/* ============ Cro Cro Cro Crocodile — shared styles ============ */
/* Palette + type aligned to the landing page (v0 design) for one cohesive world. */
@import url("https://fonts.googleapis.com/css2?family=Baloo+2:wght@600;700;800&family=Nunito:wght@600;700;800&display=swap");
:root {
  /* oklch brand tokens, matched to home.css */
  --jungle: oklch(0.62 0.13 162);
  --jungle-light: oklch(0.78 0.16 162);
  --green-deep: #0e6e52;
  --green: #1aa179;
  --green-bright: #3ecf8e;
  --water: oklch(0.79 0.10 230);
  --water-deep: oklch(0.66 0.12 240);
  --sun: oklch(0.88 0.16 92);
  --coral: oklch(0.72 0.17 35);
  --coral-shadow: rgb(190, 80, 50);
  --cream: oklch(0.97 0.02 95);
  --card: oklch(0.99 0.01 95);
  --pink: #ff9ec4;
  --ink: oklch(0.32 0.05 165);
  --border: oklch(0.88 0.03 130);
  --tap: 0.06s;
  --card-shadow: 0 10px 0 rgba(14,70,52,0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--cream);
  color: var(--ink);
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
.hidden { display: none !important; }
a { color: inherit; text-decoration: none; }
.font-heading, h1, h2 { font-family: "Baloo 2", "Comic Sans MS", system-ui, sans-serif; font-weight: 800; }

/* shared scene background — soft cream sky over a calm water band, matching the home hero */
body.scene-bg {
  background:
    radial-gradient(120% 80% at 50% 120%, color-mix(in oklab, var(--water) 70%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in oklab, var(--water) 32%, var(--cream)) 0%, var(--cream) 46%, color-mix(in oklab, var(--water) 22%, var(--cream)) 100%);
}
body.scene-bg::before { /* sun, soft and warm like the hero */
  content: ""; position: fixed; top: -6%; right: -6%;
  width: 30vmin; height: 30vmin; border-radius: 50%;
  background: var(--sun); filter: blur(2px); opacity: .9;
  pointer-events: none; z-index: 0;
  animation: sun-breathe 14s ease-in-out infinite;
}
body.scene-bg::after { /* gentle water band at the base */
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: 30%;
  background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--water) 45%, transparent));
  pointer-events: none; z-index: 0;
}
@keyframes sun-breathe { 0%,100%{transform:scale(1) rotate(0)} 50%{transform:scale(1.06) rotate(8deg)} }

.stage {
  position: fixed; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2vh; padding: 14px;
  animation: sceneIn .35s ease;
}
@keyframes sceneIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

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

/* ---------- Start gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3vh;
  background: radial-gradient(circle at 50% 30%, var(--green-bright), var(--green-deep)); text-align: center;
}
.gate-croc { font-size: clamp(80px, 26vw, 200px); animation: bob 2.2s ease-in-out infinite; }
.gate-title { color: #fff; font-size: clamp(34px, 11vw, 88px); line-height: 1; font-weight: 800;
  text-shadow: 0 4px 0 rgba(0,0,0,.18), 0 8px 18px rgba(0,0,0,.2); letter-spacing: 1px; }
.big-start {
  width: clamp(110px, 30vw, 170px); height: clamp(110px, 30vw, 170px); border-radius: 50%; border: none; cursor: pointer;
  background: var(--coral); color: #fff; font-size: clamp(50px, 14vw, 80px);
  box-shadow: 0 10px 0 var(--coral-shadow), 0 14px 26px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center; padding-left: 8px;
  animation: pulse 1.6s ease-in-out infinite;
}
.big-start:active { transform: translateY(6px); box-shadow: 0 4px 0 var(--coral-shadow); }
.gate-hint { color: #eafff5; font-size: clamp(15px, 4.5vw, 22px); font-weight: 600; opacity: .9; }

/* ---------- Home / game picker ---------- */
.menu {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(10px, 3vw, 22px);
  width: min(96vw, 720px);
}
@media (max-width: 560px) { .menu { grid-template-columns: repeat(2, 1fr); } }
.tile {
  border: none; cursor: pointer; border-radius: 26px; aspect-ratio: 1 / 0.94;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: inherit; font-weight: 800; color: #fff;
  box-shadow: 0 8px 0 rgba(0,0,0,.18), 0 12px 22px rgba(0,0,0,.18);
  transition: transform var(--tap);
}
.tile:active { transform: translateY(6px) scale(.98); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.tile-emoji { font-size: clamp(38px, 11vw, 64px); line-height: 1; }
.tile-label { font-size: clamp(15px, 4.5vw, 24px); text-shadow: 0 2px 0 rgba(0,0,0,.18); }
.tile--sing  { background: linear-gradient(160deg, #ff9ec4, #ff5fa2); }
.tile--tap   { background: linear-gradient(160deg, var(--green-bright), var(--green-deep)); }
.tile--count { background: linear-gradient(160deg, #ffc34d, #ff8c1a); }
.tile--dress { background: linear-gradient(160deg, #9b8cff, #6a4ddb); }
.tile--peek  { background: linear-gradient(160deg, #ffd36e, #f7a300); }
.tile--music { background: linear-gradient(160deg, #5be0d0, #18a89a); }
.tile--memory{ background: linear-gradient(160deg, #7ad7ff, #2b97e0); }
.tile--pop   { background: linear-gradient(160deg, #ff8e72, #e2452b); }
.tile--paint { background: linear-gradient(160deg, #c08bff, #8e44e0); }

.home-title {
  position: relative; z-index: 2; color: #fff; font-weight: 800;
  font-size: clamp(26px, 8vw, 52px); line-height: 1; text-align: center;
  text-shadow: 0 3px 0 rgba(0,0,0,.18), 0 7px 14px rgba(0,0,0,.2);
}
.home-tagline {
  position: relative; z-index: 2; color: #fff; font-weight: 700;
  font-size: clamp(15px, 4vw, 22px); text-align: center; max-width: 92vw;
  text-shadow: 0 2px 0 rgba(0,0,0,.18); margin-bottom: 2px;
}
.parent-badges {
  position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin-top: 4px;
}
.pbadge {
  background: rgba(255,255,255,.85); color: var(--green-deep); font-weight: 800;
  font-size: clamp(11px, 3vw, 14px); padding: 5px 12px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

/* ---------- Persistent buttons ---------- */
.top-btn {
  position: fixed; top: 12px; z-index: 20;
  width: clamp(50px, 13vw, 66px); height: clamp(50px, 13vw, 66px); border-radius: 999px;
  border: none; cursor: pointer; background: #fff;
  font-size: clamp(24px, 7vw, 34px); box-shadow: 0 4px 12px rgba(14,70,52,.18);
  display: flex; align-items: center; justify-content: center; text-decoration: none; color: var(--jungle);
}
/* right-side stack: mute (0), lang (1, wide pill), settings (2) */
.home-btn { left: 12px; }
.mute-btn { right: 12px; }
.lang-btn {
  right: calc(12px + clamp(50px, 13vw, 66px) + 10px);
  width: auto; padding: 0 6px; gap: 3px;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800;
}
.lang-seg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: clamp(26px, 7vw, 34px); height: clamp(38px, 10vw, 50px); border-radius: 999px;
  font-size: clamp(14px, 4vw, 18px); color: var(--muted-fg); transition: background .15s, color .15s;
}
.lang-seg.on { background: var(--jungle); color: #fff; }
.settings-btn { right: calc(12px + clamp(50px,13vw,66px) + 10px + clamp(76px,22vw,108px) + 10px); }
.top-btn:active { transform: scale(.92); }

/* ---------- Floating bubbles / bursts ---------- */
.bubble {
  position: fixed; bottom: -40px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffffcc, #ffffff22);
  pointer-events: none; z-index: 1; animation: rise linear forwards;
}
@keyframes rise { to { transform: translateY(-115vh) translateX(var(--drift, 0)); opacity: 0; } }
.burst { position: fixed; z-index: 50; pointer-events: none; font-size: 28px; animation: burst .8s ease-out forwards; }
@keyframes burst {
  0% { transform: translate(0,0) scale(.4); opacity: 1; }
  100% { transform: translate(var(--bx), var(--by)) scale(1.3) rotate(var(--br)); opacity: 0; }
}

/* ---------- Settings sheet ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45); padding: 20px;
}
.sheet-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 1.6rem; padding: 28px; max-width: 420px; width: 100%;
  box-shadow: 0 24px 60px rgba(14,70,52,.28); text-align: center;
}
.sheet-card h2 { color: var(--jungle); margin-bottom: 18px; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; font-weight: 700; }
.choice-group { display: flex; gap: 8px; }
.choice {
  border: 3px solid var(--border); background: #fff; border-radius: 14px; cursor: pointer;
  padding: 10px 16px; font-weight: 800; font-family: "Baloo 2", system-ui, sans-serif; font-size: 18px; color: var(--jungle);
}
.choice.active { border-color: var(--jungle); background: var(--jungle); color: #fff; }
.sheet-close {
  margin-top: 10px; padding: 13px 28px; border: none; border-radius: 999px; cursor: pointer;
  background: var(--coral); color: #fff; font-weight: 800; font-size: 16px; font-family: "Baloo 2", system-ui, sans-serif;
  box-shadow: 0 6px 0 var(--coral-shadow);
}
.sheet-close:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--coral-shadow); }

/* ---------- Animations ---------- */
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-14px)} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.07)} }
@keyframes wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-3deg)} 75%{transform:rotate(3deg)} }

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

/* ================= per-game styles ================= */

/* TAP */
.tap-croc { width: min(86vw, 520px); height: min(80vh, 520px); cursor: pointer; }
.tap-croc.chomp { animation: chompPulse .28s ease; }
@keyframes chompPulse { 0%,100%{transform:scale(1)} 40%{transform:scale(1.08) rotate(-2deg)} }

/* SING — lyrics-first layout, everything above the fold */
.sing-layout {
  position: fixed; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(10px, 2.5vh, 22px); padding: clamp(60px, 12vh, 90px) 16px 16px;
}
.karaoke {
  width: min(92vw, 720px);
  display: flex; flex-direction: column; align-items: center; gap: clamp(3px, 1vh, 8px);
}
.kline {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .25em .35em;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: clamp(19px, 5.2vw, 38px); font-weight: 800; line-height: 1.1;
  opacity: .4; transform: scale(.94); transition: opacity .25s, transform .25s; color: var(--green-deep);
  text-shadow: 0 2px 0 rgba(255,255,255,.7);
}
.kline-wrap { display: flex; flex-direction: column; align-items: center; gap: 0; }
.kline.current { opacity: 1; transform: scale(1.06); }
.ksub {
  font-size: clamp(12px, 3.2vw, 18px); font-weight: 600; font-style: italic;
  color: #0d6e51; opacity: .65; text-shadow: 0 1px 0 rgba(255,255,255,.4);
}
.kword { transition: color .15s, transform .15s; }
.kword.on { color: var(--coral); transform: translateY(-3px) scale(1.12); text-shadow: 0 3px 0 #fff; }
.kword.sung { color: #157a5a; }
.sing-controls { display: flex; align-items: center; gap: clamp(10px, 3vw, 20px); }
.full-lyrics { display: flex; }
.real-song-btn {
  border: none; cursor: pointer; border-radius: 999px; background: var(--coral); color: #fff;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: clamp(15px, 4vw, 20px);
  padding: 12px 24px; box-shadow: 0 6px 0 var(--coral-shadow);
}
.real-song-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--coral-shadow); }
.play-toggle {
  width: clamp(72px, 18vw, 100px); height: clamp(72px, 18vw, 100px); border-radius: 50%;
  border: none; cursor: pointer; background: var(--sun); color: var(--ink);
  font-size: clamp(34px, 9vw, 48px); padding-left: 5px; box-shadow: 0 8px 0 #d9a800;
}
.play-toggle:active { transform: translateY(5px); box-shadow: 0 3px 0 #d9a800; }

/* small crocs dancing in the corners, behind the lyrics */
.sing-dancers { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.sing-dancer { position: absolute; width: clamp(70px, 16vw, 130px); height: clamp(70px, 16vw, 130px); opacity: .9; }
.sing-dancer.d0 { left: 2%;  bottom: 6%; }
.sing-dancer.d1 { right: 2%; bottom: 6%; }
.sing-dancer.d2 { left: 1%;  top: 14%; }
.sing-dancer.d3 { right: 1%; top: 14%; }
.sing-dancers.dancing .sing-dancer { animation: croc-dance 0.6s ease-in-out infinite; }
.sing-dancers.dancing .d1 { animation-delay: .15s; }
.sing-dancers.dancing .d2 { animation-delay: .3s; }
.sing-dancers.dancing .d3 { animation-delay: .45s; }
@keyframes croc-dance {
  0%,100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-12px) rotate(4deg); }
}
@media (max-width: 560px) { .sing-dancer.d2, .sing-dancer.d3 { display: none; } }

/* COUNT */
.count-display {
  position: relative; z-index: 3; font-family: "Baloo 2", system-ui, sans-serif;
  font-size: clamp(64px, 22vw, 160px); font-weight: 800; color: var(--jungle);
  text-shadow: 0 4px 0 #fff, 0 8px 16px rgba(14,70,52,.18); line-height: 1;
}
.count-field { position: fixed; inset: 0; z-index: 2; }
.count-croc {
  position: absolute; width: clamp(64px, 18vw, 120px); height: clamp(64px, 18vw, 120px);
  cursor: pointer; transition: transform var(--tap);
}
.count-croc.pop { animation: popOut .36s cubic-bezier(.5,-0.5,.5,1) forwards; }
@keyframes popOut {
  0% { transform: scale(1); opacity: 1; }
  35% { transform: scale(1.25); opacity: 1; }   /* balloon over-inflates */
  100% { transform: scale(0) rotate(30deg); opacity: 0; }  /* then bursts */
}

/* DRESS */
.dress-stage { position: relative; z-index: 2; width: min(74vw, 420px); height: min(52vh, 420px); }
.dress-tray {
  position: relative; z-index: 3; display: flex; gap: clamp(8px, 2.5vw, 14px); flex-wrap: wrap;
  justify-content: center; width: min(96vw, 640px);
}
.dress-item {
  width: clamp(54px, 14vw, 78px); height: clamp(54px, 14vw, 78px); border-radius: 18px;
  border: 4px solid #fff; cursor: pointer; background: #ffffffbb;
  display: flex; align-items: center; justify-content: center; font-size: clamp(28px, 7vw, 42px);
  box-shadow: 0 5px 0 rgba(0,0,0,.12);
}
.dress-item:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.dress-item.active { border-color: var(--sun); background: #fff; }

/* PEEK */
.peek-field {
  position: relative; z-index: 2; width: min(94vw, 640px); height: min(72vh, 640px);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2.5vw, 18px); align-content: center;
}
.peek-cell {
  position: relative; border-radius: 24px; cursor: pointer; overflow: hidden; aspect-ratio: 1;
  background: linear-gradient(160deg, #2bb37f, #0d7a59);
  box-shadow: 0 7px 0 rgba(0,0,0,.16), inset 0 0 0 4px rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
}
.peek-cell:active { transform: translateY(5px); }
.peek-leaf {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: clamp(34px, 11vw, 64px); background: linear-gradient(160deg, #34c98f, #0e6e51);
  transition: transform .28s cubic-bezier(.5,-0.4,.5,1.4), opacity .28s; z-index: 2;
}
.peek-cell.open .peek-leaf { transform: translateY(-120%) rotate(-12deg); opacity: 0; }
.peek-inside { width: 78%; height: 78%; z-index: 1; display: flex; align-items: center; justify-content: center; }
.peek-inside .croc-svg { animation: bob 1.4s ease-in-out infinite; }
.peek-treasure { font-size: clamp(40px, 13vw, 84px); }

/* MUSIC */
.music-pad {
  position: relative; z-index: 2; display: grid; grid-template-columns: repeat(5, 1fr);
  gap: clamp(7px, 2vw, 14px); width: min(96vw, 720px);
}
.music-key {
  border: none; cursor: pointer; aspect-ratio: 1; border-radius: 22px; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 7px 0 rgba(0,0,0,.18), 0 10px 18px rgba(0,0,0,.16); transition: transform .05s;
}
.music-key:active, .music-key.lit { transform: translateY(6px) scale(.97); box-shadow: 0 1px 0 rgba(0,0,0,.18); filter: brightness(1.25); }
.mk-animal { font-size: clamp(30px, 8vw, 48px); line-height: 1; }
.mk-note { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: clamp(11px, 3vw, 16px); text-shadow: 0 1px 2px rgba(0,0,0,.25); }
@media (max-width: 560px) { .music-pad { grid-template-columns: repeat(5, 1fr); } }

/* MEMORY */
.memory-grid {
  position: relative; z-index: 2; display: grid; gap: clamp(6px, 2vw, 14px);
  width: min(94vw, 640px); margin: 0 auto;
}
.mcard { position: relative; aspect-ratio: 3/4; cursor: pointer; perspective: 700px; }
.mcard-inner {
  position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .4s; border-radius: 16px;
}
.mcard.flip .mcard-inner, .mcard.matched .mcard-inner { transform: rotateY(180deg); }
.mface {
  position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 rgba(0,0,0,.16);
}
.mback {
  background: linear-gradient(160deg, #7ad7ff, #2b97e0); color: #fff;
  font-size: clamp(28px, 8vw, 48px);
}
.mfront {
  background: var(--card); transform: rotateY(180deg); padding: 8%;
}
.mfront .croc-svg { width: 100%; height: 100%; }
.mcard.matched { animation: matchPulse .5s ease; }
.mcard.matched .mcard-inner { box-shadow: 0 0 0 4px var(--sun); border-radius: 16px; }
@keyframes matchPulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }
.memory-topbar {
  position: relative; z-index: 3; display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; justify-content: center;
}
.level-bar { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.level-chip {
  border: 3px solid var(--border); background: #fff; cursor: pointer;
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800;
  font-size: clamp(15px, 4vw, 20px); color: var(--jungle);
  min-width: clamp(44px, 11vw, 56px); padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 3px 8px rgba(14,70,52,.12); transition: transform .08s;
}
.level-chip:active { transform: translateY(3px); }
.level-chip.active { border-color: var(--jungle); background: var(--jungle); color: #fff; }
.memory-status {
  font-family: "Baloo 2", system-ui, sans-serif;
  color: var(--jungle); font-weight: 800; font-size: clamp(18px, 5vw, 28px);
  text-shadow: 0 2px 0 #fff;
}
.memory-timer {
  font-family: "Baloo 2", system-ui, sans-serif; color: var(--jungle); font-weight: 800;
  font-size: clamp(16px, 4vw, 22px); background: #fff; padding: 4px 16px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(14,70,52,.15);
}

/* POP (whack/smash) */
.pop-field { position: fixed; inset: 0; z-index: 2; }
/* Bottom-anchored hole. Layers (back→front):
   1) dark hole ellipse at the base
   2) a mask zone (overflow hidden) the croc rises through
   3) the croc, translated down to hide, up to emerge
   4) the dirt front-lip drawn ON TOP so the croc's feet are hidden by the rim */
.pop-hole {
  position: absolute; width: clamp(84px, 22vw, 150px); height: clamp(84px, 22vw, 150px);
}
.pop-hole-dark { /* the dark opening */
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 92%; height: 34%; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 35%, #4a3119 0%, #2c1c0d 75%);
  box-shadow: inset 0 6px 12px rgba(0,0,0,.55);
}
.pop-mask { /* the croc rises through here; clipped at the ground line */
  position: absolute; left: 0; right: 0; bottom: 14%; height: 92%;
  overflow: hidden; display: flex; align-items: flex-end; justify-content: center;
}
.pop-croc {
  width: 86%; aspect-ratio: 1; cursor: pointer;
  transform: translateY(108%); transition: transform .22s cubic-bezier(.34,1.4,.6,1);
}
.pop-front-lip { /* dirt rim in FRONT, hides where the croc meets the ground */
  position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%);
  width: 100%; height: 20%; border-radius: 50%; z-index: 4;
  background: linear-gradient(180deg, #c89456, #936731);
  box-shadow: 0 4px 8px rgba(0,0,0,.22);
}
.pop-hole.up .pop-croc { transform: translateY(0); }
.pop-croc.bonked { animation: bonk .3s ease; }
@keyframes bonk { 0%{transform:translateY(0) scale(1)} 50%{transform:translateY(35%) scale(.8)} 100%{transform:translateY(108%)} }
.pop-score {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5;
  font-family: "Baloo 2", system-ui, sans-serif; color: var(--jungle); font-weight: 800;
  font-size: clamp(24px, 7vw, 40px); text-shadow: 0 3px 0 #fff;
  background: #ffffffcc; padding: 4px 18px; border-radius: 999px; box-shadow: 0 4px 10px rgba(14,70,52,.15);
}

/* KEYS (baby keyboard smash) */
.keys-field { position: fixed; inset: 0; z-index: 2; }
.keys-prompt {
  font-family: "Baloo 2", system-ui, sans-serif; color: var(--jungle); font-weight: 800;
  font-size: clamp(20px, 6vw, 36px); text-shadow: 0 2px 0 #fff; text-align: center;
}
.key-pop { position: absolute; transform: translate(-50%, -50%); animation: keyPop 1.4s ease-out forwards; pointer-events: none; }
.key-char { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: clamp(80px, 22vw, 200px); text-shadow: 0 6px 0 rgba(0,0,0,.12); }
.key-croc { width: clamp(110px, 28vw, 220px); height: clamp(110px, 28vw, 220px); }
@keyframes keyPop {
  0% { transform: translate(-50%,-50%) scale(.2) rotate(-8deg); opacity: 0; }
  20% { transform: translate(-50%,-50%) scale(1.1) rotate(3deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%,-60%) scale(1) rotate(0); opacity: 0; }
}

/* SMASH (Boum!) */
.smash-field { position: fixed; inset: 0; z-index: 2; }
.smash-pop { position: absolute; transform: translate(-50%,-50%); pointer-events: none; animation: smashPop 1.5s ease-out forwards; }
.smash-emoji { font-size: clamp(70px, 18vw, 150px); display: block; }
.smash-croc { width: clamp(110px, 26vw, 210px); height: clamp(110px, 26vw, 210px); }
.smash-blob { border-radius: 50%; box-shadow: 0 8px 22px rgba(14,70,52,.25); }
@keyframes smashPop {
  0% { transform: translate(-50%,-50%) scale(.2) rotate(-10deg); opacity: 0; }
  18% { transform: translate(-50%,-50%) scale(1.15) rotate(4deg); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%,-55%) scale(1) rotate(0); opacity: 0; }
}

/* MATCH (Associer) */
.match-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 15;
  display: flex; align-items: center; gap: 16px; justify-content: center;
  padding: 12px clamp(80px, 22vw, 200px); /* clear of home + lang/mute buttons */
  background: color-mix(in oklab, var(--cream) 86%, transparent); backdrop-filter: blur(6px);
  min-height: clamp(62px, 14vw, 78px);
}
.match-stage {
  position: fixed; inset: clamp(62px, 14vw, 78px) 0 0 0; z-index: 2;
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.match-theme { display: inline-flex; align-items: center; gap: 8px; font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; color: var(--jungle); }
#themeSelect {
  font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; font-size: clamp(15px, 4vw, 19px);
  color: var(--jungle); background: #fff; border: 3px solid var(--border); border-radius: 999px;
  padding: 8px 16px; cursor: pointer;
}
.match-status { font-family: "Baloo 2", system-ui, sans-serif; font-weight: 800; color: var(--coral); font-size: clamp(18px, 5vw, 28px); min-height: 1.2em; }
.match-board { position: relative; z-index: 2; display: flex; flex-direction: column; gap: clamp(28px, 9vh, 72px); width: min(96vw, 860px); }
.match-row { display: flex; gap: clamp(10px, 3vw, 22px); justify-content: center; flex-wrap: wrap; }
.match-item, .match-target {
  width: clamp(72px, 17vw, 128px); aspect-ratio: 1; border-radius: 24px;
  display: flex; align-items: center; justify-content: center; font-size: clamp(44px, 12vw, 78px);
}
.match-item {
  background: #fff; box-shadow: 0 7px 0 rgba(14,70,52,.16); cursor: grab; touch-action: none;
  transition: transform .1s; user-select: none;
}
.match-item.dragging { cursor: grabbing; transform: scale(1.12); z-index: 60; box-shadow: 0 12px 22px rgba(0,0,0,.25); }
.match-target { background: #ffffff66; border: 4px dashed var(--jungle); }
.match-target.filled { border-style: solid; background: #fff; }
.match-ghost { opacity: .28; filter: grayscale(.4); }
.match-placed { animation: matchPulse .4s ease; }

/* FIREWORKS */
body.fw-night { background: linear-gradient(180deg, #081024 0%, #0d2247 55%, #163a6b 100%); }
/* depth order: sky+moon (0) → fireworks canvas (1) → sea/beach/crocs foreground (3) */
.fw-back { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#fwCanvas { position: fixed; inset: 0; z-index: 1; }
.fw-front { position: fixed; inset: 0; z-index: 3; overflow: hidden; pointer-events: none; }
.fw-moon {
  position: absolute; top: 8%; right: 14%; width: 12vmin; height: 12vmin; border-radius: 50%;
  background: #fff7d6; box-shadow: 0 0 8vmin 2vmin rgba(255,247,214,.35);
}
.fw-sea {
  position: absolute; left: 0; right: 0; bottom: 12%; height: 14%;
  background: linear-gradient(180deg, #1a4378, #0f2c54);
  box-shadow: inset 0 8px 24px rgba(255,255,255,.06);
}
.fw-star { position: absolute; background: #fff; border-radius: 50%; animation: twinkle 3s ease-in-out infinite; }
@keyframes twinkle { 0%,100%{opacity:.3} 50%{opacity:1} }
.fw-sea::after { /* moon glitter on water */
  content: ""; position: absolute; top: 0; right: 14%; width: 8vmin; height: 100%;
  background: linear-gradient(180deg, rgba(255,247,214,.4), transparent 70%); filter: blur(3px);
}
.fw-beach {
  position: absolute; left: 0; right: 0; bottom: 0; height: 16%;
  background: linear-gradient(180deg, #b88a4e, #8a5f2e);
}
.fw-crocs {
  position: absolute; left: 0; right: 0; bottom: 9%;
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(2px, 1vw, 14px);
}
.fw-croc { width: clamp(56px, 15vw, 110px); height: clamp(56px, 15vw, 110px); filter: brightness(.7) saturate(.9); }
.fw-croc:nth-child(odd) { transform: translateY(6%); }
.fw-prompt {
  font-family: "Baloo 2", system-ui, sans-serif; color: #fff; font-weight: 800;
  font-size: clamp(18px, 5vw, 30px); text-shadow: 0 2px 8px rgba(0,0,0,.5); text-align: center;
}

/* PAINT */
.paint-stage { position: relative; z-index: 2; width: min(78vw, 440px); height: min(52vh, 440px); cursor: pointer; }
.paint-stage .croc-region { cursor: pointer; transition: fill .15s; }
.paint-palette {
  position: relative; z-index: 3; display: flex; gap: clamp(8px, 2.5vw, 14px); flex-wrap: wrap;
  justify-content: center; width: min(96vw, 620px);
}
.swatch {
  width: clamp(48px, 13vw, 70px); height: clamp(48px, 13vw, 70px); border-radius: 50%;
  border: 4px solid #fff; cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.14);
}
.swatch:active { transform: translateY(4px); }
.swatch.active { border-color: var(--ink); transform: scale(1.12); }
