/* Chompy Reads: chunky, bright storybook look for little fingers on an iPad. */
@font-face { font-family: 'Fredoka'; src: url('../fonts/Fredoka-latin.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('../fonts/Andika-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Andika'; src: url('../fonts/Andika-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --ink: #2b2250;
  --ink-soft: #6a6394;
  --paper: #fffaf0;
  --white: #ffffff;
  --sun: #ffc83d;
  --orange: #ff8a3d;
  --berry: #ff4f8b;
  --grape: #8a5cf6;
  --sky: #39b8ff;
  --mint: #2fd39a;
  --teal: #22c4ad;
  --cons: #2b6fe8;      /* consonants are blue */
  --vowel: #ff4a62;     /* vowels are red, as in most phonics programs */
  --good: #22c55e;
  --line: rgba(43, 34, 80, .12);
  --shadow: 0 6px 0 rgba(43, 34, 80, .14), 0 14px 28px rgba(43, 34, 80, .12);
  --shadow-sm: 0 4px 0 rgba(43, 34, 80, .14), 0 8px 16px rgba(43, 34, 80, .10);
  --r: 30px;
  --ui: 'Fredoka', 'Arial Rounded MT Bold', 'Avenir Next', system-ui, sans-serif;
  --read: 'Andika', 'Avenir Next', 'Helvetica Neue', sans-serif;
  --top: max(14px, env(safe-area-inset-top));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #bff0ff; }
body {
  font-family: var(--ui); color: var(--ink); touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-font-smoothing: antialiased;
}
#app { position: fixed; inset: 0; overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; -webkit-user-select: text; user-select: text; }
h1, h2, h3 { margin: 0; font-weight: 700; }

/* ---------- screens ---------- */
.screen { position: absolute; inset: 0; opacity: 0; transform: scale(1.03); transition: opacity .35s ease, transform .35s ease; }
.screen.in { opacity: 1; transform: none; }
.screen.out { opacity: 0; transform: scale(.98); pointer-events: none; }

/* ---------- sky, clouds and hills ---------- */
.backdrop { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, var(--sky1, #bff0ff), var(--sky2, #fff6d6) 70%); }
.cloud { position: absolute; width: 180px; height: 60px; background: #fff; border-radius: 60px; opacity: .85; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 80px; height: 80px; left: 26px; top: -38px; }
.cloud::after { width: 100px; height: 100px; left: 70px; top: -52px; }
.cloud.c1 { top: 12%; left: -200px; }
.cloud.c2 { top: 26%; left: -200px; transform: scale(.7); animation-duration: 80s; animation-delay: -30s; }
.cloud.c3 { top: 6%; left: -200px; transform: scale(.5); animation-duration: 100s; animation-delay: -70s; opacity: .7; }
@keyframes drift { to { left: 110%; } }
.hills { position: absolute; left: -10%; right: -10%; bottom: -8vh; height: 30vh; }
.hills::before, .hills::after { content: ''; position: absolute; border-radius: 50%; background: var(--ground, #7ed957); }
.hills::before { left: 0; width: 70%; height: 100%; bottom: 0; filter: brightness(1.08); }
.hills::after { right: 0; width: 75%; height: 85%; bottom: -10%; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .55em 1.2em; border-radius: 999px; font-weight: 700; font-size: clamp(20px, 2.6vmin, 28px);
  background: var(--white); color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease;
}
.btn.pressed, .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(43, 34, 80, .2); }
.btn.primary { background: linear-gradient(180deg, #ffd65c, #ffb31a); }
.btn.ghost { background: rgba(255, 255, 255, .85); }
.btn.small { font-size: 18px; padding: .45em .9em; }
.btn.round { width: 64px; height: 64px; padding: 0; font-size: 30px; }
.btn.gold { background: linear-gradient(180deg, #ffe27a, #ffbe2e); }
.btn.big { font-size: clamp(24px, 3.4vmin, 34px); padding: .7em 1.4em; }
.btn.next { width: 84px; height: 84px; padding: 0; font-size: 40px; background: linear-gradient(180deg, #4fe3ae, #1fb984); color: #fff; }
.row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.spacer { flex: 1; }
.small { font-size: 16px; color: var(--ink-soft); }

/* ---------- title ---------- */
.floaters span { position: absolute; bottom: -60px; font-family: var(--read); font-weight: 700; color: #fff; opacity: .55; animation: floatUp linear infinite; text-shadow: 0 3px 0 rgba(43, 34, 80, .08); }
@keyframes floatUp { to { transform: translateY(-120vh) rotate(25deg); } }
.title-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; padding-top: 2vh; }
.logo { font-size: clamp(56px, 11vmin, 120px); line-height: .9; text-align: center; letter-spacing: 1px; }
.logo span { display: inline-block; animation: bob 2.4s ease-in-out infinite; text-shadow: 0 6px 0 rgba(43, 34, 80, .18); -webkit-text-stroke: 3px #fff; paint-order: stroke fill; }
.logo span:nth-child(6n+1) { color: var(--berry); } .logo span:nth-child(6n+2) { color: var(--orange); } .logo span:nth-child(6n+3) { color: #f4b400; }
.logo span:nth-child(6n+4) { color: var(--mint); } .logo span:nth-child(6n+5) { color: var(--sky); } .logo span:nth-child(6n) { color: var(--grape); }
.logo .reads { color: var(--ink) !important; font-size: .62em; -webkit-text-stroke: 3px #fff; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.title-chompy { width: min(38vmin, 340px); }
.btn.play { font-size: clamp(28px, 4.4vmin, 44px); padding: .5em 1.4em; background: linear-gradient(180deg, #ffe066, #ffb31a); animation: pulse 1.6s ease-in-out infinite; }
.btn.play.gone { animation: none; transform: scale(0); transition: transform .3s; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* ---------- players ---------- */
.players-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; padding: 20px; }
.heading { font-size: clamp(36px, 6vmin, 60px); color: var(--ink); text-shadow: 0 4px 0 #fff; }
.players { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; max-width: 1000px; }
.player { width: clamp(150px, 20vmin, 200px); padding: 20px 10px 16px; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); text-align: center; transition: transform .15s; }
.player.pressed { transform: scale(.95); }
.avatar { width: clamp(90px, 13vmin, 120px); height: clamp(90px, 13vmin, 120px); margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: clamp(54px, 8vmin, 74px); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12); }
.avatar.sm { width: 40px; height: 40px; font-size: 24px; margin: 0; display: inline-grid; vertical-align: middle; }
.player.add .avatar { background: #ece8fb; color: var(--grape); font-size: 64px; font-weight: 700; }
.pname { font-size: 26px; font-weight: 700; }
.pstars { color: #f4a300; font-weight: 700; }
.new-player { text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.new-player h3 { font-size: 32px; }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 72px); gap: 10px; }
.av { width: 72px; height: 72px; border-radius: 20px; display: grid; place-items: center; font-size: 46px; background: #f4f1ff; transition: transform .12s; }
.av.on { background: var(--sun); transform: scale(1.1); box-shadow: var(--shadow-sm); }
.name-input { font-size: 28px; padding: 12px 18px; border-radius: 18px; border: 3px solid #ddd6fb; width: 320px; text-align: center; outline: none; }
.name-input:focus { border-color: var(--grape); }
.btn.round.grownup.corner { position: absolute; right: 18px; bottom: 18px; opacity: .8; width: 54px; height: 54px; font-size: 24px; }

/* ---------- map ---------- */
.map-scroll { position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.map { position: relative; width: 100%; min-height: 100%; }
.world-band { position: absolute; left: 0; right: 0; background: linear-gradient(180deg, var(--sky1), var(--sky2)); overflow: hidden; }
.world-band::after { content: ''; position: absolute; left: -5%; right: -5%; bottom: -40px; height: 90px; background: var(--ground); border-radius: 50% 50% 0 0; opacity: .9; }
.world-title { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 26px; border-radius: 999px; background: rgba(255, 255, 255, .9); box-shadow: var(--shadow-sm); font-size: clamp(24px, 3.6vmin, 34px); font-weight: 700; white-space: nowrap; z-index: 2; }
.world-title .wicon { font-size: 1.3em; }
.deco { position: absolute; font-size: 44px; animation: bob 4s ease-in-out infinite; opacity: .9; }
.map-path { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }
.road { fill: none; stroke: rgba(255, 255, 255, .95); stroke-width: 30; stroke-linecap: round; }
.road-dash { fill: none; stroke: #ffd36b; stroke-width: 6; stroke-dasharray: 2 18; stroke-linecap: round; }
.lnode { position: absolute; transform: translateX(-50%); width: 120px; display: flex; flex-direction: column; align-items: center; z-index: 3; }
.ncircle { position: relative; width: 98px; height: 98px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(180deg, #fff, #f0ecff); border: 6px solid #fff; box-shadow: var(--shadow); transition: transform .15s; }
.lnode.pressed .ncircle { transform: scale(.92); }
.nicon { font-size: 46px; }
.nnum { position: absolute; top: -10px; left: -10px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--grape); color: #fff; font-weight: 700; font-size: 20px; border: 3px solid #fff; }
.lnode.passed .ncircle { background: linear-gradient(180deg, #ffe37d, #ffbe2e); }
.lnode.current .ncircle { background: linear-gradient(180deg, #8ff5d3, #2fd39a); animation: glow 1.6s ease-in-out infinite; }
.lnode.locked .ncircle { filter: saturate(.25) brightness(.97); }
.lnode.locked .nicon { opacity: .6; }
@keyframes glow { 0%, 100% { box-shadow: var(--shadow), 0 0 0 0 rgba(47, 211, 154, .6); } 50% { box-shadow: var(--shadow), 0 0 0 18px rgba(47, 211, 154, 0); } }
.ncrown { position: absolute; top: -26px; right: 4px; font-size: 34px; transform: rotate(18deg); }
.nlock { position: absolute; top: 58px; right: 6px; font-size: 26px; }
.nlabel { margin-top: 6px; padding: 3px 12px; border-radius: 999px; background: rgba(255, 255, 255, .92); font-weight: 600; font-size: 17px; white-space: nowrap; box-shadow: 0 2px 0 rgba(43, 34, 80, .1); }
.nlabel.letters { font-family: var(--read); font-weight: 700; font-size: 22px; letter-spacing: 2px; }
.chompy.map-chompy { position: absolute; width: 104px; z-index: 4; transition: top .6s, left .6s; }
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; gap: 10px; align-items: center; padding: var(--top) 16px 10px; background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); z-index: 10; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 16px 6px 6px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); font-weight: 700; font-size: 22px; }
.stars-chip { padding: 8px 16px; color: #f4a300; }
.btn.snack { position: absolute; right: 18px; bottom: 22px; width: 110px; height: 110px; border-radius: 50%; padding: 0; flex-direction: column; background: linear-gradient(180deg, #ffe2b0, #f4b35e); z-index: 10; animation: bob 3s ease-in-out infinite; }
.btn.snack > span { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.btn.snack span span { font-size: 46px; }
.btn.snack small { font-size: 15px; margin-top: 2px; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30, 20, 60, .42); display: grid; place-items: center; z-index: 50; animation: fadeIn .25s ease; padding: 16px; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.modal-back.closing { animation: fadeOut .25s ease forwards; }
.modal { position: relative; background: var(--paper); border-radius: 36px; padding: 28px; box-shadow: 0 24px 60px rgba(30, 20, 60, .35); max-width: min(92vw, 720px); max-height: 92vh; overflow-y: auto; animation: popIn .35s cubic-bezier(.3, 1.5, .5, 1); }
.modal.wide { max-width: min(94vw, 900px); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popIn { from { transform: scale(.7); opacity: 0; } }
.close { position: absolute; right: 14px; top: 14px; width: 52px; height: 52px; border-radius: 50%; background: #f1edff; font-size: 24px; font-weight: 700; color: var(--ink-soft); }

/* level card */
.level-card { display: flex; flex-direction: column; gap: 22px; }
.lc-head { display: flex; gap: 18px; align-items: center; padding-right: 50px; }
.lc-icon { font-size: 72px; width: 110px; height: 110px; border-radius: 30px; display: grid; place-items: center; background: #fff; box-shadow: var(--shadow-sm); }
.lc-num { font-size: 22px; color: var(--ink-soft); font-weight: 600; }
.lc-name { font-size: clamp(30px, 4.6vmin, 44px); font-weight: 700; }
.lc-letters { display: flex; gap: 12px; }
.lc-letters span { font-family: var(--read); font-weight: 700; font-size: clamp(44px, 7vmin, 64px); line-height: 1.1; color: var(--cons); }
.lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px; }
.lesson { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.lcircle { width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; background: #fff; box-shadow: var(--shadow-sm); transition: transform .12s; }
.lesson:nth-child(5n+1) .lcircle { background: #ffe9f1; } .lesson:nth-child(5n+2) .lcircle { background: #e6f6ff; }
.lesson:nth-child(5n+3) .lcircle { background: #e8fbf3; } .lesson:nth-child(5n+4) .lcircle { background: #fff4dc; } .lesson:nth-child(5n) .lcircle { background: #f1ebff; }
.lesson.pressed .lcircle { transform: scale(.9); }
.lesson.locked .lcircle { background: #eee !important; }
.lesson.nope { animation: shake .4s; }
.ltitle { font-weight: 600; font-size: 17px; line-height: 1.1; }
.stars { font-size: 22px; letter-spacing: 2px; }
.star { color: #e3ddf7; display: inline-block; }
.star.on { color: #ffb800; text-shadow: 0 2px 0 #e08f00; }
.star.pop { animation: starPop .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } }
.challenge-btn { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-radius: 28px; background: linear-gradient(180deg, #ffe27a, #ffb820); box-shadow: var(--shadow); transition: transform .12s; }
.challenge-btn.pressed { transform: scale(.97); }
.challenge-btn .trophy { font-size: 56px; }
.ctitle { font-size: 30px; font-weight: 700; }
.csub { font-size: 18px; color: #7a5200; }

/* ---------- lesson runner ---------- */
.runner-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 14px; padding: var(--top) 18px 0; z-index: 5; }
.progress { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 18px; border-radius: 999px; background: rgba(255, 255, 255, .8); box-shadow: var(--shadow-sm); }
.pdot { width: 22px; height: 22px; border-radius: 50%; background: #e7e2fa; transition: all .3s; }
.pdot.now { background: var(--sun); transform: scale(1.3); }
.pdot.ok { background: var(--mint); }
.pdot.miss { background: #ffb3c4; }
.tlabel { font-size: 40px; width: 64px; text-align: center; }
.chompy.buddy { position: absolute; left: 6px; bottom: 6px; width: min(23vmin, 210px); z-index: 4; }
.stage { position: absolute; top: calc(var(--top) + 84px); bottom: 18px; left: calc(min(23vmin, 210px) + 4px); right: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh; }
@media (orientation: portrait) {
  .chompy.buddy { width: 20vmin; }
  .stage { left: 16px; bottom: calc(20vmin + 10px); }
}
.pause-card { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(30, 20, 60, .45); color: #fff; text-align: center; animation: fadeIn .3s ease; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.pause-card h2 { font-size: clamp(48px, 9vmin, 80px); text-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.pause-card p { font-size: 30px; font-weight: 600; margin: 0; }
.pause-card .pause-chompy::before { content: '💤'; font-size: 90px; display: block; animation: bob 2s ease-in-out infinite; }
.loading { text-align: center; font-size: 28px; font-weight: 600; color: var(--ink-soft); }
.loading span { font-size: 90px; display: inline-block; animation: bob 1s ease-in-out infinite; }
.intro-card { text-align: center; animation: popIn .4s cubic-bezier(.3, 1.5, .5, 1); }
.intro-card h2 { font-size: clamp(40px, 7vmin, 72px); color: var(--ink); text-shadow: 0 4px 0 #fff; }
.intro-card p { font-size: 28px; }
.big-emoji { font-size: 120px; }

.prompt { display: flex; align-items: center; justify-content: center; gap: 22px; min-height: 120px; animation: popIn .35s cubic-bezier(.3, 1.5, .5, 1); }
.prompt.tall { min-height: 40vh; }
.speaker { width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); font-size: 34px; flex: none; transition: transform .1s; }
.speaker.pressed { transform: scale(.9); }
.options { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 230px)); gap: clamp(14px, 2.6vmin, 30px); justify-content: center; width: 100%; }
.options.words { grid-template-columns: repeat(var(--n), minmax(0, 260px)); }
.options.scenes { grid-template-columns: repeat(var(--n), minmax(0, 280px)); }
.options.two { grid-template-columns: repeat(2, minmax(0, 260px)); }
.options.answers { grid-template-columns: repeat(var(--n), minmax(0, 250px)); }
.card { position: relative; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); display: grid; place-items: center; min-height: clamp(120px, 20vmin, 190px); padding: 10px; transition: transform .15s, opacity .3s, box-shadow .2s; }
.opt { animation: popIn .4s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.card.pressed { transform: scale(.94); }
.card.right { box-shadow: 0 0 0 8px var(--good), var(--shadow); transform: scale(1.06); }
.card.wrong { animation: shake .45s; opacity: .45; }
.card.dim { opacity: .4; transform: scale(.95); }
.card.hint { animation: hintPulse 1s ease-in-out infinite; }
.card.show-right { box-shadow: 0 0 0 8px var(--good), var(--shadow); }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-12px) rotate(-3deg); } 40% { transform: translateX(10px) rotate(3deg); } 60% { transform: translateX(-8px); } 80% { transform: translateX(6px); } }
@keyframes hintPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 200, 61, .9), var(--shadow); transform: scale(1); } 50% { box-shadow: 0 0 0 16px rgba(255, 200, 61, 0), var(--shadow); transform: scale(1.06); } }

.card.letter span { font-family: var(--read); font-weight: 700; font-size: clamp(70px, 13vmin, 120px); line-height: 1; color: var(--cons); margin-top: -.08em; }
.card.letter.vowel span { color: var(--vowel); }
.card.letter.long span { font-size: clamp(56px, 10vmin, 96px); }
.card.letter.upper span { color: var(--grape); }
.card.letter.cookie { border-radius: 50%; width: clamp(130px, 21vmin, 190px); height: clamp(130px, 21vmin, 190px); margin: 0 auto; background: radial-gradient(circle at 35% 30%, #ffe7b8, #f5bd66 70%, #e59b3c); box-shadow: inset 0 -8px 0 rgba(160, 90, 20, .25), var(--shadow); }
.card.letter.cookie span { color: #5a2d0c; }
.card.letter.cookie.vowel span { color: #b8142f; }
.card.letter.cookie::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background:
  radial-gradient(circle at 22% 70%, #6b3a12 0 5px, transparent 6px), radial-gradient(circle at 78% 30%, #6b3a12 0 4px, transparent 5px),
  radial-gradient(circle at 72% 78%, #6b3a12 0 5px, transparent 6px), radial-gradient(circle at 30% 24%, #6b3a12 0 3px, transparent 4px); opacity: .7; }
.card.letter.prompt-letter { width: clamp(150px, 24vmin, 220px); }
.card.picture .pic { font-size: clamp(76px, 13vmin, 120px); line-height: 1; }
.card.wordcard span { font-family: var(--read); font-weight: 700; font-size: clamp(48px, 8vmin, 76px); color: var(--ink); padding: 0 .2em; }
.feed-prompt { font-size: 64px; }
.plate { display: none; }
.big-pic .pic { font-size: clamp(110px, 20vmin, 180px); line-height: 1; display: inline-block; animation: bob 3s ease-in-out infinite; }
.big-pic.small .pic { font-size: clamp(80px, 14vmin, 130px); }
.ear { width: clamp(110px, 17vmin, 150px); height: clamp(110px, 17vmin, 150px); border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); display: grid; place-items: center; font-size: clamp(60px, 10vmin, 88px); }
.pic { display: inline-block; line-height: 1; }

/* intro + trace */
.intro-row { display: flex; gap: 5vmin; align-items: center; justify-content: center; }
.card.letter.hero { width: clamp(220px, 38vmin, 340px); height: clamp(220px, 38vmin, 340px); }
.card.letter.hero span { font-size: clamp(150px, 27vmin, 250px); }
.card.letter.enter { animation: popIn .6s cubic-bezier(.3, 1.6, .5, 1); }
.card.boing { animation: boing .4s; }
@keyframes boing { 30% { transform: scale(1.12, .9); } 60% { transform: scale(.95, 1.08); } }
.keypics { display: flex; flex-direction: column; gap: 14px; }
.keypic { display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 10px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-sm); }
.keypic .pic { font-size: clamp(50px, 8vmin, 70px); }
.keypic .cap { font-family: var(--read); font-size: clamp(26px, 4vmin, 36px); font-weight: 700; }
.trace-wrap { display: flex; gap: 22px; align-items: center; width: 100%; height: 100%; }
.card.letter.mini { width: 130px; min-height: 130px; flex: none; }
.card.letter.mini span { font-size: 90px; }
.tracer { flex: 1; height: 100%; max-height: 70vh; background: #fff; border-radius: 34px; box-shadow: var(--shadow); touch-action: none; }
.tracer canvas { width: 100%; height: 100%; display: block; touch-action: none; }

/* bubbles */
.bubbles { position: relative; flex: 1; width: 100%; overflow: hidden; border-radius: 30px; background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(57, 184, 255, .18)); }
.bubble-item { position: absolute; bottom: calc(-1 * var(--size)); width: var(--size); height: var(--size); margin-left: calc(var(--size) / -2); border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95) 0 10%, rgba(255, 255, 255, .25) 26%, rgba(150, 220, 255, .35) 60%, rgba(120, 140, 255, .45));
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8), inset -10px -14px 30px rgba(138, 92, 246, .25), 0 6px 18px rgba(43, 34, 80, .12); }
.bubble-item span { font-family: var(--read); font-weight: 700; font-size: 64px; color: var(--ink); }
.bubble-item.wordy span { font-size: 44px; }
.bubble-item.popped { transform: scale(1.4) !important; opacity: 0; transition: all .2s; }
.bubble-item.nope span { animation: shake .45s; }
.pop-meter { display: flex; gap: 8px; }
.pop-meter .dot { width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 3px #d9d2f5; }
.pop-meter .dot.on { background: var(--sky); box-shadow: none; animation: starPop .4s; }

/* words drawn as letters */
.word { display: flex; align-items: flex-end; justify-content: center; font-family: var(--read); font-weight: 700; font-size: clamp(80px, 15vmin, 140px); line-height: 1.1; }
.word .g { display: inline-flex; color: var(--cons); position: relative; border-radius: 18px; transition: background .2s, transform .2s; }
.word .g.vowel { color: var(--vowel); }
.word .g.digraph { border-bottom: 7px solid var(--grape); border-radius: 0 0 8px 8px; margin: 0 .04em; }
.word .g.split { color: var(--grape); }
.word .g.split:last-child::before { content: '✨'; position: absolute; top: -.35em; left: 50%; transform: translateX(-50%); font-size: .3em; }
.word .g.silent { color: #b9b2d6; }
.word .g.lit, .word .g.on { background: #fff3c4; }
.word .g.gap { background: #fff; box-shadow: inset 0 0 0 4px #d9d2f5; padding: 0 .12em; color: #c3bbe6; }
.word.small { font-size: clamp(56px, 9vmin, 80px); }
.word.read { padding: 10px 30px; background: #fff; border-radius: 30px; box-shadow: var(--shadow); }
.word.pop { animation: boing .5s; }
.word.tiles { gap: 12px; }
.word.tiles .g { padding: 4px 18px 8px; background: #fff; border-radius: 22px; box-shadow: var(--shadow-sm); }
.word.tiles .g.digraph { border-bottom: 0; box-shadow: inset 0 -7px 0 var(--grape), var(--shadow-sm); }
.word.tiles .g.lit, .word.tiles .g.on { background: #fff3c4; transform: translateY(-6px); }
.blend { display: flex; flex-direction: column; align-items: center; gap: 30px; }
.slide { position: relative; width: 420px; max-width: 90vw; height: 76px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-sm); touch-action: none; opacity: .5; transition: opacity .3s; }
.slide.ready { opacity: 1; }
.slide-track { position: absolute; left: 50px; right: 50px; top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; background: repeating-linear-gradient(90deg, #d9d2f5 0 16px, transparent 16px 26px); }
.slide-track::after { content: '➜'; position: absolute; right: -40px; top: -23px; font-size: 40px; color: #c9bff2; }
.slide-knob { position: absolute; left: 0; top: 50%; width: 70px; height: 70px; margin: -35px 0 0 0; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: linear-gradient(180deg, #ffe066, #ffb31a); box-shadow: var(--shadow-sm); transition: left .05s linear; }
.slide.ready .slide-knob { animation: nudge 1.4s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { margin-left: 0; } 50% { margin-left: 22px; } }
.missing-prompt { display: flex; align-items: center; gap: 30px; }
.missing-prompt .pic { font-size: clamp(90px, 15vmin, 140px); }

/* building words */
.slots { display: flex; gap: 14px; justify-content: center; }
.slot { width: clamp(100px, 16vmin, 140px); height: clamp(110px, 18vmin, 150px); border-radius: 26px; border: 5px dashed #c9bff2; display: grid; place-items: center; background: rgba(255, 255, 255, .5); }
.slot.filled { border: 0; background: none; }
.slots.done { animation: boing .5s; }
.card.letter.tile, .card.letter.placed { width: clamp(96px, 15vmin, 134px); min-height: clamp(104px, 17vmin, 144px); }
.card.letter.tile span, .card.letter.placed span { font-size: clamp(60px, 11vmin, 96px); }
.card.letter.tile.used { visibility: hidden; }
.bank { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* magic e */
.magic-row { display: flex; align-items: center; gap: 16px; }
.magic-drop { border-color: var(--grape); }
.card.letter.magic-e { width: 140px; min-height: 150px; background: linear-gradient(180deg, #f3ecff, #e2d4ff); animation: bob 2s ease-in-out infinite; }
.card.letter.magic-e span:first-child { color: var(--grape); }
.magic-e .wand { position: absolute; right: -16px; top: -18px; font-size: 52px; }
.word.transform { animation: popIn .6s cubic-bezier(.3, 1.6, .5, 1); }
.prompt.sparkly { animation: none; }

/* memory */
.memory { display: grid; grid-template-columns: repeat(4, clamp(110px, 17vmin, 160px)); gap: 16px; perspective: 900px; }
.mcard { position: relative; height: clamp(110px, 17vmin, 160px); transform-style: preserve-3d; transition: transform .45s; }
.mcard.up { transform: rotateY(180deg); }
.mcard .face { position: absolute; inset: 0; border-radius: 24px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow-sm); }
.mcard .back { background: linear-gradient(135deg, var(--grape), var(--berry)); font-size: 50px; }
.mcard .front { background: #fff; transform: rotateY(180deg); }
.mcard .letterface { font-family: var(--read); font-weight: 700; font-size: clamp(60px, 10vmin, 90px); color: var(--cons); }
.mcard .front .pic { font-size: 70px; }
.mcard.matched .front { box-shadow: 0 0 0 6px var(--good); }

/* heart words */
.heart-word { display: flex; font-family: var(--read); font-weight: 700; font-size: clamp(100px, 18vmin, 170px); padding: 30px 50px 10px; background: #fff; border-radius: 40px; box-shadow: var(--shadow); position: relative; }
.heart-word .hl { position: relative; color: var(--cons); }
.heart-word .hl.tricky { color: var(--berry); }
.heart-word .heart { position: absolute; top: -.05em; left: 50%; transform: translateX(-50%); font-size: .3em; animation: bob 1.6s ease-in-out infinite; }
.heart-word .heart.whole { position: absolute; top: -.35em; left: 50%; font-size: .35em; }

/* sentences, stories */
.sentence { font-family: var(--read); font-weight: 700; font-size: clamp(40px, 6.6vmin, 64px); line-height: 1.35; text-align: center; padding: 16px 30px; background: #fff; border-radius: 30px; box-shadow: var(--shadow); max-width: 90%; }
.sw { border-radius: 12px; padding: 0 .06em; transition: background .2s; }
.sw.lit { background: #fff0a8; }
.scene { display: flex; align-items: flex-end; justify-content: center; gap: 4px; flex-wrap: wrap; }
.scene .pic { font-size: clamp(54px, 9vmin, 84px); }
.scene[data-n="1"] .pic { font-size: clamp(80px, 13vmin, 120px); }
.scene .stack { display: inline-flex; flex-direction: column; align-items: center; font-size: clamp(54px, 9vmin, 84px); }
.scene .stack .pic { font-size: 1em; }
.scene .stack .pic.top { font-size: .72em; margin-bottom: -.32em; position: relative; z-index: 1; }
.page-pic .scene .stack { font-size: clamp(90px, 17vmin, 160px); }
.pic-chompy .chompy-mini { display: inline-block; width: 1em; height: 1.05em; vertical-align: bottom; }
.pic-chompy .chompy-mini svg { width: 100%; height: 100%; overflow: visible; }
.card.scenecard { min-height: clamp(130px, 22vmin, 200px); }
.card.choice { gap: 4px; font-size: 34px; font-weight: 700; }
.card.choice .big { font-size: clamp(70px, 12vmin, 110px); line-height: 1; }
.card.choice.true { background: #eafff5; }
.card.choice.silly { background: #fff0f6; }
.card.answer { gap: 6px; font-weight: 600; font-size: 22px; text-align: center; }
.card.answer .pic { font-size: clamp(60px, 10vmin, 90px); }
.question { font-size: clamp(30px, 5vmin, 44px); font-weight: 700; text-align: center; max-width: 80%; }
.book-title { text-align: center; animation: popIn .5s cubic-bezier(.3, 1.5, .5, 1); }
.book-title h2 { font-family: var(--read); font-size: clamp(44px, 7vmin, 70px); margin-top: 20px; }
.book-cover { display: inline-block; padding: 30px 50px; border-radius: 30px; background: linear-gradient(180deg, #fff, #f6f1ff); box-shadow: var(--shadow); border-left: 18px solid var(--grape); }
.page { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2vh; padding: 10px 0; }
.page.turn { animation: turn .45s ease; }
@keyframes turn { from { transform: perspective(1200px) rotateY(-25deg) translateX(60px); opacity: 0; } }
.page-pic { flex: 1; display: grid; place-items: center; width: 100%; border-radius: 34px; background: linear-gradient(180deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .5)); box-shadow: var(--shadow-sm); }
.page-pic .scene .pic { font-size: clamp(90px, 17vmin, 160px); }
.page .sentence { max-width: 100%; }
.page-nav { display: flex; align-items: center; gap: 24px; justify-content: center; width: 100%; }
.page-nav .btn.small { font-size: 24px; padding: .6em 1.2em; }
.pageno { font-size: 22px; color: var(--ink-soft); font-weight: 600; }
.grownup { text-align: center; display: flex; flex-direction: column; gap: 20px; align-items: center; font-size: 30px; font-weight: 600; }

/* robot and alien */
.robot { position: relative; display: flex; align-items: center; gap: 10px; }
.robot .bot { font-size: clamp(110px, 18vmin, 160px); line-height: 1; display: inline-block; }
.robot.talking .bot { animation: robo .25s steps(2) infinite; }
@keyframes robo { 50% { transform: rotate(-6deg) translateY(-6px); } }
.robot .bubble { position: relative; padding: 18px 28px; background: #fff; border-radius: 30px; font-size: 44px; font-weight: 700; box-shadow: var(--shadow-sm); }
.robot .bubble::before { content: ''; position: absolute; left: -16px; top: 50%; margin-top: -12px; border: 12px solid transparent; border-right: 16px solid #fff; border-left: 0; }

/* results */
.done-card, .results { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: min(80vw, 480px); }
.done-card h2, .results h2 { font-size: clamp(30px, 5vmin, 44px); }
.done-card .stars { font-size: 76px; }
.done-chompy { width: 150px; }
.prize-row { display: flex; align-items: center; justify-content: center; gap: 30px; }
.new-sticker { font-size: 90px; animation: popIn .6s cubic-bezier(.3, 1.8, .5, 1); background: #fff; border-radius: 30px; padding: 10px 26px; box-shadow: var(--shadow-sm); }
.score { font-size: 46px; font-weight: 700; }
.score .big { font-size: 110px; color: var(--grape); line-height: 1; }
.trophy-big { font-size: 100px; animation: popIn .7s cubic-bezier(.3, 1.8, .5, 1); }
.unlock { font-size: 26px; font-weight: 700; }
.unlock .big { font-size: 60px; vertical-align: middle; }
.encourage { font-size: 26px; font-weight: 600; max-width: 520px; }

/* stickers */
.sticker-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px; padding: var(--top) 18px 0; z-index: 5; }
.sticker-top h2 { font-size: clamp(28px, 4.4vmin, 40px); text-shadow: 0 3px 0 #fff; }
.sticker-page { position: absolute; top: calc(var(--top) + 80px); bottom: 150px; left: 18px; right: 18px; border-radius: 36px; overflow: hidden; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #c8f0ff 0 55%, #9ee27a 55% 100%); }
.sticker-page::before { content: '☀️'; position: absolute; right: 30px; top: 20px; font-size: 80px; }
.sticker-page::after { content: ''; position: absolute; left: 0; right: 0; top: 55%; height: 14px; background: #88d465; }
.placed { position: absolute; z-index: 2; line-height: 1; touch-action: none; filter: drop-shadow(0 4px 0 rgba(255, 255, 255, .9)) drop-shadow(0 6px 8px rgba(43, 34, 80, .2)); }
.tray { position: absolute; left: 0; right: 0; bottom: 0; height: 140px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 16px; align-items: center; overflow-x: auto; background: rgba(255, 255, 255, .92); box-shadow: 0 -6px 20px rgba(43, 34, 80, .1); }
.tray-sticker { font-size: 66px; flex: none; touch-action: none; filter: drop-shadow(0 3px 0 #fff) drop-shadow(0 4px 6px rgba(43, 34, 80, .2)); }
.tray-sticker.ghost { position: fixed; z-index: 100; transform: translate(-50%, -50%) scale(1.3); pointer-events: none; }
.tray .empty { font-size: 24px; color: var(--ink-soft); }

/* closet */
.closet-body { position: absolute; top: calc(var(--top) + 90px); bottom: 20px; left: 20px; right: 20px; display: flex; gap: 4vw; align-items: center; justify-content: center; }
.closet-chompy { width: min(40vmin, 340px); flex: none; }
.hats { display: grid; grid-template-columns: repeat(auto-fill, 92px); gap: 14px; max-width: 560px; max-height: 100%; overflow-y: auto; padding: 10px; }
.hat { width: 92px; height: 92px; border-radius: 24px; background: #fff; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 50px; line-height: 1; }
.hat.locked { background: #ece8f7; font-size: 34px; color: #b3a9d6; }
.hat small { font-size: 13px; font-weight: 600; margin-top: 4px; }

/* grown-ups */
.gate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gate h3 { font-size: 30px; }
.hold-ring { width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; font-weight: 700; background: conic-gradient(var(--grape) 0deg, #ece8fb 0deg); box-shadow: var(--shadow-sm); touch-action: none; }
.hold-ring span { width: 110px; height: 110px; border-radius: 50%; background: #fff; display: grid; place-items: center; }
.hold-ring.holding { animation: fill 3s linear forwards; }
@property --deg { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.hold-ring { --deg: 0deg; background: conic-gradient(var(--grape) var(--deg), #ece8fb var(--deg)); }
@keyframes fill { to { --deg: 360deg; } }
.screen-parents { background: #f7f5ff; }
.parents { position: absolute; inset: 0; overflow-y: auto; padding: var(--top) 24px 40px; -webkit-user-select: text; user-select: text; }
.ptop { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.ptop h2 { font-size: 36px; }
.ptabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.ptab { padding: 10px 20px; border-radius: 999px; background: #fff; font-weight: 600; font-size: 20px; box-shadow: var(--shadow-sm); }
.ptab.on { background: var(--grape); color: #fff; }
.pcard { background: #fff; border-radius: 24px; padding: 18px 22px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.pcard h3 { font-size: 26px; display: flex; align-items: center; gap: 8px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 10px; }
.ptable th, .ptable td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.ptable th { color: var(--ink-soft); font-weight: 600; }
.ptable tr.passed td:first-child { color: var(--good); font-weight: 700; }
.setting { display: flex; align-items: center; gap: 16px; justify-content: space-between; background: #fff; padding: 14px 20px; border-radius: 20px; margin-bottom: 10px; font-size: 20px; box-shadow: var(--shadow-sm); }
.setting input[type=range] { width: 260px; accent-color: var(--grape); }
.setting input[type=checkbox] { width: 30px; height: 30px; accent-color: var(--grape); flex: none; }
.sound-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 12px; }
.sound-tile { background: #fff; border-radius: 20px; padding: 10px; text-align: center; box-shadow: var(--shadow-sm); }
.sound-tile .g { font-family: var(--read); font-size: 44px; font-weight: 700; color: var(--cons); display: block; }
.about { max-width: 760px; font-size: 19px; line-height: 1.5; background: #fff; padding: 20px 28px; border-radius: 24px; box-shadow: var(--shadow-sm); }
.about h3 { margin-top: 10px; }

/* effects */
.flying { position: fixed; z-index: 1000; pointer-events: none; margin: 0 !important; }
.burst { position: fixed; z-index: 1001; font-size: 30px; pointer-events: none; }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 999; pointer-events: none; }

/* ---------- Chompy ---------- */
.chompy { position: relative; }
.chompy svg { display: block; width: 100%; height: auto; overflow: visible; }
.chompy .c-all, .chompy .c-arm, .chompy .c-eye, .chompy .c-brow { transform-box: fill-box; }
.chompy .c-all { transform-origin: 50% 100%; }
.chompy.idle .c-all { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
.chompy .c-eye { transform-origin: 50% 50%; transition: transform .08s; }
.chompy.blink .c-eye { transform: scaleY(.1); }
.chompy .c-pupil { transition: transform .25s ease; }
.chompy .c-lid { display: none; }
[data-mouth="smile"] .c-mouth-open, [data-mouth="smile"] .c-mouth-sad,
[data-mouth="open"] .c-mouth-smile, [data-mouth="open"] .c-mouth-sad,
[data-mouth="sad"] .c-mouth-smile, [data-mouth="sad"] .c-mouth-open { display: none; }
.chompy .c-zzz { display: none; }
.chompy.sleeping .c-zzz { display: inline; animation: bob 2s ease-in-out infinite; }
.chompy.sleeping .c-eye { transform: scaleY(.12); }
.chompy.hop .c-all { animation: hop .6s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes hop { 0% { transform: scale(1.1, .9); } 40% { transform: translateY(-14%) scale(.95, 1.06); } 70% { transform: translateY(0) scale(1.06, .95); } 100% { transform: none; } }
.chompy.dance .c-all { animation: dance .45s ease-in-out infinite; }
@keyframes dance { 0%, 100% { transform: rotate(-7deg) translateY(0); } 50% { transform: rotate(7deg) translateY(-6%); } }
.chompy .c-arm-l { transform-origin: 90% 20%; }
.chompy .c-arm-r { transform-origin: 10% 20%; }
.chompy.dance .c-arm-l, .chompy.hop .c-arm-l { animation: waveL .45s ease-in-out infinite; }
.chompy.dance .c-arm-r, .chompy.hop .c-arm-r { animation: waveR .45s ease-in-out infinite; }
@keyframes waveL { 50% { transform: rotate(40deg); } }
@keyframes waveR { 50% { transform: rotate(-40deg); } }
.chompy.wiggle .c-all { animation: shake .5s; }
.chompy.droop .c-all { animation: droop 1.2s ease; }
@keyframes droop { 30%, 70% { transform: scale(1.05, .92); } }
.chompy.surprise .c-brow { transform: translateY(-8px); }
.chompy.chew .c-all { transform: scale(1.03, .97); }
.chompy .c-hat { transform-box: fill-box; transform-origin: 50% 100%; transform: rotate(-8deg); }
.title-chompy .chompy .c-arm-r { animation: waveR 1s ease-in-out infinite; }

/* =====================================================================
   Papercraft look: layered paper scenes, drawn icons, sticker pictures.
   (later rules here deliberately override the earlier, simpler styles)
   ===================================================================== */
.icon { display: inline-flex; width: 1em; height: 1em; line-height: 0; vertical-align: middle; }
.icon svg { width: 100%; height: 100%; overflow: visible; }
.fx-layer { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2000; pointer-events: none; }

/* ---------- scenes ---------- */
.scene { position: absolute; inset: 0; overflow: hidden; background: #bfefff; }
.scene-svg, .band-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.paper-grain { position: absolute; inset: 0; pointer-events: none; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .45 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E"); }
.calm-wash { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, rgba(255,255,255,.42), rgba(255,255,255,.12) 70%); }
.cloud { animation: cloudDrift var(--dur, 90s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes cloudDrift { from { transform: translateX(-1800px); } to { transform: translateX(1800px); } }
.sun .rays { animation: spin 70s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: sway var(--sway, 4s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
.sway.slow { animation-name: swaySlow; }
@keyframes sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes swaySlow { from { transform: rotate(-1.6deg); } to { transform: rotate(1.6deg); } }
.wave { animation: waveMove var(--wdur, 8s) linear infinite; }
@keyframes waveMove { from { transform: translateX(0); } to { transform: translateX(calc(100px * var(--wdir, 1))); } }
.aurora { animation: aurora var(--adur, 10s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
@keyframes aurora { from { transform: translateX(-80px); opacity: .18; } to { transform: translateX(80px); opacity: .4; } }
.twinkle { animation: twinkle var(--tw, 2.5s) ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes twinkle { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }
.flyer { animation: fly var(--fly, 18s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes fly { 0% { transform: translate(-120px, var(--fy)); } 50% { transform: translate(800px, calc(var(--fy) - 70px)); } 100% { transform: translate(1720px, var(--fy)); } }
.flap { transform-box: fill-box; transform-origin: 50% 50%; animation: flap .22s ease-in-out infinite alternate; }
.bird .flap { animation-duration: .4s; }
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }
.float { animation: floatY var(--float, 8s) ease-in-out infinite alternate; animation-delay: var(--delay, 0s); }
@keyframes floatY { from { transform: translateY(0); } to { transform: translateY(-36px); } }
.flag { animation: flag 1.4s ease-in-out infinite alternate; }
@keyframes flag { from { transform: skewY(-6deg); } to { transform: skewY(6deg); } }
.mist { animation: mist 9s ease-in-out infinite alternate; }
@keyframes mist { from { opacity: .12; transform: translateX(-40px); } to { opacity: .3; transform: translateX(40px); } }
@media (prefers-reduced-motion: reduce) {
  .cloud, .sun .rays, .sway, .wave, .aurora, .twinkle, .flyer, .flap, .float, .flag, .mist { animation: none !important; }
}

/* ---------- title ---------- */
.floaters span { color: #fff; opacity: .7; text-shadow: 0 3px 0 rgba(42, 31, 79, .12); }
.logo span { -webkit-text-stroke: 6px #fff; text-shadow: 0 6px 0 rgba(42, 31, 79, .22), 0 14px 22px rgba(42, 31, 79, .18); }
.logo .reads { -webkit-text-stroke: 6px #fff; }
.title-chompy { position: relative; z-index: 0; isolation: isolate; }
.sunburst { position: absolute; left: 50%; top: 50%; width: 220%; aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: -1;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .55) 0deg 10deg, rgba(255, 255, 255, 0) 10deg 20deg);
  -webkit-mask: radial-gradient(circle, #000 0 22%, transparent 62%); mask: radial-gradient(circle, #000 0 22%, transparent 62%);
  animation: sunburst 24s linear infinite; }
@keyframes sunburst { to { transform: translate(-50%, -50%) rotate(360deg); } }
.btn .icon { font-size: 1.1em; }
.btn.play .icon { font-size: .9em; filter: drop-shadow(0 2px 0 rgba(42, 31, 79, .2)); }

/* ---------- paper buttons ---------- */
.btn { box-shadow: inset 0 3px 0 rgba(255, 255, 255, .8), 0 5px 0 rgba(42, 31, 79, .16), 0 12px 20px rgba(42, 31, 79, .12); }
.btn.round { background: linear-gradient(180deg, #fff, #f3eefe); }
.btn.round .icon { font-size: 38px; }
.btn.round.grownup .icon { font-size: 30px; }
.btn.next .icon { font-size: 44px; }
.btn.snack { background: radial-gradient(circle at 40% 35%, #fff3d8, #ffd99a 70%); }
.btn.snack .icon { font-size: 54px; }
.close .icon { font-size: 22px; }

/* ---------- map ---------- */
.world-band { background: none; }
.world-band::after { display: none; }
.band-art { position: absolute; inset: 0; }
.world-title { top: 22px; padding: 12px 44px; border-radius: 10px; background: #fff; color: var(--ink);
  box-shadow: 0 6px 0 rgba(42, 31, 79, .14), 0 14px 24px rgba(42, 31, 79, .14); font-size: clamp(26px, 3.8vmin, 36px); }
.world-title::before, .world-title::after { content: ''; position: absolute; top: 14px; width: 34px; height: 100%; background: #ffd9ec; z-index: -1; border-radius: 6px; }
.world-title::before { left: -22px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 30% 50%); }
.world-title::after { right: -22px; clip-path: polygon(0 0, 100% 0, 70% 50%, 100% 100%, 0 100%); }
.road-shadow { fill: none; stroke: rgba(42, 31, 79, .14); stroke-width: 34; stroke-linecap: round; transform: translateY(8px); }
.road { fill: none; stroke: #fffaf0; stroke-width: 30; stroke-linecap: round; }
.road-dash { fill: none; stroke: #e8dcc2; stroke-width: 5; stroke-dasharray: 2 20; stroke-linecap: round; }
.road-gold { fill: none; stroke: #ffbe2e; stroke-width: 9; stroke-dasharray: 1 18; stroke-linecap: round; animation: march 1.2s linear infinite; filter: drop-shadow(0 0 4px rgba(255, 190, 46, .8)); }
@keyframes march { to { stroke-dashoffset: -19; } }
.ncircle { width: 104px; height: 104px; padding: 7px; border: 0; border-radius: 50%; background: #fff;
  box-shadow: inset 0 -6px 0 rgba(42, 31, 79, .1), 0 8px 0 rgba(42, 31, 79, .16), 0 16px 26px rgba(42, 31, 79, .18); }
.nface { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #ffffff, #e9e3ff 75%); box-shadow: inset 0 3px 8px rgba(42, 31, 79, .15); }
.nface .icon { font-size: 52px; }
.nletters { font-family: var(--read); font-weight: 700; font-size: 26px; color: var(--cons); line-height: .95; text-align: center; letter-spacing: 1px; padding: 0 6px; }
.nletters { white-space: nowrap; letter-spacing: 0; word-spacing: -2px; }
.nletters.small { font-size: 21px; }
.nletters.tiny { font-size: 15px; white-space: normal; line-height: 1.05; }
.lnode.passed .nface { background: radial-gradient(circle at 35% 30%, #fff6c8, #ffc94a 75%); }
.lnode.passed .nletters { color: #8a5200; }
.lnode.current .ncircle { animation: none; }
.lnode.current .nface { background: radial-gradient(circle at 35% 30%, #d6fff3, #4fe3b6 80%); }
.lnode.current .nletters { color: #0b5d4c; }
.lnode.locked .ncircle { filter: saturate(.25); }
.lnode.locked .nface { opacity: .75; }
.nhalo { position: absolute; top: 0; left: 50%; width: 104px; height: 104px; margin-left: -52px; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 0 rgba(79, 227, 182, .7); animation: halo 1.8s ease-out infinite; }
@keyframes halo { to { box-shadow: 0 0 0 26px rgba(79, 227, 182, 0); } }
.nbadge { position: absolute; top: -12px; right: 2px; font-size: 40px; transform: rotate(14deg); filter: drop-shadow(0 3px 0 rgba(42, 31, 79, .2)); }
.nlock { top: 64px; right: 4px; font-size: 34px; }
.nnum { background: var(--ink); top: -6px; left: -4px; }
.nlabel { background: #fff; box-shadow: 0 3px 0 rgba(42, 31, 79, .12); }
.chompy.map-chompy { width: 112px; filter: drop-shadow(0 8px 6px rgba(42, 31, 79, .2)); }

/* ---------- level card ---------- */
.lc-icon { font-size: 64px; overflow: hidden; background: radial-gradient(circle at 35% 30%, #fff, #ece6ff 80%); border-radius: 50%; }
.lc-icon .nletters { font-size: 30px; }
.lcircle .icon { font-size: 50px; }
.challenge-btn .trophy .icon { font-size: 60px; }

/* ---------- lesson screens ---------- */
.progress { background: rgba(255, 255, 255, .85); }
.pdot { position: relative; width: 34px; height: 34px; background: none; display: grid; place-items: center; font-size: 32px; }
.pdot .icon { position: absolute; }
.pdot .full { opacity: 0; transform: scale(.3); transition: all .3s cubic-bezier(.3, 1.8, .5, 1); }
.pdot.now { transform: scale(1.2); background: none; }
.pdot.now .empty { filter: drop-shadow(0 0 6px rgba(255, 190, 46, .9)); }
.pdot.ok { background: none; }
.pdot.ok .full { opacity: 1; transform: scale(1); }
.pdot.miss { background: none; }
.pdot.miss .empty { filter: hue-rotate(290deg) saturate(2); opacity: .7; }
.tlabel .icon { font-size: 46px; }
.speaker .icon { font-size: 40px; }
.ear .icon { font-size: clamp(76px, 12vmin, 104px); }
.feed-prompt .icon { font-size: 70px; filter: drop-shadow(0 6px 0 rgba(42, 31, 79, .15)); animation: bob 2.4s ease-in-out infinite; }
.big-icon .icon { font-size: 130px; filter: drop-shadow(0 8px 0 rgba(42, 31, 79, .15)); }
.loading .icon { font-size: 96px; animation: bob 1s ease-in-out infinite; }
.pause-icon .icon { font-size: 120px; animation: bob 2s ease-in-out infinite; }

/* paper cards: a white sheet with a lit top edge and a soft stacked shadow */
.card { background: linear-gradient(180deg, #ffffff, #faf6ff); border: 3px solid #fff;
  box-shadow: inset 0 -5px 0 rgba(42, 31, 79, .06), 0 7px 0 rgba(42, 31, 79, .13), 0 18px 30px rgba(42, 31, 79, .14); }
.card.letter span { text-shadow: 0 4px 0 rgba(42, 31, 79, .14); }
.card.right { box-shadow: 0 0 0 8px #3ddc97, 0 0 40px rgba(61, 220, 151, .7), 0 18px 30px rgba(42, 31, 79, .14); }
.card.show-right { box-shadow: 0 0 0 8px #3ddc97, 0 18px 30px rgba(42, 31, 79, .14); }
.card.choice .icon.big { font-size: clamp(72px, 12vmin, 110px); }
/* emoji pictures as die-cut stickers */
.pic { filter: drop-shadow(2.5px 0 0 #fff) drop-shadow(-2.5px 0 0 #fff) drop-shadow(0 2.5px 0 #fff) drop-shadow(0 -2.5px 0 #fff) drop-shadow(0 7px 6px rgba(42, 31, 79, .28)); }
.pic.pic-chompy { filter: drop-shadow(0 6px 6px rgba(42, 31, 79, .25)); }
.card.picture .pic, .big-pic .pic { transform-origin: 50% 90%; }
.opt.card.picture:nth-child(odd) .pic { transform: rotate(-3deg); }
.opt.card.picture:nth-child(even) .pic { transform: rotate(3deg); }
.word.tiles .g, .word.read { border: 3px solid #fff; box-shadow: inset 0 -5px 0 rgba(42, 31, 79, .06), 0 6px 0 rgba(42, 31, 79, .13), 0 14px 24px rgba(42, 31, 79, .12); }
.sentence, .question { background: #fff; }
.question { padding: 14px 26px; border-radius: 26px; box-shadow: 0 6px 0 rgba(42, 31, 79, .12); }
.page-pic { background: rgba(255, 255, 255, .55); border: 3px solid rgba(255, 255, 255, .9); }

/* Robo and Zib */
.friend { width: clamp(140px, 22vmin, 190px); flex: none; }
.friend svg { width: 100%; height: auto; overflow: visible; display: block; }
.friend .f-bob { animation: friendBob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes friendBob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
.robo.talking .f-bob { animation: robo .26s steps(2) infinite; }
.robo .r-light { transform-box: fill-box; transform-origin: center; }
.robo.talking .r-light { animation: blinkLight .3s steps(2) infinite; }
@keyframes blinkLight { 50% { fill: #ffd84d; } }
.robo .r-mouth { transform-box: fill-box; transform-origin: center; }
.robo.talking .r-mouth { animation: talkBars .18s steps(2) infinite; }
@keyframes talkBars { 50% { transform: scaleY(2.4); } }
.zib .z-eyes { transform-box: fill-box; transform-origin: center; animation: zibBlink 4s infinite; }
@keyframes zibBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.zib .z-mouth { transform-box: fill-box; transform-origin: 50% 0; }
.robot .bubble { font-family: var(--read); }

/* results */
.trophy-big { position: relative; font-size: 100px; width: 150px; height: 150px; display: grid; place-items: center; }
.trophy-big .icon { position: relative; filter: drop-shadow(0 8px 0 rgba(42, 31, 79, .15)); }
.trophy-big .sunburst { width: 260%; background: repeating-conic-gradient(from 0deg, rgba(255, 200, 60, .55) 0deg 10deg, rgba(255, 200, 60, 0) 10deg 20deg); z-index: 0; }
.stars { display: inline-flex; gap: 4px; }
.star { position: relative; display: inline-grid; width: 1em; height: 1em; }
.star .icon { position: absolute; inset: 0; width: 1em; height: 1em; }
.star .full { opacity: 0; transform: scale(.2); transition: all .35s cubic-bezier(.3, 1.8, .5, 1); }
.star.on .full { opacity: 1; transform: scale(1); }
.done-card .stars { font-size: 72px; }
.lesson .stars { font-size: 22px; }
.pause-card { background: rgba(42, 31, 79, .5); }
.level-card { width: min(86vw, 760px); }
.lessons { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
