/* ===========================================================================
 * LA ARENA DE MASCOTAS: el panel de entrada y el HUD de combate (2026-11-17)
 *
 * "El hub no tiene un estilo como el del juego ni iconos originales… no se
 * adapta a todo tipo de resolución en móviles o PC… el panel no es igual a
 * los del juego y está desordenado: deja solo lo utilizable… no quiero feos
 * gráficos ni simples."
 *
 * EL ESTILO es el de los paneles del juego (gf-hud.css): cristal ciruela con
 * filo de oro, títulos de oro con su brillo, el cerrar redondo que se pone
 * rojo y gira, botones de oro con su canto. Los iconos son propios
 * (Game/Source/arena, tools/generar-iconos-arena.py: la misma mano que los
 * del HUD). Ni un emoji: cada sistema los pinta a su manera.
 *
 * LO QUE SE VE EN COMBATE va SIN `backdrop-filter` (sobre un lienzo que se
 * repinta 60 veces por segundo, el desenfoque se recalcula 60 veces por
 * segundo) y sin bucles decorativos infinitos: lo que avisa (el súper listo,
 * el gas) late unas pocas veces y se para. Lo único que gira sin parar es lo
 * que dice "estoy esperando" (buscando partida, reconectando).
 *
 * TAMAÑOS: tres casos con reglas propias, además del normal: el teléfono
 * TUMBADO (poco alto), el teléfono DE PIE (.vertical, lo pone la escena) y
 * las pantallas grandes. Las zonas seguras (la muesca) con env().
 *
 * QUIÉN LO MUEVE: Scenes/BattleScene.js (los ids bz*) y
 * GameScene.openBattleHub (los ids battleHub*). Las clases son todas `ga-*`;
 * las viejas (.bz-*, .battle-hub-card) siguen en styless.css sin uso.
 * ======================================================================== */

:root {
  --ga-fondo: var(--gfh-fondo, linear-gradient(165deg, rgba(42, 34, 66, .97) 0%, rgba(24, 20, 40, .97) 52%, rgba(14, 12, 25, .98) 100%));
  --ga-cristal: linear-gradient(165deg, rgba(42, 34, 66, .86) 0%, rgba(24, 20, 40, .86) 60%, rgba(14, 12, 25, .9) 100%);
  --ga-boton: radial-gradient(circle at 34% 26%, #4d4172 0%, #261f3e 52%, #141120 100%);
  --ga-oro: var(--gfh-oro, #f2c35c);
  --ga-oro-claro: var(--gfh-oro-claro, #ffe2a0);
  --ga-oro-osc: var(--gfh-oro-osc, #a8742a);
  --ga-borde: var(--gfh-borde, rgba(242, 195, 92, .58));
  --ga-borde-suave: var(--gfh-borde-suave, rgba(242, 195, 92, .22));
  --ga-texto: var(--gfh-texto, #fff4dd);
  --ga-texto-2: var(--gfh-texto-2, rgba(255, 236, 204, .72));
  --ga-verde: #7be884;
  --ga-rival: #ffb0a6;
  --ga-sombra: var(--gfh-sombra, 0 18px 44px rgba(0, 0, 0, .62), 0 0 0 1px rgba(0, 0, 0, .35));
  --ga-radio: var(--gfh-radio, 16px);
  --ga-fuente: var(--gfh-fuente, 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', sans-serif);
  --ga-pixel: 'PressStart2P', monospace;
  --ga-arriba: max(8px, env(safe-area-inset-top));
  --ga-izq: max(10px, env(safe-area-inset-left));
  --ga-der: max(10px, env(safe-area-inset-right));
  --ga-abajo: max(10px, env(safe-area-inset-bottom));
}

@keyframes ga-abre   { from { opacity: 0; transform: translateY(14px) scale(.95); } }
@keyframes ga-entra  { from { opacity: 0; transform: translateX(18px); } }
@keyframes ga-pop    { from { opacity: 0; transform: translate(-50%, -50%) scale(1.7); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
@keyframes ga-pop-peque { from { opacity: 0; transform: translate(-50%, -50%) translateY(10px) scale(.9); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes ga-late   { 50% { transform: scale(1.08); } }
@keyframes ga-sacude { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes ga-gira   { to { transform: rotate(360deg); } }
@keyframes ga-busca  { 0% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(5px, -4px) rotate(8deg); } 50% { transform: translate(0, -7px) rotate(0); } 75% { transform: translate(-5px, -4px) rotate(-8deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes ga-movil  { 0%, 15% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@keyframes ga-gas-latido { 50% { opacity: .55; } }

/* ─────────────────────────────────────────────── LO COMÚN: CABECERA Y BOTONES */
.ga-cab {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px 10px 14px;
  background: linear-gradient(180deg, rgba(255, 226, 160, .10), rgba(255, 226, 160, .02));
  border-bottom: 1px solid var(--ga-borde-suave);
}
.ga-cab::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ga-oro-claro), transparent);
  opacity: .75;
  pointer-events: none;
}
.ga-cab-icono {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55));
}
.ga-titulo {
  margin: 0;
  color: var(--ga-oro-claro);
  font: 800 clamp(16px, 1.2vw + 11px, 20px)/1.2 var(--ga-fuente);
  letter-spacing: .06em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .8), 0 0 14px rgba(255, 196, 90, .35);
}
.ga-cab .ga-titulo {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ga-texto {
  margin: 0;
  color: var(--ga-texto-2);
  font-size: 13px;
  line-height: 1.45;
}

.ga-cerrar {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #4d4172, #1b1630 70%);
  border: 1.5px solid var(--ga-borde);
  color: var(--ga-oro-claro);
  font: 700 15px/1 var(--ga-fuente);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .14);
  cursor: pointer;
  transition: transform .15s cubic-bezier(.2, .9, .3, 1.5), background .15s, color .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .ga-cerrar:hover {
    background: radial-gradient(circle at 34% 26%, #ff7a6c, #b0302a 70%);
    color: #fff;
    transform: rotate(90deg) scale(1.08);
  }
}
.ga-cerrar:active { transform: scale(.9); }

/* Los botones de acción: oro con su canto (como los de los paneles). */
.ga-boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid #ffe9b0;
  background: linear-gradient(180deg, #ffd77a, #c98a2c);
  color: #2a1606;
  font: 800 14px/1.15 var(--ga-fuente);
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
  box-shadow: 0 3px 0 #7a4f17, 0 6px 12px rgba(0, 0, 0, .35);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .12s ease, filter .12s ease, box-shadow .12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ga-boton img { width: 22px; height: 22px; flex: 0 0 auto; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .45)); }
@media (hover: hover) { .ga-boton:hover { filter: brightness(1.08); transform: translateY(-1px); } }
.ga-boton:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a4f17, 0 2px 6px rgba(0, 0, 0, .3); }
.ga-boton-sec {
  background: var(--ga-boton);
  border: 1.5px solid var(--ga-borde);
  color: var(--ga-oro-claro);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7);
  box-shadow: 0 3px 0 #0c0a14, 0 6px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.ga-boton-sec:active { box-shadow: 0 1px 0 #0c0a14, inset 0 1px 0 rgba(255, 255, 255, .12); }
.ga-boton-verde {
  background: linear-gradient(180deg, #a3f5a5, #3fae52);
  border-color: #dcffd6;
  color: #062a10;
  box-shadow: 0 3px 0 #1d5a28, 0 6px 12px rgba(0, 0, 0, .35);
}
.ga-boton-verde.activo {
  background: linear-gradient(180deg, #2f7a3f, #1d5a2b);
  border-color: rgba(190, 255, 190, .6);
  color: #d4ffd8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .6);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .45), 0 1px 0 #0e2e15;
}
.ga-cerrar:focus-visible,
.ga-boton:focus-visible,
.ga-modo:focus-visible,
.ga-enlace:focus-visible,
.ga-redondo:focus-visible,
.ga-super:focus-visible {
  outline: 3px solid rgba(255, 210, 74, .85);
  outline-offset: 2px;
}

/* La barra de vida (la del hub y la tuya en combate): la del HUD del mapa. */
.ga-vida {
  position: relative;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(20, 16, 30, .7));
  border: 1px solid rgba(255, 236, 204, .16);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55);
}
.ga-vida > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, #9cf3a3 0%, #42c158 55%, #24873b 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .25);
  transition: width .35s cubic-bezier(.2, .9, .3, 1);
}
.ga-vida.media > i, .ga-vida > i.media { background: linear-gradient(180deg, #ffe596 0%, #e8bf3a 55%, #b98d16 100%); }
.ga-vida.baja > i,  .ga-vida > i.baja  { background: linear-gradient(180deg, #ff8a78 0%, #e0453a 55%, #b22a24 100%); }
.ga-vida > b {
  position: relative;
  display: block;
  text-align: center;
  color: #fff;
  font: 800 11px/14px var(--ga-fuente);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .9);
  white-space: nowrap;
}

.ga-retrato {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid var(--ga-oro);
  background: radial-gradient(circle at 50% 30%, #3a3160, #17132a);
  box-shadow: 0 0 0 3px rgba(12, 10, 20, .6), 0 0 14px rgba(255, 200, 90, .3), inset 0 0 12px rgba(0, 0, 0, .6);
}
.ga-retrato img {
  width: 86%;
  height: 86%;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .6));
}
.ga-mascota-nombre {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ga-texto);
  font: 800 15px/1.2 var(--ga-fuente);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7);
}
.ga-mascota-nombre > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ga-nivel {
  flex: 0 0 auto;
  padding: 3px 6px 2px;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffd77a, #c98a2c);
  border: 1px solid #ffe9b0;
  color: #2a1606;
  font: 400 8px/1.25 var(--ga-pixel);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
}
.ga-nivel:empty { display: none; }

/* ──────────────────────────────────────────────────── EL PANEL DE ENTRADA */
html body #battleHubOverlay.ga-hub {
  background: rgba(8, 6, 16, .6);
  padding: max(10px, env(safe-area-inset-top)) var(--ga-der) max(10px, env(safe-area-inset-bottom)) var(--ga-izq);
}
.ga-hub-caja {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 460px);
  max-height: 100%;
  overflow: hidden;
  background: var(--ga-fondo);
  border: 1.5px solid var(--ga-borde);
  border-radius: var(--ga-radio);
  box-shadow: var(--ga-sombra), inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 40px rgba(255, 200, 120, .03);
  color: var(--ga-texto);
  font-family: var(--ga-fuente);
  animation: ga-abre .32s cubic-bezier(.2, .9, .3, 1.25) backwards;
}
.ga-hub-cuerpo {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "mascota" "modos" "ranking";
  gap: 12px;
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.ga-mascota {
  grid-area: mascota;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 238, 205, .05);
  border: 1px solid var(--ga-borde-suave);
}
.ga-mascota-datos { flex: 1 1 auto; min-width: 0; }
.ga-mascota .ga-vida { margin-top: 7px; }
.ga-mascota small {
  display: block;
  margin-top: 5px;
  color: var(--ga-texto-2);
  font-size: 12px;
  line-height: 1.3;
}

.ga-modos { grid-area: modos; display: grid; gap: 10px; }
.ga-modo {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 66px;
  padding: 9px 14px 9px 9px;
  border-radius: 14px;
  border: 1px solid var(--ga-borde-suave);
  background: linear-gradient(180deg, rgba(255, 238, 205, .09), rgba(255, 238, 205, .03));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 4px 12px rgba(0, 0, 0, .32);
  color: var(--ga-texto);
  font-family: var(--ga-fuente);
  text-align: left;
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.35), border-color .15s, box-shadow .15s, background .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ga-modo-icono {
  width: 48px;
  height: 48px;
  padding: 4px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ga-boton);
  border: 1.5px solid var(--ga-borde);
  box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.ga-modo-icono img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55));
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.4);
}
.ga-modo .btn-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ga-modo strong {
  color: var(--ga-oro-claro);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .75);
}
.ga-modo small { color: var(--ga-texto-2); font-size: 12px; line-height: 1.3; }
.ga-modo-flecha {
  width: 10px;
  height: 10px;
  margin-right: 4px;
  border-right: 2.5px solid var(--ga-oro);
  border-bottom: 2.5px solid var(--ga-oro);
  transform: rotate(-45deg);
  opacity: .8;
  transition: transform .18s ease;
}
@media (hover: hover) {
  .ga-modo:hover {
    transform: translateY(-2px);
    border-color: var(--ga-borde);
    background: linear-gradient(180deg, rgba(255, 210, 120, .18), rgba(255, 210, 120, .05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 18px rgba(0, 0, 0, .4), 0 0 18px rgba(255, 200, 90, .2);
  }
  .ga-modo:hover .ga-modo-icono img { transform: rotate(-6deg) scale(1.08); }
  .ga-modo:hover .ga-modo-flecha { transform: translateX(3px) rotate(-45deg); }
}
.ga-modo:active { transform: scale(.98); transition-duration: .08s; }
.ga-modo.agotado { cursor: not-allowed; opacity: .7; filter: saturate(.4); }
.ga-modo.agotado:hover { transform: none; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 4px 12px rgba(0, 0, 0, .32); }
.ga-chip {
  padding: 6px 8px 5px;
  border-radius: 999px;
  border: 1px solid #ffe9b0;
  background: linear-gradient(180deg, #ffd77a, #c98a2c);
  color: #2a1606;
  font: 400 10px/1 var(--ga-pixel);
  box-shadow: 0 2px 0 #7a4f17;
  white-space: nowrap;
}
.ga-chip.agotado {
  border-color: rgba(255, 236, 204, .25);
  background: linear-gradient(180deg, #5a5068, #3a3348);
  color: var(--ga-texto-2);
  box-shadow: 0 2px 0 #1d1828;
}

.ga-enlace {
  grid-area: ranking;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 46px;
  padding: 7px 14px;
  border-radius: 12px;
  border: 1px solid var(--ga-borde-suave);
  background: rgba(0, 0, 0, .22);
  color: var(--ga-oro-claro);
  font: 800 14px/1 var(--ga-fuente);
  letter-spacing: .04em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ga-enlace img { width: 28px; height: 28px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
@media (hover: hover) { .ga-enlace:hover { background: rgba(255, 210, 120, .12); border-color: var(--ga-borde); } }
.ga-enlace:active { transform: scale(.98); }

/* El teléfono tumbado: dos columnas (tu mascota a la izquierda, los modos a la derecha). */
@media (max-height: 540px) and (min-width: 600px) {
  .ga-hub-caja { width: min(100%, 760px); }
  .ga-cab { padding: 7px 10px 7px 12px; }
  .ga-cab-icono { width: 30px; height: 30px; }
  .ga-hub-cuerpo {
    grid-template-columns: minmax(210px, .85fr) minmax(0, 1.3fr);
    grid-template-areas: "mascota modos" "ranking modos";
    align-items: start;
    gap: 10px 12px;
    padding: 10px 12px;
  }
  .ga-mascota { flex-direction: column; text-align: center; padding: 10px; }
  .ga-mascota-datos { width: 100%; }
  .ga-mascota-nombre { justify-content: center; }
  .ga-modos { gap: 8px; }
  .ga-modo { min-height: 56px; padding: 6px 12px 6px 7px; gap: 10px; }
  .ga-modo-icono { width: 42px; height: 42px; }
}
@media (max-height: 380px) and (min-width: 600px) {
  .ga-mascota .ga-retrato { width: 48px; height: 48px; }
  .ga-mascota small { display: none; }
  .ga-modo { min-height: 50px; }
  .ga-modo small { font-size: 11px; }
  .ga-enlace { min-height: 40px; }
}

/* ──────────────────────────────────────────────── LA CLASIFICACIÓN (vestido) */
html body .battle-rank-overlay { background: rgba(8, 6, 16, .62); }
html body .battle-rank-card {
  padding: 0;
  overflow: hidden;
  background: var(--ga-fondo);
  border: 1.5px solid var(--ga-borde);
  border-radius: var(--ga-radio);
  box-shadow: var(--ga-sombra), inset 0 1px 0 rgba(255, 255, 255, .08);
  color: var(--ga-texto);
  font-family: var(--ga-fuente);
  animation: ga-abre .32s cubic-bezier(.2, .9, .3, 1.25) backwards;
}
html body .battle-rank-head {
  position: relative;
  padding: 10px 12px 9px 14px;
  background: linear-gradient(180deg, rgba(255, 226, 160, .10), rgba(255, 226, 160, .02));
  border-bottom: 1px solid var(--ga-borde-suave);
}
html body .battle-rank-head::after {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--ga-oro-claro), transparent);
  opacity: .75;
}
html body .battle-rank-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ga-oro-claro);
  font-weight: 800;
  letter-spacing: .06em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .8), 0 0 14px rgba(255, 196, 90, .35);
}
html body .battle-rank-head h2 img { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
html body .battle-rank-season { margin: 10px 14px 8px; color: var(--ga-texto-2); }
html body .battle-rank-scroll {
  margin: 0 14px;
  border: 1px solid var(--ga-borde-suave);
  border-radius: 12px;
  background: rgba(0, 0, 0, .2);
}
html body .battle-rank-table thead th {
  background: #2a2240;
  color: var(--ga-oro-claro);
  border-bottom: 1px solid var(--ga-borde-suave);
}
html body .battle-rank-table td { border-top-color: rgba(255, 236, 204, .07); }
html body .battle-rank-table tbody tr:nth-child(odd) { background: rgba(255, 238, 205, .03); }
html body .battle-rank-table tbody tr.rank-self { background: rgba(242, 195, 92, .16); box-shadow: inset 3px 0 0 var(--ga-oro); }
html body .battle-rank-table .rank-pos { color: var(--ga-oro); }
html body .battle-rank-table .rank-pts { color: var(--ga-oro-claro); }
html body .battle-rank-table .rank-won { color: #9ff3a6; }
html body .battle-rank-table .rank-lost { color: #ffa99e; }
html body .battle-rank-table .rank-addr,
html body .battle-rank-table .rank-loading { color: var(--ga-texto-2); }
html body .battle-rank-foot { padding: 12px 14px 14px; color: var(--ga-texto-2); }
html body .rank-chip { background: rgba(255, 238, 205, .06); border-color: var(--ga-borde-suave); }
html body .rank-me-label, html body .rank-chip-pos { color: var(--ga-oro); }
html body .battle-rank-refresh { min-height: 38px; padding: 7px 16px; }
html body .battle-rank-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
html body .battle-rank-scroll::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--ga-oro), var(--ga-oro-osc)); border-radius: 8px; }
html body .battle-rank-scroll::-webkit-scrollbar-track { background: rgba(0, 0, 0, .3); }

/* ──────────────────────────────────────────────── EL AVISO DE GIRAR EL TELÉFONO */
html body .battle-rotate-notice:not(.hidden) { background: rgba(8, 6, 16, .95); color: var(--ga-texto); }
html body .battle-rotate-inner {
  padding: 22px 20px 20px;
  background: var(--ga-fondo);
  border: 1.5px solid var(--ga-borde);
  border-radius: var(--ga-radio);
  box-shadow: var(--ga-sombra), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-family: var(--ga-fuente);
  animation: ga-abre .32s cubic-bezier(.2, .9, .3, 1.25) backwards;
}
html body .battle-rotate-icono {
  display: block;
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5));
  animation: ga-movil 2s ease-in-out 3;
}
html body .battle-rotate-notice p { color: var(--ga-texto); font-weight: 600; }
html body .battle-rotate-seguir { margin-top: 16px; }

/* ──────────────────────────────────────────────────── EL HUD DE COMBATE */
html body #battleUI.ga-ui {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow: hidden;
  pointer-events: none;
  color: var(--ga-texto);
  font-family: var(--ga-fuente);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.ga-ui * { box-sizing: border-box; }
.ga-ui button { pointer-events: auto; font-family: inherit; }
.ga-ui img { -webkit-user-drag: none; }

/* El borde verde de estar dentro del gas. */
.ga-ui::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(90, 180, 70, 0) 48%, rgba(90, 180, 70, .5) 100%);
  transition: opacity .35s ease;
}
.ga-ui.en-gas::before { opacity: 1; animation: ga-gas-latido 1.1s ease-in-out 3; }

/* ── Arriba ── */
.ga-arriba {
  position: absolute;
  z-index: 3;
  top: var(--ga-arriba);
  left: var(--ga-izq);
  right: var(--ga-der);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-areas: "yo centro acciones";
  align-items: start;
  gap: 10px;
}
.ga-ui.buscando .ga-arriba,
.ga-ui.buscando .ga-pie,
.ga-ui.buscando .ga-tactil,
.ga-ui.buscando .ga-feed { display: none; }

.ga-yo {
  grid-area: yo;
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 9px;
  width: clamp(196px, 24vw, 300px);
  max-width: 100%;
  padding: 6px 10px 6px 6px;
  border-radius: 14px;
  background: var(--ga-cristal);
  border: 1.5px solid var(--ga-borde);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.ga-retrato-hud {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background-color: #2a2342;
  background-repeat: no-repeat;
  background-size: 84% auto;
  background-position: 50% 72%;
  image-rendering: pixelated;
  box-shadow: 0 0 0 3px rgba(12, 10, 20, .6), 0 0 12px rgba(255, 200, 90, .28), inset 0 0 10px rgba(0, 0, 0, .55);
}
.ga-yo-datos { flex: 1 1 auto; min-width: 0; }
.ga-yo .ga-mascota-nombre { font-size: 13px; }
.ga-yo .ga-vida { margin-top: 4px; height: 15px; }
.ga-yo .ga-vida > b { font-size: 10.5px; line-height: 13px; }
.ga-yo-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  margin-top: 4px;
}
.ga-dato, .ga-poder {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--ga-texto);
  font: 400 9px/1 var(--ga-pixel);
  text-shadow: 0 1px 0 #000;
}
.ga-dato img, .ga-poder img { width: 17px; height: 17px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); }
.ga-poder {
  padding: 2px 6px 2px 2px;
  border-radius: 999px;
  background: rgba(76, 201, 180, .2);
  border: 1px solid rgba(120, 230, 210, .6);
  color: #c9fff4;
}
.ga-poder-rapidez { background: rgba(123, 240, 212, .14); }

.ga-centro {
  grid-area: centro;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.ga-modo-txt {
  max-width: min(46vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ga-oro-claro);
  font: 800 11px/1.2 var(--ga-fuente);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #000, 0 0 10px rgba(0, 0, 0, .6);
}
.ga-marcador {
  display: flex;
  align-items: center;
  padding: 5px 4px;
  border-radius: 12px;
  background: var(--ga-cristal);
  border: 1.5px solid var(--ga-borde);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.ga-marca {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
}
.ga-marca + .ga-marca { border-left: 1px solid var(--ga-borde-suave); }
.ga-marca img { width: 20px; height: 20px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); }
.ga-marca b {
  min-width: 2ch;
  color: var(--ga-oro-claro);
  font: 400 13px/1 var(--ga-pixel);
  text-shadow: 0 2px 0 #2a1606;
}
#bzReloj.poco { color: #ff9d90; text-shadow: 0 2px 0 #3a0c08; }
.ga-gas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  border-radius: 999px;
  background: rgba(16, 30, 18, .82);
  border: 1px solid rgba(150, 220, 120, .4);
  color: #d9f7c8;
  font: 700 11px/1 var(--ga-fuente);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
}
.ga-gas img { width: 18px; height: 18px; }
.ga-gas.cerrando {
  border-color: rgba(190, 245, 150, .85);
  color: #e9ffd9;
  box-shadow: 0 0 12px rgba(120, 220, 90, .35);
}

.ga-acciones {
  grid-area: acciones;
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.ga-redondo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px 0 5px;
  border-radius: 999px;
  background: var(--ga-cristal);
  border: 1.5px solid var(--ga-borde);
  color: var(--ga-oro-claro);
  font: 800 13px/1 var(--ga-fuente);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
  white-space: nowrap;
  transition: transform .15s cubic-bezier(.2, .9, .3, 1.4), background .15s, border-color .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.ga-redondo img {
  width: 30px;
  height: 30px;
  padding: 3px;
  border-radius: 50%;
  background: var(--ga-boton);
  border: 1px solid var(--ga-borde-suave);
}
@media (hover: hover) { .ga-redondo:hover { transform: translateY(-1px); border-color: var(--ga-oro-claro); } }
.ga-redondo:active { transform: scale(.95); }
.ga-redondo.confirmar {
  background: linear-gradient(180deg, #e8483d, #b52a21);
  border-color: #ffc2b8;
  color: #fff;
  animation: ga-sacude .25s linear 1;
}

/* ── Quién ha tumbado a quién ── */
.ga-feed {
  position: absolute;
  z-index: 3;
  top: calc(var(--ga-arriba) + 52px);
  right: var(--ga-der);
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.ga-feed li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: min(46vw, 320px);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(14, 12, 25, .84);
  border: 1px solid var(--ga-borde-suave);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
  color: var(--ga-texto);
  font: 700 12px/1.2 var(--ga-fuente);
  text-shadow: 0 1px 0 #000;
  white-space: nowrap;
  animation: ga-entra .25s ease-out backwards;
  transition: opacity .4s ease, transform .4s ease;
}
.ga-feed li span { overflow: hidden; text-overflow: ellipsis; }
.ga-feed li img { width: 18px; height: 18px; flex: 0 0 auto; }
.ga-feed li .yo { color: var(--ga-verde); }
.ga-feed li .rival { color: var(--ga-rival); }
.ga-feed li.sale { opacity: 0; transform: translateX(16px); }

/* ── Los avisos ── */
.ga-aviso {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 31%;
  transform: translate(-50%, -50%);
  color: #fff;
  font: 400 clamp(26px, 7vmin, 52px)/1.2 var(--ga-pixel);
  text-align: center;
  white-space: nowrap;
  text-shadow: 3px 0 0 #2a1606, -3px 0 0 #2a1606, 0 3px 0 #2a1606, 0 -3px 0 #2a1606, 0 7px 0 rgba(0, 0, 0, .35);
}
.ga-aviso.oro { color: var(--ga-oro-claro); }
.ga-aviso.malo { color: #ff9d90; }
.ga-aviso.pop { animation: ga-pop .42s cubic-bezier(.2, .9, .3, 1.45) both; }
.ga-aviso.peque {
  top: 24%;
  width: max-content;
  max-width: min(88vw, 520px);
  padding: 9px 16px;
  border-radius: 12px;
  background: var(--ga-cristal);
  border: 1.5px solid var(--ga-borde);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45);
  color: var(--ga-oro-claro);
  font: 800 clamp(13px, 1.4vmin + 8px, 17px)/1.35 var(--ga-fuente);
  white-space: normal;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .75);
}
.ga-aviso.peque.pop { animation: ga-pop-peque .3s cubic-bezier(.2, .9, .3, 1.3) both; }

.ga-dolor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(224, 60, 50, 0) 52%, rgba(224, 60, 50, .55) 100%);
  transition: opacity .3s ease;
}
.ga-dolor.activo { opacity: 1; transition-duration: .04s; }

/* ── Estás en el gas: hacia dónde correr ── */
.ga-fuera {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: calc(var(--ga-arriba) + 104px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 460px);
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: rgba(16, 36, 18, .9);
  border: 1.5px solid rgba(170, 240, 130, .75);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  color: #e9ffd9;
  font: 800 13px/1.25 var(--ga-fuente);
  text-shadow: 0 1px 0 #000;
}
.ga-fuera.pronto {
  background: rgba(48, 36, 12, .9);
  border-color: rgba(255, 210, 90, .8);
  color: var(--ga-oro-claro);
}
.ga-flecha {
  position: relative;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ga-boton);
  border: 1.5px solid currentColor;
  transition: transform .15s ease;
}
.ga-flecha::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 12px;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: currentColor;
}
.ga-flecha::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 7.5px;
  border-left: 9px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

/* ── Sin conexión ── */
.ga-red {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: calc(var(--ga-arriba) + 150px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: rgba(60, 16, 14, .9);
  border: 1.5px solid rgba(255, 150, 130, .7);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
  color: #ffe3dc;
  font: 800 13px/1.2 var(--ga-fuente);
  white-space: nowrap;
}
.ga-red i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid #ffd2c8;
  border-top-color: transparent;
  animation: ga-gira .8s linear infinite;
}

/* ── Las tarjetas (buscando, caído, resultados) ── */
.ga-tarjeta {
  position: relative;
  width: min(100%, 440px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 16px;
  background: var(--ga-fondo);
  border: 1.5px solid var(--ga-borde);
  border-radius: var(--ga-radio);
  box-shadow: var(--ga-sombra), inset 0 1px 0 rgba(255, 255, 255, .08), inset 0 0 40px rgba(255, 200, 120, .03);
  color: var(--ga-texto);
  text-align: center;
  pointer-events: auto;
  animation: ga-abre .32s cubic-bezier(.2, .9, .3, 1.25) backwards;
}
.ga-tarjeta::-webkit-scrollbar { width: 8px; }
.ga-tarjeta::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--ga-oro), var(--ga-oro-osc)); border-radius: 8px; }
.ga-tarjeta::-webkit-scrollbar-track { background: rgba(0, 0, 0, .3); }
.ga-tarjeta .ga-titulo { margin: 6px 0 6px; }
.ga-botones {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.ga-busqueda {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: var(--ga-arriba) var(--ga-der) var(--ga-abajo) var(--ga-izq);
  background: radial-gradient(ellipse at 50% 50%, rgba(8, 6, 16, .22) 0%, rgba(8, 6, 16, .7) 100%);
  pointer-events: auto;
}
.ga-busq-icono {
  width: 64px;
  height: 64px;
  margin: 0 auto 4px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ga-boton);
  border: 2px solid var(--ga-borde);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5), 0 0 0 4px rgba(12, 10, 20, .45), inset 0 2px 0 rgba(255, 255, 255, .14);
}
.ga-busq-icono img { width: 70%; height: 70%; animation: ga-busca 2.4s ease-in-out infinite; }
.ga-busq-datos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.ga-pastilla {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--ga-borde-suave);
  color: var(--ga-oro-claro);
  font: 700 12px/1.2 var(--ga-fuente);
}
.ga-pastilla:empty { display: none; }
.ga-pastilla img { width: 16px; height: 16px; }
.ga-pastilla b { font: 400 10px/1 var(--ga-pixel); }

.ga-lobby {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.ga-lobby-fila {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 6px;
  border-radius: 11px;
  background: rgba(255, 238, 205, .05);
  border: 1px solid var(--ga-borde-suave);
}
.ga-lobby-fila.yo { border-color: var(--ga-borde); }
.ga-lobby-fila.listo { background: rgba(60, 140, 70, .26); border-color: rgba(150, 235, 150, .55); }
.ga-lobby-fila.bots { border-style: dashed; opacity: .85; }
.ga-lobby-retrato {
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: 9px;
  background: var(--ga-boton);
  border: 1px solid var(--ga-borde-suave);
  object-fit: contain;
  image-rendering: pixelated;
}
.ga-lobby-nombre {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ga-texto);
  font: 800 13px/1.25 var(--ga-fuente);
}
.ga-lobby-nombre small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ga-texto-2);
  font-size: 11px;
  font-weight: 600;
}
.ga-lobby-estado { color: #ffd38a; font: 400 8px/1 var(--ga-pixel); }
.ga-lobby-fila.listo .ga-lobby-estado { color: #a8ffab; }

.ga-consejos {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 10px 12px;
  list-style: none;
  text-align: left;
  background: rgba(0, 0, 0, .2);
  border: 1px solid var(--ga-borde-suave);
  border-radius: 12px;
}
.ga-consejos li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--ga-texto-2);
  font-size: 12.5px;
  line-height: 1.3;
}
.ga-consejos img { width: 22px; height: 22px; }
.ga-consejos b { color: var(--ga-oro-claro); }
.ga-consejos em { font-style: normal; }
.ga-ui.tactil .solo-pc, .ga-ui:not(.tactil) .solo-tactil { display: none; }
.ga-busq:has(.ga-lobby:not(.hidden)) .ga-consejos { display: none; }

.ga-caido {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--ga-arriba) var(--ga-der) max(16px, env(safe-area-inset-bottom)) var(--ga-izq);
  pointer-events: none;
}
.ga-tarjeta-peque { width: min(100%, 380px); padding: 14px 16px 14px; }
.ga-tarjeta-icono { display: block; width: 46px; height: 46px; margin: -4px auto 0; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }

/* ── Los resultados ── */
.ga-resultado {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: var(--ga-arriba) var(--ga-der) var(--ga-abajo) var(--ga-izq);
  background: rgba(8, 6, 16, .58);
  pointer-events: auto;
}
.ga-res {
  width: min(100%, 540px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "cab" "premios" "tabla" "botones";
  gap: 12px;
  text-align: left;
}
.ga-res-cab { grid-area: cab; display: flex; align-items: center; gap: 14px; min-width: 0; }
.ga-res-textos { min-width: 0; }
.ga-res-textos .ga-texto { margin-top: 6px; }
.ga-medalla {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #ffe9b0;
  background: linear-gradient(180deg, #ffe08a, #e0a630 60%, #a8742a);
  color: #2a1606;
  font: 400 15px/1 var(--ga-pixel);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .45);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 4px rgba(12, 10, 20, .5), inset 0 3px 0 rgba(255, 255, 255, .4), inset 0 -6px 10px rgba(0, 0, 0, .25);
}
.ga-medalla.oro { box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 0 4px rgba(12, 10, 20, .5), 0 0 22px rgba(255, 200, 90, .55), inset 0 3px 0 rgba(255, 255, 255, .4), inset 0 -6px 10px rgba(0, 0, 0, .25); }
.ga-medalla.plata { border-color: #fff; background: linear-gradient(180deg, #f4f6fa, #b9c2d0 60%, #7d8798); color: #1d2330; }
.ga-medalla.bronce { border-color: #ffd9b5; background: linear-gradient(180deg, #f2bf8e, #c27a3e 60%, #8a4d22); color: #2a1206; }
.ga-medalla.nada { border-color: var(--ga-borde); background: var(--ga-boton); color: var(--ga-oro-claro); text-shadow: 0 2px 0 #000; }
.ga-res-titulo {
  margin: 0;
  color: #fff;
  font: 400 clamp(15px, 1.6vmin + 9px, 22px)/1.3 var(--ga-pixel);
  text-shadow: 0 3px 0 #2a1606;
}
.ga-res-titulo.gana { color: var(--ga-oro-claro); text-shadow: 0 3px 0 #5a3a10, 0 0 18px rgba(255, 200, 90, .45); }
.ga-premios {
  grid-area: premios;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ga-premios li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 5px;
  border-radius: 999px;
  background: rgba(255, 238, 205, .06);
  border: 1px solid var(--ga-borde-suave);
  color: var(--ga-texto);
  font: 800 12.5px/1.2 var(--ga-fuente);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .7);
}
.ga-premios li img { width: 20px; height: 20px; }
.ga-premios li.oro { color: var(--ga-oro-claro); border-color: var(--ga-borde); }
.ga-premios li.verde { color: #a8f5ad; border-color: rgba(150, 235, 150, .45); }
.ga-tabla {
  grid-area: tabla;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-height: 0;
  max-height: min(42vh, 330px);
  margin: 0;
  padding: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  background: rgba(0, 0, 0, .22);
  border: 1px solid var(--ga-borde-suave);
  border-radius: 12px;
}
.ga-tabla::-webkit-scrollbar { width: 7px; }
.ga-tabla::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--ga-oro), var(--ga-oro-osc)); border-radius: 7px; }
.ga-tabla li {
  display: grid;
  grid-template-columns: 30px 32px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 6px;
  border-radius: 10px;
  background: rgba(255, 238, 205, .04);
  border: 1px solid transparent;
}
.ga-tabla li.yo { background: linear-gradient(90deg, rgba(242, 195, 92, .22), rgba(242, 195, 92, .05)); border-color: var(--ga-borde); }
.ga-tabla .pos { color: var(--ga-oro); font: 400 10px/1 var(--ga-pixel); text-align: center; }
.ga-tabla .avatar {
  width: 32px;
  height: 32px;
  padding: 2px;
  border-radius: 9px;
  background: var(--ga-boton);
  border: 1px solid var(--ga-borde-suave);
  object-fit: contain;
  image-rendering: pixelated;
}
.ga-tabla .quien {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ga-texto);
  font: 800 13px/1.2 var(--ga-fuente);
}
.ga-tabla .quien small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ga-texto-2);
  font-size: 11px;
  font-weight: 600;
}
.ga-tabla .num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ga-texto);
  font: 800 12px/1 var(--ga-fuente);
}
.ga-tabla .num img { width: 16px; height: 16px; }
.ga-res .ga-botones { grid-area: botones; margin-top: 0; }

/* ── Los mandos táctiles ── */
.ga-tactil { display: none; }
.ga-ui.tactil .ga-tactil {
  display: block;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.ga-ui.caido .ga-tactil,
.ga-ui.fin .ga-tactil { display: none; }
.ga-zona {
  position: absolute;
  bottom: 0;
  height: 70%;
  width: 50%;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.ga-zona-mover { left: 0; }
.ga-zona-disparo { right: 0; }
.ga-stick {
  position: absolute;
  width: 120px;
  height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 16, 30, .14) 0%, rgba(20, 16, 30, .42) 72%);
  border: 2px solid rgba(255, 226, 160, .38);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
  opacity: .5;
  pointer-events: none;
  transition: opacity .15s ease;
}
.ga-zona-mover .ga-stick { left: calc(max(14px, env(safe-area-inset-left)) + 84px); top: calc(100% - 96px - env(safe-area-inset-bottom)); }
.ga-zona-disparo .ga-stick { left: calc(100% - 84px - max(14px, env(safe-area-inset-right))); top: calc(100% - 96px - env(safe-area-inset-bottom)); }
.ga-stick.activo { opacity: 1; }
.ga-stick > i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 26%, #6a5a98 0%, #2e2650 60%, #19152b 100%);
  border: 2px solid var(--ga-oro);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .5), inset 0 2px 0 rgba(255, 255, 255, .18);
}
.ga-stick-fuego > i {
  background: radial-gradient(circle at 34% 26%, #ffa294 0%, #d8473b 58%, #8e2420 100%);
  border-color: #ffd9a0;
}
.ga-stick.super > i {
  background: radial-gradient(circle at 34% 26%, #fff0b8 0%, #f2c35c 55%, #a8742a 100%);
  border-color: #fff4d0;
}
.ga-super {
  position: absolute;
  right: calc(max(14px, env(safe-area-inset-right)) + 182px);
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 26px);
  width: 66px;
  height: 66px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ga-boton);
  border: 2px solid var(--ga-borde-suave);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55), inset 0 2px 0 rgba(255, 255, 255, .12);
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ga-super svg {
  position: absolute;
  inset: -6px;
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  transform: rotate(-90deg);
  pointer-events: none;
}
.ga-super-fondo { fill: none; stroke: rgba(0, 0, 0, .5); stroke-width: 4; }
.ga-super-carga {
  fill: none;
  stroke: var(--ga-oro);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  transition: stroke-dashoffset .25s ease;
}
.ga-super img {
  width: 62%;
  height: 62%;
  object-fit: contain;
  filter: grayscale(.65) brightness(.8) drop-shadow(0 2px 2px rgba(0, 0, 0, .55));
  transition: filter .2s ease, transform .2s ease;
}
.ga-super.listo {
  border-color: var(--ga-oro-claro);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .55), 0 0 22px rgba(255, 200, 90, .6), inset 0 2px 0 rgba(255, 255, 255, .2);
  animation: ga-late .6s ease-in-out 3;
}
.ga-super.listo img { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); transform: scale(1.06); }
.ga-super:disabled { cursor: default; }

/* ── Abajo: cargas, súper y teclas ── */
.ga-pie {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: var(--ga-abajo);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ga-ui.caido .ga-pie,
.ga-ui.fin .ga-pie { display: none; }
.ga-cargas {
  display: flex;
  gap: 5px;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(14, 12, 25, .74);
  border: 1px solid var(--ga-borde-suave);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .35);
}
.ga-cargas > i {
  position: relative;
  width: 30px;
  height: 10px;
  overflow: hidden;
  border-radius: 5px;
  background: rgba(0, 0, 0, .55);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .6);
}
.ga-cargas > i::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: calc(var(--carga, 1) * 100%);
  background: linear-gradient(180deg, #ffe0a0 0%, #f0a023 60%, #b8700f 100%);
  opacity: .55;
}
.ga-cargas > i.llena::after { opacity: 1; box-shadow: 0 0 8px rgba(255, 180, 70, .6); }
.ga-cargas.vacia { border-color: rgba(255, 120, 100, .85); animation: ga-sacude .18s linear 1; }
.ga-superbarra {
  position: relative;
  width: clamp(180px, 22vw, 260px);
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(20, 16, 30, .78));
  border: 1.5px solid var(--ga-borde-suave);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .4), inset 0 2px 4px rgba(0, 0, 0, .55);
}
.ga-superbarra > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(180deg, #ffe9a8 0%, #f2c35c 50%, #b07a22 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4);
  transition: width .25s ease;
}
.ga-superbarra > span {
  position: relative;
  display: block;
  color: #fff;
  font: 400 8px/15px var(--ga-pixel);
  letter-spacing: .08em;
  text-align: center;
  text-shadow: 1px 0 0 #000, -1px 0 0 #000, 0 1px 0 #000, 0 -1px 0 #000;
}
.ga-superbarra.lista {
  border-color: var(--ga-oro-claro);
  box-shadow: 0 0 16px rgba(255, 200, 90, .55), inset 0 2px 4px rgba(0, 0, 0, .3);
  animation: ga-late .6s ease-in-out 3;
}
.ga-teclas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 6px;
  color: var(--ga-texto-2);
  font: 600 11px/1 var(--ga-fuente);
  text-shadow: 0 1px 2px #000;
  transition: opacity .6s ease;
}
.ga-teclas kbd {
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(14, 12, 25, .85);
  border: 1px solid var(--ga-borde-suave);
  border-bottom-width: 2px;
  color: var(--ga-oro-claro);
  font: 700 10px/1 var(--ga-fuente);
}
.ga-teclas kbd:first-child { margin-left: 0; }
.ga-ui.sin-teclas .ga-teclas { display: none; }
.ga-ui.tactil .ga-teclas,
.ga-ui.tactil .ga-superbarra { display: none; }

/* ─────────────────────────────────────────── EL TELÉFONO DE PIE (.vertical) */
.ga-ui.vertical .ga-arriba {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "yo acciones" "centro centro";
  row-gap: 6px;
}
.ga-ui.vertical .ga-yo { width: auto; max-width: 300px; }
.ga-ui.vertical .ga-feed { top: calc(var(--ga-arriba) + 132px); }
.ga-ui.vertical .ga-fuera { top: calc(var(--ga-arriba) + 172px); }
.ga-ui.vertical .ga-red { top: calc(var(--ga-arriba) + 214px); }
.ga-ui.vertical .ga-aviso { top: 36%; }
.ga-ui.vertical .ga-zona { height: 56%; }
.ga-ui.vertical .ga-super {
  right: calc(max(14px, env(safe-area-inset-right)) + 30px);
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 186px);
}
.ga-ui.vertical .ga-modo-txt { max-width: 86vw; }

/* ───────────────────────────────────────── EL TELÉFONO TUMBADO (poco alto) */
@media (max-height: 540px) and (min-width: 600px) {
  .ga-busq { width: min(100%, 680px); padding: 12px 16px 12px; }
  .ga-busq-icono { display: none; }
  .ga-consejos { grid-template-columns: 1fr 1fr; margin-top: 10px; padding: 8px 10px; }
  .ga-busq .ga-botones { margin-top: 10px; }
  .ga-res {
    width: min(100%, 800px);
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "cab tabla" "premios tabla" "botones tabla";
    align-items: start;
    gap: 10px 14px;
    padding: 14px;
  }
  .ga-res .ga-botones { align-self: end; justify-content: flex-start; }
  .ga-tabla { max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); }
}
@media (max-height: 430px) {
  .ga-yo { padding: 4px 8px 4px 4px; gap: 7px; }
  .ga-retrato-hud { width: 38px; height: 38px; border-radius: 10px; }
  .ga-yo .ga-mascota-nombre { font-size: 12px; }
  .ga-yo .ga-vida { height: 13px; }
  .ga-yo .ga-vida > b { font-size: 9.5px; line-height: 11px; }
  .ga-yo-extra { margin-top: 3px; }
  .ga-dato img, .ga-poder img { width: 15px; height: 15px; }
  .ga-modo-txt { font-size: 10px; }
  .ga-marcador { padding: 4px 2px; }
  .ga-marca { padding: 0 7px; gap: 5px; }
  .ga-marca img { width: 17px; height: 17px; }
  .ga-marca b { font-size: 11px; }
  .ga-redondo { height: 34px; padding-right: 11px; font-size: 12px; }
  .ga-redondo img { width: 26px; height: 26px; }
  .ga-feed { top: calc(var(--ga-arriba) + 44px); }
  .ga-feed li { padding: 3px 8px; font-size: 11px; }
  .ga-fuera { top: calc(var(--ga-arriba) + 84px); font-size: 12px; }
  .ga-red { top: calc(var(--ga-arriba) + 124px); }
  .ga-stick { width: 104px; height: 104px; margin: -52px 0 0 -52px; }
  .ga-stick > i { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .ga-zona-mover .ga-stick { top: calc(100% - 82px - env(safe-area-inset-bottom)); left: calc(max(14px, env(safe-area-inset-left)) + 72px); }
  .ga-zona-disparo .ga-stick { top: calc(100% - 82px - env(safe-area-inset-bottom)); left: calc(100% - 72px - max(14px, env(safe-area-inset-right))); }
  .ga-super { width: 58px; height: 58px; right: calc(max(14px, env(safe-area-inset-right)) + 160px); bottom: calc(max(8px, env(safe-area-inset-bottom)) + 18px); }
  .ga-tarjeta { padding: 12px 14px 12px; }
  .ga-consejos li { font-size: 11.5px; }
  .ga-medalla { width: 52px; height: 52px; font-size: 13px; }
}

/* ─────────────────────────────────────────────────── PANTALLAS GRANDES */
@media (min-width: 1500px) and (min-height: 860px) {
  .ga-yo { width: 330px; padding: 8px 12px 8px 8px; }
  .ga-retrato-hud { width: 54px; height: 54px; }
  .ga-yo .ga-mascota-nombre { font-size: 15px; }
  .ga-yo .ga-vida { height: 17px; }
  .ga-yo .ga-vida > b { font-size: 11.5px; line-height: 15px; }
  .ga-marca b { font-size: 15px; }
  .ga-marca img { width: 24px; height: 24px; }
  .ga-redondo { height: 44px; font-size: 14px; }
  .ga-redondo img { width: 34px; height: 34px; }
  .ga-feed { top: calc(var(--ga-arriba) + 60px); }
  .ga-feed li { font-size: 13px; }
  .ga-superbarra { height: 20px; }
  .ga-superbarra > span { line-height: 17px; }
  .ga-cargas > i { width: 36px; height: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ga-hub-caja, .ga-tarjeta, .ga-feed li, .ga-aviso.pop, .ga-aviso.peque.pop, .ga-busq-icono img,
  .ga-super.listo, .ga-superbarra.lista, .ga-redondo.confirmar, .ga-cargas.vacia, .ga-ui.en-gas::before,
  html body .battle-rank-card, html body .battle-rotate-inner, html body .battle-rotate-icono {
    animation: none !important;
  }
  .ga-modo, .ga-cerrar, .ga-boton, .ga-enlace, .ga-redondo, .ga-vida > i, .ga-superbarra > i, .ga-super-carga {
    transition-duration: .01s !important;
  }
}
