* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a9df4; touch-action: none; }
body { font-family: "Baloo 2", "Arial Rounded MT Bold", system-ui, sans-serif; }
#stage { position: absolute; left: 50%; top: 50%; width: 1600px; height: 1000px; overflow: hidden; transform-origin: 50% 50%; }
button { font: inherit; cursor: pointer; border: 0; }

/* ---------- scene ---------- */
.scene { position: absolute; inset: 0; overflow: hidden; }
.sky { position: absolute; inset: 0; background: linear-gradient(#5ec8ff 0%, #a8e4ff 55%, #e9f9ff 100%); }
.sun { position: absolute; right: 120px; top: 40px; width: 200px; height: 200px; border-radius: 50%; background: url(#) ; background: radial-gradient(circle, #fffbe0 0 30%, #ffe680 45%, rgba(255,209,102,.5) 60%, rgba(255,209,102,0) 72%); animation: pulse 4s ease-in-out infinite; }
.cloud { position: absolute; animation: drift 9s ease-in-out infinite alternate; }
.layer { position: absolute; left: 0; top: 0; width: 3200px; height: 1000px; will-change: transform; }
.road { position: absolute; left: 0; right: 0; top: 790px; height: 210px; background: linear-gradient(#f7c873, #e9a94f); border-top: 6px solid #2f2a45; overflow: hidden; }
.road::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 26px; background: #ffe2a8; }
.dashes { position: absolute; left: -160px; top: 96px; width: 2000px; height: 18px; background: repeating-linear-gradient(90deg, #fff6dd 0 80px, transparent 80px 160px); border-radius: 9px; will-change: transform; }
.berries { position: absolute; inset: 0; pointer-events: none; }
.berry { position: absolute; left: -15px; top: -15px; width: 30px; height: 30px; border-radius: 50%; border: 4px solid #2f2a45; box-shadow: inset -5px -6px 0 rgba(0,0,0,.18), inset 5px 5px 0 rgba(255,255,255,.55); }
.items { position: absolute; inset: 0; }

/* ---------- Chompy ---------- */
.chompy { position: absolute; left: 120px; top: 480px; width: 330px; height: 344px; z-index: 5; cursor: pointer; transform-origin: 50% 100%; }
.chompy svg { width: 100%; height: 100%; overflow: visible; }
.ch-body { transform-origin: 120px 230px; transition: transform .25s; }
.chompy.rolling .ch-body { animation: hop .32s ease-in-out infinite; }
.ch-pupils { transition: transform .25s; }
.ch-mouth-open { transform-origin: 120px 134px; transform: scaleY(0); transition: transform .08s; }
.ch-mouth-closed { transition: opacity .08s; }
.chompy.open .ch-mouth-open { transform: scaleY(1); }
.chompy.open .ch-mouth-closed { opacity: 0; }
.chompy.wide .ch-body { transform: scale(1.08); }
.chompy.wide .ch-mouth-open { transform: scaleY(1.15); }
.chompy.happy { animation: happy .7s cubic-bezier(.3,1.6,.5,1); }
.chompy.full .ch-body { transform: scale(1.12, 1.08); }
.chompy.full { animation: happy 1s ease-in-out infinite; }

/* ---------- mic ---------- */
.mic { position: absolute; left: 400px; top: 380px; width: 130px; height: 130px; border-radius: 50%; background: #ff5d8f; border: 6px solid #2f2a45; z-index: 6; opacity: 0; transform: scale(.4); transition: opacity .25s, transform .3s cubic-bezier(.3,1.6,.5,1), background .2s; pointer-events: none; box-shadow: 0 8px 0 rgba(0,0,0,.15); }
.mic svg { position: absolute; inset: 18px; }
.mic.on { opacity: 1; transform: scale(1); }
.mic.heard { background: #06d6a0; transform: scale(1.12); }
.mic .ring { position: absolute; inset: -6px; border-radius: 50%; border: 6px solid #ff5d8f; opacity: 0; }
.mic.on .ring { animation: ring 1.4s ease-out infinite; }
.mic.on .ring.r2 { animation-delay: .7s; }
.mic.heard .ring { border-color: #06d6a0; }

/* ---------- items ---------- */
.bubble { position: absolute; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, #f3fbff 40%, #cfeefe 100%); border: 7px solid #2f2a45; box-shadow: 0 14px 0 rgba(47,42,69,.18), inset -14px -18px 0 rgba(120,180,230,.25); display: grid; place-items: center; cursor: pointer; animation: float 3s ease-in-out infinite; }
.bubble.letter .glyph { width: 74%; height: 74%; display: grid; place-items: center; }
.bubble.letter svg { height: 100%; width: auto; overflow: visible; }
.bubble.pic { background: radial-gradient(circle at 35% 30%, #fff 0 20%, #fffaf0 50%, #ffe9c2 100%); }
.bubble.pic svg { width: 78%; height: 78%; }
.bubble.dim { opacity: .35; filter: grayscale(.6); }
.wordcard { position: absolute; display: flex; justify-content: center; gap: 14px; padding: 18px 26px 34px; background: #fffdf5; border: 7px solid #2f2a45; border-radius: 40px; box-shadow: 0 14px 0 rgba(47,42,69,.18); }
.tile { position: relative; flex: 1; display: grid; place-items: center; border-radius: 26px; transition: background .2s; }
.tile svg { height: 100%; max-width: 100%; overflow: visible; }
.tile .dot { position: absolute; bottom: -22px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: #ffd166; border: 4px solid #2f2a45; }
.tile.next { background: #fff1b8; }
.tile.next .dot { animation: pulse 1s ease-in-out infinite; background: #ff9f1c; }
.tile.lit .dot { background: #06d6a0; }
.wordcard.blend::after { content: ''; position: absolute; left: 40px; right: 40px; bottom: 6px; height: 12px; border-radius: 6px; background: #06d6a0; transform-origin: left; animation: sweep 1.1s ease-out both; }
.hint-tap { animation: glow 1.4s ease-in-out infinite !important; }
.popin { animation: popin .5s cubic-bezier(.3,1.6,.5,1) both; }

/* ---------- HUD ---------- */
.hud { position: absolute; left: 0; right: 0; top: 0; height: 120px; display: flex; align-items: center; gap: 30px; padding: 0 30px; z-index: 8; }
.home { width: 96px; height: 96px; border-radius: 30px; background: #ff9f1c; border: 6px solid #2f2a45; box-shadow: 0 7px 0 rgba(0,0,0,.2); }
.home svg { width: 70%; }
.pellets { display: flex; gap: 14px; }
.pellets i { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.6); border: 4px solid #2f2a45; transition: background .3s, transform .3s; }
.pellets i.on { background: #ffd166; transform: scale(1.15); }
.scene.start .hud, .scene.start .mic { display: none; }

/* ---------- start ---------- */
.title { position: absolute; left: 0; right: 0; top: 120px; text-align: center; font-size: 170px; font-weight: 800; color: #ffd166; -webkit-text-stroke: 10px #2f2a45; paint-order: stroke fill; letter-spacing: 2px; z-index: 9; animation: float 3s ease-in-out infinite; text-shadow: 0 12px 0 rgba(47,42,69,.25); }
.title span { color: #ff70a6; }
.big-play { position: absolute; left: 680px; top: 430px; width: 240px; height: 240px; border-radius: 50%; background: #06d6a0; border: 9px solid #2f2a45; box-shadow: 0 14px 0 rgba(0,0,0,.2); z-index: 9; animation: pulse 1.6s ease-in-out infinite; }
.big-play svg { width: 60%; margin-left: 10%; }

/* ---------- levels ---------- */
.levels { position: absolute; inset: 0; }
.trail { position: absolute; inset: 0; }
.node { position: absolute; width: 190px; height: 190px; margin: -95px 0 0 -95px; border-radius: 50%; background: #ffd166; border: 8px solid #2f2a45; box-shadow: 0 12px 0 rgba(0,0,0,.18); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #2f2a45; }
.node .num { font-size: 40px; font-weight: 800; line-height: 1; opacity: .7; }
.node .ls { font-size: 62px; font-weight: 800; line-height: 1.05; }
.node .stars { position: absolute; bottom: -46px; font-size: 40px; letter-spacing: 2px; }
.node .stars i { font-style: normal; color: rgba(255,255,255,.75); -webkit-text-stroke: 3px #2f2a45; }
.node .stars i.on { color: #ffd166; }
.node.current { background: #06d6a0; animation: pulse 1.6s ease-in-out infinite; }
.node.locked { background: #cdd5df; }
.node.locked .ls { font-size: 52px; }
.lv-chompy { position: absolute; width: 230px; height: 240px; z-index: 3; animation: float 2.6s ease-in-out infinite; cursor: pointer; }
.lv-chompy svg { width: 100%; height: 100%; overflow: visible; }
.lv-title { position: absolute; left: 0; right: 0; top: 40px; text-align: center; font-size: 84px; font-weight: 800; color: #fff; -webkit-text-stroke: 7px #2f2a45; paint-order: stroke fill; }
.parent { position: absolute; left: 22px; top: 22px; width: 70px; height: 70px; border-radius: 50%; background: rgba(47,42,69,.35); overflow: hidden; }
.parent svg { position: relative; width: 70%; z-index: 1; }
.parent .fill { position: absolute; left: 0; bottom: 0; width: 100%; height: 0; background: #06d6a0; }
.parent.holding .fill { height: 100%; transition: height 3s linear; }

/* ---------- end ---------- */
.endcard { position: absolute; left: 520px; top: 170px; width: 900px; height: 520px; border-radius: 60px; background: rgba(255,255,255,.92); border: 8px solid #2f2a45; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 50px; animation: popin .6s cubic-bezier(.3,1.6,.5,1) both; }
.end-stars { font-size: 170px; line-height: 1; }
.end-stars i { font-style: normal; color: #dfe6ee; -webkit-text-stroke: 8px #2f2a45; display: inline-block; }
.end-stars i.on { color: #ffd166; animation: starpop .6s cubic-bezier(.3,1.8,.5,1) both; }
.end-btns { display: flex; gap: 60px; }
.end-btns button { width: 170px; height: 170px; border-radius: 50%; border: 8px solid #2f2a45; box-shadow: 0 10px 0 rgba(0,0,0,.2); }
.end-btns .again { background: #ff9f1c; }
.end-btns .next { background: #06d6a0; }
.end-btns svg { width: 62%; }

/* ---------- grown-ups panel ---------- */
.panel { position: absolute; inset: 0; background: rgba(20,20,40,.55); z-index: 20; display: grid; place-items: center; }
.sheet { width: 1300px; max-height: 920px; overflow: auto; background: #fff; border-radius: 30px; padding: 30px 44px; font-family: system-ui, sans-serif; font-size: 24px; color: #2f2a45; user-select: text; touch-action: pan-y; }
.sheet h2 { margin: 0 0 6px; font-size: 40px; }
.sheet h3 { margin: 22px 0 10px; }
.sheet .muted { color: #6b6880; font-size: 20px; }
.grid { display: flex; flex-wrap: wrap; gap: 10px; }
.cell { min-width: 58px; padding: 8px 12px; text-align: center; border-radius: 12px; font-size: 30px; font-weight: 700; }
.grid.words .cell { font-size: 24px; }
.cell.good { background: #b7f0c8; } .cell.mid { background: #ffe8a3; } .cell.low { background: #ffc2c8; } .cell.none { background: #eceef2; color: #8a8fa0; }
.sheet ul { margin: 0; padding-left: 24px; }
.row { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.row input[type=checkbox] { width: 30px; height: 30px; }
.sheet select, .sheet button { font-size: 22px; padding: 10px 18px; border-radius: 12px; }
.sheet button { background: #e9ecf3; }
.sheet .close { background: #06d6a0; color: #fff; font-weight: 700; margin-top: 16px; padding: 14px 40px; }

/* ---------- sparkles & animation ---------- */
.spark { position: absolute; width: 22px; height: 22px; margin: -11px; border-radius: 50%; z-index: 7; transition: transform .8s cubic-bezier(.2,.8,.3,1), opacity .8s; border: 3px solid #2f2a45; }
.bump { animation: bump .45s ease; }
.wiggle { animation: wiggle .9s ease; }
.shake { animation: shake .5s ease; }
.jump { animation: jump .5s cubic-bezier(.3,1.6,.5,1); }
.glow { animation: glow 1.4s ease-in-out; }
@keyframes hop { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-22px) rotate(2deg); } }
@keyframes happy { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-50px) scale(1.06, .95); } 70% { transform: translateY(0) scale(1.05, .92); } }
@keyframes float { 0%,100% { margin-top: 0; } 50% { margin-top: -14px; } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes drift { from { translate: -30px 0; } to { translate: 30px 0; } }
@keyframes bump { 50% { transform: scale(1.1); } }
@keyframes wiggle { 20% { rotate: -10deg; } 40% { rotate: 9deg; } 60% { rotate: -6deg; } 80% { rotate: 4deg; } }
@keyframes shake { 20%,60% { translate: -18px 0; } 40%,80% { translate: 18px 0; } }
@keyframes jump { 50% { translate: 0 -40px; } }
@keyframes glow { 0%,100% { box-shadow: 0 14px 0 rgba(47,42,69,.18); } 50% { box-shadow: 0 0 0 18px #ffd166, 0 0 50px 30px rgba(255,209,102,.8); } }
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes popin { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }

#rotate { display: none; }
@media (orientation: portrait) {
  #rotate { display: grid; place-items: center; position: fixed; inset: 0; background: #2a9df4; z-index: 99; color: #fff; font-size: 40px; text-align: center; }
}
