/* Atrapasaberes: estilo "álbum de pegatinas". Móvil y tablet primero. */
:root {
  --tinta: #2b2350;
  --papel: #fffdf6;
  --sol: #ffd93d;
  --ok: #3ecf6e;
  --ok-claro: #d9f8e2;
  --ay: #ff9f43;
  --ay-claro: #ffe9cf;
  --foco: #7c4dff;
  --t: #b39ddb; --t2: #efe8fb; --t3: #6a4fb3;
  --borde: 3px solid var(--tinta);
  --letra: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Varela Round", "Nunito", "Trebuchet MS", system-ui, sans-serif;
}
.tipo-fuego { --t: #ff7a45; --t2: #ffe3d3; --t3: #c8431a; }
.tipo-agua { --t: #37b6f6; --t2: #d8f1ff; --t3: #0b74b8; }
.tipo-planta { --t: #5cc463; --t2: #def7dc; --t3: #2c7d33; }
.tipo-rayo { --t: #ffcb2b; --t2: #fff4c7; --t3: #b07f00; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }   /* sin zoom por doble toque; el zoom con dos dedos sigue funcionando */
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font: 700 1.125rem/1.35 var(--letra); color: var(--tinta);
  background: linear-gradient(#8fd3ff 0, #c4ecff 45%, #e6ffd6 100%) fixed;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
:focus-visible { outline: 4px solid var(--foco); outline-offset: 3px; }
h1, h2, p { margin: 0; }

/* nubes de fondo */
.cielo { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.cielo i { position: absolute; width: 180px; height: 56px; border-radius: 60px; background: #fff; opacity: .75; animation: nube 60s linear infinite; }
.cielo i::before, .cielo i::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cielo i::before { width: 80px; height: 80px; left: 24px; top: -38px; }
.cielo i::after { width: 60px; height: 60px; right: 30px; top: -24px; }
.cielo i:nth-child(1) { top: 9%; left: -10%; }
.cielo i:nth-child(2) { top: 34%; left: 40%; transform: scale(.7); animation-duration: 90s; animation-delay: -30s; }
.cielo i:nth-child(3) { top: 62%; left: 10%; transform: scale(1.2); animation-duration: 75s; animation-delay: -50s; opacity: .5; }
@keyframes nube { from { translate: -30vw 0; } to { translate: 120vw 0; } }

#app { max-width: 760px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) calc(110px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); outline: none; }
#app[data-vista="prueba"], #app[data-vista="resultado"], #app[data-vista="portada"], #app[data-vista="familia"], #app[data-vista="historia"], #app[data-vista="perfil"] { padding-bottom: 32px; }

/* ---------- piezas comunes ---------- */
.tarjeta { background: var(--papel); border: var(--borde); border-radius: 26px; box-shadow: 0 6px 0 var(--tinta); padding: 18px; }
.btn {
  min-height: 56px; padding: 10px 22px; border: var(--borde); border-radius: 18px;
  background: var(--sol); font-weight: 900; font-size: 1.25rem; box-shadow: 0 6px 0 var(--tinta);
  transition: transform .08s, box-shadow .08s;
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--tinta); }
.btn:disabled { background: #e3e1ea; color: #6d6887; box-shadow: 0 6px 0 #8f8aa8; border-color: #8f8aa8; }
.btn-grande { width: 100%; min-height: 64px; font-size: 1.45rem; }
.btn-claro { background: #fff; }
.btn-mini { min-height: 48px; font-size: 1rem; padding: 6px 14px; box-shadow: 0 4px 0 var(--tinta); }
.btn-peligro { background: #ffd6d6; }
.botones { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.enlace { display: block; margin: 22px auto 0; min-height: 48px; padding: 8px 16px; background: none; border: 0; text-decoration: underline; font-size: .95rem; font-weight: 700; color: #3d3566; }
.nota { font-size: .95rem; font-weight: 700; color: #4a4370; }
.error { color: #b3001b; font-weight: 800; min-height: 1.2em; }
.titulo { font-size: clamp(1.6rem, 6vw, 2.3rem); font-weight: 900; text-align: center; line-height: 1.15; }
.subtitulo { text-align: center; margin: 6px 0 14px; }
.subtitulo.grande { font-size: 1.35rem; font-weight: 900; min-height: 1.4em; }

.nombre { display: inline-block; white-space: nowrap; }
.letra { display: inline-block; font-weight: 900; -webkit-text-stroke: 1.5px var(--tinta); paint-order: stroke fill; text-shadow: 0 3px 0 var(--tinta); animation: bota 1.6s ease-in-out infinite; }
.letra.l0 { color: #ff7a45; } .letra.l1 { color: #37b6f6; } .letra.l2 { color: #5cc463; } .letra.l3 { color: #ffcb2b; }
@keyframes bota { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-7px) rotate(-3deg); } }

.pestanas { display: flex; gap: 10px; justify-content: center; margin: 14px 0; }
.pestana { flex: 1; max-width: 220px; min-height: 52px; border: var(--borde); border-radius: 16px; background: #fff; font-weight: 900; box-shadow: 0 4px 0 var(--tinta); }
.pestana[aria-pressed="true"] { background: var(--tinta); color: #fff; transform: translateY(3px); box-shadow: 0 1px 0 var(--tinta); }
.pestanas.tipos .pestana { background: var(--t2); display: flex; flex-direction: column; align-items: center; font-size: 1.6rem; line-height: 1.1; padding: 6px; }
.pestanas.tipos .pestana small { font-size: .85rem; }
.pestanas.tipos .pestana[aria-pressed="true"] { background: var(--t); color: var(--tinta); }

.criatura, .capsula { display: block; width: 100%; height: auto; overflow: visible; }
.criatura .ojos { transform-box: fill-box; transform-origin: center; animation: parpadea 4.5s infinite; }
.criatura .destello { transform-box: fill-box; transform-origin: center; animation: brilla 1.8s ease-in-out infinite; }
@keyframes parpadea { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes brilla { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.4); opacity: .5; } }
.flota { animation: flota 2.6s ease-in-out infinite; }
@keyframes flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.salta { animation: salta .7s ease; }
@keyframes salta { 0%, 100% { transform: translateY(0) scale(1); } 20% { transform: translateY(6px) scale(1.12, .86); } 50% { transform: translateY(-34px) scale(.94, 1.1) rotate(6deg); } 80% { transform: translateY(0) scale(1.06, .94); } }
.anima { animation: anima .8s ease; }
@keyframes anima { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(9deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
.aparece { animation: aparece .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes aparece { from { transform: scale(0) rotate(-20deg); opacity: 0; } }

/* ---------- portada ---------- */
.portada { max-width: 460px; margin: 0 auto; text-align: center; }
.desfile { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; max-width: 380px; margin: 0 auto -6px; }
.logo { font-size: clamp(2.1rem, 10.5vw, 3.4rem); line-height: 1.1; margin: 0; }
.lema { font-weight: 800; margin-top: 4px; }
.formulario { display: grid; gap: 14px; text-align: left; }
.campo { display: grid; gap: 6px; font-weight: 800; }
.campo input, .jugador-acciones input { width: 100%; min-height: 56px; padding: 8px 14px; border: var(--borde); border-radius: 16px; background: #fff; font-size: 1.25rem; font-weight: 700; }

/* ---------- mapa ---------- */
.hola { display: grid; grid-template-columns: clamp(96px, 28vw, 150px) 1fr; gap: 6px 12px; align-items: center; margin-bottom: 18px; }
.compa { background: none; border: 0; padding: 0; border-radius: 30px; filter: drop-shadow(0 6px 0 rgba(43, 35, 80, .18)); }
.saludo { font-size: clamp(1.7rem, 7.5vw, 2.8rem); font-weight: 900; line-height: 1.1; }
.saludo .nombre { font-size: 1.2em; }
.bocadillo { position: relative; margin-top: 10px; background: #fff; border: var(--borde); border-radius: 18px; padding: 10px 14px; font-size: 1.05rem; }
.bocadillo::before { content: ""; position: absolute; left: -11px; top: 16px; width: 16px; height: 16px; background: #fff; border-left: var(--borde); border-bottom: var(--borde); transform: rotate(45deg); }
.chips { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: var(--borde); border-radius: 99px; padding: 6px 14px; font-size: 1.1rem; box-shadow: 0 3px 0 var(--tinta); }
.chip b { font-weight: 900; font-size: 1.2rem; }
.chip-texto { font-size: .9rem; }

.isla { background: var(--t2); border: var(--borde); border-radius: 30px; box-shadow: 0 8px 0 var(--t3); margin-bottom: 26px; overflow: hidden; }
.isla-cabeza { display: flex; align-items: center; gap: 10px; background: var(--t); padding: 10px 16px; border-bottom: var(--borde); }
.isla-icono { font-size: 2rem; }
.isla-cabeza h2 { flex: 1; font-size: clamp(1.25rem, 5.2vw, 1.7rem); font-weight: 900; line-height: 1.1; }
.medalla { font-size: 2rem; filter: grayscale(1); opacity: .35; }
.medalla.ganada { filter: none; opacity: 1; animation: salta 1.6s ease 1; }
.camino { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 4px; padding: 18px 8px 16px; }
.paso { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.paso:nth-child(3n+2) { margin-top: 16px; }
.paso:not(:nth-child(3n+1))::before { content: ""; position: absolute; top: 40px; right: 50%; width: 100%; border-top: 7px dotted rgba(43, 35, 80, .28); }
.nodo { position: relative; z-index: 1; width: 88px; height: 88px; border-radius: 50%; border: 4px solid var(--tinta); background: #fff; box-shadow: 0 7px 0 var(--t3); transition: transform .08s, box-shadow .08s; }
.nodo:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 2px 0 var(--t3); }
.nodo.hecho { background: var(--t); }
.nodo.cerrado { background: #dcdae6; box-shadow: 0 7px 0 #9c98b3; }
.nodo.cerrado .nodo-icono { opacity: .6; }
.nodo.siguiente { animation: late 1.2s ease-in-out infinite; outline: 5px solid var(--sol); outline-offset: 3px; }
.juega { position: absolute; z-index: 2; top: 70px; background: var(--sol); border: var(--borde); border-radius: 99px; padding: 0 10px; font-size: .95rem; font-weight: 900; pointer-events: none; }
.herramientas { display: flex; justify-content: flex-end; gap: 8px; margin: -6px 0 2px; }
.mini { width: 48px; height: 48px; border: var(--borde); border-radius: 50%; background: #fff; font-size: 1.3rem; padding: 0; }
.ver-clave { justify-self: start; min-height: 48px; margin-top: -6px; padding: 4px 12px; background: none; border: 0; font-size: 1rem; font-weight: 800; text-decoration: underline; }
@keyframes late { 0%, 100% { scale: 1; } 50% { scale: 1.07; } }
.nodo-icono { font-size: 2.3rem; line-height: 1; }
.nodo-num { position: absolute; top: -8px; left: -8px; width: 30px; height: 30px; border-radius: 50%; background: var(--tinta); color: #fff; font-size: 1rem; font-weight: 900; line-height: 30px; }
.estrellas { margin-top: 8px; font-size: 1.35rem; line-height: 1; letter-spacing: 2px; color: rgba(43, 35, 80, .22); }
.estrellas .on { color: #ffb400; -webkit-text-stroke: 1.5px var(--tinta); paint-order: stroke fill; }
.paso-titulo { font-size: .8rem; font-weight: 700; line-height: 1.15; margin-top: 4px; padding: 0 2px; color: #3d3566; }

/* ---------- menú ---------- */
#nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: var(--papel); border-top: var(--borde); }
.menu-btn { flex: 1; max-width: 190px; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 3px solid transparent; border-radius: 16px; font-size: .9rem; font-weight: 800; padding: 4px 2px; }
.menu-icono { font-size: 2.1rem; line-height: 1; }
.menu-btn[aria-current="page"] { background: var(--sol); border-color: var(--tinta); }

/* ---------- prueba ---------- */
.prueba { display: flex; flex-direction: column; gap: 12px; }
#app[data-vista="prueba"] { padding-top: calc(10px + env(safe-area-inset-top)); padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.prueba-cabeza { display: flex; align-items: center; gap: 10px; }
.cerrar { width: 48px; height: 48px; flex: none; border: var(--borde); border-radius: 50%; background: #fff; font-weight: 900; }
.progreso { flex: 1; display: flex; gap: 6px; }
.progreso i { flex: 1; height: 18px; border-radius: 99px; border: var(--borde); background: #fff; }
.progreso i.actual { background: var(--sol); animation: late 1s ease-in-out infinite; }
.progreso i.bien { background: var(--ok); }
.progreso i.mal { background: var(--ay); }
.compa-prueba { width: 76px; flex: none; }
.zona { display: grid; gap: 16px; }
.enunciado-caja { position: relative; text-align: center; padding: 20px 18px; border-color: var(--tinta); box-shadow: 0 6px 0 var(--t3); background: linear-gradient(var(--t2), #fff 60%); }
.escuchar { float: right; width: 56px; height: 56px; margin: -8px -6px 6px 10px; border: var(--borde); border-radius: 50%; background: var(--sol); font-size: 1.6rem; box-shadow: 0 4px 0 var(--tinta); }
.escuchar:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--tinta); }
.enunciado { font-size: clamp(1.35rem, 5.4vw, 1.9rem); font-weight: 900; line-height: 1.25; }
.visual { clear: both; margin-top: 12px; font-size: clamp(3rem, 17vw, 5.5rem); font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.visual.largo { font-size: clamp(1.9rem, 8.5vw, 3rem); letter-spacing: 2px; }
.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.opciones.largas { grid-template-columns: 1fr; }
.opcion, .pieza { min-height: 76px; padding: 10px 12px; border: var(--borde); border-radius: 22px; background: #fff; font-size: clamp(1.4rem, 6vw, 2rem); font-weight: 900; box-shadow: 0 6px 0 var(--tinta); transition: transform .08s, box-shadow .08s; overflow-wrap: anywhere; color: var(--tinta); }
.opciones.largas .opcion { font-size: clamp(1.15rem, 4.8vw, 1.5rem); min-height: 64px; }
.opcion:nth-child(4n+1) { background: #fff0e8; } .opcion:nth-child(4n+2) { background: #e6f5ff; } .opcion:nth-child(4n+3) { background: #e9f9e7; } .opcion:nth-child(4n) { background: #fff8d9; }
.opcion:active:not(:disabled), .pieza:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 2px 0 var(--tinta); }
.opcion:disabled { opacity: .6; }
.opcion.bien, .huecos.bien { background: var(--ok) !important; opacity: 1; }
.opcion.bien::after { content: " ✓"; }
.opcion.mal { background: var(--ay) !important; opacity: 1; animation: anima .5s; }
.opcion.mal::after { content: " ✗"; }
.ordena { display: grid; gap: 12px; }
.ordena-botones { display: flex; gap: 12px; }
.deshacer { flex: none; min-width: 64px; min-height: 64px; font-size: 1.6rem; padding: 0; }
.huecos, .piezas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; min-height: 84px; padding: 10px; border-radius: 22px; }
.huecos { background: rgba(255, 255, 255, .6); border: 4px dashed var(--tinta); }
.huecos.mal { background: var(--ay-claro); }
.huecos:empty::before { content: "Toca las piezas en orden"; font-size: 1rem; font-weight: 700; color: #4a4370; }
.piezas:empty { display: none; }
.pieza { min-height: 64px; min-width: 64px; background: var(--t2); }
.huecos:not(.frase) { gap: 4px; }
.veredicto { display: none; }
.veredicto.visible { position: fixed; z-index: 6; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 736px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 12px 14px; border: var(--borde); border-radius: 24px; box-shadow: 0 6px 0 var(--tinta); animation: sube .35s ease both; }
.veredicto.bien { background: var(--ok-claro); }
.veredicto.mal { background: var(--ay-claro); }
.veredicto-texto { font-size: 1.4rem; font-weight: 900; flex: 1 1 60%; }
.solucion { font-size: 1.15rem; flex: 1 1 100%; order: 2; }
.solucion strong { display: inline-block; background: #fff; border: var(--borde); border-radius: 12px; padding: 2px 12px; font-size: 1.4rem; font-weight: 900; }
.veredicto .btn { order: 3; margin-left: auto; }
@keyframes sube { from { transform: translateY(40px); opacity: 0; } }

/* ---------- resultado y captura ---------- */
.resultado { text-align: center; display: grid; gap: 14px; justify-items: center; padding-top: 10px; }
.resultado-titulo { font-size: clamp(1.7rem, 7.5vw, 2.7rem); font-weight: 900; line-height: 1.15; }
.resultado-titulo .nombre { font-size: 1.15em; }
.resultado-cuenta { font-size: 1.2rem; }
.estrellas-grandes { display: flex; gap: 8px; }
.estrellas-grandes span { width: clamp(3.2rem, 17vw, 5rem); }
.estrellas-grandes span:nth-child(2) { margin-top: -12px; }
.estrellas-grandes span:not(.on) { filter: grayscale(1) brightness(1.5); opacity: .45; }
.estrellas-grandes .cae { animation: cae .7s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes cae { from { translate: 0 -70vh; rotate: -200deg; opacity: 0; } }
.escena { width: min(70vw, 280px); min-height: 200px; display: grid; justify-items: center; }
.capsula-btn { width: 100%; background: none; border: 0; padding: 0; border-radius: 40px; }
.capsula-btn.agita { animation: agita 1.2s ease-in-out infinite; }
@keyframes agita { 0%, 55%, 100% { transform: rotate(0); } 10% { transform: rotate(-14deg); } 22% { transform: rotate(12deg); } 34% { transform: rotate(-9deg); } 46% { transform: rotate(6deg); } }
.capsula .cap-izq, .capsula .cap-der { transition: transform .6s cubic-bezier(.3, 1.4, .5, 1), opacity .6s; transform-box: fill-box; transform-origin: 50% 100%; }
.capsula .cap-luz { opacity: 0; transform-box: fill-box; transform-origin: center; transition: transform .6s, opacity .3s; }
.abierta .cap-izq { transform: translate(-70px, 14px) rotate(-38deg); opacity: 0; }
.abierta .cap-der { transform: translate(70px, 14px) rotate(38deg); opacity: 0; }
.abierta .cap-luz { opacity: 1; transform: scale(1.5); }
.pista { font-size: 1.3rem; font-weight: 900; animation: late 1s ease-in-out infinite; }
.trofeo { display: block; background: none; border: 0; padding: 0; width: 100%; filter: drop-shadow(0 8px 0 rgba(43, 35, 80, .15)); }
.capturada { font-size: 1.5rem; font-weight: 900; }
.capturada strong { display: block; font-size: 1.5em; color: var(--t3); -webkit-text-stroke: .5px var(--tinta); }
.extras { display: grid; gap: 8px; }
.premio { background: #fff; border: var(--borde); border-radius: 18px; padding: 10px 16px; font-size: 1.15rem; font-weight: 900; box-shadow: 0 4px 0 var(--tinta); }

#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 20; }
.confeti { position: absolute; top: -30px; width: 12px; height: 18px; border-radius: 3px; font-style: normal; animation: confeti 2.4s linear both; }
.confeti.k0 { background: #ff7a45; } .confeti.k1 { background: #37b6f6; } .confeti.k2 { background: #5cc463; } .confeti.k3 { background: #ffcb2b; } .confeti.k4 { background: #b77bff; }
.confeti.es-estrella { background: none; width: auto; height: auto; font-size: 1.8rem; color: #ffc400; -webkit-text-stroke: 1.5px var(--tinta); }
@keyframes confeti { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- colección ---------- */
.rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.celda { display: flex; flex-direction: column; align-items: center; padding: 6px 4px 8px; border: var(--borde); border-radius: 20px; background: rgba(255, 255, 255, .55); border-style: dashed; color: var(--tinta); }
.celda:not(.mia) .criatura { filter: brightness(0); opacity: .22; }
.celda:not(.mia) .criatura * { animation: none; }
.celda.mia { background: var(--t2); border-style: solid; box-shadow: 0 5px 0 var(--t3); transition: transform .08s, box-shadow .08s; }
.celda.mia:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--t3); }
.celda.evo { background: linear-gradient(#fff6b8, var(--t2)); }
.celda-nombre { font-size: .82rem; font-weight: 900; line-height: 1.1; text-align: center; }
.ficha { width: min(92vw, 420px); border: var(--borde); border-radius: 30px; background: linear-gradient(var(--t2), #fff); box-shadow: 0 8px 0 var(--tinta); padding: 20px; text-align: center; color: var(--tinta); }
.ficha::backdrop { background: rgba(43, 35, 80, .55); }
.ficha h2 { font-size: 2rem; font-weight: 900; }
.ficha .nota { min-height: 2.6em; margin: 6px 0 12px; }
.ficha-dibujo { width: min(60vw, 240px); margin: 0 auto; }
.evolucionando { animation: evoluciona 1.5s ease-in both; }
@keyframes evoluciona {
  0% { transform: scale(1); filter: brightness(1); }
  20% { transform: scale(1.1) rotate(-6deg); filter: brightness(1.6); }
  40% { transform: scale(.9) rotate(6deg); filter: brightness(1); }
  60% { transform: scale(1.2) rotate(-6deg); filter: brightness(2.4); }
  80% { transform: scale(.85) rotate(6deg); filter: brightness(1.4); }
  100% { transform: scale(1.4); filter: brightness(8) saturate(0); }
}

.ajustes { gap: 14px; text-align: left; }
.ajustes[open] { display: grid; }
.ajustes h2 { text-align: center; }
.voz-fila { display: flex; gap: 10px; align-items: center; }
.voz-fila select { flex: 1; min-width: 0; min-height: 48px; padding: 6px 10px; border: var(--borde); border-radius: 14px; background: #fff; font: inherit; font-size: 1rem; color: var(--tinta); }

/* ---------- ranking ---------- */
.tabla { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.fila { display: grid; grid-template-columns: 48px 1fr; gap: 2px 10px; align-items: center; background: var(--papel); border: var(--borde); border-radius: 20px; padding: 10px 14px; box-shadow: 0 4px 0 var(--tinta); }
.fila.yo { background: #fff3a6; transform: scale(1.02); }
.puesto { grid-row: span 2; font-size: 2rem; font-weight: 900; text-align: center; }
.quien { font-size: 1.35rem; overflow-wrap: anywhere; }
.quien b { font-weight: 900; }
.quien small { font-size: .9rem; font-weight: 700; }
.tu { margin-left: 8px; background: var(--tinta); color: #fff; border-radius: 99px; padding: 2px 10px; font-size: .9rem; }
.datos { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 1.05rem; }
.dato.principal { font-weight: 900; font-size: 1.2rem; }

/* ---------- zona familia ---------- */
.familia-lista { display: grid; gap: 14px; margin-top: 14px; }
.jugador { display: grid; gap: 8px; font-weight: 700; }
.jugador-acciones { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.jugador-acciones input { flex: 1 1 180px; min-height: 48px; font-size: 1rem; }
#app[data-vista="familia"] .formulario { max-width: 420px; margin: 16px auto 0; }

#aviso { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30; translate: -50% 0; max-width: 90vw; background: var(--tinta); color: #fff; padding: 12px 18px; border-radius: 16px; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .2s; }
#aviso.visible { opacity: 1; }
.sin-js { text-align: center; padding: 40px; }

/* móviles bajos (360x640): la pregunta, las respuestas y el botón de seguir caben sin desplazarse */
@media (max-height: 700px) {
  .compa-prueba { width: 56px; }
  .enunciado-caja { padding: 12px 14px; }
  .enunciado { font-size: clamp(1.2rem, 5vw, 1.5rem); }
  .visual { margin-top: 6px; font-size: clamp(2.6rem, 14vw, 4rem); }
  .visual.largo { font-size: clamp(1.6rem, 7.5vw, 2.4rem); }
  .escuchar { width: 48px; height: 48px; font-size: 1.3rem; margin-top: -4px; }
  .opciones { gap: 10px; }
  .opcion { min-height: 66px; }
  .opciones.largas .opcion { min-height: 52px; padding: 6px 10px; }
  .pieza { min-height: 56px; min-width: 56px; }
  .huecos, .piezas { min-height: 74px; padding: 8px; }
  .veredicto-texto { font-size: 1.2rem; }
  .desfile { max-width: 260px; }
  .formulario { gap: 10px; }
  .campo input { min-height: 50px; }
}

/* móviles estrechos: los tres contadores en una sola fila, solo icono y número */
@media (max-width: 430px) {
  .chip-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .chips { flex-wrap: nowrap; }
}

@media (min-width: 620px) {
  .camino { grid-template-columns: repeat(6, 1fr); }
  .paso:nth-child(3n+2) { margin-top: 0; }
  .paso:nth-child(even) { margin-top: 18px; }
  .paso:not(:first-child)::before { content: ""; position: absolute; top: 40px; right: 50%; width: 100%; border-top: 7px dotted rgba(43, 35, 80, .28); }
  .nodo { width: 92px; height: 92px; }
  .opciones { gap: 18px; }
  .opcion { min-height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ================= La aventura: historia, perfil, fases, combate por turnos, duelos ================= */

/* gestos de las criaturas (grupos interiores del SVG) */
.criatura .cola, .criatura .ala, .criatura .cresta { transform-box: fill-box; }
.criatura .cola { transform-origin: 0% 80%; animation: menea 1.4s ease-in-out infinite; }
.criatura .ala { transform-origin: 0% 90%; animation: aletea 1.1s ease-in-out infinite; }
.criatura .cresta { transform-origin: 50% 100%; animation: menea 2.2s ease-in-out infinite; }
.sabina .ala.saluda { transform-origin: 0% 100%; animation: aletea .7s ease-in-out infinite; }
@keyframes menea { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(9deg); } }
@keyframes aletea { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(14deg); } }
.rejilla .criatura *, .mini-avatar .criatura *, .tabla .criatura * { animation: none; }   /* listas largas: sin gestos, para móviles modestos */
.gira { animation: gira .8s ease; }
@keyframes gira { to { transform: rotate(360deg); } }
.brinca { animation: brinca 1s ease-in-out infinite; }
@keyframes brinca { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-14%) scale(.97, 1.04); } 55% { transform: translateY(0) scale(1.05, .94); } }
.tiembla { animation: tiembla .5s linear infinite; }
@keyframes tiembla { 0%, 100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-2%) rotate(-2deg); } 75% { transform: translateX(2%) rotate(2deg); } }
.huye { animation: huye 1.6s ease-in forwards; }
@keyframes huye { 20% { transform: translate(-8%, 0) rotate(-10deg); } 100% { transform: translate(160%, -60%) rotate(50deg) scale(.4); opacity: 0; } }
.transforma { animation: transforma 1.4s ease-out both; }
@keyframes transforma { 0% { transform: scale(.3); filter: brightness(6) saturate(0); } 60% { transform: scale(1.25); filter: brightness(2); } 100% { transform: scale(1); filter: none; } }
.estelar .aura { transform-box: fill-box; transform-origin: center; animation: aura 6s linear infinite; }
@keyframes aura { to { transform: rotate(360deg); } }

/* historia */
.historia { display: grid; gap: 14px; max-width: 620px; margin: 0 auto; }
.historia-barra { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.historia-puntos { display: flex; gap: 8px; }
.historia-puntos i { width: 14px; height: 14px; border-radius: 50%; border: var(--borde); background: #fff; }
.historia-puntos i.on { background: var(--sol); }
.saltar { min-height: 48px; padding: 6px 14px; border: var(--borde); border-radius: 99px; background: #fff; font-weight: 800; font-size: 1rem; }
.escenario { position: relative; border: var(--borde); border-radius: 26px; overflow: hidden; box-shadow: 0 6px 0 var(--tinta); background: #bfe9ff; aspect-ratio: 320 / 220; }
.fondo { display: block; width: 100%; height: 100%; }
.fondo .bruma { animation: bruma 7s ease-in-out infinite alternate; }
.fondo .bruma.b1 { animation-duration: 9s; } .fondo .bruma.b2 { animation-duration: 11s; animation-direction: alternate-reverse; }
@keyframes bruma { from { transform: translateX(-14px); } to { transform: translateX(14px); } }
.fondo .flotante { animation: flota 2.4s ease-in-out infinite; }
.fondo .humo { animation: flota 3s ease-in-out infinite; }
.actor { position: absolute; bottom: 4%; width: 36%; }
.p-izq { left: 5%; } .p-der { right: 5%; } .p-centro { left: 32%; width: 38%; }
.p-evo1 { left: 4%; width: 24%; } .p-evo2 { left: 31%; width: 30%; } .p-evo3 { right: 3%; width: 38%; }
.p-ali1 { left: 34%; width: 20%; bottom: 40%; } .p-ali2 { left: 40%; width: 20%; bottom: 6%; } .p-ali3 { left: 14%; width: 20%; bottom: 52%; }
.historia-texto { background: #fff; border: var(--borde); border-radius: 20px; padding: 12px 16px; font-size: clamp(1.2rem, 5vw, 1.6rem); font-weight: 900; line-height: 1.25; text-align: center; min-height: 4.4em; display: grid; align-items: center; }

/* consejo de Doña Sabina */
.consejo { display: grid; gap: 12px; justify-items: center; }
.consejo[open] { display: grid; }
.consejo-dibujo { width: 120px; }
.consejo-texto { font-size: 1.3rem; font-weight: 900; }

/* avatar y mascota */
.perfil { display: grid; gap: 12px; max-width: 560px; margin: 0 auto; text-align: center; }
.perfil-dibujo { width: min(46vw, 200px); margin: 0 auto; }
.perfil-fila { display: flex; gap: 8px; justify-content: center; }
.perfil-opcion { flex: 1; max-width: 86px; min-width: 48px; padding: 2px; border: var(--borde); border-radius: 18px; background: #fff; box-shadow: 0 4px 0 var(--tinta); }
.perfil-opcion.ocupada { filter: grayscale(1); opacity: .55; box-shadow: none; }
.perfil-dibujo.ocupado { filter: grayscale(1); opacity: .6; }
.ocupados { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px; font-size: .95rem; }
.ocupados .ic { width: 22px; height: 22px; }
.ocupado-de { display: inline-flex; align-items: center; }
.ocupados .mini-avatar { width: 34px; height: 34px; margin-right: 4px; border-width: 2px; }
.perfil-opcion.grande { max-width: 130px; background: var(--t2); }
.perfil-opcion[aria-pressed="true"] { background: var(--sol); outline: 5px solid var(--tinta); outline-offset: 2px; }
.perfil-partes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.perfil-nombres { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip-btn { min-height: 48px; padding: 6px 16px; border: var(--borde); border-radius: 99px; background: #fff; font-weight: 900; box-shadow: 0 3px 0 var(--tinta); }
.chip-btn[aria-pressed="true"] { background: var(--tinta); color: #fff; }

/* mapa por fases */
.herramientas { align-items: center; }
.herramientas .como { margin-right: auto; }
.hola-dibujos { position: relative; }
.mi-avatar { position: absolute; left: -6px; bottom: -8px; width: 52%; padding: 0; border: var(--borde); border-radius: 50%; background: #fff; overflow: hidden; box-shadow: 0 3px 0 var(--tinta); z-index: 1; }
.hola-dibujos .compa { display: block; width: 100%; padding-left: 22%; }
.duelos-btn { display: flex; align-items: center; gap: 12px; width: 100%; margin-bottom: 20px; padding: 10px 16px; text-align: left; border: var(--borde); border-radius: 22px; background: #fff; box-shadow: 0 6px 0 var(--tinta); min-height: 64px; }
.duelos-btn b { display: block; font-size: 1.2rem; font-weight: 900; }
.duelos-btn small { font-size: .95rem; font-weight: 700; }
.duelos-btn > span:nth-child(2) { flex: 1; }
.duelos-btn.aviso { background: var(--sol); animation: late 1.2s ease-in-out infinite; }
.duelos-icono { font-size: 2rem; }
.copas { font-weight: 900; font-size: 1.15rem; white-space: nowrap; }
.fase { position: relative; display: block; width: 100%; margin-bottom: 24px; border: var(--borde); border-radius: 30px; background: #f4efff; box-shadow: 0 8px 0 #6a4fb3; overflow: hidden; color: var(--tinta); }
.fase.despejada { background: #fffbe6; box-shadow: 0 8px 0 #c79a00; }
.fase-cabeza { display: flex; align-items: center; justify-content: space-between; padding: 8px 18px; background: #b9a3f0; border-bottom: var(--borde); }
.fase.despejada .fase-cabeza { background: var(--sol); }
.fase-cabeza h2 { font-size: 1.6rem; font-weight: 900; }
.fase-num { font-size: 1.4rem; font-weight: 900; }
.fase-candado { font-size: 1.6rem; }
.fase-pista { font-size: .95rem; font-weight: 700; }
.fase .camino { position: relative; z-index: 1; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 16px 6px 8px; }
.fase .paso, .fase .paso:nth-child(n) { margin-top: 0; }
.fase .paso::before { display: none; }
.fase .nodo { width: clamp(62px, 19vw, 92px); height: clamp(62px, 19vw, 92px); background: var(--t2); animation: none; }
.fase .nodo.hecho { background: var(--t); }
.fase .nodo.siguiente { animation: late 1.2s ease-in-out infinite; }
.fase .nodo-icono { font-size: clamp(1.7rem, 7vw, 2.4rem); }
.fase .juega { top: clamp(50px, 16vw, 78px); }
.fase .estrellas { font-size: 1.1rem; letter-spacing: 0; margin-top: 12px; }
.jefe-btn { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: calc(100% - 20px); margin: 6px 10px 14px; padding: 6px 14px; text-align: left; border: var(--borde); border-radius: 22px; background: #dcdae6; box-shadow: 0 5px 0 #9c98b3; color: var(--tinta); min-height: 76px; }
.jefe-btn.abierto { background: #ffd6d6; box-shadow: 0 5px 0 #b3261e; }
.jefe-btn.vencido { background: #d9f8e2; box-shadow: 0 5px 0 #2c7d33; }
.jefe-btn.siguiente { animation: late 1.2s ease-in-out infinite; outline: 5px solid var(--sol); outline-offset: 3px; }
.jefe-dibujo { width: 68px; flex: none; }
.jefe-btn:not(.abierto) .jefe-dibujo { filter: grayscale(1) opacity(.6); }
.jefe-btn.vencido .jefe-dibujo { transform: rotate(160deg) scale(.8); }
.jefe-texto b { display: block; font-size: 1.2rem; font-weight: 900; }
.jefe-texto small { font-size: .9rem; font-weight: 700; line-height: 1.15; display: block; }

/* combate por turnos */
/* el panel de acción es fijo y solo aparece tras contestar: no hace falta reservarle hueco (así nada se desplaza) */
#app[data-vista="combate"] { padding: calc(8px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)); }
.combate { display: grid; gap: 8px; }
.arena { position: relative; isolation: isolate; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; padding: 6px 10px; border: var(--borde); border-radius: 22px; background: #bfe9ff; overflow: hidden; }
.arena-fondo { position: absolute; inset: 0; z-index: -1; }
.bando { display: grid; gap: 4px; justify-items: center; }
.bando-fila { display: flex; align-items: flex-end; }
.luchador, .pareja { --L: clamp(76px, 24vw, 130px); }
.aliados { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; width: clamp(88px, 26vw, 130px); margin-right: 4px; }
.aliados:empty { display: none; }
.energia { display: flex; gap: 3px; padding: 3px; border: var(--borde); border-radius: 99px; background: #fff; }
.energia i { width: clamp(12px, 3.6vw, 20px); height: 14px; border-radius: 99px; background: #dcdae6; transition: background .3s; }
.energia.mia i.on { background: var(--ok); } .energia.suya i.on { background: #ff5d5d; }
.cartel { min-height: 1.4em; text-align: center; font-size: 1.05rem; font-weight: 900; }
.combate .zona { gap: 10px; }
.accion { display: none; }
.accion.visible { position: fixed; z-index: 6; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 736px; margin: 0 auto; display: grid; gap: 8px; padding: 10px 12px; border: var(--borde); border-radius: 24px; box-shadow: 0 6px 0 var(--tinta); animation: sube .3s ease both; }
.accion.bien { background: var(--ok-claro); } .accion.mal { background: var(--ay-claro); }
.accion .btn { justify-self: end; }
.ataques { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ataque { display: grid; justify-items: center; gap: 2px; min-height: 84px; padding: 6px 4px; border: var(--borde); border-radius: 18px; background: #fff; box-shadow: 0 5px 0 var(--tinta); font-size: .92rem; font-weight: 900; line-height: 1.1; color: var(--tinta); }
.ataque:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--tinta); }
.ataque.super { grid-auto-flow: column; align-items: center; justify-content: center; gap: 10px; min-height: 60px; font-size: 1.15rem; background: var(--sol); animation: late .9s ease-in-out infinite; }
.icono-ataque { width: 44px; height: 44px; }
.defensas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.defensas .btn { justify-self: stretch; font-size: 1.25rem; padding: 8px; }
.carga { animation: carga .6s ease; }
@keyframes carga { 0%, 100% { transform: scale(1); filter: none; } 50% { transform: scale(1.18); filter: brightness(1.5) drop-shadow(0 0 10px #ffe14d); } }
.embiste { animation: embiste .5s ease; }
@keyframes embiste { 40% { transform: translateX(22%) rotate(8deg); } }
.embiste-rival { animation: embiste-rival .5s ease; }
@keyframes embiste-rival { 40% { transform: translateX(-22%) rotate(-8deg); } }
.golpe { animation: golpe .45s linear; }
@keyframes golpe { 20%, 60% { transform: translateX(-6%) rotate(-5deg); opacity: .5; } 40%, 80% { transform: translateX(6%) rotate(5deg); opacity: 1; } }
.esquiva { animation: esquiva .6s ease; }
@keyframes esquiva { 40% { transform: translate(-30%, -30%) rotate(-20deg); } }
.escudo { animation: escudo .7s ease; border-radius: 50%; }
@keyframes escudo { 30%, 70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, .9), 0 0 0 12px rgba(55, 182, 246, .7); transform: scale(.94); } }

/* niveles y fuerza */
.nivel { display: flex; align-items: center; gap: 8px; justify-content: center; margin: 6px 0; font-weight: 900; }
.nivel-barra { display: flex; gap: 3px; padding: 3px; border: var(--borde); border-radius: 99px; background: #fff; }
.nivel-barra i { width: clamp(12px, 4vw, 20px); height: 16px; border-radius: 99px; background: #e6e3ef; }
.nivel-barra i.on { background: linear-gradient(#ffe14d, #ffb400); }
.premio.crece { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 8px; text-align: left; }
.celda-nivel { font-size: .75rem; font-weight: 900; background: var(--tinta); color: #fff; border-radius: 99px; padding: 0 8px; margin-top: 2px; }
.celda.f2 { background: linear-gradient(#fff, var(--t2)); } .celda.f3 { background: linear-gradient(#fff6b8, var(--t2)); }
.celda.elegida { outline: 5px solid var(--sol); outline-offset: 1px; }
.ficha-dibujo { display: block; background: none; border: 0; padding: 0; }
.ficha-frase { font-size: 1.1rem; font-weight: 800; }

/* duelos y ranking */
.fila.duelo { grid-template-columns: 1fr auto; }
.fila.duelo .datos { grid-column: 1; }
.fila.duelo .btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.mini-avatar { display: inline-block; width: 44px; height: 44px; vertical-align: middle; margin-right: 6px; border: var(--borde); border-radius: 50%; background: #fff; overflow: hidden; }
.arena.grande { width: 100%; max-width: 520px; padding: 12px; }
.arena.grande .luchador, .arena.grande .pareja { --L: clamp(76px, 24vw, 150px); }
.marcador { font-size: 2.2rem; font-weight: 900; }
.duelo-fin .cartel { font-size: 1.4rem; }

/* móviles bajos (360x640): el combate entero cabe sin desplazarse */
@media (max-height: 700px) {
  .cartel { font-size: .95rem; }
  .ataque { min-height: 72px; font-size: .85rem; }
  .icono-ataque { width: 36px; height: 36px; }
  .ataque.super { min-height: 52px; }
  .combate .enunciado-caja { padding: 8px 12px; }
  .combate .visual { font-size: clamp(2.2rem, 12vw, 3.4rem); margin-top: 2px; }
  .combate .visual.largo { font-size: clamp(1.3rem, 6.4vw, 2rem); letter-spacing: 0; }
  .combate .opcion { min-height: 58px; }
  .historia-texto { font-size: 1.15rem; min-height: 4em; }
  .perfil-dibujo { width: 130px; }
  .ficha { padding: 12px 16px; }
  .ficha-dibujo { width: 130px; }
  .ficha h2 { font-size: 1.6rem; }
  .ficha .nota { min-height: 1.3em; margin: 2px 0 8px; }
  .ficha .btn { min-height: 50px; font-size: 1.1rem; }
  .resultado .escena { width: 170px; min-height: 150px; }
}

/* ================= Tablet (768x1024, 810x1080, 1024x768, 1180x820): más grande, sin estirar ================= */
@media (min-width: 700px) and (min-height: 700px) {
  html { font-size: 118%; }
  #app { max-width: 980px; }
  .rejilla { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
  .fase .nodo { width: 104px; height: 104px; }
  .fase .nodo-icono { font-size: 2.8rem; }
  .fase .juega { top: 88px; }
  .jefe-dibujo { width: 96px; }
  .mini-avatar { width: 56px; height: 56px; }
  .accion.visible { max-width: 900px; }
  .historia { max-width: 760px; }
  .perfil { max-width: 680px; }
}
/* apaisado: el mapa en dos columnas y, en el combate, pregunta y respuestas en dos paneles */
@media (min-width: 1000px) and (orientation: landscape) {
  #app { max-width: 1140px; }
  #app[data-vista="mapa"] { display: grid; grid-template-columns: 5fr 7fr; gap: 0 24px; align-items: start; }
  #app[data-vista="mapa"] > .herramientas { grid-column: 1 / -1; }
  #app[data-vista="mapa"] > .hola, #app[data-vista="mapa"] > .duelos-btn { grid-column: 1; }
  #app[data-vista="mapa"] > .mapa { grid-column: 2; grid-row: 2 / span 4; }
  #app[data-vista="combate"] { padding-bottom: 16px; }
  .combate { grid-template-columns: 1fr 1fr; grid-template-areas: "cab cab" "arena zona" "cartel zona" "accion zona"; gap: 12px 24px; align-items: start; }
  .combate > .prueba-cabeza { grid-area: cab; } .combate > .arena { grid-area: arena; } .combate > .cartel { grid-area: cartel; }
  .combate > .zona { grid-area: zona; } .combate > .accion { grid-area: accion; }
  .accion.visible { position: static; max-width: none; }
  .historia-barra { grid-column: 1 / -1; }
}

/* ================= Pasada de arte: iconos propios, criaturas con vida, Súper Forma Estelar y ataques ================= */

/* iconos dibujados (arte.js): van donde antes había emojis */
.icono { display: block; width: 100%; height: 100%; overflow: visible; }
.ic { display: inline-block; width: 1.3em; height: 1.3em; vertical-align: -.3em; flex: none; }
.menu-icono { display: block; width: 40px; height: 40px; }
.nodo-icono { display: block; width: 64%; margin: 0 auto; font-size: 0; }
.mini { display: grid; place-items: center; }
.mini .ic { width: 28px; height: 28px; }
.cerrar, .escuchar, .deshacer { display: grid; place-items: center; padding: 0; }
.cerrar .icono { width: 22px; height: 22px; }
.escuchar .icono { width: 30px; height: 30px; }
.deshacer .icono { width: 34px; height: 34px; }
.medalla { display: block; width: 40px; height: 40px; }
.fase-candado { width: 34px; height: 34px; }
.duelos-icono { width: 46px; height: 46px; flex: none; }
.puesto .icono { width: 42px; height: 42px; margin: 0 auto; }
.pestanas.tipos .pestana .ic { width: 36px; height: 36px; }
.titulo .ic, .saludo .ic { width: 1.1em; height: 1.1em; vertical-align: -.2em; }
.premio .ic { width: 1.5em; height: 1.5em; }

/* criaturas con vida: respiran, mueven las orejas y, los Borrones, gotean tinta */
.criatura .respira { transform-origin: 100px 188px; animation: respira 3.2s ease-in-out infinite; }
@keyframes respira { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.025, .972); } }
.criatura .oreja { transform-box: fill-box; transform-origin: 50% 100%; animation: menea 3s ease-in-out infinite; }
.borron .gota { transform-box: fill-box; transform-origin: center; animation: gotea 2.4s ease-in infinite; }
.borron .gota.g1 { animation-delay: .8s; } .borron .gota.g2 { animation-delay: 1.6s; }
@keyframes gotea { 0% { transform: translateY(-16px) scale(.3); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(8px) scale(1); opacity: 0; } }
.celda .criatura * { animation: none; }
/* las mascotas miran hacia la izquierda: en mi bando se dan la vuelta para mirar al rival */
.luchador.yo > .mascota, .aliado > .mascota, .p-izq > .mascota, .p-izq .pareja > .mascota, [class*="p-ali"] .mascota, .compa > .mascota { scale: -1 1; }

/* Súper Forma Estelar: anillo que late y estrellas en órbita alrededor */
.estelar .orbita { animation: aura 5s linear infinite; }
.estelar .orbita.lenta { animation-duration: 9s; animation-direction: reverse; }
.estelar .anillo { animation: late-luz 1.4s ease-in-out infinite alternate; }
@keyframes late-luz { from { opacity: .7; } to { opacity: 1; } }

/* escenarios */
.fondo .sol-rayos { animation: aura 26s linear infinite; }
.fondo .nube-f { animation: bruma 12s ease-in-out infinite alternate; }
.fondo .onda { animation: bruma 3s ease-in-out infinite alternate; }
.fondo .lava, .fondo .haz { animation: late-luz 1.6s ease-in-out infinite alternate; }
.fondo .destello { transform-box: fill-box; transform-origin: center; animation: brilla 2.4s ease-in-out infinite; }

/* el dueño de cada criatura, de pie a su lado (cuerpo entero). --L es el ancho de la criatura */
.luchador { width: var(--L); }
.pareja { display: flex; align-items: flex-end; }
.pareja > .dueno { flex: none; width: 36%; margin-right: -7%; }
.pareja > :last-child { position: relative; flex: 1 1 0; min-width: 0; }
.pareja.yo > .dueno, .pareja.rival > .dueno { width: calc(var(--L) * .5); margin-right: calc(var(--L) * -.04); }
.pareja > .luchador { flex: none; }
.pareja.rival { flex-direction: row-reverse; }
.pareja.rival > .dueno { margin: 0 0 0 calc(var(--L) * -.04); scale: -1 1; }
.explorador { display: block; width: 100%; overflow: visible; }
.explorador .brazo { transform-origin: 74px 96px; }
/* sus gestos: levanta el brazo para mandar el ataque y da un respingo cuando golpean a su criatura */
.manda { animation: respingo .6s ease; }
.manda .brazo, .aliado.embiste .brazo { animation: manda .6s ease; }
@keyframes manda { 30%, 70% { transform: rotate(-80deg); } }
@keyframes respingo { 30% { transform: translateY(-6%); } }
.susto { animation: susto .45s ease; }
@keyframes susto { 30% { transform: translateX(-10%) rotate(-8deg); } 65% { transform: translateX(4%) rotate(4deg); } }
.accion.espera { display: none; }
.ataque.apagado { filter: grayscale(1); opacity: .5; box-shadow: none; }

/* ataques: cada elemento vuela a su manera. --w y --h son el tamaño de la arena; --s crece con la potencia (forma de la criatura) */
.proy { position: absolute; left: 20%; top: 48%; z-index: 3; width: calc(26px * var(--s, 1)); height: calc(26px * var(--s, 1)); margin: calc(-13px * var(--s, 1)); pointer-events: none; opacity: 0;
  --dir: 1; --t: .6s; --arc: -.25; --giro: calc(-90deg * var(--dir)); animation: tiro var(--t) ease-in both; }
.proy.vuelta { left: 80%; --dir: -1; }
.proy::before { content: ""; position: absolute; inset: -40%; border-radius: 50%; background: radial-gradient(closest-side, var(--halo, transparent), transparent); opacity: .6; }
.proy .bala { position: relative; display: block; width: 100%; height: 100%; overflow: visible; }
.proy.tipo-fuego { --t: .6s; --arc: -.32; --halo: #ffd93d; }     /* bolas que suben y caen */
.proy.tipo-agua { --t: .85s; --arc: .16; --halo: #bfe9ff; }      /* burbujas lentas que se hunden y salen */
.proy.tipo-planta { --t: .7s; --arc: -.14; --halo: #d6ffb0; }    /* hojas que giran */
.proy.tipo-rayo { --t: .32s; --arc: 0; --halo: #fff6a8; }        /* chispazos rectos y muy rápidos */
.proy.tipo-tinta { --t: .65s; --arc: -.2; }
@keyframes tiro {
  0% { translate: 0 0; scale: .3; opacity: 0; }
  15% { opacity: 1; }
  50% { translate: calc(var(--w) * .3 * var(--dir)) calc(var(--h) * var(--arc) + var(--y, 0px)); scale: 1; }
  88% { opacity: 1; }
  100% { translate: calc(var(--w) * .6 * var(--dir)) var(--y, 0px); scale: 1.35; opacity: 0; }
}
.proy.m2 { top: 80%; width: calc(34px * var(--s, 1)); height: calc(34px * var(--s, 1)); animation: rueda calc(var(--t) * 1.5) linear both; }
@keyframes rueda { 0% { translate: 0 0; opacity: 0; } 10%, 88% { opacity: 1; } 100% { translate: calc(var(--w) * .6 * var(--dir)) 0; opacity: 0; } }
.proy.m3 { top: -6%; --giro: 0deg; animation: lluvia calc(var(--t) * .9 + .15s) ease-in both; }
@keyframes lluvia { 0% { translate: calc(var(--w) * -.14 * var(--dir)) 0; opacity: 0; } 15%, 85% { opacity: 1; } 100% { translate: 0 calc(var(--h) * .82); scale: 1.3; opacity: 0; } }
.proy.m4 { left: 50%; top: 34%; z-index: 4; --giro: 0deg; animation: super 1s ease-in both; }
@keyframes super {
  0% { scale: 0; rotate: 0deg; opacity: 0; }
  20% { opacity: 1; }
  55%, 70% { translate: 0 0; scale: calc(4.5 * var(--s, 1)); rotate: 360deg; opacity: 1; }
  100% { translate: calc(var(--w) * .3 * var(--dir)) calc(var(--h) * .2); scale: 1.4; rotate: 720deg; opacity: 1; }
}
.proy.estalla { left: 80%; top: 55%; --giro: 0deg; animation: estalla .7s ease-out both; }
.proy.estalla.vuelta { left: 20%; }
@keyframes estalla { 0% { translate: 0 0; scale: .5; opacity: 1; } 100% { translate: var(--ex) var(--ey); scale: 1.3; opacity: 0; } }
.proy.tipo-fuego .bala, .proy.tipo-rayo .bala { animation: llama .14s ease-in-out infinite alternate; }
@keyframes llama { from { transform: rotate(var(--giro)) scale(1); } to { transform: rotate(var(--giro)) scale(1.3, 1.08); } }
.proy.tipo-agua .bala, .proy.tipo-tinta .bala { animation: gotita .3s ease-in-out infinite alternate; }
@keyframes gotita { from { transform: rotate(var(--giro)) scale(1.15, .9); } to { transform: rotate(var(--giro)) scale(.9, 1.15); } }
.proy.tipo-planta .bala { animation: gira .5s linear infinite; }
.proy.m2 .bala { animation: bote calc(var(--t) * .5) cubic-bezier(.3, 0, .7, 1) infinite; }
@keyframes bote { 0% { transform: translateY(0) rotate(0) scale(1.15, .85); } 50% { transform: translateY(calc(var(--h) * -.42)) rotate(180deg); } 100% { transform: translateY(0) rotate(360deg) scale(1.15, .85); } }
.impacto { position: absolute; left: 80%; top: 55%; z-index: 4; width: calc(84px * var(--s, 1)); aspect-ratio: 1; translate: -50% -50%; pointer-events: none; animation: impacto .5s ease-out both; }
.impacto.vuelta { left: 20%; }
@keyframes impacto { from { scale: .2; opacity: 1; } to { scale: 1.4; rotate: 40deg; opacity: 0; } }
.fogonazo { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: radial-gradient(circle, #fff 0, rgba(255, 246, 168, .75) 40%, transparent 75%); animation: fogonazo 1.4s ease-out both; }
@keyframes fogonazo { 0% { opacity: 0; } 40% { opacity: .9; } 62% { opacity: .3; } 68% { opacity: 1; } 100% { opacity: 0; } }
.sacude { animation: sacude .4s linear; }
@keyframes sacude { 20% { transform: translate(-5px, 3px); } 40% { transform: translate(5px, -3px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 2px); } }
.veredicto-texto.grande { text-align: center; font-size: 1.6rem; }

/* ---------- ajustes de pantallas: que todo quepa y que la tablet no se quede medio vacía ---------- */
.fase-pista, .jefe-texto small { line-height: 1.2; }
.perfil-fila.mascotas { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.perfil-fila.mascotas .perfil-opcion { max-width: none; overflow: hidden; }
.perfil-fila.mascotas .mascota { transform: scale(1.3); transform-origin: 50% 92%; }
.luchador.agotado > .criatura { rotate: 14deg; filter: grayscale(.7); opacity: .75; transition: rotate .4s, opacity .4s; }

/* combate: la arena crece con la altura de la pantalla */
.arena { min-height: clamp(128px, 23dvh, 250px); }
.luchador, .pareja { --L: clamp(84px, min(15dvh, 33vw), 150px); }
.con-equipo .luchador, .con-equipo .pareja { --L: clamp(60px, min(15dvh, 21vw), 150px); }   /* cinco parejas y el jefe tienen que caber a lo ancho */
.con-equipo .luchador.yo, .con-equipo .pareja.yo { --L: clamp(64px, min(16dvh, 21vw), 150px); }   /* la del niño, la más grande */
.con-equipo .pareja.yo > .dueno { width: calc(var(--L) * .44); margin-right: calc(var(--L) * -.06); }
.con-equipo .aliados { width: clamp(80px, 24vw, 130px); }
.tipo-duelo .luchador, .tipo-duelo .pareja { --L: clamp(76px, min(20dvh, 26vw), 230px); }   /* duelos: dos parejas, una por bando */
.bando.mio { justify-items: start; } .bando.suyo { justify-items: end; }
.bando { align-content: space-between; align-self: stretch; }
.energia { box-shadow: 0 2px 0 var(--tinta); }
.resultado .botones { width: 100%; }
.resultado .botones .btn { flex: 1 1 140px; }
.resultado .escena.con-captura { width: 100%; max-width: 520px; min-height: 0; grid-template-columns: minmax(124px, 40%) 1fr; align-items: center; gap: 4px 10px; }
.resultado .con-captura .capturada { text-align: left; font-size: 1.25rem; }

@media (max-width: 430px) {
  .chips { gap: 5px; }
  .chip { padding: 4px 9px; gap: 4px; font-size: 1rem; }
  .chip b { font-size: 1.05rem; }
  .perfil-fila.mascotas { grid-template-columns: 1fr 1fr; max-width: 270px; margin: 0 auto; }
}
@media (max-height: 700px) {
  .luchador, .pareja { --L: clamp(84px, min(15dvh, 33vw), 150px); }
  .combate.apretado .arena { min-height: 114px; }
  .combate.apretado .luchador, .combate.apretado .pareja { --L: 78px; }
  .combate.apretado .aliados { width: 84px; }
  .combate.apretado .zona { gap: 8px; }
  .combate.apretado .enunciado-caja { padding: 6px 10px; }
  .combate.apretado .enunciado.largo { font-size: 1.15rem; line-height: 1.2; }
  .combate.apretado .enunciado.largo + .visual { font-size: 1.9rem; margin-top: 0; }
  .combate.apretado .opciones { gap: 8px; }
  .combate.apretado .opciones.largas .opcion { min-height: 50px; padding: 4px 10px; font-size: 1.15rem; }
  .combate.apretado .huecos, .combate.apretado .piezas { min-height: 64px; padding: 6px; gap: 6px; }
  .combate.apretado .pieza { min-height: 50px; min-width: 50px; padding: 4px 10px; font-size: 1.3rem; }
  .combate.apretado .ordena { gap: 8px; }
  .combate.apretado .ordena .btn-grande, .combate.apretado .deshacer { min-height: 54px; }
  .perfil-fila.mascotas { grid-template-columns: repeat(4, 1fr); max-width: none; gap: 8px; }   /* en pantallas bajas, en una fila: el botón se ve sin desplazarse */
  /* resultado con captura: todo a la vista, sin desplazarse (360x640) */
  .resultado { gap: 8px; padding-top: 0; }
  .resultado-titulo { font-size: 1.45rem; }
  .estrellas-grandes span { width: 2.9rem; }
  .estrellas-grandes span:nth-child(2) { margin-top: -6px; }
  .resultado-cuenta { font-size: 1rem; }
  .resultado .premio { padding: 5px 12px; font-size: .98rem; box-shadow: 0 3px 0 var(--tinta); }
  .resultado .extras { gap: 6px; width: 100%; }
  .resultado .premio.crece { grid-template-columns: 56px 1fr; }
  .resultado .nivel { margin: 2px 0 0; justify-content: flex-start; }
  .resultado .nivel-barra i { height: 12px; }
  .resultado .btn { min-height: 50px; font-size: 1.1rem; padding: 6px 10px; }
  .resultado .con-captura .capturada { font-size: 1.1rem; }
  .pista { font-size: 1.15rem; }
}

/* tablets en vertical: arena alta, criaturas grandes y preguntas a buen tamaño */
@media (min-width: 700px) and (min-height: 900px) {
  .combate { gap: 14px; }
  .arena { min-height: 27dvh; padding: 12px 22px; }
  .combate.apretado .arena { min-height: 20dvh; }
  .combate.apretado .luchador, .combate.apretado .pareja { --L: 170px; }
  .combate .enunciado.largo { font-size: 1.6rem; }
  .combate.apretado .opciones.largas .opcion { min-height: 64px; }
  .combate .visual { font-size: 4.2rem; margin-top: 4px; }
  .combate .visual.largo { font-size: 2.4rem; }
  .luchador, .pareja { --L: clamp(170px, 20dvh, 230px); }
  .aliados { width: clamp(170px, 24vw, 220px); }
  .con-equipo .luchador, .con-equipo .pareja { --L: clamp(170px, 20dvh, 230px); }
  .con-equipo .luchador.yo, .con-equipo .pareja.yo { --L: clamp(150px, 19dvh, 200px); }
  .energia i { width: 26px; height: 18px; }
  .cartel { font-size: 1.3rem; }
  .combate .enunciado { font-size: 2rem; }
  .combate .opcion { min-height: 120px; font-size: 2.2rem; }
  .combate .opciones.largas .opcion { min-height: 74px; font-size: 1.5rem; }
  .ataque { min-height: 120px; font-size: 1.1rem; }
  .icono-ataque { width: 64px; height: 64px; }
  .historia { max-width: 760px; min-height: calc(100dvh - 60px); align-content: center; gap: 20px; }
  .historia-texto { font-size: 1.9rem; padding: 20px 24px; }
  .historia > .btn-grande { min-height: 88px; font-size: 1.8rem; }
  .resultado .escena { width: 340px; }
  .resultado .escena.con-captura { width: 100%; max-width: 660px; grid-template-columns: 240px 1fr; }
  .resultado .con-captura .capturada { font-size: 1.8rem; }
  .perfil-dibujo { width: 260px; }

}
/* apaisado (1024x768, 1180x820): dos paneles que llenan la pantalla entera */
@media (min-width: 1000px) and (orientation: landscape) {
  #app[data-vista="combate"] { max-width: 1280px; }
  .combate { min-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); grid-template-columns: 1.1fr 1fr; grid-template-rows: auto 1fr auto auto; align-items: stretch; }
  .combate > .zona { align-content: center; gap: 18px; }
  .arena { min-height: 0; padding: 14px 22px; }
  .luchador, .pareja { --L: clamp(120px, min(25dvh, 17vw), 230px); }
  .tipo-duelo .luchador, .tipo-duelo .pareja { --L: min(20dvh, 14vw); }
  .aliados { width: clamp(150px, 26dvh, 210px); }
  .con-equipo .luchador, .con-equipo .pareja, .con-equipo .luchador.yo, .con-equipo .pareja.yo { --L: min(21dvh, 12vw); }
  .con-equipo .aliados { width: min(21dvh, 12vw); }
  .energia i { width: 24px; height: 18px; }
  .cartel { font-size: 1.25rem; }
  /* el panel de acción siempre ocupa su sitio: la arena no da saltos */
  .accion, .accion.visible, .accion.espera { position: static; display: grid; align-content: center; min-height: 190px; max-width: none; animation: none; padding: 10px 14px; border: var(--borde); border-radius: 24px; }
  .accion.espera { background: rgba(255, 255, 255, .6); border-style: dashed; }
  .cartel { min-height: 2.8em; display: grid; align-items: center; }
  .combate .enunciado { font-size: 1.9rem; }
  .combate .enunciado.largo { font-size: 1.5rem; }
  .combate .opcion { min-height: 118px; font-size: 2.1rem; }
  .combate .opciones.largas .opcion { min-height: 78px; font-size: 1.5rem; }
  .ataque { min-height: 104px; font-size: 1.05rem; }
  .icono-ataque { width: 56px; height: 56px; }
  /* historia: el dibujo llena la pantalla y debajo van, en una fila, el texto y el botón */
  .historia { grid-template-columns: 1fr auto; grid-template-rows: auto; max-width: min(1240px, calc((100dvh - 275px) * 1.4545)); min-height: 0; gap: 12px 18px; align-items: stretch; }
  .historia .escenario { grid-column: 1 / -1; grid-row: auto; }
  .historia-texto { font-size: 1.6rem; min-height: 4.2em; padding: 12px 20px; }
  .historia > .btn-grande { width: auto; min-width: 250px; font-size: 1.6rem; }
  .arena.grande { max-width: 760px; }
}

/* ================= Legendarias, ficha con características, ataques propios y energía del equipo ================= */
/* mi energía es una barra continua: baja con cada golpe del rival y solo se vacía con el último fallo */
.energia.continua { width: clamp(88px, 27vw, 170px); }
.energia.continua i { display: block; width: 100%; height: 14px; transition: width .5s ease, background .3s; }
.energia.continua.baja i.on { background: #ff8a3d; }
/* el ataque especial: apagado hasta los 2 aciertos seguidos; después se ilumina */
.ataque.especial { background: #e9e6f2; }
.ataque.especial:not(.listo) .icono-ataque { filter: grayscale(1); opacity: .55; }
.ataque.especial.listo { background: var(--sol); animation: late .9s ease-in-out infinite; }
.fogonazo.oro { background: radial-gradient(circle, #fff 0, rgba(255, 217, 61, .9) 45%, transparent 80%); animation-duration: 1.9s; }
/* rareza y elemento */
.sello { display: inline-flex; align-items: center; gap: 4px; min-height: 34px; padding: 2px 12px; border: var(--borde); border-radius: 99px; background: #fff; font-size: 1rem; font-weight: 900; color: var(--tinta); }
button.sello { min-height: 48px; box-shadow: 0 3px 0 var(--tinta); }
.sello[class*="tipo-"] { background: var(--t2); }
.sello.rz-rara { background: #d8f1ff; }
.sello.rz-legendaria { background: linear-gradient(#fff6b8, #ffd93d); }
.capturada .sello { margin-top: 4px; font-size: .9rem; -webkit-text-stroke: 0; }
/* ficha */
.ficha { max-height: calc(100dvh - 20px); overflow-y: auto; }
.ficha.rz-legendaria { border-color: #a87f00; box-shadow: 0 8px 0 #a87f00; background: linear-gradient(#fff3a6, #fff); }
.ficha-chips { display: flex; gap: 8px; justify-content: center; margin: 6px 0; }
.rasgos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.rasgo { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 0 6px; min-height: 48px; padding: 4px 8px; border: var(--borde); border-radius: 14px; background: #fff; text-align: left; font-size: .85rem; font-weight: 900; line-height: 1.1; color: var(--tinta); }
.rasgo .ic { grid-row: span 2; width: 30px; height: 30px; }
.rasgo-barra { display: flex; gap: 3px; }
.rasgo-barra i { flex: 1; height: 11px; border-radius: 99px; background: #e6e3ef; border: 1.5px solid var(--tinta); }
.rasgo-barra i.on { background: var(--t); }
.ficha .ataques { margin: 8px 0; }
.ficha .ataque { min-height: 66px; font-size: .8rem; box-shadow: 0 3px 0 var(--tinta); }
.ficha .ataque.especial.listo { animation: none; }
.ficha .icono-ataque { width: 34px; height: 34px; }
/* colección */
.celda { position: relative; font: inherit; }
.celda-rareza { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; }
.celda.mia.rz-legendaria { background: linear-gradient(#fff6b8, #ffe08a); box-shadow: 0 5px 0 #a87f00; }
.celda-pista { font-size: .78rem; font-weight: 800; line-height: 1.15; text-align: center; }
.rejilla.leg { grid-template-columns: repeat(2, 1fr); }
.rejilla.leg .criatura { max-width: 180px; }
.pestanas.tipos { gap: 6px; }
.pestana.tipo-leg { --t: #ffd93d; --t2: #fff6b8; }
/* gestos de las legendarias */
.criatura .cinta { transform-box: fill-box; transform-origin: 50% 0; animation: menea 2.8s ease-in-out infinite; }
.criatura .cinta:nth-child(even) { animation-direction: reverse; }
.legendaria .aura { transform-box: fill-box; transform-origin: center; animation: aura 18s linear infinite; }
.criatura .haz { animation: late-luz 1.4s ease-in-out infinite alternate; }
/* escena al conseguir una legendaria: rayos dorados que giran detrás */
.escena-leg .actor { z-index: 1; }
.p-leg { left: 27%; width: 46%; bottom: 3%; }
.rayos-leg { position: absolute; left: 50%; top: 52%; width: 130%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 225, 77, .6) 0 12deg, transparent 12deg 24deg); -webkit-mask: radial-gradient(closest-side, #000 30%, transparent); mask: radial-gradient(closest-side, #000 30%, transparent); animation: aura 16s linear infinite; }
.escena-leg .sello { position: absolute; z-index: 2; top: 8px; left: 50%; translate: -50% 0; font-size: 1.1rem; }
@media (min-width: 620px) { .rejilla.leg { grid-template-columns: repeat(3, 1fr); } }
@media (max-height: 700px) {
  .ficha-dibujo { width: 104px; }
  .ficha .ataque { min-height: 60px; }
  .ficha-frase { font-size: 1rem; }
}
/* la ficha puede ser más alta que un móvil pequeño: se desplaza, y la X de cerrar se queda siempre a la vista */
.ficha-cerrar { position: sticky; top: 0; float: right; z-index: 1; margin: -6px -6px 0 0; }

/* ================= El mapa: la isla de Saberia con su camino de 30 casillas ================= */
.mapa { margin-bottom: 18px; }
.mapa-progreso { display: flex; align-items: center; gap: 3px; margin-bottom: 8px; }
.mapa-barra { flex: 1; height: 18px; margin-right: 6px; border: var(--borde); border-radius: 99px; background: #fff; overflow: hidden; }
.mapa-barra i { display: block; height: 100%; min-width: 10px; border-radius: 99px; background: linear-gradient(#ffe14d, #ffb400); }
.mapa-progreso .medalla { width: clamp(24px, 7.5vw, 40px); height: clamp(24px, 7.5vw, 40px); }
.mapa-caja { position: relative; border: var(--borde); border-radius: 26px; overflow: hidden; box-shadow: 0 6px 0 var(--tinta); background: #8fd3ff; }
.mapa-isla { display: block; width: 100%; }
.mapa-isla .lugar.cerrada { filter: grayscale(1); opacity: .75; }
.mapa-isla .nube-n { animation: bruma 7s ease-in-out infinite alternate; }
.mapa-isla .nube-n.n1 { animation-duration: 9s; animation-direction: alternate-reverse; }
.mapa-isla .niebla.se-va { transform-box: fill-box; transform-origin: center; animation: despeja 2.2s ease-out .7s forwards; }
@keyframes despeja { to { opacity: 0; transform: scale(1.6); } }
.lugar-btn { position: absolute; width: 17%; min-width: 52px; aspect-ratio: 1; padding: 0; translate: -50% -50%; border: 0; border-radius: 50%; background: none; }
.lugar-btn.siguiente { outline: 4px solid var(--sol); outline-offset: 0; box-shadow: 0 0 0 7px rgba(43, 35, 80, .85); animation: late 1.2s ease-in-out infinite; }
.lugar-btn .juega { top: auto; bottom: 96%; left: 50%; translate: -50% 0; white-space: nowrap; font-size: .8rem; }
.lugar-candado { position: absolute; inset: 30%; }
.mapa-yo { position: absolute; z-index: 2; width: 7.5%; min-width: 24px; translate: -50% -93%; pointer-events: none; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 2px #fff); transition: left .32s ease-in-out, top .32s ease-in-out; }
.mapa-amigo { position: absolute; width: 5.6%; aspect-ratio: 1; translate: -50% -50%; border: 2px solid var(--tinta); border-radius: 50%; background: #fff; overflow: hidden; pointer-events: none; }
.mapa-amigo .criatura * { animation: none; }
/* la ficha de un lugar: sus 4 pruebas y su jefe */
.fase-ficha { width: min(94vw, 600px); padding: 0 0 10px; margin: auto; border: 0; background: none; box-shadow: none; text-align: left; }
.fase-ficha .fase { margin: 0; }
.fase-ficha .fase-cabeza { gap: 10px; }
.fase-ficha .fase-cabeza h2 { margin-right: auto; font-size: 1.6rem; }
.mapa-progreso .medalla { animation: none; }

/* ================= Misión de refuerzo (destacada sobre el mapa) y aciertos por prueba en la zona familia ================= */
.refuerzo-btn { margin-bottom: 14px; background: #d9f7e4; outline: 4px solid var(--sol); animation: late 1.6s ease-in-out infinite; }
.refuerzo-btn .copas .ic { width: 1.4em; height: 1.4em; vertical-align: middle; }
.habs { align-items: baseline; font-size: .98rem; }
.habs .dato { padding: 1px 8px; border: 2px solid var(--tinta); border-radius: 99px; background: #fff; }
.habs.domina .dato { background: #d9f7e4; }
.habs.reforzar .dato { background: #ffe9b8; }
@media (prefers-reduced-motion: reduce) { .refuerzo-btn { animation: none; } }
