/* NOIz3 PolluTOR · DJ board. Every colour is a token on :root so a skin can restyle it. */
:root {
  --bg: #08080d;
  --bg-2: #0d0d14;
  --panel: #12121a;
  --panel-2: #191924;
  --well: #0a0a10;
  --line: #24242f;
  --line-2: #32323f;
  --text: #ecebf3;
  --muted: #a3a2b6;
  --dim: #6c6b80;
  --deck-a: #3ee6ff;
  --deck-b: #ff4fa3;
  --accent: #ffb547;
  --ok: #4dff9a;
  --bad: #ff5a6a;
  --violet: #a78bfa;
  --sec-intro: #3ee6ff;
  --sec-drop: #ff4fa3;
  --sec-break: #a78bfa;
  --sec-outro: #6c6b80;
  --sec-transition: #ffb547;
  --vu-lo: #4dff9a;
  --vu-mid: #ffb547;
  --vu-hi: #ff5a6a;
  --wave: #ecebf3;
  --grid: #ffffff;
  --playhead: #ffffff;
  --sans: "Space Grotesk", system-ui, -apple-system, "Segoe UI", "Noto Sans Runic", "Noto Sans Ogham", "Noto Sans Tifinagh", "Noto Sans Cherokee", "Noto Sans Canadian Aboriginal", "Noto Sans Ethiopic", "Noto Sans Georgian", "Noto Sans Armenian", "Noto Sans Thai", "Noto Sans Math", "Noto Sans JP", "Noto Sans Devanagari", "Noto Sans Javanese", "Noto Sans", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 14px;
  --r-sm: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--sans); }
body { min-height: 100vh; overflow-x: hidden; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.hide { display: none !important; }
button, input, select { font: inherit; color: inherit; }
.admin-only { display: none !important; }
body.admin .admin-only { display: revert !important; }
body.admin form.admin-only, body.admin .q-pick.admin-only { display: flex !important; }

/* nav */
.dj-nav { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; min-width: 0; }
.brand-disc { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--deck-b); box-shadow: inset 0 0 0 3px var(--bg-2), inset 0 0 0 7px var(--deck-a); flex: none; }
.brand-name { white-space: nowrap; }
.brand-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: var(--bg); }
.nav-link { color: var(--muted); text-decoration: none; font-size: 12px; margin-left: auto; }
.nav-link:hover { color: var(--text); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 99px; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.pill.on .dot { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.pill.off .dot { background: var(--bad); }

/* board */
.board { max-width: 1400px; margin: 0 auto; padding: 16px; }
.board-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.board-head h1 { margin: 0; font-size: 22px; letter-spacing: .01em; }
.status { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.head-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vol { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.vol input { width: 110px; accent-color: var(--accent); }
.chip { font-size: 11px; color: var(--muted); padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 99px; cursor: pointer; }
.chip input { accent-color: var(--accent); margin: 0 4px 0 0; vertical-align: -1px; }
.btn { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 8px 14px; cursor: pointer; font-weight: 600; }
.btn:hover:not(:disabled) { border-color: var(--muted); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
.btn:focus-visible, .knob:focus-visible, .xf:focus-visible, .fader:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.toast { margin: 0 0 10px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; }
.toast.bad { border-color: var(--bad); color: var(--bad); }

.rig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 300px) minmax(0, 1fr); gap: 12px; align-items: stretch; }

/* decks */
.deck { --c: var(--deck-a); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; position: relative; }
.deck[data-letter="B"] { --c: var(--deck-b); }
.deck.live { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent) inset; }
.dk-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dk-letter { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font: 700 14px var(--mono); background: var(--c); color: var(--bg); flex: none; }
.dk-role { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.dk-sync { margin-left: auto; font-size: 10px; padding: 2px 7px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--dim); }
.dk-sync.on { color: var(--bg); background: var(--ok); border-color: var(--ok); }
.dk-sync.master { color: var(--bg); background: var(--accent); border-color: var(--accent); }
.dk-ovr { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: var(--bad); color: var(--bg); }
.dk-top { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px; align-items: center; }
.dk-cover { width: 76px; height: 76px; border-radius: 8px; background: var(--well) center/cover; border: 1px solid var(--line-2); }
.dk-title { font-weight: 700; font-size: 16px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.dk-sci { font-style: italic; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-read { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.dk-read div { background: var(--well); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; min-width: 0; }
.dk-read dt { font: 500 9px var(--mono); color: var(--dim); letter-spacing: .08em; }
.dk-read dd { margin: 0; font: 700 15px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-read dd.big { color: var(--c); }
.dk-zoom { width: 100%; height: 96px; display: block; background: var(--well); border-radius: 6px; border: 1px solid var(--line); }
.dk-ovw { width: 100%; height: 30px; display: block; background: var(--well); border-radius: 6px; border: 1px solid var(--line); }
.dk-foot { display: flex; align-items: center; gap: 10px; }
.dk-count { font: 600 12px var(--mono); color: var(--muted); white-space: nowrap; }
.dk-count b { color: var(--text); }
.vu-h { flex: 1; height: 10px; }

/* meters */
.vu { position: relative; background: var(--well); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.vu .rms { position: absolute; left: 0; bottom: 0; background: linear-gradient(90deg, var(--vu-lo) 0 70%, var(--vu-mid) 70% 88%, var(--vu-hi) 88%); }
.vu-h .rms { top: 0; width: 0; background-size: var(--vu-w, 100%) 100%; }
.vu-h .pk { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); left: 0; }
.vu-v { width: 14px; height: 150px; }
.vu-v .rms { right: 0; height: 0; background: linear-gradient(0deg, var(--vu-lo) 0 70%, var(--vu-mid) 70% 88%, var(--vu-hi) 88%); background-size: 100% 150px; background-position: bottom; }
.vu-v .pk { position: absolute; left: 0; right: 0; height: 2px; background: var(--text); bottom: 0; }

/* mixer */
.mixer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mx-chans { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.mx-chan { --c: var(--deck-a); display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.mx-chan[data-ch="B"] { --c: var(--deck-b); }
.mx-label { font-size: 10px; color: var(--dim); letter-spacing: .08em; }
.mx-chan .mx-label.ch { color: var(--c); font-weight: 700; font-size: 12px; }
.mx-val { font-size: 10px; color: var(--muted); min-height: 13px; white-space: nowrap; }
.mx-master { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 2px; }
.knob-cell { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.knob { --a: 0deg; width: 38px; height: 38px; border-radius: 50%; position: relative; background: radial-gradient(circle at 50% 40%, var(--panel-2), var(--well)); border: 1px solid var(--line-2); touch-action: none; }
.knob::before { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: conic-gradient(from 225deg, var(--c) 0 var(--fill, 0deg), transparent var(--fill, 0deg)); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); mask: radial-gradient(circle, transparent 58%, #000 60%); opacity: .9; }
.knob::after { content: ""; position: absolute; left: 50%; top: 4px; width: 2px; height: 13px; margin-left: -1px; background: var(--text); border-radius: 2px; transform-origin: 50% 15px; transform: rotate(var(--a)); }
.knob.ovr { border-color: var(--bad); }
body.admin .knob, body.admin .fader { cursor: ns-resize; }
.fader-row { display: flex; gap: 8px; align-items: flex-end; }
.fader { position: relative; width: 26px; height: 150px; background: var(--well); border: 1px solid var(--line); border-radius: 6px; touch-action: none; }
.fader::before { content: ""; position: absolute; left: 50%; top: 8px; bottom: 8px; width: 2px; margin-left: -1px; background: var(--line-2); }
.fader .cap { position: absolute; left: 2px; right: 2px; height: 16px; border-radius: 4px; background: var(--c); bottom: 0; box-shadow: 0 0 8px color-mix(in srgb, var(--c) 50%, transparent); }
.fader.ovr { border-color: var(--bad); }
.mx-auto { font-size: 10px; padding: 3px 7px; }
.xf-wrap { display: flex; align-items: center; gap: 8px; }
.xf-l { color: var(--deck-a); font-weight: 700; } .xf-r { color: var(--deck-b); font-weight: 700; }
.xf { flex: 1; position: relative; height: 26px; background: var(--well); border: 1px solid var(--line); border-radius: 6px; touch-action: none; }
.xf::before { content: ""; position: absolute; top: 50%; left: 8px; right: 8px; height: 2px; margin-top: -1px; background: var(--line-2); }
.xf-cap { position: absolute; top: 2px; bottom: 2px; width: 20px; margin-left: -10px; left: 50%; border-radius: 4px; background: linear-gradient(90deg, var(--deck-a), var(--deck-b)); }
body.admin .xf { cursor: ew-resize; }
.mx-note { margin: 0; font-size: 11px; color: var(--muted); text-align: center; min-height: 16px; }

/* queue */
.queue { margin-top: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.q-head h2 { margin: 0; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.q-pick { gap: 6px; align-items: center; flex: 1 1 260px; max-width: 460px; }
.q-pick input { flex: 1; min-width: 0; background: var(--well); border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 6px 10px; }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.q-list li { display: grid; grid-template-columns: 54px 36px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--r-sm); background: var(--well); border: 1px solid var(--line); }
.q-list li.cued { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.q-t { font: 700 13px var(--mono); color: var(--accent); }
.q-cv { width: 36px; height: 36px; border-radius: 5px; background: var(--panel-2) center/cover; }
.q-main { min-width: 0; }
.q-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-sub { font: 11px var(--mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-btns { display: flex; gap: 4px; }
.q-list li.dim { display: block; }

/* phone: stacked decks */
@media (max-width: 980px) {
  .rig { grid-template-columns: minmax(0, 1fr); }
  .mixer { order: 2; } #deck-A { order: 1; } #deck-B { order: 3; }
}
@media (max-width: 520px) {
  .board { padding: 12px 16px; }
  .dj-nav { gap: 10px; padding: 10px 16px; }
  .brand-name { font-size: 14px; }
  .dk-read { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dk-top { grid-template-columns: 60px minmax(0, 1fr); }
  .dk-cover { width: 60px; height: 60px; }
  .q-list li { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .q-cv { display: none; }
  .vu-v, .fader { height: 120px; }
  .vu-v .rms { background-size: 100% 120px; }
  .head-ctl { width: 100%; }
  .vol input { width: 90px; }
}

/* which set + holding state */
.set-tag { font-size: 11px; padding: 4px 9px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.set-tag.public { color: var(--bg); background: var(--ok); border-color: var(--ok); }
.chip[href] { text-decoration: none; }
.hold { display: flex; align-items: center; gap: 14px; margin: 0 0 12px; padding: 14px 16px; border-radius: var(--r); border: 1px dashed var(--line-2); background: var(--panel); }
.hold-disc { width: 34px; height: 34px; border-radius: 50%; flex: none; border: 3px solid var(--accent); border-right-color: transparent; animation: holdspin 2.4s linear infinite; }
@keyframes holdspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hold-disc { animation: none; } }
.hold-t { margin: 0; font-weight: 700; font-size: 16px; }
.hold-s { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
body.holding .deck, body.holding .mixer { opacity: .55; }
