/* Estilos base */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  min-height: 100vh;
  background-color: #000;
  overflow-x: hidden;
}

/* Fondo de partículas */
#particles-js {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* Contenedor del reproductor */
.player-container {
  position: relative;
  z-index: 1;
  color: white;
  text-align: center;
  padding: 10px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-top: calc(40px + 0.5rem);
  width: 100%;
  box-sizing: border-box;
  max-width: 1200px;
  margin: 0 auto;
}

/* Botones */
button {
  background: linear-gradient(45deg, #ff0099, #493240);
  border: none;
  border-radius: 5px;
  color: white;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  margin: 5px;
  transition: transform 0.2s;
}

button:hover {
  transform: scale(1.1);
}

/* Letras sincronizadas */
#lyrics {
  margin-top: 20px;
  font-size: 18px;
  font-weight: bold;
}

.hidden {
  display: none;
}

#lyrics {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.lyric-prev, .lyric-next {
  opacity: 0.5;
  font-size: 0.9em;
  color: #999;
}

.lyric-current {
  font-size: 1.2em;
  font-weight: bold;
  color: #fff;
}

.karaoke-container {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(255, 20, 147, 0.2);
  max-width: 600px;
  width: 90%;
}

.karaoke-container.hidden {
  display: none;
}

/* Estilos para el título con efecto glitch */
h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 4.5rem;
  text-transform: uppercase;
  margin-bottom: 2rem;
  color: #fff;
  text-shadow: 
    0 0 10px rgba(255,255,255,0.8),
    0 0 20px rgba(255,255,255,0.8),
    0 0 30px rgba(255,255,255,0.8);
  letter-spacing: 4px;
  position: relative;
}

/* Efecto de resplandor al pasar el mouse */
h1:hover {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 
      0 0 10px rgba(255,255,255,0.8),
      0 0 20px rgba(255,255,255,0.8),
      0 0 30px rgba(255,255,255,0.8),
      0 0 40px #ff00de,
      0 0 70px #ff00de,
      0 0 80px #ff00de,
      0 0 100px #ff00de;
  }
  to {
    text-shadow: 
      0 0 20px rgba(255,255,255,0.8),
      0 0 30px #ff4da6,
      0 0 40px #ff4da6,
      0 0 50px #ff4da6,
      0 0 60px #ff4da6,
      0 0 70px #ff4da6,
      0 0 80px #ff4da6;
  }
}

/* Estilos para el efecto glitch */
.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 #ff00de;
  clip: rect(24px, 550px, 90px, 0);
  animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 #00fff9;
  clip: rect(85px, 550px, 140px, 0);
  animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(42px, 9999px, 44px, 0);
  }
  5% {
    clip: rect(12px, 9999px, 59px, 0);
  }
  10% {
    clip: rect(48px, 9999px, 29px, 0);
  }
  15.0% {
    clip: rect(42px, 9999px, 73px, 0);
  }
  20% {
    clip: rect(63px, 9999px, 27px, 0);
  }
  25% {
    clip: rect(34px, 9999px, 55px, 0);
  }
  30.0% {
    clip: rect(86px, 9999px, 73px, 0);
  }
  35% {
    clip: rect(20px, 9999px, 20px, 0);
  }
  40% {
    clip: rect(26px, 9999px, 60px, 0);
  }
  45% {
    clip: rect(25px, 9999px, 66px, 0);
  }
  50% {
    clip: rect(57px, 9999px, 98px, 0);
  }
  55.0% {
    clip: rect(5px, 9999px, 46px, 0);
  }
  60.0% {
    clip: rect(82px, 9999px, 31px, 0);
  }
  65% {
    clip: rect(54px, 9999px, 27px, 0);
  }
  70% {
    clip: rect(28px, 9999px, 99px, 0);
  }
  75% {
    clip: rect(45px, 9999px, 69px, 0);
  }
  80% {
    clip: rect(23px, 9999px, 85px, 0);
  }
  85.0% {
    clip: rect(54px, 9999px, 84px, 0);
  }
  90% {
    clip: rect(45px, 9999px, 47px, 0);
  }
  95% {
    clip: rect(37px, 9999px, 20px, 0);
  }
  100% {
    clip: rect(4px, 9999px, 91px, 0);
  }
}

/* Estilos del banner superior */
.audio-banner {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(90deg, #ff1493, #ff69b4);
  color: white;
  text-align: center;
  padding: 8px 15px;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.8rem, 3vw, 1rem);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(255, 20, 147, 0.5);
  animation: glow-banner 1.5s ease-in-out infinite alternate;
}

.audio-banner span {
  display: inline-block;
  animation: bounce 2s ease infinite;
}

/* Estilos del botón de karaoke */
#karaoke-btn {
  background: linear-gradient(45deg, #ff1493, #ff69b4);
  border: none;
  border-radius: 25px;
  color: white;
  padding: 12px 30px;
  font-size: 1.1rem;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  margin: 20px auto;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(255, 20, 147, 0.3);
  max-width: 200px;
}

#karaoke-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
}

#karaoke-btn:active {
  transform: translateY(1px);
}

/* Contenedor de karaoke */
.karaoke-container {
  background: rgba(0, 0, 0, 0.7);
  border-radius: 15px;
  padding: 20px;
  margin: 20px auto;
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(255, 20, 147, 0.2);
  max-width: 600px;
  width: 90%;
}

.karaoke-container.hidden {
  display: none;
}

/* Animaciones */
@keyframes glow-banner {
  from {
    box-shadow: 0 2px 10px rgba(255, 20, 147, 0.5);
  }
  to {
    box-shadow: 0 2px 20px rgba(255, 20, 147, 0.8);
  }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-5px);
  }
  60% {
    transform: translateY(-3px);
  }
}

/* Estilos de las letras del karaoke */
#lyrics {
  font-family: 'Orbitron', sans-serif;
  color: white;
  text-align: center;
}

.lyric-prev {
  opacity: 0.5;
  font-size: 0.9rem;
  margin: 10px 0;
}

.lyric-current {
  font-size: 1.5rem;
  color: #ff1493;
  text-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
  margin: 15px 0;
  font-weight: bold;
}

.lyric-next {
  opacity: 0.5;
  font-size: 0.9rem;
  margin: 10px 0;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
  .audio-banner {
    font-size: 0.9rem;
    padding: 8px;
  }

  #karaoke-btn {
    font-size: 1rem;
    padding: 10px 25px;
  }

  .lyric-current {
    font-size: 1.2rem;
  }
}

/* Estilos para el botón de historia */
#story-btn {
  background: linear-gradient(45deg, #ff69b4, #ff1493);
  border: none;
  border-radius: 25px;
  color: white;
  padding: 12px 30px;
  font-size: 1.1rem;
  font-family: 'Orbitron', sans-serif;
  cursor: pointer;
  margin: 20px auto;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(255, 20, 147, 0.3);
  max-width: 300px;
  display: block;
}

#story-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 20, 147, 0.5);
}

#story-btn:active {
  transform: translateY(1px);
}

/* Estilos para el modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  background: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 0 30px rgba(255, 20, 147, 0.3);
}

.close-modal {
  position: absolute;
  right: 15px;
  top: 5px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: #ff1493;
}

#story-video {
  width: 100%;
  border-radius: 10px;
}

/* Clase para ocultar elementos */
.hidden {
  display: none;
}

/* Media queries para dispositivos móviles */
@media (max-width: 768px) {
  #story-btn {
    font-size: 1rem;
    padding: 10px 20px;
    max-width: 250px;
  }
  
  .modal-content {
    width: 95%;
    padding: 15px;
  }
}

/* Ajustes del título */
h1.glitch {
  font-size: clamp(2rem, 8vw, 4.5rem);
  margin: 0.5rem 0;
  width: 100%;
  text-align: center;
}

/* Contenedor del CD */
.cd-container {
  width: min(300px, 70vw);
  height: min(300px, 70vw);
  margin: 5px auto;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cd-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: rotate 20s linear infinite paused;
}

.cd-image.playing {
  animation-play-state: running;
}

/* Controles de audio */
.audio-controls {
  width: min(500px, 90%);
  margin: 15px auto;
  padding: 15px;
  border-radius: 15px;
}

.time-control {
  width: 100%;
  gap: 8px;
  font-size: 0.9rem;
}

.volume-control {
  width: 100%;
  max-width: 200px;
  margin: 10px auto;
}

/* Botones */
#karaoke-btn, #story-btn {
  width: min(300px, 90%);
  padding: 12px 20px;
  margin: 10px auto;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

/* Media queries para dispositivos móviles */
@media (max-width: 768px) {
  .player-container {
    padding: calc(35px + 0.5rem) 8px 15px;
    gap: 8px;
  }

  .audio-controls {
    padding: 10px;
  }

  .main-controls {
    gap: 10px;
  }

  .control-btn {
    width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  .progress-bar {
    height: 4px;
  }

  #volume-slider {
    height: 4px;
  }

  .karaoke-container {
    padding: 15px;
    width: 95%;
  }

  .lyric-current {
    font-size: 1.2rem;
  }

  .lyric-prev, .lyric-next {
    font-size: 0.8rem;
  }
}

/* Media queries para pantallas muy pequeñas */
@media (max-width: 360px) {
  .player-container {
    padding-top: calc(35px + 1rem);
  }

  h1.glitch {
    font-size: 1.8rem;
  }

  .cd-container {
    width: min(200px, 75vw);
    height: min(200px, 75vw);
    margin: 2px auto;
  }

  .audio-banner {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  #karaoke-btn, #story-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
}

/* Media queries para pantallas grandes */
@media (min-width: 1200px) {
  .player-container {
    gap: 20px;
  }

  .cd-container {
    width: 350px;
    height: 350px;
    margin: 10px auto;
  }

  .audio-controls {
    padding: 20px;
  }
}