/* Same palette as Snäckmageddon and the hub: ink, cream panels, warm lines, green accent, sky. */
:root {
  --ink: #1f1710;
  --muted: #6a5a4a;
  --panel: rgba(255, 250, 240, 0.97);
  --line: #e0d4c2;
  --chip: #efe6d6;
  --accent: #3aaa5c;
  --accent-ink: #fff;
  --hud: rgba(20, 15, 10, 0.62);
  --sky: #5fb0ea;
  --sky-low: #bfe3ff;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --pad-h: 84px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: linear-gradient(var(--sky), var(--sky-low) 70%); font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
button { font: inherit; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; padding: calc(52px + var(--safe-t)) 0 calc(var(--pad-h) + 12px + var(--safe-b)); }
#lawn { width: 100%; height: 100%; display: block; touch-action: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; -webkit-user-select: none; }
#hud > * { pointer-events: auto; }
.hud-top { position: absolute; top: calc(8px + var(--safe-t)); left: 8px; right: 8px; display: flex; align-items: stretch; gap: 6px; }
.stat { display: grid; align-content: center; justify-items: start; gap: 0; padding: 4px 12px; border-radius: 10px; background: var(--hud); color: #fff; min-width: 64px; }
.stat .label { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; line-height: 1.2; }
.stat .value { font-weight: 800; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat.next { justify-items: center; padding: 4px 8px; }
.stat.next canvas { width: 44px; height: 28px; display: block; }
.hud-btns { display: flex; gap: 6px; margin-left: auto; }
.icon-btn { width: 40px; height: 36px; align-self: center; border: none; border-radius: 10px; background: var(--hud); color: #fff; font-size: 17px; cursor: pointer; flex: none; }

/* ---------- the three buttons ---------- */
.pad { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 28fr 44fr 28fr; gap: 8px; padding: 8px 10px calc(10px + var(--safe-b)); height: calc(var(--pad-h) + 12px + var(--safe-b)); z-index: 4; }
.pad-btn { border: 0; border-radius: 16px; background: var(--panel); color: var(--ink); font-size: 30px; font-weight: 800; cursor: pointer; box-shadow: 0 3px 0 rgba(0,0,0,.18), 0 8px 24px rgba(0,0,0,.18);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.pad-btn.drop { background: var(--accent); color: var(--accent-ink); font-size: 22px; letter-spacing: .02em; }
.pad-btn.down { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18), 0 4px 12px rgba(0,0,0,.18); filter: brightness(1.12); }
@media (min-width: 720px) { .pad { max-width: 560px; margin: 0 auto; } }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(95, 176, 234, 0.55); backdrop-filter: blur(3px); z-index: 10; overflow: auto; }
.panel { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.panel.small { width: min(380px, 100%); text-align: center; }
.panel h1 { margin: 6px 0 4px; font-size: 32px; line-height: 1.05; }
.panel h2 { margin: 0 0 10px; font-size: 22px; }
.tagline { margin: 0 0 6px; color: var(--muted); }
.credit { margin: 0 0 16px; font-size: 13px; font-weight: 700; color: var(--accent); }
.lang { position: absolute; top: 14px; right: 14px; display: flex; gap: 2px; background: var(--chip); border-radius: 999px; padding: 3px; }
.lang button { font-size: 12px; font-weight: 700; border: 0; background: transparent; padding: 4px 10px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn { border: 0; border-radius: 12px; padding: 11px 18px; font-weight: 800; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); flex: 1 1 100%; font-size: 17px; }
.btn.secondary { background: var(--chip); color: var(--ink); }
.btn:hover { filter: brightness(1.05); }
.hint { min-height: 1.2em; margin: 10px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
footer { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }
footer a { color: inherit; }
#help p { line-height: 1.45; }
.why { font-size: 14px; color: var(--muted); line-height: 1.45; }
.score { font-size: 30px; font-weight: 800; margin: 6px 0 0; }
.best { margin: 0 0 14px; color: var(--muted); font-weight: 700; }
.best.new { color: var(--accent); }
