/* ==========================================================================
   Narratix - Edge-to-Edge Cinematic Player (Instagram Stories / Reels Style)
   ========================================================================== */

.player-page-body {
  background-color: #05060A;
  color: #FFFFFF;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  user-select: none;
  font-family: var(--font-primary);
  overscroll-behavior: none;
}

/* Header Flotante Ultraligero */
.player-floating-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.75rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px)) 0.75rem max(1rem, env(safe-area-inset-left, 0px));
  background: transparent;
  pointer-events: none;
}

.player-back-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.48rem 0.95rem;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, rgba(30, 38, 62, 0.72) 0%, rgba(13, 17, 30, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #F8FAFC;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.player-back-btn:hover {
  background: linear-gradient(180deg, rgba(45, 56, 90, 0.85) 0%, rgba(20, 26, 46, 0.92) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    0 8px 22px rgba(0, 0, 0, 0.65),
    0 0 15px rgba(99, 102, 241, 0.35);
}

.player-top-center {
  display: none !important;
}

.player-current-node-label {
  font-size: 0.72rem;
  color: #A5B4FC;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.player-top-controls {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.player-icon-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(30, 38, 62, 0.72) 0%, rgba(13, 17, 30, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.35),
    inset 0 -2px 4px rgba(0, 0, 0, 0.45),
    0 6px 18px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.player-icon-action-btn:hover {
  background: linear-gradient(180deg, rgba(45, 56, 90, 0.85) 0%, rgba(20, 26, 46, 0.92) 100%);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px) scale(1.06);
}

/* =========================================
   Escenario Cinemático (Viewport)
========================================= */
.player-cinematic-stage {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: #000000;
}

.player-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: width 0.3s ease, height 0.3s ease, max-width 0.3s ease, border-radius 0.3s ease;
}

/* Modo por defecto y fallback 16:9 */
.player-viewport:not(.video-orientation-vertical) {
  aspect-ratio: 16/9;
}

/* En desktop con monitores anchos, mantener marco 16:9 con sombra envolvente */
@media (min-aspect-ratio: 16/9) {
  .player-viewport:not(.video-orientation-vertical) {
    height: 100%;
    width: calc(100vh * (16 / 9));
    max-width: 100%;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.95);
  }
}

/* En móviles / pantallas verticales, llenar ancho completo */
@media (max-aspect-ratio: 16/9) {
  .player-viewport:not(.video-orientation-vertical) {
    width: 100%;
    height: 100%;
  }
}

#youtube-player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
}

/* =========================================
   Indicadores de Progreso / Tiempo Ocultos (Pantalla 100% Limpia)
========================================= */
.story-progress-strip,
.player-slow-motion-badge,
.player-decision-timer {
  display: none !important;
}

/* =========================================
   Capa de Decisiones Superpuesta (Overlay)
========================================= */
.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.45) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.player-overlay.active {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.player-viewport.decision-active #youtube-player {
  filter: saturate(0.85) brightness(0.72);
  transform: scale(1.015);
  transition: filter 400ms ease, transform 400ms ease;
}

/* Contenedor de Botones de Decisión Superpuestos */
.player-decisions {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 1rem 1.5rem 5.5rem;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 42;
  overflow: hidden;
}

/* ==========================================================================
   Botones de Decisión con Relieve 3D Premium y Efecto Palpitante Profesional
   ========================================================================== */
.decision-btn {
  position: relative;
  background: linear-gradient(180deg, rgba(49, 46, 129, 0.92) 0%, rgba(19, 24, 48, 0.96) 55%, rgba(12, 15, 32, 0.98) 100%);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1.5px solid rgba(129, 140, 248, 0.88);
  border-bottom: 3px solid rgba(67, 56, 202, 0.98);
  border-radius: var(--radius-full);
  padding: 1rem 2.1rem;
  min-width: 185px;
  max-width: min(345px, 92vw);
  box-sizing: border-box;
  text-align: center;
  color: #FFFFFF;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s, background 0.2s, box-shadow 0.25s;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  pointer-events: auto;
  box-shadow:
    inset 0 2px 1.5px rgba(255, 255, 255, 0.48),
    inset 0 -3px 6px rgba(0, 0, 0, 0.55),
    0 4px 0 rgba(30, 27, 75, 0.95),
    0 14px 32px rgba(0, 0, 0, 0.85),
    0 0 26px rgba(99, 102, 241, 0.55);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  z-index: 44;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  animation: decisionHeartbeat 2s ease-in-out infinite;
}

@keyframes decisionHeartbeat {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      inset 0 2px 1.5px rgba(255, 255, 255, 0.48),
      inset 0 -3px 6px rgba(0, 0, 0, 0.55),
      0 4px 0 rgba(30, 27, 75, 0.95),
      0 14px 32px rgba(0, 0, 0, 0.85),
      0 0 0 0 rgba(99, 102, 241, 0.65),
      0 0 24px rgba(99, 102, 241, 0.5);
  }
  50% {
    transform: translateY(-3px) scale(1.045);
    box-shadow:
      inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
      inset 0 -3px 6px rgba(0, 0, 0, 0.45),
      0 6px 0 rgba(49, 46, 129, 0.95),
      0 18px 40px rgba(0, 0, 0, 0.92),
      0 0 0 10px rgba(99, 102, 241, 0),
      0 0 38px rgba(129, 140, 248, 0.85);
  }
}

.decision-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
  animation: decisionShimmerSweep 3.2s ease-in-out infinite;
}

@keyframes decisionShimmerSweep {
  0%, 55% { left: -130%; }
  100% { left: 170%; }
}

.decision-btn:hover {
  animation-play-state: paused;
  transform: translateY(-6px) scale(1.07);
  border-color: #FFFFFF;
  background: linear-gradient(180deg, rgba(67, 56, 202, 0.96) 0%, rgba(30, 41, 75, 0.98) 100%);
  box-shadow:
    inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
    inset 0 -3px 6px rgba(0, 0, 0, 0.45),
    0 6px 0 rgba(49, 46, 129, 0.98),
    0 20px 45px rgba(0, 0, 0, 0.92),
    0 0 42px rgba(99, 102, 241, 0.85);
}

.decision-btn:active {
  transform: translateY(2px) scale(0.98) !important;
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(30, 27, 75, 0.95),
    0 8px 18px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(99, 102, 241, 0.6) !important;
}

.decision-btn.decision-direction {
  background: linear-gradient(180deg, rgba(14, 116, 144, 0.92) 0%, rgba(12, 42, 64, 0.96) 60%, rgba(8, 26, 43, 0.98) 100%);
  border-color: rgba(56, 189, 248, 0.9);
  border-bottom: 3px solid rgba(8, 145, 178, 0.98);
  color: #F0F9FF;
  animation: decisionHeartbeatCyan 2s ease-in-out infinite;
}

@keyframes decisionHeartbeatCyan {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      inset 0 2px 1.5px rgba(255, 255, 255, 0.48),
      inset 0 -3px 6px rgba(0, 0, 0, 0.55),
      0 4px 0 rgba(12, 74, 110, 0.95),
      0 14px 32px rgba(0, 0, 0, 0.85),
      0 0 0 0 rgba(6, 182, 212, 0.65),
      0 0 24px rgba(6, 182, 212, 0.5);
  }
  50% {
    transform: translateY(-3px) scale(1.045);
    box-shadow:
      inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
      inset 0 -3px 6px rgba(0, 0, 0, 0.45),
      0 6px 0 rgba(14, 116, 144, 0.95),
      0 18px 40px rgba(0, 0, 0, 0.92),
      0 0 0 10px rgba(6, 182, 212, 0),
      0 0 38px rgba(56, 189, 248, 0.85);
  }
}

.decision-btn.decision-direction:hover {
  animation-play-state: paused;
  border-color: #FFFFFF;
  background: linear-gradient(180deg, rgba(8, 145, 178, 0.96) 0%, rgba(14, 55, 78, 0.98) 100%);
  box-shadow:
    inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
    0 6px 0 rgba(14, 116, 144, 0.98),
    0 18px 45px rgba(0, 0, 0, 0.92),
    0 0 45px rgba(6, 182, 212, 0.88);
}

.decision-btn.decision-object {
  background: linear-gradient(180deg, rgba(157, 23, 77, 0.92) 0%, rgba(68, 16, 48, 0.96) 60%, rgba(42, 10, 30, 0.98) 100%);
  border-color: rgba(244, 114, 182, 0.9);
  border-bottom: 3px solid rgba(190, 24, 93, 0.98);
  color: #FDF2F8;
  animation: decisionHeartbeatPink 2s ease-in-out infinite;
}

@keyframes decisionHeartbeatPink {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      inset 0 2px 1.5px rgba(255, 255, 255, 0.48),
      inset 0 -3px 6px rgba(0, 0, 0, 0.55),
      0 4px 0 rgba(112, 26, 117, 0.95),
      0 14px 32px rgba(0, 0, 0, 0.85),
      0 0 0 0 rgba(236, 72, 153, 0.65),
      0 0 24px rgba(236, 72, 153, 0.5);
  }
  50% {
    transform: translateY(-3px) scale(1.045);
    box-shadow:
      inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
      inset 0 -3px 6px rgba(0, 0, 0, 0.45),
      0 6px 0 rgba(157, 23, 77, 0.95),
      0 18px 40px rgba(0, 0, 0, 0.92),
      0 0 0 10px rgba(236, 72, 153, 0),
      0 0 38px rgba(244, 114, 182, 0.85);
  }
}

.decision-btn.decision-object:hover {
  animation-play-state: paused;
  border-color: #FFFFFF;
  background: linear-gradient(180deg, rgba(190, 24, 93, 0.96) 0%, rgba(76, 18, 52, 0.98) 100%);
  box-shadow:
    inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
    0 6px 0 rgba(157, 23, 77, 0.98),
    0 18px 45px rgba(0, 0, 0, 0.92),
    0 0 45px rgba(236, 72, 153, 0.88);
}

/* Botón con posición manual sobre el video (Hotspot / Coordenadas X, Y) */
.decision-btn.decision-btn-positioned {
  position: absolute;
  min-width: auto;
  width: auto;
  max-width: min(320px, 80vw);
  margin: 0;
  padding: 0.78rem 1.65rem;
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
  z-index: 46;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-bottom: 3.5px solid rgba(99, 102, 241, 0.98);
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(49, 46, 129, 0.95) 0%, rgba(13, 16, 28, 0.98) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  animation: decisionHeartbeatPositioned 2s ease-in-out infinite;
}

@keyframes decisionHeartbeatPositioned {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      inset 0 2px 1.5px rgba(255, 255, 255, 0.5),
      inset 0 -3px 6px rgba(0, 0, 0, 0.55),
      0 4px 0 rgba(30, 27, 75, 0.95),
      0 12px 32px rgba(0, 0, 0, 0.88),
      0 0 0 0 rgba(99, 102, 241, 0.7),
      0 0 25px rgba(99, 102, 241, 0.6);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow:
      inset 0 2.5px 2px rgba(255, 255, 255, 0.68),
      inset 0 -3px 6px rgba(0, 0, 0, 0.45),
      0 6px 0 rgba(49, 46, 129, 0.95),
      0 16px 38px rgba(0, 0, 0, 0.92),
      0 0 0 11px rgba(99, 102, 241, 0),
      0 0 38px rgba(129, 140, 248, 0.9);
  }
}

.decision-btn.decision-btn-positioned:hover {
  animation-play-state: paused;
  transform: translate(-50%, -50%) scale(1.12);
  border-color: #FFFFFF;
  background: linear-gradient(180deg, rgba(67, 56, 202, 0.98) 0%, rgba(30, 41, 75, 0.99) 100%);
  box-shadow:
    inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
    0 6px 0 rgba(49, 46, 129, 0.98),
    0 16px 42px rgba(0, 0, 0, 0.95),
    0 0 38px var(--color-primary);
}

.decision-btn.decision-btn-positioned:active {
  transform: translate(-50%, calc(-50% + 2px)) scale(0.97) !important;
}

/* Diana redonda táctil sobre un objeto con relieve 3D */
.decision-btn.decision-btn-target {
  display: grid;
  width: clamp(56px, 6.5vw, 82px);
  height: clamp(56px, 6.5vw, 82px);
  min-width: 0;
  max-width: none;
  aspect-ratio: 1;
  place-items: center;
  padding: 0;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FDE68A 0%, #F59E0B 45%, #B45309 100%);
  box-shadow:
    inset 0 3px 3px rgba(255, 255, 255, 0.65),
    inset 0 -4px 6px rgba(120, 53, 15, 0.75),
    0 4px 0 rgba(120, 53, 15, 0.95),
    0 10px 28px rgba(0, 0, 0, 0.88),
    0 0 28px rgba(245, 158, 11, 0.85);
  color: #1E1B4B;
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 800;
  cursor: pointer;
  pointer-events: auto;
  z-index: 46;
  animation: pulseTarget 1.6s ease-in-out infinite;
}

@keyframes pulseTarget {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 3px 3px rgba(255, 255, 255, 0.65),
      inset 0 -4px 6px rgba(120, 53, 15, 0.75),
      0 4px 0 rgba(120, 53, 15, 0.95),
      0 8px 25px rgba(0, 0, 0, 0.85),
      0 0 0 0 rgba(245, 158, 11, 0.7),
      0 0 22px rgba(245, 158, 11, 0.65);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      inset 0 3px 4px rgba(255, 255, 255, 0.8),
      inset 0 -4px 6px rgba(120, 53, 15, 0.6),
      0 6px 0 rgba(120, 53, 15, 0.95),
      0 12px 32px rgba(0, 0, 0, 0.92),
      0 0 0 12px rgba(245, 158, 11, 0),
      0 0 38px rgba(251, 191, 36, 0.98);
  }
}

.decision-btn.decision-btn-target:hover {
  animation-play-state: paused;
  border-color: #ffffff;
  background: radial-gradient(circle at 35% 30%, #FEF08A 0%, #FBBF24 55%, #D97706 100%);
  transform: scale(1.15);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.85),
    0 6px 0 rgba(120, 53, 15, 0.95),
    0 12px 35px rgba(0, 0, 0, 0.95),
    0 0 42px rgba(251, 191, 36, 1);
}

.decision-btn.decision-btn-target.decision-btn-positioned {
  transform: translate(-50%, -50%);
  animation: pulseTargetPositioned 1.6s ease-in-out infinite;
}

@keyframes pulseTargetPositioned {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow:
      inset 0 3px 3px rgba(255, 255, 255, 0.65),
      inset 0 -4px 6px rgba(120, 53, 15, 0.75),
      0 4px 0 rgba(120, 53, 15, 0.95),
      0 8px 25px rgba(0, 0, 0, 0.85),
      0 0 0 0 rgba(245, 158, 11, 0.7),
      0 0 22px rgba(245, 158, 11, 0.65);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow:
      inset 0 3px 4px rgba(255, 255, 255, 0.8),
      inset 0 -4px 6px rgba(120, 53, 15, 0.6),
      0 6px 0 rgba(120, 53, 15, 0.95),
      0 12px 32px rgba(0, 0, 0, 0.92),
      0 0 0 12px rgba(245, 158, 11, 0),
      0 0 38px rgba(251, 191, 36, 0.98);
  }
}

.decision-btn.decision-btn-target.decision-btn-positioned:hover {
  animation-play-state: paused;
  transform: translate(-50%, -50%) scale(1.18);
}

/* ==========================================================================
   Esquina Flotante Limpia (Instagram Style) y Panel de Información Bajo Demanda
   ========================================================================== */
.player-info-backdrop {
  position: absolute;
  inset: 0;
  z-index: 34;
  background: rgba(5, 6, 12, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease;
}

.player-info-backdrop[hidden] {
  display: none !important;
}

.player-bottom-scrim {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 35;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.25rem;
  background: transparent;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.player-viewport.decision-active .player-bottom-scrim {
  opacity: 0.18;
  pointer-events: none;
}

/* Panel de Información del Canal y Descripción (Solo se muestra al pulsar Info) */
.player-meta-overlay {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(100%, 400px);
  max-height: min(68vh, 420px);
  overflow-y: auto;
  margin-right: auto;
  padding: 1.15rem 1.25rem;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(20, 26, 46, 0.94) 0%, rgba(10, 13, 24, 0.97) 100%);
  border: 1px solid rgba(129, 140, 248, 0.38);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.25),
    0 20px 50px rgba(0, 0, 0, 0.88),
    0 0 30px rgba(99, 102, 241, 0.28);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  pointer-events: auto;
  scrollbar-width: thin;
  animation: infoPanelSlideIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.player-meta-overlay[hidden] {
  display: none !important;
}

@keyframes infoPanelSlideIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.info-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-panel-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.info-panel-kicker {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94A3B8;
}

.info-panel-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #CBD5E1;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.info-panel-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
  transform: scale(1.08);
}

.player-creator-pill {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(12, 16, 30, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 0.45rem 0.65rem 0.45rem 0.45rem;
  border-radius: var(--radius-full);
  width: 100%;
  box-sizing: border-box;
}

.creator-avatar-link {
  text-decoration: none;
  flex-shrink: 0;
}

.creator-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 1.5px;
  background: var(--gradient-brand);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.45);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.creator-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.creator-avatar span {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.creator-text-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.creator-name-link {
  color: #FFFFFF;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-name-link:hover {
  text-decoration: underline;
  color: var(--color-primary-light);
}

.creator-followers {
  color: var(--color-text-muted);
  font-size: 0.73rem;
}

.btn-follow-pill {
  background: var(--gradient-brand);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 2px solid rgba(67, 56, 202, 0.95);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    0 4px 12px rgba(99, 102, 241, 0.45);
  border-radius: var(--radius-full);
  padding: 0.38rem 0.95rem;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-follow-pill[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
}

.btn-follow-pill:hover {
  transform: translateY(-1px) scale(1.04);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.55),
    0 6px 18px rgba(236, 72, 153, 0.6);
}

.creator-pill-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.btn-youtube-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(180deg, #FF2A2A 0%, #CC0000 100%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 2px solid #990000;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.42),
    0 4px 12px rgba(239, 68, 68, 0.45);
  border-radius: var(--radius-full);
  padding: 0.36rem 0.78rem;
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.btn-youtube-pill[hidden] {
  display: none !important;
}

.btn-youtube-pill:hover {
  transform: translateY(-1px) scale(1.05);
  background: linear-gradient(180deg, #FF4444 0%, #E60000 100%);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.55),
    0 6px 18px rgba(239, 68, 68, 0.7);
}

.youtube-follow-invite {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.18) 0%, rgba(15, 23, 42, 0.92) 100%);
  border: 1px solid rgba(248, 113, 113, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 18px rgba(239, 68, 68, 0.2);
  animation: infoPanelSlideIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.youtube-follow-invite[hidden] {
  display: none !important;
}

.youtube-follow-invite-text {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.78rem;
  color: #E2E8F0;
  line-height: 1.38;
}

.youtube-follow-invite-text strong {
  color: #FFFFFF;
  font-size: 0.82rem;
}

.btn-youtube-subscribe-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.52rem 1rem;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, #FF2A2A 0%, #CC0000 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 2.5px solid #880000;
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    0 6px 18px rgba(239, 68, 68, 0.5);
  transition: all 0.2s ease;
}

.btn-youtube-subscribe-cta:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.6),
    0 8px 22px rgba(239, 68, 68, 0.75);
}

.story-overlay-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.3;
}

.story-description-expandable {
  position: relative;
}

.story-description-text {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
  line-height: 1.55;
  margin: 0;
}

.btn-toggle-desc {
  background: transparent;
  border: none;
  color: var(--color-primary-light);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 0.2rem;
}

/* Columna Lateral de Acciones en la Esquina (Instagram Style con Relieve 3D y Pulso) */
.player-side-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin-left: auto;
  pointer-events: auto;
}

.action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.22rem;
}

.side-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(35, 43, 72, 0.78) 0%, rgba(14, 18, 34, 0.88) 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.26);
  border-bottom: 2.5px solid rgba(99, 102, 241, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow:
    inset 0 2px 1.5px rgba(255, 255, 255, 0.42),
    inset 0 -3px 5px rgba(0, 0, 0, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.65),
    0 0 14px rgba(99, 102, 241, 0.25);
  animation: cornerBtnPulse 2.8s ease-in-out infinite;
}

.action-item:nth-child(2) .side-action-btn {
  animation-delay: 0.4s;
}

.action-item:nth-child(3) .side-action-btn {
  animation-delay: 0.8s;
}

@keyframes cornerBtnPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 2px 1.5px rgba(255, 255, 255, 0.42),
      inset 0 -3px 5px rgba(0, 0, 0, 0.55),
      0 6px 18px rgba(0, 0, 0, 0.65),
      0 0 0 0 rgba(99, 102, 241, 0.4);
  }
  50% {
    transform: scale(1.06);
    box-shadow:
      inset 0 2px 2px rgba(255, 255, 255, 0.58),
      inset 0 -3px 5px rgba(0, 0, 0, 0.45),
      0 8px 22px rgba(0, 0, 0, 0.75),
      0 0 0 6px rgba(99, 102, 241, 0);
  }
}

.side-action-btn:hover {
  animation-play-state: paused;
  transform: translateY(-2px) scale(1.13);
  background: linear-gradient(180deg, rgba(67, 56, 202, 0.88) 0%, rgba(25, 33, 62, 0.94) 100%);
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.6),
    0 10px 25px rgba(0, 0, 0, 0.8),
    0 0 22px rgba(99, 102, 241, 0.65);
}

.side-action-btn:active {
  transform: translateY(1px) scale(0.95) !important;
}

.side-action-btn.like-btn[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(219, 39, 119, 0.88) 0%, rgba(131, 24, 67, 0.92) 100%);
  border-color: #F472B6;
  color: #FFFFFF;
  box-shadow:
    inset 0 2px 1.5px rgba(255, 255, 255, 0.5),
    0 6px 18px rgba(0, 0, 0, 0.7),
    0 0 22px rgba(236, 72, 153, 0.75);
}

.side-action-btn.like-btn[aria-pressed="true"] .heart-svg {
  fill: #FFFFFF;
}

.side-action-btn.info-action-btn.is-active {
  background: linear-gradient(180deg, rgba(79, 70, 229, 0.92) 0%, rgba(49, 46, 129, 0.96) 100%);
  border-color: #A5B4FC;
  color: #FFFFFF;
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.55),
    0 6px 20px rgba(0, 0, 0, 0.75),
    0 0 22px rgba(99, 102, 241, 0.8);
}

.action-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(248, 250, 252, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95), 0 0 8px rgba(0, 0, 0, 0.8);
}

/* =========================================
   Efecto de Corazones Flotantes
========================================= */
.floating-hearts-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 38;
}

.floating-heart {
  position: absolute;
  bottom: 5rem;
  right: 2rem;
  font-size: 1.5rem;
  color: var(--color-accent);
  animation: floatUpHeart 1.2s ease-out forwards;
}

@keyframes floatUpHeart {
  0% {
    opacity: 1;
    transform: translateY(0) scale(0.6) rotate(0deg);
  }
  50% {
    transform: translateY(-80px) scale(1.3) rotate(15deg);
  }
  100% {
    opacity: 0;
    transform: translateY(-160px) scale(1) rotate(-15deg);
  }
}

/* =========================================
   Modal de Finalización de Historia (Victoria vs Derrota)
========================================= */
.player-ending-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(5, 6, 10, 0.92);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
  animation: fadeIn var(--transition-base);
}

.player-ending-overlay.ending-state-victory {
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.16) 0%, rgba(5, 6, 10, 0.94) 75%);
}

.player-ending-overlay.ending-state-defeat {
  background: radial-gradient(circle at center, rgba(220, 38, 38, 0.22) 0%, rgba(8, 5, 8, 0.95) 75%);
}

.ending-fx-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* Piezas de Confeti para Victoria */
.confetti-piece {
  position: absolute;
  top: -24px;
  opacity: 0.95;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% {
    transform: translate3d(0, -20px, 0) rotateX(0deg) rotateY(0deg) rotateZ(0deg);
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--confetti-drift, 40px), 105vh, 0) rotateX(540deg) rotateY(360deg) rotateZ(420deg);
    opacity: 0;
  }
}

/* Destello y brasas rojas para Derrota */
.defeat-screen-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(239, 68, 68, 0.45) 0%, rgba(185, 28, 28, 0.2) 60%, transparent 100%);
  animation: defeatFlashOut 0.85s ease-out forwards;
}

@keyframes defeatFlashOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

.defeat-ember-particle {
  position: absolute;
  bottom: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, #FCA5A5 0%, #EF4444 60%, transparent 100%);
  box-shadow: 0 0 12px #EF4444;
  opacity: 0.85;
  animation: defeatEmberRise ease-out forwards;
}

@keyframes defeatEmberRise {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-75vh) scale(0.2);
    opacity: 0;
  }
}

.ending-content-card {
  background: linear-gradient(180deg, rgba(22, 28, 48, 0.95) 0%, rgba(13, 16, 28, 0.98) 100%);
  border: 1.5px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-2xl);
  padding: 2.3rem 2rem;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 50px rgba(99, 102, 241, 0.25);
  animation: scaleIn var(--transition-spring);
}

.ending-state-victory .ending-content-card {
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.22),
    0 24px 65px rgba(0, 0, 0, 0.92),
    0 0 55px rgba(245, 158, 11, 0.28),
    0 0 30px rgba(16, 185, 129, 0.22);
}

.ending-state-defeat .ending-content-card {
  background: linear-gradient(180deg, rgba(38, 14, 22, 0.96) 0%, rgba(18, 9, 14, 0.99) 100%);
  border-color: rgba(239, 68, 68, 0.65);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.15),
    0 24px 65px rgba(0, 0, 0, 0.95),
    0 0 60px rgba(239, 68, 68, 0.38);
}

.ending-content-card.defeat-shake {
  animation: defeatCardShake 0.55s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes defeatCardShake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-9px) rotate(-0.8deg); }
  30%, 60%, 90% { transform: translateX(9px) rotate(0.8deg); }
}

.ending-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.34rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34D399;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.25);
}

.ending-state-defeat .ending-status-pill {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.ending-state-defeat .ending-trophy-ring {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.55);
  box-shadow: 0 0 35px rgba(239, 68, 68, 0.4);
}

.ending-state-defeat .ending-heading {
  color: #FECACA;
}

.ending-state-defeat .ending-btn-replay {
  background: linear-gradient(180deg, #EF4444 0%, #B91C1C 100%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 3px solid #7F1D1D;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    0 8px 25px rgba(239, 68, 68, 0.55);
  animation: decisionHeartbeatPink 1.8s ease-in-out infinite;
}

.ending-youtube-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.ending-youtube-box[hidden] {
  display: none !important;
}

.ending-youtube-label {
  font-size: 0.78rem;
  color: #CBD5E1;
  font-weight: 600;
}

.btn-ending-youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, #FF2A2A 0%, #CC0000 100%);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-bottom: 2.5px solid #880000;
  color: #FFFFFF;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.45),
    0 6px 20px rgba(239, 68, 68, 0.48);
  transition: all 0.2s ease;
}

.btn-ending-youtube:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    inset 0 1.5px 1px rgba(255, 255, 255, 0.6),
    0 8px 25px rgba(239, 68, 68, 0.75);
}

.ending-btn-close-corner {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94A3B8;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ending-btn-close-corner:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #EF4444;
  transform: scale(1.08);
}

.ending-btn-close-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ending-btn-close-action:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
}

.ending-trophy-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  border: 2px solid rgba(245, 158, 11, 0.4);
  display: grid;
  place-items: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.ending-heading {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.5rem;
}

.ending-subtext {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
  margin: 0 0 2rem;
  line-height: 1.5;
}

.ending-stats-panel {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
}

.stat-caption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--color-border);
}

.ending-actions-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.ending-btn-replay {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 650;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.4);
  transition: all var(--transition-fast);
}

.ending-btn-replay:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(236, 72, 153, 0.6);
}

.ending-btn-explore {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.ending-btn-explore:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Toast flotante */
.player-toast {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-full);
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(16, 185, 129, 0.4);
  backdrop-filter: blur(16px);
  color: #F8FAFC;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  animation: slideUp var(--transition-fast);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .player-meta-overlay {
    max-width: 85%;
  }
  .player-decisions {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.65rem !important;
    padding: 1rem 1.25rem max(6.5rem, calc(env(safe-area-inset-bottom, 0px) + 5.5rem)) !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }
  .decision-btn:not(.decision-btn-positioned):not(.decision-btn-target) {
    width: min(100%, 360px) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 48px !important;
    padding: 0.75rem 1.25rem !important;
    font-size: 0.94rem !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    word-break: break-word !important;
    text-align: center !important;
    flex-shrink: 0 !important;
  }
  .side-action-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 420px) {
  .player-decisions {
    gap: 0.5rem !important;
    padding-inline: 0.85rem !important;
    padding-bottom: max(6rem, calc(env(safe-area-inset-bottom, 0px) + 5rem)) !important;
  }
  .decision-btn:not(.decision-btn-positioned):not(.decision-btn-target) {
    font-size: 0.88rem !important;
    padding: 0.65rem 1rem !important;
    min-height: 44px !important;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .player-decisions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding-bottom: 3.5rem !important;
    padding-inline: 0.75rem !important;
  }
  .decision-btn:not(.decision-btn-positioned):not(.decision-btn-target) {
    width: auto !important;
    min-width: 120px !important;
    max-width: 260px !important;
    padding: 0.45rem 0.85rem !important;
    font-size: 0.8rem !important;
    min-height: 36px !important;
  }
}

/* ==========================================================================
   Pantalla de Inicio / Carátula Cinemática de la Historia (Player Splash)
   ========================================================================== */
.player-start-screen {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #05060A;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.player-start-screen.dismissed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-screen-backdrop {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(28px) brightness(0.35);
  transform: scale(1.08);
  transition: background-image 0.4s ease;
}

.start-screen-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.4) 0%, rgba(5, 6, 10, 0.88) 100%);
}

.start-card-container {
  position: relative;
  z-index: 2;
  width: min(92%, 520px);
  max-height: 90dvh;
  overflow-y: auto;
  scrollbar-width: none;
}

.start-card-container::-webkit-scrollbar {
  display: none;
}

.start-card {
  position: relative;
  background: rgba(15, 20, 35, 0.88);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 50px rgba(99, 102, 241, 0.25), 0 0 25px rgba(236, 72, 153, 0.15);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(99, 102, 241, 0.4) 50%, rgba(236, 72, 153, 0.3) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.start-card-cover-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #080c14;
  overflow: hidden;
  cursor: pointer;
}

.start-card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.start-card-cover-wrap:hover .start-card-cover-img {
  transform: scale(1.06);
}

.start-card-cover-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--color-primary-light);
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, #080c14 100%);
}

.start-card-category-tag {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(9, 10, 16, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.32rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #06B6D4;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.start-card-category-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06B6D4;
  box-shadow: 0 0 6px #06B6D4;
}

.start-play-pulse-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.8), 0 0 20px rgba(236, 72, 153, 0.5);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  animation: startRadarPulse 2.2s infinite;
}

@keyframes startRadarPulse {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7), 0 0 30px rgba(99, 102, 241, 0.6); }
  70% { box-shadow: 0 0 0 20px rgba(99, 102, 241, 0), 0 0 40px rgba(236, 72, 153, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0), 0 0 30px rgba(99, 102, 241, 0.6); }
}

.start-card-cover-wrap:hover .start-play-pulse-btn {
  transform: scale(1.12);
  box-shadow: 0 0 50px rgba(236, 72, 153, 0.95);
}

.start-card-info {
  padding: 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.start-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.start-user-progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
}

.start-user-progress-badge[hidden] {
  display: none !important;
}

.start-user-progress-badge.status-won {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(245, 158, 11, 0.22) 100%);
  border: 1px solid rgba(52, 211, 153, 0.65);
  color: #6EE7B7;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.start-user-progress-badge.status-lost {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #FCA5A5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.start-interactive-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #A5B4FC;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
}

.start-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 10px #34D399;
  animation: pulse 1.6s infinite;
}

.start-card-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.7rem);
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}

.start-card-desc {
  font-size: 0.92rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.start-card-author-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.start-author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #FFFFFF;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.start-author-name {
  color: #F8FAFC;
  font-weight: 600;
}

.start-scenes-tag {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 600;
  color: #E2E8F0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}

.btn-start-story {
  position: relative;
  margin-top: 0.6rem;
  min-height: 52px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--gradient-brand);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-bottom: 3.5px solid rgba(67, 56, 202, 0.98);
  border-radius: var(--radius-full);
  color: #FFFFFF;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.45);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    inset 0 2px 1.5px rgba(255, 255, 255, 0.5),
    inset 0 -3px 6px rgba(0, 0, 0, 0.35),
    0 4px 0 rgba(49, 46, 129, 0.95),
    0 12px 32px rgba(99, 102, 241, 0.55),
    0 0 22px rgba(236, 72, 153, 0.4);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  animation: startBtnHeartbeat 2.2s ease-in-out infinite;
}

@keyframes startBtnHeartbeat {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      inset 0 2px 1.5px rgba(255, 255, 255, 0.5),
      inset 0 -3px 6px rgba(0, 0, 0, 0.35),
      0 4px 0 rgba(49, 46, 129, 0.95),
      0 12px 32px rgba(99, 102, 241, 0.55),
      0 0 0 0 rgba(99, 102, 241, 0.6),
      0 0 22px rgba(236, 72, 153, 0.4);
  }
  50% {
    transform: translateY(-2px) scale(1.025);
    box-shadow:
      inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
      inset 0 -3px 6px rgba(0, 0, 0, 0.3),
      0 6px 0 rgba(49, 46, 129, 0.95),
      0 16px 38px rgba(99, 102, 241, 0.7),
      0 0 0 9px rgba(99, 102, 241, 0),
      0 0 32px rgba(236, 72, 153, 0.65);
  }
}

.btn-start-story::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-25deg);
  pointer-events: none;
  animation: decisionShimmerSweep 3.4s ease-in-out infinite;
}

.btn-start-story:hover {
  animation-play-state: paused;
  transform: translateY(-4px) scale(1.03);
  box-shadow:
    inset 0 2.5px 2px rgba(255, 255, 255, 0.65),
    0 6px 0 rgba(49, 46, 129, 0.98),
    0 16px 42px rgba(99, 102, 241, 0.75),
    0 0 38px rgba(236, 72, 153, 0.65);
}

/* ==========================================================================
   ADAPTACIÓN DINÁMICA POR ORIENTACIÓN (VERTICAL 9:16 vs HORIZONTAL 16:9)
   ========================================================================== */

/* --- 1. MODO VIDEO VERTICAL (SHORTS / REELS / HISTORIAS) --- */
.video-orientation-vertical .player-viewport {
  width: calc(100vh * (9 / 16)) !important;
  max-width: min(100vw, 460px) !important;
  height: 100% !important;
  aspect-ratio: 9 / 16 !important;
  border-radius: 20px;
  box-shadow: 0 0 90px rgba(0, 0, 0, 0.95), 0 0 40px rgba(99, 102, 241, 0.3) !important;
  margin: 0 auto !important;
}

/* En dispositivos móviles en vertical, el video vertical cubre la pantalla limpia de borde a borde */
@media (max-width: 768px) and (orientation: portrait) {
  .video-orientation-vertical .player-viewport {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    aspect-ratio: auto !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* Botones de decisión para videos verticales */
.video-orientation-vertical .player-decisions {
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-end !important;
  padding-bottom: 7.5rem !important;
  padding-inline: 1.25rem !important;
  gap: 0.85rem !important;
}

.video-orientation-vertical .decision-btn:not(.decision-btn-positioned):not(.decision-btn-target) {
  width: min(320px, 90%) !important;
  min-width: 160px !important;
  padding: 0.9rem 1.4rem !important;
  font-size: 0.95rem !important;
}

/* --- 2. MODO VIDEO HORIZONTAL (ESTILO YOUTUBE 16:9) --- */
.video-orientation-horizontal .player-viewport {
  width: 100%;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
}

@media (min-aspect-ratio: 16/9) {
  .video-orientation-horizontal .player-viewport {
    height: 100% !important;
    width: calc(100vh * (16 / 9)) !important;
    max-width: 100% !important;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.95) !important;
    border-radius: 0;
  }
}

/* En móvil portrait con video horizontal: centrar video 16:9 sin barras molestas sobre el UI */
@media (orientation: portrait) {
  .video-orientation-horizontal .player-viewport {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-height: 100% !important;
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.85) !important;
  }
}

/* Botones de decisión en modo horizontal */
.video-orientation-horizontal .player-decisions {
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: flex-end !important;
  justify-content: center !important;
  gap: 0.85rem !important;
  padding-bottom: 4.8rem !important;
  padding-inline: 1.5rem !important;
}

.video-orientation-horizontal .decision-btn:not(.decision-btn-positioned):not(.decision-btn-target) {
  width: auto !important;
  min-width: 160px !important;
  max-width: 320px !important;
  padding: 0.75rem 1.5rem !important;
  font-size: 0.92rem !important;
}

/* --- 3. OPTIMIZACIÓN ULTRA-LIMPIA EN HORIZONTAL (MOBILE LANDSCAPE) --- */
@media (orientation: landscape) and (max-height: 560px) {
  .player-floating-header {
    padding: 0.35rem 1rem !important;
  }
  .player-back-btn {
    padding: 0.3rem 0.75rem !important;
    font-size: 0.78rem !important;
  }
  .player-logo-badge {
    font-size: 0.72rem !important;
  }
  .player-current-node-label {
    display: none !important;
  }
  .player-icon-action-btn {
    width: 32px !important;
    height: 32px !important;
  }
  .story-progress-strip {
    top: 2.6rem !important;
    left: 1rem !important;
    right: 1rem !important;
  }
  .player-slow-motion-badge {
    top: 3.2rem !important;
    padding: 0.25rem 0.65rem !important;
    font-size: 0.7rem !important;
  }
  .player-decision-timer {
    top: 3.2rem !important;
    padding: 0.35rem 0.9rem !important;
    font-size: 0.78rem !important;
  }
  .player-decisions {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: flex-end !important;
    justify-content: center !important;
    gap: 0.55rem !important;
    padding-bottom: 1.75rem !important;
    padding-inline: 1rem !important;
  }
  .decision-btn:not(.decision-btn-positioned):not(.decision-btn-target) {
    width: auto !important;
    min-width: 130px !important;
    max-width: 250px !important;
    padding: 0.5rem 0.9rem !important;
    font-size: 0.82rem !important;
    min-height: 36px !important;
  }
  .player-bottom-scrim {
    padding: 0.65rem 1rem !important;
    background: transparent !important;
  }
  .player-meta-overlay {
    max-height: 75dvh !important;
    padding: 0.85rem 1rem !important;
  }
  .player-creator-pill {
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem !important;
    margin-bottom: 0.1rem !important;
  }
  .creator-avatar {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.72rem !important;
  }
  .story-overlay-title {
    font-size: 0.92rem !important;
    margin-bottom: 0.1rem !important;
  }
  .player-side-actions {
    gap: 0.45rem !important;
  }
  .side-action-btn {
    width: 34px !important;
    height: 34px !important;
  }
  .side-action-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
  .action-label {
    font-size: 0.68rem !important;
  }

  /* Portada adaptable en Landscape */
  .start-card-container {
    width: min(94%, 740px) !important;
    max-height: 94dvh !important;
  }
  .start-card {
    flex-direction: row !important;
    align-items: stretch !important;
  }
  .start-card-cover-wrap {
    width: 44% !important;
    aspect-ratio: auto !important;
    min-height: 210px !important;
    flex-shrink: 0 !important;
  }
  .start-card-info {
    width: 56% !important;
    padding: 1rem 1.25rem !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  .start-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.start-user-progress-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.03em;
}

.start-user-progress-badge[hidden] {
  display: none !important;
}

.start-user-progress-badge.status-won {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(245, 158, 11, 0.22) 100%);
  border: 1px solid rgba(52, 211, 153, 0.65);
  color: #6EE7B7;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}

.start-user-progress-badge.status-lost {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.55);
  color: #FCA5A5;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.start-interactive-pill {
    margin-bottom: 0.4rem !important;
    font-size: 0.72rem !important;
  }
  .start-card-title {
    font-size: 1.15rem !important;
    margin-bottom: 0.25rem !important;
  }
  .start-card-desc {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.5rem !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .start-card-author-row {
    margin-bottom: 0.6rem !important;
  }
  .btn-start-story {
    min-height: 42px !important;
    padding: 0.55rem 1.1rem !important;
    font-size: 0.88rem !important;
  }

  /* Pantalla final adaptable en Landscape */
  .ending-content-card {
    max-width: 620px !important;
    padding: 1rem 1.4rem !important;
  }
  .ending-trophy-ring {
    width: 46px !important;
    height: 46px !important;
    margin: 0 auto 0.4rem !important;
  }
  .ending-heading {
    font-size: 1.2rem !important;
    margin-bottom: 0.2rem !important;
  }
  .ending-subtext {
    font-size: 0.8rem !important;
    margin-bottom: 0.5rem !important;
  }
  .ending-stats-panel {
    padding: 0.4rem 0.9rem !important;
    margin: 0.4rem 0 !important;
  }
  .stat-number {
    font-size: 1.15rem !important;
  }
  .stat-caption {
    font-size: 0.72rem !important;
  }
  .ending-actions-row {
    gap: 0.55rem !important;
  }
  .ending-btn-replay, .ending-btn-explore, .ending-btn-close-action {
    padding: 0.5rem 0.9rem !important;
    font-size: 0.82rem !important;
  }
}

/* ==========================================================================
   4. OVERLAY / BANNER DE GIRO DE DISPOSITIVO ("GIRA TU DISPOSITIVO")
   ========================================================================== */
.player-rotate-prompt {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.3s ease;
}

.rotate-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.rotate-prompt-card {
  position: relative;
  z-index: 2;
  width: min(92%, 410px);
  background: rgba(18, 22, 38, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.6rem;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.92), 0 0 40px rgba(99, 102, 241, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: scaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Animación de giro cinemático del teléfono */
.rotate-phone-animation {
  position: relative;
  width: 95px;
  height: 95px;
  margin-bottom: 1.1rem;
  display: grid;
  place-items: center;
}

.phone-device-icon {
  width: 42px;
  height: 70px;
  border: 3px solid #6366F1;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.15);
  position: relative;
  box-shadow: 0 0 22px rgba(99, 102, 241, 0.45);
  animation: phoneRotateLoop 3s ease-in-out infinite;
  transform-origin: center center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-screen-glare {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  height: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, transparent 100%);
  border-radius: 4px;
}

.phone-cam-dot {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #A5B4FC;
  border-radius: 50%;
}

.phone-inner-display {
  color: #EC4899;
  opacity: 0.9;
  transform: scale(0.85);
}

.rotate-arrow-indicator {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #38BDF8;
  pointer-events: none;
  animation: rotateArrowPulse 3s ease-in-out infinite;
}

@keyframes phoneRotateLoop {
  0%, 15% {
    transform: rotate(0deg);
    border-color: #6366F1;
    box-shadow: 0 0 22px rgba(99, 102, 241, 0.45);
  }
  45%, 75% {
    transform: rotate(90deg);
    border-color: #EC4899;
    box-shadow: 0 0 28px rgba(236, 72, 153, 0.65);
  }
  95%, 100% {
    transform: rotate(0deg);
    border-color: #6366F1;
    box-shadow: 0 0 22px rgba(99, 102, 241, 0.45);
  }
}

@keyframes rotateArrowPulse {
  0%, 15% {
    opacity: 0.3;
    transform: scale(0.92);
  }
  45%, 75% {
    opacity: 1;
    transform: scale(1.1) rotate(90deg);
  }
  95%, 100% {
    opacity: 0.3;
    transform: scale(0.92);
  }
}

.rotate-prompt-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #A5B4FC;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.rotate-prompt-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: #FFFFFF;
  letter-spacing: -0.01em;
}

.rotate-prompt-desc {
  font-size: 0.88rem;
  line-height: 1.48;
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 1.4rem;
}

.rotate-prompt-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.btn-rotate-fullscreen {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  border: none;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.btn-rotate-fullscreen:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.7);
}

.btn-rotate-dismiss {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.75);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-rotate-dismiss:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

/* Chip flotante discreto de orientación */
.player-orientation-chip {
  position: absolute;
  top: 4.8rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background: rgba(18, 22, 38, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #A5B4FC;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.65), 0 0 16px rgba(99, 102, 241, 0.35);
  animation: scaleIn 0.3s ease;
  transition: all 0.2s;
}

.player-orientation-chip:hover {
  background: rgba(99, 102, 241, 0.35);
  color: #fff;
  transform: translateX(-50%) scale(1.05);
}

/* ==========================================================================
   5. MODAL CINEMÁTICO DE COMPARTIR EN REDES SOCIALES
   ========================================================================== */
.player-share-modal {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  animation: fadeIn 0.25s ease;
}

.share-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 6, 10, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.share-modal-card {
  position: relative;
  z-index: 2;
  width: min(92%, 460px);
  background: rgba(18, 22, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(99, 102, 241, 0.3);
  display: flex;
  flex-direction: column;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.share-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.2s;
}

.share-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.share-modal-header {
  text-align: left;
  margin-bottom: 1.25rem;
}

.share-modal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #A5B4FC;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.share-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.3rem;
  color: #FFFFFF;
}

.share-modal-subtitle {
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  line-height: 1.4;
}

/* Tarjeta de previsualización visual con carátula */
.share-preview-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  padding: 0.75rem;
  background: rgba(9, 11, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  margin-bottom: 1.4rem;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.4);
}

.share-preview-img-wrap {
  position: relative;
  width: 90px;
  height: 68px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.share-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.share-preview-badge {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0, 0, 0, 0.85);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  color: #F8FAFC;
}

.share-preview-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.share-preview-creator {
  font-size: 0.72rem;
  color: #A5B4FC;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.share-preview-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 0.35rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-preview-cta {
  font-size: 0.72rem;
  color: #38BDF8;
  font-weight: 600;
}

/* Cuadrícula de Redes Sociales */
.share-networks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.share-network-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.75rem 0.4rem;
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.74rem;
  font-weight: 700;
  color: #FFFFFF;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid transparent;
}

.share-network-btn .network-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform 0.2s ease;
}

.share-network-btn:hover {
  transform: translateY(-3px);
}

.share-network-btn:hover .network-icon {
  transform: scale(1.1);
}

/* Colores de marca */
.share-whatsapp {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.35);
}
.share-whatsapp .network-icon {
  background: #25D366;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.45);
}

.share-telegram {
  background: rgba(0, 136, 204, 0.12);
  border-color: rgba(0, 136, 204, 0.35);
}
.share-telegram .network-icon {
  background: #0088cc;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.45);
}

.share-facebook {
  background: rgba(24, 119, 242, 0.12);
  border-color: rgba(24, 119, 242, 0.35);
}
.share-facebook .network-icon {
  background: #1877F2;
  color: #FFFFFF;
  box-shadow: 0 4px 15px rgba(24, 119, 242, 0.45);
}

.share-twitter {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}
.share-twitter .network-icon {
  background: #000000;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* Caja de copiar enlace */
.share-copy-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(9, 11, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.3rem 0.3rem 1rem;
}

.share-copy-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.85);
  font-family: inherit;
  font-size: 0.84rem;
}

.btn-copy-share-url {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  background: var(--gradient-brand);
  border: none;
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-copy-share-url:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.side-action-btn.dislike-btn[aria-pressed="true"],
.side-action-btn.dislike-btn.is-active {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.65);
  color: #FCA5A5;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.45);
}
.side-action-btn.dislike-btn[aria-pressed="true"] svg,
.side-action-btn.dislike-btn.is-active svg {
  fill: currentColor;
}



