:root {
  color-scheme: dark;
  --ink: #070a10;
  --panel: #10151f;
  --line: #1e2632;
  --text: #d5dde8;
  --muted: #8a95a6;
  --accent: #5ce1c6;
  --metric: #f2c078;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--sans);
  display: grid;
  place-items: center;
  min-height: 100dvh;
  overflow: hidden;
}
.shell { width: min(960px, 100%); padding: 16px; display: grid; gap: 10px; }
.hud { display: flex; align-items: center; gap: 18px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.hud-item strong { color: var(--text); font-size: 15px; }
.hud button {
  margin-left: auto; font: inherit; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 12px; cursor: pointer;
}
.hud button:hover { border-color: var(--accent); }
.stage { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--ink); }
canvas { display: block; width: 100%; aspect-ratio: 16 / 9; touch-action: manipulation; outline: none; }
canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.overlay, .fallback {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px;
  text-align: center; padding: 24px; background: color-mix(in srgb, var(--ink) 72%, transparent);
}
.overlay[hidden], .fallback[hidden] { display: none; }
.overlay h1, .fallback h1 { font-size: clamp(22px, 4vw, 34px); letter-spacing: -0.02em; }
.overlay p, .fallback p { color: var(--muted); max-width: 42ch; }
.overlay button {
  font: inherit; font-weight: 600; color: #061018; background: var(--accent);
  border: 0; border-radius: 8px; padding: 10px 18px; cursor: pointer;
}
.overlay button:hover { filter: brightness(1.08); }
.hint { font-family: var(--mono); font-size: 11.5px; color: var(--muted); text-align: center; }
.status { font-size: 13px; color: var(--metric); text-align: center; min-height: 1.2em; }
body.shot .hud, body.shot .hint, body.shot .status, body.shot .overlay { display: none; }
body.shot { display: block; }
body.shot .shell { width: 100%; padding: 0; gap: 0; }
body.shot .stage { border: 0; border-radius: 0; }
body.shot canvas { height: 100dvh; aspect-ratio: auto; }
@media print {
  body { display: block; }
  canvas, .hud button { display: none; }
}
