:root {
  --bg: #0f1020;
  --panel: #191a33;
  --text: #ecebff;
  --muted: #8e8cb8;
  --accent: #ffcf4a;
  --live: #3ddc84;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 30% 0%, #23244a, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 24px 16px;
}
.game { width: min(480px, 100%); }
.hud {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 8px;
  color: var(--muted);
}
.hud b { color: var(--text); font-variant-numeric: tabular-nums; }
.stage { position: relative; }
canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #0a0b18;
  border-radius: 12px;
  box-shadow: 0 10px 40px #0008;
  touch-action: none;
}
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: #0a0b18d9;
  border-radius: 12px;
}
.overlay[hidden] { display: none; }
.overlay h1 { margin: 0; font-size: 40px; letter-spacing: 2px; color: var(--accent); }
.overlay p { margin: 0; color: var(--muted); }
form { display: flex; gap: 8px; }
input, button {
  font: inherit;
  border-radius: 8px;
  border: 1px solid #3a3b66;
  padding: 10px 14px;
}
input { background: #11122a; color: var(--text); width: 160px; }
button { background: var(--accent); color: #1b1300; border-color: var(--accent); font-weight: 600; cursor: pointer; }
button:hover { filter: brightness(1.1); }
.board {
  width: min(300px, 100%);
  background: var(--panel);
  border-radius: 12px;
  padding: 16px 20px;
}
.board h2 { margin: 0 0 12px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.live {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  border: 1px solid currentColor;
  border-radius: 99px;
  padding: 1px 8px;
}
.live.on { color: var(--live); }
ol { margin: 0; padding-left: 28px; }
li { padding: 6px 0; border-bottom: 1px solid #2a2b4f; font-variant-numeric: tabular-nums; }
li:last-child { border-bottom: 0; }
li span { float: right; color: var(--accent); }
li.empty { list-style: none; margin-left: -28px; color: var(--muted); }
li.new { animation: flash 1.5s ease-out; }
@keyframes flash { from { background: #ffcf4a40; } to { background: transparent; } }
