/* Over 9001. Mobile-first; light and dark follow the system setting. */

:root {
  --accent: #f28c28;            /* brand orange: fills, focus, highlights */
  --accent-strong: #b35a00;     /* orange text that passes contrast on light surfaces */
  --accent-soft: #fdebd8;
  --accent-contrast: #1a1a1a;
  --bg: #fafaf8;
  --surface: #ffffff;
  --surface-2: #f2f2ef;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --border: #e4e4e0;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 12px rgba(0, 0, 0, .04);
  --radius: 12px;
  --radius-card: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* rarity badges */
  --r-common: #8a8a90;
  --r-uncommon: #2f8f5b;
  --r-rare: #2f6fd6;
  --r-super: #8a3ad1;
  --r-special: #d1356b;
  --r-secret: #c7900c;
  --r-leader: #c4501c;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-strong: #ffad5c;
    --accent-soft: #3a2614;
    --bg: #121214;
    --surface: #1c1c1f;
    --surface-2: #26262a;
    --text: #f2f2f4;
    --muted: #a0a0a8;
    --border: #2e2e33;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

main { flex: 1; padding-block: 1.25rem 2rem; }
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: max(1rem, env(safe-area-inset-left)); }

a { color: var(--accent-strong); }
h1 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: 1.1rem; margin: 0 0 .75rem; }
code { font-family: var(--mono); font-size: .9em; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 .15rem; color: var(--accent-strong); font-weight: 700; font-size: .85rem; letter-spacing: .04em; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: -999px; top: .5rem; z-index: 10; background: var(--surface); padding: .5rem 1rem; border-radius: var(--radius); }
.skip-link:focus { left: 1rem; }
.js .js-hide { display: none; }
[hidden] { display: none !important; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand nav nav" "search search account";
  align-items: center;
  gap: .5rem 1rem;
  padding-block: .6rem;
}
.brand { grid-area: brand; color: var(--text); font-weight: 750; text-decoration: none; white-space: nowrap; }
@media (max-width: 380px) { .brand { font-size: .9rem; } .main-nav a { padding-inline: .45rem; } }
.brand img { display: inline-block; width: 1.35rem; height: 1.35rem; margin-right: .45rem; vertical-align: -.3em; }
.main-nav { grid-area: nav; display: flex; justify-content: flex-end; gap: .15rem; }
.main-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: .88rem; white-space: nowrap;
  padding: .3rem .6rem; border-radius: 999px;
}
.main-nav a:hover { color: var(--text); }
.main-nav a[aria-current] { color: var(--accent-contrast); background: var(--accent); }
.site-search { grid-area: search; }
.account-link {
  grid-area: account; justify-self: end; display: grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 .2rem;
  border-radius: 999px; background: var(--accent); color: var(--accent-contrast); font-weight: 750; text-decoration: none;
}
.account-link--signin { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); padding: 0 .9rem; font-weight: 600; font-size: .9rem; }
.account-link[aria-current] { outline: 3px solid var(--accent-soft); }

input[type="search"], select {
  font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  min-height: 2.5rem; padding: .4rem .75rem;
}
input[type="search"] { width: 100%; }
select { padding-right: 2rem; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1rem) 55%, calc(100% - .7rem) 55%;
  background-size: .3rem .3rem; background-repeat: no-repeat;
}

.button {
  font: inherit; font-weight: 600; cursor: pointer;
  min-height: 2.5rem; padding: .4rem 1rem;
  color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.button:hover { border-color: var(--muted); }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

.site-footer { color: var(--muted); font-size: .8rem; padding-block: 1.5rem; border-top: 1px solid var(--border); }

.notice { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.25rem; }
.notice p { margin: .5rem 0 0; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .88rem; color: var(--muted); margin-bottom: .75rem; }
.breadcrumb a { color: var(--muted); }

/* ---------- home ---------- */

.game-tiles { display: grid; gap: 1rem; }
.game-tile {
  display: flex; flex-direction: column; gap: .75rem;
  min-height: 9rem; padding: 1.25rem;
  color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.game-tile::after {
  content: ""; position: absolute; right: -2.5rem; top: -2.5rem; width: 8rem; height: 8rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffd27a, var(--accent) 60%, #c8620a); opacity: .9;
}
.game-tile:hover { border-color: var(--accent); }
.game-tile__name { font-size: 1.4rem; font-weight: 750; position: relative; z-index: 1; }
/* Stacked one per line, so the counts stay clear of the corner ball at any width; text always paints above the ball. */
.game-tile > * { position: relative; z-index: 1; }
.game-tile__stats { display: flex; flex-direction: column; gap: .15rem; color: var(--muted); font-size: .92rem; }
.game-tile__stats strong { color: var(--text); }

/* ---------- game page: series of set tiles ---------- */

.series { margin-bottom: 1.75rem; }
.set-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.set-tile {
  display: flex; align-items: center; gap: .8rem; height: 100%;
  padding: .6rem; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.set-tile:hover { border-color: var(--accent); }
.set-tile--empty { opacity: .6; }
.set-tile__art {
  flex: none; width: 3.75rem; height: 3.75rem; display: grid; place-items: center;
  border-radius: 10px; background: var(--accent-soft); overflow: hidden;
}
.set-tile__art img { width: 100%; height: 100%; object-fit: contain; }
.set-tile__code-art { font-weight: 800; font-size: .8rem; color: var(--accent-strong); letter-spacing: .02em; }
.set-tile__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.set-tile__code { font-size: .75rem; font-weight: 700; color: var(--accent-strong); }
.set-tile__name { font-weight: 600; line-height: 1.25; }
.set-tile__count { font-size: .8rem; color: var(--muted); }

/* ---------- set page ---------- */

.page-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.page-head h1 { margin-bottom: .2rem; }
.page-head p { margin: 0; }
.page-head__art { width: 4.5rem; height: 4.5rem; object-fit: contain; }

.set-controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .5rem; }
.selects { display: flex; flex-wrap: wrap; gap: .5rem; }

.segmented { display: inline-flex; border: 0; padding: 3px; margin: 0; background: var(--surface-2); border-radius: 12px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span { display: block; padding: .4rem .85rem; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.segmented small { font-weight: 500; opacity: .8; }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 1px; }

.result-count { font-size: .85rem; margin: .25rem 0 .75rem; }

.card-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .9rem .6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card-tile a { display: flex; flex-direction: column; gap: .2rem; color: var(--text); text-decoration: none; }
.card-tile__img {
  position: relative; display: block; aspect-ratio: 300 / 419;
  border-radius: var(--radius-card); overflow: hidden; background: var(--surface-2);
  box-shadow: var(--shadow); transition: transform .15s ease;
}
.card-tile a:hover .card-tile__img { transform: translateY(-2px); }
.card-tile__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-tile__placeholder {
  display: grid; place-items: center; width: 100%; height: 100%; aspect-ratio: 300 / 419;
  font-family: var(--mono); font-size: .75rem; color: var(--muted); border-radius: var(--radius-card); background: var(--surface-2);
}
.card-tile--foil .card-tile__img::after {
  /* same-art foil: the base image with a holo sheen */
  content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay; opacity: .55;
  background: linear-gradient(125deg, transparent 20%, rgba(255, 120, 200, .7) 35%, rgba(120, 220, 255, .7) 50%, rgba(255, 240, 120, .7) 65%, transparent 80%);
}
.variant-badge {
  position: absolute; left: .3rem; bottom: .3rem;
  font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  padding: .1rem .35rem; border-radius: 6px; color: #fff; background: rgba(0, 0, 0, .65);
}
.card-tile__meta { display: flex; align-items: center; justify-content: space-between; gap: .25rem; margin-top: .2rem; }
.card-tile__number { font-family: var(--mono); font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tile__name { font-size: .8rem; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-tile__set { font-size: .72rem; color: var(--muted); }

.rarity {
  flex: none; font-size: .62rem; font-weight: 800; letter-spacing: .02em; line-height: 1;
  padding: .2rem .35rem; border-radius: 5px; color: #fff; background: var(--r-common);
}
.rarity--uc { background: var(--r-uncommon); }
.rarity--r { background: var(--r-rare); }
.rarity--sr { background: var(--r-super); }
.rarity--spr, .rarity--pr { background: var(--r-special); }
.rarity--scr, .rarity--gdr, .rarity--slr, .rarity--ivr { background: var(--r-secret); }
.rarity--l { background: var(--r-leader); }

.empty-filter { margin-top: 1rem; }

/* ---------- collection: owned / missing ---------- */

button.card-tile__img { display: block; width: 100%; padding: 0; border: 0; font: inherit; cursor: pointer; text-align: left; }
.own-form { margin: 0; }
.card-tile__text { margin-top: .2rem; }
.card-tile--missing .card-tile__img img { filter: grayscale(.85) brightness(1.05); opacity: .45; transition: opacity .15s ease, filter .15s ease; }
.card-tile--missing .card-tile__img:hover img { opacity: .7; }
.own-check {
  position: absolute; top: .3rem; right: .3rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .9); background: rgba(0, 0, 0, .35); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.card-tile--owned .own-check { background: var(--accent); border-color: #fff; }
.card-tile--owned .own-check::after {
  content: ""; position: absolute; left: .42rem; top: .2rem; width: .38rem; height: .7rem;
  border: solid var(--accent-contrast); border-width: 0 .17rem .17rem 0; transform: rotate(45deg);
}

.progress { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.progress__text { font-size: .88rem; color: var(--muted); }
.progress__text strong { color: var(--text); }
.progress__bar { display: block; height: .5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress__bar > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .25s ease; }
.progress--done .progress__bar > span { background: var(--accent-strong); }
/* A set whose master tier is complete: gold. */
.progress--gold .progress__bar > span { background: linear-gradient(90deg, #f7d774, #e0a312 55%, #c98a00); }
.progress--gold .progress__text strong { color: #a87400; }
@media (prefers-color-scheme: dark) { .progress--gold .progress__text strong { color: #f2c94c; } }
.progress--compact .progress__text { font-size: .75rem; }
.progress--compact .progress__bar { height: .35rem; }
.set-progress { margin: 0 0 1rem; max-width: 32rem; }
.signin-hint { margin: -.25rem 0 1rem; font-size: .9rem; }

/* ---------- forms, account, stats ---------- */

.auth-card { max-width: 24rem; margin: 1rem auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.stack-form { display: flex; flex-direction: column; gap: .9rem; margin: 1rem 0; }
.stack-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; }
.stack-form input {
  font: inherit; font-weight: 400; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; min-height: 2.75rem; padding: .5rem .75rem;
}
.form-error { color: #b42318; background: color-mix(in srgb, #b42318 10%, transparent); border-radius: 10px; padding: .6rem .8rem; }
.form-notice { color: #027a48; background: color-mix(in srgb, #027a48 10%, transparent); border-radius: 10px; padding: .6rem .8rem; }
@media (prefers-color-scheme: dark) { .form-error { color: #ff8a80; } .form-notice { color: #6ce9a6; } }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 0 0 1rem; }
.panel h2 a { color: inherit; text-decoration: none; }
.account-details { margin-bottom: 1.25rem; }

.segmented--links { margin-bottom: 1rem; }
.segmented--links a { text-decoration: none; }
.segmented--links span { display: block; padding: .4rem .85rem; border-radius: 9px; font-weight: 600; font-size: .92rem; color: var(--muted); }
.segmented--links a[aria-current] span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.stats-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: .9rem; }
.stats-table th, .stats-table td { text-align: left; padding: .5rem .25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.stats-table thead th { color: var(--muted); font-weight: 600; font-size: .8rem; }
.stats-table td:last-child { width: 55%; }
.own-toggle { font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer; border-radius: 999px; padding: .2rem .55rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.own-toggle[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.printing-list li { display: flex; flex-direction: column; gap: .3rem; }
.rarity-stats { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .88rem; }
.set-tile__progress { display: block; margin-top: .3rem; }
.set-tile__progress .progress { width: 100%; }
.game-tile .progress { position: relative; z-index: 1; max-width: 18rem; }

/* ---------- card page ---------- */

.card-detail { display: grid; gap: 1.25rem; }
.card-detail__figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.card-detail__image { width: min(80%, 22rem); }
.card-detail__image img { width: 100%; border-radius: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); display: block; }
.card-detail__info h1 { margin-bottom: .75rem; }

.details { display: grid; gap: 0; margin: 0 0 1.5rem; border-top: 1px solid var(--border); }
.details div { display: grid; grid-template-columns: 6.5rem 1fr; gap: .5rem; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.details dt { color: var(--muted); font-size: .9rem; }
.details dd { margin: 0; font-weight: 600; }

.printing-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); }
.printing-list a {
  display: flex; flex-direction: column; align-items: flex-start; gap: .25rem;
  padding: .35rem; border: 2px solid transparent; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: .78rem; font-weight: 600;
}
.printing-list a[aria-current] { border-color: var(--accent); background: var(--accent-soft); }
.printing-list img { border-radius: 6px; }

/* ---------- search ---------- */

.search-form { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.search-form input { flex: 1 1 14rem; }

/* ---------- set intro and guide ---------- */

.set-intro { max-width: 46rem; margin: -.25rem 0 1.1rem; color: var(--muted); font-size: .92rem; }
.guide { max-width: 44rem; }
.guide h2 { margin-top: 1.75rem; }
.guide__lead { font-size: 1.08rem; }
.guide__next { margin-top: 2rem; }
.table-wrap { overflow-x: auto; }
.guide-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.guide-table th, .guide-table td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.guide-table thead th { color: var(--muted); font-weight: 600; }

/* ---------- error ---------- */

.error-page { text-align: center; padding-block: 3rem; }
.error-code { color: var(--accent-strong); font-size: 3rem; font-weight: 700; margin: 0; }

/* ---------- larger screens ---------- */

@media (min-width: 640px) {
  h1 { font-size: 1.85rem; }
  .game-tiles { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 1.1rem .9rem; }
  .card-tile__name { font-size: .85rem; }
}

@media (min-width: 820px) {
  .header-inner { grid-template-columns: auto auto 1fr auto; grid-template-areas: "brand nav search account"; }
  .main-nav { justify-content: flex-start; }
  .site-search { justify-self: end; width: min(100%, 20rem); }
  .card-detail { grid-template-columns: minmax(0, 24rem) 1fr; align-items: start; gap: 2.5rem; }
  .card-detail__image { width: 100%; }
  .card-detail__figure { position: sticky; top: 5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

.game-progress { max-width: 32rem; margin: -.25rem 0 1.5rem; }
.game-progress .segmented--links { margin-bottom: .75rem; }

/* ---------- admin ---------- */
.table-scroll { overflow-x: auto; }
.admin-table th[scope="row"] { white-space: nowrap; }
.admin-table td:last-child { width: auto; white-space: nowrap; }
.art-pairs { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.art-pair { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; }
.art-pair__images { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.art-pair figure { margin: 0; }
.art-pair img { border-radius: var(--radius-card); display: block; }
.art-pair figcaption { font-family: var(--mono); font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.art-pair__meta { font-size: .82rem; margin: .5rem 0; }
.art-pair__actions { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- latest ---------- */
.latest-intro { margin-top: -.5rem; }
.latest-section { margin: 1.75rem 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .5rem; }
.section-head h2 { margin: 0; }
.latest-section h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.near-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .75rem 0; }
.near-form label { font-weight: 600; }
.near-form input { flex: 1 1 14rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin: .25rem 0 .75rem; }
.chips a { text-decoration: none; font-size: .85rem; font-weight: 600; color: var(--muted); padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); }
.chips a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.chip { display: inline-block; font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); vertical-align: middle; }
.chip--game { background: var(--accent-soft); color: var(--accent-strong); }
.event-list, .news-list, .podcast-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.event, .news-list li, .podcast-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.event { display: flex; gap: .9rem; align-items: flex-start; }
.event__distance { flex: none; min-width: 3.6rem; text-align: center; font-weight: 750; color: var(--accent-strong); background: var(--accent-soft); border-radius: 10px; padding: .45rem .3rem; font-size: .9rem; }
.event__date, .news__meta { margin: 0 0 .2rem; font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.event__title, .news__title { font-weight: 650; color: var(--text); text-decoration: none; line-height: 1.3; }
.event__title:hover, .news__title:hover { text-decoration: underline; }
.event__summary, .news__summary { margin: .3rem 0 0; font-size: .88rem; }
.event__venue { margin: .25rem 0 0; font-size: .85rem; color: var(--muted); }
.event__tags { margin: .25rem 0 0; font-size: .78rem; }
.event details { margin-top: .4rem; font-size: .85rem; }
.event summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; }
.venues { margin: .4rem 0 0; padding-left: 1rem; display: grid; gap: .25rem; }
.video-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.video-grid a { display: flex; flex-direction: column; gap: .3rem; color: var(--text); text-decoration: none; }
.video-grid img { aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); width: 100%; }
.video__title { font-weight: 600; font-size: .9rem; line-height: 1.3; }
.video__meta { font-size: .78rem; }
.podcast-list li { display: flex; gap: .8rem; align-items: center; }
.podcast-list img { width: 3.5rem; height: 3.5rem; border-radius: 10px; flex: none; }
.latest-credit { font-size: .8rem; margin-top: 2rem; }

.game-tiles { grid-template-columns: 1fr; }
@media (min-width: 640px) { .game-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .game-tiles { grid-template-columns: repeat(3, 1fr); } }
.game-tile__lines { display: flex; flex-direction: column; gap: .45rem; font-size: .88rem; color: var(--muted); position: relative; z-index: 1; }
/* The first line sits level with the corner ball: keep it clear of it. */
.game-tile__lines > :first-child { padding-right: 3.75rem; }
.game-tile__lines strong { color: var(--accent-strong); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; display: block; }

.deck-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin: -.25rem 0 1rem; font-size: .85rem; }

/* ---------- statistics ---------- */
:root {
  /* rarity tiers: one hue, common (light) to rarest (dark); validated ordinal ramp */
  --tier-1: #86b6ef; --tier-2: #5598e7; --tier-3: #2a78d6; --tier-4: #1c5cab; --tier-5: #104281;
  --chart-line: var(--accent-strong);
  --chart-area: color-mix(in srgb, var(--accent) 16%, transparent);
  --chart-grid: var(--border);
}
@media (prefers-color-scheme: dark) {
  :root { --tier-1: #b7d3f6; --tier-2: #86b6ef; --tier-3: #5598e7; --tier-4: #2a78d6; --tier-5: #1c5cab; }
}
@media (min-width: 960px) { .game-tiles { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .game-tiles { grid-template-columns: repeat(4, 1fr); } }
.stats-part { margin: 1.75rem 0 .75rem; font-size: 1.25rem; }
.stats-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); margin-bottom: 1rem; }
.stats-grid > .panel { margin: 0; }
.panel h3 { font-size: 1rem; margin: 0 0 .6rem; }
.panel h4 { font-size: .9rem; margin: 1.25rem 0 .4rem; }
.panel details summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; font-size: .85rem; margin-top: .6rem; }
.small { font-size: .8rem; }
.stats-table caption { text-align: left; font-weight: 650; font-size: .85rem; padding-bottom: .3rem; }
.rank-table td:first-of-type { width: 6rem; white-space: nowrap; }
.rank-table td:last-child { width: 45%; }
.compare-table td, .compare-table th { white-space: nowrap; }
.compare-table td.with-bar { min-width: 9rem; }
.hbar { display: inline-block; vertical-align: middle; width: 100%; max-width: 12rem; height: .5rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.with-bar .hbar { width: 6rem; margin-left: .35rem; }
.hbar > span { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.closest { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.closest a { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; color: var(--text); margin-bottom: .25rem; }
.closest__missing { font-weight: 750; color: var(--accent-strong); white-space: nowrap; }
.closest__name { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-grid--small { grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr)); gap: .7rem .5rem; }
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart__grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart__tick { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart__area { fill: var(--chart-area); }
.chart__line { fill: none; stroke: var(--chart-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart__point { fill: var(--chart-line); stroke: var(--surface); stroke-width: 2; cursor: default; }
.chart__point:hover, .chart__point:focus { r: 6; outline: none; }
.legend { list-style: none; padding: 0; margin: 0 0 .6rem; display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .8rem; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: .35rem; }
.swatch { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }
.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); }
.mix { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.mix li { display: grid; grid-template-columns: 3.5rem 1fr; align-items: center; gap: .5rem; font-size: .8rem; }
.mix__label { font-family: var(--mono); color: var(--muted); }
.mix__bar { display: flex; gap: 2px; height: .9rem; }
.mix__bar > span { min-width: 2px; }
.mix__bar > span:first-child { border-radius: 4px 0 0 4px; }
.mix__bar > span:last-child { border-radius: 0 4px 4px 0; }
.tooltip { position: fixed; z-index: 20; pointer-events: none; background: var(--text); color: var(--bg); font-size: .78rem; font-weight: 600;
  padding: .3rem .55rem; border-radius: 6px; box-shadow: var(--shadow); max-width: 18rem; transform: translate(-50%, calc(-100% - 10px)); }

.chart { max-width: 46rem; }
@media (max-width: 640px) { .chart__tick { font-size: 20px; } .chart__line { stroke-width: 3; } }
.rank-table th { white-space: nowrap; }

.goal { margin: -.5rem 0 1rem; font-size: .9rem; }
.tier-choice { border: 0; padding: 0; margin: .5rem 0 1rem; display: grid; gap: .5rem; }
.tier-option { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 400; }
.tier-option input { margin-top: .25rem; accent-color: var(--accent); }
.tier-option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.tier-option__body { display: flex; flex-direction: column; gap: .15rem; font-size: .88rem; }
.tier-option__body strong { font-size: .95rem; }
.field-group { display: flex; flex-direction: column; gap: .3rem; }
.field-label { font-weight: 600; font-size: .92rem; }
.stack-form .tier-option { flex-direction: row; font-weight: 400; }

.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; }
.footer-links { display: flex; gap: 1rem; }
.footer-links a { color: var(--muted); }
.feedback-card { max-width: 34rem; }
.stack-form textarea { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; resize: vertical; font-weight: 400; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.admin-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.feedback-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: .75rem; }
.feedback-list .panel { margin: 0; }
.feedback__title { font-size: 1.05rem; margin: .2rem 0 .4rem; }
.feedback__body { margin: 0 0 .75rem; white-space: normal; font-size: .92rem; }
.feedback__status { display: flex; flex-wrap: wrap; gap: .4rem; }
.feedback__status .button { min-height: 2.1rem; padding: .25rem .75rem; font-size: .85rem; }
.chip--bug { background: color-mix(in srgb, #d03b3b 15%, transparent); color: #b42318; }
@media (prefers-color-scheme: dark) { .chip--bug { color: #ff8a80; } }

/* ---------- profiles & sharing ---------- */
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.profile-head h1 { margin: 0 0 .15rem; }
.profile-head p { margin: 0; }
.profile-avatar { flex: none; width: 3.5rem; height: 3.5rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-contrast); font-weight: 800; font-size: 1.5rem; }
.profile-sets { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: .6rem; }
.profile-sets a { color: var(--text); text-decoration: none; font-size: .9rem; display: block; margin-bottom: .2rem; }
.profile-banner { margin-bottom: 1rem; }
.handle-field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .92rem; margin-bottom: .9rem; }
.handle-input { display: flex; align-items: center; gap: .3rem; }
.handle-input input, .share-url { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; min-height: 2.5rem; padding: .4rem .75rem; flex: 1; min-width: 0; font-weight: 400; }
.share-url { width: 100%; margin: .3rem 0 .4rem; font-family: var(--mono); font-size: .8rem; }
.share-links { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.near-form input[type="text"] { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; min-height: 2.5rem; padding: .4rem .75rem; flex: 1 1 12rem; }

.set-tile--skipped { opacity: .5; border-style: dashed; }
.skip-form { display: inline; margin: 0; }
.link-button { font: inherit; background: none; border: 0; padding: 0; color: var(--accent-strong); text-decoration: underline; cursor: pointer; }
.skip-row { font-size: .85rem; margin: -.5rem 0 1rem; }
.skip-banner { margin-bottom: 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.skip-banner p { margin: 0; }

/* ---------- admin analytics ---------- */
.panel-title { font-size: 1rem; margin: 0 0 .6rem; }
.kpis { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.kpi__value { font-size: 1.5rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.kpi__label { font-size: .8rem; color: var(--muted); }
.chart__line--alt { stroke: var(--tier-4); }
.chart__point--alt { fill: var(--tier-4); }
.chart__band { fill: transparent; }
.chart__band:hover, .chart__band:focus { fill: color-mix(in srgb, var(--text) 6%, transparent); outline: none; }
.swatch--main { background: var(--chart-line); }
.swatch--alt { background: var(--tier-4); }
.row-highlight th, .row-highlight td { background: var(--accent-soft); }
.chip--ai { background: var(--accent-soft); color: var(--accent-strong); }
.crawler-table td, .crawler-table th { vertical-align: top; }
.crawler-paths { white-space: normal !important; font-size: .8rem; min-width: 14rem; }
.privacy { max-width: 42rem; }

/* ---------- card zoom (enlarge without ticking) ---------- */
.card-tile { position: relative; }
/* .card-tile .card-zoom beats the generic ".card-tile a" (a flex column with a gap), which would pull the icon off centre. */
.card-tile .card-zoom {
  position: absolute; top: .3rem; left: .3rem; z-index: 2;
  display: grid; place-items: center; gap: 0; padding: 0; line-height: 0; box-sizing: border-box;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  color: #fff; background: rgba(0, 0, 0, .55); box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  opacity: .85; transition: opacity .15s ease, transform .15s ease;
}
.card-tile .card-zoom:hover, .card-tile .card-zoom:focus-visible { opacity: 1; transform: scale(1.08); }
/* A bigger tap target than it looks. */
.card-tile .card-zoom::before { content: ""; position: absolute; inset: -.45rem; }
.zoom-dialog {
  border: 0; padding: 0; background: transparent; max-width: min(92vw, 30rem); width: 100%;
  color: #fff; overflow: visible;
}
.zoom-dialog::backdrop { background: rgba(10, 10, 12, .82); backdrop-filter: blur(2px); }
.zoom-dialog img { display: block; width: 100%; height: auto; max-height: 80vh; object-fit: contain; border-radius: 4.5% / 3.2%; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.zoom-dialog__bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .6rem; font-size: .9rem; }
.zoom-dialog__bar a { color: #fff; }
.zoom-dialog__nav { display: flex; gap: .4rem; }
.zoom-dialog button {
  font: inherit; color: #fff; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 999px; padding: .3rem .75rem; cursor: pointer;
}
.zoom-dialog button:hover { background: rgba(255, 255, 255, .24); }
.zoom-dialog__close { position: absolute; top: -.6rem; right: -.6rem; width: 2.2rem; height: 2.2rem; padding: 0 !important; font-size: 1.2rem; line-height: 1; background: rgba(20, 20, 24, .9) !important; }
