:root {
  --bg: #14161c;
  --panel: #1d2129;
  --panel-edge: #2b3140;
  --ink: #d7dfe8;
  --ink-dim: #8b96a5;
  --accent: #7fe3a0;
  --accent2: #ffb454;
  --oled: #06090d;
  --oled-glow: rgba(140, 220, 255, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 20% -10%, rgba(126, 183, 255, 0.07), transparent),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

a { color: #8fc7ff; text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 18px 26px 10px;
  max-width: 1080px;
  margin: 0 auto;
}

#logoIcon {
  width: 40px;
  height: 40px;
  image-rendering: pixelated;
  background: #0a0d12;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 4px;
}

.title h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.06em;
}
.title h1 .sub { color: var(--ink-dim); font-weight: 400; }
.title p { margin: 2px 0 0; color: var(--ink-dim); font-size: 12.5px; max-width: 720px; }

main {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
  padding: 12px 26px 26px;
  max-width: 1080px;
  margin: 0 auto;
}
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }

.panel {
  background: linear-gradient(180deg, #20242e, #191d25);
  border: 1px solid var(--panel-edge);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* ---------------- OLED ---------------- */
.oled-bezel {
  background: #05070a;
  border-radius: 10px;
  padding: 10px;
  border: 1px solid #000;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.9),
    0 0 34px rgba(122, 200, 255, 0.12);
  width: fit-content;
  margin: 0 auto;
}

#oled {
  width: 320px;
  height: 320px;
  image-rendering: pixelated;
  background: var(--oled);
  border-radius: 4px;
  box-shadow: 0 0 22px rgba(126, 200, 255, 0.14);
  display: block;
}

.oled-caption {
  text-align: center;
  color: var(--ink-dim);
  font-size: 11px;
  margin: 8px 0 2px;
}

/* ---------------- transport ---------------- */
.transport {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  flex-wrap: wrap;
}

button {
  font: inherit;
  color: var(--ink);
  background: #262c38;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
button:hover { background: #2e3545; }
button:active { transform: translateY(1px); }
button.on { background: #274a35; border-color: #3f7c56; color: #c9f2d8; }

.big-btn {
  min-width: 86px;
  font-weight: 600;
  letter-spacing: 0.08em;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.1;
}
.big-btn .hint { font-size: 9px; color: var(--ink-dim); font-weight: 400; letter-spacing: 0; }
#runBtn.on { background: #2c5138; box-shadow: 0 0 12px rgba(127, 227, 160, 0.25); }

.bpm-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #12151b;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 6px 10px;
}
.bpm-wrap label { font-size: 11px; color: var(--ink-dim); }
.bpm-wrap input {
  width: 64px;
  background: transparent;
  border: none;
  color: var(--ink);
  font: inherit;
  text-align: right;
}

/* ---------------- monitor ---------------- */
.monitor {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-top: 14px;
  padding: 10px 12px;
  background: #12151b;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  flex-wrap: wrap;
}
.mon-item { display: flex; flex-direction: column; min-width: 74px; }
.mon-label { font-size: 9.5px; letter-spacing: 0.12em; color: var(--ink-dim); }
.mon-val { font-size: 15px; font-variant-numeric: tabular-nums; }

.led-wrap { display: flex; align-items: center; gap: 6px; }
.led {
  width: 11px; height: 11px; border-radius: 50%;
  background: #20242c;
  border: 1px solid #333a46;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
.led.on { background: var(--accent); border-color: #9ff5c0; box-shadow: 0 0 10px rgba(127, 227, 160, 0.7); }
.led.accent.on { background: var(--accent2); border-color: #ffd9a0; box-shadow: 0 0 10px rgba(255, 180, 84, 0.7); }
.led.blue.on { background: #7fb7ff; border-color: #b3d4ff; box-shadow: 0 0 10px rgba(127, 183, 255, 0.7); }
.led.purple.on { background: #c9a6ff; border-color: #e0ccff; box-shadow: 0 0 10px rgba(201, 166, 255, 0.7); }
.led-label { font-size: 9.5px; letter-spacing: 0.1em; color: var(--ink-dim); }

/* output routing: dim the panel that isn't driving the output (still clickable) */
.dimmed { opacity: 0.38; transition: opacity 0.2s; }

/* ---------------- pattern strip ---------------- */
.strip-wrap { margin-top: 14px; }
#strip {
  width: 100%;
  height: 64px;
  background: #0a0d12;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  display: block;
}
.strip-caption { color: var(--ink-dim); font-size: 10.5px; margin-top: 4px; text-align: center; }

/* ---------------- parameter panel ---------------- */
.right { display: flex; flex-direction: column; gap: 14px; }

.group {
  background: #12151b;
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 12px 14px 12px;
}
.group h2 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9fd8ff;
}
.group h2 .sub { color: var(--ink-dim); text-transform: none; letter-spacing: 0.02em; font-weight: 400; }

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.row label { font-size: 12.5px; color: var(--ink-dim); white-space: nowrap; }
.row .val { color: var(--ink); font-variant-numeric: tabular-nums; }
.row .grow { flex: 1; }

input[type="range"] {
  flex: 2;
  min-width: 130px;
  accent-color: #7fb7ff;
  height: 22px;
}

select {
  font: inherit;
  color: var(--ink);
  background: #262c38;
  border: 1px solid var(--panel-edge);
  border-radius: 6px;
  padding: 4px 8px;
  max-width: 260px;
}

.toggle {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12.5px; color: var(--ink); }
.switch input { accent-color: var(--accent); }
.switches { gap: 16px; }

/* seed digits */
.seed-digits { display: flex; gap: 8px; margin: 10px 0 4px; }
.hexdigit {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #0c0f14;
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 4px 6px;
  gap: 2px;
  cursor: ns-resize;
  user-select: none;
}
.hexdigit .val {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 22px;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
  text-shadow: 0 0 8px rgba(127, 227, 160, 0.45);
}
.hexdigit button {
  border: none;
  background: transparent;
  color: var(--ink-dim);
  font-size: 13px;
  padding: 0 4px;
  line-height: 1;
}
.hexdigit button:hover { color: var(--ink); }
.seed-digits.disabled { opacity: 0.35; pointer-events: none; }

.tip { color: var(--ink-dim); font-size: 11px; margin: 6px 0 0; line-height: 1.45; }
.tip.inline { margin: 0; }

.small-btn { font-size: 12px; padding: 5px 10px; margin-top: 6px; }

footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 26px 30px;
  color: var(--ink-dim);
  font-size: 11.5px;
  line-height: 1.5;
}
/* ---------------- rack slot mode (?slot=1) ---------------- */
body.slot-mode header, body.slot-mode footer,
body.slot-mode .transport, body.slot-mode .monitor { display: none; }
body.slot-mode main { display: block; padding: 8px 12px; }
body.slot-mode .panel { width: 100%; padding: 10px 12px; }
body.slot-mode .oled-caption, body.slot-mode .strip-caption { display: none; }
body.slot-mode .strip-wrap { margin-top: 10px; }
body.slot-mode .panel.right {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 10px;
  align-content: start;
}
body.slot-mode .group { padding: 10px 12px; }
body.slot-mode .group h2 { margin: 0 0 8px; font-size: 13px; }
body.slot-mode .group p.tip { margin-top: 6px; }
