.audio-player {
  --player-bg: #1e1e2e;
  --player-fg: #e6e6f0;
  --player-accent: #7c6cf2;
  --player-track: #3a3a52;
  --progress: 0%;

  max-width: 420px;
  padding: 1.5rem;
  border-radius: 12px;
  background: var(--player-bg);
  color: var(--player-fg);
  font-family: system-ui, sans-serif;
}

.player-info {
  text-align: center;
  margin-bottom: 1rem;
}

.track-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.track-artist {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  opacity: 0.7;
}

.player-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.btn:hover {
  background: var(--player-track);
}

.btn:focus-visible {
  outline: 2px solid var(--player-accent);
  outline-offset: 2px;
}

.btn-play {
  width: 56px;
  height: 56px;
  background: var(--player-accent);
  color: #fff;
}

.btn-play:hover {
  background: var(--player-accent);
  filter: brightness(1.1);
}

.btn-small {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.player-progress,
.player-volume {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.player-volume {
  margin-top: 0.75rem;
}

.time {
  min-width: 3ch;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.range {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(
    to right,
    var(--player-accent) var(--progress),
    var(--player-track) var(--progress)
  );
  appearance: none;
  cursor: pointer;
}

/* Cursore per browser basati su WebKit/Blink */
.range::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  appearance: none;
  transition: transform 0.15s;
}

.range:hover::-webkit-slider-thumb {
  transform: scale(1.2);
}

/* Cursore per Firefox */
.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: none;
  border-radius: 50%;
  background: #fff;
}

.range:focus-visible {
  outline: 2px solid var(--player-accent);
  outline-offset: 4px;
}

.playlist {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--player-track);
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0.5rem;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
}

.playlist-item:hover {
  background: var(--player-track);
}

.playlist-item.is-active {
  color: var(--player-accent);
  font-weight: 600;
}