/* Fiesta Cometa — marcador, mandos y pantallas. Claro, colorido y muy legible; botones sólidos (sin degradados). */
@font-face { font-family: 'Lilita One'; src: url('/games/_vendor/fonts/lilita-one-latin.woff2') format('woff2'); font-display: block; }
@font-face { font-family: 'Lilita One'; src: url('/games/_vendor/fonts/lilita-one-latin-ext.woff2') format('woff2'); unicode-range: U+0100-024F; font-display: block; }
@font-face { font-family: 'Inter'; src: url('/games/_vendor/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #16204a; --blue: #2f7cff; --orange: #ff8a1c; --yellow: #ffd23f; --pink: #ff4f92; --green: #1fb85a; --violet: #7a2cf5;
  --red: #f52238; --card: #fffdf7; --soft: #eef3ff; --mute: #6b7399;
  --st: max(8px, env(safe-area-inset-top)); --sb: max(12px, env(safe-area-inset-bottom));
  --sl: max(10px, env(safe-area-inset-left)); --sr: max(10px, env(safe-area-inset-right));
  --u: clamp(62px, 18.5vmin, 88px); --fw: 400;
}
/* Coreano: la letra del título no tiene sus signos; se usa la del equipo, en negrita */
:root:lang(ko) { --fw: 800; font-synthesis: none; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2f9cff; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
body { font-family: 'Inter', system-ui, sans-serif; color: var(--ink); }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; padding: 0; background: none; touch-action: manipulation; }
[hidden] { display: none !important; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }
svg { display: block; }

/* ---------------------------------------------------------------- Marcador */
.hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; opacity: 0; transition: opacity .3s; --ev: var(--blue); }
.hud.on { opacity: 1; }
.hud .top { position: absolute; top: var(--st); left: var(--sl); right: var(--sr); display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rb { pointer-events: auto; width: 42px; height: 42px; border-radius: 14px; background: var(--card); color: var(--ink); display: grid; place-items: center; box-shadow: 0 4px 0 rgba(22, 32, 74, .22), 0 8px 18px rgba(12, 30, 80, .22); flex: none; transition: transform .12s; }
.rb svg { width: 22px; height: 22px; }
.rb:active { transform: translateY(2px); }

.hud:not(.on) .rb, .hud:not(.on) .ab, .hud:not(.on) .zone, .hud:not(.on) .look { pointer-events: none; }
.plate { width: min(340px, 62vw); background: var(--ink); color: #fff; border-radius: 18px; padding: 6px 10px 7px 6px; box-shadow: 0 8px 22px rgba(10, 22, 66, .38); container-type: inline-size; }
.pl1 { display: flex; align-items: center; gap: 10px; }
.ei { width: 34px; height: 34px; flex: none; border-radius: 11px; background: var(--ev); display: grid; place-items: center; } .ei svg { width: 22px; height: 22px; }
.clock { font: var(--fw) 25px/1 'Lilita One', sans-serif; font-variant-numeric: tabular-nums; min-width: 58px; }
.hud.hot .clock { color: var(--yellow); animation: beat .5s ease-in-out infinite alternate; transform-origin: 0 50%; }
.pos { margin-left: auto; font: var(--fw) 19px/1.1 'Lilita One', sans-serif; white-space: nowrap; }
@keyframes beat { to { transform: scale(1.07); } }
.track { position: relative; height: 14px; margin: 7px 14px 1px 6px; border-radius: 7px; background: rgba(255, 255, 255, .16); display: none; }
.track::after { content: ''; position: absolute; right: -7px; top: -3px; width: 9px; height: 20px; border-radius: 3px; background: repeating-conic-gradient(#fff 0 25%, #16204a 0 50%) 0 0 / 9px 9px; }
[data-ev="0"] .track { display: block; container-type: inline-size; }
.track i { position: absolute; left: -6px; top: 1px; width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--ink); will-change: transform; }
.track i.me { width: 18px; height: 18px; left: -9px; top: -2px; box-shadow: 0 0 0 3px #fff; z-index: 2; } .track i.off { opacity: .35; }
.rank { display: none; grid-template-columns: repeat(3, 1fr); gap: 5px; margin: 7px 0 0 2px; } [data-ev="2"] .rank { display: grid; }
.rank div { display: flex; align-items: center; gap: 5px; min-width: 0; background: rgba(255, 255, 255, .13); border-radius: 9px; padding: 3px 6px; font-size: 12px; font-weight: 800; } .rank div.me { background: var(--yellow); color: var(--ink); }
.rank i { width: 9px; height: 9px; border-radius: 50%; flex: none; } .rank span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; } .rank b { font: var(--fw) 14px/1 'Lilita One', sans-serif; }
.watch { position: absolute; left: 50%; bottom: calc(var(--sb) + 10px); transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 14px; padding: 9px 16px; font: var(--fw) 18px/1 'Lilita One', sans-serif; box-shadow: 0 8px 20px rgba(10, 22, 66, .35); white-space: nowrap; }
.look { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
.net { position: absolute; top: calc(var(--st) + 50px); left: var(--sl); font-size: 11px; font-weight: 800; color: #fff; background: rgba(16, 28, 76, .7); border-radius: 9px; padding: 3px 8px; }
.net.slow { background: #c56a00; } .net.bad { background: var(--red); animation: beat .5s infinite alternate; }

/* Mensajes */
.pops { position: absolute; left: 0; right: 0; top: 20%; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pop { font: var(--fw) clamp(26px, 6.2vmin, 52px)/1 'Lilita One', sans-serif; color: #fff; text-align: center; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; filter: drop-shadow(0 4px 0 rgba(22, 32, 74, .35)); animation: popIn 1.15s cubic-bezier(.2, 1.4, .4, 1) forwards; white-space: nowrap; }
.pop.gold { color: var(--yellow); } .pop.cyan { color: #5fe8ff; } .pop.pink { color: #ff8fc0; } .pop.mint { color: #7dffb0; } .pop.red { color: #ff8a7a; } .pop.orange { color: #ffb04a; }
.pop.small { font-size: clamp(19px, 4.2vmin, 32px); -webkit-text-stroke-width: 5px; }
@keyframes popIn { 0% { transform: scale(.3) translateY(22px); opacity: 0; } 15% { transform: scale(1.16); opacity: 1; } 26% { transform: scale(1); } 80% { opacity: 1; transform: translateY(-8px); } 100% { opacity: 0; transform: translateY(-30px) scale(.96); } }
.toasts { position: absolute; left: calc(var(--sl) + 12px); top: calc(var(--st) + 72px); display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.toast { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 14px; padding: 7px 13px; font-size: 13px; font-weight: 800; box-shadow: 0 6px 16px rgba(12, 30, 80, .25); animation: rise .35s cubic-bezier(.2, 1.4, .4, 1); transition: opacity .4s, transform .4s; white-space: nowrap; }
.toast i { width: 11px; height: 11px; border-radius: 50%; flex: none; } .toast.out { opacity: 0; transform: translateY(12px); }
.pop.long { animation-duration: 2.2s; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }

/* Destellos, viñeta, líneas de velocidad */
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; }
.flash.gold { background: #ffe27a; }
.vignette { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; box-shadow: inset 0 0 110px 14px rgba(245, 34, 56, .55); }
.hud.hot .vignette { opacity: 1; }
.speed { position: absolute; inset: -12%; opacity: 0; transition: opacity .2s; background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0) 0deg 4deg, rgba(255, 244, 200, .8) 4.4deg 4.9deg, rgba(255, 255, 255, 0) 5.3deg 9deg); -webkit-mask: radial-gradient(ellipse at 50% 50%, transparent 42%, #000 78%); mask: radial-gradient(ellipse at 50% 50%, transparent 42%, #000 78%); }
.speed.on { opacity: .75; animation: spin .5s linear infinite; }
@keyframes spin { to { transform: rotate(9deg); } }

/* Nombres sobre los corredores */
.tags { position: absolute; inset: 0; overflow: hidden; }
.tagp { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; visibility: hidden; }
.tagp span { position: absolute; left: 0; bottom: 4px; transform: translateX(-50%); font-size: 12px; font-weight: 800; color: #fff; background: rgba(16, 28, 76, .62); border-radius: 8px; padding: 2px 7px 3px; white-space: nowrap; }
.tagp.person span { background: var(--c); box-shadow: 0 2px 0 rgba(10, 22, 66, .35); }
.tagp.mine span { background: #fff; color: var(--ink); font: var(--fw) 15px/1 'Lilita One', sans-serif; padding: 4px 9px 5px; bottom: 15px; box-shadow: 0 3px 0 rgba(10, 22, 66, .3); }
.tagp em { position: absolute; left: -12px; bottom: 0; width: 24px; height: 14px; background: var(--c); clip-path: polygon(0 0, 100% 0, 50% 100%); animation: bob .55s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(5px); } }

/* Mandos táctiles */
.zone { position: absolute; left: 0; top: 18%; bottom: 0; width: 50%; pointer-events: auto; touch-action: none; display: none; }
.stick { position: absolute; left: 0; top: 0; width: calc(var(--u) * 1.5); height: calc(var(--u) * 1.5); border-radius: 50%; background: rgba(255, 255, 255, .22); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .6); opacity: 0; transition: opacity .12s; display: none; }
.stick.on { opacity: 1; }
.stick i { position: absolute; left: 50%; top: 50%; width: 46%; height: 46%; border-radius: 50%; background: #fff; box-shadow: 0 6px 14px rgba(10, 22, 66, .35); transform: translate(-50%, -50%); }
.pad { position: absolute; right: var(--sr); bottom: var(--sb); width: calc(var(--u) * 2.5); height: calc(var(--u) * 2.5); display: none; }
.touch .zone, .touch .stick, .touch .pad { display: block; }
.ab { pointer-events: auto; position: absolute; width: var(--u); height: var(--u); border-radius: 50%; color: #fff; background: var(--bg, var(--blue)); box-shadow: 0 6px 0 rgba(10, 22, 66, .32), 0 12px 24px rgba(10, 22, 66, .28), inset 0 0 0 4px rgba(255, 255, 255, .85); touch-action: none; transition: transform .06s; }
.ab::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; }
.ab span { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.ab svg { width: 42%; height: auto; } .ab b { font: var(--fw) 13px/1 'Lilita One', sans-serif; letter-spacing: .03em; }
.ab.down { transform: translateY(4px) scale(.96); }
.touch .zone { z-index: 1; width: 46%; } .touch .pad { width: calc(var(--u) * 2.7); height: calc(var(--u) * 2.4); z-index: 2; }
.ab.jump { --bg: var(--orange); right: 0; bottom: 0; width: calc(var(--u) * 1.38); height: calc(var(--u) * 1.38); } .ab.jump b { font-size: 15px; }
.ab.dash { --bg: var(--blue); right: calc(var(--u) * 1.5); bottom: 4px; width: calc(var(--u) * 1.1); height: calc(var(--u) * 1.1); } .ab.dash b { font-size: 11.5px; }
.ab.cheer { --bg: var(--violet); right: calc(var(--u) * .5); bottom: calc(var(--u) * 1.56); width: calc(var(--u) * .72); height: calc(var(--u) * .72); } .ab.cheer svg { width: 52%; }
.ab .cd { position: absolute; inset: 0; border-radius: 50%; opacity: 0; background: conic-gradient(rgba(10, 22, 66, .62) var(--k, 0deg), transparent 0); } .ab.wait .cd { opacity: 1; }
.hud.scene .pad, .hud.scene .stick, .hud.scene .tags, .hud.scene .watch, .hud.scene .plate { opacity: 0; } .hud.scene .ab, .hud.scene .zone { pointer-events: none; }
.pad, .plate, .tags { transition: opacity .25s; }

/* Controles: barra de teclas (computadora), botón y ayudas (celular) y tarjeta */
.rcol { display: grid; gap: 8px; } .rb.ctl { display: none; } .touch .rb.ctl { display: grid; } .rb.ctl svg { width: 25px; height: 25px; }
kbd { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 7px; background: #fff; color: var(--ink); font: 800 12px/1 'Inter', sans-serif; box-shadow: 0 2.500px 0 #aeb9dd; }
kbd.w { padding: 0 9px; } kbd.pb { border-radius: 50%; padding: 0; width: 25px; min-width: 25px; height: 25px; background: var(--c); color: #fff; box-shadow: 0 2.500px 0 rgba(10, 22, 66, .35); }
.cbar .mi text { fill: var(--ink); }
.mi { display: inline-grid; place-items: center; width: 26px; height: 26px; } .mi svg { width: 25px; height: 25px; }
.cbar, .ctab { position: absolute; left: 50%; bottom: calc(var(--sb) - 2px); transform: translate(-50%, 70px); opacity: 0; transition: transform .35s cubic-bezier(.3, 1.2, .4, 1), opacity .25s; color: #fff; background: rgba(16, 26, 74, .66); border-radius: 16px; pointer-events: none; }
.cbar { display: flex; align-items: center; gap: 15px; padding: 7px 8px 8px 13px; white-space: nowrap; font-size: 12.5px; }
.cbar span, .cbar button { display: flex; align-items: center; gap: 4px; } .cbar b { margin-left: 3px; font-weight: 700; }
.cbar button { padding: 4px 7px; border-radius: 10px; background: rgba(255, 255, 255, .13); pointer-events: none; } .cbar button kbd { height: 19px; min-width: 19px; font-size: 10.5px; }
.ctab { display: flex; align-items: center; gap: 6px; padding: 6px 9px; } .ctab svg { width: 22px; height: 22px; } .ctab kbd { height: 20px; min-width: 20px; font-size: 11px; }
.cbar.on, .ctab.on { transform: translate(-50%, 0); opacity: 1; } .cbar.on button, .ctab.on { pointer-events: auto; } .cbar button:hover, .ctab:hover { background: rgba(47, 124, 255, .9); }
.hud.scene .cbar, .hud.scene .ctab { transform: translate(-50%, 70px); opacity: 0; } .cbar.on ~ .watch, .watch:has(~ .cbar.on) { bottom: calc(var(--sb) + 58px); }
@media (max-width: 760px) { .cbar { gap: 9px; font-size: 11px; padding-left: 9px; } .cbar kbd { min-width: 20px; height: 21px; font-size: 10.500px; } .cbar kbd.w { padding: 0 6px; } }
@media (max-width: 600px), (max-height: 330px) { .cbar b { display: none; } }
.coach { position: absolute; inset: 0; opacity: 0; transition: opacity .35s; pointer-events: none; z-index: 1; } .coach.on { opacity: 1; }
.cz { position: absolute; display: grid; justify-items: center; gap: 8px; color: #fff; } .cz b { font: var(--fw) 17px/1.1 'Lilita One', sans-serif; background: var(--ink); padding: 7px 12px; border-radius: 12px; text-align: center; max-width: 40vw; }
.cz.l { left: calc(var(--sl) + 22px); bottom: calc(var(--sb) + 26px); } .cz.r { right: calc(var(--sr) + 12px); top: 41%; }
.cz .cs { position: relative; width: calc(var(--u) * 1.35); height: calc(var(--u) * 1.35); border-radius: 50%; background: rgba(16, 26, 74, .38); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .85); } .cs u { position: absolute; left: 50%; top: 50%; width: 44%; height: 44%; margin: -22% 0 0 -22%; border-radius: 50%; background: #fff; animation: coach 2.600s ease-in-out infinite; }
.cz.r i { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: rgba(16, 26, 74, .5); animation: coachX 2.200s ease-in-out infinite; } .cz.r svg { width: 46px; height: 46px; }
@keyframes coach { 0%, 100% { transform: none; } 25% { transform: translate(0, -52%); } 50% { transform: translate(46%, -12%); } 75% { transform: translate(-46%, 12%); } }
@keyframes coachX { 0%, 100% { transform: translateX(-13px); } 50% { transform: translateX(13px); } }
.crows { display: grid; gap: 11px; } .crows.t { grid-template-columns: 1fr 1fr; gap: 12px 14px; } .cr { display: flex; align-items: center; gap: 11px; } .cr b { font: var(--fw) 17px/1.1 'Lilita One', sans-serif; } .cr p { margin: 2px 0 0; font-size: 12.5px; line-height: 1.3; color: var(--mute); } .cr .ic { width: 42px; height: 42px; border-radius: 13px; color: #fff; display: grid; place-items: center; flex: none; } .cr .ic svg { width: 26px; height: 26px; }
.ck { display: grid; grid-template-columns: auto 1fr auto; gap: 9px 16px; align-items: center; } .ck small { font-size: 11.5px; font-weight: 800; color: var(--mute); text-transform: uppercase; letter-spacing: .05em; } .ck > b { font: var(--fw) 17px/1.1 'Lilita One', sans-serif; } .ck > span { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; } .ck u { text-decoration: none; font-size: 12px; color: var(--mute); margin: 0 4px; } .ck kbd { background: #f4f6ff; } .ck kbd.pb { background: var(--c); } .ck .mi { color: var(--ink); }

/* Cuenta atrás */
.count { position: absolute; left: 50%; top: 42%; font: var(--fw) min(34vmin, 260px)/1 'Lilita One', sans-serif; color: #fff; -webkit-text-stroke: 16px var(--ink); paint-order: stroke fill; transform: translate(-50%, -50%); opacity: 0; white-space: nowrap; }
.count.word { font-size: min(17vmin, 130px); color: var(--yellow); }

/* Cortinilla del cometa */
.wipe { position: fixed; inset: 0; z-index: 12; pointer-events: none; overflow: hidden; visibility: hidden; }
.wipe i { position: absolute; top: -10%; bottom: -10%; left: -60%; width: 52%; transform: skewX(-18deg); }
.wipe i:nth-child(1) { background: var(--c2); } .wipe i:nth-child(2) { background: var(--c); width: 130%; left: -140%; } .wipe i:nth-child(3) { background: #fff; width: 14%; }

/* Presentación de cada prueba */
.intro { position: fixed; left: 0; right: 0; bottom: calc(var(--sb) + 5vh); z-index: 6; pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 0 16px; opacity: 0; transform: translateY(40px); transition: opacity .35s, transform .5s cubic-bezier(.2, 1.4, .4, 1); --ev: var(--blue); }
.intro.on { opacity: 1; transform: none; }
.intro .ic2 { width: clamp(74px, 15vmin, 118px); aspect-ratio: 1; flex: none; border-radius: 28%; background: var(--ev); color: #fff; display: grid; place-items: center; box-shadow: 0 7px 0 rgba(10, 22, 66, .35), inset 0 0 0 5px #fff; transform: rotate(-5deg); } .intro .ic2 svg { width: 62%; }
.intro .tx { background: var(--card); border-radius: 22px; padding: 12px 20px 14px; max-width: min(560px, 74vw); box-shadow: 0 8px 0 rgba(22, 32, 74, .24), 0 20px 40px rgba(10, 22, 66, .35); }
.intro small { font-size: 13px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ev); }
.intro h1 { margin: 1px 0 4px; font: var(--fw) clamp(27px, 6vmin, 46px)/1 'Lilita One', sans-serif; } .intro p { margin: 0; font-size: clamp(14px, 2.3vmin, 17px); font-weight: 700; line-height: 1.35; color: #414b70; }
.intro.final .tx { background: var(--yellow); } .intro.final small { color: var(--ink); } .intro.final p { color: var(--ink); }

/* Tabla de estrellas entre pruebas */
.table { position: fixed; inset: 0; z-index: 7; pointer-events: none; display: grid; place-items: center; padding: calc(var(--st) + 4px) 14px calc(var(--sb) + 4px); opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; background: rgba(10, 18, 60, .42); }
.table.on { opacity: 1; visibility: visible; transition: opacity .3s; }
.tb { width: min(560px, 100%); height: min(600px, 100%); display: flex; flex-direction: column; background: var(--card); border-radius: 26px; padding: 14px 16px; box-shadow: 0 8px 0 rgba(22, 32, 74, .24), 0 24px 60px rgba(10, 22, 66, .42); }
.table.on .tb { animation: cardIn .35s cubic-bezier(.2, 1.3, .4, 1); }
.tb h2 { margin: 0 0 8px; text-align: center; font: var(--fw) clamp(22px, 4.6vmin, 30px)/1.1 'Lilita One', sans-serif; } .tb p { margin: 8px 0 0; text-align: center; font-size: 14px; font-weight: 800; color: var(--mute); } .tb p:empty { display: none; }
.tb ol { position: relative; flex: 1; list-style: none; margin: 0; padding: 0; }
.tb li { position: absolute; left: 0; right: 0; padding: 2.5px 0; transition: top .7s cubic-bezier(.4, 0, .2, 1); display: flex; align-items: center; gap: 9px; animation: rowIn .4s calc(var(--n) * 70ms) cubic-bezier(.2, 1.2, .4, 1) both; }
.tb li::before { content: ''; position: absolute; inset: 2.5px 0; border-radius: 14px; background: var(--soft); border-left: 7px solid var(--c); z-index: -1; } .tb ol { z-index: 0; } .tb li.me::before { background: #fff0b8; }
@keyframes rowIn { from { transform: translateX(-40px); opacity: 0; } }
.rk { font: var(--fw) 18px/1 'Lilita One', sans-serif; min-width: 34px; text-align: right; margin-left: 10px; }
.tb li img, .podium img, .seats img { width: 38px; height: 38px; max-height: 92%; aspect-ratio: 1; border-radius: 50%; background: var(--c); flex: none; object-fit: cover; }
.tb li span { flex: 1; font-size: 15px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb li em { font: var(--fw) 18px/1 'Lilita One', sans-serif; color: #e06c00; transition: opacity .4s, transform .5s; } .tb li.sum em { opacity: 0; transform: translateX(34px); }
.tb li strong, .podium strong { display: flex; align-items: center; gap: 4px; font: var(--fw) 20px/1 'Lilita One', sans-serif; min-width: 58px; margin-right: 10px; } .tb u, .podium u { text-decoration: none; } .tb strong i, .podium strong svg { width: 19px; height: 19px; color: #ffb400; } .tb strong i svg { width: 100%; }
.tb li.sum strong { animation: sumUp .5s .25s cubic-bezier(.2, 1.8, .4, 1); }
@keyframes sumUp { 40% { transform: scale(1.35); } }

/* ---------------------------------------------------------------- Pantallas */
.screens { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.screen { position: absolute; inset: 0; display: none; padding: var(--st) var(--sr) var(--sb) var(--sl); }
.screen.on { display: flex; }
.screen.on > * { pointer-events: auto; }
.mb { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; border-radius: 18px; padding: 8px 16px 8px 10px; color: #fff; background: var(--bg, var(--blue)); text-align: left; box-shadow: 0 6px 0 var(--ed, #1a55c4), 0 12px 24px rgba(10, 22, 66, .24); transition: transform .1s, box-shadow .1s, filter .15s; }
.mb:hover { filter: brightness(1.06); } .mb:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ed, #1a55c4), 0 6px 14px rgba(10, 22, 66, .24); }
.mb:focus-visible, .rb:focus-visible, .chip:focus-visible, .seg button:focus-visible, .modes button:focus-visible, .crests button:focus-visible, .tog button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; }
.mb[disabled] { filter: grayscale(.8) brightness(.95); opacity: .7; cursor: default; }
.mb .ic { width: 40px; height: 40px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, .22); display: grid; place-items: center; } .mb .ic svg { width: 25px; height: 25px; }
.mb b { display: block; font: var(--fw) 20px/1.1 'Lilita One', sans-serif; letter-spacing: .01em; } .mb small { display: block; font-size: 12.5px; font-weight: 700; opacity: .92; line-height: 1.25; }
.mb.big { min-height: 68px; } .mb.big b { font-size: 25px; } .mb.center { justify-content: center; } .mb.center span { flex: none; }
.mb.orange { --bg: var(--orange); --ed: #c45f00; } .mb.blue { --bg: var(--blue); --ed: #1a55c4; } .mb.violet { --bg: var(--violet); --ed: #5414bd; } .mb.green { --bg: var(--green); --ed: #0f8a3e; } .mb.gray { --bg: #5b678f; --ed: #414b70; }
.chip { display: inline-flex; align-items: center; gap: 7px; background: var(--card); color: var(--ink); border-radius: 13px; padding: 8px 12px; font-size: 13px; font-weight: 800; box-shadow: 0 4px 0 rgba(22, 32, 74, .2); } .chip svg { width: 18px; height: 18px; }
.chip.streak { background: var(--yellow); }

/* Portada */
.title { justify-content: space-between; align-items: stretch; }
.title .col { width: min(40vw, 420px); display: flex; flex-direction: column; justify-content: center; gap: 12px; margin-left: clamp(4px, 3vw, 48px); }
.title .logo { width: 100%; max-height: 40vh; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(10, 22, 66, .35)); animation: float 3s ease-in-out infinite; }
.tagline { margin: -6px 0 2px; text-align: center; font: var(--fw) clamp(16px, 2.6vmin, 22px)/1.15 'Lilita One', sans-serif; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; }
.menu { display: flex; flex-direction: column; gap: 13px; } .row.low { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.kit { align-self: flex-end; margin: 0 clamp(8px, 8vw, 150px) 10px 0; background: var(--card); border-radius: 20px; padding: 8px 12px 10px; text-align: center; box-shadow: 0 6px 0 rgba(22, 32, 74, .2), 0 14px 28px rgba(10, 22, 66, .26); }
.kit small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); }
.pick { display: flex; align-items: center; gap: 10px; } .pick .cr { width: 42px; height: 42px; } .pick .cr svg { width: 100%; height: 100%; } .pick b { font: var(--fw) 22px/1 'Lilita One', sans-serif; min-width: 106px; text-align: left; }
.pick .rb { background: var(--soft); box-shadow: none; }
@keyframes float { 50% { transform: translateY(-7px) rotate(-.6deg); } }

/* Tarjetas */
.panel { align-items: center; justify-content: center; }
.card { background: var(--card); border-radius: 26px; padding: 16px; width: min(560px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; touch-action: pan-y; display: flex; flex-direction: column; gap: 13px; box-shadow: 0 8px 0 rgba(22, 32, 74, .24), 0 24px 60px rgba(10, 22, 66, .42); animation: cardIn .35s cubic-bezier(.2, 1.3, .4, 1); scrollbar-width: none; }
.card.small { width: min(400px, 100%); } .card.center { align-items: center; text-align: center; }
@keyframes cardIn { from { transform: translateY(26px) scale(.95); opacity: 0; } }
.card header { display: flex; align-items: center; gap: 12px; } .card header .rb { background: var(--soft); box-shadow: none; }
.card h2 { margin: 0; font: var(--fw) 25px/1.1 'Lilita One', sans-serif; } .card p { margin: 0; font-size: 14px; line-height: 1.45; color: #414b70; }
.card label, .joinbox label { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--mute); display: block; margin-bottom: 6px; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; background: var(--soft); border-radius: 16px; padding: 5px; } .seg.four { grid-template-columns: repeat(4, 1fr); }
.seg button { border-radius: 12px; padding: 11px 4px; font-size: 14px; font-weight: 800; color: #4a5580; } .seg button.sel { background: var(--blue); color: #fff; box-shadow: 0 3px 0 #1a55c4; }
.crests { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; } .crests button { border-radius: 15px; padding: 8px 2px 6px; background: var(--soft); display: flex; flex-direction: column; align-items: center; gap: 3px; } .crests svg { width: 38px; height: 38px; } .crests small { font-size: 10.5px; font-weight: 800; color: #4a5580; }
.crests button.sel { background: var(--yellow); box-shadow: 0 3px 0 #c99a00; } .crests button.sel small { color: var(--ink); }
.keys { font-size: 12.5px !important; font-weight: 600; background: var(--soft); border-radius: 13px; padding: 9px 12px; } .keys:empty { display: none; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; align-items: stretch; }
.two .up { grid-column: 1 / -1; justify-content: center; } .two .up span { flex: none; }
.hint { text-align: center; font-weight: 700; } .hint:empty { display: none; }
.err { background: #ffe3e0; color: #a81426 !important; border-radius: 12px; padding: 9px 12px; font-weight: 700; text-align: center; }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; } .modes button { background: var(--soft); border-radius: 18px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; } .modes b { font: var(--fw) clamp(16px, 4.6vw, 20px)/1 'Lilita One', sans-serif; white-space: nowrap; } .modes small { font-size: 11.5px; font-weight: 700; color: var(--mute); line-height: 1.2; }
.modes button.sel { background: var(--blue); color: #fff; box-shadow: 0 4px 0 #1a55c4; } .modes button.sel small { color: #dfeaff; }
.dots { display: flex; align-items: center; gap: 3px; height: 16px; } .dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--blue); } .dots i.r { background: var(--red); } .dots u { width: 3px; height: 15px; border-radius: 2px; background: currentColor; opacity: .45; margin: 0 2px; } .modes .sel .dots i { background: #fff; } .modes .sel .dots i.r { background: var(--yellow); }
.name[hidden] { display: none; } .name:not([hidden]) { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 10px; margin: 0 !important; } .name input, .joinbox input { width: 100%; border: 0; border-radius: 13px; background: var(--soft); padding: 11px 13px; font-size: 16px; font-weight: 800; user-select: text; -webkit-user-select: text; outline: none; min-width: 0; } .name input:focus, .joinbox input:focus { box-shadow: 0 0 0 3px var(--blue); }
.joinbox { background: var(--soft); border-radius: 18px; padding: 9px 10px 10px; } .joinbox > div { display: grid; grid-template-columns: 1fr auto; gap: 7px; } .joinbox input { background: #fff; text-transform: uppercase; letter-spacing: .12em; padding: 9px 10px; } .joinbox .mb { min-height: 42px; width: auto; padding: 6px 13px; border-radius: 13px; box-shadow: 0 4px 0 var(--ed); } .joinbox .mb b { font-size: 16px; } .joinbox .mb svg { width: 24px; height: 24px; }

.spinner { position: relative; width: 108px; height: 108px; flex: none; }
.spinner i { position: absolute; inset: 0; color: var(--orange); animation: orbit 1.35s linear infinite; }
.spinner i::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: conic-gradient(rgba(255, 138, 26, 0) 8%, rgba(255, 138, 26, .28) 42%, var(--orange) 84%, var(--yellow)); -webkit-mask: radial-gradient(closest-side, transparent calc(100% - 10px), #000 calc(100% - 9px)); mask: radial-gradient(closest-side, transparent calc(100% - 10px), #000 calc(100% - 9px)); }
.spinner i svg { position: absolute; left: 50%; top: 0; width: 30px; height: 30px; margin-left: -15px; }
.spinner img { position: absolute; inset: 24px; width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: var(--soft); }
@keyframes orbit { to { transform: rotate(360deg); } }
.codebox { display: flex; align-items: center; gap: 12px; background: var(--soft); border-radius: 18px; padding: 9px 12px; flex-wrap: wrap; } .codebox small { font-size: 12px; font-weight: 800; color: var(--mute); } .codebox b { font: var(--fw) 31px/1 'Lilita One', sans-serif; letter-spacing: .1em; color: var(--blue); user-select: text; -webkit-user-select: text; } .codebox .chip { margin-left: auto; }
.heroes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 6px 0 4px; } .heroes button { border-radius: 50%; padding: 3px; background: var(--soft); } .heroes img { display: block; width: clamp(46px, 5.4vw, 66px); aspect-ratio: 1; border-radius: 50%; object-fit: cover; }
.heroes .sel { background: var(--orange); box-shadow: 0 3px 0 #c45f00; } .heroes button:focus-visible, .evs button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 2px; } .hn { font: var(--fw) 21px/1 'Lilita One', sans-serif; }
.evs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .evs button { display: flex; align-items: center; gap: 10px; text-align: left; background: var(--soft); border-radius: 16px; padding: 8px 10px; } .evs .wide { grid-column: 1 / -1; }
.evs i { width: 38px; height: 38px; flex: none; border-radius: 12px; background: var(--c); color: #fff; display: grid; place-items: center; } .evs svg { width: 24px; height: 24px; } .evs b { display: block; font: var(--fw) 16.5px/1.1 'Lilita One', sans-serif; } .evs small { font-size: 12px; font-weight: 700; color: var(--mute); }
.evs .sel { background: var(--yellow); box-shadow: 0 3px 0 #c99a00; } .evs .sel small { color: var(--ink); }
.seats { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; } .seats .pl { display: flex; align-items: center; gap: 9px; min-height: 50px; background: var(--soft); border-radius: 15px; padding: 5px 11px 5px 6px; font-size: 14.5px; font-weight: 800; } .seats .pl span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .seats .pl i { width: 22px; height: 22px; color: var(--green); flex: none; }
.seats .free { color: #9aa3c4; background: none; box-shadow: inset 0 0 0 2px #dbe3f7; } .seats .free img { visibility: hidden; } .seats .me { box-shadow: inset 0 0 0 3px var(--yellow); } .seats .ready { background: #dff7e6; }

/* Resultados: a un lado, para que se vea el podio */
.side { justify-content: flex-end; } .side .card { width: min(430px, 100%); margin-right: clamp(0px, 3vw, 60px); }
.results { text-align: center; } .results h1 { margin: 0; font: var(--fw) clamp(38px, 9vmin, 62px)/1 'Lilita One', sans-serif; color: var(--blue); animation: cardIn .7s cubic-bezier(.2, 1.5, .35, 1); }
[data-res="win"] h1 { color: var(--orange); } [data-res="lose"] h1 { color: #5b678f; }
.podium { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; } .podium li { display: flex; align-items: center; gap: 9px; min-height: 44px; background: var(--soft); border-radius: 13px; border-left: 7px solid var(--c); text-align: left; } .podium li.me { background: #fff0b8; }
.podium span { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 800; } .podium span u { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .podium small { display: block; font-size: 11.5px; font-weight: 700; color: var(--mute); } .podium small:empty { display: none; }
.podium img { width: 36px; height: 36px; }

.tog { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .tog button { display: flex; justify-content: space-between; align-items: center; gap: 6px; background: var(--soft); border-radius: 13px; padding: 10px 12px; font-size: 13.5px; font-weight: 800; } .tog i { font-style: normal; font-size: 12px; background: #c9d2ea; border-radius: 8px; padding: 3px 8px; } .tog .sel i { background: var(--green); color: #fff; }
.howgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; } .hc { display: flex; gap: 11px; align-items: flex-start; } .hc .ic { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; } .hc .ic svg { width: 27px; height: 27px; } .hc b { font: var(--fw) 18px/1.1 'Lilita One', sans-serif; } .hc p { font-size: 13px; line-height: 1.38; }
.ic.blue { background: var(--blue); } .ic.orange { background: var(--orange); } .ic.violet { background: var(--violet); } .ic.green { background: var(--green); } .ic.pink { background: var(--pink); }

/* Vertical */
@media (max-aspect-ratio: 95/100) {
  .title { flex-direction: column; align-items: center; justify-content: space-between; }
  .title .col { display: contents; }
  .title .logo { order: 0; width: min(80vw, 370px); max-height: 26vh; }
  .title .tagline { order: 1; margin: -10px 0 auto; max-width: 90vw; }
  .title .kit { order: 2; align-self: center; margin: 0 0 12px; padding: 7px 12px 9px; } .heroes img { width: min(13vw, 60px); }
  .title .menu { order: 3; width: min(430px, 100%); } .title .row.low { order: 4; justify-content: center; margin: 12px 0 0; }
  .howgrid { grid-template-columns: 1fr; } .pops { top: 25%; } .toasts { top: calc(var(--st) + 118px); }
  .intro { flex-direction: column; gap: 0; bottom: calc(var(--sb) + 9vh); } .intro .ic2 { margin-bottom: -20px; z-index: 1; width: 84px; } .intro .tx { padding-top: 24px; text-align: center; max-width: 92vw; }
  .side { align-items: flex-end; justify-content: center; } .side .card { margin: 0; max-height: 68%; padding: 12px 14px; gap: 8px; } .side .mb b { font-size: 17px; } .side .podium li { min-height: 36px; } .side .podium img { width: 28px; height: 28px; } .results h1 { font-size: 31px; } .tb { height: min(580px, 88%); }
  .plate { width: min(340px, calc(100vw - 124px)); } .pos { font-size: 16px; } .clock { font-size: 22px; min-width: 50px; } .pl1 { gap: 7px; }
}
@media (max-width: 480px) { .two { gap: 8px; } .mb { padding-right: 10px; gap: 9px; } .mb b { font-size: 18px; } .mb small { font-size: 11.5px; } [data-s="online"] .two { grid-template-columns: 1fr; } .seg button { font-size: 13px; } .evs b { font-size: 14.5px; } .evs small { font-size: 11px; } .evs i { width: 32px; height: 32px; } .rank span { display: none; } .rank div { justify-content: space-between; } }
@media (max-width: 480px) { .crows.t { grid-template-columns: 1fr; gap: 9px; } .cr .ic { width: 38px; height: 38px; } .title .row.low { gap: 8px; flex-wrap: wrap; } }
@media (max-height: 480px) and (min-aspect-ratio: 95/100) { .crows.t { gap: 8px 12px; } .cr p { font-size: 11.5px; } .cr .ic { width: 34px; height: 34px; } .cr b { font-size: 15px; } .cz.r { top: 34%; right: 31%; } .cz b { font-size: 14px; } .ck { gap: 5px 14px; } }
@media (max-width: 370px) { .evs { grid-template-columns: 1fr; } .seats { gap: 6px; } .seats .pl { padding: 4px 6px; gap: 6px; font-size: 13px; } .evs .wide { grid-column: auto; } .tog button { font-size: 12.5px; padding: 10px 9px; } }
@media (max-aspect-ratio: 95/100) and (max-height: 740px) { .side .podium li { min-height: 28px; } .side .podium img { width: 23px; height: 23px; } .side .podium small { display: none; } .side .podium { gap: 4px; } .results h1 { font-size: 27px; } .side .mb { min-height: 46px; } .side .mb .ic { width: 32px; height: 32px; } }
/* Pantallas bajas (móvil en horizontal y marco de la página) */
@media (max-height: 480px) and (min-aspect-ratio: 95/100) {
  .title .col { gap: 8px; width: min(44vw, 340px); } .title .logo { max-height: 38vh; } .mb { min-height: 48px; padding: 5px 12px 5px 8px; border-radius: 15px; } .mb.big { min-height: 54px; } .mb.big b { font-size: 20px; } .mb b { font-size: 17px; } .mb small { font-size: 11px; } .mb .ic { width: 34px; height: 34px; }
  .menu { gap: 10px; } .tagline { display: none; } .card { padding: 12px; gap: 9px; border-radius: 20px; width: min(680px, 100%); } .card h2 { font-size: 21px; } .card header .rb { width: 36px; height: 36px; }
  .kit { margin-bottom: 2px; padding: 5px 10px 7px; } .heroes img { width: 44px; } .evs { grid-template-columns: repeat(3, 1fr); } .evs .wide { grid-column: auto; } .evs button { padding: 5px 8px; } .evs i { width: 30px; height: 30px; } .evs small { display: none; } .seats { grid-template-columns: repeat(3, 1fr); gap: 6px; } .seats .pl { min-height: 42px; }
  [data-s="how"] .keys, [data-s="setup"] .keys { display: none; } .howgrid { gap: 8px 14px; } .hc p { font-size: 12px; }
  .intro { bottom: calc(var(--sb) + 8px); } .intro .ic2 { width: 64px; } .intro .tx { padding: 7px 14px 9px; max-width: 70vw; } .intro h1 { font-size: 24px; } .intro p { font-size: 13px; } .intro small { font-size: 11px; }
  .tb { padding: 8px 12px; border-radius: 18px; width: min(620px, 100%); } .tb h2 { font-size: 19px; margin-bottom: 3px; } .tb ol { display: block; } .tb li span { font-size: 13px; } .tb li img { width: 28px; height: 28px; } .tb p { display: none; } .rk { font-size: 15px; }
  .side .card { width: min(380px, 52vw); margin-right: 0; padding: 8px 12px 12px; gap: 6px; } .results h1 { font-size: 23px; } .podium { gap: 3px; } .podium li { min-height: 28px; } .podium img { width: 22px; height: 22px; } .podium small { display: none; } .side .two { gap: 8px; } .side .mb { min-height: 42px; } .side .mb .ic { width: 28px; height: 28px; }
  .plate { width: min(300px, 46vw); padding: 4px 8px 5px 5px; } .ei { width: 28px; height: 28px; } .clock { font-size: 21px; } .pops { top: 24%; }
}
/* Pantallas grandes: todo mayor, para verlo de lejos */
@media (min-width: 1500px) and (min-height: 880px) { .hud .top, .toasts, .watch, .tagp > *, .title .col, .title .kit, .panel .card, .intro, .tb { zoom: 1.28; } }
@media (min-width: 2200px) and (min-height: 1200px) { .hud .top, .toasts, .watch, .tagp > *, .title .col, .title .kit, .panel .card, .intro, .tb { zoom: 1.7; } }
@media (prefers-reduced-motion: reduce) { .title .logo, .tagp em { animation: none; } }
