/* ==========================================================================
   Repe · estilos
   Concepto: carpeta de coleccionista + interfaz de combate Pokémon.
   - Display: Lilita One (títulos y marca)   - UI y números: Nunito
   - Amarillo carta (#FFCB05), rojo Poké Ball (#E3350D), azul noche (#1B2150)
   - Fuego = Compras (dinero que sale) · Agua = Ventas (dinero que entra)
   ========================================================================== */

:root {
  color-scheme: light;
  --font-display: "Lilita One", "Nunito", system-ui, sans-serif;
  --font-ui: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --bg: #F4EEE2;
  --bg-2: #EFE6D4;
  --surface: #FFFCF6;
  --surface-2: #F6F0E4;
  --surface-3: #ECE3D1;
  --ink: #1D1B26;
  --ink-2: #4D4A5A;
  --muted: #827C8C;
  --line: #E6DDCB;
  --line-2: #D6CAB2;
  --focus: #2A78D6;

  --yellow: #FFCB05;
  --yellow-2: #F2B705;
  --yellow-ink: #6B4E00;
  --red: #E3350D;
  --red-2: #B8290A;
  --navy: #1B2150;
  --navy-2: #262E6B;
  --navy-ink: #E9ECFF;

  /* Series de datos (validadas para daltonismo: azul/naranja) */
  --fire: #EB6834;      /* Compras */
  --water: #2A78D6;     /* Ventas */
  --bote: #4A3AA7;      /* Bote acumulado */
  --grid: #E6E0D2;
  --axis: #C9C0AC;

  /* Estado (siempre acompañado de icono + texto) */
  --good: #0CA30C;
  --good-ink: #0B6B1C;
  --good-bg: #DDF3E2;
  --warn: #FAB219;
  --warn-ink: #7A5200;
  --warn-bg: #FFF1CC;
  --bad: #D03B3B;
  --bad-ink: #A3201B;
  --bad-bg: #FBE0DE;

  /* Celdas "Resultado" como en el Excel original */
  --xl-green: #B7E1CD;
  --xl-red: #EA9999;
  --xl-head: #CFE2F3;
  --xl-month: #FFF2CC;

  /* Barra de PS (como en los juegos) */
  --hp-green: #3FCB5B;
  --hp-yellow: #F7C928;
  --hp-red: #EF4135;

  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(60, 40, 0, .04), 0 10px 30px -12px rgba(60, 40, 0, .18);
  --shadow-lg: 0 24px 60px -20px rgba(27, 33, 80, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sidebar: 248px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11131D;
  --bg-2: #161927;
  --surface: #1B1E2C;
  --surface-2: #232739;
  --surface-3: #2C3146;
  --ink: #F5F1E8;
  --ink-2: #C9C4D6;
  --muted: #9690A8;
  --line: #2D3145;
  --line-2: #3B4058;
  --navy: #0C0F24;
  --navy-2: #171C3D;
  --fire: #D95926;
  --water: #3987E5;
  --bote: #9085E9;
  --grid: #2A2E40;
  --axis: #3B4058;
  --good-ink: #5FD46F;
  --good-bg: rgba(12, 163, 12, .16);
  --warn-ink: #FFC94D;
  --warn-bg: rgba(250, 178, 25, .14);
  --bad-ink: #FF8A80;
  --bad-bg: rgba(208, 59, 59, .18);
  --xl-green: rgba(60, 190, 120, .28);
  --xl-red: rgba(234, 100, 100, .32);
  --xl-head: rgba(110, 160, 230, .16);
  --xl-month: rgba(255, 203, 5, .10);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #11131D;
    --bg-2: #161927;
    --surface: #1B1E2C;
    --surface-2: #232739;
    --surface-3: #2C3146;
    --ink: #F5F1E8;
    --ink-2: #C9C4D6;
    --muted: #9690A8;
    --line: #2D3145;
    --line-2: #3B4058;
    --navy: #0C0F24;
    --navy-2: #171C3D;
    --fire: #D95926;
    --water: #3987E5;
    --bote: #9085E9;
    --grid: #2A2E40;
    --axis: #3B4058;
    --good-ink: #5FD46F;
    --good-bg: rgba(12, 163, 12, .16);
    --warn-ink: #FFC94D;
    --warn-bg: rgba(250, 178, 25, .14);
    --bad-ink: #FF8A80;
    --bad-bg: rgba(208, 59, 59, .18);
    --xl-green: rgba(60, 190, 120, .28);
    --xl-red: rgba(234, 100, 100, .32);
    --xl-head: rgba(110, 160, 230, .16);
    --xl-month: rgba(255, 203, 5, .10);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 14px 34px -14px rgba(0, 0, 0, .6);
  }
}

/* ───────────────────────── Base ───────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--bg);
  /* Textura: Poké Balls muy suaves, como el papel de una carpeta de cartas */
  background-image:
    radial-gradient(1200px 500px at 85% -10%, rgba(255, 203, 5, .16), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(227, 53, 13, .07), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.035' stroke-width='2'%3E%3Ccircle cx='36' cy='36' r='14'/%3E%3Cpath d='M22 36h9m10 0h9'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] body { background-image: radial-gradient(1200px 500px at 85% -10%, rgba(255, 203, 5, .07), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.03' stroke-width='2'%3E%3Ccircle cx='36' cy='36' r='14'/%3E%3Cpath d='M22 36h9m10 0h9'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3C/g%3E%3C/svg%3E"); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background-image: radial-gradient(1200px 500px at 85% -10%, rgba(255, 203, 5, .07), transparent 60%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='.03' stroke-width='2'%3E%3Ccircle cx='36' cy='36' r='14'/%3E%3Cpath d='M22 36h9m10 0h9'/%3E%3Ccircle cx='36' cy='36' r='4'/%3E%3C/g%3E%3C/svg%3E"); }
}

h1, h2, h3, h4 { margin: 0; font-weight: 400; font-family: var(--font-display); letter-spacing: .01em; line-height: 1.1; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
[hidden] { display: none !important; } /* que «hidden» gane a los display de los componentes */

/* ───────────────────────── Splash ───────────────────────── */

.splash { min-height: 100vh; display: grid; place-items: center; gap: 14px; align-content: center; color: var(--muted); font-weight: 700; }
.pokeball-spin { width: 56px; height: 56px; animation: wobble 1.1s var(--ease) infinite; }

/* ───────────────────────── Shell ───────────────────────── */

.app { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar) 1fr; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: linear-gradient(170deg, var(--navy-2), var(--navy) 55%);
  color: var(--navy-ink);
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  overflow-y: auto;
  border-right: 4px solid var(--yellow);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; text-decoration: none; }
.brand svg { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .25)); overflow: visible; }
.wordmark {
  font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--yellow);
  text-shadow: 0 2px 0 #2B57B8, 2px 0 0 #2B57B8, -2px 0 0 #2B57B8, 0 -2px 0 #2B57B8, 2px 2px 0 #2B57B8, -2px 2px 0 #2B57B8, 0 5px 0 rgba(0, 0, 0, .3);
  letter-spacing: .02em;
}
.wordmark small { display: block; font-family: var(--font-ui); font-weight: 800; font-size: 10.5px; letter-spacing: .14em; color: rgba(233, 236, 255, .7); text-shadow: none; margin-top: 8px; text-transform: uppercase; line-height: 1.35; max-width: 150px; }
/* El «eco»: la palabra repetida detrás, en rojo y un poco desplazada (una repe) */
.wordmark b {
  position: relative; display: inline-block; font-weight: normal; letter-spacing: .04em; isolation: isolate;
  text-shadow: 0 2px 0 #2B57B8, 2px 0 0 #2B57B8, -2px 0 0 #2B57B8, 0 -2px 0 #2B57B8, 2px 2px 0 #2B57B8, -2px 2px 0 #2B57B8, 2px -2px 0 #2B57B8, -2px -2px 0 #2B57B8;
}
.wordmark b::before {
  content: attr(data-t); position: absolute; left: max(.13em, 5px); top: max(.11em, 4px); z-index: -1; color: var(--red);
  text-shadow: 0 2px 0 #1D1B26, 2px 0 0 #1D1B26, -2px 0 0 #1D1B26, 0 -2px 0 #1D1B26, 2px 2px 0 #1D1B26, -2px 2px 0 #1D1B26, 2px -2px 0 #1D1B26, -2px -2px 0 #1D1B26;
}
.nav { display: grid; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 14px;
  text-decoration: none; font-weight: 800; font-size: 15px;
  color: rgba(233, 236, 255, .78);
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.nav a svg { width: 21px; height: 21px; flex: none; opacity: .9; }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; transform: translateX(2px); }
.nav a.active { background: var(--yellow); color: var(--navy); box-shadow: 0 4px 0 var(--yellow-2), 0 10px 20px -10px rgba(0, 0, 0, .6); }
.nav-sep { height: 1px; background: rgba(255, 255, 255, .1); margin: 10px 8px; }
.side-foot { margin-top: auto; padding-top: 14px; }
.trainer {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08);
}
.trainer .partner { width: 46px; height: 46px; border-radius: 50%; background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, .25), rgba(255, 255, 255, .04)); display: grid; place-items: center; flex: none; overflow: hidden; }
.trainer .partner img { max-width: 40px; max-height: 40px; image-rendering: auto; }
.trainer b { display: block; font-size: 14px; color: #fff; line-height: 1.2; }
.trainer span { font-size: 12px; color: rgba(233, 236, 255, .6); }
.trainer button { margin-left: auto; background: none; border: 0; color: rgba(233, 236, 255, .7); padding: 6px; border-radius: 10px; }
.trainer button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.trainer button svg { width: 20px; height: 20px; }
.credit-mini { font-size: 11.5px; color: rgba(233, 236, 255, .5); padding: 12px 8px 0; line-height: 1.4; }
.credit-mini a { color: rgba(233, 236, 255, .75); }

.main { min-width: 0; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.topbar h1 { font-size: 34px; color: var(--ink); }
.topbar .sub { color: var(--muted); font-weight: 700; font-size: 14px; margin-top: 2px; }
.topbar .spacer { flex: 1; }
.page { max-width: 1180px; margin: 0 auto; }

.mobilebar { display: none; }
.bottomnav { display: none; }

/* Selector de año / mes */
.stepper { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px; box-shadow: var(--shadow); }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--ink-2); transition: background .15s; }
.stepper button:hover { background: var(--surface-2); color: var(--ink); }
.stepper button svg { width: 18px; height: 18px; }
.stepper span { min-width: 64px; text-align: center; font-weight: 900; font-size: 16px; padding: 0 4px; }
.stepper.wide span { min-width: 150px; }

/* ───────────────────────── Botones ───────────────────────── */

.btn {
  --b: var(--surface); --c: var(--ink); --s: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border-radius: 999px; border: 0;
  background: var(--b); color: var(--c);
  font-weight: 900; font-size: 15px; letter-spacing: .01em;
  box-shadow: 0 3px 0 var(--s), 0 8px 18px -12px rgba(0, 0, 0, .5);
  transition: transform .12s var(--ease), box-shadow .12s, filter .15s;
  text-decoration: none; white-space: nowrap;
  border: 1px solid transparent;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--s); }
.btn svg { width: 19px; height: 19px; flex: none; }
.btn.primary { --b: var(--red); --c: #fff; --s: var(--red-2); }
.btn.fire { --b: var(--fire); --c: #fff; --s: #B8481E; }
.btn.water { --b: var(--water); --c: #fff; --s: #1D5AA6; }
.btn.yellow { --b: var(--yellow); --c: var(--navy); --s: var(--yellow-2); }
.btn.ghost { --b: transparent; --s: transparent; box-shadow: none; border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { --b: var(--surface); --c: var(--bad-ink); --s: var(--line-2); border-color: var(--bad-bg); }
.btn.sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.btn.lg { min-height: 56px; padding: 14px 24px; font-size: 17px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.danger:hover { background: var(--bad-bg); color: var(--bad-ink); }
.link-btn { background: none; border: 0; padding: 0; font-weight: 800; color: var(--water); text-decoration: underline; text-underline-offset: 3px; }

/* ───────────────────────── Tarjetas ───────────────────────── */

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.home { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 18px; align-content: start; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; position: relative; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 12px; row-gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head > div:not([class]) { flex: 1 1 200px; min-width: 0; }
.card-head > .spacer { flex: 0 1 0; }
.card-head h2, .card-head h3 { font-size: 21px; }
.card-head .desc { color: var(--muted); font-size: 13.5px; font-weight: 600; margin-top: 2px; font-family: var(--font-ui); }
.card-head .spacer { flex: 1; }
.card-head .mascot-sm { width: 54px; height: 54px; margin: -8px -4px -8px -6px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15)); }
.card.tight { padding: 14px; }
.card.flat { box-shadow: none; }

/* Aparición escalonada */
.reveal > * { animation: rise .55s var(--ease) both; }
.reveal > *:nth-child(2) { animation-delay: .05s; }
.reveal > *:nth-child(3) { animation-delay: .1s; }
.reveal > *:nth-child(4) { animation-delay: .15s; }
.reveal > *:nth-child(5) { animation-delay: .2s; }
.reveal > *:nth-child(6) { animation-delay: .25s; }
.reveal > *:nth-child(n+7) { animation-delay: .3s; }

/* ───────────────────────── Stat tiles ───────────────────────── */

.stat { display: grid; gap: 4px; padding: 16px 18px; }
.stat .label { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--ink-2); font-size: 14px; }
.stat .value { font-weight: 900; font-size: 30px; letter-spacing: -.01em; line-height: 1.1; }
.stat .value small { font-size: 16px; font-weight: 800; }
.stat .hint { font-size: 12.5px; color: var(--muted); font-weight: 700; }

/* Iconos de tipo (energías) */
.type { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .2); }
.type svg { width: 13px; height: 13px; fill: #fff; }
.type.fire { background: var(--fire); }
.type.water { background: var(--water); }
.type.electric { background: #F2B705; }
.type.electric svg { fill: #3A2A00; }
.type.ghost { background: #6D4FA8; }
.type.psychic { background: #E25C9A; }
.type.normal { background: #A8A290; }
.type.grass { background: #3DA35D; }
.type.lg { width: 30px; height: 30px; }
.type.lg svg { width: 17px; height: 17px; }

/* ───────────────────────── Estado / badges ───────────────────────── */

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; white-space: nowrap; }
.badge svg { width: 14px; height: 14px; }
.badge.good { background: var(--good-bg); color: var(--good-ink); }
.badge.warn { background: var(--warn-bg); color: var(--warn-ink); }
.badge.bad { background: var(--bad-bg); color: var(--bad-ink); }
.badge.neutral { background: var(--surface-2); color: var(--ink-2); }
.pos { color: var(--good-ink); }
.neg { color: var(--bad-ink); }

/* ───────────────────────── Héroe: carta + barra de PS ───────────────────────── */

.tcg {
  position: relative; border-radius: 26px; padding: 10px;
  background: linear-gradient(145deg, #FFE15A, var(--yellow) 30%, #F0B400 70%, #FFD93B);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255, 255, 255, .5);
  isolation: isolate;
}
.tcg-inner {
  position: relative; border-radius: 18px; overflow: hidden;
  background: var(--surface);
  display: grid; grid-template-columns: minmax(170px, 36%) 1fr;
  min-height: 300px;
}
.tcg-art {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, #FFE8A3, #FF9A4D 55%, #E4502A);
  border-right: 3px solid rgba(0, 0, 0, .08);
}
.tcg-art.water { background: radial-gradient(circle at 50% 60%, #CFE9FF, #69B3F2 55%, #2A78D6); }
.tcg-art.calm { background: radial-gradient(circle at 50% 60%, #FFF6D5, #F8D768 55%, #E3A817); }
.tcg-art.sleep { background: radial-gradient(circle at 50% 60%, #E6F1F7, #9FC4D6 55%, #5E8BA6); }
.tcg-art::before { /* rayos de fondo */
  content: ""; position: absolute; inset: -40%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .16) 0 10deg, transparent 10deg 24deg);
  animation: spin 40s linear infinite;
}
.tcg-art .mascot { position: relative; width: min(230px, 88%); filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .28)); animation: float 4s ease-in-out infinite; }
.tcg-art .stage-tag {
  position: absolute; left: 12px; top: 12px; z-index: 1;
  background: rgba(255, 255, 255, .88); color: var(--navy); border-radius: 999px;
  font-size: 12px; font-weight: 900; padding: 4px 10px; letter-spacing: .02em;
}
.tcg-art.shake .mascot { animation: shake .6s var(--ease) 2, float 4s ease-in-out .9s infinite; }
.tcg-art.evolve::after { content: ""; position: absolute; inset: 0; background: #fff; animation: flash 1.1s var(--ease) forwards; }
.tcg-body { padding: 20px 24px 18px; display: grid; gap: 14px; align-content: start; }
.tcg-top { display: flex; align-items: flex-start; gap: 12px; }
.tcg-top .who { font-weight: 900; color: var(--ink-2); font-size: 14px; text-transform: uppercase; letter-spacing: .08em; }
.tcg-top h2 { font-size: 30px; margin-top: 2px; }
.tcg-top .spacer { flex: 1; }
.hero-figure { display: grid; gap: 2px; }
.hero-figure .lbl { font-weight: 800; color: var(--ink-2); font-size: 15px; }
.hero-figure .val { font-weight: 900; font-size: clamp(44px, 6vw, 62px); line-height: 1; letter-spacing: -.02em; }
.hero-figure .val .cents { font-size: .5em; letter-spacing: 0; }
.hero-figure.neg .val { color: var(--bad-ink); }

/* Barra de PS */
.hp { display: grid; gap: 6px; }
.hp-row { display: flex; align-items: center; gap: 8px; }
.hp-tag { background: linear-gradient(#F9C23C, #E59A00); color: #3A2600; font-weight: 900; font-size: 13px; padding: 2px 9px; border-radius: 8px 4px 4px 8px; letter-spacing: .04em; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); }
.hp-track { flex: 1; height: 16px; border-radius: 999px; background: #3A3F4D; padding: 3px; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .35); }
.hp-fill {
  height: 100%; border-radius: 999px; width: calc(var(--p, 1) * 100%);
  background: var(--hp-green);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .12);
  transition: width .9s var(--spring), background-color .4s;
}
.hp.yellow .hp-fill { background: var(--hp-yellow); }
.hp.red .hp-fill { background: var(--hp-red); }
.hp.zero .hp-fill { width: 0; }
.hp-nums { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; color: var(--ink-2); }
.hp-nums b { color: var(--ink); }

/* "Ataques": desglose del mes */
.moves { display: grid; gap: 2px; border-top: 2px solid var(--line); padding-top: 8px; }
.move { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-weight: 800; }
.move:last-child { border-bottom: 0; }
.move span { flex: 1; color: var(--ink-2); }
.move b { font-size: 17px; font-weight: 900; }
.flavor { font-style: italic; font-weight: 700; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; }
.flavor strong { font-style: normal; }

.budget-slider { display: grid; gap: 8px; background: var(--surface-2); border-radius: 16px; padding: 12px 14px; }
.budget-slider .row { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.budget-slider .row .spacer { flex: 1; }

/* Holo: brillo de carta brillante al pasar el ratón */
.holo { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2; opacity: 0; transition: opacity .3s; mix-blend-mode: color-dodge;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 120, 200, .35) 36%, rgba(120, 220, 255, .38) 46%, rgba(255, 255, 140, .35) 56%, transparent 72%);
  background-size: 250% 250%; background-position: var(--hx, 50%) var(--hy, 50%); }
.tcg:hover .holo { opacity: .55; }

.quick-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }

/* ───────────────────────── Listas de movimientos ───────────────────────── */

.mov-list { display: grid; gap: 2px; }
.mov-item {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 8px; border-radius: 14px; cursor: pointer; transition: background .15s;
  border: 0; background: transparent; text-align: left; width: 100%;
}
.mov-item:hover { background: var(--surface-2); }
.mov-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; }
.mov-ico.compra { background: rgba(235, 104, 52, .14); }
.mov-ico.venta { background: rgba(42, 120, 214, .14); }
.mov-ico svg { width: 19px; height: 19px; }
.mov-item > span:last-child > svg { width: 18px; height: 18px; color: var(--muted); }
.mov-ico.compra svg { fill: var(--fire); }
.mov-ico.venta svg { fill: var(--water); }
.mov-main { min-width: 0; }
.mov-main b { display: block; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-main span { display: block; font-size: 13px; color: var(--muted); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mov-amt { font-weight: 900; text-align: right; white-space: nowrap; }
.mov-amt small { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }

/* ───────────────────────── Barras horizontales (fugas) ───────────────────────── */

.hbars { display: grid; gap: 12px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 150px) 1fr auto; gap: 12px; align-items: center; font-weight: 800; font-size: 14px; }
.hbar .lbl { display: flex; align-items: center; gap: 8px; color: var(--ink-2); min-width: 0; }
.hbar .lbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .track { height: 14px; border-radius: 0 4px 4px 0; background: var(--surface-2); position: relative; }
.hbar .fill { position: absolute; left: 0; top: 0; bottom: 0; max-width: 100%; border-radius: 0 4px 4px 0; background: var(--fire); transition: width .7s var(--ease); }
.hbar .val { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hbar .val small { color: var(--muted); font-weight: 700; margin-left: 4px; }
.seg-tabs { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-tabs button { border: 0; background: transparent; padding: 6px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.seg-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; font-weight: 700; font-size: 14.5px; }
.alert > svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.alert img { width: 46px; height: 46px; margin: -6px 0 -6px -4px; flex: none; }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); }
.alert.bad { background: var(--bad-bg); color: var(--bad-ink); }
.alert.good { background: var(--good-bg); color: var(--good-ink); }
.alert.info { background: var(--xl-head); color: var(--ink); }
.alert b { font-weight: 900; }

/* ───────────────────────── Gráficas ───────────────────────── */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .base-line { stroke: var(--axis); stroke-width: 1; }
.chart .zero-line { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
.chart text { fill: var(--muted); font: 700 11.5px var(--font-ui); font-variant-numeric: tabular-nums; }
.chart text.x.current { fill: var(--ink); font-weight: 900; }
.chart text.dl { fill: var(--ink); font-weight: 900; font-size: 12px; }
.chart .bar-c { fill: var(--fire); }
.chart .bar-v { fill: var(--water); }
.chart .budget-tick { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:hover, .chart .hit:focus { fill: var(--ink); fill-opacity: .045; }
.chart .line { fill: none; stroke: var(--bote); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area-pos { fill: var(--bote); fill-opacity: .1; }
.chart .area-neg { fill: var(--bad); fill-opacity: .12; }
.chart .dot { fill: var(--bote); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; opacity: .5; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 800; font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend i.c { background: var(--fire); }
.legend i.v { background: var(--water); }
.legend i.b { height: 2px; width: 16px; border-radius: 2px; background: var(--ink); }
.legend img { width: 26px; height: 26px; margin: -6px -2px; object-fit: contain; }

#tooltip {
  position: fixed; z-index: 90; pointer-events: none;
  background: var(--ink); color: var(--surface);
  border-radius: 12px; padding: 10px 12px; min-width: 170px;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, .45);
  font-size: 13px; font-weight: 700;
  transform: translate(-50%, calc(-100% - 14px));
}
:root[data-theme="dark"] #tooltip { background: #F5F1E8; color: #1B1E2C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #tooltip { background: #F5F1E8; color: #1B1E2C; } }
#tooltip .tt-title { font-weight: 900; margin-bottom: 6px; font-size: 13.5px; }
#tooltip .tt-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 1px 0; }
#tooltip .tt-row span { display: inline-flex; align-items: center; gap: 6px; opacity: .8; }
#tooltip .tt-row b { font-weight: 900; font-variant-numeric: tabular-nums; }
#tooltip .key { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
#tooltip .tt-hint { opacity: .6; font-size: 11.5px; margin-top: 6px; }

/* ───────────────────────── Tabla (estilo Excel, pero bonita) ───────────────────────── */

.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.xl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14.5px; }
table.xl th {
  text-align: left; font-weight: 900; font-size: 13px; color: var(--ink);
  background: var(--xl-head); padding: 10px 8px; white-space: nowrap;
  border-bottom: 2px solid var(--line-2); position: sticky; top: 0;
}
table.xl th:first-child { border-top-left-radius: 12px; }
table.xl th:last-child { border-top-right-radius: 12px; }
table.xl th.r, table.xl td.r { text-align: right; }
table.xl th button { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
table.xl th button svg { width: 13px; height: 13px; opacity: .55; }
table.xl td { padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; font-weight: 700; }
table.xl tbody tr { transition: background .12s; }
table.xl tbody tr:hover { background: var(--surface-2); }
table.xl tr.clickable { cursor: pointer; }
table.xl td.month { background: var(--xl-month); font-weight: 900; white-space: nowrap; }
table.xl td.month a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
table.xl td.month a:hover { text-decoration: underline; }
table.xl tr.now td.month { box-shadow: inset 4px 0 0 var(--red); }
table.xl tfoot td { font-weight: 900; border-top: 2px solid var(--line-2); border-bottom: 0; background: var(--surface-2); }
table.xl .res { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 88px; padding: 4px 10px; border-radius: 8px; font-weight: 900; color: var(--ink); }
table.xl .res.pos { background: var(--xl-green); }
table.xl .res.neg { background: var(--xl-red); }
table.xl .res svg { width: 13px; height: 13px; }
table.xl td.notes { max-width: 260px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.xl .cell-in {
  width: 100%; min-width: 78px; border: 1px solid transparent; background: transparent; border-radius: 8px;
  padding: 6px 8px; font-weight: 800; text-align: right; transition: border-color .15s, background .15s;
}
table.xl .cell-in:hover { border-color: var(--line-2); background: var(--surface); }
table.xl .cell-in:focus { border-color: var(--focus); background: var(--surface); outline: none; box-shadow: 0 0 0 3px rgba(42, 120, 214, .18); }
table.xl .cell-in.text { text-align: left; min-width: 130px; font-weight: 600; }
table.xl .cell-in.auto { color: var(--muted); }
table.xl .actions { white-space: nowrap; text-align: right; width: 1%; }
table.xl .actions .icon-btn { width: 32px; height: 32px; }
table.xl tr:not(:hover) .actions .icon-btn { opacity: .45; }

/* Tarjetas de mes en móvil (sustituyen a la tabla del resumen) */
.month-cards { display: none; gap: 10px; }
.month-card { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 8px; background: var(--surface); }
.month-card.now { border-color: var(--red); box-shadow: inset 4px 0 0 var(--red); }
.month-card .mc-top { display: flex; align-items: center; gap: 8px; }
.month-card .mc-top b { font-family: var(--font-display); font-size: 20px; font-weight: 400; }
.month-card .mc-top .spacer { flex: 1; }
.month-card .mc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.month-card .mc-grid b { display: block; color: var(--ink); font-size: 15px; font-weight: 900; }
.month-card .mc-budget { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14px; }
.month-card .mc-budget input { width: 110px; }

/* ───────────────────────── Meses: pestañas y filtros ───────────────────────── */

.month-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin-bottom: 8px; scrollbar-width: thin; }
.month-tab {
  flex: none; display: grid; gap: 5px; justify-items: center; min-width: 64px;
  padding: 9px 10px 8px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 900; font-size: 14px; color: var(--ink-2);
  transition: transform .15s var(--spring), border-color .15s, background .15s;
}
.month-tab:hover { transform: translateY(-2px); border-color: var(--line-2); }
.month-tab.on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 4px 0 var(--yellow); }
.month-tab .mini { width: 38px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.month-tab .mini i { display: block; height: 100%; border-radius: 99px; background: var(--hp-green); }
.month-tab .mini i.yellow { background: var(--hp-yellow); }
.month-tab .mini i.red { background: var(--hp-red); }
.month-tab .mini.none { opacity: .4; }
.month-tab.year { min-width: 92px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search { position: relative; flex: 1 1 240px; min-width: 200px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); }
.search input[type="search"] { padding-left: 40px; }
.filters select { flex: 0 1 auto; width: auto; min-width: 130px; }
.result-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-weight: 800; font-size: 14px; color: var(--ink-2); padding: 12px 4px 0; }
.result-bar b { color: var(--ink); }

.month-summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.month-summary .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.month-summary .stat .value { font-size: 22px; }

/* ───────────────────────── Formularios ───────────────────────── */

.field { display: grid; gap: 6px; }
.field > label, .field > .label { font-weight: 900; font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.field > label small, .field > .label small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.input, input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="search"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1.5px solid var(--line-2); border-radius: 14px;
  background: var(--surface); color: var(--ink);
  font-weight: 700; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 76px; resize: vertical; line-height: 1.4; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23827C8C' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px rgba(42, 120, 214, .16); }
input::placeholder, textarea::placeholder { color: var(--muted); font-weight: 600; opacity: .85; }
.field .help { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.field .err { font-size: 13px; color: var(--bad-ink); font-weight: 800; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* Importe grande */
.money-in { position: relative; }
.money-in input { font-size: 34px; font-weight: 900; min-height: 66px; padding-right: 48px; letter-spacing: -.01em; text-align: left; }
.money-in .cur { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 26px; color: var(--muted); pointer-events: none; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  padding: 7px 13px; border-radius: 999px; font-weight: 800; font-size: 14px;
  transition: background .12s, border-color .12s, color .12s, transform .12s var(--spring);
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip:active { transform: scale(.96); }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); box-shadow: 0 2px 0 var(--yellow); }
.chip.add { border-style: dashed; }

/* Segmentado Compra / Venta */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: var(--surface-2); padding: 6px; border-radius: 18px; }
.seg button { border: 0; border-radius: 14px; padding: 12px 10px; font-weight: 900; font-size: 16px; background: transparent; color: var(--ink-2); display: flex; align-items: center; justify-content: center; gap: 8px; transition: background .2s, color .2s, box-shadow .2s; }
.seg button small { display: block; font-weight: 700; font-size: 12px; opacity: .85; }
.seg button .type { width: 26px; height: 26px; }
.seg button > svg { width: 20px; height: 20px; flex: none; }
.seg button.on.compra { background: var(--fire); color: #fff; box-shadow: 0 3px 0 #B8481E; }
.seg button.on.venta { background: var(--water); color: #fff; box-shadow: 0 3px 0 #1D5AA6; }
.seg button.on .type { box-shadow: 0 0 0 2px rgba(255, 255, 255, .7); }

/* Contador +/- */
.counter { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 14px; overflow: hidden; background: var(--surface); }
.counter button { width: 44px; height: 44px; border: 0; background: var(--surface-2); font-weight: 900; font-size: 20px; color: var(--ink-2); }
.counter button:hover { background: var(--surface-3); }
.counter input { width: 64px; border: 0; text-align: center; min-height: 44px; border-radius: 0; padding: 0; font-weight: 900; }
.counter input:focus { box-shadow: none; }

/* Interruptor */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 800; }
.switch input { appearance: none; width: 52px; height: 30px; border-radius: 999px; background: var(--surface-3); position: relative; flex: none; transition: background .2s; border: 0; min-height: 0; padding: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .25); transition: transform .25s var(--spring); }
.switch input:checked { background: var(--good); }
.switch input:checked::after { transform: translateX(22px); }

/* Potenciómetros: deslizadores con Poké Ball */
.slider-field { display: grid; gap: 8px; }
.slider-field .top { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.slider-field .top label { flex: 1; font-size: 14.5px; }
.slider-field .top .num-in { width: 108px; min-height: 38px; padding: 6px 10px; text-align: right; font-weight: 900; border-radius: 10px; }
.slider-field .scale { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); font-weight: 700; }
input[type="range"].poke {
  -webkit-appearance: none; appearance: none; width: 100%; height: 34px; background: transparent; margin: 0; padding: 0; border: 0; min-height: 0;
  --fill: 50%; --tc: var(--yellow);
}
input[type="range"].poke:focus { box-shadow: none; }
input[type="range"].poke::-webkit-slider-runnable-track {
  height: 12px; border-radius: 999px;
  background: linear-gradient(90deg, var(--tc) 0 var(--fill), var(--surface-3) var(--fill) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
input[type="range"].poke::-moz-range-track { height: 12px; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18); }
input[type="range"].poke::-moz-range-progress { height: 12px; border-radius: 999px; background: var(--tc); }
input[type="range"].poke::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 50%; margin-top: -9px;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 3.5px, #1D1B26 4px 6px, transparent 6.5px),
    linear-gradient(180deg, var(--red) 0 44%, #1D1B26 44% 56%, #fff 56% 100%);
  border: 2.5px solid #1D1B26; box-shadow: 0 3px 6px rgba(0, 0, 0, .3);
  transition: transform .15s var(--spring);
  cursor: grab;
}
input[type="range"].poke::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 3.5px, #1D1B26 4px 6px, transparent 6.5px),
    linear-gradient(180deg, var(--red) 0 44%, #1D1B26 44% 56%, #fff 56% 100%);
  border: 2.5px solid #1D1B26; box-shadow: 0 3px 6px rgba(0, 0, 0, .3); cursor: grab;
}
input[type="range"].poke:active::-webkit-slider-thumb { transform: scale(1.15) rotate(-20deg); cursor: grabbing; }
input[type="range"].poke:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(42, 120, 214, .35); }
input[type="range"].poke.fire { --tc: var(--fire); }
input[type="range"].poke.water { --tc: var(--water); }
input[type="range"].poke.violet { --tc: var(--bote); }

/* ───────────────────────── Modales y hojas ───────────────────────── */

.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgba(17, 19, 34, .55);
  display: grid; place-items: center; padding: 20px;
  animation: fade .2s ease both; backdrop-filter: blur(3px);
}
.overlay.closing { animation: fade .18s ease reverse both; }
.sheet {
  width: min(600px, 100%); max-height: min(92vh, 900px); overflow: auto;
  background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-lg);
  animation: pop .32s var(--spring) both;
  display: flex; flex-direction: column;
}
.sheet.wide { width: min(760px, 100%); }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 6px; position: sticky; top: 0; background: var(--surface); z-index: 2; }
.sheet-head h2 { font-size: 25px; flex: 1; }
.sheet-head img { width: 52px; height: 52px; margin: -10px -4px -10px -8px; object-fit: contain; }
.sheet-body { padding: 10px 20px 18px; display: grid; gap: 16px; }
.sheet-foot { display: flex; gap: 10px; flex-wrap: wrap; padding: 12px 20px 18px; position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); z-index: 2; }
.sheet-foot .spacer { flex: 1; }
.grabber { display: none; }

/* ───────────────────────── Avisos (toasts) ───────────────────────── */

#saving { position: fixed; z-index: 95; right: 16px; top: 14px; background: var(--ink); color: var(--surface); font-weight: 800; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; opacity: 0; transform: translateY(-6px); transition: opacity .2s, transform .2s; pointer-events: none; }
.is-saving #saving { opacity: .92; transform: none; transition-delay: .25s; }
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 26px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--surface); border-radius: 16px; padding: 12px 14px 12px 16px;
  font-weight: 800; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .5);
  animation: toastIn .35s var(--spring) both;
}
:root[data-theme="dark"] .toast { background: #F5F1E8; color: #1B1E2C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .toast { background: #F5F1E8; color: #1B1E2C; } }
.toast.out { animation: toastOut .25s ease both; }
.toast .t-msg { flex: 1; }
.toast button { background: var(--yellow); color: var(--navy); border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 900; }
.toast.error { background: var(--bad); color: #fff; }

/* ───────────────────────── Estados vacíos ───────────────────────── */

.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: 26px 16px; }
.empty img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .15)); animation: float 4s ease-in-out infinite; }
.empty h3 { font-size: 22px; }
.empty p { color: var(--ink-2); font-weight: 700; max-width: 380px; }

/* ───────────────────────── Autenticación ───────────────────────── */

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: #fff; padding: 48px 56px;
  background: radial-gradient(circle at 70% 30%, #34409A, var(--navy) 60%);
  display: flex; flex-direction: column; justify-content: space-between; gap: 30px;
}
.auth-hero::before { content: ""; position: absolute; inset: -30%; background: repeating-conic-gradient(from 10deg at 70% 40%, rgba(255, 255, 255, .04) 0 8deg, transparent 8deg 22deg); animation: spin 90s linear infinite; }
.auth-hero > * { position: relative; }
.auth-hero .brand { padding: 0; }
.auth-hero .brand svg { width: 64px; height: 64px; }
.auth-hero .wordmark { font-size: 54px; }
.auth-hero .wordmark small { font-size: 13px; max-width: none; }
.auth-hero h1 { font-size: clamp(36px, 4.2vw, 58px); line-height: 1.02; max-width: 560px; }
.auth-hero h1 em { font-style: normal; color: var(--yellow); }
.auth-hero p.lead { font-size: 18px; font-weight: 700; color: rgba(233, 236, 255, .85); max-width: 470px; margin-top: 16px; }
.auth-feats { display: grid; gap: 10px; max-width: 470px; }
.auth-feats div { display: flex; gap: 12px; align-items: center; font-weight: 800; color: rgba(233, 236, 255, .9); }
.auth-feats .type { width: 30px; height: 30px; }
.auth-feats .type svg { width: 16px; height: 16px; }
.auth-gang { position: relative; height: 230px; }
.auth-gang img { position: absolute; filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .45)); animation: float 5s ease-in-out infinite; }
.auth-gang img:nth-child(1) { width: 210px; left: 0; bottom: 0; }
.auth-gang img:nth-child(2) { width: 150px; left: 190px; bottom: 20px; animation-delay: -1.3s; }
.auth-gang img:nth-child(3) { width: 130px; left: 330px; bottom: 0; animation-delay: -2.6s; }
.auth-gang img:nth-child(4) { width: 110px; left: 450px; bottom: 40px; animation-delay: -3.4s; }
.auth-side { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: min(440px, 100%); }
.auth-card .tcg-inner { display: block; min-height: 0; padding: 26px 24px 22px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--surface-2); padding: 5px; border-radius: 16px; margin-bottom: 20px; }
.auth-tabs a { text-align: center; text-decoration: none; padding: 10px; border-radius: 12px; font-weight: 900; color: var(--ink-2); }
.auth-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
.auth-form { display: grid; gap: 14px; }
.auth-form h2 { font-size: 28px; }
.auth-form .lead { color: var(--ink-2); font-weight: 700; }
.auth-foot { text-align: center; font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.form-error { background: var(--bad-bg); color: var(--bad-ink); border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 14px; }
.form-ok { background: var(--good-bg); color: var(--good-ink); border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 14px; }

/* Selector de compañero Pokémon */
.partners { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.partner-opt {
  border: 2px solid var(--line); background: var(--surface-2); border-radius: 14px; aspect-ratio: 1;
  display: grid; place-items: center; padding: 2px; transition: transform .15s var(--spring), border-color .15s, background .15s;
}
.partner-opt img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.partner-opt:hover { transform: translateY(-2px); }
.partner-opt.on { border-color: var(--red); background: rgba(227, 53, 13, .1); box-shadow: 0 3px 0 var(--red); }

/* ───────────────────────── Onboarding ───────────────────────── */

.onb { text-align: center; display: grid; gap: 16px; justify-items: center; }
.onb .big-mascot { width: 150px; height: 150px; object-fit: contain; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .2)); animation: float 4s ease-in-out infinite; }
.onb h2 { font-size: 30px; }
.onb p { color: var(--ink-2); font-weight: 700; max-width: 440px; }
.onb .slider-field { width: 100%; text-align: left; }
.onb-dots { display: flex; gap: 6px; justify-content: center; }
.onb-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); }
.onb-dots i.on { background: var(--red); width: 22px; border-radius: 99px; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.choice {
  border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px; text-align: left;
  display: grid; gap: 6px; transition: border-color .15s, transform .15s var(--spring), box-shadow .15s;
}
.choice:hover { transform: translateY(-2px); }
.choice b { font-size: 16px; font-weight: 900; }
.choice span { font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.choice.on { border-color: var(--good); box-shadow: 0 3px 0 var(--good); }
.choice .tag { justify-self: start; }
.big-num { font-weight: 900; font-size: 46px; line-height: 1; }

/* ───────────────────────── Calculadora ───────────────────────── */

.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.calc-inputs { display: grid; gap: 18px; }
.result-card { position: sticky; top: 20px; }
.result-big { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 8px 0 14px; }
.result-big .lbl { font-weight: 900; color: var(--ink-2); }
.result-big .val { font-weight: 900; font-size: clamp(50px, 7vw, 76px); line-height: 1; letter-spacing: -.02em; }
.result-big .per { font-weight: 800; color: var(--muted); }
.calc-steps { display: grid; gap: 8px; }
.calc-step { display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 800; font-size: 14.5px; }
.calc-step .n { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 13px; flex: none; }
.calc-step span { flex: 1; color: var(--ink-2); }
.calc-step b { white-space: nowrap; }

/* ───────────────────────── Ayuda ───────────────────────── */

.help-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.help-hero img { width: 120px; height: 120px; object-fit: contain; }
.help-hero h2 { font-size: 30px; }
.help-hero p { color: var(--ink-2); font-weight: 700; margin-top: 6px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step3 { background: var(--surface-2); border-radius: 18px; padding: 16px; display: grid; gap: 8px; align-content: start; }
.step3 .n { width: 34px; height: 34px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 900; box-shadow: 0 3px 0 var(--red-2); }
.step3 b { font-size: 16px; }
.step3 p { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface-2); border-radius: 14px; padding: 2px 14px; }
.faq summary { cursor: pointer; font-weight: 900; padding: 12px 0; list-style: none; display: flex; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; font-size: 20px; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p, .faq details ul { color: var(--ink-2); font-weight: 600; padding-bottom: 12px; font-size: 14.5px; }
.faq details ul { margin: 0; padding-left: 20px; }
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.gloss div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.gloss b { color: var(--ink); font-weight: 900; margin-right: 6px; }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────────────────────── Importar ───────────────────────── */

.drop {
  border: 2.5px dashed var(--line-2); border-radius: 20px; padding: 26px; text-align: center; display: grid; gap: 10px; justify-items: center;
  background: var(--surface-2); transition: border-color .15s, background .15s; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--water); background: rgba(42, 120, 214, .06); }
.drop img { width: 90px; height: 90px; object-fit: contain; }
.drop b { font-size: 17px; }
.preview-table { max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 14px; }
.preview-table table.xl th { top: 0; z-index: 1; }
.preview-table table.xl th:first-child, .preview-table table.xl th:last-child { border-radius: 0; }

/* ───────────────────────── Animaciones ───────────────────────── */

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-18deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(4deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px) rotate(-3deg); } 40% { transform: translateX(7px) rotate(2deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes flash { 0% { opacity: 0; } 20% { opacity: .95; } 100% { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }

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

/* ───────────────────────── Responsive ───────────────────────── */

@media (max-width: 1180px) {
  .grid.home { grid-template-columns: 1fr; }
  .month-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
  :root { --sidebar: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 76px 16px 112px; }
  .mobilebar {
    display: flex; align-items: center; gap: 10px;
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px 14px;
    background: linear-gradient(170deg, var(--navy-2), var(--navy));
    border-bottom: 3px solid var(--yellow);
    color: #fff;
  }
  .mobilebar .brand { padding: 0; gap: 8px; }
  .mobilebar .brand svg { width: 36px; height: 36px; }
  .mobilebar .wordmark { font-size: 27px; }
  .mobilebar .wordmark small { display: none; }
  .mobilebar .spacer { flex: 1; }
  .mobilebar .stepper { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .15); box-shadow: none; padding: 2px; }
  .mobilebar .stepper button { color: #fff; width: 30px; height: 30px; }
  .mobilebar .stepper button:hover { background: rgba(255, 255, 255, .12); }
  .mobilebar .stepper span { min-width: 48px; color: #fff; font-size: 15px; }
  .mobilebar .me { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .12); display: grid; place-items: center; border: 0; overflow: hidden; }
  .mobilebar .me img { max-width: 34px; max-height: 34px; }
  .bottomnav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .4);
  }
  .bottomnav a, .bottomnav button.tab {
    display: grid; justify-items: center; gap: 2px; padding: 6px 2px; text-decoration: none;
    font-size: 11.5px; font-weight: 900; color: var(--muted); background: none; border: 0; border-radius: 12px;
  }
  .bottomnav a svg, .bottomnav button.tab svg { width: 23px; height: 23px; }
  .bottomnav a.active { color: var(--red); }
  .fab {
    justify-self: center; width: 66px; height: 66px; margin-top: -30px; border-radius: 50%; border: 4px solid var(--surface);
    background: none; padding: 0; box-shadow: 0 10px 22px -8px rgba(0, 0, 0, .55); position: relative;
  }
  .fab svg { width: 100%; height: 100%; display: block; }
  .fab .plus { position: absolute; right: -4px; top: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-weight: 900; font-size: 18px; line-height: 1; box-shadow: 0 2px 0 var(--yellow-2); }
  .topbar { margin-bottom: 16px; }
  .topbar h1 { font-size: 28px; }
  .topbar .year-desk { display: none; }
  .grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calc-grid { grid-template-columns: 1fr; }
  .result-card { position: static; }
  #toasts { bottom: 20px; }
  body:has(.bottomnav) #toasts { bottom: 96px; }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { padding: 26px 20px 0; gap: 16px; }
  .auth-hero h1 { font-size: 32px; }
  .auth-hero p.lead { font-size: 15.5px; margin-top: 10px; }
  .auth-feats { display: none; }
  .auth-gang { height: 150px; margin: 0 -10px; }
  .auth-gang img:nth-child(1) { width: 140px; }
  .auth-gang img:nth-child(2) { width: 100px; left: 120px; }
  .auth-gang img:nth-child(3) { width: 90px; left: 210px; }
  .auth-gang img:nth-child(4) { width: 76px; left: 290px; }
  .auth-side { padding: 0 14px 30px; margin-top: -16px; }
}

@media (min-width: 1024px) {
  .fab-desk-hide { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 16px; border-radius: 18px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .tcg { padding: 7px; border-radius: 22px; }
  .tcg-inner { grid-template-columns: 1fr; border-radius: 16px; }
  .tcg-art { min-height: 170px; border-right: 0; border-bottom: 3px solid rgba(0, 0, 0, .08); }
  .tcg-art .mascot { width: 150px; }
  .tcg-body { padding: 16px 16px 14px; }
  .tcg-top h2 { font-size: 24px; }
  .quick-actions .btn { padding: 10px 12px; font-size: 15px; }
  .stat { padding: 12px 14px; }
  .stat .value { font-size: 22px; }
  .month-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .month-summary .stat:last-child { grid-column: span 2; }
  .hbar { grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 13.5px; }
  .hbar .track { grid-column: 1 / -1; order: 3; }
  .desk-only { display: none !important; }
  .month-cards { display: grid; }
  .steps3 { grid-template-columns: 1fr; }
  .help-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .choice-grid { grid-template-columns: 1fr; }
  .partners { grid-template-columns: repeat(6, 1fr); gap: 4px; }
  .row2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .overlay { padding: 0; place-items: end stretch; }
  .sheet { width: 100%; max-height: 94vh; border-radius: 26px 26px 0 0; animation: slideUp .32s var(--ease) both; }
  .grabber { display: block; width: 44px; height: 5px; border-radius: 99px; background: var(--line-2); margin: 8px auto 0; }
  .sheet-head { padding-top: 8px; }
  .sheet-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .sheet-foot .btn { flex: 1; }
  .filters select { flex: 1 1 calc(50% - 5px); min-width: 0; }
}

@media (min-width: 721px) {
  .mob-only { display: none !important; }
}

@media print {
  .sidebar, .mobilebar, .bottomnav, .topbar .btn, #toasts { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* ==========================================================================
   Álbum «Celebración 30.º Aniversario» (checklist de 12 bolsillos por página)
   ========================================================================== */

:root {
  --r-c: #9AA3B8; --r-r: #4B6FD6; --r-rr: #8A5CD6; --r-pk: #E9B522; --r-ir: #2FA38A;
  --r-sir: #D2453A; --r-fr: #11A3C9; --r-cl: #C07B16; --r-rgb: #B4479D; --kanto: #D2453A;
  --silhouette: brightness(0) opacity(.17);
}
:root[data-theme="dark"] {
  --r-c: #7D869C; --r-r: #7C9BFF; --r-rr: #B28CFF; --r-pk: #F2C443; --r-ir: #4FD1B0;
  --r-sir: #FF6B5E; --r-fr: #4CD3F5; --r-cl: #F0A43A; --r-rgb: #E47BD0; --kanto: #FF6B5E;
  --silhouette: brightness(0) invert(1) opacity(.13);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --r-c: #7D869C; --r-r: #7C9BFF; --r-rr: #B28CFF; --r-pk: #F2C443; --r-ir: #4FD1B0;
    --r-sir: #FF6B5E; --r-fr: #4CD3F5; --r-cl: #F0A43A; --r-rgb: #E47BD0; --kanto: #FF6B5E;
    --silhouette: brightness(0) invert(1) opacity(.13);
  }
}

/* Botón de menú en la barra móvil (avatar + ☰) */
.mobilebar .me { position: relative; overflow: visible; }
.me-menu { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; box-shadow: 0 2px 0 var(--yellow-2); }
.me-menu svg { width: 13px; height: 13px; stroke-width: 3; }

/* Cabecera */
.album-hero { margin-bottom: 18px; }
.album-hero .tcg-inner { grid-template-columns: 1fr minmax(160px, 30%); min-height: 0; }
.album-hero-body { padding: 22px 24px; display: grid; gap: 10px; align-content: center; }
.album-hero-body .who { font-weight: 900; color: var(--ink-2); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.album-hero-body h2 { font-size: clamp(26px, 3.4vw, 38px); }
.album-hero-body p { color: var(--ink-2); font-weight: 700; max-width: 560px; }
.album-hero-art { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 60%, #FFF6C9, #FFD84D 55%, #F2B705); border-left: 3px solid rgba(0, 0, 0, .08); }
.album-hero-art::before { content: ""; position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .22) 0 10deg, transparent 10deg 24deg); animation: spin 50s linear infinite; }
.album-hero-art .mascot { position: relative; width: min(190px, 82%); filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .25)); animation: float 4s ease-in-out infinite; }
.badge30 { position: absolute; right: 12px; top: 10px; font-family: var(--font-display); font-size: 34px; color: #fff; text-shadow: 0 3px 0 var(--red-2), 2px 0 0 var(--red-2), -2px 0 0 var(--red-2), 0 -2px 0 var(--red-2); }

/* La barra del álbum siempre en amarillo Pikachu: completar no es «peligro» */
.hp.collect .hp-fill { background: linear-gradient(90deg, #F2B705, var(--yellow) 60%, #FFE36E); }

/* Estadísticas */
.album-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 16px; gap: 12px; }
.album-stats .stat { position: relative; overflow: hidden; }
.album-stats .stat .value { font-size: 26px; }
.album-stats .stat .value small { color: var(--muted); font-size: 15px; }
.album-stats .stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-mascot { position: absolute; right: -6px; top: -6px; width: 58px; height: 58px; object-fit: contain; opacity: .9; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--yellow); transition: width .5s var(--ease); }
.meter.none { visibility: hidden; }

/* Herramientas (fijas al hacer scroll) */
.album-tools {
  position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.album-tools .seg-tabs { background: var(--surface); border: 1px solid var(--line); }
.album-tools .seg-tabs.mode button.on { background: var(--ink); color: var(--surface); }
.album-tools .btn { margin-left: auto; }
.mode-hint { font-size: 13.5px; font-weight: 800; color: var(--ink-2); margin: 10px 2px 8px; }
.album-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.album-legend span { display: inline-flex; align-items: center; gap: 6px; }
.album-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.kanto-tag { color: var(--kanto); font-size: 11px; letter-spacing: .04em; }

.album-sec { margin-top: 22px; }
.album-sec > h2 { font-size: 24px; }
.album-sec > p { color: var(--muted); font-weight: 700; font-size: 13.5px; margin: 2px 0 12px; }
.binder { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.binder-page { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: var(--shadow); min-width: 0; transition: border-color .3s, box-shadow .3s; }
.binder-page.done { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 203, 5, .35), var(--shadow); }
.binder-page header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.binder-page header > b { font-family: var(--font-display); font-weight: 400; font-size: 17px; color: var(--ink); }
.binder-page header span b { color: var(--ink); }
.pockets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }

/* Bolsillo / carta */
.slot {
  --rc: var(--r-c);
  position: relative; aspect-ratio: 63 / 88; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; text-align: left; padding: 6px 6px 5px;
  border: 1.5px dashed var(--line-2); border-radius: 9px; background: var(--surface-2);
  font: inherit; color: var(--ink); cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: transform .12s var(--spring), border-color .15s, background .2s, opacity .2s;
}
.slot:hover { transform: translateY(-2px); }
.slot:active { transform: scale(.95); }
.slot .num { font-weight: 900; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.2; padding-right: 30px; }
.slot .k { position: absolute; top: 6px; right: 5px; font-size: 8px; font-weight: 900; letter-spacing: .03em; color: var(--kanto); }
.slot .spr { flex: 1; min-height: 0; display: grid; place-items: center; }
.slot .spr img { width: 100%; max-width: 76px; height: auto; image-rendering: pixelated; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .14)); transition: filter .3s, transform .3s var(--spring); }
.dim-missing .slot:not(.own) .spr img { filter: var(--silhouette); }
.slot .spr .trainer-ico { width: 46%; height: auto; color: var(--ink-2); opacity: .8; }
.dim-missing .slot:not(.own) .spr .trainer-ico { color: var(--muted); opacity: .45; }
.slot .nm { font-size: 11.5px; font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.slot .rar { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 8.5px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; overflow: hidden; }
.slot .rar i { width: 7px; height: 7px; border-radius: 50%; background: var(--rc); flex: none; }
.slot.own { border-style: solid; border-width: 2px; border-color: var(--rc); background: linear-gradient(160deg, color-mix(in srgb, var(--rc) 22%, var(--surface)), var(--surface) 58%, color-mix(in srgb, var(--rc) 12%, var(--surface))); }
.slot.own .num { color: var(--ink); }
.slot.own .spr img { filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .18)); transform: scale(1.06); }
.slot.own .spr .trainer-ico { color: var(--rc); opacity: 1; }
.slot.own::after { content: "✓"; position: absolute; right: 5px; bottom: 5px; width: 17px; height: 17px; border-radius: 50%; background: var(--rc); color: #fff; font-size: 10px; font-weight: 900; display: grid; place-items: center; }
.slot .dup { position: absolute; left: 5px; top: 22px; background: var(--yellow); color: var(--navy); font-weight: 900; font-size: 10.5px; border-radius: 6px; padding: 1px 5px; box-shadow: 0 2px 0 var(--yellow-2); }
.slot.hide { opacity: .14; }
.slot.hide:hover { opacity: .4; }
/* Brillo holográfico en las raras que ya tienes */
.slot.foil.own::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .45;
  background: linear-gradient(115deg, transparent 25%, rgba(255, 120, 200, .45) 38%, rgba(120, 220, 255, .45) 48%, rgba(255, 255, 140, .45) 58%, transparent 72%);
  background-size: 250% 250%; animation: holoSweep 4.5s ease-in-out infinite;
}
@keyframes holoSweep { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
/* Mew RGB: cada uno de su color */
.slot.own[data-tint="R"] .spr img { filter: hue-rotate(-25deg) saturate(2.2) drop-shadow(0 0 6px rgba(255, 60, 60, .7)); }
.slot.own[data-tint="G"] .spr img { filter: hue-rotate(115deg) saturate(1.6) drop-shadow(0 0 6px rgba(40, 200, 90, .7)); }
.slot.own[data-tint="B"] .spr img { filter: hue-rotate(205deg) saturate(1.8) drop-shadow(0 0 6px rgba(60, 120, 255, .7)); }
.album-note { margin-top: 18px; max-width: 760px; font-weight: 700; }
.list-text { font-size: 14px; font-weight: 700; line-height: 1.45; min-height: 220px; }

/* Tarjeta del álbum en Inicio */
.album-mini { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.album-mini img { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .18)); }
.album-mini .big-num small { font-size: 18px; color: var(--muted); }

@media (max-width: 1180px) {
  .album-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .album-tools { top: calc(57px + env(safe-area-inset-top)); }
}
@media (max-width: 720px) {
  /* En el móvil, las estadísticas en una fila que se desliza (deja sitio al álbum) */
  .album-stats { display: flex; overflow-x: auto; gap: 8px; margin: 0 -16px 12px; padding: 2px 16px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .album-stats::-webkit-scrollbar { display: none; }
  .album-stats .stat { flex: 0 0 132px; scroll-snap-align: start; padding: 10px 12px; }
  .album-stats .stat .value { font-size: 21px; }
  .stat-mascot { width: 46px; height: 46px; }
  .album-hero .tcg-inner { grid-template-columns: 1fr 108px; }
  .album-hero-body { padding: 16px; }
  .album-hero-body p { display: none; }
  .album-hero-art .mascot { width: 96px; }
  .badge30 { font-size: 24px; right: 6px; top: 4px; }
  .album-tools { gap: 8px; }
  .album-tools .seg-tabs { overflow-x: auto; max-width: 100%; }
  .album-tools .seg-tabs button { padding: 6px 10px; white-space: nowrap; }
  .album-tools .btn { margin-left: auto; min-height: 36px; padding: 6px 10px; }
  .album-tools .btn .btn-txt { display: none; }
  .album-tools .seg-tabs.mode { flex: 0 1 auto; }
  .binder { grid-template-columns: 1fr; }
  .slot .nm { font-size: 11px; }
}

/* ==========================================================================
   Colecciones con objetivos (método de El Camino del Coleccionista)
   ========================================================================== */

/* Cabecera del método */
.method-hero { margin-bottom: 18px; }
.method-hero .tcg-inner { grid-template-columns: 1fr minmax(150px, 28%); min-height: 0; }
.method-body { padding: 22px 24px; display: grid; gap: 10px; align-content: center; }
.method-body .who { font-weight: 900; color: var(--ink-2); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.method-body h2 { font-size: clamp(24px, 3vw, 34px); }
.method-body p { color: var(--ink-2); font-weight: 700; max-width: 560px; }
.smart-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.smart-row span { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border-radius: 999px; padding: 4px 12px 4px 4px; font-weight: 800; font-size: 13px; }
.smart-row b, .sl { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--yellow); display: inline-grid; place-items: center; font-family: var(--font-display); font-weight: 400; font-size: 15px; flex: none; }
.sl.big { width: 44px; height: 44px; font-size: 24px; box-shadow: 0 3px 0 var(--yellow-2); }
.method-art { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 60%, #F1E3FF, #B48CF0 55%, #6A4BC2); border-left: 3px solid rgba(0, 0, 0, .08); }
.method-art::before { content: ""; position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .18) 0 10deg, transparent 10deg 24deg); animation: spin 60s linear infinite; }
.method-art .mascot { position: relative; width: min(180px, 85%); filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .3)); animation: float 4.5s ease-in-out infinite; }

/* Tarjetas de colección */
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.col-card { display: grid; gap: 14px; text-decoration: none; color: inherit; transition: transform .15s var(--spring), box-shadow .2s; }
.col-card:hover { transform: translateY(-3px); }
.col-card-top { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: center; }
.col-mascot { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .18)); }
.col-card h3 { font-size: 21px; }
.col-card p { color: var(--ink-2); font-weight: 700; font-size: 13.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.col-progress { display: grid; gap: 6px; }
.col-progress .nums { display: flex; justify-content: space-between; font-weight: 800; font-size: 13.5px; color: var(--ink-2); }
.col-progress .nums b { color: var(--ink); }
.col-card .badge { justify-self: start; }
.col-card.add { border: 2.5px dashed var(--line-2); border-radius: var(--radius); background: transparent; display: grid; place-items: center; text-align: center; gap: 8px; padding: 26px 20px; font: inherit; color: var(--ink-2); cursor: pointer; }
.col-card.add b { font-size: 18px; color: var(--ink); font-weight: 900; }
.col-card.add span { font-weight: 700; font-size: 13.5px; max-width: 280px; }
.plus-big { width: 52px; height: 52px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; box-shadow: 0 3px 0 var(--yellow-2); }
.plus-big svg { width: 26px; height: 26px; stroke-width: 3; }
.meter.big { height: 12px; position: relative; overflow: visible; }
.meter.big i { border-radius: 99px; }
.meter .target { position: absolute; top: -4px; bottom: -4px; width: 3px; border-radius: 2px; background: var(--ink); transform: translateX(-50%); }

/* Detalle de colección */
.back-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13.5px; color: var(--muted); text-decoration: none; margin-bottom: 4px; }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--ink); }
.album-hero .identity { font-weight: 800; font-size: 17px; color: var(--ink); line-height: 1.35; max-width: 620px; }
.hero-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 14px; }
.hp-track { position: relative; }
.hp-target { position: absolute; top: -5px; bottom: -5px; width: 3px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 1.5px var(--navy); transform: translateX(-50%); }
.col-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 16px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; scrollbar-width: none; }
.col-tabs::-webkit-scrollbar { display: none; }
.col-tabs a { flex: 1 0 auto; text-align: center; text-decoration: none; padding: 10px 14px; border-radius: 14px; font-weight: 900; font-size: 14.5px; color: var(--ink-2); white-space: nowrap; transition: background .15s, color .15s; }
.col-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.col-tabs a.on { background: var(--navy); color: #fff; box-shadow: 0 3px 0 var(--yellow); }

/* Bolsillos de colecciones propias */
.pockets { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); }
.slot .bignum { font-family: var(--font-display); font-weight: 400; font-size: clamp(18px, 2.4vw, 26px); color: var(--muted); opacity: .45; }
.slot.own .bignum { color: var(--rc); opacity: 1; }
.slot .cardname { font-size: 9px; font-weight: 800; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.slot .upg { position: absolute; top: 5px; right: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--water); color: #fff; font-size: 10px; font-weight: 900; display: grid; place-items: center; }
.slot.out:not(.own) { opacity: .55; }

/* Apertura en curso */
.session-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 0 0 12px; padding: 12px 16px;
  border-radius: 18px; background: linear-gradient(120deg, var(--navy-2), var(--navy)); color: #fff; box-shadow: 0 4px 0 var(--yellow), var(--shadow);
}
.session-bar .sb-info { flex: 1 1 240px; display: grid; gap: 2px; }
.session-bar .sb-info span { font-size: 13px; color: rgba(233, 236, 255, .75); font-weight: 700; }
.sb-count { display: grid; justify-items: center; line-height: 1.1; }
.sb-count b { font-size: 24px; font-weight: 900; color: var(--yellow); }
.sb-count span { font-size: 11.5px; font-weight: 800; color: rgba(233, 236, 255, .75); }
.sb-mini { display: flex; gap: 4px; margin-top: 4px; }
.sb-mini button { width: 26px; height: 24px; border-radius: 8px; border: 0; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 900; }
.sb-actions { display: flex; align-items: center; gap: 10px; }
.sb-actions .muted { color: rgba(233, 236, 255, .7); }

/* Objetivo */
.obj-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-bottom: 8px; }
.obj-figures > div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.obj-figures .big-num { font-size: 32px; }
.obj-figures .muted { font-size: 12.5px; font-weight: 800; }
.chart .pace-plan { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 5; }
.chart .pace-goal { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.smart-list { display: grid; gap: 8px; }
.smart-list > div { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.smart-list small { display: block; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.smart-sentence { margin: 12px 0; font-weight: 800; font-style: italic; color: var(--ink-2); background: var(--warn-bg); border-radius: 14px; padding: 12px 14px; }
.hitos { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.hito { position: relative; border: 2px dashed var(--line-2); border-radius: 16px; padding: 12px; display: grid; gap: 2px; text-align: center; }
.hito b { font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.hito span { font-weight: 800; font-size: 12.5px; color: var(--muted); }
.hito.done { border-style: solid; border-color: var(--good); background: var(--good-bg); }
.hito i { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; }
.hito i svg { width: 13px; height: 13px; stroke-width: 3; }
.hito.goal { border-color: var(--yellow-2); box-shadow: 0 3px 0 var(--yellow); }
.hito em { font-style: normal; font-size: 10.5px; font-weight: 900; text-transform: uppercase; color: var(--yellow-ink); }
:root[data-theme="dark"] .hito em { color: var(--yellow); }
.faq summary .sl { width: 24px; height: 24px; font-size: 14px; }

/* Aperturas */
.relev p { font-weight: 700; }
.ap-list { display: grid; gap: 8px; }
.ap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.ap-main { flex: 1 1 200px; display: grid; }
.ap-main span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.ap-nums { display: flex; gap: 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ap-nums b { color: var(--ink); font-weight: 900; }

/* Vender y cambiar */
.sell-list { display: grid; gap: 6px; }
.sell-row { display: grid; grid-template-columns: 44px 1fr; gap: 4px 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); }
.sell-row img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.sell-num { width: 44px; height: 44px; display: grid; place-items: center; font-family: var(--font-display); color: var(--muted); }
.sell-main { min-width: 0; }
.sell-main b { display: block; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sell-main small { color: var(--muted); font-weight: 800; }
.sell-main span { font-size: 12.5px; color: var(--muted); font-weight: 700; }
.sell-actions { grid-column: 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Asistente */
.wiz-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.wiz-head h2 { font-size: 26px; }
.wiz-mascot { width: 52px; height: 52px; object-fit: contain; }
.wiz-body { display: grid; gap: 14px; margin-top: 12px; }
.wiz-lead { color: var(--ink-2); font-weight: 700; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tpl { display: grid; gap: 6px; justify-items: start; text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px; font: inherit; color: inherit; cursor: pointer; transition: transform .15s var(--spring), border-color .15s, box-shadow .15s; }
.tpl:hover { transform: translateY(-3px); border-color: var(--yellow-2); box-shadow: 0 4px 0 var(--yellow); }
.tpl img { width: 76px; height: 76px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .18)); }
.tpl b { font-size: 17px; font-weight: 900; }
.tpl span { font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.plan-cats { display: grid; gap: 8px; }
.plan-cat { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; }
.pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; }
.pc-top i { width: 12px; height: 12px; border-radius: 50%; }
.pc-top .muted { font-size: 13px; }
.pc-top .spacer { flex: 1; }
.plan-cat details summary { cursor: pointer; font-weight: 800; font-size: 13px; color: var(--water); margin-top: 6px; }
.plan-chips { margin-top: 8px; max-height: 220px; overflow: auto; }
.poke-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px 3px 2px; cursor: default; }
.poke-chip img { width: 28px; height: 28px; }
.poke-chip button { border: 0; background: none; color: var(--muted); font-weight: 900; padding: 0 2px; }
.poke-chip button:hover { color: var(--bad-ink); }
.counter.sm button { width: 32px; height: 32px; font-size: 16px; }
.counter.sm input { width: 40px; min-height: 32px; font-size: 14px; }
.add-poke { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-poke input[list] { flex: 1 1 200px; }

/* Ficha */
.ficha-top { display: flex; gap: 6px; flex-wrap: wrap; }

/* Confeti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: confettiFall 2.4s cubic-bezier(.25, .6, .4, 1) forwards; }
@keyframes confettiFall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); opacity: .9; } }

@media (max-width: 720px) {
  .method-hero .tcg-inner { grid-template-columns: 1fr 100px; }
  .method-body { padding: 16px; }
  .method-body p { display: none; }
  .method-art .mascot { width: 92px; }
  .smart-row span { font-size: 0; padding: 2px; gap: 0; }
  .smart-row b { font-size: 15px; }
  .col-grid { grid-template-columns: 1fr; }
  .col-tabs a { padding: 9px 12px; font-size: 13.5px; }
  /* En el móvil, con 4 columnas solo cabe el puntito de color de la categoría */
  .pockets[style*="--cols:4"] .slot .rar { font-size: 0; }
  .pockets[style*="--cols:4"] .slot .nm { font-size: 10.5px; }
  .tpl-grid { grid-template-columns: 1fr; }
  .tpl { grid-template-columns: 64px 1fr; align-items: center; }
  .tpl img { width: 64px; height: 64px; grid-row: span 2; }
  .session-bar { gap: 10px 14px; }
  .album-hero .identity { font-size: 15px; }
}

/* Colecciones en Inicio */
.mini-cols { display: grid; gap: 10px; }
.mini-col { display: grid; gap: 6px; text-decoration: none; color: inherit; padding: 8px 10px; border-radius: 14px; transition: background .15s; }
.mini-col:hover { background: var(--surface-2); }
.mc-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mc-name b { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-name small { font-weight: 800; color: var(--muted); white-space: nowrap; }

/* ==========================================================================
   Sets a la venta (TCGdex): selector en el asistente y cartas con su imagen real
   ========================================================================== */
.sets-now { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 12px; }
.sets-now-head { display: grid; gap: 2px; }
.sets-now-head b { font-size: 17px; font-weight: 900; }
.sets-now-head span { font-size: 13.5px; color: var(--ink-2); font-weight: 700; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.set-btn {
  display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center;
  border: 2px solid var(--line); border-radius: 16px; padding: 12px 10px; font: inherit; color: inherit; cursor: pointer;
  background: radial-gradient(circle at 50% 30%, #2A2F52, #14172C 75%);
  transition: transform .15s var(--spring), border-color .15s, box-shadow .15s;
}
.set-btn:hover { transform: translateY(-3px); border-color: var(--yellow-2); box-shadow: 0 4px 0 var(--yellow); }
.set-btn img { width: 100%; height: 64px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.set-btn b { color: #fff; font-size: 14px; font-weight: 900; line-height: 1.2; }
.set-btn small { color: var(--yellow); font-size: 11.5px; font-weight: 800; }
.set-btn span { color: rgba(233, 236, 255, .7); font-size: 11.5px; font-weight: 800; }
.set-btn.loading { opacity: .6; pointer-events: none; }
.set-chosen { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: radial-gradient(circle at 20% 40%, #2A2F52, #14172C 80%); color: #fff; }
.set-chosen img { width: 120px; height: 56px; object-fit: contain; }
.set-chosen b { display: block; font-size: 18px; font-weight: 900; }
.set-chosen span { font-size: 13px; color: rgba(233, 236, 255, .75); font-weight: 700; }

/* Logo del set en las tarjetas y en la cabecera */
.col-mascot.set-logo { object-fit: contain; background: radial-gradient(circle, #2A2F52, #14172C 75%); border-radius: 14px; padding: 6px; filter: none; }
.album-hero-art.logo-art { background: radial-gradient(circle at 50% 50%, #343A66, #14172C 75%); }
.album-hero-art.logo-art .mascot.set-logo { width: min(240px, 86%); animation: float 5s ease-in-out infinite; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }

/* Carta real dentro del bolsillo: apagada si te falta, a todo color si la tienes */
.slot.cardart { padding: 0; background: var(--surface-3); }
.slot.cardart .cardimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 7px; transition: filter .35s, transform .35s var(--spring); }
.dim-missing .slot.cardart:not(.own) .cardimg { filter: grayscale(1) contrast(.85) opacity(.32); }
.slot.cardart:not(.noimg) .spr { display: none; }
.slot.cardart.noimg { padding: 6px 6px 5px; }
.slot.cardart .num { position: absolute; left: 5px; top: 5px; z-index: 1; background: rgba(20, 23, 44, .78); color: #fff; padding: 1px 6px; border-radius: 6px; font-size: 10px; }
.slot.cardart.own .num { color: #fff; }
/* La carta ya lleva su nombre: el texto solo se ve si la imagen no carga */
.slot.cardart:not(.noimg) .nm, .slot.cardart:not(.noimg) .rar, .slot.cardart:not(.noimg) .cardname { display: none; }
.slot.cardart.noimg .num { position: static; background: none; color: var(--muted); padding: 0; }
.slot.cardart .dup { top: 26px; z-index: 1; }
.slot.cardart.own::after { z-index: 1; }
.ficha-card { width: min(240px, 70%); margin: 0 auto; border-radius: 12px; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .45); }

/* Plantillas (3) y el 30 Aniversario en la lista de sets */
.tpl-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.set-grid-api { display: contents; }
.set-grid-api > p { grid-column: 1 / -1; }
.s30-logo { position: relative; display: grid; place-items: center; height: 64px; width: 100%; }
.s30-logo img { height: 64px; width: auto; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .4)); }
.s30-logo i { position: absolute; right: 10%; top: -2px; font-style: normal; font-family: var(--font-display); font-size: 28px; color: var(--yellow); text-shadow: 0 2px 0 var(--red-2), 2px 0 0 var(--red-2), -2px 0 0 var(--red-2); }
.s30-logo.sm { width: 120px; height: 56px; }
.s30-logo.sm img { height: 56px; }
@media (max-width: 720px) {
  .tpl-grid.three { grid-template-columns: 1fr; }
}

/* Tamaño por defecto de los iconos (cada sitio puede ajustarlo) */
.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.faq summary > svg { width: 20px; height: 20px; color: var(--ink-2); }
.link-btn .ico { width: 16px; height: 16px; }

/* Álbum: las que te faltan, a color pero con borde punteado; las que tienes, con su borde y ✓ */
.slot.cardart:not(.own) { border-style: dashed; }
.dim-toggle { font-size: 13px; padding: 6px 12px; }

/* Visor de cartas */
.lightbox { position: fixed; inset: 0; z-index: 150; background: rgba(10, 12, 26, .92); display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; animation: fade .2s ease both; backdrop-filter: blur(4px); }
.lb-fig { margin: 0; display: grid; justify-items: center; gap: 12px; min-width: 0; }
.lb-stage { overflow: hidden; border-radius: 16px; box-shadow: 0 24px 60px -10px rgba(0, 0, 0, .7); cursor: zoom-in; touch-action: none; max-width: 100%; }
.lb-stage.zoomed { cursor: zoom-out; }
.lb-img { display: block; max-height: min(78vh, 900px); max-width: min(92vw, 640px); width: auto; height: auto; transition: transform .25s var(--ease); user-select: none; -webkit-user-drag: none; }
.lb-img.pixel { image-rendering: pixelated; min-height: 50vh; object-fit: contain; background: radial-gradient(circle, #2A2F52, #14172C 75%); }
.lb-stage.zoomed .lb-img { transform: scale(2.4); }
.lb-fig figcaption { text-align: center; color: #fff; display: grid; gap: 2px; }
.lb-fig figcaption b { font-size: 18px; font-weight: 900; }
.lb-fig figcaption span { font-size: 13px; color: rgba(233, 236, 255, .7); font-weight: 700; }
.lb-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; display: grid; place-items: center; justify-self: center; }
.lb-btn:hover { background: rgba(255, 255, 255, .22); }
.lb-btn svg { width: 26px; height: 26px; }
.lb-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.lb-hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: rgba(233, 236, 255, .55); font-size: 12px; font-weight: 700; margin: 0; }

/* Vista previa de un set */
.pv-head { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 18px; background: radial-gradient(circle at 20% 40%, #2A2F52, #14172C 80%); color: #fff; }
.pv-head > img { width: 140px; height: 64px; object-fit: contain; }
.pv-head h2 { font-size: 24px; }
.pv-head span { font-size: 13px; color: rgba(233, 236, 255, .75); font-weight: 700; }
.pv-head > div { flex: 1; min-width: 0; }
.pv-head .icon-btn { color: #fff; }
.pv-sec h3 { font-size: 19px; margin: 6px 0 10px; }
.pv-sec h3 small { font-family: var(--font-ui); font-size: 13px; color: var(--muted); font-weight: 800; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pv-card { position: relative; aspect-ratio: 63 / 88; border: 0; padding: 0; border-radius: 8px; overflow: hidden; background: var(--surface-3); cursor: zoom-in; transition: transform .15s var(--spring), box-shadow .15s; }
.pv-card:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .45); z-index: 1; }
.pv-card > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-card i { position: absolute; left: 4px; top: 4px; font-style: normal; background: rgba(20, 23, 44, .78); color: #fff; font-size: 9.5px; font-weight: 900; padding: 1px 5px; border-radius: 5px; }
.pv-fallback { display: none; }
.pv-card.noimg .pv-fallback { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4px; padding: 18px 6px 6px; text-align: center; }
.pv-fallback img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.pv-fallback b { font-size: 11px; font-weight: 800; color: var(--ink); line-height: 1.15; }
@media (max-width: 720px) {
  .lightbox { grid-template-columns: 44px 1fr 44px; }
  .lb-btn { width: 40px; height: 40px; }
  .lb-img { max-width: calc(100vw - 100px); }
  .pv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pv-head > img { width: 96px; height: 48px; }
}

/* Que se note bien cuáles tienes ahora que todas se ven a color */
.slot.cardart.own { border-width: 3px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 35%, transparent), 0 6px 14px -6px rgba(0, 0, 0, .35); }
.slot.cardart.own::after { width: 24px; height: 24px; font-size: 13px; right: 6px; bottom: 6px; box-shadow: 0 0 0 2px #fff; }
/* Fondo un poco más claro para que se lean los logos oscuros (p. ej. Oscuridad Absoluta) */
.set-btn, .set-chosen, .pv-head, .col-mascot.set-logo, .album-hero-art.logo-art { background: radial-gradient(circle at 50% 30%, #5A63A8, #262C5C 70%); }

/* Precios de Cardmarket */
.slot .price, .pv-card .price {
  position: absolute; left: 5px; bottom: 5px; z-index: 2; font-style: normal;
  background: rgba(20, 23, 44, .86); color: #fff; font-weight: 900; font-size: 10.5px; line-height: 1.5;
  padding: 0 7px; border-radius: 99px; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); pointer-events: none;
}
.pv-card .price:empty { display: none; }
.slot:not(.cardart) .price, .slot.noimg .price { bottom: auto; top: 20px; left: auto; right: 5px; }
.slot.own .price { background: color-mix(in srgb, var(--rc) 70%, #14172C); }
.cost-card { margin-bottom: 14px; }
.cost-ico { font-size: 30px; line-height: 1; }
.cost-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cost-figs > div { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; }
.cost-figs .big-num { font-size: 28px; }
.cost-figs .muted { font-size: 12.5px; font-weight: 800; }
.cost-top { margin-top: 14px; display: grid; gap: 8px; }
.cost-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.cost-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 6px 10px 6px 6px; border-radius: 12px; background: var(--surface-2); text-decoration: none; color: inherit; transition: background .15s, transform .15s var(--spring); }
.cost-item:hover { background: var(--surface-3); transform: translateY(-2px); }
.cost-item img { width: 38px; height: 53px; object-fit: cover; border-radius: 4px; }
.cost-item img.pix { object-fit: contain; image-rendering: pixelated; }
.cost-item b { display: block; font-size: 13.5px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-item small { font-size: 11.5px; color: var(--muted); font-weight: 800; }
.cost-item span { min-width: 0; }
.cost-item em { font-style: normal; font-weight: 900; }
.cm-line { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; font-weight: 700; font-size: 14px; }
.cm-line a { color: var(--water); font-weight: 900; }
.pv-total { display: block; margin-top: 4px; color: var(--yellow) !important; }
.pv-total b { color: #fff; }
.mode-hint .zoom-tip { color: var(--muted); font-weight: 700; }
.ficha-fig { margin: 0 auto; display: grid; justify-items: center; gap: 6px; }
.ficha-fig figcaption { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.ficha-card { cursor: zoom-in; transition: transform .2s var(--spring); }
.ficha-card:hover { transform: scale(1.02); }
.ficha-card.art { width: min(200px, 60%); box-shadow: none; border-radius: 0; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .2)); }

/* ───────────────────────── Escáner de cartas ───────────────────────── */
.scan-ov { position: fixed; inset: 0; z-index: 55; background: #0B0D18; color: #fff; display: grid; animation: fade .2s ease both; }
.scan-ov [hidden] { display: none !important; }
.scan-cam { position: relative; overflow: hidden; display: grid; }
.scan-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.scan-guide {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  height: min(62vh, calc(78vw * 88 / 63)); aspect-ratio: 63 / 88; border-radius: 4.5% / 3.2%;
  box-shadow: 0 0 0 100vmax rgba(5, 7, 16, .5); pointer-events: none;
}
.scan-guide i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--yellow); }
.scan-guide i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan-guide i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan-guide i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan-guide i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scan-top { position: absolute; z-index: 2; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 16px 14px; }
.scan-tip { font-weight: 800; font-size: 14px; background: rgba(0, 0, 0, .45); padding: 8px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.scan-round { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; flex: none; }
.scan-round svg { width: 22px; height: 22px; }
.scan-strip { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(118px + env(safe-area-inset-bottom)); display: flex; gap: 8px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.scan-strip::-webkit-scrollbar { display: none; }
.scan-thumb { position: relative; flex: none; width: 46px; height: 64px; padding: 0; border: 2px solid #fff; border-radius: 7px; overflow: hidden; background: #000; animation: pop .25s var(--spring) both; }
.scan-thumb img { width: 100%; height: 100%; object-fit: cover; }
.scan-thumb span { position: absolute; right: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, .7); display: grid; place-items: center; }
.scan-thumb span svg { width: 10px; height: 10px; }
.scan-bar { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 16px 16px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .75) 40%); }
.scan-side { justify-self: center; display: grid; justify-items: center; gap: 4px; min-width: 84px; padding: 8px 10px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 900; font-size: 13px; cursor: pointer; }
.scan-side svg { width: 22px; height: 22px; }
.scan-go { background: var(--yellow); color: var(--navy); box-shadow: 0 3px 0 var(--yellow-2); }
.scan-go b { font-family: var(--font-display); font-size: 22px; line-height: 1; }
.scan-go:disabled { opacity: .45; box-shadow: none; }
.scan-shutter { width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff; background: transparent; padding: 5px; }
.scan-shutter i { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; transition: transform .12s; }
.scan-shutter:active i { transform: scale(.86); }
.scan-shutter:disabled { opacity: .35; }
.scan-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.scan-flash.on { animation: scanflash .35s ease-out; }
@keyframes scanflash { from { opacity: .75; } to { opacity: 0; } }
.scan-nocam { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; padding: 24px; background: #0B0D18; }
.scan-nocam-in { display: grid; justify-items: center; gap: 14px; text-align: center; max-width: 380px; font-weight: 700; color: #DCE0F5; }
.scan-nocam-in .big { font-size: 56px; }

.scan-review { display: grid; grid-template-rows: auto 1fr auto; background: var(--bg); color: var(--ink); min-height: 0; }
.scan-head { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.scan-head h2 { flex: 1; font-size: 22px; text-align: center; }
.scan-body { overflow-y: auto; padding: 14px 16px 20px; display: grid; gap: 12px; align-content: start; max-width: 820px; width: 100%; margin: 0 auto; }
.scan-progress { display: grid; gap: 6px; font-weight: 800; color: var(--ink-2); }
.scan-progress .meter i { transition: width .3s; }
.scan-origin { margin: 0; }
.scan-list { display: grid; gap: 10px; }
.scan-manual { justify-self: center; }
.scan-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px max(14px, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); }
.scan-sum { flex: 1 1 200px; font-weight: 800; color: var(--ink-2); }
.scan-sum b { color: var(--ink); }
.warn-txt { color: var(--warn-ink); }
.scan-foot .btn { margin-left: auto; }

.scan-row { display: grid; grid-template-columns: 58px 74px 1fr; gap: 10px; align-items: start; padding: 10px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line); animation: pop .25s var(--spring) both; }
.scan-row.st-ok { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.scan-row.st-media { border-color: color-mix(in srgb, var(--warn) 70%, var(--line)); }
.scan-row.st-baja { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.scan-row.out:not(.st-wait) .scan-card { opacity: .6; }
.scan-photo, .scan-card { padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; aspect-ratio: 63 / 88; font-size: 26px; font-weight: 900; color: var(--muted); }
.scan-photo img { width: 100%; height: 100%; object-fit: cover; }
.scan-photo.manual { font-size: 24px; }
.scan-card img { width: 100%; height: 100%; object-fit: cover; }
.scan-card.wait .spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--red); animation: spin .8s linear infinite; }
.scan-card.none { background: var(--bad-bg); color: var(--bad-ink); }
.scan-info { display: grid; gap: 4px; min-width: 0; }
.scan-info > b { font-size: 16.5px; line-height: 1.2; }
.scan-info > .muted { font-size: 13px; font-weight: 700; }
.scan-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.scan-badges .badge { font-size: 11.5px; }
.scan-ctrl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.scan-ctrl .seg.sm { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; }
.scan-ctrl .seg.sm button { padding: 6px 10px; font-size: 12.5px; border-radius: 9px; }
.scan-ctrl .seg.sm button.on { background: var(--ink); color: var(--surface); }
.scan-ctrl select { width: auto; min-height: 34px; padding: 4px 30px 4px 10px; font-size: 13px; font-weight: 800; border-radius: 10px; background-position: right 8px center; }
.scan-ctrl .counter.sm { height: 34px; }
.scan-ctrl .counter.sm b { min-width: 28px; text-align: center; }
.scan-ctrl .icon-btn { width: 34px; height: 34px; }
.pick-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.pick-head img { width: 64px; border-radius: 8px; }
.pick-head p { margin: 0; }
.pv-card.pick .pick-set { position: absolute; left: 4px; right: 4px; bottom: 4px; font-style: normal; font-size: 10px; font-weight: 800; background: rgba(20, 23, 44, .8); color: #fff; padding: 2px 5px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 520px) {
  .scan-row { grid-template-columns: 44px 58px 1fr; gap: 8px; padding: 8px; }
  .scan-head h2 { font-size: 19px; }
  .scan-info > b { font-size: 15.5px; }
  .scan-ctrl { gap: 5px; }
  .scan-ctrl .btn.sm { padding: 6px 10px; font-size: 13px; }
  .scan-ctrl .seg.sm button { padding: 5px 8px; }
  .scan-badges .badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .scan-origin .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}

/* ───────────────────────── Mi colección ───────────────────────── */
.inv-kpis { display: grid; grid-template-columns: repeat(4, auto); gap: 6px 22px; justify-content: start; }
.inv-kpis div { display: grid; }
.inv-kpis b { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); line-height: 1.05; }
.inv-kpis span { font-weight: 800; color: var(--ink-2); font-size: 13px; }
.inv-kpis .val b { color: var(--good-ink); }
.inv-tools { position: sticky; top: 0; z-index: 30; padding: 10px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.inv-card { position: relative; padding: 0; border: 0; border-radius: 9px; overflow: hidden; aspect-ratio: 63 / 88; background: var(--surface-2); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .4); transition: transform .15s var(--ease), box-shadow .15s; }
.inv-card:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 10px 20px -8px rgba(0, 0, 0, .45); z-index: 1; }
.inv-card > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-fallback { display: none; position: absolute; inset: 0; place-items: center; padding: 8px; text-align: center; font-size: 13px; }
.inv-card.noimg .inv-fallback, .inv-card:not(:has(> img)) .inv-fallback { display: grid; }
.inv-qty { position: absolute; right: 5px; top: 5px; background: var(--red); color: #fff; font-weight: 900; font-size: 12px; padding: 2px 7px; border-radius: 999px; box-shadow: 0 2px 0 var(--red-2); }
.inv-tags { position: absolute; left: 5px; top: 5px; display: flex; gap: 3px; }
.inv-tags i { font-style: normal; font-weight: 900; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(20, 23, 44, .82); color: #fff; }
.inv-tags i.rev { background: linear-gradient(135deg, #7C9BFF, #E47BD0, #F2C443); color: #1B2150; }
.inv-foot { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 4px; padding: 14px 6px 5px; background: linear-gradient(transparent, rgba(10, 12, 26, .85)); color: #fff; font-size: 11px; font-weight: 800; }
.inv-foot em { font-style: normal; color: #B9F5C4; }
.more-row { display: flex; justify-content: center; margin-top: 16px; }
.inv-empty .btn { margin-top: 4px; }
.inv-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; margin-bottom: 14px; }
.inv-banner-ico { font-size: 30px; }
.inv-banner > div { flex: 1 1 240px; display: grid; gap: 2px; }
.inv-banner > div b { font-size: 17px; }
.inv-banner > div span { color: var(--ink-2); font-weight: 700; font-size: 13.5px; }
@media (max-width: 720px) {
  .inv-kpis { grid-template-columns: repeat(2, auto); }
  .inv-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}

/* ───────────────────────── Vender y cambiar: las cartas tal y como son ───────────────────────── */
.sell-hero { margin-bottom: 16px; }
.sell-sec { margin-bottom: 16px; }
.sell-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); gap: 14px; }
.sell-card { display: grid; gap: 8px; align-content: start; padding: 10px; border-radius: 16px; background: var(--surface-2); }
.sell-art { position: relative; padding: 0; border: 0; border-radius: 9px; overflow: hidden; aspect-ratio: 63 / 88; background: var(--surface-3); box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .45); transition: transform .15s var(--ease), box-shadow .15s; }
.sell-art:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 12px 22px -10px rgba(0, 0, 0, .5); }
.sell-art > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sell-fallback { display: none; position: absolute; inset: 0; place-items: center; align-content: center; gap: 6px; padding: 8px; text-align: center; font-size: 13px; }
.sell-fallback img { width: 64px; height: 64px; object-fit: contain; image-rendering: pixelated; }
.sell-art.noimg .sell-fallback { display: grid; }
.sell-badge { position: absolute; right: 6px; top: 6px; background: var(--red); color: #fff; font-weight: 900; font-size: 12px; padding: 3px 9px; border-radius: 999px; box-shadow: 0 2px 0 var(--red-2); }
.sell-badge.fuera { background: var(--navy); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.sell-badge.upg { background: var(--warn); color: var(--warn-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.sell-info { display: grid; gap: 1px; min-width: 0; }
.sell-info b { font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sell-info small { color: var(--muted); font-weight: 800; font-size: 12px; }
.sell-price { font-weight: 900; color: var(--good-ink); margin-top: 2px; }
.sell-price em { display: block; font-style: normal; font-weight: 700; color: var(--muted); font-size: 12px; }
.sell-price.none { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.sell-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.sell-btns .btn { flex: 1 1 auto; justify-content: center; padding-left: 8px; padding-right: 8px; }
.keep-calc > summary { display: flex; align-items: center; gap: 12px; cursor: pointer; list-style: none; }
.keep-calc > summary::-webkit-details-marker { display: none; }
.keep-calc > summary::after { content: "▾"; margin-left: auto; font-size: 18px; color: var(--muted); transition: transform .2s; }
.keep-calc[open] > summary::after { transform: rotate(180deg); }
.keep-calc > summary span { display: grid; }
.keep-calc > summary small { color: var(--muted); font-weight: 700; }
@media (max-width: 720px) {
  .sell-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sell-card { padding: 8px; }
}
.keep-calc .mascot-sm { width: 54px; height: 54px; object-fit: contain; flex: none; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15)); }

/* ───────────────────────── Ficha: acciones de un toque ───────────────────────── */
.ficha-acts { display: grid; gap: 10px; margin: 4px 0 6px; }
.acts-row { display: flex; gap: 10px; }
.acts-row .btn { flex: 1 1 0; min-width: 0; justify-content: center; min-height: 58px; padding-left: 10px; padding-right: 10px; font-size: 17px; font-weight: 900; white-space: nowrap; }
.acts-row .act-miss { flex: 0 0 auto; font-size: 15px; }
.act-own { background: var(--good); color: #fff; box-shadow: 0 4px 0 #0B6B1C; }
.act-own:hover { filter: brightness(1.06); }
.act-repe {
  display: grid; justify-items: center; gap: 2px; line-height: 1; background: var(--yellow); color: var(--navy);
  box-shadow: 0 4px 0 var(--yellow-2); flex-grow: 1.3 !important;
}
.act-repe b { position: relative; font-family: var(--font-display); font-weight: normal; font-size: 27px; letter-spacing: .04em; isolation: isolate; }
.act-repe b::before { content: attr(data-t); position: absolute; left: 3px; top: 3px; z-index: -1; color: var(--red); }
.act-repe small { font-size: 12px; font-weight: 800; opacity: .8; }
.act-repe:active { transform: translateY(2px) rotate(-1.5deg); }
.acts-have { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 12px; background: var(--good-bg); color: var(--good-ink); font-weight: 900; }
.acts-have svg { width: 18px; height: 18px; }
.acts-have span { margin-left: auto; color: var(--ink-2); font-weight: 800; font-size: 14px; }
@media (max-width: 420px) {
  .acts-row { gap: 8px; }
  .acts-row .btn { font-size: 15.5px; }
  .acts-row .act-miss { font-size: 13.5px; padding-left: 10px; padding-right: 10px; }
  .act-repe b { font-size: 24px; }
}

/* Botón «REPES» de Mi colección: el logo (dos cartas iguales + ×2) y la palabra con su eco rojo */
.repes-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; min-height: 48px;
  border-radius: 999px; border: 2px solid var(--line-2); background: var(--surface); cursor: pointer;
  transition: transform .15s var(--spring), background .2s, border-color .2s, box-shadow .2s;
}
.repes-btn:hover { transform: translateY(-2px) rotate(-1deg); border-color: var(--ink-2); }
.repes-btn:active { transform: scale(.96); }
.repes-btn svg { width: 36px; height: 36px; flex: none; overflow: visible; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.repes-btn b {
  position: relative; isolation: isolate; font-family: var(--font-display); font-weight: normal; font-size: 22px; line-height: 1;
  letter-spacing: .05em; color: var(--yellow);
  text-shadow: 0 2px 0 #2B57B8, 2px 0 0 #2B57B8, -2px 0 0 #2B57B8, 0 -2px 0 #2B57B8, 2px 2px 0 #2B57B8, -2px 2px 0 #2B57B8, 2px -2px 0 #2B57B8, -2px -2px 0 #2B57B8;
}
.repes-btn b::before {
  content: attr(data-t); position: absolute; left: 4px; top: 3px; z-index: -1; color: var(--red);
  text-shadow: 0 2px 0 #1D1B26, 2px 0 0 #1D1B26, -2px 0 0 #1D1B26, 0 -2px 0 #1D1B26, 2px 2px 0 #1D1B26, -2px 2px 0 #1D1B26;
}
.repes-btn i { font-style: normal; font-weight: 900; font-size: 13px; color: #fff; background: var(--red); padding: 2px 8px; border-radius: 999px; box-shadow: 0 2px 0 var(--red-2); margin-left: 2px; }
.repes-btn.on { background: var(--navy); border-color: var(--yellow); box-shadow: 0 3px 0 var(--yellow); }

/* ───────────────────────── Ayuda: rarezas ───────────────────────── */
.rar-list { display: grid; gap: 8px; }
.rar-row {
  display: grid; grid-template-columns: 104px 46px 1fr auto; grid-template-areas: "sym img txt price";
  gap: 12px; align-items: center; padding: 8px 14px 8px 10px; border-radius: 14px; background: var(--surface-2);
}
.rar-row.joya { background: linear-gradient(100deg, color-mix(in srgb, var(--yellow) 22%, var(--surface-2)), var(--surface-2) 60%); }
.rar-sym {
  grid-area: sym; justify-self: center; display: inline-flex; align-items: center; gap: 1px; height: 30px; padding: 0 9px;
  border-radius: 999px; background: #FFFDF7; border: 1px solid #D6CAB2; /* siempre claro, como la franja de la carta */
}
.rar-sym svg { width: 18px; height: 18px; }
.rar-as, .rar-m { font-style: normal; font-weight: 900; font-size: 10.5px; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; color: #fff; white-space: nowrap; }
.rar-as { background: linear-gradient(90deg, #E3350D, #B4479D); }
.rar-m { background: linear-gradient(90deg, #8A5A00, #F5C431, #8A5A00); color: #1D1B26; }
.rar-card { grid-area: img; padding: 0; border: 0; background: none; border-radius: 4px; overflow: hidden; aspect-ratio: 63 / 88; box-shadow: 0 3px 8px -3px rgba(0, 0, 0, .45); transition: transform .15s var(--spring); }
.rar-card:hover { transform: scale(1.08) rotate(-2deg); }
.rar-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rar-txt { grid-area: txt; display: grid; gap: 2px; min-width: 0; }
.rar-txt b { font-weight: 900; }
.rar-txt b small { font-size: 11px; font-weight: 900; color: var(--ink-2); background: var(--surface-3); padding: 1px 6px; border-radius: 6px; margin-left: 4px; vertical-align: 1px; }
.rar-txt span { color: var(--ink-2); font-weight: 700; font-size: 13.5px; }
.rar-price { grid-area: price; display: grid; justify-items: end; text-align: right; }
.rar-price b { font-weight: 900; color: var(--good-ink); white-space: nowrap; }
.rar-price small { color: var(--muted); font-weight: 700; font-size: 12px; white-space: nowrap; }
.rar-tips { margin-top: 12px; }
@media (max-width: 640px) {
  .rar-row { grid-template-columns: 50px 1fr; grid-template-areas: "img sym" "img txt" "img price"; gap: 4px 12px; align-items: start; padding: 10px; }
  .rar-sym { justify-self: start; }
  .rar-price { justify-items: start; text-align: left; }
}
