/* Caja de vinilo, reproductor de música y mini reproductor
   (archivo: css/components/music-player.css) */
/* ============================================================
   CAJA DE VINILO (debajo de las estadísticas del guante)
   ============================================================ */
#glove-vinyl-wrap { margin-top: 6px; }

#glove-vinyl-box {
  position: relative;
  height: 96px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

/* El disco asoma desde detrás de la caja, ya visible por defecto.
   Se posiciona respecto al centro del box y se desplaza una cantidad fija
   en px (no en % de su propio tamaño) para que sobresalga de verdad por
   fuera del borde izquierdo de la caja. */
#glove-vinyl-disc {
  position: absolute;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  margin-left: -39px;  /* mitad del ancho, para centrar el cálculo en translateX */
  margin-top: -39px;   /* mitad de la altura */
  transform: translateX(-34px);
  background:
    radial-gradient(circle at center, var(--yellow-bright) 0 6px, #0a0a0a 7px 9px, #3a3a3a 10px 100%),
    repeating-radial-gradient(circle at center, #444 0 2px, #2a2a2a 2px 4px);
  border: 2px solid #555;
  box-shadow: 0 0 14px rgba(0,0,0,0.7), 0 0 0 2px rgba(255,215,0,0.15);
  transition: transform .25s ease;
  z-index: 1;
}
#glove-vinyl-box:hover #glove-vinyl-disc { transform: translateX(-44px); }

/* La caja (con el banner del guante) cubre la mayor parte del disco, pero
   descentrada hacia la derecha para que el disco asome por la izquierda. */
#glove-vinyl-case {
  position: relative;
  width: 130px;
  height: 86px;
  margin-left: 22px;
  border-radius: 9px;
  border: 3px solid var(--yellow-dark);
  background: #111;
  box-shadow: var(--shadow-card), 0 0 0 1px #000 inset;
  overflow: hidden;
  z-index: 2;
  transition: transform .35s cubic-bezier(.4,0,.2,1), opacity .35s ease;
}
#glove-vinyl-case-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#glove-vinyl-box:hover #glove-vinyl-case {
  transform: translateX(6px) rotate(2deg);
  box-shadow: var(--shadow-glow), 0 0 0 1px #000 inset;
}

/* Animación de salida: la caja se fija respecto al viewport (top/left/width/height
   puestos por JS desde su posición real) y SOLO entonces se traslada fuera de la
   pantalla, así nunca ensancha el contenedor con scroll que la contiene. */
#glove-vinyl-case.vinyl-fixed {
  position: fixed;
  z-index: 950;
  transition: none;
  margin: 0;
}
#glove-vinyl-case.vinyl-fly-out {
  animation: vinylCaseFlyOut .55s cubic-bezier(.55,0,.85,.35) forwards;
}
@keyframes vinylCaseFlyOut {
  0%   { transform: translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(160vw) rotate(35deg); opacity: 0.4; }
}

/* Animación de regreso: vuelve desde fuera de la pantalla a su posición original */
#glove-vinyl-case.vinyl-fly-in {
  animation: vinylCaseFlyIn .45s cubic-bezier(.2,.8,.3,1.05) forwards;
}
@keyframes vinylCaseFlyIn {
  0%   { transform: translateX(160vw) rotate(35deg); opacity: 0.4; }
  100% { transform: translateX(0) rotate(0deg); opacity: 1; }
}

/* ============================================================
   REPRODUCTOR DE MÚSICA (overlay)
   ============================================================ */
#music-player-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  animation: fadeInDetail .2s ease;
}
#music-player-overlay.open { display: flex; }

#music-player-frame {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: min(92vw, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 28px 22px 22px;
  border-radius: 18px;
  border: 4px solid var(--yellow-bright);
  background: linear-gradient(180deg, #1f1f1f, #141414);
  box-shadow: var(--shadow-glow), 0 16px 50px rgba(0,0,0,0.85);
  animation: musicFrameIn .4s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes musicFrameIn {
  0%   { opacity: 0; transform: scale(0.85) translateY(20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

#music-player-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border-bold);
  background: var(--red-close);
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, filter .15s ease;
}
#music-player-close:hover { filter: brightness(1.2); }
#music-player-close:active { transform: scale(0.9); }

/* Disco grande girando */
#music-vinyl-stage {
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
#music-vinyl-disc-big {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center, #1c1c1c 0 3px, #111 3px 6px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.7), inset 0 0 0 3px #000;
  animation: vinylSpin 6s linear infinite;
  animation-play-state: paused;
  display: flex;
  align-items: center;
  justify-content: center;
}
#music-vinyl-disc-big.spinning { animation-play-state: running; }
@keyframes vinylSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
#music-vinyl-disc-grooves {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 28px rgba(0,0,0,0.0);
}
#music-vinyl-center {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--yellow-bright);
  background: #222;
  box-shadow: 0 0 0 3px #000, 0 0 14px rgba(255,215,0,0.4);
}
#music-vinyl-center-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#music-track-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.05rem;
  color: var(--text-yellow);
  text-align: center;
  text-shadow: 1px 1px 0 #000;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#music-progress-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
#music-time-current, #music-time-total {
  font-family: 'Fredoka', sans-serif;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 32px;
  text-align: center;
}
#music-progress-bar {
  flex: 1;
  cursor: pointer;
  height: 4px;
}

#music-controls-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
#music-btn-prev, #music-btn-next, #music-btn-playpause, #music-btn-shuffle {
  border: 2px solid var(--yellow-dark);
  background: var(--bg-card-inner);
  color: var(--text-yellow);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
#music-btn-prev, #music-btn-next, #music-btn-shuffle { width: 36px; height: 36px; font-size: 1rem; }
#music-btn-shuffle { width: 32px; height: 32px; font-size: 0.9rem; opacity: 0.7; }
#music-btn-playpause { width: 46px; height: 46px; font-size: 1.2rem; background: var(--yellow-bright); color: #111; border-color: var(--border-bold); }
#music-btn-prev:hover, #music-btn-next:hover, #music-btn-shuffle:hover { background: var(--yellow-dark); color: #111; transform: scale(1.08); }
#music-btn-playpause:hover { filter: brightness(1.1); transform: scale(1.06); }
#music-btn-prev:active, #music-btn-next:active, #music-btn-playpause:active, #music-btn-shuffle:active { transform: scale(0.92); }
#music-btn-prev:disabled, #music-btn-next:disabled, #music-btn-shuffle:disabled { opacity: 0.35; cursor: default; transform: none; }
#music-btn-shuffle.active {
  opacity: 1;
  background: var(--yellow-bright);
  color: #111;
  border-color: var(--border-bold);
  box-shadow: 0 0 10px rgba(255,215,0,0.55);
}

#music-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding-left: 10px;
  border-left: 2px solid #333;
}
#music-volume-icon { font-size: 0.95rem; }
#music-volume-bar {
  cursor: pointer;
  height: 4px;
}

@media (max-width: 480px) {
  #music-vinyl-stage, #music-vinyl-disc-big { width: 170px; height: 170px; }
  #music-vinyl-center { width: 70px; height: 70px; }
}

/* ============================================================
   MINI REPRODUCTOR FLOTANTE (fijo a la izquierda, persiste
   entre páginas mientras haya una canción cargada)
   ============================================================ */
#mini-player-fab {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 870;
  display: none;
  align-items: center;
}
#mini-player-fab.show { display: flex; }

/* El disco: solo se ve la mitad, recortada por el borde izquierdo */
#mini-player-disc-btn {
  position: relative;
  width: 64px;
  height: 64px;
  margin-left: -32px;  /* mitad fuera de la pantalla */
  border: none;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  background: transparent;
  transition: margin-left .25s cubic-bezier(.34,1.56,.64,1);
}
#mini-player-disc-btn:hover { margin-left: -24px; }

#mini-player-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background:
    radial-gradient(circle at center, var(--yellow-bright) 0 5px, #0a0a0a 6px 8px, #3a3a3a 9px 100%),
    repeating-radial-gradient(circle at center, #444 0 2px, #2a2a2a 2px 4px);
  border: 2px solid var(--yellow-dark);
  box-shadow: 0 0 14px rgba(0,0,0,0.7), 0 0 10px rgba(255,215,0,0.25);
  animation: vinylSpin 5s linear infinite;
  animation-play-state: paused;
  display: flex;
  align-items: center;
  justify-content: center;
}
#mini-player-disc.spinning { animation-play-state: running; }
#mini-player-disc-img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid #000;
}

/* Panel expandido hacia la derecha */
#mini-player-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0;
  margin-left: -10px;
  background: linear-gradient(90deg, #1a1a1a, #222);
  border: 0px solid var(--yellow-dark);
  border-left: none;
  border-radius: 0 12px 12px 0;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  transition: max-width .32s cubic-bezier(.4,0,.2,1), opacity .25s ease, padding .32s ease, border-width .2s ease;
  white-space: nowrap;
}
#mini-player-fab.expanded #mini-player-panel {
  max-width: 320px;
  opacity: 1;
  padding: 8px 12px 8px 22px;
  border-width: 2px;
}

#mini-player-info { display: flex; flex-direction: column; gap: 4px; min-width: 130px; }
#mini-player-track-name {
  font-family: 'Fredoka One', cursive;
  font-size: 0.78rem;
  color: var(--text-yellow);
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 150px;
}
#mini-player-progress-row { width: 100%; }
#mini-player-progress-bar {
  width: 130px;
  cursor: pointer;
  height: 3px;
}

#mini-player-controls { display: flex; align-items: center; gap: 6px; }
#mini-player-controls button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--yellow-dark);
  background: var(--bg-card-inner);
  color: var(--text-yellow);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, background .15s ease;
}
#mini-player-controls button:hover { background: var(--yellow-dark); color: #111; transform: scale(1.1); }
#mini-player-controls button:active { transform: scale(0.9); }
#mini-player-btn-close { border-color: #5a1414 !important; }
#mini-player-btn-close:hover { background: var(--red-close) !important; color: #fff !important; }

@media (max-width: 480px) {
  #mini-player-disc-btn { width: 52px; height: 52px; margin-left: -26px; }
  #mini-player-disc-img { width: 20px; height: 20px; }
  #mini-player-info { min-width: 100px; }
  #mini-player-progress-bar, #mini-player-track-name { width: 100px; max-width: 100px; }
  #mini-player-fab.expanded #mini-player-panel { max-width: 240px; }
}

