/* =========================================================
   styles.css — Estilos de Criatulandia
   Pensado para celulares viejos: las animaciones usan solo
   transform y opacity (las más livianas para el navegador).
   ========================================================= */

:root {
  --violeta: #5b3cc4;
  --violeta-osc: #3f2a8c;
  --cielo: #e9f3ff;
  --texto: #2a2440;
  --texto-suave: #6b6585;
  --blanco: #ffffff;
  --verde: #2fb35a;
  --verde-osc: #208a43;
  --rojo: #e8474b;
  --amarillo: #ffc93c;
  --naranja: #ff8c42;
  --celeste: #3da5ff;
  --tarjeta: #ffffff;
  --borde: #e2dcf5;
  --radio: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  color: var(--texto);
  background: linear-gradient(180deg, #cfe6ff 0%, #f4f0ff 100%);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

/* ---------- Pantallas: solo una visible a la vez ---------- */
.pantalla {
  display: none;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px 16px 32px;
  max-width: 560px;
  margin: 0 auto;
}
.pantalla.activa { display: block; animation: entrar .25s ease-out; }

@keyframes entrar {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.pantalla-pasto {
  max-width: none;
  background: linear-gradient(180deg, #bfe3ff 0%, #d9f2ff 45%, #9be08f 46%, #6cc56a 100%);
}
.pantalla-pasto > * { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- Botón de sonido ---------- */
.btn-sonido {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 50;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  font-size: 22px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}

/* ---------- Cabecera de cada pantalla ---------- */
.cabecera {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 14px;
  padding-right: 54px; /* lugar para el botón de sonido */
}
.cabecera h2 { font-size: 22px; }

.btn-volver {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--blanco);
  font-size: 22px;
  box-shadow: 0 2px 0 var(--borde);
}
.btn-volver:active { transform: scale(.92); }

/* ---------- Botones generales ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radio);
  font-size: 18px;
  font-weight: 700;
  background: var(--violeta);
  color: var(--blanco);
  box-shadow: 0 4px 0 var(--violeta-osc);
  transition: transform .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--violeta-osc); }
.btn:disabled { opacity: .45; }
.btn-grande { padding: 18px; font-size: 22px; }
.btn-verde { background: var(--verde); box-shadow: 0 4px 0 var(--verde-osc); }
.btn-verde:active { box-shadow: 0 1px 0 var(--verde-osc); }
.btn-rojo { background: var(--rojo); box-shadow: 0 4px 0 #b02d31; }
.btn-gris { background: #ece8f7; color: var(--texto); box-shadow: 0 4px 0 #cfc7ea; }
.btn + .btn { margin-top: 12px; }

/* ---------- Pantalla de perfiles ---------- */
.logo-caja { text-align: center; margin: 28px 0 10px; }
.logo-bichos { font-size: 34px; letter-spacing: 4px; animation: flotar 2.4s ease-in-out infinite; }
.logo {
  font-size: 42px;
  color: var(--violeta);
  letter-spacing: -1px;
  text-shadow: 0 3px 0 #fff;
}
.subtitulo { text-align: center; font-size: 20px; color: var(--texto-suave); margin-bottom: 18px; }

.lista-perfiles { display: grid; gap: 16px; }

.tarjeta-perfil {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--tarjeta);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 4px 0 var(--borde);
}
.tarjeta-perfil .avatar {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #f1ecff;
  font-size: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tarjeta-perfil .datos { flex: 1; min-width: 0; text-align: left; }
.tarjeta-perfil .nombre { font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tarjeta-perfil .resumen { font-size: 14px; color: var(--texto-suave); margin-top: 2px; }
.btn-jugar { flex: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.btn-jugar:active { transform: scale(.97); }
.btn-editar {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: #f1ecff;
  font-size: 22px;
}

/* ---------- Inicio ---------- */
.cabecera-jugador { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; min-width: 0; }
.cabecera-jugador .avatar-mini { font-size: 34px; }
.cabecera-jugador span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.recursos { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blanco);
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 2px 0 var(--borde);
}
.chip small { font-weight: 600; font-size: 12px; color: var(--texto-suave); }

.menu-inicio { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  border-radius: 24px;
  font-size: 20px;
  font-weight: 800;
  color: var(--blanco);
  transition: transform .08s;
}
.btn-menu .ico { font-size: 44px; }
.btn-menu:active { transform: scale(.95); }
.btn-explorar { grid-column: 1 / -1; min-height: 140px; font-size: 26px; background: var(--verde); box-shadow: 0 5px 0 var(--verde-osc); }
.btn-explorar .ico { font-size: 56px; }
.btn-equipo   { background: var(--naranja); box-shadow: 0 5px 0 #d16a24; }
.btn-batalla  { background: var(--rojo); box-shadow: 0 5px 0 #b02d31; }
.btn-coleccion{ background: var(--celeste); box-shadow: 0 5px 0 #2378c4; }
.btn-tienda   { background: var(--violeta); box-shadow: 0 5px 0 var(--violeta-osc); }

/* ---------- Bola (atrapabola), hecha con CSS ---------- */
.bola {
  display: inline-block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0 14%, #ffd23f 16% 52%, #ff9f1c 54%);
  border: 3px solid var(--violeta);
  vertical-align: middle;
  flex: 0 0 auto;
}

/* ---------- Buscando ---------- */
.buscando { padding-top: 26vh; text-align: center; }
.arbustos { font-size: 72px; display: flex; justify-content: center; gap: 4px; }
.arbustos span { display: inline-block; animation: sacudir .35s ease-in-out infinite alternate; }
.arbustos span:nth-child(2) { animation-delay: .12s; }
.arbustos span:nth-child(3) { animation-delay: .24s; }
.buscando-texto { margin-top: 18px; font-size: 22px; font-weight: 800; color: var(--blanco); text-shadow: 0 2px 0 rgba(0,0,0,.2); }

@keyframes sacudir {
  from { transform: rotate(-8deg) translateY(0); }
  to   { transform: rotate(8deg) translateY(-6px); }
}

/* ---------- Dibujos de criaturas (SVG de arte.js) ---------- */
.figura { display: inline-block; line-height: 0; vertical-align: middle; }
.figura svg { width: 100%; height: 100%; display: block; overflow: visible; }
.figura-emoji { line-height: 1; text-align: center; }
.fig-xl { width: 150px; height: 150px; margin: 0 auto 6px; display: block; }
.fig-xl.figura-emoji { font-size: 110px; }
.fig-ficha { width: 70px; height: 70px; }
.fig-ficha.figura-emoji { font-size: 50px; }
.fig-cadena { width: 56px; height: 56px; }
.fig-cadena.figura-emoji { font-size: 40px; }
/* Criatura "viva": respira y parpadea */
.viva svg { animation: respirar 2.6s ease-in-out infinite; transform-origin: 50% 92%; }
.viva .ojos { transform-box: fill-box; transform-origin: center; animation: parpadear 4.5s infinite; }
@keyframes respirar {
  0%, 100% { transform: scale(1, 1); }
  50%      { transform: scale(1.035, .965); }
}
@keyframes parpadear {
  0%, 93%, 100% { transform: scaleY(1); }
  96%           { transform: scaleY(.1); }
}
.logo-bichos { display: flex; justify-content: center; gap: 2px; }
.logo-bichos .figura { width: 58px; height: 58px; }

/* ---------- Encuentro ---------- */
#p-encuentro.activa { display: flex; flex-direction: column; padding-bottom: 12px; }
#p-encuentro.activa > * { width: 100%; }
.escena {
  position: relative;
  flex: 1;
  min-height: 340px;
  touch-action: none;       /* que arrastrar la bola no mueva la página */
  overflow: hidden;
}
.objetivo { position: absolute; left: 0; top: 0; width: 150px; height: 150px; will-change: transform; }
.salvaje { position: absolute; top: 0; right: 0; bottom: 0; left: 0; transition: transform .3s, opacity .3s; }
.salvaje .figura { width: 100%; height: 100%; }
.salvaje.aparece { animation: aparecer .5s ease-out; }
.salvaje.adentro { transform: scale(.1); opacity: 0; }
.sombra {
  position: absolute;
  left: 15%;
  right: 15%;
  bottom: -2%;
  height: 14%;
  border-radius: 50%;
  background: rgba(0, 0, 0, .16);
}
/* Aro de puntería: el fijo marca el tamaño máximo, el otro se achica */
.aro-fijo, .aro {
  position: absolute;
  left: -5%;
  top: -5%;
  width: 110%;
  height: 110%;
  border-radius: 50%;
  pointer-events: none;
}
.aro-fijo { border: 3px dashed rgba(255, 255, 255, .55); }
.aro { border: 6px solid #fff; will-change: transform; }
.modo-barra .aro, .modo-barra .aro-fijo { display: none; }
.bola-tiro {
  position: absolute;
  left: 0;
  top: 0;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-width: 5px;
  will-change: transform;
  z-index: 5;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}
.modo-barra .bola-tiro { pointer-events: none; }
.mano-ayuda {
  position: absolute;
  font-size: 44px;
  margin: 0 0 0 -10px;
  pointer-events: none;
  opacity: 0;
  z-index: 6;
}
.mano-ayuda.visible { animation: deslizar 1.6s ease-in-out infinite; }
@keyframes deslizar {
  0%   { transform: translateY(20px); opacity: 0; }
  20%  { transform: translateY(10px); opacity: 1; }
  80%  { transform: translateY(-130px); opacity: 1; }
  100% { transform: translateY(-150px); opacity: 0; }
}
.cartel-tiro {
  position: absolute;
  z-index: 7;
  font-size: 30px;
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 0);
  text-shadow: 0 3px 0 #2b2340, 2px 0 0 #2b2340, -2px 0 0 #2b2340, 0 -2px 0 #2b2340;
}
.cartel-tiro.visible { animation: cartel 1.2s ease-out forwards; }
@keyframes cartel {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  20%  { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  70%  { opacity: 1; transform: translate(-50%, -20px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -40px) scale(1); }
}
.pie-encuentro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, .92);
  border-radius: var(--radio);
  padding: 10px 14px;
}
.pie-encuentro .ayuda { margin: 0; text-align: left; }
.pie-encuentro.captura { display: block; padding: 14px; }
.pie-encuentro.captura .ayuda { text-align: center; margin: 10px 0 12px; }

/* Selector de modo de tiro (en editar perfil) */
.modos-tiro { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modos-tiro button { padding: 10px 6px; border-radius: 14px; background: #f5f2ff; border: 3px solid transparent; font-size: 24px; }
.modos-tiro button b { display: block; font-size: 16px; }
.modos-tiro button small { display: block; font-size: 12px; color: var(--texto-suave); }
.modos-tiro button.elegido { border-color: var(--violeta); background: #e6deff; }

.emoji-xl { display: inline-block; font-size: 90px; line-height: 1; }

@keyframes flotar {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes aparecer {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}

.salvaje-info {
  background: rgba(255, 255, 255, .92);
  border-radius: var(--radio);
  padding: 10px 14px;
  text-align: center;
  margin-bottom: 14px;
}
.salvaje-info .nombre { font-size: 24px; font-weight: 800; }
.etiquetas { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.etiqueta {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: var(--blanco);
  background: var(--texto-suave);
}
.estrellas { color: #f5a400; letter-spacing: 1px; }

.captura { background: rgba(255,255,255,.92); border-radius: var(--radio); padding: 16px; }
.barra-captura {
  position: relative;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(90deg, #ffb3b3, #ffe9a8 50%, #ffb3b3);
  border: 3px solid var(--texto);
  overflow: hidden;
}
.zona {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--verde);
  box-shadow: inset 0 0 0 3px #7ee49b;
}
.riel { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; }
.aguja {
  position: absolute;
  left: -4px;
  top: 0;
  bottom: 0;
  width: 8px;
  border-radius: 4px;
  background: var(--texto);
  box-shadow: 0 0 0 2px #fff;
}
.ayuda { text-align: center; font-weight: 700; margin: 10px 0 12px; min-height: 24px; }

/* ---------- Grillas (equipo y álbum) ---------- */
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
.ficha {
  position: relative;
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 10px 6px 8px;
  text-align: center;
  box-shadow: 0 3px 0 var(--borde);
  border-top: 6px solid var(--borde);
}
.ficha:active { transform: scale(.95); }
.ficha .figura { margin-top: 2px; }
.ficha .nombre { font-size: 14px; font-weight: 800; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ficha .nivel { font-size: 13px; color: var(--texto-suave); font-weight: 700; }
.ficha .numero { position: absolute; top: 4px; left: 8px; font-size: 11px; color: var(--texto-suave); font-weight: 700; }
.ficha.oculta .figura { filter: brightness(0); opacity: .3; }
.ficha.oculta .nombre { color: var(--texto-suave); }

.vacio {
  grid-column: 1 / -1;
  text-align: center;
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 28px 16px;
  font-size: 18px;
}
.vacio .emoji { font-size: 56px; display: block; margin-bottom: 8px; }
.vacio .btn { margin-top: 16px; }

.progreso-album { background: var(--tarjeta); border-radius: var(--radio); padding: 12px 14px; margin-bottom: 14px; font-weight: 800; }
.progreso-album .barrita { margin-top: 8px; }

.barrita { height: 12px; border-radius: 6px; background: #ece8f7; overflow: hidden; }
.barrita > div { height: 100%; border-radius: 6px; background: var(--verde); transform-origin: left; }

.tabla-tipos { background: var(--tarjeta); border-radius: var(--radio); padding: 14px; margin-top: 18px; font-size: 15px; }
.tabla-tipos h3 { margin-bottom: 6px; font-size: 17px; }
.tabla-tipos p { padding: 3px 0; }

/* ---------- Detalle ---------- */
.detalle-cabeza {
  text-align: center;
  background: var(--tarjeta);
  border-radius: 24px;
  padding: 16px;
  border-top: 8px solid var(--borde);
  margin-bottom: 14px;
}
.detalle-cabeza .fig-xl { width: 170px; height: 170px; }
.detalle-cabeza .nombre { font-size: 28px; font-weight: 800; }
.caja { background: var(--tarjeta); border-radius: var(--radio); padding: 14px; margin-bottom: 14px; }
.caja h3 { font-size: 17px; margin-bottom: 8px; }
.fila-stat { display: grid; grid-template-columns: 96px 1fr 40px; align-items: center; gap: 8px; padding: 4px 0; font-weight: 700; font-size: 15px; }
.fila-stat .valor { text-align: right; }
.ataque-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f0edf8; font-weight: 700; }
.ataque-item:last-child { border-bottom: none; }
.ataque-item small { color: var(--texto-suave); }
.cadena-evo { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.cadena-evo .flecha { font-size: 22px; color: var(--texto-suave); }
.cadena-evo .oculta { filter: brightness(0); opacity: .3; }
.texto-suave { color: var(--texto-suave); font-size: 15px; }

/* ---------- Tienda ---------- */
.tienda { display: grid; gap: 12px; }
.item-tienda {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tarjeta);
  border-radius: var(--radio);
  padding: 12px;
  box-shadow: 0 3px 0 var(--borde);
}
.item-tienda .ico { font-size: 40px; width: 52px; text-align: center; display: flex; justify-content: center; }
.item-tienda .ico .bola { width: 38px; height: 38px; border-width: 4px; }
.item-tienda .texto { flex: 1; min-width: 0; }
.item-tienda .texto b { display: block; font-size: 18px; }
.item-tienda .texto small { color: var(--texto-suave); }
.item-tienda .btn { width: auto; padding: 12px 16px; font-size: 17px; white-space: nowrap; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 100;
  background: rgba(30, 20, 60, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.oculto { display: none; }
.modal-caja {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--blanco);
  border-radius: 24px;
  padding: 20px;
  text-align: center;
  animation: aparecer .3s ease-out;
}
.modal-caja h3 { font-size: 24px; margin-bottom: 8px; }
.modal-caja p { font-size: 17px; margin-bottom: 14px; }
.modal-caja .emoji-xl { font-size: 90px; margin: 4px 0 8px; }
.modal-caja .fig-xl { width: 140px; height: 140px; }
.modal-botones { margin-top: 16px; }

.campo { width: 100%; padding: 12px 14px; font-size: 20px; border-radius: 14px; border: 3px solid var(--borde); margin-bottom: 14px; text-align: center; font-weight: 700; user-select: text; -webkit-user-select: text; }
.campo:focus { outline: none; border-color: var(--violeta); }
.avatares { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.avatares button { font-size: 34px; padding: 6px 0; border-radius: 14px; background: #f5f2ff; border: 3px solid transparent; }
.avatares button.elegido { border-color: var(--violeta); background: #e6deff; }
.link-peligro { margin-top: 18px; color: var(--rojo); font-weight: 700; text-decoration: underline; padding: 8px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: 90%;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--texto);
  color: var(--blanco);
  font-weight: 700;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 20px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Confeti / festejo ---------- */
.festejo { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confeti {
  position: absolute;
  top: -40px;
  font-size: 26px;
  animation: caer 1.6s ease-in forwards;
}
@keyframes caer {
  to { transform: translateY(110vh) rotate(540deg); opacity: .6; }
}

/* ---------- Menú de batalla ---------- */
.btn-modo {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 120px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border-radius: 24px;
  color: var(--blanco);
  text-align: left;
}
.btn-modo:active { transform: scale(.97); }
.btn-modo .ico { font-size: 56px; }
.btn-modo b { display: block; font-size: 22px; }
.btn-modo small { display: block; font-size: 15px; opacity: .9; margin-top: 2px; }
.btn-modo-cpu { background: var(--celeste); box-shadow: 0 5px 0 #2378c4; }
.btn-modo-pvp { background: var(--naranja); box-shadow: 0 5px 0 #d16a24; }

/* ---------- Pasar el teléfono ---------- */
.pantalla-turno { max-width: none; background: linear-gradient(180deg, #6a4ad6, #3f2a8c); color: var(--blanco); }
.turno { max-width: 420px; margin: 0 auto; padding-top: 14vh; text-align: center; }
.turno-avatar {
  width: 140px;
  height: 140px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  font-size: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: flotar 2s ease-in-out infinite;
}
.turno h2 { font-size: 32px; margin-bottom: 8px; }
.turno p { font-size: 19px; opacity: .9; margin-bottom: 28px; }
.turno .link-peligro { color: #ffc2c4; }

/* ---------- Batalla ---------- */
.pantalla-arena {
  max-width: none;
  background: linear-gradient(180deg, #bfe3ff 0%, #e4f5ff 40%, #a8e39c 41%, #7ccf73 100%);
}
.pantalla-arena > * { max-width: 560px; margin-left: auto; margin-right: auto; }
/* Cada luchador tiene su carril y se mueve de lado a lado (como un boxeador):
   el de arriba arranca a la izquierda y el de abajo a la derecha */
.arena { position: relative; height: 352px; }
.luchador { position: absolute; left: 0; right: 0; display: flex; flex-direction: column; gap: 4px; }
.luchador.arriba { top: 0; }
.luchador.abajo { bottom: 0; flex-direction: column-reverse; }
.luchador-info {
  display: grid;
  grid-template-columns: 1fr auto;
  column-gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, .94);
  border-radius: 14px;
  padding: 5px 10px 6px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .08);
}
.luchador.arriba .luchador-info { margin-right: 18%; }
.luchador.abajo .luchador-info { margin-left: 18%; }
.luchador-info .nombre { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.luchador-info .nombre small { font-weight: 700; color: var(--texto-suave); font-size: 12px; }
.luchador-info .duenio { grid-column: 1 / -1; font-size: 11px; color: var(--texto-suave); font-weight: 700; }
.vida { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: #ece8f7; overflow: hidden; margin: 3px 0 2px; }
.vida-relleno { height: 100%; background: var(--verde); transform-origin: left; transition: transform .5s ease-out, background-color .5s; }
.vida-relleno.media { background: var(--amarillo); }
.vida-relleno.baja { background: var(--rojo); }
.vida-texto { font-size: 12px; font-weight: 800; text-align: right; }
.carril { position: relative; height: 120px; }
.movil {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% - 120px);
  animation: vaiven 2.8s ease-in-out infinite alternate;
  will-change: transform;
}
.luchador.abajo .movil { animation-direction: alternate-reverse; }
@keyframes vaiven {
  from { transform: translateX(0); }
  to   { transform: translateX(100%); }
}
.arena.quietos .movil { animation-play-state: paused; }  /* quietos mientras se pelean */
.luchador-emoji {
  position: absolute;
  left: 0;
  top: 0;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .1s;
}
.luchador-emoji::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 2px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .15);
  z-index: 0;
}
.luchador-emoji .figura { position: relative; z-index: 1; width: 104px; height: 104px; }
.luchador.abajo .luchador-emoji .figura { width: 116px; height: 116px; }
.luchador.caido .luchador-emoji .figura { transition: transform .6s, opacity .6s; transform: translateY(40px) scale(.6); opacity: 0; }
/* Aura de poder mientras se carga el golpe */
.aura {
  position: absolute;
  left: -15%;
  top: -15%;
  width: 130%;
  height: 130%;
  border-radius: 50%;
  opacity: 0;
  z-index: 0;
  animation: latido .25s ease-in-out infinite alternate;
}
@keyframes latido {
  from { transform: scale(.92); }
  to   { transform: scale(1.08); }
}

/* Domo-escudo para defenderse */
.escudo {
  position: absolute;
  left: -14%;
  right: -14%;
  bottom: -2%;
  height: 108%;
  border-radius: 50% 50% 14% 14% / 85% 85% 15% 15%;
  border: 3px solid rgba(214, 246, 255, .95);
  background: radial-gradient(ellipse at 50% 90%, rgba(120, 210, 255, .1) 0%, rgba(120, 210, 255, .42) 70%, rgba(225, 249, 255, .75) 100%);
  box-shadow: inset 0 0 14px rgba(255, 255, 255, .65), 0 0 10px rgba(120, 210, 255, .6);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transform-origin: 50% 100%;
  transition: opacity .2s, transform .2s;
}

/* Panel para cargar el golpe tocando rápido */
.carga {
  grid-column: 1 / -1;
  min-height: 138px;
  border-radius: 18px;
  background: #2b2340;
  color: #fff;
  padding: 14px;
  text-align: center;
  touch-action: manipulation;
  cursor: pointer;
}
.carga:active { transform: scale(.98); }
.carga-titulo { font-size: 21px; font-weight: 900; }
.carga-barra {
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .15);
  border: 3px solid #fff;
  overflow: hidden;
  margin: 12px 0 8px;
}
.carga-relleno { height: 100%; transform-origin: left; transform: scaleX(0); background: #2fb35a; }
.carga.llena .carga-barra { animation: titilar .15s infinite alternate; }
@keyframes titilar {
  from { border-color: #fff; }
  to   { border-color: #ffe14d; }
}
.carga-ataque { font-size: 15px; opacity: .85; font-weight: 700; }
.carga.defensa { background: #1d4f8f; }
.carga.defensa .carga-relleno { background: #8fe3ff; }

.mensaje-batalla {
  background: var(--blanco);
  border: 3px solid var(--texto);
  border-radius: 16px;
  padding: 12px 14px;
  min-height: 56px;
  font-size: 17px;
  font-weight: 800;
  display: flex;
  align-items: center;
  margin: 8px auto 10px;
}
.ataques { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-ataque {
  padding: 10px 8px;
  min-height: 64px;
  border-radius: 16px;
  color: var(--blanco);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .2);
}
.btn-ataque small { display: block; font-size: 12px; opacity: .9; margin-top: 3px; }
.btn-ataque:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .2); }
.btn-ataque:only-child, .btn-ataque:nth-child(3):last-child { grid-column: 1 / -1; }

/* ---------- Evolución ---------- */
.evolucion {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 120;
  background: radial-gradient(circle, #6a4ad6 0%, #2a1a66 75%);
  color: var(--blanco);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  overflow: hidden;
}
.evolucion.oculto { display: none; }
.evo-luz {
  position: absolute;
  width: 640px;
  height: 640px;
  left: 50%;
  top: 50%;
  margin: -320px 0 0 -320px;
  background: repeating-conic-gradient(rgba(255, 255, 255, .13) 0 12deg, transparent 12deg 30deg);
  border-radius: 50%;
  animation: girar 6s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
.evo-emojis { position: relative; width: 180px; height: 180px; }
.evo-emojis > span { position: absolute; left: 0; right: 0; top: 0; bottom: 0; }
.evo-emojis .figura { width: 180px; height: 180px; }
.evo-nueva { opacity: 0; }
.evolucionando .evo-vieja { animation: parpadeo-a .35s ease-in-out infinite alternate; }
.evolucionando .evo-nueva { animation: parpadeo-b .35s ease-in-out infinite alternate; }
@keyframes parpadeo-a { from { opacity: 1; transform: scale(1); } to { opacity: .1; transform: scale(.85); } }
@keyframes parpadeo-b { from { opacity: 0; transform: scale(.85); } to { opacity: .9; transform: scale(1.05); } }
.evolucion-lista .evo-vieja { opacity: 0; }
.evolucion-lista .evo-nueva { opacity: 1; animation: aparecer .6s ease-out; }
.evo-texto { position: relative; font-size: 24px; font-weight: 800; margin: 24px 0; min-height: 64px; }
.evolucion .btn { position: relative; max-width: 320px; visibility: hidden; }
.evolucion-lista .btn { visibility: visible; }

/* ---------- Efectos de ataques (efectos.js) ---------- */
.arena-marco { position: relative; }
.arena { will-change: transform; }
.capa-carteles { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 20; }
.capa-efectos { position: absolute; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; z-index: 10; }
.fx { position: absolute; pointer-events: none; will-change: transform, opacity; }
.fx-svg { overflow: visible; }
.fx-svg svg { overflow: visible; display: block; }
.fx-particula, .fx-aro, .fx-gota, .fx-burbuja, .fx-fuego { border-radius: 50%; }
.fx-aro { border: 6px solid #fff; }
.fx-fuego { background: radial-gradient(circle at 42% 42%, #fffbd0 0, #ffd23f 28%, #ff7a1f 55%, rgba(255, 70, 20, .85) 66%, rgba(255, 60, 20, 0) 72%); }
.fx-llama {
  border-radius: 50% 50% 35% 35% / 65% 65% 35% 35%;
  background: linear-gradient(to top, #ff3d1f 0%, #ff8c1f 45%, #ffe066 100%);
}
.fx-gota { background: radial-gradient(circle at 35% 35%, #fff 0 16%, #6cc4ff 22%, #2f8fe0 100%); }
.fx-burbuja { border: 3px solid #d6f3ff; background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .95) 0 12%, rgba(160, 220, 255, .3) 15%); }
.fx-hielo { background: linear-gradient(#ffffff, #8fe3ff); clip-path: polygon(50% 0, 100% 45%, 50% 100%, 0 45%); }
.fx-bloque-hielo {
  border-radius: 22px;
  border: 4px solid rgba(255, 255, 255, .95);
  background: linear-gradient(135deg, rgba(225, 250, 255, .85) 0%, rgba(140, 215, 255, .55) 55%, rgba(225, 250, 255, .8) 100%);
}
.fx-hoja { border-radius: 0 100% 0 100%; background: #4cc95a; border: 2px solid #2b7a33; }
.fx-petalo { border-radius: 100% 0 100% 0; background: #ff9fd0; border: 2px solid #e2649f; }
.fx-chispa { background: #ffe14d; clip-path: polygon(58% 0, 12% 56%, 44% 56%, 32% 100%, 88% 38%, 56% 38%); }
.fx-viento svg { display: block; overflow: visible; }
.fx-roca { background: #8a6a4a; border: 2px solid #5a4430; clip-path: polygon(20% 0, 85% 10%, 100% 60%, 70% 100%, 10% 85%, 0 35%); }
.fx-dientes {
  background: #fff;
  clip-path: polygon(0 0, 100% 0, 100% 40%, 92% 100%, 83% 40%, 75% 100%, 67% 40%, 58% 100%, 50% 40%, 42% 100%, 33% 40%, 25% 100%, 17% 40%, 8% 100%, 0 40%);
}
.fx-nube { border-radius: 30px; }
.fx-nube::before, .fx-nube::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.fx-nube::before { width: 56px; height: 56px; left: 16px; top: -26px; }
.fx-nube::after { width: 44px; height: 44px; right: 18px; top: -18px; }
.fx-tinte { border-radius: 50%; }
.fx-texto { font-size: 30px; line-height: 1; margin: -15px 0 0 -15px; color: #ffe14d; font-weight: 900; text-shadow: 0 2px 0 #2b2340; }
.fx-copo { color: #fff; }
.fx-pow svg { width: 100%; height: 100%; display: block; }
.fx-pow span {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: #e8453c;
  text-shadow: 0 2px 0 #fff;
}
.fx-danio {
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 3px 0 #c0262c, 2px 0 0 #c0262c, -2px 0 0 #c0262c, 0 -2px 0 #c0262c;
  z-index: 3;
}
.fx-danio.grande { font-size: 46px; color: #ffe14d; }
.fx-sello {
  font-size: 32px;
  font-weight: 900;
  color: #ffe14d;
  white-space: nowrap;
  letter-spacing: -1px;
  text-shadow: 0 4px 0 #2b2340, 3px 0 0 #2b2340, -3px 0 0 #2b2340, 0 -3px 0 #2b2340, 3px 3px 0 #2b2340, -3px 3px 0 #2b2340;
  z-index: 4;
}
.fx-sello.critico { color: #ff6b6b; }
.fx-sello.poco { color: #e6e1f5; font-size: 24px; }
.fx-sello.carga { color: #7ef0ff; }
.fx-sello.bloqueo { color: #b8f0ff; }
.fx-sello.bloqueo.chico { font-size: 24px; }
.destello {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
}

/* Movimiento reducido: si el teléfono lo pide, apagamos animaciones decorativas */
@media (prefers-reduced-motion: reduce) {
  .emoji-xl, .arbustos span, .viva svg, .viva .ojos { animation: none; }
}
