#music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #0d0d12;
  border-top: 1px solid #2a2a3a;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.8);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1rem;
  z-index: 9999;
  font-family: 'Courier New', Courier, monospace;
}

/* ── Controls ── */
#player-controls {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border: 1px solid #2a2a3a;
}

.player-btn {
  background: #14141c;
  border: none;
  color: #888;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 0.3rem 0.55rem;
  transition: color 0.15s, background 0.15s;
  user-select: none;
  flex-shrink: 0;
  line-height: 1;
}
.player-btn + .player-btn { border-left: 1px solid #2a2a3a; }
.player-btn:hover:not(:disabled) { color: #ffd700; background: #1a1a0a; }
.player-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.player-btn.active { color: #ffd700; background: #1a1a0a; text-shadow: 0 0 8px #ffd70055; }

/* solo buttons outside the controls group */
#player-list-btn,
#player-mute-btn {
  border: 1px solid #2a2a3a;
}
#player-list-btn { margin-left: 0.25rem; }
#player-mute-btn { margin-left: 0.25rem; }

/* ── Separator ── */
.player-sep {
  width: 1px;
  height: 22px;
  background: #2a2a3a;
  flex-shrink: 0;
}

/* ── Track name (scrolling marquee) ── */
#player-track-name {
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
  max-width: 200px;
}
#player-track-inner {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #666;
  transition: color 0.3s;
}
#player-track-name.playing #player-track-inner {
  color: #ffd700;
  text-shadow: 0 0 10px #ffd70033;
}
#player-track-name.scrolling #player-track-inner {
  animation: track-marquee linear infinite;
}
@keyframes track-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (max-width: 560px) { #player-track-name { max-width: 90px; } }

/* ── Waveform ── */
#waveform-canvas {
  flex: 1;
  height: 34px;
  display: block;
  min-width: 0;
}

/* ── Right cluster ── */
#player-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
}

/* ── Track list popup ── */
#player-tracklist {
  display: none;
  position: absolute;
  bottom: 54px;
  right: 0;
  background: #0d0d12;
  border: 1px solid #2a2a3a;
  border-left: 3px solid #ffd70033;
  min-width: 240px;
  max-width: 340px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 10000;
  box-shadow: -4px -4px 24px rgba(0,0,0,0.8);
}
#player-tracklist::-webkit-scrollbar       { width: 4px; }
#player-tracklist::-webkit-scrollbar-track { background: #0d0d12; }
#player-tracklist::-webkit-scrollbar-thumb { background: #2a2a3a; }

.ptl-header {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: #ffd700;
  padding: 0.5rem 0.85rem 0.35rem;
  border-bottom: 1px solid #1e1e2a;
}
.ptl-item {
  padding: 0.45rem 0.85rem;
  font-size: 0.74rem;
  color: #666;
  cursor: pointer;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid #131318;
  font-family: 'Courier New', Courier, monospace;
  transition: color 0.1s, background 0.1s;
}
.ptl-item:last-child      { border-bottom: none; }
.ptl-item:hover           { color: #ccc; background: #111116; }
.ptl-item.ptl-active      { color: #ffd700; background: #15150a; }
.ptl-item.ptl-empty       { color: #333; cursor: default; font-style: italic; }
.ptl-item.ptl-empty:hover { background: none; color: #333; }

/* ── Scrub bar ── */
#player-scrub-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.7rem 0.45rem;
  border-bottom: 1px solid #1e1e2a;
  background: #0a0a0f;
}
#player-time-cur,
#player-time-dur {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: #555;
  flex-shrink: 0;
  font-family: 'Courier New', Courier, monospace;
  min-width: 2.4em;
}
#player-time-cur { text-align: right; }
#player-time-dur { text-align: left; }
#player-scrub {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: #2a2a3a;
  outline: none;
  cursor: pointer;
  border-radius: 0;
}
#player-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  background: #ffd700;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 0 6px #ffd70066;
}
#player-scrub::-moz-range-thumb {
  width: 10px;
  height: 10px;
  background: #ffd700;
  border: none;
  border-radius: 0;
  cursor: pointer;
  box-shadow: 0 0 6px #ffd70066;
}
#player-scrub::-webkit-slider-runnable-track { background: #2a2a3a; }
#player-scrub::-moz-range-track              { background: #2a2a3a; }
