/* ═══════════════════════════════════════════════════════════════
   Novis9 Bible Quest — Premium Design System
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables (Light theme) ──────────────────────────────── */
:root {
  --bg-from: #6366f1;
  --bg-to:   #0f172a;
  --card-bg: rgba(255, 255, 255, 0.97);
  --card-shadow: 0 32px 80px rgba(15, 23, 42, 0.45);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: rgba(15, 23, 42, 0.08);

  /* Form */
  --input-bg: #f8fafc;
  --input-border: #e2e8f0;
  --input-focus: #6366f1;

  /* Accent palette */
  --green:  #22c55e;
  --red:    #ef4444;
  --amber:  #f59e0b;
  --indigo: #6366f1;
  --pink:   #ec4899;
  --purple: #a855f7;
  --sky:    #0ea5e9;

  /* Option tile colours (Kahoot style) */
  --tile-a: #ef4444;      /* Red    */
  --tile-b: #3b82f6;      /* Blue   */
  --tile-c: #f59e0b;      /* Amber  */
  --tile-d: #22c55e;      /* Green  */

  --tile-correct: #16a34a;
  --tile-wrong:   #b91c1c;

  /* Radii & spacing */
  --radius-sm:  10px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-xl:  32px;
  --radius-pill:999px;

  /* Transitions */
  --ease: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Dark theme overrides ─────────────────────────────────────── */
body.dark {
  --bg-from: #020617;
  --bg-to:   #0f172a;
  --card-bg: rgba(15, 23, 42, 0.97);
  --card-shadow: 0 32px 80px rgba(0, 0, 0, 0.9);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --border: rgba(255, 255, 255, 0.06);
  --input-bg: #020617;
  --input-border: #1e293b;
  --input-focus: #818cf8;
}

/* ── Reset ────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--bg-from) 0%, var(--bg-to) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.4s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* ── Floating background bubbles ─────────────────────────────── */
.bg-bubbles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.bubble {
  position: absolute;
  border-radius: 50%;
  opacity: 0.12;
  animation: float 18s ease-in-out infinite;
}

.bubble-1 { width: 380px; height: 380px; background: var(--purple);
            top: -80px; left: -80px; animation-delay: 0s; }
.bubble-2 { width: 280px; height: 280px; background: var(--sky);
            bottom: 60px; right: -60px; animation-delay: -6s; }
.bubble-3 { width: 200px; height: 200px; background: var(--pink);
            top: 50%; left: 50%; animation-delay: -12s; }
.bubble-4 { width: 150px; height: 150px; background: var(--amber);
            bottom: 200px; left: 60px; animation-delay: -3s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33%       { transform: translateY(-30px) rotate(5deg); }
  66%       { transform: translateY(20px) rotate(-5deg); }
}

/* ── Confetti canvas ─────────────────────────────────────────── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
}

/* ── Page wrapper ────────────────────────────────────────────── */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 16px 40px;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

/* ── Navbar ──────────────────────────────────────────────────── */
.navbar {
  width: 100%;
  max-width: 820px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 12px;
  padding-top: max(18px, env(safe-area-inset-top));
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: inherit;
}
.home-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}
.home-btn:active {
  transform: scale(0.97);
}
.home-btn .ri-home-4-line {
  font-size: 1.15rem;
}

.brand-icon { font-size: 1.6rem; }

.brand-name {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #fff;
}

.brand-accent { color: #fbbf24; }

.navbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Score pill */
.score-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.score-pill-label { opacity: 0.75; }

.score-pill-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fbbf24;
}

/* Streak pill */
.streak-pill {
  background: rgba(239, 68, 68, 0.85);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
  animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.06); }
}

/* Theme button */
.theme-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s var(--ease);
  color: #fff;
}

.theme-btn:hover { background: rgba(255,255,255,0.25); transform: rotate(20deg) scale(1.05); }

/* ── Card ────────────────────────────────────────────────────── */
.card {
  width: 100%;
  max-width: 820px;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* ── Screens ─────────────────────────────────────────────────── */
.screen { padding: 32px 24px 36px; }
@media (min-width: 640px) { .screen { padding: 40px 44px 44px; } }

.screen.hidden { display: none !important; }

/* Screen-in animation */
.screen-enter {
  animation: screenIn 0.35s var(--ease) forwards;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Screen header (back + title) ────────────────────────────── */
.screen-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.screen-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
}

.screen-sub {
  font-size: 0.93rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Shared: back button ─────────────────────────────────────── */
.back-btn {
  flex-shrink: 0;
  margin-top: 4px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.back-btn:hover {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}

/* ── SCREEN 1 – Welcome ──────────────────────────────────────── */
.welcome-hero {
  text-align: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.welcome-emoji { font-size: 4rem; line-height: 1; margin-bottom: 12px; }

.welcome-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 8px;
}

.welcome-title .accent { color: var(--indigo); }

.welcome-sub {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 420px;
  margin: 0 auto;
}

/* Stats panel */
.stats-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #eff6ff, #e0f2fe);
  border: 1px solid rgba(99,102,241,0.12);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: transform 0.15s var(--ease), box-shadow 0.15s ease;
}

.stats-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.15);
}

body.dark .stats-item {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-color: rgba(255,255,255,0.06);
}

.stats-icon { font-size: 1.5rem; flex-shrink: 0; }

.stats-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.stats-value {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
}

/* Form grid */
.form-grid {
  display: grid;
  gap: 16px;
}

@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
}

.form-row { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.form-input,
.form-select {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.96rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.22);
}

/* ── CTA button ──────────────────────────────────────────────── */
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 12px 32px rgba(99,102,241,0.5);
  transition: transform 0.12s var(--ease), box-shadow 0.12s ease, filter 0.1s ease;
  text-decoration: none;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(99,102,241,0.6);
  filter: brightness(1.04);
}

.cta-btn:active { transform: translateY(0); }
.cta-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.cta-btn--next { margin-top: 0; }

.btn-arrow { font-size: 1.1rem; }

/* ── Outline button ──────────────────────────────────────────── */
.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 0;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease,
              transform 0.12s var(--ease);
}

.outline-btn:hover {
  border-color: var(--indigo);
  background: var(--indigo);
  color: #fff;
  transform: translateY(-1px);
}

/* ── SCREEN 2 – Story picker ─────────────────────────────────── */
.story-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

@media (min-width: 560px) { .story-grid { grid-template-columns: 1fr 1fr; } }

/* Story card */
.story-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15,23,42,0.1);
  transition: transform 0.12s var(--ease), box-shadow 0.12s ease, border-color 0.12s ease;
  overflow: hidden;
}

.story-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  opacity: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.08));
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.story-card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(15,23,42,0.22); }
.story-card:hover::before { opacity: 1; }

.story-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.25), 0 14px 34px rgba(15,23,42,0.2);
}

.story-card.selected::before { opacity: 1; }

.story-card-emoji { font-size: 2rem; margin-bottom: 8px; }

.story-card-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.story-card-summary {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 10px;
}

.story-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.story-card-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Selected checkmark */
.story-card-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}

.story-card.selected .story-card-check { opacity: 1; transform: scale(1); }

/* ── Count picker ─────────────────────────────────────────────── */
.count-picker {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 2px solid rgba(34,197,94,0.3);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  animation: screenIn 0.3s var(--ease);
}

body.dark .count-picker {
  background: linear-gradient(135deg, #052e16, #14532d30);
  border-color: rgba(34,197,94,0.2);
}

.count-picker-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.count-picker-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}

.count-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.count-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,0.4);
  background: rgba(34,197,94,0.12);
  color: var(--text-primary);
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, transform 0.1s var(--ease);
}

.count-btn:hover { background: var(--green); color: #fff; transform: scale(1.08); }

.count-display {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 2rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px rgba(34,197,94,0.5);
}

.count-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-align: center;
}

/* ── SCREEN 3 – Question ─────────────────────────────────────── */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.quiz-meta { display: flex; flex-direction: column; gap: 2px; }

.quiz-story-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--indigo);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quiz-progress-text {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Timer ring */
.timer-ring {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}

.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.timer-track { fill: none; stroke: var(--border); stroke-width: 4; }

.timer-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.4s ease;
}

.timer-ring.warning .timer-fill { stroke: var(--amber); }
.timer-ring.danger  .timer-fill { stroke: var(--red); animation: blink 0.5s ease-in-out infinite; }

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.4; } }

.timer-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-primary);
}

/* Progress bar */
.progress-bar-wrap { margin-bottom: 18px; }

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--indigo), var(--pink));
  width: 0%;
  transition: width 0.4s var(--ease-soft);
}

/* Question box */
.question-box {
  background: linear-gradient(135deg, #f8fafc, #eff6ff);
  border: 1px solid rgba(99,102,241,0.1);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

body.dark .question-box {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  border-color: rgba(255,255,255,0.05);
}

.question-badges { display: flex; gap: 8px; margin-bottom: 10px; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.badge-diff { background: #eef2ff; color: #4338ca; }
.badge-test { background: #fef3c7; color: #92400e; }

body.dark .badge-diff { background: rgba(67,56,202,0.3); color: #a5b4fc; }
body.dark .badge-test { background: rgba(146,64,14,0.3); color: #fcd34d; }

.question-story-title {
  font-size: 1rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.question-story-summary {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.question-text {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.3;
}

@media (min-width: 640px) { .question-text { font-size: 1.5rem; } }

/* ── Answer options (Kahoot 2×2 grid) ────────────────────────── */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 400px) { .options { grid-template-columns: 1fr; } }

/* ── Mobile-first tweaks (small screens) ──────────────────────── */
@media (max-width: 600px) {
  .page { padding-left: 12px; padding-right: 12px; }
  .navbar { padding: 14px 0 10px; }
  .navbar-left { gap: 10px; }
  .brand-name { font-size: 1.25rem; }
  .brand-icon { font-size: 1.4rem; }
  .home-btn {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.85rem;
  }
  .theme-btn { width: 42px; height: 42px; min-width: 42px; min-height: 42px; }
  .welcome-title { font-size: 1.65rem; }
  .welcome-emoji { font-size: 3.2rem; }
  .stats-panel { grid-template-columns: 1fr; gap: 10px; }
  .cta-btn, .outline-btn {
    min-height: 48px;
    padding: 14px 24px;
    width: 100%;
    max-width: 320px;
  }
  .result-controls { flex-direction: column; }
  .result-controls .cta-btn,
  .result-controls .outline-btn { max-width: 100%; }
  .screen-header { flex-wrap: wrap; gap: 12px; }
  .back-btn { min-height: 44px; padding: 10px 16px; }
}

.option-btn {
  position: relative;
  width: 100%;
  min-height: 80px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 6px 18px rgba(15,23,42,0.3);
  transform: translateY(0) scale(1);
  transition: transform 0.1s var(--ease), box-shadow 0.1s ease, filter 0.08s ease;
  overflow: hidden;
}

/* Shimmer animation on appear */
.option-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  transform: translateX(-100%);
}

.option-btn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 12px 28px rgba(15,23,42,0.38);
  filter: brightness(1.06);
}

.option-btn:active:not(:disabled) { transform: scale(0.97); }

.option-btn:disabled { cursor: default; box-shadow: none; }

/* Mobile: single-column options and larger touch targets */
@media (max-width: 480px) {
  .options { grid-template-columns: 1fr; gap: 10px; }
  .option-btn { min-height: 72px; padding: 14px 16px; }
}

/* Tile colours */
.option-a { background: linear-gradient(135deg, #ef4444, #dc2626); }
.option-b { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.option-c { background: linear-gradient(135deg, #f59e0b, #d97706); }
.option-d { background: linear-gradient(135deg, #22c55e, #16a34a); }

/* Letter badge */
.option-label {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  background: rgba(0,0,0,0.22);
  color: #fff;
}

.option-text {
  flex: 1;
  font-size: 0.97rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Correct / wrong states */
.option-correct {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  animation: bounceIn 0.35s var(--ease);
}

.option-wrong {
  background: linear-gradient(135deg, #dc2626, #991b1b) !important;
  opacity: 0.85;
}

.option-missed {
  outline: 3px solid #16a34a;
}

@keyframes bounceIn {
  0%   { transform: scale(0.92); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Tick / cross overlay */
.option-result-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1rem;
  font-weight: 900;
}

/* ── Feedback bar ─────────────────────────────────────────────── */
.feedback-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 0.97rem;
  font-weight: 700;
  animation: screenIn 0.25s var(--ease);
}

.feedback-bar.correct { background: #dcfce7; color: #15803d; }
.feedback-bar.wrong   { background: #fee2e2; color: #b91c1c; }

body.dark .feedback-bar.correct { background: rgba(21,128,61,0.2); color: #4ade80; }
body.dark .feedback-bar.wrong   { background: rgba(185,28,28,0.2); color: #fca5a5; }

.feedback-icon { font-size: 1.3rem; }

/* ── Quiz controls ────────────────────────────────────────────── */
.quiz-controls { display: flex; justify-content: flex-end; }

/* ── SCREEN 4 – Results ──────────────────────────────────────── */
.result-hero { text-align: center; margin-bottom: 24px; }

.result-emoji { font-size: 4.5rem; line-height: 1; margin-bottom: 10px; }

.result-title {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.result-player {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Score circle */
.score-circle-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 20px;
}

.score-svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.score-track { fill: none; stroke: var(--border); stroke-width: 8; }

.score-ring {
  fill: none;
  stroke: url(#score-gradient);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.2s var(--ease-soft);
}

.score-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 1px;
}

.score-number {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.score-denom {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-muted);
  align-self: flex-end;
  padding-bottom: 6px;
}

.result-encouragement {
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Result stats */
.result-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 28px;
}

@media (min-width: 480px) { .result-stats { grid-template-columns: repeat(4, 1fr); } }

.result-stat-item {
  text-align: center;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 8px;
}

.result-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-stat-value {
  display: block;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
}

.correct-color { color: var(--green) !important; }
.wrong-color   { color: var(--red) !important; }
.streak-color  { color: var(--amber) !important; }

.result-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

/* ── SCREEN 5 – Review ────────────────────────────────────────── */
.review-list { display: flex; flex-direction: column; gap: 14px; }

.review-item {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.review-item-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--input-bg);
}

.review-item-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--indigo);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 900;
  flex-shrink: 0;
}

.review-item-q {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.review-item-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }

.review-story-line {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.review-answer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.review-answer-icon { font-size: 1rem; }

.review-answer-text { color: var(--text-primary); }

.review-answer-row.correct .review-answer-text { color: var(--green); }
.review-answer-row.wrong   .review-answer-text { color: var(--red); }

.review-correct-text { color: var(--green); }

.review-ref {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  margin-top: 24px;
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  text-align: center;
  font-weight: 600;
}

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

/* ── Admin login button (navbar) ─────────────────────────────── */
.admin-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.18);
  transition: background 0.18s, color 0.18s;
  letter-spacing: 0.02em;
}
.admin-login-btn:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

/* ── Welcome actions (two CTA buttons side-by-side) ──────── */
.welcome-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 4px;
}
.welcome-actions .cta-btn {
  flex: 1;
  min-width: 170px;
  max-width: 260px;
}
.cta-btn--verse {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%) !important;
}
.cta-btn--verse:hover {
  filter: brightness(1.08);
}

/* ── Memory Verse flashcard ───────────────────────────────── */
.verse-flashcard {
  perspective: 900px;
  width: 100%;
  max-width: 480px;
  margin: 10px auto 18px;
  cursor: pointer;
}
.verse-card-inner {
  position: relative;
  width: 100%;
  min-height: 260px;
  transition: transform 0.55s cubic-bezier(.4,.2,.2,1);
  transform-style: preserve-3d;
}
.verse-card-inner.flipped {
  transform: rotateY(180deg);
}
.verse-card-front,
.verse-card-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 6px 28px rgba(0,0,0,0.12);
}
.verse-card-front {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  color: #fff;
}
.verse-card-back {
  background: var(--card-bg);
  color: var(--text-primary);
  transform: rotateY(180deg);
  border: 2px solid rgba(99,102,241,0.25);
}
.verse-ref {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.verse-card-front .verse-ref {
  font-size: 1.5rem;
}
.verse-hint-text {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 6px;
  font-weight: 600;
}
.verse-text-display {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.65;
  margin: 0 0 12px;
  padding: 0;
  border: none;
  quotes: "\201C" "\201D";
}
.verse-text-display::before { content: open-quote; }
.verse-text-display::after  { content: close-quote; }
.verse-explanation {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.5;
}
.verse-progress {
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.verse-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.verse-controls .outline-btn,
.verse-controls .cta-btn {
  min-width: 120px;
}

/* Category cards in verse picker re-use .story-card style */
.story-card .verse-cat-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════
   Animated Mascot (Lottie Lamb)
   ═══════════════════════════════════════════════════════════════ */
.mascot-wrap {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}
.mascot-bubble {
  background: var(--card-bg);
  color: var(--text-primary);
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  max-width: 200px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  opacity: 0;
  transform: translateY(8px) scale(0.9);
  transition: opacity 0.35s ease, transform 0.35s var(--ease);
  pointer-events: auto;
}
.mascot-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.mascot-lottie {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  overflow: hidden;
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.3s var(--ease);
}
.mascot-lottie:hover {
  transform: scale(1.08);
}
.mascot-lottie.hidden {
  display: none !important;
}
.mascot-emoji-fallback {
  width: 100px;
  height: 100px;
  font-size: 4.5rem;
  line-height: 100px;
  text-align: center;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 8px 28px rgba(0,0,0,0.2);
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  transition: transform 0.3s var(--ease);
}
.mascot-emoji-fallback:hover {
  transform: scale(1.1);
}
.mascot-emoji-fallback.hidden {
  display: none !important;
}

/* Post-game Cheer Overlay */
.cheer-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cheerFadeIn 0.4s var(--ease);
}
.cheer-overlay.hidden {
  display: none !important;
}
.cheer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}
.cheer-content {
  position: relative;
  background: var(--card-bg);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  animation: cheerPop 0.5s var(--ease);
}
.cheer-lottie {
  width: 180px;
  height: 180px;
  margin: 0 auto 16px;
}
.cheer-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 20px;
  line-height: 1.4;
}
.cheer-dismiss {
  margin-top: 0;
}
@keyframes cheerFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes cheerPop {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 600px) {
  .mascot-wrap { bottom: 12px; right: 12px; }
  .mascot-lottie { width: 110px; height: 110px; }
  .mascot-emoji-fallback { width: 80px; height: 80px; font-size: 3.5rem; line-height: 80px; }
  .mascot-bubble { font-size: 0.76rem; max-width: 180px; padding: 8px 12px; }
  .cheer-lottie { width: 150px; height: 150px; }
}

/* ═══════════════════════════════════════════════════════════════
   Story Reading Screen
   ═══════════════════════════════════════════════════════════════ */
.story-reading-content {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  margin-bottom: 20px;
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text-primary);
  font-weight: 600;
}
.story-reading-content p {
  margin-bottom: 0.85em;
  font-size: calc(1em * var(--reading-font-scale, 1));
}
.reading-figure {
  margin: 0 0 1em;
  text-align: center;
}
.reading-figure img {
  width: 100%;
  max-width: 100%;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(15,23,42,0.25);
  object-fit: cover;
  aspect-ratio: 16 / 9;
}
.reading-figure figcaption {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}
body.dark .story-reading-content {
  background: linear-gradient(135deg, #1c1917, #292524);
  border-color: rgba(245,158,11,0.15);
}
.story-reading-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.story-reading-emoji {
  font-size: 3rem;
  line-height: 1;
}
.story-reading-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--text-primary);
}
.story-reading-testament {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 700;
}
.story-reading-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.reading-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.reading-font-controls {
  display: flex;
  gap: 6px;
}
.reading-font-btn {
  min-width: 34px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.8);
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.reading-font-btn:hover {
  background: #eef2ff;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(15,23,42,0.15);
}
.reading-page-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
}
.reading-page-dots {
  display: flex;
  gap: 4px;
}
.reading-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(15,23,42,0.15);
}
.reading-dot.active {
  width: 14px;
  background: var(--indigo);
}

.reading-page-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.reading-page-btn {
  flex: 1;
  font-size: 0.88rem;
}
.reading-page-btn[disabled] {
  opacity: 0.45;
  cursor: default;
}

/* "Read Story" link on story cards */
.story-card-read {
  position: relative;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--indigo);
  text-decoration: none;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(99,102,241,0.3);
  transition: background 0.15s, color 0.15s;
}
.story-card-read:hover {
  background: var(--indigo);
  color: #fff;
}

/* "Play Quiz" pill button on story cards */
.story-card-play {
  position: relative;
  z-index: 2;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  border: none;
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 6px 16px rgba(99,102,241,0.35);
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
}
.story-card-play::before {
  content: "▶";
  font-size: 0.7rem;
}
.story-card-play:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 10px 22px rgba(79,70,229,0.5);
}
.story-card-play:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(79,70,229,0.4);
}

/* ═══════════════════════════════════════════════════════════════
   Explanation Mode (shown on wrong answer)
   ═══════════════════════════════════════════════════════════════ */
.feedback-explanation {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(99,102,241,0.08);
  border-left: 3px solid var(--indigo);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.55;
  animation: screenIn 0.3s var(--ease);
}
body.dark .feedback-explanation {
  background: rgba(99,102,241,0.12);
}
.feedback-explanation .expl-icon {
  font-weight: 800;
  color: var(--indigo);
}
.feedback-explanation .expl-ref {
  display: block;
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}
