:root {
  color-scheme: dark;
  --bg: #050708;
  --fg: #e7eee8;
  --muted: #7f8c84;
  --line: #26302a;
  --panel: rgba(6, 9, 8, 0.96);
  --accent: #b8f7cb;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--fg); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace; }
body { overflow: hidden; }
#app { position: relative; width: 100vw; height: 100vh; background: var(--bg); }
canvas { display: block; width: 100%; height: 100%; background: var(--bg); image-rendering: pixelated; image-rendering: crisp-edges; contain: strict; }
#help { position: absolute; left: 18px; bottom: 14px; color: var(--muted); font-size: 12px; letter-spacing: .08em; user-select: none; pointer-events: none; }
.hidden { display: none !important; }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.65); backdrop-filter: blur(2px); padding: 24px; }
.panel { width: min(1180px, 96vw); border: 1px solid var(--line); background: var(--panel); padding: 24px; box-shadow: 0 0 0 1px rgba(255,255,255,.02) inset; }
.panel-head { display: flex; justify-content: space-between; gap: 20px; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.eyebrow { font-size: 11px; color: var(--muted); letter-spacing: .12em; }
h1 { margin: 6px 0 0; font-size: 28px; font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
fieldset { border: 1px solid var(--line); padding: 16px; min-width: 0; }
legend { color: var(--accent); padding: 0 8px; }
label { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 13px; margin: 0 0 16px; }
label:last-child { margin-bottom: 0; }
label input[type="range"], label select { grid-column: 1 / -1; width: 100%; }
output { color: var(--muted); }
button, select { font: inherit; color: var(--fg); background: #0c100e; border: 1px solid #354139; padding: 10px 12px; }
button:hover, select:hover { border-color: #66776d; }
input[type="range"] { accent-color: #b8f7cb; }
input[type="checkbox"] { accent-color: #b8f7cb; transform: scale(1.1); }
.panel-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
@media (max-width: 760px) {
  .grid { grid-template-columns: 1fr; max-height: 65vh; overflow: auto; }
  .panel { padding: 16px; }
}
