/* ==========================================================
   © 2026 BlueUniversostudios. Todos los derechos reservados.
   Prohibida la copia, descarga o redistribución sin autorización escrita.
   ==========================================================
   JULIETA RAMÍREZ · Cinema Player — Estilos v5 (streaming seguro)
   Dirección de arte: ROJO VINO profundo · ORO líquido
   Vídeo vertical 9:16 como "portal" central · solo Play + Pantalla completa
   ========================================================== */

:root {
  --bg: #12040c;
  --bg-2: #1c0714;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.08);
  --border: rgba(240, 207, 134, 0.14);
  --border-strong: rgba(240, 207, 134, 0.30);
  --text: #f8efe4;
  --text-dim: rgba(248, 239, 228, 0.62);
  --text-faint: rgba(248, 239, 228, 0.36);
  --gold: #edc87a;
  --gold-2: #c09442;
  --gold-3: #8c6522;
  --gold-glow: rgba(237, 200, 122, 0.48);
  /* Rojo vino (sustituye al antiguo cian; se conservan los nombres de variable) */
  --wine: #7b1230;
  --wine-deep: #4a0a1d;
  --wine-light: #a8203f;
  --cyan: #c74a63;
  --cyan-glow: rgba(168, 32, 63, 0.45);
  --violet: #5c0f22;
  --r-xl: 32px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --font-display: 'Unbounded', system-ui, sans-serif;
  --font-body: 'Inter Tight', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --dock-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

body.is-loading { overflow: hidden; }

/* ---------- Protección de contenido ---------- */
html, body {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img, svg, video {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}
button, a, .warning-close { pointer-events: auto; }
.player-video { pointer-events: none; }
body.is-warning-open { overflow: hidden; }

/* Al abrir DevTools el vídeo se oculta hasta cerrar el aviso */
body.is-devtools .player-video { filter: blur(24px) brightness(.25); }

/* La marca de agua permanece visible en pantalla completa */
.watermark {
  position: absolute; right: 16px; bottom: 16px; z-index: 6;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(246, 243, 236, 0.55);
  text-shadow: 0 1px 6px rgba(0,0,0,.8);
  pointer-events: none; user-select: none;
}
.portal-frame:fullscreen .watermark,
.portal-frame:-webkit-full-screen .watermark,
.portal-frame.is-pseudo-fs .watermark {
  right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); font-size: 11px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

.mono { font-family: var(--font-mono); font-feature-settings: 'tnum'; }

::selection { background: var(--gold-glow); color: #000; }

/* ---------- Intro ---------- */
.intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  gap: 18px;
  background: var(--bg);
  text-align: center;
  transition: opacity 0.9s var(--ease-io), visibility 0.9s;
}
.intro.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.intro {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(123, 18, 48, 0.55), transparent 70%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  padding: 32px 26px;
}

.intro-ring {
  width: 104px; height: 104px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(237, 200, 122, 0.28);
  position: relative;
  animation: intro-ring 1.6s var(--ease) both;
}
.intro-ring::before, .intro-ring::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  border-top-color: var(--gold);
  border-right-color: var(--wine-light);
  animation: spin 1.4s linear infinite;
}
.intro-ring::after { inset: 14px; animation-direction: reverse; animation-duration: 2.2s; opacity: .6; }

/* Nombre grande de la intro */
.intro-word {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 9vw, 86px);
  line-height: 1.02;
  letter-spacing: 0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.intro-line { display: flex; justify-content: center; }
.intro-word span span,
.intro-line > span {
  display: inline-block;
  background: linear-gradient(175deg, #fff8e8 0%, var(--gold) 45%, var(--gold-2) 78%, var(--gold-3) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 6px 26px rgba(123, 18, 48, 0.65));
  opacity: 0;
  transform: translateY(24px);
  animation: letter-in 0.75s var(--ease) forwards;
  animation-delay: calc(0.14s + var(--i, 0) * 0.055s);
}

/* Filete dorado bajo el nombre */
.intro-rule {
  width: min(320px, 70vw);
  height: 1px;
  margin: 4px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
  opacity: 0;
  animation: fade-in .9s 1.0s both;
}

/* Cargo en letra pequeña */
.intro-sub {
  margin: 0 auto;
  max-width: 44ch;
  font-family: var(--font-body);
  font-size: clamp(11.5px, 2.9vw, 14px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.07em;
  text-transform: none;
  text-wrap: balance;
  color: rgba(248, 239, 228, 0.72);
  animation: fade-in 1s 1.15s both;
}

/* ---------- Fondo ---------- */
.backdrop {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
}
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  mix-blend-mode: screen;
  will-change: transform;
}
.aurora--a {
  width: 70vmax; height: 70vmax; top: -30vmax; left: -20vmax;
  background: radial-gradient(circle, rgba(237, 200, 122, 0.22), transparent 60%);
  animation: drift-a 26s var(--ease-io) infinite alternate;
}
.aurora--b {
  width: 60vmax; height: 60vmax; bottom: -30vmax; right: -15vmax;
  background: radial-gradient(circle, rgba(168, 32, 63, 0.40), transparent 62%);
  animation: drift-b 30s var(--ease-io) infinite alternate;
}
.aurora--c {
  width: 45vmax; height: 45vmax; top: 40%; left: 50%;
  background: radial-gradient(circle, rgba(123, 18, 48, 0.34), transparent 62%);
  animation: drift-c 22s var(--ease-io) infinite alternate;
}
.backdrop-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(237,200,122,0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(237,200,122,0.055) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 20%, transparent 100%);
}
.backdrop-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 38%, rgba(18,4,12,0.92) 100%);
}
.backdrop-noise {
  position: absolute; inset: -50%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 0.6s steps(2) infinite;
}

/* ---------- Cabecera ---------- */
.site-header {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(18px, 3vw, 30px) clamp(20px, 4vw, 48px);
  gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.brand-sigil {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--gold);
  box-shadow: inset 0 0 20px rgba(237,200,122,0.10);
}
.brand-sigil svg { animation: spin 40s linear infinite; }
.brand-text { display: flex; flex-direction: column; line-height: 1; gap: 5px; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.26em;
}
.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint);
}
.header-nav { display: flex; align-items: center; gap: 10px; }
.header-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--text-dim);
  backdrop-filter: blur(10px);
}
.header-chip--mono { font-family: var(--font-mono); letter-spacing: 0.14em; color: var(--gold); }
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  transition: all .4s var(--ease);
}
.header-chip.is-live .chip-dot {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
  animation: pulse 1.6s var(--ease-io) infinite;
}

/* ---------- Escenario ---------- */
.stage {
  position: relative; z-index: 2;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(280px, 420px);
  grid-auto-rows: min-content;
  justify-content: center;
  align-content: center;
  gap: clamp(18px, 3vw, 28px);
  padding: 8px clamp(20px, 4vw, 48px) clamp(24px, 4vw, 48px);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Texto solo para lectores de pantalla (accesibilidad / SEO sin mostrarlo) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Titular (retirado del HTML; estilos conservados) ---------- */
.headline {
  text-align: center;
  animation: rise 1s .15s var(--ease) both;
}
.headline-kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(237, 200, 122, 0.28);
  background: linear-gradient(180deg, rgba(123,18,48,0.55), rgba(74,10,29,0.35));
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold);
  text-wrap: balance;
}
.headline-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 8.5vw, 54px);
  line-height: 1.04;
  letter-spacing: 0.005em;
  background: linear-gradient(175deg, #fff8e8 0%, var(--gold) 45%, var(--gold-2) 80%, var(--gold-3) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 8px 30px rgba(123, 18, 48, 0.6));
}
.headline-name::after {
  content: '';
  display: block;
  width: min(220px, 60%);
  height: 1px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.headline-role {
  margin: 12px auto 0;
  max-width: 40ch;
  font-size: clamp(12px, 3vw, 13.5px);
  line-height: 1.6;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  text-wrap: balance;
}

/* Paneles vidrio */
.panel {
  position: relative;
  padding: clamp(22px, 2.4vw, 32px);
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015));
  border: 1px solid var(--border);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 30px 80px -40px rgba(0,0,0,0.9), inset 0 1px 0 rgba(255,255,255,0.08);
  animation: rise 1s var(--ease) both;
}
.panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(237,200,122,0.40), transparent 40%, transparent 60%, rgba(168,32,63,0.35));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.panel--console { animation-delay: .2s; align-self: center; }

.eyebrow {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold);
}
.eyebrow--sm { font-size: 10px; color: var(--text-faint); margin-bottom: 12px; }
.eyebrow-line { width: 22px; height: 1px; background: currentColor; opacity: .7; }

/* ---------- Portal (vídeo vertical) ---------- */
.portal {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  justify-self: center;
  width: 100%;
  animation: rise 1s var(--ease) both;
  /* Sin `perspective` aquí: crearía un contenedor para position:fixed y rompería
     la pantalla completa simulada en iOS. La perspectiva va en el transform del JS. */
}
.portal-halo {
  position: absolute;
  inset: -12% -30%;
  background:
    radial-gradient(ellipse 50% 60% at 50% 45%, rgba(237,200,122,0.22), transparent 70%),
    radial-gradient(ellipse 40% 40% at 50% 75%, rgba(168,32,63,0.30), transparent 70%);
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 1s var(--ease);
}
.portal-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 9 / 16;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: #000;
  box-shadow:
    0 60px 120px -40px rgba(0,0,0,0.95),
    0 0 0 1px rgba(237,200,122,0.22),
    0 0 90px -20px rgba(123,18,48,0.55);
  transition: transform .5s var(--ease), box-shadow .8s var(--ease);
}
.portal-frame.is-playing {
  box-shadow:
    0 60px 120px -40px rgba(0,0,0,0.95),
    0 0 0 1px rgba(237,200,122,0.45),
    0 0 120px -20px rgba(237,200,122,0.35),
    0 0 200px -60px rgba(168,32,63,0.55);
}
.portal-edge {
  position: absolute; inset: 0; z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 68%, rgba(168,32,63,0.85) 82%, rgba(237,200,122,0.95) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 1.5px;
  opacity: 0;
  transition: opacity .8s var(--ease);
  animation: rotate-angle 6s linear infinite;
}
.portal-frame.is-playing .portal-edge { opacity: 1; }

@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* Vídeo HTML5 */
.player-video {
  position: absolute; inset: 0; z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #000;
  display: block;
}
.portal-frame:fullscreen .player-video,
.portal-frame:-webkit-full-screen .player-video,
.portal-frame.is-pseudo-fs .player-video { object-fit: contain; }

/* Capa de toque para pausar / reanudar */
.tap-layer {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%;
  border-radius: 0;
  cursor: pointer;
}
.tap-layer:focus-visible { outline: none; }

/* Botón Pantalla completa (aparece tras el Play) */
.fullscreen-cta {
  position: absolute; z-index: 7;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  color: #14100a;
  background: linear-gradient(145deg, #fff3d1, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 18px 44px -14px rgba(237,200,122,0.75), 0 0 0 1px rgba(123,18,48,0.35), inset 0 1px 0 rgba(255,255,255,0.7);
  font-size: 13.5px; font-weight: 600; letter-spacing: 0.04em;
  white-space: nowrap;
  animation: unmute-in .5s var(--ease) both;
  transition: transform .3s var(--ease), box-shadow .3s;
}
.fullscreen-cta[hidden] { display: none; }
.fullscreen-cta:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 22px 50px -12px rgba(237,200,122,0.9), inset 0 1px 0 rgba(255,255,255,0.8); }
.fullscreen-cta:active { transform: translateX(-50%) scale(0.96); }

/* Indicador de pausa */
.pause-badge {
  position: absolute; z-index: 6;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 84px; height: 84px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(30, 6, 18, 0.66);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.pause-badge.is-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Línea de progreso en la base del portal */
.progress-line {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  height: 3px;
  background: rgba(255,255,255,0.08);
  opacity: 0; pointer-events: none;
  transition: opacity .6s var(--ease);
}
.portal-frame.is-playing .progress-line { opacity: 1; }
.progress-line-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold-2), var(--gold) 70%, #fff);
  box-shadow: 0 0 14px var(--gold-glow);
  transition: width .25s linear;
}

/* Activar sonido */
.unmute-button {
  position: absolute; z-index: 7;
  left: 50%; top: calc(64px + env(safe-area-inset-top));
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  color: #14100a;
  background: linear-gradient(145deg, #fff3d1, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 14px 34px -12px rgba(237,200,122,0.8);
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
  animation: unmute-in .5s var(--ease) both;
}
.unmute-button[hidden] { display: none; }
.unmute-button:active { transform: translateX(-50%) scale(0.96); }

/* Error del reproductor */
.player-error {
  position: absolute; inset: 0; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 28px;
  text-align: center;
  background: rgba(24, 5, 15, 0.93);
  color: var(--text);
}
.player-error[hidden] { display: none; }
.player-error svg { color: var(--gold); }
.player-error-title { margin: 6px 0 0; font-family: var(--font-display); font-size: 15px; font-weight: 500; letter-spacing: 0.06em; }
.player-error-text { margin: 0; font-size: 13px; line-height: 1.55; color: var(--text-dim); max-width: 320px; }
.player-error-retry {
  margin-top: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(237,200,122,0.5);
  color: var(--gold);
  font-size: 13px; font-weight: 500; letter-spacing: 0.04em;
  transition: background .3s;
}
.player-error-retry:hover { background: rgba(240,207,134,0.12); }

/* Overlay de inicio */
.portal-overlay {
  position: absolute; inset: 0; z-index: 5;
  overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background:
    radial-gradient(ellipse at 50% 60%, rgba(74,10,29,0.28), rgba(18,4,12,0.75) 80%),
    linear-gradient(180deg, rgba(18,4,12,0.35), rgba(18,4,12,0.65));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity .6s var(--ease), visibility .6s;
}
.portal-overlay.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.play-orb {
  position: relative;
  width: 118px; height: 118px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: transform .5s var(--ease);
}
.play-orb:hover { transform: scale(1.06); }
.play-orb:active { transform: scale(0.97); }
.orb-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(237,200,122,0.40);
}
.orb-ring--1 { animation: ripple 3s var(--ease-io) infinite; }
.orb-ring--2 { animation: ripple 3s 1s var(--ease-io) infinite; }
.orb-ring--3 { inset: 14px; border-color: rgba(168,32,63,0.65); border-style: dashed; animation: spin 24s linear infinite; }
.orb-core {
  position: relative; z-index: 1;
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #4a0a1d;
  background: linear-gradient(145deg, #fff3d1, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 20px 50px -14px rgba(237,200,122,0.7), 0 0 0 1px rgba(123,18,48,0.4), inset 0 1px 0 rgba(255,255,255,0.7);
}
.orb-core svg { margin-left: 4px; }
.overlay-caption {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--text-dim);
}

/* HUD */
.hud {
  position: absolute; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s var(--ease);
}
.hud--top { top: 0; }
.portal-frame.is-playing .hud { opacity: 1; }
.hud-rec {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.2em;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hud-rec-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff5a5a; box-shadow: 0 0 10px #ff5a5a; animation: pulse 1s var(--ease-io) infinite; }
.hud-mono {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}

.corner {
  position: absolute; z-index: 3;
  width: 22px; height: 22px;
  border: 1.5px solid rgba(240,207,134,0.6);
  pointer-events: none;
  opacity: 0; transition: opacity .6s var(--ease), transform .6s var(--ease);
  transform: scale(1.3);
}
.portal-frame.is-playing .corner { opacity: 1; transform: scale(1); }

/* Botón salir de pantalla completa (solo visible en fullscreen) */
.fs-exit {
  display: none;
  position: absolute; top: 14px; right: 14px; z-index: 6;
  width: 44px; height: 44px; border-radius: 50%;
  place-items: center;
  color: #fff;
  background: rgba(10,10,20,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background .3s, transform .3s var(--ease), opacity .4s;
}
.fs-exit:hover { background: rgba(240,207,134,0.25); }
.fs-exit:active { transform: scale(0.94); }

/* ---------- Pantalla completa (nativa o simulada) ---------- */
.portal-frame:fullscreen,
.portal-frame:-webkit-full-screen,
.portal-frame.is-pseudo-fs {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh; height: 100dvh;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
  box-shadow: none;
  transform: none !important;
  transition: none;
  z-index: 1000;
}
.portal-frame.is-pseudo-fs { z-index: 1000; }
.portal-frame.is-pseudo-fs .fs-exit,
.portal-frame:fullscreen .fs-exit,
.portal-frame:-webkit-full-screen .fs-exit {
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
}
.portal-frame.is-pseudo-fs .hud,
.portal-frame:fullscreen .hud,
.portal-frame:-webkit-full-screen .hud { top: env(safe-area-inset-top); }
.portal-frame:fullscreen .portal-edge,
.portal-frame:-webkit-full-screen .portal-edge,
.portal-frame.is-pseudo-fs .portal-edge,
.portal-frame:fullscreen .corner,
.portal-frame:-webkit-full-screen .corner,
.portal-frame.is-pseudo-fs .corner { display: none; }
.portal-frame:fullscreen .fs-exit,
.portal-frame:-webkit-full-screen .fs-exit,
.portal-frame.is-pseudo-fs .fs-exit { display: grid; }
.portal-frame:fullscreen .hud,
.portal-frame:-webkit-full-screen .hud,
.portal-frame.is-pseudo-fs .hud { padding: 24px 72px 24px 24px; }
.portal-frame:fullscreen .progress-line,
.portal-frame:-webkit-full-screen .progress-line,
.portal-frame.is-pseudo-fs .progress-line { bottom: env(safe-area-inset-bottom); }
body.is-fs-lock { overflow: hidden; }
.corner--tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.corner--tr { top: 14px; right: 14px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.corner--bl { bottom: 14px; left: 14px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.corner--br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }

/* Buffering */
.buffer-spinner {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0; transition: opacity .3s;
}
.buffer-spinner.is-visible { opacity: 1; }
.buffer-spinner span {
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}

/* ---------- Pie ---------- */
.site-footer {
  position: relative; z-index: 2;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 16px clamp(20px, 4vw, 48px) calc(20px + var(--dock-h));
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint);
  border-top: 1px solid rgba(255,255,255,0.05);
}

/* Insignia de tecnología de entrega (HLS / DASH / DRM / URL firmada) */
.stream-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 10px; letter-spacing: 0.14em;
  transition: color .4s, border-color .4s, box-shadow .4s;
}
.stream-badge-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-faint);
  transition: background .4s, box-shadow .4s;
}
.stream-badge.is-secure {
  color: var(--gold);
  border-color: rgba(237, 200, 122, 0.40);
  box-shadow: 0 0 18px -6px var(--gold-glow);
}
.stream-badge.is-secure .stream-badge-dot { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.stream-badge.is-plain { color: var(--text-dim); }
.stream-badge.is-plain .stream-badge-dot { background: var(--gold-2); }

/* Candado DRM en el HUD */
.hud-secure {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(237, 200, 122, 0.40);
  background: rgba(74, 10, 29, 0.55);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.18em;
  color: var(--gold);
  text-shadow: 0 0 8px var(--gold-glow);
}
.hud-secure[hidden] { display: none; }

/* ---------- Aviso de copyright ---------- */
.legal-notice {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px clamp(20px, 4vw, 48px) calc(22px + env(safe-area-inset-bottom));
  text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.45) 100%);
  border-top: 1px solid rgba(240, 207, 134, 0.14);
}
.legal-copy {
  margin: 0;
  font-family: var(--font-display); font-weight: 500;
  font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold);
}
.legal-copy strong { font-weight: 700; color: #fff; }
.legal-warning {
  margin: 0; max-width: 760px;
  display: inline-flex; align-items: flex-start; gap: 8px;
  padding: 10px 16px; border-radius: var(--r-md);
  font-size: 12px; line-height: 1.55; color: var(--text-dim);
  background: rgba(255, 77, 77, 0.06);
  border: 1px solid rgba(255, 77, 77, 0.22);
}
.legal-warning svg { flex: 0 0 auto; margin-top: 2px; color: #ff6b6b; }
.legal-warning strong { color: #ff8a8a; font-weight: 600; }

/* ---------- Modal de advertencia legal ---------- */
.warning-modal {
  position: fixed; inset: 0; z-index: 2147483647;
  display: grid; place-items: center;
  padding: 20px;
  background: rgba(4, 4, 10, 0.86);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  opacity: 0; transition: opacity .25s var(--ease);
}
.warning-modal[hidden] { display: none; }
.warning-modal.is-visible { opacity: 1; }
.warning-card {
  position: relative;
  width: min(560px, 100%);
  padding: 36px 30px 30px;
  border-radius: var(--r-xl);
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 77, 77, 0.18), transparent 60%),
    linear-gradient(180deg, #16060a 0%, #0a0a14 100%);
  border: 1px solid rgba(255, 77, 77, 0.45);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 30px 80px rgba(0,0,0,.7),
    0 0 60px rgba(255, 77, 77, 0.25);
  transform: translateY(14px) scale(.97);
  transition: transform .3s var(--ease);
  user-select: none;
}
.warning-modal.is-visible .warning-card { transform: none; }
.warning-card::before {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: repeating-linear-gradient(-45deg, rgba(255,77,77,.9) 0 14px, #f0cf86 14px 28px);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 5px no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% 5px no-repeat;
  opacity: .9;
}
.warning-icon {
  display: grid; place-items: center;
  width: 84px; height: 84px; margin: 0 auto 18px;
  border-radius: 50%; color: #ff5c5c;
  background: rgba(255, 77, 77, 0.10);
  border: 1px solid rgba(255, 77, 77, 0.45);
  box-shadow: 0 0 40px rgba(255, 77, 77, 0.35);
  animation: warn-pulse 1.6s ease-in-out infinite;
}
.warning-kicker {
  margin: 0 0 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
  color: #ff8a8a;
}
.warning-title {
  margin: 0 0 16px;
  font-family: var(--font-display); font-weight: 900;
  font-size: clamp(20px, 4.6vw, 30px); line-height: 1.15; letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 24px rgba(255, 77, 77, 0.5);
}
.warning-text {
  margin: 0 0 12px;
  font-size: 14px; line-height: 1.6; color: var(--text-dim);
}
.warning-text strong { color: #f6f3ec; font-weight: 600; }
.warning-text--strong {
  padding: 14px 16px; border-radius: var(--r-md);
  color: #ffd6d6;
  background: rgba(255, 77, 77, 0.10);
  border: 1px solid rgba(255, 77, 77, 0.35);
}
.warning-text--strong strong { color: #ff6b6b; font-weight: 700; letter-spacing: 0.04em; }
.warning-footer {
  margin: 16px 0 22px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--gold);
}
.warning-close {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 180px; padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: #04040a;
  background: linear-gradient(135deg, #ffd9a0, var(--gold) 45%, var(--gold-2));
  box-shadow: 0 10px 30px rgba(240, 207, 134, 0.3);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.warning-close:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(240, 207, 134, 0.42); }
.warning-close:active { transform: translateY(0); }
.warning-modal.is-shake .warning-card { animation: warn-shake .45s var(--ease-io); }

@keyframes warn-pulse { 0%,100% { box-shadow: 0 0 40px rgba(255,77,77,.35); } 50% { box-shadow: 0 0 64px rgba(255,77,77,.65); } }
@keyframes warn-shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); } 40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(6px); }
}

/* ---------- Impresión bloqueada ---------- */
@media print {
  body > *:not(.warning-modal) { display: none !important; }
  body::after {
    content: '© BlueUniversostudios · Todos los derechos reservados. Prohibida la copia, descarga, impresión o redistribución de este contenido sin autorización escrita.';
    display: block; padding: 40px; text-align: center;
    font: 700 18px/1.5 system-ui, sans-serif; color: #000;
  }
}

/* ---------- Animaciones ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes rotate-angle { to { --angle: 360deg; } }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
@keyframes ripple { 0% { transform: scale(0.9); opacity: .9; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes letter-in { to { opacity: 1; transform: none; } }
@keyframes intro-ring { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes unmute-in { from { opacity: 0; transform: translateX(-50%) translateY(-10px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes eq { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }
@keyframes grain { 0% { transform: translate(0,0); } 50% { transform: translate(-3%, 2%); } 100% { transform: translate(2%, -3%); } }
@keyframes drift-a { to { transform: translate(18vmax, 12vmax) scale(1.1); } }
@keyframes drift-b { to { transform: translate(-16vmax, -14vmax) scale(1.15); } }
@keyframes drift-c { to { transform: translate(-30%, -40%) scale(1.3); } }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .site-header { padding: calc(12px + env(safe-area-inset-top)) 18px 12px; }
  .brand-tag { display: none; }
  .brand-sigil { width: 40px; height: 40px; }
  .header-chip { padding: 7px 12px; font-size: 11px; }
  .stage {
    grid-template-columns: 1fr;
    padding: 4px 16px 20px;
  }
  .portal { position: static; gap: 14px; }
  .portal-frame { max-width: min(100%, 72svh * 9 / 16, 72vh * 9 / 16); border-radius: var(--r-lg); }
  .portal-halo { inset: -10% -20%; filter: blur(28px); }
  .play-orb { width: 104px; height: 104px; }
  .orb-core { width: 66px; height: 66px; }
  .fullscreen-cta { padding: 13px 20px; font-size: 13px; }
  .site-footer { flex-wrap: wrap; justify-content: center; }
  .stream-badge { order: 3; width: 100%; justify-content: center; }
  .legal-warning { font-size: 11px; text-align: left; }
  .warning-card { padding: 28px 20px 24px; border-radius: var(--r-lg); }
  .warning-icon { width: 68px; height: 68px; }
  .watermark { font-size: 9px; right: 12px; bottom: 12px; }

  /* Rendimiento en móvil: menos desenfoque y sin grano animado */
  .aurora { filter: blur(50px); animation: none; }
  .backdrop-noise { animation: none; opacity: .04; }
  .brand-sigil svg { animation: none; }
  .portal-frame { transition: box-shadow .8s var(--ease); }
}

/* Móvil en horizontal */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .portal-frame { max-width: min(100%, 70vh * 9 / 16); }
}

/* Evita zoom por doble toque y resaltados en pantallas táctiles */
@media (hover: none) {
  .play-orb:hover { transform: none; }
  .fullscreen-cta:hover { transform: translateX(-50%); }
  button { touch-action: manipulation; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  .backdrop-noise, .aurora { animation: none; }
  .portal-frame { transform: none !important; }
}
