:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #5f6368;
  --border: #dedcd7;
  --accent: #c8102e;        /* GameStop red */
  --accent-text: #ffffff;
  --tag-bg: #ecebe7;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --surface: #1e1e21;
    --text: #ececee;
    --muted: #a0a0a8;
    --border: #333338;
    --accent: #e0334f;
    --tag-bg: #2b2b30;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.page-head {
  padding: 32px 0 8px;
}
.page-head h1 {
  margin: 0 0 4px;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  line-height: 1.2;
}
.lede {
  margin: 0;
  color: var(--muted);
}

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

.filter {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.filter button {
  font: inherit;
  font-size: 0.9rem;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.filter button + button { border-left: 1px solid var(--border); }
.filter button:hover { background: var(--tag-bg); }
.filter button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-text);
}
.filter button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -4px;
}

.count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.grid {
  list-style: none;
  margin: 0 0 48px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-img {
  display: block;
  padding: 12px 12px 0;
}
.card-img img {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;   /* standard TCG card proportions */
  object-fit: contain;
  border-radius: 8px;
}

.card-body {
  padding: 12px 14px 16px;
}
.card-body h2 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.3;
}
.meta {
  margin: 2px 0 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.tag {
  display: inline-block;
  margin: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
  font-size: 0.8rem;
}
.tag-stamp {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.notes {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.error {
  color: var(--accent);
}
