/* =========================================================
   HADES ONE E'SPORTS — Capa de efectos 3D y animaciones
   Todo con transform/opacity (GPU). Se apaga sola en equipos
   lentos (.lowfx) o con "reducir movimiento".
   ========================================================= */
/* Los elementos inclinados en 3D no deben ensanchar la página en celulares */
html, body, main { overflow-x: clip; }
@supports not (overflow: clip) { main { overflow-x: hidden; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Barra de progreso de scroll ---------- */
.scroll-fx { display: none; }
@supports (animation-timeline: scroll()) {
  .scroll-fx {
    display: block; position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 210;
    background: var(--grad); transform-origin: 0 50%; transform: scaleX(0);
    animation: scroll-grow linear both; animation-timeline: scroll(root);
  }
  @keyframes scroll-grow { to { transform: scaleX(1); } }
}

/* ---------- Botones con destello ---------- */
.btn { overflow: hidden; }
.btn::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -45%; width: 30%; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .4), transparent);
  transform: skewX(-20deg); transition: transform .6s ease;
}
.btn:hover::after { transform: skewX(-20deg) translateX(520%); }

/* ---------- Revelado 3D ---------- */
.js [data-reveal="flip"] { transform: perspective(900px) rotateX(-32deg) translateY(36px); transform-origin: 50% 100%; }
.js .page-head [data-reveal], .js .sec-head[data-reveal] { transform: perspective(800px) rotateX(-40deg) translateY(18px); transform-origin: 50% 100%; }
.js [data-reveal].in, .js .page-head [data-reveal].in, .js .sec-head[data-reveal].in { transform: none; }
.js [data-reveal].in[data-tilt] { transition: opacity .6s ease, transform .25s ease-out; }

/* ---------- Encabezado de páginas internas: suelo 3D ---------- */
.page-head { position: relative; isolation: isolate; }
.page-head::before {
  content: ''; position: absolute; z-index: -1; left: -25%; right: -25%; bottom: -10px; height: 300px;
  background-image: linear-gradient(rgba(124, 58, 237, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(124, 58, 237, .4) 1px, transparent 1px);
  background-size: 44px 44px; transform: perspective(380px) rotateX(66deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 80%); mask-image: linear-gradient(to top, #000 0%, transparent 80%);
  opacity: .45; pointer-events: none;
}
.page-head::after {
  content: ''; position: absolute; z-index: -1; left: 10%; right: 10%; bottom: 40px; height: 160px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(225, 29, 72, .22), transparent 70%);
}

/* =========================================================
   HERO 3D
   ========================================================= */
.hero3d::after { display: none; }
.hero3d { min-height: min(100vh, 920px); }
.arena { position: absolute; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; perspective: 420px; perspective-origin: 50% 64%; }
.arena-sun {
  position: absolute; left: 50%; top: 64%; width: 1100px; height: 360px; transform: translate(-50%, -78%);
  background: radial-gradient(ellipse at 50% 100%, rgba(225, 29, 72, .35), rgba(124, 58, 237, .18) 40%, transparent 70%);
}
.arena-sun::after { /* línea de horizonte */
  content: ''; position: absolute; left: 0; right: 0; bottom: 22%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 77, 109, .9), rgba(167, 139, 250, .9), transparent);
}
.arena-plane {
  position: absolute; left: -160%; right: -160%; top: 64%; height: 400px; overflow: hidden;
  transform: rotateX(70deg); transform-origin: 50% 0;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
}
.arena-grid {
  position: absolute; left: 0; right: 0; top: -48px; bottom: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, .42) 2px, transparent 2px),
    linear-gradient(90deg, rgba(124, 58, 237, .38) 2px, transparent 2px);
  background-size: 48px 48px;
  animation: grid-run 1.4s linear infinite; will-change: transform;
}
@keyframes grid-run { to { transform: translate3d(0, 48px, 0); } }

.hero-stage { position: relative; width: 100%; max-width: 480px; aspect-ratio: 1; justify-self: center; display: grid; place-items: center; }
.stage-glow { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgba(124, 58, 237, .45), rgba(225, 29, 72, .16) 45%, transparent 70%); }
.scene {
  --px: 0deg; --py: 0deg;
  position: relative; width: 62%; aspect-ratio: 1; display: grid; place-items: center;
  transform-style: preserve-3d; transform: perspective(1000px) rotateX(var(--py)) rotateY(var(--px));
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.token-float { transform-style: preserve-3d; animation: float3d 6s ease-in-out infinite; }
@keyframes float3d { 50% { transform: translate3d(0, -14px, 0); } }
.token {
  --s: clamp(150px, 22vw, 250px); --d: calc(var(--s) * .1);
  position: relative; width: var(--s); height: var(--s); transform-style: preserve-3d;
  animation: token-spin 14s linear infinite;
}
@keyframes token-spin { from { transform: rotateX(-8deg) rotateY(0deg); } to { transform: rotateX(-8deg) rotateY(360deg); } }
.token-face { position: absolute; inset: 0; width: 100%; height: 100%; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.token-face.front { transform: translateZ(calc(var(--d) / 2)); }
.token-face.back { transform: rotateY(180deg) translateZ(calc(var(--d) / 2)); }
.token-edge {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--s) * .49 + 2px); height: var(--d);
  margin-left: calc(var(--s) * -.245 - 1px); margin-top: calc(var(--d) / -2);
  background: linear-gradient(90deg, #3b1475, #7c3aed 35%, #e11d48 100%);
  transform: rotateZ(calc(30deg + var(--i) * 60deg)) translateY(calc(var(--s) * -.4243)) rotateX(90deg);
  filter: brightness(calc(.55 + var(--i) * .1));
}
.token-shadow {
  position: absolute; left: 50%; bottom: 8%; width: 46%; height: 8%; transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(225, 29, 72, .45), transparent 70%); animation: shadow-pulse 6s ease-in-out infinite;
}
@keyframes shadow-pulse { 50% { transform: translateX(-50%) scale(.8); opacity: .6; } }
.orbit { position: absolute; inset: -14%; border-radius: 50%; border: 1px solid rgba(167, 139, 250, .38); transform: rotateX(74deg); animation: orbit-a 10s linear infinite; transform-style: preserve-3d; }
.orbit.o2 { inset: -28%; border-color: rgba(255, 77, 109, .28); border-style: dashed; animation: orbit-b 16s linear infinite; }
.orbit i { position: absolute; top: -5px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--red-2); box-shadow: 0 0 14px 3px rgba(255, 77, 109, .7); }
.orbit.o2 i { background: var(--purple-2); box-shadow: 0 0 14px 3px rgba(167, 139, 250, .7); }
@keyframes orbit-a { from { transform: rotateX(74deg) rotateZ(0); } to { transform: rotateX(74deg) rotateZ(360deg); } }
@keyframes orbit-b { from { transform: rotateY(-18deg) rotateX(66deg) rotateZ(360deg); } to { transform: rotateY(-18deg) rotateX(66deg) rotateZ(0); } }

/* HUD */
.hud { position: absolute; width: 26px; height: 26px; border: 2px solid rgba(255, 255, 255, .5); }
.hud.c1 { top: 6%; left: 6%; border-right: 0; border-bottom: 0; }
.hud.c2 { top: 6%; right: 6%; border-left: 0; border-bottom: 0; }
.hud.c3 { bottom: 6%; left: 6%; border-right: 0; border-top: 0; }
.hud.c4 { bottom: 6%; right: 6%; border-left: 0; border-top: 0; }
.hud-tag { position: absolute; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-h); font-size: .68rem; letter-spacing: .2em; color: rgba(255, 255, 255, .55); }
.hud-tag.t1 { top: 2%; left: 13%; }
.hud-tag.t2 { bottom: 2%; right: 13%; }
.hero-stage::before { /* barrido de escáner */
  content: ''; position: absolute; left: 8%; right: 8%; top: 8%; height: 2px; z-index: 2; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 77, 109, .8), transparent);
  animation: scan-y 4.5s ease-in-out infinite;
}
@keyframes scan-y { 0%, 100% { transform: translateY(0); opacity: 0; } 10%, 90% { opacity: 1; } 50% { transform: translateY(calc(min(480px, 84vw) * .82)); } }

/* Título del hero */
.hero-title .ht-main { display: inline-block; text-shadow: 3px 0 0 rgba(225, 29, 72, .55), -3px 0 0 rgba(124, 58, 237, .55); }
.js:not(.lowfx) .hero-title { animation: title-in .9s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes title-in { from { opacity: 0; transform: perspective(700px) rotateX(-55deg) translateY(30px); } }
.js:not(.lowfx) .hero-copy > .live-chip, .js:not(.lowfx) .hero-text, .js:not(.lowfx) .hero-cta, .js:not(.lowfx) .hero-stats, .js:not(.lowfx) .countdown { animation: rise .7s cubic-bezier(.2, .8, .2, 1) both; }
.js:not(.lowfx) .hero-text { animation-delay: .15s; }
.js:not(.lowfx) .hero-cta { animation-delay: .25s; }
.js:not(.lowfx) .hero-stats { animation-delay: .35s; }
.js:not(.lowfx) .countdown { animation-delay: .45s; }
.js:not(.lowfx) .hero-stage { animation: stage-in 1.1s cubic-bezier(.2, .8, .2, 1) .1s both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes stage-in { from { opacity: 0; transform: scale(.8) rotate(-8deg); } }

/* Cuenta regresiva */
.countdown {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; width: fit-content; max-width: 100%; margin-top: 18px; padding: 12px 16px;
  background: linear-gradient(120deg, rgba(225, 29, 72, .14), rgba(124, 58, 237, .14)); border: 1px solid rgba(255, 77, 109, .35);
  clip-path: var(--cut-sm); color: var(--text);
}
.countdown:hover { color: var(--white); border-color: var(--red-2); }
.cd-label { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: #e7e5ee; }
.cd-label b { color: var(--white); }
.cd-boxes { display: flex; gap: 6px; }
.cd-boxes > span { min-width: 52px; padding: 6px 4px; text-align: center; background: rgba(9, 9, 13, .75); border: 1px solid var(--line-2); border-radius: 4px; }
.cd-boxes b { display: block; font-family: var(--font-h); font-size: 1.35rem; line-height: 1.1; color: var(--white); font-variant-numeric: tabular-nums; }
.cd-boxes small { font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cd-live { display: none; font-family: var(--font-h); color: var(--red-2); letter-spacing: .15em; }
.countdown.done .cd-boxes { display: none; }
.countdown.done .cd-live { display: inline; }

@media (max-width: 900px) {
  .hero-stage { max-width: 300px; order: -1; margin-bottom: -10px; }
  .hud-tag { display: none; }
  .countdown { margin-inline: auto; justify-content: center; }
  .arena { perspective-origin: 50% 70%; }
  .arena-sun, .arena-plane { top: 70%; }
}

/* ---------- Ticker "EN VIVO" ---------- */
.ticker { position: relative; z-index: 3; display: flex; align-items: stretch; background: #0b0b11; border-block: 1px solid var(--line); overflow: hidden; }
.ticker-label {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 0 22px 0 16px; background: var(--red); color: var(--white);
  font-family: var(--font-h); font-size: .78rem; letter-spacing: .2em; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%);
}
.ticker-label .dot { background: var(--white); }
.ticker-view { flex: 1; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track { display: inline-flex; white-space: nowrap; animation: ticker 38s linear infinite; will-change: transform; }
.ticker:hover .ticker-track { animation-play-state: paused; }
.tk { display: inline-flex; align-items: center; gap: 10px; padding: 12px 34px 12px 0; font-size: .92rem; color: #d6d4df; }
.tk b { font-family: var(--font-h); font-size: .72rem; letter-spacing: .16em; color: var(--red-2); }
.tk::after { content: ''; width: 7px; height: 7px; margin-left: 24px; background: var(--purple-2); transform: rotate(45deg); }
@keyframes ticker { to { transform: translate3d(-50%, 0, 0); } }
.ticker + .quick { margin-top: 28px; }

/* ---------- Accesos rápidos con profundidad ---------- */
.q-card { position: relative; transform-style: preserve-3d; clip-path: none; border-radius: 4px; overflow: visible; }
.q-card::before { /* esquina recortada decorativa */
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 16px; height: 16px; background: var(--bg);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.q-card .q-ico { transform: translateZ(46px); box-shadow: 0 10px 24px rgba(225, 29, 72, .25); }
.q-card h3 { transform: translateZ(30px); }
.q-card p { transform: translateZ(16px); }
.q-card .go { transform: translateZ(24px); }
.glare, .t-card::after {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; border-radius: inherit;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .12), transparent 45%);
}
.t-card::after { content: ''; z-index: 3; }
.q-card:hover .glare, .t-card:hover::after { opacity: 1; }
.q-card:hover { border-color: rgba(255, 77, 109, .5); box-shadow: 0 24px 50px -20px rgba(124, 58, 237, .5); }

/* ---------- Encabezados: texto HUD ---------- */
.eyebrow { font-variant-numeric: tabular-nums; }
.title-xl { position: relative; }

/* =========================================================
   TARJETA DE JUGADOR 3D (trading card)
   ========================================================= */
.player.card3d {
  clip-path: none; overflow: visible; border: 0; background: none; perspective: 1100px;
  cursor: pointer; outline-offset: 6px; --tx: 0deg; --ty: 0deg; --mx: 50%; --my: 50%;
}
.player.card3d:hover { border: 0; }
.card3d-inner {
  position: relative; display: grid; transform-style: preserve-3d;
  transform: rotateX(var(--tx)) rotateY(calc(var(--ty) + var(--flip, 0deg)));
  transition: transform .55s cubic-bezier(.2, .8, .2, 1);
}
.card3d.flipped { --flip: 180deg; }
.card3d .face {
  grid-area: 1 / 1; position: relative; overflow: hidden; clip-path: var(--cut);
  background: var(--surface); border: 1px solid var(--line);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.card3d:hover .face-front, .card3d:focus-visible .face-front { border-color: color-mix(in srgb, var(--rc) 60%, transparent); }
.card3d .face-front::before { /* borde de rareza */
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; clip-path: var(--cut);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--rc) 35%, transparent), inset 0 -60px 60px -40px color-mix(in srgb, var(--rc) 30%, transparent);
}
.card3d[data-tier="immortal"] .face-front::before, .card3d[data-tier="glory"] .face-front::before {
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .55), inset 0 -60px 60px -40px rgba(251, 191, 36, .25);
}
.holo {
  position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 77, 109, .28) 36%, rgba(167, 139, 250, .32) 46%, rgba(255, 255, 255, .3) 52%, rgba(56, 189, 248, .2) 60%, transparent 75%);
  background-size: 260% 260%; background-position: var(--mx) var(--my); mix-blend-mode: screen;
}
.card3d:hover .holo { opacity: 1; }
.flip-hint {
  position: absolute; right: 10px; bottom: 10px; z-index: 5; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(9, 9, 13, .8); border: 1px solid var(--line-2); border-radius: 30px; color: #d6d4df; transition: background .2s, color .2s;
}
.card3d:hover .flip-hint { background: var(--red); color: var(--white); border-color: var(--red); }
.face-front .player-body { padding-bottom: 40px; }

/* Reverso */
.face-back {
  transform: rotateY(180deg); display: flex; flex-direction: column; padding: 18px;
  background:
    radial-gradient(circle at 85% 10%, color-mix(in srgb, var(--rc) 35%, transparent), transparent 45%),
    radial-gradient(circle at 10% 95%, rgba(225, 29, 72, .25), transparent 45%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 10px),
    #12121a !important;
}
.back-top { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.back-top span { font-family: var(--font-h); font-size: .78rem; letter-spacing: .1em; color: var(--white); line-height: 1.1; flex: 1; }
.back-top em { display: block; font-style: normal; font-size: .6rem; letter-spacing: .3em; color: var(--red-2); }
.back-top b { font-family: var(--font-h); color: var(--muted); font-size: .85rem; }
.back-nick { margin-top: auto; padding-top: 18px; font-family: var(--font-h); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2rem); color: var(--white); text-transform: uppercase; line-height: 1; word-break: break-word; }
.back-role { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 16px; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; color: var(--rc); }
.back-role i { width: 9px; height: 9px; background: var(--rc); transform: rotate(45deg); }
.back-stats { margin: 0; display: grid; gap: 8px; }
.back-stats div { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; background: rgba(255, 255, 255, .04); border-left: 3px solid var(--rc); }
.back-stats dt { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.back-stats dd { margin: 0; font-weight: 700; color: var(--white); text-align: right; font-size: .9rem; }
.back-foot { display: flex; justify-content: space-between; margin-top: 16px; font-family: var(--font-h); font-size: .66rem; letter-spacing: .25em; color: rgba(255, 255, 255, .35); }

/* =========================================================
   TORNEOS
   ========================================================= */
.t-card .t-banner .ph-mode { transition: transform .5s; }
.t-card:hover .t-banner .ph-mode { transform: scale(1.12) rotate(-3deg); }
.t-card:hover .t-banner img { transform: scale(1.06); transition: transform .5s; }
.t-card { transition: border-color .2s, box-shadow .3s; }
.t-card:hover { box-shadow: 0 30px 60px -28px rgba(225, 29, 72, .55); }
.progress i { position: relative; overflow: hidden; }
.progress i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .5), transparent); transform: translateX(-100%); animation: bar-shine 2.4s ease-in-out infinite; }
@keyframes bar-shine { 60%, 100% { transform: translateX(100%); } }

/* =========================================================
   BRACKETS
   ========================================================= */
.js .in .b-match { animation: bm-in .55s cubic-bezier(.2, .8, .2, 1) both; }
.js .in .b-round:nth-child(2) .b-match { animation-delay: .2s; }
.js .in .b-round:nth-child(3) .b-match { animation-delay: .4s; }
.js .in .b-round:nth-child(4) .b-match { animation-delay: .6s; }
.js .in .b-round:nth-child(5) .b-match { animation-delay: .8s; }
.js .in .b-round:nth-child(6) .b-match { animation-delay: 1s; }
@keyframes bm-in { from { opacity: 0; transform: perspective(600px) translateX(-18px) rotateY(-30deg); } }
.b-round:not(:last-child) .b-match::after { transform-origin: 0 50%; background: linear-gradient(90deg, var(--purple-2), var(--red-2)); }
.js .in .b-round:not(:last-child) .b-match::after { animation: line-in .4s ease-out .5s both; }
@keyframes line-in { from { transform: scaleX(0); } }
.b-match { transition: transform .2s, border-color .2s; }
.b-match:hover { transform: translateY(-2px); border-color: rgba(255, 77, 109, .5); }
.b-team.win b { color: var(--red-2); }
.js .in .match-row { animation: rise .45s ease both; }
.champion { overflow: hidden; }
.champion::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(251, 191, 36, .2) 50%, transparent 60%);
  transform: translateX(-100%); animation: champ-sweep 3.6s ease-in-out infinite;
}
@keyframes champ-sweep { 55%, 100% { transform: translateX(100%); } }
.champion .crown { animation: crown 3s ease-in-out infinite; box-shadow: 0 0 0 0 rgba(251, 191, 36, .4); }
@keyframes crown { 50% { transform: translateY(-6px) rotate(-4deg); box-shadow: 0 0 0 12px rgba(251, 191, 36, 0); } }

/* ---------- Agenda / formularios ---------- */
.agenda-item { transition: transform .2s, border-color .2s; }
.agenda-item:hover { transform: translateX(6px); }
.fieldset { transition: border-color .2s, background .2s; }
.fieldset:focus-within { border-color: rgba(167, 139, 250, .45); background: rgba(124, 58, 237, .05); }
.mv-card { transition: transform .3s, box-shadow .3s; }
.mv-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -20px rgba(124, 58, 237, .35); }

/* =========================================================
   MODO LIGERO / PAUSA
   ========================================================= */
.hero3d.paused *, .hero3d.paused *::before, .hero3d.paused *::after { animation-play-state: paused !important; }
.lowfx .arena-grid, .lowfx .token, .lowfx .token-float, .lowfx .orbit, .lowfx .hero-stage::before,
.lowfx .ticker-track, .lowfx .progress i::after, .lowfx .champion::after, .lowfx .token-shadow { animation: none !important; }
.lowfx .token { transform: rotateX(-8deg) rotateY(-22deg); }
.lowfx .ticker-view { overflow-x: auto; }
.lowfx .holo { display: none; }
@media (prefers-reduced-motion: reduce) {
  .card3d-inner { transition: none; }
}
