/* ==========================================================
   PokéMinis · estética de videojuego portátil (Pokédex + menús de rol)
   ========================================================== */

:root {
  --red: #e4202a;
  --red-d: #a3141b;
  --blue: #2f8fe6;
  --blue-d: #1b5fa8;
  --yellow: #ffd23f;
  --yellow-d: #c99a00;
  --ink: #1f1d2e;
  --cream: #fbf7e4;
  --paper: #ffffff;
  --muted: #5b6182;
  --line: #c9cde6;
  --green: #3ecf6e;
  --lcd: #c9e29a;
  --lcd-ink: #2b4a1c;
  --px: 'Press Start 2P', ui-monospace, 'Courier New', monospace;
  --shadow: 0 6px 0 rgba(31, 29, 46, 0.35);
  --grass-a: #5cb94a;
  --grass-b: #53ad43;
}

* { box-sizing: border-box; }
html { color-scheme: light; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--px);
  font-size: 10px;
  line-height: 1.8;
  color: var(--ink);
  background: conic-gradient(var(--grass-a) 25%, var(--grass-b) 0 50%, var(--grass-a) 0 75%, var(--grass-b) 0) 0 0 / 36px 36px;
}

a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.35; }
h3 { font-family: var(--px); font-size: 12px; line-height: 1.6; }
h4 { font-family: var(--px); font-size: 9px; line-height: 1.5; }
p { margin: 0 0 12px; font-size: 10px; line-height: 2; }
.muted { color: var(--muted); }
.center { text-align: center; justify-content: center; }

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

@keyframes blink { 50% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cabecera tipo Pokédex ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(#ee2c35, #c4161f);
  border-bottom: 6px solid var(--ink);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.topbar-in {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.lens {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #8fd0ff 0 25%, #2f8fe6 55%, #164e92 100%);
  border: 4px solid #fff;
  box-shadow: 0 0 0 4px var(--ink), 0 0 16px #7fd0ff;
}
.lens i {
  position: absolute; left: 8px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: rgba(255, 255, 255, 0.9);
}
.leds { display: flex; gap: 6px; }
.leds b { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); }
.leds b:nth-child(1) { background: #ff7a7a; }
.leds b:nth-child(2) { background: #ffe14d; }
.leds b:nth-child(3) { background: #5be37d; }
.brand-name {
  font-family: var(--px);
  font-size: 14px;
  color: #fff;
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 3px 0 var(--ink);
}
.nav { display: flex; gap: 6px; margin-left: 6px; flex: 1; }
.navlink {
  font-family: var(--px); font-size: 10px; padding: 11px 12px; border-radius: 8px;
  color: #fff; text-decoration: none; border: 3px solid transparent; text-shadow: 1px 1px 0 var(--ink);
}
.navlink:hover { background: rgba(0, 0, 0, 0.18); }
.navlink.active { background: var(--cream); color: var(--ink); border-color: var(--ink); text-shadow: none; }
.icon-btn {
  appearance: none; flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 0; border-radius: 6px; background: transparent; color: #fff; opacity: 0.7; transition: opacity 0.15s;
}
.icon-btn:hover, .icon-btn:focus-visible { opacity: 1; }
.icon-btn:active { transform: translateY(1px); }
.icon-btn svg { fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 1.5px 0 rgba(31, 29, 46, 0.7)); }
.icon-btn .spk { stroke-linejoin: round; stroke-width: 1; }
.icon-btn .wave, .icon-btn .mute { fill: none; }
.icon-btn .mute { display: none; }
.icon-btn.off .wave { display: none; }
.icon-btn.off .mute { display: inline; }
.icon-btn.off { opacity: 0.5; }
.coins {
  flex: none; display: flex; align-items: center; justify-content: flex-end; gap: 9px; background: var(--lcd); color: var(--lcd-ink);
  font-family: var(--px); font-size: 16px; line-height: 1; letter-spacing: 1px; color: #1b3010; text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.45);
  border: 3px solid var(--ink); border-radius: 6px; padding: 7px 10px 7px 8px;
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.18); min-width: 96px;
}
.coin-ico {
  flex: none; position: relative; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff3a6 0 18%, #ffd23f 40%, #e0a000 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.coin-ico::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid rgba(140, 90, 0, 0.55); }

/* ---------- Estructura ---------- */
.container { width: 100%; max-width: 1000px; margin: 0 auto; padding: 26px 16px 36px; flex: 1; }
.footer {
  max-width: 760px; margin: 0 auto 26px; padding: 12px 16px; text-align: center;
  background: rgba(251, 247, 228, 0.94); color: var(--muted); font-size: 8px; line-height: 2.2;
  border: 3px solid var(--ink); border-radius: 10px;
}
.page-in { animation: pagein 0.28s ease-out; }
@keyframes pagein { from { opacity: 0; transform: translateY(8px); } }

.hero { display: grid; gap: 16px; justify-items: center; text-align: center; margin-bottom: 24px; }
.hero h1 {
  font-family: var(--px);
  font-size: clamp(18px, 4.4vw, 32px);
  line-height: 1.4;
  color: var(--yellow);
  -webkit-text-stroke: 8px var(--blue-d);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 var(--ink);
  margin: 0;
}

/* ---------- Cuadros de diálogo y paneles ---------- */
.dialog {
  position: relative;
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px var(--line), var(--shadow);
  font-family: var(--px);
  font-size: 11px;
  line-height: 1.9;
  text-align: left;
}
.dialog.wait::after { content: '▼'; position: absolute; right: 14px; bottom: 8px; font-size: 11px; animation: blink 0.9s steps(2) infinite; }

.card, .panel {
  background: #fff;
  border: 4px solid var(--ink);
  border-radius: 12px;
  padding: 18px;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--line), var(--shadow);
}
.panel { margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.grid.games { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.grid.pokes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.game-card { display: block; position: relative; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform 0.12s; }
.game-card:hover, .game-card:focus-visible { transform: translateY(-5px) rotate(-0.5deg); outline: none; }
.game-card:focus-visible { box-shadow: 0 0 0 4px var(--yellow), 0 0 0 8px var(--ink); }
.gc-top {
  margin: -18px -18px 14px; padding: 10px 14px; background: var(--c, var(--red)); border-bottom: 4px solid var(--ink);
  display: flex; align-items: center; justify-content: space-between;
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.28) 0 25%, transparent 25% 50%, rgba(255, 255, 255, 0.28) 50% 75%, transparent 75%);
  background-size: 22px 22px;
}
.gc-no { font-family: var(--px); font-size: 10px; color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.game-card h3 { font-size: 11px; margin-bottom: 8px; min-height: 2.9em; }
.game-card p { font-size: 9px; line-height: 2; }
.best { margin-top: 8px; font-family: var(--px); font-size: 8px; color: var(--red-d); }

.game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.game-head h2 {
  margin: 0; font-family: var(--px); font-size: clamp(12px, 2.6vw, 18px); color: #fff;
  -webkit-text-stroke: 6px var(--ink); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
}
.stage { min-height: 300px; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }

.stats-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.stats-bar span {
  background: var(--lcd); color: var(--lcd-ink); border: 3px solid var(--ink); border-radius: 6px;
  padding: 7px 10px; font-family: var(--px); font-size: 9px; line-height: 1.4;
  box-shadow: inset 0 3px 0 rgba(0, 0, 0, 0.15);
}

/* ---------- Botones y menús ---------- */
.btn {
  appearance: none; cursor: pointer; font-family: var(--px); font-size: 11px; line-height: 1.4;
  background: var(--yellow); color: var(--ink); padding: 13px 16px; border: 4px solid var(--ink); border-radius: 10px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55), 0 5px 0 var(--yellow-d), 0 5px 0 4px var(--ink);
  margin-bottom: 5px; text-decoration: none; display: inline-block; transition: transform 0.08s;
}
.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55), 0 1px 0 var(--yellow-d), 0 1px 0 4px var(--ink); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: #fff; box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.55), 0 5px 0 var(--line), 0 5px 0 4px var(--ink); }
.btn.ghost:active:not(:disabled) { box-shadow: 0 1px 0 var(--line), 0 1px 0 4px var(--ink); }
.btn.small { font-size: 9px; padding: 9px 12px; }
.btn.red { background: var(--red); color: #fff; text-shadow: 1px 1px 0 var(--ink); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3), 0 5px 0 var(--red-d), 0 5px 0 4px var(--ink); }
.btn:focus-visible, .opt:focus-visible, .tile:focus-visible, .mv:focus-visible, .hole:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; }

.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
@media (max-width: 520px) { .opts { grid-template-columns: 1fr; } }
.opt {
  position: relative; appearance: none; cursor: pointer; text-align: left; color: var(--ink);
  font-family: var(--px); font-size: 11px; line-height: 1.6; padding: 14px 12px 14px 34px;
  background: #fff; border: 4px solid var(--ink); border-radius: 10px;
  box-shadow: inset 0 0 0 3px var(--line), 0 4px 0 rgba(31, 29, 46, 0.35);
}
.opt::before { content: '▶'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; opacity: 0; }
.opt:hover:not(:disabled)::before, .opt:focus-visible::before { opacity: 1; animation: blink 0.8s steps(2) infinite; }
.opt:disabled { cursor: default; }
.opt.ok { background: #c8f5c0; }
.opt.ok::before { content: '✔'; opacity: 1; color: #1c8a33; }
.opt.bad { background: #ffc6c6; }
.opt.bad::before { content: '✖'; opacity: 1; color: var(--red-d); }

/* ---------- Pokémon y tipos ---------- */
.poke { width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.chip {
  display: inline-block; margin: 2px; padding: 5px 8px; border-radius: 5px; border: 2px solid var(--ink);
  font-family: var(--px); font-size: 8px; line-height: 1.2; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
}
.poke-card { text-align: center; padding: 12px; }
.poke-card img { max-width: 120px; border-radius: 50%; background: radial-gradient(circle, #eef1ff 0 62%, transparent 64%); }
.poke-card h4 { margin: 6px 0; }
.poke-card.pickable { cursor: pointer; transition: transform 0.12s; }
.poke-card.pickable:hover { transform: translateY(-4px); }
.poke-card.selected { box-shadow: 0 0 0 4px var(--yellow), 0 0 0 8px var(--ink); transform: translateY(-4px); }

/* ---------- ¿Quién es ese Pokémon? ---------- */
.whos-stage {
  position: relative; overflow: hidden; text-align: center; padding: 16px 16px 18px;
  background: #12306b; border: 4px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow);
}
.rays {
  position: absolute; inset: -80%; will-change: transform;
  background: repeating-conic-gradient(from 0deg, #1f56b8 0 10deg, #2f78e0 10deg 20deg);
  animation: spin 50s linear infinite;
}
.whos-banner {
  position: relative; margin-bottom: 8px; font-family: var(--px); font-size: clamp(11px, 2.6vw, 17px); line-height: 1.5;
  color: var(--yellow); -webkit-text-stroke: 6px var(--blue-d); paint-order: stroke fill; text-shadow: 0 3px 0 var(--ink);
}
.whos-stage img { position: relative; max-width: 260px; width: 58%; transition: filter 0.6s; }
.whos-stage img.hidden { filter: brightness(0); }
.timer { position: relative; height: 16px; background: #44445c; border: 3px solid var(--ink); border-radius: 8px; overflow: hidden; margin-top: 12px; }
.timer > div { height: 100%; background: repeating-linear-gradient(45deg, #4cd964 0 8px, #3ab954 8px 16px); transform-origin: left; }

/* ---------- Memory ---------- */
.memory-grid { display: grid; gap: 10px; }
.tile { perspective: 600px; aspect-ratio: 1; appearance: none; border: 0; background: none; padding: 0; cursor: pointer; }
.tile-inner { position: relative; width: 100%; height: 100%; transition: transform 0.4s; transform-style: preserve-3d; }
.tile.flipped .tile-inner, .tile.matched .tile-inner { transform: rotateY(180deg); }
.tile-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 12px; display: grid; place-items: center; border: 4px solid var(--ink); }
.tile-front { background: linear-gradient(var(--red) 0 44%, var(--ink) 44% 56%, #fff 56%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.35), 0 4px 0 rgba(31, 29, 46, 0.35); }
.tile-front::after { content: ''; width: 26%; aspect-ratio: 1; border-radius: 50%; background: #fff; border: 4px solid var(--ink); }
.tile:hover:not(.matched) .tile-front { filter: brightness(1.08); }
.tile-back { transform: rotateY(180deg); background: var(--cream); padding: 6px; }
.tile.matched .tile-back { background: #c8f5c0; }
.tile-back img { width: 92%; }

/* ---------- Campo de batalla ---------- */
.battlefield {
  position: relative; container-type: inline-size; aspect-ratio: 16 / 10; overflow: hidden;
  border: 4px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow);
  background:
    radial-gradient(ellipse 14% 7% at 16% 15%, #fff 0 58%, transparent 62%),
    radial-gradient(ellipse 11% 6% at 30% 11%, #fff 0 58%, transparent 62%),
    radial-gradient(ellipse 16% 7% at 74% 20%, #fff 0 58%, transparent 62%),
    linear-gradient(#8fd3ff, #d9f2ff 56%);
}
.battlefield::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 50%;
  border-top: 4px solid #3d8a35;
  background: conic-gradient(#78c95c 25%, #6fc054 0 50%, #78c95c 0 75%, #6fc054 0) 0 0 / 44px 44px;
}
.pad {
  position: absolute; border-radius: 50%; border: 3px solid #3d8a35;
  background: radial-gradient(ellipse at 50% 38%, #cdeb9f, #8ec45f 72%); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.16);
}
.pad.opp { right: 6%; top: 47%; width: 38%; height: 9%; }
.pad.me { left: 3%; bottom: 6%; width: 50%; height: 12%; }
.slot { position: absolute; display: flex; align-items: flex-end; justify-content: center; pointer-events: none; }
.slot.opp { right: 6%; top: 6%; width: 38%; height: 44%; animation: slideR 0.8s ease-out both; }
.slot.me { left: 3%; bottom: 11%; width: 50%; height: 56%; animation: slideL 0.8s ease-out both; }
@keyframes slideR { from { translate: 120% 0; opacity: 0; } }
@keyframes slideL { from { translate: -120% 0; opacity: 0; } }
.fsprite {
  width: calc(var(--nw, 64) * var(--k, 1.2) * 100cqw / 320);
  max-width: 100%; height: auto; image-rendering: pixelated; transform-origin: 50% 100%;
}
.fsprite.me { --k: 1.55; }
.fsprite.opp { --k: 1.2; }

.hud {
  position: absolute; padding: 7px 9px; background: #fffbe8; border: 4px solid var(--ink); border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--line), 0 3px 0 rgba(0, 0, 0, 0.2);
  font-family: var(--px); font-size: clamp(7px, 1.7cqw, 11px); line-height: 1.5;
}
.hud.opp { left: 3%; top: 5%; width: 42%; }
.hud.me { right: 3%; bottom: 5%; width: 44%; }
.hp-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.hp-tag { background: var(--ink); color: #ffb347; border-radius: 4px; padding: 2px 4px; font-size: 0.85em; }
.hpbar { flex: 1; height: 11px; background: #44445c; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden; }
.hpbar > div { height: 100%; width: 100%; background: var(--green); transition: width 0.7s steps(14), background 0.2s; }
.hp-num { text-align: right; margin-top: 4px; }
.dmg {
  position: absolute; z-index: 4; font-family: var(--px); font-size: clamp(10px, 3.2cqw, 18px); color: #fff;
  -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; pointer-events: none; animation: floatup 0.9s ease-out forwards;
}
@keyframes floatup { to { transform: translateY(-34px); opacity: 0; } }
.wipe { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.wipe::before, .wipe::after { content: ''; position: absolute; left: 0; right: 0; height: 50%; background: var(--ink); animation: wipe 0.9s ease-in 0.15s forwards; }
.wipe::before { top: 0; --to: -100%; }
.wipe::after { bottom: 0; --to: 100%; }
@keyframes wipe { to { transform: translateY(var(--to)); } }

.battle-ui { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; margin-top: 12px; align-items: stretch; }
@media (max-width: 680px) { .battle-ui { grid-template-columns: 1fr; } }
.battle-dialog { min-height: 96px; display: flex; align-items: center; }
.menu-box { background: #fff; border: 4px solid var(--ink); border-radius: 10px; padding: 10px; box-shadow: inset 0 0 0 3px var(--line), var(--shadow); }
.moves-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mv {
  position: relative; appearance: none; cursor: pointer; text-align: left; font-family: var(--px); font-size: 9px; line-height: 1.5;
  padding: 10px 8px 10px 22px; background: #fff; color: var(--ink);
  border: 3px solid var(--ink); border-left: 10px solid var(--tc, var(--ink)); border-radius: 8px;
}
.mv::before { content: '▶'; position: absolute; left: 6px; top: 12px; font-size: 8px; opacity: 0; }
.mv:hover:not(:disabled)::before, .mv:focus-visible::before { opacity: 1; animation: blink 0.8s steps(2) infinite; }
.mv small { display: block; margin-top: 4px; font-size: 7px; line-height: 1.5; color: var(--muted); }
.mv:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------- Captura ---------- */
.battlefield.catch-scene { aspect-ratio: 16 / 9; }
.thrower { position: absolute; left: 16%; bottom: 14%; width: 0; height: 0; z-index: 3; }
.pball {
  position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(var(--red) 0 42%, var(--ink) 42% 58%, #fff 58%); border: 3px solid var(--ink);
  opacity: 0; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.12);
}
.pball::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.spark { position: absolute; z-index: 5; font-size: 18px; pointer-events: none; color: #fff2a8; text-shadow: 0 0 6px #ffd23f, 1px 1px 0 var(--ink); }
.catch-bar { position: relative; height: 32px; background: #44445c; border: 4px solid var(--ink); border-radius: 8px; overflow: hidden; margin: 16px 0; }
.catch-zone { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #4cd964 0 8px, #3ab954 8px 16px); border-left: 3px solid var(--ink); border-right: 3px solid var(--ink); }
.catch-marker { position: absolute; top: 0; bottom: 0; width: 8px; background: var(--yellow); border: 2px solid var(--ink); }

/* ---------- Caza rápida ---------- */
.field {
  max-width: 540px; margin: 0 auto; padding: 18px; border: 4px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow);
  background: conic-gradient(#78c95c 25%, #6fc054 0 50%, #78c95c 0 75%, #6fc054 0) 0 0 / 40px 40px;
}
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hole {
  appearance: none; border: 4px solid #3a2616; font: inherit; aspect-ratio: 1; border-radius: 50%; position: relative; overflow: hidden; cursor: pointer; padding: 0;
  background: radial-gradient(ellipse at 50% 60%, #2a1a0d 0 48%, #6b4a2b 50% 100%); box-shadow: 0 4px 0 rgba(0, 0, 0, 0.25);
}
.hole img { position: absolute; left: 8%; bottom: -100%; width: 84%; image-rendering: pixelated; transition: bottom 0.12s; pointer-events: none; }
.hole.up img { bottom: 2%; }

/* ---------- Más o menos ---------- */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.vs-card { text-align: center; }
.vs-card img { max-width: 170px; border-radius: 50%; background: radial-gradient(circle, #eef1ff 0 62%, transparent 64%); }
.vs-badge {
  width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; background: var(--red); color: #fff;
  border: 4px solid var(--ink); font-family: var(--px); font-size: 12px; text-shadow: 2px 2px 0 var(--ink); box-shadow: var(--shadow);
}
@media (max-width: 520px) { .vs-badge { width: 38px; height: 38px; font-size: 9px; } }
.vs-value { font-family: var(--px); font-size: 16px; color: var(--blue-d); min-height: 2.2rem; margin-top: 6px; }
.vs-value.good { color: #1c8a33; }
.vs-value.bad { color: var(--red); }

/* ---------- Pokédex (Mi equipo) ---------- */
.dex-head { display: grid; gap: 12px; }
.dex-bar { height: 18px; border: 3px solid var(--ink); border-radius: 9px; background: #44445c; overflow: hidden; }
.dex-bar > div { height: 100%; background: linear-gradient(#ff6b6b, var(--red)); transition: width 0.6s; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.dex-entry {
  position: relative; padding: 6px 6px 9px; text-align: center; cursor: pointer; background: #fff; border: 3px solid var(--ink);
  border-radius: 10px; box-shadow: inset 0 0 0 2px var(--line); appearance: none; font: inherit; color: var(--ink);
}
.dex-entry .no { font-family: var(--px); font-size: 7px; color: var(--muted); text-align: left; }
.dex-entry img { width: 96px; height: 96px; image-rendering: pixelated; display: block; margin: 2px auto; }
.dex-entry .nm { font-family: var(--px); font-size: 7px; line-height: 1.5; word-break: break-word; }
.dex-entry.owned:hover { transform: translateY(-3px); border-color: var(--red); }
.dex-entry.unseen { cursor: default; background: #eceef8; }
.dex-entry.unseen img { filter: brightness(0) opacity(0.2); }
.statrow { display: grid; grid-template-columns: 64px 1fr 30px; gap: 8px; align-items: center; margin: 6px 0; font-family: var(--px); font-size: 8px; text-align: left; }
.statbar { height: 10px; border: 2px solid var(--ink); border-radius: 6px; background: #e8eaf6; overflow: hidden; }
.statbar > div { height: 100%; }

/* ---------- Varios ---------- */
.loading { display: grid; place-items: center; gap: 14px; padding: 60px 0; font-family: var(--px); font-size: 11px; color: #fff; text-shadow: 2px 2px 0 var(--ink); text-align: center; line-height: 1.6; }
.spinner {
  position: relative; width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--ink);
  background: linear-gradient(var(--red) 0 42%, var(--ink) 42% 58%, #fff 58%); animation: spin 0.9s steps(8) infinite;
}
.spinner::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff; border: 3px solid var(--ink); }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(20, 18, 40, 0.72); }
.modal {
  width: 100%; max-width: 440px; max-height: 92vh; overflow: auto; text-align: center; padding: 22px; background: #fff;
  border: 4px solid var(--ink); border-radius: 14px; animation: none;
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 6px var(--line), 0 8px 0 rgba(0, 0, 0, 0.35);
}
.modal h2 { font-family: var(--px); font-size: 14px; line-height: 1.6; color: var(--red-d); margin-bottom: 10px; }
.modal-body { margin: 10px 0 18px; }
.modal img { max-width: 160px; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } }

#toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60; padding: 10px 14px; background: #fff; color: var(--ink);
  border: 4px solid var(--ink); border-radius: 10px; font-family: var(--px); font-size: 11px;
  box-shadow: inset 0 0 0 2px var(--line), 0 4px 0 rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: 0.2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .leds { display: none; }
  .brand-name { font-size: 11px; }
  .topbar-in { gap: 8px; padding: 8px 10px; }
  .navlink { font-size: 8px; padding: 9px 7px; }
  .coins { min-width: 84px; padding: 6px 8px 6px 6px; gap: 6px; }
  .lens { width: 36px; height: 36px; }
  .lens i { left: 6px; top: 5px; width: 9px; height: 9px; }
}

html, body { overflow-x: hidden; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
