/* NoxeTutor. Exercise-book blue page, navy ink, school-bus yellow for the one thing to press. */
/* Gabarito by Naipe Foundry, SIL Open Font License. Served from this folder so no request leaves the device. */
@font-face { font-family: 'Gabarito'; src: url('../fonts/gabarito-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }
:root {
  --page: #E8EEF5;
  --sheet: #FFFFFF;
  --ink: #15233A;
  --soft: #4A5B73;
  --line: #C3CFDD;
  --rule: #DCE5EF;
  --go: #FFC52E;
  --go-edge: #C7920C;
  --blue: #2F68C0;
  --good: #1E7A4B;
  --warn: #B4441A;
  --close: #7A5A00;
  --focus: #2F68C0;
  --r: 8px;
  --go-ink: #15233A;
  --press: 4px;
  --r-btn: 8px;
  --r-card: 14px;
  --font: 'Gabarito', 'Avenir Next', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 18px/1.5 var(--font); font-variant-numeric: tabular-nums lining-nums;
  min-height: 100vh;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 6vw, 44px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 .8em; max-width: 62ch; }
a { color: var(--blue); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--sheet); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.noscript { padding: 24px; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 820px; margin: 0 auto; padding: 14px 16px 6px; }
.brand { font-weight: 900; font-size: 24px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--blue); }
.brand small { font-size: 14px; font-weight: 600; color: var(--soft); letter-spacing: 0; margin-left: 2px; }
.top-nav { display: flex; gap: 4px; }
.top-nav a { color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: var(--r); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.top-nav a:hover { background: var(--rule); }
.top-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 3px; }
body.in-practice .top { display: none; }

main { max-width: 820px; margin: 0 auto; padding: 8px 16px 64px; outline: none; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: var(--r); border: 2px solid var(--ink); background: var(--sheet); font-weight: 700; font-size: 18px; cursor: pointer; text-decoration: none; color: var(--ink); }
.btn:hover { background: var(--rule); }
.btn-go { background: var(--go); color: var(--go-ink); border-color: var(--go-edge); box-shadow: 0 var(--press) 0 var(--go-edge); font-size: 20px; min-height: 60px; padding: 0 28px; border-radius: var(--r-btn); }
.btn-go:hover { filter: brightness(1.06); }
.btn-go:active { transform: translateY(calc(var(--press) - 1px)); box-shadow: 0 1px 0 var(--go-edge); }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 10px 4px; min-height: 44px; color: var(--blue); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font-weight: 600; }
.link-quiet { color: var(--soft); }
.row-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }

/* ---------- forms ---------- */
label.field { display: block; margin: 0 0 18px; font-weight: 700; }
label.field span.help { display: block; font-weight: 400; color: var(--soft); font-size: 16px; }
.input, select.input { display: block; width: 100%; max-width: 420px; min-height: 56px; margin-top: 6px; padding: 10px 14px; font-size: 22px; border: 2px solid var(--ink); border-radius: var(--r); background: var(--sheet); }
select.input { font-size: 19px; }
.err { color: var(--warn); font-weight: 600; }

/* ---------- welcome ---------- */
.welcome { padding-top: 12px; }
.welcome-sum { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: baseline; margin: 6px 0 28px; }
.welcome-sum dt { font-size: clamp(30px, 6vw, 40px); font-weight: 900; line-height: 1; white-space: nowrap; }
.welcome-sum dd { margin: 0; color: var(--soft); }
.promise { color: var(--soft); font-size: 16px; margin-top: 20px; }
.sheet { background: var(--sheet); border: 2px solid var(--ink); border-radius: 12px; padding: 22px 20px; box-shadow: 0 6px 0 var(--line); }

/* ---------- home ---------- */
.hello { margin-top: 12px; }
.today { margin: 18px 0 26px; }
.today .plan-line { font-size: 21px; margin-bottom: 18px; }
.rows { border-top: 1px solid var(--line); margin: 8px 0 24px; padding: 0; list-style: none; }
.rows > li { border-bottom: 1px solid var(--line); }
.rowlink { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; min-height: 60px; padding: 12px 4px; background: none; border: 0; text-align: left; color: var(--ink); text-decoration: none; cursor: pointer; font-size: 18px; }
.rowlink:hover { background: rgba(255, 255, 255, .55); }
.rowlink .main { display: block; font-weight: 700; }
.rowlink .sub { display: block; color: var(--soft); font-size: 15px; font-weight: 400; }
.rowlink .val { text-align: right; white-space: nowrap; font-weight: 700; }
.chev { color: var(--soft); margin-left: 6px; }
.tone-good { color: var(--good); }
.tone-due { color: var(--blue); }
.tone-warn { color: var(--warn); }
.tone-close { color: var(--close); }
.tone-learn { color: var(--ink); }
.tone-new { color: var(--soft); }
.tone-locked { color: #7C8798; font-weight: 500; }
.strand { margin-top: 30px; font-size: 21px; }

/* ---------- practice ---------- */
.pbar { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.pbar .count { font-weight: 700; white-space: nowrap; }
.track { flex: 1; height: 10px; background: var(--rule); border-radius: 5px; overflow: hidden; border: 1px solid var(--line); }
.track i { display: block; height: 100%; width: 100%; background: var(--blue); transform-origin: left center; transition: transform .3s; }
.kind { color: var(--soft); font-weight: 600; margin: 4px 0 8px; }
.kind strong { color: var(--ink); }
.card { background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--r-card); padding: 22px 20px 20px; box-shadow: 0 6px 0 var(--line); }
.prompt { font-size: clamp(36px, 8.5vw, 76px); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; margin: 2px 0 18px; overflow-wrap: anywhere; }
.prompt.wordy { font-size: clamp(24px, 4.8vw, 34px); font-weight: 700; letter-spacing: 0; line-height: 1.3; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .78em; line-height: 1; margin: 0 .08em; }
.frac > span { padding: 0 .12em; }
.frac > span:first-child { border-bottom: .07em solid currentColor; padding-bottom: .06em; }
.frac > span:last-child { padding-top: .06em; }
.frac .blank { color: var(--blue); }

.answer { display: flex; flex-wrap: wrap; gap: 12px; align-items: stretch; }
.answer .input { flex: 1 1 200px; max-width: 320px; margin: 0; font-size: 32px; font-weight: 700; min-height: 64px; }
.answer .btn-go { min-height: 64px; }
.choices { display: flex; gap: 12px; flex-wrap: wrap; }
.choice { min-width: 88px; min-height: 76px; font-size: 40px; font-weight: 800; border: 2px solid var(--ink); background: var(--sheet); border-radius: var(--r); cursor: pointer; box-shadow: 0 4px 0 var(--ink); }
.choice:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.helpers { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; }

.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 14px; max-width: 520px; }
.keypad button { min-height: 56px; font-size: 24px; font-weight: 700; border: 1.5px solid var(--line); background: var(--page); border-radius: var(--r); cursor: pointer; }
.keypad button:active { background: var(--rule); }
.keypad .wide { grid-column: span 2; font-size: 18px; }
.keypad-small { grid-template-columns: repeat(3, 1fr); max-width: 360px; }
.keypad-small .wide { grid-column: span 3; }

.feedback { margin-top: 18px; font-size: 20px; }
.feedback:empty { display: none; }
.feedback .verdict { font-weight: 800; font-size: 24px; display: block; margin-bottom: 4px; }
.feedback.ok .verdict { color: var(--good); }
.feedback.no .verdict { color: var(--warn); }
.feedback.part .verdict { color: var(--close); }
.feedback p { margin-bottom: 10px; }

.hintbox { margin-top: 16px; padding: 14px 16px; background: #FFF6D6; border: 1.5px solid #E7CC72; border-radius: var(--r); }
.hintbox p { margin: 0 0 6px; }
.hintbox p:last-child { margin: 0; }

.steps { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; padding: 12px 0; border-top: 1px solid var(--rule); }
.steps li::before { content: counter(st); font-weight: 800; color: var(--blue); font-size: 20px; }
.steps li > div { min-width: 0; }
.steps .ask { font-weight: 700; font-size: 21px; }
.steps .given { color: var(--good); font-weight: 800; }
.steps .mini { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.steps .mini .input { max-width: 180px; min-height: 52px; font-size: 24px; margin: 0; }
.steps .mini .btn { min-height: 52px; }
.steps .later { color: #8792A2; }
.steps .note { color: var(--warn); font-size: 17px; margin-top: 4px; }

.example { margin: 6px 0 20px; }
.example .prompt { font-size: clamp(30px, 6vw, 52px); }
.example-label { font-weight: 700; color: var(--blue); }

/* ---------- pictures ---------- */
.picture { margin-top: 18px; border-top: 1px solid var(--rule); padding-top: 8px; }
.picture > summary { cursor: pointer; font-weight: 700; color: var(--blue); min-height: 44px; display: flex; align-items: center; list-style: none; }
.picture > summary::-webkit-details-marker { display: none; }
.picture > summary::before { content: '+'; display: inline-block; width: 22px; font-weight: 900; }
.picture[open] > summary::before { content: '\2212'; }
.vis { padding: 8px 0 4px; }
.vis-svg { display: block; max-width: 100%; height: auto; font-family: var(--font); }
.vis-cap { color: var(--soft); font-size: 17px; margin: 8px 0; min-height: 1.5em; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.tool { min-height: 48px; padding: 0 16px; border: 1.5px solid var(--ink); background: var(--sheet); border-radius: var(--r); font-weight: 600; cursor: pointer; font-size: 17px; }
.tool:hover { background: var(--rule); }
.tool:active { background: var(--line); }

.blocks { display: grid; gap: 14px; }
.block-row { display: grid; gap: 6px; }
.block-label { font-weight: 700; font-size: 15px; color: var(--soft); }
.block-area { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px; min-height: 60px; }
.block-count { color: var(--soft); font-size: 16px; }
.blk { border: 1.5px solid var(--ink); padding: 0; cursor: pointer; display: inline-block; }
.blk.hund { width: 70px; height: 70px; background-color: #2E9A62; background-image: linear-gradient(rgba(21,35,58,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(21,35,58,.35) 1px, transparent 1px); background-size: 7px 7px; }
.blk.ten { width: 14px; height: 70px; background-color: #3D7BD9; background-image: linear-gradient(rgba(21,35,58,.45) 1px, transparent 1px); background-size: 14px 7px; }
.blk.one { width: 14px; height: 14px; background: #FFC52E; }
.blk.one.gone { background: transparent; border-style: dashed; position: relative; }
.blk.one.gone::after { content: ''; position: absolute; left: -2px; right: -2px; top: 50%; border-top: 2px solid var(--warn); transform: rotate(-45deg); }
.ones { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 110px; align-items: flex-end; }

.area { display: grid; gap: 6px; max-width: 560px; }
.area-corner, .area-head { font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; padding: 6px; }
.area-box { min-height: 74px; border: 2px solid var(--ink); border-radius: 4px; background: #EAF1FC; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 16px; }
.area-box.open { background: #FFF1C2; cursor: default; }
.area-box strong { font-size: 24px; }
.area-q { color: var(--soft); }

.pv { display: grid; gap: 4px; max-width: 520px; }
.pv-name { font-size: 14px; color: var(--soft); text-align: center; font-weight: 600; }
.pv-digit { font-size: 40px; font-weight: 800; min-height: 72px; border: 2px solid var(--ink); background: var(--sheet); border-radius: 4px; cursor: pointer; }
.pv-digit:hover { background: #FFF1C2; }

.groups { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; min-height: 48px; }
.group { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 7px; border: 2px solid var(--blue); border-radius: 50%; max-width: 92px; justify-content: center; }
.loose { display: inline-flex; flex-wrap: wrap; gap: 4px; max-width: 320px; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--go); border: 1.5px solid var(--ink); display: inline-block; }

.ops-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: 34px; font-weight: 800; }
.ops-tok { padding: 2px 8px; border-radius: 4px; }
.ops-tok.now { background: var(--go); outline: 2px solid var(--ink); }

/* ---------- finish ---------- */
.result-line { font-size: 22px; }
.mastered-note { font-size: 22px; font-weight: 700; color: var(--good); }

/* ---------- grown-ups ---------- */
.section { margin-top: 36px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); margin: 10px 0 18px; }
.facts div { background: var(--page); padding: 12px 14px; }
.facts b { display: block; font-size: 26px; font-weight: 800; }
.facts span { color: var(--soft); font-size: 15px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 16px; }
table.plain th { text-align: left; font-weight: 700; color: var(--soft); border-bottom: 2px solid var(--line); padding: 8px 6px; }
table.plain td { border-bottom: 1px solid var(--line); padding: 10px 6px; vertical-align: top; }
table.plain td.num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; border-bottom: 1px solid var(--line); }
.switch { appearance: none; width: 52px; height: 32px; border-radius: 999px; background: #B7C2D0; position: relative; cursor: pointer; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(20px); }

/* ---------- toast with undo ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 14px 12px 18px; border-radius: var(--r); display: flex; gap: 14px; align-items: center; max-width: calc(100% - 32px); z-index: 20; font-size: 17px; }
[hidden] { display: none !important; }
.toast button { background: none; border: 0; color: var(--go); font-weight: 800; text-decoration: underline; cursor: pointer; min-height: 40px; }

.pop { animation: pop .35s ease-out; }
@keyframes pop { 0% { transform: scale(.96); opacity: .4; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 520px) {
  body { font-size: 17px; }
  .card { padding: 18px 14px; }
  .keypad { gap: 6px; }
  .rowlink .val { font-size: 16px; }
}

/* ---------- printing a practice sheet ---------- */
#print { display: none; }
@media print {
  body { background: #fff; }
  body > *:not(#print) { display: none !important; }
  #print { display: block; color: #000; font-size: 15pt; }
  #print h1 { font-size: 22pt; margin-bottom: 4pt; }
  #print .ws-meta { font-size: 11pt; margin-bottom: 14pt; }
  #print ol { columns: 2; column-gap: 28pt; padding-left: 22pt; }
  #print li { break-inside: avoid; margin-bottom: 30pt; }
  #print .ws-line { display: block; margin-top: 16pt; border-bottom: 1px solid #000; width: 70%; }
  #print .key { break-before: page; }
  #print .key li { margin-bottom: 8pt; font-size: 12pt; }
  #print .frac { font-size: .8em; }
}

/* =========================================================
   Looks by age. html[data-age] is set from the learner's school year.
   young  (grades 1-3): game board, stars, chunky amber controls (after the gamified app reference)
   middle (grades 4-5): violet and lime, white cards, doodle page (after the tutoring landing reference)
   older  (grades 6-7): navy band with chalk maths doodles, sunny yellow, more help (after the math tutoring reference)
   ========================================================= */
.star path { fill: var(--star, #FFB524); stroke: var(--star-edge, #B85410); stroke-width: 1.6; }
.star-half path { fill: var(--star-soft, #FFE2A3); }
.star-empty path { fill: transparent; stroke: var(--line); }
.star-now path { fill: #fff; stroke: var(--star-edge, #B85410); stroke-width: 2.4; }
.kid-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 20px; margin-top: 12px; }
.score { display: flex; gap: 18px; flex-wrap: wrap; margin: 0; font-weight: 600; }
.score-item { display: inline-flex; align-items: center; gap: 6px; }
.score-item b { font-size: 22px; font-weight: 900; }
.starline { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; align-items: center; }
.starline.big { gap: 6px; margin: 6px 0 10px; }
.star-earned { display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--star-edge, #B85410); font-size: 20px; }
.kbd-hint { color: var(--soft); font-size: 15px; margin: 10px 0 0; }
.method { margin-top: 6px; }
.method > summary { cursor: pointer; font-weight: 700; color: var(--blue); min-height: 44px; display: flex; align-items: center; }
.btn-big { min-height: 66px; font-size: 22px; }

/* medal for a mastered skill */
.medals { display: grid; gap: 12px; margin: 8px 0 18px; }
.medal { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.medal-disc { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #FFE7A1, #FFB524 60%, #D9850F); border: 3px solid #B85410; box-shadow: 0 5px 0 #8A3A0A; flex: none; }
.medal-disc .star path { fill: #fff; stroke: #B85410; }
.medal-text { display: grid; }
.medal-text b { font-size: 22px; font-weight: 900; }

/* dotted journey (middle and older) */
.journey-wrap { margin: 26px 0 10px; }
.journey { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.journey li { display: grid; justify-items: center; text-align: center; gap: 6px; position: relative; padding: 0 4px; }
.journey li:not(:last-child)::after { content: ''; position: absolute; top: 19px; left: calc(50% + 22px); right: calc(-50% + 22px); border-top: 3px dotted var(--j-line, var(--line)); }
.j-dot { width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--sheet); display: grid; place-items: center; }
.j-good .j-dot, .j-due .j-dot { background: var(--j-done, #FFF1C2); }
.j-now .j-dot { background: var(--go); border-color: var(--go-edge); box-shadow: 0 0 0 5px color-mix(in srgb, var(--go) 30%, transparent); }
.j-locked .j-dot { border-color: var(--line); }
.j-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.j-word { font-size: 13px; font-weight: 700; }
@media (max-width: 600px) {
  .journey { grid-template-columns: 1fr; gap: 14px; }
  .journey li { grid-template-columns: 40px 1fr auto; justify-items: start; text-align: left; align-items: center; gap: 12px; }
  .journey li:not(:last-child)::after { top: 42px; bottom: -14px; left: 19px; right: auto; border-top: 0; border-left: 3px dotted var(--j-line, var(--line)); }
}

/* the youngest: a game board */
.village-wrap { max-width: 460px; margin: 22px auto 26px; }
.adventure { position: relative; border-radius: 26px; overflow: hidden; border: 3px solid #4E9A36; box-shadow: 0 7px 0 #3E7F2A; background: #88CE5D; }
.village { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.village .v-cloud { animation: v-drift 14s ease-in-out infinite alternate; }
@keyframes v-drift { to { translate: 14px 0; } }
.village .v-duck { animation: v-paddle 5s ease-in-out infinite alternate; }
@keyframes v-paddle { to { translate: -16px 0; } }
.castle-sign { position: absolute; transform: translate(-50%, -50%); margin: 0; white-space: nowrap; background: #FFF3D6; color: #5A3410; border: 2px solid #B07A3E; box-shadow: 0 3px 0 #B07A3E; border-radius: 10px; padding: 4px 12px; font-weight: 900; font-size: 15px; }
.village-note { text-align: center; margin: 12px 0 0; font-weight: 700; color: #3E6A2A; }
.road { position: absolute; inset: 0; width: 100%; height: 100%; }
.road path { fill: none; stroke-linecap: round; }
.road-edge { stroke: #C99A55; stroke-width: 46px; }
.road-top { stroke: #F3D9A4; stroke-width: 38px; }
.road-line { stroke: #fff; stroke-width: 4px; stroke-dasharray: 10 14; }
.stop-wrap { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; width: 150px; }
.stop { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font: 900 22px var(--font); cursor: pointer; border: 3px solid #8A3A0A; background: #fff; color: #2B1A0E; box-shadow: 0 6px 0 #8A3A0A; }
.stop:active { transform: translateY(4px); box-shadow: 0 2px 0 #8A3A0A; }
.stop-done { background: #FFB524; }
.stop-done .star path { fill: #fff; }
.stop-now { width: 86px; height: 86px; background: #FF7A1A; color: #fff; font-size: 22px; border-color: #8A3A0A; box-shadow: 0 7px 0 #8A3A0A, 0 0 0 8px rgba(255,255,255,.7); animation: stop-hop 1.6s ease-in-out 2; }
.stop-locked { background: #E7EDF2; color: #8796A6; border-color: #9AA9B8; box-shadow: 0 6px 0 #9AA9B8; }
.stop-name { background: #FFF3D6; padding: 3px 10px; border-radius: 10px; font-weight: 800; font-size: 14px; line-height: 1.2; text-align: center; color: #5A3410; border: 2px solid #B07A3E; box-shadow: 0 3px 0 #B07A3E; }
@keyframes stop-hop { 0%, 100% { transform: none; } 30% { transform: translateY(-8px); } 55% { transform: none; } }

/* ---------- young (grades 1-3) ---------- */
:root[data-age="young"] {
  --page: #D7EEFF; --sheet: #FFFFFF; --ink: #2B1A0E; --soft: #6A5240; --line: #E3CFB4; --rule: #F2E6D4;
  --go: #FFB524; --go-edge: #B85410; --go-ink: #2B1A0E; --press: 6px; --r: 14px; --r-btn: 18px; --r-card: 26px;
  --blue: #2F6FD0; --good: #2E8B3E; --warn: #C2410C;
}
:root[data-age="young"] body { font-size: 19px; }
:root[data-age="young"] .brand span { color: #FF7A1A; }
:root[data-age="young"] .card { border-width: 3px; border-color: #B85410; box-shadow: 0 8px 0 #F0C78C; }
:root[data-age="young"] .prompt { font-size: clamp(44px, 11vw, 90px); }
:root[data-age="young"] .btn { border-width: 3px; border-radius: var(--r-btn); }
:root[data-age="young"] .tool { border-radius: 12px; border-width: 2px; min-height: 52px; }
:root[data-age="young"] .choice { border-radius: 18px; border-width: 3px; box-shadow: 0 6px 0 var(--go-edge); background: #FFF4DC; }
:root[data-age="young"] .keypad button { border-radius: 14px; border: 2px solid #E3CFB4; background: #FFF8EC; box-shadow: 0 4px 0 #E3CFB4; min-height: 62px; font-size: 28px; }
:root[data-age="young"] .answer .input { border-width: 3px; border-radius: 16px; font-size: 38px; }
:root[data-age="young"] .feedback.ok { background: #E7F7DA; border: 3px solid #7FCB5A; border-radius: 20px; padding: 14px 16px; }
:root[data-age="young"] .feedback.no { background: #FFEBDD; border: 3px solid #FFB38A; border-radius: 20px; padding: 14px 16px; }
:root[data-age="young"] .feedback .verdict { font-size: 30px; }
:root[data-age="young"] .hintbox { border-radius: 18px; border-width: 2px; }
:root[data-age="young"] .rows { background: #fff; border-radius: 22px; border: 3px solid #E3CFB4; padding: 0 14px; }
:root[data-age="young"] .rows > li:last-child { border-bottom: 0; }
:root[data-age="young"] .sheet { border-color: #B85410; border-width: 3px; border-radius: 26px; box-shadow: 0 8px 0 #F0C78C; }

/* ---------- middle (grades 4-5) ---------- */
:root[data-age="middle"] {
  --page: #F3EBFF; --sheet: #FFFFFF; --ink: #24113D; --soft: #5E4A7A; --line: #D9C8F2; --rule: #EADFFB;
  --go: #8B3BE0; --go-edge: #5B1FA3; --go-ink: #FFFFFF; --press: 5px; --r: 12px; --r-btn: 14px; --r-card: 20px;
  --blue: #7A2FD6; --good: #3C8C12; --warn: #B3261E; --focus: #7A2FD6;
  --star: #A6E22E; --star-edge: #4F7F0A; --star-soft: #DDF3B0; --j-done: #E9F8CC; --j-line: #B79BE8;
}
:root[data-age="middle"] body { background-color: var(--page); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' fill='none' stroke='%238B3BE0' stroke-opacity='.10' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M22 30h18M31 21v18'/%3E%3Cpath d='M96 18l14 14M110 18L96 32'/%3E%3Cpath d='M146 76h16M146 85h16'/%3E%3Cpath d='M38 116l20-34 20 34z'/%3E%3Ccircle cx='132' cy='146' r='13'/%3E%3Cpath d='M12 160c9-16 25-16 34 0'/%3E%3Cpath d='M90 92q10-14 20 0t20 0'/%3E%3C/svg%3E"); }
:root[data-age="middle"] .brand span { color: #8B3BE0; }
:root[data-age="middle"] .card, :root[data-age="middle"] .sheet { border-color: #CDB6F0; box-shadow: 0 10px 28px rgba(91,31,163,.12); }
:root[data-age="middle"] .btn { border-radius: var(--r-btn); }
:root[data-age="middle"] .feedback.ok .verdict { color: #3C8C12; }
:root[data-age="middle"] .track i { background: #A6E22E; }
:root[data-age="middle"] .choice { box-shadow: 0 5px 0 var(--go-edge); border-color: var(--go-edge); }

/* ---------- older (grades 6-7) ---------- */
:root[data-age="older"] {
  --page: #E4F0FC; --sheet: #FFFFFF; --ink: #0E2340; --soft: #46597A; --line: #BFD2EA; --rule: #DCE8F6;
  --go: #FFD35A; --go-edge: #0E3766; --go-ink: #0E2340; --press: 3px; --r: 8px; --r-btn: 10px; --r-card: 14px;
  --blue: #1E5FB4; --star: #FFD35A; --star-edge: #0E3766;
}
.hero-band { margin: 10px 0 8px; padding: 26px 22px 24px; border-radius: 18px; color: #fff; background-color: #0E3766;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220' fill='none' stroke='white' stroke-opacity='.08' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M20 34h20M30 24v20'/%3E%3Cpath d='M120 22l14 14M134 22l-14 14'/%3E%3Cpath d='M176 92h18M176 101h18'/%3E%3Cpath d='M30 150l26-44 26 44z'/%3E%3Ccircle cx='160' cy='170' r='20'/%3E%3Cpath d='M140 170h40'/%3E%3Cpath d='M86 70c10-22 34-22 44 0'/%3E%3Cpath d='M90 200h22M101 194v0M101 206v0'/%3E%3Ctext x='60' y='112' font-family='sans-serif' font-size='15' fill='white' fill-opacity='.08' stroke='none'%3Ex+y=10%3C/text%3E%3Ctext x='120' y='132' font-family='sans-serif' font-size='14' fill='white' fill-opacity='.08' stroke='none'%3Ea%C2%B2+b%C2%B2%3C/text%3E%3C/svg%3E"); }
.hero-band h1 { color: #fff; font-size: clamp(30px, 6vw, 46px); }
.hero-band .plan-line { color: #D8E6F8; font-size: 20px; }
.hero-hi { color: var(--go, #FFD35A); font-weight: 800; margin-bottom: 6px; }
.hero-band .btn-go { border-color: #FFD35A; box-shadow: 0 4px 0 #B8901A; }
.hero-band .link-quiet { color: #D8E6F8; }
:root[data-age="older"] .card { box-shadow: 0 4px 0 var(--line); }
:root[data-age="older"] .prompt { font-size: clamp(34px, 7.5vw, 64px); }
main:focus, main:focus-visible { outline: none; }
.brand { white-space: nowrap; }
.top-nav a { white-space: nowrap; }
@media (max-width: 480px) {
  .top { padding-top: 10px; }
  .brand { font-size: 21px; }
  .brand small { display: block; margin: -2px 0 0; font-size: 12px; }
  .top-nav a { padding: 10px 8px; font-size: 16px; }
}
.starline.big { flex-wrap: nowrap; }
.starline.big > * { flex: 0 1 34px; min-width: 0; }
.starline.big svg { width: 100%; height: auto; }

/* ---------- game art for the playful look (Fluent Emoji 3D, MIT) ---------- */
.art { display: block; height: auto; max-width: 100%; user-select: none; -webkit-user-drag: none; }
.deco { position: absolute; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 6px 4px rgba(30,70,20,.25)); }
.deco-sun, .deco-cloud { filter: none; }
.deco-cloud { animation: drift 9s ease-in-out infinite alternate; }
.deco-cloud-2 { animation-duration: 12s; opacity: .9; }
@keyframes drift { to { transform: translate(-40%, -50%); } }
.map-fox { position: absolute; z-index: 2; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 6px 3px rgba(40,90,25,.3)); animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -58%); } }
.stop-wrap { z-index: 1; }
.stop-done { background: #FFF3C4; }
.stop-done .art, .stop-locked .art { width: 70%; }
.castle { gap: 0; width: 200px; }
.castle .art { filter: drop-shadow(0 8px 4px rgba(30,70,20,.3)); }
.score-game { margin-top: 14px; gap: 6px 20px; }
.score-game .score-item { gap: 4px; }
.score-game .art { width: 34px; }
.buddy { display: flex; align-items: flex-end; gap: 10px; margin: 14px 0 18px; }
.buddy > .art { flex: none; width: 96px; animation: bob-small 2.6s ease-in-out infinite; }
@keyframes bob-small { 50% { transform: translateY(-5px); } }
.bubble { position: relative; flex: 1; background: #fff; border: 3px solid #2B1A0E; border-radius: 22px; padding: 12px 16px 14px; box-shadow: 0 5px 0 rgba(43,26,14,.18); margin-bottom: 26px; }
.bubble::before { content: ""; position: absolute; left: -15px; bottom: 16px; border: 9px solid transparent; border-right: 14px solid #2B1A0E; }
.bubble::after { content: ""; position: absolute; left: -9px; bottom: 19px; border: 6px solid transparent; border-right: 10px solid #fff; }
.bubble h1 { margin: 0; font-size: clamp(30px, 8vw, 42px); }
.bubble .plan-line { margin: 4px 0 0; font-size: 19px; }
.kind .art { display: inline-block; vertical-align: middle; width: 44px; margin-right: 8px; }
.kind:has(.art) { display: flex; align-items: center; }
.feedback { position: relative; }
.feedback-buddy { display: grid; grid-template-columns: 64px 1fr; column-gap: 12px; align-items: center; }
.feedback-buddy > * { grid-column: 1 / -1; }
.feedback-buddy > .art { grid-column: 1; grid-row: 1; width: 64px; }
.feedback-buddy > .verdict { grid-column: 2; grid-row: 1; margin: 0; }
.feedback.ok > .art-party-popper { animation: pop .4s ease-out; }
.star-earned .art { width: 36px; }
.confetti { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.confetti i { position: absolute; left: 50%; top: 35%; width: 9px; height: 14px; border-radius: 2px; background: var(--c); animation: confetti 1.15s cubic-bezier(.15,.7,.35,1) forwards; }
@keyframes confetti { 70% { opacity: 1; } to { transform: translate(var(--x), calc(var(--y) + 60px)) rotate(var(--r)); opacity: 0; } }
.prize { position: relative; display: grid; justify-items: center; text-align: center; margin: 10px 0 4px; }
.prize .art { width: 150px; animation: pop .5s ease-out; filter: drop-shadow(0 10px 6px rgba(120,70,0,.25)); }
.prize h1 { margin: 6px 0 0; }
.starline.big .dim .art { opacity: .35; filter: grayscale(1); }
.medal .art { width: 84px; flex: none; }
html, body { overflow-x: clip; }
