/* Site-wide base styles for every page on the network (was templates/shared/_base_style.html,
   inlined into every page). Linked from each base.html with a ?v=<mtime> version so it is
   cached for a year (core.http.install_static_cache). Page-specific CSS stays in head_extra. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d1117;
  --surface: #161b22;
  --surface2: #1c2128;
  --surface3: #222a33;
  --border: #30363d;
  --border-soft: #252c35;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-dim: #1f3a5f;
  --green: #3fb950;
  --red: #f85149;
  --orange: #f0883e;
  --purple: #bc8cff;
  --yellow: #e3b341;
  --pink: #f778ba;
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.24);
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* Room for the cookie bar while it is open (--cc-h set by _consent.html). */
  padding-bottom: var(--cc-h, 0px);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ── Header ── */
/* Tab-bar header: one row that never wraps (wrapping inside the fixed
   height was clipping links once the nav grew). On narrow screens the nav
   scrolls sideways with the scrollbar hidden; the active page gets an
   accent underline that reads at a glance. */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  /* Align the header contents with main's centered 1100px column
     (main pads 1.5rem, so mirror it once the viewport exceeds 1100px). */
  padding: 0 max(1rem, calc((100% - 1100px) / 2 + 1.5rem));
  height: 52px;
  display: flex;
  align-items: stretch;
  gap: 1.25rem;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-brand {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  flex: none;
}
.site-brand span { color: var(--accent); }
header nav {
  display: flex;
  align-items: stretch;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
header nav::-webkit-scrollbar { display: none; }
header nav a {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  padding: 0 0.65rem;
  font-size: 0.85rem;
  white-space: nowrap;
  border-top: 2px solid transparent;    /* balances the underline */
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
header nav a:hover { color: var(--text); text-decoration: none; }
header nav a.active { color: var(--text); border-bottom-color: var(--accent); }
header nav a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* ── Game identity (core/art.py packs): header chip + section-home band ── */
.game-chip { display:flex; align-items:center; gap:0.45rem; flex:none; color:var(--text);
  font-size:0.85rem; font-weight:600; padding-left:1rem; border-left:1px solid var(--border); white-space:nowrap; }
.game-chip img { width:26px; height:26px; object-fit:contain; border-radius:6px; }
.game-chip:hover { text-decoration:none; color:var(--accent); }
@media (max-width: 640px) { .game-chip span { display:none; } .game-chip { padding-left:0.6rem; } }
.game-band { max-width:1100px; width:100%; margin:1.25rem auto -0.75rem; padding:0 1.5rem; }
.gb-inner { position:relative; border-radius:14px; overflow:hidden; border:1px solid var(--border);
  min-height:180px; display:flex; align-items:flex-end; background:var(--surface); }
.gb-bg { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.gb-inner::after { content:""; position:absolute; inset:0;
  background:linear-gradient(90deg, rgba(13,17,23,0.92) 0%, rgba(13,17,23,0.6) 45%, rgba(13,17,23,0.15) 100%); }
.gb-inner.no-banner { background:radial-gradient(circle at 85% 30%, rgba(88,166,255,0.18), transparent 55%), var(--surface); }
.gb-inner.no-banner { min-height:110px; }
.gb-inner.no-banner::after { display:none; }
.gb-body { position:relative; z-index:1; display:flex; align-items:flex-end; justify-content:space-between;
  gap:1rem; width:100%; padding:1.1rem 1.25rem; flex-wrap:wrap; }
.gb-id { display:flex; align-items:center; gap:0.85rem; }
.gb-id img { width:64px; height:64px; object-fit:contain; filter:drop-shadow(0 4px 12px rgba(0,0,0,0.6)); }
.gb-name { font-size:1.35rem; font-weight:800; color:#fff; line-height:1.15; }
.gb-credit { font-size:0.75rem; color:rgba(230,237,243,0.75); }
.gb-strip { display:flex; gap:0.4rem; }
.gb-strip img { border-radius:8px; border:1px solid rgba(255,255,255,0.15); background:rgba(13,17,23,0.55); }
.gb-strip.kind-icon img { width:44px; height:44px; object-fit:contain; padding:4px; }
.gb-strip.kind-shot img { width:120px; aspect-ratio:16 / 9; height:auto; object-fit:cover; }
.gb-strip.kind-portrait img { width:60px; aspect-ratio:1 / 2; height:auto; object-fit:cover; object-position:top; }
@media (max-width: 640px) { .gb-strip.kind-shot img:nth-child(n+3), .gb-strip.kind-icon img:nth-child(n+5),
  .gb-strip.kind-portrait img:nth-child(n+4) { display:none; }
  .game-band { padding:0 1rem; } .gb-inner { min-height:150px; } }
/* ── Official screenshots: a captioned wall (hub, section homes) and a
      fixed-height row (compare, best-of). Markup: templates/hub/_art.html ── */
.net-gallery { columns:5 180px; column-gap:0.75rem; }
.net-gallery figure { break-inside:avoid; margin:0 0 0.75rem; border:1px solid var(--border);
  border-radius:10px; overflow:hidden; background:var(--surface); }
.net-gallery img { display:block; width:100%; height:auto; background:#0d1117; }
.net-gallery .is-portrait img { max-height:300px; object-fit:cover; object-position:top; }
.net-gallery figcaption { font-size:0.72rem; line-height:1.4; color:var(--text-muted); padding:0.45rem 0.65rem 0.55rem; }
.net-gallery figcaption a { font-weight:700; }
.net-gallery .net-credit { display:block; }
.net-shots { display:flex; gap:0.5rem; margin:0.6rem 0; }
.net-shots img { display:block; flex:0 1 auto; min-width:0; height:150px; width:auto; max-width:100%;
  object-fit:cover; object-position:top; border-radius:8px; border:1px solid var(--border); background:#0d1117; }
.net-shots.is-small img { height:104px; }
/* ── Main ── */
main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}
footer a { color: var(--text-muted); }
/* Tip jar: the single outbound support link. Borrows the site's own
   .pill-link vocabulary at footer scale (existing tokens only, no new
   palette) so it reads as one deliberate action rather than a seventh
   muted info link. */
footer .footer-support { margin-top: 0.7rem; }
footer a.tip-jar {
  display: inline-flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.28rem 0.85rem;
  color: var(--text); font-size: 0.76rem;
  transition: border-color 0.15s, color 0.15s;
}
footer a.tip-jar:hover {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
}
footer a.tip-jar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
footer .disclaimer {
  margin-top: 0.4rem;
  font-style: italic;
}
/* ── Page header ── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; }
.page-header p { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.875rem; }
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin-bottom: 0.45rem;
}
/* ── Cards ── */
.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)) var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}
.tool-card {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(88, 166, 255, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)) var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem;
  box-shadow: var(--shadow-soft);
}
.tool-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), transparent 78%);
  opacity: 0.7;
}
.tool-card > * { position: relative; }
.card-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
/* ── Stat card ── */
.stat-card {
  background:
    radial-gradient(circle at top right, rgba(88, 166, 255, 0.10), transparent 42%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
a.stat-card { color: var(--text); display: block; }
a.stat-card:hover { transform: translateY(-1px); border-color: #465568; text-decoration: none; }
.stat-card .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .value { font-size: 1.65rem; font-weight: 800; margin: 0.2rem 0; color: var(--text); font-variant-numeric: tabular-nums; }
.stat-card .sub { font-size: 0.75rem; color: var(--text-muted); }
/* ── Table ── */
.table-wrap { overflow-x: auto; }
/* Freeze the first column so the row label survives horizontal scroll on
   narrow viewports. skill_table/loot_table both render inside .card
   (var(--surface)), so this bg matches the backdrop = no desktop shift. */
.table-wrap th.col-sticky, .table-wrap td.col-sticky {
  position: sticky;
  left: 0;
  background: var(--surface);
  z-index: 1;
  border-right: 1px solid var(--border);
}
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 0.6rem 0.75rem; vertical-align: middle; }
/* ── Search bar ── */
.search-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.search-bar input, .search-bar select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
}
.search-bar input { flex: 1; min-width: 200px; }
.search-bar input:focus, .search-bar select:focus { border-color: var(--accent); }
.search-bar button, .btn {
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent);
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.search-bar button:hover, .btn:hover { background: var(--accent); color: #0d1117; }
/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-common  { background: #21262d; color: var(--text); border: 1px solid var(--border); }
.badge-uncommon { background: #1a3a21; color: var(--green); }
.badge-rare    { background: var(--accent-dim); color: var(--accent); }
.badge-epic    { background: #2d1f3d; color: var(--purple); }
.badge-legendary { background: #3d2a10; color: var(--orange); }
.badge-mythic    { background: #3a1130; color: var(--pink); }
/* ── Empty state ──
   One base class; add .empty-card for the boxed (dashed-border) variant. */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty .empty-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.empty p { font-size: 0.875rem; }
.empty.empty-card {
  padding: 2.4rem 1.25rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
}
.empty.empty-card .empty-icon { font-size: 1.7rem; margin-bottom: 0.45rem; }
.empty.empty-card strong { display: block; color: var(--text); margin-bottom: 0.25rem; }
/* ── Freshness badge ── */
.fresh-ok   { color: var(--green); }
.fresh-warn { color: var(--yellow); }
.fresh-stale { color: var(--red); }
/* ── Section spacing ── */
.section { margin-bottom: 2rem; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.75rem; }
.section-header h2 { font-size: 1rem; font-weight: 700; letter-spacing: 0.01em; }
.section-header a { font-size: 0.8rem; color: var(--text-muted); }
/* ── Price ── */
.price { font-weight: 600; color: var(--yellow); font-variant-numeric: tabular-nums; }
.price-up { color: var(--green); }
.price-down { color: var(--red); }
.gold-value {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: var(--yellow);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gold-value::before {
  content: "";
  width: 0.78em;
  height: 0.78em;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, #fff1a8 0 15%, transparent 16%),
    linear-gradient(145deg, #f7d774, #b87516 72%);
  border: 1px solid rgba(255, 225, 128, 0.55);
  box-shadow: inset 0 -1px 1px rgba(70, 35, 0, 0.45), 0 0 8px rgba(227, 179, 65, 0.22);
  flex: 0 0 auto;
}
/* ── Last updated pill ── */
.updated-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.updated-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(63,185,80,.55); }
/* ── Progress bar ── */
.progress-wrap {
  background: var(--surface2);
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-top: 0.4rem;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}
/* ── Meta list ── */
.meta-list { display: grid; gap: 0.5rem; }
.meta-row { display: flex; gap: 0.75rem; }
.meta-label { min-width: 110px; color: var(--text-muted); font-size: 0.8rem; }
.meta-value { font-size: 0.875rem; }
/* ── Breadcrumbs ── */
.breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: var(--text); }
/* ── Hero ── */
.hero {
  background:
    radial-gradient(circle at 12% 10%, rgba(227, 179, 65, 0.12), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(88, 166, 255, 0.14), transparent 34%),
    linear-gradient(135deg, var(--surface), var(--surface2));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-soft);
}
.hero h1 { font-size: clamp(1.75rem, 3vw, 2.35rem); font-weight: 800; letter-spacing: -0.03em; }
.hero p { color: var(--text-muted); margin-top: 0.5rem; max-width: 60ch; }
.hero .cta-row { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.hero-meta { display:flex; gap:0.5rem; flex-wrap:wrap; margin-top:1rem; }
/* ── Pill links ── */
.pill-link {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.3rem 0.7rem; font-size: 0.8rem;
  color: var(--text);
}
.pill-link:hover { border-color: var(--accent); text-decoration: none; }
.data-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34, 42, 51, 0.72);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.76rem;
  padding: 0.22rem 0.6rem;
}
.data-chip strong { color: var(--text); font-weight: 700; }
.count-chip { color: var(--text-muted); font-size: 0.75rem; }
/* ── Status dot ── */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 0.35rem; }
.dot-ok    { background: var(--green); }
.dot-warn  { background: var(--yellow); }
.dot-error { background: var(--red); }
.dot-unknown { background: var(--text-muted); }
/* ── Footer links ── */
.footer-links { margin-bottom: 0.5rem; }
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
/* ── Legal / info pages (prose) ── */
.legal { line-height: 1.7; }
.legal h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--text);
}
.legal h2:first-of-type { margin-top: 0.5rem; }
.legal p { margin-bottom: 0.85rem; }
.legal ul { margin: 0 0 0.95rem 1.25rem; }
.legal li { margin-bottom: 0.45rem; }
/* ── Cookie-consent banner ── */
/* A compact full-width bottom bar: one or two lines of text and two buttons
   of equal weight. Safe-area aware; body reserves its height (--cc-h). */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.5rem max(1rem, env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  flex-wrap: wrap;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.35);
  z-index: 200;
}
.cookie-consent[hidden] { display: none; }
.cookie-consent .cc-text { font-size: 0.78rem; line-height: 1.4; color: var(--text-muted); flex: 0 1 auto; max-width: 640px; margin: 0; }
.cookie-consent .cc-text a { text-decoration: underline; }
.cookie-consent .cc-actions { display: flex; gap: 0.5rem; flex: none; }
/* Accept and Decline share one style: neither is presented as the default. */
.cc-btn {
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--text);
  min-width: 6rem;
  min-height: 40px;
  padding: 0.35rem 1rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.cc-btn:hover { background: var(--accent-dim); }
@media (max-width: 600px) {
  .cookie-consent { gap: 0.4rem; }
  .cookie-consent .cc-text { flex: 1 1 100%; text-align: center; }
  .cookie-consent .cc-actions { flex: 1 1 100%; }
  .cookie-consent .cc-actions .cc-btn { flex: 1; }
}
/* ── Skip link (a11y: bypass sticky nav) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 6px;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}
/* ── Focus visibility (a11y: keyboard focus rings) ── */
.search-bar input:focus-visible, .search-bar select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ── Mobile tier (phones) — additive, desktop untouched above ── */
@media (max-width: 600px) {
  /* Touch targets: form controls to the 44px minimum */
  .search-bar input, .search-bar select, .search-bar button, .btn, .cc-btn { min-height: 44px; }
  /* Stack the search bar full-width so controls don't squish */
  .search-bar input, .search-bar select { flex: 1 1 100%; }
  /* Tighter side padding reclaims horizontal room on small screens */
  main { padding: 1.5rem 1rem; }
  /* Floor sub-legible labels to ~11px on phones only (desktop unchanged) */
  .section-kicker, .badge, .count-chip, .en-stat .k, .lvl-chip, .lh-hint { font-size: 11px; }
}
  
/* ── Site search (header link + panel: static/search.js; page: hub/search.html) ── */
.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; }
.hdr-search { display: flex; align-items: center; justify-content: center; gap: 0.4rem; flex: none;
  min-width: 44px; padding: 0 0.5rem; margin-right: -0.5rem; color: var(--text-muted); font-size: 0.85rem; }
.hdr-search:hover, .hdr-search.active, .hdr-search[aria-expanded="true"] { color: var(--text); text-decoration: none; }
.hdr-search:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.hdr-search-label { display: none; }
@media (min-width: 1000px) { .hdr-search-label { display: inline; } }
.search-panel { position: fixed; top: 52px; right: max(0px, calc((100% - 1100px) / 2)); z-index: 150;
  width: min(100%, 560px); max-height: calc(100vh - 52px - var(--cc-h, 0px)); max-height: calc(100dvh - 52px - var(--cc-h, 0px)); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 10px 10px;
  box-shadow: var(--shadow-soft); padding: 0.75rem; }
.search-panel[hidden] { display: none; }
.sp-form { display: flex; gap: 0.5rem; }
.sp-form input, .sr-form input[type="search"] { flex: 1; min-width: 0; min-height: 44px; background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; padding: 0.5rem 0.75rem; font: inherit; font-size: 16px; }
.sp-form input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.sp-close { flex: none; width: 44px; min-height: 44px; background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.sp-close:hover { color: var(--text); }
.sp-status, .sr-status { font-size: 0.8rem; color: var(--text-muted); margin: 0.5rem 0 0; }
.sp-status:empty { display: none; }
.sr-list { list-style: none; margin: 0.5rem 0 0; }
.sr-item { display: flex; align-items: center; gap: 0.65rem; min-height: 44px; padding: 0.35rem 0.5rem;
  border-radius: 6px; color: var(--text); }
.sr-item:hover, .sr-item:focus-visible { background: var(--surface2); text-decoration: none; }
.sr-item:focus-visible { outline-offset: -2px; }
.sr-item img { width: 28px; height: 28px; object-fit: contain; flex: none; border-radius: 4px; }
.sr-main { display: flex; flex-direction: column; min-width: 0; }
.sr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sr-meta { font-size: 0.75rem; color: var(--text-muted); }
.sp-all { display: flex; align-items: center; min-height: 40px; padding: 0 0.5rem; font-size: 0.82rem; }
.sr-form { margin-bottom: 0.25rem; }
.sr-form input[type="search"] { flex: 1 1 260px; }
main .sr-list .sr-item { border-bottom: 1px solid var(--border-soft); border-radius: 0; }
.sr-tips { margin-top: 1rem; }
kbd { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.8em; padding: 0.05rem 0.35rem;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--surface2); }
@media (max-width: 600px) {
  .search-panel { border-radius: 0; border-left: 0; border-right: 0; }
}
/* ── Shared chrome: mobile polish ── */
/* Nav overflow affordance: the tab strip fades out at its
   right edge, and a trailing spacer lets the last tab scroll clear of the
   fade. mask-image fades the strip itself, so nothing is drawn over the
   search button at the header's right end. */
header nav::after { content: ""; flex: 0 0 1.25rem; }
header nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 1.75rem), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 1.75rem), transparent); }
header nav.at-end { -webkit-mask-image: none; mask-image: none; }
header nav.scrolled { -webkit-mask-image: linear-gradient(to right, transparent, #000 1.75rem, #000 calc(100% - 1.75rem), transparent);
  mask-image: linear-gradient(to right, transparent, #000 1.75rem, #000 calc(100% - 1.75rem), transparent); }
header nav.scrolled.at-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 1.75rem);
  mask-image: linear-gradient(to right, transparent, #000 1.75rem); }
@media (max-width: 640px) { header { gap: 0.75rem; } }
.site-brand { min-height: 44px; }
.site-brand:focus-visible, .game-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.cc-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Footer: each link is a 40px-tall tap target on touch screens. */
@media (max-width: 600px), (pointer: coarse) {
  footer .footer-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.3rem; }
  footer a.tip-jar { min-height: 40px; padding: 0.28rem 1rem; }
}
/* Links inside running text carry an underline, so they are not told apart
   by colour alone (WCAG 1.4.1). Buttons, chips and cards use classes and
   are unaffected. */
main p a:not([class]) { text-decoration: underline;
  text-decoration-color: rgba(88, 166, 255, 0.45); text-underline-offset: 2px; }
main p a:not([class]):hover { text-decoration-color: currentColor; }
/* Phone tap targets for in-page chrome: breadcrumb links and pill links get a
   40px-tall hit area from padding (text size unchanged); the breadcrumb's
   negative margins keep its visual spacing. */
@media (max-width: 600px), (pointer: coarse) {
  .breadcrumb { margin-top: -0.6rem; margin-bottom: 0.4rem; row-gap: 0; }
  .breadcrumb a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0.2rem; margin: 0 -0.2rem; }
  .pill-link { min-height: 40px; }
}
/* Stacked tables on phones (.stack-table, e.g. the shared skill_table macro):
   each row becomes a card, the first cell is its heading and every other cell
   shows its column name from data-label. Desktop layout is untouched. */
@media (max-width: 600px) {
  .table-wrap:has(> .stack-table) { overflow-x: visible; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-table, .stack-table tbody { display: block; }
  .stack-table tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.35rem 0.75rem;
    padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
  .stack-table td { display: block; padding: 0; border: 0; white-space: normal !important; min-width: 0; }
  .stack-table td.st-name, .stack-table td.col-sticky { grid-column: 1 / -1; position: static; border: 0; background: none;
    font-weight: 600; font-size: 0.95rem; }
  .stack-table td.st-wide { grid-column: 1 / -1; }
  .stack-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; }
  .stack-table td.count-chip { background: none; border: 0; padding: 0; border-radius: 0; }
}
