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

:root {
  --teal:      #0d9488;
  --teal-light:#14b8a6;
  --teal-dark: #0f766e;
  --bg:        #0f172a;
  --surface:   #1e293b;
  --surface2:  #334155;
  --text:      #f1f5f9;
  --muted:     #94a3b8;
  --muted2:    #64748b;
  --border:    #334155;
  --green:     #22c55e;
  --red:       #ef4444;
  --yellow:    #eab308;

  /* ── Playful redesign: design tokens (design_handoff_science_hub_playful) ── */
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --spring: cubic-bezier(.34,1.56,.64,1);

  --r-pill: 999px;
  --r-hero: 26px;
  --r-card: 20px;
  --r-input: 14px;

  --sp-4: 4px; --sp-6: 6px; --sp-8: 8px; --sp-10: 10px; --sp-12: 12px;
  --sp-14: 14px; --sp-16: 16px; --sp-18: 18px; --sp-22: 22px;

  /* status chip palette */
  --ok-bg: rgba(34,197,94,.18);   --ok-fg: #86efac;   --ok-solid: #22c55e;
  --warn-bg: rgba(245,158,11,.18);--warn-fg: #fcd34d;
  --info-bg: rgba(59,130,246,.16);--info-fg: #93c5fd;
  --bad-bg: rgba(239,68,68,.14);  --bad-fg: #fca5a5;  --bad-solid: #ef4444;
  --off-bg: rgba(148,163,184,.16);--off-fg: #94a3b8;
  --streak-bg: rgba(251,146,60,.16); --streak-fg: #fdba74; --streak-icon: #fb923c;

  --teacher-accent: linear-gradient(135deg,#f59e0b,#ea580c);
  --teacher-shadow: 0 5px 0 #9a3412;
  --sand-gold: linear-gradient(135deg,#fde68a,#fbbf24 55%,#f59e0b);
  --sand-ink: #3b2a06;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.5;
}

.material-symbols-rounded {
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  display: inline-block;
  user-select: none;
  vertical-align: middle;
}

a { color: var(--teal-light); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.hub-header {
  background: var(--surface);
  border-bottom: 2px solid var(--teal-dark);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.hub-header .logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal-light);
  letter-spacing: 0.5px;
}
.hub-header .breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
}
.hub-header .breadcrumb span { color: var(--text); }

.hub-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 32px;
}

/* ── Grade Selector ── */
.grade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.grade-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
}
.grade-card:hover {
  border-color: var(--teal);
  transform: translateY(-3px);
}
.grade-card .grade-num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--teal-light);
}
.grade-card .grade-label { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }

/* ── Topic List ── */
.topic-list { margin-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.topic-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.topic-card:hover { border-color: var(--teal); }
.topic-card .tag {
  background: var(--teal-dark);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}
.topic-card .title { font-size: 1.1rem; font-weight: 600; }
.topic-card .meta { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }

/* ── Section Nav (breadcrumb progress) ── */
.section-nav {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.section-nav .step {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background 0.2s, color 0.2s;
}
.section-nav .step:last-child { border-right: none; }
.section-nav .step.active { background: var(--teal-dark); color: #fff; }
.section-nav .step.done { background: var(--surface2); color: var(--teal-light); }

/* ── Slide Deck ── */
.slide-deck-wrapper {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.slide-progress-bar-wrap {
  height: 6px;
  background: var(--surface2);
}
.slide-progress-bar {
  height: 100%;
  background: var(--teal);
  transition: width 0.3s ease;
}
.slide-counter {
  padding: 10px 24px;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.slide-counter .slide-title-label { color: var(--text); font-weight: 600; }
.slides-container {
  position: relative;
  min-height: 520px;
}
.slide {
  display: none;
  padding: 40px 56px 32px;
  animation: slideIn 0.25s ease;
}
.slide.active { display: block; }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide h2 {
  font-size: 2rem;
  color: var(--teal-light);
  margin-bottom: 24px;
  line-height: 1.2;
}
.slide-bullets { list-style: none; margin-bottom: 24px; }
.slide-bullet {
  font-size: 1.25rem;
  padding: 10px 0 10px 28px;
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
  border-bottom: 1px solid var(--border);
}
.slide-bullet:last-child { border-bottom: none; }
.slide-bullet.revealed { opacity: 1; transform: translateY(0); }
.slide-bullet::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--teal);
}

.slide-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 56px 24px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.btn {
  padding: 10px 22px;
  border-radius: var(--r-pill);
  border: none;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s var(--spring), box-shadow .15s var(--spring), opacity .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark))); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--b, var(--teal-dark)) 70%, #000); }
.btn-primary:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--b, var(--teal-dark)) 70%, #000); }
.btn-secondary { background: var(--surface2); color: var(--text); }
.btn-ghost { background: transparent; border: 2px solid var(--border); color: var(--muted); }
.btn-green { background: var(--ok-solid); color: #fff; box-shadow: 0 4px 0 #15803d; }
.btn-green:active { box-shadow: 0 2px 0 #15803d; }
.btn-sm { padding: 6px 14px; font-size: 0.85rem; }
.btn:disabled { opacity: .5; cursor: default; transform: none; }

.fullscreen-btn {
  margin-left: auto;
  background: transparent;
  border: 2px solid var(--border);
  color: var(--muted);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color .15s var(--spring), color .15s;
}
.fullscreen-btn:hover { border-color: var(--a, var(--teal)); color: var(--teal-light); transform: translateY(-1px); }

/* ── Poll ── */
.poll-block {
  background: var(--bg);
  border: 2px solid var(--teal-dark);
  border-radius: 12px;
  padding: 24px;
  margin-top: 24px;
}
.poll-block h3 { color: var(--teal-light); font-size: 1.1rem; margin-bottom: 16px; }
.poll-options { display: flex; flex-direction: column; gap: 10px; }
.poll-option {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--r-input);
  padding: 12px 16px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .2s var(--spring), transform .15s var(--spring);
}
.poll-option:hover:not(.locked) { border-color: var(--a, var(--teal)); transform: translateY(-1px); }
.poll-option.wrong { animation: shake .4s ease; }
.poll-correct-banner img { width: 40px; height: 40px; vertical-align: middle; margin-right: 10px; }
.poll-option .bar {
  height: 8px;
  border-radius: 4px;
  background: var(--teal);
  width: 0;
  flex: 1;
  transition: width 0.6s ease;
}
.poll-option.selected .bar { width: 100%; }
.poll-option.locked { cursor: default; }
.poll-option.correct { border-color: var(--green); }
.poll-option.wrong { border-color: var(--red); }
.poll-option.wrong .bar { background: var(--red); }
.poll-correct-banner {
  display: none;
  margin-top: 14px;
  background: #14532d;
  border: 2px solid var(--green);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--green);
  font-weight: 600;
}
.poll-correct-banner.show { display: block; }

/* ── SVG Cell Diagram ── */
.cell-diagram-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  margin: 24px 0;
}
.cell-diagram-wrapper svg {
  max-width: 100%;
  height: auto;
}
.organelle-hit {
  cursor: pointer;
  transition: opacity 0.15s;
}
.organelle-hit:hover { opacity: 0.75; }

.org-tooltip {
  position: fixed;
  z-index: 999;
  background: var(--surface);
  border: 2px solid var(--teal);
  border-radius: 12px;
  padding: 16px 20px;
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  display: none;
  font-size: 0.9rem;
}
.org-tooltip.show { display: block; }
.org-tooltip h4 { color: var(--teal-light); font-size: 1rem; margin-bottom: 8px; }
.org-tooltip p { color: var(--text); margin-bottom: 4px; }
.org-tooltip .analogy { color: var(--muted); font-style: italic; font-size: 0.85rem; }
.org-tooltip .close-tip {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}

/* ── Analogy Table ── */
.analogy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin-top: 16px;
}
.analogy-table th {
  background: var(--teal-dark);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
}
.analogy-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.analogy-table tr { opacity: 0; transition: opacity 0.4s ease; }
.analogy-table tr.revealed { opacity: 1; }
.analogy-table tr:nth-child(even) td { background: var(--surface2); }

/* ── Comparison Diagram ── */
.compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
}
.compare-cell-box {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.compare-cell-box h4 { color: var(--teal-light); margin-bottom: 10px; font-size: 1rem; }
.compare-cell-box img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 12px;
}
/* Same "uncropped" escape hatch as .slide-photo-wrap, for a cutout/white-background
   image placed inside a compare-cell-box instead — show it whole, don't crop it. */
.compare-cell-box img.uncropped {
  height: auto;
  object-fit: contain;
  background: #fff;
}

/* ── Real photo (slide hero / inline) ── */
.slide-photo-wrap {
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}
.slide-photo-wrap img { width: 100%; max-height: 340px; object-fit: cover; display: block; }
.slide-photo-caption {
  padding: 10px 16px;
  background: var(--surface2);
  font-size: 0.85rem;
  color: var(--muted);
}
.slide-photo-row { display: flex; align-items: flex-start; gap: 16px; margin: 20px 0; flex-wrap: wrap; }
.slide-photo-row .slide-photo-wrap { flex: 1; min-width: 200px; margin: 0; }
.slide-photo-row .slide-photo-wrap img { height: 180px; }

/* Uncropped variant — for any source image whose aspect ratio is too square/portrait
   for the wide hero-photo box above (that box crops hard: cover-fitting a portrait
   image into a ~3:1 wide box zooms into a thin center slice and loses most of the
   subject). Use for: diagrams/illustrations on a plain background, AND real photos
   that are portrait-oriented rather than landscape. Shows the whole image at its own
   natural ratio, no cropping — the box just hugs the image, no letterboxing needed. */
.slide-photo-wrap.uncropped {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  background: #fff;
}
.slide-photo-wrap.uncropped img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}
/* Real (non-diagram) portrait photos don't need the white backing — drop it so a
   non-white photo doesn't get an odd white edge if its ratio doesn't divide evenly. */
.slide-photo-wrap.uncropped.photo { background: transparent; }
/* When two+ uncropped images sit side by side in a row, let each just fill its
   flex cell (no fixed max-width/centering) — still no cropping, just natural ratio. */
.slide-photo-row .slide-photo-wrap.uncropped { max-width: none; margin: 0; }

/* ── Vocab Game ── */
.vocab-game {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}
.vocab-col { display: flex; flex-direction: column; gap: 10px; }
.vocab-card {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: border-color 0.15s, background 0.15s;
  min-height: 56px;
  display: flex;
  align-items: center;
}
.vocab-card:hover:not(.matched):not(.wrong) { border-color: var(--teal); }
.vocab-card.selected { border-color: var(--teal); background: #0d9488aa; }
.vocab-card.matched { border-color: var(--green); background: #14532d88; cursor: default; }
.vocab-card.wrong { border-color: var(--red); background: #7f1d1d44; animation: shake 0.4s ease; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  60% { transform: translateX(8px); }
}
.vocab-score {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--teal-light);
  margin-bottom: 12px;
}

/* ── Vocab: flip cards (Learn mode) ── */
.flip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 20px; perspective: 1200px; }
@media (max-width: 900px) { .flip-grid { grid-template-columns: repeat(2, 1fr); } }
.flip-card { height: 150px; cursor: pointer; }
.flip-inner {
  position: relative; width: 100%; height: 100%; transition: transform .6s var(--spring); transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r-card); border: 2px solid var(--surface2);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px; text-align: center; font-weight: 800;
}
.flip-front { background: var(--surface); font-size: 1.05rem; }
.flip-back { background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark))); color: #fff; transform: rotateY(180deg); font-weight: 700; font-size: .92rem; gap: 10px; }
.flip-actions { display: flex; gap: 8px; }
.flip-card.known .flip-front { border-color: var(--ok-solid); box-shadow: 0 0 0 2px var(--ok-solid) inset; }

/* ── Quiz ── */
.quiz-layout { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; max-width: 1080px; margin: 0 auto; }
@media (max-width: 900px) { .quiz-layout { grid-template-columns: 1fr; } }
.quiz-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.quiz-mascot-panel { background: var(--surface); border: 2px solid var(--surface2); border-radius: var(--r-card); padding: 18px; text-align: center; }
.quiz-mascot-img { width: 84px; height: 84px; }
.quiz-mascot-msg { margin-top: 10px; font-weight: 800; font-size: .88rem; color: var(--muted); }
.quiz-section { max-width: 860px; margin: 0 auto; }
.quiz-progress-bar-wrap { height: 6px; background: var(--surface2); border-radius: 3px; margin-bottom: 24px; }
.quiz-progress-bar { height: 100%; background: var(--teal); border-radius: 3px; transition: width 0.3s; }

.quiz-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 36px 40px;
}
.quiz-card .q-label { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.quiz-card .q-text { font-size: 1.3rem; font-weight: 600; margin-bottom: 24px; line-height: 1.4; }
.quiz-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.quiz-opt {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.quiz-opt:hover:not(.locked) { border-color: var(--teal); }
.quiz-opt input[type=checkbox] { margin-top: 2px; accent-color: var(--teal); width: 18px; height: 18px; }
.quiz-opt.selected:not(.locked) { border-color: var(--teal); background: #0d948833; }
.quiz-opt.correct { border-color: var(--green); background: #14532d44; }
.quiz-opt.wrong   { border-color: var(--red);   background: #7f1d1d44; }

.answer-reveal {
  display: none;
  background: #0c1a2e;
  border: 2px solid var(--teal-dark);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 0.95rem;
  color: var(--text);
  margin-top: 16px;
  line-height: 1.6;
}
.answer-reveal.show { display: block; }
.answer-reveal strong { color: var(--teal-light); }

/* Drag-to-categorize (Q6) */
.drag-cats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.drag-cat {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 100px;
}
.drag-cat h5 { color: var(--teal-light); margin-bottom: 10px; font-size: 0.9rem; }
.drag-item {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  cursor: grab;
  font-size: 0.9rem;
  user-select: none;
}
.drag-item:active { cursor: grabbing; opacity: 0.7; }
.drag-item.picked { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-dark); }
.drag-item.correct-place { border-color: var(--green); }
.drag-item.wrong-place   { border-color: var(--red); }
.drag-item.locked { cursor: default; }
.drag-item small { display: block; margin-top: 4px; font-weight: 600; color: var(--muted); }
.drag-cat.locked { opacity: 0.85; }

/* Table-sort (Q7) */
.table-sort-grid { display: flex; flex-direction: column; gap: 8px; }
.ts-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}
.ts-desc { background: var(--surface2); border-radius: 8px; padding: 10px 14px; font-size: 0.9rem; }
.ts-btn {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s;
}
.ts-btn:hover:not(.locked) { border-color: var(--teal); }
.ts-btn.selected { border-color: var(--teal); background: var(--teal-dark); color: #fff; }
.ts-btn.correct  { border-color: var(--green); background: #14532d44; }
.ts-btn.wrong    { border-color: var(--red);   background: #7f1d1d44; }

/* ── Exit Ticket ── */
.exit-section { max-width: 700px; margin: 0 auto; }
.exit-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 32px 36px;
  margin-bottom: 20px;
}
.exit-card .q-num { color: var(--teal-light); font-size: 0.85rem; margin-bottom: 6px; }
.exit-card .q-text { font-size: 1.1rem; font-weight: 600; margin-bottom: 16px; }

/* Ticket-stub styling (playful redesign): a torn-stub left column + dashed perforation. */
.exit-card.ticket { display: flex; padding: 0; overflow: hidden; border-radius: var(--r-card); }
.exit-card.ticket .ticket-stub {
  flex: none; width: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark))); color: #fff;
  font-weight: 900; font-size: 0.9rem; text-align: center; padding: 16px 8px;
  border-right: 3px dashed rgba(255,255,255,.5);
  position: relative;
}
.exit-card.ticket .ticket-stub span { font-size: .68rem; font-weight: 800; opacity: .85; text-transform: uppercase; }
.exit-card.ticket .ticket-body { flex: 1; padding: 24px 28px; }
.confidence-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.confidence-face {
  flex: 1; min-width: 74px; background: var(--surface2); border: 2px solid var(--surface2); border-radius: var(--r-input);
  color: var(--muted); padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .15s var(--spring), border-color .15s var(--spring), color .15s;
}
.confidence-face:hover { transform: translateY(-2px); }
.confidence-face .material-symbols-rounded { font-size: 26px; }
.confidence-face .cf-label { font-size: .7rem; font-weight: 800; }
.confidence-face.selected { border-color: var(--a, var(--teal)); color: var(--text); background: color-mix(in srgb, var(--a, var(--teal)) 18%, var(--surface2)); }

.lesson-complete-mascot { width: 90px; height: 90px; margin-bottom: 4px; }
.streak-tile { margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; background: var(--streak-bg); color: var(--streak-fg); border-radius: var(--r-pill); padding: 8px 18px; font-weight: 900; }
.exit-input {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  outline: none;
}
.exit-input:focus { border-color: var(--teal); }
.exit-opts { display: flex; flex-direction: column; gap: 8px; }
.exit-opt {
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 1rem;
  transition: border-color 0.15s;
}
.exit-opt:hover:not(.locked) { border-color: var(--teal); }
.exit-opt.selected:not(.locked) { border-color: var(--teal); background: #0d948833; }
.exit-opt.correct { border-color: var(--green); background: #14532d44; }
.exit-opt.wrong   { border-color: var(--red);   background: #7f1d1d44; }

.exit-result {
  text-align: center;
  padding: 20px;
  font-size: 2rem;
}
.exit-result .tick  { color: var(--green); font-size: 3rem; }
.exit-result .cross { color: var(--red);   font-size: 3rem; }

.final-score {
  background: var(--surface);
  border: 2px solid var(--teal);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  margin-top: 24px;
}
.final-score .score-num { font-size: 4rem; font-weight: 800; color: var(--teal-light); }
.final-score .score-msg { font-size: 1.2rem; color: var(--muted); margin-top: 8px; }

/* ── Page heading ── */
.page-heading { margin-bottom: 8px; }
.page-heading h1 { font-size: 2rem; font-weight: 800; }
.page-heading p  { color: var(--muted); font-size: 1rem; margin-top: 4px; }

/* ── Utility ── */
.hidden { display: none !important; }
.mt-24 { margin-top: 24px; }
.mt-16 { margin-top: 16px; }
.flex-row { display: flex; align-items: center; gap: 12px; }
.tag-unit {
  background: #1e3a5f;
  color: #7dd3fc;
  border-radius: 6px;
  padding: 3px 10px;
  font-size: 0.8rem;
}

/* ── Shared playful components (pill / 3D button / card / switch / segmented / toast / chips) ── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 0.8rem; font-weight: 800;
  background: var(--surface2); color: var(--text);
}
.pill .material-symbols-rounded { font-size: 16px; }

.status-chip { border-radius: var(--r-pill); padding: 4px 12px; font-weight: 800; font-size: 0.78rem; display: inline-flex; align-items: center; gap: 6px; }
.status-chip.ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.status-chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.status-chip.info { background: var(--info-bg); color: var(--info-fg); }
.status-chip.bad  { background: var(--bad-bg);  color: var(--bad-fg); }
.status-chip.off  { background: var(--off-bg);  color: var(--off-fg); }
.status-chip.streak { background: var(--streak-bg); color: var(--streak-fg); }

.countdown-chip {
  font-family: var(--font-mono); font-weight: 800; font-variant-numeric: tabular-nums;
  background: rgba(0,0,0,.28); border-radius: var(--r-input);
  padding: 6px 10px; display: inline-flex; gap: 4px; align-items: baseline;
}
.countdown-chip .cd-unit { display: flex; flex-direction: column; align-items: center; min-width: 2.4ch; }
.countdown-chip .cd-num { font-size: 1.5em; line-height: 1; }
.countdown-chip .cd-lbl { font-size: 0.4em; letter-spacing: .08em; opacity: .7; text-transform: uppercase; }

.btn-3d {
  border: none; border-radius: var(--r-pill);
  padding: 12px 26px;
  font-family: var(--font-body); font-weight: 900; font-size: 1rem;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark)));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--b, var(--teal-dark)) 70%, #000);
  transition: transform .15s var(--spring), box-shadow .15s var(--spring), opacity .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-3d:hover { transform: translateY(-2px); }
.btn-3d:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--b, var(--teal-dark)) 70%, #000); }
.btn-3d.white { background: #fff; color: var(--bg); box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.btn-3d.white:active { box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn-3d.teacher { background: var(--teacher-accent); box-shadow: var(--teacher-shadow); }
.btn-3d.teacher:active { box-shadow: 0 2px 0 #9a3412; }
.btn-3d:disabled { opacity: .55; cursor: default; transform: none; }

.card {
  background: var(--surface);
  border: 2px solid var(--surface2);
  border-radius: var(--r-card);
  padding: var(--sp-18) var(--sp-22);
  transition: transform .2s var(--spring), border-color .2s var(--spring), box-shadow .2s var(--spring);
}
.card.hover-lift:hover {
  transform: translateY(-5px) rotate(-.5deg);
  border-color: var(--a, var(--teal));
  box-shadow: 0 14px 28px rgba(0,0,0,.4);
}
.card.gradient {
  background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark)));
  border: none; color: #fff;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
}

.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: var(--r-pill);
  background: var(--surface2); cursor: pointer;
  transition: background .2s var(--spring);
}
.switch .track::before {
  content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff;
  transition: transform .2s var(--spring);
}
.switch input:checked + .track { background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark))); }
.switch input:checked + .track::before { transform: translateX(18px); }

.segmented {
  display: inline-flex; gap: 4px; padding: 4px;
  border-radius: 16px; background: var(--bg); border: 2px solid var(--surface2);
}
.segmented .seg-opt {
  border: none; background: transparent; color: var(--muted);
  padding: 8px 16px; border-radius: 12px; font-weight: 800; font-size: 0.9rem;
  cursor: pointer; transition: background .2s var(--spring), color .2s var(--spring);
}
.segmented .seg-opt.active {
  background: linear-gradient(135deg, var(--a, var(--teal)), var(--b, var(--teal-dark)));
  color: #fff;
}

.toast-stack {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 1000; align-items: center;
}
.toast {
  background: var(--surface); border: 1px solid var(--surface2); border-radius: 14px;
  padding: 12px 20px; font-weight: 700; font-size: 0.9rem; color: var(--text);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  animation: pop .4s var(--spring) both;
  display: flex; align-items: center; gap: 10px;
}

/* ── Fullscreen mode ── */
.slide-deck-wrapper:fullscreen,
.slide-deck-wrapper:-webkit-full-screen {
  border-radius: 0;
  border: none;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.slide-deck-wrapper:fullscreen .slides-container,
.slide-deck-wrapper:-webkit-full-screen .slides-container {
  flex: 1;
  overflow-y: auto;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .vocab-game { grid-template-columns: 1fr; }
  .compare-row { grid-template-columns: 1fr; }
  .drag-cats { grid-template-columns: 1fr; }
  .ts-row { grid-template-columns: 1fr 1fr; }
  .hub-main { padding: 20px 16px; }
  .slide { padding: 24px 20px 20px; }
  .slide h2 { font-size: 1.5rem; }
  .slide-controls { padding: 12px 20px 16px; }
}
