/* ============ PokéSurvivor — interfaz estilo Mundo Misterioso ============
 * Cajas azules con doble borde blanco, como los menús de PMD, y fuente pixel
 * local (Pixelify Sans, OFL).
 */
/* Pixelify Sans con los números redibujados para que no se confundan (tools/make_font.py). */
@font-face {
  font-family: 'Pixelify';
  src: url('../assets/fonts/PixelifyPS-400.ttf') format('truetype');
  font-weight: 400 550;
  font-display: block;
}
@font-face {
  font-family: 'Pixelify';
  src: url('../assets/fonts/PixelifyPS-700.ttf') format('truetype');
  font-weight: 551 900;
  font-display: block;
}

:root {
  --ink: #ffffff;
  --muted: #bdd6b8;
  --box1: #2f6b3f;
  --box2: #1d4a2b;
  --edge: #f2f7ec;
  --edge-in: #4f9c62;
  --edge-out: #0d2416;
  --gold: #ffd23f;
  --gold2: #f0a31e;
  --red: #ff5f6d;
  --green: #5fe08a;
  --shadow: #06160c;
  --r1: #9fb1c9; --r2: #5fe08a; --r3: #4fb4ff; --r4: #c47bff; --r5: #ffcb3d;
  --font: 'Pixelify', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: #04120a;
  color: var(--ink);
  font: 16px/1.35 var(--font);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: none;
}
canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
/* position: fixed + inset: 0 en vez de 100vw / 100vh: en iPhone (sobre todo
   abierto desde la pantalla de inicio) los vh no cuadraban con la ventana y el
   juego se veía estirado. */
#game { display: block; position: fixed; inset: 0; width: 100%; height: 100%; touch-action: none; }
button { font: inherit; color: inherit; }
input { font: inherit; }

/* ---------- capas de pantalla ---------- */
.scr {
  position: fixed; inset: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .2s ease-out;
}
.scr.hidden { display: none; }
/* Pantallas que se abren con la barra superior a la vista: empiezan debajo de ella. */
@media (min-height: 521px) {
  #scr-goals, #scr-dex, #scr-upgrades, #scr-gacha, #scr-friends, #scr-rank, #scr-lobby, #scr-profile { padding-top: 66px; }
}
.scr.dim { background: radial-gradient(circle at 50% 40%, rgba(12,38,22,.55), rgba(3,12,6,.88)); }
/* El modo «mirada» de la mochila: el juego sigue, así que se ve el fondo. */
#scr-pack.peek { background: linear-gradient(180deg, rgba(4,8,12,.35), rgba(4,8,12,.62)); padding: 10px; }
#scr-pack.peek .pack-box { max-height: 96vh; overflow: auto; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- caja PMD ---------- */
.box {
  position: relative;
  background: linear-gradient(180deg, var(--box1), var(--box2));
  border: 3px solid var(--edge);
  border-radius: 12px;
  box-shadow: 0 0 0 3px var(--edge-out), inset 0 0 0 2px var(--edge-in), 0 18px 50px rgba(0,0,0,.55);
  padding: 22px 24px;
  text-shadow: 2px 2px 0 var(--shadow);
  animation: pop .22s ease-out;
  max-height: 100%;
  overflow: auto;
}
.box h1, .box h2, .box h3 { margin: 0 0 6px; font-weight: 700; letter-spacing: .5px; }
/* ---------- el cuadrito del botín que tienes al lado (ui/loot-tip.js) ---------- */
.loot-tip {
  position: fixed; z-index: 12; pointer-events: none;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 9px;
  background: rgba(10,14,28,.9);
  border: 2px solid rgba(242,247,236,.3);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  color: #e6ecff; font-size: 12px; white-space: nowrap;
}
.loot-tip.hidden { display: none; }
.loot-tip .loot-ico { display: inline-flex; }
.loot-tip .loot-ico img { image-rendering: pixelated; }
.loot-tip .loot-name { font-weight: 700; }
.loot-tip .loot-name em { font-style: normal; color: #ffd23f; }
.loot-tip .loot-more { color: #8fa0c0; font-size: 11px; }
.loot-tip .loot-hint { color: #8fa0c0; font-size: 11px; border-left: 1px solid rgba(242,247,236,.2); padding-left: 6px; }

/* ---------- la pantalla del paquete (ui/loot-ui.js) ---------- */
.loot-box { width: min(420px, 100%); }
.loot-box h2 { margin-bottom: 4px; }
.loot-q { font-size: 15px; }
.loot-list { list-style: none; margin: 6px 0; padding: 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.loot-list li {
  padding: 4px 10px; font-size: 13px; color: var(--edge);
  background: rgba(10,26,16,.85); border: 2px solid rgba(242,247,236,.22); border-radius: 8px;
}
.loot-bar-wrap {
  height: 8px; margin: 8px 0; border-radius: 5px; overflow: hidden;
  background: rgba(0,0,0,.4); border: 1px solid rgba(242,247,236,.18);
}
.loot-bar-wrap i { display: block; height: 100%; width: 0; background: #ffd23f; transition: width .05s linear; }
.loot-btns { display: flex; gap: 8px; justify-content: center; margin-top: 8px; }
/* ---------- el almacén y el mercado negro (ui/xmode-ui.js) ---------- */
.pack-grid.stash-grid { grid-template-columns: repeat(5, 1fr); grid-template-rows: none; grid-auto-rows: 62px; }
.stash-grid .pack-item { cursor: pointer; }
.pack-sell {
  position: absolute; right: 2px; top: 2px;
  font-size: 9px; padding: 1px 4px; cursor: pointer;
  background: rgba(20,30,20,.92); color: #ffd23f;
  border: 1px solid #ffd23f; border-radius: 4px;
}
.pack-sell:hover { background: #ffd23f; color: #241a05; }
.market-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.market-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; text-align: left;
  background: rgba(255,252,233,.5); border: 2px solid #a9a37c; border-radius: 8px;
}
.market-row b { display: block; font-size: 14px; color: #3f3722; }
.market-row small { display: block; font-size: 11px; color: #6b6144; }
.market-row .btn { margin-left: auto; flex: 0 0 auto; }
.market-row .btn.off { opacity: .45; }
/* ---------- el teclado de la caja fuerte (ui/keypad-ui.js) ---------- */
.keypad-digits { font: 800 26px Pixelify, monospace; letter-spacing: 6px; margin: 10px 0 2px; color: #ffd23f; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 240px; margin: 8px auto 0; }
.keypad .key {
  padding: 9px 0; font: 800 15px Pixelify, monospace; cursor: pointer;
  background: rgba(10,26,16,.9); color: #e6ecff;
  border: 2px solid rgba(242,247,236,.25); border-radius: 8px;
}
.keypad .key:hover { background: rgba(30,60,40,.95); }
.keypad .key-del, .keypad .key-ok { font-size: 11px; color: #ffd23f; }
.box h2 { font-size: 26px; }
.box h3 { font-size: 18px; }
.sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.gold { color: var(--gold); }
.center { text-align: center; }

/* ---------- botones ---------- */
.btn {
  appearance: none; cursor: pointer;
  padding: 10px 20px;
  border: 3px solid var(--edge);
  border-radius: 9px;
  background: linear-gradient(180deg, #4f9c62, #2f6b3f);
  box-shadow: 0 0 0 2px var(--edge-out), 0 4px 0 var(--edge-out);
  font-size: 17px; font-weight: 700;
  text-shadow: 2px 2px 0 var(--shadow);
  transition: transform .06s, filter .12s;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 2px var(--edge-out), 0 2px 0 var(--edge-out); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; transform: none; }
.btn.gold {
  background: linear-gradient(180deg, #ffe37a, #f0a31e);
  color: #3a2300; text-shadow: 1px 1px 0 rgba(255,255,255,.4);
  border-color: #fff7d6;
}
.btn.ghost { background: transparent; box-shadow: none; border-color: rgba(242,247,236,.35); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }

/* Lista de menú con cursor (flecha pixel art), como en PMD */
.menu-list { display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  appearance: none; background: none; border: 0; cursor: pointer;
  text-align: left; padding: 8px 10px 8px 30px; border-radius: 6px;
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
  text-shadow: 2px 2px 0 var(--shadow);
  position: relative;
}
.menu-item small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.menu-item::before {
  content: ''; position: absolute; left: 6px; top: 14px; width: 16px; height: 24px;
  background: var(--ico-cursor) no-repeat center / contain; image-rendering: pixelated;
  opacity: 0; transition: opacity .1s, transform .1s; transform: translateX(-4px);
}
.menu-item:hover, .menu-item:focus-visible { background: rgba(255,255,255,.08); outline: none; }
.menu-item:hover::before, .menu-item:focus-visible::before { opacity: 1; transform: none; }
.menu-item.play { font-size: 30px; color: var(--gold); }
/* ---------- la pantalla de los DOS MODOS ---------- */
/* En el modo搜打撤 la barra de arriba es OTRA: sin tickets ni botones del
   modo normal (todo lo de ahí es otra economía, otra interfaz). */
body.mode-x #tickets-pill,
body.mode-x #btn-news,
body.mode-x #btn-yt,
body.mode-x #btn-support,
body.mode-x #btn-save { display: none; }
body.mode-x .credits-line { opacity: .75; }
.mode-pick .menu-list { gap: 10px; }
.menu-item.mode-big {
  grid-template-columns: 1fr;
  padding: 16px 16px;
  border: 2px solid rgba(255,255,255,.14); border-radius: 10px;
  background: rgba(255,255,255,.05);
}
.menu-item.mode-big b { grid-column: 1; display: block; font-size: 26px; }
.menu-item.mode-big small { grid-column: 1; display: block; font-size: 13px; margin-top: 3px; }
.menu-item.mode-big:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.3); }
.menu-item.mode-raid { border-color: rgba(216,72,63,.55); }
.menu-item.mode-raid b { color: #ffb0a0; }
.menu-item { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; align-items: center; }
.menu-item small { grid-column: 2; }
.mi-ico { grid-row: span 2; display: flex; }

/* ---------- formularios ---------- */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.tab {
  flex: 1; padding: 8px; cursor: pointer; border-radius: 8px;
  background: rgba(0,0,0,.2); border: 2px solid transparent;
  text-align: center; font-weight: 700;
}
.tab.on { border-color: var(--edge); background: rgba(255,255,255,.1); }
label { display: block; font-size: 14px; color: var(--muted); margin: 8px 0 4px; }
.field {
  width: 100%; padding: 10px 12px;
  background: #16351f; color: #fff;
  border: 2px solid var(--edge-in); border-radius: 8px;
  font-size: 17px; outline: none;
}
.field:focus { border-color: var(--edge); }
.err { color: #ffb0b8; min-height: 20px; font-size: 14px; margin: 8px 0 0; }
.note { color: var(--muted); font-size: 13px; margin-top: 14px; }

/* ---------- el modo搜打撤 (su propia pantalla: ui/xmode-ui.js) ---------- */
.xmode-box { width: min(560px, 100%); }
.xmode-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.xmode-head h2 { flex: 1; margin: 0; }
.xmode-coins { color: var(--gold); font-size: 18px; font-weight: 700; }
.xmode-play {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 12px 16px; margin-bottom: 10px; cursor: pointer; text-align: left;
  background: linear-gradient(180deg, #ffe37a, #f0a31e); color: #3a2300;
  border: 3px solid #fff7d6; border-radius: 10px;
  text-shadow: 1px 1px 0 rgba(255,255,255,.4);
}
.xmode-play b { font-size: 18px; }
.xmode-play small { font-size: 12px; color: #5a3a00; }
.xmode-play:hover { filter: brightness(1.06); }
.xmode-page { margin-top: 10px; }
.xmode-back { margin-bottom: 8px; }
.xmode-list-items {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
}
.xmode-list-items li {
  padding: 4px 8px; font-size: 12px; color: var(--edge);
  background: rgba(10,26,16,.9); border: 2px solid var(--q, #e8eef7); border-radius: 8px;
}

/* ---------- la mochila (modo搜打撤) ----------
 * Con los artes de assets/ui/ (papel vegetal con borde verde oscuro). */
.pack-box { width: min(560px, 100%); }
#scr-pack .pack-box {
  width: min(1120px, 100%);
  background: linear-gradient(180deg, #fdf8e6 0%, #ece2bb 100%);
  border-color: #5d6d4b;
  box-shadow: 0 0 0 3px #46543a, inset 0 0 0 2px #b9b185, 0 18px 50px rgba(0,0,0,.55);
  color: #3f3722; text-shadow: none;
}
#scr-pack .btn { color: #2f2a18; border-color: #5d6d4b; }
#scr-pack .note { color: #6b6144; }
.pack-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pack-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 22px; font-weight: 700; color: #3f3722;
}
.pack-title img { width: 26px; height: 26px; image-rendering: pixelated; }
.pack-title .pack-bolt { width: 22px; height: 22px; margin-left: -4px; }
.pack-sub { flex: 1; font-size: 13px; color: #6b6144; text-align: right; }
.pack-body { display: flex; gap: 12px; align-items: flex-start; }
.pack-left { flex: 0 0 424px; }
.pack-mid { flex: 1 1 auto; min-width: 0; }
.pack-right { flex: 0 0 214px; }
.pack-tip { margin-top: 8px; font-size: 12px; }
/* La versión que se está ejecutando (para saber si el navegador está viejo). */
.pack-build {
  font-size: 10px; color: #8a7f5e; letter-spacing: .5px;
  border: 1px solid rgba(93,109,75,.4); border-radius: 4px; padding: 0 4px; margin-left: 6px;
}
.pack-build-line { margin: 6px 0 0; font-size: 11px; }

/* La rejilla: 20 casillas con el arte de celda. */
.pack-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 76px);
  gap: 4px; padding: 8px;
  background: rgba(206, 191, 138, .45);
  border: 3px solid #5d6d4b;
  border-radius: 10px;
}
.pack-grid-small { grid-template-rows: repeat(2, 58px) !important; gap: 3px; padding: 5px; }
.pack-cell {
  background: url(../assets/ui/pack-cell.png) center / 100% 100% no-repeat;
  border: none; border-radius: 0;
}
/* El borde va con el color de la calidad del objeto. */
.pack-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255, 252, 233, .45);
  border: 3px solid var(--q, #8a8a5e);
  border-radius: 8px;
  cursor: grab; user-select: none; overflow: hidden; text-align: center;
  color: #3f3722;
}
.pack-item.dragging { opacity: .75; cursor: grabbing; }
/* El nombre de la cosa: se lee de un vistazo (letra grande, con sombra clara
   para que destaque sobre el fondo translúcido de la casilla). */
.pack-item span {
  font-size: 12px; font-weight: 700; color: #342e1c; line-height: 1.15;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.75);
}
.pack-item img { image-rendering: pixelated; }
.pack-ball-ico { width: 26px; height: 26px; }
.pack-gear-ico { width: 26px; height: 26px; }
/* La pieza que llevas cogida con un clic (para ponerla en un hueco). */
.pack-item.held { outline: 3px solid #d9a01e; box-shadow: 0 0 0 2px rgba(217,160,30,.45); }
/* La que acabas de coger: se marca en rojo y se ve cuántas casillas ocupa
   (como en三角洲). */
.pack-item.picked {
  background: rgba(216, 76, 76, .26);
  box-shadow: inset 0 0 0 2px #d6483f;
}
.pack-size {
  position: absolute; right: 2px; bottom: 1px;
  font-style: normal; font-size: 11px; font-weight: 700; line-height: 1.3;
  color: #6b6144; background: rgba(255,255,255,.6);
  padding: 0 3px; border-radius: 3px;
}
.pack-item.picked .pack-size { background: rgba(255,255,255,.8); color: #a5302a; }
/* Un Pokémon CAÍDO: se ve apagado y con el botón de revivir encima. */
.pack-item.dead { background: rgba(120,40,40,.2); }
.pack-item.dead span, .pack-stash-item.dead span { color: #8a3030; }
.pack-item.dead img { filter: grayscale(1) brightness(.75); }
.pack-revive {
  position: absolute; left: 2px; top: 2px; z-index: 2;
  background: rgba(95,224,138,.92); border: 2px solid #4e9c5a; border-radius: 6px;
  color: #1f4629; font-size: 10px; font-weight: 700; line-height: 1.1;
  padding: 2px 5px; cursor: pointer;
}
.pack-revive:hover { background: #7fe89a; }
.pack-stash-item .pack-revive { position: static; margin-left: auto; }
.pack-stash-item.dead { opacity: .9; }
/* ---------- la preparación («entrar en la partida») ---------- */
.prep-box { display: flex; flex-direction: column; gap: 10px; }
.prep-tabs { display: flex; gap: 6px; justify-content: center; }
.prep-tabs .tab, .prep-cats .tab {
  background: rgba(255,252,233,.5); border: 2px solid #5d6d4b; border-radius: 8px;
  color: #3f3722; font-size: 13px; font-weight: 700; padding: 6px 14px; cursor: pointer;
}
.prep-tabs .tab.on, .prep-cats .tab.on {
  color: #f3ffe8; border-color: #2f6b3f; background: rgba(47,107,63,.65);
}
/* La pestaña activa se ve a ojo: fondo oscuro y letra clara. */
.prep-tabs button.tab.on, .prep-cats button.tab.on {
  color: #ffffff; border-color: #1d4a29; background: rgba(24,62,36,.95);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.prep-cats { display: flex; gap: 6px; justify-content: center; margin-bottom: 6px; }
.prep-body { min-height: 330px; }
.prep-pane.hidden { display: none; }
#prep-bag { display: flex; gap: 14px; align-items: flex-start; }
.prep-bag-left { flex: 1 1 auto; min-width: 0; }
.prep-bag-right { flex: 0 0 268px; }
.prep-slots { display: flex; gap: 10px; justify-content: center; margin-bottom: 10px; }
.prep-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 190px; padding: 8px 14px;
  background: rgba(255,252,233,.5); border: 3px solid #5d6d4b; border-radius: 10px;
  color: #3f3722; cursor: pointer;
}
.prep-slot.on { border-color: #d9a01e; box-shadow: 0 0 0 2px rgba(217,160,30,.35); }
.prep-slot b { font-size: 13px; }
.prep-slot span { font-size: 15px; font-weight: 700; }
.prep-slot span.dim { color: #9a9070; font-weight: 400; }
/* La montura: la velocidad que da (debajo del nombre). */
.prep-slot em { font-style: normal; font-size: 11px; color: #9ae6ff; }
.prep-cands small { display: block; font-size: 11px; color: var(--muted); }
.prep-slot b { font-size: 13px; }
.prep-slot span { font-size: 15px; font-weight: 700; }
.prep-slot span.dim { color: #9a9070; font-weight: 400; }
.prep-cands {
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px;
}
.prep-tiers { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.prep-tiers .btn.tiny {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 3px 4px; font-size: 10px; line-height: 1.1;
}
.prep-tiers .btn.tiny img { image-rendering: pixelated; }
.prep-tiers .btn.tiny span { font-size: 10px; }
.prep-foot { margin-top: 10px; gap: 12px; }
.prep-foot .note { flex: 1 1 auto; margin: 0; }
/* Las filas de la tienda: con su icono y el texto un poco más grande. */
.market-info { display: flex; align-items: center; gap: 9px; flex: 1 1 auto; min-width: 0; }
.market-info b { display: block; font-size: 14px; }
.market-info small { display: block; font-size: 12px; color: var(--muted); }
.market-ico { flex: 0 0 auto; }
.market-ico img { image-rendering: pixelated; width: 22px; height: 22px; }
.market-row .btn { flex: 0 0 auto; }
.btn.tiny { padding: 3px 6px; font-size: 11px; line-height: 1.1; }
/* La colección del modo搜打撤: los mismos filtros que la del normal. */
#scr-xdex .grid { max-height: 460px; overflow-y: auto; }

/* El panel de al lado: lo que acabas de coger. */
.pack-picked {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(95,110,75,.35);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.pack-picked.hidden { display: none; }
.pack-picked-ico { flex: 0 0 auto; width: 34px; text-align: center; }
.pack-picked-ico img { image-rendering: pixelated; width: 30px; height: 30px; }
.pack-picked-txt { flex: 1 1 auto; min-width: 0; }
.pack-picked-txt b { display: block; font-size: 15px; color: #342e1c; }
.pack-picked-meta { display: block; font-size: 12px; color: #5b5236; }
.pack-picked-q { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 3px; }
.pack-picked-txt p { margin: 2px 0 0; font-size: 12px; color: #3f3722; }
.pack-picked-tag { flex: 0 0 auto; font-size: 10px; color: #7d7355; letter-spacing: .06em; }
/* Las medicinas NO se usan en la mochila: se avisa de dónde sí (la rueda). */
.pack-use-hint {
  flex: 0 0 auto; align-self: center; max-width: 190px;
  background: rgba(95,224,138,.18); border: 2px dashed #4e9c5a; border-radius: 8px;
  color: #2f5c39; font-size: 11px; font-weight: 700; padding: 5px 9px; text-align: center;
}
/* ---------- la bandeja: lo que está por identificar ---------- */
.pack-pending {
  background: rgba(120,40,40,.16);
  border: 1px solid rgba(150,60,60,.45);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 8px;
}
.pack-pending.hidden { display: none; }
.pack-pending-h {
  font-size: 11px; font-weight: 700; color: #8a3030;
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.pack-search-bar {
  flex: 1 1 auto; max-width: 180px; height: 6px; border-radius: 3px;
  background: rgba(0,0,0,.25); overflow: hidden; display: inline-block;
}
.pack-search-bar i { display: block; height: 100%; background: #d6483f; }
.pack-pending-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pack-pending-item {
  position: relative;
  width: 92px; min-height: 74px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255,252,233,.5);
  border: 2px dashed rgba(150,90,80,.6);
  border-radius: 8px; padding: 4px; text-align: center;
  color: #3f3722; cursor: default; user-select: none;
}
.pack-pending-item.busy { border-style: solid; border-color: rgba(120,90,80,.35); }
.pack-pending-item.done { border-style: solid; border-color: #b9b185; cursor: grab; }
.pack-pending-item.done:hover { background: rgba(255,255,255,.6); }
.pack-pending-item.dragging { opacity: .6; }
.pack-pending-item b { font-size: 12px; line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-pending-ico img { image-rendering: pixelated; width: 26px; height: 26px; }
.pack-pending-q { width: 8px; height: 8px; border-radius: 2px; }
.pack-pending-size { font-size: 9px; color: #6b6144; }
.pack-pending-lens { display: inline-block; animation: pack-spin 1.1s linear infinite; }
.pack-pending-lens img { image-rendering: pixelated; width: 26px; height: 26px; opacity: .9; }
.pack-pending-left { font-size: 10px; color: #8a3030; font-weight: 700; }
.pack-pending-bar {
  display: block; width: 100%; height: 5px; margin-top: 4px;
  background: rgba(0,0,0,.25); border-radius: 3px; overflow: hidden;
}
.pack-pending-bar b { display: block; height: 100%; background: #d6483f; }
@keyframes pack-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* El fantasma que sigue al puntero al arrastrar desde la bandeja. */
.pack-ghost {
  position: fixed; z-index: 60; width: 48px; height: 48px;
  pointer-events: none; opacity: .85; transform: translate(-50%, -50%);
  background: rgba(255,252,233,.6); border: 2px solid #b9b185; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}
.pack-ghost.bad { border-color: #d6483f; background: rgba(216,72,63,.25); }
/* Las casillas donde caería la cosa que arrastras. */
.pack-cell.pack-fit { background: rgba(95,224,138,.45); box-shadow: inset 0 0 0 2px #5fe08a; }
.pack-cell.pack-nofit { background: rgba(216,72,63,.4); box-shadow: inset 0 0 0 2px #d6483f; }
.q-comun  { --q: #b9b185; }
.q-buena  { --q: #4e9c5a; }
.q-rara   { --q: #3f7fd0; }
.q-epica  { --q: #8a45c8; }
.q-legend { --q: #d9a01e; }
.pack-tabs { display: flex; gap: 6px; justify-content: center; margin: 0 0 10px; }
.pack-tabs .tab {
  padding: 6px 14px; font-size: 13px; color: var(--muted);
  background: rgba(0,0,0,.3); border: 2px solid rgba(242,247,236,.22);
  border-radius: 8px; cursor: pointer;
}
.pack-tabs .tab.on { color: var(--edge); border-color: var(--edge); background: rgba(47,107,63,.65); }
.pack-stash {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-top: 6px; min-height: 34px;
}
/* ---------- la pantalla del仓库: equipo a la izquierda, almacén a la derecha ---------- */
.warehouse-box { width: min(1000px, 100%); }
.warehouse-cols {
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap;
}
.warehouse-left { flex: 1 1 340px; min-width: 0; }
.warehouse-right { flex: 1 1 540px; min-width: 0; }
/* Las dos columnas se pueden desplazar si no caben (la caja fuerte va abajo). */
.warehouse-cols { max-height: calc(100dvh - 200px); overflow-y: auto; padding-right: 4px; }
/* El仓库 grande (ocho columnas, celdas pequeñas) y las cabeceras del mercado. */
.stash-grid { gap: 3px; padding: 5px; background: rgba(206,191,138,.45); }
/* Las celdas del仓库 se pintan como las de la mochila (mismo tono). */
.stash-grid .pack-cell { background-color: rgba(255,252,233,.35); }
.stash-grid .pack-item { border-width: 2px; }
.stash-grid .pack-item span { font-size: 10px; }
.stash-grid .pack-item img { width: 20px; height: 20px; }
.stash-grid .pack-size { font-size: 9px; }
.stash-grid .pack-ball-ico { width: 20px; height: 20px; }
.market-h { margin: 12px 0 6px; font-size: 14px; color: #3f3722; font-weight: 700; }
/* Una oferta: el precio viejo va tachado. */
.market-row.deal .btn s { opacity: .55; margin-right: 5px; }
.warehouse-h {
  font-size: 13px; color: #3f3722; font-weight: 700; margin: 0 0 6px;
  display: flex; align-items: baseline; gap: 8px;
}
.warehouse-h small { color: #6b6144; font-weight: 400; }
.warehouse-right .pack-stash { justify-content: flex-start; }
.pack-stash-item {
  position: relative;
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px;
  background: rgba(10,26,16,.9); border: 3px solid var(--q, #e8eef7); border-radius: 8px;
  color: var(--edge); font-size: 12px; cursor: pointer;
}
.pack-stash-item:hover { background: rgba(22,54,32,.95); }
.pack-stash-item img { image-rendering: pixelated; }
.pack-stash-item.dragging { opacity: .6; }
.pack-stash button {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px;
  background: rgba(10,26,16,.9); border: 3px solid var(--q, #e8eef7); border-radius: 8px;
  color: var(--edge); font-size: 12px; cursor: pointer;
}
.pack-stash button:hover { background: rgba(22,54,32,.95); }
.pack-stash button img { image-rendering: pixelated; }
.pack-bar {
  display: inline-block; width: 110px; height: 8px;
  background: rgba(60, 52, 26, .25); border: 2px solid rgba(60, 52, 26, .35);
  border-radius: 6px; vertical-align: middle; overflow: hidden;
}
.pack-bar i { display: block; height: 100%; background: #6f8a3f; }
.pack-pct { color: #6f8a3f; }

/* ---------- las esferas en la mochila ---------- */
.pack-appraise {
  margin-top: 3px; padding: 2px 6px; font-size: 10px; cursor: pointer;
  background: rgba(255,252,233,.95); color: #3f3722;
  border: 2px solid #5d6d4b; border-radius: 6px;
}
.pack-appraise:hover { background: #fff; }
.pack-appraise-bar {
  display: block; height: 4px; width: 0; margin-top: 3px;
  background: #d9a01e; border-radius: 3px; transition: width .05s linear;
}
.pack-ball-tier { font-size: 11px; font-weight: 700; color: #5c7433; }

/* ---------- la página de Pokémon (columna izquierda) ----------
 * Como en el ejemplo de排版: dos tarjetas (principal y suplente). Cada una
 * tiene la barra de arriba (el icono de la esfera + nombre/nivel/atributo),
 * los tres huecos de carried item ENCIMA de la cabeza, el hueco de la立绘 y
 * la底座 (el óvalo) debajo. */
.pack-left { flex: 0 0 424px; display: flex; flex-direction: column; gap: 8px; }
.pack-left.hidden { display: none; }
.pack-teams { display: flex; gap: 10px; align-items: flex-start; }
.pack-card {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; gap: 5px;
  padding: 7px 7px 0;
  background: rgba(255,252,233,.5);
  border: 3px solid #5d6d4b; border-radius: 10px;
}
.pack-card.on { border-color: #d9a01e; box-shadow: 0 0 0 2px rgba(217,160,30,.35); }
.pack-card.empty { opacity: .85; }
.pack-card-bar {
  display: flex; align-items: center; gap: 5px;
  background: url(../assets/ui/pack-panel.png) center / 100% 100% no-repeat;
  padding: 4px 8px; min-height: 38px;
}
.pack-card-ball { width: 22px; height: 22px; image-rendering: pixelated; flex: 0 0 auto; }
.pack-card-bar b {
  font-size: 15px; color: #342e1c;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-card-bar b.dim { color: #9a9070; }
.pack-card-lv { font-size: 12px; font-weight: 700; color: #5b5236; flex: 0 0 auto; }
.pack-card-types { display: inline-flex; gap: 3px; margin-left: auto; flex: 0 0 auto; }
/* El atributo, como un punto de color (el texto no cabe en la tarjeta). */
.pack-card-types i {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  border: 1px solid rgba(0,0,0,.35);
}
/* Los tres huecos de pieza: van ENCIMA de la cabeza. */
.pack-card-slots { display: flex; gap: 5px; justify-content: center; }
.pack-gear-slot {
  position: relative; flex: 1; max-width: 58px; aspect-ratio: 1 / 1.05;
  background: url(../assets/ui/pack-item-slot.png) center / 100% 100% no-repeat;
  display: flex; align-items: flex-end; justify-content: center;
  cursor: pointer; overflow: hidden;
}
.pack-gear-slot.on { box-shadow: 0 0 0 2px #d9a01e; border-radius: 6px; }
/* La barra de DURABILIDAD de la pieza (se gasta con los golpes). */
.pack-dur {
  position: absolute; left: 3px; right: 3px; bottom: 12px; height: 3px;
  background: #6f8a3f; border-radius: 2px; display: block;
}
.pack-dur.low { background: #ff5f6d; }
/* El arte del hueco va de fondo y el nombre encima: si no, la imagen (que es
   de 120 px) empuja la etiqueta fuera del hueco y no se ve nada. */
.pack-gear-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.pack-gear-slot b {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-size: 10px; line-height: 1.1; color: #342e1c; text-align: center;
  background: rgba(255,252,233,.92); padding: 1px 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pack-card-stage {
  position: relative; flex: 1; min-height: 172px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,252,233,.35);
  border: 3px solid #a9a37c; border-radius: 22px;
  cursor: pointer;
}
.pack-card-cv { image-rendering: pixelated; width: 168px; height: 168px; }
/* La barra de vida, justo encima de la cabeza del Pokémon. */
.pack-card-hpbar {
  position: relative; align-self: center; width: 76%; max-width: 152px; height: 16px;
  background: rgba(24,21,14,.78); border: 2px solid #2b2618; border-radius: 9px;
  overflow: hidden; display: flex; align-items: center; margin: -2px 0;
}
.pack-card-hpbar i {
  display: block; height: 100%;
  background: linear-gradient(180deg, #86e692, #3f9c50);
}
.pack-card-hpbar.low i { background: linear-gradient(180deg, #ffd166, #d9822b); }
.pack-card-hpbar.empty i { background: #7a2626; }
.pack-card-hpbar span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.95);
}
.pack-card-base {
  height: 40px;
  background: url(../assets/ui/pack-base-l.png) center bottom / 100% 100% no-repeat;
}
.pack-panel {
  background: rgba(255,252,233,.5);
  border: 3px solid #5d6d4b; border-radius: 10px;
  padding: 8px; display: flex; flex-direction: column; gap: 6px;
}
.pack-panel-bar {
  display: flex; align-items: center; gap: 7px;
  background: url(../assets/ui/pack-panel.png) center / 100% 100% no-repeat;
  padding: 6px 10px; min-height: 40px;
}
.pack-panel-bar b { font-size: 15px; color: #3f3722; }
.pack-panel-ball { width: 24px; height: 24px; image-rendering: pixelated; }
.pack-panel-lv { font-size: 11px; color: #6b6144; }
.pack-panel-types { display: inline-flex; gap: 3px; }
.pack-panel-items { display: flex; gap: 6px; justify-content: center; }
.pack-item-slot {
  flex: 1; max-width: 62px; aspect-ratio: 1 / 1.05;
  background: url(../assets/ui/pack-item-slot.png) center / 100% 100% no-repeat;
}
.pack-panel-stage {
  position: relative; height: 186px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,252,233,.35);
  border: 3px solid #a9a37c; border-radius: 26px;
}
.pack-card-cv { image-rendering: pixelated; width: 168px; height: 168px; }
.pack-panel-base {
  height: 46px;
  background: url(../assets/ui/pack-base-l.png) center bottom / 100% 100% no-repeat;
}
.pack-card-empty { color: #6b6144; font-size: 12px; text-align: center; margin-top: 16px; }

/* ---------- el panel del entrenador (columna derecha) ---------- */
.pack-right { flex: 0 0 214px; display: flex; flex-direction: column; gap: 8px; }
.pack-trainer-cv { image-rendering: pixelated; width: 168px; height: 168px; }
.pack-safe { margin-top: 0; }
.pack-safe-h { font-size: 12px; color: #3f3722; font-weight: 700; margin-bottom: 4px; }
.pack-safe-h small { color: #6b6144; font-weight: 400; }

/* ---------- la franja de abajo: 六维图 + 技能列表 + 特性 + HP/性格 ---------- */
.pack-detail {
  display: grid; grid-template-columns: 240px 1fr; grid-template-rows: auto auto;
  gap: 8px; margin-top: 10px;
}
.pack-detail.hidden { display: none; }
.pack-stats {
  grid-row: 1; grid-column: 1;
  background: rgba(255,252,233,.4); border: 3px solid #a9a37c; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; padding: 4px;
}
.pack-stats-cv { image-rendering: pixelated; width: 230px; height: 200px; }
.pack-skills {
  grid-row: 1; grid-column: 2;
  background: url(../assets/ui/pack-panel.png) center / 100% 100% no-repeat;
  padding: 8px 12px;
}
.pack-skills h4 { margin: 0 0 4px; font-size: 13px; color: #3f3722; }
.pack-skill {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: #3f3722;
  background: rgba(255,252,233,.5); border: 2px solid #a9a37c; border-radius: 5px;
  padding: 3px 7px; margin-bottom: 3px;
}
.pack-skill b { flex: 0 0 92px; }
.pack-skill span { flex: 1; color: #6b6144; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-skill i { font-style: normal; font-size: 12px; color: #3f3722; flex: 0 0 auto; }
.pack-skill.dim { color: #9a9070; }
.pack-abilinfo {
  grid-row: 2; grid-column: 1;
  background: rgba(255,252,233,.4); border: 3px solid #a9a37c; border-radius: 10px;
  padding: 7px 11px; font-size: 12px; color: #3f3722;
}
.pack-abilinfo b { display: block; margin-bottom: 3px; }
.pack-abilinfo p { margin: 0; color: #5b5236; font-size: 12px; }
.pack-vitals {
  grid-row: 2; grid-column: 2;
  background: rgba(255,252,233,.4); border: 3px solid #a9a37c; border-radius: 10px;
  padding: 7px 11px; display: flex; flex-direction: column; gap: 4px;
}
.pack-card-hp { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b6144; }
.pack-card-hp-t { flex: 0 0 auto; }
.pack-card-hp-bar {
  flex: 1; height: 11px; background: url(../assets/ui/pack-hp-empty.png) center / 100% 100% no-repeat;
}
.pack-card-hp-bar i { display: block; height: 100%; background: url(../assets/ui/pack-hp.png) center / 100% 100% no-repeat; }
.pack-card-hp-n { color: #3f3722; }
.pack-card-nat { display: flex; gap: 7px; font-size: 12px; }
.pack-card-nat i { color: #5b5236; font-style: normal; flex: 0 0 52px; }
.pack-card-nat span { color: #342e1c; }
.pack-card-nat em { font-style: normal; color: #4e9c5a; }
/* En pantallas estrechas (móvil en horizontal) las tres columnas se apilan. */
@media (max-width: 900px) {
  .pack-body { flex-direction: column; }
  .pack-left, .pack-right { flex: 0 0 auto; width: 100%; }
  .pack-panel-stage { height: 160px; }
  .pack-detail { grid-template-columns: 1fr; }
  .pack-stats, .pack-skills, .pack-abilinfo, .pack-vitals { grid-row: auto; grid-column: 1; }
}
/* ---------- el mapa (modo搜打撤, tecla M) ---------- */
.map-box { width: min(760px, 100%); }
.map-box canvas {
  display: block; width: 100%; height: auto; image-rendering: pixelated;
  background: #0b0d12; border: 2px solid rgba(214,226,244,.28);
  border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.55);
}
.map-tip { margin-top: 10px; }
.map-box .pack-sub { color: var(--muted); font-size: 13px; }

/* ---------- pantalla de inicio ---------- */
.logo { text-align: center; margin-bottom: 18px; }
.logo .t1 {
  font-size: 46px; font-weight: 700; line-height: 1; color: var(--gold); letter-spacing: .04em;
  /* Contorno duro de 1 p铆xel (8 direcciones) + sombra: el logo se lee como logo de p铆xel. */
  text-shadow:
    -.045em 0 0 var(--edge-out), .045em 0 0 var(--edge-out),
    0 -.045em 0 var(--edge-out), 0 .045em 0 var(--edge-out),
    -.045em -.045em 0 var(--edge-out), .045em -.045em 0 var(--edge-out),
    -.045em .045em 0 var(--edge-out), .045em .045em 0 var(--edge-out),
    .1em .13em 0 rgba(6,22,12,.85);
  animation: logo-glow 3s ease-in-out infinite alternate;
}
@keyframes logo-glow {
  from { filter: drop-shadow(0 3px 7px rgba(0,0,0,.65)) drop-shadow(0 0 0 rgba(255,210,63,0)); }
  to   { filter: drop-shadow(0 3px 7px rgba(0,0,0,.65)) drop-shadow(0 0 13px rgba(255,210,63,.5)); }
}
/* El escudo «Poke Raid» (assets/ui/logo.png). */
.logo .logo-img {
  display: block; margin: 0 auto; height: auto;
  width: min(330px, 84%);
  animation: logo-glow 3s ease-in-out infinite alternate;
}
.menu-left .logo .logo-mark { position: relative; font-size: 0; }
.menu-left .logo .logo-img { width: min(310px, 88%); }
.boot-in .logo-img { width: min(400px, 72%); margin-bottom: 10px; }
.tapstart .boot-in .logo-img { width: min(360px, 64%); }
@media (prefers-reduced-motion: reduce) { .logo .logo-img { animation: none; } }
@media (prefers-reduced-motion: reduce) { .logo .t1 { animation: none; } }
.logo .t2 { font-size: 17px; color: var(--edge); margin-top: 8px; letter-spacing: 4px;
  text-shadow: 2px 2px 0 var(--shadow); }

/* ---------- test de personalidad ---------- */
.test-box { width: min(620px, 100%); }
.progress { height: 8px; background: rgba(0,0,0,.35); border-radius: 8px; overflow: hidden; margin-bottom: 18px; }
.progress i { display: block; height: 100%; background: var(--gold); transition: width .25s; }
.q { font-size: 22px; margin: 0 0 16px; min-height: 2.6em; }
.answers { display: flex; flex-direction: column; gap: 8px; }
.answer {
  appearance: none; text-align: left; cursor: pointer;
  padding: 12px 16px 12px 34px; position: relative;
  background: rgba(0,0,0,.18); border: 2px solid rgba(242,247,236,.25); border-radius: 9px;
  font-size: 17px; text-shadow: 2px 2px 0 var(--shadow);
}
.answer::before {
  content: ''; position: absolute; left: 10px; top: 50%; width: 12px; height: 18px; margin-top: -9px;
  background: var(--ico-cursor) no-repeat center / contain; image-rendering: pixelated; opacity: 0;
}
.answer:hover { background: rgba(255,255,255,.1); border-color: var(--edge); }
.answer:hover::before { opacity: 1; }

.result { width: min(560px, 100%); text-align: center; }
.result .trait { font-size: 30px; color: var(--gold); margin: 4px 0; }
.stage {
  display: block; margin: 8px auto 6px;
  /* Recuadro estilo PMD: fondo oscuro y borde del color del tipo (--stage-c). */
  background:
    radial-gradient(ellipse at 50% 88%, rgba(120,170,255,.22), transparent 60%),
    linear-gradient(180deg, rgba(20,36,78,.88), rgba(8,14,34,.92));
  border: 3px solid var(--stage-c, #4f9c62);
  border-radius: 14px;
  box-shadow: 0 0 0 3px #0d2416, 0 10px 30px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.06);
}
.stage.shiny { box-shadow: 0 0 0 3px #0d2416, 0 0 22px rgba(154,230,255,.55), inset 0 0 0 2px rgba(255,255,255,.08); }

/* ---------- rejilla de Pokémon ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px; max-height: 56vh; overflow-y: auto; padding: 4px;
}
.cell {
  position: relative; cursor: pointer; text-align: center;
  background: rgba(0,0,0,.2); border: 2px solid rgba(242,247,236,.18); border-radius: 10px;
  padding: 4px 2px 6px; transition: transform .08s, border-color .12s, background .12s;
}
.cell:hover { transform: translateY(-2px); border-color: var(--edge); background: rgba(255,255,255,.08); }
.cell.on { border-color: var(--gold); background: rgba(255,210,63,.14); }
.cell.locked { cursor: default; opacity: .75; }
.cell.locked:hover { transform: none; border-color: rgba(242,247,236,.18); }
.cell canvas { display: block; margin: 0 auto; }
.cell b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .no { position: absolute; top: 3px; left: 6px; font-size: 11px; color: var(--muted); }
.cell .stars { font-size: 10px; letter-spacing: -1px; }
.cell .partner { position: absolute; top: 3px; right: 5px; font-size: 12px; }

.wide { width: min(980px, 100%); }
.split { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
.panel {
  background: rgba(0,0,0,.2); border: 2px solid rgba(242,247,236,.2); border-radius: 10px; padding: 14px;
}
.stat { display: grid; grid-template-columns: 90px 1fr 34px; gap: 8px; align-items: center; font-size: 14px; margin: 5px 0; }
.stat .bar { height: 8px; background: rgba(0,0,0,.35); border-radius: 6px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--gold); }
/* Naturaleza (20-10-2026): el stat que sube en verde y el que baja en rojo. */
.stat.nat-up > span:first-child, .stat.nat-up > span:last-child { color: #7fe8a0; }
.stat.nat-up .bar i { background: #5fe08a; }
.stat.nat-down > span:first-child, .stat.nat-down > span:last-child { color: #ff9aa5; }
.stat.nat-down .bar i { background: #ff7a86; }
/* Naturaleza, habilidad y MT en la ficha de la colección. */
.mon-extra { margin: 10px 0 4px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.18); font-size: 14px; }
.mon-extra .mx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0; }
.mon-extra .mx-row > span:first-child { color: var(--muted); min-width: 84px; }
.mon-extra .mx-row small { color: var(--muted); }
.mon-extra .mx-row .btn { margin-left: auto; }
.mon-extra .mx-row .btn + .btn { margin-left: 0; }
.mon-extra .mx-desc { margin: 0 0 6px; font-size: 13px; }
.mon-extra .ban-picker { margin-top: 6px; }
.type {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 700;
  color: #10131a; text-shadow: none; margin-right: 4px;
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.dex-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.dex-tools input, .dex-tools select { background: rgba(0,0,0,.3); color: inherit; border: 2px solid rgba(242,247,236,.3); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 14px; }
.dex-tools input { flex: 1 1 180px; min-width: 0; }
.dex-tools select option { background: #16351f; }
.dex-sort { align-items: center; margin-top: -4px; }
.dex-more { grid-column: 1 / -1; height: 1px; }
.fit-low { display: block; color: #ffb37a; font-size: 12px; margin-top: 2px; }
/* Pausa con el resumen de la partida (run-ui.js, pauseSummary). */
.pause-box { width: min(720px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; }
.pause-sum { text-align: left; margin: 4px 0 10px; }
.pause-sum h3 { color: var(--gold); font-size: 16px; margin: 10px 0 6px; }
.sum-moves { width: 100%; border-collapse: collapse; font-size: 14px; }
.sum-moves td, .sum-moves th { padding: 3px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sum-moves th { font-size: 12px; color: var(--muted); font-weight: 400; }
.sum-moves .num { text-align: right; white-space: nowrap; }
.sum-moves img { vertical-align: -4px; }
.sum-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 14px; font-size: 14px; }
.sum-stats div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid rgba(255,255,255,.08); padding: 2px 0; }
.sum-stats span { color: var(--muted); }
.sum-stats small { color: var(--muted); font-weight: 400; }
.dex-sort .sub { margin: 0 2px 0 0; font-size: 13px; }
.chip {
  appearance: none; cursor: pointer; padding: 4px 10px; border-radius: 20px;
  background: rgba(0,0,0,.25); border: 2px solid rgba(242,247,236,.25); font-size: 13px;
  text-shadow: 1px 1px 0 var(--shadow);
}
.chip.on { border-color: var(--gold); color: var(--gold); }

/* ---------- menú principal ---------- */
#scr-menu { justify-content: space-between; align-items: stretch; padding: 0; }
.menu-left {
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 30px; min-width: 0;
}
.menu-left .logo .t1 { font-size: clamp(36px, 6vw, 64px); }
/* Frase amarilla torcida en la esquina del título, como las de Minecraft. */
.menu-left .logo .t1 { position: relative; }
.splash {
  position: absolute; right: 0; top: 82%; width: max-content; max-width: 14em;
  font-size: clamp(10px, 1.2vw, 15px); font-weight: 700; line-height: 1.15; letter-spacing: 0;
  color: #ffff40; text-shadow: 2px 2px 0 #16351f; pointer-events: none; z-index: 3;
  transform: translateX(62%) rotate(-14deg); animation: splash-pulse .9s ease-in-out infinite alternate;
}
@keyframes splash-pulse {
  from { transform: translateX(62%) rotate(-14deg) scale(.94); }
  to { transform: translateX(62%) rotate(-14deg) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .splash { animation: none; } }
.partner-card { text-align: center; margin-top: 10px; }
.partner-card .nm { font-size: 24px; font-weight: 700; text-shadow: 3px 3px 0 var(--shadow); }
.partner-card .lv { color: var(--muted); font-size: 14px; text-shadow: 2px 2px 0 var(--shadow); }
.menu-right {
  width: min(380px, 100%); display: flex; flex-direction: column;
  /* Arriba deja sitio a la barra superior; si no cabe todo, se desplaza
     (los márgenes auto lo centran sin que se salga por arriba). */
  padding: 70px 24px 18px; gap: 14px; overflow-y: auto;
  background: linear-gradient(90deg, transparent, rgba(5,10,25,.65) 30%);
}
.menu-right > :first-child { margin-top: auto; }
.menu-right > :last-child { margin-bottom: auto; }
/* Portátiles con poca altura: menú más compacto y, si hace falta, en dos columnas. */
@media (max-height: 780px) and (min-height: 521px) {
  .menu-right { padding-top: 62px; gap: 10px; }
  .menu-right .box { padding: 10px 14px; }
  .menu-item { font-size: 17px; padding: 5px 10px; }
  .menu-item.play { font-size: 24px; }
  .menu-item small { font-size: 11px; }
}
@media (max-height: 660px) and (min-height: 521px) {
  .menu-right { width: min(500px, 52vw); }
  .menu-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
  .menu-item.play { grid-column: span 2; }
  .menu-item small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-left .logo .t1 { font-size: clamp(32px, 5vw, 52px); }
  #menu-partner { height: min(30vh, 200px); width: auto; }
}
.topbar {
  position: fixed; top: 14px; right: 16px; z-index: 25;
  display: flex; gap: 10px; align-items: center;
}
.pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 30px;
  background: rgba(10,30,16,.85); border: 2px solid var(--edge);
  box-shadow: 0 0 0 2px var(--edge-out);
  font-weight: 700; text-shadow: 2px 2px 0 var(--shadow);
}
.coin {
  display: inline-block; width: 18px; height: 18px; vertical-align: -3px;
  background: var(--ico-coin) no-repeat center / contain; image-rendering: pixelated;
}
.credits-line {
  position: fixed; left: 14px; bottom: 10px; z-index: 25; font-size: 12px; color: rgba(185,203,240,.7);
  text-shadow: 1px 1px 0 #000;
}

/* ---------- mejoras ---------- */
.upg { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.upg-item { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; }
.upg-item .ic { font-size: 26px; text-align: center; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 12px; height: 6px; border-radius: 2px; background: rgba(0,0,0,.4); }
.pips i.on { background: var(--gold); }

/* ---------- gacha ---------- */
.banner {
  position: relative; border-radius: 12px; overflow: hidden;
  background:
    radial-gradient(circle at 80% 30%, rgba(255,210,63,.35), transparent 45%),
    radial-gradient(circle at 15% 80%, rgba(196,123,255,.35), transparent 50%),
    linear-gradient(135deg, #3a1d6e, #1b2f78 55%, #0f4d6e);
  border: 2px solid rgba(242,247,236,.4);
  padding: 18px;
}
.banner h3 { font-size: 28px; color: var(--gold); text-shadow: 3px 3px 0 #2a0f55; }
.banner .feat {
  /* Debajo del texto, nunca encima: los legendarios a ×2 son grandes. */
  display: flex; align-items: flex-end; justify-content: center; gap: 6px;
  margin: 8px -10px -18px; height: 190px; overflow: hidden;
}
.banner .feat canvas { flex: 0 0 auto; }
.rates { font-size: 14px; }
.rates div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dashed rgba(242,247,236,.15); }

#pull-fx {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  align-items: center; gap: 18px; padding: 14px 10px;
  /* Si las 10 cartas no caben (móvil en horizontal) se puede desplazar, y
     "Continuar" se queda siempre a la vista abajo (antes quedaba fuera y no
     había forma de cerrar sin recargar la página). */
  overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(circle at 50% 45%, #1d4a2b, #04120a 70%);
}
/* Centrado vertical que no corta por arriba cuando no cabe. */
#pull-fx::before, #pull-fx::after { content: ''; margin: auto; }
#pull-close, #pull-skip { position: sticky; bottom: 8px; z-index: 2; flex-shrink: 0; box-shadow: 0 4px 18px rgba(0,0,0,.6); }
/* La ×100: cartas más pequeñas y un resumen arriba. */
.pull-results.many { gap: 6px; max-width: 1100px; }
.pull-results.many .pcard { width: 104px; padding: 5px 3px; border-radius: 10px; border-width: 2px; box-shadow: 0 0 10px var(--rc, #fff); }
.pull-results.many .pcard canvas { width: 88px; height: auto; }
.pull-results.many .pcard b { font-size: 12px; }
.pull-results.many .pcard .tag { font-size: 10px; }
.pull-results.many .pcard .stars { font-size: 11px; }
.pull-sum { flex: 0 0 100%; text-align: center; font-size: 16px; color: var(--gold); }
@media (max-height: 520px) {
  #pull-fx { gap: 10px; }
  .pull-results { gap: 6px; }
  .pcard { width: 100px; padding: 5px 3px; border-radius: 10px; }
  .pcard canvas { width: 84px; height: auto; }
  .pcard b { font-size: 12px; }
  .pcard .tag { font-size: 10px; }
  .pcard .stars { font-size: 11px; }
}
#pull-fx.hidden { display: none; }
.ball {
  width: 120px; height: 120px; border-radius: 50%; position: relative;
  background: linear-gradient(180deg, #ff4d4d 0 47%, #1a1a1a 47% 53%, #f4f4f4 53% 100%);
  border: 5px solid #1a1a1a;
  box-shadow: 0 0 0 0 var(--glow, #fff);
}
.ball::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: #f4f4f4; border: 5px solid #1a1a1a;
}
.ball.drop { animation: drop .55s cubic-bezier(.3,1.6,.6,1) both; }
.ball.shake { animation: shake .45s ease-in-out 3; }
.ball.burst { animation: burst .45s ease-out forwards; }
@keyframes drop { from { transform: translateY(-60vh) rotate(-200deg); } to { transform: none; } }
@keyframes shake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-18deg); } 75% { transform: rotate(18deg); } }
@keyframes burst {
  0% { box-shadow: 0 0 0 0 var(--glow); }
  60% { box-shadow: 0 0 80px 40px var(--glow); transform: scale(1.15); }
  100% { box-shadow: 0 0 200px 120px transparent; transform: scale(0); opacity: 0; }
}
/* Mensaje de apoyo al acabar una partida (run-ui.js). */
.support-ask { position: relative; margin-top: 4px; padding: 10px 34px 12px 12px; border-radius: 10px; text-align: center;
  background: rgba(255,210,63,.08); border: 2px solid rgba(255,210,63,.45); }
.support-ask p { margin: 0 0 8px; font-size: 13px; color: var(--ink); line-height: 1.35; }
.support-ask .btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.support-ask .x { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 2px 6px; }
.pull-results { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 900px; }
.iris-get { flex: 0 0 100%; box-sizing: border-box; display: flex; justify-content: center; gap: 12px; align-items: center; text-align: left; padding: 10px 14px;
  border: 2px solid var(--gold); border-radius: 12px; background: rgba(255,210,63,.12); animation: pop .5s ease-out; }
.iris-get b { color: var(--gold); font-size: 16px; }
.pcard {
  width: 150px; padding: 10px 6px; text-align: center; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.1), rgba(0,0,0,.3));
  border: 3px solid var(--rc, #fff);
  box-shadow: 0 0 22px var(--rc, #fff);
  animation: pop .3s ease-out both;
  text-shadow: 2px 2px 0 var(--shadow);
}
.pcard .stars { color: var(--rc); font-size: 14px; }
.pcard b { display: block; font-size: 16px; }
.pcard .tag { font-size: 12px; margin-top: 2px; }
.pcard .new { color: var(--gold); font-weight: 700; }
.pcard .pmon { font-size: 11px; color: var(--muted); line-height: 1.2; }

/* ---------- Tienda Kecleon: el puesto (20-10-2026) ----------
 * El puesto entero se dibuja en pixel art en #shop-scene (Scene, shop-ui.js);
 * aquí sólo el lienzo, el cartel (para que se traduzca), el bocadillo, el
 * objeto que vuela a la Mochila y la aparición del contenido. */
#scr-shop .shop-box { overflow-x: hidden; }
.shop-stall { position: relative; margin: -22px -24px 14px; height: 294px; border-radius: 9px 9px 0 0; overflow: hidden; background: #6fb8f0; }
.shop-scene { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; cursor: default; }
.shop-stall.opening .shop-scene { cursor: pointer; }
/* Cartel colgado del toldo; cae balanceándose y se encienden sus bombillas. */
.shop-sign { position: absolute; z-index: 2; left: 50%; top: 6px; padding: 3px 16px; font-size: 18px; color: #3a1f08; text-shadow: none; white-space: nowrap;
  background: #e2b26a; border: 3px solid #5a3412; border-radius: 4px; box-shadow: 0 3px 0 #5a3412; transform: translateX(-50%); transform-origin: 50% -14px;
  opacity: 0; }
.shop-sign.show { opacity: 1; animation: shopSign 1.1s ease-out both; }
.shop-sign.shown { opacity: 1; }
@keyframes shopSign { 0% { transform: translate(-50%, -70px) rotate(-18deg); } 30% { transform: translate(-50%, 0) rotate(12deg); }
  55% { transform: translate(-50%, 0) rotate(-7deg); } 78% { transform: translate(-50%, 0) rotate(3deg); } 100% { transform: translate(-50%, 0); } }
.shop-sign::before, .shop-sign::after { content: ''; position: absolute; left: 4px; right: 4px; height: 4px;
  background: radial-gradient(circle, #6b4a20 0 1.6px, transparent 2px) 0 0 / 10px 4px repeat-x; }
.shop-sign::before { top: 2px; } .shop-sign::after { bottom: 2px; }
.shop-sign.lit::before, .shop-sign.lit::after { animation: shopBulbs .5s steps(1) infinite; }
.shop-sign.lit::after { animation-delay: .25s; }
.shop-sign.lit { box-shadow: 0 3px 0 #5a3412, 0 0 16px rgba(255,210,63,.55); }
@keyframes shopBulbs {
  0% { background-image: radial-gradient(circle, #fff4b0 0 1.8px, transparent 2.2px); }
  50% { background-image: radial-gradient(circle, #ff8a3d 0 1.8px, transparent 2.2px); }
}
/* El bocadillo sigue al Kecleon morado (lo coloca shop-ui.js) y se va solo. */
.shop-bubble { position: absolute; z-index: 3; left: 0; top: 0; max-width: 60%; padding: 6px 10px; white-space: nowrap;
  font-size: 13px; color: #1b1528; text-shadow: none; background: #f2f7ec; border: 3px solid #1b1528; border-radius: 10px;
  transition: opacity .3s, transform .3s; transform-origin: 100% 60%; }
.shop-bubble::after { content: ''; position: absolute; right: -11px; top: 9px; border: 7px solid transparent; border-left-color: #1b1528; }
.shop-bubble.hide { opacity: 0; transform: scale(.6); }
.shop-bubble.pop { animation: shopBubble .35s ease-out both; }
@keyframes shopBubble { from { transform: scale(0); } 70% { transform: scale(1.08); } to { transform: none; } }
/* El objeto comprado vuela a su fila de la lista, que bota al recibirlo. */
.shop-fly { position: fixed; left: 0; top: 0; z-index: 1000; pointer-events: none; filter: drop-shadow(0 3px 4px rgba(0,0,0,.5)); }
.shop-fly img { width: 32px; height: 32px; }
#shop-body .ic.bump { animation: shopBump .4s ease-out; }
@keyframes shopBump { 30% { transform: scale(1.25); } 60% { transform: scale(.92); } }
@keyframes shopFade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.shop-stall.opening ~ .shop-inner { animation: shopFade .5s 1.8s ease-out both; }
@media (max-height: 520px) {                 /* (ahí la caja tiene 10px 14px de relleno) */
  .shop-stall { margin: -10px -14px 10px; height: 200px; }
  .shop-sign { font-size: 14px; top: 3px; }
}
@media (max-width: 640px) {
  .shop-stall { height: 220px; }
  .shop-sign { font-size: 14px; }
  .shop-bubble { font-size: 11px; }
}
.pcard.r5 { animation: pop .3s ease-out both, legend 1.4s ease-in-out infinite alternate; }
@keyframes legend { to { box-shadow: 0 0 40px var(--rc), 0 0 80px var(--rc); } }

/* ---------- cartas de nivel ---------- */
.cards { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); }
.card {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  background: rgba(0,0,0,.2); border: 2px solid rgba(242,247,236,.3); border-radius: 12px;
  padding: 12px 14px; transition: transform .08s, background .12s, border-color .12s;
}
.card:hover { background: rgba(255,255,255,.1); border-color: var(--edge); transform: translateX(4px); }
.card .ico { flex: 0 0 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 24px; }
.card .txt { flex: 1; }
.card .nm { font-weight: 700; font-size: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card .ds { color: var(--muted); font-size: 14px; }
.card .key { font-size: 13px; color: var(--muted); border: 2px solid rgba(242,247,236,.3); border-radius: 6px; padding: 2px 8px; }
.tag-chip { font-size: 11px; padding: 2px 7px; border-radius: 5px; color: #10131a; text-shadow: none; font-weight: 700; }
/* Físico / Especial en las cartas de nivel: aparte del tipo, oscura y con borde. */
.tag-chip.cat { background: rgba(10,30,16,.55); color: #f2f7ec; border: 1.5px solid rgba(160,210,170,.5); padding: 1px 7px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 18px; }
.stats > div { background: rgba(0,0,0,.22); border-radius: 9px; padding: 8px 10px; }
.stats > div > span:first-child { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.stats b { font-size: 22px; }

kbd {
  display: inline-block; padding: 0 6px; border: 2px solid rgba(242,247,236,.4); border-bottom-width: 3px;
  border-radius: 5px; font: inherit; font-size: 13px; text-shadow: none;
}

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 60;
  padding: 10px 18px; border-radius: 10px;
  background: rgba(10,30,16,.95); border: 2px solid var(--edge);
  text-shadow: 2px 2px 0 var(--shadow); animation: pop .2s ease-out;
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(242,247,236,.3); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

@media (max-width: 760px) and (min-height: 521px) {
  /* En vertical la LISTA va primero: si el logo y el compañero van delante,
     los botones se quedan fuera de la pantalla (y toca hacer scroll para
     encontrarlos). Con 12 entradas hay que apretar, así que van compactas. */
  #scr-menu { flex-direction: column; overflow-y: auto; }
  .menu-right {
    order: -1; width: 100%; background: rgba(5,10,25,.7);
    padding: 56px 8px 10px;
  }
  .menu-left { order: 1; padding: 14px; }
  .menu-list { gap: 2px; }
  .menu-item { font-size: 16px; padding: 5px 8px; grid-template-columns: 26px 1fr; column-gap: 6px; }
  .menu-item small { display: none; }
  .menu-item.play { font-size: 26px; }
  .menu-item.play small { display: block; }
  .mi-ico img { width: 22px; height: 22px; }
  .split { grid-template-columns: 1fr; }
  .logo .t1 { font-size: 34px; }
  #menu-partner { height: min(20vh, 120px); width: auto; }
}

/* ============ iconos pixel art ============ */
img.pix { image-rendering: pixelated; image-rendering: crisp-edges; vertical-align: middle; }
img.pix.off { filter: grayscale(1); opacity: .4; }
.stars-row { display: inline-flex; gap: 1px; vertical-align: middle; }
.cell .stars-row { display: flex; justify-content: center; margin-top: 2px; }
.badge-r { position: absolute; top: 3px; right: 4px; }
.move-icons { display: flex; flex-wrap: wrap; gap: 3px; margin: 0 0 10px; }
.card .ico img { display: block; }
.upg-item .ic { display: flex; justify-content: center; }

/* ============ pestañas de generación ============ */
.gen-tabs { display: flex; gap: 5px; overflow-x: auto; padding: 4px 2px 8px; margin-top: 6px; }
.gen-tab {
  appearance: none; cursor: pointer; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
  padding: 6px 12px; border-radius: 9px;
  background: rgba(0,0,0,.25); border: 2px solid rgba(242,247,236,.22);
  text-shadow: 2px 2px 0 var(--shadow);
}
.gen-tab b { font-size: 15px; }
.gen-tab small { font-size: 11px; color: var(--muted); }
.gen-tab:hover { border-color: var(--edge); }
.gen-tab.on { border-color: var(--gold); background: rgba(255,210,63,.14); }
.gen-tab.on b { color: var(--gold); }

/* ============ normal / shiny ============ */
.seg { display: flex; justify-content: center; gap: 0; margin: 2px auto 8px; width: max-content;
  border: 2px solid rgba(242,247,236,.35); border-radius: 9px; overflow: hidden; }
.seg button { appearance: none; cursor: pointer; background: rgba(0,0,0,.25); border: 0;
  padding: 5px 14px; font-size: 14px; display: flex; gap: 5px; align-items: center;
  text-shadow: 2px 2px 0 var(--shadow); }
.seg button.on { background: rgba(154,230,255,.22); color: #c9f3ff; }
.pcard.shiny { animation: pop .3s ease-out both, legend 1.1s ease-in-out infinite alternate; }
.caught > span { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.caught-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.caught-row > div { text-align: center; }
.caught-row small { display: block; font-size: 12px; color: #c9f3ff; }

/* ============ sonido ============ */
.sound-panel { position: fixed; top: 62px; right: 16px; z-index: 30; width: 270px; padding: 14px 16px; }
.sound-inline { margin: 6px auto 16px; max-width: 320px; }
.snd-row { display: grid; grid-template-columns: 20px 64px 1fr; gap: 8px; align-items: center; margin-bottom: 10px; font-size: 14px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px;
  background: rgba(0,0,0,.4); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 4px;
  background: var(--gold); border: 2px solid #fff7d6; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 4px; background: var(--gold); border: 2px solid #fff7d6; }
#btn-sound { padding: 5px 9px; display: flex; }

/* ============ nube, aviso legal ============ */
.btn.google { background: linear-gradient(180deg, #ffffff, #dfe6f2); color: #1f2a44; text-shadow: none; }
.sync { display: inline-block; width: 9px; height: 9px; margin-left: 8px; border-radius: 2px;
  box-shadow: 0 0 0 2px #0d2416; vertical-align: 1px; }
.sync.ok { background: #5fe08a; }
.sync.syncing, .sync.pending { background: #ffd23f; }
.sync.offline { background: #ff5f6d; }
.sync.local { background: #9fb1c9; }
.sync.guest { display: none; }
.legal-link { color: var(--muted); }
.legal-link:hover { color: #fff; }
.credits-line a { color: inherit; }
.legal h3 { margin: 14px 0 4px; color: var(--gold); font-size: 17px; }
.legal p { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.legal a { color: #a9e3b4; }
#scr-legal { z-index: 65; }   /* por delante de Ajustes y Apoyar (60) */
.boot { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: #04120a; color: var(--muted); font-size: 18px; }

/* ---------- amigos, sala, invitaciones y ranking ---------- */
.fr-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.fr-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px;
  background: rgba(0,0,0,.22); border: 2px solid rgba(242,247,236,.14);
}
.fr-row b { font-size: 17px; }
.fr-row .st { color: var(--muted); font-size: 13px; }
.dot { width: 10px; height: 10px; border-radius: 2px; background: #6b7a94; flex: 0 0 10px; }
.dot.on { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.play { background: var(--gold); }
.dot.pend { background: var(--r4); }
#fr-add { margin: 10px 0 0; }
#fr-add .field { min-width: 180px; }

.lobby-members { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.lob-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px;
  border-radius: 10px; background: rgba(0,0,0,.25); border: 3px solid var(--pc, rgba(242,247,236,.2));
  min-height: 170px; justify-content: center; text-align: center;
}
.lob-card b { font-size: 17px; color: var(--pc); }
.lob-card small { color: var(--muted); font-size: 12px; }
.lob-card .conn { font-size: 12px; color: var(--green); }
.lob-card .conn.wait { color: var(--gold); }
.lob-card.empty { border-style: dashed; border-color: rgba(242,247,236,.18); color: var(--muted); }

.invite-pop {
  position: fixed; right: 18px; bottom: 54px; z-index: 70; width: min(340px, calc(100% - 32px));
  padding: 14px 16px; animation: pop .2s ease-out;
}
.invite-pop img { vertical-align: middle; }

.rk-tools { gap: 8px; margin-bottom: 8px; }
.rk-tools .field { width: 220px; padding: 6px 10px; font-size: 15px; }
.rk-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.rk-row {
  display: grid; grid-template-columns: 54px auto 1fr auto 26px; gap: 10px; align-items: center;
  padding: 4px 12px; border-radius: 8px; background: rgba(0,0,0,.2); border: 2px solid transparent;
}
.rk-row .pos { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 4px; color: var(--muted); }
.rk-row.top1 .pos { color: var(--gold); }
.rk-row.top2 .pos { color: #dfe7f5; }
.rk-row.top3 .pos { color: #e0a36b; }
.rk-row .mons { display: flex; }
.rk-row .who { display: flex; flex-direction: column; min-width: 0; }
.rk-row .who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-row .who small { color: var(--muted); font-size: 12px; }
.rk-row .time { font-size: 22px; font-weight: 700; color: #fff; }
.rk-row.mine { border-color: var(--gold); background: rgba(255,210,63,.1); }
.rk-rep { background: none; border: 0; padding: 4px; cursor: pointer; opacity: .35; line-height: 0; }
.rk-rep:hover { opacity: 1; }
.rk-rep.sent { opacity: .12; cursor: default; }
.rk-row.mod-row { grid-template-columns: 54px 1fr auto; }
.rk-row.mod-row.rep { grid-template-columns: 54px auto 1fr auto auto; }
.mod-warn { color: #ff8a96 !important; }
.mod-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
/* Dos mitades (23-10-2026): daño a Arceus a la izquierda y tiempo a la derecha (en el móvil, una debajo de otra). */
#scr-rank .box.wide { width: min(1240px, 100%); }
.rk-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rk-col { min-width: 0; display: flex; flex-direction: column; }
.rk-h { margin: 2px 0 6px; font-size: 17px; color: var(--gold); }
.rk-split .rk-row { grid-template-columns: 46px auto 1fr auto 26px; gap: 8px; padding: 4px 8px; }
.rk-split .rk-row .time { font-size: 19px; }
.rk-me { margin-top: 10px; padding: 10px 12px; border-radius: 8px; background: rgba(0,0,0,.25); font-size: 15px; min-height: 20px; }

.cards.done .card { pointer-events: none; opacity: .45; }
/* Recién aparecidas: un momento sin poder elegirlas (ver guard() en run-ui.js). */
.cards.guard .card { opacity: .5; filter: saturate(.6); }
.cards .card { transition: transform .08s, background .12s, border-color .12s, opacity .2s, filter .2s; }
.cards.done .card.picked { opacity: 1; border-color: var(--gold); }
#lvl-wait { color: var(--gold); font-size: 15px; }

@media (max-width: 760px) {
  .lobby-members { grid-template-columns: repeat(2, 1fr); }
  .rk-row, .rk-split .rk-row { grid-template-columns: 40px auto 1fr auto 22px; gap: 6px; }
  .rk-split { grid-template-columns: 1fr; }
  .rk-split .rk-list { max-height: 38vh; }
}

/* ---------- tickets y mejoras por Pokémon ---------- */
.tickets-line img, #tickets-pill img, #cost-10 img, #cost-10b img, #cost-100 img, #cost-100b img { vertical-align: middle; }
.upg-head { display: flex; gap: 14px; align-items: center; margin: 6px 0 12px; }
.upg-head .stage { width: 120px; height: 96px; flex: 0 0 120px; }
select.field { font-family: var(--font); }

/* ---------- tragaperras del gacha ---------- */
#slot { width: min(528px, 92vw, 66vh); height: auto; image-rendering: pixelated; cursor: pointer;
  filter: drop-shadow(0 0 30px rgba(255,90,90,.35)); animation: pop .25s ease-out both; }

/* ---------- misiones, logros, perfil y objetos ---------- */
.goals-body { max-height: 62vh; overflow-y: auto; padding-right: 6px; }
.goals-h { margin: 6px 0 4px; }
.goals-h h3 { margin: 0; }
.mission {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 10px 12px; margin-bottom: 6px; border-radius: 8px;
  background: rgba(0,0,0,.22); border: 2px solid rgba(242,247,236,.14);
}
.mission.ready { border-color: var(--gold); background: rgba(255,210,63,.1); }
.mission.claimed { opacity: .55; }
.mission small, .ach small { color: var(--muted); font-size: 12px; }
.mission .bar, .ach .bar { height: 7px; background: rgba(0,0,0,.4); border-radius: 6px; overflow: hidden; margin: 4px 0 2px; }
.mission .bar i, .ach .bar i { display: block; height: 100%; background: var(--gold); }
.m-rw, .a-rw { font-size: 13px; color: var(--ink); }
.m-rw img, .a-rw img, .tag-chip img { vertical-align: middle; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.ach {
  display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px;
  background: rgba(0,0,0,.2); border: 2px solid rgba(242,247,236,.1);
}
.ach.ok { border-color: rgba(255,210,63,.6); }
.ach .a-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.leg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; }
.leg-cell { display: flex; flex-direction: column; align-items: center; padding: 4px; border-radius: 8px; background: rgba(0,0,0,.25); border: 2px solid transparent; }
.leg-cell.ok { border-color: rgba(255,210,63,.5); }
.leg-cell small { font-size: 10px; color: var(--muted); text-align: center; }
.fav-slots { display: flex; gap: 12px; flex-wrap: wrap; margin: 6px 0; }
.fav-slot {
  width: 140px; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; background: rgba(0,0,0,.28); border: 3px dashed rgba(242,247,236,.25); cursor: pointer; text-align: center;
}
.fav-slots.view .fav-slot { cursor: default; border-style: solid; border-color: rgba(255,210,63,.55); }
.fav-slot b { font-size: 14px; }
.profile-box { width: min(640px, 100%); max-height: 90vh; overflow-y: auto; }
.prof-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: -10px; }
.prof-head h2 { margin: 0; }
.prof-title { color: var(--gold); font-size: 15px; border: 2px solid var(--gold); border-radius: 8px; padding: 1px 8px; }
.prof-marks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.prof-marks div { background: rgba(0,0,0,.25); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; }
.prof-marks span { color: var(--muted); font-size: 12px; }
.prof-marks b { font-size: 18px; }
.prof-medals { display: flex; flex-wrap: wrap; gap: 8px; }
.prof-medals .pm { width: 84px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.prof-medals small { font-size: 10px; color: var(--muted); }
a.plink { color: inherit; text-decoration: none; border-bottom: 1px dotted rgba(242,247,236,.4); }
a.plink:hover { color: var(--gold); }
#user-pill { cursor: pointer; }
.ach-pop {
  position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 80;
  display: flex; gap: 10px; align-items: center; padding: 10px 16px; animation: pop .2s ease-out;
  border-color: var(--gold) !important;
}
.ach-pop b { display: block; color: var(--gold); }
.ach-pop small { color: var(--muted); }
.card.evo { border-color: var(--gold); background: linear-gradient(90deg, rgba(255,210,63,.18), rgba(255,210,63,.04)); }
.card.evo .nm { color: var(--gold); }
/* Vínculo (premio de los legendarios): rosa */
.bond-title { color: #ff8ad8; }
.card.bond { border-color: #ff8ad8; background: linear-gradient(90deg, rgba(255,138,216,.18), rgba(255,138,216,.04)); }
.card.bond .nm { color: #ff8ad8; }
@media (max-height: 520px) {
  #scr-bond .bond-hint { display: none; }
  #scr-bond .box { width: min(820px, 100%); }
  #bond-cards { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
}
@media (max-width: 760px) { .mission { grid-template-columns: 1fr; } .prof-marks { grid-template-columns: repeat(2, 1fr); } }


/* ================= móvil y táctil ================= */
html, body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
body { touch-action: manipulation; }
/* iPhone: sin esto, mantener el dedo en el joystick sacaba "Copiar / Seleccionar
   todo" (Safari sólo hace caso a la versión -webkit- y no lo hereda bien). */
body, body * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* Con táctil no tienen sentido las pistas de teclas. */
body.touch kbd, body.touch .card .key, body.touch .kbd-hint { display: none !important; }
#rotate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 10, 30, .94);
}
#rotate.hidden { display: none; }
#rotate .box { max-width: 320px; }
#rotate-ico { animation: rot-hint 1.6s steps(4) infinite; display: inline-block; }
@keyframes rot-hint { 0%, 30% { transform: rotate(0deg); } 60%, 100% { transform: rotate(90deg); } }

/* ---------- ajustes ---------- */
#scr-settings { z-index: 60; }
/* Colocar los botones (layout-ui.js): por delante de Ajustes */
#scr-layout { z-index: 66; display: block; background: radial-gradient(circle at 50% 40%, #24452c, #0d1a12); touch-action: none; }
#scr-layout.hidden { display: none; }
.lay-thing { position: absolute; z-index: 2; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.lay-thing.held { cursor: grabbing; filter: drop-shadow(0 0 8px rgba(255,210,63,.8)); }
.lay-thing.hidden { display: none; }
.lay-bar { display: flex; gap: 9px; }
.lay-slot { position: relative; width: 54px; height: 54px; flex: none; border-radius: 12px; background: rgba(10,24,14,.8); border: 1.2px solid rgba(140,170,210,.4); }
.lay-slot.on { border: 2.5px solid var(--gold); }
.lay-slot.item { margin-right: 9px; background: rgba(10,24,14,.55); }
.lay-slot i { position: absolute; left: 4px; top: 2px; font-style: normal; font-size: 10px; color: rgba(180,200,230,.7); }
.lay-tag { position: absolute; left: 50%; top: -18px; transform: translateX(-50%); font-size: 11px; color: var(--gold); white-space: nowrap; pointer-events: none; }
.lay-pause { border-radius: 10px; background: rgba(10,24,14,.7); border: 2px solid rgba(242,247,236,.8); box-sizing: border-box; }
.lay-pause b { position: absolute; top: 9px; width: 5px; height: 18px; background: #f2f7ec; }
.lay-pause b:first-child { left: 11px; } .lay-pause b:last-child { left: 20px; }
.lay-stick { border-radius: 50%; background: rgba(10,30,16,.3); border: 3px solid rgba(242,247,236,.6); box-sizing: border-box; }
.lay-stick .knob { position: absolute; left: 50%; top: 50%; width: 42%; height: 42%; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(255,210,63,.85); border: 3px solid #a55f00; box-sizing: border-box; }
.lay-panel { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(340px, calc(100% - 32px)); padding: 10px 14px; text-align: center; opacity: .95; }
.lay-panel h3 { margin: 0 0 6px; font-size: 14px; }
#lay-mode { justify-content: center; align-items: center; gap: 6px; margin: 0; }
.lay-help { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.lay-turn { color: var(--gold); font-size: 13px; margin: 4px 0; }
.lay-btns { justify-content: center; gap: 8px; margin-top: 6px; }
.box.settings { width: min(640px, 100%); max-height: calc(100dvh - 24px); display: flex; flex-direction: column; }
.set-body { overflow-y: auto; padding-right: 4px; min-height: 0; }
#set-tabs { flex-wrap: wrap; }
#set-tabs .gen-tab { padding: 6px 12px; }
.set-h { color: var(--gold); font-size: 17px; margin: 14px 0 6px; }
.set-h:first-child { margin-top: 4px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.set-row b { display: block; }
.set-row small { display: block; color: var(--muted); font-size: 12px; }
.set-row .switch { min-width: 58px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.set-chips { margin: 6px 0 10px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; font-size: 14px; }
.keys span { color: var(--muted); }
.padkey { display: inline-block; padding: 0 7px; border: 2px solid rgba(242,247,236,.4); border-radius: 9px; font-size: 13px; color: var(--text, #f2f7ec) !important; text-shadow: none; }
/* Lo seleccionado con el mando (gamepad.js). */
.pad-focus { outline: 3px solid #ffd23f !important; outline-offset: 3px; box-shadow: 0 0 0 6px rgba(255,210,63,.25) !important; }
.credits { margin: 4px 0 12px; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.credits b { color: var(--ink); }
.about-logo { text-align: center; font-size: 34px; font-weight: 700; color: var(--gold); text-shadow: 2px 2px 0 #a55f00, 4px 4px 0 var(--shadow); margin-top: 6px; }
.btn.danger { background: #8a1f2e; border-color: #ff8a96; }
.row.wrap { flex-wrap: wrap; }
.touch-hint { display: none; }
body.touch .touch-hint { display: block; }
#pause-sound + .row, #scr-pause .row { flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-block; color: var(--ink); }

/* ================= pantallas bajas (móvil en horizontal) =================
 * Todo más compacto: la barra superior deja sitio, el menú va en dos
 * columnas y la línea de créditos se esconde (está en Ajustes → Acerca de). */
@media (max-height: 520px) {
  .scr { padding: 50px 10px 6px; }
  /* Sin barra superior encima: no hace falta dejarle hueco. */
  #scr-login, #scr-test, #scr-result, #scr-starters, #scr-nick, #scr-levelup, #scr-pause,
  #scr-over, #scr-item, #scr-settings, #scr-legal, #scr-profile { padding: 6px 10px; }
  .split { grid-template-columns: 1fr; }
  .logo .t1 { font-size: 30px; }
  .box { padding: 10px 14px; border-radius: 10px; }
  .box h2 { font-size: 20px; }
  .box h3 { font-size: 16px; }
  .sub { font-size: 13px; margin-bottom: 8px; }
  .note { margin-top: 8px; font-size: 12px; }
  .btn { padding: 7px 14px; }
  .btn.small { padding: 4px 9px; font-size: 13px; }
  .topbar { top: 5px; right: 6px; gap: 5px; }
  .pill { padding: 2px 8px; font-size: 13px; gap: 5px; }
  #user-pill { max-width: 130px; overflow: hidden; white-space: nowrap; }
  .topbar .btn.small { padding: 2px 6px; }
  .credits-line { display: none !important; }
  .sound-panel { top: 40px; }

  #scr-menu { flex-direction: row; padding: 0; overflow: hidden; }
  .menu-left { padding: 50px 8px 6px; }
  .menu-left .logo { margin-bottom: 2px; }
  .menu-left .logo .t1 { font-size: 28px; }
  .splash { top: 50%; font-size: 9px; max-width: 10em; margin-right: -3.6em; }
  .logo .t2 { font-size: 10px; margin-top: 2px; letter-spacing: 2px; }
  #menu-partner { height: min(34vh, 130px); width: auto; }
  .partner-card { margin-top: 2px; }
  .partner-card .nm { font-size: 17px; }
  .partner-card .lv { font-size: 12px; }
  .menu-right { width: min(54vw, 420px); padding: 50px 8px 6px; gap: 6px; justify-content: flex-start; overflow-y: auto; }
  .menu-right .box { padding: 6px 8px; }
  .menu-right > .box:last-child { display: none; }
  .menu-right > :first-child { margin-top: 0; }
  .ach-pop { top: auto; bottom: 8px; }
  .menu-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 4px; }
  .menu-item { font-size: 15px; padding: 4px 6px; grid-template-columns: 22px 1fr; column-gap: 6px; }
  .menu-item small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .menu-item.play { grid-column: span 2; font-size: 21px; }
  .menu-item::before { display: none; }
  .mi-ico img { width: 20px; height: 20px; }
  .box.settings { max-height: calc(100dvh - 12px); }
}
/* Móviles muy bajos (iPhone SE y similares): sin subtítulos en el menú, para que quepa entero. */
@media (max-height: 400px) {
  .menu-right { padding-top: 48px; }
  .menu-item small { display: none; }
  .menu-item { font-size: 14px; padding: 5px 6px; }
  .menu-item.play { font-size: 19px; }
  .menu-item.play small { display: block; }
  #menu-partner { height: min(30vh, 110px); }
}

/* ---------- pantalla de carga (lo primero que se ve y lo que lee Google) ---------- */
.boot-in { text-align: center; padding: 20px; max-width: 640px; }
.boot-in h1 { margin: 0 0 8px; font-size: clamp(38px, 8vw, 64px); color: var(--gold); text-shadow: 3px 3px 0 #a55f00, 6px 6px 0 var(--shadow); font-weight: 700; }
.boot-in p { margin: 6px 0; color: var(--muted); }
.boot-in a { color: #a9e3b4; }
.boot-ld { color: #fff; margin-top: 18px !important; }
.boot.noscript { z-index: 90; }
/* "Pulsa para empezar": encima de todo, se ve el mundo de fondo. */
.tapstart { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: radial-gradient(ellipse at center, rgba(5,9,20,.35), rgba(5,9,20,.8)); animation: fade .4s; }
.tapstart .boot-in p { color: #dfe7ff; text-shadow: 2px 2px 0 #000; }
.tap-blink { color: #fff !important; font-size: 20px; margin-top: 22px !important; animation: blink 1.1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.login-tag { margin: -6px 0 12px; font-size: 13px; color: var(--muted); text-align: center; }
.login-official { margin: -6px 0 12px; font-size: 12px; color: var(--muted); text-align: center; opacity: .85; }
.login-links { margin-top: 10px; font-size: 13px; text-align: center; }
.login-links a { color: #a9e3b4; }

/* ---------- apoyar el proyecto ---------- */
#scr-support { z-index: 60; }
.box.support { width: min(560px, 100%); }
/* Mejoras: botones y veto */
.upg-btns { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ban-picker { grid-column: 1 / -1; }
.bind-panel { grid-column: 1 / -1; }
.bind-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.bind-slot { display: flex; align-items: center; gap: 6px; margin: 0; }
.bind-slot span { font-weight: 700; color: var(--gold); min-width: 14px; }
.bind-slot select { width: 100%; min-width: 0; }
@media (max-width: 760px) { .bind-slots { grid-template-columns: repeat(2, 1fr); } }
.ban-moves { display: flex; flex-wrap: wrap; gap: 6px; }
.ban-moves .chip { display: inline-flex; align-items: center; gap: 5px; }
.ban-moves .chip.ban { background: rgba(255,95,109,.25); border-color: #ff5f6d; color: #ffd3d8; text-decoration: line-through; }
/* Novedades */
.news-btn { position: relative; }
.news-btn .dot { display: none; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; background: #ff5f6d; box-shadow: 0 0 0 2px var(--shadow); }
.news-btn.new .dot { display: block; }
.box.news-box { width: min(640px, 100%); max-height: calc(100dvh - 90px); display: flex; flex-direction: column; }
.news-body { overflow-y: auto; padding-right: 4px; }
.news-day { padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.1); }
.news-day:last-child { border-bottom: 0; }
.news-day h3 { color: var(--gold); margin: 14px 0 6px; font-size: 18px; }
.news-day h3 small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 2px; }
.news-part { margin: 6px 0 8px; }
.news-tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 4px; color: #0b1020; text-shadow: none; }
.news-tag.new { background: #5fe08a; } .news-tag.chg { background: #4fb4ff; } .news-tag.fix { background: #ffb347; }
.news-day ul { margin: 0; padding-left: 20px; }
.news-day li { margin: 4px 0; line-height: 1.35; font-size: 15px; }
@media (max-width: 760px) { .news-btn span { display: none; } }
/* YouTube (en directo: rojo y con un punto que late). */
.yt-btn.live { background: #e0202a; border-color: #ff8a8a; color: #fff; }
.yt-btn .rec { display: none; width: 8px; height: 8px; border-radius: 50%; background: #fff; margin-right: 2px; animation: yt-rec 1.2s ease-in-out infinite; }
.yt-btn.live .rec { display: inline-block; }
@keyframes yt-rec { 50% { opacity: .25; } }
@media (max-width: 760px) { .yt-btn:not(.live) span { display: none; } }
/* Botón Guardar (barra de arriba). */
.save-btn { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; }
#savenote-body p { line-height: 1.4; }
.sup-tab { width: 100%; border-collapse: collapse; margin: 6px 0 10px; font-size: 15px; }
.sup-tab td { padding: 5px 4px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sup-tab td.num { text-align: right; white-space: nowrap; }
.sup-tab tr.tot td { font-weight: 700; color: var(--gold); border-bottom: 0; }
#btn-support span { margin-left: 2px; }
@media (max-height: 520px) { #btn-support span { display: none; } }
/* ============ Pokémon en móvil horizontal ============
 * La lista a la izquierda y la ficha (con "Elegir de compañero") a la derecha,
 * siempre a la vista: antes la ficha quedaba debajo de la lista y había que
 * bajar hasta el borde para encontrar el botón. */
@media (max-height: 520px) {
  #scr-dex .box { height: 100%; display: flex; flex-direction: column; padding: 8px 10px; }
  #scr-dex .gen-tabs { margin-top: 2px; padding-bottom: 4px; flex: 0 0 auto; }
  #scr-dex .split { grid-template-columns: 1fr minmax(190px, 36%); gap: 8px; flex: 1; min-height: 0; margin-top: 2px !important; }
  #scr-dex .split > div:first-child { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  #scr-dex .gen-tabs, #scr-dex .filters { scrollbar-width: none; }
  #scr-dex .gen-tabs::-webkit-scrollbar, #scr-dex .filters::-webkit-scrollbar { display: none; }
  #scr-dex .filters { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 4px; flex: 0 0 auto; }
  #scr-dex .dex-tools { margin-bottom: 4px; gap: 6px; }
  /* Ajustes: las pestañas en una fila que se desliza de lado. */
  #set-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  #set-tabs::-webkit-scrollbar { display: none; }
  #set-tabs .gen-tab { flex: 0 0 auto; }
  #scr-dex .dex-tools input, #scr-dex .dex-tools select { padding: 2px 8px; font-size: 12px; }
  #scr-dex .chip { flex: 0 0 auto; padding: 2px 8px; font-size: 12px; }
  #scr-dex .grid { max-height: none; flex: 1; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 5px; }
  #scr-dex .cell canvas { width: 69px; height: 60px; }
  #scr-dex .cell b { font-size: 11px; }
  #dex-detail { min-height: 0; overflow-y: auto; padding: 6px 8px; display: flex; flex-direction: column; }
  #dex-detail .stage { width: 132px; height: 114px; margin: 2px auto 4px; }
  #dex-detail h3 { margin: 0; }
  #dex-detail .stat { grid-template-columns: 62px 1fr 34px; gap: 4px; font-size: 12px; margin: 2px 0; }
  #dex-detail p { margin: 4px 0 !important; font-size: 12px !important; }
  #dex-detail .move-icons { margin-bottom: 4px; }
  /* El botón de elegir, pegado abajo de la ficha: se ve aunque la ficha no quepa. */
  #dex-detail .btn { position: sticky; bottom: 0; order: 9; margin-top: auto; padding: 8px 6px; font-size: 15px;
    box-shadow: 0 -6px 10px rgba(5,10,25,.6); }
}

/* ============ equipo del modo搜打撤 (principal y suplente) ============ */
.team-box { max-height: min(94vh, 900px); display: flex; flex-direction: column; }
.team-slots { display: flex; gap: 10px; margin: 8px 0; }
.team-slot {
  flex: 1; min-width: 0; cursor: pointer;
  border: 3px solid var(--edge); border-radius: 10px; padding: 8px;
  background: rgba(10,30,16,.45);
}
.team-slot.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,210,63,.35); }
.team-slot .ts-h { font-weight: 700; font-size: 13px; color: var(--gold); text-align: center; }
.team-slot .ts-body { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.team-slot .ts-stage { width: 120px; height: 96px; }
.team-slot b { font-size: 15px; }
.team-slot small { font-size: 11px; color: var(--muted); }
.team-grid { max-height: 40vh; }
/* El suplente se marca con otro color que el principal. */
.team-grid .cell.sub { box-shadow: 0 0 0 3px #7fd4ff inset; }

/* Local CJK fonts: no font service or additional downloads. */
html:lang(zh-Hant) { --font: 'Pixelify', 'PingFang TC', 'Microsoft JhengHei', 'Noto Sans CJK TC', system-ui, sans-serif; }
html:lang(zh-Hans) { --font: 'Pixelify', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif; }
html:lang(zh) body { line-height: 1.5; -webkit-font-smoothing: antialiased; }
html:lang(zh) .btn, html:lang(zh) .chip { letter-spacing: 0; }

/* ============ barra superior en ventanas pequeñas ============
 * Cuando la ventana es pequeña (de ancho O de alto) la barra no cabe de
 * lado: se compacta y las etiquetas se ocultan dejando sólo el icono.
 * Y los botones NO pueden partir su texto en dos líneas: si lo hacen, la
 * barra crece hacia abajo y tapa el título de la pantalla.
 * Está al final del fichero para ganar a los demás @media. */
@media (max-width: 760px), (max-height: 520px) {
  .topbar { top: 6px; right: 6px; gap: 3px; flex-wrap: nowrap; }
  .topbar .btn { flex: 0 0 auto; white-space: nowrap; line-height: 1.2; }
  .topbar .btn.small { padding: 2px 5px; font-size: 12px; }
  .topbar .btn.small > span { display: none; }
  .topbar .yt-btn.live > span { display: inline; }   /* "EN DIRECTO" sí se enseña */
  .pill { padding: 2px 6px; font-size: 12px; gap: 3px; }
  .pill .coin { width: 14px; height: 14px; }
  #tickets-pill img { width: 14px; height: 14px; }
  #user-pill { max-width: 72px; overflow: hidden; white-space: nowrap; }
}
/* Ya no caben ni los iconos: se va YouTube (propaganda, no juego). */
@media (max-width: 620px) { #btn-yt { display: none; } }
/* Móvil estrecho: sólo lo imprescindible (monedas, guardar, novedades,
   sonido, pantalla completa, ajustes, salir). */
@media (max-width: 480px) { #user-pill, #tickets-pill { display: none; } }
/* ============ el mercado entre jugadores (ui/xtrade-ui.js) ============ */
.xtrade-box { display: flex; flex-direction: column; gap: 8px; }
.xtrade-cols { display: flex; gap: 12px; align-items: flex-start; }
.xtrade-col { flex: 1 1 0; min-width: 0; }
.xtrade-left { flex: 0 0 240px; }
.xtrade-mid { flex: 1 1 320px; }
.xtrade-right { flex: 0 0 280px; }
.xtrade-list {
  display: flex; flex-direction: column; gap: 5px;
  max-height: 260px; overflow-y: auto; margin-bottom: 10px;
}
.xtrade-list .market-row { padding: 5px 8px; }
.xtrade-list .market-row.on { border-color: #d9a01e; box-shadow: 0 0 0 2px rgba(217,160,30,.35); }
.xtrade-list .pack-stash-item { width: 100%; }
.xtrade-list .pack-stash-item .btn { margin-left: auto; }
.xtrade-sell-row {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
  background: rgba(255,252,233,.5); border: 2px solid #a9a37c; border-radius: 8px;
}
.xtrade-sell-name {
  flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; font-size: 13px; color: #3f3722;
}
.xtrade-price {
  flex: 0 0 74px; width: 74px;
  font: 700 13px Pixelify, monospace; text-align: right;
  padding: 3px 5px; border: 2px solid #a9a37c; border-radius: 6px;
  background: rgba(255,255,255,.75); color: #3f3722;
}
.xtrade-say { display: flex; gap: 6px; align-items: center; }
.xtrade-say input {
  flex: 1 1 auto; min-width: 0;
  font: 400 13px Pixelify, monospace; padding: 6px 8px;
  border: 2px solid #a9a37c; border-radius: 8px;
  background: rgba(255,255,255,.8); color: #3f3722;
}
.xtrade-say .btn { flex: 0 0 auto; }
@media (max-width: 860px) {
  .xtrade-cols { flex-direction: column; }
  .xtrade-left, .xtrade-mid, .xtrade-right { flex: 1 1 auto; width: 100%; }
  .xtrade-list { max-height: 190px; }
}
/* ============ revisión de UI: pantallas grandes y pantallas bajas ============
 * Lo que se arregla aquí:
 *
 * 1) LA MOCHILA (scr-pack) es la pantalla más alta del juego. En un portátil de
 *    720p no cabía: el botón de cerrar quedaba DEBAJO de la barra de arriba
 *    (que está en z-index 25) y los botones de abajo (六维图 y 招式) se veían
 *    cortados sin ninguna forma de llegar a ellos. Ahora:
 *      - la caja se ajusta a la ventana y se puede desplazar,
 *      - la pantalla va por delante de la barra de arriba (tiene su propio
 *        botón de cerrar),
 *      - y con poca altura las piezas se encogen para que entre casi todo.
 *
 * 2) EN UN MÓVIL EN HORIZONTAL (≤520 px de alto) casi ninguna pantalla del
 *    modo搜打撤 cabía: la preparación, el仓库, la colección y el mercado se
 *    salían por abajo y por arriba. Ahora todas tienen como mucho la altura de
 *    la ventana y lo que no cabe se desplaza (con el dedo).
 */

/* 1) La mochila. */
#scr-pack { z-index: 30; }
#scr-pack .pack-box,
#scr-safe .pack-box,
#scr-xprep .prep-box,
#scr-xtrade .xtrade-box,
#scr-xdex .box,
#scr-team .team-box {
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#scr-pack.peek .pack-box { max-height: 96vh; }

/* 2) Con poca altura (portátiles de 720p y 768p) se encoge lo que se puede:
   la etapa del Pokémon, las celdas de la mochila y el 六维图. */
@media (max-height: 820px) {
  .pack-panel-stage { height: 136px; }
  .pack-grid { grid-template-rows: repeat(4, 58px); }
  .pack-detail { grid-template-columns: 200px 1fr; }
  .pack-stats-cv { width: 180px; height: 158px; }
  .prep-body { min-height: 0; }
}

/* 3) Móvil en horizontal (≤520 px de alto): todo más compacto y con
   desplazamiento donde haga falta. */
@media (max-height: 520px) {
  #scr-pack .pack-box, #scr-safe .pack-box, #scr-xprep .prep-box,
  #scr-xtrade .xtrade-box, #scr-xdex .box, #scr-team .team-box {
    max-height: calc(100dvh - 10px);
  }
  /* La mochila se queda en tres columnas (no apilada) pero más estrechas. */
  .pack-body { flex-direction: row; flex-wrap: nowrap; }
  .pack-left { flex: 0 0 190px; }
  .pack-right { flex: 0 0 136px; }
  .pack-panel-stage { height: 96px; }
  .pack-grid { grid-template-rows: repeat(4, 42px); }
  .pack-detail { grid-template-columns: 124px 1fr; }
  .pack-stats-cv { width: 116px; height: 100px; }
  .pack-teams { gap: 6px; }
  .pack-tip { font-size: 11px; }
  /* La columna izquierda del仓库 es la alta: que se desplace ella sola. */
  .warehouse-cols { max-height: calc(100dvh - 92px); }
  /* El mercado: tres columnas apiladas en pantallas estrechas, con las listas
     cortadas para que quepan. */
  .xtrade-list { max-height: 104px; }
  .xtrade-sell-row { padding: 2px 6px; }
  /* La colección del modo搜打撤: como la del normal, en dos columnas con la
     ficha al lado y las listas desplazables. */
  #scr-xdex .box { height: 100%; display: flex; flex-direction: column; padding: 8px 10px; }
  #scr-xdex .gen-tabs { margin-top: 2px; padding-bottom: 4px; flex: 0 0 auto; }
  #scr-xdex .split { grid-template-columns: 1fr minmax(168px, 34%); gap: 8px; flex: 1; min-height: 0; margin-top: 2px !important; }
  #scr-xdex .split > div:first-child { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  #scr-xdex .filters { flex-wrap: nowrap; overflow-x: auto; margin-bottom: 4px; flex: 0 0 auto; }
  #scr-xdex .grid { max-height: none; flex: 1; min-height: 0; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 4px; }
  #scr-xdex .cell canvas { width: 62px; height: 54px; }
  #scr-xdex #xdex-detail { min-height: 0; overflow-y: auto; padding: 6px 8px; }
  /* El escudo del menú principal: a 375 px de alto se salía por arriba. */
  .menu-left .logo .logo-img { width: auto; height: min(24vh, 128px); max-width: 80%; }
  .menu-left .logo { margin-bottom: 0; }
}
/* ============ la franja de abajo de la mochila: 六维图 + 招式 ============
 * La columna de las instrucciones se salía del panel: en una rejilla, `1fr`
 * quiere decir `minmax(auto, 1fr)` y el mínimo es el tamaño del texto, así
 * que una descripción larga (「以极快的电流贯穿多个敌人」) empujaba la
 * columna y la pantalla entera se salía de la caja. Con `minmax(0, 1fr)` y
 * `min-width: 0` en los hijos, la columna se ajusta y el texto se recorta con
 * puntos suspensivos como estaba pensado. */
.pack-detail { grid-template-columns: 240px minmax(0, 1fr); }
.pack-skill span { flex: 1 1 0; min-width: 0; }
.pack-skill b { flex: 0 0 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pack-skills, .pack-vitals, .pack-abilinfo, .pack-stats { min-width: 0; }
.pack-card-nat { min-width: 0; }
.pack-card-nat span, .pack-card-nat em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 900px) { .pack-detail { grid-template-columns: minmax(0, 1fr); } }
/* La mochila a 720p: con la etapa a 136 y las celdas a 58 la pantalla se
 * quedaba 20 px más alta que la ventana (lo de abajo quedaba cortado). Con
 * estas medidas entra entera; y si aun así no cabe, la caja se desplaza. */
@media (max-height: 820px) {
  .pack-panel-stage { height: 118px; }
  .pack-grid { grid-template-rows: repeat(4, 52px); }
  .pack-detail { grid-template-columns: 180px minmax(0, 1fr); }
  .pack-stats-cv { width: 164px; height: 144px; }
  .pack-body { gap: 10px; }
  .pack-left, .pack-right { gap: 6px; }
}
/* La mochila a 720p: la etapa de cada Pokémon (172 px) y la del entrenador
 * (186 px) eran lo que sobraba. En una pantalla de poca altura se encogen
 * (el lienzo es de 176 px y se escala, así que no pierde calidad) y la
 * pantalla entra entera sin tener que desplazarse. */
@media (max-height: 820px) {
  .pack-card-stage { min-height: 116px; }
  .pack-card-cv { width: 110px; height: 110px; }
  .pack-panel-stage { height: 122px; }
  .pack-trainer-cv { width: 120px; height: 120px; }
  .pack-card-base, .pack-panel-base { height: 30px; }
  .pack-card-slots { gap: 4px; }
  .pack-gear-slot { max-width: 46px; }
}
/* El 六维图 y la lista de 招式 comparten fila: si el gráfico es más alto que
 * lo que necesitan las habilidades, la última fila (「空缺 4」) queda medio
 * tapada por el panel de abajo. Con el gráfico un poco más bajo, la lista
 * manda y se ve entera. */
@media (max-height: 820px) {
  .pack-detail { grid-template-columns: 172px minmax(0, 1fr); }
  .pack-stats-cv { width: 160px; height: 139px; }
}
/* Móvil en horizontal: la caja de las pantallas grandes se coloca pegada
 * arriba (empezando por debajo de la barra de arriba) y con la altura justa
 * para no salirse por abajo. Antes, al estar centrada en un hueco más bajo que
 * la caja, se salía por los dos lados. */
@media (max-height: 520px) {
  #scr-pack, #scr-safe, #scr-xprep, #scr-xtrade, #scr-xdex, #scr-team { align-items: flex-start; }
  #scr-pack .pack-box, #scr-safe .pack-box, #scr-xprep .prep-box,
  #scr-xtrade .xtrade-box, #scr-xdex .box, #scr-team .team-box {
    max-height: calc(100dvh - 58px);
  }
}
/* Móvil en horizontal: las tarjetas de Pokémon son estrechas (95 px) y el
 * nombre se quedaba sin sitio (salía「、等级 1」). La columna de la izquierda
 * es un poco más ancha y los puntos de tipo se esconden (el tipo ya se ve en
 * la ficha de abajo). */
@media (max-height: 520px) {
  .pack-left { flex: 0 0 236px; }
  .pack-card-types { display: none; }
  .pack-card-bar { padding: 3px 5px; gap: 4px; }
  .pack-card-bar b { font-size: 13px; }
  .pack-card-lv { font-size: 11px; }
}
/* Móvil en horizontal: en el仓库 las dos columnas (lo que llevas / el almacén
 * grande) no cabían y la del almacén se iba para abajo, debajo del todo. Con
 *las columnas más estrechas las dos se ven a la vez. */
@media (max-height: 520px) {
  .warehouse-left { flex: 1 1 240px; }
  .warehouse-right { flex: 1 1 390px; }
  .warehouse-h { font-size: 12px; }
  .warehouse-cols { max-height: calc(100dvh - 92px); }
}
/* Móvil en horizontal: los dos huecos de Pokémon del仓库 tienen un ancho
 * mínimo de 190 px (el de la preparación) y se salían encima de la columna
 * del almacén. Aquí se estiran con el espacio que haya. */
@media (max-height: 520px) {
  .warehouse-left .prep-slots { gap: 6px; }
  .warehouse-left .prep-slot { min-width: 0; flex: 1 1 0; padding: 4px 6px; }
  .warehouse-left .prep-slot b { font-size: 13px; }
}
/* Móvil en horizontal: la rejilla de candidatos de la preparación salía de
 * su hueco y se montaba encima de la nota de abajo. Se limita a lo que cabe y
 * las细胞 se encogen (el sprite es de 92×80 y se escala). */
@media (max-height: 520px) {
  .prep-cands { max-height: 38vh; gap: 5px; }
  .prep-cands .cell canvas { width: 66px; height: 57px; }
  .prep-cands .cell b { font-size: 12px; }
  .prep-slots { margin-bottom: 6px; gap: 6px; }
  .prep-slot { padding: 4px 8px; min-width: 0; }
  .prep-slot span { font-size: 13px; }
  .prep-foot { margin-top: 6px; }
}
/* Móvil en horizontal: el contenido del cuerpo de la preparación (la rejilla de
 * candidatos y la nota de las monturas) se salía de su hueco y se montaba
 * encima de la nota de abajo. Ahora el cuerpo se desplaza. */
@media (max-height: 520px) {
  .prep-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
/* Móvil en horizontal: las células de la preparación, un poco más pequeñas,
 * para que la rejilla y la nota de las monturas quepan sin desplazar. */
@media (max-height: 520px) {
  .prep-cands .cell canvas { width: 58px; height: 50px; }
  .prep-cands .cell b { font-size: 11px; }
  .prep-cands { gap: 4px; }
}
/* ============ con el dedo, los botones se hacen más grandes ============
 * El mínimo cómodo para el pulgar son 40-44 px. Con ratón no hace falta (y no
 * cabe en un móvil en horizontal), así que esto sólo se aplica cuando el
 * juego ha detectado que se juega con el dedo (body.touch).
 */
@media (max-height: 520px) {
  body.touch .menu-item { min-height: 42px; }
  body.touch .btn { min-height: 42px; }
  body.touch .btn.small { min-height: 40px; }
  body.touch .tab, body.touch .gen-tab { min-height: 40px; }
  body.touch .cell { min-height: 44px; }
  body.touch .xmode-play { min-height: 56px; }
}
/* ============ texto limpio: sin fantasma y con contraste ============
 * La sombra dura (`2px 2px 0`) es el estilo del juego, pero por debajo de
 * 17 px pone una COPIA del texto justo debajo y desplazada: se ve como un
 * fantasma (重影). Encima, el subtítulo usaba el marrón del tema de papel
 * sobre la caja verde y no se leía nada.
 * Ahora la sombra dura la llevan sólo los rótulos grandes; el texto corriente
 * va limpio y cada tema usa su color.
 */
.box { text-shadow: none; }
.box h1, .box h2, .box h3 { text-shadow: 2px 2px 0 var(--shadow); }
.pack-box h1, .pack-box h2, .pack-box h3 { text-shadow: none; }

/* El subtítulo de la cabecera: claro en las cajas verdes, marrón en las de
   papel (la mochila y el仓库, que son claras). */
.pack-sub { color: #cfe3c4; }
.pack-box .pack-sub { color: #6b6144; }

/* Los rótulos dentro de la caja verde (el mercado negro y el de jugadores). */
.market-h { color: #eaf5e4; }
.xtrade-box .warehouse-h { color: #eaf5e4; }
.xtrade-box .warehouse-h small { color: #b7d2b0; }

/* Las filas del mercado tienen fondo claro: el texto va oscuro. Con la
   sombra dura, el texto claro sobre fondo claro no se leía. */
.market-info small { color: #6b6144; }
.market-row small { color: #6b6144; }

/* Los rótulos pequeños con sombra dura (pestañas, chips, píldoras): una
   sombra de 1 px en vez de la copia desplazada de 2 px. */
.gen-tab, .seg button, .chip, .pill { text-shadow: 1px 1px 0 var(--shadow); }
/* ============ una sola tipografía por línea ============
 * En chino, una línea como «1,234,567 宝可梦硬币» mezcla dos familias: los
 * números salen de Pixelify (pixel, más bajos) y los汉字 de PingFang (lisa,
 * más alta). Se lee como dos textos pegados. Ahora el texto corriente usa una
 * sola familia y el estilo pixel se queda en lo que es RótULO (títulos,
 * botones, menús), que es donde aporta.
 */
html:lang(zh) body,
html:lang(zh-Hans) body,
html:lang(zh-Hant) body {
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
}
html:lang(zh) .logo .t1, html:lang(zh) .logo .t2,
html:lang(zh) .menu-item, html:lang(zh) .btn, html:lang(zh) .pill,
html:lang(zh) .xmode-play b, html:lang(zh) .pack-title,
html:lang(zh) .cell b, html:lang(zh) .pcard b, html:lang(zh) .pcard .tag,
html:lang(zh) .gen-tab, html:lang(zh) .tab, html:lang(zh) .prep-tab,
html:lang(zh) .answer, html:lang(zh) .about-logo, html:lang(zh) .banner h3,
html:lang(zh) .partner-card .nm, html:lang(zh) .toast, html:lang(zh) .splash,
html:lang(zh) .topbar .btn, html:lang(zh) .market-row .btn {
  font-family: 'Pixelify', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', system-ui, sans-serif;
}
/* ============ el mercado: sistema + jugadores ============ */
.xtrade-body { display: flex; flex-direction: column; min-height: 0; }
.xtrade-pane { min-height: 0; }
.xtrade-pane.hidden { display: none; }
.xtrade-pane .market-list { max-height: 42vh; }
.xtrade-pane .prep-cats { margin-bottom: 4px; }
.xtrade-pane .market-h { margin-top: 4px; }
@media (max-height: 520px) {
  .xtrade-pane .market-list { max-height: 30vh; }
}
/* ============ la mochila: el contenedor y la vista previa ============
 * 1) EL CONTENEDOR (lo que sale de una caja) es un panel de verdad: una
 *    bandeja oscura arriba de la mochila, con su cabecera y sus tarjetas
 *    claras. Antes era un tinted con un borde fino y se perdía en el papel.
 * 2) LA VISTA PREVIA (lo que acabas de coger) era una tira de 46 px: la foto
 *    grande del objeto (64 px) y la letra, para que se vea de qué va.
 */
.pack-pending {
  position: relative;
  background: linear-gradient(180deg, rgba(74,28,28,.95), rgba(44,17,17,.95));
  border: 2px solid #8a5050;
  border-radius: 10px;
  padding: 0 0 9px;
  margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.08);
  overflow: hidden;
}
.pack-pending-h {
  font-size: 12px; font-weight: 700; color: #ffd9d0;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; margin-bottom: 7px;
  background: rgba(0,0,0,.26);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.pack-pending-row { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 9px; }
.pack-pending-item {
  background: rgba(255,252,233,.94);
  border: 2px dashed rgba(150,90,80,.55);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.pack-pending-item.done { border-style: solid; border-color: #b9b185; }
.pack-pending-item.done:hover { background: #fffdf2; transform: translateY(-1px); }
.pack-pending-item.busy { opacity: .9; }
.pack-pending-ico img { width: 34px; height: 34px; }
.pack-pending-lens img { width: 34px; height: 34px; }
.pack-pending-item b { font-size: 13px; }
.pack-pending-size { font-size: 10px; }
.pack-pending-left { color: #ffd0c4; }

/* La vista previa: grande. */
.pack-picked {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.55);
  border: 2px solid #a9a37c; border-radius: 10px;
  padding: 9px 12px; margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.pack-picked-ico { flex: 0 0 auto; width: 64px; text-align: center; }
.pack-picked-ico img { image-rendering: pixelated; width: 56px; height: 56px; }
.pack-picked-txt b { display: block; font-size: 18px; color: #342e1c; }
.pack-picked-meta { display: block; font-size: 13px; color: #5b5236; }
.pack-picked-txt p { margin: 3px 0 0; font-size: 13px; color: #3f3722; }
.pack-picked-tag { flex: 0 0 auto; font-size: 11px; color: #7d7355; letter-spacing: .06em; }
.pack-picked-q { width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; }
/* El contenedor y la vista previa, algo más compactos (la mochila con un
   contenedor abierto es muy alta y en 720 px hay que desplazarse). */
.pack-picked-ico { width: 52px; }
.pack-picked-ico img { width: 44px; height: 44px; }
.pack-picked-txt b { font-size: 16px; }
.pack-picked-meta { font-size: 12px; }
.pack-picked-txt p { font-size: 12px; }
.pack-pending-item { width: 84px; min-height: 66px; }
.pack-pending-ico img, .pack-pending-lens img { width: 30px; height: 30px; }
.pack-pending-item b { font-size: 12px; }
/* ============ elegir mapa: la foto de la mapa ============
 * Antes era una lista con el nombre y un párrafo. Ahora cada mapa enseña su
 * FOTO: el terreno real (con sus árboles y su niebla) y los lugares marcados.
 */
.map-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: rgba(0,0,0,.25);
  border: 3px solid rgba(242,247,236,.18);
  border-radius: 12px; padding: 10px; margin-bottom: 14px;
}
.map-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,210,63,.25); }
.map-shot {
  display: block; width: 100%; max-width: 480px; height: auto;
  image-rendering: pixelated;
  border: 2px solid rgba(0,0,0,.55); border-radius: 6px;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
  background: #0b0d12;
}
.map-card-info { text-align: center; }
.map-card-info b { display: block; font-size: 20px; color: #fff; text-shadow: 2px 2px 0 var(--shadow); }
@media (max-width: 560px) { .map-card { padding: 8px; } }
/* ============ la pantalla del modo搜打撤, como la del menú ============
 * Antes era una caja verde en medio de la pantalla. Ahora es una página
 * entera: el escudo a un lado y los botones al otro, sobre el mundo (que
 * hace de cartel). La viñeta por encima le da el aire de «pantalla de inicio».
 */
#scr-xmode { justify-content: space-between; align-items: stretch; padding: 0; }
#scr-xmode::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: radial-gradient(ellipse at 28% 45%, rgba(0,0,0,0) 26%, rgba(3,10,6,.62) 100%);
}
.xmode-left {
  position: relative; z-index: 1;
  flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  padding: 30px; min-width: 0;
}
.xmode-left .logo { margin-bottom: 0; }
.xmode-right {
  position: relative; z-index: 1;
  width: min(460px, 100%); display: flex; flex-direction: column;
  padding: 70px 24px 18px; gap: 10px; overflow-y: auto;
  background: linear-gradient(90deg, rgba(5,10,25,0), rgba(5,10,25,.72) 34%);
}
.xmode-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.xmode-head h2 { flex: 1; margin: 0; }
.xmode-coins { color: var(--gold); font-size: 18px; font-weight: 700; }
.xmode-list { display: flex; flex-direction: column; gap: 6px; }
.xmode-box { width: min(560px, 100%); }
/* Las sub-páginas (elegir mapa, colección...) van a lo ancho de la columna. */
.xmode-page { margin-top: 6px; }
.xmode-page .map-card { max-width: 100%; }
.xmode-page .map-shot { max-width: 100%; }
@media (max-width: 860px) {
  #scr-xmode { flex-direction: column; overflow-y: auto; }
  .xmode-left { padding: 18px 10px 0; }
  .xmode-left .logo .t1 { font-size: 30px; }
  .xmode-right { width: 100%; padding: 56px 12px 14px; background: rgba(5,10,25,.62); }
}
@media (max-height: 520px) {
  .xmode-left { padding: 48px 8px 6px; }
  .xmode-left .logo .t1 { font-size: 28px; }
  .xmode-left .logo .t2 { font-size: 11px; letter-spacing: 2px; }
  .xmode-right { padding: 48px 10px 8px; gap: 5px; }
  .xmode-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
  .xmode-list .menu-item { grid-template-columns: 22px 1fr; column-gap: 6px; font-size: 15px; padding: 4px 6px; }
  .xmode-list .menu-item small { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .xmode-list .xmode-play { grid-column: span 2; }
}
