/* Player popup acionado pelo vinil */
.vinyl-player {
  --vinyl-size: 68px;
  --popup-width: min(78vw, 330px);
  --player-gap: 12px;
  --player-slide: calc(var(--popup-width) + var(--player-gap));
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 4000;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--player-gap);
  transform: translateX(var(--player-slide));
  transition: transform 360ms cubic-bezier(0.23, 1, 0.32, 1);
  will-change: transform;
}

.vinyl-player.is-open {
  transform: translateX(0);
}

.vinyl-toggle {
  width: var(--vinyl-size);
  height: var(--vinyl-size);
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.vinyl-toggle:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

.vinyl-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  animation: vinyl-spin 2.2s linear infinite;
  animation-play-state: paused;
}

.vinyl-player.is-playing .vinyl-image {
  animation-play-state: running;
}

.vinyl-popup {
  width: var(--popup-width);
  opacity: 0;
  transform: translateX(calc(100% + var(--player-gap))) scale(1);
  pointer-events: none;
  background: rgba(14, 14, 14, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  backdrop-filter: blur(8px);
  transition: opacity 360ms ease, transform 360ms cubic-bezier(0.23, 1, 0.32, 1);
}

.vinyl-player.is-open .vinyl-popup {
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.vinyl-title-wrap {
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 8px 10px;
  margin-bottom: 10px;
}

.vinyl-title-track {
  width: max-content;
  max-width: none;
}

.vinyl-title {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.94);
  white-space: nowrap;
}

.vinyl-title-track.is-marquee {
  animation: player-marquee var(--marquee-duration, 11s) linear infinite;
}

.vinyl-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.player-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
  color: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, transform 160ms ease, box-shadow 180ms ease;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.28);
}

.player-btn:hover {
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.14));
  transform: translateY(-1px);
}

.player-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.player-btn-main {
  background: radial-gradient(circle at 30% 20%, rgba(255, 180, 223, 0.5), rgba(233, 30, 140, 0.32));
  border-color: rgba(255, 220, 244, 0.55);
}

.player-btn-icon {
  font-size: 1.15rem;
  line-height: 1;
}

@keyframes vinyl-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes player-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(var(--marquee-distance, 0px) * -1));
  }
}

@media (max-width: 680px) {
  .vinyl-player {
    --vinyl-size: 60px;
    --popup-width: min(82vw, 300px);
    top: 10px;
    right: 10px;
  }
}
