:root {
  --bg-base: #121110;
  --bg-panel: #1c1b1a;
  --bg-panel-raised: #232220;
  --line: #322f2c;
  --text: #ede7dd;
  --text-muted: #8a8377;
  --amber: #f2a93b;
  --amber-dim: #8a641f;
  --teal: #46c2b0;
  --danger: #d9614f;
  --radius: 10px;
  --font-display: 'Oswald', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg-base);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(242,169,59,0.04), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(70,194,176,0.05), transparent 40%);
  color: var(--text);
  font-family: var(--font-body);
}

.hidden { display: none !important; }
.mono { font-family: var(--font-mono); }

/* ---------- Lock screen ---------- */
.lock-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lock-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: min(90vw, 340px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.lock-label {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 22px;
  color: var(--amber);
}
.lock-sub {
  color: var(--text-muted);
  font-size: 13px;
  margin: 8px 0 24px;
}
.lock-panel input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg-base);
  color: var(--text);
  font-family: var(--font-mono);
  text-align: center;
  letter-spacing: 0.2em;
}
.lock-panel button {
  margin-top: 14px;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  border: none;
  background: var(--amber);
  color: #211705;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
}
.lock-panel button:hover { filter: brightness(1.08); }
.lock-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 12px;
  min-height: 14px;
}

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}
.brand-sub { color: var(--text-muted); font-family: var(--font-body); font-weight: 400; letter-spacing: 0; font-size: 12px; }

.conn-status { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.dot.online { background: var(--teal); box-shadow: 0 0 6px var(--teal); }

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  padding: 28px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Deck ---------- */
.deck {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  gap: 32px;
  align-items: center;
}
@media (max-width: 640px) {
  .deck { flex-direction: column; text-align: center; }
}

.deck-art-wrap { flex-shrink: 0; }
.vinyl {
  width: 160px; height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #2a2825 0%, #17110a 70%, #0d0a07 100%);
  border: 6px solid #0d0c0b;
  position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  animation: spin 8s linear infinite;
  animation-play-state: paused;
}
.vinyl.spinning { animation-play-state: running; }
.art-img { width: 68%; height: 68%; border-radius: 50%; object-fit: cover; background: #2a2825; }
.vinyl-hole { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--bg-base); border: 2px solid #444; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.deck-info { flex: 1; min-width: 0; }
.track-title { font-family: var(--font-display); font-size: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-author { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

.scrubber { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.time { font-size: 12px; color: var(--text-muted); width: 38px; }
.scrub-track { flex: 1; height: 4px; background: var(--line); border-radius: 4px; position: relative; cursor: pointer; }
.scrub-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: var(--amber); border-radius: 4px; }
.scrub-handle { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--amber); transform: translate(-50%, -50%); left: 0%; box-shadow: 0 0 6px rgba(242,169,59,0.6); }

.transport { display: flex; align-items: center; gap: 10px; }
.tbtn {
  border: 1px solid var(--line);
  background: var(--bg-panel-raised);
  color: var(--text);
  border-radius: 8px;
  width: 42px; height: 42px;
  cursor: pointer;
  font-size: 15px;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.tbtn:hover { filter: brightness(1.15); }
.tbtn:active { transform: scale(0.94); }
.tbtn.primary { background: var(--amber); color: #211705; border: none; width: 52px; height: 52px; font-size: 18px; }
.tbtn.ghost.active { color: var(--teal); border-color: var(--teal); }

.vu-row { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; gap: 20px; }
.vu-meter { display: flex; align-items: flex-end; gap: 3px; height: 20px; }
.vu-meter span { width: 4px; height: 30%; background: var(--line); border-radius: 1px; transition: background 0.2s; }
.vu-meter.active span { background: var(--teal); animation: vu 0.9s ease-in-out infinite; }
.vu-meter.active span:nth-child(2n) { animation-delay: 0.15s; }
.vu-meter.active span:nth-child(3n) { animation-delay: 0.3s; }
.vu-meter.active span:nth-child(4n) { animation-delay: 0.45s; background: var(--amber); }
@keyframes vu { 0%, 100% { height: 20%; } 50% { height: 90%; } }

.volume-control { display: flex; align-items: center; gap: 10px; }
.volume-control input[type="range"] { width: 100px; accent-color: var(--amber); }
#volume-label { width: 26px; color: var(--text-muted); font-size: 12px; }

/* ---------- Sidebar / Queue ---------- */
.sidebar {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}
.search-box { display: flex; gap: 8px; }
.search-box input {
  flex: 1;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
}
.search-box button {
  border: none;
  background: var(--teal);
  color: #082622;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.search-results { margin-top: 8px; }
.search-results .sr-item {
  padding: 8px 6px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}
.search-results .sr-item:hover { background: var(--bg-panel-raised); color: var(--text); }

.queue-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: 12px;
  color: var(--text-muted);
  margin: 20px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.queue-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.queue-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-radius: 6px;
  font-size: 13px;
}
.queue-list li:hover { background: var(--bg-panel-raised); }
.queue-index { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; width: 16px; }
.queue-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-remove { color: var(--text-muted); background: none; border: none; cursor: pointer; font-size: 14px; }
.queue-remove:hover { color: var(--danger); }
.queue-empty { color: var(--text-muted); font-size: 13px; padding: 20px 6px; text-align: center; }
