@font-face { font-family: "Fredoka"; font-weight: 500; font-display: swap; src: url("../assets/fonts/fredoka-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 600; font-display: swap; src: url("../assets/fonts/fredoka-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Fredoka"; font-weight: 700; font-display: swap; src: url("../assets/fonts/fredoka-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 400; font-display: swap; src: url("../assets/fonts/nunito-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 700; font-display: swap; src: url("../assets/fonts/nunito-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-weight: 800; font-display: swap; src: url("../assets/fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 300 550; font-display: swap; src: url("../assets/fonts/atkinson-hyperlegible-next-400.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible Next"; font-weight: 551 900; font-display: swap; src: url("../assets/fonts/atkinson-hyperlegible-next-700.woff2") format("woff2"); }

:root {
  --forest: #24503A; --forest-deep: #183829; --leaf: #5E8C4A; --moss: #7FA36B;
  --gold: #E3A72F; --amber-deep: #8F5A0E; --cream: #FBF5E6; --paper: #FFFDF7;
  --parchment: #F4E8CC; --bark: #6B4C3B; --ink: #2B2A22; --muted: #5B574A;
  --display: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, sans-serif;
  --reading: "Atkinson Hyperlegible Next", "Nunito", system-ui, sans-serif;
  --tap: 96px;            /* child targets: well above the 64px floor */
  --radius: 28px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--cream); color: var(--ink); font: 400 20px/1.5 var(--body); -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 5px solid var(--gold); outline-offset: 4px; }

.app { min-height: 100%; display: flex; flex-direction: column; max-width: 1100px; margin: 0 auto; padding: 12px 16px 16px; }
.topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { height: 40px; width: auto; }
.brand { font: 700 24px/1 var(--display); color: var(--forest); }
.brand small { font: 700 13px var(--body); color: var(--amber-deep); text-transform: uppercase; letter-spacing: .06em; margin-left: 6px; }
.grownups { margin-left: auto; position: relative; min-height: 48px; padding: 8px 16px 8px 46px; border-radius: 999px; border: 2px solid var(--forest); background: var(--paper); color: var(--forest); font: 700 16px var(--body); user-select: none; -webkit-user-select: none; touch-action: none; }
.grownups .ring { position: absolute; left: 10px; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: conic-gradient(var(--forest) calc(var(--p, 0) * 1turn), var(--parchment) 0); }

.stage { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 16px 0; }
.scene { width: 100%; display: grid; grid-template-columns: minmax(140px, 220px) 1fr; gap: 20px; align-items: center; }
.scene.title { grid-template-columns: 1fr; }
.guide { width: 100%; max-width: 220px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(36,80,58,.15)); }
.guides { display: flex; justify-content: center; }
.guides img { width: 50%; }
.hero { width: 100%; border-radius: var(--radius); display: block; box-shadow: 0 10px 30px rgba(36,80,58,.12); }

.say { display: flex; gap: 16px; align-items: flex-start; background: var(--paper); border: 3px solid var(--parchment); border-radius: var(--radius); padding: 16px; }
.replay { flex: none; width: var(--tap); height: var(--tap); border-radius: 50%; border: 0; background: var(--forest); color: var(--cream); display: grid; place-items: center; box-shadow: 0 6px 0 var(--forest-deep); }
.replay:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--forest-deep); }
.replay svg { width: 52px; height: 52px; }
.replay.speaking { background: var(--leaf); }
.caption { font: 600 26px/1.45 var(--reading); color: var(--ink); margin: 0; }
.caption .w.on { background: #F6DFA4; border-radius: 6px; }
.big .caption { font-size: 34px; }
.adult-tip { margin: 8px 0 0; font: 700 15px/1.4 var(--body); color: var(--amber-deep); }
.nocaps .caption { display: none; }

.choices { display: flex; flex-wrap: wrap; gap: 20px; justify-content: center; width: 100%; }
.choice { width: 200px; min-height: 200px; border-radius: var(--radius); border: 4px solid var(--parchment); background: var(--paper); padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 6px 0 var(--parchment); }
.choice:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--parchment); }
.choice .pic { width: 150px; height: 150px; }
.choice .lbl { font: 700 18px var(--body); color: var(--muted); }
.choice.right { border-color: var(--forest); background: #EAF2E4; }
.choice.hint { border-color: var(--gold); border-style: dashed; }
.choice.try { animation: wiggle .5s; }
.choice.wide { width: 260px; }
@keyframes wiggle { 25% { transform: rotate(-3deg); } 75% { transform: rotate(3deg); } }

.word { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
/* Letter box on top, sound dot in its own row below (clear of descenders: g p y j q). */
.sound { min-width: var(--tap); height: 120px; padding: 0 18px; border-radius: 24px; border: 4px solid var(--forest); background: var(--paper); font: 700 72px/1.2 var(--reading); color: var(--forest-deep); position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.sound::after { content: ""; display: block; flex: none; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); }
.sound.lit { background: #F6DFA4; }
.sentence { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; }
.sentence .sword { min-height: var(--tap); padding: 10px 20px; border-radius: 20px; border: 3px solid var(--parchment); background: var(--paper); font: 700 56px/1 var(--reading); color: var(--forest-deep); }
.sentence .sword.lit { background: #F6DFA4; }

.cta { min-height: var(--tap); min-width: 220px; padding: 0 36px; border-radius: 999px; border: 0; background: var(--gold); color: var(--forest-deep); font: 700 32px var(--display); box-shadow: 0 6px 0 var(--amber-deep); display: inline-flex; align-items: center; justify-content: center; gap: 12px; }
.cta:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--amber-deep); }
.cta.green { background: var(--forest); color: var(--cream); box-shadow: 0 6px 0 var(--forest-deep); }
.cta svg { width: 40px; height: 40px; }
.mic { display: none; }
.has-mic .mic { display: inline-flex; }
.row-c { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

.stars { display: flex; gap: 10px; justify-content: center; }
.stars svg { width: 80px; height: 80px; }
.pop { animation: pop .6s ease-out both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.calm *, .calm *::before { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.progress ol { list-style: none; display: flex; gap: 10px; justify-content: center; margin: 8px 0 0; padding: 0; }
.progress li { width: 16px; height: 16px; border-radius: 50%; background: var(--parchment); }
.progress li.done { background: var(--moss); }
.progress li.now { background: var(--forest); transform: scale(1.3); }

.overlay { position: fixed; inset: 0; background: rgba(24,56,41,.55); display: grid; place-items: center; padding: 16px; z-index: 10; }
.overlay[hidden] { display: none; }
.sheet { background: var(--paper); border-radius: 24px; padding: 24px; max-width: 520px; width: 100%; max-height: 92vh; overflow: auto; font-size: 18px; }
.sheet.wide { max-width: 720px; }
.sheet h2 { font: 700 28px var(--display); color: var(--forest); margin: 0 0 8px; }
.sheet h3 { font: 700 20px var(--display); color: var(--forest); margin: 18px 0 6px; }
.note { color: var(--muted); margin: 0; }
.gate-q { font-size: 22px; font-weight: 700; }
.gate-opts { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.gate-opts button, .sheet .primary, .sheet .quiet { min-height: 48px; padding: 8px 18px; border-radius: 12px; font-weight: 700; }
.gate-opts button { min-width: 72px; border: 2px solid var(--forest); background: var(--cream); font-size: 22px; }
.primary { background: var(--forest); color: var(--cream); border: 0; }
.quiet { background: transparent; border: 2px solid var(--bark); color: var(--bark); }
.row { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.row input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--forest); }
.row select { font: inherit; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--forest); background: var(--cream); }
.btnrow { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; margin-top: 20px; }
table.prog { border-collapse: collapse; width: 100%; font-size: 16px; }
table.prog td, table.prog th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--parchment); }

@media (max-width: 640px) {
  .scene { grid-template-columns: 1fr; justify-items: center; }
  .guide { max-width: 150px; }
  .choice { width: 150px; min-height: 160px; } .choice .pic { width: 110px; height: 110px; }
  .caption { font-size: 22px; }
  .sound { height: 100px; font-size: 56px; gap: 4px; } .sound::after { width: 12px; height: 12px; } .sentence .sword { font-size: 40px; }
}
.defs { position: absolute; width: 0; height: 0; }
.choice[aria-disabled="true"] { opacity: .55; }
.hero { max-height: 52vh; object-fit: cover; object-position: 60% 50%; }
.caption { font-weight: 700; }
.scene.title + .say + .cta, .stage > .cta { margin-top: 4px; }
.privacy-note { margin: 0 0 6px; font-weight: 700; color: var(--forest); }
.confirm { border: 2px solid var(--gold); background: var(--cream); border-radius: 14px; padding: 12px 16px; margin: 10px 0; }
.confirm[hidden] { display: none; }
.confirm p { margin: 0 0 4px; font-weight: 700; }
.btnrow.left { justify-content: flex-start; margin-top: 10px; }
.sheet .danger { min-height: 48px; padding: 8px 18px; border-radius: 12px; font-weight: 700; background: #8E2F1F; color: #FFFDF7; border: 0; }
.sheet button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- early version: badge, picker, new cast, footer ---------- */
.brand { margin: 0; }
.badge { display: inline-block; font: 700 13px/1.2 var(--body); color: var(--amber-deep); background: var(--paper); border: 2px solid var(--amber-deep); border-radius: 999px; padding: 3px 10px; letter-spacing: .02em; }
.early-line { margin: 0 0 8px; }
.early-line .badge { margin-right: 6px; }
.picker { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; width: 100%; }
.pick-card { width: min(100%, 440px); border: 4px solid var(--parchment); border-radius: var(--radius); background: var(--paper); padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: stretch; box-shadow: 0 6px 0 var(--parchment); }
.pick-card:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--parchment); }
.pick-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; display: block; }
.pick-title { font: 700 26px/1.2 var(--display); color: var(--forest); }
.cameo { display: flex; align-items: center; gap: 14px; background: var(--paper); border: 3px dashed var(--gold); border-radius: var(--radius); padding: 10px 16px; max-width: 640px; }
.cameo-img { width: 110px; height: 110px; object-fit: contain; flex: none; }
.cameo .caption { font-size: 22px; }
.guides.three img { width: 33%; }
.breath-ring { width: 120px; height: 120px; border-radius: 50%; border: 6px solid var(--moss); background: #EAF2E4; }
.breath-ring.go { animation: breathe 6s ease-in-out; }
@keyframes breathe { 0% { transform: scale(.7); } 45% { transform: scale(1.25); } 100% { transform: scale(.7); } }
.sitefoot { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--parchment); font-size: 14px; color: var(--muted); text-align: center; }
.foot-note { margin: 4px 0; }
.footlinks, .sheetlinks { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; justify-content: center; }
.footlinks a, .sheetlinks a { color: var(--forest); display: inline-block; min-height: 24px; padding: 2px 0; text-underline-offset: 3px; }
.sheetlinks { justify-content: flex-start; font-size: 17px; gap: 6px 18px; }
.sheetlinks a { min-height: 32px; }
.linkbtn { display: inline-flex; align-items: center; min-height: 48px; padding: 8px 18px; border-radius: 12px; background: var(--forest); color: var(--cream); font-weight: 700; text-decoration: none; }
.steps { margin: 6px 0; padding-left: 22px; }
.steps li { margin-bottom: 6px; }
.tablewrap { overflow-x: auto; }
table.prog thead th { font-size: 14px; color: var(--muted); }
@media (max-width: 640px) {
  .pick-title { font-size: 22px; }
  .cameo { flex-direction: column; text-align: center; }
  .sheet { padding: 18px; }
  .sound { min-width: 88px; }
}
