:root {
  color-scheme: light;
  --ink: #292440;
  --purple: #5b43bc;
  --purple-dark: #3d2b8f;
  --mint: #3ebd8b;
  --gold: #f0bd38;
  --cream: #fff9e8;
  --panel: rgba(255,255,255,.94);
  --shadow: 0 18px 50px rgba(48,35,91,.18);
  font-family: Nunito, "Trebuchet MS", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html,body { min-height: 100%; margin: 0; }
body {
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%,rgba(255,241,169,.95),transparent 28%),
    radial-gradient(circle at 88% 14%,rgba(187,229,255,.9),transparent 30%),
    linear-gradient(160deg,#e9f9ef,#eee8ff 54%,#fff4d0);
  overflow-x: hidden;
  padding-right: env(safe-area-inset-right);
  padding-left: env(safe-area-inset-left);
}
button { font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 4px solid #2f83c7; outline-offset: 3px; }
.world-glow { position: fixed; inset: 0; pointer-events: none; background-image: radial-gradient(circle,#fff 0 2px,transparent 3px); background-size: 54px 54px; opacity: .48; }
.page-shell { position: relative; width: min(960px,calc(100% - 24px)); margin: 0 auto; padding: 12px 0 28px; }

/* Stable product title */
.game-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; margin-bottom: 11px; padding: 11px 15px; border: 2px solid rgba(255,255,255,.8); border-radius: 24px; background: rgba(255,255,255,.83); box-shadow: 0 10px 28px rgba(60,45,104,.12); backdrop-filter: blur(12px); }
.brand-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 17px; background: linear-gradient(145deg,#ffe483,#f6bd35); box-shadow: 0 6px 0 #d69f23; font-size: 1.8rem; transform: rotate(-4deg); }
.brand-copy { min-width: 0; }
.eyebrow,.subtitle,.game-header h1 { margin: 0; }
.eyebrow { color: var(--purple); font-size: .64rem; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.game-header h1 { font-size: clamp(1.45rem,4vw,2rem); line-height: 1.05; }
.subtitle { color: #71698a; font-size: .8rem; font-weight: 800; }
.voice-toggle { min-height: 40px; padding: 8px 12px; border: 2px solid #d9ceef; border-radius: 13px; color: #49368f; background: #f8f4ff; font-size: .76rem; font-weight: 950; cursor: pointer; }
.game-toolbar { display: flex; justify-content: flex-end; gap: 7px; margin: -3px 5px 9px; }
.toolbar-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 11px; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; color: #4b3a86; background: rgba(255,255,255,.78); box-shadow: 0 5px 13px rgba(60,45,104,.09); font-size: .72rem; text-decoration: none; cursor: pointer; }
.toolbar-button strong { font-weight: 950; }.toolbar-button:hover,.toolbar-button:focus-visible { color: #2f2472; background: #fff; transform: translateY(-1px); }.language-button { color: #7a3a19; background: #fff2c7; }

.loading-state { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 420px; border-radius: 32px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.loading-state span { font-size: 3rem; animation: runaway 1s ease-in-out infinite alternate; }
.loading-state.is-error { flex-direction: column; color: #8a3651; }
.game-card { position: relative; min-height: 650px; padding: clamp(14px,3vw,28px); border: 3px solid rgba(255,255,255,.92); border-radius: 32px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }

/* Start screen: one promise, one choice, one action */
.start-screen { max-width: 760px; margin: 0 auto; text-align: center; }
.hero-chase { display: grid; grid-template-columns: 128px minmax(170px,220px) 128px; align-items: end; justify-content: center; gap: 12px; min-height: 190px; }
.hero-chase img { width: 122px; height: 122px; border: 6px solid white; border-radius: 50%; object-fit: cover; box-shadow: 0 12px 24px rgba(61,43,143,.2); }
.hero-chase img:first-child { transform: rotate(-5deg); }
.hero-chase img:last-child { transform: rotate(5deg); }
.runaway-hero-chest { position: relative; display: grid; place-items: center; width: 190px; height: 128px; margin: 0 auto 12px; border: 7px solid #754a21; border-radius: 78px 78px 24px 24px; color: #5d3718; background: linear-gradient(#f7cf5a 0 36%,#c9802f 36% 100%); box-shadow: inset 0 -13px 0 rgba(99,52,14,.15),0 13px 0 rgba(86,55,30,.14); animation: chest-run 1.05s ease-in-out infinite; }
.runaway-hero-chest::before { content: ""; position: absolute; inset: 42% -7px auto; height: 9px; background: #754a21; }
.runaway-hero-chest i { display: grid; place-items: center; width: 42px; height: 48px; border: 5px solid #754a21; border-radius: 12px; color: #754a21; background: #ffe887; font-size: 1.35rem; font-style: normal; font-weight: 950; }
.dust { position: absolute; bottom: -4px; color: #bca786; font-size: 2.4rem; animation: dust 1s ease-out infinite; }
.dust-one { left: -30px; }.dust-two { left: -54px; animation-delay: .28s; }
.adventure-label { display: inline-block; margin: 5px 0 4px; padding: 6px 12px; border-radius: 999px; color: #fff; background: var(--purple); font-size: .66rem; font-weight: 950; letter-spacing: .12em; }
.start-screen h2 { margin: 4px 0 3px; font-size: clamp(1.85rem,6vw,2.8rem); line-height: 1.05; }
.start-promise { margin: 0 0 15px; color: #665e7b; font-weight: 850; }
.three-steps { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto 17px; padding: 12px; border: 2px dashed #d9cdec; border-radius: 21px; background: #fbf8ff; }
.three-steps div { display: grid; justify-items: center; min-width: 92px; }
.three-steps span { font-size: 1.9rem; }.three-steps strong { font-size: .82rem; }.three-steps b { color: #9a8db8; }
.mode-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; max-width: 530px; margin: 0 auto 15px; }
.mode-button { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-height: 82px; padding: 11px 15px; border: 3px solid #ddd4ef; border-radius: 20px; color: var(--ink); background: white; box-shadow: 0 6px 0 #cec4e2; text-align: left; cursor: pointer; }
.mode-button > span { grid-row: 1 / 3; font-size: 2rem; }.mode-button strong { font-size: 1rem; }.mode-button small { color: #766e87; font-size: .72rem; font-weight: 800; }
.mode-button[aria-pressed="true"] { border-color: var(--purple); background: #f1ecff; box-shadow: 0 6px 0 #a995d9; }
.action-button { min-height: 50px; padding: 12px 24px; border: 0; border-radius: 16px; color: white; background: linear-gradient(145deg,#7259d6,#4d36a4); box-shadow: 0 7px 0 #39267e; font-weight: 950; cursor: pointer; transition: transform .15s ease,box-shadow .15s ease; }
.action-button:hover { transform: translateY(-2px); box-shadow: 0 9px 0 #39267e; }.action-button:active { transform: translateY(3px); box-shadow: 0 3px 0 #39267e; }
.start-button { min-width: 210px; font-size: 1.02rem; }.fixture-note { margin: 12px 0 0; color: #958da5; font-size: .66rem; font-weight: 800; }

/* Always-visible chase progress */
.quest-bar { position: sticky; z-index: 20; top: 7px; display: grid; grid-template-columns: 94px minmax(170px,1fr) 94px; align-items: center; gap: 10px; max-width: 650px; margin: 0 auto 9px; padding: 8px 14px; border: 2px solid rgba(255,255,255,.92); border-radius: 23px; background: rgba(248,245,255,.94); box-shadow: 0 8px 22px rgba(48,35,91,.14); backdrop-filter: blur(12px); }
.friend-chip { display: grid; justify-items: center; margin: 0; transition: transform .2s ease; }
.friend-chip img { width: 70px; height: 70px; border: 4px solid white; border-radius: 50%; object-fit: cover; box-shadow: 0 6px 13px rgba(52,36,103,.18); }
.friend-chip figcaption { color: #62568a; font-size: .68rem; font-weight: 950; }.friend-chip.is-active { transform: translateY(-4px) scale(1.04); }
.quest-chest-wrap { display: grid; justify-items: center; }
.mini-chest { position: relative; width: 126px; height: 78px; transform-origin: center bottom; }
.mini-chest-lid,.mini-chest-body { position: absolute; left: 0; width: 100%; border: 5px solid #70441f; background: linear-gradient(135deg,#f3c94d,#bc7028); }
.mini-chest-lid { top: 0; height: 37px; border-radius: 54px 54px 11px 11px; transition: transform .45s ease,top .45s ease; }.mini-chest-body { bottom: 0; display: grid; place-items: center; height: 47px; border-radius: 8px 8px 14px 14px; }
.mini-chest-body span { display: grid; place-items: center; width: 28px; height: 31px; border: 4px solid #70441f; border-radius: 8px; color: #70441f; background: #ffe480; font-size: .75rem; }
.mini-chest.is-running { animation: mini-run .75s ease-in-out infinite alternate; }.mini-chest.is-unlocking { animation: unlock-shake .48s ease; }
.mini-chest.is-open .mini-chest-lid { top: -16px; transform: rotateX(-62deg); }.chest-reward { position: absolute; z-index: 5; left: 50%; top: 8px; opacity: 0; transform: translateX(-50%) scale(.5); font-size: 2.5rem; transition: .5s ease; }.mini-chest.is-open .chest-reward { top: -32px; opacity: 1; transform: translateX(-50%) scale(1); }
.lock-row { display: flex; gap: 7px; margin-top: 4px; }.lock-row span { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid #c9bee2; border-radius: 50%; color: #817899; background: #f7f4fb; font-size: .7rem; font-weight: 950; transition: .3s ease; }.lock-row span.unlocked { border-color: #48b888; color: #176549; background: #caf4e1; transform: scale(1.1); }
.stage-line { display: flex; justify-content: space-between; max-width: 720px; margin: 0 auto 8px; color: var(--purple); font-size: .72rem; font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }

/* One rule, four deeper maps */
.challenge-panel { max-width: 800px; min-height: 520px; margin: 0 auto; padding: clamp(16px,3vw,25px); border: 2px solid #e4dcf1; border-radius: 26px; background: linear-gradient(180deg,#fffefa,#fbf8ff); }
.task-heading { display: flex; align-items: center; justify-content: center; gap: 12px; text-align: left; }.task-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 19px; background: #ebe3ff; font-size: 2rem; }.task-icon.pulse { animation: pulse .7s ease-in-out infinite alternate; }
.task-heading p { margin: 0 0 2px; color: var(--purple); font-size: .65rem; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }.task-heading h2 { margin: 0; font-size: clamp(1.35rem,4vw,1.8rem); }
.speech { max-width: 560px; min-height: 39px; margin: 9px auto 0; padding: 8px 13px; border-radius: 14px; color: #534780; background: #f4efff; text-align: center; font-size: .82rem; font-weight: 800; }.speech strong { margin-right: 6px; color: var(--purple); }
.memory-board { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 10px; margin: 10px auto 5px; }
.stage-cue { display: grid; justify-items: center; gap: 12px; }.cue-chest { display: grid; place-items: center; width: 98px; height: 88px; border: 4px solid #fff; border-radius: 30px; background: linear-gradient(145deg,#7b63d8,#4c369e); box-shadow: 0 8px 0 #d7cef0; font-size: 3.2rem; animation: runaway 1s ease-in-out infinite alternate; }.cue-flow { padding: 9px 15px; border-radius: 999px; color: #5b5272; background: #f3eff8; font-size: .79rem; font-weight: 950; }.tutorial-note { max-width: 340px; color: #7d718f; font-weight: 800; }
.trail-meter { min-width: 160px; padding: 7px 14px; border-radius: 999px; color: #6e6093; background: #eee9f8; text-align: center; font-size: .74rem; font-weight: 950; }.trail-meter.active { color: #12674c; background: #ddf8ec; }
.trail-grid { --grid-size: 3; display: grid; grid-template-columns: repeat(var(--grid-size),minmax(0,1fr)); gap: clamp(5px,1.5vw,9px); width: min(520px,100%); padding: clamp(8px,2vw,13px); border: 5px solid #9a6b39; border-radius: 24px; background: #e7c98c; box-shadow: inset 0 0 0 4px rgba(255,255,255,.38),0 10px 0 rgba(95,61,26,.12); transition: opacity .2s ease,filter .2s ease; }
.trail-grid[data-scene="garden"] { background: linear-gradient(145deg,#cceea9,#f1df91); }.trail-grid[data-scene="mushroom_forest"] { background: linear-gradient(145deg,#afd49f,#d6b879); }.trail-grid[data-scene="moon_bridge"] { background: linear-gradient(145deg,#918cd8,#c5b8e9); border-color: #6154a6; }.trail-grid[data-scene="treasure_map"] { background: linear-gradient(145deg,#eacb82,#cda563); border-color: #8a5c2b; }
.trail-grid.is-memory-off { opacity: .14; filter: blur(7px); }
.trail-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; min-height: 0; padding: 0; border: 2px solid rgba(104,75,42,.22); border-radius: clamp(9px,2vw,15px); color: var(--ink); background: rgba(255,255,255,.78); box-shadow: inset 0 -4px 0 rgba(76,55,32,.08); overflow: hidden; cursor: pointer; transition: transform .16s ease,border-color .16s ease,background .16s ease; }
.trail-cell:not(:disabled):hover { transform: translateY(-2px); border-color: var(--purple); }.trail-cell:disabled { cursor: default; }.trail-cell.is-showing { z-index: 2; border-color: #ffe373; background: #fff7be; transform: scale(1.06); box-shadow: 0 0 0 5px rgba(255,231,91,.38); }.trail-cell.is-correct { border-color: #3ebd8b; background: #e3fff2; }.trail-cell.is-wrong { border-color: #e95f86; background: #ffe8ef; animation: wiggle .3s ease; }
.cell-landmark { position: absolute; left: 7px; bottom: 5px; opacity: .4; font-size: clamp(.8rem,2.5vw,1.25rem); filter: saturate(.8); }.step-number { position: absolute; z-index: 5; right: 5px; top: 5px; display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: white; background: var(--mint); font-size: .68rem; font-weight: 950; }
.runner-chest { position: absolute; z-index: 4; display: block; width: min(50%,46px); aspect-ratio: 1.2; animation: chest-hop .35s ease both; filter: drop-shadow(0 5px 4px rgba(76,42,10,.22)); }.runner-lid,.runner-body { position: absolute; left: 0; width: 100%; border: 3px solid #70441f; background: linear-gradient(145deg,#f4cc50,#bd7027); }.runner-lid { top: 1px; height: 45%; border-radius: 22px 22px 5px 5px; }.runner-body { bottom: 0; height: 62%; border-radius: 4px 4px 8px 8px; }.runner-keyhole { position: absolute; z-index: 3; left: 50%; top: 47%; transform: translate(-50%,-50%); color: #70441f; font-size: .55rem; }
.trail-friend { position: absolute; z-index: 3; right: 2px; bottom: 2px; width: 36%; aspect-ratio: 1; border: 2px solid white; border-radius: 50%; object-fit: cover; box-shadow: 0 3px 7px rgba(48,35,91,.2); animation: pop .25s ease; }
.feedback { min-height: 24px; margin: 5px 0; text-align: center; font-weight: 950; }.feedback.good { color: #177053; }.feedback.try { color: #a5425c; }.primary-action { display: flex; min-height: 52px; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.trail-success { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 13px; width: min(390px,100%); padding: 18px; border: 3px solid #9edfc2; border-radius: 23px; color: #145e45; background: #e8fff5; text-align: left; }.trail-success > span { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: white; background: var(--mint); font-size: 2rem; }.trail-success strong,.trail-success small { display: block; }.trail-success strong { font-size: 1.22rem; }.trail-success small { margin-top: 3px; color: #4f7d6d; font-weight: 800; }

/* Reward-ready endpoint */
.reward-panel { max-width: 680px; margin: 0 auto; padding: clamp(24px,5vw,40px); border: 4px solid #efc33f; border-radius: 30px; background: radial-gradient(circle at 50% 8%,#fff,#fff1ad); text-align: center; box-shadow: 0 14px 35px rgba(104,77,16,.18); animation: reward-rise .6s ease both; }.reward-panel > p { margin: 8px 0 2px; color: #8b6810; font-size: .67rem; font-weight: 950; letter-spacing: .12em; }.reward-panel h2 { margin: 0; font-size: clamp(1.7rem,5vw,2.35rem); }.reward-symbol { display: block; font-size: 5rem; line-height: 1; animation: reward-bob .8s ease-in-out infinite alternate; }
.reward-character { display: flex; align-items: center; justify-content: center; gap: 15px; margin: 15px 0; }.reward-character > strong { max-width: 240px; color: #5c4b1c; text-align: left; }.reward-friends { display: flex; }.reward-friends img { width: 83px; height: 83px; margin-left: -15px; border: 5px solid white; border-radius: 50%; object-fit: cover; box-shadow: 0 7px 16px rgba(81,59,19,.18); }.reward-friends img:first-child { margin-left: 0; }
.collection-strip { display: flex; justify-content: center; gap: 10px; margin: 14px 0 18px; }.collection-dot { display: grid; place-items: center; width: 48px; height: 48px; border: 2px dashed #c4b688; border-radius: 15px; color: #a49b80; background: rgba(255,255,255,.7); font-size: 1.35rem; }.collection-dot.collected { border-style: solid; border-color: #dfb72f; background: #fff0a4; animation: pop .4s ease; }
.diagnostics { max-width: 800px; margin: 11px auto 0; color: #817890; font-size: .7rem; }.diagnostics summary { cursor: pointer; }.diagnostics pre { max-height: 180px; overflow: auto; padding: 9px; border-radius: 10px; color: #ece6ff; background: #2f2850; white-space: pre-wrap; }

.bug-hunter { width: 100%; margin-top: 14px; padding: clamp(14px,2vw,20px); border: 3px solid rgba(255,255,255,.92); border-radius: 25px; color: #f8f5ff; background: linear-gradient(145deg,#34236f,#4c369e 58%,#6548b8); box-shadow: var(--shadow); }.bug-hunter h2 { margin: 4px 0 5px; color: #fff; font-size: clamp(1.25rem,2.7vw,1.65rem); }.bug-hunter > p { margin: 0 0 10px; color: #ded6f7; font-size: .84rem; }.bug-badge { color: #ffd867; font-size: .62rem; font-weight: 950; letter-spacing: .1em; }.feedback-panel summary { width: max-content; min-height: 38px; display: flex; align-items: center; padding: 0 12px; border: 1px solid rgba(255,255,255,.24); border-radius: 11px; background: rgba(255,255,255,.1); cursor: pointer; font-size: .78rem; font-weight: 950; }.feedback-panel[open] summary { margin-bottom: 12px; }.feedback-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }.feedback-form label { display: grid; gap: 6px; color: #f2eeff; font-size: .78rem; font-weight: 850; }.feedback-form textarea,.feedback-form input,.feedback-form select { width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.24); border-radius: 12px; color: #292440; background: #fffefa; font: inherit; }.feedback-form textarea { resize: vertical; }.feedback-consent,.feedback-auto,.feedback-actions,.feedback-email-link,.privacy-note { grid-column: 1 / -1; }.feedback-consent { grid-template-columns: auto 1fr !important; align-items: start; }.feedback-consent input { width: 22px; min-height: 22px; }.feedback-auto { display: grid; gap: 4px; padding: 11px 13px; border-radius: 13px; color: #eee9ff; background: rgba(255,255,255,.09); font-size: .75rem; }.feedback-auto small { color: #cfc4ee; }.feedback-trap { position: absolute; left: -9999px; }.feedback-actions { display: flex; align-items: center; gap: 14px; }.feedback-actions .action-button { min-height: 46px; margin: 0; }.feedback-actions p { margin: 0; font-size: .78rem; font-weight: 850; }.feedback-actions p[data-state="success"] { color: #a7f0cd; }.feedback-actions p[data-state="error"] { color: #ffc0cc; }.feedback-actions p[data-state="info"] { color: #ffe39a; }.feedback-email-link { width: max-content; color: #bce9ff; font-size: .78rem; }.privacy-note { margin: 0; color: #c1b8dc; font-size: .7rem; }.book-reward { display: flex; align-items: center; gap: 8px; margin: 10px 0; padding: 8px 10px; border: 1px solid rgba(255,216,103,.3); border-radius: 12px; color: #fff5cf; background: rgba(255,216,103,.09); }.book-reward span { font-size: 1.25rem; }.book-reward small { font-size: .68rem; line-height: 1.35; }
.book-showcase { width: 100%; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.15); }.book-showcase-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 7px; }.book-showcase-heading h3,.book-showcase-heading p { margin: 0; }.book-showcase-heading h3 { color: #fff; font-size: .92rem; }.book-showcase-heading p { color: #cfc4ee; font-size: .65rem; }.book-shelf { width: 100%; display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); gap: clamp(4px,.75vw,8px); }.book-shelf a { min-width: 0; display: block; padding: 3px; border: 1px solid rgba(255,255,255,.14); border-radius: 10px; color: #fff; background: rgba(255,255,255,.07); text-decoration: none; transition: transform .2s ease,border-color .2s ease; }.book-shelf a:hover,.book-shelf a:focus-visible { border-color: #ffd867; transform: translateY(-3px); }.book-shelf img { width: 100%; aspect-ratio: 4 / 5; display: block; object-fit: cover; border-radius: 6px; background: #fff; }.book-shelf strong { display: none; }.book-cta { min-height: 36px; width: max-content; display: inline-flex; align-items: center; margin-top: 8px; padding: 0 11px; border-radius: 10px; color: #3a2b68; background: #ffd867; font-size: .68rem; font-weight: 950; text-decoration: none; }
.confetti { pointer-events: none; position: absolute; z-index: 30; inset: 0; overflow: hidden; }.confetti span { position: absolute; top: 35%; color: #f2b82e; font-size: 1.35rem; animation: confetti 1s ease-out both; }

@keyframes runaway { to { transform: translateX(8px) translateY(-7px) rotate(5deg); } }
@keyframes chest-run { 0% { transform: translateX(-9px) rotate(-3deg); } 55% { transform: translateY(-13px) rotate(4deg); } 100% { transform: translateX(10px) rotate(-1deg); } }
@keyframes dust { to { transform: translateX(-28px) scale(.3); opacity: 0; } }
@keyframes mini-run { to { transform: translateY(-5px) rotate(2deg); } }
@keyframes chest-hop { 0% { transform: translateY(18px) scale(.65) rotate(-6deg); opacity: .25; } 65% { transform: translateY(-7px) scale(1.08) rotate(4deg); } 100% { transform: translateY(0) scale(1); opacity: 1; } }
@keyframes pulse { to { transform: scale(1.08); background: #fff0ae; } }
@keyframes pop { 0% { transform: scale(.6); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes wiggle { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes unlock-shake { 20% { transform: rotate(-3deg); } 45% { transform: rotate(4deg) scale(1.04); } 70% { transform: rotate(-2deg); } }
@keyframes reward-rise { from { opacity: 0; transform: translateY(20px) scale(.95); } }
@keyframes reward-bob { to { transform: translateY(-7px) rotate(3deg); } }
@keyframes confetti { to { top: 82%; transform: translateX(30px) rotate(220deg); opacity: 0; } }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 12px,960px); padding-top: 6px; }.game-header { margin-bottom: 7px; padding: 8px 10px; border-radius: 19px; }.brand-mark { width: 42px; height: 42px; border-radius: 13px; font-size: 1.45rem; }.eyebrow { font-size: .55rem; }.game-header h1 { font-size: 1.3rem; }.subtitle { font-size: .66rem; }.voice-toggle { min-height: 34px; padding: 6px 8px; font-size: .67rem; }
  .game-toolbar { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); margin: -2px 2px 7px; }.toolbar-button { min-width: 0; min-height: 36px; padding: 5px 6px; font-size: .65rem; }
  .bug-hunter { padding: 14px 11px; border-radius: 20px; }.feedback-form { grid-template-columns: 1fr; }.feedback-form > * { grid-column: 1 !important; }.feedback-actions { display: grid; }.feedback-actions .action-button { width: 100%; }.feedback-email-link { width: auto; overflow-wrap: anywhere; }.book-showcase-heading { display: grid; gap: 2px; }.book-shelf { gap: 3px; }.book-shelf a { padding: 2px; border-radius: 7px; }.book-shelf img { border-radius: 4px; }.book-cta { width: 100%; min-height: 34px; justify-content: center; }
  .game-card { min-height: 610px; padding: 11px; border-radius: 23px; }.hero-chase { grid-template-columns: 78px 140px 78px; gap: 5px; min-height: 145px; }.hero-chase img { width: 76px; height: 76px; }.runaway-hero-chest { width: 132px; height: 91px; border-width: 5px; border-radius: 52px 52px 17px 17px; }.runaway-hero-chest i { width: 31px; height: 35px; border-width: 3px; font-size: .95rem; }.start-screen h2 { font-size: 1.75rem; }.start-promise { margin-bottom: 11px; font-size: .85rem; }.three-steps { gap: 5px; margin-bottom: 13px; padding: 9px 4px; }.three-steps div { min-width: 68px; }.three-steps span { font-size: 1.45rem; }.three-steps strong { font-size: .72rem; }.mode-picker { gap: 8px; }.mode-button { min-height: 70px; padding: 9px; }.mode-button > span { font-size: 1.5rem; }.mode-button strong { font-size: .88rem; }.mode-button small { font-size: .65rem; }
  .quest-bar { top: 4px; grid-template-columns: 66px minmax(128px,1fr) 66px; gap: 5px; margin-bottom: 7px; padding: 6px 8px; border-radius: 19px; }.friend-chip img { width: 54px; height: 54px; }.friend-chip figcaption { font-size: .6rem; }.mini-chest { width: 103px; height: 65px; }.mini-chest-lid { height: 30px; }.mini-chest-body { height: 40px; }.lock-row { gap: 4px; }.lock-row span { width: 21px; height: 21px; font-size: .6rem; }.stage-line { padding: 0 4px; }
  .challenge-panel { min-height: 500px; padding: 13px 8px; border-radius: 21px; }.task-icon { width: 48px; height: 48px; border-radius: 15px; font-size: 1.6rem; }.task-heading h2 { font-size: 1.3rem; }.speech { min-height: 34px; margin-top: 7px; padding: 7px 9px; font-size: .74rem; }.memory-board { min-height: 315px; margin-top: 7px; }.trail-grid { width: min(440px,100%); gap: 5px; padding: 8px; border-width: 4px; border-radius: 19px; }.trail-cell { border-radius: 10px; }.cell-landmark { left: 4px; bottom: 3px; }.step-number { right: 3px; top: 3px; width: 20px; height: 20px; font-size: .6rem; }.cue-flow { font-size: .67rem; }.reward-panel { padding: 24px 11px; }
}

@media (max-width: 390px) {
  .page-shell { width: calc(100% - 8px); }.game-header { gap: 7px; }.brand-mark { width: 38px; height: 38px; }.eyebrow { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.subtitle { display: none; }.voice-toggle { padding: 5px 6px; }.game-card { padding: 8px; }.hero-chase { grid-template-columns: 66px 120px 66px; }.hero-chase img { width: 64px; height: 64px; }.runaway-hero-chest { width: 114px; height: 80px; }
  .three-steps div { min-width: 60px; }.quest-bar { grid-template-columns: 58px minmax(112px,1fr) 58px; }.friend-chip img { width: 48px; height: 48px; }.mini-chest { width: 94px; height: 61px; }.task-heading { gap: 7px; }.task-heading h2 { font-size: 1.18rem; }.memory-board { min-height: 300px; }.trail-grid { gap: 4px; padding: 6px; }.trail-cell { border-radius: 8px; }.trail-friend { border-width: 1px; }.reward-character { flex-direction: column; }.reward-character > strong { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* V0.4.1 child-visual polish: one playful world, no extra feature panels */
body {
  background:
    radial-gradient(circle at 9% 12%,rgba(255,244,163,.98) 0 7%,transparent 24%),
    radial-gradient(circle at 91% 10%,rgba(195,235,255,.96) 0 8%,transparent 26%),
    radial-gradient(circle at 82% 88%,rgba(255,190,217,.7),transparent 27%),
    linear-gradient(155deg,#c9f5e0 0%,#e7ddff 49%,#fff0b9 100%);
}
body[data-theme="moon"] { background: radial-gradient(circle at 80% 8%,#fff6b8 0 5%,transparent 20%),linear-gradient(155deg,#b8e8f6,#ded2ff 48%,#ffd8ea); }
body::before,body::after { content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(1px); }
body::before { width: 180px; height: 180px; left: -58px; bottom: 6%; background: rgba(108,210,157,.35); box-shadow: 92px 54px 0 rgba(255,255,255,.28); }
body::after { width: 210px; height: 210px; right: -75px; top: 28%; background: rgba(154,128,235,.22); box-shadow: -76px 82px 0 rgba(255,211,102,.22); }
.world-glow { background-image: radial-gradient(circle,#fff 0 2px,transparent 3px),radial-gradient(circle,#fff7bd 0 3px,transparent 4px); background-position: 0 0,27px 30px; background-size: 58px 58px,76px 76px; opacity: .64; }
.world-decor { position: fixed; z-index: -1; inset: 0; pointer-events: none; overflow: hidden; color: rgba(255,255,255,.78); }
.world-decor span { position: absolute; font-size: clamp(1.1rem,3vw,2rem); animation: sky-float 4.5s ease-in-out infinite alternate; text-shadow: 0 3px 0 rgba(104,77,170,.08); }
.world-decor span:nth-child(1) { left: 4%; top: 22%; }.world-decor span:nth-child(2) { right: 5%; top: 18%; color: rgba(255,207,93,.66); animation-delay: -.8s; }.world-decor span:nth-child(3) { right: 9%; bottom: 12%; animation-delay: -1.9s; }.world-decor span:nth-child(4) { left: 8%; bottom: 17%; color: rgba(255,128,172,.48); animation-delay: -2.6s; }.world-decor span:nth-child(5) { left: 48%; top: 2%; color: rgba(255,211,76,.55); animation-delay: -1.1s; }

.game-header { border-color: rgba(255,255,255,.95); background: linear-gradient(135deg,rgba(255,255,255,.94),rgba(251,246,255,.9)); box-shadow: 0 9px 0 rgba(102,76,166,.09),0 18px 34px rgba(60,45,104,.12); }
.brand-mark { background: linear-gradient(145deg,#fff090,#ffbd51 58%,#ff8d79); box-shadow: 0 6px 0 #d59337,0 0 0 4px rgba(255,255,255,.8); }
.voice-toggle { border-color: #d9ccff; color: #513597; background: linear-gradient(#fff,#f3edff); box-shadow: 0 4px 0 #d4c5ee; transition: transform .15s ease,box-shadow .15s ease; }
.voice-toggle:hover { transform: translateY(-1px); box-shadow: 0 5px 0 #d4c5ee; }
.game-card { border-color: rgba(255,255,255,.98); background: linear-gradient(180deg,rgba(255,255,255,.96),rgba(255,250,239,.95)); box-shadow: 0 10px 0 rgba(106,78,170,.08),0 24px 55px rgba(48,35,91,.18); }
.game-card::before { content: "✦   •   ★"; position: absolute; right: 20px; top: 14px; color: rgba(125,87,202,.18); font-size: 1.4rem; letter-spacing: .45em; pointer-events: none; }

.hero-chase { position: relative; margin-top: 2px; padding: 20px 20px 14px; border: 3px solid rgba(255,255,255,.9); border-radius: 34px; background: linear-gradient(180deg,#d9f4ff 0 55%,#c8edaa 55% 78%,#a6d986 78%); box-shadow: inset 0 -10px 0 rgba(75,147,74,.08),0 9px 0 #efe7ff; overflow: hidden; }
.hero-chase::before { content: "☁       ☁"; position: absolute; left: 8%; right: 8%; top: 10px; color: rgba(255,255,255,.9); font-size: 2.15rem; word-spacing: 8rem; animation: cloud-drift 6s ease-in-out infinite alternate; }
.hero-chase::after { content: "✿  •  ✿  •  ✿"; position: absolute; right: 6%; bottom: 5px; color: #fff6ad; font-size: 1.05rem; letter-spacing: .45em; }
.hero-chase img,.runaway-hero-chest { z-index: 2; }
.hero-chase img { border-color: #fff; box-shadow: 0 8px 0 rgba(92,70,160,.14),0 13px 26px rgba(61,43,143,.16); }
.runaway-hero-chest { background: linear-gradient(#ffe17a 0 36%,#df8f3e 36% 100%); box-shadow: inset 0 -13px 0 rgba(99,52,14,.13),0 10px 0 rgba(86,55,30,.14),0 18px 25px rgba(86,55,30,.13); }
.runaway-hero-chest::after { content: "•  •"; position: absolute; z-index: 3; left: 50%; top: 18px; transform: translateX(-50%); color: #70441f; font-size: 1.2rem; font-weight: 950; letter-spacing: .5rem; white-space: nowrap; }
.adventure-label { background: linear-gradient(135deg,#8a68de,#ff7fa8); box-shadow: 0 4px 0 rgba(92,58,151,.18); }
.start-promise { color: #584f73; }
.three-steps { border-color: #e1d3ff; background: linear-gradient(135deg,#fff8c9,#f5efff 52%,#e3fff4); box-shadow: inset 0 0 0 3px rgba(255,255,255,.68); }
.three-steps div { padding: 5px 8px; border-radius: 14px; background: rgba(255,255,255,.68); }
.three-steps div:nth-child(1) span { filter: drop-shadow(0 3px 0 #eadc9d); }.three-steps div:nth-child(3) span { filter: drop-shadow(0 3px 0 #b7e5cf); }.three-steps div:nth-child(5) span { filter: drop-shadow(0 3px 0 #ebc183); }
.mode-button { border-color: #e4daf5; box-shadow: 0 6px 0 #d8cce8,0 10px 18px rgba(80,55,135,.08); }
.mode-button[aria-pressed="true"] { border-color: #7957d5; background: linear-gradient(135deg,#efe8ff,#fff4c7); box-shadow: 0 6px 0 #bca9e7,0 11px 20px rgba(88,62,151,.11); }
.action-button { color: #47270d; background: linear-gradient(145deg,#ffe068,#ffb44d 58%,#ff8f70); box-shadow: 0 7px 0 #c76c36,0 12px 20px rgba(139,74,35,.18); text-shadow: 0 1px 0 rgba(255,255,255,.5); }
.action-button:hover { box-shadow: 0 9px 0 #c76c36,0 15px 23px rgba(139,74,35,.18); }.action-button:active { box-shadow: 0 3px 0 #c76c36; }

.quest-bar { border-color: #fff; background: linear-gradient(135deg,rgba(246,240,255,.96),rgba(255,250,213,.96)); box-shadow: 0 7px 0 rgba(108,82,166,.1),0 13px 24px rgba(48,35,91,.14); }
.friend-chip img { box-shadow: 0 5px 0 rgba(114,87,174,.13),0 9px 16px rgba(52,36,103,.16); }
.mini-chest-lid,.mini-chest-body { background: linear-gradient(135deg,#ffda64,#d78034); }
.lock-row span.unlocked { box-shadow: 0 3px 0 rgba(36,139,95,.16); }
.challenge-panel { border-color: #e5d9f7; background: radial-gradient(circle at 100% 0,rgba(255,231,128,.22),transparent 27%),linear-gradient(180deg,#fffefa,#faf6ff); box-shadow: inset 0 0 0 4px rgba(255,255,255,.7),0 8px 0 rgba(107,82,163,.08); }
.task-icon { background: linear-gradient(145deg,#eee7ff,#ffe8a3); box-shadow: 0 5px 0 #ddd0f4; }
.speech { position: relative; color: #4d4275; background: linear-gradient(135deg,#f2ecff,#fff7d5); box-shadow: 0 4px 0 rgba(113,83,176,.08); }
.speech::after { content: ""; position: absolute; left: 22%; bottom: -7px; width: 14px; height: 14px; background: #f4eff8; transform: rotate(45deg); }
.trail-meter.active { box-shadow: 0 4px 0 rgba(56,171,120,.12); }
.trail-grid { box-shadow: inset 0 0 0 5px rgba(255,255,255,.4),0 9px 0 rgba(95,61,26,.13),0 15px 25px rgba(78,55,29,.11); }
.trail-cell { border-color: rgba(104,75,42,.18); background: rgba(255,255,255,.83); box-shadow: inset 0 -5px 0 rgba(76,55,32,.08),0 2px 0 rgba(255,255,255,.6); }
.trail-cell:nth-child(3n+1) { background-color: rgba(255,250,218,.86); }.trail-cell:nth-child(3n+2) { background-color: rgba(241,235,255,.86); }.trail-cell:nth-child(3n) { background-color: rgba(225,252,240,.86); }
.trail-cell.is-showing { background: #fff2a2; box-shadow: 0 0 0 6px rgba(255,228,91,.34),0 7px 14px rgba(123,79,25,.14); }
.trail-cell.is-correct { background: #dffff0; box-shadow: inset 0 -5px 0 rgba(42,153,106,.12); }
.trail-success { border-color: #8dddb6; background: linear-gradient(135deg,#e0fff0,#fff8bd); box-shadow: 0 7px 0 rgba(68,169,119,.12); }
.reward-panel { background: radial-gradient(circle at 50% 8%,#fff,#fff2a8 55%,#ffe0aa); box-shadow: 0 9px 0 rgba(203,151,27,.13),0 19px 38px rgba(104,77,16,.18); }
.collection-dot { background: rgba(255,255,255,.78); box-shadow: 0 4px 0 rgba(150,124,62,.11); }

@keyframes sky-float { to { transform: translateY(-14px) rotate(8deg); } }
@keyframes cloud-drift { to { transform: translateX(22px); } }

@media (max-width: 680px) {
  .hero-chase { padding: 14px 8px 8px; border-radius: 25px; }.hero-chase::before { font-size: 1.45rem; word-spacing: 3rem; }.hero-chase::after { font-size: .75rem; }.runaway-hero-chest::after { top: 12px; font-size: .9rem; }.three-steps div { padding: 4px; }
}

@media (max-width: 340px) {
  .game-header { gap: 5px; padding-inline: 7px; }.brand-mark { width: 34px; height: 34px; font-size: 1.2rem; }.game-header h1 { font-size: 1.08rem; }.eyebrow { font-size: .48rem; }.voice-toggle { min-height: 32px; padding-inline: 5px; font-size: .61rem; }
  .hero-chase { grid-template-columns: 58px 106px 58px; }.hero-chase img { width: 57px; height: 57px; border-width: 4px; }.runaway-hero-chest { width: 102px; height: 73px; }.three-steps div { min-width: 54px; }.mode-button { min-height: 66px; padding: 7px; }.mode-button small { font-size: .6rem; }
  .quest-bar { grid-template-columns: 52px minmax(104px,1fr) 52px; padding-inline: 5px; }.friend-chip img { width: 44px; height: 44px; }.mini-chest { width: 88px; }.challenge-panel { padding-inline: 6px; }.trail-grid { padding: 5px; }
}

@media (orientation: landscape) and (max-height: 480px) and (min-width: 600px) {
  .page-shell { width: min(100% - 16px,960px); padding-block: 5px 10px; }.game-header { margin-bottom: 6px; padding: 6px 10px; }.brand-mark { width: 38px; height: 38px; font-size: 1.3rem; }.game-header h1 { font-size: 1.25rem; }.subtitle { font-size: .65rem; }.voice-toggle { min-height: 34px; }
  .game-card { min-height: 0; padding: 10px 12px; border-radius: 24px; }.start-screen { display: grid; grid-template-columns: minmax(245px,.9fr) minmax(300px,1.1fr); grid-template-areas: "hero label" "hero title" "hero promise" "hero steps" "hero modes" "hero start" "hero note"; column-gap: 14px; align-items: center; max-width: none; }
  .hero-chase { grid-area: hero; grid-template-columns: 62px 112px 62px; gap: 4px; width: 100%; min-height: 255px; height: 100%; margin: 0; padding: 12px 7px 8px; }.hero-chase img { width: 59px; height: 59px; border-width: 4px; }.runaway-hero-chest { width: 108px; height: 76px; margin-bottom: 3px; }.runaway-hero-chest i { width: 29px; height: 33px; border-width: 3px; }.runaway-hero-chest::after { top: 10px; font-size: .8rem; }
  .adventure-label { grid-area: label; justify-self: center; margin-block: 0 2px; padding-block: 4px; }.start-screen h2 { grid-area: title; margin: 1px 0; font-size: 1.55rem; }.start-promise { grid-area: promise; margin: 0 0 5px; font-size: .76rem; }.three-steps { grid-area: steps; gap: 4px; margin: 0 0 6px; padding: 5px; }.three-steps div { min-width: 58px; padding: 2px; }.three-steps span { font-size: 1.2rem; }.three-steps strong { font-size: .65rem; }
  .mode-picker { grid-area: modes; gap: 7px; width: 100%; margin: 0 0 7px; }.mode-button { min-height: 57px; padding: 6px 8px; border-width: 2px; border-radius: 15px; }.mode-button > span { font-size: 1.3rem; }.mode-button strong { font-size: .8rem; }.mode-button small { font-size: .58rem; }.start-button { grid-area: start; justify-self: center; min-height: 42px; padding-block: 8px; }.fixture-note { grid-area: note; margin-top: 7px; }
}
