:root {
  --bg: #0d1117; --panel: rgba(13, 17, 23, 0.82); --text: #e6edf3;
  --muted: #8b949e; --accent: #2ea8ff; --line: #ff3b5c; --truth: #2bd97e;
}
* { margin: 0; box-sizing: border-box; }
body {
  background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
  display: grid; place-items: center; min-height: 100dvh;
}
#stage {
  position: relative; width: min(100vw, 100dvh); height: min(100vw, 100dvh);
  overflow: hidden; touch-action: none;
}
#tiles { position: absolute; inset: 0; }
#draw { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
#hud {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 14px; align-items: baseline; white-space: nowrap;
  background: var(--panel); backdrop-filter: blur(8px);
  padding: 10px 20px; border-radius: 999px; font-size: 15px;
}
#hud strong { font-size: 18px; }
#hud span { color: var(--muted); }
#controls { position: absolute; right: 16px; bottom: 40px; display: flex; gap: 10px; }
button {
  font: inherit; border: 0; border-radius: 999px; padding: 12px 24px; cursor: pointer;
}
.btn-primary { background: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-ghost { background: var(--panel); color: var(--text); backdrop-filter: blur(8px); }
#overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(13, 17, 23, 0.7); backdrop-filter: blur(4px); z-index: 10;
}
#overlay[hidden] { display: none; }
.panel {
  background: var(--panel); border: 1px solid #30363d; border-radius: 16px;
  padding: 28px 32px; max-width: 420px; width: 90%; max-height: 80%; overflow-y: auto;
  text-align: center; display: grid; gap: 14px;
}
.panel h2 { font-size: 22px; }
.panel .big { font-size: 40px; font-weight: 700; color: var(--accent); }
.panel .muted { color: var(--muted); }
.panel input {
  font: inherit; padding: 10px 14px; border-radius: 8px; border: 1px solid #30363d;
  background: var(--bg); color: var(--text); text-align: center;
}
.panel ol { text-align: left; padding-left: 28px; }
.panel li { padding: 2px 0; }
.panel li.me { color: var(--accent); font-weight: 700; }
.error { color: var(--line); font-size: 14px; }
#attribution {
  position: absolute; left: 8px; bottom: 6px; font-size: 10px; color: var(--muted);
  text-shadow: 0 0 4px #000;
}
