html, body {
  height: 100%;
  margin: 0;
  background: #0b0f19;
  overflow: hidden;
  font-family: 'Roboto', Arial, sans-serif;
}
.frame {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.stage {
  width: 100vw;
  height: 56.25vw;
  max-height: 100vh;
  max-width: 177.77vh;
  background: linear-gradient(180deg, rgba(6,10,20,0.65) 0%, rgba(10,14,24,0.9) 100%);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 180px rgba(0,255,255,0.35);
}
canvas { 
  display: block; 
  width: 100%; 
  height: 100%; 
}

/* === Título mejorado === */
.title3d {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 10;
}
.title3d h1 {
  font-size: 10vw;
  color: #00ffff;
  text-shadow: 
    0 0 20px #00ffff, 
    0 0 40px #00ffff, 
    0 0 80px #00aaff;
  letter-spacing: 0.1em;
  margin: 0;
  animation: glow 3s infinite alternate ease-in-out;
}
.title3d p {
  font-size: 3.5vw;
  color: #cceeff;
  text-shadow: 0 0 8px #00aaff, 0 0 16px #00ffff;
  margin-top: -1vw;
  margin-bottom: 0;
  letter-spacing: 0.05em;
}
@keyframes glow {
  0% { 
    text-shadow: 
      0 0 10px #00ffff,
      0 0 20px #00ffff,
      0 0 40px #00aaff; 
  }
  100% { 
    text-shadow: 
      0 0 30px #00ffff,
      0 0 60px #00ffff,
      0 0 90px #00bbff; 
  }
}

/* === Reproductor mejorado === */
#player {
  position: fixed;
  bottom: 0; 
  left: 0;
  width: 100%; 
  height: 100px;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  box-sizing: border-box;
  z-index: 1000;
  flex-wrap: wrap;
  border-top: 1px solid rgba(0, 255, 255, 0.2);
  box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}
#player .controls { 
  display: flex; 
  align-items: center; 
  gap: 15px; 
}
#player button { 
  background: rgba(0, 255, 255, 0.1); 
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 50%;
  color: #00ffff; 
  font-size: 1.8em; 
  cursor: pointer; 
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}
#player button:hover { 
  background: rgba(0, 255, 255, 0.2); 
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}
#player .track { 
  color: #fff; 
  font-size: 1.2em; 
  flex: 1; 
  text-align: center;
  text-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
  letter-spacing: 0.05em;
}
#player .playlist {
  position: absolute; 
  bottom: 100px; 
  left: 20px;
  background: rgba(0, 0, 0, 0.9);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  z-index: 1001;
}
#player .playlist div { 
  padding: 8px 12px; 
  cursor: pointer; 
  color: #00ffff; 
  border-radius: 4px;
  transition: all 0.2s ease;
}
#player .playlist div:hover { 
  background: rgba(0, 255, 255, 0.1); 
}
#player .playlist div.active { 
  background: #00ffff; 
  color: #000; 
  font-weight: bold;
}

/* === SUBTÍTULOS MEJORADOS - POSICIÓN SUPERIOR Y ROBOTO === */
#subtitles {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  text-align: center;
  color: #ffff00;
  font-size: 1.8em;
  font-weight: 500;
  font-family: 'Roboto', sans-serif;
  text-shadow: 
    0 0 15px #ffaa00,
    0 0 30px #ff5500,
    0 0 45px #ffff00;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px 30px;
  border-radius: 15px;
  z-index: 999;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  pointer-events: none;
  line-height: 1.6;
  backdrop-filter: blur(12px);
  max-width: 900px;
  letter-spacing: 0.03em;
}

#subtitles.active {
  opacity: 1;
  transform: translateX(-50%) scale(1.02);
}

/* Efecto de tipeo */
.typing-cursor {
  display: inline-block;
  width: 3px;
  height: 1.2em;
  background-color: #ffff00;
  margin-left: 2px;
  animation: blink 1s infinite;
  vertical-align: middle;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* === SELECTOR DE IDIOMA ELEGANTE === */
#language-selector {
  position: absolute;
  top: 30px;
  right: 30px;
  background: rgba(0, 0, 0, 0.85);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  z-index: 1001;
  display: flex;
  gap: 12px;
  backdrop-filter: blur(10px);
}

#language-selector button {
  background: rgba(0, 255, 255, 0.15);
  border: 1px solid rgba(0, 255, 255, 0.4);
  color: #00ffff;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  font-weight: bold;
  font-family: 'Roboto', sans-serif;
}

#language-selector button.active {
  background: #00ffff;
  color: #000;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

#language-selector button:hover:not(.active) {
  background: rgba(0, 255, 255, 0.25);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.4);
}

/* Barra de progreso */
.progress-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, #00ffff, #00aaff);
  transition: width 0.1s linear;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Barra de volumen */
.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.volume-icon {
  color: #00ffff;
  font-size: 1.5em;
}
#volume {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 6px;
  background: linear-gradient(to right, #00ffff, #00aaff);
  border-radius: 5px;
  cursor: pointer;
  box-shadow: 0 0 5px rgba(0, 255, 255, 0.3);
}
#volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #00ffff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  border: 2px solid #fff;
}

/* === Responsive mejorado === */
@media (max-width: 768px) {
  .title3d h1 { font-size: 14vw; }
  .title3d p { font-size: 5vw; }
  #player { 
    height: 120px; 
    flex-direction: column; 
    padding: 10px; 
    gap: 10px;
  }
  #player .controls button { font-size: 1.5em; width: 40px; height: 40px; }
  #player .track { font-size: 1em; margin-top: 5px; }
  #subtitles {
    font-size: 1.4em;
    top: 100px;
    width: 90%;
    padding: 15px 20px;
  }
  #language-selector {
    top: 20px;
    right: 15px;
    padding: 10px 15px;
  }
}
@media (orientation: portrait) { 
  .stage { height: 100vh; width: 100vw; } 
}