/* ==========================================================================
   Páginas públicas de Kolekto (scripts/seo/: cada juego, cada set y cada carta, para Google).
   Ligeras y sin JavaScript: los mismos tokens que base.css (paleta «Tinta», Newsreader e Instrument
   Sans, el acento de cada juego), solo lo que usan estas páginas. Primero el móvil.
   ========================================================================== */

@font-face {
  font-family: 'Instrument Sans';
  src: url('../fonts/instrument-sans-latin-wdth-normal.woff2') format('woff2');
  font-weight: 400 700;
  font-stretch: 75% 100%;
  font-display: swap;
}
/* La de los títulos pesa: si no llega a tiempo, Georgia (sin saltos al cargar) */
@font-face {
  font-family: 'Newsreader';
  src: url('../fonts/newsreader-latin-opsz-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: optional;
}

:root {
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #19191c;
  --surface-3: #202024;
  --line: #232326;
  --line-2: #303035;
  --line-soft: rgba(255, 255, 255, .055);
  --text: #eeece7;
  --text-2: #b6b3ac;
  --muted: #8d8b85;
  --brass: #c9a35b;
  --brass-2: #e2c286;
  --accent: var(--brass);
  --accent-2: var(--brass-2);
  --ok: #3fbf8c;
  --ok-2: #7fdcb4;
  --ok-soft: rgba(63, 191, 140, .12);
  --bad: #f06b6b;
  --bad-2: #ffa3a3;
  --bad-soft: rgba(240, 107, 107, .12);
  --warn: #e5a54b;
  --warn-soft: rgba(229, 165, 75, .12);
  --font: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --r: 10px;
  --r-s: 7px;
  --w: 1120px;
  --gutter: 16px;
  color-scheme: dark;
  /* Los colores de cada juego (los de base.css) */
  --g-onepiece: #e2ae4d;
  --g-pokemon: #6aa6ff;
  --g-dbsfw: #f2913f;
  --g-digimon: #43c2e4;
  --g-yugioh: #a88bf4;
  --g-magic: #e27cb3;
  --g-lorcana: #8f97ff;
}
[data-game="onepiece"] { --accent: var(--g-onepiece); --accent-2: #f0ca7e; }
[data-game="pokemon"] { --accent: var(--g-pokemon); --accent-2: #a6c9ff; }
[data-game="dbsfw"] { --accent: var(--g-dbsfw); --accent-2: #f9b77c; }
[data-game="digimon"] { --accent: var(--g-digimon); --accent-2: #8fdcf0; }
[data-game="yugioh"] { --accent: var(--g-yugioh); --accent-2: #c9b6fa; }
[data-game="magic"] { --accent: var(--g-magic); --accent-2: #f0aed1; }
[data-game="lorcana"] { --accent: var(--g-lorcana); --accent-2: #c3c8ff; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 460px at 50% -240px, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%), var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--accent-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 450; letter-spacing: -.015em; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(30px, 6.4vw, 52px); letter-spacing: -.028em; }
h2 { font-size: clamp(22px, 3.6vw, 30px); margin-bottom: 8px; }
h3 { font-size: 19px; }
p { margin: 0 0 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.s-wrap { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter); }
.s-muted { color: var(--muted); }
.s-note { color: var(--muted); font-size: 13px; }
.s-skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--text); color: var(--bg); border-radius: var(--r-s); }
.s-skip:focus { top: 8px; }

/* ---------- Barra ---------- */
.s-bar { display: flex; align-items: center; gap: 12px; max-width: var(--w); margin: 0 auto; padding: 12px var(--gutter); }
.s-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; flex: none; }
.k-mark { width: 24px; height: 24px; display: block; }
.k-mark .k-on { fill: var(--text); }
.k-mark .k-hit { fill: var(--brass); }
.k-mark .k-off { fill: none; stroke: var(--text); stroke-opacity: .28; stroke-width: 1; }
.k-word { font-family: var(--serif); font-weight: 560; font-size: 20px; line-height: 1; letter-spacing: -.012em; }
.s-nav { display: none; gap: 18px; }
.s-nav a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.s-nav a:hover { color: var(--text); }
.s-bar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.s-lang { display: inline-grid; place-items: center; min-width: 40px; height: 36px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: var(--r-s); color: var(--text-2); text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .06em; }
.s-lang:hover { color: var(--text); border-color: var(--muted); }

/* ---------- Botones ---------- */
.s-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border-radius: var(--r-s); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; }
.s-btn:hover { background: var(--surface-3); color: var(--text); }
.s-btn-primary { background: var(--text); border-color: var(--text); color: #141210; }
.s-btn-primary:hover { background: #fff; color: #141210; }
.s-btn-lg { min-height: 46px; padding: 0 22px; font-size: 16px; }
.s-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 20px 0 0; }
.s-shop { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); color: var(--text); text-decoration: none; font-weight: 550; font-size: 14px; }
.s-shop:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Ruta ---------- */
.s-crumbs { max-width: var(--w); margin: 0 auto; padding: 4px var(--gutter) 0; font-size: 13px; color: var(--muted); }
.s-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
.s-crumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line-2); }
.s-crumbs a { color: var(--text-2); text-decoration: none; }
.s-crumbs a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Cabecera de cada página ---------- */
.s-hero { padding: 28px 0 8px; }
.s-kicker { margin: 0 0 12px; color: var(--accent-2); font-size: 11px; font-weight: 650; font-stretch: 88%; letter-spacing: .14em; text-transform: uppercase; }
.s-lead { margin-top: 16px; max-width: 68ch; color: var(--text-2); font-size: 17px; line-height: 1.6; }
.s-hero h1 + p { margin-top: 14px; }
.s-meta { color: var(--text-2); }
.s-code { color: var(--accent-2); font-family: var(--font); font-weight: 600; font-size: .62em; letter-spacing: 0; vertical-align: .14em; white-space: nowrap; }
.s-flag { display: inline-block; padding: 6px 10px; border-radius: var(--r-s); background: var(--warn-soft); color: var(--warn); font-size: 14px; }
.s-chip { display: inline-block; padding: 0 6px; border-radius: 4px; background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 600; vertical-align: middle; }
.s-hero-split { display: grid; gap: 18px; align-items: center; }
/* Tamaño fijo: la foto de la caja puede ser apaisada o no, y la página no salta al llegar */
.s-hero-art { width: 180px; height: 180px; object-fit: contain; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .55)); }

/* ---------- Secciones ---------- */
.s-sec { padding: 28px 0 4px; border-top: 1px solid var(--line); margin-top: 24px; }
.s-hero + .s-sec { border-top: 0; margin-top: 8px; }
.s-how p { max-width: 75ch; color: var(--text-2); }

/* ---------- Cifras de un set ---------- */
.s-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.s-kpi { display: flex; flex-direction: column; gap: 2px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.s-kpi-accent { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.s-kpi-l { color: var(--muted); font-size: 11px; font-weight: 650; font-stretch: 88%; letter-spacing: .08em; text-transform: uppercase; }
.s-kpi-v { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.s-kpi-s { color: var(--muted); font-size: 12px; line-height: 1.4; }
.s-verdict { max-width: 80ch; padding: 14px 16px; border-radius: var(--r); border-left: 3px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: 16px; }
.s-verdict b { color: var(--text); }
.s-verdict.good { border-left-color: var(--ok); background: var(--ok-soft); }
.s-verdict.bad { border-left-color: var(--bad); background: var(--bad-soft); }

/* ---------- Tablas ---------- */
/* position: relative para que el .sr-only de sus enlaces (absoluto) quede dentro del desplazamiento: si no,
   cuenta como ancho de la página y el móvil se aleja (+170 px en las páginas de carta) */
.s-table { position: relative; overflow-x: auto; margin: 12px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); -webkit-overflow-scrolling: touch; }
.s-dt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14px; }
.s-dt th, .s-dt td { padding: 9px 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-soft); }
.s-dt thead th { color: var(--muted); font-size: 11px; font-weight: 650; font-stretch: 88%; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; border-bottom-color: var(--line-2); }
.s-dt tbody th { font-weight: 550; min-width: 150px; }
.s-dt .n { text-align: right; white-space: nowrap; }
.s-dt .up { color: var(--ok-2); }
.s-dt .down { color: var(--bad-2); }
.s-dt a { color: var(--text); text-decoration: none; }
.s-dt a:hover { color: var(--accent-2); text-decoration: underline; }
.s-sub { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.s-thumb { width: 60px; min-width: 58px; padding-right: 0 !important; }
/* Sin encoger en una tabla estrecha (el móvil): la tabla se desplaza de lado */
.s-thumb img, .s-drivers img { display: block; width: 48px; min-width: 48px; max-width: none; height: auto; border-radius: 3px; background: var(--surface-2); }
.s-bar-pct { display: inline-block; width: 40px; height: 6px; margin-right: 8px; border-radius: 3px; background: linear-gradient(90deg, var(--accent) var(--w), var(--line-2) var(--w)); vertical-align: middle; }
.s-shops { white-space: nowrap; }
.s-shops .s-shop { min-height: 30px; padding: 0 8px; font-size: 13px; }

/* ---------- Cartas en rejilla ---------- */
.s-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin: 16px 0 0; padding: 0; list-style: none; }
.s-tile a, .s-tile > div { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text); text-decoration: none; }
.s-tile a:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.s-tile img, .s-noimg { width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: contain; border-radius: 5px; margin-bottom: 6px; background: var(--surface-2); }
.s-noimg { display: block; }
.s-tile-name { font-weight: 600; line-height: 1.3; }
.s-tile-meta { color: var(--muted); font-size: 12px; }
.s-tile-price { margin-top: auto; padding-top: 4px; font-variant-numeric: tabular-nums; }

.s-drivers { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.s-drivers li { display: flex; gap: 12px; align-items: center; }

/* ---------- Juegos (índice) ---------- */
.s-games { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); margin: 16px 0 0; padding: 0; list-style: none; }
.s-game { position: relative; padding: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.s-game::before { content: ""; position: absolute; left: 18px; top: 0; width: 34px; height: 3px; border-radius: 0 0 3px 3px; background: var(--g); }
.s-game h3 { margin-bottom: 6px; color: var(--text); }
.s-game > a { text-decoration: none; }
.s-game p { margin: 0 0 4px; color: var(--text-2); font-size: 14px; }
.s-game-stats { color: var(--muted) !important; }
.s-more { display: inline-block; margin-top: 8px; font-weight: 600; }

.s-features { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.s-feature { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--text-2); }

/* ---------- Sets por año ---------- */
.s-years { display: grid; gap: 18px; margin-top: 12px; }
.s-year h3 { margin-bottom: 6px; font-size: 17px; color: var(--text-2); }
.s-year ul { display: grid; gap: 4px 18px; margin: 0; padding: 0; list-style: none; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.s-year a { color: var(--text-2); text-decoration: none; }
.s-year a:hover { color: var(--text); text-decoration: underline; }
.s-year b { color: var(--accent-2); font-weight: 600; }

/* ---------- Ficha de una carta ---------- */
.s-card-hero { display: grid; gap: 22px; }
.s-card-art img { display: block; width: min(300px, 78vw); height: auto; border-radius: 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, .45), 0 24px 48px -16px rgba(0, 0, 0, .7); }
.s-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin: 18px 0 0; }
.s-facts div { min-width: 0; }
.s-facts dt { color: var(--muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
.s-facts dd { margin: 2px 0 0; }

/* ---------- Producto sellado y gráfico ---------- */
.s-sealed { display: grid; gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.s-sealed-item { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.s-sealed-item img { grid-row: span 2; width: 64px; height: 64px; object-fit: contain; }
.s-sealed-item .s-note { grid-column: 2 / 4; margin: 0; }
.s-sealed-price { font-variant-numeric: tabular-nums; font-size: 18px; }
.s-chart { margin: 12px 0 0; }
.s-chart-box { position: relative; height: 220px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.s-chart-box svg { display: block; width: 100%; height: 100%; }
.s-chart-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 14px; }
.s-chart-msg[hidden] { display: none; }
.s-chart .line { fill: none; stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.s-chart .area { fill: color-mix(in srgb, var(--accent) 14%, transparent); }
.s-chart .lbl { fill: var(--text-2); font: 12px var(--font); }
.s-chart figcaption { margin-top: 8px; }

/* ---------- Vecinos, llamada y pie ---------- */
.s-neighbours { display: grid; gap: 10px; }
.s-nb { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); color: var(--text); text-decoration: none; background: var(--surface); }
.s-nb:hover { border-color: color-mix(in srgb, var(--accent) 55%, transparent); color: var(--text); }
.s-nb.all { text-align: center; font-weight: 600; }
.s-cta { margin: 36px 0 12px; padding: 28px 20px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 14px; background: radial-gradient(600px 220px at 50% 0, color-mix(in srgb, var(--accent) 12%, transparent), transparent 75%), var(--surface); text-align: center; }
.s-cta p { max-width: 60ch; margin: 8px auto 18px; color: var(--text-2); }
.s-cta .s-actions { justify-content: center; max-width: none; margin: 0; }
.s-foot { margin-top: 40px; padding: 28px 0 36px; border-top: 1px solid var(--line); }
.s-foot-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.s-foot-links { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.s-foot-links a { color: var(--text-2); }
.s-foot .s-note { max-width: 90ch; }

/* ---------- Pantallas medianas y grandes ---------- */
@media (min-width: 640px) {
  :root { --gutter: 24px; }
  .s-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .s-neighbours { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
  .s-nb.next { text-align: right; }
  .s-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
@media (min-width: 860px) {
  .s-nav { display: flex; margin-left: 18px; }
  .s-hero { padding-top: 44px; }
  .s-hero-split { grid-template-columns: minmax(0, 1fr) auto; }
  .s-hero-art { width: 240px; height: 240px; }
  .s-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .s-card-hero { grid-template-columns: 300px minmax(0, 1fr); align-items: start; gap: 40px; }
  .s-table { margin-left: 0; margin-right: 0; padding: 0; }
}
/* En pantallas táctiles, dianas de 40 px (docs/barrido-responsive.md): los botones crecen; los enlaces de
   una línea o de una tabla solo agrandan su zona de toque, sin mover nada */
@media (pointer: coarse) {
  .s-brand, .s-lang, .s-btn, .s-shop, .s-shops .s-shop, .s-foot-links a { min-height: 40px; }
  .s-lang { height: 40px; }
  .s-foot-links a { display: inline-flex; align-items: center; }
  .s-year a { display: inline-block; padding: 8px 0; }
  .s-crumbs a, .s-dt a:not(.s-shop), .s-more, .s-game > a, .s-drivers a, .s-facts a, .s-note a, .s-lead a, .s-tile-name a { position: relative; }
  .s-crumbs a::after, .s-dt a:not(.s-shop)::after, .s-more::after, .s-game > a::after, .s-drivers a::after, .s-facts a::after, .s-note a::after, .s-lead a::after, .s-tile-name a::after { content: ""; position: absolute; inset: -12px -6px; }
  /* Un código corto («SSK») también llega a 40 px de ancho */
  .s-crumbs a::after { left: 50%; right: auto; width: max(100% + 12px, 40px); transform: translateX(-50%); }
}
@media (prefers-reduced-motion: no-preference) {
  .s-tile a, .s-nb, .s-btn, .s-shop { transition: border-color .15s, background .15s, color .15s; }
}
@media print {
  body { background: #fff; color: #000; }
  .s-bar, .s-cta, .s-skip { display: none; }
}
