/* DJ dashboard — "studio at night": ink navy, cool greys, one amber light. */
:root {
  --ink: #161a2b;
  --ink-2: #1e2338;
  --ink-3: #272d47;
  --line: #2f3654;
  --text: #eef0f8;
  --muted: #9aa3c2;
  --amber: #ffb547;
  --amber-ink: #2a1c05;
  --spotify: #3ad074;
  --youtube: #ff6b6b;
  --danger: #ff7a7a;
  --r-lg: 22px;
  --r-md: 12px;
  --r-sm: 8px;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
img:not([src]), img[src=""] { visibility: hidden; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink);
  color: var(--text);
  font: 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
h1, h2 { font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.muted { color: var(--muted); }
code { background: var(--ink-3); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
svg { fill: currentColor; }

/* ------------------------------------------------------------ layout -- */
.app { display: grid; grid-template-columns: 76px 1fr; min-height: 100vh; }
.shell { min-width: 0; display: flex; flex-direction: column; }

/* ------------------------------------------------------------ rail ---- */
.rail {
  position: sticky; top: 0; height: 100vh;
  background: #12152a;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 0; overflow-y: auto;
}
.rail-bot { width: 44px; height: 44px; border-radius: 50%; background: var(--ink-3); }
.rail-sep { width: 28px; height: 2px; border-radius: 2px; background: var(--line); margin: 2px 0; }
.guild-list { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.guild {
  position: relative; width: 48px; height: 48px; padding: 0; border: 0;
  border-radius: 50%; background: var(--ink-3) center/cover;
  font: 600 14px var(--body); color: var(--text);
  transition: border-radius .18s ease;
}
.guild:hover, .guild.active { border-radius: 16px; }
.guild::before {
  content: ""; position: absolute; left: -14px; top: 50%; width: 4px; height: 0;
  background: var(--text); border-radius: 0 4px 4px 0; transform: translateY(-50%);
  transition: height .18s ease;
}
.guild:hover::before { height: 18px; }
.guild.active::before { height: 36px; }
.guild.live::after {
  content: ""; position: absolute; right: -2px; bottom: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--amber); border: 3px solid #12152a;
}
.rail-add {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink-2); color: var(--amber); transition: border-radius .18s ease, background .18s;
}
.rail-add:hover { border-radius: 16px; background: var(--ink-3); }
.rail-add svg { width: 22px; height: 22px; }

/* ------------------------------------------------------------ top bar - */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px; border-bottom: 1px solid var(--line);
}
.top-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.top-title h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 3px 10px 3px 8px; border-radius: 99px; font-size: 13px;
  background: var(--ink-2); color: var(--muted); border: 1px solid var(--line);
}
.chip.on { color: var(--text); }
.chip.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.me { position: relative; }
.me-btn {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--ink-2);
}
.me-btn img { width: 30px; height: 30px; border-radius: 50%; }
.me-btn span { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.me-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 160px; z-index: 5;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px;
  box-shadow: 0 16px 40px rgba(5, 7, 20, .5);
}
.me-menu a { display: block; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; }
.me-menu a:hover { background: var(--ink-3); }

/* ------------------------------------------------------------ empty --- */
.empty { flex: 1; display: grid; place-content: center; justify-items: center; text-align: center; padding: 40px 24px; }
.empty h2 { font-size: 26px; margin-top: 28px; }
.empty p { color: var(--muted); margin: 6px 0 0; max-width: 42ch; }
.empty .record { width: 180px; }

/* ------------------------------------------------------------ stage --- */
.stage {
  display: grid; grid-template-columns: minmax(320px, 400px) 1fr; gap: 32px;
  padding: 28px 32px 48px; align-items: start;
}

/* the deck */
.deck {
  position: sticky; top: 24px;
  background: var(--ink-2); border-radius: var(--r-lg); padding: 28px;
  display: flex; flex-direction: column; gap: 20px;
}
.deck-turntable {
  background: radial-gradient(circle at 50% 45%, var(--ink-3), #191d31 70%);
  border-radius: 18px; padding: 26px; display: grid; place-items: center;
}

/* the record — the one memorable thing */
.record {
  width: 100%; max-width: 280px; aspect-ratio: 1; border-radius: 50%; position: relative;
  background:
    radial-gradient(circle, transparent 0 33%, rgba(255,255,255,.035) 33.5% 34%, transparent 34.5%),
    repeating-radial-gradient(circle, #0c0e18 0 2px, #141726 2px 3px),
    #0c0e18;
  box-shadow: 0 18px 40px rgba(4, 6, 18, .55), inset 0 0 0 2px #090b14;
  display: grid; place-items: center;
}
.record::after {
  /* light catching the grooves */
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 30deg, transparent 0 12%, rgba(255,255,255,.07) 16%, transparent 22% 62%, rgba(255,255,255,.05) 66%, transparent 72%);
  pointer-events: none;
}
.record-label {
  width: 38%; aspect-ratio: 1; border-radius: 50%; position: relative;
  background: var(--amber) center/cover;
  box-shadow: 0 0 0 4px #0c0e18;
}
.record-label::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 9%; aspect-ratio: 1;
  border-radius: 50%; background: var(--ink-2); transform: translate(-50%, -50%);
}
.record.spinning { animation: spin 3.2s linear infinite; }
.record.spinning.paused { animation-play-state: paused; }
.record-idle .record-label { background: var(--ink-3); }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .record.spinning { animation: none; } }

.deck-info { min-width: 0; text-align: center; }
.np-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 700 21px/1.25 var(--display); text-decoration: none; letter-spacing: -0.01em;
}
.np-title[href]:hover { text-decoration: underline; text-underline-offset: 3px; }
.np-meta { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.src { font-weight: 600; }
.src.spotify { color: var(--spotify); }
.src.youtube { color: var(--youtube); }

.timeline .bar { height: 6px; background: var(--ink-3); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--amber); border-radius: 99px; transition: width 1s linear; }
.times { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

.transport { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.loop { display: inline-flex; background: var(--ink-3); border-radius: 99px; padding: 3px; justify-self: start; }
.loop button { border: 0; background: none; padding: 5px 10px; border-radius: 99px; color: var(--muted); font-size: 13px; font-weight: 500; }
.loop button[aria-checked="true"] { background: var(--text); color: var(--ink); }
.play {
  width: 64px; height: 64px; border-radius: 50%; border: 0;
  background: var(--amber); color: var(--amber-ink); display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(255, 181, 71, .28);
  transition: transform .12s ease;
}
.play:active:not(:disabled) { transform: scale(.95); }
.play svg { width: 26px; height: 26px; }
.play:disabled { background: var(--ink-3); color: var(--muted); box-shadow: none; }
.ctl {
  justify-self: start; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: var(--ink-3); display: grid; place-items: center;
}
.ctl svg { width: 20px; height: 20px; }
.ctl:hover:not(:disabled) { background: var(--line); }
.ctl:disabled { opacity: .4; }

.voice { border-top: 1px solid var(--line); padding-top: 18px; }
.voice-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.voice-row { display: flex; gap: 8px; }
select {
  flex: 1; min-width: 0; appearance: none;
  background: var(--ink-3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%239aa3c2'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 8px center/20px;
  border: 1px solid transparent; border-radius: var(--r-md); padding: 9px 34px 9px 12px;
}

.btn {
  border: 0; border-radius: var(--r-md); padding: 9px 16px; font-weight: 600;
  background: var(--amber); color: var(--amber-ink); white-space: nowrap;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: .45; }
.btn-quiet { background: var(--ink-3); color: var(--text); }
.btn-quiet:hover:not(:disabled) { background: var(--line); filter: none; }

/* the list */
.list { min-width: 0; }
.add {
  display: flex; align-items: center; gap: 8px; position: relative;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 16px; padding: 6px 6px 6px 44px;
}
.add:focus-within { border-color: var(--amber); }
.add-icon { position: absolute; left: 14px; width: 20px; height: 20px; color: var(--muted); }
.add input { flex: 1; min-width: 0; border: 0; background: none; padding: 8px 0; outline: none; }
.add input::placeholder { color: var(--muted); }

.list-head { display: flex; align-items: center; justify-content: space-between; margin: 28px 0 10px; gap: 12px; }
.list-head h2 { font-size: 20px; }
#queue-count { color: var(--muted); font: 500 15px var(--body); margin-left: 4px; }
.list-tools { display: flex; gap: 8px; }

.queue { list-style: none; margin: 0; padding: 0; }
.row {
  display: grid; grid-template-columns: 26px 48px 1fr auto; gap: 14px; align-items: center;
  padding: 8px 10px; border-radius: var(--r-md);
}
.row:hover, .row:focus-within { background: var(--ink-2); }
.row.dragging { opacity: .35; }
.row.drop { box-shadow: inset 0 2px 0 var(--amber); }
.row-pos { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; cursor: grab; font-size: 14px; }
.row-art { width: 48px; height: 48px; border-radius: var(--r-sm); background: var(--ink-3) center/cover; }
.row-main { min-width: 0; }
.row-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.row-title a { text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.row-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-end { display: flex; align-items: center; gap: 2px; }
.row-dur { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; width: 48px; text-align: right; margin-right: 6px; }
.row-btn {
  width: 32px; height: 32px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--muted); display: grid; place-items: center; opacity: 0;
}
.row:hover .row-btn, .row:focus-within .row-btn { opacity: 1; }
.row-btn:hover { background: var(--ink-3); color: var(--text); }
.row-btn.danger:hover { color: var(--danger); }
.row-btn svg { width: 18px; height: 18px; }
.queue-empty { padding: 36px 10px; color: var(--text); }
.queue-empty p { margin: 0 0 4px; }

/* ------------------------------------------------------------ toast --- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 10; max-width: min(520px, 90vw);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--ink); font-weight: 500;
  padding: 10px 16px; border-radius: var(--r-md); transition: .18s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--danger); color: #2b0606; }

/* ------------------------------------------------------------ small --- */
@media (max-width: 980px) {
  .stage { grid-template-columns: minmax(0, 1fr); padding: 20px; gap: 24px; }
  .deck { position: static; }
  .deck-turntable { padding: 18px; }
  .record { max-width: 220px; }
}
@media (max-width: 640px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .app > * { min-width: 0; }
  .rail { position: sticky; top: 0; z-index: 4; height: auto; flex-direction: row; padding: 10px 12px; overflow-x: auto; }
  .guild-list { flex-direction: row; }
  .guild::before { display: none; }
  .rail-sep { width: 2px; height: 28px; }
  .rail-bot { width: 38px; height: 38px; }
  .guild, .rail-add { width: 42px; height: 42px; flex: none; }
  .top { padding: 14px 20px; }
  .top-title { flex-direction: column; align-items: flex-start; gap: 4px; }
  .me-btn span { display: none; }
  .me-btn { padding: 4px; }
  .row { grid-template-columns: 40px 1fr auto; }
  .row-pos, .row-dur { display: none; }
  .row-art { width: 40px; height: 40px; }
  .row-btn { opacity: 1; }
  .row-btn.extra { display: none; }
  .transport { grid-template-columns: 1fr auto 1fr; }
}
