/**
 * Sistema de Enmascaramiento y Recorte Anti-Spoilers de YouTube
 * Asegura que el título del video, ícono de canal, sugerencias y marcas de agua
 * permanezcan 100% invisibles para el usuario.
 */

/* Contenedor principal de la pantalla de cine */
.cinema-theater-viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #050608;
  z-index: 0;
}

/* Envoltorio del reproductor: sobredimensionado y centrado */
.video-stream-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  /* Desplazamos ligeramente hacia arriba para sacar la barra de título de YouTube del viewport */
  transform: translate(-50%, calc(-50% - 25px)) scale(1.22);
  width: 100vw;
  height: 100vh;
  min-width: 177.77vh; /* Mantiene proporción 16:9 cubriendo el 100% de la pantalla */
  min-height: 56.25vw;
  pointer-events: none; /* Impide cualquier interacción con los controles nativos de YouTube */
  user-select: none;
}

.video-stream-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* Escudo protector invisible sobre el video */
.video-click-shield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: default;
  pointer-events: auto; /* Atrapa clics para que no alcancen el iframe de YouTube */
}

/* Viñeta cinematográfica superior: cubre la zona superior del video */
.cinema-vignette-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 180px;
  background: linear-gradient(
    to bottom,
    rgba(5, 6, 8, 0.95) 0%,
    rgba(5, 6, 8, 0.8) 35%,
    rgba(5, 6, 8, 0.4) 70%,
    transparent 100%
  );
  z-index: 3;
  pointer-events: none;
}

/* Viñeta cinematográfica inferior: se integra armoniosamente con las opciones del juego */
.cinema-vignette-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 380px;
  background: linear-gradient(
    to top,
    rgba(5, 6, 8, 0.98) 0%,
    rgba(5, 6, 8, 0.9) 45%,
    rgba(5, 6, 8, 0.5) 80%,
    transparent 100%
  );
  z-index: 3;
  pointer-events: none;
}

/* Efecto de viñeta radial de lente de cine */
.cinema-vignette-radial {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.85);
  z-index: 3;
  pointer-events: none;
}

/* Indicador de carga de video */
.video-loading-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #07090e;
  z-index: 4;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.video-loading-placeholder.active {
  opacity: 1;
  pointer-events: auto;
}

.film-reel-spinner {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: spinReel 0.9s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
  margin-bottom: 1rem;
}

@keyframes spinReel {
  to {
    transform: rotate(360deg);
  }
}
