/* ==========================================================================
   styles.css  -  Astro Typer

   COLORS: change the finger colors / skin tone in :root just below.
   Layout is designed on a 1600x900 "stage" that scales to fit the window.
   ========================================================================== */
:root {
  /* one color per finger type (light / main / dark are used for the key shading) */
  --pinky-l: #ffa6cd;  --pinky: #ff7eb6;  --pinky-d: #cf4688;
  --ring-l: #86d0ff;   --ring: #4db8ff;   --ring-d: #2386cf;
  --middle-l: #8ee6a3; --middle: #5ed67a; --middle-d: #2fa24c;
  --index-l: #ffc980;  --index: #ffae42;  --index-d: #d17f12;
  --thumb-l: #cfa4f2;  --thumb: #b27be8;  --thumb-d: #7f48bd;
  --neutral-l: #a9b6ec; --neutral: #8493d6; --neutral-d: #5a68ae;

  --skin: #ffd5b0;
  --skin-line: #b9704a;
  --navy: #2b2d6e;
  --font: "Arial Rounded MT Bold", "Nunito", "Varela Round", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  font-weight: 800;
  color: #fff;
  background: #120f44;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}
button { font-family: inherit; font-weight: inherit; cursor: pointer; border: 0; color: inherit; }
svg { display: block; }

/* ---------------------------------------------------------------- BACKGROUND */
#bg {
  position: fixed; inset: 0; overflow: hidden; z-index: 0;
  background:
    radial-gradient(ellipse at 15% 20%, rgba(70, 90, 210, .45), transparent 55%),
    radial-gradient(ellipse at 90% 85%, rgba(160, 60, 190, .55), transparent 55%),
    linear-gradient(160deg, #0d1c5e 0%, #1c1c7a 40%, #3b1c7c 75%, #561f80 100%);
}
#bg .star {
  position: absolute; border-radius: 50%; background: #fff;
  box-shadow: 0 0 6px 1px rgba(255, 255, 255, .8);
  animation: twinkle 3s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.25); } }
.deco { position: absolute; filter: drop-shadow(0 0 18px rgba(130, 150, 255, .35)); animation: drift 9s ease-in-out infinite alternate; }
.deco svg { width: 100%; height: 100%; }
@keyframes drift { to { transform: translateY(-1.2vmin) rotate(2deg); } }
.d-moon-tl   { width: 26vmin; height: 26vmin; left: -8vmin; top: -8vmin; }
.d-mars-tl   { width: 8vmin; height: 8vmin; left: 24vmin; top: 6vmin; animation-delay: -3s; }
.d-orange-tr { width: 34vmin; height: 34vmin; right: -9vmin; top: -11vmin; animation-delay: -5s; }
.d-saturn-r  { width: 18vmin; height: 18vmin; right: 6vmin; top: 30vmin; animation-delay: -2s; }
.d-moon-r    { width: 10vmin; height: 10vmin; right: -2vmin; top: 50vmin; animation-delay: -6s; }
.d-saturn-br { width: 15vmin; height: 15vmin; right: 5vmin; top: 66vmin; animation-delay: -4s; }
.d-moon-bl   { width: 28vmin; height: 28vmin; left: -9vmin; bottom: -9vmin; animation-delay: -1s; }
.d-orange-br { width: 24vmin; height: 24vmin; right: -7vmin; bottom: -8vmin; animation-delay: -7s; }

/* --------------------------------------------------------------------- STAGE */
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1600px; height: 900px;
  transform: translate(-50%, -50%) scale(var(--s, 1));
  z-index: 1;
}
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Chunky outlined text */
.outlined, #heading, .logo, .screen-title {
  -webkit-text-stroke: 12px var(--navy);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(20, 10, 70, .45);
}

/* ------------------------------------------------------------------- BUTTONS */
.big-btn {
  font-size: 54px; padding: 18px 64px; border-radius: 60px;
  background: linear-gradient(#ffd54f, #ffa726); color: #4a2a00;
  box-shadow: 0 8px 0 #c57900, 0 14px 24px rgba(0, 0, 0, .35);
  transition: transform .12s;
}
.big-btn:hover { transform: translateY(-3px) scale(1.04); }
.big-btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #c57900; }
.mid-btn {
  font-size: 30px; padding: 12px 34px; border-radius: 40px;
  background: linear-gradient(#7e8bf0, #5663d4);
  box-shadow: 0 6px 0 #343c96, 0 10px 18px rgba(0, 0, 0, .3);
}
.mid-btn:hover { filter: brightness(1.1); }
.mid-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #343c96; }
.mid-btn.go { background: linear-gradient(#69e08c, #2fb35a); box-shadow: 0 6px 0 #1b7b3b; }
.mid-btn.warn { background: linear-gradient(#ffb067, #ee7a2a); box-shadow: 0 6px 0 #a94d10; }
.round-btn {
  width: 72px; height: 72px; border-radius: 50%; padding: 17px;
  background: linear-gradient(#7e8bf0, #5663d4);
  box-shadow: 0 5px 0 #343c96, 0 8px 16px rgba(0, 0, 0, .3);
}
.round-btn:hover { filter: brightness(1.12); }
.round-btn:active { transform: translateY(3px); }
#btn-home, #btn-back-title { position: absolute; left: 24px; top: 24px; z-index: 5; }

#topbar { position: absolute; right: 22px; top: 14px; display: flex; align-items: flex-start; gap: 16px; z-index: 20; }
#btn-fs { margin-top: 6px; }
#btn-fs .i-exit, #btn-fs.is-full .i-enter { display: none; }
#btn-fs.is-full .i-exit { display: block; }
#btn-parent { background: none; width: 104px; text-align: center; font-size: 18px; line-height: 1; padding: 0; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
#btn-parent svg { width: 66px; height: 66px; margin: 0 auto 4px; filter: drop-shadow(0 4px 0 rgba(30, 20, 100, .5)); }
#btn-parent:hover svg { transform: scale(1.08); }

/* --------------------------------------------------------------------- TITLE */
.logo { position: absolute; left: 0; right: 0; top: 80px; margin: 0; text-align: center; font-size: 190px; line-height: 1; }
.logo span { color: #ffc94a; }
.tagline { position: absolute; left: 0; right: 0; top: 300px; text-align: center; margin: 0; font-size: 44px; text-shadow: 0 4px 0 rgba(20, 10, 70, .6); }
#title-mascot { position: absolute; left: 640px; top: 370px; width: 320px; }
#btn-play { position: absolute; left: 50%; top: 740px; transform: translateX(-50%); }
#btn-play:hover { transform: translateX(-50%) translateY(-3px) scale(1.04); }
#btn-play:active { transform: translateX(-50%) translateY(5px); }
.press { position: absolute; left: 0; right: 0; top: 840px; text-align: center; margin: 0; font-size: 28px; opacity: .85; animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* ----------------------------------------------------------------- LEVEL MAP */
.screen-title { position: absolute; left: 0; right: 0; top: 30px; text-align: center; margin: 0; font-size: 72px; }
#level-grid {
  position: absolute; left: 70px; top: 150px; width: 1060px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px 18px;
}
.lvl-tile {
  position: relative; background: rgba(40, 36, 130, .55); border-radius: 28px; padding: 10px 6px 12px;
  height: 218px; display: flex; flex-direction: column; align-items: center;
  border: 4px solid rgba(160, 170, 255, .35);
  transition: transform .15s, border-color .15s;
}
.lvl-tile:hover { transform: translateY(-5px) scale(1.04); border-color: #ffd54f; }
.lvl-planet { width: 118px; height: 118px; animation: drift 5s ease-in-out infinite alternate; }
.lvl-num {
  position: absolute; left: 10px; top: 8px; width: 40px; height: 40px; border-radius: 50%;
  background: #ffd54f; color: #4a2a00; font-size: 24px; line-height: 40px; text-align: center;
}
.lvl-name { font-size: 24px; margin-top: 6px; line-height: 1.1; }
.lvl-bonus { position: absolute; right: 8px; top: 8px; font-size: 14px; background: #ff7eb6; border-radius: 12px; padding: 3px 8px; }
.lvl-badge { position: absolute; right: 8px; bottom: 8px; width: 54px; height: 54px; }
.lvl-badge svg { width: 100%; height: 100%; }
.lvl-tile.locked { filter: grayscale(.9) brightness(.7); }
.lvl-tile.current { border-color: #ffd54f; animation: tilePulse 1.6s ease-in-out infinite; }
.lvl-tile.shake { animation: wobble .5s; }
@keyframes tilePulse { 50% { box-shadow: 0 0 28px 6px rgba(255, 213, 79, .65); } }
#sticker-book {
  position: absolute; left: 1170px; top: 150px; width: 380px; height: 656px;
  background: rgba(40, 36, 130, .55); border: 4px solid rgba(160, 170, 255, .35); border-radius: 28px; padding: 16px;
}
#sticker-book h3 { margin: 0; font-size: 36px; text-align: center; text-shadow: 0 3px 0 rgba(20, 10, 70, .6); }
#book-count { text-align: center; font-size: 22px; opacity: .85; margin-bottom: 12px; }
#book-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.book-item { position: relative; aspect-ratio: 1; }
.book-item svg { width: 100%; height: 100%; }
.book-item:not(.has) svg { filter: grayscale(1) brightness(.45) opacity(.7); }
.book-item b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; color: #cdd2ff; }
.book-item.has { animation: drift 4s ease-in-out infinite alternate; }

/* --------------------------------------------------------------------- GAME */
#starbar { position: absolute; left: 400px; top: 18px; width: 800px; height: 76px; display: flex; align-items: center; justify-content: center; }
.sb-track {
  position: absolute; left: calc(var(--ss) / 2 + 5px); right: calc(var(--ss) / 2 + 5px); top: 50%; height: 20px; margin-top: -10px;
  background: #2c2f8f; border: 4px solid #7b87ea; border-radius: 12px; overflow: hidden;
}
.sb-fill { height: 100%; width: 0; background: linear-gradient(#ffe27a, #ffb02e); transition: width .5s cubic-bezier(.3, 1.4, .5, 1); }
.sb-stars { position: relative; display: flex; justify-content: space-between; width: calc(100% - 10px); }
.sb-star { width: var(--ss); height: var(--ss); }
.sb-star svg { width: 100%; height: 100%; overflow: visible; }
.s-empty { fill: #343a9e; stroke: #8b96f2; stroke-width: 5; stroke-linejoin: round; }
.s-fill { fill: #ffd23f; stroke: #c98a0a; stroke-width: 5; stroke-linejoin: round; opacity: 0; transform-origin: 50px 54px; }
.s-shine { fill: #fff; opacity: 0; }
.sb-star.full .s-fill { opacity: 1; animation: starPop .6s cubic-bezier(.3, 1.8, .5, 1); }
.sb-star.full .s-shine { opacity: .7; }
@keyframes starPop { 0% { transform: scale(.2) rotate(-90deg); } 70% { transform: scale(1.5) rotate(10deg); } 100% { transform: scale(1); } }

#heading { position: absolute; left: 0; right: 0; top: 92px; margin: 0; text-align: center; font-size: 66px; line-height: 1; }
#heading .hl { color: #ffc94a; }

/* the prompt: big bubble (single key) or wide card (word) */
#prompt-box { position: absolute; left: 0; right: 0; top: 168px; height: 176px; opacity: 0; pointer-events: none; }
#prompt-box.on { opacity: 1; }
#prompt-box.pop #bubble, #prompt-box.pop #word-card { animation: bubblePop .55s cubic-bezier(.3, 1.7, .5, 1); }
#prompt-box.yay #bubble, #prompt-box.yay #word-card { animation: bubbleYay .5s ease; }
@keyframes bubblePop { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes bubbleYay { 40% { transform: scale(1.18); } }
#bubble {
  position: absolute; left: 50%; top: 0; margin-left: -88px; width: 176px; height: 176px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), rgba(150, 200, 255, .35) 35%, rgba(130, 120, 240, .35) 70%, rgba(190, 150, 255, .55));
  border: 4px solid rgba(255, 255, 255, .8);
  box-shadow: 0 0 40px 10px rgba(140, 190, 255, .55), inset 0 0 30px rgba(255, 255, 255, .5);
  animation: bubbleGlow 2.4s ease-in-out infinite;
}
@keyframes bubbleGlow { 50% { box-shadow: 0 0 60px 18px rgba(170, 215, 255, .8), inset 0 0 30px rgba(255, 255, 255, .5); } }
#bubble-text { font-size: 124px; line-height: 1; color: #ffd44d; -webkit-text-stroke: 14px var(--navy); paint-order: stroke fill; text-shadow: 0 5px 0 rgba(30, 10, 80, .4); }
#bubble.is-space #bubble-text { font-size: 100px; }
#bubble .tw { position: absolute; width: 22px; height: 22px; background: #bfe9ff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 1.6s infinite; }
#bubble .t1 { left: -26px; top: 10px; } #bubble .t2 { right: -30px; bottom: 30px; animation-delay: .5s; } #bubble .t3 { right: 4px; top: -22px; animation-delay: 1s; width: 16px; height: 16px; }
#word-card {
  position: absolute; left: 50%; top: 4px; transform: translateX(-50%); display: none;
  align-items: center; gap: 22px; padding: 6px 34px 6px 24px; height: 160px; white-space: nowrap;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .6), rgba(130, 120, 240, .4));
  border: 4px solid rgba(255, 255, 255, .8); border-radius: 90px;
  box-shadow: 0 0 40px 8px rgba(140, 190, 255, .5);
}
#prompt-box.word #bubble { display: none; }
#prompt-box.word #word-card { display: flex; }
#word-emoji { font-size: 104px; line-height: 1; font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; }
#word-letters { display: flex; gap: 10px; }
.wl { width: 78px; height: 96px; display: grid; place-items: center; font-size: 72px; border-radius: 18px; background: rgba(30, 20, 100, .55); border: 4px solid rgba(255, 255, 255, .35); color: #fff; transition: all .25s; }
.wl.now { background: #ffd44d; color: var(--navy); border-color: #fff; animation: keyPulse 1s ease-in-out infinite; }
.wl.done { background: #5ed67a; color: var(--navy); border-color: #fff; }
#prompt-label { position: absolute; left: 50%; top: 178px; transform: translateX(-50%); font-size: 28px; padding: 2px 18px; border-radius: 20px; background: rgba(30, 20, 100, .6); }
#prompt-label:empty { display: none; }

/* hands */
#hands { position: absolute; inset: 0; pointer-events: none; }
.hand { position: absolute; width: 416px; height: 520px; }
.hand-svg { width: 100%; height: 100%; overflow: visible; }
.hand .skin { fill: var(--skin); stroke: var(--skin-line); stroke-width: 5; stroke-linejoin: round; }
.hand .patch { fill: var(--skin); }
.finger { --fc: var(--pinky); }
.ft-pinky { --fc: var(--pinky); } .ft-ring { --fc: var(--ring); } .ft-middle { --fc: var(--middle); }
.ft-index { --fc: var(--index); } .ft-thumb { --fc: var(--thumb); }
.no-colors .finger { --fc: var(--neutral); }
.finger .nail { fill: var(--fc); stroke: rgba(80, 40, 20, .35); stroke-width: 2; }
.finger .tip-glow { fill: var(--fc); opacity: 0; filter: blur(8px); }
.finger .tip-spark { fill: #fff; opacity: 0; }
.fin-lean { transform-origin: 0 0; transform: rotate(var(--lean, 0deg)) scaleY(var(--reach, 1)); transition: transform .4s cubic-bezier(.3, 1.5, .5, 1); }
.fin-wiggle { transform-origin: 0 0; }
.finger.active .tip-glow { opacity: .95; animation: glowPulse 1s ease-in-out infinite; }
.finger.active .fin-wiggle { animation: wiggle .8s ease-in-out infinite; }
.finger.active .tip-spark { animation: twinkle 1s infinite; }
.finger.hint .tip-glow { opacity: 1; filter: blur(5px); animation: glowPulse .55s ease-in-out infinite; transform-origin: center; }
.finger.hint .fin-wiggle { animation: wiggle .45s ease-in-out infinite; }
.finger.tap .fin-wiggle { animation: tapDown .35s ease; }
@keyframes wiggle { 0%, 100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }
@keyframes tapDown { 40% { transform: translateY(14px) scaleY(.92); } }
@keyframes glowPulse { 50% { opacity: .55; } }
#hands.settling .hand { animation: settle 1s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes settle { 0% { transform: translateY(-80px) rotate(var(--r, 0deg)); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.hand-L { --r: -6deg; } .hand-R { --r: 6deg; }

/* keyboard */
#keyboard {
  position: absolute; left: 197px; top: 490px; width: 1206px; padding: 14px 18px; z-index: 3;
  background: linear-gradient(#2a2c98, #1f2178); border: 4px solid #6f7bde; border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
.kb-row { display: flex; height: 60px; padding-top: 3px; }
.kb-spacer { flex: none; }
.key {
  position: relative; flex: none; height: 54px; margin: 0 4px; border-radius: 13px;
  display: grid; place-items: center; font-size: 30px; color: var(--navy);
  background: linear-gradient(var(--kc-l), var(--kc));
  box-shadow: 0 5px 0 var(--kc-d), inset 0 3px 0 rgba(255, 255, 255, .5);
  transition: opacity .3s, transform .08s;
}
.key.special { font-size: 18px; opacity: .9; }
.f-pinky { --kc-l: var(--pinky-l); --kc: var(--pinky); --kc-d: var(--pinky-d); }
.f-ring { --kc-l: var(--ring-l); --kc: var(--ring); --kc-d: var(--ring-d); }
.f-middle { --kc-l: var(--middle-l); --kc: var(--middle); --kc-d: var(--middle-d); }
.f-index { --kc-l: var(--index-l); --kc: var(--index); --kc-d: var(--index-d); }
.f-thumb { --kc-l: var(--thumb-l); --kc: var(--thumb); --kc-d: var(--thumb-d); }
.no-colors .key { --kc-l: var(--neutral-l); --kc: var(--neutral); --kc-d: var(--neutral-d); }
.key.off { opacity: .36; filter: saturate(.6); }
.key.ridge.off { opacity: .75; }
.key.ridge .bump { position: absolute; left: 50%; bottom: 7px; width: 22px; height: 5px; margin-left: -11px; border-radius: 3px; background: rgba(43, 45, 110, .55); }
.key.ridge .spark { position: absolute; right: 4px; top: 2px; width: 16px; height: 16px; background: #fff; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 1.8s infinite; }
.key.pressed { transform: translateY(4px); box-shadow: 0 1px 0 var(--kc-d), inset 0 3px 0 rgba(255, 255, 255, .5); }
.key.target, .key.home-pulse {
  opacity: 1; z-index: 2; filter: none; animation: keyPulse 1s ease-in-out infinite;
  box-shadow: 0 5px 0 var(--kc-d), 0 0 0 5px #fff, 0 0 26px 10px rgba(255, 236, 140, .95);
}
.key.hint { animation: keyPulse .5s ease-in-out infinite; box-shadow: 0 5px 0 var(--kc-d), 0 0 0 6px #fff, 0 0 44px 20px rgba(255, 236, 140, 1); }
@keyframes keyPulse { 50% { transform: scale(1.14); } }
.key.oops { animation: wobble .6s; background: linear-gradient(#d7c9ff, #a58df0); box-shadow: 0 5px 0 #7058c4, 0 0 20px 6px rgba(190, 170, 255, .8); opacity: 1; filter: none; }
.key.nudge { animation: nudge .6s; }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
@keyframes nudge { 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* beam: dotted line from glowing finger to glowing key */
#beam { position: absolute; inset: 0; width: 1600px; height: 900px; pointer-events: none; z-index: 4; }
#beam-path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 14; opacity: .75; animation: march 1s linear infinite; filter: drop-shadow(0 0 5px #fff); }
#beam.hint #beam-path { stroke-width: 9; opacity: 1; }
#beam-dot { opacity: .9; animation: glowPulse 1s infinite; }
@keyframes march { to { stroke-dashoffset: -32; } }

/* mascot */
.mascot { position: absolute; }
#mascot { left: 30px; top: 185px; width: 240px; z-index: 2; }
.mascot-svg { width: 100%; overflow: visible; }
.mascot .face { display: none; }
.mascot-svg[data-mood="happy"] .f-happy, .mascot-svg[data-mood="wow"] .f-wow, .mascot-svg[data-mood="oops"] .f-oops { display: inline; }
.mascot .m-bob { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-7px); } }
.mascot .arm { transition: transform .4s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 0 0; }
.mascot .arm-l { transform: rotate(16deg); }
.mascot .arm-r { transform: rotate(-16deg); }
.mascot .m-head { transform-origin: 150px 196px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.pose-wave .arm-r { animation: waveArm .8s ease-in-out infinite alternate; }
@keyframes waveArm { from { transform: rotate(-135deg); } to { transform: rotate(-165deg); } }
.pose-cheer { animation: jump .6s ease; }
.pose-cheer .arm-l { transform: rotate(150deg); } .pose-cheer .arm-r { transform: rotate(-150deg); }
@keyframes jump { 40% { transform: translateY(-34px); } }
.pose-tilt .m-head { transform: rotate(-13deg); }
.pose-tilt .arm-r { transform: rotate(-35deg); } .pose-tilt .arm-l { transform: rotate(30deg); }
.pose-point .arm-r { transform: rotate(var(--point, -60deg)); animation: pointBob .5s ease-in-out infinite alternate; }
@keyframes pointBob { to { transform: rotate(calc(var(--point, -60deg) + 6deg)); } }
.pose-point .m-head { transform: rotate(6deg); }
.pose-dance { animation: dance .7s ease-in-out infinite alternate; }
.pose-dance .arm-l { animation: waveL .35s ease-in-out infinite alternate; } .pose-dance .arm-r { animation: waveR .35s ease-in-out infinite alternate; }
@keyframes dance { from { transform: translateY(0) rotate(-6deg); } to { transform: translateY(-24px) rotate(6deg); } }
@keyframes waveL { from { transform: rotate(120deg); } to { transform: rotate(165deg); } }
@keyframes waveR { from { transform: rotate(-165deg); } to { transform: rotate(-120deg); } }
#speech {
  position: absolute; left: 262px; top: 172px; max-width: 250px; padding: 10px 20px; font-size: 26px; line-height: 1.15; z-index: 6;
  background: #fff; color: var(--navy); border-radius: 24px; box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
  opacity: 0; transform: scale(.6); transform-origin: left bottom; transition: all .25s cubic-bezier(.3, 1.6, .5, 1); pointer-events: none;
}
#speech.show { opacity: 1; transform: none; }
#speech::before { content: ""; position: absolute; left: -12px; bottom: 14px; border: 12px solid transparent; border-right-color: #fff; border-left: 0; }

/* sticker strip */
#stickers-strip { position: absolute; left: 0; right: 0; bottom: 6px; height: 62px; display: flex; justify-content: center; align-items: center; gap: 18px; z-index: 3; }
#stickers-strip .arrow { width: 44px; height: 52px; background: none; padding: 6px; }
#stickers-strip .arrow:hover svg { transform: scale(1.2); }
#strip-items { display: flex; gap: 22px; }
.strip-item { position: relative; width: 58px; height: 58px; }
.strip-item svg { width: 100%; height: 100%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.strip-item:not(.has) svg { filter: grayscale(1) brightness(.45) opacity(.65); }
.strip-item b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 26px; color: #cdd2ff; }
.strip-item.new { animation: starPop .8s cubic-bezier(.3, 1.8, .5, 1); }

/* sparkle burst */
#fx { position: absolute; inset: 0; pointer-events: none; z-index: 8; }
.spk {
  position: absolute; width: var(--sz); height: var(--sz); margin: calc(var(--sz) / -2) 0 0 calc(var(--sz) / -2); background: var(--c);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 4px #fff); animation: burst .9s ease-out forwards;
}
@keyframes burst { 0% { transform: translate(0, 0) scale(.2) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(200deg); opacity: 0; } }

/* ------------------------------------------------------------------ OVERLAYS */
.overlay { position: absolute; inset: 0; background: rgba(12, 8, 55, .82); z-index: 50; display: none; place-items: center; }
.overlay.open { display: grid; animation: fadeIn .3s; }
#confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#confetti i { position: absolute; top: -60px; font-style: normal; animation: fall linear infinite; text-shadow: 0 0 8px rgba(255, 255, 255, .7); }
@keyframes fall { to { transform: translateY(1000px) rotate(540deg); } }
.cel-card { position: relative; display: flex; align-items: center; gap: 30px; }
#cel-mascot { position: relative; width: 340px; }
.cel-main { text-align: center; }
#cel-title { margin: 0 0 8px; font-size: 76px; color: #ffc94a; -webkit-text-stroke: 12px var(--navy); paint-order: stroke fill; }
#cel-sticker { width: 230px; height: 230px; margin: 0 auto; animation: starPop 1s cubic-bezier(.3, 1.8, .5, 1), drift 3s 1s ease-in-out infinite alternate; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
#cel-sticker-name { font-size: 40px; margin: 10px 0 20px; }
.cel-buttons { display: flex; gap: 20px; align-items: center; justify-content: center; }
.panel { width: 640px; padding: 34px 44px; background: linear-gradient(#34369f, #26267c); border: 5px solid #8793ee; border-radius: 36px; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.panel h2 { margin: 0 0 16px; font-size: 52px; }
.panel p { margin: 0; font-size: 28px; }
#gate-q { font-size: 84px; margin: 6px 0 14px; color: #ffc94a; }
#gate-input { width: 220px; font: inherit; font-size: 56px; text-align: center; border-radius: 22px; border: 4px solid #8793ee; padding: 6px; background: #fff; color: var(--navy); user-select: text; -webkit-user-select: text; }
#gate-err { min-height: 36px; margin: 8px 0; font-size: 24px; color: #ffd9a0; }
.panel .row { display: flex; gap: 20px; justify-content: center; }
.toggle { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-bottom: 14px; padding: 12px 26px; font-size: 30px; border-radius: 22px; background: rgba(20, 16, 90, .6); border: 3px solid #6e7be0; }
.toggle .state { min-width: 90px; padding: 4px 0; border-radius: 16px; background: #6d6fa8; font-size: 26px; }
.toggle.on .state { background: #2fb35a; }
.mid-btn.wide { width: 100%; margin-top: 14px; }
