:root {
  color-scheme: dark;
  --bg: #100f14;
  --panel: #1c1924;
  --panel-2: #262132;
  --line: #453d5e;
  --text: #f4ecff;
  --muted: #bdb1d0;
  --kick: #ff6c51;
  --snare: #ffd35d;
  --hat: #63d5ff;
  --tom: #66e0a3;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(255, 108, 81, .16), transparent 34%),
    radial-gradient(circle at 86% 10%, rgba(99, 213, 255, .16), transparent 26%),
    var(--bg);
  color: var(--text);
  font-family: Inter, Segoe UI, Arial, sans-serif;
}

button, input { font: inherit; }

button {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
  min-height: 42px;
  padding: 0 14px;
}

button:hover { border-color: #fff; }

.sequencer {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.transport {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.transport p, .pattern-readout p {
  color: var(--hat);
  margin: 0 0 6px;
  text-transform: uppercase;
}

h1, h2 { letter-spacing: 0; margin: 0; }
h1 { font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1; }
h2 { font-size: 1.15rem; }

.transport-buttons, .pattern-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#playButton { background: var(--hat); color: #06121b; font-weight: 800; }

.deck {
  display: grid;
  gap: 14px;
  grid-template-columns: 285px minmax(620px, 1fr) 270px;
}

.controls, .grid-wrap, .mixer {
  background: rgba(28, 25, 36, .94);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.controls, .mixer {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 18px;
}

label {
  color: var(--muted);
  display: grid;
  gap: 9px;
}

label strong { color: var(--text); justify-self: end; }
input[type="range"] { width: 100%; }

.scope {
  background: #0c0b10;
  border: 1px solid var(--line);
  min-height: 180px;
  overflow: hidden;
  position: relative;
}

#meterCanvas { height: 100%; width: 100%; }

#pulse {
  background: rgba(255, 211, 93, .16);
  inset: 0;
  opacity: 0;
  position: absolute;
  transition: opacity .08s ease;
}

#pulse.live { opacity: 1; }

.grid-wrap {
  min-width: 0;
  overflow-x: auto;
  padding: 18px;
}

.step-numbers, .track-row {
  display: grid;
  gap: 7px;
  grid-template-columns: 120px repeat(16, minmax(36px, 1fr));
  min-width: 840px;
}

.step-numbers {
  color: var(--muted);
  margin-bottom: 8px;
  text-align: center;
}

.step-numbers span:first-child { text-align: left; }

.grid {
  display: grid;
  gap: 10px;
}

.track-name {
  align-items: center;
  display: flex;
  font-weight: 800;
  gap: 9px;
}

.track-name i, .mixer-row i {
  border-radius: 99px;
  display: inline-block;
  height: 12px;
  width: 12px;
}

.step {
  aspect-ratio: 1;
  min-height: 0;
  padding: 0;
  position: relative;
}

.step.on { box-shadow: inset 0 0 0 2px rgba(255,255,255,.28); }
.step.playing { outline: 2px solid #fff; outline-offset: 2px; }
.step.on[data-track="kick"] { background: var(--kick); }
.step.on[data-track="snare"] { background: var(--snare); color: #241700; }
.step.on[data-track="hat"] { background: var(--hat); color: #07141a; }
.step.on[data-track="tom"] { background: var(--tom); color: #06160d; }

.mixer-row {
  display: grid;
  gap: 8px;
  grid-template-columns: 24px 1fr;
  margin-top: 12px;
}

.mixer-row label { grid-column: 2; }

.mute {
  grid-column: 2;
  min-height: 34px;
}

.mute.active { border-color: #fff; opacity: .5; }

.pattern-readout {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 16px;
}

pre {
  color: var(--muted);
  font: .82rem/1.5 Consolas, monospace;
  margin: 0;
  overflow: auto;
}

@media (max-width: 1100px) {
  .deck { grid-template-columns: 1fr; }
  .transport { align-items: start; flex-direction: column; }
}
