/* Wavy Arcade. Layout: one centred column of bands on a pale sky; the play page is a full-screen dark stage. */
:root {
  --sky: #e4f5ff;
  --paper: #ffffff;
  --ink: #14213d;
  --ink-soft: #46557a;
  --coral: #ff5d5d;
  --sun: #ffc93c;
  --mint: #2ec4a6;
  --mint-deep: #17806c;
  --night: #0d1630;
  --display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter-l: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--body); font-size: 1.0625rem; line-height: 1.55; color: var(--ink); background: var(--sky); }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 6px; }

.btn {
  display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  font: 800 1.2rem var(--display); color: #fff; background: var(--coral);
  padding: 0.7em 1.4em 0.6em; border-radius: 999px; box-shadow: 0 5px 0 #c93c3c;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #c93c3c; }
.text-link { font-weight: 700; color: var(--mint-deep); text-underline-offset: 3px; }
.ghost {
  font: 700 0.95rem var(--body); color: inherit; background: transparent; cursor: pointer;
  border: 2px solid currentColor; border-radius: 999px; padding: 0.35em 0.9em; opacity: 0.85;
}
.ghost:hover { opacity: 1; }

/* ---------- home ---------- */
.site-bar, .hero, .band, .site-foot {
  max-width: 1080px; margin-inline: auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.site-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-block: 18px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 1.5rem var(--display); text-decoration: none; }
.logo-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, var(--mint) 60%); border: 2px solid var(--ink); }
.site-bar nav { display: flex; flex-wrap: wrap; gap: 6px 22px; font-weight: 700; }
.site-bar nav a { text-decoration: none; }
.site-bar nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.hero { display: grid; grid-template-columns: 1.15fr 0.85fr; align-items: center; gap: 32px; padding-block: 36px 56px; }
.hero-copy { display: grid; gap: 18px; min-width: 0; }
.eyebrow { font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.85rem; color: var(--mint-deep); }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; }
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 6px; }

.hero-art { position: relative; aspect-ratio: 1 / 1; max-width: 100%; border-radius: 36px; background: linear-gradient(#bfe8ff, #8fd3ff); overflow: hidden; border: 3px solid var(--ink); }
.kid { position: absolute; left: 50%; bottom: -2%; width: 58%; transform: translateX(-50%); }
.b { position: absolute; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.9); background: radial-gradient(circle at 32% 28%, #fff 0 12%, var(--c) 55%); animation: float 5s ease-in-out infinite alternate; display: grid; place-items: center; }
.b1 { --c: #ff7a8a; width: 22%; aspect-ratio: 1; left: 8%; top: 12%; }
.b2 { --c: #8f7bff; width: 15%; aspect-ratio: 1; left: 70%; top: 8%; animation-delay: -1.5s; }
.b3 { --c: #3ddc97; width: 18%; aspect-ratio: 1; left: 76%; top: 46%; animation-delay: -3s; }
.b4 { --c: #ffa24c; width: 13%; aspect-ratio: 1; left: 10%; top: 56%; animation-delay: -2s; }
.b5 { --c: #35c8f5; width: 11%; aspect-ratio: 1; left: 44%; top: 6%; animation-delay: -4s; }
.gold { --c: var(--sun); width: 14%; aspect-ratio: 1; left: 22%; top: 34%; color: #7a4b00; font-size: clamp(1rem, 3vw, 1.6rem); animation-delay: -0.8s; }
@keyframes float { from { transform: translateY(8px); } to { transform: translateY(-10px); } }

.band { padding-block: 34px; display: grid; gap: 22px; }
.band h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 800; }

.game-list { display: grid; gap: 22px; }
.game-card { display: grid; grid-template-columns: minmax(200px, 320px) 1fr; background: var(--paper); border: 3px solid var(--ink); border-radius: 28px; overflow: hidden; }
.game-thumb { position: relative; min-height: 190px; background: linear-gradient(160deg, #1b2f6b, var(--night)); }
.game-thumb span { position: absolute; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.85); background: radial-gradient(circle at 32% 28%, #fff 0 12%, var(--card) 60%); }
.game-thumb span:nth-child(1) { width: 34%; aspect-ratio: 1; left: 12%; top: 16%; }
.game-thumb span:nth-child(2) { width: 22%; aspect-ratio: 1; left: 58%; top: 12%; filter: hue-rotate(140deg); }
.game-thumb span:nth-child(3) { width: 27%; aspect-ratio: 1; left: 50%; top: 52%; filter: hue-rotate(220deg); }
.game-body { padding: 24px 26px; display: grid; gap: 12px; align-content: center; min-width: 0; }
.game-body h3 { font-size: 1.9rem; font-weight: 800; }
.game-tag { color: var(--ink-soft); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.facts li { font-weight: 700; font-size: 0.9rem; background: var(--sky); border-radius: 999px; padding: 0.25em 0.8em; }
.game-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 6px; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; counter-reset: step; }
.steps li { counter-increment: step; display: grid; gap: 6px; align-content: start; }
.steps li::before { content: counter(step); font: 800 1.5rem var(--display); width: 1.9em; height: 1.9em; display: grid; place-items: center; border-radius: 50%; background: var(--sun); border: 3px solid var(--ink); }
.steps h3 { font-size: 1.35rem; font-weight: 800; margin-top: 4px; }
.steps p { color: var(--ink-soft); }

.note p { max-width: 62ch; color: var(--ink-soft); }
.site-foot { padding-block: 26px 40px; color: var(--ink-soft); font-size: 0.95rem; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-block: 16px 36px; }
  .hero-art { max-width: 360px; justify-self: center; width: 100%; }
  .game-card { grid-template-columns: 1fr; }
}

/* ---------- play ---------- */
body.play { background: var(--night); color: #fff; display: flex; flex-direction: column; overflow: hidden; }
.play-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 10px var(--gutter-r) 10px var(--gutter-l); }
.play-bar h1 { font-size: 1.5rem; font-weight: 800; flex: 1; min-width: 0; }
.back { font-weight: 700; text-decoration: none; padding: 0.3em 0.2em; }
.back:hover { text-decoration: underline; }
.play-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.badge { font-size: 0.88rem; font-weight: 700; color: #bfe8ff; }

.stage-wrap { position: relative; flex: 1; min-height: 0; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
body[data-mode="practice"] #stage { cursor: crosshair; }

.hud { position: absolute; inset: 14px var(--gutter-r) auto var(--gutter-l); display: flex; justify-content: space-between; pointer-events: none; }
.hud-item { display: flex; align-items: baseline; gap: 10px; background: rgba(13, 22, 48, 0.72); border-radius: 18px; padding: 6px 18px 2px; }
.hud-label { font-weight: 700; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: #bfe8ff; }
.hud-value { font: 800 2.6rem var(--display); font-variant-numeric: tabular-nums; }
.hud-combo { font: 800 1.6rem var(--display); color: var(--sun); min-width: 1.6em; }

.panel {
  position: absolute; left: 50%; top: 9%; transform: translateX(-50%);
  width: min(560px, calc(100% - 32px)); text-align: center; display: grid; gap: 12px; justify-items: center;
  background: rgba(13, 22, 48, 0.86); border: 2px solid rgba(255, 255, 255, 0.25); border-radius: 26px; padding: 24px 26px 26px;
}
.panel h2 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 800; }
.panel p { color: #d6e6ff; }
.stats { margin: 4px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 26px; }
.stats div { display: grid; }
.stats dt { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #bfe8ff; }
.stats dd { margin: 0; font: 800 1.8rem var(--display); font-variant-numeric: tabular-nums; }
.panel-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 18px; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
  .b { animation: none; }
  .btn { transition: none; }
}
