/* ═══════════════════════════════════════════════════════════════════════════
   VIALPRO — SPLASH UNIFICADA (web + app + juegos)
   Fuente única de verdad del look de carga. La usan:
   · index.html (app React) — capa #vp-splash con el snippet VP-SPLASH
   · hub y juegos estáticos (boss, survival, pass-or-smash) — ídem
   · duelo-titanes.html — su S0 usa estas mismas clases (host absoluto)
   Regla 60fps: solo se anima transform y opacity.
   Fondo #07060a = idéntico a la splash nativa de Capacitor (transición invisible).
   ═══════════════════════════════════════════════════════════════════════════ */

.vp-splash-root {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: #07060a;
}

/* Variante para vivir DENTRO de una pantalla de juego (S0 del Duelo) */
.vp-splash-host {
  position: absolute;
  inset: 0;
  background: #07060a;
}

.vp-splash-root,
.vp-splash-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  opacity: 1;
  transition: opacity 300ms ease-out;
}

.vp-splash-root.vp-splash-out {
  opacity: 0;
  pointer-events: none;
}

.vp-splash-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translateY(-4vh);
}

/* Halo dorado tras el logo: pulso suave, solo opacity/transform */
.vp-splash-halo {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 168, 67, 0.16) 0%, rgba(212, 168, 67, 0) 62%);
  animation: vpHaloPulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes vpHaloPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.vp-splash-logo {
  width: min(46vw, 180px);
  height: auto;
  display: block;
  position: relative;
}

/* Barra indeterminada: shimmer izq→dcha, lento (percepción de velocidad) */
.vp-splash-track {
  margin-top: 22px;
  width: 132px;
  height: 3px;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.14);
  overflow: hidden;
  position: relative;
}
.vp-splash-track::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 44px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(212, 168, 67, 0) 0%, #d4a843 50%, rgba(212, 168, 67, 0) 100%);
  animation: vpShimmer 1.6s ease-in-out infinite;
}
@keyframes vpShimmer {
  from { transform: translateX(-48px); }
  to   { transform: translateX(136px); }
}

/* Barra CON progreso real (S0 del Duelo): mismo carril, relleno por width
   controlado por su propio JS (no es un loop de animación CSS). */
.vp-splash-track--progress { width: min(64vw, 240px); height: 4px; }
.vp-splash-track--progress::after { content: none; }
.vp-splash-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #9a7728, #d4a843 60%, #f3dc9a);
}
.vp-splash-pct {
  margin-top: 10px;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.78rem;
  color: #8E8E93;
  letter-spacing: 0.06em;
}

/* Tarjeta de consejo DGT (aparece a los ~350ms si la carga sigue viva).
   El avatar de Santi entra por CSS (::before) — cero cambios de HTML. */
.vp-splash-tip {
  position: absolute;
  left: 50%;
  bottom: max(30px, env(safe-area-inset-bottom, 0px) + 24px);
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  width: min(88vw, 420px);
  box-sizing: border-box;
  padding: 12px 16px;
  border: 1px solid rgba(212, 168, 67, 0.28);
  border-radius: 14px;
  background: rgba(18, 17, 16, 0.92);
  text-align: left;
  transition: opacity 300ms ease-out, transform 300ms ease-out;
  pointer-events: none;
  display: grid;
  grid-template-columns: 36px 1fr;
  column-gap: 12px;
  align-items: center;
}
.vp-splash-tip::before {
  content: '';
  grid-row: 1 / 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: url(/juegos/assets/santi/avatar-64.webp) center/cover;
  border: 1px solid rgba(212, 168, 67, 0.4);
}
.vp-splash-tip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.vp-splash-tip-label {
  font-family: 'Syne', 'DM Sans', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: #d4a843;
  margin-bottom: 4px;
}
.vp-splash-tip-text {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 0.84rem;
  line-height: 1.35;
  color: #f5f3ef;
}

@media (prefers-reduced-motion: reduce) {
  .vp-splash-halo, .vp-splash-track::after { animation: none; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   CARGA — el vídeo de marca entero (ver el .js)
   Dos grabaciones nativas (móvil 1290×2796 y tablet 2048×2732), cada una
   compuesta para su pantalla: van con cover y llenan la pantalla entera sin
   bandas. Lo que recorta cover en un móvil más alargado son unos píxeles del
   fondo de carretera; el mando y la barra quedan siempre dentro.
   ═══════════════════════════════════════════════════════════════════════════ */
.vp-splash-root.vp-v2, .vp-splash-host.vp-v2 {
  display: block; overflow: hidden; background: #05060b;
}
.vp-v2 .vp-carga-relleno {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: #05060b center / cover no-repeat;
}
.vp-v2 .vp-carga-video {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
  object-fit: cover; background: transparent; display: block;
}
.vp-v2.is-out { opacity: 0; pointer-events: none; transition: opacity 300ms ease-out }

/* el consejo de Santi no va en la carga: es pantalla de marca, sin texto */
.vp-v2 .vp-splash-tip { display: none !important }

/* El marcado viejo de la capa (logo-192 recortado con halo dorado) sigue en el
   HTML de index.html y del hub por compatibilidad, pero NO se pinta nunca:
   hasta que el .js decide, solo se ve el fondo liso; si toca carga, el .js lo
   sustituye por el vídeo (.vp-v2), y si no, retira la capa entera. */
#vp-splash[data-solo-entrada]:not(.vp-v2) > * { visibility: hidden !important; animation: none !important; }
