/* ---------- fonts ---------- */
/* Geist and Geist Mono (SIL OFL, see assets/fonts/OFL.txt). unicode-range means a
   browser only downloads the latin-ext files when a page uses those letters. */
@font-face { font-family: "Geist"; font-weight: 400 700; font-display: swap; src: url(assets/fonts/geist-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist"; font-weight: 400 700; font-display: swap; src: url(assets/fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-display: swap; src: url(assets/fonts/geist-mono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-weight: 500; font-display: swap; src: url(assets/fonts/geist-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens ---------- */
/* Light is the default. Dark applies when the system asks for it (unless the
   visitor picked light) or when the visitor picked dark; theme.js sets data-theme. */
:root {
  color-scheme: light;
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --muted: #52525b;
  --dim: #6b6b75;
  --brand: #ff4655;          /* logo and fills only; text uses --accent */
  --accent: #be1e2d;
  --ok: #166534;
  --warn: #854d0e;
  --info: #1d4ed8;
  --pressed-bg: #18181b;
  --pressed-text: #fafafa;
  --shadow: 0 1px 2px rgba(9, 9, 11, .04);
  --shadow-hover: 0 8px 24px -12px rgba(9, 9, 11, .18);
  --backdrop: rgba(9, 9, 11, .45);
  --header-bg: rgba(250, 250, 250, .82);
  --radius: 12px;
  --radius-sm: 8px;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09090b;
    --surface: #111113;
    --surface-2: #18181b;
    --border: #232327;
    --border-strong: #34343a;
    --text: #fafafa;
    --muted: #a1a1aa;
    --dim: #8e8e98;
    --accent: #ff6b77;
    --ok: #4ade80;
    --warn: #facc15;
    --info: #93c5fd;
    --pressed-bg: #fafafa;
    --pressed-text: #09090b;
    --shadow: none;
    --shadow-hover: 0 8px 24px -12px rgba(0, 0, 0, .6);
    --backdrop: rgba(0, 0, 0, .65);
    --header-bg: rgba(9, 9, 11, .8);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #111113;
  --surface-2: #18181b;
  --border: #232327;
  --border-strong: #34343a;
  --text: #fafafa;
  --muted: #a1a1aa;
  --dim: #8e8e98;
  --accent: #ff6b77;
  --ok: #4ade80;
  --warn: #facc15;
  --info: #93c5fd;
  --pressed-bg: #fafafa;
  --pressed-text: #09090b;
  --shadow: none;
  --shadow-hover: 0 8px 24px -12px rgba(0, 0, 0, .6);
  --backdrop: rgba(0, 0, 0, .65);
  --header-bg: rgba(9, 9, 11, .8);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 var(--sans); font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
::selection { background: var(--brand); color: #fff; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 4px; }

/* ---------- header ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; font-size: 16px; letter-spacing: -.01em; }
.brand span:last-child { color: var(--muted); font-weight: 500; }
.mark {
  display: grid; place-items: center; width: 26px; height: 26px; background: var(--brand); color: #fff;
  font-size: 15px; font-weight: 700; clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
}
.links { display: flex; align-items: center; gap: 4px; }
.links a { color: var(--muted); text-decoration: none; font-size: 14px; padding: 6px 10px; border-radius: var(--radius-sm); transition: color .15s, background .15s; }
.links a:hover { color: var(--text); background: var(--surface-2); }

/* Styled like the nav links next to it: no box until hovered. */
.theme-toggle {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.theme-toggle:hover { color: var(--text); background: var(--surface-2); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* Show the icon for the theme a click switches to. */
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.hero { padding: 48px 16px 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 4px 10px 4px 8px;
  font-size: 13px; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.hero h1 { margin: 0; font-size: clamp(36px, 6vw, 56px); line-height: 1.05; font-weight: 650; letter-spacing: -.035em; }
.hero h1 em { font-style: normal; color: var(--muted); }
.lede { margin: 14px 0 0; max-width: 60ch; color: var(--muted); font-size: 16px; }

.stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin-top: 28px; }
.stat { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.stat b { font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
a.stat b { color: var(--ok); }
a.stat:hover span { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- filter bar ---------- */
/* Only the search box stays pinned: it sits last in the bar, and app.js offsets the
   sticky bar by the chip rows' height so they scroll away above it. */
.controls {
  position: sticky; top: var(--controls-top, 0); z-index: 5; padding: 4px 0 10px;
  background: var(--header-bg); backdrop-filter: blur(12px) saturate(160%); -webkit-backdrop-filter: blur(12px) saturate(160%);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.controls > .wrap { display: flex; flex-direction: column; }
.search { position: relative; display: block; order: 1; margin-top: 10px; }
.search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; }
#q {
  width: 100%; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: 400 15px var(--sans); box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
#q::placeholder { color: var(--dim); }
#q:focus { outline: none; border-color: var(--border-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 10%, transparent); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.chips .lbl { flex: none; font-size: 12px; font-weight: 500; color: var(--dim); margin-right: 2px; min-width: 52px; }
/* Type, Region and Sort share one line on wide screens */
.filter-row { display: flex; flex-wrap: wrap; column-gap: 32px; }
/* Hold space for the stats and chips app.js fills in, so the page doesn't jump on load. */
.chips:empty { min-height: 28px; }
.stats:empty { min-height: 52px; }
@media (min-width: 1100px) {
  .filter-row .sort .lbl { min-width: 0; }
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  border-radius: 999px; padding: 4px 11px; font: 500 13px/1.3 var(--sans); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip small { font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="true"] { background: var(--pressed-bg); border-color: var(--pressed-bg); color: var(--pressed-text); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .7; }

/* ---------- sections ---------- */
main.wrap { padding-bottom: 20px; }
.cat { margin: 48px 0 12px; }
.cat > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.count {
  font-size: 12px; font-weight: 500; color: var(--muted); padding: 2px 8px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.cat > p { margin: 0 0 18px; color: var(--muted); max-width: 80ch; font-size: 14px; }
.group { margin: 28px 0; }
.group h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.note { margin: 0 0 10px; font-size: 13px; color: var(--muted); max-width: 90ch; }
.sub { margin: 16px 0 8px; font-size: 12px; font-weight: 500; color: var(--dim); }
.month { margin-top: 40px; }
.month > h2 { font-size: 19px; }

.now { padding: 22px 20px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.now .grid .card { background: var(--bg); }
.live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--ok); opacity: 0; animation: ping 2s ease-out infinite; }
@keyframes ping { 0% { transform: scale(.6); opacity: .7; } 100% { transform: scale(1.5); opacity: 0; } }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card {
  position: relative; display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
/* Type colour, used by the dot next to the type label (cards and the item dialog). */
[data-type="Spray"] { --dot: #f97316; }
[data-type="Gun Buddy"] { --dot: #eab308; }
[data-type="Player Card"] { --dot: #8b5cf6; }
[data-type="Title"] { --dot: #14b8a6; }
[data-type="Gun Skin"] { --dot: #ff4655; }
.card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card.is-active { border-color: color-mix(in srgb, var(--ok) 30%, var(--border)); }
.now .card.is-active { border-color: var(--border); } /* the section already says so */

.thumb { height: 160px; display: grid; place-items: center; padding: 14px; background: var(--surface-2); }
.thumb img { max-width: 100%; max-height: 132px; object-fit: contain; transition: transform .2s ease; }
.thumb.card-img img { max-height: 136px; border-radius: 4px; }
.card:hover .thumb img { transform: scale(1.03); }
.ptitle {
  padding: 8px 16px; text-align: center; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
  border-top: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
}

.body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
button.name { all: unset; display: block; font-size: 16px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; cursor: pointer; }
button.name:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 2px; }
.type { display: inline-flex; align-items: center; gap: 6px; width: fit-content; font-size: 12px; color: var(--muted); }
.type::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--dot, #a1a1aa); }
.ctx { margin: 0; font-size: 12px; color: var(--muted); }
.details { margin: 0; font-size: 13px; color: var(--muted); }
.details div + div { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.details b { color: var(--text); font-weight: 500; }
.how { margin: 0; font-size: 13px; color: var(--text); padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.how a { color: var(--text); text-underline-offset: 2px; }
.how code { font: 500 12px var(--mono); }

.src { margin-top: auto; font-size: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.src a { color: var(--muted); text-decoration: none; transition: color .15s; }
.src a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.off { color: var(--ok); }

/* badges */
.status, .added {
  width: fit-content; display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; line-height: 1; padding: 4px 8px; border-radius: 999px;
}
.status.active { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.status.active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.upcoming { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.status.maybe { background: var(--surface-2); color: var(--muted); }
.status.unconfirmed { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--muted); cursor: help; }
.status.expired { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); text-decoration: line-through; }
.added { background: #c81e32; color: #fff; } /* fixed: white on --brand is too faint for small text */

.regions { display: flex; flex-wrap: wrap; gap: 4px; }
.region { font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 6px; border: 1px solid color-mix(in srgb, var(--info) 35%, transparent); color: var(--info); }

.also { font-size: 13px; color: var(--muted); padding: 8px 10px; border-radius: var(--radius-sm); border: 1px dashed var(--border-strong); }
.also-h { margin: 0 0 4px; font-size: 12px; font-weight: 600; color: var(--text); }
.also > div + div { margin-top: 6px; }
.also .where, .also b { color: var(--text); font-weight: 500; }

/* codes */
.codes { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.code-row code {
  font: 500 12px/1.4 var(--mono); padding: 3px 8px; border-radius: 6px; user-select: all; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.code-row .exp { color: var(--muted); font-size: 12px; }
.code-row.expired code { text-decoration: line-through; color: var(--dim); user-select: text; }
.code-row.expired .exp { color: var(--accent); }
.copy {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  border-radius: 6px; font: 500 12px/1 var(--sans); padding: 5px 9px; cursor: pointer; transition: background .15s;
}
.copy:hover { background: var(--surface-2); }

/* ---------- item dialog ---------- */
#item {
  width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--text);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
}
#item[open] { display: flex; animation: pop .18s ease; }
/* app.js focuses the dialog itself on open; it isn't a control, so no ring. */
#item:focus-visible { outline: none; }
#item::backdrop { background: var(--backdrop); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
#item-close {
  position: absolute; top: 12px; right: 12px; z-index: 2; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
  transition: color .15s, border-color .15s;
}
#item-close:hover { color: var(--text); border-color: var(--border-strong); }
#item-body { flex: 1; overflow: auto; max-height: calc(100vh - 48px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
.d-media {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 28px; min-height: 320px;
  background: var(--surface-2); border-right: 1px solid var(--border);
}
.d-main { max-width: 100%; max-height: 440px; object-fit: contain; }
.d-main.tall { max-height: 540px; border-radius: 6px; }
.d-wide { max-width: 100%; border-radius: 8px; }
.ptitle.big { font-size: 20px; padding: 14px 28px; }
.d-info { padding: 28px 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.d-info h2 { margin: 0; padding-right: 40px; font-size: 28px; line-height: 1.15; font-weight: 650; letter-spacing: -.03em; }
.d-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.d-badges:empty { display: none; }
.d-info .details, .d-info .also, .d-info .how { font-size: 14px; }
.d-info .ctx { font-size: 13px; }
.d-info .note { margin: 0; }
.d-info .src { margin-top: 6px; }
.d-info .src .lbl { color: var(--dim); }
.d-actions { margin-top: 4px; }
.d-actions .chip { color: var(--text); }

/* ---------- footer ---------- */
.empty { padding: 80px 0; text-align: center; color: var(--muted); font-size: 16px; }
.foot { margin-top: 72px; padding-top: 28px; padding-bottom: 48px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.foot h2 { margin: 0 0 10px; color: var(--text); font-size: 16px; font-weight: 600; }
.foot p { max-width: 90ch; }
.foot a { color: var(--text); text-underline-offset: 2px; }

/* ---------- small screens ---------- */
@media (max-width: 760px) {
  .links a:not(:first-child) { display: none; }
  .stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
  .stats:empty { min-height: 172px; }
}
@media (max-width: 680px) {
  .hero { padding: 28px 16px 28px; }
  /* one swipeable line per filter row instead of a tall wall of chips */
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
  .chips::-webkit-scrollbar { display: none; }
  .chips .lbl { min-width: 0; }
  .chip { padding: 6px 12px; }
  /* Cards stay short; tapping one opens the item view with the details, "Also from", sources and dates. */
  .card .details, .card .also, .card .src, .card .more { display: none; }
  .filter-row { display: block; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .thumb { height: 120px; padding: 10px; }
  .thumb img, .thumb.card-img img { max-height: 100px; }
  .body { padding: 10px 11px 12px; }
  button.name { font-size: 15px; }
  .ptitle { font-size: 11px; padding: 6px 8px; letter-spacing: .06em; }
  .cat > h2 { font-size: 20px; }
  .now { padding: 18px 12px 8px; margin-left: -6px; margin-right: -6px; }
  #item { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  #item-body { display: block; max-height: 100dvh; }
  .d-media { min-height: 220px; border-right: 0; border-bottom: 1px solid var(--border); }
  .d-main.tall { max-height: 360px; }
  .d-info { padding: 22px 18px; }
  .d-info h2 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- prerendered list (no-JS fallback, replaced by app.js) ---------- */
.plain-list { margin: 0; padding: 0; list-style: none; columns: 3 280px; column-gap: 28px; }
.plain-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.plain-list a { color: var(--text); text-decoration: none; font-weight: 500; }
.plain-list a:hover { text-decoration: underline; text-underline-offset: 2px; }
.plain-list span { color: var(--muted); font-size: 13px; }

/* ---------- 404 page ---------- */
.page-404 .top { min-height: 100vh; }
.nf { padding-top: 96px; padding-bottom: 120px; }
.nf .eyebrow::before { background: var(--accent); }
.nf .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 28px; }
.nf .actions a { text-decoration: none; padding: 6px 14px; }
