:root {
  --bg: #0d0f14;
  --panel: #151922;
  --edge: #262c3a;
  --fg: #e6e9f0;
  --muted: #8a93a6;
  --accent: #7cc4ff;
  --accent-dim: #2a3548;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: flex-start;
  justify-content: center;
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* --- stage / canvas --- */
.stage {
  position: relative;
  flex: 0 0 auto;
}

#frame {
  width: 448px;
  max-width: 78vw;
  aspect-ratio: 1 / 1;
  height: auto;
  image-rendering: pixelated;
  background: #000;
  border: 1px solid var(--edge);
  border-radius: 10px;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 15px/1.4 -apple-system, sans-serif;
  color: var(--danger);
  background: rgba(8, 10, 14, 0.55);
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}
.overlay.show { opacity: 1; }

/* --- panel --- */
.panel {
  flex: 1 1 320px;
  min-width: 300px;
  max-width: 420px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
}

h1 {
  font-size: 22px;
  line-height: 1.25;
  margin: 0 0 12px;
}

.intro {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 20px;
}
.intro b { color: var(--fg); font-weight: 600; }

.row { margin: 0 0 6px; }

.buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

button {
  font: 500 13px/1 inherit;
  color: var(--fg);
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 7px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
button:hover { background: var(--accent-dim); border-color: var(--accent); }

.group {
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.group .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
}
.group .row:first-child { margin-top: 0; }
.group label { font-size: 13px; color: var(--muted); }
.group output { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--accent); }

input[type="range"] {
  width: 100%;
  margin: 4px 0 2px;
  accent-color: var(--accent);
}

.note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.note.err { color: var(--danger); }

.hud {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre;
  color: var(--fg);
  background: #0a0c11;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 76px;
}
.hud.dead { color: var(--danger); border-color: var(--danger); }
