/* gamedb.css — components this site has and the blog does not.
 *
 * Loads after fleet-ui/site.css and the theme preset, and uses ONLY the twelve
 * tokens those define:
 *
 *   --bg --surface --text --muted --accent --accent-contrast --border
 *   --font-body --font-heading --radius --header-bg --header-text
 *
 * No literal colours. A colour here would be a colour the control plane cannot
 * change, which is the drift the fleet split exists to prevent.
 *
 * fleet-ui/site.css contains zero media queries — its responsiveness is
 * emergent from clamp(), grid auto-fill and flex-wrap. That holds up for prose
 * and card grids and does not hold up for a wide stat table, so the breakpoints
 * and the scroll containers below are this file's job.
 */

/* ── Layout bits ──────────────────────────────────────────────────────── */

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 2rem 0 0.25rem;
}

.page-sub { color: var(--muted); margin: 0 0 1.5rem; }
.empty { color: var(--muted); padding: 2rem 0; }
.muted { color: var(--muted); }

.section { margin: 2.5rem 0; }

.section-title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  margin: 0 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumb { color: var(--muted); font-size: 0.9rem; margin: 1.5rem 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

.db-hero { padding: 2rem 0 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── Provenance ───────────────────────────────────────────────────────── */

/* Neutral-alpha tints rather than named colours, so these read correctly on
   both the light and dark presets without knowing which one is active. */
.provenance {
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-size: 0.92rem;
  border: 1px solid var(--border);
}

.provenance.verified { color: var(--muted); background: rgba(127, 127, 127, 0.06); }

.provenance.unverified {
  color: var(--text);
  background: rgba(127, 127, 127, 0.1);
  border-left: 3px solid var(--accent);
}

.unverified-dot {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
}

/* ── Badges and chips ─────────────────────────────────────────────────── */

.tier-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: rgba(127, 127, 127, 0.1);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
}

.chip {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text);
  background: rgba(127, 127, 127, 0.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin: 0.15rem 0.25rem 0.15rem 0;
}

a.chip:hover { border-color: var(--accent); color: var(--accent); }

/* ── Stat tables ──────────────────────────────────────────────────────── */

/* The table scrolls inside this, never the page body. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  background: var(--surface);
}

.stat-table { width: 100%; border-collapse: collapse; font-size: 0.96rem; }

.stat-table th,
.stat-table td { padding: 0.65rem 1rem; text-align: left; vertical-align: top; }

.stat-table tbody tr + tr { border-top: 1px solid var(--border); }

.stat-table th[scope='row'] {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  width: 34%;
}

.compare-table thead th {
  font-family: var(--font-heading);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.compare-table th[scope='row'] { width: auto; }

.stat-sublist { list-style: none; margin: 0; padding: 0; }

.stat-sublist li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0;
  max-width: 22rem;
}

.stat-subkey { color: var(--text); text-transform: capitalize; }
.stat-subval { color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── Entity page ──────────────────────────────────────────────────────── */

.entity { max-width: 900px; }

.entity-head { margin: 0.5rem 0 1rem; }

.entity-title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.entity-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.entity-prose { max-width: 70ch; }
.entity-section { margin: 2rem 0; }

.entity-section h2 {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

/* ── Home ─────────────────────────────────────────────────────────────── */

.biome-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  counter-reset: biome;
}

.biome-step a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.biome-step a:hover { border-color: var(--accent); transform: translateY(-1px); }

.biome-order {
  font-variant-numeric: tabular-nums;
  color: var(--accent-contrast);
  background: var(--accent);
  border-radius: 999px;
  width: 1.5rem;
  height: 1.5rem;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.biome-name { font-family: var(--font-heading); }

.browse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}

.browse-tile {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.browse-tile:hover { border-color: var(--accent); transform: translateY(-2px); }

.browse-count {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.browse-label { color: var(--muted); font-size: 0.9rem; }

.entity-card .card-body { padding: 1rem 1.1rem; }
.entity-card .card-meta { gap: 0.5rem; align-items: center; }

/* ── Search ───────────────────────────────────────────────────────────── */

.search-results { list-style: none; margin: 0; padding: 0; }

.search-results li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.search-name { font-family: var(--font-heading); font-size: 1.1rem; }

.search-type {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: 0.6rem;
}

.search-excerpt { color: var(--muted); margin: 0.3rem 0 0; font-size: 0.92rem; }
.search-excerpt mark { background: rgba(127, 127, 127, 0.22); color: var(--text); }

/* ── Footer / fleet ───────────────────────────────────────────────────── */

.fleet-link { font-weight: 600; }
.footer-note { color: var(--muted); font-size: 0.85rem; max-width: 60ch; }

/* ── Breakpoints ──────────────────────────────────────────────────────── */

@media (max-width: 720px) {
  .stat-table th[scope='row'] { width: 45%; white-space: normal; }
  .stat-table th,
  .stat-table td { padding: 0.55rem 0.7rem; }
  .stat-sublist li { max-width: none; }
  .browse-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

@media (max-width: 480px) {
  .biome-strip { flex-direction: column; }
  .biome-step a { justify-content: flex-start; }
}
