/* RESET */
* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, sans-serif;
}

body {
  margin: 0;
  background: #0b0b0b;
  color: white;
}

/* PLAYER WRAPPER */
.player {
  max-width: 420px;
  margin: 0 auto;
  padding-bottom: 24px;
}

/* COVER */
.cover {
  width: calc(100% - 32px);
  margin: 16px;
  border-radius: 16px;
}

/* PLAYER BAR (STICKY ONCE IT HITS TOP) */
.player-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0b0b0b;
  padding: 8px 16px 12px;
}

/* INFO */
.info h1 {
  margin: 8px 0 2px;
  font-size: 1.35rem;
}

.meta-mask {
  height: 18px;
  overflow: hidden;
}

.meta-track {
  white-space: nowrap;
  color: #b3b3b3;
  font-size: 0.9rem;
}

/* PROGRESS */
.progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

#current,
#duration {
  font-size: 0.75rem;
  color: #b3b3b3;
}

.bar-wrapper {
  flex: 1;
}

#seek {
  --progress: 0%;
  width: 100%;
  appearance: none;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(
    to right,
    white var(--progress),
    #535353 var(--progress)
  );
}

/* Desktop hover → green */
@media (pointer: fine) {
  #seek:hover {
    background: linear-gradient(
      to right,
      #1db954 var(--progress),
      #535353 var(--progress)
    );
  }
}

/* Thumb */
#seek::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
}

/* Desktop thumb on hover only */
@media (pointer: fine) {
  #seek::-webkit-slider-thumb {
    opacity: 0;
  }
  .bar-wrapper:hover #seek::-webkit-slider-thumb {
    opacity: 1;
  }
}

/* TRANSPORT */
.transport {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin: 20px 0 18px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
}

.icon-btn svg {
  width: 100%;
  height: 100%;
  fill: white;
}

.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: white;
}

.play-btn svg {
  width: 34px;
  height: 34px;
  fill: black;
}

/* A/B */
.ab-toggle {
  display: flex;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}

.ab-option {
  flex: 1;
  padding: 8px 0;
  font-size: 0.75rem;
  border: none;
  background: none;
  color: #b3b3b3;
}

.ab-option.active {
  background: #1db954;
  color: black;
}

/* PLAYLIST */
.playlist {
  padding: 0 16px;
  margin-top: 8px;
}

.track {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #222;
  cursor: pointer;
}

.track img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
}

/* WAVEFORM */
.wave {
  width: 14px;
  display: none;
  align-items: center;
  gap: 2px;
}

.wave span {
  width: 3px;
  background: #1db954;
  border-radius: 2px;
}

.track.active .wave {
  display: flex;
}

.track.playing .wave span:nth-child(1) { animation: wave1 0.9s infinite; }
.track.playing .wave span:nth-child(2) { animation: wave2 1.1s infinite; }
.track.playing .wave span:nth-child(3) { animation: wave3 0.8s infinite; }

.track.active:not(.playing) .wave span {
  height: 4px;
}

@keyframes wave1 { 0%,100%{height:6px} 50%{height:16px} }
@keyframes wave2 { 0%,100%{height:10px} 50%{height:20px} }
@keyframes wave3 { 0%,100%{height:7px} 50%{height:14px} }

/* TEXT */
.track-text {
  display: flex;
  flex-direction: column;
}

.track-title {
  font-size: 1.05rem;
  line-height: 1.1;
}

.track-meta {
  font-size: 0.85rem;
  color: #b3b3b3;
}

.track.active .track-title {
  color: #1db954;
}
