/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --navy:   #0a0a38;
  --panel:  #111128;
  --accent: #f5a200;
  --text:   #ffffff;
  --muted:  #6666aa;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 8px;
  --thumb:  40px;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--navy);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  height: 100vh;
  overflow: hidden;
}

/* ── App shell ────────────────────────────────────────────────────────────── */
.sc-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── Left panel ───────────────────────────────────────────────────────────── */
.sc-left {
  width: 190px;
  min-width: 170px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--border);
  padding: 12px 8px 8px;
  overflow: hidden;
}

.sc-name-slot {
  height: 24px;
  flex-shrink: 0;
}

.sc-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.sc-section-header {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--text);
  display: inline-block;
  padding: 2px 6px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.sc-track-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
  margin-bottom: 6px;
}

.sc-track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: default;
  flex-shrink: 0;
}

.sc-track-thumb {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: rgba(255,255,255,0.08);
}

.sc-track-thumb-empty {
  width: var(--thumb);
  height: var(--thumb);
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sc-track-name-wrap {
  overflow: hidden;
}

.sc-track-name {
  font-size: 0.78rem;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sc-track-artist {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sc-btn-clear {
  align-self: flex-end;
  background: none;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}

.sc-btn-clear:hover { border-color: var(--text); color: var(--text); }

/* ── Centre panel ─────────────────────────────────────────────────────────── */
.sc-centre {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 16px 12px;
  gap: 10px;
  overflow: hidden;
}

/* Search */
.sc-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sc-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex: 1;
}

.sc-search-icon {
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.sc-search-input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.88rem;
  padding: 8px 0;
  outline: none;
  min-width: 0;
}

.sc-search-input::placeholder { color: var(--muted); }

.sc-btn-arrow {
  background: #5865f2;
  border: none;
  color: #fff;
  font-size: 1.35rem;
  padding: 6px 10px;
  border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s;
}

.sc-btn-arrow:hover { background: #4752c4; }

.sc-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1a1a45;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 200;
  max-height: 300px;
  overflow-y: auto;
}

.sc-search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.sc-search-result-item:hover,
.sc-search-result-item.selected { background: rgba(255,255,255,0.07); }

.sc-search-result-item img {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.sc-search-result-track  { font-size: 0.84rem; display: block; }
.sc-search-result-artist { font-size: 0.72rem; color: var(--muted); }

.sc-btn-queue {
  background: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--text);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.sc-btn-queue:not([disabled]):hover {
  background: rgba(255,255,255,0.07);
  border-color: var(--accent);
}

.sc-btn-queue[disabled] { opacity: 0.35; cursor: default; }

/* Song title */
.sc-song-title {
  font-size: clamp(1.1rem, 2.2vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  flex-shrink: 0;
}

/* Artwork */
.sc-artwork-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
}

.sc-artwork {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 6px;
  display: none;
}

.sc-artwork.loaded { display: block; }

.sc-artwork-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  font-size: 5rem;
  color: var(--muted);
}

/* Track info box */
.sc-info-box {
  flex-shrink: 0;
  height: 140px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.8rem;
  line-height: 1.65;
}

.sc-info-label { color: var(--muted); }
.sc-info-value { color: var(--text); }

/* ── Right panel ──────────────────────────────────────────────────────────── */
.sc-right {
  width: 220px;
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-left: 1px solid var(--border);
  padding: 14px 12px 12px;
}

.sc-playlist-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.sc-playlist-label {
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-playlist-label.active { color: var(--text); border-color: rgba(255,255,255,0.3); }

.sc-btn-playlist {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
  align-self: flex-start;
}

.sc-btn-playlist:hover { border-color: var(--accent); color: var(--accent); }

.sc-right-spacer { flex: 1; min-height: 16px; max-height: 80px; }

/* Transport */
.sc-transport {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

.sc-progress-row,
.sc-volume-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sc-time {
  font-size: 0.68rem;
  color: var(--muted);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* Shared range style */
.sc-range {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.sc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
}

.sc-range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}

/* Controls */
.sc-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

.sc-ctrl {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 1.1rem;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s;
  display: flex;
  align-items: center;
}

.sc-ctrl:hover { color: var(--text); }

.sc-ctrl-play { font-size: 2.4rem; color: var(--accent); padding: 0; }
.sc-ctrl-play:hover { color: #ffbe00; }

.sc-ctrl-toggle.active { color: var(--accent); }

/* MusicBrainz box */
.sc-mb-box {
  flex: 1;
  min-height: 0;
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 0.77rem;
  line-height: 1.6;
}

.sc-mb-box strong {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  display: block;
  margin-top: 8px;
  margin-bottom: 2px;
}

.sc-mb-box strong:first-child { margin-top: 0; }

/* ── Shared utilities ─────────────────────────────────────────────────────── */
.sc-scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}

.sc-scrollable::-webkit-scrollbar       { width: 4px; }
.sc-scrollable::-webkit-scrollbar-track { background: transparent; }
.sc-scrollable::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.sc-empty {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}

/* ── Playlist modal ───────────────────────────────────────────────────────── */
.sc-modal-content {
  background: #1a1a45;
  border: 1px solid var(--border);
  color: var(--text);
}

.sc-modal-content .modal-header {
  border-bottom: 1px solid var(--border);
}

.sc-playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s;
}

.sc-playlist-item:hover { background: rgba(255,255,255,0.07); }

.sc-playlist-item img {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.sc-playlist-item-empty {
  width: 44px;
  height: 44px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sc-playlist-item-name  { font-size: 0.86rem; }
.sc-playlist-item-count { font-size: 0.72rem; color: var(--muted); }
