/* YugaVerse Kids - Copyright (c) 2026 mayurj476. All rights reserved.
   Not for copying, reuse or redistribution without written permission. See LICENSE. */
:root {
  --S: 160px;
  --fur: #ffa94d;
  --furLine: #b85c00;
  --belly: #ffe8cc;
  --stripe: #e8590c;
  --font: "Baloo 2", "Chalkboard SE", "Comic Sans MS", "Marker Felt", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  background: #8fdcff;
  font-family: var(--font);
}

button { font-family: inherit; cursor: pointer; }

/* ---------- Scenery ---------- */
#sky {
  position: fixed; inset: 0; overflow: hidden;
  background: linear-gradient(#5cc8ff 0%, #a8e6ff 55%, #e6fbff 100%);
}
.sun {
  position: absolute; left: 5vmin; top: 14vmin;
  width: 16vmin; height: 16vmin; border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #fff7b0, #ffd60a 60%, #ffb703);
  box-shadow: 0 0 0 3vmin rgba(255, 214, 10, .22), 0 0 0 6vmin rgba(255, 214, 10, .1);
  animation: sunPulse 3s ease-in-out infinite;
}
.cloud {
  position: absolute; width: 22vmin; height: 7vmin; border-radius: 7vmin;
  background: #fff; opacity: .9;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ""; position: absolute; background: #fff; border-radius: 50%;
}
.cloud::before { width: 10vmin; height: 10vmin; left: 3vmin; top: -5vmin; }
.cloud::after  { width: 8vmin;  height: 8vmin;  left: 11vmin; top: -3.5vmin; }
.c1 { top: 8vh;  animation-duration: 60s; animation-delay: -10s; }
.c2 { top: 42vh; animation-duration: 80s; animation-delay: -45s; transform: scale(.7); opacity: .7; }
.c3 { top: 22vh; animation-duration: 70s; animation-delay: -30s; }
.hill {
  position: absolute; border-radius: 50%;
}
.h1 { left: -20vw; bottom: -30vh; width: 90vw; height: 55vh; background: #7be07b; }
.h2 { right: -25vw; bottom: -34vh; width: 100vw; height: 58vh; background: #5fd35f; }

@keyframes sunPulse { 50% { transform: scale(1.08); } }
@keyframes drift {
  from { left: -30vmin; }
  to   { left: 110vw; }
}

/* ---------- Board ---------- */
#board { position: fixed; inset: 0; z-index: 2; }

.tray {
  position: absolute; left: 0; top: 0;
  border-radius: 48px;
  background: rgba(255, 255, 255, .6);
  box-shadow: 0 10px 0 rgba(0, 60, 120, .08), inset 0 0 0 5px rgba(255, 255, 255, .8);
}

.hole, .piece {
  position: absolute; left: 0; top: 0;
  width: var(--S); height: var(--S);
  will-change: transform;
  pointer-events: none; /* all touch is handled by the board for a forgiving grab */
}
.hole { z-index: 3; }
.piece { z-index: 5; }
.piece.dragging { z-index: 20; }
.piece.returning { transition: transform .5s cubic-bezier(.34, 1.56, .64, 1); }
.piece.placing   { transition: transform .22s ease-out; }

.inner { width: 100%; height: 100%; }
.inner svg { width: 100%; height: 100%; overflow: visible; display: block; }

.piece .inner {
  filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .14));
  animation: bob 2.6s ease-in-out infinite;
}
.piece.dragging .inner {
  filter: drop-shadow(0 18px 12px rgba(0, 0, 0, .25));
  animation: none;
}
.piece.done .inner { animation: none; }

.inner.popin  { animation: popIn .65s cubic-bezier(.34, 1.56, .64, 1) both !important; }
.inner.happy  { animation: happy .8s ease both !important; }
.inner.wiggle { animation: wiggle .9s ease both !important; }
.inner.no     { animation: no .5s ease both !important; }

.hole .inner { transition: transform .2s; }
.hole.near .inner { animation: holePulse .5s ease-in-out infinite alternate; }
.hole.hint .inner { animation: holePulse .45s ease-in-out 6 alternate; }
.hole.filled .outline { opacity: 0; }
.hole.filled .inner { animation: none; }

.blink { transform-box: fill-box; transform-origin: center; animation: blink 4.5s infinite; }

@keyframes bob    { 50% { transform: translateY(-5%) rotate(2deg); } }
@keyframes popIn  { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }
@keyframes happy  {
  0%   { transform: scale(1); }
  25%  { transform: scale(1.25, .8); }
  50%  { transform: scale(.9, 1.15) translateY(-10%); }
  75%  { transform: scale(1.06, .95); }
  100% { transform: scale(1); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0) scale(1); }
  20% { transform: rotate(-14deg) scale(1.1); }
  40% { transform: rotate(12deg) scale(1.1); }
  60% { transform: rotate(-8deg) scale(1.05); }
  80% { transform: rotate(5deg); }
}
@keyframes no {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-9%); }
  50% { transform: translateX(8%); }
  75% { transform: translateX(-5%); }
}
@keyframes holePulse { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* ---------- Top bar ---------- */
#topbar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 0;
  pointer-events: none;
}
#stars {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  min-height: 44px; padding: 4px 14px; border-radius: 30px;
  background: rgba(255, 255, 255, .55);
  font-size: 30px; line-height: 1; color: #b35f00; font-weight: 800;
}
#stars:empty { visibility: hidden; }
#stars .star { display: inline-block; }
#stars .star.new { animation: starPop .9s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes starPop {
  0% { transform: scale(0) rotate(-180deg); }
  60% { transform: scale(1.8) rotate(20deg); }
  100% { transform: scale(1) rotate(0); }
}
.topBtns { display: flex; gap: 10px; }
#homeBtn {
  pointer-events: auto;
  width: 54px; height: 54px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .7); font-size: 26px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .1);
  padding: 0;
}
/* Home must be held for a moment (so toddlers don't leave by accident): a ring fills up. */
#homeBtn, #parentBtn { position: relative; }
#homeBtn::after, #parentBtn::after {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  background: conic-gradient(#ff5dc8 var(--p, 0%), transparent 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
  mask: radial-gradient(circle, transparent 58%, #000 60%);
  opacity: 0;
}
#homeBtn.holding::after { opacity: 1; animation: holdFill .9s linear forwards; }
#parentBtn.holding::after { opacity: 1; animation: holdFill 2s linear forwards; }
@property --p { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
@keyframes holdFill { from { --p: 0%; } to { --p: 100%; } }
body:not(.playing) #homeBtn { display: none; }

/* ---------- Balloon game ---------- */
#balloonGame { position: fixed; inset: 0; z-index: 4; display: none; overflow: hidden; }
body.mode-balloons #balloonGame { display: block; }
body.mode-balloons #board { display: none; }
.bal {
  position: absolute; left: 0; top: 0;
  width: var(--bw); height: calc(var(--bw) * 1.6);
  transform-origin: 50% 35%;
  will-change: transform; pointer-events: none;
}
.bal svg { width: 100%; height: 100%; overflow: visible; display: block; }
.bal .num { font-family: var(--font); font-weight: 800; }
.bal.popping { animation: balPop .16s ease-out forwards; }
@keyframes balPop {
  0% { opacity: 1; scale: 1; }
  100% { opacity: 0; scale: 1.45; }
}
.numPop {
  position: absolute; left: 0; top: 0; z-index: 3;
  font-weight: 800; line-height: 1; pointer-events: none;
  -webkit-text-stroke: 5px #fff; paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(0, 0, 0, .15);
  animation: numUp 1.1s cubic-bezier(.2, 1.4, .4, 1) forwards;
}
@keyframes numUp {
  0% { opacity: 0; scale: .3; }
  20% { opacity: 1; scale: 1.25; }
  70% { opacity: 1; scale: 1; translate: 0 -30%; }
  100% { opacity: 0; scale: 1; translate: 0 -80%; }
}

/* ---------- Hint hand ---------- */
#hintHand {
  position: fixed; left: 0; top: 0; z-index: 25;
  pointer-events: none; opacity: 0; line-height: 1;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .25));
}

/* ---------- Celebration ---------- */
#celebrate {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top, 0px) + 4vh);
  background: radial-gradient(circle at 50% 65%, rgba(255, 255, 255, .85), rgba(255, 220, 245, .75) 60%, rgba(200, 160, 255, .7));
  opacity: 1; transition: opacity .4s;
  overflow: hidden;
}
#celebrate.hidden { opacity: 0; pointer-events: none; }

#yay {
  position: relative; z-index: 2;
  font-size: min(16vmin, 130px); font-weight: 800; line-height: 1;
  white-space: nowrap;
  text-shadow: 0 6px 0 rgba(0, 0, 0, .12);
  -webkit-text-stroke: 3px #fff;
  paint-order: stroke fill;
}
#yay span { display: inline-block; transform: scale(0); }
#celebrate.show #yay span { animation: letterIn .5s cubic-bezier(.34, 1.56, .64, 1) forwards, letterBounce .7s ease-in-out .6s infinite alternate; }
@keyframes letterIn { to { transform: scale(1); } }
@keyframes letterBounce { from { transform: translateY(0) scale(1); } to { transform: translateY(-14%) scale(1.06); } }

#cat {
  position: relative; z-index: 2;
  width: min(72vmin, 480px); height: auto;
  margin-bottom: -2vmin;
  transform: translateY(110%);
  transition: transform .8s cubic-bezier(.34, 1.4, .64, 1);
  overflow: visible;
}
#celebrate.show #cat { transform: translateY(0); }
#girl {
  position: relative; z-index: 2;
  width: min(66vmin, 440px); height: auto;
  margin-bottom: -1vmin;
  transform: translateY(110%);
  transition: transform .8s cubic-bezier(.34, 1.4, .64, 1);
  overflow: visible;
}
#celebrate.show #girl { transform: translateY(0); }
#celebrate.girlMode #cat, #celebrate:not(.girlMode) #girl { display: none; }

/* Dancing girl (letters game). One beat = 0.5s, matching the dance music. */
#girl .skin { fill: #FFD7B5; stroke: #D9946A; stroke-width: 3; }
#girl .limb { fill: none; stroke: #F7C59F; stroke-width: 18; stroke-linecap: round; }
#girl .hair { fill: #6B3E26; }
#girl .bow { fill: #FF5DA2; stroke: #B3207F; stroke-width: 2; stroke-linejoin: round; }
#girl .dressFill { fill: #FF5DA2; stroke: #B3207F; stroke-width: 4; stroke-linejoin: round; }
#girl .dot { fill: #fff; opacity: .75; }
#girl .shoe { fill: #A45DFF; }
#girl .note { font-size: 44px; font-weight: 800; opacity: 0; }
#girl .n1 { fill: #FF4D6D; } #girl .n2 { fill: #3A86FF; } #girl .n3 { fill: #38D46A; } #girl .n4 { fill: #FF9F1C; }
#girl .girlAll, #girl .gArmL, #girl .gArmR, #girl .legL, #girl .legR, #girl .pigL, #girl .pigR,
#girl .gHead, #girl .note, #girl .girlEyes { transform-box: view-box; }
#girl .girlAll { transform-origin: 150px 340px; }
#girl .gArmL { transform-origin: 126px 180px; }
#girl .gArmR { transform-origin: 174px 180px; }
#girl .legL { transform-origin: 134px 262px; }
#girl .legR { transform-origin: 166px 262px; }
#girl .pigL { transform-origin: 104px 96px; }
#girl .pigR { transform-origin: 196px 96px; }
#girl .gHead { transform-origin: 150px 165px; }
#girl .girlEyes { transform-origin: 150px 110px; animation: catBlink 3.4s infinite; }
#girl.dancing .girlAll { animation: girlDance 1s ease-in-out infinite; }
#girl.dancing .gArmL { animation: armWaveL 1s ease-in-out infinite; }
#girl.dancing .gArmR { animation: armWaveR 1s ease-in-out infinite; }
#girl.dancing .legL { animation: kickL 1s ease-in-out infinite; }
#girl.dancing .legR { animation: kickR 1s ease-in-out infinite; }
#girl.dancing .pigL { animation: pigSwing .5s ease-in-out infinite alternate; }
#girl.dancing .pigR { animation: pigSwing .5s ease-in-out infinite alternate-reverse; }
#girl.dancing .gHead { animation: headTilt 1s ease-in-out infinite; }
#girl.dancing .note { animation: noteFloat 1.5s ease-out infinite; }
#girl.dancing .n2 { animation-delay: .4s; } #girl.dancing .n3 { animation-delay: .8s; } #girl.dancing .n4 { animation-delay: 1.1s; }
@keyframes girlDance {
  0%, 100% { transform: rotate(-6deg) translateY(0); }
  25% { transform: rotate(0) translateY(-6%); }
  50% { transform: rotate(6deg) translateY(0); }
  75% { transform: rotate(0) translateY(-6%); }
}
@keyframes armWaveL { 0%, 100% { transform: rotate(20deg); } 50% { transform: rotate(135deg); } }
@keyframes armWaveR { 0%, 100% { transform: rotate(-135deg); } 50% { transform: rotate(-20deg); } }
@keyframes kickL { 0%, 50%, 100% { transform: rotate(0); } 25% { transform: rotate(22deg); } }
@keyframes kickR { 0%, 50%, 100% { transform: rotate(0); } 75% { transform: rotate(-22deg); } }
@keyframes pigSwing { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes noteFloat {
  0% { opacity: 0; transform: translateY(10px) scale(.6); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-40px) scale(1.1) rotate(15deg); }
}

/* "A for Apple" picture card */
#wordPop {
  position: fixed; left: 50%; top: 50%; z-index: 35;
  transform: translate(-50%, -50%) scale(.3); opacity: 0;
  transition: opacity .25s, transform .45s cubic-bezier(.34, 1.56, .64, 1);
  pointer-events: none; text-align: center;
  background: #fff; border: 8px solid #FFD60A; border-radius: 40px;
  padding: 2vmin 6vmin 3vmin;
  box-shadow: 0 12px 0 rgba(0, 0, 0, .1), 0 20px 40px rgba(0, 0, 0, .2);
}
#wordPop.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#wordPop .wpPic { font-size: min(26vmin, 210px); line-height: 1.15; animation: bob 1.6s ease-in-out infinite; }
#wordPop .wpPic svg { display: inline-block; vertical-align: middle; }
#wordPop .wpText { font-size: min(8vmin, 64px); font-weight: 800; color: #444; white-space: nowrap; line-height: 1.1; }
#wordPop .wpText b { font-size: 1.35em; -webkit-text-stroke: 3px #fff; paint-order: stroke fill; }

#cat .fur   { fill: var(--fur); stroke: var(--furLine); stroke-width: 5; stroke-linejoin: round; }
#cat .belly { fill: var(--belly); }
#cat .earIn { fill: #ffb3cc; }
#cat .stripe { fill: none; stroke: var(--stripe); stroke-width: 7; stroke-linecap: round; }
#cat .cheek { fill: #ff6b9a; opacity: .45; }
#cat .whiskers path { fill: none; stroke: var(--furLine); stroke-width: 3.5; stroke-linecap: round; }
#cat .armLine { stroke: var(--furLine); stroke-width: 40; stroke-linecap: round; }
#cat .armFill { stroke: var(--fur); stroke-width: 30; stroke-linecap: round; }
#cat .bean { fill: #ffb3cc; }
#cat .clapFx path { fill: none; stroke: #ffd60a; stroke-width: 7; stroke-linecap: round; }

#cat .armL, #cat .armR, #cat .head, #cat .tail, #cat .catAll, #cat .clapFx, #cat .catEyes {
  transform-box: view-box;
}
#cat .armL { transform-origin: 95px 238px; transform: rotate(-60deg); }
#cat .armR { transform-origin: 205px 238px; transform: rotate(60deg); }
#cat .head { transform-origin: 150px 200px; }
#cat .tail { transform-origin: 212px 276px; animation: tailWag 1.2s ease-in-out infinite alternate; }
#cat .catAll { transform-origin: 150px 345px; }
#cat .clapFx { transform-origin: 150px 200px; opacity: 0; }
#cat .catEyes { transform-origin: 150px 110px; animation: catBlink 3.2s infinite; }

#cat.clapping .armL   { animation: clapL .32s ease-in infinite alternate; }
#cat.clapping .armR   { animation: clapR .32s ease-in infinite alternate; }
#cat.clapping .clapFx { animation: clapFx .64s linear infinite; }
#cat.clapping .catAll { animation: catBounce .64s ease-in-out infinite; }
#cat.clapping .head   { animation: headTilt 1.28s ease-in-out infinite; }

@keyframes clapL { from { transform: rotate(-60deg); } to { transform: rotate(0); } }
@keyframes clapR { from { transform: rotate(60deg); } to { transform: rotate(0); } }
@keyframes clapFx {
  0%, 42% { opacity: 0; transform: scale(.5); }
  50% { opacity: 1; transform: scale(1.15); }
  68%, 100% { opacity: 0; transform: scale(1.4); }
}
@keyframes catBounce {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  50% { transform: translateY(-4%) scale(1.02, .98); }
}
@keyframes headTilt { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes tailWag { from { transform: rotate(-12deg); } to { transform: rotate(14deg); } }
@keyframes catBlink { 0%, 90%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.1); } }

.balloon {
  position: absolute; bottom: -28vmin; z-index: 1;
  width: 13vmin; height: 16vmin;
  border-radius: 50% 50% 48% 52% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .7) 0 10%, transparent 11%), var(--c);
  box-shadow: inset -1.2vmin -1.5vmin 0 rgba(0, 0, 0, .12);
  animation: rise var(--dur, 5s) ease-in var(--delay, 0s) forwards;
}
.balloon::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 2px; height: 10vmin; background: rgba(0, 0, 0, .25);
}
.balloon.popped { animation: balloonPop .2s ease-out forwards; }
@keyframes rise {
  0% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-65vh) rotate(5deg); }
  100% { transform: translateY(-135vh) rotate(-4deg); }
}
@keyframes balloonPop { to { transform: var(--t, none) scale(1.8); opacity: 0; } }

#confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* ---------- Paused ---------- */
body.paused *, body.paused *::before, body.paused *::after { animation-play-state: paused !important; }
#pausedOverlay {
  position: fixed; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  background: rgba(60, 30, 110, .35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
body.paused.playing #pausedOverlay { display: flex; }
.pauseCircle {
  width: min(34vmin, 240px); height: min(34vmin, 240px); border-radius: 50%;
  border: 10px solid #fff;
  background: radial-gradient(circle at 35% 30%, #7dff9a, #2ecc71 60%, #18a058);
  box-shadow: 0 12px 0 #138a4a, 0 20px 30px rgba(0, 0, 0, .25);
  display: flex; align-items: center; justify-content: center;
}
.pauseCircle svg { width: 58%; height: 58%; }

/* ---------- Start screen ---------- */
#start {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5vmin;
  background: linear-gradient(160deg, #ff9ad5, #b98bff 45%, #6ccfff);
  transition: opacity .5s, transform .5s;
  overflow: hidden;
}
#start.gone { opacity: 0; transform: scale(1.2); pointer-events: none; }
#title {
  position: relative; z-index: 2; margin: 0;
  font-size: min(15vmin, 130px); font-weight: 800; line-height: 1; text-align: center;
  -webkit-text-stroke: 4px #fff; paint-order: stroke fill;
  text-shadow: 0 8px 0 rgba(0, 0, 0, .15);
}
#title span { display: inline-block; animation: letterBounce .8s ease-in-out infinite alternate; }
#menu {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6vmin;
  padding: 0 16px;
}
.gameCard {
  position: relative;
  width: min(30vmin, 290px); height: min(30vmin, 290px);
  border-radius: 44px; border: 10px solid #fff; padding: 0;
  box-shadow: 0 12px 0 rgba(0, 0, 0, .18), 0 20px 30px rgba(0, 0, 0, .2);
  animation: playPulse 1.4s ease-in-out infinite;
  overflow: hidden;
}
#cardShapes   { background: radial-gradient(circle at 35% 30%, #a6f7ff, #38d46a 75%); }
#cardLetters  { background: radial-gradient(circle at 35% 30%, #fff6c2, #ffd60a 50%, #ff9f1c 100%); animation-delay: -.35s; }
#cardBalloons { background: radial-gradient(circle at 35% 30%, #ffe0f4, #ff9ad5 45%, #a45dff 100%); animation-delay: -.7s; }
.gameCard:active { transform: scale(.94); }
.gameCard .art { position: absolute; inset: 0; }
.gameCard .art svg { position: absolute; overflow: visible; }
@keyframes playPulse { 50% { transform: scale(1.07) rotate(-1.5deg); } }
#startShapes { position: absolute; inset: 0; }
#version {
  position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); z-index: 2;
  font-size: 16px; font-weight: 700; color: rgba(255, 255, 255, .85);
}
#startShapes .floater {
  position: absolute; width: 20vmin; height: 20vmin; opacity: .9;
  animation: floaty 4s ease-in-out infinite alternate;
}
#startShapes .floater svg { width: 100%; height: 100%; overflow: visible; }
@keyframes floaty {
  from { transform: translateY(0) rotate(-10deg); }
  to   { transform: translateY(-5vmin) rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .cloud, .sun, .piece .inner { animation: none; }
}

/* ---------- Parent gear (start screen) ---------- */
#parentBtn {
  position: absolute; left: 14px; top: calc(env(safe-area-inset-top, 0px) + 12px); z-index: 3;
  width: 48px; height: 48px; border-radius: 50%; border: 0; padding: 0;
  background: rgba(255, 255, 255, .45); font-size: 24px; opacity: .8;
}

/* ---------- Parent settings ---------- */
#settings {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(40, 20, 80, .45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
#settings.hidden { display: none; }
.setCard {
  position: relative; width: min(560px, 100%); max-height: 100%; overflow: auto;
  background: #fff; border-radius: 28px; padding: 22px 22px 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: #2b2633;
}
.setCard h2 { margin: 0 0 14px; font-size: 22px; }
#setClose {
  position: absolute; right: 12px; top: 12px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: #f1eef8; font-size: 20px;
}
.setRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #eee; flex-wrap: wrap; }
.setLabel { font-weight: 700; font-size: 16px; }
.langBtns { display: flex; gap: 8px; flex-wrap: wrap; }
.langBtns button, .toggle, #setReset {
  min-height: 44px; padding: 0 16px; border-radius: 22px; border: 2px solid #d9d2ee;
  background: #faf8ff; font-size: 16px; font-weight: 700; color: #4a3f6b;
}
.langBtns button.on, .toggle.on { background: #7c5cff; border-color: #7c5cff; color: #fff; }
.setNote { margin: 6px 0 4px; font-size: 13.5px; line-height: 1.4; color: #6b6480; }

/* ---------- Game layers from games/*.js ---------- */
.gameLayer { position: fixed; inset: 0; z-index: 4; display: none; overflow: hidden; }
.gameLayer.active { display: block; }
body.mode-custom #board { display: none; }

/* ---------- Animal Sounds ---------- */
.aGrid {
  position: absolute; left: 0; right: 0;
  display: grid; justify-content: center; align-content: center;
}
.aCard {
  position: relative; width: var(--cell); height: var(--cell);
  border-radius: 30%;
  background: radial-gradient(circle at 32% 25%, rgba(255, 255, 255, .85), rgba(255, 255, 255, 0) 55%), var(--bg);
  box-shadow: 0 calc(var(--cell) * .05) 0 var(--shade), 0 calc(var(--cell) * .09) calc(var(--cell) * .08) rgba(0, 0, 0, .14),
    inset 0 -6px 0 rgba(0, 0, 0, .05), inset 0 0 0 4px rgba(255, 255, 255, .6);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.aCard.enter { animation: aEnter .55s cubic-bezier(.34, 1.56, .64, 1) both; }
.aCard.pressed { animation: aPress .35s ease; }
.aArt { width: 78%; height: 72%; margin-top: -4%; animation: bob 2.8s ease-in-out infinite; }
.aArt svg { width: 100%; height: 100%; overflow: visible; display: block; }
.aArt.talk { animation: aTalk .7s ease both !important; }
.aArt.sing { animation: aSing .9s ease-in-out both !important; }
.aArt.wave { animation: wiggle 1s ease both !important; }
.aName {
  font-family: var(--font); font-weight: 800; line-height: 1.05; color: #3b2f55;
  font-size: calc(var(--cell) * .135); margin-top: -2%;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .8);
}
.aBubble {
  position: absolute; left: 50%; top: -6%; z-index: 3; pointer-events: none;
  transform: translate(-50%, -60%);
  padding: calc(var(--cell) * .03) calc(var(--cell) * .08); border-radius: 999px;
  background: #fff; color: #3b2f55; white-space: nowrap;
  font-family: var(--font); font-weight: 800; font-size: calc(var(--cell) * .16);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .08), 0 10px 20px rgba(0, 0, 0, .15);
  animation: aBubble 1.9s ease both;
}
.aBubble::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -9px;
  border: 9px solid transparent; border-top-color: #fff; border-bottom: 0;
}
@keyframes aEnter { from { opacity: 0; transform: scale(.4) translateY(30%); } to { opacity: 1; transform: none; } }
@keyframes aPress {
  0% { transform: none; }
  30% { transform: translateY(5%) scale(.94); box-shadow: 0 2px 0 var(--shade), 0 4px 8px rgba(0, 0, 0, .14); }
  100% { transform: none; }
}
@keyframes aTalk {
  0% { transform: none; }
  25% { transform: scale(1.14, .88) translateY(6%); }
  50% { transform: scale(.94, 1.1) translateY(-10%); }
  75% { transform: scale(1.04, .97); }
  100% { transform: none; }
}
@keyframes aSing {
  0%, 100% { transform: none; }
  20% { transform: rotate(-7deg) scale(1.06); }
  40% { transform: rotate(6deg) scale(1.08); }
  60% { transform: rotate(-5deg) scale(1.06); }
  80% { transform: rotate(4deg) scale(1.03); }
}
@keyframes aBubble {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.5); }
  15% { opacity: 1; transform: translate(-50%, -60%) scale(1.08); }
  25% { transform: translate(-50%, -60%) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -80%); }
}

/* Title words never break in the middle */
#title .tWord { display: inline-block; white-space: nowrap; animation: none; }
#title .tWord span { display: inline-block; }

/* ---------- Color Pop ---------- */
.cpStage { position: absolute; inset: 0; }
.cpSplats { position: absolute; inset: 0; pointer-events: none; }
.cpSplat {
  position: absolute; width: var(--s); height: var(--s);
  transform: translate(-50%, -50%) rotate(var(--rot));
  animation: cpSplatIn .45s cubic-bezier(.2, .9, .3, 1.3) both;
}
.cpSplat svg { width: 100%; height: 100%; display: block; overflow: visible; }
.cpSplat .cpDrop { animation: cpDropOut .4s cubic-bezier(.2, .8, .3, 1) both; }
.cpSplat .cpDrip { transform-box: fill-box; transform-origin: top; animation: cpDrip 2.6s ease-in both; }
.cpSplat.gone { animation: cpSplatOut .6s ease forwards; }
@keyframes cpSplatIn { from { transform: translate(-50%, -50%) rotate(var(--rot)) scale(.15); } }
@keyframes cpSplatOut { to { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(.9); } }
@keyframes cpDropOut { from { transform: translate(var(--dx), var(--dy)) scale(.3); } }
@keyframes cpDrip { from { transform: scaleY(0); } }
.cpCrack { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cpCrack path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: cpCrackDraw .18s ease-out forwards; }
@keyframes cpCrackDraw { to { stroke-dashoffset: 0; } }
.cpObj.cracked .cpBody { animation: cpWobble 1.1s ease-in-out infinite; }
@keyframes cpWobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.02); } }
.cpDots {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 18px); z-index: 2;
  transform: translateX(-50%); display: flex; gap: 14px;
  padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .55);
}
.cpDot {
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 255, 255, .8); box-shadow: inset 0 0 0 3px rgba(124, 92, 255, .35);
}
.cpDot.on { background: radial-gradient(circle at 35% 30%, #fff6b0, #ffd400 55%, #ff9f1c); box-shadow: 0 3px 0 #c77a00; }
.cpDot.bump { animation: starPop .7s cubic-bezier(.34, 1.56, .64, 1); }
.cpObj {
  position: absolute; left: 50%; top: 54%;
  width: var(--s); height: calc(var(--s) * 1.05);
  transform: translate(-50%, -50%);
}
.cpBody { position: absolute; inset: 0; animation: bob 2.4s ease-in-out infinite; }
.cpBody svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .18)); }
.cpShadow {
  position: absolute; left: 18%; right: 18%; bottom: -6%; height: 9%;
  border-radius: 50%; background: rgba(0, 0, 0, .16);
}
.cpObj.enter .cpBody { animation: cpDrop .85s cubic-bezier(.3, .9, .4, 1.25) both; }
.cpObj.enter .cpShadow { animation: cpShadowIn .85s ease both; }
.cpObj.wiggle .cpBody { animation: wiggle .9s ease both; }
.cpObj.crack .cpBody { animation: cpShake .23s linear both; }
.cpObj.popped .cpBody { animation: cpPop .3s ease-out forwards; }
.cpObj.popped .cpShadow, .cpObj.open .cpShadow { animation: cpShadowOut .5s ease forwards; }
.cpHalf { position: absolute; inset: 0; }
.cpObj.open .cpHalf.top { animation: cpTopFly .8s cubic-bezier(.2, .7, .4, 1) forwards; }
.cpObj.open .cpHalf.bottom { animation: cpBottomFly .8s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes cpDrop {
  0% { transform: translateY(-120vh) scale(.9, 1.1); }
  70% { transform: translateY(0) scale(1.12, .86); }
  85% { transform: translateY(-6%) scale(.96, 1.04); }
  100% { transform: none; }
}
@keyframes cpShadowIn { 0%, 50% { opacity: 0; transform: scale(.3); } 100% { opacity: 1; transform: none; } }
@keyframes cpShadowOut { to { opacity: 0; transform: scale(.4); } }
@keyframes cpShake {
  0%, 100% { transform: none; }
  25% { transform: rotate(-6deg) scale(1.04); }
  50% { transform: rotate(6deg) scale(1.06); }
  75% { transform: rotate(-4deg) scale(1.08); }
}
@keyframes cpPop { to { transform: scale(1.5); opacity: 0; } }
@keyframes cpTopFly { to { transform: translate(-35%, -70%) rotate(-40deg); opacity: 0; } }
@keyframes cpBottomFly { to { transform: translate(25%, 30%) rotate(25deg); opacity: 0; } }

/* ---------- Coloring ---------- */
.clPic {
  position: absolute; left: 12px; top: calc(env(safe-area-inset-top, 0px) + 70px); bottom: 14px;
  right: calc(var(--colW, 124px) + 16px);
  display: flex; align-items: center; justify-content: center;
}
.clPicture { width: 100%; height: 100%; max-width: 100%; max-height: 100%; overflow: visible; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .14)); }
.clPicture.enter { animation: clIn .6s cubic-bezier(.34, 1.56, .64, 1) both; }
.clPicture.alive { animation: clAlive 1.2s ease-in-out both; }
.clDecor, .clEdge { pointer-events: none; }
.clRegion { transform-box: fill-box; transform-origin: center; }
.clRegion.wobble { animation: clWobble .45s ease; }
.clRegion.nudge .clBase { animation: clNudge 1.2s ease 2; }
@keyframes clIn { from { transform: scale(.3) rotate(-8deg); opacity: 0; } }
@keyframes clAlive {
  0%, 100% { transform: none; }
  20% { transform: translateY(-8%) scale(1.06, .96); }
  40% { transform: translateY(0) scale(.96, 1.05) rotate(-3deg); }
  60% { transform: translateY(-5%) scale(1.04) rotate(3deg); }
  80% { transform: translateY(0) scale(1.02, .98); }
}
@keyframes clWobble { 40% { transform: scale(1.04); } 70% { transform: scale(.98); } }
@keyframes clNudge { 50% { fill: #fff3b0; } }
.clBowls {
  position: absolute; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 78px); bottom: 12px;
  width: var(--colW, 124px);
  display: grid; grid-template-columns: repeat(var(--cols, 1), var(--b, 90px));
  align-content: center; justify-content: center; gap: 10px;
}
.clBowl {
  position: relative; width: var(--b, 90px); height: calc(var(--b, 90px) * .9);
  padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%;
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
  -webkit-tap-highlight-color: transparent;
}
.clBowl svg { width: 100%; height: 100%; display: block; overflow: visible; }
.clBowl.on { transform: scale(1.14); }
.clBowl.on::before {
  content: ''; position: absolute; inset: -6% -8%; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 40%, rgba(255, 255, 255, 0) 72%); z-index: -1;
}
.clBowl.dip svg { animation: clDip .4s ease; }
@keyframes clDip { 40% { transform: translateY(8%) scale(1.06, .9); } }
.clBrush {
  position: absolute; width: calc(var(--b, 90px) * .34); height: calc(var(--b, 90px) * 1.02);
  pointer-events: none; transform: rotate(18deg); transform-origin: bottom center;
  transition: left .3s ease, top .3s cubic-bezier(.34, 1.56, .64, 1); z-index: 2;
}
.clBrush svg { width: 100%; height: 100%; display: block; overflow: visible; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .2)); }
.clBrush.dip { animation: clBrushDip .45s ease; }
@keyframes clBrushDip { 45% { transform: rotate(18deg) translateY(22%); } }

/* ---------- Talking Cat ---------- */
.tcWrap { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); }
.tcCat svg { width: 100%; height: auto; display: block; overflow: visible; }
.tcCat .tcHead, .tcCat .tcBody, .tcCat .tcTail, .tcCat .tcEar, .tcCat .tcEyes, .tcCat .tcMouthOpen { transform-box: fill-box; }
.tcHead { transform-origin: 50% 90%; transition: transform .3s ease; }
.tcTail { transform-origin: 0% 100%; animation: tcTail 2.4s ease-in-out infinite; }
.tcBody { transform-origin: 50% 100%; animation: tcBreathe 3s ease-in-out infinite; }
.tcEar { transform-origin: 50% 100%; transition: transform .25s ease; }
.tcEyes { transform-origin: center; transition: transform .08s; }
.tcMouthOpen { transform-origin: 50% 0%; opacity: 0; }
.tcCat.blink .tcEyes { transform: scaleY(.1); }
.tcCat.enter { animation: tcEnter .9s cubic-bezier(.34, 1.56, .64, 1) both; }
.tcCat.listening .tcHead { transform: rotate(-8deg); }
.tcCat.listening .tcEar { transform: scale(1.12); }
.tcCat.talking .tcHead { animation: tcNod .5s ease-in-out infinite; }
.tcCat.running .tcTail { animation-duration: .35s; }
.tcCat.giggle { animation: tcGiggle .18s ease-in-out 10; }
.tcCat.giggle .tcEyes { transform: scaleY(.35); }
.tcCat.jump { animation: tcJump 1.05s cubic-bezier(.3, .7, .4, 1) both; }
.tcCat.wave .tcHead { animation: tcWave 1.2s ease; }
@keyframes tcEnter { from { transform: translateY(60%) scale(.5); opacity: 0; } }
@keyframes tcTail { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(10deg); } }
@keyframes tcBreathe { 50% { transform: scale(1.015, .99); } }
@keyframes tcNod { 50% { transform: rotate(3deg) translateY(-1%); } }
@keyframes tcGiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.02); } }
@keyframes tcJump {
  0% { transform: none; } 15% { transform: scale(1.1, .85); }
  50% { transform: translateY(-45%) rotate(180deg); } 85% { transform: translateY(0) rotate(360deg) scale(1.08, .9); }
  100% { transform: rotate(360deg); }
}
@keyframes tcWave { 25% { transform: rotate(-10deg); } 60% { transform: rotate(8deg); } }
/* silly faces and moves */
.tcCat .tcEye, .tcCat .tcPupil, .tcCat .tcMuzzle, .tcCat .tcTongue, .tcCat .tcArm { transform-box: fill-box; }
.tcEye, .tcMuzzle { transform-origin: center; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.tcPupil { transition: transform .2s ease; }
.tcTongue { transform-origin: 50% 0%; opacity: 0; }
.tcLid { opacity: 0; }
.tcArm { transform-origin: 15% 95%; opacity: 0; }
.tcPawR { transition: opacity .1s; }
.tcCat.tongue .tcTongue { opacity: 1; animation: tcBlep .35s ease-in-out 4 alternate; }
.tcCat.wink .tcEye.r .tcOpen { opacity: 0; }
.tcCat.wink .tcEye.r .tcLid { opacity: 1; }
.tcCat.wink .tcHead { transform: rotate(5deg); }
.tcCat.cross .tcEye.l .tcPupil { transform: translate(8px, 4px); }
.tcCat.cross .tcEye.r .tcPupil { transform: translate(-8px, 4px); }
.tcCat.cross .tcHead { animation: tcGiggle .5s ease-in-out 3; }
.tcCat.surprised .tcEye { transform: scale(1.22); }
.tcCat.surprised .tcEar { transform: scale(1.15); }
.tcCat.puff .tcMuzzle { transform: scale(1.35); }
.tcCat.puff .tcEye { transform: scaleY(.55); }
.tcCat.wave .tcArm, .tcCat.dance .tcArm { opacity: 1; animation: tcWaveArm .32s ease-in-out infinite alternate; }
.tcCat.wave .tcPawR, .tcCat.dance .tcPawR { opacity: 0; }
.tcCat.dance { animation: tcDance .6s ease-in-out 4; }
.tcCat.dance .tcTail { animation-duration: .6s; }
@keyframes tcBlep { from { transform: scaleY(.5); } to { transform: scaleY(1.1); } }
@keyframes tcWaveArm { from { transform: rotate(-14deg); } to { transform: rotate(16deg); } }
@keyframes tcDance {
  0%, 100% { transform: rotate(-7deg); }
  25% { transform: translateY(-7%) rotate(0deg) scale(1.03, .97); }
  50% { transform: rotate(7deg); }
  75% { transform: translateY(-7%) rotate(0deg) scale(1.03, .97); }
}
.tcNote { position: absolute; font-size: 44px; font-weight: 700; pointer-events: none; animation: tcNote 1.6s ease-out forwards; text-shadow: 0 2px 0 #fff; }
@keyframes tcNote { from { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: translate(20px, -140px) rotate(15deg) scale(1.1); opacity: 0; } }
.tcMic {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 18px); transform: translateX(-50%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 26px;
  background: rgba(255, 255, 255, .7); pointer-events: none; transition: opacity .3s;
}
.tcMic.on { box-shadow: 0 0 0 0 rgba(46, 204, 64, .6); animation: tcMicPulse 1.8s ease-out infinite; }
.tcMic.off, .tcMic.asking { opacity: .45; }
.tcMic.none { opacity: .35; filter: grayscale(1); }
.tcMic.none::after { content: ''; position: absolute; width: 60%; height: 4px; border-radius: 2px; background: #e33; transform: rotate(-45deg); }
@keyframes tcMicPulse { 0% { box-shadow: 0 0 0 0 rgba(46, 204, 64, .55); } 100% { box-shadow: 0 0 0 18px rgba(46, 204, 64, 0); } }

/* ---------- Body Parts ---------- */
.bpStage { position: absolute; left: 0; right: 0; top: calc(env(safe-area-inset-top, 0px) + 96px); bottom: 10px; display: flex; justify-content: center; align-items: flex-end; }
.bpSvg { width: auto; max-width: calc(100% - 24px); display: block; overflow: visible; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .15)); }
.bpSvg.enter { animation: bpIn .8s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes bpIn { from { transform: translateY(40%) scale(.6); opacity: 0; } }
.bpSvg .bpPart, .bpSvg .bpBaby, .bpSvg .bpLower, .bpSvg .bpUpper, .bpSvg .bpEar, .bpSvg .bpEye, .bpSvg .bpFoot, .bpSvg .bpHand, .bpSvg .bpHeadAll { transform-box: fill-box; transform-origin: center; }
.bpPart.hl { animation: bpPulse 1s ease-in-out infinite; }
@keyframes bpPulse { 50% { transform: scale(1.06); } }
.bpRing { transform-box: view-box; animation: bpRingIn .45s cubic-bezier(.34, 1.56, .64, 1) both; }
.bpRing ellipse { animation: bpSpin 1.6s linear infinite; }
@keyframes bpRingIn { from { transform: scale(.3); opacity: 0; } }
@keyframes bpSpin { to { stroke-dashoffset: -104; } }
/* acting out each part */
.bpSvg .bpBaby { transform-origin: 50% 100%; }
.bpSvg .bpHeadAll { transform-origin: 50% 95%; }
.bpSvg .bpHair { transform-origin: 50% 100%; }
.bpSvg .bpSide { transform-box: view-box; }
.bpSvg .bpSide.l { transform-origin: 144px 276px; }
.bpSvg .bpSide.r { transform-origin: 256px 276px; }
.bpSvg .bpHand { transform-origin: 50% 20%; }
.bpSvg .bpFoot { transform-origin: 20% 100%; }
.bpSvg .bpFoot.r { transform-origin: 80% 100%; }
.do-head .bpHeadAll { animation: bpNod .7s ease-in-out 2; }
.do-hair .bpHair.bpPart { animation: bpBoing .5s ease-in-out 3; }
.do-eyes .bpEye { animation: bpBlink .4s ease 2 .1s; }
.do-ears .bpEar.l { animation: bpWiggleL .3s ease-in-out 5; }
.do-ears .bpEar.r { animation: bpWiggleR .3s ease-in-out 5; }
.do-nose .bpNose.bpPart { animation: bpBoop .45s cubic-bezier(.34, 1.56, .64, 1) 2; }
.bpSvg .bpMouthAll, .bpSvg .bpTongue { transform-box: fill-box; }
.bpSvg .bpMouthAll { transform-origin: 50% 20%; }
.bpSvg .bpTongue.bpPart { transform-origin: 50% 10%; }
.do-mouth .bpMouthAll { animation: bpAah 1.2s ease-in-out; }
.do-teeth .bpMouthAll { animation: bpChomp .35s ease-in-out 3 .05s; }
.do-tongue .bpTongue.bpPart { animation: bpBlep 1.4s ease-in-out .1s; }
@keyframes bpChomp { 50% { transform: scale(1.1, .55); } }
@keyframes bpBlep { 20%, 80% { transform: translateY(9px) scale(1.15, 1.7); } 50% { transform: translateY(10px) scale(1.2, 1.8) rotate(4deg); } }
.do-arms .bpSide.l { animation: bpRaiseL 1.5s ease-in-out; }
.do-arms .bpSide.r { animation: bpRaiseR 1.5s ease-in-out; }
.do-hands .bpHand { animation: bpWaveHand .4s ease-in-out 4; }
.do-tummy .bpBaby { animation: bpJiggle .2s ease-in-out 7; }
.do-legs .bpBaby { animation: bpJump .7s cubic-bezier(.3, .7, .4, 1) 2; }
.do-knees .bpUpper { animation: bpSquat .75s ease-in-out 2; }
.do-feet .bpFoot.l { animation: bpStomp .6s ease-in-out 3; }
.do-feet .bpFoot.r { animation: bpStomp .6s ease-in-out 3 .3s; }
@keyframes bpNod { 30% { transform: rotate(-7deg); } 70% { transform: rotate(7deg); } }
@keyframes bpBoing { 50% { transform: scale(1.04, 1.14); } }
@keyframes bpBlink { 50% { transform: scaleY(.08); } }
@keyframes bpWiggleL { 50% { transform: rotate(-16deg); } }
@keyframes bpWiggleR { 50% { transform: rotate(16deg); } }
@keyframes bpBoop { 50% { transform: scale(1.45); } }
@keyframes bpAah { 25%, 75% { transform: scale(1.35, 1.6); } }
@keyframes bpRaiseL { 30%, 70% { transform: rotate(118deg); } }
@keyframes bpRaiseR { 30%, 70% { transform: rotate(-118deg); } }
@keyframes bpWaveHand { 50% { transform: rotate(24deg); } }
@keyframes bpJiggle { 50% { transform: rotate(2.5deg) scale(1.02, .98); } }
@keyframes bpJump { 15% { transform: scale(1.06, .92); } 50% { transform: translateY(-14%); } 85% { transform: scale(1.05, .94); } }
@keyframes bpSquat { 50% { transform: translateY(5%); } }
@keyframes bpStomp { 30% { transform: translateY(-10%) rotate(-8deg); } 55% { transform: none; } }
.bpWord {
  position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%);
  min-width: 140px; padding: 6px 26px; border-radius: 999px; background: rgba(255, 255, 255, .85);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .08); text-align: center; pointer-events: none;
  font: 800 clamp(34px, 7vw, 60px)/1.15 var(--font); white-space: nowrap;
}
.bpWord:empty { opacity: 0; }
.bpWord span { display: inline-block; text-shadow: 0 3px 0 rgba(0, 0, 0, .12); }
.bpWord.pop { animation: bpWordPop .5s cubic-bezier(.34, 1.56, .64, 1); }
.bpWord.pop span { animation: bpLetter .5s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes bpWordPop { from { transform: translateX(-50%) scale(.5); } }
@keyframes bpLetter { from { transform: translateY(-40%) scale(.4); opacity: 0; } }
.bpDots { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 88px); transform: translateX(-50%); display: flex; gap: 6px; pointer-events: none; }
.bpDots span { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 2px rgba(124, 92, 255, .3); transition: transform .2s; }
.bpDots span.on { background: #ffd400; box-shadow: none; }
.bpDots span.now { background: #ff5db1; box-shadow: none; transform: scale(1.4); }
.bpNext {
  position: absolute; right: calc(env(safe-area-inset-right, 0px) + 18px); bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  width: clamp(84px, 13vmin, 120px); height: clamp(84px, 13vmin, 120px); border-radius: 50%; border: 0; padding: 0; cursor: pointer; z-index: 3;
  background: radial-gradient(circle at 35% 28%, #b6ff9a, #2ecc40 55%, #178a26 100%);
  box-shadow: 0 8px 0 #12701e, 0 14px 20px rgba(0, 0, 0, .2), inset 0 -6px 10px rgba(0, 0, 0, .15);
  -webkit-tap-highlight-color: transparent;
}
.bpNext svg { width: 62%; height: 62%; display: block; margin: auto; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .2)); }
.bpNext.press { animation: bpPress .3s ease; }
.bpNext.nudge { animation: bpNudge .9s ease-in-out 3; }
@keyframes bpPress { 40% { transform: translateY(6px) scale(.94); box-shadow: 0 2px 0 #12701e, 0 4px 8px rgba(0, 0, 0, .2); } }
@keyframes bpNudge { 30% { transform: scale(1.15) rotate(-6deg); } 60% { transform: scale(1.1) rotate(6deg); } }
