/* =========================================================
   developed.work — Pixel Quest UI
   ========================================================= */

:root {
  /* Base nocturna */
  --bg-0: #07061a;
  --bg-1: #0d0b26;
  --bg-2: #151236;
  --panel: #1a1745;
  --panel-hi: #252061;
  --panel-lo: #110e31;
  --line: #efedff;
  --line-soft: #3b3585;
  --outline: #05040f;

  /* Texto */
  --ink: #f4f2ff;
  --ink-2: #cfcbf3;
  --muted: #a19dd2;
  --dim: #6f6aa8;

  /* Acentos por zona */
  --green: #3ddc84;
  --green-dk: #1b9653;
  --cyan: #45e3ff;
  --cyan-dk: #1596b8;
  --teal: #2fe0c0;
  --teal-dk: #138f7a;
  --blue: #4aa8ff;
  --blue-dk: #1c64c4;
  --purple: #a682ff;
  --purple-dk: #6a3fd6;
  --red: #ff5470;
  --red-dk: #b51f3c;
  --gold: #ffcf3f;
  --gold-dk: #c98b00;
  --orange: #ff9f43;
  --orange-dk: #c25f0c;
  --wa: #25d366;
  --wa-dk: #128c4b;

  --zone: var(--green);
  --hud-h: 68px;

  --font-px: 'Press Start 2P', ui-monospace, monospace;
  --font-head: 'Pixelify Sans', 'Press Start 2P', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hud-h) + 8px);
  -webkit-text-size-adjust: 100%;
  background: var(--bg-1);
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(106, 63, 214, .28), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(21, 150, 184, .14), transparent 60%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-attachment: fixed;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  cursor: var(--cursor, auto);
}

html.is-booting body { overflow: hidden; }

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
ul, ol { list-style: none; }
strong { color: var(--ink); font-weight: 700; }

a, button, label, select, summary, [role="tab"], [role="option"] { cursor: var(--cursor-hand, pointer); }
input, textarea { cursor: text; }
[tabindex="-1"]:focus { outline: none; }

::selection { background: var(--gold); color: var(--outline); }

:focus-visible {
  outline: 3px dashed var(--gold);
  outline-offset: 6px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  left: 12px; top: -60px;
  z-index: 10000;
  padding: 10px 14px;
  background: var(--gold);
  color: var(--outline);
  font-family: var(--font-px);
  font-size: .6rem;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Marco pixel compartido ---------- */
/* Marco de 4px con esquinas recortadas + sombra escalonada */
.npc, .crt, .map, .level, .stat, .shop, .verified, .phone, .screen, .pipeline,
.compare, .arena, .cart, .quest, .menu, .modal, .toast, .zone-card__box,
.item__icon, .klass__box, .diff__box, .vbox, .powerup, .boot__bar {
  --pf: var(--line);
  --sd: rgba(0, 0, 0, .55);
  --dd: 4px;
  box-shadow:
    0 -4px 0 0 var(--pf),
    0 4px 0 0 var(--pf),
    -4px 0 0 0 var(--pf),
    4px 0 0 0 var(--pf),
    var(--dd) calc(var(--dd) + 4px) 0 0 var(--sd),
    calc(var(--dd) + 4px) var(--dd) 0 0 var(--sd),
    inset 0 4px 0 0 rgba(255, 255, 255, .06),
    inset 0 -4px 0 0 rgba(0, 0, 0, .22);
}

/* ---------- Botones pixel ---------- */
.btn {
  --c: var(--green);
  --c-dk: var(--green-dk);
  --t: #06200f;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 4px 8px;
  padding: 14px 20px 16px;
  font-family: var(--font-px);
  font-size: .66rem;
  line-height: 1.5;
  letter-spacing: .02em;
  color: var(--t);
  background: var(--c);
  border: 0;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    0 -4px 0 0 var(--c),
    0 4px 0 0 var(--c),
    -4px 0 0 0 var(--c),
    4px 0 0 0 var(--c),
    0 8px 0 0 var(--c-dk),
    inset 0 -4px 0 0 rgba(0, 0, 0, .16),
    inset 0 4px 0 0 rgba(255, 255, 255, .28);
  transition: transform .12s steps(2), filter .12s steps(2);
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active {
  transform: translateY(4px);
  box-shadow:
    0 -4px 0 0 var(--c),
    0 4px 0 0 var(--c),
    -4px 0 0 0 var(--c),
    4px 0 0 0 var(--c),
    inset 0 4px 0 0 rgba(0, 0, 0, .16);
}
.btn[disabled] { filter: grayscale(.7) brightness(.8); pointer-events: none; }
.btn--sm { padding: 10px 14px 12px; font-size: .58rem; }
.btn--blue { --c: var(--blue); --c-dk: var(--blue-dk); --t: #04162e; }
.btn--gold { --c: var(--gold); --c-dk: var(--gold-dk); --t: #2a1a00; }
.btn--purple { --c: var(--purple); --c-dk: var(--purple-dk); --t: #160736; }
.btn--red { --c: var(--red); --c-dk: var(--red-dk); --t: #2c0610; }
.btn--orange { --c: var(--orange); --c-dk: var(--orange-dk); --t: #2a1200; }
.btn--wa { --c: var(--wa); --c-dk: var(--wa-dk); --t: #04200f; }
.btn--ghost { --c: #2a2566; --c-dk: #15123d; --t: var(--ink); }

/* ---------- Iconos pixelados (emoji -> canvas) ---------- */
.pxi { display: inline-grid; place-items: center; line-height: 1; }
.pxi img.px-emoji {
  width: 1.2em;
  height: 1.2em;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ---------- Sprites ---------- */
[data-sprite] svg { display: block; overflow: visible; }
[data-sprite] .sp-b { opacity: 0; }
.is-walking .sp-a { animation: sp-a .34s steps(1, end) infinite; }
.is-walking .sp-b { animation: sp-b .34s steps(1, end) infinite; }
.is-left svg { transform: scaleX(-1); }
@keyframes sp-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes sp-b { 0% { opacity: 0; } 50% { opacity: 1; } }

/* =========================================================
   BOOT / PANTALLA DE INICIO
   ========================================================= */
.boot { display: none; }
.is-booting .boot {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 500px at 50% 40%, rgba(106, 63, 214, .35), transparent 70%),
    var(--bg-0);
  text-align: center;
}
.boot__inner { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.boot__sprite { animation: bob 1s steps(2) infinite; margin-bottom: 8px; }
.boot__logo {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 5rem);
  line-height: 1;
  letter-spacing: .02em;
  color: var(--ink);
  text-shadow: 0 4px 0 var(--purple-dk), 0 8px 0 var(--outline);
}
.boot__logo span { color: var(--gold); }
.boot__sub { font-family: var(--font-px); font-size: .62rem; color: var(--cyan); letter-spacing: .2em; }
.boot__bar {
  --pf: var(--line);
  width: min(320px, 80vw);
  height: 20px;
  background: var(--panel-lo);
  margin-top: 16px;
  overflow: hidden;
}
.boot__bar span {
  display: block;
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--green) 0 12px, var(--green-dk) 12px 16px);
}
.boot__status { font-family: var(--font-px); font-size: .55rem; color: var(--muted); min-height: 1.4em; }
.boot__start {
  visibility: hidden;
  margin-top: 8px;
  padding: 10px 14px;
  font-family: var(--font-px);
  font-size: .78rem;
  color: var(--gold);
  background: none;
  border: 0;
  animation: blink 1s steps(1) infinite;
}
.boot.is-ready .boot__start { visibility: visible; }
.boot__skip {
  font-family: var(--font-body);
  font-size: .82rem;
  color: var(--dim);
  background: none;
  border: 0;
  text-decoration: underline;
}
.boot__copy { font-family: var(--font-px); font-size: .45rem; color: var(--dim); margin-top: 24px; line-height: 1.8; }

/* =========================================================
   HUD
   ========================================================= */
.hud {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--hud-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: rgba(9, 8, 28, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 4px solid #1f1b4d;
}

.hud__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
  flex-shrink: 0;
}
.hud__avatar {
  width: 40px;
  height: 40px;
  object-fit: cover;
  box-shadow: 0 0 0 3px var(--line), 4px 4px 0 3px rgba(0, 0, 0, .5);
}
.hud__name { font-family: var(--font-px); font-size: .66rem; letter-spacing: .02em; }
.hud__name span { color: var(--gold); }
.hud__lvl {
  font-family: var(--font-px);
  font-size: .5rem;
  padding: 5px 6px;
  color: #2a1a00;
  background: var(--gold);
  box-shadow: inset 0 -2px 0 var(--gold-dk);
}

.hud__xp { flex: 1; max-width: 360px; margin: 0 auto; align-self: flex-end; padding-bottom: 11px; }
.hud__xp-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  font-family: var(--font-px);
  font-size: .45rem;
  color: var(--muted);
  white-space: nowrap;
}
.hud__zone { color: var(--zone); }
.hud__zone::before { content: '▶ '; }
.hud__xp-val strong { color: var(--gold); font-weight: 400; }
.hud__track {
  position: relative;
  height: 8px;
  background: #221e52;
  box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px #3b3585;
}
.hud__fill {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(90deg, var(--zone) 0 6px, color-mix(in srgb, var(--zone) 70%, #000) 6px 8px);
}
.hud__runner {
  position: absolute;
  left: 0;
  bottom: 6px;
  width: 20px;
  will-change: transform;
}

.hud__actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hud__counter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 9px;
  font-family: var(--font-px);
  font-size: .6rem;
  color: var(--ink);
  background: #17143f;
  box-shadow: inset 0 0 0 2px #2e2970;
  text-decoration: none;
}
.hud__counter.is-bump { animation: bump .4s steps(4); }
.hud__icon, .hud__menu {
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  display: inline-grid;
  place-items: center;
  font-family: var(--font-px);
  font-size: .62rem;
  color: var(--ink);
  background: #1f1b4d;
  border: 0;
  box-shadow: inset 0 0 0 2px #3b3585, inset 0 -4px 0 0 rgba(0, 0, 0, .3);
}
.hud__icon[aria-pressed="false"] { color: var(--dim); }
.pxicon { display: inline-grid; place-items: center; }
.pxicon svg { display: block; height: 16px; width: auto; }
.hud__bag .pxicon svg { height: 15px; color: var(--gold); }
.hud__icon:hover, .hud__menu:hover { background: #2a2566; }
.hud__menu { display: inline-flex; gap: 8px; }
.hud__cta { margin: 0 0 4px 4px; }

.hud__progress {
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 4px;
}
.hud__progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--zone);
}

/* Moneda pixel */
.coin {
  width: 12px;
  height: 14px;
  background: var(--gold);
  clip-path: polygon(0 3px, 3px 3px, 3px 0, 9px 0, 9px 3px, 12px 3px, 12px 11px, 9px 11px, 9px 14px, 3px 14px, 3px 11px, 0 11px);
  box-shadow: inset -3px 0 0 var(--gold-dk), inset 3px 0 0 #fff3b0;
}
.is-bump .coin { animation: coin-spin .4s steps(4); }

/* =========================================================
   ZONAS (secciones)
   ========================================================= */
.zone {
  position: relative;
  isolation: isolate;
  padding: 100px 0 96px;
}
.zone::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--zone) 60%, transparent) 0 12px, transparent 12px 24px);
  opacity: .55;
}
.zone::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(1000px 460px at 50% 0, color-mix(in srgb, var(--zone) 13%, transparent), transparent 70%);
}
.hero::before { display: none; }

.anchor-alias { position: absolute; top: 0; }

.zone-head {
  position: relative;
  max-width: 820px;
  margin: 0 auto 56px;
  padding: 0 64px;
  text-align: center;
}
.zone-tag {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 0 12px 0 0;
  font-family: var(--font-px);
  font-size: .55rem;
  line-height: 1;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--zone) 45%, transparent);
}
.zone-tag__world {
  padding: 8px 10px;
  color: var(--outline);
  background: var(--zone);
}
.zone-title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.12;
  letter-spacing: .01em;
  text-wrap: balance;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, .45);
  margin-bottom: 16px;
}
.zone-sub {
  font-size: clamp(.98rem, 1.6vw, 1.1rem);
  color: var(--muted);
  max-width: 64ch;
  margin: 0 auto;
  text-wrap: pretty;
}
.zone-sub strong { color: var(--ink-2); }
.zone-cta { text-align: center; margin-top: 40px; }

/* Bloque ? */
.qblock {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-family: var(--font-px);
  font-size: .9rem;
  color: #fff7d1;
  text-shadow: 2px 2px 0 var(--gold-dk);
  background:
    radial-gradient(circle at 6px 6px, #7a4b00 0 2px, transparent 2.5px),
    radial-gradient(circle at 38px 6px, #7a4b00 0 2px, transparent 2.5px),
    radial-gradient(circle at 6px 38px, #7a4b00 0 2px, transparent 2.5px),
    radial-gradient(circle at 38px 38px, #7a4b00 0 2px, transparent 2.5px),
    var(--gold);
  border: 0;
  box-shadow:
    0 0 0 3px #4a2c00,
    inset -4px -4px 0 0 var(--gold-dk),
    inset 4px 4px 0 0 #ffe9a3,
    6px 6px 0 0 rgba(0, 0, 0, .45);
  animation: bob 1.4s steps(2) infinite;
}
.qblock.is-hit { animation: qhit .3s steps(3); }
.qblock.is-used {
  color: transparent;
  text-shadow: none;
  background:
    radial-gradient(circle at 6px 6px, #3b2410 0 2px, transparent 2.5px),
    radial-gradient(circle at 38px 6px, #3b2410 0 2px, transparent 2.5px),
    radial-gradient(circle at 6px 38px, #3b2410 0 2px, transparent 2.5px),
    radial-gradient(circle at 38px 38px, #3b2410 0 2px, transparent 2.5px),
    #8a5a2b;
  box-shadow: 0 0 0 3px #2c1a08, inset -4px -4px 0 0 #5e3b19, inset 4px 4px 0 0 #a8743f, 6px 6px 0 0 rgba(0, 0, 0, .45);
  animation: none;
}
.coin-pop {
  position: absolute;
  left: 50%;
  top: -8px;
  width: 20px;
  height: 24px;
  margin-left: -10px;
  pointer-events: none;
  background: var(--gold);
  clip-path: polygon(0 5px, 5px 5px, 5px 0, 15px 0, 15px 5px, 20px 5px, 20px 19px, 15px 19px, 15px 24px, 5px 24px, 5px 19px, 0 19px);
  box-shadow: inset -5px 0 0 var(--gold-dk), inset 5px 0 0 #fff3b0;
  animation: coin-pop .7s steps(10) forwards;
}

/* Revelado al hacer scroll */
.js .reveal { opacity: 0; translate: 0 24px; }
.js .reveal.is-in { animation: rise .55s steps(6) both; animation-delay: var(--d, 0ms); }
@keyframes rise {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - var(--hud-h));
  padding: 64px 0 0;
  overflow: hidden;
}
.hero__sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cloud { position: absolute; color: rgba(207, 203, 243, .05); }
.cloud--1 { width: 192px; top: 12%; left: -200px; animation: drift 70s linear infinite; }
.cloud--2 { width: 128px; top: 42%; left: -200px; animation: drift 95s linear infinite -40s; color: rgba(207, 203, 243, .05); }
.cloud--3 { width: 256px; top: 70%; left: -260px; animation: drift 120s linear infinite -80s; color: rgba(207, 203, 243, .04); }

.hero__grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  gap: 64px;
  align-items: start;
}
.hero__media { margin-top: 56px; }
.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  padding: 9px 12px;
  font-family: var(--font-px);
  font-size: .55rem;
  color: var(--green);
  background: rgba(61, 220, 132, .08);
  box-shadow: inset 0 0 0 2px rgba(61, 220, 132, .4);
}
.led {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 10px var(--green);
  animation: blink 1.2s steps(1) infinite;
}
.hero__title {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.3rem, 4.7vw, 3.7rem);
  line-height: 1.05;
  letter-spacing: .005em;
  text-shadow: 5px 5px 0 rgba(0, 0, 0, .45);
  margin-bottom: 22px;
  text-wrap: balance;
}
.hl { background: none; color: var(--c); box-shadow: inset 0 -.16em 0 color-mix(in srgb, var(--c) 30%, transparent); }
.hl--cyan { --c: var(--cyan); }
.hl--green { --c: var(--green); }
.hl--purple { --c: var(--purple); }
.hl--blue { --c: var(--blue); }
.hero__lead {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--ink-2);
  max-width: 60ch;
  margin-bottom: 30px;
}

/* NPC / diálogo */
.npc {
  --pf: var(--line);
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  padding: 22px 22px 20px;
  margin: 0 4px 30px;
  background: linear-gradient(180deg, #2a2475 0%, #19154c 100%);
}
.npc__portrait {
  width: 96px;
  height: 96px;
  box-shadow: 0 0 0 4px var(--outline), 0 0 0 6px #5b54b8;
  overflow: hidden;
  background: #cbe8ff;
}
.npc__portrait img { width: 100%; height: 100%; object-fit: cover; }
.npc__name {
  position: absolute;
  top: -14px;
  left: 20px;
  padding: 6px 10px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: #2a1a00;
  background: var(--gold);
  box-shadow: 0 0 0 3px var(--outline);
}
.npc__text {
  position: relative;
  min-height: 4.4em;
  font-family: var(--font-head);
  font-size: 1.14rem;
  line-height: 1.45;
  color: var(--ink);
}
.npc.is-done .npc__text::after {
  content: '▼';
  display: inline-block;
  margin-left: 8px;
  font-size: .7rem;
  color: var(--gold);
  animation: blink .8s steps(1) infinite;
}
.npc__choices { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.js .npc:not(.is-done) .npc__choices { visibility: hidden; }
.npc.is-done .npc__choices { animation: rise .4s steps(4) both; }
.choice {
  position: relative;
  align-self: flex-start;
  padding: 4px 4px 4px 22px;
  font-family: var(--font-head);
  font-size: 1.02rem;
  color: var(--cyan);
  text-decoration: none;
}
.choice::before {
  content: '▶';
  position: absolute;
  left: 2px;
  top: 7px;
  font-size: .62rem;
  color: var(--gold);
  opacity: 0;
}
.choice:hover, .choice:focus-visible { color: var(--gold); }
.choice:hover::before, .choice:focus-visible::before { opacity: 1; animation: nudge .5s steps(2) infinite; }

.hero__ctas { display: flex; flex-wrap: wrap; gap: 12px; }

/* CRT */
.hero__media { position: relative; }
.crt {
  --pf: var(--line);
  padding: 12px 12px 14px;
  margin: 4px;
  background: linear-gradient(180deg, #2b2766, #1a1745);
}
.crt__bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 10px;
  font-family: var(--font-px);
  font-size: .45rem;
  color: var(--muted);
}
.crt__rec { color: var(--red); animation: blink 1.4s steps(1) infinite; }
.crt__screen {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--outline);
}
.crt__screen img { width: 100%; animation: glitch 9s steps(1) infinite; }
.crt__screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, .35) 100%);
}
.hero__badge {
  position: absolute;
  left: -28px;
  bottom: -34px;
  width: 116px;
  height: 116px;
  padding: 6px;
  background: #e8f3ff;
  box-shadow: 0 0 0 4px var(--outline), 0 0 0 8px var(--blue), 8px 8px 0 8px rgba(0, 0, 0, .45);
  animation: bob 1.6s steps(2) infinite;
}
.hero__badge img { width: 100%; height: 100%; object-fit: cover; }

/* Stats */
.hero__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 72px;
}
.stat {
  --pf: var(--line-soft);
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 16px 18px;
  margin: 4px;
  background: linear-gradient(180deg, #1f1b52, #16133f);
}
.stat__icon { grid-row: span 2; font-size: 1.9rem; }
.stat__num {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.85rem;
  line-height: 1.1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.stat:nth-child(2) .stat__num { color: var(--cyan); }
.stat:nth-child(3) .stat__num { color: var(--purple); }
.stat:nth-child(4) .stat__num { color: var(--blue); }
.stat__label { font-size: .8rem; color: var(--muted); line-height: 1.35; }

.scroll-cue {
  align-self: center;
  margin: 40px auto 28px;
  font-family: var(--font-px);
  font-size: .55rem;
  color: var(--muted);
  text-decoration: none;
  animation: bob 1s steps(2) infinite;
}
.scroll-cue:hover { color: var(--gold); }

.ground {
  margin-top: auto;
  height: 32px;
  background:
    linear-gradient(90deg, #36c777 0 50%, transparent 0) 0 0 / 16px 4px repeat-x,
    linear-gradient(#36c777, #36c777) 0 4px / 100% 8px no-repeat,
    linear-gradient(#1f8a4f, #1f8a4f) 0 12px / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, #4a2f1c 0 16px, #57381f 16px 32px) 0 16px / 100% 16px no-repeat;
}

/* =========================================================
   MAPA
   ========================================================= */
.map {
  --pf: var(--line);
  position: relative;
  margin: 4px;
  background: #0d2f5c;
}
.map img { width: 100%; }
.pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 2;
  width: 44px;
  height: 52px;
  transform: translate(-50%, -100%);
  background: none;
  border: 0;
}
.pin__arrow {
  position: absolute;
  left: 50%;
  top: 0;
  width: 28px;
  height: 30px;
  margin-left: -14px;
  background: var(--c);
  clip-path: polygon(20% 0, 80% 0, 80% 45%, 100% 45%, 100% 60%, 80% 60%, 80% 75%, 60% 75%, 60% 90%, 40% 90%, 40% 75%, 20% 75%, 20% 60%, 0 60%, 0 45%, 20% 45%);
  filter: drop-shadow(0 0 0 var(--outline));
  animation: bob .9s steps(2) infinite;
}
.pin::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 28px;
  height: 10px;
  margin-left: -14px;
  border: 3px solid var(--c);
  border-radius: 50%;
  opacity: .9;
  animation: ring 1.4s steps(5) infinite;
}
.pin__label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 7px 9px;
  font-family: var(--font-px);
  font-size: .5rem;
  white-space: nowrap;
  color: var(--outline);
  background: var(--c);
  box-shadow: 0 0 0 3px var(--outline);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s steps(2);
}
.pin:hover .pin__label, .pin:focus-visible .pin__label { opacity: 1; }
.pin:focus-visible { outline-offset: 2px; }
.map__hero {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  transform: translate(-130%, -70%);
  transition: left .9s steps(12), top .9s steps(12);
  pointer-events: none;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, .5));
}
.map__hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 10px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--gold);
  background: rgba(7, 6, 26, .82);
  box-shadow: 0 0 0 3px var(--outline);
  animation: blink 1.6s steps(1) infinite;
}

.levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.level {
  --pf: var(--c);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  margin: 4px;
  padding: 18px 16px 16px;
  text-decoration: none;
  background: linear-gradient(180deg, #1f1b52, #15123d);
  transition: transform .12s steps(2);
}
.level:hover, .level:focus-visible { --dd: 8px; transform: translate(-4px, -4px); }
.level__num { font-family: var(--font-px); font-size: .5rem; color: var(--c); }
.level__icon { font-size: 1.9rem; margin: 6px 0 2px; align-self: flex-start; }
.level__name { font-family: var(--font-head); font-weight: 700; font-size: 1.28rem; line-height: 1.15; }
.level__desc { font-size: .82rem; color: var(--muted); line-height: 1.4; flex: 1; }
.level__state { font-family: var(--font-px); font-size: .45rem; color: var(--gold); margin-top: 8px; }
.level.is-visited .level__state { color: var(--green); }

/* =========================================================
   CATÁLOGO / TIENDA
   ========================================================= */
.shop {
  --pf: var(--line);
  margin: 4px;
  background: linear-gradient(180deg, #221d5c 0%, #16134a 100%);
}
.shop__keeper {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  background: rgba(0, 0, 0, .2);
  border-bottom: 4px solid var(--line-soft);
}
.shop__keeper-icon { font-size: 2.4rem; animation: bob 1.2s steps(2) infinite; }
.shop__keeper-text { font-family: var(--font-head); font-size: 1.12rem; line-height: 1.4; min-height: 1.4em; }

.shop__tabs {
  display: flex;
  gap: 8px;
  padding: 18px 24px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.shop__tabs::-webkit-scrollbar { display: none; }
.shop-tab {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 14px;
  font-family: var(--font-px);
  font-size: .55rem;
  color: var(--muted);
  background: #120f38;
  border: 0;
  box-shadow: inset 0 0 0 2px #2b2670;
  transition: transform .1s steps(2);
}
.shop-tab .pxi { font-size: 1.1rem; }
.shop-tab:hover { color: var(--ink); transform: translateY(-2px); }
.shop-tab.is-active {
  color: var(--outline);
  background: var(--c);
  box-shadow: inset 0 -4px 0 0 rgba(0, 0, 0, .25), inset 0 4px 0 0 rgba(255, 255, 255, .3);
}

.shop__body {
  display: grid;
  grid-template-columns: 330px 1fr;
  margin-top: 18px;
  border-top: 4px solid var(--line-soft);
  min-height: 500px;
}
.shop__list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  border-right: 4px solid var(--line-soft);
  background: rgba(0, 0, 0, .14);
}
.no-js .shop__list { display: none; }
.shop-row {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 18px;
  font-family: var(--font-head);
  font-size: 1.04rem;
  line-height: 1.2;
  text-align: left;
  color: var(--ink-2);
  background: transparent;
  border: 0;
}
.shop-row::before {
  content: '▶';
  position: absolute;
  left: 2px;
  font-size: .55rem;
  color: var(--gold);
  opacity: 0;
}
.shop-row:hover { background: rgba(255, 255, 255, .04); color: var(--ink); }
.shop-row.is-selected {
  color: var(--ink);
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 4px 0 0 var(--rc);
}
.shop-row.is-selected::before { opacity: 1; animation: nudge .6s steps(2) infinite; }
.shop-row__icon { font-size: 1.6rem; }
.shop-row__rar {
  width: 10px;
  height: 10px;
  background: var(--rc);
  box-shadow: 0 0 0 2px var(--outline);
}
.shop-row.is-owned .shop-row__rar {
  width: auto;
  height: auto;
  background: none;
  box-shadow: none;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--green);
}

.shop__items { padding: 30px 34px 32px; min-width: 0; }
.item { --rc: var(--blue); }
.item[data-rarity="epic"], .shop-row[data-rarity="epic"] { --rc: var(--purple); }
.item[data-rarity="legendary"], .shop-row[data-rarity="legendary"] { --rc: var(--gold); }
.shop-row[data-rarity="rare"] { --rc: var(--blue); }
.js .item:not(.is-active) { display: none; }
.no-js .item { margin-bottom: 48px; }
.item.is-active { animation: item-in .32s steps(4) both; }
.item__top { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.item__icon {
  --pf: var(--rc);
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  margin: 4px;
  display: grid;
  place-items: center;
  font-size: 2.8rem;
  background: radial-gradient(circle, color-mix(in srgb, var(--rc) 28%, transparent) 0 40%, transparent 41%), #120f38;
}
.item[data-rarity="legendary"] .item__icon { animation: glow 1.6s steps(2) infinite; }
.item__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.rarity {
  padding: 5px 8px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--outline);
  background: var(--rc);
}
.item__cat { font-family: var(--font-px); font-size: .5rem; color: var(--muted); }
.item__name { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2rem); line-height: 1.1; }
.item__desc { color: var(--ink-2); max-width: 62ch; margin-bottom: 18px; }
.item__effect {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 12px;
  font-family: var(--font-px);
  font-size: .55rem;
  line-height: 1.6;
  color: var(--gold);
  background: rgba(255, 207, 63, .08);
  box-shadow: inset 4px 0 0 var(--gold);
}
.item__stats { display: grid; gap: 10px; margin-bottom: 22px; max-width: 460px; }
.item__stats > div { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 12px; }
.item__stats dt { font-size: .86rem; color: var(--muted); }
.pips {
  --v: 3;
  display: block;
  width: 120px;
  height: 12px;
  background:
    repeating-linear-gradient(90deg, var(--rc, var(--green)) 0 20px, transparent 20px 24px) 0 0 / calc(var(--v) * 24px) 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .12) 0 20px, transparent 20px 24px);
}
.item.is-active .pips { animation: pips-fill .6s steps(5) both .1s; }
.pips--sm { width: 100px; height: 8px; background-size: calc(var(--v) * 20px) 100%, auto; background-image: repeating-linear-gradient(90deg, var(--gold) 0 16px, transparent 16px 20px), repeating-linear-gradient(90deg, rgba(255, 255, 255, .14) 0 16px, transparent 16px 20px); }
.item__label { font-family: var(--font-px); font-size: .5rem; color: var(--dim); margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag {
  padding: 5px 9px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--ink-2);
  background: #2a2566;
  box-shadow: inset 0 -3px 0 0 rgba(0, 0, 0, .3);
}
.item__incl { display: grid; gap: 6px; margin-bottom: 24px; }
.item__incl li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: .94rem; }
.item__incl li::before { content: '◆'; position: absolute; left: 0; top: 0; font-size: .72rem; color: var(--rc); }
.item__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.item__actions .is-owned { --c: var(--green); --c-dk: var(--green-dk); --t: #06200f; }

.shop__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-top: 4px solid var(--line-soft);
  background: rgba(0, 0, 0, .2);
}
.shop__hint { font-family: var(--font-px); font-size: .5rem; color: var(--dim); }
.shop__bag { font-family: var(--font-px); font-size: .55rem; color: var(--gold); text-decoration: none; }
.shop__bag:hover { color: var(--ink); }
.shop__bag strong { color: var(--ink); font-weight: 400; }

/* =========================================================
   META FORTRESS
   ========================================================= */
.verified {
  --pf: var(--blue);
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: center;
  margin: 4px 4px 64px;
  padding: 36px;
  background: linear-gradient(135deg, #1b2a6b 0%, #18154a 60%);
}
.verified__emblem {
  padding: 8px;
  background: #e8f3ff;
  box-shadow: 0 0 0 4px var(--outline), 0 0 0 8px var(--blue), 0 0 40px 8px rgba(74, 168, 255, .35);
  animation: glow-blue 2s steps(2) infinite;
}
.pill {
  display: inline-block;
  margin-bottom: 14px;
  padding: 7px 10px;
  font-family: var(--font-px);
  font-size: .5rem;
  line-height: 1.6;
}
.pill--green { color: var(--green); background: rgba(61, 220, 132, .1); box-shadow: inset 0 0 0 2px rgba(61, 220, 132, .4); }
.verified__title { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 1.9rem); line-height: 1.15; margin-bottom: 12px; }
.verified__text { color: var(--ink-2); margin-bottom: 22px; }
.verified__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.verified__stats li {
  padding: 14px 10px;
  text-align: center;
  background: rgba(0, 0, 0, .25);
  box-shadow: inset 0 0 0 2px rgba(74, 168, 255, .35);
}
.vnum { display: block; font-family: var(--font-px); font-size: 1rem; color: var(--green); margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.vlabel { font-size: .78rem; color: var(--muted); }

.meta-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 48px;
  align-items: start;
}

/* Teléfono */
.phone {
  --pf: var(--line);
  margin: 4px;
  padding: 16px 12px 20px;
  background: linear-gradient(180deg, #23204f, #121031);
}
.phone__speaker { width: 64px; height: 6px; margin: 0 auto 12px; background: #060514; }
.phone__screen {
  display: flex;
  flex-direction: column;
  height: 580px;
  overflow: hidden;
  background: #0b141a;
  box-shadow: 0 0 0 4px var(--outline);
}
.wa-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #202c33;
  color: #e9edef;
}
.wa-head__avatar { width: 36px; height: 36px; object-fit: cover; box-shadow: 0 0 0 2px var(--wa); }
.wa-head__info { min-width: 0; flex: 1; }
.wa-head__name { font-weight: 700; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wa-head__check { color: var(--wa); }
.wa-head__status { font-size: .7rem; color: #8696a0; }
.wa-head__more { color: #aebac1; font-size: 1.1rem; }

.wa-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  overflow-y: auto;
  background-color: #0b141a;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 14px 14px;
  scrollbar-width: thin;
  scrollbar-color: #2a3942 transparent;
}
.bubble {
  max-width: 86%;
  padding: 9px 11px 6px;
  font-size: .86rem;
  line-height: 1.45;
  color: #e9edef;
  word-break: break-word;
  clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  animation: bubble-in .25s steps(3) both;
}
.bubble strong { color: #fff; }
.bubble--bot { align-self: flex-start; background: #202c33; }
.bubble--user { align-self: flex-end; background: #005c4b; }
.bubble__time { display: block; text-align: right; font-size: .62rem; color: #8696a0; margin-top: 3px; }
.bubble--typing { padding: 12px 14px; }
.dots { display: inline-flex; gap: 5px; }
.dots i { width: 6px; height: 6px; background: #8696a0; animation: dot 1s steps(2) infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }

.wa-chips {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  background: #111b21;
  border-top: 1px solid #222d34;
  scrollbar-width: none;
}
.wa-chips::-webkit-scrollbar { display: none; }
.wa-chip {
  flex-shrink: 0;
  padding: 6px 11px;
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  color: #e9edef;
  background: #202c33;
  border: 0;
  box-shadow: inset 0 0 0 2px #2f3f48;
  transition: background .1s steps(2);
}
.wa-chip:hover { background: var(--wa); color: #04200f; box-shadow: none; }
.wa-input { display: flex; gap: 8px; padding: 8px 10px; background: #202c33; }
.wa-input input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: .86rem;
  color: #e9edef;
  background: #2a3942;
  border: 0;
  outline: none;
  box-shadow: inset 0 0 0 2px transparent;
}
.wa-input input:focus { box-shadow: inset 0 0 0 2px var(--wa); }
.wa-input input::placeholder { color: #8696a0; }
.wa-input button {
  width: 40px;
  flex-shrink: 0;
  font-size: 1rem;
  color: #04200f;
  background: var(--wa);
  border: 0;
  box-shadow: inset 0 -3px 0 var(--wa-dk);
}

.meta-side { display: grid; gap: 40px; }

/* Ventana/pantalla con imagen */
.screen {
  --pf: var(--line-soft);
  margin: 4px;
  background: #15123d;
}
.screen__bar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  font-family: var(--font-px);
  font-size: .45rem;
  color: var(--muted);
  background: #221e58;
  border-bottom: 4px solid var(--line-soft);
}
.screen__caption { padding: 14px 18px 16px; font-size: .9rem; color: var(--muted); border-top: 4px solid var(--line-soft); }
.screen__caption strong { color: var(--ink); }
.zoomable {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  overflow: hidden;
}
.zoomable img { width: 100%; transition: transform .3s steps(4); }
.zoomable:hover img { transform: scale(1.03); }
.zoomable__hint {
  position: absolute;
  right: 10px;
  top: 10px;
  padding: 6px 8px;
  font-family: var(--font-px);
  font-size: .45rem;
  color: var(--ink);
  background: rgba(7, 6, 26, .85);
  box-shadow: 0 0 0 2px var(--line-soft);
  opacity: 0;
  transition: opacity .15s steps(2);
}
.zoomable:hover .zoomable__hint, .zoomable:focus-visible .zoomable__hint { opacity: 1; }

/* Pipeline animado */
.pipeline {
  --pf: var(--line-soft);
  margin: 4px;
  padding: 24px;
  background: #15123d;
}
.pipeline__title { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; margin-bottom: 8px; }
.pipeline__text { font-size: .92rem; color: var(--muted); margin-bottom: 22px; }
.pipeline__track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.pipeline__track::before {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 24px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--line-soft) 0 8px, transparent 8px 14px);
}
.pipeline__track::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 10%;
  width: 12px;
  height: 12px;
  background: var(--wa);
  box-shadow: 0 0 12px var(--wa);
  animation: packet 3.2s steps(24) infinite;
}
.pipeline__track li {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: .74rem;
  line-height: 1.3;
  color: var(--ink-2);
}
.pipeline__node {
  width: 52px;
  height: 52px;
  font-size: 1.6rem;
  background: #221e58;
  box-shadow: 0 0 0 3px var(--outline), 0 0 0 5px var(--line-soft);
}
.pipeline__track li:nth-child(1) .pipeline__node { animation: node-ping 3.2s steps(1) infinite 0s; }
.pipeline__track li:nth-child(2) .pipeline__node { animation: node-ping 3.2s steps(1) infinite .7s; }
.pipeline__track li:nth-child(3) .pipeline__node { animation: node-ping 3.2s steps(1) infinite 1.4s; }
.pipeline__track li:nth-child(4) .pipeline__node { animation: node-ping 3.2s steps(1) infinite 2.1s; }
.pipeline__track li:nth-child(5) .pipeline__node { animation: node-ping 3.2s steps(1) infinite 2.8s; }

/* =========================================================
   NEURAL SANCTUM
   ========================================================= */
.ai-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 56px;
}
.compare {
  --pf: var(--purple);
  margin: 4px;
  padding: 30px 32px;
  background: linear-gradient(135deg, #2a1d63 0%, #17134a 70%);
}
.compare__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
  margin-bottom: 26px;
}
.compare__kicker { font-family: var(--font-px); font-size: .5rem; color: var(--purple); margin-bottom: 8px; }
.compare__title { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.4rem, 2.4vw, 1.8rem); line-height: 1.15; }
.switch { display: flex; padding: 4px; background: #0e0b2c; box-shadow: inset 0 0 0 2px #3b3585; }
.switch__opt {
  padding: 10px 12px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--muted);
  background: none;
  border: 0;
}
.switch__opt.is-active { color: var(--outline); background: var(--red); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25); }
.compare[data-model="student"] .switch__opt.is-active { background: var(--green); }
.compare__rows { display: grid; gap: 16px; }
.crow { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 16px; }
.crow dt { font-weight: 600; color: var(--ink-2); font-size: .94rem; }
.crow dd { display: grid; grid-template-columns: 1fr 220px; align-items: center; gap: 14px; }
.crow__bar { height: 18px; background: #0e0b2c; box-shadow: inset 0 0 0 2px #2b2670; }
.crow__bar span {
  display: block;
  height: 100%;
  width: var(--w, 100%);
  background: repeating-linear-gradient(90deg, var(--red) 0 10px, var(--red-dk) 10px 12px);
  transition: width .6s steps(10);
}
.compare[data-model="student"] .crow__bar span { background: repeating-linear-gradient(90deg, var(--green) 0 10px, var(--green-dk) 10px 12px); }
.crow__val { font-family: var(--font-px); font-size: .5rem; line-height: 1.6; color: var(--red); }
.compare[data-model="student"] .crow__val { color: var(--green); }

.powerups {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.powerup {
  --pf: var(--line-soft);
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 4px;
  padding: 16px 18px;
  font-family: var(--font-px);
  font-size: .5rem;
  line-height: 1.8;
  color: var(--muted);
  background: #18144a;
}
.powerup > .pxi { font-size: 2rem; animation: bob 1.2s steps(2) infinite; }
.powerup:nth-child(2) > .pxi { animation-delay: .3s; }
.powerup:nth-child(3) > .pxi { animation-delay: .6s; }
.powerup:nth-child(4) > .pxi { animation-delay: .9s; }
.powerup strong { font-size: .85rem; color: var(--purple); font-weight: 400; }

/* =========================================================
   BOSS ARENA
   ========================================================= */
.arena {
  --pf: var(--red);
  max-width: 980px;
  margin: 4px auto;
  padding: 22px;
  background: linear-gradient(180deg, #2a1033 0%, #170c2a 100%);
}
.arena__hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}
.hp { padding: 12px 14px; background: #0f0820; box-shadow: inset 0 0 0 3px #3a1d4d; }
.hp__row { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; font-family: var(--font-px); font-size: .5rem; }
.hp--player .hp__val { color: var(--green); }
.hp--boss .hp__name, .hp--boss .hp__val { color: var(--red); }
.hp__bar { height: 16px; background: #2b1840; box-shadow: 0 0 0 2px var(--outline); }
.hp__bar span {
  display: block;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--green) 0 8px, var(--green-dk) 8px 10px);
  transition: width .5s steps(8);
}
.hp--boss .hp__bar span { background: repeating-linear-gradient(90deg, var(--red) 0 8px, var(--red-dk) 8px 10px); }
.hp.is-low .hp__bar span { animation: blink .5s steps(1) infinite; }
.arena__turn {
  padding: 8px 10px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--gold);
  text-align: center;
  animation: blink 1s steps(1) infinite;
}
.arena__turn.is-boss { color: var(--red); }
.arena__screen {
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 0 4px var(--outline);
  margin-bottom: 18px;
}
.arena__screen img { width: 100%; }
.arena__flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: #fff; }
.arena__flash.is-boss { left: 55%; }
.arena__flash.is-on { animation: flash .3s steps(3); }
.arena__flash.is-hurt { background: var(--red); animation: flash .35s steps(3); }
.arena__fx { position: absolute; inset: 0; pointer-events: none; }
.arena__end {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(10, 6, 24, .86);
  animation: rise .5s steps(5) both;
}
.arena__end[hidden] { display: none; }
.arena__end-title {
  font-family: var(--font-px);
  font-size: clamp(.9rem, 2.4vw, 1.4rem);
  line-height: 1.5;
  color: var(--gold);
  text-shadow: 4px 4px 0 var(--outline);
}
.arena__end--lose .arena__end-title { color: var(--red); animation: blink 1s steps(1) infinite; }
.arena__end-text { max-width: 56ch; color: var(--ink-2); font-size: .95rem; }

.arena__bottom { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.dialog-box {
  min-height: 132px;
  padding: 16px 18px;
  font-family: var(--font-px);
  font-size: .6rem;
  line-height: 2;
  color: var(--ink);
  background: #0f0820;
  box-shadow: inset 0 0 0 3px var(--line), inset 0 0 0 6px var(--outline);
}
.commands { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmd {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 12px 12px 12px 26px;
  text-align: left;
  color: var(--ink);
  background: #1f1238;
  border: 0;
  box-shadow: inset 0 0 0 2px #4a2a63, inset 0 -4px 0 0 rgba(0, 0, 0, .3);
  transition: transform .1s steps(2);
}
.cmd::before {
  content: '▶';
  position: absolute;
  left: 9px;
  top: 50%;
  translate: 0 -50%;
  font-size: .55rem;
  color: var(--gold);
  opacity: 0;
}
.cmd:hover, .cmd:focus-visible { background: #2c1a4d; box-shadow: inset 0 0 0 2px var(--gold), inset 0 -4px 0 0 rgba(0, 0, 0, .3); }
.cmd:hover::before, .cmd:focus-visible::before { opacity: 1; animation: nudge .5s steps(2) infinite; }
.cmd:focus-visible { outline: none; }
.cmd:active { transform: translateY(2px); }
.cmd[disabled] { opacity: .4; pointer-events: none; }
.cmd__name { font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.2; }
.cmd__sub { font-family: var(--font-px); font-size: .45rem; color: var(--muted); }
.arena__reset {
  display: block;
  margin: 16px 0 0 auto;
  padding: 8px 10px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--muted);
  background: none;
  border: 0;
  box-shadow: inset 0 0 0 2px #3a1d4d;
}
.arena__reset:hover { color: var(--ink); }

.shake { animation: shake .4s steps(8); }

/* FX de batalla */
.proj {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  background: var(--c, var(--purple));
  box-shadow: 0 0 0 3px #fff, 0 0 18px 6px var(--c, var(--purple));
}
.dmg {
  position: absolute;
  font-family: var(--font-px);
  font-size: clamp(.8rem, 2vw, 1.25rem);
  color: #fff;
  text-shadow: 3px 3px 0 var(--outline), -2px -2px 0 var(--outline);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: dmg-up 1s steps(10) forwards;
}
.dmg--crit { color: var(--gold); font-size: clamp(1rem, 2.6vw, 1.6rem); }
.dmg--hurt { color: var(--red); }
.dmg--heal { color: var(--green); }
.spark { position: absolute; width: 8px; height: 8px; background: var(--c, var(--gold)); }

/* =========================================================
   HALL OF QUESTS (proyectos)
   ========================================================= */
.carts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  perspective: 1000px;
}
.cart {
  --pf: var(--orange);
  display: flex;
  flex-direction: column;
  margin: 4px;
  background: linear-gradient(180deg, #2b2063 0%, #1a154a 100%);
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .2s ease-out;
  transform-style: preserve-3d;
}
.cart__ridges {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-family: var(--font-px);
  font-size: .45rem;
  color: var(--orange);
  background: repeating-linear-gradient(90deg, #352a78 0 6px, #2b2266 6px 12px);
  border-bottom: 4px solid var(--outline);
}
.cart__label { margin: 14px 14px 0; box-shadow: 0 0 0 4px var(--outline); overflow: hidden; background: #fff; }
.cart__label img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s steps(4); }
.cart:hover .cart__label img { transform: scale(1.04); }
.cart__body { display: flex; flex-direction: column; flex: 1; padding: 20px 18px 18px; }
.cart__title { font-family: var(--font-head); font-weight: 700; font-size: 1.45rem; line-height: 1.15; margin-bottom: 8px; }
.cart__desc { flex: 1; font-size: .9rem; color: var(--muted); margin-bottom: 16px; }
.cart .btn { align-self: flex-start; }
.cart--empty { --pf: var(--line-soft); background: repeating-linear-gradient(135deg, #16123f 0 12px, #1a1648 12px 24px); }
.cart__slot {
  position: relative;
  display: grid;
  place-items: center;
  margin: 14px 14px 0;
  aspect-ratio: 4 / 3;
  background: #0e0b2c;
  box-shadow: inset 0 0 0 4px var(--outline), inset 0 0 0 6px var(--line-soft);
}
.cart__coin { position: absolute; top: 18px; font-family: var(--font-px); font-size: .6rem; color: var(--gold); animation: blink 1s steps(1) infinite; }
.cart__q { font-family: var(--font-px); font-size: 3.4rem; color: var(--line-soft); animation: bob 1.2s steps(2) infinite; }

/* Ficha modal */
.sheet__kicker { font-family: var(--font-px); font-size: .5rem; color: var(--orange); margin-bottom: 10px; }
.sheet__title { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.1; margin-bottom: 18px; padding-right: 40px; }
.sheet__img { width: 100%; box-shadow: 0 0 0 4px var(--outline); margin-bottom: 20px; background: #fff; }
.sheet__text { color: var(--ink-2); margin-bottom: 22px; }
.sheet__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.sheet__label { font-family: var(--font-px); font-size: .5rem; color: var(--dim); margin-bottom: 12px; }
.sheet__list { display: grid; gap: 6px; }
.sheet__list li { position: relative; padding-left: 24px; color: var(--ink-2); font-size: .94rem; }
.sheet__list li::before { content: '✓'; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.lightbox__img { width: 100%; box-shadow: 0 0 0 4px var(--outline); background: #fff; }
.lightbox__cap { margin-top: 14px; font-size: .9rem; color: var(--muted); padding-right: 40px; }

/* =========================================================
   GUILD HALL (cotizador)
   ========================================================= */
.quest {
  --pf: var(--green);
  max-width: 980px;
  margin: 4px auto;
  padding: 36px 40px 30px;
  background: linear-gradient(180deg, #1c2a5c 0%, #15123f 70%);
}
.quest__steps {
  position: relative;
  display: flex;
  justify-content: space-between;
  max-width: 560px;
  margin: 0 auto 36px;
}
.quest__steps::before {
  content: '';
  position: absolute;
  left: 40px;
  right: 40px;
  top: 17px;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--line-soft) 0 8px, transparent 8px 14px);
}
.quest__steps li { position: relative; z-index: 1; }
.quest__steps button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--dim);
  background: none;
  border: 0;
}
.quest__steps button span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: .7rem;
  color: var(--muted);
  background: #120f38;
  box-shadow: 0 0 0 3px var(--outline), 0 0 0 5px var(--line-soft);
}
.quest__steps li.is-active button { color: var(--green); }
.quest__steps li.is-active button span { color: var(--outline); background: var(--green); box-shadow: 0 0 0 3px var(--outline), 0 0 0 5px var(--green); }
.quest__steps li.is-done button { color: var(--gold); }
.quest__steps li.is-done button span { color: var(--outline); background: var(--gold); box-shadow: 0 0 0 3px var(--outline), 0 0 0 5px var(--gold); }

.qstep { border: 0; min-width: 0; }
.js .qstep:not(.is-active) { display: none; }
.no-js .qstep { margin-bottom: 32px; }
.qstep.is-active { animation: step-in .35s steps(4) both; }
.qstep__title {
  display: block;
  width: 100%;
  margin-bottom: 22px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  line-height: 1.2;
}
.qstep__title small { display: block; margin-top: 6px; font-family: var(--font-body); font-weight: 500; font-size: .9rem; color: var(--muted); }

.classes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 26px; }
.klass, .diff { position: relative; display: block; }
.klass input, .diff input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.klass__box, .diff__box {
  --pf: var(--line-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  margin: 4px;
  padding: 18px 10px 16px;
  text-align: center;
  background: #120f38;
  transition: transform .1s steps(2);
}
.klass__box:hover, .diff__box:hover { transform: translateY(-3px); }
.klass__icon { font-size: 2rem; }
.klass__name { font-family: var(--font-head); font-weight: 600; font-size: 1rem; line-height: 1.2; }
.klass__meta { font-family: var(--font-px); font-size: .45rem; color: var(--dim); margin-top: auto; }
.klass input:checked + .klass__box, .diff input:checked + .diff__box {
  --pf: var(--green);
  background: linear-gradient(180deg, #1a4a45, #133437);
}
.klass input:checked + .klass__box::after, .diff input:checked + .diff__box::after {
  content: '✓';
  position: absolute;
  top: -12px;
  right: -12px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--outline);
  background: var(--green);
  box-shadow: 0 0 0 3px var(--outline);
}
.klass input:checked + .klass__box .klass__meta { color: var(--green); }
.klass input:focus-visible + .klass__box, .diff input:focus-visible + .diff__box { outline: 3px dashed var(--gold); outline-offset: 8px; }

.equipped { margin-bottom: 22px; }
.equipped__label { font-family: var(--font-px); font-size: .5rem; color: var(--gold); margin-bottom: 12px; }
.equipped__list { display: flex; flex-wrap: wrap; gap: 8px; }
.equipped__list li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 10px;
  font-size: .82rem;
  font-weight: 600;
  background: #2a2566;
  box-shadow: inset 0 0 0 2px var(--gold-dk);
}
.equipped__list button {
  width: 22px;
  height: 22px;
  font-size: .7rem;
  color: var(--ink);
  background: #3b3585;
  border: 0;
}
.equipped__list button:hover { background: var(--red); }

.estimate {
  padding: 14px 16px;
  font-family: var(--font-px);
  font-size: .55rem;
  line-height: 1.9;
  color: var(--green);
  background: rgba(61, 220, 132, .07);
  box-shadow: inset 4px 0 0 var(--green);
}
.estimate.is-flash { animation: flash-text .4s steps(2); }

.diffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.diff__name { font-family: var(--font-px); font-size: .6rem; color: var(--ink); }
.diff input:checked + .diff__box .diff__name { color: var(--gold); }
.diff__desc { font-size: .82rem; color: var(--muted); line-height: 1.35; }

.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field__label { font-size: .86rem; font-weight: 700; color: var(--ink-2); }
.field__input {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #0e0b2c;
  border: 0;
  outline: none;
  box-shadow: inset 0 0 0 3px #3b3585;
  transition: box-shadow .1s steps(2);
}
.field__input::placeholder { color: var(--dim); }
.field__input:focus { box-shadow: inset 0 0 0 3px var(--green); background: #110e34; }
.field__input.is-invalid { box-shadow: inset 0 0 0 3px var(--red); animation: shake .35s steps(6); }
.field__input--area { min-height: 130px; resize: vertical; }

.summary { display: grid; gap: 6px; padding: 16px; background: rgba(0, 0, 0, .22); box-shadow: inset 0 0 0 2px var(--line-soft); }
.summary:empty { display: none; }
.summary p { font-size: .88rem; color: var(--ink-2); }
.summary b { font-family: var(--font-px); font-size: .5rem; color: var(--dim); font-weight: 400; margin-right: 6px; }

.feedback { display: none; margin-top: 20px; padding: 14px 16px; font-weight: 600; font-size: .92rem; }
.feedback.is-error { display: block; color: #ffd0d8; background: rgba(255, 84, 112, .12); box-shadow: inset 4px 0 0 var(--red); }
.feedback.is-success { display: block; color: #c9ffe0; background: rgba(61, 220, 132, .12); box-shadow: inset 4px 0 0 var(--green); }

.quest__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 4px dashed var(--line-soft);
}
.quest__nav [hidden] { display: none; }
.quest__wa { margin-left: auto; }
.btn.is-loading::after {
  content: '';
  width: 10px;
  height: 10px;
  background: currentColor;
  animation: blink .4s steps(1) infinite;
}

/* =========================================================
   CRÉDITOS / FOOTER
   ========================================================= */
.credits {
  position: relative;
  padding: 0 0 28px;
  background: #07061a;
}
.credits .ground { margin: 0 0 52px; }
.credits__inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; margin-bottom: 32px; }
.credits__brand { display: flex; align-items: center; gap: 14px; }
.credits__brand img { width: 48px; height: 48px; box-shadow: 0 0 0 3px var(--line); }
.credits__name { font-family: var(--font-px); font-size: .7rem; margin-bottom: 6px; }
.credits__tag { font-size: .82rem; color: var(--muted); }
.credits__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.credits__links a { font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.credits__links a:hover { color: var(--gold); }
.credits__score { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; font-family: var(--font-px); font-size: .5rem; color: var(--muted); }
.credits__score strong { color: var(--gold); font-weight: 400; }
.credits__top { color: var(--green); text-decoration: none; }
.credits__copy { text-align: center; font-size: .8rem; color: var(--dim); padding: 0 24px; }

/* =========================================================
   CAPAS DE JUEGO
   ========================================================= */
.stars {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  pointer-events: none;
}

.wipe {
  position: fixed;
  inset: 0;
  z-index: 9500;
  width: 100%;
  height: 100%;
  display: none;
  pointer-events: none;
}
.wipe.is-on { display: block; pointer-events: auto; }

.zone-card {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9600;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}
.zone-card.is-on { display: flex; animation: card-in .3s steps(4) both; }
.zone-card__world { font-family: var(--font-px); font-size: .7rem; color: var(--zc, var(--gold)); letter-spacing: .15em; }
.zone-card__name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 6vw, 3.6rem);
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 4px 0 var(--outline);
}

.sidenav {
  position: fixed;
  right: 16px;
  top: 50%;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(-50%);
}
.sidenav a {
  position: relative;
  display: block;
  width: 14px;
  height: 14px;
  background: #221e52;
  box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px #3b3585;
}
.sidenav a.is-visited { background: #3b3585; }
.sidenav a.is-active { background: var(--c); box-shadow: 0 0 0 2px var(--outline), 0 0 0 4px var(--c); }
.sidenav a span {
  position: absolute;
  right: 28px;
  top: 50%;
  translate: 0 -50%;
  padding: 6px 8px;
  font-family: var(--font-px);
  font-size: .45rem;
  white-space: nowrap;
  color: var(--outline);
  background: var(--c);
  opacity: 0;
  pointer-events: none;
}
.sidenav a:hover span, .sidenav a:focus-visible span { opacity: 1; }

.keyhint.is-hidden { opacity: 0; visibility: hidden; transition: opacity .4s steps(4), visibility 0s .4s; }
.keyhint {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  padding: 8px 10px;
  font-family: var(--font-px);
  font-size: .45rem;
  color: var(--dim);
  background: rgba(7, 6, 26, .8);
  box-shadow: inset 0 0 0 2px #1f1b4d;
}

.toasts {
  position: fixed;
  right: 20px;
  top: calc(var(--hud-h) + 18px);
  z-index: 8000;
  display: flex;
  flex-direction: column;
  gap: 16px;
  pointer-events: none;
}
.toast {
  --pf: var(--gold);
  display: flex;
  align-items: center;
  gap: 14px;
  width: 300px;
  margin: 4px;
  padding: 12px 14px;
  background: #1d1846;
  animation: toast-in .35s steps(5) both;
}
.toast.is-out { animation: toast-out .3s steps(4) both; }
.toast__icon { font-size: 1.8rem; }
.toast__kicker { display: block; font-family: var(--font-px); font-size: .45rem; color: var(--gold); margin-bottom: 6px; }
.toast__title { display: block; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.toast__desc { display: block; font-size: .78rem; color: var(--muted); line-height: 1.35; }

.discover {
  position: fixed;
  left: 50%;
  bottom: 40px;
  z-index: 7000;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 76px 16px;
  background: rgba(7, 6, 26, .92);
  box-shadow: 0 0 0 4px var(--outline), 0 0 0 6px color-mix(in srgb, var(--dc, var(--gold)) 70%, transparent), 8px 10px 0 6px rgba(0, 0, 0, .4);
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}
.discover::before, .discover::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 44px;
  height: 4px;
  background: var(--dc, var(--gold));
}
.discover::before { left: 18px; }
.discover::after { right: 18px; }
.discover.is-on { display: flex; animation: discover 2.6s steps(12) both; }
.discover__world { font-family: var(--font-px); font-size: .5rem; color: var(--dc, var(--gold)); }
.discover__name { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; white-space: nowrap; text-shadow: 3px 3px 0 var(--outline); }

.fx-layer { position: fixed; inset: 0; z-index: 8500; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; width: 8px; height: 8px; }
.fly-item { position: fixed; z-index: 8600; font-size: 2rem; pointer-events: none; }

/* Diálogos (menú y modal) */
dialog { color: var(--ink); border: 0; }
.menu, .modal {
  --pf: var(--line);
  margin: auto;
  max-height: 90vh;
  overflow: auto;
  background: linear-gradient(180deg, #252061 0%, #16134a 100%);
  scrollbar-width: thin;
  scrollbar-color: var(--line-soft) transparent;
}
.menu[open], .modal[open] { animation: pop .3s steps(4) both; }
.menu::backdrop, .modal::backdrop {
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 2px, transparent 2px 4px),
    rgba(5, 4, 18, .78);
}
.menu { width: min(900px, calc(100vw - 32px)); padding: 28px 30px 26px; }
.menu__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.menu__head h2 { font-family: var(--font-px); font-size: 1rem; font-weight: 400; color: var(--gold); }
.menu__close, .modal__close {
  width: 38px;
  height: 38px;
  font-size: 1rem;
  color: var(--ink);
  background: #2f2a73;
  border: 0;
  box-shadow: inset 0 0 0 2px var(--line-soft), inset 0 -4px 0 rgba(0, 0, 0, .3);
}
.menu__close:hover, .modal__close:hover { background: var(--red); }
.menu__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; }
.menu__label { font-family: var(--font-px); font-size: .5rem; color: var(--dim); margin: 0 0 14px; }
.menu__label strong { color: var(--gold); font-weight: 400; }
.menu__zones { display: grid; gap: 4px; }
.menu__zones a {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 9px 10px 9px 22px;
  font-family: var(--font-head);
  font-size: 1.1rem;
  text-decoration: none;
}
.menu__zones a::before { content: '▶'; position: absolute; left: 4px; font-size: .55rem; color: var(--gold); opacity: 0; }
.menu__zones a:hover, .menu__zones a:focus-visible { background: rgba(255, 255, 255, .06); }
.menu__zones a:hover::before, .menu__zones a:focus-visible::before { opacity: 1; animation: nudge .5s steps(2) infinite; }
.menu__zones .k {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  font-family: var(--font-px);
  font-size: .55rem;
  color: var(--outline);
  background: var(--c);
}
.menu__zones .st { font-family: var(--font-px); font-size: .45rem; color: var(--dim); }
.menu__zones .is-visited .st { color: var(--green); }
.ach-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 24px; }
.ach {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  text-align: center;
  background: #120f38;
  box-shadow: inset 0 0 0 2px #2b2670;
}
.ach__icon { font-size: 1.6rem; filter: grayscale(1) brightness(.5); }
.ach__name { font-family: var(--font-px); font-size: .4rem; line-height: 1.6; color: var(--dim); }
.ach.is-on { background: #2a2260; box-shadow: inset 0 0 0 2px var(--gold); }
.ach.is-on .ach__icon { filter: none; }
.ach.is-on .ach__name { color: var(--gold); }
.menu__opts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.opt {
  padding: 10px 12px;
  font-family: var(--font-px);
  font-size: .5rem;
  color: var(--ink);
  background: #2a2566;
  border: 0;
  box-shadow: inset 0 0 0 2px var(--line-soft), inset 0 -4px 0 rgba(0, 0, 0, .3);
}
.opt[aria-pressed="false"] { color: var(--dim); }
.menu__keys { font-size: .82rem; color: var(--dim); }
.menu__resume { display: flex; margin: 26px auto 0; }

.modal { width: min(920px, calc(100vw - 32px)); padding: 28px; }
.modal__close { position: absolute; top: 16px; right: 16px; z-index: 2; }
.modal--quest { text-align: center; }
.qdone__title { font-family: var(--font-px); font-size: clamp(.9rem, 2.6vw, 1.3rem); line-height: 1.6; color: var(--gold); margin: 10px 0 18px; text-shadow: 3px 3px 0 var(--outline); }
.qdone__code { display: inline-block; margin-bottom: 18px; padding: 12px 16px; font-family: var(--font-px); font-size: .8rem; color: var(--green); background: #0e0b2c; box-shadow: inset 0 0 0 3px var(--green); }
.qdone__text { max-width: 52ch; margin: 0 auto 22px; color: var(--ink-2); }
.qdone__sprite { display: flex; justify-content: center; margin-top: 8px; animation: bob .5s steps(2) infinite; }

/* Modo leyenda (código secreto) */
.is-legend .hud { animation: rainbow 1.2s steps(6) infinite; }
.is-legend .stars { filter: hue-rotate(90deg) saturate(2); }

/* =========================================================
   KEYFRAMES
   ========================================================= */
@keyframes blink { 50% { opacity: 0; } }
@keyframes bob { 50% { translate: 0 -4px; } }
@keyframes nudge { 50% { translate: 3px 0; } }
@keyframes bump { 50% { transform: translateY(-4px); } }
@keyframes coin-spin { 25% { transform: scaleX(.5); } 50% { transform: scaleX(.1); } 75% { transform: scaleX(.5); } }
@keyframes drift { to { transform: translateX(calc(100vw + 600px)); } }
@keyframes glitch {
  0%, 95%, 100% { transform: none; filter: none; }
  96% { transform: translateX(-4px); filter: hue-rotate(60deg) saturate(1.6); }
  97% { transform: translateX(4px); }
  98% { transform: translateX(-2px); filter: none; }
}
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes qhit { 50% { translate: 0 -12px; } }
@keyframes coin-pop {
  0% { transform: translateY(0) scaleX(1); opacity: 1; }
  25% { transform: translateY(-40px) scaleX(.2); }
  50% { transform: translateY(-64px) scaleX(1); }
  75% { transform: translateY(-52px) scaleX(.2); opacity: 1; }
  100% { transform: translateY(-36px) scaleX(1); opacity: 0; }
}
@keyframes item-in { from { opacity: 0; translate: 12px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes pips-fill { from { background-size: 0 100%, auto; } }
@keyframes glow { 50% { box-shadow: 0 -4px 0 0 var(--pf), 0 4px 0 0 var(--pf), -4px 0 0 0 var(--pf), 4px 0 0 0 var(--pf), 4px 8px 0 0 var(--sd), 8px 4px 0 0 var(--sd), 0 0 28px 6px color-mix(in srgb, var(--rc) 55%, transparent); } }
@keyframes glow-blue { 50% { box-shadow: 0 0 0 4px var(--outline), 0 0 0 8px var(--cyan), 0 0 56px 12px rgba(74, 168, 255, .5); } }
@keyframes bubble-in { from { opacity: 0; translate: 0 8px; } to { opacity: 1; translate: 0 0; } }
@keyframes dot { 50% { translate: 0 -4px; } }
@keyframes packet { 0% { left: 10%; } 100% { left: calc(90% - 12px); } }
@keyframes node-ping { 0% { background: #2f6f4f; } 12% { background: #221e58; } }
@keyframes shake {
  0%, 100% { translate: 0 0; }
  20% { translate: -6px 4px; }
  40% { translate: 6px -4px; }
  60% { translate: -4px 2px; }
  80% { translate: 4px -2px; }
}
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
@keyframes dmg-up {
  0% { translate: 0 0; opacity: 1; scale: .6; }
  20% { translate: 0 -24px; scale: 1.2; }
  70% { translate: 0 -48px; opacity: 1; scale: 1; }
  100% { translate: 0 -64px; opacity: 0; }
}
@keyframes step-in { from { opacity: 0; translate: 16px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes flash-text { 50% { opacity: .3; } }
@keyframes card-in { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes toast-in { from { opacity: 0; translate: 120% 0; } to { opacity: 1; translate: 0 0; } }
@keyframes toast-out { to { opacity: 0; translate: 120% 0; } }
@keyframes discover {
  0% { opacity: 0; translate: 0 12px; }
  15%, 80% { opacity: 1; translate: 0 0; }
  100% { opacity: 0; translate: 0 0; }
}
@keyframes pop { from { opacity: 0; scale: .85; } to { opacity: 1; scale: 1; } }
@keyframes rainbow {
  0% { border-bottom-color: var(--red); }
  20% { border-bottom-color: var(--orange); }
  40% { border-bottom-color: var(--gold); }
  60% { border-bottom-color: var(--green); }
  80% { border-bottom-color: var(--blue); }
  100% { border-bottom-color: var(--purple); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1240px) {
  .sidenav { display: none; }
}

@media (max-width: 1100px) {
  .hud__xp { max-width: 240px; }
  .hud__lvl { display: none; }
  .levels { grid-template-columns: repeat(3, 1fr); }
  .meta-grid { grid-template-columns: 380px 1fr; gap: 32px; }
}

@media (max-width: 992px) {
  .keyhint { display: none; }
  .hud__cta { display: none; }
  .hero__grid { grid-template-columns: 1fr; gap: 56px; }
  .hero__media { max-width: 620px; margin: 0 auto; width: 100%; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .shop__body { grid-template-columns: 270px 1fr; }
  .verified { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .verified__emblem { max-width: 200px; }
  .meta-grid { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
  .phone { max-width: 420px; width: calc(100% - 8px); justify-self: center; }
  .ai-grid { grid-template-columns: 1fr; max-width: 640px; margin-left: auto; margin-right: auto; }
  .powerups { grid-template-columns: repeat(2, 1fr); }
  .arena__bottom { grid-template-columns: 1fr; }
  .carts { grid-template-columns: repeat(2, 1fr); }
  .classes { grid-template-columns: repeat(3, 1fr); }
  .diffs { grid-template-columns: repeat(2, 1fr); }
  .crow { grid-template-columns: 1fr; gap: 8px; }
}

@media (max-width: 860px) {
  .hud__xp { display: none; }
  .hud { justify-content: space-between; }
  .shop__body { grid-template-columns: 1fr; min-height: 0; }
  .shop__list {
    flex-direction: row;
    gap: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 4px solid var(--line-soft);
    scrollbar-width: none;
  }
  .shop__list::-webkit-scrollbar { display: none; }
  .shop__list li { flex-shrink: 0; }
  .shop-row { grid-template-columns: auto auto auto; padding: 10px 12px; font-size: .95rem; box-shadow: inset 0 0 0 2px #2b2670; }
  .shop-row.is-selected { box-shadow: inset 0 0 0 2px var(--rc); }
  .shop-row::before { display: none; }
  .shop__hint { display: none; }
  .shop__foot { justify-content: flex-end; }
}

@media (max-width: 720px) {
  :root { --hud-h: 60px; }
  .container { padding: 0 16px; }
  .zone { padding: 84px 0 76px; }
  .zone-head { padding: 0; margin-bottom: 40px; }
  .qblock { position: relative; display: inline-grid; margin-top: 22px; width: 40px; height: 40px; }
  .hud { gap: 8px; padding: 0 12px; }
  .hud__name { display: none; }
  .hud__avatar { width: 36px; height: 36px; }
  .hud__actions { gap: 6px; }
  .hud__counter { padding: 6px 7px; font-size: .55rem; }
  .hud__menu { font-size: .55rem; padding: 0 9px; }
  .hero { padding-top: 40px; }
  .hero__sky { display: none; }
  .hero__title { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .npc { grid-template-columns: 64px 1fr; gap: 14px; padding: 20px 16px 16px; }
  .npc__portrait { width: 64px; height: 64px; }
  .npc__text { font-size: 1.04rem; }
  .hero__ctas .btn { flex: 1 1 100%; }
  .hero__badge { width: 84px; height: 84px; left: -6px; bottom: -26px; }
  .hero__stats { gap: 14px; margin-top: 64px; }
  .stat { grid-template-columns: 1fr; padding: 14px; }
  .stat__icon { grid-row: auto; font-size: 1.5rem; margin-bottom: 6px; }
  .stat__num { font-size: 1.45rem; }
  .pin { width: 30px; height: 36px; }
  .pin__arrow { width: 18px; height: 20px; margin-left: -9px; }
  .pin::after { width: 18px; height: 8px; margin-left: -9px; }
  .pin__label, .map__hint { display: none; }
  .map__hero { display: none; }
  .levels {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 72%;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 8px 4px 20px;
    margin-left: -4px;
    margin-right: -4px;
    scrollbar-width: none;
  }
  .levels::-webkit-scrollbar { display: none; }
  .levels li { scroll-snap-align: start; }
  .shop__keeper { padding: 14px 16px; }
  .shop__keeper-icon { font-size: 1.8rem; }
  .shop__keeper-text { font-size: 1rem; }
  .shop__tabs { padding: 14px 16px 0; }
  .shop__items { padding: 22px 18px 24px; }
  .item__top { gap: 14px; }
  .item__icon { width: 64px; height: 64px; font-size: 2rem; }
  .item__stats > div { grid-template-columns: 1fr auto; }
  .item__actions .btn { flex: 1 1 100%; }
  .verified { padding: 26px 18px; margin-bottom: 48px; }
  .verified__stats { grid-template-columns: 1fr; }
  .phone__screen { height: 520px; }
  .pipeline { padding: 20px 14px; }
  .pipeline__track li { font-size: .66rem; }
  .pipeline__node { width: 42px; height: 42px; font-size: 1.25rem; }
  .pipeline__track::before { top: 19px; }
  .pipeline__track::after { top: 15px; }
  .compare { padding: 22px 16px; }
  .switch { width: 100%; }
  .switch__opt { flex: 1; padding: 10px 6px; font-size: .45rem; line-height: 1.6; }
  .crow dd { grid-template-columns: 1fr; gap: 6px; }
  .powerups { gap: 12px; }
  .powerup { padding: 12px; gap: 10px; }
  .powerup > .pxi { font-size: 1.5rem; }
  .arena { padding: 14px; }
  .arena__hud { grid-template-columns: 1fr 1fr; gap: 10px; }
  .arena__turn { grid-column: 1 / -1; grid-row: 1; padding: 0; }
  .hp { padding: 10px; }
  .hp__row { flex-direction: column; gap: 4px; font-size: .45rem; }
  .dialog-box { min-height: 112px; font-size: .55rem; padding: 14px; }
  .cmd { padding: 10px 10px 10px 22px; }
  .cmd__name { font-size: .9rem; }
  .carts { grid-template-columns: 1fr; max-width: 440px; margin: 0 auto; }
  .quest { padding: 26px 16px 22px; }
  .quest__steps { margin-bottom: 28px; }
  .classes { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .klass:last-child { grid-column: 1 / -1; }
  .diffs { grid-template-columns: 1fr; gap: 10px; }
  .diff__box { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; padding: 14px; }
  .diff__desc { flex-basis: 100%; }
  .fields { grid-template-columns: 1fr; }
  .quest__nav .btn { flex: 1 1 auto; }
  .quest__wa { margin-left: 4px; flex-basis: 100%; }
  .sheet__cols { grid-template-columns: 1fr; }
  .menu { padding: 22px 16px; }
  .menu__grid { grid-template-columns: 1fr; gap: 24px; }
  .ach-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .modal { padding: 20px 14px; }
  .toasts { left: 12px; right: 12px; align-items: center; }
  .toast { width: min(320px, 100%); }
  .discover { bottom: 24px; padding: 12px 52px 14px; }
  .discover::before, .discover::after { width: 24px; }
  .discover::before { left: 14px; }
  .discover::after { right: 14px; }
  .discover__name { font-size: 1.2rem; }
  .credits__inner { flex-direction: column; text-align: center; }
  .credits__links { justify-content: center; }
}

@media (max-width: 400px) {
  .hud__bag { display: none; }
}
@media (max-width: 340px) {
  .classes { grid-template-columns: 1fr; }
  .klass:last-child { grid-column: auto; }
  .hero__stats { grid-template-columns: 1fr; }
}

@media (hover: none) {
  .keyhint, .shop__hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .js .reveal { opacity: 1; translate: none; }
  .cloud { display: none; }
}
.field__hint { margin: -6px 0 18px; font-size: .82rem; color: var(--dim); }

/* Ajustes de desborde en pantallas pequeñas */
.hero__grid > *, .meta-grid > *, .ai-grid > *, .shop__body > * { min-width: 0; }
.pipeline__track { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.pipeline__track li span:last-child { overflow-wrap: anywhere; hyphens: auto; }
@media (max-width: 720px) {
  .btn { white-space: normal; text-align: center; }
  .pipeline__track { gap: 4px; }
  .pipeline__track li { font-size: .6rem; }
}
