/* ============================================================================
   app.css — Captain Minnow's math command. One visual family with the Book.
   Built on Sofia's surface palette; slate-teal math thread; honey the one
   accent; a single bio-glow spark reserved for the reward moment. Soft rounded
   panels, warm ink, no clock-like anything anywhere. Tablet-first big targets.
   @imports the shared tokens so the app and the book share one spine.
   ============================================================================ */

@import url("../fonts.css");

/* Bring in the shared design tokens (copied into the app tree for a self-
   contained deploy — the deploy-copy-travels-whole law). */
@import url("../tokens.css");

/* ---------------------------------------------------------------------------
   RESET & GROUND
   --------------------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* App-scale type (screen px, not print pt) built from the token relationships */
  --app-big:  clamp(3rem, 8vw, 5.5rem);   /* the big friendly problem number */
  --app-h1:   clamp(1.6rem, 3.4vw, 2.4rem);
  --app-h2:   clamp(1.2rem, 2.4vw, 1.6rem);
  --app-lead: clamp(1.05rem, 2vw, 1.3rem);
  --app-ui:   clamp(0.95rem, 1.6vw, 1.1rem);
  --app-label: clamp(0.72rem, 1.2vw, 0.82rem);

  --tap-min: 68px;             /* tablet-first minimum touch target */
  --panel-max: 940px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html, body { height: 100%; }

body {
  font-family: var(--font-ui);
  font-size: var(--app-ui);
  color: var(--ink);
  /* warm oat, with the faintest sunlit wash toward honey at the top */
  background:
    radial-gradient(120% 80% at 50% -10%, #FFFBF2 0%, var(--paper) 46%, #F6EFE0 100%);
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* App shell */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------------------
   THE TOP BAR — never a clock. Just who you are (Captain Minnow, fixed) and a
   calm way home. No score, no timer, no streak counter.
   --------------------------------------------------------------------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px clamp(14px, 3vw, 32px);
  border-bottom: 1.5px solid var(--paper-edge);
  background: rgba(251, 246, 236, 0.86);
  backdrop-filter: blur(6px);
  position: sticky; top: 0; z-index: 40;
}
.topbar .home-btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 18px;
  border: none; border-radius: var(--radius-pill);
  background: var(--paper-warm); color: var(--ink);
  font-family: var(--font-ui); font-weight: 600; font-size: var(--app-ui);
  cursor: pointer; transition: transform .15s var(--ease), background .15s;
}
.topbar .home-btn:hover { background: var(--honey-pale); }
.topbar .home-btn:active { transform: scale(0.96); }
.topbar .captain {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-variation-settings: var(--fraunces-warm-sm);
  font-size: var(--app-h2); color: var(--ink);
}
.topbar .captain .badge {
  width: 40px; height: 40px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--honey-pale), var(--honey));
  display: grid; place-items: center; font-size: 1.2rem;
  box-shadow: var(--lift);
}
.topbar .spacer { flex: 1; }
.topbar .parent-link {
  min-height: 44px; padding: 0 14px;
  border: 1.5px solid var(--paper-edge); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-soft);
  font-family: var(--font-ui); font-size: var(--app-label);
  letter-spacing: var(--track-label); text-transform: uppercase; font-weight: 600;
  cursor: pointer;
}
.topbar .parent-link:hover { border-color: var(--honey); color: var(--honey-deep); }

/* ---------------------------------------------------------------------------
   MAIN STAGE
   --------------------------------------------------------------------------- */
.stage {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(16px, 3vw, 40px);
  width: 100%;
}
.panel {
  width: 100%; max-width: var(--panel-max);
  display: flex; flex-direction: column; gap: var(--sp-4);
}

/* Big friendly title using warm Fraunces */
.display-title {
  font-family: var(--font-display);
  font-variation-settings: var(--fraunces-warm);
  font-weight: 380; line-height: var(--lh-tight);
  font-size: var(--app-h1); color: var(--ink);
  letter-spacing: -0.01em;
}

/* ---------------------------------------------------------------------------
   HOME — the three mode doors + the chart + discoveries. Self-explaining:
   a kid sees three big warm cards and taps one. Three-second rule.
   --------------------------------------------------------------------------- */
.home-hello {
  text-align: center; margin-bottom: var(--sp-3);
}
.home-hello h1 {
  font-family: var(--font-display);
  font-variation-settings: var(--fraunces-warm);
  font-weight: 400; font-size: var(--app-h1); color: var(--ink);
}
.home-hello p { color: var(--ink-soft); font-size: var(--app-lead); margin-top: 6px; }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--sp-4);
}
.mode-card {
  border: none; text-align: left; cursor: pointer;
  border-radius: var(--radius-lg);
  padding: clamp(22px, 3vw, 32px);
  min-height: 190px;
  display: flex; flex-direction: column; gap: 10px; justify-content: flex-end;
  color: var(--ink);
  box-shadow: var(--lift);
  transition: transform .18s var(--ease), box-shadow .18s;
  position: relative; overflow: hidden;
  font-family: var(--font-ui);
}
.mode-card:hover { transform: translateY(-4px); box-shadow: 0 6px 22px rgba(42,38,34,.14); }
.mode-card:active { transform: translateY(-1px) scale(0.99); }
.mode-card .emoji { font-size: 2.6rem; line-height: 1; }
.mode-card h2 {
  font-family: var(--font-display);
  font-variation-settings: var(--fraunces-warm-sm);
  font-size: 1.5rem; font-weight: 420;
}
.mode-card p { color: var(--ink-soft); font-size: var(--app-ui); line-height: 1.35; }

/* mode card grounds — each a warm surface, math thread edge */
.mode-card.patterns { background: linear-gradient(155deg, #FDF6E8, var(--paper-warm)); }
.mode-card.words    { background: linear-gradient(155deg, #FBF1E4, #F0E3CF); }
.mode-card.mixed    { background: linear-gradient(155deg, #FCF4E6, #F3E7D2); }
.mode-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px;
  background: var(--thread-math);
}
.mode-card.words::after  { background: var(--thread-reading); }
.mode-card.mixed::after  { background: var(--honey); }

/* a "coming soon" mode — never a shameful padlock, a warm island shape */
.mode-card.soon {
  cursor: default; box-shadow: none;
  background: repeating-linear-gradient(135deg, #F6EFE1, #F6EFE1 12px, #F2E8D6 12px, #F2E8D6 24px);
  opacity: 0.86;
}
.mode-card.soon:hover { transform: none; }
.mode-card.soon .soon-tag {
  align-self: flex-start;
  font-size: var(--app-label); letter-spacing: var(--track-label);
  text-transform: uppercase; font-weight: 700; color: var(--ink-soft);
  background: var(--paper); border-radius: var(--radius-pill);
  padding: 5px 12px;
}

/* ---------------------------------------------------------------------------
   THE PROGRESS CHART — mirrors her wall chart. Commutative pairs light TOGETHER.
   Warmth carried by BOTH color AND a non-color cue (fill dots) per §12.6.
   --------------------------------------------------------------------------- */
.chart-wrap { display: flex; flex-direction: column; gap: var(--sp-3); align-items: center; }
.chart-caption { color: var(--ink-soft); font-size: var(--app-ui); text-align: center; }
.grid-chart {
  display: grid;
  gap: 3px;
  --cell: clamp(26px, 4.6vw, 44px);
  grid-template-columns: var(--cell) repeat(10, var(--cell));
  grid-auto-rows: var(--cell);
  background: var(--paper-warm);
  padding: 10px; border-radius: var(--radius-lg);
  box-shadow: var(--lift);
}
.grid-chart .hd {
  display: grid; place-items: center;
  font-family: var(--font-ui); font-weight: 700; font-size: var(--app-label);
  color: var(--ink-soft);
}
.grid-chart .cell {
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui); font-weight: 600;
  font-size: clamp(0.6rem, 1.4vw, 0.82rem);
  position: relative;
  background: #FFFFFF; color: var(--ink-faint);
  border: 1px solid var(--paper-edge);
}
/* warmth by color — cool paper to warm honey; slate-teal for the math thread base */
.grid-chart .cell.w0 { background: #F1EADD; color: #C4B79E; }             /* locked */
.grid-chart .cell.w1 { background: #E7EEF0; color: var(--ink-soft); }     /* new — cool teal-grey */
.grid-chart .cell.w2 { background: #CFE1E2; color: var(--ink); }          /* warming */
.grid-chart .cell.w3 { background: var(--honey-pale); color: var(--honey-deep); } /* warm */
.grid-chart .cell.w4 { background: var(--honey); color: #fff; }           /* hot */
.grid-chart .cell.sq { box-shadow: inset 0 0 0 2px var(--thread-math); }  /* square landmark */
/* NON-COLOR cue: a small filled bar count at the bottom, warmth 0..4 (§12.6) */
.grid-chart .cell .warmdots {
  position: absolute; bottom: 2px; left: 0; right: 0;
  display: flex; gap: 1.5px; justify-content: center;
}
.grid-chart .cell .warmdots i {
  width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5;
}
.grid-chart .cell.highlight { outline: 3px solid var(--bio-glow); outline-offset: 1px; z-index: 2; }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: center;
  font-size: var(--app-label); color: var(--ink-soft);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend .sw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--paper-edge); }

/* ---------------------------------------------------------------------------
   DISCOVERIES — a collected set, like shells on a shelf.
   --------------------------------------------------------------------------- */
.discoveries { display: flex; flex-direction: column; gap: var(--sp-2); }
.discoveries h3 {
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm-sm);
  font-size: var(--app-h2); font-weight: 400;
}
.disc-row { display: flex; flex-wrap: wrap; gap: 12px; }
.disc-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-radius: var(--radius-pill);
  background: var(--paper-warm); box-shadow: var(--lift);
  font-weight: 600;
}
.disc-chip .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--bio-glow); box-shadow: 0 0 8px var(--bio-cyan); }
.disc-chip.locked { opacity: .45; }
.disc-chip.locked .dot { background: var(--paper-edge); box-shadow: none; }

/* ---------------------------------------------------------------------------
   THE PROBLEM CARD (Patterns / Mixed) — the big friendly number, array visual,
   tappable answers. No clock, no score readout.
   --------------------------------------------------------------------------- */
.problem-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--lift); padding: clamp(20px, 4vw, 44px);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-4);
  position: relative; overflow: hidden;
}
.problem-prompt {
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm);
  font-weight: 380; font-size: var(--app-big); color: var(--ink);
  line-height: 1; text-align: center;
}
.problem-prompt .x { color: var(--thread-math); padding: 0 .12em; }

.array-vis { display: grid; gap: 5px; justify-content: center; }
.array-vis .dot {
  width: clamp(14px, 2.6vw, 22px); height: clamp(14px, 2.6vw, 22px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--honey-pale), var(--honey));
  animation: pop .28s var(--ease) backwards;
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }

.answer-grid {
  display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: var(--sp-3); width: 100%; max-width: 520px;
}
.answer-btn {
  min-height: var(--tap-min); border: 2px solid var(--paper-edge);
  border-radius: var(--radius-lg); background: var(--paper);
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm-sm);
  font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 420; color: var(--ink);
  cursor: pointer; transition: transform .12s var(--ease), background .15s, border-color .15s;
}
.answer-btn:hover { border-color: var(--honey); background: #FFFDF8; }
.answer-btn:active { transform: scale(0.95); }
.answer-btn.correct { background: var(--honey); color: #fff; border-color: var(--honey-deep); animation: correctPulse .4s var(--ease); }
.answer-btn.gentle { background: #EAF2F2; border-color: var(--sea-shallow); color: var(--ink-soft); }
@keyframes correctPulse { 0%{transform:scale(1);} 40%{transform:scale(1.08);} 100%{transform:scale(1);} }

/* the strategy coach line — a warm route, never a scold */
.coach {
  width: 100%; max-width: 620px; text-align: center;
  background: var(--honey-pale); border-radius: var(--radius);
  padding: 14px 18px; color: var(--honey-deep); font-weight: 600;
  font-size: var(--app-ui); display: none;
}
.coach.show { display: block; animation: fadeUp .3s var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px);} to {opacity:1; transform:none;} }

.help-btn {
  align-self: center; min-height: 52px; padding: 0 22px;
  border: 2px dashed var(--sea-shallow); border-radius: var(--radius-pill);
  background: transparent; color: var(--sea-mid); font-weight: 600;
  font-family: var(--font-ui); font-size: var(--app-ui); cursor: pointer;
}
.help-btn:hover { background: #EAF4F4; }

/* the reward flash — the one bio-glow spark tying the app to the ocean (§ design) */
.spark {
  position: fixed; inset: 0; pointer-events: none; z-index: 60;
  display: grid; place-items: center; opacity: 0;
}
.spark.go { animation: sparkFlash 1s var(--ease); }
.spark .burst {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bio-glow); box-shadow: 0 0 60px 30px var(--bio-cyan);
}
@keyframes sparkFlash {
  0% { opacity: 0; } 20% { opacity: .9; } 100% { opacity: 0; }
}

/* ---------------------------------------------------------------------------
   WORD-PROBLEM CRACKING — the Detective Steps interface.
   --------------------------------------------------------------------------- */
.detective { width: 100%; max-width: 720px; display: flex; flex-direction: column; gap: var(--sp-4); }
.wp-text {
  font-family: var(--font-body); font-size: var(--app-lead); line-height: 1.6;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--lift);
  padding: clamp(20px, 3vw, 32px); color: var(--ink);
}
.wp-text .word { cursor: pointer; border-radius: 3px; padding: 1px 2px; transition: background .12s; }
.wp-text .word:hover { background: var(--honey-pale); }
.wp-text .word.known { background: var(--honey-pale); box-shadow: inset 0 -3px 0 var(--honey); }
.wp-text .word.decoy { color: var(--ink-faint); text-decoration: line-through; text-decoration-color: var(--thread-reading); }
.wp-text .word.question { background: #E3F0F0; box-shadow: inset 0 0 0 2px var(--sea-shallow); border-radius: 5px; }

.step-track { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.step-chip {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  border-radius: var(--radius-pill); background: var(--paper-warm);
  color: var(--ink-soft); font-weight: 600; font-size: var(--app-label);
  letter-spacing: var(--track-tiny); text-transform: uppercase;
}
.step-chip.active { background: var(--sea-shallow); color: #fff; }
.step-chip.done { background: var(--honey); color: #fff; }
.step-chip .n { font-family: var(--font-display); font-size: 1rem; }

.wp-instruction {
  text-align: center; font-size: var(--app-lead); color: var(--sea-mid);
  font-weight: 600; min-height: 2em;
}

/* ---------------------------------------------------------------------------
   THE CIRCUIT-BREAKER / GENTLE OFFER — a calm, warm interstitial, never a scold.
   --------------------------------------------------------------------------- */
.gentle-offer {
  background: linear-gradient(160deg, #EAF4F4, var(--paper));
  border-radius: var(--radius-lg); box-shadow: var(--lift);
  padding: clamp(24px, 4vw, 44px); text-align: center;
  display: flex; flex-direction: column; gap: var(--sp-4); align-items: center;
}
.gentle-offer .big { font-size: 3rem; }
.gentle-offer h2 {
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm);
  font-weight: 400; font-size: var(--app-h1);
}
.gentle-offer p { color: var(--ink-soft); font-size: var(--app-lead); max-width: 460px; }
.gentle-offer .choices { display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: center; }

/* ---------------------------------------------------------------------------
   BIG PRIMARY BUTTON — used across modes for "next / let's go / keep going".
   --------------------------------------------------------------------------- */
.btn-primary {
  min-height: var(--tap-min); padding: 0 32px;
  border: none; border-radius: var(--radius-pill);
  background: var(--honey); color: #fff;
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm-sm);
  font-size: 1.4rem; font-weight: 440; cursor: pointer;
  box-shadow: var(--lift); transition: transform .14s var(--ease), background .15s;
}
.btn-primary:hover { background: var(--honey-deep); }
.btn-primary:active { transform: scale(0.96); }
.btn-soft {
  min-height: var(--tap-min); padding: 0 28px;
  border: 2px solid var(--paper-edge); border-radius: var(--radius-pill);
  background: var(--paper); color: var(--ink); font-family: var(--font-ui);
  font-size: var(--app-ui); font-weight: 600; cursor: pointer;
}
.btn-soft:hover { border-color: var(--sea-shallow); }

/* ---------------------------------------------------------------------------
   SESSION SUMMARY — a warm "here's what warmed up today", never a score.
   --------------------------------------------------------------------------- */
.summary-card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--lift);
  padding: clamp(24px, 4vw, 44px); display: flex; flex-direction: column; gap: var(--sp-4);
  align-items: center; text-align: center;
}
.summary-card h2 {
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm);
  font-weight: 400; font-size: var(--app-h1);
}
.warmed-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.warmed-pill {
  padding: 10px 18px; border-radius: var(--radius-pill); font-weight: 700;
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm-sm);
  font-size: 1.3rem;
  background: var(--honey-pale); color: var(--honey-deep);
}
.warmed-pill.hot { background: var(--honey); color: #fff; }

/* ---------------------------------------------------------------------------
   PARENT VIEW — quiet, honest, read-only. Deliberately plainer (§6.4).
   --------------------------------------------------------------------------- */
.parent {
  width: 100%; max-width: 820px; display: flex; flex-direction: column; gap: var(--sp-5);
  font-family: var(--font-ui);
}
.parent h1 {
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm);
  font-weight: 400; font-size: var(--app-h1);
}
.parent .note { color: var(--ink-soft); font-size: var(--app-ui); line-height: 1.5; }
.parent .section {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--lift); padding: var(--sp-5);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.parent .section h2 { font-size: var(--app-h2); font-weight: 700; color: var(--ink); }
.warmth-list { display: flex; flex-direction: column; gap: 8px; }
.warmth-row { display: flex; align-items: center; gap: 12px; }
.warmth-row .tbl { width: 84px; font-weight: 700; color: var(--ink); }
.warmth-bar { flex: 1; display: flex; gap: 3px; }
.warmth-bar .seg { flex: 1; height: 22px; border-radius: 4px; background: #F1EADD; }
.warmth-bar .seg.f1 { background: #E7EEF0; }
.warmth-bar .seg.f2 { background: #CFE1E2; }
.warmth-bar .seg.f3 { background: var(--honey-pale); }
.warmth-bar .seg.f4 { background: var(--honey); }

.unlock-panel { display: flex; flex-direction: column; gap: var(--sp-3); }
.unlock-panel .ready {
  background: var(--honey-pale); border-radius: var(--radius); padding: 16px 20px;
  color: var(--honey-deep); font-weight: 600;
}
.parent .danger {
  align-self: flex-start; min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--thread-reading); border-radius: var(--radius-pill);
  background: transparent; color: var(--thread-reading); font-weight: 600; cursor: pointer;
  font-size: var(--app-label); text-transform: uppercase; letter-spacing: var(--track-label);
}

.toggle-row { display: flex; align-items: center; gap: 12px; }
.toggle {
  width: 56px; height: 32px; border-radius: 999px; background: var(--paper-edge);
  border: none; cursor: pointer; position: relative; transition: background .2s;
}
.toggle.on { background: var(--sea-shallow); }
.toggle .knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left .2s var(--ease); box-shadow: var(--lift); }
.toggle.on .knob { left: 27px; }

/* ---------------------------------------------------------------------------
   THE 60-SECOND WALKTHROUGH — full-screen, one arrow, teaches by doing.
   --------------------------------------------------------------------------- */
.walkthrough {
  position: fixed; inset: 0; z-index: 80;
  background: radial-gradient(120% 90% at 50% 0%, #FFFBF2, var(--paper) 60%, #EFE6D5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-5); padding: clamp(20px, 5vw, 60px); text-align: center;
}
.walkthrough .wt-emoji { font-size: clamp(4rem, 12vw, 7rem); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{ transform: translateY(0);} 50%{ transform: translateY(-12px);} }
.walkthrough h1 {
  font-family: var(--font-display); font-variation-settings: var(--fraunces-warm);
  font-weight: 400; font-size: clamp(1.8rem, 5vw, 3rem); color: var(--ink); max-width: 14ch;
}
.walkthrough p { font-size: var(--app-lead); color: var(--ink-soft); max-width: 30ch; line-height: 1.5; }
.walkthrough .dots { display: flex; gap: 10px; }
.walkthrough .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--paper-edge); }
.walkthrough .dots i.on { background: var(--honey); }
.walkthrough .wt-demo {
  display: flex; gap: var(--sp-3); align-items: center; justify-content: center; flex-wrap: wrap;
}

/* The tiny "Skip" — a quiet, warm secondary link for a returning kid or a
   grown-up. Same family as the topbar's .parent-link: transparent pill, soft
   ink, uppercase tracked, calm. NOT a default box. Sits below the big arrow. */
.walkthrough .parent-link {
  min-height: 44px; padding: 0 16px;
  border: 1.5px solid var(--paper-edge); border-radius: var(--radius-pill);
  background: transparent; color: var(--ink-soft);
  font-family: var(--font-ui); font-size: var(--app-label);
  letter-spacing: var(--track-label); text-transform: uppercase; font-weight: 600;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.walkthrough .parent-link:hover { border-color: var(--honey); color: var(--honey-deep); }
.walkthrough .parent-link:active { transform: scale(0.96); }

/* ---------------------------------------------------------------------------
   RESPONSIVE — TABLET IS FIRST-CLASS. Rules above are already tablet-tuned.
   Below: the DESKTOP enhancement (roomier), and the PHONE compaction.
   --------------------------------------------------------------------------- */

/* Desktop enhancement: wider stage, roomier grid */
@media (min-width: 1024px) {
  .stage { padding: 48px; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Phone: single column, tighter, answers full-width stack, chart scrollable */
@media (max-width: 560px) {
  .answer-grid { grid-template-columns: 1fr 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card { min-height: 150px; }
  .grid-chart { --cell: clamp(24px, 8vw, 34px); overflow-x: auto; }
  .topbar .captain { font-size: 1.1rem; }
  .topbar .parent-link { padding: 0 10px; }
}

/* ---------------------------------------------------------------------------
   REDUCED MOTION (§12.6). Doubling/finger-trick animations and sparks become
   instant static reveals; nothing pulses. The lesson still lands.
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .array-vis .dot { animation: none; }
  .walkthrough .wt-emoji { animation: none; }
  .spark.go { animation: none; opacity: 0; } /* no flash for reduced-motion */
}

/* utility */
.hidden { display: none !important; }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; justify-content: center; }
