/* ── Variables ───────────────────────────────────────────────────────────── */
:root {
  --bg:        #080808;
  --sidebar:   #0c0c0c;
  --surface:   #111;
  --surface2:  #181818;
  --border:    #1c1c1c;
  --border2:   #252525;
  --text:      #dedad4;
  --muted:     #3a3a3a;
  --muted2:    #555;
  --accent:    #e8e4dc;
  --accent2:   #fff;
  --playing:   #c8f04a;
  --mono:      'DM Mono', monospace;
  --sans:      'DM Sans', sans-serif;
  --bar-h:     76px;
  --sidebar-w: 280px;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
}

/* ── Layout ──────────────────────────────────────────────────────────────── */
.app {
  display: flex;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - var(--bar-h));
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--playing);
}

.song-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted2);
  margin-top: 4px;
  letter-spacing: 0.06em;
}

.song-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.song-list::-webkit-scrollbar { width: 2px; }
.song-list::-webkit-scrollbar-track { background: transparent; }
.song-list::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.12s;
  border-left: 2px solid transparent;
  position: relative;
}

.song-item:hover { background: var(--surface); }

.song-item.active {
  background: var(--surface);
  border-left-color: var(--playing);
}

.song-num {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted2);
  width: 18px;
  text-align: right;
  flex-shrink: 0;
  transition: opacity 0.15s;
}

.song-item.active .song-num,
.song-item:hover .song-num { opacity: 0; }

.song-item.active .song-playing-dot,
.song-item:hover .song-play-icon { display: flex; }

.song-play-icon,
.song-playing-dot {
  position: absolute;
  left: 20px;
  width: 18px;
  display: none;
  align-items: center;
  justify-content: flex-end;
}

.song-play-icon { font-size: 9px; color: var(--muted2); }

.song-playing-dot { gap: 2px; }

.song-playing-dot span {
  display: block;
  width: 2px;
  background: var(--playing);
  border-radius: 1px;
  animation: eq 0.8s ease-in-out infinite alternate;
}

.song-playing-dot span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.song-playing-dot span:nth-child(2) { height: 10px; animation-delay: 0.2s; }
.song-playing-dot span:nth-child(3) { height: 4px;  animation-delay: 0.4s; }

.paused .song-playing-dot span { animation-play-state: paused; }

@keyframes eq {
  from { transform: scaleY(0.4); }
  to   { transform: scaleY(1); }
}

.song-info { flex: 1; min-width: 0; }

.song-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.song-item.active .song-title { color: var(--accent2); }

.song-artist {
  font-size: 11px;
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.song-dur {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  flex-shrink: 0;
}

/* ── Main area ───────────────────────────────────────────────────────────── */
.main {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.main-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 40% 50%, #0f0f0f 0%, var(--bg) 70%);
}

.now-playing-center {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.now-playing-center.visible { opacity: 1; }

.center-art {
  width: 200px;
  height: 200px;
  margin: 0 auto 28px;
  border-radius: 4px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.center-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.center-art-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.center-art-placeholder svg {
  width: 48px;
  height: 48px;
  opacity: 0.15;
}

.center-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--accent2);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.center-artist {
  font-size: 13px;
  color: var(--muted2);
  font-weight: 400;
}

.center-album {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.idle-state {
  position: relative;
  z-index: 1;
  text-align: center;
}

.idle-state .big-logo {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Player bar ──────────────────────────────────────────────────────────── */
.player-bar {
  height: var(--bar-h);
  background: var(--sidebar);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 220px;
  flex-shrink: 0;
}

.player-art {
  width: 44px;
  height: 44px;
  border-radius: 3px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-art img { width: 100%; height: 100%; object-fit: cover; }
.player-art svg { width: 16px; height: 16px; opacity: 0.2; }

.player-meta { min-width: 0; }

.player-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-size: 11px;
  color: var(--muted2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.controls {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ctrl-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted2);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, transform 0.1s;
  border-radius: 50%;
}

.ctrl-btn:hover { color: var(--text); }
.ctrl-btn:active { transform: scale(0.92); }
.ctrl-btn svg { display: block; }

.play-btn {
  width: 34px;
  height: 34px;
  background: var(--accent2);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform 0.12s, background 0.12s;
  flex-shrink: 0;
}

.play-btn:hover { transform: scale(1.06); background: var(--accent); }
.play-btn:active { transform: scale(0.96); }
.play-btn svg { display: block; }

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 500px;
}

.time {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted2);
  flex-shrink: 0;
  width: 34px;
  letter-spacing: 0.02em;
}

.time.right { text-align: right; }

.progress-track {
  flex: 1;
  height: 3px;
  background: var(--border2);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  overflow: visible;
}

.progress-fill {
  height: 100%;
  background: var(--accent2);
  border-radius: 99px;
  width: 0%;
  position: relative;
  pointer-events: none;
  transition: width 0.1s linear;
}

.progress-thumb {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 10px;
  height: 10px;
  background: var(--accent2);
  border-radius: 50%;
  transition: transform 0.15s;
  pointer-events: none;
}

.progress-track:hover .progress-thumb { transform: translateY(-50%) scale(1); }
.progress-track:hover .progress-fill  { background: var(--playing); }

.player-right {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 140px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.vol-icon { color: var(--muted2); }
.vol-icon svg { display: block; }

.volume-track {
  width: 72px;
  height: 3px;
  background: var(--border2);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
}

.volume-fill {
  height: 100%;
  background: var(--muted2);
  border-radius: 99px;
  width: 80%;
  transition: background 0.15s;
}

.volume-track:hover .volume-fill { background: var(--accent2); }

/* ── States ──────────────────────────────────────────────────────────────── */
.loading {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted2);
  letter-spacing: 0.06em;
  padding: 20px;
  animation: blink 1.2s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: var(--border2) transparent; }
