/* =========================================================
   ITALIAN BATTLE — ESTILOS
   Mundo visual: isla mediterránea de noche-atardecer,
   botones gruesos de consola, tipografía de cartel.
   ========================================================= */
:root {
  /* Layout: pantalla completa tipo consola · HUD arriba · escenario al centro · acciones abajo */
  --ink: #0B1433;
  --night: #15226A;
  --deep: #1D338F;
  --panel: rgba(13, 22, 66, .86);
  --line: rgba(255, 255, 255, .14);
  --sky: #3A86FF;
  --sky-d: #1E5CD6;
  --sea: #16C3D3;
  --sun: #FFD23F;
  --sun-d: #D99A00;
  --lava: #FF5A36;
  --lava-d: #B8320F;
  --leaf: #2BD47D;
  --leaf-d: #128A4B;
  --grape: #9B5CFF;
  --grape-d: #5622C2;
  --pink: #FF4FA3;
  --pink-d: #C21C6E;
  --snow: #FFFFFF;
  --cream: #FFF6D6;
  --muted: #A9B8EE;
  --it-green: #1FA35B;
  --it-red: #E63946;
  --display: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--snow); font-family: var(--body); font-weight: 800; -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, input:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
input { -webkit-user-select: text; user-select: text; }
#app { position: fixed; inset: 0; overflow: hidden; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }
#overlay-root { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
#overlay-root > * { pointer-events: auto; }

/* ---------- Pantallas ---------- */
.screen {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  padding: calc(var(--safe-t) + 10px) max(14px, env(safe-area-inset-right)) calc(var(--safe-b) + 12px) max(14px, env(safe-area-inset-left));
  background:
    radial-gradient(90% 60% at 80% 0%, rgba(255, 79, 163, .25), transparent 60%),
    radial-gradient(100% 70% at 10% 10%, rgba(58, 134, 255, .45), transparent 60%),
    linear-gradient(180deg, #1D338F 0%, #15226A 45%, #0B1433 100%);
  animation: screenIn .32s ease both;
  overflow: hidden;
}
.screen.out { animation: screenOut .25s ease both; pointer-events: none; }
@keyframes screenIn { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
@keyframes screenOut { to { opacity: 0; transform: scale(.97); } }

/* ---------- Botones ---------- */
.btn {
  --c: var(--sky); --cd: var(--sky-d);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: var(--display); font-size: clamp(18px, 2.4vw, 24px); letter-spacing: .03em;
  padding: .55em 1.2em .6em; border-radius: 16px; color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff) 0%, var(--c) 45%, var(--cd) 100%);
  box-shadow: 0 6px 0 var(--cd), 0 10px 18px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .45);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--cd), 0 4px 8px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .45); }
.btn:hover { filter: brightness(1.07); }
.btn-play, .btn-green { --c: var(--leaf); --cd: var(--leaf-d); }
.btn-sun { --c: var(--sun); --cd: var(--sun-d); color: #3A2400; text-shadow: 0 1px 0 rgba(255, 255, 255, .5); }
.btn-red { --c: var(--it-red); --cd: #9E1B26; }
.btn-sky { --c: var(--sky); --cd: var(--sky-d); }
.btn-ghost { --c: #3A4C9E; --cd: #1E2A66; }
.btn.big { font-size: 26px; }
.row-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.row-btns.left { justify-content: flex-start; }
.link-btn { color: var(--muted); font-weight: 800; font-size: 16px; padding: 10px 16px; margin-top: 6px; text-decoration: underline; text-underline-offset: 4px; }
.x-btn { position: absolute; top: 12px; right: 12px; width: 42px; height: 42px; border-radius: 50%; background: rgba(255, 255, 255, .12); font-size: 20px; z-index: 2; }

/* ---------- Moneda ---------- */
.coin { display: inline-block; width: 1.05em; height: 1.05em; border-radius: 50%; vertical-align: -.15em; background: radial-gradient(circle at 35% 30%, #FFF3A6 0 18%, #FFD23F 40%, #D99A00 100%); box-shadow: inset 0 0 0 2px #C98F00, 0 2px 0 rgba(0, 0, 0, .25); position: relative; }
.coin::after { content: ""; position: absolute; inset: 28%; border-radius: 50%; border: 2px solid rgba(201, 143, 0, .7); }
.coin.big { width: 54px; height: 54px; }

/* ---------- HUD ---------- */
.hud { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; z-index: 5; flex-shrink: 0; }
.hud-btn { width: 46px; height: 46px; flex-shrink: 0; border-radius: 14px; display: grid; place-items: center; font-size: 22px; background: var(--panel); border: 2px solid var(--line); box-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.hud-btn:active { transform: translateY(3px); box-shadow: none; }
.hud-rank { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 5px 14px 5px 6px; min-width: 0; flex: 1 1 auto; max-width: 340px; }
.rank-badge { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; font-family: var(--display); font-size: 20px; color: #3A2400; background: radial-gradient(circle at 35% 30%, #FFF3A6, var(--sun) 50%, var(--sun-d)); clip-path: polygon(50% 0, 95% 20%, 95% 70%, 50% 100%, 5% 70%, 5% 20%); }
.rank-txt { min-width: 0; flex: 1; }
.rank-txt b { display: block; font-family: var(--display); font-weight: 400; font-size: 15px; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-txt small { font-size: 11px; color: var(--muted); }
.xpbar { height: 9px; border-radius: 9px; background: rgba(0, 0, 0, .4); overflow: hidden; margin: 3px 0 1px; }
.xpbar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--sea), var(--leaf)); transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.hud-chip { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 0 12px; height: 46px; font-family: var(--display); font-size: 20px; flex-shrink: 0; }
.hud-chip b { font-weight: 400; font-variant-numeric: tabular-nums; }
.hud-chip b.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.35); color: var(--sun); } }
.hud-streak .flame { filter: grayscale(1) opacity(.6); transition: filter .3s; }
.hud-streak.hot { border-color: #FF9F1C; box-shadow: 0 0 16px rgba(255, 159, 28, .55); }
.hud-streak.hot .flame { filter: none; animation: flame .6s ease-in-out infinite alternate; }
@keyframes flame { to { transform: scale(1.2) rotate(-6deg); } }
.home-top { display: flex; gap: 10px; justify-content: flex-end; position: relative; z-index: 3; }

/* =========================================================
   INICIO
   ========================================================= */
.home-screen { background: linear-gradient(180deg, #3A86FF 0%, #6AA8FF 38%, #FFB7A1 62%, #16C3D3 63%, #0E7FB8 100%); }
.home { display: flex; flex-direction: column; height: 100%; position: relative; }
.home-sky { position: absolute; inset: 0; pointer-events: none; }
.cloud { position: absolute; width: 140px; height: 44px; background: #fff; border-radius: 44px; opacity: .85; animation: drift 38s linear infinite; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 60px; height: 60px; left: 22px; top: -28px; }
.cloud::after { width: 46px; height: 46px; left: 70px; top: -18px; }
.c1 { top: 12%; left: -10%; } .c2 { top: 26%; left: 40%; transform: scale(.7); animation-duration: 52s; animation-delay: -20s; } .c3 { top: 6%; left: 70%; transform: scale(.55); animation-duration: 46s; animation-delay: -8s; }
@keyframes drift { from { translate: -20vw 0; } to { translate: 120vw 0; } }
.logo { text-align: center; position: relative; z-index: 2; margin-top: -6px; }
.logo h1 { margin: 0; line-height: .82; font-family: var(--display); font-weight: 400; display: flex; flex-direction: column; align-items: center; }
.logo .l1 { font-size: clamp(30px, 6vw, 58px); letter-spacing: .14em; color: #fff; -webkit-text-stroke: 2px #0B1433; paint-order: stroke fill; text-shadow: 0 5px 0 #0B1433; }
.logo .l2 { font-size: clamp(62px, 13vw, 130px); color: var(--sun); -webkit-text-stroke: 3px #0B1433; paint-order: stroke fill; text-shadow: 0 7px 0 #0B1433, 0 12px 30px rgba(0, 0, 0, .35); transform: rotate(-3deg); }
.logo-sub { margin: 10px auto 0; display: inline-block; font-family: var(--display); font-size: clamp(17px, 2.6vw, 26px); background: var(--it-red); color: #fff; padding: 4px 20px 6px; border-radius: 10px; box-shadow: 0 4px 0 #9E1B26; transform: rotate(-2deg); letter-spacing: .04em; }
.logo-flag { display: flex; justify-content: center; gap: 0; margin-bottom: 4px; }
.logo-flag i { width: 26px; height: 7px; display: block; } .logo-flag i:nth-child(1) { background: var(--it-green); border-radius: 4px 0 0 4px; } .logo-flag i:nth-child(2) { background: #fff; } .logo-flag i:nth-child(3) { background: var(--it-red); border-radius: 0 4px 4px 0; }
.home-stage { flex: 1; min-height: 140px; position: relative; display: flex; align-items: flex-end; justify-content: center; z-index: 1; }
.island-plat { position: absolute; bottom: 4%; left: 50%; transform: translateX(-50%); width: min(520px, 86%); height: 34%; min-height: 60px; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #6BE38A 0 40%, #1E9B54 62%, #FFE29A 63%, #F2C062 100%); box-shadow: 0 16px 0 rgba(0, 0, 0, .12); }
.palm { position: absolute; bottom: 55%; width: 12px; height: 90px; background: #8B5A2B; border-radius: 6px; }
.palm::before { content: "🌴"; position: absolute; font-size: 74px; left: -34px; top: -62px; }
.palm.p1 { left: 12%; transform: rotate(-10deg); } .palm.p2 { right: 12%; transform: rotate(8deg) scale(.8); }
.home-hero { position: relative; height: 100%; max-height: 300px; aspect-ratio: 514/760; margin-bottom: 6%; }
.home-hero .hero { width: 100%; height: 100%; }
.nameplate { position: absolute; bottom: 2%; left: 50%; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--line); padding: 4px 16px 6px; border-radius: 12px; text-align: center; white-space: nowrap; }
.nameplate b { font-family: var(--display); font-weight: 400; font-size: 18px; display: block; }
.nameplate small { color: var(--sun); font-size: 12px; }
.home-actions { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.btn-play { font-size: clamp(28px, 4.4vw, 40px); padding: .35em 1.8em .42em; border-radius: 22px; animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.home-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(760px, 100%); }
.tile { --c: var(--sky); --cd: var(--sky-d); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px 12px; border-radius: 18px; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, #fff), var(--c) 50%, var(--cd)); box-shadow: 0 5px 0 var(--cd), 0 8px 14px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .4); transition: transform .08s; }
.tile:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cd); }
.tile span { font-size: clamp(26px, 4vw, 36px); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25)); }
.tile b { font-family: var(--display); font-weight: 400; font-size: clamp(11px, 1.6vw, 15px); letter-spacing: .03em; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); text-align: center; line-height: 1.05; }
.t-gold { --c: #FFB627; --cd: #B9760A; } .t-pink { --c: var(--pink); --cd: var(--pink-d); } .t-sky { --c: var(--sky); --cd: var(--sky-d); } .t-grape { --c: var(--grape); --cd: var(--grape-d); }

/* ---------- Héroe: animaciones ---------- */
.hero { overflow: visible; display: block; }
.hero.idle .hero-body, .hero-spot .hero-body { animation: bob 2.2s ease-in-out infinite; transform-origin: 100px 240px; }
@keyframes bob { 50% { transform: translateY(-5px); } }
.hero .hand-glow { animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow { to { opacity: .2; } }
.hero .jetflame { animation: jet .12s linear infinite alternate; transform-origin: center top; }
@keyframes jet { to { transform: scaleY(.7); } }
.hero .pet { animation: pet 1.6s ease-in-out infinite; transform-origin: 182px 238px; }
@keyframes pet { 50% { transform: translateY(-8px) rotate(-6deg); } }
.hero .eyes { animation: blink 4s infinite; transform-origin: 100px 78px; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.shoot .arm-r { animation: recoil .25s ease; transform-origin: 150px 126px; }
@keyframes recoil { 50% { transform: rotate(10deg); } }

/* =========================================================
   MAPA
   ========================================================= */
.map-screen { background: linear-gradient(180deg, #0E5FA8, #0B3D86 60%, #0B1433); }
.map-wrap { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 0; }
.map-box { position: relative; width: min(100%, calc((100dvh - 190px) * 1.4286)); aspect-ratio: 1000 / 700; border-radius: 28px; overflow: hidden; box-shadow: 0 0 0 4px rgba(255, 255, 255, .15), 0 20px 50px rgba(0, 0, 0, .45); }
.map-svg { width: 100%; height: 100%; display: block; }
.map-svg .waves { animation: waves 3s ease-in-out infinite alternate; }
@keyframes waves { to { transform: translateX(10px); } }
.map-svg .boat { animation: boat 4s ease-in-out infinite; }
@keyframes boat { 50% { transform: translate(84px, 586px) rotate(-3deg); } }
.wnode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 2; }
.wnode-badge { width: clamp(52px, 8vw, 78px); height: clamp(52px, 8vw, 78px); border-radius: 50%; display: grid; place-items: center; font-size: clamp(28px, 4.4vw, 42px); background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--wc, #888) 70%, #fff), var(--wc, #888) 55%, var(--wd, #444)); border: 4px solid #fff; box-shadow: 0 6px 0 var(--wd, #333), 0 10px 20px rgba(0, 0, 0, .4); }
button.wnode .wnode-badge { animation: nodePulse 2s ease-in-out infinite; }
@keyframes nodePulse { 50% { transform: scale(1.08); box-shadow: 0 6px 0 var(--wd), 0 0 0 10px rgba(255, 255, 255, .25); } }
.wnode.done .wnode-badge { animation: none; }
.wnode-label { background: var(--panel); border: 2px solid rgba(255, 255, 255, .25); border-radius: 10px; padding: 2px 10px 4px; text-align: center; font-family: var(--display); font-size: clamp(11px, 1.5vw, 15px); line-height: 1.05; white-space: nowrap; }
.wnode-label small { display: block; font-family: var(--body); font-size: 10px; color: var(--sun); letter-spacing: .08em; }
.wnode-stars { font-size: 12px; color: var(--sun); background: rgba(0, 0, 0, .45); padding: 1px 8px; border-radius: 8px; }
.wnode:active .wnode-badge { transform: scale(.92); }
.wnode.locked { filter: saturate(.3); }
.wnode.locked .wnode-badge { background: #4A5590; box-shadow: 0 6px 0 #2A3263; animation: none; }
.fog { position: absolute; width: 190%; aspect-ratio: 1.6; left: 50%; top: 40%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(225, 235, 255, .9), rgba(225, 235, 255, 0)); z-index: -1; }
.fog-big { position: absolute; width: 22%; aspect-ratio: 1.5; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgba(235, 242, 255, .98) 40%, rgba(235, 242, 255, 0)); filter: blur(2px); z-index: 1; animation: fogMove 6s ease-in-out infinite alternate; }
@keyframes fogMove { to { transform: translate(-46%, -52%) scale(1.05); } }
.map-foot { display: flex; justify-content: center; gap: 12px; flex-shrink: 0; }

/* ---------- Hoja de mundo ---------- */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5, 10, 35, .62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn .2s ease both; }
.overlay.closing { animation: fadeOut .2s ease both; }
@keyframes fadeIn { from { opacity: 0; } } @keyframes fadeOut { to { opacity: 0; } }
.overlay-card { position: relative; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: linear-gradient(180deg, #24399E, #15226A); border: 3px solid rgba(255, 255, 255, .22); border-radius: 26px; padding: 22px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); animation: popIn .32s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes popIn { from { transform: scale(.7) translateY(30px); opacity: 0; } }
.overlay-card h2 { font-family: var(--display); font-weight: 400; margin: 6px 0 12px; font-size: 28px; letter-spacing: .02em; }
.overlay.small .overlay-card { width: min(420px, 100%); }
.overlay.sheet .overlay-card { width: min(860px, 100%); text-align: left; }
.ws-head { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.ws-ico { width: 70px; height: 70px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 38px; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--wc) 70%, #fff), var(--wc) 55%, var(--wd)); border: 4px solid #fff; }
.ws-head small { color: var(--sun); letter-spacing: .1em; font-size: 12px; }
.ws-head h2 { margin: 0; font-size: clamp(22px, 3.4vw, 32px); }
.ws-head p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.spath { display: flex; align-items: center; gap: 0; margin: 20px 0 14px; overflow-x: auto; padding: 6px 4px 12px; }
.snode-link { flex: 1 0 14px; height: 6px; min-width: 14px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .5) 0 8px, transparent 8px 14px); border-radius: 3px; }
.snode { flex: 0 0 auto; width: clamp(92px, 14vw, 128px); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 18px; background: linear-gradient(180deg, #3A86FF, #1E5CD6); box-shadow: 0 5px 0 #143F9E; transition: transform .08s; }
.snode:active { transform: translateY(4px); box-shadow: none; }
.snode.fresh { animation: freshPulse 1.4s ease-in-out infinite; }
@keyframes freshPulse { 50% { box-shadow: 0 5px 0 #143F9E, 0 0 0 8px rgba(255, 210, 63, .45); } }
.snode.boss { background: linear-gradient(180deg, #B98CFF, #6A2FD8); box-shadow: 0 5px 0 #3E178A; }
.snode.locked { background: #39427A; box-shadow: 0 5px 0 #222852; cursor: not-allowed; opacity: .75; }
.snode-ico { font-size: 36px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25)); }
.snode-name { font-family: var(--display); font-size: 13px; text-align: center; line-height: 1.05; min-height: 2.1em; display: grid; place-items: center; }
.snode-stars { font-size: 15px; color: rgba(255, 255, 255, .3); min-height: 18px; font-family: var(--display); }
.snode-stars i { font-style: normal; } .snode-stars i.on { color: var(--sun); text-shadow: 0 0 8px rgba(255, 210, 63, .8); }
.snode.boss .snode-stars { color: var(--sun); font-size: 12px; }
.ws-verbs { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { --sc: #888; font-size: 13px; padding: 3px 10px 4px; border-radius: 20px; background: rgba(0, 0, 0, .3); border: 2px solid var(--sc); }

/* =========================================================
   MINIJUEGOS — comunes
   ========================================================= */
.game-hud .game-title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: clamp(16px, 2.4vw, 22px); white-space: nowrap; min-width: 0; }
.game-hud .game-title b { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
.gt-icon { font-size: 1.3em; }
.dots { flex: 1; display: flex; gap: 6px; justify-content: center; min-width: 0; flex-wrap: wrap; }
.dot { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .2); border: 2px solid rgba(255, 255, 255, .3); transition: all .3s; }
.dot.now { background: #fff; transform: scale(1.25); box-shadow: 0 0 10px #fff; }
.dot.ok { background: var(--leaf); border-color: #A6F5C8; }
.dot.half { background: var(--sun); border-color: #FFF0A8; }
.dot.ko { background: #7C86C2; border-color: #A9B8EE; }

.qbar { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 12px auto 10px; flex-wrap: wrap; position: relative; z-index: 3; flex-shrink: 0; }
.q-inf { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: clamp(30px, 5.6vw, 58px); letter-spacing: .03em; color: #fff; background: var(--panel); border: 3px solid rgba(255, 255, 255, .25); border-radius: 20px; padding: 4px 22px 8px 14px; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); box-shadow: 0 6px 0 rgba(0, 0, 0, .3); animation: qIn .35s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes qIn { from { transform: scale(.6); opacity: 0; } }
.spk { font-size: .5em; background: var(--sky); border-radius: 50%; width: 1.6em; height: 1.6em; display: grid; place-items: center; text-shadow: none; box-shadow: 0 3px 0 var(--sky-d); }
.q-arrow { font-family: var(--display); font-size: clamp(28px, 4.4vw, 46px); color: var(--sun); text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.q-ans { font-family: var(--display); font-size: clamp(30px, 5.6vw, 58px); min-width: 2.2em; text-align: center; color: var(--sun); background: rgba(0, 0, 0, .35); border: 3px dashed rgba(255, 210, 63, .6); border-radius: 20px; padding: 4px 18px 8px; animation: wiggle 1.6s ease-in-out infinite; }
.q-ans.revealed { animation: reveal .5s cubic-bezier(.2, 1.5, .4, 1); border-style: solid; border-color: var(--leaf); background: rgba(43, 212, 125, .2); color: #fff; }
.q-ans.revealed.learn { border-color: var(--sun); background: rgba(255, 210, 63, .18); color: var(--sun); }
@keyframes wiggle { 50% { transform: rotate(-3deg) scale(1.04); } }
@keyframes reveal { from { transform: scale(1.6); } }

.stage { position: relative; flex: 1; min-height: 0; border-radius: 26px; overflow: hidden; border: 3px solid rgba(255, 255, 255, .16); box-shadow: inset 0 -30px 60px rgba(0, 0, 0, .25), 0 12px 30px rgba(0, 0, 0, .35); }
.stage-deco { position: absolute; inset: 0; pointer-events: none; }
/* Temas por mundo: ilustración de fondo + viñeta para que se lea todo */
.stage { background-color: #1D338F; background-size: cover; background-position: center; }
.theme-isola    { background-image: linear-gradient(180deg, rgba(11,20,51,.05) 40%, rgba(11,20,51,.45)), url(../img/mondo1.webp); }
.theme-vulcano  { background-image: linear-gradient(180deg, rgba(40,5,0,.1) 40%, rgba(40,5,0,.55)), url(../img/mondo2.webp); }
.theme-foresta  { background-image: linear-gradient(180deg, rgba(0,20,10,.08) 40%, rgba(0,20,10,.5)), url(../img/mondo3.webp); }
.theme-citta    { background-image: linear-gradient(180deg, rgba(40,20,0,.05) 40%, rgba(40,20,0,.45)), url(../img/mondo4.webp); }
.theme-castello { background-image: linear-gradient(180deg, rgba(20,10,60,.1) 40%, rgba(20,10,60,.55)), url(../img/mondo5.webp); }
.stage-deco { background: radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0,0,0,.35)); }
.theme-foresta .stage-deco::after, .theme-castello .stage-deco::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,255,255,.9) 0 1.5px, transparent 2px); background-size: 90px 110px; animation: sparkleDrift 9s linear infinite; opacity: .5; }
.theme-vulcano .stage-deco::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(255,182,39,.95) 0 2px, transparent 3px); background-size: 70px 90px; animation: emberRise 6s linear infinite; opacity: .6; }
@keyframes sparkleDrift { to { background-position: 90px 110px; } }
@keyframes emberRise { to { background-position: 30px -180px; } }

.hero-spot { position: absolute; left: 2%; bottom: 3%; width: clamp(110px, 20vw, 210px); aspect-ratio: 514/760; z-index: 2; }
.hero-spot .hero { width: 100%; height: 100%; }
.hero-spot.small { width: clamp(80px, 13vw, 140px); }

/* ---------- Il Bersaglio ---------- */
.targets { position: absolute; inset: 6% 3% 6% 24%; display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 4% 6%; place-items: center; z-index: 3; }
.target { display: flex; flex-direction: column; align-items: center; gap: 4px; animation: float 2.4s ease-in-out infinite; animation-delay: var(--d); transition: opacity .3s, transform .3s; }
.targets.in .target { animation: targetIn .45s cubic-bezier(.2, 1.4, .4, 1) both, float 2.4s ease-in-out .45s infinite; animation-delay: var(--d), calc(var(--d) + .45s); }
@keyframes targetIn { from { transform: scale(0) rotate(-90deg); } }
@keyframes float { 50% { transform: translateY(-10px); } }
.target-ring { width: clamp(70px, 12vw, 120px); aspect-ratio: 1; display: block; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .25)); }
.target-ring svg { width: 100%; height: 100%; }
.target-word { font-family: var(--display); font-size: clamp(18px, 2.8vw, 28px); background: #fff; color: #15226A; padding: 2px 14px 4px; border-radius: 12px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); letter-spacing: .02em; }
.target:hover .target-ring { transform: scale(1.06); }
.target.miss { opacity: .35; filter: grayscale(1); animation: none; }
.target.boom { animation: boom .5s ease forwards; }
.target.boom .target-word { background: var(--leaf); color: #fff; }
@keyframes boom { 30% { transform: scale(1.3); } 100% { transform: scale(1.1); } }
.target.fade { opacity: 0; transform: scale(.6); pointer-events: none; }

/* ---------- I Forzieri ---------- */
.chests { position: absolute; inset: 8% 3% 4% 3%; display: flex; justify-content: center; align-items: center; gap: clamp(10px, 3vw, 40px); z-index: 3; }
.chest { display: flex; flex-direction: column; align-items: center; gap: 8px; width: clamp(96px, 22vw, 200px); position: relative; transition: opacity .3s, transform .3s; }
.chests.in .chest { animation: chestIn .5s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--d); }
@keyframes chestIn { from { transform: translateY(-120%) scale(.6); opacity: 0; } }
.chest-label { font-family: var(--display); font-size: clamp(17px, 2.8vw, 28px); background: #6B3E1A; color: #FFE7B8; border: 3px solid #3A2010; padding: 2px 12px 5px; border-radius: 10px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35); white-space: nowrap; }
.chest-svg { width: 100%; filter: drop-shadow(0 8px 0 rgba(0, 0, 0, .25)); overflow: visible; }
.chest:not(.opened):hover .chest-svg { animation: rattle .4s ease; }
@keyframes rattle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.chest .lid { transform-origin: 14px 66px; transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.chest.opened .lid { transform: rotate(-38deg) translate(-6px, -8px); }
.chest.opened:not(.empty) .chest-glow circle { opacity: .8; animation: glowPulse 1s ease-in-out infinite alternate; }
@keyframes glowPulse { to { opacity: .35; } }
.chest-loot { position: absolute; top: 34%; left: 50%; transform: translate(-50%, 0) scale(0); font-size: 52px; transition: transform .5s cubic-bezier(.2, 1.6, .4, 1) .1s; pointer-events: none; }
.chest.opened .chest-loot { transform: translate(-50%, -70%) scale(1); }
.chest.empty { opacity: .55; filter: grayscale(.7); }
.puff { font-family: var(--display); font-size: 22px; color: #fff; background: rgba(0, 0, 0, .5); padding: 2px 10px; border-radius: 10px; }
.chest.fade { opacity: 0; transform: scale(.7); pointer-events: none; }
.hero-spot.small { left: 1%; bottom: 2%; }

/* ---------- La Tempesta ---------- */
.storm-q { gap: 10px; }
.timer { position: relative; width: 100%; max-width: 520px; height: 18px; border-radius: 10px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 2px solid rgba(255, 255, 255, .2); order: 5; }
.timer i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--leaf), var(--sun)); border-radius: 10px; transition: width .1s linear; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-size: 14px; font-weight: 400; text-shadow: 0 1px 0 #000; }
.timer.low i { background: linear-gradient(90deg, var(--lava), #FF9F1C); animation: lowBlink .5s infinite alternate; }
@keyframes lowBlink { to { opacity: .6; } }
.storm-stage { min-height: 150px; }
.storm { --p: 20; position: absolute; top: 0; bottom: 0; right: 0; width: calc(var(--p) * 1%); z-index: 3; transition: width .6s cubic-bezier(.3, 1.3, .5, 1); pointer-events: none; }
.storm-core { position: absolute; inset: 0; background: radial-gradient(ellipse 60% 70% at 0% 50%, rgba(214, 120, 255, .95), rgba(139, 77, 255, .85) 40%, rgba(70, 20, 160, .95) 75%); filter: blur(1px); border-radius: 50% 0 0 50% / 30% 0 0 30%; animation: stormPulse 1.2s ease-in-out infinite alternate; box-shadow: -20px 0 50px rgba(178, 94, 255, .7); }
@keyframes stormPulse { to { transform: scaleX(1.06); filter: blur(3px) brightness(1.2); } }
.bolt { position: absolute; width: 6px; height: 40%; background: #fff; box-shadow: 0 0 12px #fff, 0 0 30px #D9A6FF; clip-path: polygon(40% 0, 100% 0, 60% 40%, 100% 40%, 0 100%, 30% 55%, 0 55%); opacity: 0; }
.bolt.b1 { left: 20%; top: 10%; width: 30px; animation: bolt 2.3s infinite; }
.bolt.b2 { left: 55%; top: 45%; width: 24px; animation: bolt 3.1s .8s infinite; }
@keyframes bolt { 0%, 90%, 100% { opacity: 0; } 92%, 96% { opacity: 1; } }
.storm-stage .hero-spot { left: 4%; width: clamp(100px, 17vw, 180px); }
.storm-stage .hero-spot.safe::after { content: ""; position: absolute; inset: -12%; border-radius: 50%; border: 6px solid rgba(155, 246, 255, .9); box-shadow: 0 0 30px #9BF6FF, inset 0 0 30px #9BF6FF; animation: bubbleShield .7s ease forwards; }
@keyframes bubbleShield { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.1); opacity: 0; } }
.rumble { animation: rumble .4s linear; }
@keyframes rumble { 20% { transform: translate(-6px, 2px); } 40% { transform: translate(6px, -2px); } 60% { transform: translate(-4px, 1px); } 80% { transform: translate(4px, -1px); } }
.bubble { position: absolute; left: 70%; top: -6%; white-space: nowrap; font-family: var(--display); font-size: clamp(16px, 2.6vw, 24px); background: #fff; color: #15226A; padding: 4px 14px 6px; border-radius: 14px; opacity: 0; transform: scale(.4); transition: all .25s cubic-bezier(.2, 1.5, .4, 1); pointer-events: none; }
.bubble.show { opacity: 1; transform: scale(1); }
.bubble.good { background: var(--leaf); color: #fff; } .bubble.warn { background: var(--sun); color: #3A2400; }
.shields { position: absolute; top: 10px; left: 12px; display: flex; gap: 4px; z-index: 4; font-size: clamp(24px, 3.4vw, 34px); }
.shield { transition: all .3s; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); }
.shield.off { filter: grayscale(1) opacity(.35); transform: scale(.8); }
.answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 12px; flex-shrink: 0; }
.ans-btn { font-family: var(--display); font-size: clamp(20px, 3vw, 30px); padding: 14px 8px 16px; border-radius: 18px; color: #15226A; background: linear-gradient(180deg, #fff, #DCE6FF); box-shadow: 0 6px 0 #8FA3E0, 0 10px 18px rgba(0, 0, 0, .3); transition: transform .08s; animation: qIn .35s cubic-bezier(.2, 1.4, .4, 1) both; letter-spacing: .02em; }
.ans-btn:nth-child(2) { animation-delay: .05s; } .ans-btn:nth-child(3) { animation-delay: .1s; } .ans-btn:nth-child(4) { animation-delay: .15s; }
.ans-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 #8FA3E0; }
.ans-btn.right { background: linear-gradient(180deg, #7DF2B0, var(--leaf)); color: #fff; box-shadow: 0 6px 0 var(--leaf-d), 0 0 24px rgba(43, 212, 125, .7); text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.ans-btn.wrong { background: #6E78AE; color: #C9D0F0; box-shadow: 0 6px 0 #464E80; animation: shakeX .4s; }

/* ---------- Memoria ---------- */
.mem-legend { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; flex-shrink: 0; }
.lg { font-family: var(--display); font-size: 14px; padding: 3px 12px 5px; border-radius: 10px; }
.lg.inf { background: var(--sky); } .lg.part { background: #FF9F1C; color: #3A2000; }
.lg-and { font-family: var(--display); font-size: 20px; color: var(--sun); }
.mem-moves { margin-left: 12px; color: var(--muted); font-size: 15px; } .mem-moves b { color: #fff; font-family: var(--display); font-weight: 400; font-size: 18px; }
.mem-stage { display: grid; place-items: center; padding: 12px; }
.mem-grid { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 1.6vw, 16px); width: min(100%, 760px); max-height: 100%; }
.card { perspective: 800px; aspect-ratio: 4 / 3.2; animation: cardIn .45s cubic-bezier(.2, 1.4, .4, 1) both; animation-delay: var(--d); }
@keyframes cardIn { from { transform: scale(0) rotate(12deg); } }
.card-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1); }
.card.up .card-in, .card.done .card-in { transform: rotateY(180deg); }
.card-back, .card-front { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); }
.card-back { background: linear-gradient(135deg, #4C2AB8, #2A1475); border: 3px solid rgba(255, 255, 255, .3); }
.card-back b { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 4vw, 40px); color: var(--sun); text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
.cb-flag { display: flex; } .cb-flag i { width: 14px; height: 5px; } .cb-flag i:nth-child(1) { background: var(--it-green); } .cb-flag i:nth-child(2) { background: #fff; } .cb-flag i:nth-child(3) { background: var(--it-red); }
.card-front { transform: rotateY(180deg); border: 3px solid #fff; padding: 4px; }
.card-front.inf { background: linear-gradient(180deg, #6AA8FF, var(--sky-d)); }
.card-front.part { background: linear-gradient(180deg, #FFC56B, #F08A00); color: #3A2000; }
.card-ico { font-size: clamp(22px, 3.6vw, 36px); }
.card-txt { font-family: var(--display); font-size: clamp(11px, 1.9vw, 19px); letter-spacing: .02em; text-align: center; word-break: break-word; line-height: 1; }
.card.done .card-front { box-shadow: 0 0 0 4px var(--leaf), 0 0 24px rgba(43, 212, 125, .8); }
.card.done { animation: none; }
.card.done .card-in { animation: matched .5s ease; }
@keyframes matched { 50% { transform: rotateY(180deg) scale(1.12); } }
.card.nope .card-front { box-shadow: 0 0 0 4px var(--it-red); }

/* ---------- Boss ---------- */
.boss-stage { min-height: 220px; }
.boss-hud { position: absolute; top: 10px; right: 12px; left: 40%; z-index: 4; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.boss-name { font-family: var(--display); font-size: clamp(14px, 2vw, 20px); text-shadow: 0 2px 0 #000; }
.hpbar { position: relative; width: 100%; max-width: 380px; height: 24px; border-radius: 12px; background: rgba(0, 0, 0, .55); border: 3px solid #fff; overflow: hidden; }
.hpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(180deg, #FF7A7A, var(--it-red)); transition: width .5s cubic-bezier(.3, 1.3, .5, 1); }
.hpbar b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--display); font-weight: 400; font-size: 14px; text-shadow: 0 1px 0 #000; }
.boss-spot { position: absolute; right: 4%; bottom: 3%; width: clamp(140px, 24vw, 260px); aspect-ratio: 260/290; z-index: 2; }
.boss { width: 100%; height: 100%; overflow: visible; }
.boss .boss-body { animation: bossFloat 2s ease-in-out infinite; transform-origin: 130px 280px; }
@keyframes bossFloat { 50% { transform: translateY(-8px) scale(1.02); } }
.boss .orb { animation: glow 0.8s ease-in-out infinite alternate; }
.boss-spot.boss-hit { animation: bossHit .5s ease; }
@keyframes bossHit { 20% { transform: translateX(14px) rotate(4deg); filter: brightness(2.5); } 50% { transform: translateX(-8px); } }
.boss-spot.attack { animation: bossAttack .45s ease; }
@keyframes bossAttack { 50% { transform: translateX(-30px) scale(1.08); } }
.boss-spot.defeated { animation: defeated 1.6s ease forwards; }
@keyframes defeated { 30% { transform: rotate(-10deg) scale(1.1); filter: brightness(2); } 100% { transform: translateY(40%) rotate(20deg) scale(.4); opacity: 0; } }
.hero-spot.hurt { animation: hurt .5s ease; }
@keyframes hurt { 25% { transform: translateX(-12px); filter: brightness(2) hue-rotate(260deg); } 75% { transform: translateX(6px); } }
.hero-shields { top: auto; bottom: 10px; left: 50%; transform: translateX(-50%); }
.boss-q { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 10px; z-index: 5; flex-wrap: wrap; justify-content: center; width: 90%; }
.boss-q .q-inf, .boss-q .q-ans { font-size: clamp(24px, 4.2vw, 46px); }
.orbs .orb { color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.orb.o0 { background: linear-gradient(180deg, #8EC5FF, var(--sky)); box-shadow: 0 6px 0 var(--sky-d), 0 0 18px rgba(58, 134, 255, .6); }
.orb.o1 { background: linear-gradient(180deg, #FF9DCB, var(--pink)); box-shadow: 0 6px 0 var(--pink-d), 0 0 18px rgba(255, 79, 163, .6); }
.orb.o2 { background: linear-gradient(180deg, #FFE38A, #FFB627); box-shadow: 0 6px 0 #B9760A, 0 0 18px rgba(255, 182, 39, .6); }
.orb.o3 { background: linear-gradient(180deg, #CBA8FF, var(--grape)); box-shadow: 0 6px 0 var(--grape-d), 0 0 18px rgba(155, 92, 255, .6); }
.boss-retry { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(10, 5, 30, .75); text-align: center; padding: 20px; animation: fadeIn .3s; }
.boss-retry b { font-family: var(--display); font-weight: 400; font-size: 36px; color: var(--sun); }
.boss-retry span { font-size: 18px; color: var(--muted); }

/* =========================================================
   VOZ — ORA PRONUNCIA!
   ========================================================= */
.overlay.voice .overlay-card { width: min(520px, 100%); background: radial-gradient(120% 80% at 50% 0%, #3A86FF, #1D338F 55%, #15226A); }
.voice-top { display: flex; align-items: center; justify-content: center; gap: 10px; }
.voice-top h2 { margin: 0; font-size: clamp(28px, 4.6vw, 40px); color: var(--sun); text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.mic-ico { font-size: 40px; animation: flame .7s ease-in-out infinite alternate; }
.voice-pair { color: var(--muted); font-family: var(--display); font-size: 20px; margin-top: 6px; display: flex; justify-content: center; gap: 8px; }
.voice-pair i { font-style: normal; color: var(--sun); }
.voice-word { font-family: var(--display); font-size: clamp(46px, 9vw, 76px); letter-spacing: .03em; margin: 4px 0; text-shadow: 0 6px 0 rgba(0, 0, 0, .3); }
.voice-word.speak { animation: speakPulse .9s ease; }
@keyframes speakPulse { 30% { transform: scale(1.12); color: var(--sun); } }
.voice-stars { display: flex; justify-content: center; gap: 6px; font-size: 38px; }
.voice-stars i { font-style: normal; color: rgba(255, 255, 255, .2); transition: all .3s cubic-bezier(.2, 1.6, .4, 1); }
.voice-stars i.on { color: var(--sun); text-shadow: 0 0 16px rgba(255, 210, 63, .9); transform: scale(1.2); }
.voice-msg { min-height: 54px; font-size: 19px; margin: 8px 0 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.voice-msg small { font-size: 13px; color: var(--muted); font-weight: 700; }
.voice-msg.good { color: #7DF2B0; font-family: var(--display); font-size: 30px; }
.voice-msg.mid { color: var(--sun); font-family: var(--display); font-size: 24px; }
.voice-msg.warn { color: #FFC9A8; font-family: var(--display); font-size: 22px; }
.voice-btns { display: flex; justify-content: center; align-items: center; gap: 22px; }
.round-btn { flex-direction: column; width: 96px; height: 96px; border-radius: 50%; padding: 0; font-size: 34px; gap: 0; }
.round-btn small, .btn-mic small { font-family: var(--body); font-size: 12px; font-weight: 900; }
.btn-mic { --c: var(--it-red); --cd: #9E1B26; flex-direction: column; width: 132px; height: 132px; border-radius: 50%; padding: 0; font-size: 50px; gap: 0; }
.mic-ring { position: absolute; inset: -10px; border-radius: 50%; border: 5px solid rgba(255, 255, 255, .5); animation: ring 1.6s ease-out infinite; pointer-events: none; }
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.btn-mic.on { --c: var(--leaf); --cd: var(--leaf-d); }
.btn-mic.on .mic-ring { border-color: #7DF2B0; animation-duration: .7s; }

/* =========================================================
   TEXTOS FLOTANTES, BANNERS, PISTAS
   ========================================================= */
.float-txt { position: fixed; z-index: 70; transform: translate(-50%, -50%); font-family: var(--display); font-size: clamp(24px, 3.6vw, 36px); pointer-events: none; animation: floatUp 1.3s ease-out forwards; white-space: nowrap; -webkit-text-stroke: 2px #0B1433; paint-order: stroke fill; }
.float-txt.xp { color: #7DF2B0; } .float-txt.coins { color: var(--sun); } .float-txt.dmg { color: #FF7A7A; font-size: clamp(32px, 5vw, 50px); }
@keyframes floatUp { 0% { transform: translate(-50%, -20%) scale(.5); opacity: 0; } 15% { transform: translate(-50%, -60%) scale(1.15); opacity: 1; } 100% { transform: translate(-50%, -260%) scale(1); opacity: 0; } }
.banner { position: fixed; left: 50%; top: 42%; z-index: 65; transform: translate(-50%, -50%); pointer-events: none; text-align: center; width: max-content; max-width: 94vw; }
.banner span { display: inline-block; font-family: var(--display); font-size: clamp(36px, 7vw, 72px); color: #fff; -webkit-text-stroke: 3px #0B1433; paint-order: stroke fill; text-shadow: 0 6px 0 #0B1433; animation: bannerIn 1.5s cubic-bezier(.2, 1.4, .4, 1) forwards; letter-spacing: .02em; }
.banner.pop span { color: #7DF2B0; font-size: clamp(30px, 5vw, 52px); }
.banner.fire span { color: #FFB627; }
.banner.legend span { color: var(--sun); font-size: clamp(32px, 6vw, 64px); background: linear-gradient(90deg, var(--it-green), #fff, var(--it-red)); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 2px #0B1433; text-shadow: none; filter: drop-shadow(0 5px 0 #0B1433); }
.banner.soft span { color: #FFD6C2; font-size: clamp(26px, 4.4vw, 44px); }
.banner.gold span { color: var(--sun); }
.banner.boss span { color: #D9A6FF; }
@keyframes bannerIn { 0% { transform: scale(.3) rotate(-8deg); opacity: 0; } 18% { transform: scale(1.15) rotate(2deg); opacity: 1; } 28% { transform: scale(1) rotate(0); } 80% { opacity: 1; } 100% { transform: scale(1.05) translateY(-20px); opacity: 0; } }
.rankup { position: fixed; inset: 0; z-index: 66; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle, rgba(255, 210, 63, .3), transparent 60%); animation: fadeIn .2s, fadeOut .4s 2.2s forwards; }
.rankup-card { text-align: center; background: linear-gradient(180deg, #FFE38A, #FFB627); color: #3A2000; border: 5px solid #fff; border-radius: 26px; padding: 18px 34px 22px; box-shadow: 0 10px 0 #B9760A, 0 0 60px rgba(255, 210, 63, .8); animation: popIn .5s cubic-bezier(.2, 1.5, .4, 1); }
.rankup-card small { display: block; font-size: 16px; letter-spacing: .14em; }
.rankup-card b { font-family: var(--display); font-weight: 400; font-size: clamp(32px, 6vw, 54px); }
.hint-pop { position: fixed; left: 50%; top: 48%; transform: translateX(-50%); z-index: 45; background: #fff; color: #15226A; font-family: var(--display); font-size: clamp(18px, 2.6vw, 24px); padding: 8px 20px 10px; border-radius: 18px; box-shadow: 0 6px 0 rgba(0, 0, 0, .3); display: flex; align-items: center; gap: 10px; pointer-events: none; animation: hintIn 2.1s ease forwards; white-space: nowrap; }
.hint-ico { font-size: 1.3em; }
@keyframes hintIn { 0% { transform: translate(-50%, -40px) scale(.6); opacity: 0; } 12%, 85% { transform: translate(-50%, 0); opacity: 1; } 100% { transform: translate(-50%, -30px); opacity: 0; } }
.shake { animation: shakeX .4s; }
@keyframes shakeX { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* =========================================================
   RESULTADOS
   ========================================================= */
.results-screen { background: radial-gradient(80% 60% at 50% 30%, #3A86FF, #1D338F 60%, #0B1433); }
.results { flex: 1; display: grid; place-items: center; overflow: auto; }
.res-card { width: min(560px, 100%); text-align: center; background: var(--panel); border: 3px solid rgba(255, 255, 255, .2); border-radius: 30px; padding: 20px 20px 24px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); animation: popIn .45s cubic-bezier(.2, 1.4, .4, 1); }
.res-kicker { color: var(--sun); letter-spacing: .1em; font-size: 13px; }
.res-card h2 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6vw, 54px); margin: 4px 0 2px; text-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.res-stars { display: flex; justify-content: center; gap: 8px; font-size: clamp(54px, 9vw, 76px); line-height: 1; }
.rs { font-style: normal; color: rgba(255, 255, 255, .15); transform: scale(.8); }
.rs.on { animation: starIn .5s cubic-bezier(.2, 1.8, .4, 1) both; animation-delay: var(--d); color: var(--sun); text-shadow: 0 0 22px rgba(255, 210, 63, .9), 0 5px 0 #B9760A; }
.rs:nth-child(2) { transform: translateY(-14px) scale(.9); } .rs.on:nth-child(2) { --ty: -14px; }
@keyframes starIn { from { transform: scale(0) rotate(-180deg); } to { transform: translateY(var(--ty, 0)) scale(1); } }
.res-hero { width: 140px; aspect-ratio: 514/760; margin: 4px auto 0; }
.res-hero .hero { width: 100%; height: 100%; }
.emote-salto .hero { animation: jump .7s ease-in-out infinite; }
@keyframes jump { 50% { transform: translateY(-22px); } }
.emote-giro .hero { animation: spin 1.4s ease-in-out infinite; }
@keyframes spin { 60%, 100% { transform: rotateY(360deg); } }
.emote-saluto .hero .arm-r { animation: wave .5s ease-in-out infinite alternate; transform-origin: 150px 126px; }
@keyframes wave { to { transform: rotate(-25deg); } }
.emote-ballo .hero { animation: dance .5s ease-in-out infinite alternate; transform-origin: 50% 100%; }
@keyframes dance { from { transform: rotate(-8deg) translateX(-6px); } to { transform: rotate(8deg) translateX(6px); } }
.res-gains { display: flex; justify-content: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.gain { min-width: 96px; background: rgba(0, 0, 0, .3); border-radius: 16px; padding: 8px 14px; display: flex; flex-direction: column; align-items: center; }
.gain b { font-family: var(--display); font-weight: 400; font-size: 30px; font-variant-numeric: tabular-nums; }
.gain small { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.gain.coins { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 24px; } .gain.coins small { width: 100%; text-align: center; }
.res-extra { color: var(--muted); margin: 6px 0; }
.res-bonus { color: var(--sun); margin: 4px 0; }
.res-unlock { margin: 12px auto 0; background: linear-gradient(180deg, #7DF2B0, var(--leaf)); color: #06301B; border-radius: 18px; padding: 10px 14px; box-shadow: 0 5px 0 var(--leaf-d); animation: popIn .5s 1.2s cubic-bezier(.2, 1.5, .4, 1) both; }
.res-unlock small { display: block; letter-spacing: .1em; font-size: 12px; }
.res-unlock b { font-family: var(--display); font-weight: 400; font-size: 26px; }
.res-unlock.legend { background: linear-gradient(180deg, #FFE38A, #FFB627); color: #3A2000; box-shadow: 0 5px 0 #B9760A; }

/* =========================================================
   PÁGINAS: INVENTARIO, VERBOS, CLASIFICACIÓN, CONFIG
   ========================================================= */
.page { flex: 1; overflow-y: auto; padding: 14px 4px 20px; -webkit-overflow-scrolling: touch; -webkit-user-select: none; }
.page.narrow { max-width: 680px; width: 100%; margin: 0 auto; }
.page-title { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4.6vw, 42px); margin: 4px 0 10px; text-align: center; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.page-tip { text-align: center; color: var(--muted); margin: 6px 0 14px; }
.sub-title { font-family: var(--display); font-weight: 400; font-size: 20px; margin: 18px 0 8px; color: var(--sun); letter-spacing: .04em; }

/* Inventario */
.inv { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(200px, 34%) 1fr; gap: 16px; padding-top: 12px; }
.inv-hero { position: relative; border-radius: 26px; background: radial-gradient(ellipse 70% 20% at 50% 88%, rgba(0, 0, 0, .35), transparent), radial-gradient(circle at 50% 40%, rgba(255, 210, 63, .35), transparent 60%), linear-gradient(180deg, #3A86FF, #1D338F); border: 3px solid rgba(255, 255, 255, .2); display: flex; align-items: center; justify-content: center; padding: 20px 10px 54px; min-height: 0; }
.inv-stage { width: 100%; max-width: 260px; aspect-ratio: 514/760; }
.inv-stage .hero { width: 100%; height: 100%; }
.inv-hero .nameplate { bottom: 12px; }
.inv-shop { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; flex-shrink: 0; }
.tab { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); font-size: 15px; }
.tab span { font-size: 20px; }
.tab.on { background: var(--sun); color: #3A2400; border-color: #fff; box-shadow: 0 4px 0 var(--sun-d); }
.items { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 12px; align-content: start; padding: 4px 2px 10px; }
.item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px 10px; border-radius: 18px; background: var(--panel); border: 3px solid var(--line); box-shadow: 0 5px 0 rgba(0, 0, 0, .3); transition: transform .08s; }
.item:active { transform: translateY(4px); box-shadow: none; }
.item b { font-size: 14px; text-align: center; line-height: 1.1; min-height: 2.2em; display: grid; place-items: center; }
.item .emo { font-size: 46px; line-height: 1.1; }
.item .title-ico { font-size: 38px; }
.swatch { width: 54px; height: 54px; border-radius: 50%; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50%); box-shadow: inset 0 0 0 5px var(--c), 0 4px 0 rgba(0, 0, 0, .3); }
.fxdots { display: flex; gap: 3px; height: 54px; align-items: center; } .fxdots i { width: 16px; height: 16px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.price { font-family: var(--display); font-size: 16px; display: inline-flex; align-items: center; gap: 4px; background: rgba(0, 0, 0, .35); padding: 2px 10px 3px; border-radius: 10px; }
.item.owned .price { background: var(--sky); }
.item.on { border-color: var(--leaf); box-shadow: 0 5px 0 var(--leaf-d), 0 0 18px rgba(43, 212, 125, .45); }
.item.on .price { background: var(--leaf); }
.item.poor { opacity: .6; }
.item.confirm { border-color: var(--sun); animation: wiggle .8s ease-in-out infinite; }
.item.confirm .price { background: var(--sun); color: #3A2400; }
.inv-tip { color: var(--muted); text-align: center; margin: 4px 0 0; font-size: 14px; }

/* Mis verbos */
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.leg { display: inline-flex; align-items: center; gap: 6px; background: var(--panel); border-radius: 12px; padding: 5px 12px; font-size: 14px; border: 2px solid var(--line); }
.leg i { width: 14px; height: 14px; border-radius: 50%; background: var(--sc); }
.leg b { font-family: var(--display); font-weight: 400; color: var(--sun); }
.vgroup { margin-bottom: 18px; }
.vgroup h3 { font-family: var(--display); font-weight: 400; font-size: 18px; letter-spacing: .04em; margin: 10px 0 8px; padding-left: 10px; border-left: 6px solid var(--wc); }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vcard { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px 10px; border-radius: 16px; background: var(--panel); border: 3px solid var(--sc); text-align: left; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); transition: transform .1s; }
.vcard:active { transform: translateY(3px); }
.vcard.talk { animation: speakPulse .9s ease 2; }
.vc-ico { position: absolute; top: 8px; right: 10px; font-size: 24px; }
.vc-inf { font-size: 13px; color: var(--muted); }
.vc-part { font-family: var(--display); font-size: 22px; line-height: 1.1; }
.vc-stars { font-size: 18px; letter-spacing: 1px; } .vc-stars i { font-style: normal; color: rgba(255, 255, 255, .18); } .vc-stars i.on { color: var(--sun); }
.vc-st { font-size: 11px; color: var(--sc); letter-spacing: .04em; }

/* Clasificación */
.records { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rec { background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 10px 6px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.rec span { font-size: 28px; } .rec b { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--sun); } .rec small { color: var(--muted); font-size: 12px; line-height: 1.15; }
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 680px; margin: 0 auto; }
.lb-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 8px 14px; }
.lb-row.me { background: linear-gradient(90deg, rgba(43, 212, 125, .35), var(--panel)); border-color: var(--leaf); transform: scale(1.02); box-shadow: 0 0 18px rgba(43, 212, 125, .35); }
.lb-row.boss { border-color: var(--sun); }
.lb-pos { width: 34px; text-align: center; font-family: var(--display); font-size: 22px; }
.lb-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--c); font-family: var(--display); font-size: 20px; color: #0B1433; flex-shrink: 0; }
.lb-row b { flex: 1; font-size: 17px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-xp { font-family: var(--display); font-size: 18px; color: var(--sun); font-variant-numeric: tabular-nums; }

/* Configuración */
.set-card { background: var(--panel); border: 2px solid var(--line); border-radius: 22px; overflow: hidden; }
.set-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 17px; flex-wrap: wrap; }
.set-row:last-child { border-bottom: 0; }
.set-row b { flex: 1; min-width: 150px; }
.set-ico { font-size: 24px; width: 32px; text-align: center; }
.switch { width: 60px; height: 34px; border-radius: 20px; background: #3A4C9E; position: relative; transition: background .2s; flex-shrink: 0; }
.switch i { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3, 1.5, .5, 1); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
.switch.on { background: var(--leaf); } .switch.on i { transform: translateX(26px); }
.segs { display: flex; gap: 4px; background: rgba(0, 0, 0, .3); padding: 4px; border-radius: 14px; }
.seg { padding: 6px 12px; border-radius: 10px; font-size: 14px; }
.seg.on { background: var(--sun); color: #3A2400; }
.go { font-size: 18px; color: var(--sun); }
.set-status { display: flex; flex-direction: column; gap: 4px; margin: 14px 4px; font-size: 14px; }
.set-status .ok { color: #7DF2B0; } .set-status .warn { color: #FFC9A8; }
.parents-btn { display: flex; margin: 18px auto 0; font-size: 18px; }

/* PIN y nombre */
.pin-help { color: var(--muted); margin: -4px 0 12px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 16px; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; border: 3px solid #fff; }
.pin-dots i.on { background: var(--sun); border-color: var(--sun); }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; justify-content: center; }
.key { height: 64px; border-radius: 16px; background: rgba(255, 255, 255, .12); font-family: var(--display); font-size: 28px; box-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.key:active { transform: translateY(3px); box-shadow: none; }
.name-hero { width: 120px; aspect-ratio: 514/760; margin: 0 auto; }
.name-hero .hero { width: 100%; height: 100%; }
.name-input { width: 100%; font: inherit; font-family: var(--display); font-size: 28px; text-align: center; padding: 12px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .3); color: #fff; margin-bottom: 16px; }
.confirm-txt { font-size: 18px; margin: 8px 0; }

/* Panel padres (sobrio, en español) */
.parent-screen { background: linear-gradient(180deg, #16204F, #0B1433); }
.parent-hud { gap: 12px; }
.ph-title { font-size: 18px; }
.parent { font-family: var(--body); font-weight: 700; max-width: 1100px; width: 100%; margin: 0 auto; -webkit-user-select: text; user-select: text; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.kpi { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.kpi b { display: block; font-size: 26px; font-weight: 900; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.pcols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.pbox { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-top: 12px; min-width: 0; }
.pcols .pbox { margin-top: 0; }
.pbox h3 { margin: 0 0 10px; font-size: 16px; font-weight: 900; }
.hard { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.hard li span { display: block; color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.muted { color: var(--muted); margin: 0; }
.tbl-wrap { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 460px; }
.ptable th { text-align: left; color: var(--muted); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, .06); font-variant-numeric: tabular-nums; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--sc); color: var(--sc); white-space: nowrap; }

/* =========================================================
   RESPONSIVE
   ========================================================= */
/* Tablet vertical y celulares */
@media (max-width: 820px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .pcols { grid-template-columns: 1fr; }
  .records { grid-template-columns: repeat(2, 1fr); }
  .inv { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .inv-hero { padding: 10px 10px 48px; }
  .inv-stage { max-width: 150px; }
}
@media (max-width: 640px) {
  .screen { padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .hud { gap: 6px; }
  .hud-btn, .hud-chip { height: 40px; } .hud-btn { width: 40px; font-size: 18px; } .hud-chip { font-size: 17px; padding: 0 8px; }
  .hud-rank { padding: 4px 8px 4px 4px; } .rank-badge { width: 30px; height: 30px; font-size: 16px; } .rank-txt small { display: none; }
  .game-hud .game-title b { display: none; }
  .dot { width: 11px; height: 11px; }
  .home-grid { grid-template-columns: repeat(2, 1fr); }
  .answers { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .ans-btn { padding: 12px 6px 14px; }
  .targets { inset: 4% 2% 30% 2%; }
  .hero-spot { width: 96px; }
  .chests { inset: 4% 2% 26% 2%; }
  .chest { width: 31%; }
  .chests { gap: 2%; }
  .chest-label { font-size: 13px; padding: 2px 6px 4px; white-space: normal; word-break: break-all; text-align: center; max-width: 100%; }
  .chest-loot { font-size: 36px; }
  .coin.big { width: 38px; height: 38px; }
  .mem-grid { grid-template-columns: repeat(3, 1fr); }
  .card { aspect-ratio: 1 / 1; }
  .boss-q { top: 34%; }
  .boss-spot { width: 120px; }
  .boss-hud { left: 30%; }
  .map-box { width: 100%; }
  .wnode-label { font-size: 10px; padding: 1px 6px 3px; } .wnode-label small { font-size: 8px; }
  .wnode-stars { font-size: 10px; }
  .spath { flex-direction: column; align-items: stretch; gap: 6px; }
  .snode { width: 100%; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 8px 14px; }
  .snode-ico { font-size: 28px; } .snode-name { min-height: 0; font-size: 16px; flex: 1; text-align: left; place-items: start; }
  .snode-link { display: none; }
  .overlay.sheet .overlay-card { padding: 18px 14px; }
  .ws-ico { width: 54px; height: 54px; font-size: 28px; }
  .lb-xp { font-size: 15px; }
}
/* Pantallas bajas (celular horizontal) */
@media (max-height: 520px) {
  .logo .l2 { font-size: 54px; } .logo .l1 { font-size: 26px; } .logo-sub { font-size: 15px; margin-top: 6px; }
  .home-grid { grid-template-columns: repeat(4, 1fr); } .tile { padding: 6px; } .tile span { font-size: 22px; }
  .btn-play { font-size: 24px; }
  .qbar { margin: 6px auto; } .q-inf, .q-ans { font-size: 28px; }
  .answers { margin-top: 8px; } .ans-btn { padding: 8px; font-size: 20px; }
  .mem-legend { margin: 4px 0; } .mem-grid { grid-template-columns: repeat(6, 1fr); } .card { aspect-ratio: 1 / 1.05; }
  .map-box { width: min(100%, calc((100dvh - 130px) * 1.4286)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   ILUSTRACIONES: héroe, jefe, mapa, aura, balón, premiación
   ========================================================= */
.hero { position: relative; display: block; width: 100%; height: 100%; container-type: inline-size; }
.hero-img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 10px 8px rgba(0,0,0,.35)); -webkit-user-drag: none; }
.hero.idle .hero-img, .hero-spot .hero.pose-idle .hero-img { animation: bob 2.2s ease-in-out infinite; transform-origin: 50% 100%; }
.hero.pose-win .hero-img { animation: winHop .5s cubic-bezier(.2,1.5,.4,1); }
@keyframes winHop { from { transform: translateY(12%) scale(.9); } }
.hero.pose-sad .hero-img { animation: sadDrop .4s ease; }
@keyframes sadDrop { from { transform: translateY(-6%); } }
.hand-glow { position: absolute; left: 58%; top: 40%; width: 8%; aspect-ratio: 1; border-radius: 50%; pointer-events: none; }
.pet { position: absolute; left: -14%; bottom: 0; font-size: 30cqw; line-height: 1; animation: petHop 1.6s ease-in-out infinite; filter: drop-shadow(0 4px 2px rgba(0,0,0,.35)); }
@keyframes petHop { 50% { transform: translateY(-14%) rotate(-6deg); } }
.ball { position: absolute; right: -12%; bottom: 0; font-size: 24cqw; line-height: 1; animation: dribble .7s cubic-bezier(.5,0,.5,1) infinite alternate; filter: drop-shadow(0 4px 2px rgba(0,0,0,.35)); }
@keyframes dribble { from { transform: translateY(-60%) rotate(0); } to { transform: translateY(0) rotate(180deg); } }
.b-azzurro { filter: drop-shadow(0 0 6px #3A86FF) drop-shadow(0 4px 2px rgba(0,0,0,.35)) hue-rotate(0deg); }
.b-fuoco { filter: drop-shadow(0 0 4px #FFB627) drop-shadow(0 0 12px #FF5A36); }
.b-fuoco::after { content: "🔥"; position: absolute; left: 10%; top: -60%; font-size: 70%; animation: flame .3s infinite alternate; }
.b-oro { filter: sepia(1) saturate(4) hue-rotate(5deg) brightness(1.15) drop-shadow(0 0 10px #FFD23F); }
.aura-ghiaccio .hero-img { filter: drop-shadow(0 0 6px #9BF6FF) drop-shadow(0 0 18px #4CC9F0); }
.aura-smeraldo .hero-img { filter: drop-shadow(0 0 6px #7DF2B0) drop-shadow(0 0 18px #1FA35B); }
.aura-fuoco .hero-img { filter: drop-shadow(0 0 6px #FFB627) drop-shadow(0 0 20px #FF5A36); animation: auraFlicker .4s infinite alternate; }
.aura-tricolore .hero-img { filter: drop-shadow(-6px 0 8px #1FA35B) drop-shadow(0 -4px 8px #FFFFFF) drop-shadow(6px 0 8px #E63946); }
.aura-galassia .hero-img { filter: drop-shadow(0 0 8px #FF4FA3) drop-shadow(0 0 22px #9B5CFF); }
.aura-oro .hero-img { filter: drop-shadow(0 0 8px #FFF3A6) drop-shadow(0 0 24px #FFD23F); }
@keyframes auraFlicker { to { filter: drop-shadow(0 0 10px #FFE066) drop-shadow(0 0 28px #FF5A36); } }
.boss { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; animation: bossFloat 2s ease-in-out infinite; transform-origin: 50% 100%; }
.boss-spot { aspect-ratio: 1; width: clamp(160px, 28vw, 320px); }

/* Mapa ilustrado: las etiquetas ya vienen en la imagen, encima van los puntos jugables */
.map-box { width: min(100%, calc((100dvh - 190px) * 1.3333)); aspect-ratio: 1448 / 1086; }
.map-img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }
.whot { position: absolute; transform: translate(-50%, -50%); width: 17%; height: 9%; border-radius: 14px; z-index: 2; }
.whot.open { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--wc); animation: hotPulse 1.6s ease-in-out infinite; }
.whot.open.done { animation: none; box-shadow: 0 0 0 3px var(--sun); }
@keyframes hotPulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 12px var(--wc), 0 0 30px var(--wc); } }
.whot-chip { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); white-space: nowrap; font-family: var(--display); font-size: clamp(11px, 1.5vw, 16px); background: rgba(11,20,51,.85); color: var(--sun); padding: 2px 10px 3px; border-radius: 10px; border: 2px solid rgba(255,255,255,.3); }
.whot-go { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); font-family: var(--display); font-size: clamp(12px, 1.6vw, 17px); background: var(--leaf); color: #fff; padding: 2px 12px 4px; border-radius: 10px; box-shadow: 0 4px 0 var(--leaf-d); animation: bounceY .8s ease-in-out infinite alternate; white-space: nowrap; }
@keyframes bounceY { to { transform: translate(-50%, calc(-100% - 6px)); } }
.wfog { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; z-index: 1; pointer-events: none; background: radial-gradient(closest-side, rgba(20,28,70,.78) 30%, rgba(20,28,70,.45) 65%, rgba(20,28,70,0)); backdrop-filter: grayscale(.8) blur(2px); -webkit-backdrop-filter: grayscale(.8) blur(2px); }
.wlock { position: absolute; transform: translate(-50%, -50%); z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; }
.wlock span { font-size: clamp(26px, 4vw, 44px); filter: drop-shadow(0 4px 0 rgba(0,0,0,.4)); }
.wlock b { font-family: var(--display); font-weight: 400; font-size: clamp(11px, 1.6vw, 16px); background: rgba(11,20,51,.85); padding: 2px 10px 3px; border-radius: 10px; }

/* Inicio con la ilustración del Mundo 1 */
.home-screen { background: linear-gradient(180deg, rgba(11,20,51,.35), rgba(11,20,51,.05) 35%, rgba(11,20,51,.15) 60%, rgba(11,20,51,.85)), url(../img/mondo1.webp) center / cover; }
.home-hero { max-height: 340px; }
.home-hero::before { content: ""; position: absolute; left: 50%; bottom: -2%; width: 120%; height: 18%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.4), transparent); }
.island-plat, .palm { display: none; }

/* Esultanze extra */
.emote-scivolata .hero { animation: slideKnee 1.4s ease-in-out infinite; }
@keyframes slideKnee { 0% { transform: translateX(-30%) rotate(0); } 50% { transform: translateX(30%) rotate(-8deg); } 100% { transform: translateX(-30%); } }
.emote-campione .hero { animation: jump .7s ease-in-out infinite; }
.emote-campione .hero-img { filter: drop-shadow(0 0 10px #FFF3A6) drop-shadow(0 0 26px #FFD23F); }

/* ---------- PREMIAZIONE (estadio) ---------- */
.ceremony { position: fixed; inset: 0; z-index: 68; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(40% 60% at 20% 0%, rgba(255,255,255,.35), transparent 70%),
  radial-gradient(40% 60% at 80% 0%, rgba(255,255,255,.35), transparent 70%),
  radial-gradient(70% 40% at 50% 100%, #1FA35B, #0E6B3A 60%, transparent 61%),
  linear-gradient(180deg, #0B1433, #15226A 55%, #0B1433); animation: fadeIn .3s; overflow: hidden; }
.ceremony::before { content: ""; position: absolute; left: 0; right: 0; top: 30%; height: 26%; background-image: radial-gradient(circle, rgba(255,255,255,.75) 0 2px, transparent 3px), radial-gradient(circle, rgba(255,210,63,.7) 0 2px, transparent 3px); background-size: 22px 18px, 31px 23px; opacity: .55; animation: flash 1.2s steps(2) infinite; }
@keyframes flash { 50% { opacity: .25; } }
.ceremony .beam-l, .ceremony .beam-r { position: absolute; top: -10%; width: 30%; height: 120%; background: linear-gradient(180deg, rgba(255,255,255,.3), transparent 70%); filter: blur(6px); transform-origin: top center; }
.ceremony .beam-l { left: 8%; animation: sweepL 3s ease-in-out infinite alternate; } .ceremony .beam-r { right: 8%; animation: sweepR 3s ease-in-out infinite alternate; }
@keyframes sweepL { from { transform: rotate(-20deg); } to { transform: rotate(15deg); } }
@keyframes sweepR { from { transform: rotate(20deg); } to { transform: rotate(-15deg); } }
.cer-card { position: relative; z-index: 2; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 640px; }
.cer-gol { font-family: var(--display); font-size: clamp(56px, 12vw, 120px); color: #fff; -webkit-text-stroke: 4px #0B1433; paint-order: stroke fill; text-shadow: 0 8px 0 #0B1433; animation: golIn .8s cubic-bezier(.2,1.6,.4,1); letter-spacing: .02em; line-height: 1; }
@keyframes golIn { from { transform: scale(.2) rotate(-12deg); opacity: 0; } }
.cer-kicker { font-size: clamp(14px, 2vw, 18px); letter-spacing: .14em; color: var(--sun); }
.cer-stage { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 4%; height: clamp(200px, 38vh, 340px); width: min(92vw, 560px); }
.cer-hero, .cer-campione { height: 100%; aspect-ratio: 514/760; }
.cer-campione img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.cer-trophy { position: absolute; left: 50%; top: 0; transform: translateX(-50%); font-size: clamp(80px, 16vh, 140px); animation: trophyIn 1s .3s cubic-bezier(.2,1.5,.4,1) both, trophyShine 1.6s 1.3s ease-in-out infinite alternate; filter: drop-shadow(0 0 30px rgba(255,210,63,.9)); z-index: 3; }
.cer-hero.with-campione + .cer-trophy, .cer-stage.duo .cer-trophy { left: 50%; }
@keyframes trophyIn { from { transform: translate(-50%, -140%) scale(.3) rotate(-30deg); } }
@keyframes trophyShine { to { transform: translateX(-50%) scale(1.08) rotate(4deg); } }
.cer-name { font-family: var(--display); font-size: clamp(26px, 5vw, 44px); color: var(--sun); text-shadow: 0 4px 0 rgba(0,0,0,.4); }
.cer-sub { color: #E8EEFF; font-size: clamp(15px, 2.2vw, 19px); margin: 0 0 8px; }
.trophy-shelf { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tro { background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.tro span { font-size: 38px; filter: drop-shadow(0 0 10px rgba(255,210,63,.6)); }
.tro b { font-size: 13px; line-height: 1.1; }
.tro small { font-size: 11px; color: var(--muted); line-height: 1.15; }
.tro.locked span { filter: grayscale(1) brightness(.4); }
.tro.locked b { color: var(--muted); }
@media (max-width: 640px) { .trophy-shelf { grid-template-columns: repeat(2, 1fr); } .whot-chip { font-size: 10px; } }

/* ---------- TIRA AL GOL ---------- */
.pitch { background: radial-gradient(120% 60% at 50% 110%, #2BD47D, #128A4B 55%, #0B5E37 75%), #0B5E37; }
.pitch::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.05) 0 8%, transparent 8% 16%); }
.crowd { position: absolute; left: 0; right: 0; top: 0; height: 22%; background: linear-gradient(180deg, #0B1433, #15226A); }
.crowd::after { content: ""; position: absolute; inset: 10% 0 0; background-image: radial-gradient(circle, #FFD23F 0 3px, transparent 4px), radial-gradient(circle, #FF4FA3 0 3px, transparent 4px), radial-gradient(circle, #9BF6FF 0 3px, transparent 4px); background-size: 26px 20px, 34px 24px, 21px 28px; background-position: 0 0, 10px 6px, 4px 12px; animation: flash 1s steps(2) infinite; opacity: .8; }
.goal { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); width: min(72%, 640px); height: 46%; border: 10px solid #fff; border-bottom: 0; border-radius: 6px 6px 0 0; box-shadow: 0 0 0 3px rgba(0,0,0,.25), 0 10px 30px rgba(0,0,0,.35); z-index: 2; }
.net { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px); background-size: 18px 18px; background-color: rgba(11,20,51,.25); }
.net.shake { animation: netShake .5s ease; }
@keyframes netShake { 30% { transform: scale(1.04, 1.06) translateY(-3%); } 60% { transform: scale(.98); } }
.zones { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); z-index: 2; }
.zone { display: grid; place-items: center; border-right: 3px dashed rgba(255,255,255,.35); }
.zone:last-child { border-right: 0; }
.zone span { font-family: var(--display); font-size: clamp(15px, 2.6vw, 28px); background: #fff; color: #15226A; padding: 4px 12px 6px; border-radius: 12px; box-shadow: 0 4px 0 rgba(0,0,0,.3); animation: qIn .4s cubic-bezier(.2,1.4,.4,1) both; }
.zone:hover span { transform: scale(1.06); }
.zone.scored span { background: var(--leaf); color: #fff; }
.zone.blocked span { background: #6E78AE; color: #C9D0F0; }
.keeper { position: absolute; left: 50%; bottom: 0; width: 15%; aspect-ratio: .7; transform: translateX(-50%); z-index: 3; transition: transform .38s cubic-bezier(.3,1.2,.5,1); pointer-events: none; }
.k-head { position: absolute; left: 30%; top: 0; width: 40%; aspect-ratio: 1; border-radius: 50%; background: #F2C29B; box-shadow: inset 0 -6px 0 #5A3418; }
.k-body { position: absolute; left: 18%; top: 26%; width: 64%; height: 56%; border-radius: 16px 16px 8px 8px; background: linear-gradient(180deg, #FFB627, #FF7A1A); }
.k-glove { position: absolute; top: 22%; width: 24%; aspect-ratio: 1; border-radius: 40%; background: #2BD47D; border: 3px solid #fff; }
.k-glove.l { left: -8%; } .k-glove.r { right: -8%; }
.keeper.dive-0 { transform: translateX(-210%) rotate(-70deg); }
.keeper.dive-1 { transform: translateX(-50%) translateY(-40%); }
.keeper.dive-2 { transform: translateX(110%) rotate(70deg); }
.spot { position: absolute; left: 50%; bottom: 10%; width: 60px; height: 14px; transform: translateX(-50%); border-radius: 50%; background: rgba(255,255,255,.7); }
.kball { position: absolute; left: 50%; bottom: 10%; margin-left: -0.5em; font-size: clamp(44px, 6vw, 64px); line-height: 1; z-index: 4; transition: transform .45s cubic-bezier(.2,.7,.3,1); filter: drop-shadow(0 6px 4px rgba(0,0,0,.4)); }
.kball.caught { animation: shakeX .4s; }
.rigore-game .hero-spot { left: 6%; bottom: 2%; width: clamp(90px, 14vw, 160px); z-index: 3; }
.camp-spot { position: absolute; right: 3%; bottom: 2%; width: clamp(100px, 16vw, 190px); aspect-ratio: .75; z-index: 3; }
.camp-spot .bubble { left: auto; right: 60%; top: -4%; }
.camp-img { display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 6px rgba(0,0,0,.35)); }
.camp-jersey { display: block; width: 100%; height: 100%; filter: drop-shadow(0 8px 6px rgba(0,0,0,.35)); animation: bob 2s ease-in-out infinite; }
.score { position: absolute; top: 4%; right: 3%; z-index: 4; font-family: var(--display); font-size: clamp(20px, 3vw, 30px); background: rgba(11,20,51,.85); padding: 4px 14px 6px; border-radius: 12px; border: 2px solid rgba(255,255,255,.3); }

/* ---------- Evento del Campione ---------- */
.overlay.campione-ev .overlay-card { background: radial-gradient(120% 80% at 50% 0%, #2BD47D, #128A4B 45%, #0B3D2A); border-color: var(--sun); }
.ev-flash { display: inline-block; font-family: var(--display); font-size: clamp(16px, 2.4vw, 22px); color: #3A2400; background: var(--sun); padding: 4px 16px 6px; border-radius: 12px; animation: lowBlink .4s infinite alternate; }
.ev-title { font-size: clamp(26px, 5vw, 42px) !important; color: #fff; text-shadow: 0 4px 0 rgba(0,0,0,.4); }
.ev-portrait { position: relative; width: clamp(140px, 30vw, 220px); aspect-ratio: .8; margin: 0 auto; }
.ev-bubble { position: absolute; right: -40%; top: 4%; background: #fff; color: #15226A; font-family: var(--display); font-size: clamp(14px, 2vw, 19px); padding: 6px 12px 8px; border-radius: 14px; white-space: nowrap; animation: popIn .4s .4s cubic-bezier(.2,1.5,.4,1) both; }
.ev-info { font-family: var(--display); font-size: clamp(16px, 2.4vw, 20px); color: var(--sun); margin: 8px 0 0; }
.voice-camp { width: 90px; aspect-ratio: .8; margin: -6px auto 0; }
@media (max-width: 640px) {
  .goal { width: 90%; top: 16%; height: 40%; border-width: 7px; }
  .camp-spot { width: 86px; } .rigore-game .hero-spot { width: 76px; }
  .ev-bubble { right: -10%; top: -12%; }
}
/* Premiación: héroe · copa · campione en fila */
.cer-stage { align-items: flex-end; }
.cer-trophy { position: static; transform: none; align-self: center; order: 2; animation: trophyIn2 1s .3s cubic-bezier(.2,1.5,.4,1) both, trophyShine2 1.6s 1.3s ease-in-out infinite alternate; }
.cer-hero { order: 1; } .cer-campione { order: 3; }
@keyframes trophyIn2 { from { transform: translateY(-140%) scale(.3) rotate(-30deg); } }
@keyframes trophyShine2 { to { transform: scale(1.08) rotate(4deg); } }
/* Celular vertical: el mapa se ve grande y se desliza de lado */
@media (max-aspect-ratio: 4/5) {
  .map-wrap { display: flex; align-items: center; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .map-wrap::-webkit-scrollbar { display: none; }
  .map-box { flex: 0 0 auto; width: auto; height: min(100%, 560px); max-width: none; }
  .map-foot { flex-wrap: wrap; gap: 8px; }
  .map-foot .btn { font-size: 17px; }
}
.stadio-card { margin-top: 14px; width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 10px 16px; border-radius: 18px; background: linear-gradient(90deg, #2BD47D, #128A4B); box-shadow: 0 5px 0 #0B5E37; }
.stadio-card b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; }
.stadio-card small { font-size: 14px; }
.sc-camp { width: 64px; aspect-ratio: .8; flex-shrink: 0; }
@media (min-width: 641px) {
  .spath { overflow: visible; }
  .snode { flex: 1 1 0; width: auto; min-width: 0; }
  .snode-link { flex: 0 0 14px; }
}
/* Configuración en celular: controles debajo del texto, sin desbordes */
@media (max-width: 640px) {
  .set-row { padding: 12px; gap: 8px 10px; font-size: 16px; }
  .set-row.static b { min-width: 0; flex: 1 1 60%; }
  .set-row.static .segs { flex: 1 1 100%; justify-content: stretch; }
  .segs .seg { flex: 1; text-align: center; }
  .set-status { font-size: 13px; }
}

/* ---------- Celular horizontal (pantallas bajas) ---------- */
@media (max-height: 520px) and (min-aspect-ratio: 1/1) {
  .screen { padding-top: calc(var(--safe-t) + 6px); padding-bottom: calc(var(--safe-b) + 6px); }
  .hud-btn, .hud-chip { height: 38px; } .hud-btn { width: 38px; }
  /* inicio: logo arriba, héroe al centro, botones en una fila */
  .home-hero { max-height: 160px; margin-bottom: 0; }
  .nameplate { display: none; }
  .home-actions { flex-direction: row; justify-content: center; gap: 10px; }
  .btn-play { font-size: 22px; padding: .3em 1.1em .38em; }
  .home-grid { width: auto; grid-template-columns: repeat(4, minmax(78px, 1fr)); gap: 8px; }
  .tile { padding: 5px 6px 7px; } .tile span { font-size: 20px; } .tile b { font-size: 10px; }
  /* mapa: ocupa todo el alto, botones flotando abajo */
  .map-wrap { padding: 4px 0; }
  .map-box { width: min(100%, calc((100dvh - 64px) * 1.3333)); }
  .map-foot { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 8px); z-index: 4; }
  .map-foot .btn { font-size: 15px; padding: .4em .9em .45em; }
  /* Bersaglio: 4 objetivos en una fila */
  .targets { inset: 4% 2% 4% 20%; grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; }
  .target-ring { width: 58px; } .target-word { font-size: 15px; padding: 2px 8px 3px; }
  .hero-spot { width: 86px; }
  .chests { inset: 4% 2% 4% 16%; } .chest { width: 22%; } .chest-label { font-size: 14px; }
  .boss-spot { width: 130px; }
  .inv-stage { max-height: 60dvh; width: auto; height: 60dvh; }
  .overlay-card { padding: 14px; } .overlay-card h2 { font-size: 22px; margin: 2px 0 6px; }
  .spath { margin: 10px 0 8px; }
  .res-card { padding: 10px 14px 12px; } .res-hero { width: 80px; } .res-stars { font-size: 44px; } .res-card h2 { font-size: 30px; }
}
/* Celulares angostos: la pregunta cabe en una línea */
@media (max-width: 420px) {
  .qbar { gap: 8px; margin: 8px auto; }
  .q-inf { font-size: 26px; padding: 3px 14px 6px 8px; } .q-ans { font-size: 26px; padding: 3px 12px 6px; min-width: 1.6em; } .q-arrow { font-size: 24px; }
  .boss-q .q-inf, .boss-q .q-ans { font-size: 22px; }
}
/* Tablet vertical: mapa grande */
@media (max-aspect-ratio: 4/5) and (min-width: 700px) {
  .map-box { height: min(100%, 100vw); }
}
