/* ═══════════════════════════════════════════════════
   StoryWeaver — Styles v0.5
   80s Choose Your Own Adventure book aesthetic
   ═══════════════════════════════════════════════════ */

:root {
  --bg-dark: #1a1209;
  --bg-page: #f4e8c1;
  --bg-page-dark: #e8d5a3;
  --bg-card: #2a1f0e;
  --bg-surface: #3d2e15;
  --bg-hover: #4d3a1f;
  --accent: #c62828;
  --accent-light: #ef5350;
  --accent-dim: #8b1a1a;
  --gold: #d4a843;
  --gold-light: #f0d080;
  --gold-dim: #8a7030;
  --text-dark: #2c1810;
  --text-light: #f4e8c1;
  --text-dim: #9a8a6a;
  --text-muted: #6a5a3a;
  --green: #2e7d32;
  --blue: #1565c0;
  --red: #c62828;
  --orange: #e65100;
  --purple: #6a1b9a;
  --font-title: 'Special Elite', 'Courier New', monospace;
  --font-story: 'Merriweather', Georgia, serif;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-horror: 'Creepster', cursive;
  --radius: 4px;
  --transition: 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg-dark);
  color: var(--text-dark);
  font-family: var(--font-ui);
  line-height: 1.6;
}

/* ─── Book Border Frame ───────────────────────────── */
.book-border {
  background: var(--bg-page);
  border: 3px solid var(--accent);
  box-shadow:
    inset 0 0 30px rgba(0,0,0,0.1),
    8px 8px 0 rgba(0,0,0,0.4),
    0 0 60px rgba(0,0,0,0.5);
  position: relative;
}
.book-border::before {
  content: '';
  position: absolute;
  top: 6px; left: 6px; right: 6px; bottom: 6px;
  border: 1px solid var(--accent-dim);
  pointer-events: none;
  opacity: 0.4;
}

/* ─── Screens ─────────────────────────────────────── */
.screen {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s ease;
}
.screen.active { opacity: 1; pointer-events: all; }

/* ─── Title / Story Select Screen ─────────────────── */
.title-container {
  text-align: center; padding: 40px 30px;
  max-width: 900px; width: 90vw; max-height: 90vh; overflow-y: auto;
}
.retro-badge {
  display: inline-block; background: var(--accent); color: white;
  font-family: var(--font-title); font-size: 0.75rem;
  letter-spacing: 0.25em; padding: 4px 16px; margin-bottom: 12px;
  text-transform: uppercase;
}
.title {
  font-family: var(--font-title); font-size: 3.5rem; font-weight: 900;
  color: var(--text-dark); text-shadow: 3px 3px 0 rgba(0,0,0,0.15);
  letter-spacing: 0.08em; margin-bottom: 4px; line-height: 1.1;
}
.title-accent { color: var(--accent); }
.subtitle {
  font-family: var(--font-title); font-size: 1.2rem; color: var(--text-dark);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px;
}
.tagline {
  font-family: var(--font-story); font-style: italic;
  color: var(--text-muted); font-size: 0.95rem; margin-bottom: 30px;
}

/* ─── Story Cards ─────────────────────────────────── */
.story-cards {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 16px; margin-bottom: 24px;
}
.story-card {
  background: var(--bg-card); border: 2px solid transparent;
  color: var(--text-light); padding: 20px 16px; cursor: pointer;
  text-align: left; transition: all var(--transition);
  position: relative; overflow: hidden;
}
.story-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
}
.story-card.genre-fantasy::before { background: var(--gold); }
.story-card.genre-survival::before { background: var(--blue); }
.story-card.genre-horror::before { background: var(--accent); }
.story-card:hover {
  transform: translateY(-4px); border-color: var(--gold);
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}
.story-card-genre {
  font-family: var(--font-title); font-size: 0.65rem;
  letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 8px; opacity: 0.7;
}
.genre-fantasy .story-card-genre { color: var(--gold); }
.genre-survival .story-card-genre { color: #64b5f6; }
.genre-horror .story-card-genre { color: var(--accent-light); }
.story-card-title {
  font-family: var(--font-story); font-size: 1.15rem;
  font-weight: 700; margin-bottom: 8px; line-height: 1.3;
}
.story-card-desc {
  font-size: 0.8rem; line-height: 1.5; opacity: 0.8; margin-bottom: 12px;
}
.story-card-prompt {
  font-family: var(--font-title); font-size: 0.7rem;
  letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.5; text-align: right;
}
.warning-text {
  font-family: var(--font-title); font-size: 0.75rem;
  color: var(--accent); letter-spacing: 0.05em;
}
.title-footer {
  border-top: 1px solid var(--text-muted); padding-top: 16px; margin-top: 8px;
}

/* ─── Buttons ─────────────────────────────────────── */
.btn {
  font-family: var(--font-ui); font-size: 0.95rem; font-weight: 500;
  padding: 12px 28px; border: none; border-radius: var(--radius);
  cursor: pointer; transition: all var(--transition); letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--accent); color: white;
  font-family: var(--font-title); letter-spacing: 0.08em;
}
.btn-primary:hover {
  background: var(--accent-light); transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(198,40,40,0.3);
}
.btn-glow { box-shadow: 0 0 15px rgba(198,40,40,0.2); }
.btn-secondary {
  background: var(--bg-surface); color: var(--text-light);
  border: 1px solid var(--text-muted);
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--gold-dim); }
.btn-icon {
  background: none; border: 1px solid var(--text-muted);
  color: var(--text-light); padding: 6px 12px; font-size: 1.2rem;
  border-radius: var(--radius); cursor: pointer;
}
.btn-icon:hover { border-color: var(--gold); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-back {
  background: none; border: none; color: var(--text-muted);
  font-family: var(--font-title); font-size: 0.85rem;
  cursor: pointer; padding: 4px 8px; margin-bottom: 8px;
}
.btn-back:hover { color: var(--accent); }

/* ─── Setup Screen ────────────────────────────────── */
.setup-container {
  max-width: 700px; width: 90vw; max-height: 90vh;
  overflow-y: auto; padding: 30px 40px;
  scrollbar-width: thin; scrollbar-color: var(--accent-dim) transparent;
}
.setup-container h2 {
  font-family: var(--font-title); font-size: 1.8rem;
  color: var(--accent); text-align: center; margin-bottom: 4px; letter-spacing: 0.05em;
}
.setup-intro {
  text-align: center; color: var(--text-muted); margin-bottom: 24px;
  font-family: var(--font-story); font-style: italic;
}
.setup-section { margin-bottom: 20px; }
.setup-section label {
  display: block; font-family: var(--font-title); font-size: 0.8rem;
  color: var(--accent); text-transform: uppercase;
  letter-spacing: 0.12em; margin-bottom: 8px;
}
.option-list { display: flex; flex-direction: column; gap: 6px; }
.option-btn {
  background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.12);
  color: var(--text-dark); padding: 10px 14px; border-radius: var(--radius);
  cursor: pointer; text-align: left; font-family: var(--font-story);
  font-size: 0.85rem; transition: all var(--transition); line-height: 1.4;
}
.option-btn:hover { background: rgba(198,40,40,0.06); border-color: var(--accent); }
.option-btn.selected {
  background: rgba(198,40,40,0.1); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}
.setup-actions {
  display: flex; gap: 16px; justify-content: center;
  margin-top: 24px; padding-bottom: 16px;
}

/* ─── Story Screen ────────────────────────────────── */
.story-container {
  width: 100%; height: 100%; display: flex;
  flex-direction: column; background: var(--bg-dark);
}
.story-status {
  display: flex; align-items: center; gap: 20px;
  padding: 10px 20px; background: var(--bg-card);
  border-bottom: 2px solid var(--accent-dim); font-family: var(--font-title);
}
.status-item { display: flex; align-items: center; gap: 6px; }
.status-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.status-label {
  font-size: 0.65rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
}
.status-value { font-size: 0.9rem; color: var(--gold); font-weight: 600; }
.tension-bar {
  width: 80px; height: 6px; background: var(--bg-dark);
  border-radius: 3px; overflow: hidden;
}
.tension-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--orange), var(--red));
  border-radius: 3px; transition: width 1s ease;
}

/* Narrative Area */
.narrative-area {
  flex: 1; overflow-y: auto; padding: 36px 50px;
  background: linear-gradient(to bottom, rgba(244,232,193,0.03) 0%, rgba(244,232,193,0.08) 50%, rgba(244,232,193,0.03) 100%), var(--bg-dark);
  scrollbar-width: thin; scrollbar-color: var(--accent-dim) transparent;
}
.narrative-text {
  font-family: var(--font-story); font-size: 1.2rem;
  line-height: 1.9; color: var(--text-light); max-width: 680px; margin: 0 auto;
}
.narrative-text p {
  margin-bottom: 1.2em; opacity: 0;
  animation: fade-in-up 0.8s ease forwards; text-indent: 1.5em;
}
.narrative-text p:first-child { text-indent: 0; }
.narrative-text p:nth-child(1) { animation-delay: 0s; }
.narrative-text p:nth-child(2) { animation-delay: 0.15s; }
.narrative-text p:nth-child(3) { animation-delay: 0.3s; }
.narrative-text p:nth-child(4) { animation-delay: 0.45s; }
.narrative-text p:nth-child(5) { animation-delay: 0.6s; }
.narrative-text p:nth-child(6) { animation-delay: 0.75s; }
.narrative-text p:nth-child(7) { animation-delay: 0.9s; }
.narrative-text p:nth-child(8) { animation-delay: 1.05s; }

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.segment-divider {
  text-align: center; padding: 24px 0; color: var(--accent-dim);
  font-family: var(--font-title); font-size: 0.8rem;
  letter-spacing: 0.5em; opacity: 0.5;
}
.page-number {
  text-align: center; font-family: var(--font-title);
  font-size: 0.75rem; color: var(--text-muted);
  padding: 8px 0 20px; letter-spacing: 0.1em;
}

/* ─── RESPONSE AREA ───────────────────────────────── */
.response-area {
  padding: 14px 20px 18px; background: var(--bg-card);
  border-top: 2px solid var(--accent-dim);
}
.response-area.pulse { animation: pulse-border 2s ease; }
@keyframes pulse-border {
  0% { border-top-color: var(--accent-dim); }
  30% { border-top-color: var(--accent); }
  100% { border-top-color: var(--accent-dim); }
}
.suggestions-label {
  font-family: var(--font-title); font-size: 0.7rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.15em; margin-bottom: 8px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.suggestions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.suggestion-btn {
  background: rgba(244,232,193,0.08); border: 1px solid var(--accent-dim);
  color: var(--text-light); padding: 10px 18px; border-radius: var(--radius);
  cursor: pointer; font-family: var(--font-story); font-size: 0.85rem;
  transition: all var(--transition); line-height: 1.3; max-width: 100%; text-align: left;
}
.suggestion-btn::before { content: '▸ '; color: var(--accent); font-weight: bold; }
.suggestion-btn:hover {
  background: rgba(198,40,40,0.15); border-color: var(--accent);
  color: white; transform: translateY(-1px);
}

.free-input-bar {
  display: flex; gap: 8px; align-items: center;
  max-width: 680px; margin: 0 auto;
}
.free-input-bar input {
  flex: 1; background: rgba(0,0,0,0.3); border: 1px solid var(--text-muted);
  color: var(--text-light); padding: 12px 16px; border-radius: var(--radius);
  font-family: var(--font-story); font-size: 0.95rem;
  outline: none; transition: border-color var(--transition);
}
.free-input-bar input:focus {
  border-color: var(--accent); box-shadow: 0 0 8px rgba(198,40,40,0.2);
}
.free-input-bar input::placeholder { color: var(--text-muted); }

.btn-send {
  background: var(--accent); color: white; border: none;
  width: 44px; height: 44px; border-radius: var(--radius);
  font-size: 1.1rem; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all var(--transition);
  padding: 0; flex-shrink: 0;
}
.btn-send:hover { background: var(--accent-light); transform: scale(1.05); }

.btn-voice {
  background: none; border: 1px solid var(--text-muted);
  color: var(--text-light); width: 44px; height: 44px;
  border-radius: var(--radius); font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all var(--transition); padding: 0; flex-shrink: 0;
}
.btn-voice:hover { border-color: var(--accent); }
.btn-voice.listening {
  border-color: var(--red); background: rgba(198,40,40,0.15);
  animation: listening-pulse 1.5s ease-in-out infinite;
}
@keyframes listening-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(198,40,40,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(198,40,40,0); }
}

.input-hint {
  text-align: center; font-family: var(--font-title);
  font-size: 0.65rem; color: var(--text-muted);
  margin-top: 6px; letter-spacing: 0.05em;
}

/* ─── Speed Control ───────────────────────────────── */
.speed-control { display: flex; align-items: center; gap: 4px; margin-right: 6px; }
.speed-label {
  font-size: 0.6rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-right: 2px;
}
.speed-value {
  font-size: 0.8rem; color: var(--gold); font-weight: 600;
  min-width: 32px; text-align: center;
}
.btn-speed {
  background: var(--bg-surface); border: 1px solid var(--text-muted);
  color: var(--text-light); width: 26px; height: 26px;
  border-radius: var(--radius); font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; transition: all var(--transition); line-height: 1;
}
.btn-speed:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Decision Timer ──────────────────────────────── */
.timer-bar {
  position: relative; height: 6px; background: rgba(0,0,0,0.3);
  border-radius: 3px; overflow: visible; margin-bottom: 12px;
  max-width: 680px; margin-left: auto; margin-right: auto;
}
.timer-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--green));
  border-radius: 3px; transition: width 1s linear;
}
.timer-text {
  position: absolute; right: 0; top: -18px;
  font-family: var(--font-title); font-size: 0.7rem;
  color: var(--accent); font-weight: 600;
}
.timer-bar.urgent .timer-fill {
  background: var(--red);
  animation: timer-flash 0.5s ease-in-out infinite;
}
.timer-bar.paused .timer-fill { opacity: 0.4; }
.timer-bar.paused .timer-text::after { content: ' PAUSED'; }
@keyframes timer-flash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Chapter History Modal ───────────────────────── */
.modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200; display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
}
.modal-content {
  position: relative; max-width: 600px; width: 90vw;
  max-height: 80vh; display: flex; flex-direction: column; z-index: 1;
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,0.1);
}
.modal-header h3 {
  font-family: var(--font-title); font-size: 1.2rem; color: var(--accent);
}
.modal-header .btn-icon { color: var(--text-dark); border-color: rgba(0,0,0,0.2); }
.modal-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.modal-footer {
  padding: 12px 20px; border-top: 1px solid rgba(0,0,0,0.1);
}
.rewind-hint {
  font-family: var(--font-story); font-style: italic;
  font-size: 0.8rem; color: var(--text-muted); text-align: center;
}
.chapter-entry {
  padding: 10px 0; border-bottom: 1px dashed rgba(0,0,0,0.1);
}
.chapter-entry:last-child { border-bottom: none; }
.chapter-entry-header {
  font-family: var(--font-title); font-size: 0.75rem; color: var(--accent);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px;
}
.chapter-entry-text {
  font-family: var(--font-story); font-size: 0.85rem; color: var(--text-dark);
  line-height: 1.5; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.chapter-choice-btn {
  display: inline-block; background: rgba(198,40,40,0.08);
  border: 1px solid var(--accent-dim); color: var(--accent);
  padding: 4px 12px; border-radius: var(--radius); cursor: pointer;
  font-family: var(--font-title); font-size: 0.72rem;
  letter-spacing: 0.05em; transition: all var(--transition);
}
.chapter-choice-btn:hover { background: var(--accent); color: white; }
.chapter-choice-label {
  font-family: var(--font-story); font-style: italic;
  font-size: 0.78rem; color: var(--text-muted); margin-bottom: 4px;
}

/* ─── Death Screen ────────────────────────────────── */
#screen-death .book-border {
  max-width: 500px; width: 90vw;
}
.death-border { border-color: #4a0000 !important; background: #1a0a0a !important; }
.death-border::before { border-color: #3a0000 !important; }
.death-container {
  text-align: center; padding: 40px 30px; color: var(--text-light);
}
.death-icon {
  font-size: 4rem; margin-bottom: 12px;
  animation: death-pulse 2s ease-in-out infinite;
}
@keyframes death-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}
.death-title {
  font-family: var(--font-title); font-size: 2rem; color: var(--accent);
  letter-spacing: 0.15em; margin-bottom: 12px;
}
.death-text {
  font-family: var(--font-story); font-style: italic; font-size: 1rem;
  color: #aa8888; margin-bottom: 20px; line-height: 1.6;
}
.death-page {
  font-family: var(--font-title); font-size: 0.9rem; color: var(--accent-dim);
  letter-spacing: 0.3em; margin-bottom: 24px; opacity: 0.6;
}
.death-actions {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.death-actions .btn { min-width: 240px; }

/* ─── Loading Overlay ─────────────────────────────── */
.loading-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(10,8,4,0.85); display: flex;
  align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(4px);
}
.loading-content { text-align: center; }
.loading-spinner {
  width: 36px; height: 36px; margin: 0 auto 14px;
  border: 3px solid var(--bg-surface); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-content p {
  font-family: var(--font-story); font-style: italic;
  color: var(--text-dim); font-size: 1rem;
}

/* ─── Utilities ───────────────────────────────────── */
.hidden { display: none !important; }

/* ─── Text Highlighting (follows audio) ───────────── */
.word { transition: color 0.2s ease; }
.word-spoken { color: var(--text-dim); }
.word-active { color: var(--gold-light); text-shadow: 0 0 8px rgba(240,208,128,0.3); }

/* ─── Narration Loading Indicator ─────────────────── */
.narration-loading {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 12px; margin-top: 16px;
  font-family: var(--font-story); font-style: italic;
  color: var(--text-dim); font-size: 0.85rem;
}
.narration-loading-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--bg-surface); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 1s linear infinite;
}

/* ─── Timer Toggle ────────────────────────────────── */
.btn-icon.timer-off { opacity: 0.4; text-decoration: line-through; }

/* ─── Patience Disclaimer ─────────────────────────── */
.patience-text {
  font-family: var(--font-story); font-size: 0.8rem;
  color: var(--text-muted); font-style: italic;
  margin-top: 8px;
}

/* ─── Story Complete Screen ───────────────────────── */
#screen-complete .book-border {
  max-width: 500px; width: 90vw;
}
.complete-border { border-color: var(--gold-dim) !important; background: var(--bg-page) !important; }
.complete-border::before { border-color: var(--gold-dim) !important; }
.complete-container {
  text-align: center; padding: 40px 30px; color: var(--text-dark);
}
.complete-icon {
  font-size: 4rem; margin-bottom: 12px;
  animation: complete-glow 3s ease-in-out infinite;
}
@keyframes complete-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; transform: scale(1.05); }
}
.complete-title {
  font-family: var(--font-title); font-size: 2rem; color: var(--gold-dim);
  letter-spacing: 0.2em; margin-bottom: 16px;
}
.complete-text {
  font-family: var(--font-story); font-style: italic; font-size: 1rem;
  color: var(--text-muted); margin-bottom: 16px; line-height: 1.6;
}
.complete-stats {
  font-family: var(--font-title); font-size: 0.8rem;
  color: var(--text-muted); letter-spacing: 0.05em; margin-bottom: 24px;
}
.complete-stat-sep { margin: 0 8px; opacity: 0.4; }
.complete-actions {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.complete-actions .btn { min-width: 240px; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 3px; }

/* ─── Mobile ──────────────────────────────────────── */
@media (max-width: 768px) {
  .title { font-size: 2.4rem; }
  .story-cards { grid-template-columns: 1fr; gap: 12px; }
  .narrative-area { padding: 20px 18px; }
  .narrative-text { font-size: 1.05rem; }
  .response-area { padding: 10px 14px 14px; }
  .setup-container { padding: 20px; }
  .story-status { gap: 10px; padding: 8px 14px; font-size: 0.8rem; }
  .title-container { padding: 24px 16px; }
}

/* ═══ Narration Upsell Modal ═══ */

.upsell-body {
  text-align: center;
  padding: 10px 0;
}
.upsell-body p {
  color: var(--text-dark);
  margin: 8px 0;
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  line-height: 1.6;
}
.upsell-option {
  background: var(--bg-page-dark);
  border: 2px solid var(--gold-dim);
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
}
.upsell-option h4 {
  color: var(--text-dark);
  margin: 0 0 8px;
  font-family: 'Special Elite', cursive;
  font-size: 1.1rem;
}
.upsell-hint {
  font-size: 0.85rem !important;
  color: var(--text-dark);
  opacity: 0.7;
}
.upsell-hint a {
  color: var(--accent);
  text-decoration: underline;
}
.upsell-key-input {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.tts-key-input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--gold-dim);
  border-radius: 6px;
  background: var(--bg-page);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}
.tts-key-input:focus {
  outline: none;
  border-color: var(--gold);
}
.upsell-divider {
  color: var(--text-dark);
  opacity: 0.5;
  margin: 16px 0;
  font-family: 'Special Elite', cursive;
  font-size: 0.9rem;
}
.btn-full {
  width: 100%;
  justify-content: center;
}

/* ═══ Ending Continue Button ═══ */

.btn-ending-continue {
  display: block;
  margin: 24px auto 16px;
  padding: 14px 40px;
  background: var(--accent);
  color: var(--text-light);
  border: 2px solid var(--accent-light);
  border-radius: 8px;
  font-family: 'Special Elite', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: pulse-glow 2s ease-in-out infinite;
}
.btn-ending-continue:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(198, 40, 40, 0.4); }
  50% { box-shadow: 0 0 20px rgba(198, 40, 40, 0.8); }
}
