/* ==========================================================================
   VIAJES SAMSER — CINEMATIC INTRO OVERLAY
   Paleta Institucional: Navy Real (#021d76), Oro Imperial (#fbb801),
   Cian Aeroespacial (#38bdf8) & Fondo Espacial (#01091d)
   ========================================================================== */

#samser-intro-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background-color: #01091d;
  color: #f8fafc;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.75s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.75s;
}

#samser-intro-overlay.intro-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 3D Perspective Stage */
.intro-stage-3d {
  perspective: 1200px;
  perspective-origin: center center;
}

/* Background Atmosphere */
.intro-backdrop-radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, #052a7a 0%, #021a52 35%, #010e2c 70%, #000615 100%);
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
}

.intro-flare-spot {
  position: absolute;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 184, 1, 0.16) 0%, rgba(56, 189, 248, 0.12) 40%, transparent 70%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  animation: introFlarePulse 4.5s ease-in-out infinite;
}

@keyframes introFlarePulse {
  0%, 100% { transform: scale(0.92); opacity: 0.45; }
  50% { transform: scale(1.18); opacity: 0.8; }
}

/* Ambient Canvas */
#intro-ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* ── Top Controls Bar ── */
.intro-top-controls {
  position: absolute;
  top: 24px;
  right: 28px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
}

.intro-btn-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #e2e8f0;
  background: rgba(2, 29, 118, 0.45);
  border: 1px solid rgba(251, 184, 1, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.intro-btn-ctrl:hover {
  color: #ffffff;
  border-color: var(--samser-gold-500, #fbb801);
  background: rgba(2, 29, 118, 0.7);
  transform: translateY(-1px);
}

.intro-btn-skip {
  background: linear-gradient(135deg, rgba(251, 184, 1, 0.2), rgba(2, 29, 118, 0.5));
  border: 1.5px solid rgba(251, 184, 1, 0.7);
  color: #ffffff;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.intro-btn-skip:hover {
  background: linear-gradient(135deg, #fbb801, #e19f00);
  color: #021d76;
  border-color: #ffffff;
  box-shadow: 0 0 24px rgba(251, 184, 1, 0.55);
}

.intro-btn-skip svg {
  transition: transform 0.25s ease;
}

.intro-btn-skip:hover svg {
  transform: translateX(3px);
}

/* ── Central Stage ── */
.intro-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 900px;
  height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  perspective: 1200px;
}

/* Elegant Anamorphic Flare in Horizon */
.intro-anamorphic-flare {
  position: absolute;
  width: 90%;
  max-width: 820px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(56, 189, 248, 0.4) 25%, rgba(251, 184, 1, 0.85) 50%, rgba(56, 189, 248, 0.4) 75%, transparent 100%);
  filter: drop-shadow(0 0 16px #fbb801);
  opacity: 0.65;
  pointer-events: none;
  animation: introFlareGlow 3s ease-in-out infinite alternate;
}

@keyframes introFlareGlow {
  0% { opacity: 0.45; filter: drop-shadow(0 0 10px #fbb801); }
  100% { opacity: 0.85; filter: drop-shadow(0 0 24px #38bdf8) drop-shadow(0 0 16px #fbb801); }
}

/* Energy Burst Flash */
.intro-portal-flash {
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(251, 184, 1, 0.75) 35%, rgba(56, 189, 248, 0.3) 65%, transparent 80%);
  opacity: 0;
  filter: blur(32px);
  transform: scale(0.4);
  pointer-events: none;
  transition: all 1.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 15;
}

/* ── 1. The Pre-Impact SAMSER Glass Shield (Target) ── */
.intro-shatter-emblem {
  position: absolute;
  width: 340px;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1200px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  z-index: 20;
}

.intro-shield-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 21;
}

.intro-shatter-emblem.is-broken .intro-shield-base {
  opacity: 0;
  transform: scale(1.18);
  pointer-events: none;
}

.intro-shield-glass {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, rgba(251, 184, 1, 0.15) 0%, rgba(2, 29, 118, 0.82) 60%, rgba(1, 13, 56, 0.98) 100%);
  border: 2px solid rgba(251, 184, 1, 0.75);
  box-shadow: 0 0 45px rgba(2, 29, 118, 0.9), 0 0 25px rgba(251, 184, 1, 0.3), inset 0 0 35px rgba(251, 184, 1, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.intro-shield-logo-wrap {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.intro-shield-samser-svg {
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 16px rgba(251, 184, 1, 0.7));
}

/* Marco circular dorado del emblema */
.intro-emblem-frame {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(251, 184, 1, 0.8);
  box-shadow: 0 0 25px rgba(251, 184, 1, 0.4);
  pointer-events: none;
  animation: introFrameBreathe 2.4s ease-in-out infinite alternate;
}

@keyframes introFrameBreathe {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(1.025); opacity: 1; border-color: #fff1a8; box-shadow: 0 0 35px rgba(251, 184, 1, 0.7); }
}

/* ── 3D Crystalline Glass Shards Lattice ── */
.intro-shards-lattice {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 24;
}

.intro-shard {
  position: absolute;
  inset: 0;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(56, 189, 248, 0.2) 0%, rgba(2, 29, 118, 0.65) 60%, rgba(1, 14, 58, 0.9) 100%);
  border: 1px solid rgba(251, 184, 1, 0.55);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.2);
  transition: transform 1.25s cubic-bezier(0.12, 0.95, 0.2, 1), opacity 1.1s ease;
  will-change: transform, opacity;
  opacity: 0;
}

.intro-shatter-emblem.is-broken .intro-shard {
  opacity: 1;
}

/* 12 Precise Polygonal Facets */
.intro-shard-1 { clip-path: polygon(50% 50%, 30% 0%, 50% 0%); }
.intro-shard-2 { clip-path: polygon(50% 50%, 50% 0%, 75% 0%, 100% 15%); }
.intro-shard-3 { clip-path: polygon(50% 50%, 100% 15%, 100% 45%); }
.intro-shard-4 { clip-path: polygon(50% 50%, 100% 45%, 100% 75%); }
.intro-shard-5 { clip-path: polygon(50% 50%, 100% 75%, 85% 100%); }
.intro-shard-6 { clip-path: polygon(50% 50%, 85% 100%, 50% 100%); }
.intro-shard-7 { clip-path: polygon(50% 50%, 50% 100%, 25% 100%); }
.intro-shard-8 { clip-path: polygon(50% 50%, 25% 100%, 0% 85%); }
.intro-shard-9 { clip-path: polygon(50% 50%, 0% 85%, 0% 55%); }
.intro-shard-10 { clip-path: polygon(50% 50%, 0% 55%, 0% 25%); }
.intro-shard-11 { clip-path: polygon(50% 50%, 0% 25%, 15% 0%); }
.intro-shard-12 { clip-path: polygon(50% 50%, 15% 0%, 30% 0%); }

/* 3D Dispersal Explosions */
.intro-shatter-emblem.is-broken .intro-shard-1 {
  transform: translate3d(-170px, -240px, 180px) rotate(-55deg) rotateY(-40deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-2 {
  transform: translate3d(50px, -260px, 190px) rotate(35deg) rotateX(-50deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-3 {
  transform: translate3d(240px, -180px, 170px) rotate(55deg) rotateZ(35deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-4 {
  transform: translate3d(280px, 10px, 210px) rotate(65deg) rotateY(45deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-5 {
  transform: translate3d(250px, 190px, 180px) rotate(45deg) rotateX(40deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-6 {
  transform: translate3d(90px, 270px, 190px) rotate(20deg) rotateX(60deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-7 {
  transform: translate3d(-80px, 270px, 170px) rotate(-25deg) rotateY(45deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-8 {
  transform: translate3d(-230px, 190px, 190px) rotate(-60deg) rotateZ(-40deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-9 {
  transform: translate3d(-270px, 10px, 210px) rotate(-70deg) rotateY(-50deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-10 {
  transform: translate3d(-240px, -130px, 170px) rotate(-50deg) rotateX(-35deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-11 {
  transform: translate3d(-140px, -210px, 160px) rotate(-35deg) rotateZ(-25deg);
  opacity: 0;
}
.intro-shatter-emblem.is-broken .intro-shard-12 {
  transform: translate3d(-40px, -240px, 150px) rotate(-15deg) rotateX(-45deg);
  opacity: 0;
}

/* Glass Fracture Crack Overlay */
.intro-fracture-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 26;
  opacity: 0;
  transition: opacity 0.15s ease;
}

/* Sacudida sísmica de pantalla por impacto */
@keyframes stageImpactShake {
  0% { transform: translate(0, 0) scale(1); }
  20% { transform: translate(-10px, 7px) scale(1.02); }
  40% { transform: translate(9px, -6px) scale(1.015); }
  60% { transform: translate(-6px, -5px) scale(1.01); }
  80% { transform: translate(5px, 4px) scale(1.005); }
  100% { transform: translate(0, 0) scale(1); }
}

.intro-stage-3d.shake-impact {
  animation: stageImpactShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* ── 2. Dynamic Acrobatic Chilena Stage ── */
.intro-chilena-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Vector Silhouette of Carlos Ruiz (#20) */
.intro-player-figure {
  position: absolute;
  bottom: 16%;
  left: 6%;
  width: 250px;
  height: 230px;
  z-index: 35;
  opacity: 0;
  transform: translate(-50px, 60px) scale(0.65) rotate(-18deg);
  transition: all 0.75s cubic-bezier(0.16, 1, 0.3, 1);
}

.intro-player-figure.active {
  opacity: 1;
  transform: translate(0, 0) scale(1) rotate(0deg);
}

.intro-player-figure.kicking {
  transform: translate(25px, -15px) scale(1.08) rotate(10deg);
}

.intro-player-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 25px rgba(251, 184, 1, 0.65));
}

/* Flash de impacto en el pie del jugador */
.intro-kick-flash {
  position: absolute;
  top: 15px;
  left: 35px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #fff08a 40%, #fbb801 70%, transparent 85%);
  opacity: 0;
  transform: scale(0.2);
  transition: all 0.3s ease-out;
  pointer-events: none;
  z-index: 38;
}

.intro-kick-flash.active {
  opacity: 1;
  transform: scale(3.5);
}

/* Balón Dinámico 3D */
.intro-chilena-ball {
  position: absolute;
  bottom: 33%;
  left: 20%;
  width: 48px;
  height: 48px;
  z-index: 40;
  opacity: 0;
  transform: scale(0.6) translate(0, 0);
  transition: opacity 0.35s ease;
  will-change: transform, opacity;
}

.intro-chilena-ball.ready {
  opacity: 1;
  transform: scale(1) translate(0, 0);
  animation: ballHoverApex 1.2s ease-in-out infinite alternate;
}

@keyframes ballHoverApex {
  0% { transform: scale(1) translateY(0px); }
  100% { transform: scale(1.06) translateY(-8px); }
}

/* Disparo a toda velocidad hacia el centro del escudo */
.intro-chilena-ball.fired {
  opacity: 1;
  animation: none;
  transition: transform 0.32s cubic-bezier(0.12, 0.95, 0.2, 1);
  transform: translate(175px, -68px) scale(1.4) rotate(1080deg);
}

/* Impacto y desvanecimiento en el choque */
.intro-chilena-ball.impacted {
  transform: translate(195px, -74px) scale(2.8);
  opacity: 0;
  transition: all 0.28s ease-out;
}

.intro-ball-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: drop-shadow(0 0 16px rgba(251, 184, 1, 1)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.95));
}

.intro-ball-svg {
  width: 100%;
  height: 100%;
}

.intro-ball-trail {
  position: absolute;
  top: 50%;
  left: -80px;
  width: 90px;
  height: 24px;
  margin-top: -12px;
  border-radius: 9999px;
  background: linear-gradient(90deg, transparent 0%, rgba(251, 184, 1, 0.8) 70%, #ffffff 100%);
  filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.intro-chilena-ball.fired .intro-ball-trail {
  opacity: 1;
}

.intro-ball-aura {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 184, 1, 0.6) 0%, rgba(255, 255, 255, 0.4) 30%, transparent 70%);
  animation: ballAuraPulse 1.2s ease-in-out infinite alternate;
}

@keyframes ballAuraPulse {
  0% { transform: scale(0.9); opacity: 0.5; }
  100% { transform: scale(1.15); opacity: 0.9; }
}

/* Doble Onda de Choque Expansiva */
.intro-impact-wave, .intro-impact-wave-secondary {
  position: absolute;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 4px solid #ffffff;
  box-shadow: 0 0 35px #fbb801, 0 0 65px #ffffff;
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
  z-index: 28;
  transition: all 0.85s cubic-bezier(0.08, 0.82, 0.17, 1);
}

.intro-impact-wave.active {
  opacity: 1;
  transform: scale(16);
  border-width: 1.5px;
  border-color: rgba(251, 184, 1, 0.6);
}

.intro-impact-wave-secondary.active {
  opacity: 0.9;
  transform: scale(22);
  border-width: 1px;
  border-color: rgba(56, 189, 248, 0.5);
  transition-delay: 0.08s;
}

/* Avión CR20 que Despega y Cruza la Brecha */
.intro-cr20-jet-shot {
  position: absolute;
  width: 170px;
  height: auto;
  opacity: 0;
  transform: translate(-30px, 30px) scale(0.35);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 45;
  pointer-events: none;
}

.intro-cr20-jet-shot.active {
  opacity: 1;
  transform: translate(110px, -70px) scale(1.25);
}

.intro-cr20-jet-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 25px rgba(251, 184, 1, 0.75));
}

/* ── 3. Post-Shatter Unified Alliance Reveal (Clean & Luxury) ── */
.intro-alliance-reveal {
  position: absolute;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.65s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.intro-alliance-reveal.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.intro-luxury-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 20px;
  border-radius: 9999px;
  background: rgba(2, 29, 118, 0.92);
  border: 1.5px solid var(--samser-gold-500, #fbb801);
  color: var(--samser-gold-500, #fbb801);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  margin-bottom: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 16px rgba(251, 184, 1, 0.35);
}

.intro-brand-logo-frame {
  margin: 12px 0 6px;
  width: 100%;
  max-width: 440px;
}

.intro-alliance-logo-img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 30px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(251, 184, 1, 0.6));
}

.intro-slogan-motto {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 1.7rem;
  letter-spacing: 6px;
  color: #ffffff;
  text-transform: uppercase;
  margin: 6px 0 4px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.95), 0 0 25px rgba(251, 184, 1, 0.75);
}

.intro-slogan-desc {
  margin-top: 6px;
  color: #bae6fd;
  font-size: 0.95rem;
  font-weight: 400;
  letter-spacing: 0.3px;
  max-width: 440px;
  line-height: 1.5;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}

/* Auto-progress Timeline Bar */
.intro-timeline-wrap {
  width: 220px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(251, 184, 1, 0.3);
}

.intro-timeline-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #38bdf8, #fbb801);
  transition: width 0.08s linear;
}

/* Responsive Tweaks */
@media (max-width: 680px) {
  .intro-container { height: 440px; }
  .intro-shatter-emblem { width: 270px; height: 270px; }
  .intro-shard { width: 270px; height: 270px; }
  .intro-player-figure { width: 180px; height: 165px; left: 2%; bottom: 12%; }
  .intro-player-figure.kicking { transform: translate(16px, -10px) scale(1.06) rotate(8deg); }
  .intro-kick-flash { top: 10px; left: 25px; }
  .intro-chilena-ball { width: 40px; height: 40px; left: 16%; bottom: 25%; }
  .intro-chilena-ball.fired { transform: translate(120px, -55px) scale(1.3) rotate(1080deg); }
  .intro-chilena-ball.impacted { transform: translate(135px, -60px) scale(2.2); }
  .intro-cr20-jet-shot { width: 130px; }
  .intro-cr20-jet-shot.active { transform: translate(75px, -45px) scale(1.15); }
  .intro-brand-logo-frame { max-width: 310px; }
  .intro-slogan-motto { font-size: 1.25rem; letter-spacing: 4px; }
  .intro-slogan-desc { font-size: 0.82rem; max-width: 300px; }
  .intro-top-controls { top: 16px; right: 16px; gap: 8px; }
  .intro-btn-ctrl { padding: 6px 12px; font-size: 0.72rem; }
}
