/* TablePick — sistema visual
   Paleta: tinta índigo de «noche de juegos», verde azulado para acciones y amarillo de peón
   reservado para el progreso, el foco y el peón del asistente. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-display: swap; src: url("../fonts/bricolage-grotesque-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }

:root {
  --bg: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #e9ecf5;
  --ink: #1b2140;
  --muted: #535a75;
  --line: #d4d8e6;
  --primary: #0b6668;
  --primary-hover: #084f51;
  --on-primary: #ffffff;
  --pawn: #f2b705;
  --pawn-ink: #3a2b00;
  --ok: #17663b;
  --ok-bg: #e3f3e9;
  --warn: #7a4b00;
  --warn-bg: #fff3d6;
  --error: #9b1c24;
  --error-bg: #fde8e8;
  --info-bg: #e6eef9;
  --focus: #f2b705;

  --font-display: "Bricolage Grotesque", "Avenir Next", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 1.953rem;
  --step-4: clamp(2.2rem, 1.6rem + 3vw, 3.4rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-pill: 999px;
  --gutter: 16px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11142a;
    --surface: #1a1f3b;
    --surface-2: #232947;
    --ink: #eceffa;
    --muted: #aab0cb;
    --line: #333a5e;
    --primary: #5fc9ca;
    --primary-hover: #86dadb;
    --on-primary: #08201f;
    --pawn: #f5c842;
    --pawn-ink: #2a1f00;
    --ok: #7dd8a1;
    --ok-bg: #173526;
    --warn: #ffd27a;
    --warn-bg: #3a2c10;
    --error: #ffa3a8;
    --error-bg: #3d1a1f;
    --info-bg: #1f2c4a;
    --focus: #f5c842;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11142a; --surface: #1a1f3b; --surface-2: #232947; --ink: #eceffa; --muted: #aab0cb; --line: #333a5e;
  --primary: #5fc9ca; --primary-hover: #86dadb; --on-primary: #08201f; --pawn: #f5c842; --pawn-ink: #2a1f00;
  --ok: #7dd8a1; --ok-bg: #173526; --warn: #ffd27a; --warn-bg: #3a2c10; --error: #ffa3a8; --error-bg: #3d1a1f;
  --info-bg: #1f2c4a; --focus: #f5c842; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding-block: var(--space-6) var(--space-7); outline: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); font-weight: 800; }
h2 { font-size: var(--step-2); font-weight: 600; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 var(--space-4); }
a { color: var(--primary); text-underline-offset: 0.18em; }
a:hover { color: var(--primary-hover); }
code { font-size: 0.92em; background: var(--surface-2); padding: 0 0.3em; border-radius: 4px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.optional { font-family: var(--font-body); font-size: var(--step--1); font-weight: 400; color: var(--muted); margin-left: var(--space-2); }
.year { font-family: var(--font-body); font-weight: 400; color: var(--muted); font-size: 0.6em; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 44rem; }

.skip-link { position: absolute; left: var(--space-4); top: -100px; background: var(--pawn); color: var(--pawn-ink); padding: var(--space-2) var(--space-4); z-index: 10; border-radius: var(--radius-s); font-weight: 700; }
.skip-link:focus { top: var(--space-2); }

/* ---------- Cabecera y pie ---------- */
.site-header { background: var(--ink); color: var(--bg); }
.header-inner { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand lang" "nav nav"; align-items: center; gap: var(--space-1) var(--space-4); padding-block: var(--space-3); }
.header-inner .wordmark { grid-area: brand; }
.header-inner nav { grid-area: nav; margin-inline: calc(var(--space-2) * -1); }
.header-inner .lang-switch { grid-area: lang; }
@media (min-width: 48rem) {
  .header-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "brand nav lang"; gap: var(--space-4); }
  .header-inner nav { margin-inline: 0; justify-self: end; }
}
.wordmark { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; color: inherit; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); }
.wordmark:hover { color: inherit; }
.meeple { width: 1.6rem; height: 1.6rem; fill: var(--pawn); }
.nav { list-style: none; display: flex; flex-wrap: wrap; gap: 0 var(--space-2); margin: 0; padding: 0; }
.nav a { color: inherit; text-decoration: none; display: block; padding: 0.7rem var(--space-2); border-bottom: 3px solid transparent; font-weight: 700; }
.nav a:hover { border-bottom-color: color-mix(in srgb, var(--pawn) 60%, transparent); color: inherit; }
.nav a.is-current { border-bottom-color: var(--pawn); }
.lang-switch { display: flex; align-items: center; gap: var(--space-2); }
.lang-switch select { width: auto; min-height: 36px; padding: 0.2rem 0.5rem; font-size: var(--step--1); background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 35%, transparent); }
.lang-switch select option { color: var(--ink); background: var(--surface); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); font-size: var(--step--1); color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); padding-block: var(--space-5); }
.footer-inner p { margin: 0; max-width: 40rem; }
.bgg-credit { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.bgg-logo img { width: 200px; height: auto; }

/* ---------- Botones y formularios ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0.55rem 1.1rem;
  border: 2px solid var(--line); border-radius: var(--radius-m);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--primary); color: var(--ink); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { border-color: var(--line); color: var(--primary-hover); }
.btn-small { min-height: 36px; padding: 0.3rem 0.8rem; font-size: var(--step--1); }
.btn-large { min-height: 52px; padding: 0.7rem 1.6rem; font-size: var(--step-1); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.6; cursor: not-allowed; }
.link-strong { font-weight: 700; }

label { font-weight: 700; }
input[type="text"], input[type="search"], input[type="number"], input[type="date"], select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius-s);
  min-height: 44px; padding: 0.4rem 0.7rem; width: 100%;
}
input:focus-visible, select:focus-visible { border-color: var(--primary); }
input[aria-invalid="true"] { border-color: var(--error); }
input[type="radio"], input[type="checkbox"] { accent-color: var(--primary); width: 1.15rem; height: 1.15rem; flex: none; margin-top: 0.2rem; }

.notice { padding: var(--space-3) var(--space-4); border-radius: var(--radius-m); border-left: 5px solid; margin-block: var(--space-4); }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok); }
.notice-info { background: var(--info-bg); border-color: var(--primary); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn); }
.notice-error { background: var(--error-bg); border-color: var(--error); }

/* ---------- Portada ---------- */
.hero { display: grid; gap: var(--space-5); padding-block: var(--space-5) var(--space-6); }
.hero h1 { font-size: clamp(2.6rem, 1.8rem + 4.5vw, 4.6rem); max-width: 14ch; margin-bottom: var(--space-4); }
.lede { font-size: var(--step-1); color: var(--muted); max-width: 42rem; }
.hero-start {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4);
  background: var(--surface); border: 2px solid var(--ink); border-radius: var(--radius-m);
  padding: var(--space-4) var(--space-5); width: fit-content; max-width: 100%;
  box-shadow: 6px 6px 0 var(--pawn);
}
.hero-start-label { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); }
.stepper { display: inline-flex; align-items: stretch; border: 2px solid var(--line); border-radius: var(--radius-m); overflow: hidden; background: var(--surface); }
.stepper input { width: 4.5rem; border: 0; border-radius: 0; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: var(--step-2); -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn { border: 0; background: var(--surface-2); color: var(--ink); font-size: var(--step-2); min-width: 48px; cursor: pointer; font-weight: 700; }
.stepper-btn:hover { background: var(--line); }
@media (max-width: 34rem) {
  .hero-start { padding: var(--space-4); gap: var(--space-3); width: 100%; box-shadow: 4px 4px 0 var(--pawn); justify-content: center; }
  .hero-start-label { font-size: var(--step-1); }
  .hero-start .stepper input { width: 3rem; font-size: var(--step-1); }
  .hero-start .stepper-btn { min-width: 40px; font-size: var(--step-1); }
  .hero-start .btn { flex: 1 1 100%; }
}
.stepper-large input { width: 6rem; font-size: var(--step-3); }

.home-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.home-panel { border-top: 4px solid var(--ink); padding-top: var(--space-4); }
.mini-title { font-weight: 700; margin: var(--space-3) 0 var(--space-1); font-size: var(--step--1); color: var(--muted); }
.mini-rank { margin: 0 0 var(--space-3); padding-left: 1.4rem; }

/* ---------- Cabecera de página ---------- */
.page-head { margin-bottom: var(--space-5); }
.page-head h1 { font-size: var(--step-3); }
@media (min-width: 48rem) { .page-head h1 { font-size: clamp(2rem, 1.4rem + 2vw, 2.8rem); } }

/* ---------- Asistente: tablero de progreso ---------- */
.wizard { max-width: 48rem; }
.track { position: relative; margin-top: 2.25rem; margin-bottom: var(--space-5); --pos: 0; --steps: 6; }
.track ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--steps), 1fr); position: relative; }
.track ol::before { content: ""; position: absolute; left: calc(100% / var(--steps) / 2); right: calc(100% / var(--steps) / 2); top: 22px; height: 4px; background: var(--line); border-radius: 2px; }
.track-space { position: relative; display: flex; justify-content: center; }
.track-space button { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.track-num {
  width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--surface); border: 3px solid var(--line); border-radius: var(--radius-s);
  font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--ink);
  position: relative; z-index: 1; transform: rotate(-2deg);
}
.track-space:nth-child(even) .track-num { transform: rotate(2deg); }
.track-label { font-size: var(--step--1); font-weight: 700; text-align: center; line-height: 1.2; }
.track-space.is-done .track-num { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.track-space.is-current .track-num { border-color: var(--ink); background: var(--pawn); color: var(--pawn-ink); }
.track-space.is-current .track-label { color: var(--ink); }
.track-pawn {
  position: absolute; top: -30px; width: 30px; height: 30px; fill: var(--ink);
  left: calc((100% / var(--steps)) * var(--pos) + (100% / var(--steps) / 2) - 15px);
  transition: left 280ms cubic-bezier(.3,1.4,.6,1); z-index: 2;
  filter: drop-shadow(0 2px 0 var(--pawn));
}
/* El título de cada paso ya dice «Paso X de N»: aquí solo se anuncia a lectores de pantalla. */
.track-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 34rem) {
  .track-label { display: none; }
  .track-num { width: 40px; height: 40px; }
  .track ol::before { top: 18px; }
}
@media (prefers-reduced-motion: reduce) { .track-pawn { transition: none; } }

.step { border: 0; padding: 0; margin: 0 0 var(--space-6); min-width: 0; }
.step legend { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); line-height: 1.2; margin-bottom: var(--space-4); padding: 0; outline: none; }
.step-num { display: block; font-family: var(--font-body); font-size: var(--step--1); font-weight: 700; color: var(--muted); margin-bottom: var(--space-1); }
.wizard:not(.is-enhanced) .step { padding-bottom: var(--space-5); border-bottom: 1px solid var(--line); }
.hint { color: var(--muted); font-size: var(--step--1); max-width: 40rem; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: var(--space-2); margin-bottom: var(--space-4); }
.choice-list { display: grid; gap: var(--space-2); margin-bottom: var(--space-4); }
.choice {
  display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  border: 2px solid var(--line); border-radius: var(--radius-m); background: var(--surface); cursor: pointer; font-weight: 400;
}
.choice:hover { border-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.choice-wide strong { display: block; }
.choice-wide .muted { display: block; font-size: var(--step--1); }
.chip-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.chip-choice { display: inline-flex; align-items: center; gap: var(--space-2); padding: 0.4rem 0.9rem; border: 2px solid var(--line); border-radius: var(--radius-pill); background: var(--surface); cursor: pointer; font-weight: 700; min-height: 44px; }
.chip-choice input { margin-top: 0; }
.chip-choice:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.toggle { display: flex; align-items: flex-start; gap: var(--space-3); font-weight: 400; padding: var(--space-3) 0; max-width: 40rem; }
.toggle-inline { padding: 0; align-items: center; }
.toggle-inline input { margin-top: 0; }
.basis { margin-bottom: var(--space-3); font-size: var(--step--1); }
.basis summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 44px; display: flex; align-items: center; }
.basis dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin: var(--space-2) 0; }
.basis dt { font-weight: 700; }
.basis dd { margin: 0; color: var(--muted); }
@media (max-width: 34rem) { .basis dl { grid-template-columns: 1fr; } .basis dd { margin-bottom: var(--space-2); } }
.wizard-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding-top: var(--space-4); border-top: 1px solid var(--line); }
.wizard-actions [data-next], .wizard-actions [data-submit] { margin-left: auto; }

/* ---------- Resultados ---------- */
.condition-list { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-4); }
.condition-list li { background: var(--surface-2); padding: 0.2rem 0.8rem; border-radius: var(--radius-pill); font-size: var(--step--1); font-weight: 700; }
.result-meta { max-width: 48rem; }
.result-meta .muted { display: block; font-size: var(--step--1); }
.section-title { font-size: var(--step-1); margin-top: var(--space-6); }

.rec-card { display: grid; grid-template-columns: 6.5rem 1fr; gap: var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: var(--space-4); }
.rec-card-featured { grid-template-columns: minmax(0, 16rem) 1fr; border: 2px solid var(--ink); padding: var(--space-5); box-shadow: 6px 6px 0 var(--pawn); gap: var(--space-5); }
.rec-cover img { border-radius: var(--radius-s); width: 100%; object-fit: contain; aspect-ratio: 1; background: var(--surface-2); }
.rec-card-featured .rec-cover img { aspect-ratio: auto; max-height: 22rem; object-fit: contain; }
.rec-title { margin-bottom: var(--space-3); }
.rec-card-featured .rec-title { font-size: var(--step-3); font-weight: 800; }
.rec-title a { color: var(--ink); text-decoration: none; }
.rec-title a:hover { text-decoration: underline; }
.highlight { display: inline-block; margin-bottom: var(--space-2); background: var(--pawn); color: var(--pawn-ink); font-weight: 700; font-size: var(--step--1); padding: 0.1rem 0.6rem; border-radius: var(--radius-s); }
.facts { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0 0 var(--space-3); }
.facts div { min-width: 0; }
.facts dt { font-size: var(--step--1); color: var(--muted); }
.facts dd { margin: 0; font-weight: 700; }
.facts-large dd { font-size: var(--step-1); }
.facts-large dd .muted { display: block; font-weight: 400; margin-top: 0.1rem; }
.fit { font-family: var(--font-display); font-weight: 800; }
.reasons { list-style: none; padding: 0; margin: 0 0 var(--space-3); display: grid; gap: var(--space-1); }
.reasons li { padding-left: 1.6rem; position: relative; }
.reasons li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.reason-ok::before { content: "✓"; color: var(--ok); }
.reason-caveat { color: var(--muted); }
.reason-caveat::before { content: "!"; color: var(--warn); left: 0.35rem !important; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); padding: 0; margin: 0 0 var(--space-3); }
.tags li { font-size: var(--step--1); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 0 0.5rem; }
.tags a { color: inherit; text-decoration: none; }
.tags a:hover { text-decoration: underline; }
.community { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); font-size: var(--step--1); color: var(--muted); margin-bottom: var(--space-3); }
.in-collection { color: var(--ok); font-weight: 700; }
.card-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.card-grid { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 30rem), 1fr)); }
.compact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.compact-list li { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; padding-block: var(--space-2); border-bottom: 1px solid var(--line); }
.compact-list .muted { font-size: var(--step--1); }
.unverified { margin-top: var(--space-6); }
.relax-list { padding-left: 1.2rem; }

.cover-missing { display: grid; place-items: center; aspect-ratio: 1; background: var(--surface-2); border-radius: var(--radius-s); color: var(--muted); font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); width: 100%; }
.cover-missing-large { font-size: 5rem; }

.empty-state { background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius-m); padding: var(--space-5); max-width: 48rem; }
.empty-state h1, .empty-state h2 { font-size: var(--step-2); }

@media (max-width: 40rem) {
  .rec-card, .rec-card-featured { grid-template-columns: 1fr; }
  .rec-card .rec-cover { max-width: 8rem; }
  .rec-card-featured .rec-cover { max-width: 14rem; }
  .rec-card-featured { box-shadow: 4px 4px 0 var(--pawn); padding: var(--space-4); }
  .rec-cover .cover-missing { aspect-ratio: auto; width: 4.5rem; height: 4.5rem; font-size: var(--step-2); }
}

/* ---------- Catálogo ---------- */
.catalog-search { margin-bottom: var(--space-5); }
.search-row { display: flex; gap: var(--space-2); max-width: 40rem; }
.search-row input { flex: 1; }
.filters { margin-top: var(--space-3); }
.filters summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 44px; display: inline-flex; align-items: center; }
.filter-grid { display: grid; gap: var(--space-3) var(--space-4); grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); margin: var(--space-3) 0; }
.filter-grid label { display: block; margin-bottom: var(--space-1); font-size: var(--step--1); }
.game-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-5) var(--space-3); grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.game-tile { min-width: 0; }
.tile-link { display: grid; gap: var(--space-2); color: var(--ink); text-decoration: none; }
.tile-link img, .tile-link .cover-missing { aspect-ratio: 1; object-fit: contain; border-radius: var(--radius-s); background: var(--surface-2); width: 100%; }
.tile-link:hover .tile-name { text-decoration: underline; }
.tile-name { font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.tile-facts, .tile-community { font-size: var(--step--1); color: var(--muted); margin: var(--space-1) 0 0; }
.tile-community { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); }
.pager { display: flex; gap: var(--space-4); align-items: center; justify-content: center; margin-top: var(--space-6); }
.pager a { font-weight: 700; padding: var(--space-2); }
.more-source { margin-top: var(--space-5); }
.provider-results { margin-top: var(--space-6); max-width: 48rem; }
.provider-item { justify-content: space-between; }
.provider-item form { margin: 0; }

/* ---------- Ficha ---------- */
.game-head { display: grid; gap: var(--space-5); grid-template-columns: minmax(0, 18rem) 1fr; margin-bottom: var(--space-5); }
.game-cover img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; max-height: 26rem; object-fit: contain; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface-2); }
.credit { font-size: var(--step--1); color: var(--muted); margin-top: var(--space-2); }
.game-intro h1 { font-size: var(--step-4); }
.game-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-4); }
.game-layout { display: grid; gap: var(--space-6); grid-template-columns: 1fr minmax(16rem, 22rem); align-items: start; }
.game-main section { margin-bottom: var(--space-6); }
.prose { max-width: 42rem; }
.prose p { margin-bottom: var(--space-3); }
/* ---------- Anuncios ---------- */
.ad { margin: var(--space-6) auto; max-width: 970px; }
.ad-label { margin: 0 0 var(--space-1); font-size: 0.75rem; color: var(--muted); text-align: center; }
.ad-box { min-height: 100px; display: grid; place-items: center; }  /* espacio reservado: la página no salta al cargar */
.adsbygoogle { display: block; width: 100%; }
.ad:has(ins[data-ad-status="unfilled"]) { display: none; }          /* sin anuncio, no se deja un hueco */
.ad-preview .ad-box { border: 2px dashed var(--line); background: var(--surface-2); color: var(--muted); font-size: var(--step--1); border-radius: var(--radius-s); }
.ad-sidebar { display: none; }
@media (min-width: 52rem) {
  .ad-banner .ad-box { min-height: 90px; }
  .ad-sidebar { display: block; margin: 0; }
  .ad-sidebar .ad-box { min-height: 250px; }
  .ad-below-desktop { display: none; }
}

/* ---------- Enlaces de compra (afiliados) ---------- */
.buy { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--line); max-width: 48rem; }
.buy h2 { font-size: var(--step-1); }
.buy-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-3); padding: 0; margin: 0 0 var(--space-3); }
.buy-links .btn { gap: var(--space-3); }
.buy-region { font-weight: 400; font-size: var(--step--1); color: var(--muted); }
.disclosure { max-width: 40rem; }

.original { margin: var(--space-2) 0 var(--space-3); }
.original summary { cursor: pointer; font-weight: 700; color: var(--primary); min-height: 44px; display: inline-flex; align-items: center; }
.original .prose { color: var(--muted); }
.credits { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-2) var(--space-4); margin: 0; }
.credits dt { font-weight: 700; }
.credits dd { margin: 0; }
.game-side { display: grid; gap: var(--space-4); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: var(--space-4) var(--space-5); }
.panel h2 { font-size: var(--step-1); }
.panel-quiet { background: transparent; }
.big-number { font-family: var(--font-display); font-weight: 800; font-size: var(--step-4); line-height: 1; margin-bottom: var(--space-1); }
.big-number span { font-size: var(--step-0); font-weight: 600; color: var(--muted); }
.distribution { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-1); }
.distribution li { display: grid; grid-template-columns: 2.6rem 1fr 2rem; gap: var(--space-2); align-items: center; font-size: var(--step--1); }
.dist-bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.dist-bar span { display: block; height: 100%; background: var(--ink); }
.dist-count { text-align: right; color: var(--muted); }
.source-line { padding-inline: var(--space-2); }

.rate-form fieldset { border: 0; padding: 0; margin: 0 0 var(--space-3); }
.rate-form legend { font-weight: 700; margin-bottom: var(--space-2); }
.stars { display: inline-flex; flex-direction: row-reverse; gap: var(--space-1); }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { width: 44px; height: 44px; cursor: pointer; display: grid; place-items: center; border-radius: var(--radius-s); }
.stars label::before { content: "★"; font-size: 2rem; line-height: 1; color: var(--line); }
.stars input:checked ~ label::before, .stars label:hover::before, .stars label:hover ~ label::before { color: var(--pawn); -webkit-text-stroke: 1px var(--pawn-ink); }
.stars input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }
.play-form { display: grid; gap: var(--space-2); margin-bottom: var(--space-3); }
.play-form label { font-size: var(--step--1); margin-top: var(--space-2); }
.play-form .btn { margin-top: var(--space-3); justify-self: start; }

@media (max-width: 52rem) {
  .game-head, .game-layout { grid-template-columns: 1fr; }
  .game-cover { max-width: 30rem; }
  .game-cover .cover-missing-large { width: 6rem; height: 6rem; aspect-ratio: auto; font-size: var(--step-3); }
}

/* ---------- Rankings ---------- */
.totals { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.ranking-layout { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); align-items: start; }
.rank-list { list-style: none; padding: 0; margin: 0; counter-reset: none; }
.rank-list li { display: grid; grid-template-columns: 2.2rem 1fr; gap: 0 var(--space-3); padding-block: var(--space-2); border-bottom: 1px solid var(--line); }
.rank-list li:last-child { border-bottom: 0; }
.rank-pos { grid-row: span 2; font-family: var(--font-display); font-weight: 800; font-size: var(--step-1); color: var(--muted); }
.rank-list li:first-child .rank-pos { color: var(--ink); }
.rank-list a { font-weight: 700; }
.rank-meta { font-size: var(--step--1); color: var(--muted); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.inline-form select { width: auto; min-width: 9rem; }
.inline-form label { font-size: var(--step--1); }
.method { max-width: 48rem; margin-top: var(--space-6); }
.method h2 { font-size: var(--step-1); }

/* ---------- Colección ---------- */
.collection { display: grid; gap: var(--space-5); }
.collection .panel { max-width: 40rem; }
.collection .panel label { display: block; margin-bottom: var(--space-2); }
.suggestions { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.suggestions li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: var(--space-3); }
.section-head input { max-width: 18rem; }
.collection-list { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; gap: var(--space-2); }
.collection-item { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }
.collection-item a { font-weight: 700; margin-right: auto; }
.collection-item.is-unavailable a { color: var(--muted); }

/* Anchos de las barras de distribución (sin estilos en línea por la CSP). */
.w-0 { width: 0; } .w-5 { width: 5%; } .w-10 { width: 10%; } .w-15 { width: 15%; } .w-20 { width: 20%; }
.w-25 { width: 25%; } .w-30 { width: 30%; } .w-35 { width: 35%; } .w-40 { width: 40%; } .w-45 { width: 45%; }
.w-50 { width: 50%; } .w-55 { width: 55%; } .w-60 { width: 60%; } .w-65 { width: 65%; } .w-70 { width: 70%; }
.w-75 { width: 75%; } .w-80 { width: 80%; } .w-85 { width: 85%; } .w-90 { width: 90%; } .w-95 { width: 95%; } .w-100 { width: 100%; }
.dist-bar span[class^="w-"] { display: block; }

/* La portada reserva su espacio antes de cargar (no se conoce su proporción): apaisada en móvil, cuadrada junto al texto. */
@media (min-width: 52rem) { .game-cover img { aspect-ratio: 1; } }
