/* ======================================================================
   MEGGA ENDGAME · sistema de diseño
   Tokens exactos del spec (sección 5). Mobile-first.
   Capa AURA: profundidad, luz y materialidad sobre la misma estructura.
   ====================================================================== */

:root {
  --void: #050507;
  --panel: #0C0E12;
  --line: #1A1E26;
  --ki: #00E5FF;
  --ki-dim: rgba(0, 229, 255, 0.12);
  --critical: #FF2D78;
  --text: #F2F4F8;
  --text-dim: #8A93A6;
  /* Derivados de profundidad (no son tokens nuevos de marca) */
  --glow-mid: rgba(0, 229, 255, 0.22);
}

/* ---------- Fuentes (3 woff2 subset latin) ---------- */
@font-face {
  font-family: 'Chakra Petch';
  src: url('../assets/fonts/chakra-petch-bold.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-regular.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Press Start 2P';
  src: url('../assets/fonts/press-start-2p.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background:
    radial-gradient(120% 60% at 50% -10%, #0A1118 0%, transparent 60%),
    var(--void);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }

::selection { background: rgba(0, 229, 255, 0.28); color: #fff; }
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: #16303a; }
::-webkit-scrollbar-thumb:hover { background: #1e4452; }

/* Utilidades de marca */
.u-press {
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.u-critical { color: var(--critical); font-style: normal; }

a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ki);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ====== Materialización (6.1): estados previos, solo con JS.
   H1 y label SIEMPRE visibles (LCP); el decode los resuelve. ====== */
html.js .hero-sub,
html.js .hero-tierline, html.js .hero-ctas, html.js .hero-microline {
  opacity: 0;
}
html.js .pc-frag { opacity: 0; }
html.js.sig-done .hero-sub,
html.js.sig-done .hero-tierline, html.js.sig-done .hero-ctas, html.js.sig-done .hero-microline,
html.js.sig-done .pc-frag { opacity: 1; }
.sig-fade-in { animation: sigFade 0.5s ease-out forwards; }
@keyframes sigFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pc-frag-a.sig-assemble { animation: fragA 0.5s cubic-bezier(0.22,1,0.36,1) forwards; }
.pc-frag-b.sig-assemble { animation: fragB 0.5s cubic-bezier(0.22,1,0.36,1) 0.12s forwards; }
.pc-frag-c.sig-assemble { animation: fragC 0.5s cubic-bezier(0.22,1,0.36,1) 0.24s forwards; }
@keyframes fragA { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes fragB { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes fragC { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.player-card.sig-pulse { animation: cardPulse 0.45s ease-out; }
@keyframes cardPulse { 0% { box-shadow: 0 0 0 0 var(--glow-mid); } 60% { box-shadow: 0 0 0 18px rgba(0,229,255,0); } 100% { box-shadow: none; } }
.hero-scanline.sig-sweep { opacity: 1; animation: scanSweep 0.4s linear forwards; }
@keyframes scanSweep { from { background-position: 0 -120%; } to { background-position: 0 220%; } }

/* Reveals sobrios (5) */
html.js .section > * { opacity: 0; transform: translateY(12px); }
html.js .section.is-revealed > * { opacity: 1; transform: none; transition: opacity 0.3s ease, transform 0.3s ease; }

/* ====================================================================
   HERO · composición cinematográfica multicapa
   ==================================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  padding: 96px 20px 110px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(58% 42% at 50% 38%, rgba(0, 229, 255, 0.10) 0%, transparent 70%),
    radial-gradient(90% 60% at 50% 110%, #07131A 0%, transparent 62%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute; inset: 0; z-index: 3;
  background: radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.5) 100%);
  pointer-events: none;
}
.ambient-canvas { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-scanline {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(0,229,255,0.16) 50%, transparent 100%);
  background-size: 100% 220%;
  opacity: 0;
}
.hero-inner { position: relative; z-index: 4; max-width: 720px; width: 100%; text-align: center; }

/* Label con brackets de transmisión */
.hero-label {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--ki);
  margin-bottom: 26px;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.5);
}
.hero-label::before, .hero-label::after {
  content: '';
  display: block; height: 1px; width: 44px;
  background: linear-gradient(90deg, transparent, var(--ki));
}
.hero-label::after { background: linear-gradient(90deg, var(--ki), transparent); }

/* H1 como material de luz */
.hero-h1 {
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(32px, 8.4vw, 62px);
  line-height: 1.08;
  margin-bottom: 20px;
  background: linear-gradient(180deg, #FFFFFF 0%, #DDF6FC 55%, #8FD9EA 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
}
/* El glow del H1 entra tras la materialización: primer paint barato (LCP) */
html.sig-done .hero-h1 { filter: drop-shadow(0 2px 22px rgba(0, 229, 255, 0.18)); }
.hero-sub {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 54ch;
  margin: 0 auto 42px;
}

/* ====== Player Card · objeto premium ====== */
.player-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  grid-template-areas: "a b" "c c";
  gap: 16px;
  align-items: center;
  text-align: left;
  max-width: 430px;
  margin: 0 auto 18px;
  padding: 22px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(16, 20, 27, 0.92), rgba(9, 11, 15, 0.96)) padding-box,
    linear-gradient(135deg, rgba(0, 229, 255, 0.55), rgba(0, 229, 255, 0.06) 38%, rgba(0, 229, 255, 0.02) 64%, rgba(255, 45, 120, 0.18)) border-box;
  box-shadow:
    0 24px 60px -28px rgba(0, 0, 0, 0.85),
    0 0 42px -8px rgba(0, 229, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transform-style: preserve-3d;
  will-change: transform;
}
/* Efectos de render caros: entran después de la materialización */
html.sig-done .player-card {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: cardBreathe 4.5s ease-in-out infinite;
}
@keyframes cardBreathe {
  0%, 100% { box-shadow: 0 24px 60px -28px rgba(0,0,0,0.85), 0 0 42px -8px rgba(0,229,255,0.14), inset 0 1px 0 rgba(255,255,255,0.05); }
  50% { box-shadow: 0 24px 60px -28px rgba(0,0,0,0.85), 0 0 58px -6px rgba(0,229,255,0.26), inset 0 1px 0 rgba(255,255,255,0.05); }
}
.player-card::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.12), transparent 52%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.player-card.is-tilting::after { opacity: 1; }
.pc-corners {
  position: absolute; inset: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--ki), var(--ki)) left 0 top 0 / 14px 1px,
    linear-gradient(var(--ki), var(--ki)) left 0 top 0 / 1px 14px,
    linear-gradient(var(--ki), var(--ki)) left 0 bottom 0 / 14px 1px,
    linear-gradient(var(--ki), var(--ki)) left 0 bottom 0 / 1px 14px,
    linear-gradient(var(--ki), var(--ki)) right 0 bottom 0 / 14px 1px,
    linear-gradient(var(--ki), var(--ki)) right 0 bottom 0 / 1px 14px;
  background-repeat: no-repeat;
  opacity: 0.5;
}
.pc-frag-a { grid-area: a; }
.pc-frag-b { grid-area: b; }
.pc-frag-c { grid-area: c; }
.pc-avatar {
  position: relative; overflow: hidden;
  background:
    radial-gradient(70% 70% at 50% 36%, rgba(0, 229, 255, 0.16), transparent 70%),
    linear-gradient(180deg, #0B0E13, #07090D);
  border: 1px solid rgba(0, 229, 255, 0.22);
}
.pc-avatar::after {
  content: '';
  position: absolute; inset: -100% 0;
  background: repeating-linear-gradient(0deg, rgba(0, 229, 255, 0.08) 0 2px, transparent 2px 5px);
  animation: avScan 7s linear infinite;
  pointer-events: none;
}
@keyframes avScan { to { transform: translateY(50%); } }
.pc-avatar-svg { width: 94px; height: 94px; }
.pc-tier-label {
  color: var(--ki);
  margin-bottom: 12px;
  font-size: 11px;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}
.pc-id { color: var(--text-dim); font-size: 9px; opacity: 0.8; }
.pc-xp { display: flex; align-items: center; gap: 10px; }
.pc-xp-label, .pc-xp-num { color: var(--text-dim); font-size: 9px; }
.pc-xp-num { color: var(--ki); }
.pc-xp-track {
  flex: 1; height: 10px;
  background:
    repeating-linear-gradient(90deg, transparent 0 9px, rgba(0, 0, 0, 0.6) 9px 10px),
    linear-gradient(180deg, #05070A, #0A0D12);
  border: 1px solid var(--line);
  overflow: hidden;
  position: relative;
}
.pc-xp-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.45), var(--ki));
  box-shadow: 0 0 12px var(--ki);
}

.hero-tierline { color: var(--text-dim); font-size: 15px; margin-bottom: 34px; }

/* ====== Botones ====== */
.btn {
  display: inline-block;
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-align: center;
  padding: 17px 32px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  transition: box-shadow 0.25s ease, transform 0.15s ease, background 0.25s ease;
}
.btn-primary {
  background: linear-gradient(180deg, #36EEFF 0%, var(--ki) 45%, #00B6CC 100%);
  color: #02151A;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow:
    0 10px 34px -10px rgba(0, 229, 255, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn-primary:hover {
  box-shadow:
    0 14px 44px -10px rgba(0, 229, 255, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}
.btn-ghost {
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.06), rgba(0, 229, 255, 0.02));
  color: var(--ki);
  border: 1px solid rgba(0, 229, 255, 0.4);
}
.btn-ghost:hover { background: var(--ki-dim); box-shadow: 0 0 24px -6px rgba(0, 229, 255, 0.4); }
.hero-ctas { display: flex; flex-direction: column; gap: 12px; max-width: 430px; margin: 0 auto 20px; }
.hero-ctas .btn { white-space: nowrap; }
.hero-microline { color: var(--text-dim); font-size: 13.5px; }

/* ====================================================================
   SECCIONES · numeración técnica + ritmo editorial
   ==================================================================== */
body { counter-reset: sec; }
.section {
  padding: 100px 20px 0;
  max-width: 780px;
  margin: 0 auto;
  counter-increment: sec;
}
.section:last-of-type { padding-bottom: 110px; }
.kicker {
  display: flex; align-items: center; gap: 12px;
  color: var(--ki);
  margin-bottom: 22px;
  font-size: 10px;
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.4);
}
.kicker::before {
  content: counter(sec, decimal-leading-zero);
  color: var(--text-dim);
  opacity: 0.75;
}
.kicker::after {
  content: '';
  flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.35), transparent 70%);
}
.h2 {
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(24px, 5.6vw, 38px);
  line-height: 1.14;
  margin-bottom: 28px;
  background: linear-gradient(180deg, #FFFFFF, #C9EDF6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff;
}
.h3 {
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 18px;
  color: var(--ki);
  margin-bottom: 12px;
  text-shadow: 0 0 14px rgba(0, 229, 255, 0.3);
}
.prose { max-width: 68ch; }
.prose p { margin-bottom: 1.3em; }
.prose p:last-child { margin-bottom: 0; }
.prose-dim { color: var(--text-dim); }

/* ====== Paneles HUD con materia ====== */
.panel {
  position: relative;
  background: linear-gradient(165deg, #10141B 0%, #0A0D12 70%);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  padding: 26px 24px;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 16px; height: 1px;
  background: linear-gradient(90deg, var(--ki), rgba(0, 229, 255, 0.05) 70%, transparent);
  opacity: 0.55;
}

/* ====== VSL: marco de transmisión ====== */
.vsl-facade {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(60% 60% at 50% 45%, rgba(0, 229, 255, 0.08), transparent 75%),
    linear-gradient(165deg, #0E1218, #07090D);
  outline: 1px solid rgba(0, 229, 255, 0.3);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 26px 60px -28px rgba(0, 0, 0, 0.9), 0 0 50px -16px rgba(0, 229, 255, 0.2);
}
.vsl-facade::before {
  content: '';
  position: absolute; top: 12px; left: 14px; z-index: 2;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--critical);
  box-shadow: 0 0 10px var(--critical);
  animation: recBlink 1.6s steps(2, end) infinite;
}
@keyframes recBlink { 50% { opacity: 0.25; } }
.vsl-play {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: none; border: none; cursor: pointer;
  padding: 24px;
}
.vsl-play-icon {
  width: 78px; height: 78px;
  background: radial-gradient(circle at 50% 42%, rgba(0, 229, 255, 0.25), rgba(0, 229, 255, 0.06) 70%);
  border: 1px solid var(--ki);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 34px -4px rgba(0, 229, 255, 0.5), inset 0 0 18px rgba(0, 229, 255, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vsl-play:hover .vsl-play-icon {
  transform: scale(1.06);
  box-shadow: 0 0 46px -2px rgba(0, 229, 255, 0.7), inset 0 0 18px rgba(0, 229, 255, 0.25);
}
.vsl-play-icon::after {
  content: '';
  position: absolute; left: 55%; top: 50%;
  transform: translate(-50%, -50%);
  border-left: 22px solid var(--ki);
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  filter: drop-shadow(0 0 8px rgba(0, 229, 255, 0.8));
}
.vsl-duration { color: var(--text-dim); }
.vsl-iframe { width: 100%; height: 100%; border: 0; position: relative; z-index: 2; }

/* ====== Aliados ====== */
.allies { display: grid; gap: 16px; }
.ally { transition: transform 0.25s ease, box-shadow 0.25s ease; }
.ally:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 52px -24px rgba(0, 0, 0, 0.9), 0 0 44px -14px rgba(0, 229, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.ally p { color: var(--text-dim); font-size: 16px; }

/* ====== Mapa de niveles ====== */
.levels { list-style: none; position: relative; padding-left: 30px; }
.levels::before {
  content: '';
  position: absolute; left: 8px; top: 8px; bottom: 8px;
  width: 1px; background: var(--line);
}
.levels.has-svg { padding-left: 36px; }
.levels.has-svg::before { display: none; }
.levels-spine {
  position: absolute; left: 4px; top: 0; height: 100%; width: 18px;
  overflow: visible; pointer-events: none;
}
.levels-spine path {
  stroke: var(--ki); stroke-width: 2; fill: none;
  filter: drop-shadow(0 0 5px rgba(0, 229, 255, 0.7));
}
.level { position: relative; margin-bottom: 18px; }
.level::before {
  content: '';
  position: absolute; left: -26px; top: 26px;
  width: 10px; height: 10px;
  background: var(--void);
  border: 1px solid rgba(0, 229, 255, 0.45);
  transform: rotate(45deg);
  transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.levels.has-svg .level::before { left: -32px; }
.level.is-lit::before {
  background: var(--ki);
  border-color: var(--ki);
  animation: nodePulse 0.5s ease-out;
}
@keyframes nodePulse { 0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.8); } 100% { box-shadow: 0 0 12px var(--ki); } }
.level-card { overflow: hidden; }
.level-card summary {
  display: flex; align-items: baseline; gap: 16px;
  cursor: pointer; list-style: none;
  position: relative; z-index: 1;
}
.level-card summary::-webkit-details-marker { display: none; }
.level:nth-child(1) .level-card::after { content: '01'; }
.level:nth-child(2) .level-card::after { content: '02'; }
.level:nth-child(3) .level-card::after { content: '03'; }
.level:nth-child(4) .level-card::after { content: '04'; }
.level:nth-child(5) .level-card::after { content: '05'; }
.level:nth-child(6) .level-card::after { content: '06'; }
.level-card::after {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  font-family: 'Chakra Petch', sans-serif;
  font-weight: 700;
  font-size: 78px;
  line-height: 1;
  color: rgba(0, 229, 255, 0.055);
  pointer-events: none;
  z-index: 0;
}
.level-card[open] {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.8), 0 0 36px -12px rgba(0, 229, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.level-tag { color: var(--ki); font-size: 10px; }
.level-name {
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700; text-transform: uppercase; font-size: 17px;
}
.level-card p {
  position: relative; z-index: 1;
  color: var(--text-dim); font-size: 16px;
  overflow: hidden; max-height: 0; margin-top: 0;
  transition: max-height 0.2s cubic-bezier(0.34, 1.45, 0.64, 1), margin-top 0.2s ease;
}
.level-card[open] p { max-height: 280px; margin-top: 14px; }

/* ====== Jugadores (C1: slots del sistema) ====== */
.players { display: grid; gap: 16px; grid-template-columns: 1fr; }
.player-slot { text-align: center; }
.player-slot .ps-photo {
  width: 86px; height: 86px; margin: 0 auto 16px;
  border: 1px dashed rgba(0, 229, 255, 0.3);
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(0, 229, 255, 0.08), transparent 75%),
    var(--void);
  display: flex; align-items: center; justify-content: center;
  color: rgba(0, 229, 255, 0.4);
  font-size: 22px;
}
.player-slot .ps-name { margin-bottom: 6px; color: var(--text); font-size: 10px; }
.player-slot .ps-meta { color: var(--text-dim); font-size: 14px; }
.player-slot .ps-status { color: var(--ki); margin-top: 14px; font-size: 9px; opacity: 0.85; animation: critBlink 2.8s steps(2, end) infinite; }

/* ====== Inversión ====== */
.price-panel { margin-top: 28px; text-align: center; }
.price-main {
  font-family: 'Chakra Petch', 'Inter', sans-serif;
  font-weight: 700; font-size: 44px;
  background: linear-gradient(180deg, #7FEFFF, var(--ki));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--ki);
  filter: drop-shadow(0 0 22px rgba(0, 229, 255, 0.35));
}
.price-sub { color: var(--text-dim); margin-top: 8px; }

/* ====== CTA final: clímax de luz ====== */
.section-final {
  position: relative;
  text-align: center;
  isolation: isolate;
}
.section-final::before {
  content: '';
  position: absolute; inset: -40px -50vw 0; z-index: -1;
  background:
    radial-gradient(50% 46% at 50% 58%, rgba(0, 229, 255, 0.10) 0%, transparent 70%),
    radial-gradient(34% 30% at 50% 50%, rgba(255, 45, 120, 0.05) 0%, transparent 75%);
  pointer-events: none;
}
.section-final .prose { margin: 0 auto 34px; }
.btn-final { min-width: min(430px, 100%); font-size: 18px; padding: 20px 34px; }
.u-critical-flash.is-flashing {
  color: var(--critical);
  text-shadow: 0 0 20px rgba(255, 45, 120, 0.7);
}

/* ====== Downsell ====== */
.section-downsell { text-align: center; opacity: 0.94; }
.section-downsell .prose { margin: 0 auto 24px; }

/* ====== E4: borde de energía + carga al press ====== */
@property --eang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.btn-primary { position: relative; isolation: isolate; overflow: hidden; }
.btn-primary::before {
  content: '';
  position: absolute; inset: -2px; z-index: -1;
  background: conic-gradient(from var(--eang), transparent 0 68%, rgba(255, 255, 255, 0.95) 82%, transparent 95%);
  animation: edgeSpin 3.2s linear infinite;
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
@keyframes edgeSpin { to { --eang: 360deg; } }
.btn-primary::after {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, 0.4);
  transform: scaleX(0); transform-origin: left;
}
.btn-primary.is-charging::after { transition: transform 0.15s linear; transform: scaleX(1); }

/* ====== E5: parpadeo terminal ====== */
.u-critical-blink { animation: critBlink 2.6s steps(2, end) infinite; }
@keyframes critBlink { 50% { opacity: 0.45; } }

/* ====== E2: piso de grilla en perspectiva ====== */
.hero-grid {
  position: absolute; left: -20%; right: -20%; bottom: -4%; height: 54%;
  z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(0, 229, 255, 0.13) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg, rgba(0, 229, 255, 0.13) 0 1px, transparent 1px 44px);
  transform: perspective(420px) rotateX(62deg);
  transform-origin: 50% 100%;
  animation: gridFlow 9s linear infinite;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 46%, #000 100%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 46%, #000 100%);
}
@keyframes gridFlow { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 0 44px; } }
.ambient-fallback::before {
  background:
    radial-gradient(58% 42% at 50% 38%, rgba(0, 229, 255, 0.12) 0%, transparent 70%),
    radial-gradient(90% 60% at 50% 110%, #07131A 0%, transparent 62%);
}

/* ====== E6: ruido global 2% ====== */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 99; pointer-events: none;
  opacity: 0.02;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ====== XP topbar + toast (6.2) ====== */
.xp-topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  background: rgba(0, 229, 255, 0.06); z-index: 90;
}
.xp-topbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, rgba(0, 229, 255, 0.5), var(--ki));
  box-shadow: 0 0 10px var(--ki);
}
.xp-toast {
  position: fixed; top: 16px; left: 50%;
  transform: translate(-50%, -10px);
  background: linear-gradient(165deg, #11151C, #0A0D12);
  border: 1px solid rgba(0, 229, 255, 0.4);
  color: var(--ki);
  font-family: 'Press Start 2P', ui-monospace, monospace;
  font-size: 10px; letter-spacing: 0.06em;
  padding: 9px 16px;
  opacity: 0; pointer-events: none;
  z-index: 95;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.9), 0 0 24px -8px rgba(0, 229, 255, 0.4);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.xp-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.xp-toast.is-critical {
  color: var(--critical);
  border-color: var(--critical);
  box-shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.9), 0 0 28px -6px rgba(255, 45, 120, 0.5);
}

/* ====== Dock (6.2) ====== */
.xp-dock {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; gap: 14px;
  background: rgba(10, 12, 16, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(0, 229, 255, 0.18);
  box-shadow: 0 -12px 34px -18px rgba(0, 0, 0, 0.9);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.xp-dock-label { color: var(--ki); white-space: nowrap; font-size: 9px; }
.btn-dock { flex: 1; padding: 14px 18px; font-size: 14px; }
@media (min-width: 900px) {
  .xp-dock {
    left: auto; right: 28px; bottom: 28px;
    border: 1px solid rgba(0, 229, 255, 0.22);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
    padding: 10px 14px;
  }
  .btn-dock { flex: none; }
}

/* ====== Footer ====== */
.footer {
  position: relative;
  margin-top: 150px;
  padding: 56px 20px calc(100px + env(safe-area-inset-bottom));
  text-align: center;
}
.footer::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: min(560px, 80%); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.5), transparent);
}
.footer-brand { color: var(--text); margin-bottom: 24px; letter-spacing: 0.3em; }
.footer-social { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.footer-social a {
  color: var(--text-dim); text-decoration: none; font-size: 14px;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}
.footer-social a:hover { color: var(--ki); text-shadow: 0 0 12px rgba(0, 229, 255, 0.6); }
.footer-legal { color: var(--text-dim); font-size: 12.5px; opacity: 0.75; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
  body { font-size: 18px; }
  .section { padding-top: 150px; }
  .hero-ctas { flex-direction: row; justify-content: center; max-width: none; }
  .allies { grid-template-columns: repeat(3, 1fr); }
  .players { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Reduced motion: página estática completa ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html.js .hero-sub, html.js .hero-tierline, html.js .hero-ctas,
  html.js .hero-microline, html.js .pc-frag, html.js .section > * {
    opacity: 1 !important;
    transform: none !important;
  }
  .hero-grid, body::after { display: none; }
  .player-card { animation: none; }
}
