/* select: selección de luchador (#chars) y de escenario (#stages), al estilo de Tekken / Street Fighter 6.
   Detrás, la ilustración de cada jugador (J1 a la izquierda, J2 a la derecha) con su nombre enorme a su lado;
   abajo, en un panel, la rejilla de retratos agrupada por categorías. menus.js (selLayout) elige cuántas columnas
   tiene la rejilla y el tamaño del retrato (--tile, --g, --lh, --lf en px) para que quepa entera sin scroll; el
   hueco que puede ocupar lo dicen --grid-w / --grid-h (fracción del ancho / alto de la pantalla). */
.cards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 0 16px; }
.card { position: relative; cursor: pointer; }

#chars {
  --p1: #ffd84a; --p2: #5fd0ff;
  --tile: 72px; --g: 4px; --lh: 14px; --lf: 8px;   /* los pone selLayout */
  --grid-w: .76; --grid-h: .4; --tile-max: 112;
  --sp: calc((100vh - var(--dock, 36vh) - 16vh) / 78);   /* alto de un píxel del sprite grande */
  gap: 0; padding: 0 0 1.2vh; overflow: hidden; justify-content: flex-end;
  background: radial-gradient(ellipse at 50% 30%, #243263 0%, #0f1530 55%, #05070f 100%);
}
#chars > .sel-band, #chars > .sel-dock { position: relative; z-index: 4; }

/* ---- fondo de cada jugador: ilustración grande con halo, rayos, chispas y barrido (mitad de su lado, en diagonal) */
.sel-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .3s; }
.sel-bg.on { opacity: 1; }
.sel-bg.p1 { --gx: 24%; clip-path: polygon(0 0, 57% 0, 43% 100%, 0 100%); }
.sel-bg.p2 { --gx: 76%; clip-path: polygon(57% 0, 100% 0, 100% 100%, 43% 100%); }
.sel-bg .glow { position: absolute; inset: 0;
  background: radial-gradient(ellipse at var(--gx) 40%, color-mix(in srgb, var(--c) 55%, transparent), transparent 62%),
              linear-gradient(180deg, transparent 40%, color-mix(in srgb, var(--c) 22%, transparent)); }
.sel-bg .rays { position: absolute; left: calc(var(--gx) - 80vmax); top: calc(40% - 80vmax); width: 160vmax; height: 160vmax;
  background: repeating-conic-gradient(color-mix(in srgb, var(--c) 34%, transparent) 0 5deg, transparent 5deg 15deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 42%); mask: radial-gradient(circle, #000 0, transparent 42%);
  animation: sel-spin 50s linear infinite; will-change: transform; }
.sel-bg.p2 .rays { animation-direction: reverse; }
.sel-bg .fig { position: absolute; top: -3vh; height: 120vh; }
.sel-bg.p1 .fig { left: -1vw; }
.sel-bg.p2 .fig { right: -1vw; }
.sel-bg .float { height: 100%; animation: sel-float 3.4s ease-in-out infinite; }
.sel-bg img { height: 100%; opacity: .5; filter: brightness(.85) saturate(1.15) drop-shadow(0 0 6px var(--c)) drop-shadow(0 0 28px var(--c)); }
.sel-bg.p2 img { transform: scaleX(-1); }
/* "?" y bloqueados: silueta negra con contorno de luz del color del personaje */
.sel-bg.mystery img, .sel-bg.dark img { opacity: .9; filter: brightness(0) drop-shadow(0 0 1px #fff) drop-shadow(0 0 3px var(--c)) drop-shadow(0 0 26px var(--c)); }
.sel-bg::after { content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0 2px, transparent 2px 4px); }
/* barrido de luz: una franja que se desplaza con transform (sin repintar la pantalla entera) */
.sel-bg .sweep { position: absolute; top: 0; bottom: 0; left: 0; width: 60%; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.14) 50%, transparent 80%);
  transform: translateX(-100%); animation: sel-sweep 4.5s linear infinite; will-change: transform; }
.sel-bg i { position: absolute; bottom: -12px; width: 4px; height: 4px; background: var(--c); box-shadow: 0 0 6px var(--c), 0 0 12px var(--c);
  animation: sel-ember linear infinite; opacity: 0; }
.sel-bg.enter .fig { animation: sel-fig-in .5s cubic-bezier(.2,.9,.3,1.15); }
.sel-bg.p2.enter .fig { animation-name: sel-fig-in-r; }
.sel-bg.enter .glow { animation: sel-flash .5s ease-out; }
.sel-bg.flash .glow { animation: sel-confirm .6s ease-out; }
@keyframes sel-spin { to { transform: rotate(360deg); } }
@keyframes sel-float { 50% { transform: translateY(-.6vh); } }
@keyframes sel-sweep { from { transform: translateX(-100%); } to { transform: translateX(170%); } }
@keyframes sel-ember { 0% { transform: translateY(0) scale(1); opacity: 0; } 10% { opacity: 1; }
                       100% { transform: translate(var(--dx), -105vh) scale(.4); opacity: 0; } }
@keyframes sel-fig-in { from { transform: translateX(-30vw) skewX(-12deg); opacity: 0; } }
@keyframes sel-fig-in-r { from { transform: translateX(30vw) skewX(12deg); opacity: 0; } }
@keyframes sel-flash { from { opacity: .3; } }
@keyframes sel-confirm { 0% { filter: brightness(5) saturate(0); } 100% { filter: none; } }
/* viñeta: oscurece arriba y abajo para que se lean el título y la rejilla */
.sel-vig { position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(2,4,12,.6) 0, transparent 20%, transparent 44%, rgba(2,4,12,.9) 100%),
              radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0,0,0,.5) 100%); }

/* ---- sprite grande (el idle del atlas, ampliado sin suavizar) de pie sobre el panel de la rejilla */
.sel-art { position: absolute; z-index: 3; bottom: calc(var(--dock, 36vh) + 1vh); pointer-events: none; display: flex; align-items: flex-end;
           opacity: 0; transition: opacity .25s; }
.sel-art.on { opacity: 1; }
/* hacia el centro, entre el nombre de su lado y el del rival: cara a cara como en la pantalla de VS */
.sel-art.p1 { left: 35vw; transform: translateX(-50%); }
.sel-art.p2 { right: 35vw; transform: translateX(50%); }
.sel-art canvas { image-rendering: pixelated; background: none; filter: drop-shadow(0 0 18px rgba(0,0,0,.6)) brightness(.95); }
.sel-art.p2 canvas { transform: scaleX(-1); }
.sel-art.dark canvas { filter: brightness(0) drop-shadow(0 0 2px var(--p1)); opacity: .85; }
.sel-art.q canvas { transform: none !important; filter: drop-shadow(0 0 10px #ffd84a) drop-shadow(0 0 2px #000); animation: q-bob 1s ease-in-out infinite; }
.sel-art.enter.p1 { animation: sel-in-l .3s ease-out; }
.sel-art.enter.p2 { animation: sel-in-r .3s ease-out; }
.sel-art.flash canvas { animation: sel-confirm .6s ease-out; }
@keyframes q-bob { 50% { transform: translateY(-1.5vh) rotate(-4deg); } }
@keyframes sel-in-l { from { transform: translateX(calc(-50% - 14vw)); opacity: 0; } to { transform: translateX(-50%); opacity: 1; } }
@keyframes sel-in-r { from { transform: translateX(calc(50% + 14vw)); opacity: 0; } to { transform: translateX(50%); opacity: 1; } }

/* ---- cabecera y panel del jugador */
.sel-head { position: absolute; z-index: 5; top: 1.8vh; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: .8vh;
            pointer-events: none; }
#chars .sel-head h2 { font-size: clamp(11px, 1.7vw, 30px); letter-spacing: .14em; transform: skewX(-8deg); }
#chars .sel-head .sub { font-size: clamp(6px, .62vw, 10px); line-height: 1.7; max-width: 56vw; text-align: center; text-shadow: 2px 2px 0 #000; }
.sel-player { position: absolute; z-index: 5; top: calc(18px + 46px); left: 18px; display: flex; gap: 10px; align-items: center;
  padding: 8px 14px 8px 8px; background: linear-gradient(90deg, rgba(8,12,30,.9), rgba(8,12,30,.6)); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #2d3b66;
  clip-path: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%); min-width: 180px; text-shadow: 2px 2px 0 #000; }
.sp-av { --f1: #2d3b66; --f2: #121a33; width: clamp(40px, 5.2vh, 60px); height: clamp(40px, 5.2vh, 60px); flex: none; box-sizing: border-box; border: 3px solid var(--f1);
  box-shadow: 0 0 0 2px var(--f2), 0 0 0 4px #000; background: #0a0f20; overflow: hidden; }
.sp-av img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; display: block; }
/* marcos animados: solo cambia el color del borde (sin box-shadow ni filter animados) */
.sp-av.pulse { animation: sp-pulse 1.2s steps(2) infinite; }
.sp-av.rainbow { animation: sp-rainbow 3s steps(6) infinite; }
@keyframes sp-pulse { 50% { border-color: #fff; } }
@keyframes sp-rainbow { 0% { border-color: #ff5a5a; } 17% { border-color: #ffb547; } 33% { border-color: #ffe24a; } 50% { border-color: #5fe08a; }
                        67% { border-color: #5fd0ff; } 83% { border-color: #b77bff; } 100% { border-color: #ff5a5a; } }
.sp-txt { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sp-txt b { font-weight: normal; font-size: clamp(9px, 1.1vh, 14px); letter-spacing: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 18vw; }
.sp-lv { display: flex; align-items: center; gap: 6px; font-size: clamp(7px, .9vh, 11px); color: #9fb3e6; }
.sp-lv .bar { width: 60px; height: 5px; background: #1a2040; border: 1px solid #000; display: block; }
.sp-lv .bar u { display: block; height: 100%; background: #ffd84a; }
.sp-coins { font-size: clamp(8px, 1vh, 13px); color: #ffd84a; display: flex; align-items: center; gap: 5px; }
.sp-coins .coin { width: 8px; height: 8px; background: #ffd84a; box-shadow: 0 0 0 1px #000, inset -2px -2px 0 #b38f00; display: inline-block; }

/* ---- nombre enorme de cada jugador, en cursiva, con su lema, categoría, peso, skin y (si toca) cómo conseguirlo */
.sel-band { display: flex; justify-content: space-between; align-items: flex-end; width: 100%; box-sizing: border-box; padding: 0 2.4vw;
            margin-bottom: 1.4vh; pointer-events: none; gap: 2vw; }
.sel-info { --c: #fff; display: flex; flex-direction: column; gap: .8vh; min-width: 0; max-width: 47vw; opacity: 0; transition: opacity .2s; }
.sel-info.on { opacity: 1; }
.sel-info.p2 { align-items: flex-end; text-align: right; }
.sel-info .chip { align-self: flex-start; font-size: clamp(7px, .72vw, 12px); padding: .5em .9em; color: #111; letter-spacing: 2px; transform: skewX(-12deg);
  box-shadow: 3px 3px 0 #000; }
.sel-info.p2 .chip { align-self: flex-end; }
.sel-info .chip:empty { display: none; }
.sel-info .bigname { font-size: calc(min(5.4vw, 9vh) * var(--k, 1)); line-height: 1.05; white-space: nowrap; letter-spacing: -.02em;
  color: #fff; transform: skewX(-12deg); transform-origin: left bottom;
  text-shadow: .06em .06em 0 var(--c), .12em .12em 0 #000, -.03em -.03em 0 #000, .03em -.03em 0 #000, -.03em .03em 0 #000, 0 0 .5em color-mix(in srgb, var(--c) 60%, transparent); }
.sel-info.p2 .bigname { transform-origin: right bottom; }
.sel-info .ttl { font-size: clamp(7px, .72vw, 12px); letter-spacing: 3px; color: color-mix(in srgb, var(--c) 45%, #fff); text-shadow: 2px 2px 0 #000;
  transform: skewX(-12deg); margin-top: .2vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.sel-info .ttl:empty { display: none; }
.sel-info .meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: clamp(7px, .78vw, 13px); letter-spacing: 2px; color: #dfe7ff; text-shadow: 2px 2px 0 #000; }
.sel-info.p2 .meta { justify-content: flex-end; }
.sel-info .meta b { font-weight: normal; padding: .35em .6em; color: #111; background: var(--cc, #fff); text-shadow: none; box-shadow: 2px 2px 0 #000; }
.sel-info .meta span { padding: .35em .6em; background: rgba(0,0,0,.55); box-shadow: inset 0 -2px 0 #3b4c86; }
.sel-info.ready .bigname { opacity: .75; }
.sel-info.enter.p1 .bigname { animation: sel-name-in-l .38s cubic-bezier(.2,.9,.3,1.1); }
.sel-info.enter.p2 .bigname { animation: sel-name-in-r .38s cubic-bezier(.2,.9,.3,1.1); }
.sel-info.flash .bigname { animation: sel-name-flash .6s ease-out; }
@keyframes sel-name-in-l { from { transform: translateX(-40vw) skewX(-12deg); opacity: 0; } }
@keyframes sel-name-in-r { from { transform: translateX(40vw) skewX(-12deg); opacity: 0; } }
@keyframes sel-name-flash { 0% { opacity: .2; transform: scale(1.08) skewX(-12deg); } 100% { opacity: 1; } }

/* ---- barra de bloqueo: bajo el nombre del jugador que está eligiendo (menus.js la mueve a su lado) */
.sel-lockbar { display: none; align-items: center; flex-wrap: wrap; gap: 8px 12px; box-sizing: border-box; pointer-events: auto;
  padding: .7em 1em; max-width: min(40vw, 680px); font-size: clamp(7px, .7vw, 12px); line-height: 1.6; letter-spacing: 1px; color: #f4ecd8; text-shadow: 2px 2px 0 #000;
  background: rgba(14,10,0,.88); box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #b38f00, 0 4px 0 rgba(0,0,0,.4); text-align: left; }
.sel-info.p2 .sel-lockbar { justify-content: flex-end; text-align: right; }
.sel-lockbar.on { display: flex; animation: sel-pop .18s ease-out; }
.sel-lockbar .lk { color: #1a1a1a; background: #ffd84a; padding: .35em .6em; text-shadow: none; white-space: nowrap; }
.sel-lockbar .tx { flex: 1 1 14em; }
.sel-lockbar .warn { color: #ff9a8a; white-space: nowrap; }
.sel-lockbar .buy { font: inherit; font-size: 1em; letter-spacing: 2px; padding: .6em 1em; color: #1a1a1a; background: #ffd84a; border: 0; cursor: pointer;
  box-shadow: 0 3px 0 #b38f00, 0 0 0 2px #000; white-space: nowrap; }
.sel-lockbar .buy:hover, .sel-lockbar .buy:focus-visible { background: #fff07a; outline: none; transform: translateY(-1px); }
.sel-lockbar .buy .k { font-size: 1.2em; }
@keyframes sel-pop { from { transform: translateY(6px) scale(.96); opacity: 0; } }

/* ---- pila de abajo: panel con la rejilla de retratos y la ayuda de teclas */
.sel-dock { display: flex; flex-direction: column; align-items: center; gap: 1vh; width: 100%; box-sizing: border-box; }
.sel-dock .blink { font-size: clamp(7px, .66vw, 11px); text-shadow: 2px 2px 0 #000; }

#char-cards { --line: #2d3b66; position: relative; display: flex; flex-direction: column; align-items: center; flex-wrap: nowrap;
  gap: calc(var(--g) * 2); padding: calc(var(--g) * 2.5) calc(var(--g) * 3) calc(var(--g) * 3); }
/* escuadras de color en las esquinas del panel */
#char-cards::before { content: ''; position: absolute; inset: -5px; pointer-events: none; --q: #ffd84a;
  background:
    linear-gradient(var(--q), var(--q)) 0 0 / 14px 3px, linear-gradient(var(--q), var(--q)) 0 0 / 3px 14px,
    linear-gradient(var(--q), var(--q)) 100% 0 / 14px 3px, linear-gradient(var(--q), var(--q)) 100% 0 / 3px 14px,
    linear-gradient(var(--q), var(--q)) 0 100% / 14px 3px, linear-gradient(var(--q), var(--q)) 0 100% / 3px 14px,
    linear-gradient(var(--q), var(--q)) 100% 100% / 14px 3px, linear-gradient(var(--q), var(--q)) 100% 100% / 3px 14px;
  background-repeat: no-repeat; }
#chars.p2 #char-cards::before { --q: var(--p2); }
#char-cards .sel-line { display: flex; gap: var(--g); align-items: flex-end; justify-content: center; }
#char-cards .cat { --cc: #fff; display: flex; flex-direction: column; gap: var(--g); min-width: 0; }
#char-cards .cat-label { display: flex; align-items: stretch; height: var(--lh); font-size: var(--lf); line-height: var(--lh); letter-spacing: .2em;
  white-space: nowrap; overflow: hidden; }
#char-cards .cat-label span { padding: 0 .7em 0 .6em; color: var(--cc); background: color-mix(in srgb, var(--cc) 16%, rgba(0,0,0,.6));
  box-shadow: inset 3px 0 0 var(--cc); text-shadow: 1px 1px 0 #000; overflow: hidden; text-overflow: clip; }
#char-cards .cat-label::after { content: ''; flex: 1; align-self: flex-end; height: 2px; background: var(--cc); opacity: .45; min-width: 4px; }
#char-cards .cat.on .cat-label span { color: #111; background: var(--cc); text-shadow: none; }
#char-cards .cat.on .cat-label::after { opacity: 1; }
#char-cards .cat-grid { display: grid; grid-template-columns: repeat(var(--n, 1), var(--tile)); gap: var(--g); }

/* retrato: fondo teñido y borde inferior del color de su categoría; el cursor de J1 es dorado y el de J2 cian */
#char-cards .card { --cur: transparent; width: var(--tile); height: calc(var(--tile) * .667); box-sizing: border-box;
  background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 26%, #1d2a5a) 0%, #0b1026 100%);
  box-shadow: 0 0 0 1px #000, inset 0 -3px 0 var(--cc); transition: transform .08s; }
#char-cards .card img, #char-cards .card canvas { width: 100%; height: 100%; display: block; object-fit: cover; image-rendering: pixelated; background: none;
  opacity: .78; transition: opacity .12s; }
#char-cards .card:hover img, #char-cards .card:hover canvas { opacity: 1; }
#char-cards .card.active { z-index: 6; transform: scale(1.1); }
#char-cards .card.active img, #char-cards .card.active canvas { opacity: 1; }
#char-cards .card.cur1 { --cur: var(--p1); outline: 3px solid var(--cur); outline-offset: 0; z-index: 5; }
#char-cards .card.cur2 { --cur: var(--p2); outline: 3px solid var(--cur); outline-offset: 0; z-index: 5; }
#char-cards .card.both { outline: 3px solid var(--p1); box-shadow: 0 0 0 1px #000, inset 0 0 0 3px var(--p2); }
#char-cards .card.picked:not(.active) { transform: none; }
#char-cards .card .tg { position: absolute; left: -3px; top: -3px; z-index: 3; font-style: normal; font-size: clamp(6px, calc(var(--tile) * .11), 10px); line-height: 1;
  padding: .35em .5em; color: #111; background: var(--cur); pointer-events: none; white-space: nowrap; }
#char-cards .card .tg:empty { display: none; }
#char-cards .card.cur2 .tg { left: auto; right: -3px; }
#char-cards .card.cur1.cur2 .tg { left: -3px; right: auto; background: linear-gradient(90deg, var(--p1) 50%, var(--p2) 50%); }

/* bloqueado: silueta oscura con candado de píxeles */
#char-cards .card .lockic { display: none; position: absolute; left: 50%; top: 50%; width: calc(var(--tile) * .18); height: calc(var(--tile) * .216); transform: translate(-50%, -50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 12' shape-rendering='crispEdges'><path fill='%23ffd84a' d='M2 0h6v1H2zM2 1h1v4H2zM7 1h1v4H7zM3 1h4v1H3z'/><path fill='%23ffd84a' d='M0 5h10v7H0z'/><path fill='%23b38f00' d='M0 10h10v2H0z'/><path fill='%23111' d='M4 7h2v3H4z'/></svg>") center / contain no-repeat;
  image-rendering: pixelated; filter: drop-shadow(2px 2px 0 #000); pointer-events: none; }
#char-cards .card.is-locked .lockic { display: block; }
#char-cards .card.is-locked img { filter: brightness(0); opacity: .55; }
#char-cards .card.is-locked:hover img, #char-cards .card.is-locked.active img { opacity: .8; }
#char-cards .card.is-locked { background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 12%, #161b33) 0%, #080b17 100%); }
#char-cards .card.just { animation: sel-unlock 1.2s ease-out; }
@keyframes sel-unlock { 0% { filter: brightness(5); transform: scale(1.5); } 100% { filter: none; } }
#char-cards .card .crown { position: absolute; top: calc(var(--tile) * -.1); right: calc(var(--tile) * -.08); width: calc(var(--tile) * .3); image-rendering: pixelated;
  transform: rotate(16deg); filter: drop-shadow(2px 2px 0 #000); pointer-events: none; z-index: 2; }

/* escuadras pixel alrededor del retrato señalado (laten con transform, sin repintar) */
#char-cards .card::after, #stage-cards .card::after { content: ""; position: absolute; inset: -6px; pointer-events: none; z-index: 4; opacity: 0;
  --q: var(--cur, #ffd84a);
  background:
    linear-gradient(var(--q), var(--q)) 0 0 / 8px 2px, linear-gradient(var(--q), var(--q)) 0 0 / 2px 8px,
    linear-gradient(var(--q), var(--q)) 100% 0 / 8px 2px, linear-gradient(var(--q), var(--q)) 100% 0 / 2px 8px,
    linear-gradient(var(--q), var(--q)) 0 100% / 8px 2px, linear-gradient(var(--q), var(--q)) 0 100% / 2px 8px,
    linear-gradient(var(--q), var(--q)) 100% 100% / 8px 2px, linear-gradient(var(--q), var(--q)) 100% 100% / 2px 8px;
  background-repeat: no-repeat; }
#char-cards .card.active::after, #stage-cards .card.active::after { opacity: 1; animation: sel-brackets .8s steps(2) infinite; }
#stage-cards .card { --cur: #ffd84a; }
@keyframes sel-brackets { 50% { transform: scale(1.08); } }
#char-cards .card:focus-visible, #stage-cards .card:focus-visible { outline: 2px dashed #fff; outline-offset: 6px; }

/* ventanita de confirmación de compra */
.sel-modal { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(2,4,12,.72); }
.sel-modal.hidden { display: none; }
.sel-modal .box { max-width: 80vw; padding: 3vh 3vw; display: flex; flex-direction: column; align-items: center; gap: 3vh; text-align: center; line-height: 1.8;
  background: #10172f; box-shadow: 0 0 0 2px #000, inset 0 0 0 2px #3b4c86, inset 0 2px 0 2px rgba(255,255,255,.06), 0 8px 0 rgba(0,0,0,.4); animation: sel-pop .2s ease-out; }
.sel-modal .q { font-size: clamp(10px, 1.4vw, 22px); letter-spacing: 2px; color: #ffd84a; text-shadow: 3px 3px 0 #000; }
.sel-modal .row { display: flex; gap: 20px; }
.sel-modal button { font: inherit; font-size: clamp(9px, 1vw, 16px); letter-spacing: 2px; padding: 1.1em 1.8em; cursor: pointer; border: 0; color: #f4ecd8;
  background: #1d2850; box-shadow: inset 0 0 0 2px #3b4c86, 0 0 0 2px #000, 0 4px 0 #000; }
.sel-modal button:first-child { color: #1a1a1a; background: #ffd84a; box-shadow: 0 4px 0 #b38f00, 0 0 0 2px #000; }
.sel-modal button:hover, .sel-modal button:focus-visible { outline: none; filter: brightness(1.2); transform: translateY(-2px); }
.sel-modal button:focus-visible { outline: 2px dashed #fff; outline-offset: 4px; }
.sel-lockbar .buy:focus-visible { outline: 2px dashed #fff; outline-offset: 4px; }

/* ---------------------------------------------------------------- escenario */
#stages { --p1: #ffd84a; --p2: #5fd0ff; gap: 1.6vh; overflow: hidden; justify-content: center; padding: 2vh 0 1.6vh;
  background: radial-gradient(ellipse at 50% 40%, #243263 0%, #0f1530 60%, #05070f 100%); }
#stages > * { position: relative; z-index: 2; }
#stages > .st-bg { position: absolute; z-index: 0; inset: 0; overflow: hidden; }
#stages > .back-btn { position: absolute; z-index: 30; }
.st-bg canvas { width: 100%; height: 100%; display: block; filter: blur(8px) brightness(.4) saturate(1.3); transform: scale(1.15); image-rendering: auto; background: none; }
.st-bg::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 2px, transparent 2px 4px),
  radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,.7) 100%); }
#stages h2 { font-size: clamp(12px, 1.8vw, 30px); letter-spacing: .14em; transform: skewX(-8deg); }
.st-main { display: flex; flex-direction: column; align-items: center; gap: 1.2vh; }
.st-big { position: relative; width: min(60vw, 100vh * .72); aspect-ratio: 16 / 9; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--p1), 0 0 50px rgba(255,216,74,.35); background: #000; overflow: hidden; }
.st-big canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; background: none; }
.st-scan { position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 4px),
  linear-gradient(100deg, transparent 40%, rgba(255,255,255,.14) 50%, transparent 60%); background-size: auto, 300% 100%; animation: st-sweep 4.5s linear infinite; }
.st-name { --k: 1; font-size: calc(min(5.2vw, 8.6vh) * var(--k)); line-height: 1.05; white-space: nowrap; color: #fff; transform: skewX(-12deg); letter-spacing: -.02em;
  text-shadow: .06em .06em 0 var(--p1), .12em .12em 0 #000, -.03em -.03em 0 #000, .03em -.03em 0 #000, -.03em .03em 0 #000; }
.st-place { font-size: clamp(7px, .9vw, 15px); letter-spacing: 4px; color: #ffd84a; text-shadow: 2px 2px 0 #000; }
.st-main.enter .st-big { animation: st-zoom .35s cubic-bezier(.2,.9,.3,1.1); }
.st-main.enter .st-name { animation: sel-name-in-l .4s cubic-bezier(.2,.9,.3,1.1); }
@keyframes st-sweep { from { background-position: 0 0, 150% 0; } to { background-position: 0 0, -150% 0; } }
@keyframes st-zoom { from { transform: scale(.88); filter: brightness(3); } }
#stage-cards { display: flex; gap: clamp(8px, 1.2vw, 20px); justify-content: center; flex-wrap: wrap; padding: 0 16px; }
#stage-cards .card { width: min(11.6vw, 22vh * 16 / 9 * .8); aspect-ratio: 16 / 9; box-sizing: border-box; background: #000; box-shadow: 0 0 0 2px #000; transition: transform .1s, filter .15s; }
#stage-cards .card canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; background: none; filter: brightness(.6); }
#stage-cards .card.active { transform: scale(1.1); box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--p1), 0 0 24px rgba(255,216,74,.5); z-index: 3; }
#stage-cards .card.active canvas, #stage-cards .card:hover canvas { filter: none; }
#stage-cards .card .lockic, #stage-cards .card .tg { display: none; }
#stages .blink { text-shadow: 2px 2px 0 #000; }
/* los dos luchadores elegidos, a los lados de la vista del escenario */
.st-vs { position: absolute !important; z-index: 3; top: 50%; left: 0; right: 0; transform: translateY(-55%); display: flex; justify-content: space-between;
  padding: 0 2.4vw; pointer-events: none; }
.st-vs .side { --cur: #fff; display: flex; flex-direction: column; align-items: center; gap: .8vh; width: min(15vw, 24vh); }
.st-vs .side img, .st-vs .side .qq { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--cur), 0 0 24px var(--cur);
  background: linear-gradient(#34457f, #172046); image-rendering: pixelated; }
.st-vs .qq { display: flex; align-items: center; justify-content: center; font-size: 4vw; color: #ffd84a; text-shadow: 3px 3px 0 #000; }
.st-vs .chip { font-size: clamp(7px, .8vw, 12px); padding: .5em .9em; color: #111; background: var(--cur); transform: skewX(-12deg); }
.st-vs .side b { font-weight: normal; font-size: clamp(8px, 1vw, 16px); letter-spacing: 2px; color: #fff; text-shadow: 3px 3px 0 #000; transform: skewX(-12deg); }
.st-vs .side.p1 { animation: st-in-l .4s ease-out; }
.st-vs .side.p2 { animation: st-in-r .4s ease-out; }
@keyframes st-in-l { from { transform: translateX(-14vw); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes st-in-r { from { transform: translateX(14vw); opacity: 0; } to { transform: none; opacity: 1; } }


@media (max-width: 900px) {
  .sel-player { display: none; }
  .st-vs { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  #chars *, #stages * { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
/* ---- skin del luchador (skins.js): ◄ NOMBRE ► bajo el nombre enorme; con candado y precio si no es tuya */
.skin-pick { --rc: #9fb3e6; display: flex; align-items: center; gap: 8px; pointer-events: auto; font-size: clamp(7px, .8vw, 13px); letter-spacing: 1px;
  color: #dfe7ff; text-shadow: 2px 2px 0 #000; padding: .35em .6em; background: rgba(4,8,22,.72); box-shadow: 0 0 0 2px #000, inset 0 -2px 0 var(--rc);
  opacity: .7; transition: opacity .15s; }
.skin-pick[hidden] { display: none; }
.skin-pick.active { opacity: 1; }
.sel-info.p2 .skin-pick { align-self: flex-end; }
.sel-info.p1 .skin-pick { align-self: flex-start; }
.skin-pick .sk-lab { color: #9fb3e6; font-size: .8em; }
.skin-pick .sk-name { font-weight: normal; color: var(--rc); white-space: nowrap; }
.skin-pick .sk-n { font-style: normal; color: #8d99ad; font-size: .8em; }
.skin-pick .sk-arr { font: inherit; color: #fff; background: none; border: 0; padding: .2em .35em; cursor: pointer; display: flex; align-items: center; gap: 4px; min-height: 28px; }
.skin-pick .sk-arr:hover, .skin-pick .sk-arr:focus-visible { color: #ffd84a; outline: none; }
.skin-pick .sk-arr .k { font-size: .9em; }
.skin-pick .sk-lock { color: #1a1a1a; background: var(--rc); padding: .25em .5em; text-shadow: none; white-space: nowrap; }
.skin-pick.locked .sk-name::before { content: ""; display: inline-block; width: .8em; height: .7em; margin-right: .4em; vertical-align: -.05em;
  background: currentColor; box-shadow: inset 0 0 0 1px #000; clip-path: polygon(0 35%, 15% 35%, 15% 10%, 30% 0, 70% 0, 85% 10%, 85% 35%, 100% 35%, 100% 100%, 0 100%); }
@media (pointer: coarse) { .skin-pick .sk-arr { min-width: 36px; min-height: 36px; justify-content: center; } }

/* Calidad baja (html.lite): sin desenfoque en vivo del fondo del escenario (caro en móvil) */
html.lite .st-bg canvas { filter: brightness(.4) saturate(1.3); }
