:root {
  --bg: #12141c;
  --panel: #1b1e29;
  --line: #2b3040;
  --text: #e8eaf2;
  --muted: #949bb3;
  --accent: #6ee7a8;
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}
body { touch-action: none; }
.wrap {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
h1 { margin: 0; font-size: 1.05rem; font-weight: 650; letter-spacing: .01em; }
.sub { display: block; font-size: .72rem; font-weight: 400; color: var(--muted); }
.fps { font-variant-numeric: tabular-nums; font-size: .78rem; color: var(--muted); }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; }
canvas {
  display: block;
  border-radius: 18px;
  touch-action: none;
  box-shadow: 0 14px 40px rgba(0,0,0,.45);
}
.controls { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 8px; }
.chip {
  flex: 1;
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: .85rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip.ghost { font-size: .78rem; color: var(--muted); }
.chip.is-on { border-color: var(--accent); color: var(--accent); }
.hint { margin: 0; font-size: .72rem; color: var(--muted); text-align: center; }
@media (prefers-reduced-motion: reduce) { canvas { box-shadow: none; } }
