:root {
  --bg: #14110d;
  --panel: #1f1a14;
  --panel-2: #262019;
  --line: #3a3026;
  --text: #efe6d6;
  --muted: #a8998a;
  --gold: #f0b429;
  --gold-dim: #b9861c;
  --hl: rgba(240, 180, 41, .28);
  --radius: 10px;
  --tier-1: #6ba368; --tier-2: #4f9bd9; --tier-3: #9d7bd8;
  --tier-4: #d9a441; --tier-5: #e07b53; --tier-6: #d95f6e; --tier-7: #cf4fa8;
}
* { box-sizing: border-box; }
/* The client-side filter hides items by setting the `hidden` property. Author
   rules like `.card { display: flex }` outrank the browser's built-in
   `[hidden] { display: none }`, so without this guard filtered-out cards stay
   visible. Must stay ahead of any rule that sets `display`. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.skip {
  position: absolute; left: -9999px; background: var(--gold); color: #1a1408;
  padding: 10px 14px; border-radius: 0 0 8px 0; z-index: 10;
}
.skip:focus { left: 0; top: 0; }

/* header + nav */
.site-header { border-bottom: 1px solid var(--line); background: var(--panel); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 12px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.brand-mark { opacity: .8; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.nav a { color: var(--muted); padding: 7px 11px; border-radius: 7px; font-size: .92rem; font-weight: 600; }
.nav a:hover { color: var(--text); background: var(--panel-2); text-decoration: none; }
.nav a.active { color: var(--gold); background: rgba(240,180,41,.1); }

/* page furniture */
.breadcrumbs { color: var(--muted); font-size: .85rem; margin: 16px 0 8px; }
.breadcrumbs .sep { margin: 0 7px; opacity: .6; }
.page-head { margin: 8px 0 18px; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); margin: 0 0 6px; color: var(--gold); line-height: 1.2; }
h2 { font-size: 1.25rem; margin: 28px 0 12px; }
h3 { font-size: 1.05rem; margin: 20px 0 8px; }
.lede { color: var(--muted); margin: 0; max-width: 70ch; }
.meta { color: var(--muted); font-size: .85rem; min-height: 1.2em; margin: 10px 0; }
.empty { padding: 32px; text-align: center; color: var(--muted); }
.error { color: #ff7b72; margin: 10px 0; }
.prose { max-width: 72ch; }
.prose p { margin: 0 0 14px; }
.prose ul { padding-left: 20px; }

/* toolbar */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
input, select, button {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px;
}
input[type="search"] { flex: 1 1 240px; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px;
}
.btn { background: var(--gold); color: #1a1408; border-color: var(--gold); font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--gold-dim); }
.btn:disabled { opacity: .6; cursor: progress; }

/* grids and cards */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid--tight { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card {
  display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px;
}
.card:hover { border-color: var(--gold-dim); }
/* Card imagery is square cropped artwork (see lib/cards.js). */
.card-art { width: 96px; height: 96px; flex: none; border-radius: 6px; background: #0d0b08;
  object-fit: cover; object-position: center; }
.card-body { min-width: 0; }
.card-title { font-weight: 600; color: var(--gold); display: block; }
.card-sub { font-size: .84rem; color: var(--muted); margin-bottom: 6px; }
.card-text { font-size: .88rem; }
.card-note { font-size: .8rem; color: var(--muted); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge {
  font-size: .72rem; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line); color: var(--muted);
}
.badge--stats { color: var(--text); font-variant-numeric: tabular-nums; }
.badge--tier { color: #14110d; border: 0; font-weight: 700; }
.tier-1 { background: var(--tier-1); } .tier-2 { background: var(--tier-2); }
.tier-3 { background: var(--tier-3); } .tier-4 { background: var(--tier-4); }
.tier-5 { background: var(--tier-5); } .tier-6 { background: var(--tier-6); }
.tier-7 { background: var(--tier-7); }

/* tables */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--panel); color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.03); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
td.rank { font-variant-numeric: tabular-nums; width: 1%; white-space: nowrap; }
td.name { word-break: break-word; }
mark { background: var(--hl); color: inherit; border-radius: 3px; }

/* detail pages */
.detail { display: flex; flex-wrap: wrap; gap: 24px; margin-bottom: 8px; }
.detail-art { width: 288px; max-width: 70vw; aspect-ratio: 1; object-fit: cover;
  border-radius: 12px; flex: none; background: #0d0b08; }
.detail-body { flex: 1 1 320px; min-width: 0; }
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 84px; }
.stat dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.callout { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 8px; padding: 12px 14px; margin: 16px 0; }
.link-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.link-list a { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px;
  color: var(--text); font-size: .9rem; display: inline-block; }
.link-list a:hover { border-color: var(--gold); text-decoration: none; }

/* ad slots: reserved space so enabling ads shifts nothing */
.ad-slot { display: block; margin: 16px auto; text-align: center; overflow: hidden; }
.ad-slot--top { min-height: 90px; }
.ad-slot--inline { min-height: 250px; }
.ad-slot--footer { min-height: 90px; }
.ad-slot:empty { display: none; }
@media (max-width: 600px) { .ad-slot--top, .ad-slot--footer { min-height: 100px; } }

/* footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 34px; background: var(--panel); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; }
.footer-nav a { color: var(--muted); font-size: .9rem; }
.disclaimer { color: var(--muted); font-size: .78rem; max-width: 85ch; margin: 0; }
.disclaimer a { color: var(--muted); text-decoration: underline; }

@media (max-width: 700px) {
  .nav { margin-left: 0; width: 100%; }
  .card-art { width: 72px; height: 72px; }
}
