/* Fonts load from <link> tags in base.html (no @import chain). Cabinet Grotesk comes from Fontshare: Google Fonts doesn't have it. */

:root {
  /* Color Palette - Defined Design Tokens */
  --color-primary: #7A5DC0;    /* Malva: headings, primary actions, active tabs. White on it is 5.05:1 (AA); #8367C7 was 4.43:1 */
  --color-secondary: #73D8D4;  /* Turquesa pastel: Accent badges, borders, secondary CTAs */
  --color-accent: #FF9E8A;     /* Coral deslavado: Lowest price highlights, stock warnings, alerts */
  --color-bg: #F5F0E9;         /* Blanco roto: Main app background, neutral card canvas */
  --color-surface: #FFFFFF;    /* Pure White: Foreground card surfaces */
  --color-text: #3A3A3A;       /* Carbón suave: Primary typography and body copy */
  --color-text-muted: #636363; /* Muted text: labels, timestamps. 5.3:1 on the beige background (#6E6E6E was 4.5:1, borderline) */
  --color-border: #E2DBD0;     /* Subtle container dividers */
  --color-border-control: #8C8279; /* Input and search borders: 3.3:1 on beige, 3.8:1 on white (WCAG 1.4.11) */
  --color-primary-text: #6A4FB0;   /* Links and small purple text: 6.2:1 on white, 5.6:1 on beige (primary is 4.45:1 there) */

  /* Typography */
  --font-family-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-family-heading: "Cabinet Grotesk", var(--font-family-sans);

  /* Shadows & Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(122, 93, 192, 0.08);
  --shadow-lg: 0 10px 24px rgba(122, 93, 192, 0.12);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family-sans);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

a {
  color: var(--color-primary-text);
  text-decoration: none;
}

/* The sticky header (70 px) must never cover an anchor target or a focused element (WCAG 2.4.11) */
html { scroll-padding-top: 86px; }
@media (max-width: 480px) { html { scroll-padding-top: 76px; } }

.text-primary { color: var(--color-primary); }

/* Text links underline on hover; buttons, cards and nav have their own hover (fading them looked disabled) */
a:not(.btn, .nav-link, .brand-logo, .meta-pill, .stock-switch, .home-pill):hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Nav */
.site-header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-family-heading);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-text);
}

.brand-meeple {
  width: 32px;
  height: 32px;
  fill: var(--color-primary);
}

.nav-links {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav-link {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-primary);
  background-color: rgba(122, 93, 192, 0.08);
}


/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-family-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF !important;
  box-shadow: 0 4px 10px rgba(122, 93, 192, 0.3);
}

.btn-primary:hover {
  background-color: var(--color-primary-text);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text);
}

.btn-secondary:hover {
  background-color: #5ecbc7;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  background-color: rgba(0, 0, 0, 0.03);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
}

/* A disabled button must not look clickable (no hover either; the cursor keeps the title tooltip working) */
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-outline:disabled:hover {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.badge-in-stock {
  background-color: #E8F8F5;
  color: #1E7A45; /* 4.9:1 on its background (AA); the old #27AE60 was 2.6:1 */
  border: 1px solid #A3E4D7;
}

.badge-out-of-stock {
  background-color: #F2F3F4;
  color: var(--color-text-muted);
  border: 1px solid #BDC3C7;
}

.badge-accent {
  background-color: var(--color-accent);
  color: #7A2412; /* 5.03:1 on the coral; #8C2D19 was 4.20:1 */
  font-weight: 700;
}

.badge-secondary {
  background-color: rgba(115, 216, 212, 0.25);
  color: #1A7471;
  border: 1px solid var(--color-secondary);
}

.badge-expansion {
  background-color: #FFF3CD;
  color: #856404;
  border: 1px solid #FFEEBA;
}

/* Hero Section */
.hero-banner {
  position: relative;
  background: linear-gradient(180deg, rgba(122, 93, 192, 0.12) 0%, rgba(245, 240, 233, 0.8) 70%, var(--color-bg) 100%);
  padding: 40px 0 20px 0;
  border-bottom: 1px solid var(--color-border);
}

.game-profile {
  display: grid;
  grid-template-columns: 200px 1fr 300px;
  gap: 32px;
  align-items: start;
}

/* Tablets: cover beside the title, the price card below both (one column made the cover fill the screen) */
@media (max-width: 992px) {
  .game-profile {
    grid-template-columns: 200px 1fr;
    gap: 24px;
  }
  .game-profile .price-highlight-card { grid-column: 1 / -1; }
}

.game-cover-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background-color: var(--color-surface);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-meta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 14px 0;
}

.game-names { color: var(--color-text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.game-subtitle { color: var(--color-text-muted); font-size: 0.95rem; margin-bottom: 14px; max-width: 60ch; }
.game-subtitle a { color: var(--color-primary-text); font-weight: 600; }

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text);
}

/* Price Highlight Card */
.price-highlight-card {
  background-color: var(--color-surface);
  border: 2px solid rgba(122, 93, 192, 0.2);
  border-top: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  text-align: center;
}

.price-highlight-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.price-highlight-amount {
  font-family: var(--font-family-heading);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 12px;
}

/* Comparison Table */
.table-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-top: 32px;
}

.table-header-bar {
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.comparison-table th {
  background-color: #FAF8F5;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
}

.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
  font-size: 0.95rem;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr.out-of-stock-row {
  background-color: #FCFBF9;
}

.sold-out {
  border-top: 1px solid var(--color-border);
}

.sold-out summary {
  padding: 16px 24px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  color: var(--color-text);
}


/* Inset: the card clips overflow, so an outer ring would be cut off */
.sold-out summary:focus-visible { outline-offset: -3px; }

.store-name-cell {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
}

/* The shop's own product title: tells apart editions/languages sold by the same store */
.listing-title {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: 4px;
  max-width: 260px;
}

.price-cell {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.price-lowest {
  color: var(--color-primary);
  font-size: 1.25rem;
}

/* Interactive Charts */
.chart-container {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-top: 32px;
}

.chart-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.chart-filters {
  display: flex;
  gap: 8px;
}

.filter-btn {
  background-color: transparent;
  border: 1px solid var(--color-border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-btn:hover {
  background-color: rgba(122, 93, 192, 0.08);
  color: var(--color-primary);
}

.filter-btn.active {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #FFFFFF;
}

/* Card Grids for Catalog */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 14px;
  margin: 24px 0;
  list-style: none;
  padding: 0;
}

.game-card {
  position: relative; /* the title link's ::after covers the card */
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  gap: 14px;
  padding: 14px;
}

.game-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

/* Small cover beside the text: BGG's thumbnail (about 150 px) stays sharp at this size, even on 2x screens.
   Covers vary in shape: show the whole box, never crop its title */
.game-card-img {
  flex: none;
  width: 80px;
  height: 80px;
  object-fit: contain;
  object-position: top;
}

.game-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.game-card-tags .badge { font-size: 0.75rem; padding: 2px 8px; }

.game-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.game-card-heading {
  font-size: 0.98rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.game-card-title {
  font-weight: 700;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* One link per card, stretched over it: the whole card is clickable and is announced once, by its title */
.game-card-title::after {
  content: "";
  position: absolute;
  inset: 0;
}

@supports selector(:has(*)) {
  .game-card-title:focus-visible { outline: none; }
  .game-card:has(.game-card-title:focus-visible) { outline: 3px solid var(--color-primary); outline-offset: 2px; }
}

.game-card-meta { font-size: 0.8rem; color: var(--color-text-muted); margin-bottom: 10px; }
.game-card-label { font-size: 0.8rem; font-weight: 500; color: var(--color-text-muted); }
.game-card-price { white-space: nowrap; font-family: var(--font-family-heading); font-size: 1.2rem; font-weight: 800; color: var(--color-primary); }
.game-card-price small { font-size: 0.7em; font-weight: 600; }
.game-card-stores { display: block; font-size: 0.8rem; color: var(--color-text-muted); }
.game-card-empty { font-size: 0.9rem; color: var(--color-text-muted); }

.game-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #F0EBE3;
}

/* Admin shell: a side menu grouped by job (sticky under the 70 px site header) next to the page */
.admin-shell { display: grid; gap: 24px; align-items: start; padding-top: 28px; padding-bottom: 60px; }
.admin-main { min-width: 0; }
.admin-sidebar-title { font-family: var(--font-family-sans); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--color-text-muted); margin: 0 0 12px 12px; }
.admin-nav { display: grid; gap: 18px; }
.admin-nav-heading { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); margin: 0 0 4px 12px; }
.admin-nav ul { list-style: none; display: grid; gap: 2px; }
.admin-nav-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; padding: 8px 12px;
  border-radius: var(--radius-md); color: var(--color-text); font-weight: 600; font-size: 0.92rem; }
.admin-nav-link:hover { background: rgba(122, 93, 192, 0.08); color: var(--color-primary-text); }
.admin-nav-link[aria-current="page"] { background: var(--color-surface); color: var(--color-primary-text);
  box-shadow: var(--shadow-sm), inset 3px 0 0 var(--color-primary); }
/* Waiting in a queue: coral like the other "to do" badges; dark text keeps 7:1 */
.admin-nav-count { font-size: 0.75rem; font-weight: 700; padding: 1px 8px; border-radius: var(--radius-full);
  background: #FFE3DC; color: #8A2E1C; font-variant-numeric: tabular-nums; }
@media (min-width: 960px) {
  .admin-shell { grid-template-columns: 224px minmax(0, 1fr); gap: 40px; }
  .admin-sidebar { position: sticky; top: 94px; }
}
/* Narrow screens: the menu wraps as chips above the page; group names stay for screen readers only */
@media (max-width: 959px) {
  .admin-sidebar { padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
  .admin-sidebar-title { margin-left: 0; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-nav-group { display: contents; }  /* a div: no semantics to lose (unlike the lists) */
  .admin-nav ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .admin-nav-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .admin-nav-link { min-height: 36px; padding: 6px 12px; background: var(--color-surface); border: 1px solid var(--color-border); }
  .admin-nav-link[aria-current="page"] { background: var(--color-primary); border-color: var(--color-primary); color: #fff; box-shadow: none; }
  .admin-nav-link[aria-current="page"] .admin-nav-count { background: #fff; }
}

/* Triage Side-by-side Cards */
.triage-card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.triage-actions {
  display: flex;
  flex-wrap: wrap; /* on a phone, the search form takes its own line and the exit buttons go below it */
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

/* Admin forms (a store's page, Añadir una tienda, the ranking upload) */
.admin-form-card { padding: 24px; max-width: 640px; }
.admin-form fieldset { border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 20px; }
.admin-form legend { font-weight: 700; padding: 0 6px; }
.admin-form fieldset label { display: block; padding: 4px 0; }
.admin-field { margin-bottom: 20px; }
.admin-field > label { display: block; font-weight: 700; margin-bottom: 6px; }
.admin-field input[type="text"], .admin-field input[type="url"], .admin-field input[type="number"],
.admin-field input[type="search"], .admin-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); font: inherit;
}
.admin-field textarea { resize: vertical; }
.admin-field input:invalid:user-invalid { border-color: #B03A2E; }
.admin-help { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
.admin-error { font-size: 0.85rem; color: #B03A2E; margin-top: 4px; font-weight: 600; }
.admin-notice { margin-bottom: 16px; padding: 10px 14px; border-radius: var(--radius-md); background: #E8F8F5; border: 1px solid #A3E4D7; color: #1E6B48; }

/* Invitation to stores to confirm their free-shipping policy (PD-03) */
.merchant-cta { margin: 0; padding: 14px 20px; font-size: 0.85rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); }
.merchant-cta a, .game-meta a, .game-help a, .offers-footnote a { text-decoration: underline; text-underline-offset: 2px; }

/* Admin queues: grouped triage, catalog queue, pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0; }
.pager-status { font-size: 0.9rem; color: var(--color-text-muted); }
.pager-disabled { pointer-events: none; border-color: transparent; background: none; box-shadow: none; color: var(--color-text-muted); }
.admin-search { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.admin-search label { font-weight: 700; font-size: 0.9rem; }
.admin-search input { padding: 8px 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); font: inherit; min-width: 240px; }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-filters .active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.store-filters-container { padding: 16px; margin-bottom: 24px; }
.store-filter-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.filter-group-label { font-weight: 700; font-size: 0.85rem; color: var(--color-text-muted); align-self: center; margin-right: 4px; }
.filter-has-errors { border-color: #E6B0AA; color: #922B21; font-weight: 600; }
.filter-has-errors.active { background: #922B21; color: #fff; border-color: #922B21; }
.empty-filtered-panel { padding: 32px 16px; text-align: center; }

/* Crawl Progress Panel */
.crawl-progress-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-secondary);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.crawl-progress-panel.is-finished {
  border-left-color: #27AE60;
  border-color: #A9DFBF;
  background: #F4FBF7;
}

.crawl-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}

.crawl-progress-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
}

.crawl-spinner {
  display: inline-block;
  animation: crawl-spin 1.8s linear infinite;
  font-size: 1.1rem;
}

@keyframes crawl-spin {
  100% { transform: rotate(360deg); }
}

.crawl-current-store {
  color: var(--color-primary-text);
  font-weight: 600;
  background: rgba(122, 93, 192, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}

.crawl-percentage {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  min-width: 48px;
  text-align: right;
}

.crawl-progress-track {
  height: 12px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.crawl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-radius: var(--radius-full);
  transition: width 0.4s ease-in-out;
  position: relative;
}

.crawl-progress-fill::after {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.45) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  animation: crawl-shimmer 2s infinite;
}

@keyframes crawl-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.crawl-progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.crawl-finished-msg {
  color: #1E8449;
  font-weight: 700;
}

/* Row currently being crawled */
tr.is-crawling-now {
  background-color: rgba(115, 216, 212, 0.2) !important;
  transition: background-color 0.3s ease;
}

tr.is-crawling-now th {
  border-left: 3px solid var(--color-primary);
}
.admin-notice-warning { background: #FFF8E8; border-color: #F0D9A8; color: #7A4B00; }
.admin-notice-info { background: var(--color-surface); border-color: var(--color-border); color: var(--color-text); }
.admin-notice-error { background: #FDEDEC; border-color: #F5B7B1; color: #922B21; }
.triage-label { font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 8px; }
.triage-dismiss { margin-left: auto; color: #A93226; border-color: #E6B0AA; }
.triage-status { font-size: 0.85rem; margin-top: 8px; min-height: 1em; }
.catalog-candidates { display: grid; gap: 8px; margin: 14px 0; }
.catalog-candidate { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.empty-state { text-align: center; padding: 60px 20px; background-color: var(--color-surface); border-radius: var(--radius-lg); border: 1px dashed var(--color-border); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ---------- Public UX pass (2026-10-13) ---------- */

/* Keyboard users skip the header; hidden until focused */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px; border-radius: var(--radius-md);
  background: var(--color-surface); color: var(--color-primary); font-weight: 700; box-shadow: var(--shadow-lg);
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }
#content:focus { outline: none; } /* focused only by the skip link; not a control */

/* One visible focus ring for every control */
:where(a, button, input, select, textarea, summary, [tabindex="0"]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.home-hero {
  background: linear-gradient(180deg, rgba(122, 93, 192, 0.15) 0%, rgba(245, 240, 233, 0.5) 100%);
  padding: 36px 0 26px; border-bottom: 1px solid var(--color-border); text-align: center;
}
.home-search { display: flex; gap: 10px; max-width: 580px; margin: 0 auto; }
.home-search input {
  flex: 1; min-width: 0; padding: 12px 18px; font: inherit; font-size: 1rem;
  border: 2px solid var(--color-border-control); border-radius: var(--radius-md); background: #fff;
}
.home-search .btn { padding: 0 24px; }
.header-search-wrap { flex: 1; min-width: 0; max-width: 380px; margin: 0 16px; }  /* min-width: may shrink below the input's natural width (390 px phones cut «Buscar» off) */
.header-search { display: flex; gap: 8px; }
.header-search input {
  flex: 1; min-width: 0; padding: 7px 12px; font: inherit; font-size: 0.9rem;
  border: 1.5px solid var(--color-border-control); border-radius: var(--radius-md); background: #fff;
}
.home-search input:focus-visible, .header-search input:focus-visible { border-color: var(--color-primary); outline-offset: 0; }
/* Search suggestions under the box (static/js/search.js): cover, name, lowest price */
.has-suggest { position: relative; }
.suggest-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; margin: 0; padding: 6px; list-style: none;
  max-height: min(70vh, 460px); overflow-y: auto; text-align: left; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
}
.suggest-list[data-typo]::before {
  content: "¿Quisiste decir…?" / "";  /* the list's aria-label already says it */
  display: block; padding: 4px 10px 6px; font-size: 0.8rem; color: var(--color-text-muted);
}
.suggest-option { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; }
.suggest-option:hover, .suggest-option[aria-selected="true"] { background: #F1ECFA; }
.suggest-option img { flex: none; width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-bg); }
.suggest-text { display: flex; flex-direction: column; min-width: 0; }
.suggest-name { font-weight: 600; color: var(--color-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-meta { font-size: 0.85rem; color: var(--color-text-muted); }
.suggest-all { margin-top: 4px; padding: 12px 10px; border-top: 1px solid var(--color-border); border-radius: 0; color: var(--color-primary-text); font-weight: 600; }
@media (forced-colors: active) {
  .suggest-option[aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
/* «Solo con stock» pill toggle switch (role="switch"): sliding thumb inside a rounded track, matched in height and surface to .home-pill-group */
.stock-switch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 3px 13px 3px 7px;
  border-radius: var(--radius-full); border: 1px solid var(--color-border);
  background: var(--color-surface); box-shadow: var(--shadow-sm); color: var(--color-text); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; text-decoration: none; user-select: none;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}
.stock-switch:hover { border-color: var(--color-primary); color: var(--color-primary-text); }
.stock-switch[aria-checked="true"] { border-color: rgba(122, 93, 192, 0.45); }
.stock-switch-track {
  position: relative; display: inline-flex; align-items: center;
  width: 36px; height: 20px; padding: 2px; border-radius: var(--radius-full);
  background: #C4BDB3; transition: background-color 0.2s ease; flex: none;
}
.stock-switch[aria-checked="true"] .stock-switch-track,
.flag-checkbox:checked + .stock-switch-track { background: var(--color-primary); }
.stock-switch-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.stock-switch[aria-checked="true"] .stock-switch-thumb,
.flag-checkbox:checked + .stock-switch-track .stock-switch-thumb { transform: translateX(16px); }
.flag-checkbox:focus-visible + .stock-switch-track { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.flag-list { display: grid; gap: 10px; }
.flag-item {
  display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface);
  cursor: pointer; user-select: none;
}
.flag-item:hover { border-color: var(--color-primary); }
.flag-item .stock-switch-track { margin-top: 2px; }
.flag-copy { display: grid; gap: 2px; }
.flag-label { font-weight: 700; font-size: 0.92rem; color: var(--color-text); }
.flag-help { margin-top: 0; }
.flag-criteria { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--color-border); font-size: 0.88rem; }
.flag-criteria summary { font-weight: 600; cursor: pointer; color: var(--color-text); }
.flag-criteria-list { margin: 8px 0 0 18px; color: var(--color-text-muted); font-size: 0.82rem; display: grid; gap: 4px; }
@media (forced-colors: active) {
  .stock-switch-track { border: 1px solid ButtonText; }
  .stock-switch-thumb { background: ButtonText; }
  .stock-switch[aria-checked="true"] .stock-switch-track,
  .flag-checkbox:checked + .stock-switch-track { background: Highlight; border-color: Highlight; }
  .stock-switch[aria-checked="true"] .stock-switch-thumb,
  .flag-checkbox:checked + .stock-switch-track .stock-switch-thumb { background: HighlightText; }
}

.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.85rem; color: var(--color-text-muted); margin-bottom: 16px; }

/* Game page offers table */
.comparison-table tbody th {
  background: none; padding: 16px 20px; border-bottom: 1px solid var(--color-border); vertical-align: middle;
  font-size: 0.95rem; font-weight: 400; color: var(--color-text); text-transform: none; letter-spacing: 0;
}
.comparison-table tr:last-child th { border-bottom: none; }
.shipping-notes { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 4px; max-width: 240px; }
.table-scroll { overflow-x: auto; container-type: inline-size; position: relative; }  /* positioned: the absolute .visually-hidden labels inside scroll with the table instead of widening the page (/admin/stores was 648 px on a 390 px phone) */
.cell-action { text-align: right; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .game-card:hover, .btn-primary:hover { transform: none; }
}

/* Phones: the header stays one line */
@media (max-width: 480px) {
  .header-inner { height: 60px; }
  .brand-logo { font-size: 1.1rem; gap: 6px; }
  .brand-meeple { width: 26px; height: 26px; }
  .brand-logo > span { white-space: nowrap; }
  .header-search-wrap { margin: 0 0 0 10px; max-width: none; }
  .header-search .btn { padding: 6px 10px; font-size: 0.8rem; }
  .nav-link { white-space: nowrap; padding: 6px 8px; font-size: 0.9rem; }
  .nav-link[href="/"] { display: none; } /* same destination as the logo; room for the logo on one line */
  .nav-links-home-only { display: none; } /* then the nav would be an empty landmark */
}

/* Phones: small cover beside the title, then the price */
@media (max-width: 768px) {
  .hero-banner { padding-top: 20px; }
  .game-profile { grid-template-columns: 96px 1fr; gap: 16px; align-items: center; }
  .game-cover-container { box-shadow: var(--shadow-sm); border-radius: var(--radius-md); }
  /* The title sits beside the small cover; facts and names use the full width below (one pill per line before) */
  .game-details { display: contents; }
  .game-details > * { grid-column: 2; }
  .game-details > .game-meta-group, .game-details > .game-subtitle, .game-details > .game-names { grid-column: 1 / -1; margin: 0; }
  /* Price and «Ir a la tienda» above the fold: the facts move below the price card (desktop keeps its order) */
  .game-details > .game-meta-group, .game-details > .game-names { order: 1; }
  .price-highlight-card { padding: 18px; }
  .price-highlight-amount { font-size: 2rem; }
  .game-meta-group { gap: 6px; margin: 10px 0; }
  .meta-pill { padding: 4px 10px; font-size: 0.8rem; }
}
.catalog-offers { margin-top: 10px; max-width: 640px; }
/* The BGG name sits inside a line of text: underlined, not told apart by color alone */
.catalog-candidate a { font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.catalog-thumb, .tq-alts img, .games-row-title img { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.catalog-auto { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 16px 20px; margin: 0 0 20px; }
.catalog-auto > div { flex: 1; max-width: 780px; }
.catalog-auto-status { font-size: 0.85rem; margin-top: 6px; }

/* ---------- Triage cards (2026-10-14): shop offer vs suggested game, side by side ---------- */
/* `hidden` must win over component display rules (.btn is inline-flex) */
[hidden], .hidden { display: none !important; }
.tq-card { padding: 0; overflow: hidden; container-type: inline-size; }
/* A decided card folds to its status line smoothly (interpolate-size: Chrome; elsewhere it folds at once), so the
   cards below slide up instead of jumping */
.tq-body { interpolate-size: allow-keywords; transition: block-size 0.25s ease-out, opacity 0.2s ease-out; }
.tq-body.tq-closing { block-size: 0; opacity: 0; overflow: clip; }
.tq-page-done { scroll-margin-top: 88px; text-align: center; }
.admin-nav-count[hidden] { display: none; }
.per-page-form { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: -8px 0 16px; font-size: 0.9rem; }
.per-page-form select { padding: 4px 8px; font: inherit; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); background: #fff; }
.tq-page-done:focus { outline: none; } /* focused only to bring keyboard users here; the link is the control */
.triage-card { scroll-margin-top: 88px; } /* clear the sticky header when triage.js or queue-keys.js scrolls to a card */
.triage-card:focus-visible { outline-offset: 2px; }
/* Keyboard shortcuts of the two queues (queue-keys.js): a hint on each button, and the list «?» opens */
.key-hint { display: inline-block; margin-left: 8px; padding: 0 5px; border: 1px solid currentColor; border-radius: var(--radius-sm); font: 600 0.75em/1.4 var(--font-family-sans); }
.queue-keys-open { display: flex; justify-content: flex-end; margin: -8px 0 16px; }
.queue-keys-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.queue-keys-table th, .queue-keys-table td { padding: 6px 0; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.queue-keys-table th { white-space: nowrap; padding-right: 16px; font-weight: 400; }
.queue-keys-table kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center; border: 1px solid var(--color-border-control); border-radius: var(--radius-sm); background: var(--color-bg); font: 600 0.85rem var(--font-family-sans); }
@media (hover: none) { .key-hint, .queue-keys-open { display: none; } } /* touch screens: no keyboard to hint at */
.tq-columns { display: grid; grid-template-columns: 1fr 1fr; }
.tq-shop, .tq-game { padding: 20px 24px; min-width: 0; }
.tq-game { background: #FBFAFE; border-left: 1px solid var(--color-border); }
.tq-title { font-size: 1.15rem; line-height: 1.35; margin-bottom: 4px; overflow-wrap: anywhere; }
.tq-title mark, .tq-reasons mark { background: #FCE3B0; color: inherit; border-radius: 3px; padding: 0 2px; }
.tq-price { font-weight: 800; font-size: 1.1rem; margin-bottom: 12px; }
.tq-price span { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.tq-offers { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 0.875rem; }
.tq-offers li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 6px 10px; background: var(--color-bg); border-radius: var(--radius-sm); }
.tq-offers a { font-weight: 700; color: var(--color-primary-text); } /* primary is 4.45:1 on the beige rows */
.tq-offer-price { font-variant-numeric: tabular-nums; }
.tq-pick { display: inline-flex; align-items: center; align-self: center; cursor: pointer; }
.tq-pick input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--color-primary); }
@media (pointer: coarse) { .tq-pick { min-width: 44px; min-height: 44px; margin: -10px 0 -10px -10px; justify-content: center; } }
.tq-offers li.tq-offer-decided { opacity: 0.6; text-decoration: line-through; }
.tq-split-hint { margin: 10px 0 0; }
.tq-split-hint a { text-decoration: underline; text-underline-offset: 2px; }
.tq-offer-title { flex-basis: 100%; color: var(--color-text-muted); font-size: 0.8rem; overflow-wrap: anywhere; }
.tq-tag { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: #8A4B00; background: #FDEBD0; padding: 1px 6px; border-radius: var(--radius-full); }
.tq-more { margin-top: 6px; font-size: 0.85rem; }
.tq-more summary, .history-table summary { cursor: pointer; color: var(--color-primary); font-weight: 600; padding: 4px 0; }
.tq-more .tq-offers { margin-top: 6px; }
.tq-game-head { display: flex; gap: 14px; align-items: flex-start; }
.tq-game-head img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-md); flex: none; background: var(--color-bg); }
.tq-game-name { font-family: var(--font-family-heading); font-weight: 800; font-size: 1.15rem; line-height: 1.25; }
.tq-links { display: flex; gap: 14px; margin-top: 4px; font-size: 0.875rem; font-weight: 600; }
.tq-typical { margin: 12px 0 8px; font-size: 0.9rem; }
.tq-reasons { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.tq-reasons li, .tq-split-hint { font-size: 0.85rem; padding: 6px 10px 6px 12px; border-left: 3px solid #E0A526; background: #FFF8E8; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.tq-reasons li.tq-reason-soft { border-left-color: var(--color-border); background: var(--color-bg); color: var(--color-text-muted); }
.tq-decide { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 16px 24px; border-top: 1px solid var(--color-border); }
.tq-other { padding: 16px 24px 4px; border-top: 1px dashed var(--color-border); }
.tq-alts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.tq-alts li { display: flex; align-items: center; gap: 12px; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #fff; }
.tq-alt-text { flex: 1; min-width: 0; display: grid; font-size: 0.9rem; }
.tq-find > label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.tq-find-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tq-find-input { flex: 1 1 220px; max-width: 360px; padding: 8px 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); font: inherit; }
.tq-results { margin-top: 8px; }
.tq-results:empty { display: none; }
.tq-footer { display: flex; align-items: center; gap: 12px; padding: 0 24px 14px; }
.tq-footer .triage-status { margin: 0; }
.tq-footer .triage-status:empty { display: none; }
.triage-card.triage-done { background: #F3FBF7; border-color: #A3E4D7; }
.tq-card.triage-done .tq-footer { padding-top: 14px; }
.triage-card.triage-done .triage-status { font-weight: 600; color: #1E6B48; margin: 0; }
.catalog-status:empty { display: none; }
.catalog-status:focus { outline: none; } /* focused only to keep keyboard users in place; not a control */
.catalog-status.admin-notice-error { padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid #F5B7B1; }
/* «Aplicar a seleccionadas» (triage.js): a card's checkbox, and the bar that sticks to the bottom while cards are picked */
.tq-select { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: -12px 0 4px; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.tq-select input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--color-primary); }
.tq-bulk { position: sticky; bottom: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; box-shadow: var(--shadow-lg); }
.tq-bulk-title { margin: 0; font-weight: 700; font-size: 0.95rem; }
/* «Otra edición» in triage: opens below the decision buttons, inside the row (the card clips overflow) */
.tq-edition-details > summary { list-style: none; cursor: pointer; }
.tq-edition-details > summary::-webkit-details-marker { display: none; }
/* Margins, not gap: a <details> wraps everything after its summary in one box, so a grid gap never reaches the rows */
.tq-edition-details[open] { flex-basis: 100%; padding: 12px; background: var(--color-bg); border-radius: var(--radius-md); }
.tq-edition-details[open] > summary { margin-bottom: 12px; }
.tq-edition-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tq-edition-chip { min-height: 32px; padding: 2px 12px; border: 1px solid var(--color-border-control); border-radius: var(--radius-full); background: #fff; font: inherit; font-size: 0.85rem; cursor: pointer; }
.tq-edition-chip[aria-pressed="true"] { background: var(--color-primary); border-color: transparent; color: #fff; }
.tq-edition-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tq-edition-input { flex: 1 1 180px; max-width: 280px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--color-border-control); border-radius: var(--radius-sm); font: inherit; font-size: 0.875rem; }
/* A chip moves the focus here: the ring hugs the field (as in the search boxes) instead of reaching the chips */
.tq-edition-input:focus-visible { border-color: var(--color-primary); outline-offset: 0; }
@media (pointer: coarse) { .tq-edition-chip, .tq-edition-input, .tq-edition-row .btn { min-height: 44px; } }
/* Rules (/admin/reglas) */
.rules-heading { font-size: 1.1rem; margin-bottom: 12px; }
.rules-section { margin-top: 20px; padding: 20px 24px; }
.rules-apply { margin-top: 16px; }
/* The card, not the window, decides: the admin layout's width varies */
@container (max-width: 680px) {
  .tq-columns { grid-template-columns: 1fr; }
  .tq-game { border-left: none; border-top: 1px solid var(--color-border); }
  .tq-decide .btn { flex: 1 1 100%; }
  .tq-decide .triage-dismiss { margin-left: 0; }
}

/* ---------- Comparator polish (2026-10-14): patterns from boardgameprices, Board Game Oracle, PriceRunner ---------- */
/* Home: compact hero, coverage + freshness line, sort, denser cards that show the whole cover */
.home-title { font-size: clamp(1.6rem, 4.5vw, 2.3rem); margin-bottom: 18px; color: var(--color-text); }
.home-stats { margin-top: 14px; font-size: 0.875rem; color: var(--color-text-muted); }
.home-toolbar { display: grid; gap: 14px; }
.home-toolbar-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px; }
.home-count { font-family: var(--font-family-sans); font-size: 0.9rem; font-weight: 500; color: var(--color-text-muted); margin-left: 6px; }
.home-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.home-control-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.home-control-label { font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); }
.home-pill-group {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 3px;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 18px;
  box-shadow: var(--shadow-sm);
}
.home-pill {
  display: inline-flex; align-items: center; min-height: 28px; padding: 3px 11px;
  border-radius: var(--radius-full); font-size: 0.85rem; font-weight: 600; color: var(--color-text);
  text-decoration: none; white-space: nowrap; transition: background-color 0.15s ease, color 0.15s ease;
}
.home-pill:hover:not(.active) { background: rgba(122, 93, 192, 0.08); color: var(--color-primary-text); }
.home-pill.active { background: var(--color-primary); color: #fff; }
@media (min-width: 960px) {
  .home-control-stock { margin-left: auto; }
}
@media (max-width: 600px) {
  .home-pill-group { border-radius: 14px; }
  .home-pill { flex: 1 1 auto; justify-content: center; padding: 4px 8px; font-size: 0.8rem; }
}
@media (forced-colors: active) {
  .home-pill.active { background: Highlight; color: HighlightText; }
}
.home-about { max-width: 70ch; margin: 48px auto 0; padding-top: 28px; border-top: 1px solid var(--color-border); }
.home-about h2 { font-size: 1.35rem; margin-bottom: 8px; }
.home-about h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.home-about p { line-height: 1.65; }
.home-about a { text-decoration: underline; text-underline-offset: 2px; }

/* Game page hero card */
.price-verdict { display: inline-block; margin: -4px 0 12px; padding: 4px 10px; border-radius: var(--radius-full); background: #E8F8F0; color: #1E6B48; font-size: 0.8rem; font-weight: 700; }
.price-highlight-store { font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.price-highlight-range { margin-top: 12px; font-size: 0.8rem; color: var(--color-text-muted); line-height: 1.5; }
/* «Avísame cuando baje»: the price-alert demand test, under the price */
.alert-interest { margin-top: 14px; text-align: left; font-size: 0.9rem; scroll-margin-top: 88px; }
.alert-interest:focus { outline: none; }  /* focused only to keep the keyboard's place (#alerta, alerts.js) */
.alert-bell { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }
.alert-interest .btn { min-height: 44px; }
.alert-interest-done:empty { display: none; }
.alert-interest-panel { display: grid; gap: 6px; }
.alert-interest-panel p { color: var(--color-text-muted); margin-bottom: 4px; }
.alert-interest-panel input[type="email"], .alert-interest-panel input[type="text"] {
  font: inherit; font-size: 1rem; min-height: 44px; padding: 8px 10px; margin-bottom: 6px; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border-control); border-radius: var(--radius-md);
}
.alert-interest-money { font-variant-numeric: tabular-nums; }
/* Red only after the visitor tried (or the server sent it back): not on an empty field they haven't touched */
.alert-interest-panel input:user-invalid, .alert-interest-panel input[aria-invalid="true"] { border-color: #B03A2E; }
.alert-interest-panel p.alert-interest-error { color: #B03A2E; margin: -4px 0 6px; font-size: 0.85rem; }
.alert-interest-consent { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.alert-interest-consent input { width: 1.15rem; height: 1.15rem; flex: none; accent-color: var(--color-primary); }
.alert-interest-consent a { color: var(--color-primary-text); text-decoration: underline; }
.badge-lang { background: #FDEBD0; color: #7A4300; border: 1px solid #F5CBA7; }
.badge-possible { background: #FFF4CC; color: #6B4E00; border: 1px solid #F0D98A; }

/* Possible matches (Brief 4): their own block under the offers, never part of the price ranking */
.possible-offers { border-top: 1px solid var(--color-border); }
.possible-offers > h3 { font-size: 1.1rem; padding: 16px 24px 0; }
.possible-offers > p { padding: 4px 24px 8px; font-size: 0.85rem; color: var(--color-text-muted); }
/* «¿Es otro juego?» under an offer: a quiet link that opens a small form */
.report-offer { margin-top: 6px; font-size: 0.8rem; font-weight: 400; }
.report-offer summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; color: var(--color-primary-text); text-decoration: underline; text-underline-offset: 2px; }
.report-offer form { display: grid; gap: 4px; max-width: 320px; padding-bottom: 8px; }
.report-offer select, .report-offer textarea { font: inherit; font-size: 1rem; min-height: 44px; padding: 6px 8px; color: var(--color-text);
  background: var(--color-surface); border: 1px solid var(--color-border-control); border-radius: var(--radius-md); }
.report-offer .btn { justify-self: start; min-height: 44px; margin-top: 4px; }
.report-thanks { margin-top: 6px; font-size: 0.85rem; font-weight: 600; color: #1E6B48; }

/* Offers table: one strong action (the cheapest), the rest quieter; the difference to the cheapest at a glance */
.th-unit { font-weight: 500; text-transform: none; letter-spacing: 0; }
.offer-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.price-delta { display: block; font-size: 0.8rem; color: var(--color-text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.price-delta-best { color: #1E6B48; font-weight: 700; }
.offers-footnote { margin: 0; padding: 14px 20px; font-size: 0.8rem; color: var(--color-text-muted); border-top: 1px solid var(--color-border); line-height: 1.55; }

/* Expansions of a base game */
.expansions { margin-top: 32px; }
.expansion-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.expansion-item { position: relative; display: grid; grid-template-columns: 56px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center;
  padding: 10px 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.expansion-item:hover { border-color: var(--color-primary); }
.expansion-item img { grid-row: span 2; width: 56px; height: 56px; object-fit: contain; border-radius: var(--radius-sm); background: #F7F4EF; }
.expansion-name { font-weight: 700; color: var(--color-text); align-self: end; line-height: 1.3; }
.expansion-name::after { content: ""; position: absolute; inset: 0; } /* the whole item is the link */
@supports selector(:has(*)) {
  .expansion-name:focus-visible { outline: none; }
  .expansion-item:has(.expansion-name:focus-visible) { outline: 3px solid var(--color-primary); outline-offset: 2px; }
}
.expansion-price { font-size: 0.85rem; color: var(--color-text-muted); align-self: start; }

/* Price history: no empty chart box; the data is also a table */
.history-pending { padding: 14px 16px; background: var(--color-bg); border-radius: var(--radius-md); font-size: 0.9rem; color: var(--color-text-muted); }
.history-table { margin-top: 14px; font-size: 0.9rem; }
.history-table table { margin-top: 8px; max-width: 420px; }


/* The cheapest offer reads as the answer: tinted row with an accent edge */
.comparison-table tbody tr.offer-best { background: #F8F5FE; }
.comparison-table tbody tr.offer-best > th { box-shadow: inset 3px 0 0 var(--color-primary); }
@media (hover: hover) {
  .comparison-table tbody tr:not(.offer-best):hover { background: #FBFAF7; }
}

/* BGG rank: a fact about the game, apart from the price block */
.badge-rank { background: #3A3A3A; color: #fff; font-weight: 700; }

/* Phones (by the table's own width): each offer is a compact card instead of a table to scroll sideways.
   Store and price on top, shipping and the link below. One block: it overrides the table rules above. */
@container (width < 600px) {
  .comparison-stack, .comparison-stack tbody, .comparison-stack tbody th, .comparison-stack td { display: block; }
  .comparison-stack thead { display: none; }
  .comparison-stack tr { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: start;
    padding: 14px 16px; border-bottom: 1px solid var(--color-border); }
  .comparison-stack tr:last-child { border-bottom: none; }
  .comparison-stack tbody th, .comparison-stack td { padding: 3px 0; border: none; text-align: left !important; }
  .comparison-stack tbody th, .comparison-stack td[data-label="Envío"] { grid-column: 1; }
  .comparison-stack td[data-label="Precio"] { grid-column: 2; grid-row: 1; text-align: right !important; }
  .comparison-stack td:last-child { grid-column: 2; align-self: end; }
  .comparison-stack td[data-label]::before {
    content: attr(data-label) ": ";
    content: attr(data-label) ": " / attr(data-label); /* screen readers hear the label without the colon */
    font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted);
  }
  /* The price needs no visible label next to it; screen readers still hear it */
  .comparison-stack td[data-label="Precio"]::before { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .comparison-stack .price-delta { text-align: right; }
  .comparison-stack .listing-title, .comparison-stack .shipping-notes { max-width: none; }
  .comparison-table tbody tr.offer-best { box-shadow: inset 3px 0 0 var(--color-primary); }
  .comparison-table tbody tr.offer-best > th { box-shadow: none; }
}

/* Admin overview */
.overview-section { margin-bottom: 32px; }
.overview-heading { font-size: 1.05rem; margin-bottom: 10px; }
.overview-alerts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.overview-alerts .admin-notice { margin: 0; }
.overview-alerts a { font-weight: 600; color: inherit; text-decoration: underline; }
.overview-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.overview-card { display: grid; gap: 4px; align-content: start; padding: 18px 20px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); color: var(--color-text); text-decoration: none; }
.overview-card:hover { border-color: var(--color-primary); }
.overview-card-title { font-weight: 700; color: var(--color-primary-text); }
.overview-card-number { font-family: var(--font-family-heading); font-size: 2rem; font-weight: 800; line-height: 1.1; }
.overview-card-text { font-size: 0.875rem; color: var(--color-text-muted); }
.overview-bad { color: #A93226; font-weight: 600; }

/* Footer */
.site-footer { margin-top: 60px; padding: 40px 0; border-top: 1px solid var(--color-border); background-color: var(--color-surface); text-align: center; }
.site-footer-title { font-weight: 700; font-family: var(--font-family-heading); margin-bottom: 8px; }
.site-footer-note { color: var(--color-text-muted); font-size: 0.85rem; max-width: 600px; margin: 0 auto; }
.powered-by-bgg { display: inline-block; margin-top: 20px; }
.powered-by-bgg img { display: block; width: 200px; height: auto; } /* BGG asks for legible text: "BY" is the smallest part */

.page-section { padding-top: 60px; padding-bottom: 60px; }
.run-status { margin: 6px 0 0; text-align: right; }
.run-status:empty { display: none; }
.btn-block { width: 100%; }
.badge-lg { font-size: 0.9rem; padding: 6px 12px; }
.price-highlight-empty { padding: 20px 0; color: var(--color-text-muted); }
.price-highlight-empty-title { font-size: 1.8rem; margin-bottom: 4px; }
.offer-group { margin-top: 12px; }
.listing-checked { font-size: 0.8rem; color: var(--color-text-muted); }

/* Admin page headers */
.admin-page-head { margin-bottom: 20px; }
.admin-page-head-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.admin-page-title { font-size: 1.6rem; margin-bottom: 6px; }
.admin-page-intro { color: var(--color-text-muted); font-size: 0.9rem; max-width: 780px; }
.admin-page-intro a, .admin-help a { text-decoration: underline; text-underline-offset: 2px; }  /* links inside muted text: color alone is too close */

/* Footer links and information pages (how it works, contact, privacy, terms) */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; margin-top: 16px; font-size: 0.9rem; font-weight: 600; }
.footer-links a { padding: 4px 2px; }
/* «Cookies» in the footer opens the consent banner: a button that looks like the links next to it */
.footer-link-button { font: inherit; color: var(--color-primary-text); background: none; border: 0; padding: 4px 2px; cursor: pointer; }
.footer-link-button:hover { text-decoration: underline; }
/* Google Analytics consent (static/js/consent.js): both answers look the same, so neither is pushed */
.consent-banner { position: fixed; inset: auto 12px 12px; z-index: 50; max-width: 640px; margin: 0 auto; display: flex; flex-wrap: wrap;
  align-items: center; gap: 12px 16px; padding: 14px 18px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-lg); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); font-size: 0.9rem; }
.consent-banner[hidden] { display: none; }
.consent-banner p { flex: 1 1 280px; margin: 0; }
.consent-banner a { text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; gap: 8px; }
.consent-actions .btn { min-height: 44px; min-width: 96px; }
.info-page { padding-top: 40px; padding-bottom: 20px; }
.info-article { max-width: 70ch; margin: 0 auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: clamp(20px, 5vw, 44px); }
.info-article h1 { font-size: clamp(1.7rem, 5vw, 2.3rem); margin-bottom: 12px; }
.info-article h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.info-article p, .info-article li { line-height: 1.65; }
.info-article ul { padding-left: 1.2em; display: grid; gap: 6px; }
.info-article a:not(.btn) { text-decoration: underline; text-underline-offset: 2px; }
.info-lead { font-size: 1.05rem; color: var(--color-text-muted); }
.info-updated { font-size: 0.85rem; color: var(--color-text-muted); }

/* /tiendas: a summary row and one card per store */
.info-article-wide { max-width: 1040px; }
.stores-summary { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0 28px; }
.stores-summary div { flex: 1 1 140px; padding: 12px 16px; background: var(--color-bg); border-radius: var(--radius-md); }
.stores-summary dt { font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.stores-summary dd { margin: 0; font-family: 'Cabinet Grotesk', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--color-primary); }
.info-article ul.store-cards { list-style: none; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.store-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--color-border);
  border-radius: var(--radius-md); background: var(--color-surface); transition: border-color .15s, box-shadow .15s; }
.store-card:hover { border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.info-article .store-card-name { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.info-article .store-card-name a { color: var(--color-text); text-decoration: none; }
.info-article .store-card-name a:hover { color: var(--color-primary-text); text-decoration: underline; }
.store-card p { margin: 0; line-height: 1.45; }
.store-card-domain { font-size: 0.8rem; color: var(--color-text-muted); overflow-wrap: anywhere; }
.store-card-ship { margin-top: 8px !important; font-size: 0.9rem; color: var(--color-text-muted); }
.store-card-ship.is-free { color: var(--color-text); }
.store-card-ship strong { color: var(--color-primary-text); font-size: 1rem; }
.store-card-note { font-size: 0.8rem; color: var(--color-text-muted); }
.store-card-games { margin-top: auto !important; padding-top: 10px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); }
.stores-footer { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--color-border); display: grid; gap: 6px; }

/* Admin: headline numbers, panels and compact data tables (Resumen, Visitas) */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 10px; }
.section-head .overview-heading, .panel-head .overview-heading { margin: 0; }
.section-link { font-weight: 600; font-size: 0.9rem; }
.section-help { margin-bottom: 12px; }
.kpi-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.kpi { display: grid; gap: 2px; align-content: start; padding: 16px 18px; background: var(--color-surface);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.kpi-label { font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); }
.kpi-value { font-family: var(--font-family-heading); font-size: 2rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi-change { font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); }
.kpi-up { color: #1E6B48; }
.kpi-down { color: #A93226; }
.kpi-note { font-size: 0.8rem; font-weight: 400; color: var(--color-text-muted); }

.segmented { display: inline-flex; gap: 2px; padding: 3px; background: var(--color-surface); border: 1px solid var(--color-border-control);
  border-radius: var(--radius-full); }
.segmented-item { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 14px; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.875rem; color: var(--color-text); white-space: nowrap; }
.segmented-item:hover { color: var(--color-primary-text); }
.segmented-item[aria-current="page"] { background: var(--color-primary); color: #fff; }

.panel { min-width: 0; padding: 18px 20px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.panel > .overview-heading { margin-bottom: 10px; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.panel-grid { display: grid; gap: 16px; align-items: start; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); }
.panel-help { margin: -4px 0 10px; }
.panel-help a { text-decoration: underline; }
.panel-empty { margin: 0; font-size: 0.9rem; color: var(--color-text-muted); }
.panel-attention { box-shadow: inset 3px 0 0 var(--color-accent); }
.alert-readout { margin-top: 16px; }
.alert-readout .kpi-grid { margin-bottom: 16px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { padding: 7px 8px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border); }
.data-table thead th { font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted); border-bottom-width: 2px; }
.data-table tbody th { font-weight: 500; overflow-wrap: anywhere; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table code { font-size: 0.85em; }
/* A bar behind the label, as long as the value's share of the top row */
.bar-cell { display: block; margin-left: -6px; padding: 2px 6px; border-radius: 4px;
  background: linear-gradient(to right, rgba(122, 93, 192, 0.16) var(--share, 0%), transparent var(--share, 0%)); }

.chart-legend { display: flex; gap: 14px; list-style: none; font-size: 0.8rem; color: var(--color-text-muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-key { width: 12px; height: 12px; border-radius: 3px; }
.chart-key-visitors, .bar-visitors { background: var(--color-primary); fill: var(--color-primary); }
.chart-key-views, .bar-views { background: #C4B5EB; fill: #C4B5EB; }
.visits-chart { position: relative; margin: 0; padding-top: 20px; }
.visits-chart svg { display: block; width: 100%; height: 200px; border-bottom: 1px solid var(--color-border-control); }
/* The scale: the busiest day's page views, on a dashed line at the top of the bars */
.visits-chart-top { position: absolute; top: 0; left: 0; right: 0; height: 20px; font-size: 0.75rem; color: var(--color-text-muted);
  border-bottom: 1px dashed var(--color-border); pointer-events: none; }
.bar-hit { fill: transparent; }
.visits-bar:hover .bar-views { fill: #A994DF; }
.visits-bar:hover .bar-visitors { fill: #5E43A6; }
.visits-chart-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 0.75rem; color: var(--color-text-muted); }
.chart-table { margin-top: 12px; }
/* Review time against the weekly budget: the queues' progress bar and the overview's 8-week sparkline */
.review-budget { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 16px; font-size: 0.9rem; }
.review-budget progress { width: min(100%, 240px); height: 10px; accent-color: var(--color-primary); }
.review-spark { margin: 0; }
.review-spark svg { display: block; width: min(100%, 320px); height: 48px; border-bottom: 1px solid var(--color-border-control); }
.review-spark rect { fill: var(--color-primary); }
.review-spark-goal { stroke: var(--color-text-muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-table summary { cursor: pointer; font-weight: 600; font-size: 0.875rem; color: var(--color-primary-text); }
.chart-table .table-scroll { max-height: 320px; overflow: auto; margin-top: 8px; overscroll-behavior: contain; }
.cell-sub { font-size: 0.8rem; font-weight: 400; color: var(--color-text-muted); }
.cell-sub.overview-bad { color: #A93226; font-weight: 600; }
.cell-muted { color: var(--color-text-muted); }
.cell-notes { min-width: 12rem; max-width: 280px; }
.cell-notes .cell-sub + .cell-sub { margin-top: 4px; }
.data-table tbody th.cell-store { min-width: 10rem; overflow-wrap: normal; }
.admin-select { padding: 8px 12px; min-height: 40px; border: 1px solid var(--color-border-control); border-radius: var(--radius-md); font: inherit; background: var(--color-surface); color: var(--color-text); }
.admin-search input[type="search"] { min-width: 200px; }
.tcg-products { list-style: none; display: grid; gap: 6px; margin-top: 6px; font-weight: 400; }
.tcg-products .cell-sub { display: block; }
.store-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.store-actions form { display: contents; }
.store-crawl-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* A sortable column: its header is a link to the sorted view (aria-sort on the active one) */
.th-sort { display: inline-flex; align-items: center; min-height: 44px; color: inherit; text-decoration: underline; }
.report-page { padding-top: 28px; padding-bottom: 60px; }
.report-scroll { max-height: 360px; overflow: auto; overscroll-behavior: contain; }
.report-share { width: 100%; font-family: monospace; font-size: 0.85rem; }
.report-note { max-width: 75ch; margin-top: 20px; }
.data-table .num .cell-sub { white-space: normal; }  /* a long note under a number wraps instead of widening the table */
.store-add, .rank-import { margin-bottom: 24px; }  /* width and top margin: .help-section, a later rule */
.store-add-form { padding: 0 24px 24px 48px; max-width: 640px; }
.rank-import-body { padding: 0 24px 24px 48px; }
.rank-import-body > p { margin-bottom: 10px; }
.rank-import-list { max-height: 24rem; overflow-y: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 16px; }
.rank-import-list thead th { position: sticky; top: 0; background: var(--color-surface, #FFFFFF); }
.rank-import-apply { margin-bottom: 24px; }
.rank-import-apply .admin-help { max-width: 70ch; }
.rank-import-upload { max-width: 640px; }
.store-remove { margin-top: 20px; }
.store-remove h3 { font-size: 1.1rem; margin-bottom: 4px; }
.store-remove .admin-help { margin-bottom: 12px; max-width: 60ch; }
.btn-danger { background-color: #B03A2E; color: #FFFFFF !important; }
.btn-danger:hover { background-color: #922B21; }
.admin-dialog { margin: auto; border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: 24px; width: min(92vw, 460px); color: var(--color-text); background: var(--color-surface, #FFFFFF); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18); }
.admin-dialog::backdrop { background: rgba(20, 16, 30, 0.45); }
.admin-dialog h2 { font-size: 1.15rem; margin: 0 0 8px; }
.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Admin game page (/admin/games) */
.admin-field input[type="number"] { max-width: 10rem; }
.games-list-title { font-size: 1.05rem; margin-bottom: 12px; }
.games-row-title { display: flex; align-items: center; gap: 10px; }
.games-row-title .cell-sub { display: block; }
.game-back { margin-bottom: 16px; }  /* the «← Juegos» / «← Tiendas» link above an edit page */
.game-head { display: flex; gap: 16px; align-items: center; }
.game-head img { width: 96px; height: 96px; object-fit: cover; border-radius: var(--radius-md); flex: none; }
.game-head p + p { margin-top: 6px; }
.game-sections { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; margin-bottom: 20px; }
.game-sections .admin-form-card { max-width: none; }
.table-card h3 { font-size: 1.15rem; margin-bottom: 4px; }
.game-section-intro { margin: 0 0 16px; font-size: 0.85rem; }
.game-restore { margin-left: 8px; }
.game-image-preview { display: block; margin-top: 8px; width: 120px; height: 120px; object-fit: cover; border-radius: var(--radius-md); border: 1px solid var(--color-border); }
.game-offers, .game-merge { margin-bottom: 20px; padding: 24px; }
.game-offers .data-table td:first-child { width: 2.5rem; }
.game-offers .data-table th[scope="row"] label { cursor: pointer; }
.game-offers .data-table th[scope="row"] .cell-sub { display: block; }
.game-offers input[type="checkbox"], .game-sections input[type="checkbox"], .game-merge input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--color-primary); }
.game-offers-form fieldset { margin-top: 16px; }
.game-picker-results:empty { display: none; }
.game-inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.game-merged-list { list-style: none; display: grid; gap: 6px; }

/* Admin help (/admin/ayuda) and the link to it on every admin page */
.admin-help-link { margin: 0 0 8px; font-size: 0.85rem; text-align: right; }
.admin-help-link a { text-decoration: underline; text-underline-offset: 2px; display: inline-block; padding: 6px 0; }
.help-tools { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; justify-content: space-between; max-width: 860px; margin-bottom: 8px; }
.help-search { display: grid; gap: 6px; flex: 1 1 320px; max-width: 520px; }
.help-search label { font-weight: 600; }
.help-search input { padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; }
.help-search .admin-help { margin: 0; min-height: 1.2em; }
.help-toggle { display: flex; gap: 8px; }
.help-section { margin-top: 12px; max-width: 860px; scroll-margin-top: 16px; line-height: 1.6; }
.help-section summary { display: block; padding: 16px 24px 16px 48px; cursor: pointer; position: relative; list-style: none; }
.help-section summary::-webkit-details-marker { display: none; }
.help-section summary::before { content: ""; position: absolute; left: 22px; top: 23px; width: 8px; height: 8px; border-right: 2.5px solid var(--color-primary); border-bottom: 2.5px solid var(--color-primary); transform: rotate(-45deg); transition: transform 0.15s; }
.help-section[open] summary::before { transform: rotate(45deg); }
.help-section summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; border-radius: var(--radius-lg); }
.help-section summary h3 { display: inline; font-size: 1.15rem; margin: 0; }
.help-gist { display: block; font-size: 0.85rem; color: var(--color-text-muted); margin-top: 2px; }
.help-content { padding: 0 24px 20px 48px; }
.help-section h4 { font-size: 1rem; margin: 18px 0 6px; }
.help-section p, .help-section ul, .help-section ol, .help-section dl { margin: 0 0 10px; }
.help-section ul, .help-section ol { padding-left: 22px; }
.help-section li + li { margin-top: 4px; }
.help-section code { font-size: 0.85em; overflow-wrap: anywhere; }
.help-section a { text-decoration: underline; text-underline-offset: 2px; }  /* links in running text: color alone is too close */
.help-terms dt { font-weight: 700; margin-top: 8px; }
.help-terms dd { margin: 2px 0 0 0; color: var(--color-text-muted); }
::highlight(help-search) { background-color: #FCE3B0; color: var(--color-text); }
@media (prefers-reduced-motion: reduce) { .help-section summary::before { transition: none; } }
@media (max-width: 600px) {
  .help-section summary { padding: 14px 16px 14px 40px; }
  .help-section summary::before { left: 16px; top: 21px; }
  .help-content { padding: 0 16px 16px; }
}
/* /admin/excluidos: the actions per title */
.excluded-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
/* /admin/ranking: the four change lists side by side when there's room */
.ranking-grid { display: grid; gap: 0 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.ranking-card { padding: 16px 20px; margin-top: 20px; }
.ranking-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.ranking-missing { font-variant-numeric: tabular-nums; line-height: 1.8; margin-top: 8px; }

/* WebMCP visual feedback when a browser AI agent interacts with a declarative tool form */
form:tool-form-active {
  outline: 2px dashed var(--color-primary);
  outline-offset: 4px;
  border-radius: var(--radius-md);
  background-color: rgba(122, 93, 192, 0.06);
}
button:tool-submit-active {
  outline: 2px dashed var(--color-primary);
  outline-offset: 2px;
}
.review-group { margin-top: 12px; scroll-margin-top: 16px; }
.review-group > summary { display: block; padding: 14px 20px 14px 44px; cursor: pointer; position: relative; list-style: none; }
.review-group > summary::-webkit-details-marker { display: none; }
.review-group > summary::before { content: ""; position: absolute; left: 20px; top: 21px; width: 8px; height: 8px; border-right: 2.5px solid var(--color-primary); border-bottom: 2.5px solid var(--color-primary); transform: rotate(-45deg); transition: transform 0.15s; }
.review-group[open] > summary::before { transform: rotate(45deg); }
.review-group > summary:focus-visible { outline: 2px solid var(--color-primary); outline-offset: -2px; border-radius: var(--radius-lg); }
.review-summary-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; justify-content: space-between; }
.review-game { font-size: 1.05rem; margin: 0; }
.review-meta { font-size: 0.85rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.review-body { border-top: 1px solid var(--color-border); padding: 12px 20px 16px; }
.review-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 0.85rem; }
.review-links { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.review-links a { text-decoration: underline; text-underline-offset: 2px; }
.review-table td, .review-table th { vertical-align: middle; }
.review-actions-cell { width: 1%; white-space: nowrap; }
.review-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; }
.review-actions:has(details[open]) { flex-wrap: wrap; }
.review-actions form { display: flex; gap: 6px; align-items: center; }
.review-ed-details > summary { list-style: none; cursor: pointer; }
.review-ed-details > summary::-webkit-details-marker { display: none; }
.review-ed-details[open] { flex-basis: 100%; display: flex; justify-content: flex-end; }
.review-ed-details[open] > summary { display: none; }
.review-edition input[type="text"] { width: 9rem; padding: 6px 10px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); font: inherit; font-size: 0.85rem; min-height: 36px; }
@media (max-width: 760px) {
  .review-group > summary { padding: 12px 14px 12px 36px; }
  .review-group > summary::before { left: 14px; top: 19px; }
  .review-body { padding: 10px 14px 14px; }
  .review-actions-cell { width: auto; white-space: normal; }
  .review-actions, .review-actions form { flex-wrap: wrap; justify-content: flex-start; }
  .review-ed-details[open] { justify-content: flex-start; }
}
.price-languages { font-size: 0.9rem; margin: 4px 0; }
.price-warning { font-size: 0.85rem; color: #8A1C24; background: #FDE2E4; border-radius: 6px; padding: 6px 10px; margin: 6px 0; }
.language-filter { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.language-filter a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--color-border, #ddd); border-radius: 999px; text-decoration: none; }
.language-filter a[aria-current] { background: var(--color-primary, #7A5DC0); color: #fff; border-color: transparent; }
