:root {
  --ink: #ede8ff;
  --muted: #8b84b0;
  --accent: #9b7bff;
  --danger: #ff5d7a;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  background: radial-gradient(circle at 50% 25%, #160f28, #0a0712 70%);
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; user-select: none;
}
#stage { position: fixed; inset: 0; display: block; touch-action: none; }

.hud { position: fixed; top: 20px; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 26px; pointer-events: none; }
.hud h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; text-shadow: 0 2px 18px #000; }
.stats { display: flex; gap: 22px; }
.stats div { text-align: right; }
.stats span { display: block; font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.stats b { font-size: 24px; font-variant-numeric: tabular-nums; }

.dpad { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: 6px; }
.dpad .mid { display: flex; gap: 44px; }
.dpad button {
  width: 54px; height: 54px; border-radius: 12px; font-size: 18px;
  background: rgba(20,14,34,.8); border: 1px solid rgba(155,123,255,.3); color: var(--ink);
}
@media (pointer: coarse) { .dpad { display: flex; } }

.overlay {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px;
  background: rgba(10,7,18,.82); backdrop-filter: blur(8px);
}
.overlay.hidden { display: none; }
.overlay h2 { font-size: clamp(34px, 7vw, 56px); font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(90deg, var(--accent), #ff8fb0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.overlay p { color: #aaa3cc; max-width: 360px; font-size: 14px; }
.leaderboard h3 { font-size: 11px; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; margin-bottom: 6px; }
.leaderboard ol { list-style: none; font-variant-numeric: tabular-nums; }
.leaderboard li { display: flex; gap: 12px; justify-content: center; font-size: 14px; padding: 2px 0; color: #cfc9ec; }
.leaderboard li span { color: var(--muted); }
.start {
  background: var(--accent); color: #fff; border: none; padding: 13px 44px; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 16px; letter-spacing: 2px; cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.start:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(155,123,255,.4); }
.keys { color: var(--muted) !important; font-size: 12px !important; }
.keys b { color: var(--ink); }
@media (max-width: 640px) { .hud h1 { font-size: 20px; } }
