:root {
  --bg: #050710;
  --panel: #0d1220;
  --line: #22304d;
  --text: #e6ecff;
  --muted: #8a97b8;
  --accent: #4fd1ff;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overflow: hidden; }
.layout { display: flex; height: 100vh; height: 100dvh; }
.stage { position: relative; flex: 1; min-width: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(3, 4, 10, 0.3); }
.overlay[hidden] { display: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px 32px; text-align: center; max-width: 320px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.card h1 { margin: 0 0 8px; font-size: 28px; }
.card p { margin: 0 0 20px; color: var(--muted); }
button { background: var(--accent); color: #04111c; border: 0; border-radius: 8px;
  padding: 10px 18px; font-weight: 700; font-size: 15px; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.panel { width: 260px; flex-shrink: 0; background: var(--panel); border-left: 1px solid var(--line);
  padding: 20px; overflow-y: auto; }
.panel h2 { margin: 0 0 16px; font-size: 20px; }
.panel h3 { margin: 22px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 0; }
.stats div { background: #0a0f1c; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
#next { width: 120px; height: 96px; background: #0a0f1c; border: 1px solid var(--line); border-radius: 10px; }
.keys { list-style: none; padding: 0; margin: 0 0 20px; font-size: 13px; color: var(--muted); line-height: 2; }
kbd { font-family: ui-monospace, monospace; background: #17203a; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--text); font-size: 12px; }
.panel > button { width: 100%; }
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); max-height: 40vh; }
}
