/* Deedz Synth Board. Colours match the homepage and arcade. */
:root {
  color-scheme: dark;
  --bg: #08131f;
  --bg-2: #111f30;
  --panel: rgba(15, 29, 45, .86);
  --inset: #0a1826;
  --text: #f6fbff;
  --muted: #bdd0df;
  --line: rgba(255, 255, 255, .13);
  --gold: #ffcb3d;
  --pink: #ff5dab;
  --blue: #8eeaff;
  --green: #67f291;
  --red: #ff4b5f;
  --radius: 20px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); line-height: 1.45;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(800px 420px at 0% -10%, rgba(255, 93, 171, .14), transparent 60%),
    radial-gradient(800px 420px at 100% 0%, rgba(255, 203, 61, .1), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}
button, select, input { font: inherit; }
button { touch-action: manipulation; }
.shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 16px 0 44px; }
deedz-nav { min-height: 50px; margin-bottom: 20px; --dz-nav-accent: var(--gold); }

.topbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1; letter-spacing: -.045em; }
.subtitle { margin: .5rem 0 0; color: var(--muted); }
h2 { margin: 0; font-size: 1.05rem; }

.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.head-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Controls */
.field { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 750; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
select {
  background: var(--inset); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 10px; font-size: .92rem;
}
.slider { display: flex; flex-direction: column; gap: 4px; color: var(--muted); font-size: .75rem; font-weight: 750; min-width: 110px; flex: 1; }
.slider b { color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.chip, .toggle, .octave button, .big {
  border: 1px solid var(--line); background: var(--inset); color: var(--text); border-radius: 999px;
  padding: 8px 14px; font-weight: 750; font-size: .88rem; cursor: pointer;
}
.chip:hover, .toggle:hover, .octave button:hover, .big:hover { border-color: rgba(255, 255, 255, .3); }
.toggle[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #1a1200; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.sound { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 18px; }
.sound .field { min-width: 180px; }
.sliders { display: flex; flex-wrap: wrap; gap: 12px 16px; flex: 1 1 360px; }
.octave { display: flex; align-items: center; gap: 6px; }
.octave button { width: 38px; height: 38px; padding: 0; font-size: 1.2rem; }
.octave span { min-width: 34px; text-align: center; font-weight: 850; font-variant-numeric: tabular-nums; }

/* Keyboard */
.keyboard { margin-bottom: 14px; }
.keys {
  position: relative; display: flex; height: clamp(180px, 30vw, 250px);
  padding: 14px 10px 10px; border-radius: var(--radius);
  background: linear-gradient(180deg, #1b2c42, #0c1826); border: 1px solid var(--line);
  box-shadow: inset 0 10px 24px rgba(0, 0, 0, .45), 0 18px 50px rgba(0, 0, 0, .3);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.key {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  padding-bottom: 8px; font-size: .7rem; font-weight: 800; cursor: pointer;
}
.key.white {
  flex: 1; margin: 0 1.5px; border-radius: 0 0 9px 9px; color: #54647a;
  background: linear-gradient(180deg, #e8eef6, #ffffff 70%, #f1f4f9);
  box-shadow: inset 0 -6px 0 #cfd8e4, 0 2px 0 rgba(0, 0, 0, .35);
}
.key.black {
  position: absolute; top: 14px; height: 60%; z-index: 2; border-radius: 0 0 7px 7px; color: #9fb0c6;
  background: linear-gradient(180deg, #1a2433, #06090e);
  box-shadow: inset 0 -5px 0 #2c3b50, 0 3px 6px rgba(0, 0, 0, .5);
}
.key .kbd { opacity: .75; text-transform: uppercase; }
.key .name { font-size: .62rem; opacity: .7; margin-top: 2px; }
.key.white.on { background: linear-gradient(180deg, #ffd96b, #ffcb3d); box-shadow: inset 0 -2px 0 #d9a520; color: #4a3500; }
.key.black.on { background: linear-gradient(180deg, #ff8cc4, #ff5dab); box-shadow: inset 0 -2px 0 #c73c83; color: #fff; }
.hint { color: var(--muted); font-size: .8rem; margin: 10px 2px 0; }
kbd {
  display: inline-block; min-width: 1.5em; padding: 0 .35em; border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; background: var(--inset); color: var(--text); font: inherit; font-size: .75rem; text-align: center;
}

/* Transport */
.transport { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 16px; }
.transport-buttons { display: flex; gap: 8px; }
.big { padding: 12px 20px; font-size: 1rem; }
.big#play.playing { background: var(--green); border-color: var(--green); color: #04220f; }
.big.rec { color: var(--red); }
.big.rec.armed { background: var(--red); border-color: var(--red); color: #fff; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 75, 95, .25); } }
.tempo { flex: 1 1 200px; }
.field.small select { min-width: 90px; }
.loop-progress { flex-basis: 100%; height: 6px; border-radius: 99px; background: var(--inset); overflow: hidden; }
.loop-progress div { height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--gold)); }
.loop-progress.recording div { background: var(--red); }
.status { flex-basis: 100%; margin: 0; min-height: 1.3em; color: var(--muted); font-size: .85rem; }
.downloads { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; }
.downloads:empty { display: none; }
.downloads a {
  color: #04220f; background: var(--green); border-radius: 999px; padding: 7px 14px; font-weight: 800;
  font-size: .85rem; text-decoration: none;
}

/* Layers */
.layer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.layer-list li {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  background: var(--inset); border: 1px solid var(--line);
}
.layer-list li.muted { opacity: .5; }
.layer-list .num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pink); color: #2a0016; font-weight: 900; font-size: .85rem;
}
.layer-list .desc { flex: 1; min-width: 0; font-size: .88rem; }
.layer-list .desc small { display: block; color: var(--muted); }
.layer-list .empty { display: block; color: var(--muted); text-align: center; background: transparent; border-style: dashed; }

/* Drums */
.pads { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.pad {
  aspect-ratio: 1 / .8; border-radius: 14px; border: 1px solid var(--line); cursor: pointer; color: var(--text);
  background: linear-gradient(160deg, #203754, #0d1a2a); font-weight: 850; font-size: .82rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .35); touch-action: manipulation; user-select: none;
}
.pad small { color: var(--muted); font-weight: 700; }
.pad.hit { background: linear-gradient(160deg, #ff8cc4, #ff5dab); color: #2a0016; }
.pad.hit small { color: #5a0833; }
/* Layout helpers */
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.two-col > .panel { margin-bottom: 0; }
.panel-head .hint { margin: 2px 0 0; }
.segmented { display: flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.segmented button {
  border: 0; background: var(--inset); color: var(--muted); padding: 8px 12px; font-weight: 800; font-size: .85rem; cursor: pointer;
}
.segmented button[aria-pressed="true"] { background: var(--blue); color: #04202a; }

/* DJ decks */
.deck-row { display: grid; grid-template-columns: 1fr minmax(180px, .8fr) 1fr; gap: 14px; align-items: center; }
.deck { padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--inset); transition: opacity .2s; }
.deck[data-deck="A"] { --deck: var(--pink); }
.deck[data-deck="B"] { --deck: var(--blue); }
.deck .knob-arc { stroke: var(--deck); }
.deck.off { opacity: .5; }
.deck-top { display: flex; align-items: center; gap: 10px; }
.deck-name { font-weight: 900; color: var(--deck); }
.deck-count { color: var(--muted); font-size: .8rem; flex: 1; }
.deck .toggle[aria-pressed="true"] { background: var(--deck); border-color: var(--deck); color: #10131a; }
.xfader { display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
.xfader label { color: var(--muted); font-size: .75rem; font-weight: 800; }
.xfader input { accent-color: var(--gold); }
.xf-labels { display: flex; justify-content: space-between; align-items: center; }
.xf-labels b:first-child { color: var(--pink); }
.xf-labels b:last-child { color: var(--blue); }
.layer-list .deck-badge {
  flex: none; min-width: 64px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line);
  font-weight: 850; font-size: .8rem; cursor: pointer; background: var(--inset); color: var(--text);
}
.layer-list .deck-badge[data-deck="A"] { border-color: var(--pink); color: var(--pink); }
.layer-list .deck-badge[data-deck="B"] { border-color: var(--blue); color: var(--blue); }

/* Performance FX */
.perf-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.hold {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px;
  border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, #1d3350, #0d1a2a);
  color: var(--text); font-weight: 850; font-size: .88rem; cursor: pointer; touch-action: none; user-select: none;
  grid-column: span 2;
}
.hold small { color: var(--muted); font-weight: 700; }
.hold.wide { grid-column: span 3; }
.hold.held { background: linear-gradient(160deg, #ffd96b, #ffcb3d); color: #2a1d00; border-color: var(--gold); }
.hold.held small { color: #5a4300; }

/* FX board */
.fx-pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fx-pad {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 78px;
  border-radius: 14px; border: 1px solid var(--line); background: linear-gradient(160deg, #2a1d45, #0f1a2c);
  color: var(--text); font-weight: 800; font-size: .8rem; cursor: pointer; touch-action: manipulation; user-select: none;
}
.fx-icon { font-size: 1.5rem; line-height: 1; }
.fx-pad.hit { background: linear-gradient(160deg, #b98cff, #7d5cff); border-color: #b98cff; }
.panel-head .knob { width: 80px; }
.panel-head .knob-dial { width: 50px; height: 50px; }

/* Sample pads */
.sample-pads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sample-pad {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 76px; padding: 8px 6px; border-radius: 14px; border: 1px dashed var(--line); background: var(--inset);
  color: var(--muted); font-weight: 800; font-size: .8rem; cursor: pointer; touch-action: manipulation; user-select: none;
}
.sample-pad .sp-num { position: absolute; top: 6px; left: 9px; font-size: .7rem; opacity: .7; }
.sample-pad .sp-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sample-pad small { font-weight: 700; opacity: .8; }
.sample-pad.filled { border-style: solid; color: var(--text); background: linear-gradient(160deg, #0f3a33, #0b1d24); }
.sample-pad.selected { outline: 2px solid var(--green); outline-offset: 1px; }
.sample-pad.looping { background: linear-gradient(160deg, #3be08a, #1fae66); color: #04220f; }
.sample-pad.hit { background: linear-gradient(160deg, #8ff5b8, #67f291); color: #04220f; }
.sample-editor { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.sample-title { font-weight: 800; font-size: .9rem; overflow-wrap: anywhere; }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip.recording { background: var(--red); border-color: var(--red); color: #fff; }

/* Scenes */
.scenes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.scene-slot { position: relative; }
.scene {
  width: 100%; min-height: 76px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px;
  padding: 10px 14px; border-radius: 14px; border: 1px dashed var(--line); background: var(--inset); color: var(--muted);
  font-size: .9rem; cursor: pointer; text-align: left;
}
.scene b { color: var(--text); }
.scene small { font-size: .75rem; }
.scene.filled { border-style: solid; background: linear-gradient(160deg, #1c2f4a, #0e1b2c); }
.scene.current { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.scene.queued { animation: pulse 0.6s ease-in-out infinite; border-color: var(--gold); }
.scene.save-target { border-color: var(--green); border-style: solid; }
.scene-clear {
  position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--inset); color: var(--muted); cursor: pointer; font-size: .75rem;
}

@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
  .deck-row { grid-template-columns: 1fr; }
  .xfader { order: 3; }
}
@media (max-width: 480px) {
  .perf-grid { grid-template-columns: repeat(2, 1fr); }
  .perf-grid .hold { grid-column: span 1; }
  .perf-grid .hold:last-child { grid-column: span 2; }
}

/* Kick designer */
.kick-designer {
  margin: 14px 0 6px; padding: 14px; border-radius: 16px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 93, 171, .08), rgba(10, 24, 38, .6));
}
.kick-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.kick-head h3 { margin: 0; font-size: .98rem; }
.kick-head .hint { margin: 2px 0 0; }
.kick-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.kick-presets button[aria-pressed="true"] { background: var(--pink); border-color: var(--pink); color: #2a0016; }
.knobs { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 12px 18px; margin-top: 12px; }

.knob { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 92px; }
.knob-dial { width: 68px; height: 68px; border-radius: 50%; cursor: ns-resize; touch-action: none; }
.knob-dial:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.knob-dial svg { display: block; width: 100%; height: 100%; overflow: visible; }
.knob-track { fill: none; stroke: #1e3048; stroke-width: 5; stroke-linecap: round; }
.knob-arc { fill: none; stroke: var(--pink); stroke-width: 5; stroke-linecap: round; }
.knob-cap { fill: #13243a; stroke: rgba(255, 255, 255, .18); stroke-width: 1.5; }
.knob-pointer { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.knob-label { font-size: .75rem; font-weight: 800; color: var(--muted); }
.knob-value { font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }

.seq-scroll { overflow-x: auto; margin-top: 6px; padding-bottom: 4px; }
.seq { display: grid; grid-template-columns: 88px repeat(16, minmax(26px, 1fr)); gap: 4px; min-width: 560px; }
.seq .row-label { color: var(--muted); font-size: .75rem; font-weight: 750; align-self: center; white-space: nowrap; }
.seq .cell {
  aspect-ratio: 1; border-radius: 6px; border: 1px solid var(--line); background: var(--inset); cursor: pointer; padding: 0;
}
.seq .cell.beat { background: #13263a; }
.seq .cell.on { background: var(--pink); border-color: var(--pink); }
.seq .cell.now { outline: 2px solid var(--gold); outline-offset: -1px; }

.privacy { color: var(--muted); font-size: .82rem; text-align: center; margin: 18px 8px 0; }

@media (max-width: 700px) {
  .pads { grid-template-columns: repeat(4, 1fr); }
  .transport-buttons { flex-basis: 100%; }
  .transport-buttons .big { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .big.rec.armed { animation: none; }
}
