/* =====================================================================
   POKEBOOM · interfaz del juego
   Oscuro con un solo acento naranja (el de la marca y la landing), paneles de
   vidrio, esquinas cortadas en diagonal en todo lo que se pulsa y tipografía
   gruesa (Unbounded para títulos y números, Outfit para el texto).
   Regla de formas: botones, tarjetas, casillas y pastillas llevan el corte en
   diagonal (--cut); los paneles grandes, radio de 18 px.
   ===================================================================== */
:root {
  --bg0: #05070d; --bg1: #0a0e1a; --bg2: #10162a; --bg3: #18203a; --bg4: #222c4c;
  --line: rgba(255,255,255,.07); --line2: rgba(255,255,255,.14); --line3: rgba(255,255,255,.26);
  --tx: #f3f5fb; --tx2: #a6b0cc; --tx3: #69738f;
  --acc: #ff7a1a; --acc-hi: #ffb347; --acc-lo: #e2560a; --acc-ink: #1f0c00; --acc-glow: rgba(255,122,26,.45); --acc-soft: rgba(255,122,26,.14);
  --gold: #ffd23d; --ok: #3ee07a; --bad: #ff4757; --info: #5ad8ff;
  --team-a: #ff4d5e; --team-b: #3d8bff;
  --font: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Unbounded', 'Outfit', system-ui, sans-serif;
  --cut: 10px;
  --radius: 18px;
  --glass: linear-gradient(180deg, rgba(26,33,58,.92), rgba(12,16,30,.95));
  --glass-2: linear-gradient(180deg, rgba(34,43,74,.9), rgba(18,24,44,.92));
  --shadow: 0 28px 70px rgba(0,0,0,.55);
  /* nombres viejos que el código todavía usa en estilos en línea */
  --accent: var(--acc); --red: var(--bad); --muted: var(--tx2); --gbgold: var(--gold); --text: var(--tx); --green: var(--ok); --blue: var(--team-b);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
/* sin zoom de doble toque en el movil */
html, body, button { touch-action: manipulation; }
/* Safari del iPhone amplia la pantalla al tocar un campo con letra menor de 16 px y el zoom se queda puesto (lo
   vio un amigo del usuario): en pantallas tactiles los campos van a 16 px */
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } }
body { font-family: var(--font); background: var(--bg0); color: var(--tx); overflow: hidden; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; font-size: 15px; }
input, select, textarea { user-select: text; -webkit-user-select: text; font-family: inherit; }
button { font-family: inherit; cursor: pointer; color: inherit; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.1; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: .01em; text-transform: uppercase; }
h3 { font-family: var(--display); font-weight: 700; font-size: .92rem; letter-spacing: .03em; text-transform: uppercase; }
p { margin: .3em 0; }
.hint { color: var(--tx2); font-size: .85rem; }
.sub { color: var(--tx2); }
.hidden { display: none !important; }
.grow { flex: 1; }
canvas { display: block; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* corte en diagonal (arriba a la izquierda y abajo a la derecha) */
.cut, .btn:not(.link), .chip, .tab, .mode-card, .rail-btn, .gb-card, .gb-tile, .gb-slot, .shot, .item, .gbtn, .member, .camp-mi, .camp-reg, .reward, .toast, .pad, .gb-tag-slot, .ps-cell, .poke, .starter, .lobby-row, .gb-end-row {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
}

.screen { position: fixed; inset: 0; display: none; }
.screen.active { display: block; animation: screenIn .38s cubic-bezier(.2,.8,.2,1); }
@keyframes screenIn { from { opacity: 0; transform: scale(1.015); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes shine { from { transform: translateX(-140%) skewX(-20deg); } to { transform: translateX(340%) skewX(-20deg); } }
@keyframes pulse { to { transform: scale(1.06); } }
@keyframes glow { to { filter: brightness(1.35); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------------- logo ---------------- */
.logo { display: flex; align-items: center; justify-content: center; margin: 0; }
.logo .logo-img, .logo-img { height: clamp(40px, 7vw, 84px); width: auto; filter: drop-shadow(0 8px 18px rgba(0,0,0,.55)); }
.logo.small .logo-img { height: 36px; }

/* ---------------- botones ---------------- */
.btn { position: relative; overflow: hidden; border: 0; background: var(--glass-2); color: var(--tx); padding: .72em 1.2em; font-weight: 700; font-size: .95rem; letter-spacing: .01em; line-height: 1.15;
  box-shadow: inset 0 0 0 1px var(--line2), inset 0 1px 0 rgba(255,255,255,.1); transition: transform .08s, filter .15s, background .15s; }
.btn:hover { filter: brightness(1.18); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .42; cursor: default; transform: none; filter: grayscale(.4); }
.btn.primary { background: linear-gradient(180deg, var(--acc-hi) 0%, var(--acc) 52%, var(--acc-lo) 100%); color: var(--acc-ink); font-family: var(--display); font-weight: 800; text-transform: uppercase; letter-spacing: .03em; font-size: .88rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -2px 0 rgba(0,0,0,.18); }
.btn.primary::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent); transform: translateX(-140%) skewX(-20deg); pointer-events: none; }
.btn.primary:hover::after { animation: shine .75s ease-out; }
.btn.danger { background: linear-gradient(180deg, #ff6b78, #e23447 60%, #b81f30); color: #fff; }
.btn.ghost { background: transparent; color: var(--tx2); }
.btn.link { background: none; box-shadow: none; padding: 0 .3em; color: var(--tx2); }
.btn.link:hover { color: var(--acc); filter: none; }
.btn.small { padding: .5em .85em; font-size: .85rem; --cut: 8px; }
.btn.tiny { padding: .32em .65em; font-size: .78rem; --cut: 6px; }
.btn.big { padding: .95em 1.7em; font-size: 1.02rem; --cut: 12px; }
.btn.primary.big { font-size: .98rem; }
.btn.icon { padding: .5em .7em; }
.row2 { display: flex; gap: .7em; margin-top: .8em; }
.row2 > * { flex: 1; }
.row3 { display: flex; gap: .7em; margin-top: .8em; }

/* ---------------- paneles, cajas y formularios ---------------- */
.panel, .box { background: var(--glass); border: 1px solid var(--line2); border-radius: var(--radius); box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.06); color: var(--tx); position: relative; }
.panel::before, .box::before { content: ''; position: absolute; top: -1px; left: 26px; width: 84px; height: 3px; border-radius: 0 0 3px 3px; background: linear-gradient(90deg, var(--acc), var(--acc-hi)); box-shadow: 0 0 14px var(--acc-glow); }
.panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 1.4rem 1.6rem; max-width: 96vw; max-height: 96vh; overflow: auto; backdrop-filter: blur(14px); }
.panel.wide { width: 960px; }
.card { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 14px; padding: 1rem; }
.card.dark { background: rgba(4,6,14,.55); }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .5em; }
.card-head h3 { margin: 0; }
label { display: flex; flex-direction: column; gap: .35em; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tx2); margin: .7em 0; }
label.check { flex-direction: row; align-items: center; gap: .6em; text-transform: none; letter-spacing: 0; font-size: .9rem; }
input[type=text], input[type=search], input:not([type]), select { background: rgba(0,0,0,.4); border: 1px solid var(--line2); color: var(--tx); border-radius: 10px; padding: .65em .85em; font-size: 1rem; font-weight: 600; outline: none; transition: border-color .15s, box-shadow .15s; text-transform: none; letter-spacing: 0; }
input:focus, select:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
select option { background: var(--bg2); }
input[type=checkbox] { accent-color: var(--acc); width: 18px; height: 18px; }
.chip, .tab { padding: .38em .85em; background: rgba(255,255,255,.06); font-size: .85rem; font-weight: 700; cursor: pointer; color: var(--tx); border: 0; box-shadow: inset 0 0 0 1px var(--line2); --cut: 7px; }
.chip.sel, .tab.sel { background: linear-gradient(180deg, var(--acc-hi), var(--acc)); color: var(--acc-ink); box-shadow: none; }
.swatches, .chips, .tabs { display: flex; gap: .4em; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; transition: transform .1s; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--acc); }
.el { display: inline-block; font-family: var(--display); font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .25em .7em; color: #111; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }

/* ---------------- arranque y registro ---------------- */
#screen-boot, #screen-register { background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(255,122,26,.16), transparent 60%), radial-gradient(ellipse at 50% 120%, #17203d, var(--bg0) 70%); }
.boot { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; }
.boot p { color: var(--tx2); font-weight: 600; letter-spacing: .04em; }
.boot::after { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.12); border-top-color: var(--acc); animation: spin .8s linear infinite; }
#screen-register { overflow: auto; }
/* la cuenta: el juego de verdad detras (partida de bots), desenfocado y oscuro, y una tarjeta de cristal con
   REGISTRO e INICIAR SESION */
#screen-cuenta { background: var(--bg0); overflow: hidden; }
#cuenta-bg { position: absolute; inset: -3%; width: 106%; height: 106%; display: block; filter: blur(3px) brightness(.62) saturate(1.15); }
.cuenta-velo { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 50% 50%, rgba(11,14,26,.2), rgba(11,14,26,.75) 80%), radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,122,26,.18), transparent 70%); }
.cuenta-lang { position: absolute; top: max(14px, env(safe-area-inset-top)); right: max(14px, env(safe-area-inset-right)); z-index: 2; }
.cuenta-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(430px, 92vw); max-height: 94dvh; overflow: auto;
  display: flex; flex-direction: column; align-items: stretch; gap: .75rem; text-align: center; padding: 1.6rem 1.5rem 1.3rem;
  background: rgba(14,18,34,.62); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(255,122,26,.08), inset 0 1px 0 rgba(255,255,255,.08); animation: riseCentro .5s ease both; }
.cuenta-logo { width: min(300px, 74%); margin: 0 auto; filter: drop-shadow(0 8px 26px rgba(255,122,26,.35)); }
.cuenta-lema { margin: -.2rem 0 .3rem; color: var(--tx2); font-weight: 600; letter-spacing: .02em; }
.cuenta-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.08); }
.cuenta-tab { appearance: none; border: 0; border-radius: 10px; padding: .7rem .4rem; background: transparent; color: var(--tx2); font-family: var(--display); font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: background .2s, color .2s; }
.cuenta-tab:hover { color: var(--tx); }
.cuenta-tab.sel { background: linear-gradient(180deg, var(--acc-hi), var(--acc)); color: #1a0f05; box-shadow: 0 6px 18px var(--acc-glow); }
.cuenta-vista { display: flex; flex-direction: column; gap: .7rem; animation: rise .3s ease both; }
.cuenta-vista h2 { font-family: var(--display); font-size: 1.3rem; line-height: 1.15; margin: .5rem 0 0; }
.cuenta-vista .sub { color: var(--tx2); margin: 0 0 .3rem; }
.cuenta-vista .btn { width: 100%; }
.cuenta-panel .hint { margin: .1rem 0 0; color: var(--tx3); }
#screen-register .panel { animation: rise .45s ease both; }
.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.reg-grid .card { background: rgba(255,255,255,.025); }
.avatar-3d { display: block; margin: 0 auto; width: 240px; height: 260px; max-width: 100%; border-radius: 14px; background: radial-gradient(ellipse 60% 50% at 50% 70%, rgba(255,122,26,.22), transparent 70%), radial-gradient(circle at 50% 40%, #1d2646, #0b0f1d 75%); box-shadow: inset 0 0 0 1px var(--line); }
.pick-row { display: flex; align-items: center; gap: .6em; margin: .5em 0; flex-wrap: wrap; }
.pick-row > span { width: 72px; font-size: .75rem; color: var(--tx2); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em; }
.starter { background: var(--glass-2); padding: .55em; text-align: center; cursor: pointer; transition: transform .14s; box-shadow: inset 0 0 0 1px var(--line2); }
.starter:hover { transform: translateY(-3px); }
.starter.sel { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -40px 40px -20px var(--acc-soft); }
.starter canvas { width: 100%; max-width: 130px; aspect-ratio: 1; margin: 0 auto; }
.starter b { display: block; font-family: var(--display); font-size: .82rem; text-transform: uppercase; }
.starter small { color: var(--tx2); display: block; font-size: .72rem; line-height: 1.25; }
#reg-go { width: 100%; margin-top: 1rem; }
#reg-wallet, #reg-correo { width: 100%; margin-top: .4rem; }

/* ---------------- menú: lobby de juego ----------------
   Barra de arriba con tu perfil (nivel, rango de GP y rango competitivo), las monedas y Ajustes; secciones a la
   izquierda; tu entrenador en el centro; a la derecha los modos y, abajo, JUGAR (partida rápida) con su selector
   NORMAL / COMPETITIVA. En el móvil en vertical todo va en una columna y las secciones son pestañas abajo. */
#menu-bg, #lobby-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; filter: saturate(.9) brightness(.85); }
.menu-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 45% 60% at 45% 62%, rgba(255,122,26,.13), transparent 70%), linear-gradient(90deg, rgba(5,7,13,.88) 0%, rgba(5,7,13,.3) 22%, rgba(5,7,13,.3) 52%, rgba(5,7,13,.9) 100%), linear-gradient(180deg, rgba(5,7,13,.85), transparent 20%, transparent 72%, rgba(5,7,13,.85)); }
.menu-art { position: absolute; inset: -4%; background: var(--bg1) url(/img/campana/ruta_9.jpg) center / cover no-repeat; filter: brightness(.5) saturate(1.05); animation: kenburns 46s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1) translate(0, 0); } to { transform: scale(1.1) translate(-2%, -1.5%); } }
/* con una ventana abierta el fondo del menu se para: el desenfoque de la ventana no tiene que rehacerse cada cuadro */
body:has(.modal.open) .menu-art, body:has(.modal.open) .menu-chispas i { animation-play-state: paused; }
.menu-chispas { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.menu-chispas i { position: absolute; bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: var(--acc-hi); box-shadow: 0 0 8px 2px var(--acc-glow); opacity: 0; transform: scale(var(--s, 1)); animation: chispa linear infinite; }
@keyframes chispa { 0% { opacity: 0; transform: translate(0, 0) scale(var(--s, 1)); } 12% { opacity: .9; } 80% { opacity: .5; } 100% { opacity: 0; transform: translate(var(--x, 0), -95vh) scale(var(--s, 1)); } }

/* barra de arriba: perfil, logo, ORO, BOOM (el "+" solo lo ve el creador) y el engranaje de Ajustes */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: 76px; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left)); }
.top-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); height: 42px; width: auto; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); pointer-events: none; }
#me-card { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-width: 0; max-width: 380px; padding: 7px 16px 7px 7px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2), 0 12px 30px rgba(0,0,0,.35); --cut: 14px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.me-ava { position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #2a3560, #10162a); box-shadow: 0 0 0 2px var(--acc), 0 0 16px var(--acc-glow); }
#me-card canvas#me-avatar { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: 50% 8%; }
.me-lv { position: absolute; right: -6px; bottom: -4px; min-width: 24px; height: 22px; padding: 0 5px; display: grid; place-items: center; font-family: var(--display); font-size: .68rem; font-weight: 900; color: var(--acc-ink); background: linear-gradient(180deg, var(--acc-hi), var(--acc)); border-radius: 7px; box-shadow: 0 0 0 2px #0b0f1d; }
.me-info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.me-name { display: flex; align-items: center; gap: 2px; min-width: 0; font-family: var(--display); font-weight: 800; font-size: 1rem; line-height: 1.1; }
.me-name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* zona de toque de 40 px o mas aunque el boton se vea chico */
.cur-mas::after { content: ''; position: absolute; inset: -7px; }
.me-rangos { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.me-rango { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; color: var(--tx2); white-space: nowrap; cursor: help; }
.me-rango img { width: 22px; height: 22px; object-fit: contain; }
.me-liga { --c: #b47bff; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px 2px 4px; font-size: .66rem; font-weight: 800; white-space: nowrap; color: color-mix(in srgb, var(--c) 70%, #fff); background: color-mix(in srgb, var(--c) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 55%, transparent); border-radius: 999px; cursor: help; }
.liga-ico { display: inline-block; flex: none; width: 16px; height: 16px; background: var(--c, #b47bff); -webkit-mask: url(/img/ui/medal-fill.svg) center / contain no-repeat; mask: url(/img/ui/medal-fill.svg) center / contain no-repeat; filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c, #b47bff) 60%, transparent)); }
.me-xp { width: 100%; min-width: 120px; height: 5px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; }
.me-xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc), var(--acc-hi)); box-shadow: 0 0 8px var(--acc-glow); transition: width .5s; }
.topbar-right { position: relative; z-index: 1; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.cur { position: relative; display: flex; align-items: center; gap: .45em; height: 40px; padding: 0 1em 0 .4em; border-radius: 999px; background: rgba(4,6,14,.78); box-shadow: inset 0 0 0 1px var(--line2), 0 6px 18px rgba(0,0,0,.35); font-family: var(--display); font-weight: 800; font-size: .9rem; font-variant-numeric: tabular-nums; }
.cur-ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: .66rem; font-weight: 900; color: #3a2400; flex: none; }
.cur.oro .cur-ico { background: radial-gradient(circle at 35% 30%, #fff1a6, #ffc21e 60%, #c78a00); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.cur.oro .cur-ico::before { content: 'G'; }
.cur.boom .cur-ico { background: radial-gradient(circle at 35% 30%, var(--acc-hi), var(--acc) 60%, var(--acc-lo)); color: var(--acc-ink); }
.cur.boom .cur-ico::before { content: 'B'; }
.cur.oro b { color: var(--gold); }
.cur.boom b { color: var(--acc-hi); }
.cur.boom:has(.cur-mas:not(.hidden)) { padding-right: 5px; }
.cur-mas { position: relative; width: 30px; height: 30px; margin-left: 4px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; font-size: .85rem; color: var(--acc-ink); background: linear-gradient(180deg, #7df0a6, var(--ok)); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2); }
.cur-mas:hover { filter: brightness(1.12); }
.coins { display: none; }
.topbar .btn.icon { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; font-size: 1.2rem; }
.online { color: var(--tx2); font-size: .74rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4em; white-space: nowrap; }
.online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* panel de Ajustes: una lista (idioma, sonido, cuenta, app, ayuda y tutorial, y abajo quien esta en linea) */
.aj-panel { position: fixed; z-index: 60; width: min(330px, calc(100vw - 16px)); max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--glass); border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line2), var(--shadow); animation: rise .18s ease; }
.aj-cab > b { font-family: var(--display); font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.aj-fila { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.aj-et { display: inline-flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 700; color: var(--tx2); }
.aj-et .ui-ico { color: var(--acc-hi); font-size: 1rem; }
.aj-sonido { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.aj-sonido-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.aj-panel .aj-sonido-cab .btn.small { min-height: 36px; padding: .4em .9em; font-size: .8rem; }
.aj-panel .btn.small { min-height: 40px; }
.aj-panel .lang-btn { min-height: 36px; }
.aj-grupo { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.aj-grupo > .aj-fila { padding-top: 0; border-top: 0; }
.aj-sub { font-family: var(--display); font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tx3); }
.aj-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 0 12px; border: 0; border-radius: 10px; text-align: left; font-family: var(--font); font-size: .88rem; font-weight: 700; color: var(--tx); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line); transition: background .15s; }
.aj-item:hover { background: rgba(255,255,255,.09); }
.aj-item > .ui-ico { flex: none; font-size: 1.05rem; color: var(--acc-hi); }
.aj-item > span { flex: 1; min-width: 0; }
.aj-estado { flex: none; font-style: normal; font-size: .72rem; font-weight: 800; color: var(--ok); }
.aj-pie { display: flex; justify-content: center; padding-top: 10px; border-top: 1px solid var(--line); }
.snd-fila { display: grid; grid-template-columns: 18px 64px 1fr; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: var(--tx); }
.snd-fila .ui-ico { color: var(--acc-hi); font-size: 1rem; }
.snd-fila input[type=range] { width: 100%; accent-color: var(--acc); }

/* el cuerpo del menu */
.menu-scroll { display: contents; }
.menu-main { position: absolute; top: 76px; left: 0; right: 0; bottom: 0; z-index: 2; display: grid; grid-template-columns: 96px minmax(0, 1fr) minmax(400px, 460px); gap: 18px; padding: 4px max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }

/* secciones: Vestuario, Pokemon, Pase y Ranking */
.menu-rail { display: flex; flex-direction: column; gap: 8px; align-self: center; animation: rise .45s .05s ease both; }
.rail-btn { position: relative; width: 90px; min-height: 84px; border: 0; padding: 9px 4px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--tx); background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2), 0 10px 24px rgba(0,0,0,.3); transition: transform .12s, box-shadow .15s; --cut: 12px; }
.rail-btn:hover { transform: translateX(3px); box-shadow: inset 0 0 0 1px var(--acc), inset 4px 0 0 var(--acc), 0 10px 24px rgba(0,0,0,.3); }
.rail-btn:active { transform: scale(.97); }
.rail-ico { width: 44px; height: 42px; display: grid; place-items: center; font-size: 31px; color: var(--acc-hi); background: radial-gradient(circle at 50% 40%, rgba(255,122,26,.28), transparent 70%); border-radius: 12px; transition: transform .2s cubic-bezier(.2,1.6,.4,1); }
.rail-btn:hover .rail-ico { transform: scale(1.1) rotate(-5deg); }
.rail-btn b { max-width: 100%; font-family: var(--font); font-size: 13px; font-weight: 700; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.rail-badge { position: absolute; top: 5px; right: 7px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; font-style: normal; font-family: var(--display); font-size: .58rem; font-weight: 900; color: #fff; background: var(--bad); border-radius: 10px; box-shadow: 0 0 0 2px #0b0f1d, 0 0 12px rgba(255,71,87,.6); animation: pulse .9s ease-in-out infinite alternate; }
/* pokebola de interfaz (el icono de la seccion Pokemon) */
.pokeball-ico { display: block; width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #fff 0 16%, #1b1a2a 16% 26%, transparent 26%), linear-gradient(180deg, #ff5a3c 0 45%, #1b1a2a 45% 55%, #f3f5fb 55%); box-shadow: 0 0 0 2px #1b1a2a, 0 0 12px rgba(255,90,60,.45); }
.rail-btn:hover .pokeball-ico { animation: pokeBamboleo .5s ease-in-out; }
@keyframes pokeBamboleo { 25% { transform: rotate(-14deg); } 75% { transform: rotate(12deg); } }

/* tu entrenador: tocarlo abre el Vestuario (la camiseta de la esquina lo indica) */
.menu-hero { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 0; animation: rise .5s .1s ease both; }
.menu-hero::before { content: ''; position: absolute; left: 50%; bottom: 13%; width: min(520px, 90%); height: 70px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(255,122,26,.42), rgba(255,122,26,.08) 55%, transparent 72%); filter: blur(2px); pointer-events: none; }
.hero-card { position: relative; z-index: 1; overflow: hidden; border: 0; padding: 0; height: min(64vh, 560px); max-height: 100%; aspect-ratio: 400 / 584; cursor: pointer; background: radial-gradient(ellipse 70% 55% at 50% 78%, rgba(255,122,26,.35), transparent 70%), linear-gradient(180deg, #1a2342, #0b0f1d); --cut: 22px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); box-shadow: inset 0 0 0 1px var(--line3); transition: transform .2s; }
.hero-card::before { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 62%, rgba(255,179,71,.09) 0deg 6deg, transparent 6deg 18deg), radial-gradient(ellipse 80% 60% at 50% 62%, rgba(255,122,26,.25), transparent 70%); animation: rayos 60s linear infinite; pointer-events: none; }
@keyframes rayos { to { transform: rotate(360deg) scale(1.6); } }
.hero-card::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px rgba(255,179,71,.45), inset 0 -120px 80px -60px rgba(5,7,13,.9); pointer-events: none; }
.hero-card:hover { transform: translateY(-3px); }
.hero-card:active { transform: scale(.99); }
.hero-card canvas { position: relative; z-index: 1; }
#hero-trainer { width: 100%; height: 100%; margin: 0; display: block; }
.hero-ir { position: absolute; top: 14px; right: 14px; z-index: 2; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.2rem; color: var(--acc-hi); background: rgba(4,6,14,.75); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); transition: background .15s, color .15s; }
.hero-card:hover .hero-ir { background: var(--acc); color: var(--acc-ink); }
.hero-plate { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 0; padding: .45em 1.3em; text-align: center; white-space: nowrap; background: rgba(4,6,14,.8); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.hero-plate b { font-family: var(--display); font-weight: 800; font-size: .95rem; text-transform: uppercase; }
.hero-plate small { font-size: .62rem; font-family: var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--acc-hi); }
.hero-acts { position: relative; z-index: 2; display: flex; align-items: stretch; gap: 8px; justify-content: center; }
.hero-poke { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 3px 16px 3px 6px; border: 0; text-align: left; color: var(--tx); background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); --cut: 8px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: filter .15s; }
.hero-poke:hover { filter: brightness(1.18); }
.hero-poke img { width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.hero-poke small { display: block; font-family: var(--display); font-size: .48rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx3); }
.hero-poke b { display: block; font-family: var(--display); font-size: .8rem; font-weight: 800; text-transform: uppercase; }

/* la derecha: Campana, Incursion y Con amigos, y JUGAR grande abajo */
.menu-side { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 0; animation: rise .5s .15s ease both; }
.mode-card { position: relative; overflow: hidden; border: 0; padding: 12px 14px; min-height: 118px; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; gap: 2px; text-align: left; color: #fff; background: var(--bg2); --cut: 16px; transition: transform .14s; }
.mode-card .mc-img { position: absolute; inset: 0; background: var(--bg3) center / cover no-repeat; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.mode-card .mc-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,7,13,.95) 10%, rgba(5,7,13,.45) 60%, rgba(5,7,13,.15)); }
.mode-card::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px var(--line2); pointer-events: none; transition: box-shadow .15s; }
.mode-card:hover { transform: translateY(-2px); }
.mode-card:hover .mc-img { transform: scale(1.07); }
.mode-card:hover::after { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -60px 60px -40px var(--acc-soft); }
.mode-card:active { transform: scale(.99); }
.mode-card > * { position: relative; z-index: 1; }
.mode-card b { font-family: var(--display); font-weight: 800; font-size: 1.02rem; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.mode-card small { color: var(--tx2); font-size: .74rem; font-weight: 500; line-height: 1.25; }
.mc-ico { position: absolute !important; top: 10px; left: 12px; width: 32px; height: 32px; display: grid; place-items: center; font-size: 1.1rem; color: var(--acc-hi); background: rgba(4,6,14,.72); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.mode-card.hot .mc-ico { color: var(--acc-ink); background: linear-gradient(180deg, var(--acc-hi), var(--acc)); box-shadow: none; animation: glow 1s ease-in-out infinite alternate; }
.mc-tag { position: absolute !important; top: 12px; left: 14px; font-family: var(--display); font-size: .56rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .35em .75em; background: rgba(4,6,14,.75); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.mc-boss { position: absolute !important; right: -8%; bottom: -10%; height: 112%; width: auto; max-width: 62%; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(255,90,40,.55)); transition: transform .5s; pointer-events: none; }
.mode-card:hover .mc-boss { transform: scale(1.06) translateX(-4px); }
.mc-badge { position: absolute !important; top: 10px; right: 10px; display: inline-flex; align-items: center; gap: 4px; font-family: var(--display); font-size: .7rem; font-weight: 800; color: var(--gold); padding: .3em .65em; background: rgba(4,6,14,.78); border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,210,61,.35); }
.mc-badge:empty { display: none; }
/* las salas publicas abiertas, en la tarjeta Con amigos */
.mc-badge.salas { color: var(--tx); box-shadow: inset 0 0 0 1px var(--line3); }
.mc-badge.salas .ui-ico { color: var(--acc-hi); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mode-card.ancha { grid-column: 1 / -1; min-height: 96px; }

/* JUGAR */
.play-dock { flex: none; display: flex; flex-direction: column; gap: 6px; filter: drop-shadow(0 18px 36px rgba(0,0,0,.5)); }
.mode-card.big { min-height: 164px; padding: 16px 18px; --cut: 20px; }
.mode-card.big .play-txt { display: flex; flex-direction: column; gap: 2px; max-width: calc(100% - 180px); }
.mode-card.big b { font-size: 1.75rem; }
.mode-card.big::after { box-shadow: inset 0 0 0 2px rgba(255,122,26,.7), inset 0 -70px 70px -50px rgba(255,122,26,.25); }
.mc-cta { position: absolute !important; right: 16px; bottom: 16px; display: inline-flex !important; align-items: center; gap: .4em; font-family: var(--display); font-weight: 900; font-size: 1.5rem; letter-spacing: .05em; color: var(--acc-ink); padding: .55em 1.25em; background: linear-gradient(180deg, var(--acc-hi), var(--acc) 55%, var(--acc-lo)); clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.5); overflow: hidden; }
.mc-cta .ui-ico { font-size: .9em; }
.mc-cta::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 30%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); animation: shine 2.8s ease-in-out infinite; }
.mode-card.big:hover .mc-cta { filter: brightness(1.1); }
.spinner { width: 20px; height: 20px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--acc); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.btn.huge { display: flex; flex-direction: column; align-items: flex-start; gap: .15em; padding: 1em 1.3em; width: 100%; text-align: left; }
.btn.huge b { font-family: var(--display); font-size: 1.2rem; text-transform: uppercase; }
.btn.huge span { font-weight: 500; color: var(--tx2); font-size: .85rem; }

/* portatil pequeño y tableta en horizontal */
@media (max-width: 1180px) {
  .menu-main { grid-template-columns: 90px minmax(220px, 1fr) minmax(350px, 420px); gap: 14px; }
  .top-logo { display: none; }
  .hero-card { height: min(56vh, 470px); }
  .mode-card { min-height: 104px; }
  .mode-card.ancha { min-height: 88px; }
  .mode-card.big b { font-size: 1.45rem; }
  .mc-cta { font-size: 1.25rem; }
}

/* movil en horizontal (poco alto): barra fina, secciones en columna, el entrenador y a la derecha modos y JUGAR */
@media (max-height: 520px) and (min-width: 560px) {
  .topbar { height: 52px; gap: 8px; padding: 0 max(10px, env(safe-area-inset-right)) 0 max(10px, env(safe-area-inset-left)); }
  .top-logo { display: none; }
  #me-card { gap: 9px; padding: 4px 12px 4px 4px; max-width: 300px; --cut: 10px; }
  .me-ava, #me-card canvas#me-avatar { width: 40px; height: 40px; }
  .me-lv { min-width: 20px; height: 18px; font-size: .56rem; right: -5px; bottom: -3px; }
  .me-name { font-size: .82rem; }
  .me-rango { font-size: .62rem; }
  .me-rango img { width: 18px; height: 18px; }
  .me-liga { font-size: .56rem; padding: 1px 7px 1px 3px; }
  .liga-ico { width: 13px; height: 13px; }
  .me-xp { display: none; }
  .cur { height: 36px; font-size: .78rem; }
  .cur-ico { width: 22px; height: 22px; font-size: .58rem; }
  .cur-mas { width: 28px; height: 28px; }
  .topbar .btn.icon { width: 40px; height: 40px; }
  .menu-main { top: 52px; grid-template-columns: 80px minmax(0, 1fr) minmax(300px, 46%); gap: 10px; padding: 2px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  .menu-rail { gap: 5px; align-self: stretch; justify-content: center; }
  .rail-btn { width: 80px; min-height: 54px; padding: 5px 3px; gap: 3px; --cut: 8px; }
  .rail-ico { width: 26px; height: 24px; font-size: 19px; background: none; }
  .pokeball-ico { width: 19px; height: 19px; }
  .rail-btn b { font-size: 11px; }
  .rail-badge { top: 2px; right: 4px; min-width: 16px; height: 16px; font-size: .5rem; }
  .menu-hero { gap: 6px; }
  .menu-hero::before { bottom: 18%; }
  .hero-card { height: calc(100dvh - 52px - 62px); min-height: 150px; --cut: 14px; }
  .hero-ir { top: 8px; right: 8px; width: 30px; height: 30px; font-size: .95rem; }
  .hero-plate { bottom: 8px; padding: .3em 1em; }
  .hero-plate b { font-size: .74rem; }
  .hero-plate small { font-size: .5rem; }
  .hero-acts { flex-wrap: nowrap; gap: 6px; }
  .hero-poke { min-height: 40px; font-size: .72rem; padding: 2px 10px 2px 4px; }
  .hero-poke img { width: 32px; height: 32px; }
  .hero-poke small { display: none; }
  .hero-poke b { font-size: .64rem; }
  .menu-side { gap: 8px; }
  .mode-grid { gap: 7px; }
  .mode-card, .mode-card.ancha { min-height: 66px; padding: 6px 10px; --cut: 10px; }
  .mode-card b { font-size: .78rem; }
  .mode-card small { display: none; }
  .mc-ico { width: 24px; height: 24px; top: 6px; left: 8px; font-size: .85rem; }
  .mc-badge { top: 6px; right: 6px; font-size: .56rem; }
  .play-dock { gap: 5px; }
  .mode-card.big { min-height: 84px; padding: 8px 12px; --cut: 12px; }
  .mode-card.big .mc-tag { display: none; }
  .mode-card.big .play-txt { max-width: calc(100% - 128px); }
  .mode-card.big b { font-size: 1rem; }
  .mode-card.big small { display: block; font-size: .62rem; }
  .mc-cta { right: 10px; bottom: 50%; transform: translateY(50%); font-size: 1.05rem; padding: .6em 1em; }
}

/* movil en vertical y pantallas estrechas: una columna que se desliza y las secciones en pestañas abajo. JUGAR va
   justo debajo del entrenador, a la vista sin desplazar */
@media (max-width: 900px) and (min-height: 521px), (max-width: 559px) {
  #screen-menu.active { display: flex; flex-direction: column; }
  .topbar { position: relative; flex: none; height: auto; flex-wrap: wrap; row-gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 8px; }
  .top-logo { display: none; }
  #me-card { flex: 1 1 150px; max-width: none; gap: 10px; padding: 5px 12px 5px 5px; }
  .me-ava, #me-card canvas#me-avatar { width: 44px; height: 44px; }
  .me-name { font-size: .88rem; }
  .me-rango { font-size: .66rem; }
  .me-rango img { width: 18px; height: 18px; }
  .me-liga { font-size: .58rem; }
  .me-xp { min-width: 0; }
  .topbar-right { gap: 6px; }
  .cur { height: 38px; font-size: .78rem; padding-right: .8em; }
  .cur.boom:has(.cur-mas:not(.hidden)) { padding-right: 4px; }
  .cur-ico { width: 22px; height: 22px; font-size: .58rem; }
  .topbar .btn.icon { width: 40px; height: 40px; }
  .menu-main { position: relative; top: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .menu-scroll { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; padding: 4px 12px 14px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .menu-scroll > * { flex-shrink: 0; }
  .menu-rail { order: 2; position: relative; flex: none; align-self: stretch; z-index: 4; flex-direction: row; justify-content: space-around; gap: 2px; padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(14,19,36,.96), rgba(6,8,16,.98)); box-shadow: 0 -10px 30px rgba(0,0,0,.5), inset 0 1px 0 var(--line2); animation: none; }
  .rail-btn { flex: 1; width: auto; min-width: 0; min-height: 58px; padding: 5px 2px; gap: 3px; background: none; box-shadow: none; --cut: 0px; }
  .rail-btn:hover { transform: none; box-shadow: none; }
  .rail-ico { width: 30px; height: 28px; font-size: 22px; color: var(--acc-hi); background: none; }
  .pokeball-ico { width: 22px; height: 22px; }
  .rail-btn b { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rail-badge { top: 2px; right: calc(50% - 22px); }
  .menu-hero { padding-top: 2px; gap: 8px; }
  /* el alto del entrenador deja sitio a JUGAR encima de las pestanas, sin desplazar */
  .hero-card { height: clamp(180px, calc(100dvh - 460px), 330px); }
  .menu-hero::before { bottom: 16%; }
  .menu-side { justify-content: flex-start; }
  .play-dock { order: -1; }
  .mode-card.big { min-height: 0; padding: 44px 14px 14px; }
  .mode-card.big .play-txt { max-width: 100%; }
  .mode-card.big b { font-size: 1.35rem; }
  .mode-card.big .mc-cta { position: static !important; align-self: stretch; justify-content: center; margin-top: 10px; font-size: 1.3rem; }
  .mode-card { min-height: 108px; padding-top: 48px; }
  .mode-card.ancha { min-height: 92px; }
  .mode-card .mc-boss { max-width: 48%; }
}
@media (max-width: 380px) {
  .mode-card b { font-size: .9rem; }
}
/* ---------------- sala ---------------- */
.panel.lobby { width: 1120px; padding: 16px 18px; max-height: calc(100vh - 24px); overflow: auto; }
.lobby-scroll { display: contents; }
.lobby-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.lobby-head h2 { font-size: 1.5rem; margin-bottom: .1em; }
.code { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; color: var(--tx2); font-size: .85rem; }
.code b { font-family: var(--display); font-size: 1.15rem; letter-spacing: .18em; color: var(--acc-hi); }
#lobby-mode-desc { margin: .3em 0 .6em; }
.teams { display: grid; grid-template-columns: 1fr 260px 1fr; gap: 12px; align-items: stretch; margin: .4rem 0; }
.team-col { background: rgba(4,6,14,.45); border: 1px solid var(--line); border-radius: 16px; padding: 10px; }
.team-col h3 { margin: 0 0 8px; padding: .45em .8em; color: #fff; font-size: .82rem; background: linear-gradient(90deg, var(--c), transparent); clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px); }
.team-col .switch { width: 100%; margin-top: 8px; }
.members { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.member { position: relative; display: flex; flex-direction: column; overflow: hidden; min-height: 132px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); --cut: 12px; }
.member.me { box-shadow: inset 0 0 0 2px var(--acc); }
.member.offline { opacity: .5; }
.member .pair { display: flex; align-items: flex-end; justify-content: center; height: 88px; background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(255,122,26,.18), transparent 70%); }
.member canvas { width: 56px; height: 64px; }
.member canvas.mon { width: 72px; height: 72px; }
.member .nm { flex: 1; background: rgba(4,6,14,.6); padding: .35em .55em; font-family: var(--display); font-weight: 700; font-size: .7rem; text-transform: uppercase; line-height: 1.2; }
.member .nm small { display: flex; align-items: center; gap: .3em; color: var(--tx2); font-family: var(--font); font-weight: 500; font-size: .7rem; text-transform: none; }
.member .nm small canvas { width: 16px; height: 16px; flex: none; }
.member .host { position: absolute; top: 6px; left: 8px; font-family: var(--display); font-size: .52rem; font-weight: 700; letter-spacing: .06em; color: var(--acc-ink); background: var(--acc); padding: .2em .55em; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.member .btn.tiny { position: absolute; top: 4px; right: 4px; padding: .1em .5em; }
.member.free { background: transparent; box-shadow: inset 0 0 0 1px var(--line2); align-items: center; justify-content: center; }
.member.free .nm { background: none; color: var(--tx3); text-align: center; flex: none; }
.member .mon.rand { width: 60px; height: 60px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-size: 2rem; color: var(--acc-ink); background: radial-gradient(circle at 40% 35%, var(--acc-hi), var(--acc)); flex: none; }
.ready-tag { position: absolute; right: 6px; bottom: 40px; font-family: var(--display); font-size: .52rem; font-weight: 700; letter-spacing: .06em; padding: .25em .55em; color: #fff; background: rgba(255,71,87,.85); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.ready-tag.on { background: var(--ok); color: #03200f; }
.gb-room-mid { display: flex; flex-direction: column; gap: 8px; padding: 10px; background: rgba(4,6,14,.45); border: 1px solid var(--line); border-radius: 16px; }
.gb-map-name { text-align: center; font-family: var(--display); font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--acc-hi); }
.gb-map-pic { position: relative; height: 112px; border-radius: 12px; overflow: hidden; background: var(--bg3) center / cover no-repeat; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line2); }
.gb-map-pic b { display: none; font-family: var(--display); font-weight: 900; font-size: 2.6rem; color: #fff; text-shadow: 0 0 20px var(--acc-glow); }
.gb-map-pic.random { background: radial-gradient(circle, rgba(255,122,26,.3), transparent 70%), var(--bg3) !important; }
.gb-map-pic.random b { display: block; }
.gb-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(4,6,14,.75); color: #fff; font-size: .75rem; box-shadow: inset 0 0 0 1px var(--line3); }
.gb-arrow:hover { background: var(--acc); color: var(--acc-ink); }
.gb-arrow.l { left: 6px; }
.gb-arrow.r { right: 6px; }
.gb-room-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gb-room-opts label { margin: 0; font-size: .62rem; }
.gb-room-opts select { width: 100%; padding: .4em .5em; font-size: .85rem; }
.vs, .gb-room-mid .vs { margin-top: auto; text-align: center; font-family: var(--display); font-weight: 900; font-size: 2.2rem; font-style: italic; background: linear-gradient(180deg, #fff, var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 12px var(--acc-glow)); }
.gb-lower { display: grid; grid-template-columns: 1fr 300px; gap: 12px; margin-bottom: 10px; }
.gb-picker { display: grid; grid-template-columns: 1fr 220px; gap: 10px; padding: 10px; background: rgba(4,6,14,.45); border: 1px solid var(--line); border-radius: 16px; }
.gb-pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; align-content: start; max-height: 300px; overflow: auto; padding: 2px; }
.gb-tile { aspect-ratio: 1; border: 0; padding: 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); color: var(--tx); --cut: 8px; transition: transform .1s; }
.gb-tile:hover { transform: translateY(-2px); }
.gb-tile canvas { width: 100%; height: auto; flex: 1; min-height: 0; }
.gb-tile img { width: 100%; flex: 1; min-height: 0; object-fit: contain; padding: 3px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.45)); pointer-events: none; }
.gb-tile small { font-size: .55rem; font-weight: 700; line-height: 1.1; white-space: nowrap; text-transform: uppercase; letter-spacing: .02em; }
.gb-tile.sel { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -24px 24px -12px var(--acc-soft); }
.gb-tile.sel2 { box-shadow: inset 0 0 0 2px var(--ok), inset 0 -24px 24px -12px rgba(62,224,122,.18); }
.gb-tile.locked { filter: grayscale(1) brightness(.6); cursor: not-allowed; }
.gb-tile.random { background: linear-gradient(180deg, rgba(255,122,26,.35), rgba(255,122,26,.08)); }
.gb-tile .rand-q { font-family: var(--display); font-weight: 900; font-size: 1.8rem; color: var(--acc-hi); line-height: 1; flex: 1; display: grid; place-items: center; }
.gb-pick-show { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--glass-2); border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.gb-show-name { display: flex; align-items: center; justify-content: space-between; gap: .4em; font-family: var(--display); font-weight: 800; font-size: .85rem; text-transform: uppercase; }
.gb-show-name span { font-family: var(--display); font-size: .52rem; font-weight: 700; padding: .25em .6em; color: #111; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.gb-show-pic { display: grid; place-items: center; height: 120px; border-radius: 10px; background: radial-gradient(ellipse 60% 55% at 50% 72%, rgba(255,122,26,.26), transparent 70%), #0b1020; box-shadow: inset 0 0 0 1px var(--line); }
.gb-show-pic canvas { height: 116px; width: 116px; }
.gb-show-pic img { height: 108px; width: 108px; object-fit: contain; }
.gb-show-pic.rand b { font-family: var(--display); font-weight: 900; font-size: 3rem; color: var(--acc-hi); }
.gb-show-shots { display: grid; gap: 3px; font-size: .74rem; font-weight: 600; }
.gb-show-shots div { display: flex; align-items: center; gap: 6px; }
.gb-show-shots em { font-style: normal; font-family: var(--display); font-weight: 800; font-size: .6rem; color: var(--acc-hi); width: 2.2em; text-align: center; }
.gb-show-shots canvas { width: 18px; height: 18px; }
.gb-show-pas { display: flex; flex-wrap: wrap; gap: 4px; }
.gb-show-pas span { background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 999px; padding: 2px 9px; font-size: .64rem; font-weight: 600; color: var(--tx2); cursor: help; }
.gb-show-txt { font-size: .75rem; color: var(--tx2); margin: 0; }
.gb-tag-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gb-tag-slot { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 6px; text-align: left; padding: 5px 8px; border: 0; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line2); color: var(--tx2); font: inherit; --cut: 7px; }
.gb-tag-slot em { grid-row: span 2; font-style: normal; font-family: var(--display); font-weight: 900; font-size: 1.15rem; color: var(--acc); }
.gb-tag-slot b { font-size: .76rem; color: #fff; }
.gb-tag-slot small { font-size: .6rem; }
.gb-tag-slot.on { box-shadow: inset 0 0 0 2px var(--acc); }
.gb-tag-slot:nth-child(2) em { color: var(--ok); }
.gb-tag-slot:nth-child(2).on { box-shadow: inset 0 0 0 2px var(--ok); }
.lobby-chat, .gb-lower .lobby-chat { margin: 0; display: flex; flex-direction: column; padding: 10px; background: rgba(4,6,14,.45); border: 1px solid var(--line); border-radius: 16px; }
.chat-log { max-height: 190px; min-height: 120px; flex: 1; overflow: auto; font-size: .86rem; display: flex; flex-direction: column; gap: .2em; }
.chat-in { width: 100%; margin-top: .4em; }
.lobby-actions { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; }
.lobby-actions > .host-only > span { color: var(--tx2); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.host-only { display: none; align-items: center; gap: .4em; }
.is-host .host-only { display: flex; }
.is-host .guest-only { display: none; }
.raid-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 12px; border-radius: 14px; background: radial-gradient(ellipse at 50% 40%, rgba(255,90,40,.35), rgba(20,4,0,.9)); box-shadow: inset 0 0 0 1px rgba(255,90,40,.5), 0 0 30px rgba(255,70,40,.3); }
.raid-card small { font-family: var(--display); font-size: .56rem; letter-spacing: .1em; text-transform: uppercase; color: #ffc2ad; }
.raid-card b { font-family: var(--display); font-weight: 900; font-size: 1.4rem; text-transform: uppercase; }
.raid-card p { margin: 0; font-size: .78rem; color: #ffe2d8; }
.raid-card em { font-style: normal; font-family: var(--display); font-weight: 700; font-size: .72rem; color: var(--gold); }
.raid-jefe { width: 190px; height: 190px; }
.panel.lobby.raid .team-col[data-team="1"] h3, .panel.lobby.raid .switch, .panel.lobby.raid .gb-room-opts, .panel.lobby.raid .gb-map, .panel.lobby.raid .lobby-actions .host-only > span, .panel.lobby.raid [data-bot] { display: none; }
.panel.lobby.raid .gb-room-mid { background: transparent; border-color: transparent; }
.panel.lobby.raid .gb-room-mid .vs { font-size: 3rem; }

/* ---------------- partida: HUD ---------------- */
/* Consola de juego en tres piezas (tu Pokemon y disparos / apuntar / objetos y acciones), marcador con
   viento y reloj arriba al centro, orden de turnos con retratos a la izquierda. Todo va dentro de #hud. */
#screen-match { background: #000; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; font-family: var(--font); --dock-h: 130px; }
#hud > * { pointer-events: auto; }
#hud .ui-ico { display: inline-block; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; flex: none; }
#hud kbd { display: inline-block; min-width: 1.5em; padding: 2px 4px 3px; font-family: var(--font); font-size: .52rem; font-weight: 800; line-height: 1; text-align: center; letter-spacing: .02em; color: var(--tx2); background: linear-gradient(180deg, #2b355a, #161d36); border-radius: 3px; box-shadow: inset 0 -1.5px 0 rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.12); }
#hud kbd + kbd { margin-left: 2px; }

/* ---- arriba: marcador de los dos equipos, viento y reloj */
.h-top { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; align-items: flex-start; filter: drop-shadow(0 10px 22px rgba(0,0,0,.5)); }
.ts { --c: var(--team-a); width: 128px; height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 42%, #0b1020), rgba(10,14,26,.94) 92%); box-shadow: inset 0 -2px 0 var(--c); }
.ts.a { clip-path: polygon(0 0, 100% 0, 100% 100%, 16px 100%); padding-left: 10px; }
.ts.b { clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%); padding-right: 10px; }
.ts b { font-family: var(--display); font-weight: 900; font-size: 1.75rem; line-height: 1; color: #fff; text-shadow: 0 0 18px color-mix(in srgb, var(--c) 80%, transparent); font-variant-numeric: tabular-nums; }
.ts span { font-family: var(--display); font-size: .48rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 45%, #fff); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.ts.pop b { animation: tsPop .45s cubic-bezier(.2,1.8,.4,1); }
@keyframes tsPop { from { transform: scale(1.6); } }
.h-core { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 22px 2px; background: linear-gradient(180deg, #1d2546, #0b1020); box-shadow: inset 0 0 0 1px var(--line2), inset 0 -2px 0 rgba(255,255,255,.08); clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 18px 100%); }
.g-wind { display: flex; align-items: center; gap: 8px; }
.g-wind .wnum { display: flex; flex-direction: column; align-items: center; min-width: 2.4em; }
.g-wind .wnum b { font-family: var(--display); font-weight: 900; font-size: 1.45rem; line-height: 1; color: #fff; }
.g-wind .wnum span, .h-mode { font-family: var(--display); font-size: .46rem; font-weight: 700; letter-spacing: .16em; color: var(--tx2); text-transform: uppercase; }
.g-wind.fuerte .wnum b { color: var(--acc-hi); text-shadow: 0 0 14px var(--acc-glow); }
.g-clock .ring { --ring: #fff; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring) calc(var(--p, 1) * 360deg), rgba(255,255,255,.1) 0); transition: background .2s; }
.g-clock .ring b { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 50% 35%, #232c50, #0b1020); font-family: var(--display); font-weight: 900; font-size: 1.15rem; color: #fff; font-variant-numeric: tabular-nums; }
.my-turn .g-clock .ring { --ring: var(--acc); }
.g-clock.low .ring { --ring: var(--bad); animation: pulse .45s infinite alternate; }
.g-clock.low .ring b { color: #ffd0d4; }
.h-mode { position: absolute; top: 68px; left: 50%; transform: translateX(-50%); padding: 3px 12px; background: rgba(5,7,13,.6); border-radius: 20px; white-space: nowrap; pointer-events: none !important; color: var(--tx3); }

/* ---- daño grande arriba a la derecha (como Gunbound) */
.g-dmg { position: absolute; top: 18px; right: 26px; font-family: var(--display); font-size: 4.4rem; font-weight: 900; line-height: 1; background: linear-gradient(180deg, #fff 10%, var(--bad)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 18px rgba(255,71,87,.55)); opacity: 0; transform: scale(.6) rotate(-6deg); transition: opacity .2s, transform .28s cubic-bezier(.2,1.6,.4,1); pointer-events: none !important; }
.g-dmg.show { opacity: 1; transform: scale(1) rotate(-6deg); }
.g-dmg.bad { background: linear-gradient(180deg, #fff 10%, var(--acc)); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 6px 18px var(--acc-glow)); }

/* ---- orden de turnos con retratos */
.g-order { position: absolute; left: 10px; top: 150px; width: 224px; padding: 6px; background: linear-gradient(180deg, rgba(22,28,52,.9), rgba(8,11,22,.9)); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line2), 0 10px 30px rgba(0,0,0,.4); font-size: .76rem; }
.g-order .title { font-family: var(--display); font-size: .48rem; font-weight: 700; letter-spacing: .16em; color: var(--tx3); padding: 2px 6px 6px; }
.g-order .rows { display: flex; flex-direction: column; gap: 4px; }
.ord { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-rows: auto 5px; column-gap: 8px; row-gap: 4px; align-items: center; padding: 4px 8px 5px 4px; background: rgba(255,255,255,.03); box-shadow: inset 3px 0 0 var(--c); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%); transition: background .2s; }
.ord .pic { grid-row: 1 / 3; width: 32px; height: 32px; overflow: hidden; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--el) 60%, transparent), transparent 72%), #10162a; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.ord .pic img { width: 150%; margin: -6% 0 0 -25%; display: block; }
.ord .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 4px; min-width: 0; }
.ord .nm canvas { flex: none; }
.ord .hp { grid-column: 2 / 4; height: 5px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; }
.ord .hp i { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.ord .nm { grid-row: 1; grid-column: 2; }
.ord .dl { grid-row: 1; grid-column: 3; font-family: var(--display); font-size: .56rem; font-weight: 700; color: var(--tx3); font-variant-numeric: tabular-nums; }
.ord.act { background: linear-gradient(90deg, rgba(255,122,26,.26), rgba(255,122,26,.04)); box-shadow: inset 3px 0 0 var(--acc), inset 0 0 0 1px rgba(255,122,26,.45); }
.ord.act .dl { color: var(--acc-hi); }
.ord.me .nm { color: var(--acc-hi); }

/* ---- aviso grande del centro (tu turno, K.O., fin) */
.hud-banner { position: absolute; top: 31%; left: 0; right: 0; text-align: center; opacity: 0; pointer-events: none !important; }
.hud-banner.show { opacity: 1; }
.b-band { position: relative; display: inline-block; padding: .18em 2.4em; background: linear-gradient(90deg, transparent, rgba(5,7,13,.86) 16%, rgba(5,7,13,.86) 84%, transparent); transform: skewX(-12deg); }
.b-band::before, .b-band::after { content: ''; position: absolute; left: 12%; right: 12%; height: 2px; background: linear-gradient(90deg, transparent, var(--acc), transparent); }
.b-band::before { top: 0; } .b-band::after { bottom: 0; }
.b-band.red::before, .b-band.red::after { background: linear-gradient(90deg, transparent, var(--bad), transparent); }
.hud-banner.show .b-band { animation: bandIn .42s cubic-bezier(.2,1,.3,1); }
.b-title { display: inline-block; transform: skewX(12deg); font-family: var(--display); font-weight: 900; font-size: clamp(1.8rem, 5vw, 3.3rem); text-transform: uppercase; letter-spacing: .02em; color: #fff; text-shadow: 0 4px 20px rgba(0,0,0,.7); }
.hud-banner.show .b-title { animation: titleIn .5s cubic-bezier(.2,1,.3,1); }
.b-title.gold { color: var(--acc-hi); text-shadow: 0 0 26px var(--acc-glow); }
.b-title.red { color: var(--bad); }
.b-sub { margin-top: .4em; font-weight: 700; font-size: 1.02rem; color: var(--tx2); text-shadow: 0 2px 6px #000; }
@keyframes bandIn { from { transform: skewX(-12deg) scaleX(0); opacity: 0; } }
@keyframes titleIn { from { transform: skewX(12deg) translateX(-60px); opacity: 0; letter-spacing: .3em; } }

/* ---- barra del jefe */
.g-jefe { position: absolute; left: 50%; top: 96px; transform: translateX(-50%); width: min(560px, 64%); z-index: 5; text-align: center; pointer-events: none !important; }
.g-jefe[hidden] { display: none; }
.g-jefe b { font-family: var(--display); font-weight: 800; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: #ffc2ad; text-shadow: 0 2px 8px #000; }
.g-jefe .bar { height: 12px; margin-top: 4px; background: rgba(0,0,0,.65); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255,90,40,.6), 0 0 20px rgba(255,70,40,.35); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.g-jefe .bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff3b2a, #ff7a1a); transition: width .3s; }

/* ---- consola de abajo */
.h-dock { position: absolute; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 12px; padding: 0 12px 10px; pointer-events: none !important; }
.h-dock > * { pointer-events: auto; background: linear-gradient(180deg, rgba(26,33,62,.94), rgba(9,12,24,.96)); box-shadow: inset 0 0 0 1px var(--line2), inset 0 1px 0 rgba(255,255,255,.1); }
.d-left { justify-self: start; display: flex; align-items: flex-end; gap: 8px; padding: 8px; clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%, 0 14px); }
.d-right { justify-self: end; display: flex; flex-direction: column; align-items: flex-end; gap: 7px; padding: 8px; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.d-mid { justify-self: center; width: min(560px, 42vw); display: flex; flex-direction: column; gap: 6px; padding: 7px 16px 10px; clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%, 0 22px); transition: box-shadow .2s; }
.my-turn .d-mid { box-shadow: inset 0 0 0 1px rgba(255,122,26,.75), inset 0 3px 0 var(--acc), inset 0 30px 40px -30px rgba(255,122,26,.35); }

/* tu Pokemon */
.h-poke { width: 112px; display: flex; flex-direction: column; gap: 5px; }
.pk-frame { --el: var(--acc); position: relative; height: 90px; overflow: hidden; background: radial-gradient(circle at 50% 78%, color-mix(in srgb, var(--el) 62%, transparent), transparent 70%), linear-gradient(180deg, #1c2446, #0a0e1c); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.h-poke .pk-frame { --el: inherit; }
/* el retrato cabe entero en su marco, con aire (antes medía el 112 % del alto y el marco lo cortaba) */
.pk-img { position: absolute; left: 50%; bottom: 5px; height: 84%; width: 88%; object-fit: contain; object-position: 50% 100%; transform: translateX(-50%); filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); pointer-events: none; }
.h-poke.dead .pk-img { filter: grayscale(1) brightness(.6); }
.pk-info { display: flex; flex-direction: column; gap: 3px; }
.pk-name { font-family: var(--display); font-size: .58rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-hp { position: relative; height: 15px; background: rgba(0,0,0,.6); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.pk-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #22b85c, var(--ok) 60%, #a6ffcf); transition: width .3s; }
.pk-hp.low i { background: linear-gradient(90deg, #c0283a, var(--bad)); animation: glow .5s infinite alternate; }
.pk-hp span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: .5rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; font-variant-numeric: tabular-nums; }
.tagbtn { position: absolute; top: 5px; right: 5px; width: 40px; padding: 0 0 3px; border: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; background: rgba(5,7,13,.82); box-shadow: inset 0 0 0 1px var(--ok); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); color: #d6ffe6; }
.tagbtn[hidden] { display: none; }
.tagbtn img { width: 100%; height: 30px; object-fit: cover; object-position: 50% 12%; }
.tagbtn .tg-hp { width: 32px; height: 3px; background: rgba(255,255,255,.15); border-radius: 2px; overflow: hidden; }
.tagbtn .tg-hp i { display: block; height: 100%; background: var(--ok); }
.tagbtn .tg-k { display: flex; align-items: center; gap: 2px; font-size: .7rem; }
.tagbtn:not(:disabled):hover { background: rgba(62,224,122,.25); }
.tagbtn:disabled { opacity: .55; cursor: default; }
.tagbtn.vacio img { filter: grayscale(1) brightness(.5); }

/* disparos 1 / 2 / ULTI */
#hud .shots { display: flex; gap: 6px; }
#hud .shot { --el: var(--acc); position: relative; width: 78px; height: 112px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 0 4px 7px; border: 0; color: var(--tx); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--el) 42%, transparent), transparent 64%), linear-gradient(180deg, #1d2547, #0b1020); box-shadow: inset 0 0 0 1px var(--line2); --cut: 10px; transition: transform .1s, box-shadow .15s; overflow: hidden; }
#hud .shot .k { position: absolute; top: 6px; left: 7px; z-index: 2; }
#hud .shot canvas { margin-bottom: auto; margin-top: 26px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
#hud .shot .n { position: relative; z-index: 2; max-width: 100%; font-size: .6rem; font-weight: 700; line-height: 1.15; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 3px #000; }
#hud .shot:hover:not(:disabled) { transform: translateY(-2px); }
#hud .shot.sel { transform: translateY(-4px); background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--el) 60%, transparent), transparent 66%), linear-gradient(180deg, #3a2a20, #120c08); box-shadow: inset 0 0 0 2px var(--acc), inset 0 -4px 0 var(--acc); }
#hud .shot.sel .n { color: var(--acc-hi); }
#hud .shot:disabled { cursor: default; }
#hud .shot.ult { width: 88px; }
#hud .shot.ult .ult-img { position: absolute; left: 50%; top: 4px; height: 92%; transform: translateX(-50%); z-index: 0; filter: grayscale(.9) brightness(.45); transition: filter .3s; pointer-events: none; }
#hud .shot.ult::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p, 0) * 100%); z-index: 1; background: linear-gradient(0deg, color-mix(in srgb, var(--el) 55%, transparent), color-mix(in srgb, var(--el) 10%, transparent)); box-shadow: inset 0 2px 0 color-mix(in srgb, var(--el) 80%, #fff); transition: height .3s; pointer-events: none; }
#hud .shot.ult .ult-p { position: absolute; top: 6px; right: 6px; z-index: 2; font-family: var(--display); font-size: .5rem; font-weight: 800; color: var(--tx2); text-shadow: 0 1px 2px #000; }
#hud .shot.ult.full .ult-img { filter: none; }
#hud .shot.ult.full::before { height: 0; }
#hud .shot.ult.full { box-shadow: inset 0 0 0 2px var(--gold); animation: ultReady .8s infinite alternate; }
#hud .shot.ult.full .ult-p { color: var(--gold); }
#hud .shot.ult.full.sel { box-shadow: inset 0 0 0 2px var(--gold), inset 0 -4px 0 var(--gold); }
@keyframes ultReady { to { box-shadow: inset 0 0 0 2px var(--gold), inset 0 0 26px rgba(255,210,61,.55); } }

/* apuntar: transportador, potencia y movimiento */
.g-lcd { text-align: center; }
.g-lcd span { display: block; font-family: var(--display); font-weight: 800; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tx2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-lcd span::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--c, var(--tx3)); box-shadow: 0 0 8px var(--c, transparent); vertical-align: 1px; }
.my-turn .g-lcd span { color: var(--acc-hi); }
.g-lcd.alert span { color: var(--bad); animation: pulse .4s infinite alternate; }
.h-aim { display: flex; align-items: center; gap: 14px; }
.g-angle { flex: none; display: flex; align-items: flex-end; gap: 4px; }
.g-angle .anum { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 3.4em; }
.g-angle .anum b { font-family: var(--display); font-weight: 900; font-size: 1.45rem; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
/* el angulo del tiro anterior (el LAST de Gunbound) */
.g-angle .anum .alast { font-style: normal; font-size: .6rem; font-weight: 800; letter-spacing: .05em; color: rgba(255,255,255,.55); min-height: 1em; white-space: nowrap; }
.my-turn .g-angle .anum b { color: var(--acc-hi); text-shadow: 0 0 14px var(--acc-glow); }
.h-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.prow { display: grid; align-items: center; gap: 8px; }
.prow.pow { grid-template-columns: 70px minmax(0, 1fr) 2.2em; }
.prow.mov { grid-template-columns: 70px minmax(0, 1fr) auto; }
.plbl { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 3px 4px; font-family: var(--display); font-size: .48rem; font-weight: 700; letter-spacing: .12em; color: var(--tx3); text-align: right; }
.plbl > span { width: 100%; }
.power-bar { position: relative; height: 26px; border-radius: 6px; background: linear-gradient(180deg, #04060c, #121933); box-shadow: inset 0 0 0 1px var(--line2), inset 0 3px 8px rgba(0,0,0,.7); }
.power-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 6px; overflow: hidden; background: linear-gradient(90deg, #ffd23d, #ff9a1a 45%, #ff4a1a 85%, #ff2d3a); box-shadow: 0 0 18px var(--acc-glow), inset 0 1px 0 rgba(255,255,255,.45); }
.power-bar .fill::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(-55deg, rgba(255,255,255,.22) 0 7px, transparent 7px 15px); background-size: 200% 100%; opacity: 0; }
.power-bar.charging .fill::after { opacity: 1; animation: rayas .5s linear infinite; }
.power-bar.max .fill { animation: glow .18s infinite alternate; }
@keyframes rayas { to { background-position: -30px 0; } }
.power-bar .ticks { position: absolute; inset: 0; border-radius: 6px; pointer-events: none; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(255,255,255,.16) calc(10% - 1px) 10%); }
.power-bar .ticks::after { content: ''; position: absolute; left: 50%; top: 3px; bottom: 3px; width: 2px; margin-left: -1px; background: rgba(255,255,255,.3); }
.power-bar .mark { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; display: none; background: #fff; border-radius: 2px; box-shadow: 0 0 8px #fff, 0 0 2px #000; }
.power-bar .mark em { position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%); padding: 1px 4px; font-style: normal; font-family: var(--display); font-size: .5rem; font-weight: 800; color: #0b1020; background: #fff; border-radius: 3px; white-space: nowrap; }
.pnum { font-family: var(--display); font-weight: 900; font-size: 1.05rem; color: var(--tx); text-align: right; font-variant-numeric: tabular-nums; }
.my-turn .pnum { color: var(--acc-hi); }
.stam-bar { height: 8px; background: rgba(0,0,0,.6); border-radius: 4px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.stam-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #22b85c, var(--ok), #a6ffcf); border-radius: 4px; transition: width .15s; }
.prow .jump { display: flex; align-items: center; gap: 4px; font-family: var(--display); font-size: .46rem; font-weight: 700; letter-spacing: .12em; color: var(--tx3); }
#hud:not(.my-turn) .h-aim { opacity: .8; }

/* objetos y acciones */
#hud .items { display: flex; gap: 6px; }
#hud .item { position: relative; width: 56px; height: 56px; display: grid; place-items: center; border: 0; padding: 0; color: var(--tx); background: radial-gradient(circle at 50% 45%, rgba(255,255,255,.1), transparent 66%), linear-gradient(180deg, #1d2547, #0b1020); box-shadow: inset 0 0 0 1px var(--line2); --cut: 9px; transition: transform .1s; }
#hud .item:hover:not(.empty) { transform: translateY(-2px); }
#hud .item .key { position: absolute; left: 4px; top: 4px; line-height: 0; }
#hud .item .cnt { position: absolute; right: 5px; bottom: 3px; font-family: var(--display); font-size: .62rem; font-weight: 900; color: var(--acc-hi); text-shadow: 0 1px 2px #000; }
#hud .item.empty { opacity: .35; filter: grayscale(.8); }
#hud .item.on { box-shadow: inset 0 0 0 2px var(--ok), inset 0 0 18px rgba(62,224,122,.35); }
.h-tools { display: flex; gap: 5px; }
.tool { position: relative; width: 40px; height: 34px; display: grid; place-items: center; border: 0; padding: 0; font-size: 1.05rem; color: var(--tx); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); transition: background .12s; }
.tool:hover { background: rgba(255,255,255,.14); }
.tool:active { transform: translateY(1px); }
#hud .tool kbd { position: absolute; right: 1px; bottom: 1px; min-width: 0; padding: 1px 2px; font-size: .4rem; }
.tool.red { color: #ffb3ba; background: rgba(255,71,87,.16); box-shadow: inset 0 0 0 1px rgba(255,71,87,.5); }
.tool.red:hover { background: rgba(255,71,87,.3); }

/* emotes, chat y mando tactil, justo encima de la consola */
.hud-emotes { position: absolute; right: 14px; bottom: calc(var(--dock-h) + 12px); display: none; grid-template-columns: repeat(4, 1fr); gap: .3em; padding: .5em; background: var(--glass); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line2); }
.hud-emotes.open { display: grid; animation: rise .2s ease; }
.emote { font-size: 1.25rem; background: rgba(255,255,255,.06); border: 0; border-radius: 10px; padding: .2em .45em; color: #fff; font-weight: 800; }
.emote:hover { background: var(--acc-soft); }
.hud-chat { position: absolute; left: 14px; bottom: calc(var(--dock-h) + 14px); width: min(360px, 60vw); }
.hud-chat .chat-log { max-height: 140px; min-height: 0; }
.hud-chat .chat-line { opacity: .25; transition: opacity .5s; text-shadow: 0 1px 3px #000; font-size: .85rem; }
.hud-chat .chat-line.fresh { opacity: 1; }
.hud-chat .chat-in { background: rgba(5,7,13,.8); }
.hud-chat .chat-in:not(:focus) { opacity: 0; pointer-events: none; height: 0; padding: 0; border: 0; margin: 0; }
.hud-pad { display: none; position: absolute; left: 0; right: 0; bottom: calc(var(--dock-h) + 10px); justify-content: space-between; padding: 0 .8rem; }
.pad-left, .pad-right { display: flex; gap: .55em; align-items: center; }
.pad { width: 60px; height: 60px; border: 0; background: rgba(5,7,13,.7); box-shadow: inset 0 0 0 1px var(--line3); color: #fff; font-size: 1.25rem; font-weight: 800; --cut: 12px; }
.pad:active { background: var(--acc-soft); }
.pad.fire { width: 92px; height: 92px; font-family: var(--display); font-size: .9rem; font-weight: 900; color: var(--acc-ink); background: linear-gradient(180deg, var(--acc-hi), var(--acc) 55%, var(--acc-lo)); box-shadow: none; --cut: 18px; }
.spectate .hud-pad, .spectate .hud-emotes, .spectate .hud-chat { display: none; }
.spectate .shots, .spectate .items, .spectate .tagbtn { pointer-events: none; }
@media (pointer: coarse) { .hud-pad { display: flex; } #hud kbd { display: none; } }

/* pantallas medianas */
@media (max-width: 1180px) {
  .d-mid { width: min(470px, 44vw); padding-inline: 12px; }
  .h-poke { width: 96px; }
  .pk-frame { height: 80px; }
  #hud .shot { width: 68px; height: 100px; }
  #hud .shot.ult { width: 76px; }
  #hud .item { width: 48px; height: 48px; }
  .tool { width: 34px; }
  .prow.pow, .prow.mov { grid-template-columns: 58px minmax(0, 1fr) auto; }
  .g-angle .anum { min-width: 2.8em; }
}
/* tablet en vertical y movil: consola en dos filas */
@media (max-width: 900px) {
  .h-dock { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'l r' 'm m'; gap: 6px; padding: 0 8px 8px; }
  .d-left { grid-area: l; padding: 6px; }
  .d-right { grid-area: r; padding: 6px; }
  .d-mid { grid-area: m; width: 100%; }
  .g-order, .hud-chat, .h-mode { display: none; }
  .ts { width: 96px; }
  .g-dmg { font-size: 3rem; top: 80px; right: 14px; }
}
@media (max-width: 560px) {
  .h-poke { width: 74px; }
  .pk-frame { height: 64px; }
  .pk-name { font-size: .5rem; }
  #hud .shots { gap: 4px; }
  #hud .shot { width: 56px; height: 82px; }
  #hud .shot.ult { width: 62px; }
  #hud .shot canvas { width: 34px !important; height: 34px !important; margin-top: 22px; }
  #hud .shot .n { font-size: .5rem; }
  .d-right { flex-direction: column; }
  #hud .item { width: 42px; height: 42px; }
  .h-tools { display: grid; grid-template-columns: repeat(3, 32px); gap: 4px; }
  .tool { width: 32px; height: 30px; font-size: .95rem; }
  .ts { width: 74px; }
  .ts b { font-size: 1.35rem; }
  .h-core { padding: 0 14px; gap: 8px; }
  .g-wind canvas { width: 60px !important; }
  .g-angle canvas { width: 72px !important; height: 44px !important; }
}
/* movil en horizontal (poca altura): una sola fila y sin nombres */
@media (max-height: 500px) and (min-width: 560px) {
  .h-dock { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: none; padding: 0 6px 6px; gap: 6px; }
  .d-left, .d-mid, .d-right { grid-area: auto; }
  .d-mid { width: auto; padding: 5px 10px 7px; gap: 4px; }
  .pk-info { display: none; }
  .h-poke { width: 64px; }
  .pk-frame { height: 70px; }
  #hud .shot { width: 54px; height: 70px; }
  #hud .shot.ult { width: 58px; }
  #hud .shot .n { display: none; }
  #hud .shot canvas { width: 32px !important; height: 32px !important; margin: 18px 0 auto; }
  .g-angle { display: none; }
  .g-lcd span { font-size: .56rem; }
  #hud .item { width: 40px; height: 40px; }
  .tool { width: 32px; height: 28px; }
  .g-order, .h-mode { display: none; }
  .h-core { height: 52px; }
  .ts { height: 44px; width: 84px; }
  .g-clock .ring { width: 42px; height: 42px; }
  .g-clock .ring b { width: 33px; height: 33px; font-size: .95rem; }
}
.labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

/* ---------------- resultados ---------------- */
#screen-result { background: radial-gradient(ellipse at 50% 0%, rgba(255,122,26,.12), transparent 60%), var(--bg0); }
.panel.result, .panel.result.gb-end { width: 980px; padding: 20px 22px; text-align: center; animation: rise .45s ease both; }
.gb-end-title { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 5vw, 3.2rem); text-transform: uppercase; letter-spacing: .02em; margin-bottom: .05em; text-shadow: 0 0 40px rgba(255,122,26,.25); }
.gb-end-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 14px 0; text-align: left; }
.gb-end-col { border-radius: 16px; overflow: hidden; background: rgba(4,6,14,.5); border: 1px solid var(--line); }
.gb-end-col.win { border-color: rgba(255,122,26,.45); box-shadow: 0 0 30px rgba(255,122,26,.12); }
.gb-end-head { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px; }
.gb-end-col.win .gb-end-head { background: linear-gradient(90deg, transparent, rgba(255,122,26,.28), transparent); }
.gb-end-head b { font-family: var(--display); font-weight: 900; font-size: 1.5rem; letter-spacing: .12em; min-width: 4.5ch; text-align: center; }
.gb-end-col.win .gb-end-head b { color: var(--acc-hi); }
.gb-end-col.lose .gb-end-head b { color: var(--tx3); }
.end-ico { width: 38px; height: 38px; }
.gb-end-list { padding: 10px; display: grid; gap: 8px; min-height: 160px; align-content: start; }
.gb-end-row { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); --cut: 9px; }
.gb-end-row.me { box-shadow: inset 0 0 0 2px var(--acc); }
.gb-end-team { font-family: var(--display); font-weight: 900; font-size: 1.1rem; text-align: center; color: var(--team-a); }
.gb-end-row.b .gb-end-team { color: var(--team-b); }
.gb-end-name b { display: block; font-weight: 700; font-size: .95rem; }
.gb-end-name small { color: var(--tx2); font-weight: 500; font-size: .74rem; }
.gb-end-pts { text-align: right; font-family: var(--display); line-height: 1.15; }
.gb-end-pts b { display: block; font-size: .95rem; }
.gb-end-pts span { font-size: .85rem; color: var(--gold); }
.rewards { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: .6rem 0; }
.reward { min-width: 130px; padding: .7em 1.1em; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); font-size: .74rem; font-weight: 600; color: var(--tx2); text-transform: uppercase; letter-spacing: .05em; animation: rise .4s ease both; }
.reward b { display: block; font-family: var(--display); font-weight: 900; font-size: 1.35rem; color: var(--tx); text-transform: none; letter-spacing: 0; }
.reward.up { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -30px 30px -18px var(--acc-soft); color: var(--acc-hi); }
.reward.up b { color: var(--acc-hi); }
.res-table { width: 100%; border-collapse: collapse; margin: .8rem 0; font-size: .92rem; }
.res-table th { color: var(--tx3); font-family: var(--display); font-weight: 700; font-size: .55rem; text-transform: uppercase; letter-spacing: .1em; padding: .5em; text-align: left; }
.res-table td { padding: .5em; border-top: 1px solid var(--line); text-align: left; }
.res-table tr.me td { background: var(--acc-soft); }
.res-table .tm { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: .4em; }

/* ---------------- modales ---------------- */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(2,3,8,.7); backdrop-filter: blur(6px); z-index: 50; padding: 1rem; }
.modal.open { display: flex; }
/* Ranking POKEBOOM (Puntos de Liga) a lo ancho del modal */
.rk-liga { grid-column: 1 / -1; }
.reward.liga b { color: #d9b8ff; }
/* la recarga de BOOM se abre desde la tienda: va por encima de ella */
#modal-creador { z-index: 60; }
.modal.open .box { animation: pop .28s cubic-bezier(.2,1.3,.4,1); }
@keyframes pop { from { transform: translateY(10px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.box { padding: 1.3rem 1.5rem; width: 440px; max-width: 100%; max-height: 94vh; overflow: auto; }
.box h2 { font-size: 1.25rem; }
.box.lg { width: 760px; }
.box.xl { width: 1100px; }
.box-head { display: flex; align-items: center; gap: 1em; margin-bottom: .8em; }
.box-head h2 { flex: 1; margin: 0; }
.help p { margin: .7em 0; line-height: 1.5; color: var(--tx2); }
.help b { color: var(--tx); }

/* Con amigos: crear sala (con el interruptor Publica), unirse con codigo y las salas publicas */
.am-box { width: 470px; display: flex; flex-direction: column; gap: 10px; }
.am-box .box-head { margin-bottom: 2px; }
.am-parte { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: rgba(255,255,255,.03); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.am-parte h3 { margin: 0; font-size: .8rem; }
.am-parte .hint { margin: 0; font-size: .76rem; }
.am-fila { display: flex; align-items: center; gap: 10px; }
.am-fila > .btn { flex: none; min-height: 46px; min-width: 112px; }
.am-codigo { flex: 1; min-width: 0; height: 46px; text-align: center; text-transform: uppercase; letter-spacing: .24em; font-family: var(--display); font-size: 1.15rem; }
.am-sw { flex: 1; min-width: 0; display: flex; flex-direction: row; align-items: center; gap: 10px; margin: 0; text-transform: none; letter-spacing: 0; font-size: .84rem; font-weight: 600; line-height: 1.25; color: var(--tx); cursor: pointer; }
.am-sw input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.am-sw-pista { position: relative; flex: none; width: 46px; height: 26px; border-radius: 13px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px var(--line2); transition: background .15s; }
.am-sw-pista::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transition: transform .18s cubic-bezier(.2,1.3,.4,1); }
.am-sw input:checked + .am-sw-pista { background: var(--acc); box-shadow: none; }
.am-sw input:checked + .am-sw-pista::after { transform: translateX(20px); }
.am-sw input:focus-visible + .am-sw-pista { outline: 2px solid var(--acc-hi); outline-offset: 2px; }
.am-salas .card-head { margin: 0; }
.am-salas .btn.tiny { width: 40px; height: 36px; padding: 0; display: grid; place-items: center; }
.lobby-list { display: flex; flex-direction: column; gap: .4em; min-height: 40px; max-height: 240px; overflow: auto; overscroll-behavior: contain; }
.lobby-list .hint { margin: .2em 0; font-size: .78rem; }
.lobby-row { display: flex; align-items: center; gap: .6em; background: rgba(255,255,255,.04); padding: .45em .6em; box-shadow: inset 0 0 0 1px var(--line); --cut: 7px; }
.lobby-row b { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby-row .mode { color: var(--tx2); font-size: .76rem; white-space: nowrap; }
.lobby-row .btn.tiny { min-height: 38px; padding-inline: .9em; }
@media (max-width: 420px) {
  .am-parte { padding: 10px 12px; }
  .am-fila > .btn { min-width: 92px; padding-inline: .9em; }
}

/* vestuario: tienda, mis prendas y sets (js/vestuario.js). Cada prenda lleva el color de su rareza en --r */
.tn-modal { padding: 12px; }
.box.tn { width: min(1520px, 100%); height: min(920px, calc(100dvh - 24px)); max-height: none; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.tn-cab { flex: none; display: flex; align-items: center; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,122,26,.08), transparent); }
.tn-titulo small { display: block; font-family: var(--display); font-size: .5rem; font-weight: 700; letter-spacing: .2em; color: var(--acc-hi); }
.tn-titulo h2 { margin: 0; font-size: 1.35rem; font-style: italic; }
.tn-tabs { display: flex; gap: 6px; }
.tn-tab { position: relative; display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: 0 16px; border: 0; color: var(--tx2); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line2); font-family: var(--display); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; --cut: 9px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: background .15s, color .15s; }
.tn-tab:hover { color: var(--tx); background: rgba(255,255,255,.09); }
.tn-tab .ui-ico { font-size: 1.15rem; }
.tn-tab em { min-width: 20px; height: 18px; padding: 0 5px; display: grid; place-items: center; font-style: normal; font-size: .58rem; color: var(--tx); background: rgba(255,255,255,.12); border-radius: 9px; }
.tn-tab.on { color: var(--acc-ink); background: linear-gradient(180deg, var(--acc-hi), var(--acc)); box-shadow: none; }
.tn-tab.on em { background: rgba(0,0,0,.2); color: var(--acc-ink); }
.tn-saldo { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tn-saldo .cur { height: 38px; }
.tn-saldo .gb-recarga { min-height: 38px; color: #d6ffe6; box-shadow: inset 0 0 0 1px rgba(62,224,122,.5); }
.tn-x { flex: none; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; font-size: 1.1rem; color: var(--tx2); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line2); }
.tn-x:hover { color: #fff; background: rgba(255,71,87,.3); }
.tn-cuerpo { position: relative; flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0, 1fr) 340px; gap: 14px; padding: 14px 16px 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* tu entrenador */
.tn-prev { display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding-right: 2px; }
.tn-escena { position: relative; flex: none; aspect-ratio: 360 / 460; background: radial-gradient(ellipse 60% 40% at 50% 84%, rgba(255,122,26,.35), transparent 70%), repeating-conic-gradient(from 0deg at 50% 70%, rgba(255,179,71,.06) 0deg 6deg, transparent 6deg 18deg), linear-gradient(180deg, #1a2342, #0b0f1d); box-shadow: inset 0 0 0 1px var(--line3); --cut: 16px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.tn-escena canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tn-probando { position: absolute; top: 10px; left: 12px; z-index: 1; font-family: var(--display); font-size: .56rem; font-weight: 900; letter-spacing: .12em; color: var(--acc-ink); padding: .4em .8em; background: linear-gradient(90deg, var(--acc-hi), var(--acc)); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); animation: glow .8s ease-in-out infinite alternate; }
.tn-base { position: absolute; right: 8px; top: 8px; z-index: 1; display: flex; gap: 3px; padding: 3px; background: rgba(4,6,14,.8); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line2); }
.tn-gen { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; white-space: nowrap; font-size: .74rem; font-weight: 700; color: var(--tx2); background: none; }
.tn-gen.on { color: var(--acc-ink); background: linear-gradient(180deg, var(--acc-hi), var(--acc)); }
.tn-reset { min-height: 40px; }
.tn-bloque h4 { margin: 0 0 6px; font-family: var(--display); font-size: .56rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tx3); }
.tn-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tn-st { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 4px 7px; font-size: .66rem; font-weight: 600; color: var(--tx2); background: rgba(255,255,255,.03); border-radius: 8px; }
.tn-st span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-st b { font-family: var(--display); font-size: .74rem; color: var(--tx); }
.tn-st.cero { opacity: .5; }
.tn-st.up { background: rgba(62,224,122,.14); } .tn-st.up b { color: var(--ok); }
.tn-st.down { background: rgba(255,71,87,.14); } .tn-st.down b { color: var(--bad); }
.tn-llevas, .tn-det-piezas { display: flex; flex-direction: column; gap: 5px; }
.tn-ll { --r: var(--line3); position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; padding: 4px 8px 4px 4px; border: 0; text-align: left; color: var(--tx); background: rgba(255,255,255,.03); box-shadow: inset 3px 0 0 var(--r), inset 0 0 0 1px var(--line); border-radius: 0 10px 10px 0; }
button.tn-ll:hover { background: rgba(255,255,255,.07); }
.tn-ll-ico { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; background: rgba(0,0,0,.3); color: var(--gold); }
.tn-ll-ico canvas { width: 38px; height: 38px; }
.tn-ll small { display: block; font-family: var(--display); font-size: .5rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.tn-ll b { display: block; font-size: .78rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-ll em { display: block; font-style: normal; font-size: .62rem; color: var(--bad); }
.tn-ll.vacio { opacity: .55; }
.tn-ll.vacio .tn-ll-ico { background: repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 4px, transparent 4px 8px); }
.tn-ll.prueba { background: linear-gradient(90deg, rgba(255,122,26,.22), rgba(255,122,26,.03)); }
.tn-ll.prueba small { color: var(--acc-hi); }
.tn-ll.set { --r: var(--gold); }
.tn-ll.set b { white-space: normal; font-size: .7rem; color: var(--gold); }
.tn-ll-x { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--tx2); background: rgba(255,255,255,.06); }
.tn-ll-x:hover { color: #fff; background: rgba(255,71,87,.3); }
.tn-ll-est { font-family: var(--display); font-weight: 800; font-size: .66rem !important; color: var(--tx3) !important; }
.tn-ll-est.si { color: var(--ok) !important; }

/* filtros y rejilla */
.tn-centro { display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 10px; }
.tn-filtros { display: flex; flex-direction: column; gap: 8px; }
.tn-slots { display: flex; gap: 6px; }
.tn-slot { flex: 1; min-width: 64px; min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; border: 0; color: var(--tx2); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line2); --cut: 9px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.tn-slot small { font-family: var(--display); font-size: .5rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.tn-slot .tn-todo { width: 30px; height: 30px; display: grid; place-items: center; font-size: 1.2rem; }
.tn-slot:hover { background: rgba(255,255,255,.08); color: var(--tx); }
.tn-slot.on { color: var(--acc-hi); background: linear-gradient(180deg, rgba(255,122,26,.26), rgba(255,122,26,.06)); box-shadow: inset 0 0 0 2px var(--acc); }
.tn-fila { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tn-rarezas { display: flex; gap: 5px; flex-wrap: wrap; }
.tn-rz { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 13px; border: 0; border-radius: 999px; font-size: .74rem; font-weight: 700; color: var(--tx2); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap; }
.tn-rz i { width: 10px; height: 10px; border-radius: 50%; background: var(--r); box-shadow: 0 0 8px color-mix(in srgb, var(--r) 70%, transparent); }
.tn-rz:hover { color: var(--tx); }
.tn-rz.on { color: #fff; background: color-mix(in srgb, var(--r) 24%, transparent); box-shadow: inset 0 0 0 2px var(--r); }
.tn-buscar { position: relative; flex: 1 1 170px; display: flex; align-items: center; margin: 0; text-transform: none; letter-spacing: 0; }
.tn-buscar .ui-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--tx3); pointer-events: none; }
.tn-buscar input { width: 100%; min-height: 40px; padding-left: 36px; border-radius: 999px; font-size: .88rem; }
.tn-orden { margin: 0; }
.tn-orden select { min-height: 40px; border-radius: 999px; font-size: .82rem; padding: 0 12px; }
.tn-info { display: flex; align-items: center; gap: 14px; font-size: .72rem; font-weight: 600; color: var(--tx3); }
.tn-urge { display: inline-flex; align-items: center; gap: 5px; color: #ff9aa4; }
.tn-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); grid-auto-rows: max-content; gap: 10px; align-content: start; padding: 2px 6px 10px 2px; overscroll-behavior: contain; }
.tn-item { --r: #9aa4b2; position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 8px; border: 0; text-align: left; color: var(--tx); background: linear-gradient(180deg, color-mix(in srgb, var(--r) 16%, #141b34), #0b1020 72%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 30%, transparent), inset 0 -3px 0 var(--r); --cut: 12px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: transform .12s, box-shadow .15s; }
.tn-item:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px var(--r), inset 0 -3px 0 var(--r); }
.tn-item.sel { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -3px 0 var(--r), inset 0 -40px 40px -24px var(--acc-soft); }
.tn-item.r-legendario .tn-marco::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,230,150,.22) 50%, transparent 70%); background-size: 250% 100%; animation: tnBrillo 3.2s ease-in-out infinite; pointer-events: none; }
@keyframes tnBrillo { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.tn-rar { font-family: var(--display); font-size: .46rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--r) 75%, #fff); }
.tn-marco { position: relative; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; border-radius: 10px; background: radial-gradient(ellipse 60% 55% at 50% 58%, color-mix(in srgb, var(--r) 32%, transparent), transparent 72%), rgba(0,0,0,.28); }
.tn-pic { width: 100%; height: 100%; }
.tn-item.set .tn-marco { aspect-ratio: 170 / 196; }
.tn-nm { font-weight: 700; font-size: .78rem; line-height: 1.15; min-height: 2.3em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tn-mods { display: flex; flex-wrap: wrap; gap: 4px 8px; min-height: 14px; font-family: var(--display); font-size: .6rem; font-weight: 800; }
.tn-mods > span { display: inline-flex; align-items: center; gap: 3px; }
.tn-mods .up { color: var(--ok); } .tn-mods .down { color: var(--bad); }
.tn-mods .est { font-family: var(--font); font-weight: 600; color: var(--tx3); }
.tn-mods .bonus { font-family: var(--font); font-weight: 700; font-size: .62rem; color: var(--gold); line-height: 1.2; }
.tn-pie { display: flex; align-items: center; gap: 6px; min-height: 20px; font-family: var(--display); font-size: .72rem; font-weight: 800; }
.tn-pie b { display: inline-flex; align-items: center; gap: 4px; }
.tn-pie.precio b.oro { color: var(--gold); }
.tn-pie.precio b.boom { margin-left: auto; color: var(--acc-hi); }
.tn-pie.puesto { color: var(--ok); }
.tn-pie.tuyo { color: #9fe6b8; }
.tn-pie.temp { color: var(--acc-hi); }
.tn-pie.urge { color: var(--bad); }
.tn-mon { flex: none; width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-size: .42rem; font-weight: 900; }
.tn-mon.oro { background: radial-gradient(circle at 35% 30%, #fff1a6, #ffc21e 60%, #c78a00); color: #3a2400; }
.tn-mon.oro::before { content: 'G'; }
.tn-mon.boom { background: radial-gradient(circle at 35% 30%, var(--acc-hi), var(--acc) 60%, var(--acc-lo)); color: var(--acc-ink); }
.tn-mon.boom::before { content: 'B'; }
.tn-item.puesto { box-shadow: inset 0 0 0 2px var(--ok), inset 0 -3px 0 var(--r); }
.tn-item.puesto.sel { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -3px 0 var(--ok); }
.tn-item.sin-arte .tn-marco { opacity: .5; }
.tn-piezas { position: absolute; top: 7px; right: 8px; z-index: 1; font-family: var(--display); font-size: .6rem; font-weight: 900; padding: .25em .6em; color: var(--tx); background: rgba(4,6,14,.8); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line2); }
.tn-piezas.todas { color: #03200f; background: var(--ok); }
/* estrella de las piezas que son de un set (las sueltas no la llevan) */
.tn-enset { position: absolute; top: 7px; right: 8px; z-index: 1; display: grid; place-items: center; width: 18px; height: 18px; font-size: .62rem; color: #ffd36a; background: rgba(4,6,14,.75); border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,211,106,.45); }
.tn-vacio { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 50px 20px; text-align: center; color: var(--tx3); }
.tn-vacio .ui-ico { font-size: 2.4rem; color: var(--tx3); }
.tn-vacio p { max-width: 36ch; margin: 0; }

/* la prenda elegida */
.tn-detalle { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2); border-radius: 16px; }
.tn-det-vacio { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; color: var(--tx3); padding: 20px; }
.tn-det-vacio .ui-ico { font-size: 2.6rem; color: var(--acc); opacity: .6; }
.tn-det-vacio b { color: var(--tx2); font-family: var(--display); font-size: .8rem; text-transform: uppercase; }
.tn-det-vacio p { margin: 0; font-size: .8rem; }
.tn-hoja-x, .tn-velo { display: none; }
.tn-det-top { --r: #9aa4b2; position: relative; flex: none; display: grid; place-items: center; padding: 30px 10px 10px; background: radial-gradient(ellipse 60% 55% at 50% 60%, color-mix(in srgb, var(--r) 38%, transparent), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--r) 12%, #141b34), #0b1020); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--r) 40%, transparent), inset 0 -3px 0 var(--r); --cut: 14px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.tn-det-top .tn-rar { position: absolute; top: 10px; left: 12px; font-size: .52rem; padding: .35em .7em; color: #fff; background: color-mix(in srgb, var(--r) 55%, #000); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.tn-ranura { position: absolute; top: 8px; right: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: .66rem; font-weight: 700; color: var(--tx2); }
.tn-ranura .ui-ico { color: var(--gold); }
.tn-det-pic { width: min(78%, 260px); height: auto; aspect-ratio: 1; }
.tn-det-pic.set { aspect-ratio: 300 / 340; width: min(70%, 230px); }
.tn-det-ent { display: none; }
.tn-det-nm { margin: 0; font-size: 1.15rem; line-height: 1.15; }
.tn-estado { display: flex; align-items: center; gap: 6px; margin: 0; font-size: .8rem; font-weight: 700; color: var(--tx2); }
.tn-estado.puesto { color: var(--ok); }
.tn-estado.tuyo { color: #9fe6b8; }
.tn-estado.temp { color: var(--acc-hi); }
.tn-estado.urge { color: #ff9aa4; }
.tn-det-stats { display: grid; gap: 4px; }
.tn-det-stats > div { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 9px; font-size: .78rem; font-weight: 600; background: rgba(255,255,255,.03); border-radius: 8px; }
.tn-det-stats b { font-family: var(--display); font-size: .82rem; }
.tn-det-stats .up b { color: var(--ok); } .tn-det-stats .down b { color: var(--bad); }
.tn-est { margin: 0; font-size: .78rem; color: var(--tx3); }
.tn-bonus { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: .8rem; font-weight: 700; color: var(--gold); }
.tn-del-set { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 10px; border: 0; text-align: left; color: var(--tx); background: rgba(255,210,61,.07); box-shadow: inset 0 0 0 1px rgba(255,210,61,.3); border-radius: 10px; }
.tn-del-set:hover { background: rgba(255,210,61,.13); }
.tn-del-set > .ui-ico { color: var(--gold); font-size: 1.1rem; }
.tn-del-set small { display: block; font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tx3); }
.tn-del-set b { display: block; font-size: .82rem; }
.tn-del-set em { display: block; font-style: normal; font-size: .68rem; color: var(--gold); }
.tn-acts { display: flex; gap: 8px; }
.tn-acts .btn { flex: 1; min-height: 44px; }
.tn-planes { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.tn-planes h4 { margin: 0 0 2px; font-family: var(--display); font-size: .56rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tx3); }
.tn-plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 6px 14px; border: 0; color: #fff; text-align: left; background: rgba(255,210,61,.08); box-shadow: inset 0 0 0 1px rgba(255,210,61,.35); --cut: 10px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: filter .15s, transform .08s; }
.tn-plan:hover:not(:disabled) { filter: brightness(1.2); }
.tn-plan:active:not(:disabled) { transform: scale(.98); }
.tn-plan:disabled { opacity: .42; cursor: not-allowed; }
.tn-plan.boom { background: linear-gradient(90deg, rgba(255,122,26,.34), rgba(255,122,26,.12)); box-shadow: inset 0 0 0 1px var(--acc); }
.tn-plan-nm { display: flex; flex-direction: column; font-size: .86rem; font-weight: 700; }
.tn-plan-nm small { font-family: var(--display); font-size: .5rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tx3); }
.tn-plan b { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 1.05rem; font-weight: 900; }
.tn-plan.oro b { color: var(--gold); }
.tn-plan.boom b { color: var(--acc-hi); }
.tn-plan .tn-mon { width: 18px; height: 18px; font-size: .5rem; }

/* pantallas medianas */
@media (max-width: 1280px) { .tn-cuerpo { grid-template-columns: 250px minmax(0, 1fr) 300px; } .tn-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); } }
/* tableta y movil en horizontal: la prenda elegida es un panel que entra por la derecha */
/* tableta y movil en horizontal: la columna de la prenda solo aparece al elegir una, y la rejilla se estrecha
   para dejarle sitio (nada queda debajo de nada) */
@media (max-width: 1060px), (max-height: 520px) {
  .tn-cuerpo { grid-template-columns: 220px minmax(0, 1fr); }
  .tn-detalle { display: none; }
  .tn-cuerpo.con-detalle { grid-template-columns: 200px minmax(0, 1fr) minmax(250px, 300px); }
  .tn-cuerpo.con-detalle .tn-detalle { display: flex; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .tn-modal { padding: 0; }
  .box.tn { width: 100%; height: 100dvh; border-radius: 0; }
  .box.tn::before { display: none; }
  .tn-cab { gap: 8px; padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); }
  .tn-titulo { display: none; }
  .tn-tab { min-height: 40px; padding: 0 11px; font-size: .62rem; }
  .tn-saldo { gap: 5px; }
  .tn-saldo .cur { height: 34px; font-size: .74rem; }
  .tn-saldo .cur-ico { width: 22px; height: 22px; font-size: .58rem; }
  .tn-saldo .gb-recarga { min-height: 34px; padding: .3em .7em; font-size: .7rem; }
  .tn-x { width: 40px; height: 40px; }
  .tn-cuerpo { grid-template-columns: 150px minmax(0, 1fr); gap: 8px; padding: 8px max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
  .tn-cuerpo.con-detalle { grid-template-columns: 124px minmax(0, 1fr) minmax(230px, 270px); }
  .tn-cuerpo.con-detalle .tn-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .tn-prev { gap: 6px; }
  .tn-gen { min-height: 30px; padding: 0 9px; font-size: .62rem; }
  .tn-base { top: auto; bottom: 4px; right: 50%; transform: translateX(50%); }
  .tn-probando { top: 6px; left: 6px; font-size: .44rem; }
  .tn-stats { grid-template-columns: 1fr; }
  .tn-st { padding: 2px 6px; font-size: .58rem; }
  .tn-bloque h4 { font-size: .46rem; margin-bottom: 4px; }
  .tn-ll { grid-template-columns: 30px minmax(0, 1fr) auto; min-height: 40px; gap: 6px; }
  .tn-ll-ico { width: 30px; height: 30px; }
  .tn-ll-ico canvas { width: 28px; height: 28px; }
  .tn-ll b { font-size: .64rem; }
  .tn-filtros { gap: 5px; }
  .tn-slots { gap: 4px; }
  .tn-slot { min-height: 40px; flex-direction: row; gap: 5px; }
  .tn-slot canvas { width: 22px !important; height: 22px !important; }
  .tn-slot .tn-todo { width: 22px; height: 22px; font-size: 1rem; }
  .tn-slot small { font-size: .44rem; }
  .tn-fila { gap: 5px; flex-wrap: nowrap; }
  .tn-rarezas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 0 1 auto; min-width: 0; }
  .tn-rz { min-height: 36px; padding: 0 10px; font-size: .64rem; }
  .tn-buscar { flex: 1 0 126px; min-width: 126px; }
  .tn-buscar input, .tn-orden select { min-height: 38px; }
  .tn-orden { flex: 0 1 150px; min-width: 0; }
  .tn-orden select { width: 100%; text-overflow: ellipsis; }
  /* el filtro de sueltas o de set, solo lo que mide su texto: el orden se queda el resto */
  #lk-origen-et { flex: 0 0 auto; }
  #lk-origen-et select { width: auto; }
  .tn-info { display: none; }
  .tn-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 7px; }
  .tn-item { padding: 6px; gap: 3px; --cut: 9px; }
  .tn-nm { font-size: .66rem; }
  .tn-pie { font-size: .62rem; }
  .tn-detalle { padding: 10px; gap: 7px; border-radius: 12px; }
  .tn-det-top { padding-top: 26px; }
  .tn-det-pic { width: min(52%, 150px); }
  .tn-det-pic.set { width: min(46%, 130px); }
  .tn-det-nm { font-size: .95rem; }
  .tn-plan { min-height: 44px; padding: 4px 12px; }
}
/* movil en vertical: todo a pantalla completa en una columna y la prenda en una hoja que sube desde abajo */
@media (max-width: 700px) and (min-height: 521px) {
  .tn-modal { padding: 0; }
  .box.tn { width: 100%; height: 100dvh; border-radius: 0; }
  .box.tn::before { display: none; }
  .tn-cab { flex-wrap: wrap; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; }
  .tn-titulo h2 { font-size: 1.1rem; }
  .tn-tabs { order: 3; flex: 1 1 100%; }
  .tn-tab { flex: 1; justify-content: center; padding: 0 6px; font-size: .62rem; }
  .tn-saldo { gap: 5px; }
  .tn-saldo .cur { height: 34px; font-size: .74rem; padding-right: .7em; }
  .tn-saldo .cur-ico { width: 22px; height: 22px; font-size: .58rem; }
  .tn-saldo .gb-recarga { min-height: 34px; padding: .3em .6em; font-size: .68rem; }
  .tn-x { width: 40px; height: 40px; }
  .tn-cuerpo { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .tn-titulo { display: none; }
  .tn-tab { white-space: nowrap; }
  .tn-prev { flex: none; display: grid; grid-template-columns: 130px minmax(0, 1fr); grid-template-areas: "esc llevas" "esc reset" "stats stats"; gap: 8px 10px; overflow: visible; }
  .tn-escena { grid-area: esc; align-self: start; }
  .tn-prev .b-llevas { grid-area: llevas; }
  .tn-reset { grid-area: reset; min-height: 40px; align-self: end; }
  .tn-prev .b-stats { grid-area: stats; }
  .tn-base { top: auto; bottom: 6px; right: 50%; transform: translateX(50%); }
  .tn-gen { min-height: 30px; padding: 0 8px; font-size: .6rem; }
  .tn-probando { top: 6px; left: 6px; font-size: .46rem; }
  .tn-llevas { gap: 4px; }
  .tn-ll { grid-template-columns: 32px minmax(0, 1fr) auto; min-height: 40px; gap: 6px; }
  .tn-ll-ico { width: 32px; height: 32px; }
  .tn-ll-ico canvas { width: 30px; height: 30px; }
  .tn-ll small { font-size: .44rem; }
  .tn-ll b { font-size: .7rem; }
  .tn-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
  .tn-st { padding: 3px 6px; font-size: .56rem; }
  .tn-st.cero { display: none; }
  .tn-centro { flex: none; min-height: auto; }
  .tn-slots { overflow-x: auto; scrollbar-width: none; }
  .tn-slot { min-width: 66px; }
  .tn-rarezas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; }
  .tn-grid { overflow: visible; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .tn-item { padding: 6px; }
  .tn-nm { font-size: .7rem; }
  .tn-pie { font-size: .64rem; }
  .tn-pie.precio { flex-wrap: wrap; row-gap: 2px; }
  .tn-detalle { position: fixed; z-index: 70; left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 82dvh; padding: 14px 14px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; transform: translateY(105%); box-shadow: 0 -20px 60px rgba(0,0,0,.65), inset 0 1px 0 var(--line3); }
  .tn-detalle.abierta { transform: none; }
  .tn-cuerpo.con-detalle .tn-detalle { display: flex; }
  .tn-velo { display: block; position: fixed; inset: 0; z-index: 69; background: rgba(2,3,8,.6); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .tn-velo.on { opacity: 1; pointer-events: auto; }
  .tn-hoja-x { display: grid; place-items: center; align-self: flex-end; flex: none; width: 40px; height: 40px; margin: -4px -4px -8px 0; padding: 0; border: 0; border-radius: 50%; font-size: 1rem; color: #fff; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px var(--line3); }
  .tn-det-top { grid-template-columns: 1fr 1fr; padding-top: 34px; }
  .tn-det-pic { width: min(90%, 160px); }
  .tn-det-pic.set { width: min(70%, 140px); grid-column: 1 / -1; }
  .tn-det-ent { display: block; width: min(80%, 130px); height: auto; aspect-ratio: 150 / 190; }
}
@media (max-width: 380px) { .tn-saldo .gb-recarga { display: none; } .tn-tab .ui-ico { display: none; } }
/* pase de batalla */
.pase-box { max-width: 1120px; }
.ps-top { display: flex; align-items: center; gap: 16px; margin: 6px 0 14px; }
.ps-nivel { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: radial-gradient(circle at 40% 30%, var(--acc-hi), var(--acc) 60%, var(--acc-lo)); color: var(--acc-ink); box-shadow: 0 0 0 4px rgba(255,122,26,.25), 0 0 30px var(--acc-glow); }
.ps-nivel b { font-family: var(--display); font-weight: 900; font-size: 1.8rem; line-height: 1; }
.ps-nivel span { font-family: var(--display); font-size: .48rem; font-weight: 800; letter-spacing: .12em; }
.ps-barra { position: relative; flex: 1; height: 22px; background: rgba(0,0,0,.5); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.ps-barra i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc-lo), var(--acc), var(--gold)); transition: width .3s; }
.ps-barra span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: .6rem; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; }
.ps-saldo { text-align: center; font-family: var(--display); font-weight: 900; color: var(--acc-hi); }
.ps-saldo span { display: block; font-size: .5rem; letter-spacing: .1em; color: var(--tx3); }
.ps-pistas { display: flex; gap: 8px; }
.ps-etq { display: grid; grid-template-rows: 26px 1fr 1fr; gap: 6px; }
.ps-etq b { display: grid; place-items: center; writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--display); font-size: .56rem; letter-spacing: .16em; color: var(--tx3); }
.ps-etq b:first-child { grid-row: 2; }
.ps-etq b.prem { grid-row: 3; color: var(--acc-hi); }
.ps-track { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.ps-col { flex: 0 0 106px; display: grid; grid-template-rows: 26px 1fr 1fr; gap: 6px; scroll-snap-align: start; }
.ps-n { display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: .72rem; color: var(--tx3); background: rgba(255,255,255,.04); clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.ps-col.alcanzado .ps-n { background: linear-gradient(90deg, var(--acc), var(--acc-hi)); color: var(--acc-ink); }
.ps-cell { position: relative; display: grid; justify-items: center; align-content: center; gap: 4px; min-height: 128px; padding: 6px 4px; text-align: center; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line2); --cut: 10px; }
.ps-cell.premium { background: linear-gradient(180deg, rgba(255,122,26,.16), rgba(255,210,61,.05)); box-shadow: inset 0 0 0 1px rgba(255,122,26,.45); }
.ps-cell.cerrado { filter: saturate(.4) brightness(.75); }
.ps-cell.listo { box-shadow: inset 0 0 0 2px var(--gold), inset 0 -40px 40px -24px rgba(255,210,61,.25); }
.ps-cell.cobrado { opacity: .5; }
.ps-prem b { font-family: var(--display); font-weight: 900; font-size: 1.05rem; }
.ps-prem small { display: block; font-size: .62rem; font-weight: 600; max-width: 98px; color: var(--tx2); }
.ps-prem.boom b { color: var(--acc-hi); }
.ps-prem.oro b { color: var(--gold); }
.ps-ok { color: var(--ok); font-weight: 800; }
.ps-lock { opacity: .7; }
/* el circulo del nivel no se aplasta (en el movil salia ovalado con LEVEL cortado) y la barra de XP baja a su
   propia fila (se quedaba sin ancho y no se veia) */
.ps-nivel { flex: none; }
@media (max-width: 560px) {
  .ps-top { flex-wrap: wrap; gap: 10px 14px; }
  .ps-barra { order: 4; flex: 1 1 100%; }
}

/* Pokémon y ranking */
.poke-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; max-height: 72vh; overflow: auto; padding: 2px; }
.poke { display: flex; flex-direction: column; gap: .4em; padding: .8em; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); --cut: 14px; }
.poke.sel { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -60px 60px -40px var(--acc-soft); }
.poke.locked { opacity: .5; }
.poke .top { display: flex; gap: .7em; align-items: center; }
.poke canvas.mon { width: 88px; height: 88px; flex: none; border-radius: 12px; background: radial-gradient(ellipse 60% 55% at 50% 70%, rgba(255,122,26,.2), transparent 70%), #0b1020; }
.poke .nm { font-family: var(--display); font-weight: 800; font-size: 1rem; text-transform: uppercase; }
.poke .bars { display: grid; grid-template-columns: 34px 1fr; gap: .3em .5em; font-size: .68rem; align-items: center; color: var(--tx3); font-weight: 600; text-transform: uppercase; }
.poke .bars div { height: 6px; border-radius: 3px; background: rgba(255,255,255,.06); overflow: hidden; }
.poke .bars i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--acc), var(--acc-hi)); }
.poke .shots-l { display: flex; flex-direction: column; gap: .2em; font-size: .78rem; }
.poke .shots-l div { display: flex; gap: .4em; align-items: center; }
.poke .shots-l canvas { width: 20px; height: 20px; }
.poke .shots-l b { font-weight: 700; white-space: nowrap; }
.poke .shots-l small { color: var(--tx3); }
.poke .pasivos { display: flex; flex-direction: column; gap: .15em; font-size: .74rem; color: var(--tx2); }
.poke .pasivos b { color: var(--acc-hi); margin-right: .2em; }
.poke .types { font-size: .72rem; color: var(--tx3); }
.poke .btn { margin-top: auto; }
.rank-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.rk-icon { display: inline-block; width: 28px; height: 28px; vertical-align: middle; margin-right: .3em; }
/* la X de las ventanas, con 40 px para el dedo */
.box-head [data-close] { min-width: 40px; min-height: 40px; display: inline-grid; place-items: center; }
.ladder { display: flex; flex-direction: column; gap: .3em; max-height: 60vh; overflow: auto; }
.rung { display: flex; align-items: center; gap: .6em; padding: .35em .7em; border-radius: 10px; background: rgba(255,255,255,.03); font-weight: 600; font-size: .88rem; }
.rung.me { background: var(--acc-soft); box-shadow: inset 0 0 0 1px var(--acc); }
.rung span.gp { margin-left: auto; color: var(--tx3); font-size: .78rem; font-family: var(--display); }

/* avisos */
.toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .4em; z-index: 100; pointer-events: none; }
.toast { padding: .7em 1.2em; font-weight: 600; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2), inset 3px 0 0 var(--info); opacity: 0; transform: translateY(-10px); transition: all .25s; --cut: 8px; }
.toast.in { opacity: 1; transform: none; }
.toast.error { box-shadow: inset 0 0 0 1px rgba(255,71,87,.5), inset 3px 0 0 var(--bad); color: #ffd0d5; }
.toast.ok { box-shadow: inset 0 0 0 1px rgba(62,224,122,.5), inset 3px 0 0 var(--ok); color: #d6ffe6; }

/* ---------------- Campaña ---------------- */
#screen-campana { overflow: hidden; background: var(--bg0); }
.camp-bg { position: absolute; inset: 0; background: var(--bg1) center / cover no-repeat; transform: scale(1.04); filter: brightness(.6) saturate(.9); }
.camp-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,7,13,.75), rgba(5,7,13,.3) 30%, rgba(5,7,13,.85)); }
.camp-top { position: relative; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 14px 18px 6px; }
.camp-top h1 { margin: 0; font-size: 1.8rem; }
.camp-energia { margin-left: auto; display: flex; align-items: center; gap: 6px; padding: 7px 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); color: var(--tx2); font-weight: 600; font-size: .82rem; }
.camp-energia .rayo { width: 20px; height: 24px; clip-path: polygon(55% 0, 10% 58%, 45% 58%, 30% 100%, 90% 38%, 55% 38%, 75% 0); background: #2a3354; }
.camp-energia .rayo.on { background: linear-gradient(180deg, #fff3a0, var(--gold) 50%, var(--acc)); filter: drop-shadow(0 0 6px rgba(255,210,61,.7)); }
.camp-energia span { margin-left: 6px; }
.camp-regiones { position: relative; z-index: 2; display: flex; gap: 6px; padding: 4px 18px 12px; overflow-x: auto; }
.camp-reg { flex: 0 0 auto; display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: center; padding: 7px 14px 7px 10px; border: 0; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2); color: #fff; font: inherit; --cut: 8px; }
.camp-reg b { grid-row: span 2; font-family: var(--display); font-weight: 900; font-size: 1.05rem; color: var(--acc-hi); }
.camp-reg span { font-weight: 700; font-size: .78rem; }
.camp-reg small { font-size: .62rem; color: var(--tx3); }
.camp-reg.sel { background: linear-gradient(180deg, var(--acc-hi), var(--acc)); color: var(--acc-ink); box-shadow: none; }
.camp-reg.sel b, .camp-reg.sel small { color: var(--acc-ink); }
.camp-reg.bloq { opacity: .4; cursor: default; }
.camp-body { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 390px; gap: 14px; padding: 0 18px 18px; height: calc(100% - 142px); min-height: 0; }
.camp-stages { position: relative; border-radius: var(--radius); background: var(--bg1) center / cover no-repeat; overflow: hidden; min-height: 300px; box-shadow: inset 0 0 0 1px var(--line2), var(--shadow); }
.camp-stages::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,7,13,.05), rgba(5,7,13,.4)); pointer-events: none; }
.camp-camino { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.camp-camino polyline { fill: none; stroke: rgba(255,240,215,.9); stroke-width: 5px; stroke-dasharray: 10 9; vector-effect: non-scaling-stroke; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.camp-nodo { position: absolute; z-index: 2; transform: translate(-50%, -50%); width: 54px; height: 54px; border-radius: 50%; border: 0; color: #fff; font: 900 1rem var(--display); cursor: pointer; background: radial-gradient(circle at 35% 30%, #3a4672, #161d36 70%); box-shadow: 0 0 0 3px rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.55); }
.camp-nodo.jefe { width: 68px; height: 68px; background: radial-gradient(circle at 35% 30%, #ff9a7a, #e23c22 60%, #7a1408); box-shadow: 0 0 0 3px rgba(255,140,110,.5), 0 0 22px rgba(255,70,40,.55); }
.camp-nodo.hecho { background: radial-gradient(circle at 35% 30%, #fff3b0, var(--gold) 60%, #b97d00); color: #3a2200; box-shadow: 0 0 0 3px rgba(255,210,61,.45), 0 8px 18px rgba(0,0,0,.5); }
.camp-nodo.abierto { background: radial-gradient(circle at 35% 30%, var(--acc-hi), var(--acc) 60%, var(--acc-lo)); color: var(--acc-ink); animation: campLatir 1.4s ease-in-out infinite; }
.camp-nodo.bloq { filter: grayscale(.8) brightness(.6); cursor: default; }
.camp-nodo.sel { outline: 3px solid #fff; outline-offset: 4px; }
.camp-nodo .ok { position: absolute; right: -6px; top: -6px; font-style: normal; font-size: .72rem; background: var(--ok); color: #03200f; border-radius: 50%; width: 22px; height: 22px; display: grid; place-items: center; }
@keyframes campLatir { 0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 3px rgba(255,179,71,.5), 0 0 0 0 var(--acc-glow); } 50% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 3px rgba(255,179,71,.7), 0 0 0 12px rgba(255,122,26,0); } }
.camp-panel { display: flex; flex-direction: column; gap: 10px; padding: 16px; overflow-y: auto; color: #fff; background: var(--glass); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line2), var(--shadow); }
.camp-ph { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.camp-ph small { width: 100%; color: var(--acc-hi); font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .56rem; }
.camp-ph h2 { margin: 0; font-size: 1.5rem; }
.camp-tag { background: linear-gradient(90deg, #ff3b2a, var(--acc)); color: #fff; padding: .25em .7em; font-family: var(--display); font-weight: 700; font-size: .55rem; letter-spacing: .06em; text-transform: uppercase; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.camp-sec { display: flex; flex-direction: column; gap: 6px; padding: 9px 11px; border-radius: 12px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line); }
.camp-sec > b { font-family: var(--display); font-size: .56rem; font-weight: 700; color: var(--tx3); text-transform: uppercase; letter-spacing: .12em; }
.camp-peleas { display: flex; flex-direction: column; gap: 4px; }
.camp-pelea { display: flex; align-items: center; gap: 6px; }
.camp-pelea em { font-style: normal; font-family: var(--display); font-weight: 800; color: var(--tx3); width: 1.4em; font-size: .7rem; }
.camp-en { display: flex; flex-direction: column; align-items: center; font-size: .62rem; color: var(--tx2); }
.camp-mini { display: block; }
.camp-jefe-row { display: flex; gap: 10px; align-items: center; }
.camp-jefe-row strong { display: block; font-family: var(--display); font-weight: 800; font-size: .9rem; text-transform: uppercase; }
.camp-jefe-row .el { margin: 4px 0; }
.camp-jefe-row p { margin: 2px 0 0; font-size: .76rem; color: var(--tx2); }
.camp-premio { font-size: .78rem; font-weight: 600; color: var(--gold); text-align: center; }
.camp-mis { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 5px; max-height: 190px; overflow-y: auto; }
.camp-mi { display: flex; flex-direction: column; align-items: center; padding: 2px; border: 0; background: var(--glass-2); box-shadow: inset 0 0 0 1px var(--line2); color: #fff; font: inherit; --cut: 7px; }
.camp-mi small { font-family: var(--display); font-size: .5rem; font-weight: 700; }
.camp-mi.sel { box-shadow: inset 0 0 0 2px var(--acc); background: linear-gradient(180deg, rgba(255,122,26,.3), rgba(255,122,26,.06)); }
.camp-panel .btn.big { padding: .9em; }
#screen-ruta, #screen-captura { overflow: hidden; background: var(--bg1); }
#ruta-cv, #cap-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ruta-hud, .cap-hud { position: absolute; left: 14px; right: 14px; top: 12px; display: flex; align-items: center; gap: 10px; z-index: 2; }
.ruta-info, .ruta-hp, .cap-titulo, .cap-bolas, .cap-viento, .cap-ang { padding: 7px 14px; color: #fff; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.ruta-info b { font-family: var(--display); font-weight: 900; font-size: 1rem; margin-right: 8px; text-transform: uppercase; }
.ruta-info span { color: var(--tx2); font-weight: 600; }
.ruta-hp { display: flex; align-items: center; gap: 10px; min-width: 320px; font-weight: 600; }
.ruta-hp .bar { flex: 1; height: 10px; background: rgba(0,0,0,.55); overflow: hidden; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.ruta-hp .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #a6ffcf); transition: width .4s; }
.ruta-hp small { color: var(--tx2); font-family: var(--display); font-size: .7rem; }
#ruta-salir { margin-left: auto; }
.ruta-ayuda { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2; padding: 8px 20px; font-weight: 600; color: #fff; background: var(--glass); box-shadow: inset 0 0 0 1px var(--acc); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); animation: rutaAyuda 1.6s ease-in-out infinite; }
.ruta-ayuda b { color: var(--acc-hi); }
.ruta-ayuda.hidden { display: none; }
@keyframes rutaAyuda { 50% { transform: translateX(-50%) translateY(-4px); } }
.ruta-aviso { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(.6); opacity: 0; z-index: 3; padding: .2em .9em; font-family: var(--display); font-weight: 900; font-size: 2.2rem; color: #fff; text-transform: uppercase; text-align: center; background: linear-gradient(90deg, transparent, rgba(5,7,13,.8) 15%, rgba(5,7,13,.8) 85%, transparent); text-shadow: 0 4px 20px rgba(0,0,0,.7); pointer-events: none; transition: transform .28s cubic-bezier(.2,1.6,.4,1), opacity .2s; max-width: 92%; }
.ruta-aviso.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ruta-aviso.jefe { color: #ffb09a; text-shadow: 0 0 30px rgba(255,70,40,.7); }
.ruta-aviso.gold { color: var(--acc-hi); text-shadow: 0 0 30px var(--acc-glow); }
.ruta-aviso.ok { color: var(--ok); font-size: 1.6rem; }
.ruta-ctrl, .cap-ctrl { position: absolute; right: 16px; bottom: 16px; display: none; gap: 10px; z-index: 2; }
.ruta-ctrl .btn, .cap-ctrl .btn { width: 66px; height: 66px; font-size: 1.4rem; }
.cap-ctrl #cap-lanzar { width: 116px; }
@media (pointer: coarse) { .ruta-ctrl, .cap-ctrl { display: flex; } .ruta-ayuda { bottom: 96px; } .cap-abajo { bottom: 96px; } }
.ruta-fin { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(2,3,8,.6); backdrop-filter: blur(4px); }
.ruta-fin.hidden { display: none; }
.ruta-fin .box { padding: 24px 28px; max-width: 460px; text-align: center; animation: pop .3s cubic-bezier(.2,1.3,.4,1); }
.ruta-fin .box p { color: var(--tx2); }
.cap-titulo { display: flex; flex-direction: column; }
.cap-titulo b { font-family: var(--display); font-weight: 900; font-size: 1rem; text-transform: uppercase; }
.cap-titulo small { color: var(--tx2); font-size: .74rem; }
.cap-bolas { display: flex; gap: 6px; }
.cap-bolas .bola { width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(180deg, #e8322e 0 47%, #1b1a2a 47% 53%, #f2f2f2 53%); border: 2px solid #1b1a2a; position: relative; }
.cap-bolas .bola::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 2px solid #1b1a2a; }
.cap-bolas .bola.usada { filter: grayscale(1) brightness(.45); }
.cap-viento b, .cap-ang b { font-family: var(--display); color: var(--acc-hi); font-size: 1rem; }
.cap-abajo { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 10px; width: min(780px, 92%); flex-wrap: wrap; justify-content: center; }
.cap-power { position: relative; flex: 1; min-width: 220px; height: 22px; background: rgba(0,0,0,.6); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.cap-power i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--acc-lo), var(--acc), var(--gold)); }
.cap-power span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: .55rem; color: #fff; letter-spacing: .14em; text-shadow: 0 1px 2px #000; }
.cap-ayuda { width: 100%; text-align: center; color: #fff; font-size: .8rem; font-weight: 500; text-shadow: 0 1px 3px #000; }
.cap-ayuda b { color: var(--acc-hi); }

/* ---------------- tamaños de pantalla ---------------- */
@media (max-width: 900px) {
  .reg-grid, .rank-wrap, .gbshop, .gb-lower, .gb-picker, .gb-end-cols { grid-template-columns: 1fr; }
  .panel { padding: 1rem; }
  .teams { grid-template-columns: 1fr; }
  .vs { display: none; }
  .camp-body { grid-template-columns: 1fr; height: auto; padding: 0 12px 24px; }
  /* en el movil la Campaña se desliza con el dedo hasta el boton de jugar (antes quedaba debajo, sin poder llegar) */
  #screen-campana { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
  .camp-bg, .camp-shade { position: fixed; }
  .camp-top { gap: 10px; padding: 10px 12px 4px; }
  .camp-top h1 { font-size: 1.25rem; flex: 1; min-width: 0; }
  .camp-top .btn { padding-inline: .8em; white-space: nowrap; }
  .camp-energia { margin-left: 0; padding: 6px 10px; }
  .camp-energia .rayo { width: 16px; height: 20px; }
  .camp-energia span { display: none; }
  .camp-regiones { padding: 4px 12px 10px; }
  .camp-stages { min-height: 260px; }
  .camp-nodo { width: 42px; height: 42px; font-size: .85rem; }
  .camp-nodo.jefe { width: 52px; height: 52px; }
  .ruta-hp { min-width: 0; flex: 1; }
  .ruta-aviso { font-size: 1.4rem; }
}

/* ---------------- subida de rango ---------------- */
.rankup { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--tc, #ff7a1a) 34%, transparent) 0, transparent 42%), rgba(2,3,8,.93); }
.ru-rayos { position: absolute; left: 50%; top: 45%; width: 220vmax; height: 220vmax; transform: translate(-50%, -50%); background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc, #ff7a1a) 26%, transparent) 0deg 7deg, transparent 7deg 20deg); -webkit-mask: radial-gradient(circle closest-side, #000 4%, transparent 26%); mask: radial-gradient(circle closest-side, #000 4%, transparent 26%); opacity: 0; }
.rankup.show .ru-rayos { animation: ruRayos 1s ease-out forwards, ruGira 30s linear infinite; }
@keyframes ruRayos { to { opacity: 1; } }
@keyframes ruGira { to { transform: translate(-50%, -50%) rotate(360deg); } }
.ru-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.ru-in small { font-family: var(--display); font-weight: 800; font-size: .9rem; letter-spacing: .3em; text-transform: uppercase; color: #fff; opacity: 0; }
.ru-in img { width: min(52vmin, 380px); height: auto; filter: drop-shadow(0 0 40px color-mix(in srgb, var(--tc, #ff7a1a) 70%, transparent)) drop-shadow(0 18px 30px rgba(0,0,0,.6)); opacity: 0; transform: scale(.3) rotate(-12deg); }
.ru-in b { font-family: var(--display); font-weight: 900; font-size: clamp(2rem, 6vw, 3.6rem); text-transform: uppercase; letter-spacing: .02em; background: linear-gradient(180deg, #fff 20%, var(--tc, #ff7a1a)); -webkit-background-clip: text; background-clip: text; color: transparent; opacity: 0; }
.ru-in span { font-family: var(--display); font-weight: 700; color: var(--tx2); letter-spacing: .1em; opacity: 0; }
.ru-in .btn { margin-top: 14px; opacity: 0; }
.rankup.show .ru-in small { animation: ruSube .5s .1s ease-out forwards; }
.rankup.show .ru-in img { animation: ruEmblema .9s .2s cubic-bezier(.2,1.6,.35,1) forwards, ruFlota 3.2s 1.2s ease-in-out infinite; }
.rankup.show .ru-in b { animation: ruSube .5s .75s ease-out forwards; }
.rankup.show .ru-in span { animation: ruSube .5s .9s ease-out forwards; }
.rankup.show .ru-in .btn { animation: ruSube .5s 1.1s ease-out forwards; }
@keyframes ruSube { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes ruEmblema { 0% { opacity: 0; transform: scale(.3) rotate(-12deg); } 60% { opacity: 1; } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes ruFlota { 50% { transform: translateY(-10px); } }
.ru-chispas { position: absolute; left: 50%; top: 42%; }
.ru-chispas i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px 3px var(--tc, #ff7a1a); opacity: 0; }
.rankup.show .ru-chispas i { animation: ruChispa 1.3s ease-out forwards; }
@keyframes ruChispa { 0% { opacity: 1; transform: translate(0, 0) scale(1.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.3); } }
.rankup.show::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: 0; animation: ruFlash .6s .3s ease-out; pointer-events: none; }
@keyframes ruFlash { 0% { opacity: 0; } 15% { opacity: .55; } 100% { opacity: 0; } }
/* chino: las fuentes del juego no traen esos caracteres */
html:lang(zh) { --font: 'Noto Sans SC', 'Outfit', system-ui, sans-serif; --display: 'Noto Sans SC', 'Unbounded', system-ui, sans-serif; }
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3, html:lang(zh) .btn.primary { letter-spacing: .04em; }

/* selector de idioma */
/* control segmentado EN · ES · 中文 con el corte en diagonal de los botones (barra del menú y registro) */
.lang-pick { --cut: 8px; display: inline-flex; align-items: center; gap: 2px; padding: 3px; background: rgba(4,6,14,.72); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.lang-btn { --cut: 6px; border: 0; background: transparent; color: var(--tx2); font-family: 'Unbounded', 'Outfit', system-ui, sans-serif; font-weight: 800; font-size: .66rem; letter-spacing: .06em; line-height: 1; padding: .55em .72em; min-width: 2.6em; cursor: pointer; transition: color .15s, background .15s; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.lang-btn:lang(zh) { font-family: 'Noto Sans SC', 'Outfit', system-ui, sans-serif; font-weight: 700; font-size: .74rem; letter-spacing: 0; padding-block: .46em; }
.lang-btn:hover { color: var(--tx); background: rgba(255,255,255,.08); }
.lang-btn.sel { background: linear-gradient(180deg, var(--acc-hi), var(--acc)); color: var(--acc-ink); cursor: default; }
.lang-btn:focus-visible { outline: 2px solid var(--acc-hi); outline-offset: -2px; }
.reg-lang { position: absolute; top: 1.1rem; right: 1.3rem; z-index: 1; }
@media (max-width: 560px) { .reg-lang { position: static; margin: 0 0 .6rem auto; display: flex; width: max-content; } }
/* el registro y los resultados entraban con "rise", que al terminar deja transform: none y sacaba el panel del centro */
#screen-register .panel, .panel.result, .panel.result.gb-end { animation-name: riseCentro; }
@keyframes riseCentro { from { opacity: 0; transform: translate(-50%, calc(-50% + 14px)); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ---------------- iconos de interfaz (svg pintado con el color del texto) ---------------- */
.ui-ico { display: inline-block; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; flex: none; vertical-align: -0.12em; }

/* ---------------- movil: girar a horizontal para jugar ---------------- */
.girar { position: fixed; inset: 0; z-index: 9000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 35%, rgba(255,122,26,.18), transparent 60%), rgba(5,7,13,.94); color: var(--tx); }
.girar[hidden] { display: none; }
.girar-ico { font-size: 4.2rem; color: var(--acc-hi); animation: girarTel 2.2s ease-in-out infinite; }
.girar b { font-family: var(--display); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; }
.girar p { max-width: 28ch; color: var(--tx2); font-size: .95rem; line-height: 1.4; }
.girar .btn.link { background: none; color: var(--tx3); font-size: .85rem; text-decoration: underline; }
@keyframes girarTel { 0%, 20% { transform: rotate(0); } 45%, 75% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

/* ---------------- fuerza de la mira: - y +, barra que se toca y boton de disparar ---------------- */
.prow.pow { grid-template-columns: 70px 26px minmax(0, 1fr) 26px 2.2em; }
.pw-btn { width: 26px; height: 26px; padding: 0; border: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: 1rem; line-height: 1; color: var(--tx); background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); touch-action: none; }
.pw-btn:hover { background: rgba(255,122,26,.25); }
.pw-btn:active { background: rgba(255,122,26,.45); }
.power-bar { cursor: pointer; touch-action: none; }
.fire-btn { flex: none; align-self: stretch; width: 84px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; font-family: var(--display); font-weight: 900; font-size: .9rem; letter-spacing: .04em; color: var(--acc-ink); background: linear-gradient(180deg, var(--acc-hi), var(--acc) 55%, var(--acc-lo)); clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.fire-btn:hover:not(:disabled) { filter: brightness(1.12); }
.fire-btn:active:not(:disabled) { transform: translateY(1px); }
.fire-btn:disabled { filter: grayscale(.9) brightness(.55); cursor: default; }
#hud .fire-btn kbd { color: var(--acc-ink); background: rgba(255,255,255,.35); box-shadow: none; }
@media (max-width: 1180px) { .prow.pow { grid-template-columns: 58px 24px minmax(0, 1fr) 24px auto; } .fire-btn { width: 70px; } }
/* mando tactil: angulo (arriba y abajo) y fuerza (+ y -) en columnas, y FIRE dispara con la fuerza elegida */
.pad-right { align-items: flex-end; }
.pad-col { display: grid; gap: .35em; justify-items: center; }
.pad.sm { width: 50px; height: 42px; font-size: 1.05rem; --cut: 9px; }
.pad.sm.pw { font-family: var(--display); font-weight: 900; font-size: 1.3rem; color: var(--acc-hi); }
.pad-lbl { font-family: var(--display); font-size: .44rem; font-weight: 700; letter-spacing: .12em; color: var(--tx2); text-shadow: 0 1px 3px #000; }
@media (pointer: coarse) { .fire-btn { display: none; } }
/* la parte central de la consola se ensancha: con - y + y DISPARAR la barra de fuerza necesita sitio para tocarla bien */
.d-mid { width: min(700px, 52vw); }
@media (max-width: 1180px) { .d-mid { width: min(540px, 47vw); } }
@media (max-width: 900px) { .d-mid { width: 100%; } }
/* movil en horizontal: la consola del medio ocupa todo su hueco (centrada y a lo minimo, la barra de fuerza medía
   0 px y se cargaba a ciegas); con el dedo sobran la etiqueta y los botones - y +, que ya estan en el mando */
@media (max-height: 500px) and (min-width: 560px) { .d-mid { width: auto; justify-self: stretch; } .power-bar { min-width: 120px; } }
@media (max-height: 500px) and (min-width: 560px) and (pointer: coarse) {
  .prow.pow { grid-template-columns: minmax(120px, 1fr) auto; }
  .prow.mov { grid-template-columns: minmax(0, 1fr) auto; }
  .prow .plbl, .prow .pw-btn { display: none; }
}
/* la fila del mando va de lado a lado de la pantalla: solo sus botones reciben el toque (si no, tapaba el mapa a esa
   altura y tocar ahi para poner la mira no hacia nada) */
#hud > .hud-pad { pointer-events: none; }
.hud-pad .pad { pointer-events: auto; }
/* el mando no hace zoom ni desplaza la pagina al mantener o arrastrar el dedo */
.hud-pad .pad { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* mandos tactiles algo transparentes: si un Pokemon queda detras se sigue viendo */
.hud-pad .pad:not(.fire) { background: rgba(5,7,13,.42); }
.hud-pad .pad:not(.fire):active { background: var(--acc-soft); }
/* movil en horizontal (pantallas bajas): mandos mas compactos y casi transparentes, para que no queden cruzados
   encima de los Pokemon (lo vio el usuario) y la camara tenga sitio para sacarlos de detras */
@media (max-height: 430px) {
  .hud-pad .pad:not(.fire) { width: 46px; height: 46px; font-size: 1rem; background: rgba(5,7,13,.22); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); --cut: 10px; }
  .hud-pad .pad.sm { width: 40px; height: 34px; font-size: .95rem; }
  .hud-pad .pad.fire { width: 74px; height: 74px; font-size: .8rem; --cut: 14px; }
  .hud-pad .pad.tipo { height: 24px; font-size: .46rem; background: rgba(5,7,13,.34); }
  .hud-pad .pad-left, .hud-pad .pad-right, .hud-pad .pad-cols { gap: .35em; }
}

/* clima Pokemon bajo el marcador: el de ahora, su efecto y los que vienen */
.g-clima { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); display: flex; align-items: baseline; gap: 8px; padding: 4px 12px; white-space: nowrap; pointer-events: none !important; background: rgba(5,7,13,.62); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); font-size: .62rem; color: var(--tx2); }
.g-clima b { font-family: var(--display); font-weight: 900; font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.g-clima i { font-style: normal; color: var(--tx3); }
.g-clima[data-c="sol"] b { color: #ffb347; }
.g-clima[data-c="lluvia"] b { color: #7fb8ff; }
.g-clima[data-c="arena"] b { color: #e0b06a; }
.g-clima[data-c="granizo"] b { color: #bfe8ff; }
.g-clima[data-c="niebla"] b { color: #d6dcea; }
@media (max-width: 900px), (max-height: 500px) { .g-clima { top: 58px; font-size: .52rem; padding: 3px 9px; } .g-clima b { font-size: .54rem; } .g-clima i { display: none; } }
/* la habilidad del Pokemon, destacada delante de sus pasivos */
.hab b { color: var(--acc-hi); }
.hab { box-shadow: inset 0 0 0 1px rgba(255,122,26,.45); }

/* tiro recto o aereo: dos pastillas sobre el angulo y la fuerza en el movil, y junto al angulo en el PC */
.pad-mandos { display: grid; gap: .35em; }
.pad-tipos { display: flex; gap: .35em; }
/* telefono: se apunta tocando donde cae el tiro (sin angulo ni fuerza a mano); RECTO y AEREO eligen el arco y el
   elegido se marca */
#hud.caida .pad-cols { display: none; }
#hud.caida .pad-tipos { flex-direction: column; }
#hud.caida .hud-pad .pad.tipo { flex: none; width: 68px; height: 32px; font-size: .52rem; }
#hud.caida .pad.tipo.on { color: var(--acc-ink, #120a02); background: var(--acc); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.pad-cols { display: flex; gap: .55em; align-items: flex-end; }
.pad.tipo { flex: 1; width: auto; height: 28px; padding: 0 .5em; font-family: var(--display); font-size: .5rem; font-weight: 900; letter-spacing: .08em; color: var(--acc-hi); --cut: 7px; }
.tipo-tiro { display: grid; gap: 3px; margin-left: 6px; }
.tipo-tiro button { border: 0; padding: 3px 8px; font-family: var(--display); font-size: .46rem; font-weight: 900; letter-spacing: .08em; color: var(--acc-hi); background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); cursor: pointer; }
.tipo-tiro button:hover { background: rgba(255,122,26,.25); }
.tipo-tiro button:active { background: rgba(255,122,26,.45); }

/* ---------------- pantalla final (adaptable: cabe entera en el movil en horizontal sin alejar la pagina) ---------------- */
#screen-result { overflow: hidden; }
.fin { position: absolute; inset: 0; margin: auto; width: min(1100px, calc(100vw - 24px)); height: fit-content; max-height: calc(100dvh - 16px); display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 16px); padding: clamp(10px, 2vh, 22px) clamp(12px, 2vw, 26px); box-sizing: border-box; background: linear-gradient(180deg, rgba(14,18,36,.9), rgba(6,8,18,.94)); box-shadow: inset 0 0 0 1px var(--line2), 0 30px 80px rgba(0,0,0,.55); clip-path: polygon(22px 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%, 0 22px); animation: finEntra .55s cubic-bezier(.2,.8,.2,1) both; overflow: hidden; }
@keyframes finEntra { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.fin-rayos { position: absolute; inset: -40%; pointer-events: none; opacity: .0; background: repeating-conic-gradient(from 0deg at 50% 18%, rgba(255,190,80,.10) 0 6deg, transparent 6deg 18deg); animation: finRayos 26s linear infinite; }
.fin.gano .fin-rayos { opacity: 1; }
@keyframes finRayos { to { transform: rotate(360deg); } }
.fin > * { position: relative; }
.fin-cab { text-align: center; }
.fin-modo { margin: 0; font-family: var(--display); font-size: .62rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--tx3); }
.fin-titulo { margin: .05em 0 0; font-family: var(--display); font-weight: 900; font-size: clamp(2.1rem, 7vh, 4.2rem); line-height: 1; letter-spacing: .02em; text-transform: uppercase; color: var(--tx); }
.fin.gano .fin-titulo { background: linear-gradient(180deg, #fff6c9, #ffcf3a 45%, #ff7a1a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 24px rgba(255,140,30,.45)); animation: finTitulo 1.8s ease-in-out infinite alternate; }
.fin.perdio .fin-titulo { color: #ff6b6b; text-shadow: 0 4px 22px rgba(255,60,60,.25); }
@keyframes finTitulo { from { filter: drop-shadow(0 4px 18px rgba(255,140,30,.35)); } to { filter: drop-shadow(0 4px 34px rgba(255,170,60,.7)); } }
.fin-cuerpo { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(10px, 1.6vw, 18px); min-height: 0; flex: 1 1 auto; }
.fin-heroe { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px; background: radial-gradient(ellipse at 50% 70%, rgba(255,122,26,.18), transparent 70%), rgba(4,6,14,.5); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); min-height: 0; }
.fin.perdio .fin-heroe { background: rgba(4,6,14,.55); filter: saturate(.75); }
.fin-escena { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 100%; height: clamp(120px, 30vh, 240px); }
.fin-escena canvas { height: 100%; width: auto; }
.fin-escena img { height: 72%; width: auto; margin-left: -14%; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.fin.gano .fin-escena img { animation: finSalta 1.1s ease-in-out infinite; }
@keyframes finSalta { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-10%); } }
.fin-yo { display: flex; align-items: center; gap: 8px; }
.fin-yo img { width: 34px; height: 34px; object-fit: contain; }
.fin-yo b { display: block; font-family: var(--display); font-size: .86rem; font-weight: 800; color: var(--acc-hi); }
.fin-yo small { display: block; font-size: .7rem; color: var(--tx2); }
.fin-yo-stats { display: flex; gap: 12px; font-size: .68rem; color: var(--tx2); }
.fin-yo-stats b { margin-right: .3em; font-family: var(--display); font-size: .9rem; color: var(--tx); }
.fin-tabla { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
.fin-equipo { display: flex; flex-direction: column; min-height: 0; background: rgba(4,6,14,.5); box-shadow: inset 0 0 0 1px var(--line2); clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.fin-equipo.win { box-shadow: inset 0 0 0 1px rgba(255,122,26,.55), 0 0 30px rgba(255,122,26,.12); }
.fin-eq-cab { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; }
.fin-eq-cab canvas { width: 26px; height: 26px; }
.fin-eq-cab b { font-family: var(--display); font-weight: 900; font-size: 1.1rem; letter-spacing: .14em; }
.fin-equipo.win .fin-eq-cab { background: linear-gradient(90deg, transparent, rgba(255,122,26,.3), transparent); }
.fin-equipo.win .fin-eq-cab b { color: var(--acc-hi); }
.fin-equipo.lose .fin-eq-cab b { color: var(--tx3); }
.fin-lista { display: grid; gap: 6px; padding: 8px; align-content: start; overflow-y: auto; min-height: 0; }
.fin-fila { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; background: var(--glass-2); box-shadow: inset 3px 0 0 var(--team-a), inset 0 0 0 1px var(--line2); animation: finFila .45s cubic-bezier(.2,.8,.2,1) both; }
.fin-fila.b { box-shadow: inset 3px 0 0 var(--team-b), inset 0 0 0 1px var(--line2); }
/* (yo y no me: .me es la ficha del menu y le cambiaba el ancho) */
.fin-fila.yo { box-shadow: inset 3px 0 0 var(--acc), inset 0 0 0 2px var(--acc); }
.fin-lista .fin-fila:nth-child(2) { animation-delay: .08s; } .fin-lista .fin-fila:nth-child(3) { animation-delay: .16s; } .fin-lista .fin-fila:nth-child(4) { animation-delay: .24s; }
@keyframes finFila { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.fin-rango { width: 28px; height: 28px; object-fit: contain; }
.fin-rango.vacio { display: grid; place-items: center; font-family: var(--display); font-weight: 900; color: var(--tx3); }
.fin-nombre { min-width: 0; }
.fin-nombre b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .86rem; }
.fin-nombre small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx2); font-size: .68rem; }
.fin-pts { text-align: right; font-family: var(--display); line-height: 1.15; }
.fin-pts b { display: block; font-size: .8rem; }
.fin-pts span { font-size: .72rem; color: var(--gold); }
.fin-premios { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.fin-premios .reward { min-width: 0; padding: 6px 14px; }
.fin-premios .reward b { font-family: var(--display); }
.fin-botones { display: flex; justify-content: center; gap: 10px; }
.fin-botones .btn { min-width: 160px; }
/* movil en horizontal (poco alto): todo mas compacto para que quepa sin alejar la pagina */
@media (max-height: 520px) {
  .fin { gap: 6px; padding: 8px 12px; max-height: calc(100dvh - 8px); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
  .fin-titulo { font-size: clamp(1.4rem, 9vh, 2.2rem); }
  .fin-modo { font-size: .5rem; }
  .fin-cuerpo { grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); gap: 8px; }
  .fin-heroe { padding: 6px; gap: 4px; }
  .fin-escena { height: clamp(80px, 30vh, 130px); }
  .fin-yo img { width: 24px; height: 24px; }
  .fin-yo b { font-size: .7rem; }
  .fin-yo small, .fin-yo-stats { font-size: .56rem; }
  .fin-eq-cab { padding: 3px; }
  .fin-eq-cab canvas { width: 18px; height: 18px; }
  .fin-eq-cab b { font-size: .8rem; }
  .fin-lista { padding: 5px; gap: 4px; }
  .fin-fila { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; padding: 3px 8px 3px 4px; }
  .fin-rango { width: 20px; height: 20px; }
  .fin-nombre b { font-size: .7rem; }
  .fin-nombre small, .fin-pts span { font-size: .56rem; }
  .fin-pts b { font-size: .64rem; }
  .fin-premios { gap: 5px; }
  .fin-premios .reward { padding: 3px 10px; font-size: .62rem; }
  .fin-botones .btn { min-width: 0; padding: .45em 1.2em; font-size: .7rem; }
}
/* pantalla estrecha y alta (movil en vertical): una sola columna */
@media (max-width: 640px) and (min-height: 521px) {
  .fin-cuerpo { grid-template-columns: 1fr; }
  .fin-tabla { grid-template-columns: 1fr; }
  .fin-escena { height: 140px; }
}

/* ---------------- antes de la partida: elegir Pokemon, mapa, rivales y modo (js/prepartida.js) ---------------- */
#screen-pre { overflow: hidden; background: var(--bg0); }
.pre-bg { position: absolute; inset: -3%; background: var(--bg1) url(/img/campana/ruta_9.jpg) center / cover no-repeat; filter: blur(6px) brightness(.42) saturate(1.1); transition: background-image .3s; }
.pre-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 60% 70% at 22% 55%, rgba(255,122,26,.12), transparent 70%), linear-gradient(180deg, rgba(5,7,13,.75), rgba(5,7,13,.25) 26%, rgba(5,7,13,.8)); }
.pre-top { position: absolute; top: 0; left: 0; right: 0; height: 68px; z-index: 2; display: flex; align-items: center; gap: 16px; padding: 0 max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); }
.pre-volver { display: inline-flex; align-items: center; gap: .5em; min-height: 42px; }
.pre-volver .ui-ico { font-size: 1.05rem; }
.pre-titulo small { display: block; font-family: var(--display); font-size: .56rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--acc-hi); }
.pre-titulo h1 { margin: 0; font-size: 1.45rem; font-style: italic; text-shadow: 0 4px 18px rgba(0,0,0,.6); }
.pre-cuerpo { position: absolute; top: 68px; left: 0; right: 0; bottom: 0; z-index: 1; display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(300px, 370px); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "tipo tipo tipo" "show elige aj"; gap: 14px; padding: 0 max(20px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.pre-show, .pre-elige, .pre-ajustes { min-height: 0; display: flex; flex-direction: column; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line2), var(--shadow); --cut: 18px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); animation: rise .4s ease both; }
.pre-show { grid-area: show; --el: var(--acc); overflow: hidden; }
.pre-elige { grid-area: elige; padding: 14px; animation-delay: .05s; }
.pre-ajustes { grid-area: aj; animation-delay: .1s; }

/* el Pokemon elegido */
.pre-escena { position: relative; flex: 0 0 auto; height: clamp(150px, 34vh, 300px); display: grid; place-items: end center; background: radial-gradient(ellipse 55% 42% at 50% 86%, color-mix(in srgb, var(--el) 55%, transparent), transparent 72%), linear-gradient(180deg, color-mix(in srgb, var(--el) 16%, #0b1020), #0b1020); overflow: hidden; }
.pre-escena::before { content: ''; position: absolute; inset: 0; background: repeating-conic-gradient(from 0deg at 50% 80%, color-mix(in srgb, var(--el) 14%, transparent) 0deg 6deg, transparent 6deg 18deg); opacity: .8; }
.pre-escena::after { content: ''; position: absolute; left: 50%; bottom: 7%; width: 62%; height: 14%; transform: translateX(-50%); border-radius: 50%; border: 2px solid color-mix(in srgb, var(--el) 70%, #fff); box-shadow: 0 0 24px color-mix(in srgb, var(--el) 60%, transparent), inset 0 0 18px color-mix(in srgb, var(--el) 45%, transparent); }
.pre-mon { position: absolute; z-index: 1; left: 50%; bottom: 0; height: 100%; width: auto; aspect-ratio: 1; transform: translateX(-50%); }
/* Pokemon sin retrato todavia: una pokebola en su sitio */
.pre-sin { display: none; flex: none; width: 50%; max-width: 58px; aspect-ratio: 1; margin: auto auto 8px; border-radius: 50%; opacity: .5; background: radial-gradient(circle at 50% 50%, #fff 0 13%, #1b1a2a 13% 20%, transparent 20%), linear-gradient(180deg, #e8322e 0 46%, #1b1a2a 46% 54%, #f2f2f2 54%); box-shadow: 0 0 0 3px #1b1a2a; }
.pre-tile img.sin-img { display: none; }
.pre-tile img.sin-img + .pre-sin { display: block; }
.pre-slot img.sin-img, .pre-lleva img.sin-img { visibility: hidden; }
.pre-ficha { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; }
.pre-nombre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pre-nombre b { font-family: var(--display); font-weight: 900; font-size: 1.5rem; text-transform: uppercase; line-height: 1; }
.pre-ang { margin-left: auto; font-family: var(--display); font-size: .56rem; font-weight: 700; letter-spacing: .06em; color: var(--acc-hi); padding: .3em .6em; box-shadow: inset 0 0 0 1px rgba(255,122,26,.45); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.pre-desc { margin: 0; color: var(--tx2); font-size: .84rem; line-height: 1.35; }
.pre-stats { display: grid; gap: 5px; }
.pre-stat { display: grid; grid-template-columns: 16px 46px minmax(0, 1fr) 42px; align-items: center; gap: 7px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--tx2); }
.pre-stat .ui-ico { color: var(--el); font-size: .95rem; }
.pre-stat b { font-family: var(--display); font-size: .8rem; color: var(--tx); text-align: right; }
.pre-bar { height: 8px; background: rgba(255,255,255,.07); overflow: hidden; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.pre-bar i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--el) 70%, #000), var(--el), color-mix(in srgb, var(--el) 50%, #fff)); transition: width .35s cubic-bezier(.2,.8,.2,1); }
.pre-tiros { display: grid; gap: 6px; }
.pre-tiro { display: grid; grid-template-columns: 34px 26px minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 10px 6px 6px; background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.pre-tiro em { font-style: normal; font-family: var(--display); font-weight: 900; font-size: .8rem; text-align: center; color: var(--tx); }
.pre-tiro.ulti { background: linear-gradient(90deg, rgba(255,122,26,.2), rgba(255,122,26,.03)); box-shadow: inset 0 0 0 1px rgba(255,122,26,.45); }
.pre-tiro.ulti em { font-size: .56rem; color: var(--acc-hi); letter-spacing: .04em; }
.pre-tiro img { width: 26px; height: 26px; object-fit: contain; }
.pre-tiro b { display: block; font-size: .86rem; }
.pre-tiro small { display: block; font-size: .72rem; color: var(--tx2); line-height: 1.25; }
.pre-pas { display: flex; flex-direction: column; gap: 5px; font-size: .74rem; color: var(--tx2); line-height: 1.3; }
.pre-pas span { padding: 6px 10px; background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line); border-radius: 10px; }
.pre-pas b { color: var(--tx); margin-right: .2em; }
.pre-pas .hab b { color: var(--acc-hi); }
/* Tag: las dos casillas */
.pre-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 10px 0; }
.pre-slot { display: grid; grid-template-columns: auto 40px minmax(0, 1fr); align-items: center; gap: 6px; min-height: 52px; padding: 4px 8px; border: 0; text-align: left; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line2); color: var(--tx2); --cut: 8px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.pre-slot em { font-style: normal; font-family: var(--display); font-weight: 900; font-size: 1.2rem; color: var(--acc); }
.pre-slot:nth-child(2) em { color: var(--ok); }
.pre-slot img { width: 40px; height: 40px; object-fit: contain; }
.pre-slot b { display: block; font-size: .8rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pre-slot small { font-size: .62rem; }
.pre-slot.on { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -24px 24px -14px var(--acc-soft); }
.pre-slot:nth-child(2).on { box-shadow: inset 0 0 0 2px var(--ok), inset 0 -24px 24px -14px rgba(62,224,122,.2); }
.pre-tag-ayuda { margin: 6px 12px 0; font-size: .7rem; color: var(--tx3); }

/* la rejilla */
.pre-elige-cab { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 0; margin-bottom: 8px; }
.pre-elige-cab h3 { margin: 0; white-space: nowrap; }
.pre-elige-mas { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pre-elige-cab #pre-cuenta { white-space: nowrap; font-family: var(--display); font-size: .6rem; font-weight: 700; letter-spacing: .08em; color: var(--tx3); }
.pre-todos { flex: none; display: inline-flex; align-items: center; gap: 2px; min-height: 36px; padding: 0 4px 0 10px; border: 0; background: none; font-family: var(--font); font-size: .82rem; font-weight: 700; color: var(--acc-hi); }
.pre-todos:hover { color: #fff; }
.pre-todos .ui-ico { font-size: .95em; }
/* con un solo Pokemon no hay rejilla: quedan la ficha y JUGAR */
#screen-pre.sin-rejilla .pre-elige { display: none; }
#screen-pre.sin-rejilla .pre-cuerpo { grid-template-columns: minmax(300px, 400px) minmax(300px, 380px); grid-template-areas: "tipo tipo" "show aj"; justify-content: center; }
/* Normal y Competitiva: el panel de la derecha solo lleva JUGAR, abajo */
#screen-pre[data-tipo="rapida"] .pre-ajustes { align-self: end; }
.pre-ajustes:empty { display: none; }
.pre-grid { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-auto-rows: max-content; gap: 8px; align-content: start; padding: 2px 4px 2px 2px; overscroll-behavior: contain; }
.pre-tile { position: relative; aspect-ratio: 1 / 1.08; border: 0; padding: 6px 4px 4px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; overflow: hidden; color: var(--tx); background: radial-gradient(ellipse 70% 50% at 50% 78%, color-mix(in srgb, var(--el) 40%, transparent), transparent 72%), linear-gradient(180deg, #1a2244, #0c1122); box-shadow: inset 0 0 0 1px var(--line2), inset 0 -3px 0 color-mix(in srgb, var(--el) 70%, transparent); --cut: 10px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: transform .12s, box-shadow .15s; }
.pre-tile img { flex: 1; min-height: 0; width: 92%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); transition: transform .2s; pointer-events: none; }
.pre-tile small { font-family: var(--display); font-size: .56rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pre-tile:hover:not(:disabled) { transform: translateY(-2px); }
.pre-tile:hover:not(:disabled) img { transform: scale(1.06); }
.pre-tile.sel { box-shadow: inset 0 0 0 2px var(--acc), inset 0 -30px 30px -16px var(--acc-soft); }
.pre-tile.sel::after { content: ''; position: absolute; top: 7px; right: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 10px var(--acc-glow); }
.pre-tile.locked { cursor: not-allowed; }
.pre-tile.locked img { filter: grayscale(1) brightness(.35); }
.pre-tile.locked small { color: var(--tx3); }
.pre-lock { position: absolute; top: 36%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 4px; padding: .3em .6em; font-family: var(--display); font-size: .56rem; font-weight: 800; color: var(--tx); background: rgba(4,6,14,.85); border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line2); white-space: nowrap; }
.pre-badge { position: absolute; top: 5px; left: 5px; width: 22px; height: 22px; display: grid; place-items: center; font-style: normal; font-family: var(--display); font-weight: 900; font-size: .72rem; color: var(--acc-ink); background: var(--acc); border-radius: 50%; }
.pre-badge.dos { background: var(--ok); color: #03200f; }

/* ajustes y JUGAR */
.pre-opciones { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 16px 16px 10px; }
.pre-bloque h4 { margin: 0 0 7px; font-family: var(--display); font-size: .58rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tx3); }
.pre-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.pre-seg.tres { grid-template-columns: repeat(3, 1fr); }
.pre-seg.cuatro { grid-template-columns: repeat(4, 1fr); }
.pre-seg.modos { grid-template-columns: repeat(3, 1fr); }
.pre-seg button { min-height: 42px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px; border: 0; background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line2); color: var(--tx2); --cut: 8px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: background .15s, box-shadow .15s, color .15s; }
.pre-seg button b { font-family: var(--display); font-weight: 800; font-size: .74rem; letter-spacing: .02em; text-transform: uppercase; line-height: 1.1; text-align: center; }
.pre-seg button small { font-size: .64rem; font-weight: 600; opacity: .8; text-align: center; }
.pre-seg button:hover { background: rgba(255,255,255,.09); color: var(--tx); }
.pre-seg button.on { background: linear-gradient(180deg, rgba(255,122,26,.34), rgba(255,122,26,.1)); box-shadow: inset 0 0 0 2px var(--acc); color: #fff; }
/* arriba: Normal, Competitiva o Contra la CPU (la competitiva en morado, como su JUGAR) y una linea que lo explica */
.pre-tipo { grid-area: tipo; justify-self: center; width: min(660px, 100%); display: flex; flex-direction: column; align-items: center; gap: 6px; animation: rise .35s ease both; }
.pre-seg.tipo { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; padding: 5px; background: rgba(4,6,14,.78); box-shadow: inset 0 0 0 1px var(--line2), var(--shadow); --cut: 12px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.pre-seg.tipo button { min-height: 46px; background: transparent; box-shadow: none; }
.pre-seg.tipo button b { font-size: .84rem; }
.pre-seg.tipo button.on { background: linear-gradient(180deg, rgba(255,122,26,.42), rgba(255,122,26,.14)); box-shadow: inset 0 0 0 2px var(--acc); }
.pre-seg.tipo.comp button.on { background: linear-gradient(180deg, rgba(162,77,255,.45), rgba(162,77,255,.14)); box-shadow: inset 0 0 0 2px #b47bff; }
.pre-exp { margin: 0; max-width: 100%; font-size: .82rem; font-weight: 600; line-height: 1.3; text-align: center; color: var(--tx2); text-shadow: 0 2px 8px rgba(0,0,0,.7); }
/* contra la CPU: mapa y modo en "Mas opciones" (plegado se ve lo que hay puesto) */
.pre-mas { padding-top: 10px; border-top: 1px solid var(--line); }
.pre-mas > summary { list-style: none; display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; user-select: none; }
.pre-mas > summary::-webkit-details-marker { display: none; }
.pre-mas > summary b { flex: none; font-family: var(--display); font-size: .62rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tx2); }
.pre-mas > summary:hover b { color: var(--tx); }
.pre-mas > summary small { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; font-weight: 600; color: var(--tx3); }
.pre-mas[open] > summary small { display: none; }
.pre-mas-flecha { color: var(--acc-hi); transition: transform .18s; }
.pre-mas[open] .pre-mas-flecha { transform: rotate(90deg); }
.pre-mas-cuerpo { display: flex; flex-direction: column; gap: 14px; padding-top: 8px; }
.pre-nota { margin: 7px 0 0; font-size: .76rem; line-height: 1.35; color: var(--tx2); }
.pre-mapa { position: relative; height: 104px; display: flex; align-items: flex-end; justify-content: center; padding: 8px 48px; background: var(--bg3) center / cover no-repeat; box-shadow: inset 0 0 0 1px var(--line2); --cut: 12px; clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); }
.pre-mapa::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,7,13,.85), transparent 60%); }
.pre-mapa.random { background: radial-gradient(circle at 50% 40%, rgba(255,122,26,.35), transparent 65%), var(--bg3); }
.pre-mapa b { position: relative; font-family: var(--display); font-weight: 800; font-size: .82rem; letter-spacing: .05em; text-transform: uppercase; text-shadow: 0 2px 8px #000; text-align: center; }
.pre-mapa .pre-azar { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); font-size: 2.2rem; color: var(--acc-hi); }
.pre-flecha { position: absolute; top: 50%; transform: translateY(-50%); left: 6px; z-index: 1; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; font-size: 1.1rem; color: #fff; background: rgba(4,6,14,.75); box-shadow: inset 0 0 0 1px var(--line3); }
.pre-flecha.r { left: auto; right: 6px; }
.pre-flecha:hover { background: var(--acc); color: var(--acc-ink); }
.pre-pie { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 12px 16px 16px; background: linear-gradient(180deg, transparent, rgba(255,122,26,.08)); box-shadow: inset 0 1px 0 var(--line2); }
.pre-lleva { display: flex; align-items: center; gap: 10px; }
.pre-lleva img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.5)); }
.pre-lleva small { display: block; font-family: var(--display); font-size: .52rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--tx3); }
.pre-lleva b { font-family: var(--display); font-weight: 800; font-size: .9rem; text-transform: uppercase; }
.btn.pre-jugar { display: flex; align-items: center; justify-content: center; gap: .55em; width: 100%; min-height: 62px; font-size: 1.25rem; letter-spacing: .06em; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.2), 0 0 34px -6px var(--acc-glow); }
.pre-jugar .ui-ico { font-size: 1.1em; }
.pre-jugar span { white-space: nowrap; }
.pre-jugar::after { animation: shine 2.6s ease-in-out infinite; }
.btn.pre-jugar.comp { background: linear-gradient(180deg, #d9a8ff, #a24dff 55%, #7a2bd6); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 0 34px -6px #a24dff; }
.pre-busca { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: rgba(4,6,14,.6); box-shadow: inset 0 0 0 1px var(--acc), 0 0 24px -8px var(--acc-glow); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.pre-busca b { display: block; font-weight: 700; }
.pre-busca small { color: var(--tx2); font-size: .74rem; }
.pre-pie > .btn { min-height: 44px; }

/* portatil y tableta: los ajustes bajan debajo de la rejilla */
@media (max-width: 1180px) {
  .pre-cuerpo { grid-template-columns: minmax(270px, 330px) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "tipo tipo" "show elige" "show aj"; }
  #screen-pre.sin-rejilla .pre-cuerpo { grid-template-columns: minmax(270px, 360px) minmax(0, 520px); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "tipo tipo" "show aj"; }
  .pre-ajustes { flex-direction: row; max-height: 46vh; }
  .pre-opciones { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-content: start; }
  .pre-mas { grid-column: 1 / -1; }
  .pre-mas-cuerpo { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .pre-pie { width: 250px; justify-content: flex-end; background: linear-gradient(90deg, transparent, rgba(255,122,26,.08)); box-shadow: inset 1px 0 0 var(--line2); }
}
/* tableta: en Normal y Competitiva la fila de abajo solo lleva JUGAR, a lo ancho */
@media (max-width: 1180px) and (min-width: 600px) and (min-height: 521px) {
  #screen-pre[data-tipo="rapida"] .pre-ajustes { align-self: stretch; }
  #screen-pre[data-tipo="rapida"] .pre-pie { width: auto; flex: 1; flex-direction: row; align-items: center; justify-content: flex-end; box-shadow: none; }
  #screen-pre[data-tipo="rapida"] .btn.pre-jugar { width: auto; flex: 0 1 340px; }
}
/* movil en horizontal (poco alto): tres columnas compactas, cada una con su propio desplazamiento */
@media (max-height: 520px) and (min-width: 600px) {
  .pre-top { height: 48px; gap: 10px; }
  .pre-volver { min-height: 40px; padding: .4em .8em; font-size: .8rem; }
  .pre-titulo small { font-size: .46rem; }
  .pre-titulo h1 { font-size: 1rem; }
  .pre-cuerpo { top: 48px; gap: 8px; padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); grid-template-columns: minmax(200px, 30%) minmax(0, 1fr) minmax(210px, 30%); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "show tipo tipo" "show elige aj"; }
  #screen-pre.sin-rejilla .pre-cuerpo { grid-template-columns: minmax(220px, 40%) minmax(260px, 46%); grid-template-areas: "show tipo" "show aj"; justify-content: center; }
  .pre-tipo { width: 100%; gap: 4px; }
  .pre-seg.tipo { padding: 3px; gap: 3px; --cut: 8px; }
  .pre-seg.tipo button { min-height: 38px; padding: 2px 3px; }
  .pre-seg.tipo button b { font-size: .62rem; letter-spacing: 0; }
  .pre-exp { font-size: .62rem; }
  .pre-show, .pre-elige, .pre-ajustes { --cut: 12px; }
  .pre-show { overflow-y: auto; }
  .pre-escena { height: 96px; flex: none; }
  .pre-ficha { overflow: visible; flex: none; padding: 8px 10px 10px; gap: 7px; }
  .pre-nombre b { font-size: 1.05rem; }
  .pre-desc { display: none; }
  .pre-stat { grid-template-columns: 14px 38px minmax(0, 1fr) 34px; font-size: .58rem; gap: 5px; }
  .pre-tiro { grid-template-columns: 28px 20px minmax(0, 1fr); gap: 6px; padding: 4px 8px 4px 4px; }
  .pre-tiro img { width: 20px; height: 20px; }
  .pre-tiro b { font-size: .72rem; }
  .pre-tiro small { font-size: .6rem; }
  .pre-pas { font-size: .62rem; }
  .pre-slots { padding: 6px 6px 0; gap: 4px; }
  .pre-slot { grid-template-columns: auto 30px minmax(0, 1fr); min-height: 42px; padding: 3px 6px; }
  .pre-slot img { width: 30px; height: 30px; }
  .pre-tag-ayuda { display: none; }
  .pre-elige { padding: 8px; }
  .pre-elige-cab { margin-bottom: 6px; }
  .pre-elige-cab h3 { font-size: .62rem; white-space: nowrap; }
  .pre-elige-cab #pre-cuenta { font-size: .48rem; }
  .pre-grid { grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 5px; }
  /* sin la nota de los rivales; la del modo se queda (la regla de Party) */
  #screen-pre[data-tipo="practica"] .pre-opciones > .pre-bloque .pre-nota { display: none; }
  .pre-tile small { font-size: .46rem; }
  .pre-ajustes { flex-direction: column; max-height: none; }
  .pre-opciones { display: flex; padding: 10px 10px 6px; gap: 10px; }
  .pre-bloque h4 { margin-bottom: 4px; font-size: .5rem; }
  .pre-seg button { min-height: 40px; padding: 4px; }
  .pre-seg button b { font-size: .6rem; }
  .pre-seg button small { font-size: .54rem; }
  .pre-nota { font-size: .64rem; margin-top: 5px; }
  .pre-mas { padding-top: 6px; }
  .pre-mas > summary { min-height: 36px; }
  .pre-mas > summary b { font-size: .52rem; }
  .pre-mas > summary small { font-size: .6rem; }
  .pre-mas-cuerpo { display: flex; gap: 10px; padding-top: 4px; }
  .pre-mapa { height: 58px; padding: 6px 44px; }
  .pre-mapa .pre-azar { font-size: 1.5rem; top: 14%; }
  .pre-pie { width: auto; padding: 8px 10px 10px; gap: 6px; box-shadow: inset 0 1px 0 var(--line2); }
  .pre-lleva { display: none; }
  .btn.pre-jugar { min-height: 50px; font-size: .92rem; padding-inline: .6em; }
}
/* movil en vertical: una sola columna que se desliza y JUGAR fijo abajo */
@media (max-width: 599px) {
  .pre-top { height: 58px; padding: 0 12px; gap: 10px; }
  .pre-titulo h1 { font-size: 1.1rem; }
  #screen-pre.active { display: flex; flex-direction: column; }
  .pre-top { position: relative; flex: none; }
  .pre-cuerpo { position: relative; top: auto; left: auto; right: auto; bottom: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; padding: 0 12px 14px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .pre-titulo h1 { font-size: 1rem; line-height: 1.1; }
  .pre-show, .pre-elige, .pre-ajustes, .pre-tipo { flex: none; --cut: 14px; }
  .pre-tipo { width: 100%; gap: 5px; }
  .pre-seg.tipo button { min-height: 44px; padding: 4px; }
  .pre-seg.tipo button b { font-size: .64rem; letter-spacing: 0; }
  .pre-exp { font-size: .74rem; }
  .pre-mas-cuerpo { display: flex; }
  /* el retrato a la izquierda y nombre, tipo y barras a la derecha; disparos y habilidad debajo, a lo ancho */
  .pre-show { display: grid; grid-template-columns: 128px minmax(0, 1fr); column-gap: 12px; padding-bottom: 12px; }
  .pre-slots, .pre-tag-ayuda, .pre-tiros, .pre-pas { grid-column: 1 / -1; }
  .pre-escena { grid-column: 1; grid-row: span 3; height: 150px; }
  .pre-ficha { display: contents; }
  .pre-nombre { padding: 12px 12px 0 0; }
  .pre-nombre b { font-size: 1.1rem; }
  .pre-desc { padding-right: 12px; font-size: .72rem; }
  .pre-stats { padding: 0 12px 4px 0; align-self: end; }
  .pre-tiros, .pre-pas { margin: 10px 12px 0; }
  .pre-tiro small { font-size: .68rem; }
  .pre-ang { margin-left: 0; }
  /* sin recorte ni animacion: si no, la barra fija de JUGAR quedaba encerrada dentro del panel */
  .pre-ajustes { clip-path: none; animation: none; border-radius: 14px; }
  .pre-elige { padding: 10px; }
  .pre-elige-cab h3 { font-size: .78rem; white-space: nowrap; }
  .pre-elige-cab #pre-cuenta { font-size: .52rem; }
  .pre-grid { overflow: visible; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .pre-tile small { font-size: .5rem; }
  .pre-ajustes { flex-direction: column; max-height: none; }
  .pre-opciones { display: flex; overflow: visible; padding: 12px; }
  .pre-pie-movil { position: relative; z-index: 2; flex: none; }
  .pre-pie { width: auto; flex-direction: row; align-items: center; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(10,14,26,.96), rgba(5,7,13,.99)); box-shadow: 0 -10px 30px rgba(0,0,0,.5), inset 0 1px 0 var(--line2); }
  .pre-lleva { flex: 0 1 auto; min-width: 0; }
  .pre-lleva img { width: 38px; height: 38px; }
  .pre-lleva b { font-size: .74rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
  .btn.pre-jugar { flex: 1; min-width: 0; min-height: 54px; font-size: 1rem; }
  .pre-busca { flex: 1; min-width: 0; padding: 8px 10px; }
}

/* telefono estrecho: junto a JUGAR solo la imagen de tu Pokemon (el nombre ya esta en la ficha), para que
   "FIND OPPONENT" quepa entero */
@media (max-width: 440px) {
  .pre-pie .pre-lleva > span { display: none; }
}

/* ---------------- tus Pokemon (la coleccion del menu: ficha grande y rejilla, js/prepartida.js) ---------------- */
.pk-box { width: min(1240px, 100%); height: min(860px, calc(100dvh - 24px)); max-height: none; display: flex; flex-direction: column; padding: 14px 16px 16px; }
.pk-box .box-head { flex: none; flex-wrap: wrap; row-gap: 4px; }
.pk-hint b { color: var(--acc-hi); font-weight: 700; }
.pk-cuerpo { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); grid-template-areas: "show elige"; gap: 14px; }
.pk-cuerpo .pre-elige { padding: 12px; }
.pk-pie { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 16px 16px; background: linear-gradient(180deg, transparent, rgba(255,122,26,.08)); box-shadow: inset 0 1px 0 var(--line2); }
.pk-pie .btn { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: .3em; }
.pk-tipos { margin: 0; font-size: .74rem; color: var(--tx2); }
.pre-tile.locked.ver { cursor: pointer; }
.pre-tile.locked.ver:hover img { filter: grayscale(1) brightness(.55); }
.pre-badge .ui-ico { font-size: .8rem; }
@media (max-height: 520px) and (min-width: 600px) {
  .pk-box { width: 100%; height: 100dvh; border-radius: 0; padding: 6px max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); }
  .modal#modal-pokemon { padding: 0; }
  .pk-box::before { display: none; }
  .pk-box .box-head { margin-bottom: 6px; }
  .pk-box .box-head h2 { font-size: 1rem; }
  .pk-hint { font-size: .66rem; }
  .pk-cuerpo { grid-template-columns: minmax(220px, 36%) minmax(0, 1fr); gap: 8px; }
  .pk-cuerpo .pre-elige { padding: 8px; }
  .pk-cuerpo .pre-show { overflow: hidden; display: flex; flex-direction: column; }
  .pk-cuerpo .pre-escena { flex: none; }
  .pk-cuerpo .pre-ficha { flex: 1; min-height: 0; overflow-y: auto; }
  .pk-pie { flex: none; padding: 8px 10px; }
  .pk-tipos { font-size: .6rem; }
  .pk-pie .btn { min-height: 42px; padding: .5em 1em; font-size: .8rem; }
}
@media (max-width: 599px) {
  .modal#modal-pokemon { padding: 0; }
  .pk-box { width: 100%; height: 100dvh; border-radius: 0; padding: max(10px, env(safe-area-inset-top)) 12px 0; }
  .pk-box::before { display: none; }
  .pk-box .box-head h2 { font-size: 1.05rem; }
  .pk-cuerpo { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .pk-cuerpo > * { flex: none; }
  .pk-pie { grid-column: 1 / -1; padding: 10px 12px 12px; }
  .pk-cuerpo .pre-grid { overflow: visible; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
}

/* ---------------- pase de batalla en el movil: a pantalla completa y las dos pistas caben enteras ---------------- */
@media (max-height: 520px) and (min-width: 560px) {
  #modal-pase { padding: 0; }
  .box.pase-box { width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; display: flex; flex-direction: column; padding: 6px max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left)); }
  .pase-box::before { display: none; }
  .pase-box .box-head { margin-bottom: 4px; }
  .pase-box .box-head h2 { font-size: 1rem; }
  .pase-box .box-head .hint { font-size: .68rem; }
  .pase-box .box-head [data-close] { min-width: 40px; min-height: 40px; }
  .ps-top { margin: 0 0 6px; gap: 10px; }
  .ps-nivel { width: 46px; height: 46px; box-shadow: 0 0 0 3px rgba(255,122,26,.25); }
  .ps-nivel b { font-size: 1.15rem; }
  .ps-nivel span { font-size: .36rem; }
  .ps-barra { height: 18px; }
  #ps-comprar { padding: .5em 1em; font-size: .72rem; min-height: 40px; }
  .ps-pistas { flex: 1; min-height: 0; }
  .ps-etq { grid-template-rows: 22px 1fr 1fr; }
  .ps-track { height: 100%; padding-bottom: 4px; }
  .ps-col { flex-basis: 92px; grid-template-rows: 22px 1fr 1fr; }
  .ps-cell { min-height: 0; padding: 4px; gap: 2px; }
  .ps-prem canvas { width: 50px !important; height: 50px !important; }
  .ps-prem b { font-size: .9rem; }
  .ps-prem small { font-size: .54rem; }
  .ps-cell .btn.tiny { min-height: 32px; padding: .3em .6em; }
  .pase-box > .hint { display: none; }
}
@media (max-width: 560px) {
  #modal-pase { padding: 0; }
  .box.pase-box { width: 100%; height: 100dvh; max-height: none; border-radius: 0; padding: max(10px, env(safe-area-inset-top)) 12px 12px; }
  .pase-box::before { display: none; }
  .pase-box .box-head { flex-wrap: wrap; row-gap: 2px; }
  .pase-box .box-head h2 { font-size: 1.05rem; }
  .pase-box .box-head .hint { order: 3; flex: 1 1 100%; }
  .pase-box .box-head [data-close] { min-width: 40px; min-height: 40px; }
  #ps-comprar { flex: 1 1 100%; min-height: 46px; }
  .ps-col { flex-basis: 100px; }
  .ps-cell { min-height: 150px; }
  .ps-cell .btn.tiny { min-height: 36px; }
}

/* ---------------- sala en el movil: a pantalla completa, los dos equipos a la vista y EMPEZAR / LISTO siempre abajo ---------------- */
@media (max-height: 520px) and (min-width: 560px), (max-width: 700px) {
  .panel.lobby { left: 0; top: 0; transform: none; width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; }
  .panel.lobby::before { display: none; }
  .lobby-scroll { display: block; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(10px, env(safe-area-inset-left)); }
  .lobby-actions { flex: none; z-index: 5; margin: 0; padding: 8px max(10px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); background: linear-gradient(180deg, rgba(12,16,30,.96), #070a14); box-shadow: 0 -10px 24px rgba(0,0,0,.5), inset 0 1px 0 var(--line2); }
  .lobby-actions .btn { min-height: 42px; }
  .lobby-actions .btn.big { padding: .6em 1.3em; font-size: .9rem; }
  #btn-copy, .team-col .switch, .member .btn.tiny { min-height: 36px; }
  .gb-room-opts select { min-height: 40px; }
  .gb-arrow { width: 40px; height: 40px; }
  .gb-tile { min-height: 56px; }
}
@media (max-height: 520px) and (min-width: 560px) {
  .lobby-head h2 { font-size: 1.05rem; }
  .code { font-size: .74rem; }
  .code b { font-size: .95rem; }
  .code .hint { display: none; }
  #lobby-mode-desc { margin: .1em 0 .4em; font-size: .7rem; }
  .teams { grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr); gap: 8px; margin: .2rem 0; }
  .vs { display: block; font-size: 1.3rem; }
  .team-col { padding: 6px; border-radius: 12px; }
  .team-col h3 { font-size: .62rem; margin-bottom: 5px; }
  .team-col .switch { margin-top: 5px; font-size: .7rem; }
  .members { gap: 5px; }
  .member { min-height: 88px; --cut: 9px; }
  .member .pair { height: 52px; }
  .member canvas { width: 38px; height: 44px; }
  .member canvas.mon { width: 46px; height: 46px; }
  .member .nm { font-size: .58rem; padding: .3em .45em; }
  .member .nm small { font-size: .56rem; }
  .gb-room-mid { padding: 6px; gap: 5px; border-radius: 12px; }
  .gb-map-pic { height: 66px; }
  .gb-map-name { font-size: .64rem; }
  .gb-lower { grid-template-columns: minmax(0, 1fr) 230px; gap: 8px; margin-bottom: 4px; }
  .gb-picker { grid-template-columns: minmax(0, 1fr) 170px; padding: 6px; gap: 6px; }
  .gb-pick-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); max-height: 168px; }
  .gb-show-pic { height: 84px; }
  .gb-show-pic canvas { width: 80px; height: 80px; }
  .gb-show-shots { font-size: .62rem; }
  .lobby-chat, .gb-lower .lobby-chat { padding: 6px; }
  .chat-log { min-height: 70px; max-height: 120px; font-size: .74rem; }
}
@media (max-width: 700px) and (min-height: 521px) {
  .lobby-head h2 { font-size: 1.15rem; }
  .members { grid-template-columns: 1fr 1fr; }
  .gb-picker { grid-template-columns: 1fr; }
  .gb-pick-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-height: none; }
  .lobby-actions { flex-wrap: wrap; row-gap: 6px; }
  .lobby-actions .host-only { flex: 1 1 100%; flex-wrap: wrap; }
  .lobby-actions .grow { display: none; }
  .lobby-actions > .btn { flex: 1; }
}
/* LISTO / ESPERANDO arriba a la izquierda (abajo tapaba el nombre); el anfitrion nunca lo lleva */
.member .ready-tag { top: 6px; left: 8px; right: auto; bottom: auto; }
@media (max-width: 700px) and (min-height: 521px) { .gb-map-pic { height: 88px; } }
/* resultados en el movil en horizontal y el aviso de girar: botones de 40 px o mas */
@media (max-height: 520px) { .fin-botones .btn { min-height: 40px; } }
.girar .btn.link { min-height: 44px; padding: 0 1em; }

/* ---------------- registro en el movil ---------------- */
@media (max-height: 520px) and (min-width: 560px) {
  #screen-register .panel { left: 0; top: 0; transform: none; width: 100%; max-width: none; height: 100dvh; max-height: none; border-radius: 0; padding: 8px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left)); animation: none; overflow-y: auto; }
  #screen-register .panel::before { display: none; }
  #screen-register .logo.small .logo-img { height: 26px; }
  #screen-register .sub { font-size: .72rem; margin: .2em 0; padding-right: 150px; }
  .reg-lang { top: 8px; right: 12px; }
  .reg-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; margin-top: 6px; }
  .reg-grid .card { padding: 8px 10px; }
  .reg-grid .card h3 { font-size: .7rem; margin-bottom: 4px; }
  .reg-grid .card:first-child { display: grid; grid-template-columns: 118px minmax(0, 1fr); column-gap: 10px; align-content: start; }
  .reg-grid .card:first-child h3 { grid-column: 1 / -1; }
  .reg-grid .card:first-child #reg-avatar { grid-row: 2 / span 3; width: 118px; height: 132px; margin: 0; }
  .reg-grid .card:first-child label { margin: 0 0 6px; }
  .reg-grid .card:first-child .hint { font-size: .66rem; margin: 0; }
  .starters { gap: 6px; }
  .starter { padding: .35em; }
  .starter canvas { max-width: 74px; }
  .starter b { font-size: .66rem; }
  .starter small { font-size: .56rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .reg-grid .card:last-child .hint { font-size: .64rem; margin: .3em 0; }
  #reg-go { margin-top: .4rem; min-height: 46px; padding: .5em 1em; }
  #reg-wallet, #reg-correo { min-height: 40px; font-size: .74rem; }
}
@media (max-width: 560px) {
  #screen-register .panel { left: 0; top: 0; transform: none; width: 100%; max-width: none; min-height: 100dvh; max-height: none; border-radius: 0; padding: max(12px, env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom)); animation: none; overflow: visible; position: relative; }
  #screen-register .panel::before { display: none; }
  .reg-grid .card:first-child { display: grid; grid-template-columns: 120px minmax(0, 1fr); column-gap: 12px; align-content: start; }
  .reg-grid .card:first-child h3 { grid-column: 1 / -1; }
  .reg-grid .card:first-child #reg-avatar { grid-row: 2 / span 3; width: 120px; height: 136px; margin: 0; }
  .reg-grid .card:first-child label { margin: 0 0 8px; }
  .reg-grid .card:first-child .hint { font-size: .7rem; margin: 0; }
  .starters { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .starter { padding: .4em .3em; }
  .starter b { font-size: .64rem; overflow-wrap: anywhere; }
  .starter small { font-size: .6rem; }
  .reg-grid, .reg-grid .card { min-width: 0; }
  .reg-grid input { width: 100%; min-width: 0; }
  .starter canvas { max-width: 90px; }
  #reg-go { min-height: 52px; }
  #reg-wallet, #reg-correo { min-height: 44px; }
}
@media (max-width: 380px) { .starter b { font-size: .56rem; } }

/* ---------------- Campaña en el movil en horizontal: el mapa y el panel del stage lado a lado, sin deslizar ---------------- */
@media (max-height: 520px) and (min-width: 560px) {
  #screen-campana { overflow: hidden; display: none; }
  #screen-campana.active { display: flex; flex-direction: column; }
  .camp-bg, .camp-shade { position: absolute; }
  .camp-top { flex: none; padding: 6px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left)); gap: 10px; }
  .camp-top .btn { min-height: 40px; }
  .camp-top h1 { font-size: 1.05rem; }
  .camp-regiones { flex: none; padding: 2px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
  .camp-reg { padding: 4px 10px 4px 8px; min-height: 40px; }
  .camp-reg b { font-size: .86rem; }
  .camp-reg span { font-size: .66rem; }
  .camp-body { flex: 1; min-height: 0; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 34%); gap: 8px; padding: 0 max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .camp-stages { min-height: 0; }
  .camp-panel { min-height: 0; overflow-y: auto; padding: 10px; gap: 7px; }
  .camp-ph h2 { font-size: 1.05rem; }
  .camp-sec { padding: 6px 8px; }
  .camp-panel .btn.big { padding: .6em; min-height: 46px; }
  .camp-nodo { width: 40px; height: 40px; font-size: .8rem; }
  .camp-nodo.jefe { width: 48px; height: 48px; }
}

/* ---------------- instalar en iPhone (ayuda de Compartir y Añadir a pantalla de inicio) ---------------- */
.ios-box { width: 420px; }
.ios-app { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 10px; background: rgba(255,255,255,.04); border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.ios-app img { width: 60px; height: 60px; border-radius: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.45); }
.ios-app b { display: block; font-family: var(--display); font-weight: 900; }
.ios-app small { color: var(--tx2); font-size: .8rem; }
.ios-pasos { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: paso; }
.ios-pasos li { counter-increment: paso; display: grid; grid-template-columns: 28px 30px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 12px; font-size: .9rem; color: var(--tx2); background: rgba(255,255,255,.03); border-radius: 12px; }
.ios-pasos li::before { content: counter(paso); width: 26px; height: 26px; display: grid; place-items: center; font-family: var(--display); font-weight: 900; font-size: .75rem; color: var(--acc-ink); background: var(--acc); border-radius: 50%; }
.ios-pasos .ui-ico { font-size: 1.4rem; color: #5aa9ff; }
.ios-pasos b { color: var(--tx); }
.ios-box > .btn { width: 100%; min-height: 46px; }
.gb-tile small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pre-pie-movil:empty { display: none; }
@media (max-width: 599px) { .pk-box .box-head .pk-hint { order: 3; flex: 1 1 100%; } }

/* ---------- POKI, la meme de POKEBOOM (js/poki.js) ---------- */
/* arranque: POKI saltando encima del logo */
.boot-poki { width: 150px; height: auto; filter: drop-shadow(0 12px 18px rgba(0,0,0,.5)); animation: poki-bota 1.1s ease-in-out infinite; }
.boot-poki-txt { color: #f4a38f !important; font-family: var(--display); letter-spacing: .02em !important; margin-bottom: -10px; }
@keyframes poki-bota { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-16px) scale(.97, 1.03); } 55% { transform: translateY(-16px); } 90% { transform: translateY(0) scale(1.05, .95); } }
/* menu: POKI al lado del entrenador, abajo a la derecha de su tarjeta */
.menu-hero { z-index: 1; }
.poki-compa { --w: clamp(100px, 19vh, 170px); position: absolute; z-index: 3; bottom: 78px; left: min(calc(50% + min(64vh, 560px) * .685 / 2 - var(--w) * .26), calc(100% - var(--w)));
  width: var(--w); padding: 0; border: 0; background: none; cursor: pointer; transform-origin: 50% 100%; animation: poki-respira 3.2s ease-in-out infinite; }
.poki-compa img { width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0,0,0,.55)); pointer-events: none; }
.poki-compa.salta { animation: poki-salta .7s cubic-bezier(.2, 1.4, .4, 1), poki-respira 3.2s ease-in-out .7s infinite; }
@keyframes poki-respira { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, .97); } }
@keyframes poki-salta { 0% { transform: scale(1); } 15% { transform: scale(1.12, .86); } 45% { transform: translateY(-26px) scale(.94, 1.08) rotate(-4deg); } 75% { transform: translateY(0) scale(1.05, .95); } 100% { transform: scale(1); } }
.poki-globo { position: absolute; bottom: 92%; left: 50%; translate: -50% 0; width: max-content; max-width: 190px; padding: 7px 11px; border-radius: 14px;
  background: #fff8ef; color: #2a1100; font: 800 .74rem/1.25 var(--display); text-align: center; box-shadow: 0 6px 16px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(8px) scale(.9); transition: opacity .2s, transform .25s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; }
.poki-globo::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff8ef; }
.poki-globo.ve { opacity: 1; transform: none; }
.poki-candado { position: absolute; left: 50%; bottom: -4px; translate: -50% 100%; width: max-content; max-width: var(--w); padding: 4px 9px; border-radius: 10px;
  background: rgba(5,7,13,.78); box-shadow: inset 0 0 0 1px rgba(255,122,26,.55); color: #ffb347; font: 700 .56rem/1.3 var(--display); letter-spacing: .04em; text-transform: uppercase; text-align: center; text-wrap: balance; }
.poki-candado::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 4px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url(/img/ui/lock-simple.svg) center / contain no-repeat; mask: url(/img/ui/lock-simple.svg) center / contain no-repeat; }
.poki-compa.holder .poki-candado { display: none; }
.poki-chispa { position: absolute; left: 50%; top: 38%; width: 7px; height: 7px; border-radius: 50%; background: #ffd34d; box-shadow: 0 0 8px #ff7a1a; pointer-events: none;
  animation: poki-chispa .65s ease-out forwards; }
@keyframes poki-chispa { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@media (max-height: 520px) and (orientation: landscape) {
  .poki-compa { --w: 84px; bottom: 50px; left: calc(50% + (100dvh - 114px) * .685 / 2 - 30px); }
  .poki-candado { display: none; }
}
@media (max-width: 700px) and (orientation: portrait) {
  .poki-compa { --w: 92px; bottom: 54px; left: auto; right: 4px; }
  /* en vertical no cabe la frase al lado de la chapa de "Tu Pokemon": queda la pastilla corta con el candado */
  .poki-candado { font-size: 0; letter-spacing: 0; white-space: nowrap; }
  .poki-candado::after { content: '$POKI'; font-size: .56rem; letter-spacing: .04em; }
}
@media (prefers-reduced-motion: reduce) { .boot-poki, .poki-compa { animation: none; } }

/* POKI en la ficha de Tus Pokemon (bloqueado para quien no tiene $POKI) y en el final de partida */
.pk-holder { display: grid; gap: 8px; }
.pk-holder p { display: flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--display); font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #ffb347; }
.pk-holder-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-holder-btns .btn { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; min-height: 46px; padding: .55em .7em;
  font-family: var(--display); font-weight: 800; font-size: .7rem; line-height: 1.2; letter-spacing: .03em; text-transform: uppercase; text-wrap: balance; }
.fin-escena .fin-poki { position: absolute; right: 0; top: -7%; height: 30%; margin: 0; rotate: 10deg; animation: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.5)); }
.fin.gano .fin-escena .fin-poki { animation: poki-salta 1s cubic-bezier(.2, 1.4, .4, 1) .4s both; }
