/* ===== Underground Games · animaciones y efectos =====
   Se carga DESPUÉS del CSS de cada página, así que puede sobrescribirlo. */

/* ---------- Fuentes de reserva ajustadas (evitan que la página "salte" cuando llega la fuente) ----------
   Arial con las medidas exactas de Chakra Petch y Sora: al cambiar a la fuente real no se mueve nada. */
@font-face{font-family:"Chakra FB";src:local("Arial Bold"),local("Arial-BoldMT"),local("Liberation Sans Bold"),local("Helvetica Bold"),local("Roboto Bold");font-weight:700;size-adjust:99.46%;ascent-override:99.53%;descent-override:31.17%;line-gap-override:0%}
@font-face{font-family:"Chakra FB";src:local("Arial Bold"),local("Arial-BoldMT"),local("Liberation Sans Bold"),local("Helvetica Bold"),local("Roboto Bold");font-weight:500 600;size-adjust:97.88%;ascent-override:101.15%;descent-override:31.67%;line-gap-override:0%}
@font-face{font-family:"Sora FB";src:local("Arial"),local("ArialMT"),local("Liberation Sans"),local("Helvetica"),local("Roboto");font-weight:400;size-adjust:112.18%;ascent-override:86.47%;descent-override:25.85%;line-gap-override:0%}
@font-face{font-family:"Sora FB";src:local("Arial Bold"),local("Arial-BoldMT"),local("Liberation Sans Bold"),local("Helvetica Bold"),local("Roboto Bold");font-weight:600 700;size-adjust:106.92%;ascent-override:90.73%;descent-override:27.12%;line-gap-override:0%}

/* ---------- Capas fijas: partículas, brillo del cursor, progreso ---------- */
#fx-back,#fx-front{position:fixed;left:0;top:0;width:100%;height:100%;pointer-events:none}
#fx-back{z-index:0}
#fx-front{z-index:5}
#fx-glow{position:fixed;left:0;top:0;width:560px;height:560px;margin:-280px 0 0 -280px;border-radius:50%;pointer-events:none;z-index:0;
 background:radial-gradient(circle,rgba(168,85,255,.20),rgba(255,79,216,.07) 45%,transparent 70%);
 opacity:0;transition:transform .4s cubic-bezier(.2,.7,.2,1),opacity .5s;will-change:transform}
#fx-glow.on{opacity:1}
#fx-prog{position:fixed;left:0;top:0;width:100%;height:3px;z-index:40;pointer-events:none;transform-origin:0 50%;
 transform:scaleX(var(--p,0));background:linear-gradient(90deg,#7a2cff,#b86bff,#ff4fd8);box-shadow:0 0 14px #ff4fd8}

/* ---------- Keyframes ---------- */
@keyframes fxDrop{from{opacity:0;translate:0 -26px}}
@keyframes fxRise{from{opacity:0;translate:0 30px}}
@keyframes fxPop{from{opacity:0;scale:.82}}
@keyframes fxCard{from{opacity:0;translate:0 36px;scale:.9}}
@keyframes fxFade{from{opacity:0}}
@keyframes fxShine{to{background-position:200% 0}}
@keyframes fxFloat{50%{transform:translateY(-14px) rotate(-2.5deg)}}
@keyframes fxSpin{to{transform:rotate(360deg)}}
@keyframes fxGrad{50%{background-position:100% 50%}}

/* ---------- Logo y cabecera ---------- */
/* sin backdrop-filter: el desenfoque se recalculaba en CADA fotograma porque detrás hay partículas animadas.
   Un fondo casi opaco se ve prácticamente igual y no cuesta nada. */
header .bar{animation:fxDrop .8s cubic-bezier(.2,.8,.2,1) backwards;background:linear-gradient(145deg,rgba(48,16,92,.94),rgba(12,5,26,.97));transition:border-color .4s}
header.sc .bar{border-top-color:rgba(255,79,216,.55);border-right-color:rgba(255,79,216,.55);border-bottom-color:rgba(255,79,216,.55)}
.logo i{background-image:linear-gradient(90deg,var(--ac),var(--ac2),#8d5cff,var(--ac));background-size:200% 100%;animation:fxShine 6s linear infinite}
.logo img{transition:transform .5s cubic-bezier(.2,.9,.3,1.3)}
.logo:hover img{transform:rotate(-10deg) scale(1.12)}
#q{transition:background .25s}
#q:focus{background:rgba(122,44,255,.24)}

/* ---------- Hero ---------- */
.hero h1 .ln{display:inline-block;animation:fxRise .9s cubic-bezier(.2,.8,.2,1) backwards}
.hero h1 .g{padding:0 .02em .14em;margin-bottom:-.14em;
 background-image:linear-gradient(90deg,var(--ac),var(--ac2),#8d5cff,var(--ac));background-size:200% 100%;
 -webkit-background-clip:text;background-clip:text;color:transparent;
 animation:fxRise .9s .18s cubic-bezier(.2,.8,.2,1) backwards,fxShine 6s linear infinite}
.hero .sub{animation:fxRise .9s .38s cubic-bezier(.2,.8,.2,1) backwards}
.emblem{transform:translate(var(--px,0px),var(--py,0px));transition:transform .5s cubic-bezier(.2,.7,.2,1);animation:fxPop 1s .2s cubic-bezier(.2,.9,.3,1.2) backwards}
.emblem img{animation:pulse 5s ease-in-out infinite,fxFloat 7s ease-in-out infinite}
.emblem::after{content:"";position:absolute;inset:-3%;border-radius:50%;pointer-events:none;
 background:conic-gradient(from 0deg,transparent 0 55%,#ff4fd8 100%);
 -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 2px),#000 calc(100% - 1px));
 mask:radial-gradient(farthest-side,transparent calc(100% - 2px),#000 calc(100% - 1px));
 animation:fxSpin 6s linear infinite}
.cats{animation:fxRise .8s .5s cubic-bezier(.2,.8,.2,1) backwards}

/* Emblema nuevo (trae su propio aro y humo): más grande, sin el aro CSS */
.emblem{width:clamp(150px,32vw,370px);margin:-50px -45px -50px 0;pointer-events:none}
.emblem::before{inset:20%;background:radial-gradient(circle,rgba(168,60,255,.42),transparent 68%)}
.emblem::after{display:none}
.emblem img{filter:none;animation:fxFloat 7s ease-in-out infinite}
.emblem.gl img{visibility:hidden}
.emb-gl{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;animation:fxFloat 7s ease-in-out infinite}
@media(max-width:520px){.emblem{width:150px;margin:-20px -30px -20px 0}}

/* ---------- Chips y botones ---------- */
.chip,.btn{position:relative;overflow:hidden}
.chip{transition:background .2s,transform .2s}
.chip:hover{transform:translateY(-2px)}
.chip:active{transform:scale(.95)}
.chip::after,.btn::after{content:"";position:absolute;inset:0;pointer-events:none;
 background:linear-gradient(110deg,transparent 30%,rgba(255,255,255,.35) 50%,transparent 70%);
 transform:translateX(-130%);transition:transform .7s}
.chip:hover::after,.btn:hover::after{transform:translateX(130%)}

/* ---------- Tarjetas de juegos ---------- */
/* en reposo SIN transformación 3D: antes cada tarjeta era una capa 3D aparte en la GPU (mucha memoria y scroll más pesado).
   Solo la tarjeta que tienes debajo del ratón se vuelve 3D. */
#grid .card{--rx:0deg;--ry:0deg;--mx:50%;--my:50%;
 transform:none;
 transition:transform .18s ease-out,border-color .25s}
#grid .card:hover{transform:perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-6px) scale(1.025);z-index:2}
@media(hover:none){#grid .card:hover{transform:none}#grid .card:hover .th{transform:none}#grid .card:active{transform:scale(.97)}}
#grid .card::after{content:"";position:absolute;inset:0;pointer-events:none;opacity:0;transition:opacity .3s;
 background:radial-gradient(260px circle at var(--mx) var(--my),rgba(255,255,255,.22),rgba(184,107,255,.18) 35%,transparent 65%)}
#grid .card:hover::after{opacity:1}
#grid .card .th{transition:filter .25s,transform .7s cubic-bezier(.2,.8,.2,1)}
#grid .card:hover .th{transform:scale(1.09)}
#grid .card.pre{opacity:0}
#grid .card.in{animation:fxCard .75s cubic-bezier(.2,.8,.2,1) backwards;animation-delay:calc(var(--i,0) * 70ms)}
.badge-top{animation:fxBadge 2.4s ease-in-out infinite}
@keyframes fxBadge{50%{transform:scale(1.1) rotate(-3deg)}}

/* ---------- Aparecer al hacer scroll ---------- */
.rv{opacity:0;translate:0 26px;transition:opacity .8s cubic-bezier(.2,.8,.2,1),translate .8s cubic-bezier(.2,.8,.2,1)}
.rv.in{opacity:1;translate:none}
.info h2{transition:border-color .4s}

/* ---------- Reproductor ---------- */
/* sin desenfoque detrás del juego: el navegador podía recalcularlo en cada fotograma del juego y le robaba FPS */
#player{backdrop-filter:none;-webkit-backdrop-filter:none;background:#06020f}
/* mientras juegas, la portada de detrás ni se dibuja: toda la potencia para el juego */
html.fx-play .wrap,html.fx-play header,html.fx-play .orb,html.fx-play #sidebar,html.fx-play #sbk,html.fx-play #fx-back,html.fx-play #fx-front,html.fx-play #fx-glow,html.fx-play footer.site{visibility:hidden!important}
#player.on{animation:fxFade .3s}
#player.on .pb{animation:fxPop .5s cubic-bezier(.2,.9,.3,1.1)}

/* ---------- Páginas legales / fichas de juego ---------- */
.box>.top{animation:fxDrop .7s cubic-bezier(.2,.8,.2,1) backwards}
.box>main.card{animation:fxRise .9s .12s cubic-bezier(.2,.8,.2,1) backwards}
.box>footer{animation:fxFade 1s .5s backwards}

/* ---------- Accesibilidad: menos movimiento ---------- */
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{animation:none!important;transition-duration:.01ms!important}
 .rv,#grid .card.pre{opacity:1!important;translate:none!important}
 #fx-glow,#fx-prog{display:none}
}

/* ---------- Arreglo móvil: la columna principal no debe ensancharse por la fila de categorías ---------- */
.wrap>main{min-width:0}

.chip{flex:none}
@media(max-width:520px){.emblem{margin-right:-18px}}

/* ---------- Cursor morado personalizado ----------
   Normal: flecha violeta con brillo · Enlaces/botones/tarjetas: flecha rosa con aro · Texto: barra neón.
   Para volver al cursor normal, borra este bloque. */
html{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='-3 -3 36 36'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23c58bff'/%3E%3Cstop offset='1' stop-color='%237a2cff'/%3E%3C/linearGradient%3E%3Cfilter id='g' x='-50%' y='-50%' width='200%' height='200%'%3E%3CfeGaussianBlur stdDeviation='1.7' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23g)'%3E%3Cpath d='M6 4 L6 26 L11.4 21 L15.4 29.4 L19.2 27.6 L15.2 19.4 L22.6 19.4 Z' fill='%23b86bff' opacity='.55' transform='translate(0 0) scale(1.0)'/%3E%3Cpath d='M6 4 L6 26 L11.4 21 L15.4 29.4 L19.2 27.6 L15.2 19.4 L22.6 19.4 Z' fill='url(%23f)' stroke='%23f6ecff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E") 9 7,auto}
a,button,[role=button],summary,select,label[for],input[type=submit],input[type=button],input[type=checkbox],input[type=radio],.card,.chip,.btn,.sb-item,.burger,.logo,#intro{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='-3 -3 36 36'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23ff7be5'/%3E%3Cstop offset='1' stop-color='%239a3bff'/%3E%3C/linearGradient%3E%3Cfilter id='g' x='-50%' y='-50%' width='200%' height='200%'%3E%3CfeGaussianBlur stdDeviation='1.7' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23g)'%3E%3Cpath d='M6 4 L6 26 L11.4 21 L15.4 29.4 L19.2 27.6 L15.2 19.4 L22.6 19.4 Z' fill='%23ff4fd8' opacity='.55' transform='translate(0 0) scale(1.0)'/%3E%3Cpath d='M6 4 L6 26 L11.4 21 L15.4 29.4 L19.2 27.6 L15.2 19.4 L22.6 19.4 Z' fill='url(%23f)' stroke='%23f6ecff' stroke-width='1.4' stroke-linejoin='round'/%3E%3Ccircle cx='6' cy='4' r='3.2' fill='none' stroke='%23ffffff' stroke-width='1.2' opacity='.9'/%3E%3C/g%3E%3C/svg%3E") 9 7,pointer!important}
input:not([type=submit]):not([type=button]):not([type=checkbox]):not([type=radio]),textarea,[contenteditable=true]{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='32' viewBox='0 0 28 32'%3E%3Cdefs%3E%3Cfilter id='g' x='-80%' y='-30%' width='260%' height='160%'%3E%3CfeGaussianBlur stdDeviation='1.6' result='b'/%3E%3CfeMerge%3E%3CfeMergeNode in='b'/%3E%3CfeMergeNode in='SourceGraphic'/%3E%3C/feMerge%3E%3C/filter%3E%3C/defs%3E%3Cg filter='url(%23g)' stroke='%23c58bff' stroke-width='2.4' stroke-linecap='round' fill='none'%3E%3Cpath d='M9 5 H19 M14 5 V27 M9 27 H19'/%3E%3C/g%3E%3Cg stroke='%23ffffff' stroke-width='1' stroke-linecap='round' fill='none' opacity='.9'%3E%3Cpath d='M9 5 H19 M14 5 V27 M9 27 H19'/%3E%3C/g%3E%3C/svg%3E") 14 16,text!important}

/* ---------- 🎅 Navidad: gorro en el logo y en el emblema ----------
   Para quitarlo después de Navidad: borra este bloque (y, si quieres, el archivo xmas-hat.svg). */
.logo{position:relative}
.logo::before{content:"";--ls:46px;position:absolute;z-index:2;pointer-events:none;
 left:calc(var(--ls)*.38);top:calc(var(--ls)*-.12);width:calc(var(--ls)*.66);aspect-ratio:220/170;
 background:url(xmas-hat.svg) center/contain no-repeat;transform:rotate(22deg);transition:transform .5s cubic-bezier(.2,.9,.3,1.3)}
.logo:hover::before{transform:rotate(10deg) translate(-2px,-4px)}
.box .logo::before{--ls:44px}
@media(max-width:520px){header .logo::before{--ls:42px}.box .logo::before{--ls:36px}}
.xhat{position:absolute;z-index:2;left:47%;top:1%;width:40%;aspect-ratio:220/170;pointer-events:none;
 background:url(xmas-hat.svg) center/contain no-repeat;rotate:20deg;animation:fxFloat 7s ease-in-out infinite}
html.fx-still .xhat{animation-play-state:paused}
html.fx-low .xhat{animation:none!important}

/* ---------- Rendimiento ----------
   · fx-play: se está jugando -> toda la web de fondo queda quieta para no competir con el juego
   · fx-still: el hero no se ve (has bajado) -> se pausan el brillo del título y el emblema
   · fx-low: equipo modesto -> sin animaciones infinitas decorativas */
html.fx-play :not(#player):not(#player *),html.fx-play :not(#player):not(#player *)::before,html.fx-play :not(#player):not(#player *)::after{animation-play-state:paused!important}
html.fx-still .hero h1 .g,html.fx-still .emblem img,html.fx-still .emb-gl,html.fx-still .orb{animation-play-state:paused}
html.fx-low .orb,html.fx-low .hero h1 .g,html.fx-low .logo i,html.fx-low .chip.on,html.fx-low .badge-top,html.fx-low .emblem img,html.fx-low .emb-gl,html.fx-low .soon .dots i{animation:none!important}
/* modo ligero: fuera el brillo que sigue al ratón por la tarjeta (se repintaba en cada movimiento) y el halo del cursor */
html.fx-low #grid .card::after,html.fx-low #fx-glow{display:none!important}
html.fx-low #grid .card .th{transition:transform .4s ease-out}
/* lo que está fuera de la pantalla no se dibuja hasta que te acercas (scroll más suave en equipos lentos) */
footer.site{content-visibility:auto;contain-intrinsic-size:auto 420px}