:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --line: #2a2a2a;
  --text: #e8e8e8;
  --muted: #8a8a8a;
  --accent: #6ee7d8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.4 ui-sans-serif, system-ui, sans-serif;
}

#app {
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  height: 100%;
}

#hud, #refs {
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 14px 14px 24px;
}

#refs { border-right: 0; border-left: 1px solid var(--line); }

h1 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 4px;
}

.sub { color: var(--muted); margin: 0 0 14px; }

label {
  display: block;
  margin: 10px 0 4px;
  color: var(--muted);
}

select, button, input[type="range"] { width: 100%; }

select, button {
  background: #1c1c1c;
  color: var(--text);
  border: 1px solid var(--line);
  padding: 6px 8px;
  border-radius: 4px;
}

button { cursor: pointer; margin-top: 8px; }
button:hover { border-color: #555; }

.row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.row input[type="range"] { flex: 1; }
.val { color: var(--text); min-width: 36px; text-align: right; }

fieldset {
  border: 1px solid var(--line);
  margin: 12px 0 0;
  padding: 8px 10px 12px;
}

legend { color: var(--accent); padding: 0 4px; }

#view { position: relative; min-width: 0; }
canvas.webgl { display: block; width: 100%; height: 100%; }

#ramp {
  width: 100%;
  height: 18px;
  margin-top: 6px;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}

.ref img {
  width: 100%;
  height: auto;
  display: block;
  background: #000;
  margin: 6px 0 14px;
}

.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.check input { width: auto; }

@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  #view { min-height: 52vh; }
}
