/* Self-hosted Baloo 2 (variable, latin) — removes render-blocking Google
   Fonts round-trips from the LCP path. Indic scripts fall back to system fonts. */
@font-face {
  font-family: "Baloo 2";
  font-style: normal;
  font-weight: 500 800;
  font-display: swap;
  src: url("../fonts/baloo2-var.woff2") format("woff2");
}
:root {
  --card-bg: #ffffff;
  --accent: #ff5e7e;
  --accent-dark: #e8456a;
  --correct: #3ecf6e;
  --wrong: #ff5252;
  --text: #2d2d2d;
  --radius: 20px;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
html, body { margin: 0; min-height: 100vh; overflow-x: hidden; }

body {
  font-family: "Baloo 2", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(-45deg, #ff9a8b, #ffd66b, #8bf5b4, #6bd9ff, #a78bff, #ff8bdc);
  background-size: 400% 400%;
  animation: gradientShift 14s ease infinite;
}

@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── background decorations ── */
.bg-shapes { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-shape {
  position: absolute; font-size: 2.6rem; opacity: 0.5;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
  animation: drift linear infinite;
}
.s1 { top: 8%;  left: 5%;  font-size: 2rem;   animation-duration: 16s; }
.s2 { top: 60%; left: 85%; font-size: 3.2rem; animation-duration: 22s; }
.s3 { top: 15%; left: 78%; font-size: 3.6rem; animation-duration: 26s; }
.s4 { top: 75%; left: 12%; font-size: 2.2rem; animation-duration: 18s; }
.s5 { top: 40%; left: 92%; font-size: 2.4rem; animation-duration: 20s; }
.s6 { top: 85%; left: 60%; font-size: 3rem;   animation-duration: 24s; }
@keyframes drift {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-30px) rotate(8deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* ── header ── */
.topbar {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: white;
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}
.topbar-brand {
  font-size: 1.4rem; margin: 0; font-weight: 800;
  color: white; background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; white-space: nowrap;
  text-shadow: 0 2px 0 rgba(0,0,0,0.15);
  animation: wobble 4s ease-in-out infinite;
  transition: opacity 0.15s;
}
.topbar-brand:hover { opacity: 0.85; }
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-2deg); }
  75% { transform: rotate(2deg); }
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.streak-display {
  font-weight: 700; font-size: 1.2rem;
  background: rgba(255,255,255,0.3); padding: 6px 14px;
  border-radius: 999px; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}
.streak-display.hidden { display: none; }
.sound-toggle {
  font-family: inherit; font-size: 1.15rem; line-height: 1;
  background: rgba(255,255,255,0.3); border: none; cursor: pointer;
  border-radius: 999px; padding: 7px 11px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
  transition: transform 0.15s;
}
.sound-toggle:hover { transform: scale(1.08); }
.topbar-signin {
  font-family: inherit; font-size: 0.92rem; font-weight: 700;
  background: rgba(255,255,255,0.92); color: #7c3aed;
  border: none; border-radius: 999px; padding: 7px 16px; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.topbar-signin:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.18); }
.topbar-signin.hidden { display: none; }
#lang-switcher {
  font-family: inherit; font-size: 1rem; padding: 7px 12px;
  border-radius: 12px; border: none; font-weight: 700; cursor: pointer;
}

/* Mobile topbar — placed after the base rules so these overrides win the cascade */
@media (max-width: 420px) {
  .topbar { padding: 12px 12px; }
  .topbar-right { gap: 6px; }
  .topbar-brand { font-size: 1.15rem; }
  .streak-display { font-size: 1rem; padding: 5px 9px; }
  .sound-toggle { padding: 6px 9px; font-size: 1.05rem; }
  .topbar-signin { padding: 6px 11px; font-size: 0.85rem; }
  #lang-switcher { font-size: 0.9rem; padding: 6px 7px; }
}

/* ── layout ── */
.screen { position: relative; z-index: 1; padding: 24px 20px 40px; max-width: 720px; margin: 0 auto; }
.screen.hidden { display: none; }
.screen-title {
  text-align: center; font-size: 1.5rem; font-weight: 800;
  color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  margin: 8px 0 22px;
}

/* ── mascot ── */
.mascot {
  font-size: 4.5rem; text-align: center; margin-bottom: 4px;
  animation: mascotBob 2.4s ease-in-out infinite;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.18));
}
.mascot-small { font-size: 2.4rem; margin-bottom: 6px; }
@keyframes mascotBob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50%       { transform: translateY(-10px) rotate(3deg); }
}
.mascot.celebrate { animation: mascotCelebrate 0.6s ease; }
@keyframes mascotCelebrate {
  0%   { transform: scale(1) rotate(0); }
  30%  { transform: scale(1.3) rotate(-12deg); }
  60%  { transform: scale(1.3) rotate(12deg); }
  100% { transform: scale(1) rotate(0); }
}
.mascot.oops { animation: mascotOops 0.5s ease; }
@keyframes mascotOops {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-6px) rotate(-6deg); }
  75% { transform: translateX(6px) rotate(6deg); }
}

/* ── WELCOME BANNER ── */
.welcome-banner {
  padding: 4px 0 12px; margin-bottom: 4px;
}
.time-greeting { font-size: 0.82rem; font-weight: 600; color: rgba(255,255,255,0.75); margin: 0 0 2px; }
.welcome-name  { font-size: 1.4rem; font-weight: 900; color: #fff; margin: 0 0 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15); }

/* home stats chips */
.home-stats {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.home-stat-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.22); border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 6px 14px;
  backdrop-filter: blur(4px);
}
.home-stat-icon  { font-size: 1rem; }
/* the streak chip is a real button (tap to share) — keep it looking like a chip */
button.home-stat-share {
  font-family: inherit; font-size: inherit; color: inherit; cursor: pointer;
  transition: transform 0.15s;
}
button.home-stat-share:hover { transform: scale(1.05); background: rgba(255,255,255,0.3); }
.home-stat-value { font-size: 1rem; font-weight: 900; color: #fff; }
.home-stat-label { font-size: 0.72rem; font-weight: 700; color: rgba(255,255,255,0.75); }

/* ── CONTINUE BAR ── */
.continue-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.18); border-radius: 16px;
  padding: 10px 16px; margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.35);
}
.continue-label { font-size: 0.8rem; font-weight: 800; color: rgba(255,255,255,0.75); white-space: nowrap; }
.continue-btn {
  flex: 1; font-family: inherit; font-size: 0.95rem; font-weight: 800;
  padding: 9px 16px; border: none; border-radius: 12px;
  background: rgba(255,255,255,0.9); color: var(--text); cursor: pointer;
  text-align: left; transition: background 0.15s;
}
.continue-btn:hover { background: #fff; }

/* ── PICK TITLE ── */
.pick-title { font-size: 1.1rem; margin: 4px 0 16px; opacity: 0.9; }

/* ── CLASS GRID ── */
.class-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.class-btn {
  font-family: inherit; font-weight: 800; border: none; border-radius: 22px;
  padding: 20px 8px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer;
  box-shadow: 0 6px 0 rgba(0,0,0,0.15), 0 8px 20px rgba(0,0,0,0.12);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  position: relative; overflow: hidden;
}
.class-btn::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.22), transparent 60%);
  pointer-events: none;
}
.class-btn:hover  { transform: translateY(-5px) scale(1.03); box-shadow: 0 10px 0 rgba(0,0,0,0.15), 0 14px 28px rgba(0,0,0,0.18); }
.class-btn:hover .class-emoji { transform: scale(1.15) rotate(-6deg); }
.class-btn:active { transform: translateY(3px) scale(0.96); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }
.class-emoji {
  font-size: 2.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  width: 58px; height: 58px;
  background: rgba(255,255,255,0.28);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}
.class-num   { font-size: 2rem; line-height: 1; font-weight: 900; }
.class-label { font-size: 0.6rem; opacity: 0.7; letter-spacing: 0.5px; text-transform: uppercase; font-weight: 800; }

/* group colours */
.group-primary-low { background: linear-gradient(145deg, #ffe0a0, #ffb347); color: #5a2d00; }
.group-primary     { background: linear-gradient(145deg, #ffd27f, #ff8c42); color: #5a2d00; }
.group-middle      { background: linear-gradient(145deg, #9bedff, #42b8f5); color: #003a55; }
.group-secondary   { background: linear-gradient(145deg, #d8b4ff, #a855f7); color: #2e004a; }
.group-senior      { background: linear-gradient(145deg, #ffb3b3, #ef4444); color: #4a0000; }

/* ── SUBJECT PICKER ── */
.picker-toprow {
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.back-btn {
  font-size: 1.5rem; border: none; background: var(--card-bg);
  border-radius: 50%; width: 46px; height: 46px; cursor: pointer; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18); transition: transform 0.12s ease;
}
.back-btn:active { transform: scale(0.9); }
.class-badge {
  font-size: 1rem; font-weight: 800; background: rgba(255,255,255,0.85);
  padding: 6px 16px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* curriculum tabs */
.curriculum-tabs {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 20px;
}
.curr-tab {
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  padding: 8px 18px; border-radius: 999px; border: 2px solid rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.35); color: var(--text); cursor: pointer;
  transition: all 0.15s ease;
}
.curr-tab.active {
  background: var(--card-bg); border-color: var(--card-bg);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}
.curriculum-note {
  text-align: center; font-size: 0.78rem; font-weight: 600;
  color: rgba(255,255,255,0.85); margin: -10px 0 16px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.region-label {
  text-align: center; margin: 0 0 18px;
  font-size: 0.9rem; font-weight: 700; color: rgba(255,255,255,0.92);
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.region-label.hidden { display: none; }

/* ── NEET / JEE / UPSC tiles + in-app revision player ── */
.exam-section { max-width: 720px; margin: 32px auto 0; text-align: center; border-top: 1px solid rgba(255,255,255,0.4); padding-top: 22px; }
.exam-section-title { margin: 0; }
.exam-section-sub { color: rgba(255,255,255,0.9); font-size: 0.85rem; font-weight: 600; margin: 4px 0 0; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.exam-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 720px; margin: 14px auto 0; }
.board-grid { grid-template-columns: repeat(2, 1fr); max-width: 380px; }
.exam-btn.board-btn { background: linear-gradient(135deg, #0ea5e9, #0891b2) !important; box-shadow: 0 4px 14px rgba(14,165,233,0.35); }
/* board-exam entry inside the class 10/12 subject picker */
.subject-btn.board-subject-btn { background: linear-gradient(135deg, #0ea5e9, #0891b2); color: #fff; }
.board-btn .class-num { font-size: 0.92rem; line-height: 1.15; }
.exam-btn { background: linear-gradient(135deg, #7c3aed, #a855f7) !important; color: #fff !important; box-shadow: 0 4px 14px rgba(124,58,237,0.35); }
.exam-btn .class-num { font-size: 1.15rem; letter-spacing: 0.5px; }
.exam-btn .class-label { opacity: 0.92; }
#exam-body { max-width: 640px; margin: 0 auto; }
.exam-note { background: rgba(255,255,255,0.92); color: #7c3aed; font-weight: 700; font-size: 0.82rem; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
.exam-modes { display: grid; gap: 10px; margin: 8px 0 20px; }
.mode-btn { font-family: inherit; font-weight: 700; font-size: 1rem; text-align: left; background: #fff; color: var(--text); border: none; border-radius: 14px; padding: 15px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; box-shadow: 0 3px 10px rgba(0,0,0,0.08); }
.mode-btn.primary { background: linear-gradient(135deg,#7c3aed,#a855f7); color: #fff; }
.ex-badge { background: #fee2e2; color: #b91c1c; border-radius: 999px; padding: 2px 9px; font-size: 0.8rem; font-weight: 800; }
.ex-muted { color: #6b7280; font-size: 0.85rem; }
#exam-score { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.exam-hy-title { color: #fff; font-size: 1rem; margin: 6px 0 8px; text-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.exam-hy-row { display: flex; justify-content: space-between; color: #fff; font-size: 0.85rem; padding: 5px 2px 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.exam-hy-bar { height: 6px; background: rgba(255,255,255,0.85); border-radius: 3px; margin-bottom: 6px; }
.exam-qmeta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.exam-qmeta .tag { background: rgba(255,255,255,0.92); color: #475569; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.exam-prompt { background: #fff; border-radius: 16px; padding: 20px; font-size: 1.15rem; font-weight: 700; line-height: 1.5; margin-bottom: 14px; box-shadow: 0 3px 12px rgba(0,0,0,0.08); }
.exam-choice { display: block; width: 100%; text-align: left; font-family: inherit; font-size: 1rem; padding: 14px 16px; margin-bottom: 10px; border: 2px solid transparent; border-radius: 14px; background: #fff; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: border-color .15s; }
.exam-choice:hover:not(:disabled) { border-color: #a855f7; }
.exam-choice:disabled { cursor: default; }
.exam-choice.correct { border-color: #16a34a; background: #f0fdf4; }
.exam-choice.wrong { border-color: #dc2626; background: #fef2f2; }
.exam-solution { background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 14px; padding: 15px 17px; font-size: 0.95rem; line-height: 1.55; color: #3b0764; margin-top: 4px; }
.exam-solution.hidden { display: none; }
.exam-sol-h { font-weight: 800; color: #7c3aed; margin-bottom: 5px; }
.exam-row { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.exam-summary { background: #fff; border-radius: 18px; padding: 26px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.exam-big { font-size: 2.6rem; font-weight: 800; color: #7c3aed; }
.exam-empty { background: #fff; border-radius: 18px; padding: 30px; text-align: center; box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.exam-empty-emoji { font-size: 2.4rem; }
.exam-empty strong { display: block; margin: 8px 0; }
.exam-empty p { color: #6b7280; font-size: 0.9rem; margin: 0 0 16px; }
@media (max-width: 600px) { .exam-grid:not(.board-grid) { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px) {
  .exam-grid:not(.board-grid) { grid-template-columns: repeat(2, 1fr); }
  .exam-btn .class-num { font-size: 0.95rem; }
  .board-btn .class-num { font-size: 0.85rem; }
}

/* subject grid */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
}
.subject-btn {
  font-family: inherit; font-size: 1rem; font-weight: 800;
  padding: 22px 10px 16px; border: none; border-radius: 18px;
  background: var(--card-bg); color: var(--text); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.12), 0 8px 18px rgba(0,0,0,0.1);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.subject-emoji { font-size: 2.4rem; animation: float 3s ease-in-out infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%       { transform: translateY(-7px) scale(1.07); }
}
.subject-btn:hover  { transform: translateY(-3px); }
.subject-btn:active { transform: translateY(3px) scale(0.96); box-shadow: 0 2px 0 rgba(0,0,0,0.12); }

/* ── PLAY SCREEN ── */
.question-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 28px 24px;
  text-align: center; box-shadow: 0 12px 30px rgba(0,0,0,0.22);
  border: 4px solid rgba(255,255,255,0.6); animation: popIn 0.3s ease;
}
@keyframes popIn {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}
.visual { font-size: 4.5rem; margin-bottom: 4px; animation: bounceIn 0.45s ease; }
@keyframes bounceIn {
  0%   { transform: scale(0.4) rotate(-10deg); opacity: 0; }
  60%  { transform: scale(1.2) rotate(5deg);   opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
#repeat-audio-btn {
  font-size: 1.8rem; border: none; background: none; cursor: pointer;
  display: block; margin: 0 auto 12px; transition: transform 0.15s ease;
}
#repeat-audio-btn:active { transform: scale(1.35) rotate(10deg); }
.prompt { font-size: 1.4rem; font-weight: 800; margin: 12px 0 24px; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
/* odd counts: the last choice spans the row, keeping the grid symmetric */
.choices .choice-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* sentence-length answers read better stacked full-width */
.choices.choices-long { grid-template-columns: 1fr; }
.choice-btn {
  font-family: inherit; font-size: 1.5rem; font-weight: 800;
  padding: 20px 8px; border-radius: 16px; border: none;
  background: linear-gradient(150deg, #fff, #f1f1f1); color: var(--text);
  cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,0.12), 0 6px 14px rgba(0,0,0,0.1);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.choice-btn:not(:disabled):hover  { transform: translateY(-3px) scale(1.04); }
.choice-btn:not(:disabled):active { transform: translateY(3px) scale(0.95); }
.choice-btn.correct {
  background: linear-gradient(150deg, #5ee08a, var(--correct)); color: white;
  animation: pulse 0.4s ease;
  box-shadow: 0 0 0 4px rgba(62,207,110,0.35), 0 6px 14px rgba(0,0,0,0.15);
}
.choice-btn.wrong {
  background: linear-gradient(150deg, #ff7b7b, var(--wrong)); color: white;
  animation: shake 0.4s ease;
  box-shadow: 0 0 0 4px rgba(255,82,82,0.3), 0 6px 14px rgba(0,0,0,0.15);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.feedback { min-height: 1.7em; font-size: 1.3rem; font-weight: 800; margin-top: 18px; }
.feedback.correct { color: var(--correct); }
.feedback.wrong   { color: var(--wrong); }

/* ── confetti ── */
.confetti-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.confetti-piece {
  position: absolute; font-size: 1.9rem; top: 40%; left: 50%;
  animation: confettiBurst 0.9s ease-out forwards;
}
@keyframes confettiBurst {
  0%   { transform: translate(-50%, -50%) scale(0.6) rotate(0deg); opacity: 1; }
  100% {
    transform:
      translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
      scale(1.15) rotate(var(--rot));
    opacity: 0;
  }
}

/* ── footer + about modal ── */
.site-footer {
  position: relative; z-index: 1; text-align: center;
  padding: 16px 1rem 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
}
.footer-brand { font-size: 0.85rem; color: var(--text); opacity: 0.55; }
.footer-sep { color: var(--text); opacity: 0.3; font-size: 0.85rem; }
.footer-link {
  font-family: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--text); background: none; text-decoration: none;
  border: none; padding: 2px 4px; cursor: pointer; opacity: 0.65;
}
.footer-link:hover { opacity: 1; text-decoration: underline; }
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal-card {
  background: white; border-radius: var(--radius); max-width: 480px;
  width: 100%; max-height: 80vh; overflow-y: auto;
  padding: 28px 24px; position: relative;
  box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.modal-card h3 { margin-top: 0; font-size: 1.3rem; font-weight: 800; }
.modal-card ul { padding-left: 20px; line-height: 1.7; }
.modal-close {
  position: absolute; top: 16px; right: 16px; font-size: 1.2rem;
  border: none; background: #f1f1f1; border-radius: 50%;
  width: 36px; height: 36px; cursor: pointer;
}

/* ── Session Complete ── */
.complete-card {
  max-width: 440px; margin: auto; padding: 2.5rem 2rem;
  background: white; border-radius: 24px;
  box-shadow: 0 8px 40px rgba(124,58,237,0.12);
  text-align: center; display: flex; flex-direction: column; gap: 1rem;
}
.complete-emoji { font-size: 3.5rem; }
.complete-title { font-size: 1.8rem; font-weight: 800; color: #2d1b4e; margin: 0; }
.complete-score { font-size: 1.1rem; color: #666; margin: 0; }
.complete-actions { display: flex; gap: 10px; justify-content: center; }
.btn-secondary-action {
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  background: #f3e8ff; color: #7c3aed; border: none;
  border-radius: 999px; padding: 10px 22px; cursor: pointer;
}
.btn-secondary-action:hover { background: #e9d5ff; }
.upgrade-strip {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border-radius: 16px; padding: 1.25rem; color: white;
  display: flex; flex-direction: column; gap: 0.75rem; text-align: left;
}
.upgrade-strip-inner { display: flex; gap: 0.75rem; align-items: flex-start; }
.upgrade-icon { font-size: 1.5rem; flex-shrink: 0; }
.upgrade-strip strong { font-size: 1rem; }
.upgrade-strip p { font-size: 0.85rem; opacity: 0.88; margin: 2px 0 0; }
.btn-upgrade {
  font-family: inherit; font-size: 1rem; font-weight: 800;
  background: white; color: #7c3aed;
  border: none; border-radius: 999px; padding: 12px 24px;
  cursor: pointer; width: 100%;
}
.btn-upgrade:hover { background: #f3e8ff; }

/* ── Premium card inside the account / profile screen ── */
.profile-premium { margin: 0 0 18px; }
.premium-offer-card,
.premium-active-card {
  display: flex; align-items: center; gap: 12px;
  border-radius: 16px; padding: 16px; color: white; text-align: left;
}
.premium-offer-card { background: linear-gradient(135deg, #7c3aed, #a855f7); flex-wrap: wrap; }
.premium-active-card { background: linear-gradient(135deg, #f59e0b, #f97316); }
.premium-active-card.free-card { background: linear-gradient(135deg, #10b981, #059669); }
.premium-card-icon { font-size: 1.6rem; flex-shrink: 0; }
.premium-card-text { flex: 1; min-width: 150px; }
.premium-card-text strong { font-size: 1.05rem; display: block; }
.premium-card-text p { font-size: 0.85rem; opacity: 0.9; margin: 2px 0 0; }
.premium-offer-card .btn-upgrade { width: auto; padding: 10px 18px; font-size: 0.95rem; }
@media (max-width: 420px) {
  .premium-offer-card .btn-upgrade { width: 100%; }
}

/* ── Premium Modal ── */
.premium-card { text-align: center; padding: 2rem; }
.premium-header { font-size: 1.6rem; font-weight: 800; color: #7c3aed; margin-bottom: 0.25rem; }
.premium-subhead { font-size: 0.9rem; color: #666; margin: 0 0 1.5rem; }
.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 1.25rem; }
.plan-card {
  font-family: inherit; border: 2px solid #e8dff5; border-radius: 16px;
  padding: 1.25rem 0.75rem; cursor: pointer; background: white;
  text-align: center; position: relative; transition: border-color 0.15s;
}
.plan-card:hover { border-color: #a855f7; }
.plan-card.selected { border-color: #7c3aed; background: #faf5ff; }
.plan-featured { border-color: #a855f7; }
.plan-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: #7c3aed; color: white; font-size: 0.7rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px;
}
.plan-name { font-size: 0.9rem; font-weight: 700; color: #2d1b4e; }
.plan-price { font-size: 1.8rem; font-weight: 800; color: #7c3aed; margin: 4px 0; }
.plan-period { font-size: 0.78rem; color: #888; }
.btn-checkout {
  font-family: inherit; font-size: 1.05rem; font-weight: 800;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white; border: none; border-radius: 999px;
  padding: 14px 32px; cursor: pointer; width: 100%;
  transition: opacity 0.15s;
}
.btn-checkout:disabled { opacity: 0.45; cursor: default; }
.btn-checkout:not(:disabled):hover { opacity: 0.9; }
.premium-note { font-size: 0.78rem; color: #aaa; margin: 0.75rem 0 0; }

/* ── responsive ── */
@media (max-width: 600px) {
  .class-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .class-btn { padding: 14px 4px 10px; }
  .class-num { font-size: 1.5rem; }
  .class-emoji { font-size: 1.2rem; }
  .subject-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .topbar-brand { font-size: 1.1rem; }
  .choices { gap: 10px; }
  .choice-btn { font-size: 1.2rem; padding: 16px 6px; }
  .welcome-name { font-size: 1.15rem; }
}
@media (max-width: 380px) {
  .class-grid { grid-template-columns: repeat(2, 1fr); }
  .curriculum-tabs { flex-wrap: wrap; }
}

/* ── user info in topbar ── */
.user-info { display: flex; align-items: center; gap: 8px; }
.user-name { font-size: 0.9rem; font-weight: 700; color: white; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout-btn {
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  padding: 5px 11px; border: 2px solid rgba(255,255,255,0.55);
  border-radius: 999px; background: transparent; color: white;
  cursor: pointer; transition: background 0.15s;
}
.signout-btn:hover { background: rgba(255,255,255,0.2); }

/* ── auth screen (full-page split) ── */
.auth-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: row;
}
.auth-screen.hidden { display: none !important; }

/* Left hero panel */
.auth-hero {
  flex: 1 1 55%;
  background: linear-gradient(135deg, #ff5e7e 0%, #ff8c42 40%, #7c3aed 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  position: relative; overflow: hidden;
}
.auth-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.auth-hero-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  max-width: 440px;
}
.hero-owl { font-size: 5rem; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.25)); animation: owlFloat 4s ease-in-out infinite; }
@keyframes owlFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.hero-brand {
  font-size: 2.4rem; font-weight: 800; color: white; margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
  line-height: 1.1;
}
.hero-tagline {
  font-size: 1.15rem; color: rgba(255,255,255,0.88); margin: 0;
  line-height: 1.5; font-weight: 500;
}
/* Language ticker */
.lang-ticker {
  overflow: hidden;
  width: 100%;
  margin: 10px 0 4px;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
}
.lang-ticker-track {
  display: flex;
  gap: 10px;
  width: max-content;
  animation: ticker-scroll 28s linear infinite;
}
.lang-ticker-track span {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.82);
  letter-spacing: 0.01em;
}
.lang-ticker-track .sep {
  opacity: 0.4;
  font-weight: 400;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.hero-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.hero-chip {
  background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px; padding: 6px 14px;
  font-size: 0.85rem; color: white; font-weight: 700;
}

/* Right login panel */
.auth-form-panel {
  flex: 0 0 420px;
  background: white;
  display: flex; align-items: center; justify-content: center;
  padding: 48px 40px;
  overflow-y: auto;
}
.auth-form-inner {
  width: 100%; max-width: 340px;
  display: flex; flex-direction: column;
}
.auth-title {
  font-size: 1.85rem; font-weight: 800; margin: 0 0 6px;
  color: var(--text);
}
.auth-subtitle { font-size: 0.88rem; color: #888; margin: 0 0 24px; }
.auth-tabs {
  display: flex; gap: 6px; margin-bottom: 18px;
  background: #f3f3f3; border-radius: 999px; padding: 4px;
}
.auth-tab {
  flex: 1; font-family: inherit; font-size: 0.92rem; font-weight: 700;
  border: none; border-radius: 999px; padding: 8px;
  background: transparent; color: #999; cursor: pointer;
  transition: all 0.2s ease;
}
.auth-tab.active { background: white; color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.auth-form { display: flex; flex-direction: column; gap: 11px; }
.auth-input {
  width: 100%; box-sizing: border-box;
  font-family: inherit; font-size: 1rem; font-weight: 600;
  padding: 13px 15px; border: 2px solid #e5e5e5; border-radius: 13px;
  outline: none; transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-error { min-height: 1.1em; font-size: 0.83rem; color: var(--wrong); font-weight: 700; margin: 0; }
.auth-submit {
  font-family: inherit; font-size: 1.05rem; font-weight: 800;
  padding: 13px; border: none; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #ff8c42);
  color: white; cursor: pointer;
  box-shadow: 0 4px 0 rgba(0,0,0,0.14);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.auth-submit:hover  { transform: translateY(-2px); box-shadow: 0 6px 0 rgba(0,0,0,0.14); }
.auth-submit:active { transform: translateY(2px);  box-shadow: 0 2px 0 rgba(0,0,0,0.14); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.pw-wrap { position: relative; }
.pw-wrap .auth-input { width: 100%; padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; padding: 6px; opacity: 0.45; line-height: 1;
}
.pw-toggle.showing, .pw-toggle:hover { opacity: 0.9; }
.forgot-link {
  background: none; border: none; cursor: pointer; padding: 0;
  font-family: inherit; font-size: 0.82rem; font-weight: 700;
  color: #7c3aed; text-align: right; display: block; margin: -6px 0 4px auto;
}
.forgot-link:hover { text-decoration: underline; }
.auth-error.auth-success { color: #059669; }
.guest-btn {
  display: block; width: 100%; margin-top: 16px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.95rem; font-weight: 700;
  color: #7c3aed; padding: 10px; border-radius: 12px;
  transition: background 0.15s;
}
.guest-btn:hover { background: #f3e8ff; }
.auth-note { font-size: 0.78rem; color: #aaa; margin: 14px 0 0; line-height: 1.5; }

/* Google button */
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 16px; margin-bottom: 4px;
  border: 2px solid #e5e5e5; border-radius: 13px;
  background: white; font-family: inherit; font-size: 1rem; font-weight: 700;
  color: #3c3c3c; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.google-btn:hover  { background: #f7f7f7; border-color: #ccc; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.google-btn:active { background: #efefef; }
.google-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Divider */
.auth-divider { position: relative; text-align: center; margin: 16px 0 12px; }
.auth-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: #eee;
}
.auth-divider span {
  position: relative; background: white;
  padding: 0 12px; color: #bbb; font-size: 0.82rem; font-weight: 600;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .auth-screen { flex-direction: column; overflow-y: auto; }
  .auth-hero {
    flex: 0 0 auto; padding: 32px 24px;
    min-height: 0;
  }
  .auth-hero-inner { align-items: center; text-align: center; gap: 12px; }
  .hero-owl { font-size: 3.5rem; }
  .hero-brand { font-size: 1.8rem; }
  .hero-tagline { font-size: 1rem; }
  .hero-features { gap: 8px; }
  .hero-feat { font-size: 0.88rem; padding: 9px 14px; }
  .auth-form-panel { flex: 0 0 auto; padding: 32px 24px; }
  .auth-form-inner { max-width: 100%; }
}

/* ── Session progress bar ── */
.session-progress {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.18); border-radius: 999px;
  padding: 8px 14px;
}
.session-bar-track {
  flex: 1; height: 12px;
  background: rgba(255,255,255,0.25); border-radius: 999px;
  overflow: hidden; border: 1px solid rgba(255,255,255,0.4);
}
.session-bar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.85) 100%);
  transition: width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px rgba(255,255,255,0.6);
}
.session-label {
  font-size: 0.88rem; font-weight: 800; color: white;
  min-width: 42px; text-align: right;
  text-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ── User Avatar (topbar) ── */
.user-info { display: flex; align-items: center; }
.user-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: 2.5px solid rgba(255,255,255,0.6);
  color: white; font-weight: 800; font-size: 0.85rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}
.user-avatar-btn:hover { transform: scale(1.08); }

/* ── Profile / Dashboard Screen ── */
.profile-header {
  display: flex; align-items: center; gap: 16px;
  background: rgba(255,255,255,0.85); border-radius: 20px;
  padding: 18px 20px; margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.profile-avatar-lg {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white; font-weight: 800; font-size: 1.4rem;
  display: flex; align-items: center; justify-content: center;
}
.profile-identity { flex: 1; }
.profile-name { font-weight: 800; font-size: 1.1rem; color: #2d2d2d; }
.profile-email { font-size: 0.82rem; color: #666; margin-top: 2px; }

/* Stats cards */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px;
}
.stat-card {
  background: rgba(255,255,255,0.9); border-radius: 18px;
  padding: 18px 10px; text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}
.stat-value {
  font-size: 1.7rem; font-weight: 800; color: #7c3aed; line-height: 1;
}
.stat-label {
  font-size: 0.72rem; color: #666; margin-top: 6px; font-weight: 700;
}
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.85); border-radius: 14px;
  padding: 13px 18px; margin-bottom: 8px; font-size: 0.95rem; color: #2d2d2d;
}
.stat-row strong { color: #7c3aed; font-size: 1rem; }

/* 7-day calendar */
.profile-section-title {
  font-weight: 800; font-size: 0.8rem; color: rgba(255,255,255,0.85);
  text-transform: uppercase; letter-spacing: 0.1em; margin: 18px 0 10px;
}
.calendar-week {
  display: flex; gap: 6px; margin-bottom: 4px;
}
.cal-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cal-dot {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}
.cal-dot.played {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: white; box-shadow: 0 3px 8px rgba(124,58,237,0.35);
}
.cal-dot.empty {
  background: rgba(255,255,255,0.45); color: rgba(255,255,255,0.6);
  border: 2px solid rgba(255,255,255,0.3);
}
.cal-day-name {
  font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.75);
  text-transform: uppercase;
}

/* Subject breakdown bars */
.subject-breakdown { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.subject-bar-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.85); border-radius: 14px; padding: 10px 16px;
}
.subject-bar-label {
  width: 90px; font-weight: 700; font-size: 0.85rem; color: #2d2d2d;
  text-transform: capitalize; flex-shrink: 0;
}
.subject-bar-track {
  flex: 1; height: 8px; border-radius: 999px; background: #eee; overflow: hidden;
}
.subject-bar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  transition: width 0.7s cubic-bezier(0.4,0,0.2,1);
}
.subject-bar-pct {
  font-size: 0.82rem; font-weight: 800; color: #7c3aed;
  min-width: 38px; text-align: right; flex-shrink: 0;
}
.subject-bar-count {
  font-size: 0.7rem; color: #999; min-width: 44px; text-align: right; flex-shrink: 0;
}

/* Share + sign-out */
.profile-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.btn-share-score {
  background: linear-gradient(135deg, #059669, #10b981);
  color: white; border: none; border-radius: 14px;
  padding: 14px 20px; font-weight: 800; font-size: 1rem; cursor: pointer; width: 100%;
  font-family: inherit; box-shadow: 0 4px 12px rgba(5,150,105,0.3);
}
.btn-share-streak {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: white; border: none; border-radius: 14px;
  padding: 14px 20px; font-weight: 800; font-size: 1rem; cursor: pointer; width: 100%;
  font-family: inherit; box-shadow: 0 4px 12px rgba(245,158,11,0.35);
}
.btn-share-app {
  background: rgba(255,255,255,0.9); color: #7c3aed;
  border: 2px solid #7c3aed; border-radius: 14px;
  padding: 12px 20px; font-weight: 800; font-size: 1rem; cursor: pointer; width: 100%;
  font-family: inherit;
}
.signout-profile-btn {
  background: transparent; color: rgba(255,255,255,0.75);
  border: 2px solid rgba(255,255,255,0.35); border-radius: 14px;
  padding: 10px 20px; font-weight: 700; font-size: 0.9rem; cursor: pointer; width: 100%;
  font-family: inherit;
}
.signout-profile-btn:hover { color: white; border-color: rgba(255,255,255,0.6); }

/* Share button on session complete */
.btn-share-inline {
  background: rgba(255,255,255,0.25); color: white;
  border: 2px solid rgba(255,255,255,0.5); border-radius: 12px;
  padding: 10px 18px; font-weight: 700; font-size: 0.92rem;
  cursor: pointer; font-family: inherit;
}
.btn-share-inline:hover { background: rgba(255,255,255,0.4); }

/* ══════════════════════════════════════
   GAME HUD
══════════════════════════════════════ */
.game-hud {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
  background: rgba(255,255,255,0.18); border-radius: 18px;
  padding: 10px 16px; backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
}
.hud-hearts { display: flex; gap: 4px; font-size: 1.4rem; line-height: 1; }
.hud-heart { display: inline-block; transition: transform 0.15s; }
.hud-heart.broken {
  filter: grayscale(1) opacity(0.4);
  animation: heartBreak 0.4s ease forwards;
}
@keyframes heartBreak {
  0%   { transform: scale(1.4) rotate(-10deg); }
  30%  { transform: scale(0.7) rotate(10deg); }
  60%  { transform: scale(1.1) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); filter: grayscale(1) opacity(0.4); }
}
.hud-score-wrap { text-align: center; }
.hud-score-label { display: block; font-size: 0.58rem; font-weight: 900; color: rgba(255,255,255,0.7); letter-spacing: 1px; }
.hud-score-val {
  display: block; font-size: 1.5rem; font-weight: 900; color: white;
  text-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: transform 0.15s cubic-bezier(0.34,1.56,0.64,1);
}
.hud-score-val.pop { transform: scale(1.35); }
.hud-dots { display: flex; gap: 5px; align-items: center; }
.hud-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.25); border: 2px solid rgba(255,255,255,0.4);
  transition: background 0.25s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.hud-dot.dot-correct {
  background: #4ade80; border-color: #22c55e;
  transform: scale(1.25);
  box-shadow: 0 0 6px rgba(74,222,128,0.6);
}
.hud-dot.dot-wrong {
  background: #f87171; border-color: #ef4444;
  transform: scale(1.1);
}

/* ══════════════════════════════════════
   COMBO BANNER
══════════════════════════════════════ */
.combo-banner {
  text-align: center; font-size: 1.35rem; font-weight: 900;
  color: white; letter-spacing: 0.5px;
  min-height: 2.2rem; margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  opacity: 0; transform: translateY(-8px) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.combo-banner.show {
  opacity: 1; transform: translateY(0) scale(1);
}

/* ══════════════════════════════════════
   FLYING SCORE NUMBER
══════════════════════════════════════ */
.fly-score {
  position: fixed; pointer-events: none; z-index: 999;
  font-size: 1.6rem; font-weight: 900; color: #fbbf24;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
  animation: flyUp 0.9s ease-out forwards;
}
@keyframes flyUp {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-70px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-120px) scale(0.9); }
}

/* ══════════════════════════════════════
   ANSWER SPARKLE
══════════════════════════════════════ */
.sparkle-piece {
  position: fixed; pointer-events: none; z-index: 998;
  font-size: 1.1rem;
  animation: sparkleBurst 0.7s ease-out forwards;
}
@keyframes sparkleBurst {
  0%   { opacity: 1; transform: translate(0,0) scale(0.6); }
  100% { opacity: 0; transform: translate(var(--sdx),var(--sdy)) scale(1.2) rotate(var(--srot)); }
}

/* ══════════════════════════════════════
   SESSION COMPLETE — REDESIGN
══════════════════════════════════════ */
.end-confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden;
}
.end-confetti-piece {
  position: absolute; width: 10px; height: 10px; border-radius: 2px;
  top: -12px; animation: fallDown linear forwards;
}
@keyframes fallDown {
  0%   { transform: translateX(0) rotate(0deg) scaleY(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateX(var(--fdx)) translateY(110vh) rotate(var(--frot)) scaleY(0.6); opacity: 0; }
}
.stars-row {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 4px;
}
.star {
  font-size: 2.8rem; line-height: 1;
  display: inline-block;
  filter: grayscale(1) opacity(0.3);
  transform: scale(0.7);
  transition: filter 0.3s, transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.star.earned {
  filter: none; transform: scale(1.1);
}
.score-reveal {
  display: flex; align-items: baseline; justify-content: center; gap: 8px;
  margin: 4px 0;
}
.score-reveal-val {
  font-size: 3.5rem; font-weight: 900; color: #7c3aed;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 4px 16px rgba(124,58,237,0.2);
}
.score-reveal-label {
  font-size: 1.1rem; font-weight: 700; color: #a78bfa;
}
.complete-score { font-size: 1rem; color: #888; margin: 0; }
.complete-title { font-size: 1.6rem; font-weight: 900; color: #2d1b4e; margin: 0 0 4px; }
.new-record-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: white; font-weight: 900; font-size: 0.9rem;
  border-radius: 999px; padding: 6px 18px;
  box-shadow: 0 4px 12px rgba(245,158,11,0.4);
  animation: badgePop 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes badgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════
   SEO STATIC CONTENT SECTION
══════════════════════════════════════ */
.seo-section {
  background: #1a1030;
  color: rgba(255,255,255,0.82);
  padding: 60px 24px 80px;
  margin-top: 40px;
}
.seo-inner {
  max-width: 860px;
  margin: 0 auto;
  font-family: "Baloo 2", system-ui, sans-serif;
}
.seo-inner > h1,
.seo-inner h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin: 0 0 16px;
  line-height: 1.3;
}
.seo-inner h3 {
  font-size: 1.05rem;
  font-weight: 800;
  color: #c4b5fd;
  margin: 28px 0 8px;
}
.seo-inner p { font-size: 0.95rem; line-height: 1.7; margin: 0 0 12px; }
.seo-inner ul { padding-left: 20px; margin: 0; line-height: 2; font-size: 0.95rem; }
.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 28px 0 36px;
}
.seo-col { background: rgba(255,255,255,0.06); border-radius: 14px; padding: 18px; }
.seo-inner details {
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 14px 0;
}
.seo-inner details summary {
  font-weight: 700;
  color: #e9d5ff;
  cursor: pointer;
  font-size: 0.97rem;
  list-style: none;
}
.seo-inner details summary::before { content: '+ '; opacity: 0.6; }
.seo-inner details[open] summary::before { content: '− '; }
.seo-inner details p { margin: 10px 0 4px 16px; font-size: 0.9rem; color: rgba(255,255,255,0.72); }
.seo-inner a { color: #c4b5fd; }
.seo-links { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.seo-links a { font-weight: 700; font-size: 0.95rem; }
.seo-cta-text { margin-top: 32px !important; font-weight: 700; color: #fff; }
@media (max-width: 600px) {
  .seo-grid { grid-template-columns: 1fr; }
  .seo-inner > h1, .seo-inner h2 { font-size: 1.3rem; }
}

/* ── streak milestone strip (session complete) ── */
.milestone-strip {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  background: linear-gradient(135deg, #ffb347, #ff8c42);
  border-radius: 16px; padding: 12px 18px; margin: 14px auto 0;
  max-width: 380px; box-shadow: 0 6px 18px rgba(255,140,66,0.4);
  animation: badgePop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
.milestone-text { font-size: 1.05rem; font-weight: 900; color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.btn-milestone-share {
  font-family: inherit; font-size: 0.9rem; font-weight: 800;
  background: #fff; color: #d97706; border: none; border-radius: 999px;
  padding: 8px 18px; cursor: pointer; transition: transform 0.15s;
}
.btn-milestone-share:hover { transform: scale(1.05); }

/* ── focus mode: calm the background while a question is on screen ── */
body.focus-mode { animation-play-state: paused; }
body.focus-mode .bg-shape { display: none; }

/* ── accessibility ── */
:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  border-radius: 6px;
}
.choice-btn:focus-visible, .class-btn:focus-visible, .subject-btn:focus-visible {
  outline: 3px solid #7c3aed;
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fly-score, .sparkle-piece, .end-confetti-piece, .confetti-piece { display: none !important; }
}

/* ── report-a-question (accuracy feedback loop) ── */
.report-btn {
  display: block; margin: 10px auto 0; background: none; border: none;
  color: #9ca3af; font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: inherit; text-decoration: underline dotted; padding: 6px;
}
.report-btn:hover { color: #6d28d9; }
