/* ============================================================
   TopDeck Society — site styles
   One system: ink surfaces, one volt green for actions, teal/red
   reserved for price direction, game colours only as identity marks.
   Light and dark. Numbers are always tabular.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0b0c10;
  --bg-2: #0f1117;
  --surface: #14161e;
  --surface-2: #1b1e29;
  --line: #242836;
  --line-2: #343a4d;
  --text: #f2f3f7;
  --text-2: #a9afbf;
  --text-3: #737a90;
  /* Volt. --brand fills (buttons, bars); --brand-text is the same colour where it has to be read as text;
     --brand-mark is the logo's stem. On dark all three are one colour; light needs darker greens to stay legible. */
  --brand: #c8f53c;
  --brand-hover: #d8fb6a;
  --brand-ink: #0b0c10;
  --brand-text: #c8f53c;
  --brand-mark: #c8f53c;
  --brand-soft: rgba(200, 245, 60, 0.12);
  /* "up" leans teal so it is never mistaken for the brand colour */
  --up: #2fd6b5;
  --up-soft: rgba(47, 214, 181, 0.13);
  --down: #ff6b78;
  --down-soft: rgba(255, 107, 120, 0.13);
  --gold: #f2c14e;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  --art-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);

  --font-display: "Tektur", "Archivo", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --wrap: 1240px;
  --pad: 24px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f4ef;
  --bg-2: #eeede7;
  --surface: #ffffff;
  --surface-2: #f6f5f0;
  --line: #e2e0d7;
  --line-2: #cbc8bc;
  --text: #15171c;
  --text-2: #4f5565;
  --text-3: #7c8291;
  --brand: #c3ef36;
  --brand-hover: #b2e01f;
  --brand-ink: #15171c;
  --brand-text: #416f00;
  --brand-mark: #5f9a00;
  --brand-soft: rgba(110, 160, 0, 0.13);
  --up: #00826c;
  --up-soft: rgba(0, 130, 108, 0.1);
  --down: #cc3040;
  --down-soft: rgba(204, 48, 64, 0.09);
  --gold: #a67400;
  --shadow: 0 10px 28px rgba(30, 28, 20, 0.09);
  --art-shadow: 0 8px 22px rgba(30, 28, 20, 0.22);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: 0; line-height: 1.1; }
h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; }
h2 { font-size: 21px; font-weight: 750; }
h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
.eyebrow { font-size: 11.5px; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 22px; height: 60px; }
.logo { font-family: var(--font-display); font-weight: 800; font-size: 18px; letter-spacing: 0; display: flex; align-items: center; gap: 9px; flex: none; }
.logo-mark { display: grid; place-items: center; }
.logo em { font-style: normal; color: var(--brand-text); }
.menus { display: flex; gap: 2px; }
.menu { position: relative; }
.menu > button { height: 36px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 14.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.menu > button:hover, .menu.open > button, .menu.here > button { color: var(--text); background: var(--surface-2); }
.menu > button svg { opacity: 0.6; transition: transform 0.15s; }
.menu.open > button svg { transform: rotate(180deg); }
.menu-panel { position: absolute; top: 44px; left: 0; width: 318px; padding: 8px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: var(--shadow); display: none; }
.menu.open .menu-panel { display: block; }
.menu-panel a { display: block; padding: 10px 12px; border-radius: 9px; }
.menu-panel a:hover { background: var(--surface-2); }
.menu-panel b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.menu-panel span { display: block; font-size: 13px; color: var(--text-3); margin-top: 1px; }
.search-btn { flex: 1 1 0; min-width: 38px; max-width: 430px; margin-left: auto; height: 38px; padding: 0 12px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--text-3); font-size: 14px; text-align: left; }
.search-btn:hover { border-color: var(--line-2); color: var(--text-2); }
.search-btn span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
kbd { font: 600 11px/1 var(--font-body); padding: 4px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--text-3); }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); border: 1px solid var(--line); background: var(--surface); flex: none; }
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

.gamebar { display: flex; gap: 6px; padding-top: 9px; padding-bottom: 9px; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.gamebar::-webkit-scrollbar { display: none; }
.formats { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; }
.formats::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px 0 6px; display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 550; color: var(--text-2); }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.on { color: var(--text); border-color: var(--text-3); background: var(--surface-2); }
.chip.all { padding: 0 14px; }

/* game identity mark: the only place game colours appear */
.mark { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border-radius: 5px; background: var(--g, var(--brand)); color: #0b0c10; font: 800 9.5px/1 var(--font-display); letter-spacing: 0.03em; flex: none; }
.mark.lg { min-width: 46px; height: 46px; border-radius: 12px; font-size: 15px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 10px; font-weight: 650; font-size: 14.5px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); white-space: nowrap; }
.btn:hover { border-color: var(--text-3); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.link { color: var(--brand-text); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.link:hover { text-decoration: underline; }

/* ---------- page furniture ---------- */
main.wrap { padding-top: 30px; padding-bottom: 80px; min-height: 70vh; }
.lede { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.lede p.sub { color: var(--text-2); font-size: 16px; margin-top: 10px; max-width: 62ch; }
.lede .eyebrow { margin-bottom: 10px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-3); margin-bottom: 14px; }
.crumbs a:hover { color: var(--text); }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head p { color: var(--text-3); font-size: 13.5px; margin-top: 5px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head > div { min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; }
.panel-head h2 { font-size: 17px; }
.panel-foot { padding: 11px 18px 13px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 12.5px; color: var(--text-3); }
.panel-body { padding: 0 18px 18px; }

.grid-home { display: grid; grid-template-columns: 1.15fr 1.15fr 0.9fr; gap: 16px; align-items: start; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.grid-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.grid-home > *, .grid-2 > *, .grid-even > *, .stack > * { min-width: 0; }
.sub-line { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.meta-grid { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.deck-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }

.stats { display: flex; gap: 10px; flex-wrap: wrap; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 16px 12px; min-width: 118px; }
.stat b { display: block; font: 800 22px/1.15 var(--font-display); letter-spacing: 0; }
.stat span { font-size: 12px; color: var(--text-3); }

/* segmented control + tabs */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 9px; }
.seg button { height: 28px; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 26px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button, .tabs a { flex: none; padding: 11px 14px 12px; font-weight: 600; font-size: 14.5px; color: var(--text-3); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover, .tabs a:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-color: var(--brand-text); }
.subnav { position: sticky; top: 104px; z-index: 20; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); }

/* ---------- rows ---------- */
.rows { display: grid; }
.row { display: grid; align-items: center; gap: 12px; padding: 10px 18px; border-top: 1px solid var(--line); min-height: 60px; }
a.row:hover, .row.click:hover { background: var(--surface-2); }
.row-card { grid-template-columns: 34px minmax(0, 1fr) auto; }
.row-result { grid-template-columns: 46px minmax(0, 1fr) auto; }
.row-release { grid-template-columns: 46px minmax(0, 1fr); }
.thumb { width: 34px; aspect-ratio: 63 / 88; border-radius: 3px; background: var(--surface-2); object-fit: contain; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }
.t1 { display: block; font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t2 { font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; }
.t2 > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.price { font-weight: 650; font-size: 14.5px; text-align: right; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 650; padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.delta.up { color: var(--up); background: var(--up-soft); }
.delta.down { color: var(--down); background: var(--down-soft); }
.delta.flat { color: var(--text-3); background: var(--surface-2); }
.delta small { font-weight: 550; opacity: 0.8; font-size: 11px; }
.datebox { width: 46px; height: 46px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-content: center; text-align: center; line-height: 1.05; }
.datebox b { font: 800 17px/1 var(--font-display); }
.datebox span { font-size: 10px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.place { font-weight: 650; font-size: 13px; color: var(--text-2); text-align: right; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 650; letter-spacing: 0.03em; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); background: transparent; }

/* ---------- game tiles ---------- */
.games { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.game-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; position: relative; overflow: hidden; }
.game-tile::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--g); opacity: 0.9; }
.game-tile:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.game-tile { transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.game-tile header { display: flex; align-items: center; gap: 10px; }
.game-tile dl { margin: 0; display: grid; gap: 7px; font-size: 13px; }
.game-tile dl div { display: flex; justify-content: space-between; gap: 10px; }
.game-tile dt { color: var(--text-3); flex: none; }
.game-tile dd { margin: 0; min-width: 0; font-weight: 600; display: flex; justify-content: flex-end; align-items: center; gap: 6px; white-space: nowrap; }
.game-tile dd > :first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.game-tile dd > :not(:first-child) { flex: none; }

/* ---------- meta bars ---------- */
.metabar { padding: 14px 18px 16px; border-top: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.metabar-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; }
.metabar-top b { display: flex; align-items: center; gap: 9px; font-size: 14.5px; }
.stackbar { display: flex; height: 26px; border-radius: 7px; overflow: hidden; gap: 2px; }
.stackbar i { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; }
.legend b { font-weight: 650; color: var(--text); }

/* ---------- chase rail ---------- */
/* a card picture is img.art; a deck picture (deckArt in src/render.js) is span.art further down. "img.art" keeps the card portrait
   where the deck rule would make it a wide 16:10 window. */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 178px; gap: 14px; overflow-x: auto; padding: 4px 2px 16px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.rail-card { scroll-snap-align: start; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 10px; min-width: 0; }
img.art { width: 100%; aspect-ratio: 63 / 88; border-radius: 4.6% / 3.3%; object-fit: contain; background: var(--surface-2); box-shadow: var(--art-shadow); transition: transform 0.2s; }
.rail-card:hover .art { transform: translateY(-4px) rotate(-1deg); }
.rail-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.right, td.right { text-align: right; }
th button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; display: inline-flex; gap: 5px; align-items: center; }
th button:hover, th[aria-sort] button { color: var(--text); }
td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td, tbody tr.sel td { background: var(--surface-2); }
td:first-child, th:first-child { padding-left: 18px; }
td:last-child, th:last-child { padding-right: 18px; }
.rank { color: var(--text-3); width: 34px; }
.cell-card { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cell-card .thumb { width: 30px; }
.bar { display: flex; align-items: center; gap: 10px; min-width: 120px; }
.bar i { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; display: block; }
.bar i u { display: block; height: 100%; border-radius: 99px; background: var(--brand); text-decoration: none; }
.bar b { width: 46px; text-align: right; font-weight: 650; }
.wr { display: inline-flex; align-items: center; gap: 8px; }
.wr b { font-weight: 650; }
.wr.good b { color: var(--up); }
.wr.bad b { color: var(--down); }
.whisker { position: relative; width: 74px; height: 12px; }
.whisker::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.whisker i { position: absolute; top: 5px; height: 2px; background: var(--text-3); border-radius: 2px; }
.whisker u { position: absolute; top: 2px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--text); }
.spark { width: 96px; height: 30px; display: block; }
.spark path { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }

/* ---------- scatter + matchups ---------- */
.scatter { width: 100%; height: auto; display: block; }
.scatter text { font: 600 11px var(--font-body); fill: var(--text-2); }
.scatter .axis { font-weight: 500; fill: var(--text-3); font-size: 10.5px; }
.scatter .dot { cursor: pointer; }
.scatter .dot:hover circle { stroke: var(--text); stroke-width: 2; }
.matrix { border-collapse: separate; border-spacing: 3px; font-size: 12.5px; width: auto; min-width: 100%; }
.matrix th, .matrix td { border: 0; padding: 0; }
.matrix thead th { height: 112px; vertical-align: bottom; text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 600; color: var(--text-2); }
.matrix thead th div { writing-mode: vertical-rl; transform: rotate(200deg); white-space: nowrap; max-height: 108px; overflow: hidden; text-overflow: ellipsis; margin: 0 auto; }
.matrix tbody th { text-align: right; padding-right: 10px; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--text); text-transform: none; letter-spacing: 0; max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.matrix td { width: 54px; min-width: 54px; height: 44px; text-align: center; border-radius: 6px; background: var(--surface-2); line-height: 1.15; }
.matrix td b { display: block; font-weight: 700; font-size: 13px; }
.matrix td small { font-size: 10px; opacity: 0.75; }
.matrix td.self { background: transparent; color: var(--text-3); }
.matrix td.thin { opacity: 0.45; }
.matrix tbody tr:hover th { color: var(--brand-text); }

/* ---------- deck detail ---------- */
.deck-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.deck-pick button { height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 550; color: var(--text-2); }
.deck-pick button:hover { color: var(--text); border-color: var(--line-2); }
.deck-pick button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.group-label { padding: 14px 18px 6px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); display: flex; justify-content: space-between; }
.list-line { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; padding: 6px 18px; font-size: 14px; align-items: center; }
.list-line:hover { background: var(--surface-2); }
.list-line .q { font-weight: 700; color: var(--text-2); }
.list-line .p { color: var(--text-3); font-size: 13px; }
.cost { display: flex; align-items: baseline; gap: 10px; padding: 4px 18px 14px; }
.cost b { font: 800 30px/1 var(--font-display); letter-spacing: 0; }

/* ---------- card page ---------- */
.card-page { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 44px; align-items: start; }
.card-art { position: sticky; top: 124px; }
.card-art .art { box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45); }
.card-art img.art.sealed { aspect-ratio: auto; height: auto; border-radius: 10px; background: none; }      /* a box, tin or bundle photo: its own shape */
.card-art .note { margin-top: 16px; font-size: 13.5px; color: var(--text-2); padding: 12px 14px; border-left: 2px solid var(--brand-text); background: var(--brand-soft); border-radius: 0 9px 9px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.bigprice { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.bigprice b { font: 800 50px/0.95 var(--font-display); letter-spacing: -0.01em; }
.pricebox { padding: 20px 20px 8px; }
.pricebox .sublabel { font-size: 13px; color: var(--text-3); margin-top: 8px; }
.changes { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chart-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; }
.chart { position: relative; padding: 6px 8px 10px; }
.chart svg { width: 100%; height: 230px; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text { font: 500 10.5px var(--font-body); fill: var(--text-3); }
.chart .tip { position: absolute; top: 6px; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 9px; font-size: 12.5px; white-space: nowrap; transform: translateX(-50%); box-shadow: var(--shadow); display: none; }
.chart .tip b { display: block; font-size: 14px; }
.actions { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 10px; margin-top: 16px; }
.actions .btn { padding: 0 10px; }
.empty { padding: 26px 20px; text-align: center; color: var(--text-3); font-size: 14px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- search palette ---------- */
dialog.palette { width: min(640px, calc(100vw - 24px)); margin-top: 12vh; padding: 0; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
dialog.palette::backdrop { background: rgba(6, 7, 10, 0.6); backdrop-filter: blur(3px); }
.palette input { width: 100%; height: 56px; padding: 0 18px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: 500 17px var(--font-body); outline: none; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: 8px; }
.palette-list a { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 10px; border-radius: 9px; }
.palette-list a.on, .palette-list a:hover { background: var(--surface-2); }
.palette-foot { padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); display: flex; gap: 16px; }

/* ---------- footer + mobile tab bar ---------- */
footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13px; color: var(--text-3); }
footer.site .wrap { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
footer.site a { color: var(--text-2); }
footer.site a:hover { color: var(--text); }
.tabbar { display: none; }

@media (max-width: 1080px) {
  .grid-home { grid-template-columns: 1fr 1fr; }
  .grid-home > :nth-child(3) { grid-column: 1 / -1; }
  .games { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .meta-grid, .deck-grid { grid-template-columns: 1fr; }
  .grid-2 .panel[style*="sticky"] { position: static !important; }
  .card-page { grid-template-columns: minmax(0, 280px) minmax(0, 1fr); gap: 28px; }
}
@media (max-width: 760px) {
  :root { --pad: 16px; }
  html { scroll-padding-top: 110px; }
  .menus, .search-btn kbd, .search-btn span { display: none; }
  .top-row { gap: 10px; height: 54px; }
  .search-btn { flex: none; width: 38px; padding: 0; justify-content: center; color: var(--text-2); }
  .bar { min-width: 84px; gap: 6px; }
  .bar b { width: 42px; }
  td, th { padding-left: 8px; padding-right: 8px; }
  .rank { width: 22px; }
  .grid-home, .grid-even { grid-template-columns: 1fr; }
  .games { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game-tile { padding: 13px; }
  .card-page { grid-template-columns: 1fr; gap: 22px; }
  .card-art { position: static; max-width: 250px; margin: 0 auto; }
  .card-art .note { display: none; }
  .actions { grid-template-columns: 1fr 1fr 1fr; }
  .actions .btn:not(.primary) { font-size: 13.5px; padding: 0 6px; }
  .actions .primary { grid-column: 1 / -1; }
  .bigprice b { font-size: 40px; }
  .subnav { top: 98px; }
  .hide-sm { display: none !important; }
  main.wrap { padding-top: 22px; padding-bottom: 110px; }
  .row { padding-left: 14px; padding-right: 14px; }
  .panel-head { padding: 14px 14px 10px; }
  .panel-head:has(> .seg) { flex-wrap: wrap; }
  .panel-head:has(> .seg) > :first-child { flex: 1 1 200px; min-width: 0; }
  td:first-child, th:first-child { padding-left: 14px; }
  td:last-child, th:last-child { padding-right: 14px; }
  .rail { grid-auto-columns: 148px; }
  footer.site { padding-bottom: 96px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: grid; justify-items: center; gap: 3px; padding: 6px 0; font-size: 10.5px; font-weight: 600; color: var(--text-3); }
  .tabbar .on { color: var(--brand-text); }
}
@media (max-width: 420px) {
  .games { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================ brand: logo + hero */
.h1 { font-size: clamp(30px, 4.2vw, 46px); font-weight: 800; }
.logo-mark { width: auto; height: auto; background: none; color: var(--text); border-radius: 0; }
.logo-svg { display: block; overflow: visible; }
.logo-svg g { transform-box: fill-box; transform-origin: center; }
.logo-svg .lg-stem { transform-origin: 50% 0; }
@keyframes lgBar { from { transform: translateX(-36px) skewX(-24deg); opacity: 0; } }
@keyframes lgStem { from { transform: scaleY(0); } }
@keyframes lgGlint { 0%, 88%, 100% { filter: brightness(1); } 93% { filter: brightness(1.55); } }
@keyframes lgFloat { 50% { transform: translateY(-7px); } }
.logo-svg.play .lg-bar { animation: lgBar 0.55s cubic-bezier(0.2, 0.9, 0.2, 1) 0.05s both; }
.logo-svg.play .lg-stem { animation: lgStem 0.6s cubic-bezier(0.3, 1.3, 0.4, 1) 0.4s both; }
.logo-svg.idle { animation: lgGlint 6.5s ease-in-out 2.4s infinite; }

.wm { display: inline-flex; gap: 0.2em; font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; font-stretch: normal; line-height: 1; white-space: nowrap; }
.wm em { font-style: normal; color: var(--brand-text); }
.logo .wm { font-size: 16.5px; }

.hero { position: relative; isolation: isolate; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; z-index: -1; }
.hero-bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-bg::before { content: ""; position: absolute; inset: -25%; filter: blur(40px); opacity: 0.9;
  background:
    radial-gradient(34% 42% at 32% 38%, color-mix(in srgb, var(--brand) 30%, transparent), transparent 70%),
    radial-gradient(30% 40% at 70% 58%, rgba(47, 214, 181, 0.24), transparent 70%),
    radial-gradient(26% 34% at 56% 22%, rgba(92, 200, 255, 0.12), transparent 70%);
  animation: aurora 24s ease-in-out infinite alternate; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 55% at 50% 45%, transparent 0, var(--bg) 100%), linear-gradient(to bottom, transparent 70%, var(--bg)); opacity: 0.55; }
:root[data-theme="light"] .hero-bg::before { opacity: 0.55; }
@keyframes aurora {
  0% { transform: translate3d(-4%, -2%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, 3%, 0) rotate(7deg) scale(1.1); }
  100% { transform: translate3d(-2%, 5%, 0) rotate(-6deg) scale(1.04); }
}
.hero-inner { min-height: clamp(500px, calc(100vh - 250px), 680px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 0; padding: 52px var(--pad) 40px; }
.hero-logo { height: 200px; filter: drop-shadow(0 22px 40px rgba(0, 0, 0, 0.45)); animation: lgFloat 7s ease-in-out 2s infinite; }
:root[data-theme="light"] .hero-logo { filter: drop-shadow(0 16px 30px rgba(40, 30, 90, 0.22)); }
.hero-word { margin-top: 26px; font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; font-stretch: normal; font-size: clamp(34px, 6.5vw, 84px); line-height: 1; }
.hero-word > span { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 0.08em 0.2em; }
.hero-word .w { display: inline-flex; font-style: normal; }
.hero-word em { color: var(--brand-text); }
.hero-word .w span { display: inline-block; }
.hero-tag { margin-top: 18px; font-size: clamp(16px, 1.7vw, 20px); color: var(--text-2); max-width: 56ch; }
.hero-cta { margin-top: 28px; display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.hero .btn:not(.primary) { background: color-mix(in srgb, var(--surface) 70%, transparent); backdrop-filter: blur(8px); }

@keyframes rise { from { opacity: 0; transform: translateY(0.5em); } }
@keyframes letter { from { opacity: 0; transform: translateY(0.55em) rotate(6deg); } }
.hero.play .hero-word .w span { animation: letter 0.6s cubic-bezier(0.2, 0.9, 0.2, 1) calc(0.85s + var(--i) * 34ms) both; }
.hero.play .hero-tag { animation: rise 0.7s ease 1.45s both; }
.hero.play .hero-cta { animation: rise 0.7s ease 1.65s both; }
.hero.play .ticker { animation: rise 0.7s ease 1.9s both; }

.ticker { display: flex; align-items: center; gap: 14px; height: 52px; margin-bottom: 22px; padding: 0 8px 0 18px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: blur(10px); }
.ticker-label { flex: none; font-size: 11.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.ticker-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px var(--up-soft); }
.ticker-view { flex: 1; min-width: 0; overflow: hidden; mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent); }
.ticker-track { display: flex; gap: 34px; width: max-content; animation: ticker calc(var(--n) * 5.5s) linear infinite; }
.ticker-view:hover .ticker-track, .ticker-view:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(calc(-50% - 17px)); } }
.ticker-track a { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; white-space: nowrap; }
.ticker-track a b { font-weight: 650; }
.ticker-track a span:last-child { color: var(--text-3); }
.ticker-track a:hover b { color: var(--brand-text); }
.ticker-pause { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); border: 1px solid var(--line); }
.ticker-pause:hover { color: var(--text); border-color: var(--line-2); }
.ticker-pause[aria-pressed="true"] { color: var(--brand-text); border-color: var(--brand-text); }

@media (max-width: 760px) {
  .hero-inner { min-height: 0; padding: 62px var(--pad) 30px; }
  .hero-logo { height: 124px; }
  .hero-logo .logo-svg { width: 124px; height: 124px; }
  .hero-word { margin-top: 14px; }
  .hero-cta { width: 100%; }
  .hero-cta .btn { flex: 1 1 100%; }
  .ticker { padding-left: 12px; gap: 10px; }
  .ticker-label { font-size: 0; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hero *, .logo-svg * { animation: none !important; }
  .logo-svg .lg-foil { opacity: 0; }
}

/* ============================================================ pieces added for the server-rendered pages */
[hidden] { display: none !important; }
.grow { min-width: 0; flex: 1; display: block; }
.inline { display: inline-block; }
.thin { font-weight: 500; }
.gap { margin-top: 6px; }
.row-two { grid-template-columns: minmax(0, 1fr) auto; }
.lede-game { display: flex; gap: 16px; align-items: center; }
.lede p.sub.tight { margin-top: 6px; }
.stack.roomy { gap: 18px; }
.grid-2.one { grid-template-columns: minmax(0, 1fr); }
.panel.sticky { position: sticky; top: 124px; }
.stat b.good { color: var(--up); }
.stat b.bad { color: var(--down); }
td.group { padding-top: 16px; }
td a:hover b, .t1[href]:hover, .list-line:hover .t1 { color: var(--brand-text); }
a.tag:hover { border-color: var(--line-2); color: var(--text); }
th button[aria-sort]::after { content: " ↓"; }
th button[aria-sort="ascending"]::after { content: " ↑"; }
.matrix-wrap { padding: 0 14px 16px; }
.matrix tbody th a:hover { color: var(--brand-text); }
.scatter a.dot:hover circle { stroke: var(--text); stroke-width: 2; }
.deck-pick a { height: 32px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 550; color: var(--text-2); }
.deck-pick a:hover { color: var(--text); border-color: var(--line-2); }
.deck-pick a[aria-current] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.buy-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; padding: 0 18px 8px; }
.buy-row > :only-child { grid-column: 1 / -1; }
a.list-line { grid-template-columns: 22px minmax(0, 1fr); }
a.list-line.priced { grid-template-columns: 22px minmax(0, 1fr) auto; }
.list-line .p { font-variant-numeric: tabular-nums; }
.cost-line { padding: 2px 18px 10px; font-size: 13.5px; color: var(--text-3); }
.cost-line b { color: var(--text); font-size: 15px; }
details.fold summary .price { flex: none; font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
span.thumb { display: block; flex: none; box-shadow: none; }
.rows.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .rows.two-col { grid-template-columns: minmax(0, 1fr); } }
.printings td .t2 { margin-top: 1px; }
details.fold { border-top: 1px solid var(--line); }
details.fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 12px 18px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font: 600 18px/1 var(--font-body); color: var(--text-3); }
details.fold[open] > summary::after { content: "–"; }
details.fold > summary:hover { background: var(--surface-2); }
details.fold[open] { padding-bottom: 12px; }
.wrapline { flex-wrap: wrap; justify-content: flex-start; gap: 8px 18px; }
.wrapline b { color: var(--text); }
.chipline { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1080px) { .panel.sticky { position: static; } }

/* ============================================================ collector pages: search, sets, releases, restocks, events, watchlist */
.small { font-size: 13.5px; }
.center { justify-content: center; }
.chipline.gap { margin-top: 14px; }
.chipline.center { margin-top: 14px; }
.section.tight { margin-top: 26px; }
.t1 a:hover, .cell-card:hover .t1 { color: var(--brand-text); }
.btn.icon { width: 34px; padding: 0; flex: none; }
.btn svg { flex: none; }
.pill { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 99px; background: var(--surface-2); font-size: 11.5px; font-weight: 650; color: var(--text-2); text-align: center; }
.pill:empty { display: none; }

/* watchlist link in the top bar */
.watch-link { position: relative; }
.watch-link .count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); font: 700 10.5px/18px var(--font-body); text-align: center; }
.palette-foot .link { margin-left: auto; }

/* search and filters */
.finder { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.finder-main { flex: 1 1 380px; min-width: 0; display: flex; gap: 8px; }
.finder-main .finder-q { flex: 1; }
a.stat:hover { border-color: var(--line-2); }
.finder-q { flex: 1 1 280px; min-width: 0; display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text-3); cursor: text; }
.finder-q:focus-within { border-color: var(--brand-text); box-shadow: 0 0 0 3px var(--brand-soft); }
.finder-q svg { flex: none; }
.finder-q input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--text); font: 500 15px var(--font-body); outline: none; }
.finder-q input::placeholder { color: var(--text-3); }
.finder select, .wl-bar select { height: 44px; max-width: 100%; padding: 0 34px 0 12px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--text); font: 550 14px var(--font-body); appearance: none; -webkit-appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23808799' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.finder select:hover, .wl-bar select:hover { border-color: var(--text-3); }
.finder .btn { height: 44px; }
.filterbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filterbar .finder-q { flex: 1 1 260px; max-width: 460px; }
.filterbar .seg { flex-wrap: wrap; }
.browse { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 26px; }
.browse a { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.browse a:hover { border-color: var(--line-2); background: var(--surface-2); }
.browse a > span { min-width: 0; }
.browse b { display: block; font-size: 14px; font-weight: 650; }
.browse span span { display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* card listings: table and grid */
.list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.list-head h2 { font-size: 17px; }
.seg a { height: 28px; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); display: inline-flex; align-items: center; }
.seg a:hover { color: var(--text); }
.seg a[aria-current] { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }
[data-results] { scroll-margin-top: 130px; transition: opacity 0.12s; }
[data-results].loading { opacity: 0.5; pointer-events: none; }
.star { width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--text-3); }
.star:hover { color: var(--text); background: var(--surface-2); }
.star[aria-pressed="true"] { color: var(--gold); }
.star[aria-pressed="true"] svg { fill: currentColor; }
th.star-col, td.star-col { width: 46px; text-align: right; padding-left: 0; }
/* the name column takes what is left and shortens its text, so prices never slide off a narrow screen */
.cardlist td:first-child, .wl-table td:first-child { width: 100%; max-width: 0; }
.cardlist td, .wl-table td, .cardlist th, .wl-table th { white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 22px 14px; }
.tile { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; align-content: start; min-width: 0; }
.tile-art { display: block; margin-bottom: 5px; }
.tile:hover .art { transform: translateY(-4px); }
.tile .star { position: absolute; top: 6px; right: 6px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); color: var(--text); }
.tile .star[aria-pressed="true"] { color: var(--gold); }
.tile .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.tile .price { text-align: left; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; color: var(--text-3); }
.pager > span:empty { width: 96px; }

/* set lists */
tr.year td { padding: 18px 18px 8px; font: 800 15px var(--font-display); color: var(--text-2); background: var(--bg-2); border-bottom: 1px solid var(--line); }
table[data-sorted] tr.year { display: none; }
#setlist .t2 { margin-top: 3px; }
#setlist td .cell-card { max-width: 300px; }

/* releases */
.row-rel { grid-template-columns: 46px minmax(0, 1fr) auto; }
.rel-actions { display: flex; gap: 6px; align-items: center; }

/* restock radar */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px; }
.product { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 10px; align-content: start; }
.product header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.product h3 { font-size: 16px; line-height: 1.25; }
.product h3 a:hover { color: var(--brand-text); }
.product .type { font-size: 12.5px; color: var(--text-3); margin-top: -6px; }
.pricing { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 6px 20px; align-items: end; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pricing span { display: block; font-size: 11.5px; color: var(--text-3); }
.pricing b { font: 800 20px/1.2 var(--font-display); }
.pricing .trend { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 6px; }
.pricing .trend .spark { width: 64px; height: 24px; }
.pricing .delta { font-size: 12px; color: inherit; }
.pricing .delta.up { color: var(--up); } .pricing .delta.down { color: var(--down); } .pricing .delta.flat { color: var(--text-3); }
.pricing .delta small { display: inline; }
.product .note { font-size: 13.5px; color: var(--text-2); }
.retailers { display: flex; flex-wrap: wrap; gap: 6px; }
.retailers a { height: 28px; padding: 0 10px; display: inline-flex; align-items: center; border-radius: 7px; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.retailers a:hover { color: var(--text); border-color: var(--line-2); background: var(--surface-2); }
.tag.st-hunted { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); background: var(--down-soft); }
.tag.st-scarce { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 40%, transparent); background: transparent; }
.tag.st-instock { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); background: var(--up-soft); }

/* near you, link cards, the week */
.near-form { display: flex; flex-wrap: wrap; gap: 8px; }
.near-form .finder-q { flex: 1 1 240px; }
.near-form .btn { height: 44px; }
.near .sub-line { margin-top: 10px; }
.near .sub-line button.link { font-size: inherit; }
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.near .linkgrid { margin-top: 6px; }
.near .linkgrid:empty { display: none; }
.linkgrid h3 { grid-column: 1 / -1; font: 650 11.5px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-top: 10px; }
.linkcard { display: block; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; }
.near .linkcard { background: var(--surface-2); }
.linkcard:hover { border-color: var(--line-2); }
.linkcard b { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 650; }
.linkcard b svg { color: var(--text-3); flex: none; }
.linkcard span { display: block; font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); }
.week > div { background: var(--surface); padding: 14px 18px; }
.week b { display: block; margin: 8px 0 3px; font-size: 14.5px; }
.week p { font-size: 13px; color: var(--text-3); }

/* long-form text */
.prose p { margin: 0 0 12px; color: var(--text-2); }
.prose p:last-child { margin-bottom: 0; }
.prose b { color: var(--text); }
.prose a:not(.btn):not(.link) { color: var(--brand-text); text-decoration: underline; text-underline-offset: 2px; }
.prose ul { margin: 0 0 14px; padding-left: 20px; color: var(--text-2); }
.prose li { margin-bottom: 7px; }
.prose.page { max-width: 760px; margin: 10px auto 0; font-size: 15.5px; line-height: 1.62; }
.prose.page h1 { margin: 10px 0 6px; }
.prose.page h2 { margin: 32px 0 10px; font-size: 19px; }
.prose.page .lead { font-size: 17px; color: var(--text); margin-top: 22px; }
.prose .other { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 34px; padding-top: 18px; border-top: 1px solid var(--line); }

/* watchlist and collections */
.wl-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.wl-bar .btn { height: 44px; }
.adder { position: relative; flex: 1 1 300px; max-width: 520px; }
.adder .finder-q { width: 100%; }
.adder-list { position: absolute; z-index: 30; left: 0; right: 0; top: 50px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; max-height: 60vh; overflow: auto; }
.adder-list button { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 7px 9px; border-radius: 8px; }
.adder-list button:hover, .adder-list button.on { background: var(--surface-2); }
.adder-list .thumb { width: 30px; }
.adder-list .empty { padding: 14px; }
.coll-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.coll-pick button { height: 34px; padding: 0 13px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; font-weight: 550; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; }
.coll-pick button:hover { color: var(--text); border-color: var(--line-2); }
.coll-pick button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 650; }
.coll-pick button[aria-pressed="true"] .faint { color: inherit; opacity: 0.7; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; vertical-align: middle; }
.qty button { width: 28px; height: 28px; color: var(--text-2); font-weight: 700; }
.qty button:hover { background: var(--surface-2); color: var(--text); }
.qty span { min-width: 28px; text-align: center; font-weight: 650; font-size: 13.5px; }
.x { width: 30px; height: 30px; border-radius: 8px; color: var(--text-3); font-size: 15px; }
.x:hover { background: var(--down-soft); color: var(--down); }
.wl-table td.act { white-space: nowrap; text-align: right; }
.wl-table td.act > * { margin-left: 6px; }
.since { font-size: 12.5px; color: var(--text-3); display: block; margin-top: 2px; }
.since.up { color: var(--up); } .since.down { color: var(--down); }
.stat b.up { color: var(--up); } .stat b.down { color: var(--down); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; max-width: calc(100vw - 32px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); }
.pop { position: absolute; z-index: 70; min-width: 230px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.pop button { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 8px; font-size: 14px; font-weight: 550; }
.pop button:hover { background: var(--surface-2); }
.pop .pop-label { padding: 7px 11px 5px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.pop .link { display: block; padding: 9px 11px 7px; border-top: 1px solid var(--line); margin-top: 4px; }

@media (max-width: 1080px) {
  .browse { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .finder select { flex: 1 1 40%; min-width: 0; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 18px 10px; }
  .row-rel { grid-template-columns: 46px minmax(0, 1fr); }
  .rel-actions { grid-column: 2; flex-wrap: wrap; }
  .products { grid-template-columns: minmax(0, 1fr); }
  .toast { bottom: 84px; }
  .list-head { align-items: flex-start; flex-direction: column; }
  th.star-col, td.star-col { width: 38px; }
  tr.year td { padding-left: 14px; }
  .wl-table .qty button { width: 26px; }
}

/* ---------- players and rankings ---------- */
table.ranking .tag { display: inline-block; max-width: 260px; height: auto; line-height: 18px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
table.ranking.results .tag { max-width: 170px; }
table.ranking td:nth-child(2) { overflow-wrap: anywhere; }        /* account names can be one long word */
table.ranking td a:hover b, td b a:hover, .sub-line a:hover, h2 a:hover { color: var(--brand-text); }
/* a player's results: fixed columns, so a long event name is cut short instead of pushing the table past its panel */
table.ranking.results { table-layout: fixed; width: 100%; }
table.ranking.results th:nth-child(1) { width: 78px; }
table.ranking.results th:nth-child(3) { width: 116px; }
table.ranking.results th:nth-child(4) { width: 186px; }
table.ranking.results th:nth-child(5) { width: 78px; }
table.ranking.results td { overflow: hidden; }
@media (max-width: 760px) {
  table.ranking.results th:nth-child(1) { width: 62px; }
  table.ranking.results th:nth-child(3) { width: 98px; }
  table.ranking.results th:nth-child(5) { width: 62px; }
  table.ranking.results .t1, table.ranking.results .t2, table.ranking.results .t2 span { white-space: normal; }
}
.grid-even table.ranking .tag { max-width: 190px; }

/* ---------- metagame pages: deck art, tier board, over-time chart, matchups, head to head ---------- */
:root { --c0: #c8f53c; --c1: #5cc8ff; --c2: #f2c14e; --c3: #ff8a5c; --c4: #b79bff; --c5: #ff6b9a; --c6: #2fd6b5; --c7: #9aa3b8; --c8: #e86bff; --c9: #7ddc6a;
        --tier-s: #c8f53c; --tier-a: #2fd6b5; --tier-b: #f2c14e; --tier-c: #8f98ad; }
:root[data-theme="light"] { --c0: #5f9a00; --c1: #0b84c9; --c2: #a67400; --c3: #d4551f; --c4: #6c4bd8; --c5: #d6336c; --c6: #00826c; --c7: #5d6475; --c8: #a32fc0; --c9: #2f8f3a;
        --tier-s: #5f9a00; --tier-a: #00826c; --tier-b: #a67400; --tier-c: #6b7385; }
.gap-top { margin-top: 16px; }
.gap-bottom { margin-bottom: 16px; }
.input { height: 38px; min-width: 0; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 500 14px var(--font-body); outline: none; }
.input:focus { border-color: var(--text-3); }
.input.sm { height: 34px; width: 180px; }

/* a deck's picture: the window is laid over the card's artwork (roughly the band from 12% to 57% of its height) */
.art { display: block; position: relative; flex: none; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; background: var(--surface-2); }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 21%; transform: scale(1.18); transform-origin: 50% 30%; }
body[data-game="yugioh"] .art img { object-position: 50% 37%; transform: scale(1.32); transform-origin: 50% 42%; }      /* its artwork sits lower, in a square frame */
body[data-game="onepiece"] .art img { object-position: 50% 0; transform: scale(1.3); transform-origin: 50% 0; }            /* the top third: above the SAMPLE mark its pictures carry */
.art.none { display: grid; place-items: center; font: 800 15px var(--font-display); color: var(--text-3); background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); }
/* a product with no photo (site.js takes the src off a broken image): the deck's initials instead */
.art:has(img:not([src])) { display: grid; place-items: center; font: 800 15px var(--font-display); color: var(--text-3); background: linear-gradient(135deg, var(--surface-2), var(--bg-2)); }
.art:has(img:not([src]))::after { content: attr(data-mono); }
.art img:not([src]) { display: none; }
.art.sm { width: 46px; border-radius: 6px; }
.art.sm.none { font-size: 11px; }
.art.lg { width: 132px; border-radius: 10px; }
.art.xl { width: 148px; border-radius: 12px; box-shadow: var(--art-shadow); }
.art.xl.none { font-size: 30px; }
.cell-deck { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-deck .tier-tag { margin-left: 2px; }

.tier-tag { display: inline-grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 6px; font: 800 12.5px/1 var(--font-display); color: var(--bg); background: var(--tier, var(--text-3)); }
.t-s { --tier: var(--tier-s); }
.t-a { --tier: var(--tier-a); }
.t-b { --tier: var(--tier-b); }
.t-c { --tier: var(--tier-c); }
.stat b.tier-letter { color: var(--tier); }

.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.pod { display: flex; gap: 14px; align-items: center; padding: 12px; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.pod:first-child { border-color: color-mix(in srgb, var(--brand-mark) 45%, var(--line)); }
.pod:hover { border-color: var(--line-2); background: var(--surface-2); }
.pod-body { display: grid; gap: 5px; min-width: 0; }
.pod-rank { font-size: 11px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.pod-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pod-name b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font: 700 18px/1.2 var(--font-display); }
.pod-nums { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--text-3); }
.pod-nums b { color: var(--text); font-weight: 650; }
.pod-nums b.good, .dt-nums .good, .pct.good, .vs-score b.good, .row b.good { color: var(--up); }
.pod-nums b.bad, .dt-nums .bad, .pct.bad { color: var(--down); }

.meta-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.meta-controls .formats { margin: 0; min-width: 0; }
.meta-controls + .tabs { margin-top: 12px; }
.seg a { display: inline-flex; align-items: center; height: 28px; padding: 0 11px; border-radius: 6px; font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.seg a:hover { color: var(--text); }
.seg a[aria-current] { background: var(--surface-2); color: var(--text); box-shadow: 0 0 0 1px var(--line-2); }

.tiers { display: grid; gap: 8px; padding: 2px 14px 14px; }
.tier { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; }
.tier-name { display: grid; align-content: center; justify-items: center; gap: 4px; padding: 10px 6px; text-align: center; border-radius: 10px; background: color-mix(in srgb, var(--tier) 14%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--tier) 40%, transparent); }
.tier-name b { font: 800 34px/1 var(--font-display); color: var(--tier); }
.tier-name span { font-size: 11px; font-weight: 600; color: var(--text-2); }
.tier-decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 8px; padding: 8px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.dt { display: grid; gap: 5px; align-content: start; min-width: 0; padding: 6px 6px 8px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); transition: transform 0.12s, border-color 0.12s; }
.dt:hover { border-color: var(--tier, var(--line-2)); transform: translateY(-2px); }
.dt-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 0 2px; font-weight: 650; font-size: 13px; line-height: 1.25; }
.dt-nums { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 0 2px; font-size: 11.5px; color: var(--text-3); }
.dt.more { place-content: center; justify-items: center; min-height: 100px; text-align: center; font-size: 12px; color: var(--text-2); }
.dt.more b { font: 800 20px var(--font-display); color: var(--text); }

.row-mover { grid-template-columns: 46px minmax(0, 1fr) auto; }
.row-vs, .row-pilot { grid-template-columns: minmax(0, 1fr) auto; }
.row-pilot .t1 a:hover { color: var(--brand-text); }

.mchart { padding: 0 14px 14px; }
.mchart-plot { position: relative; min-height: 200px; }
.mchart svg { display: block; touch-action: pan-y; }
.mchart .rule { stroke: var(--line); }
.mchart .base { stroke: var(--text-3); stroke-dasharray: 4 4; }
.mchart .axis { font: 500 10.5px var(--font-body); fill: var(--text-3); }
.mchart .series path { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.mchart .series circle { fill: currentColor; }
.mchart .series { transition: opacity 0.12s; }
.mchart .series.dim { opacity: 0.16; }
.mchart .area { opacity: 0.14; }
.mchart .cursor { stroke: var(--text-3); stroke-dasharray: 3 3; }
.mchart .marks circle { fill: var(--surface); stroke: currentColor; stroke-width: 2.5; }
.mchart-tip { position: absolute; top: 8px; z-index: 3; pointer-events: none; display: grid; gap: 3px; min-width: 176px; max-width: 270px; padding: 9px 11px; font-size: 12.5px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); }
.mchart-tip[hidden] { display: none; }
.mchart-tip .tr { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 7px; align-items: center; }
.mchart-tip .tr i { width: 9px; height: 9px; border-radius: 50%; }
.mchart-tip .tr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mchart-legend { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 10px; }
.mchart-legend:empty { display: none; }
.key { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 8px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; }
.key i { width: 12px; height: 3px; border-radius: 2px; background: currentColor; }
.key i.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 6px); }
.key span { color: var(--text); }
.key[aria-pressed="false"] { border-style: dashed; }
.key[aria-pressed="false"] span { color: var(--text-3); }
.key[aria-pressed="false"] i { background: var(--line-2); }
.key:hover { border-color: var(--text-3); }
table.then th small { display: block; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; }

.matrix thead th { height: 146px; }
.matrix thead th div { max-height: 142px; }
.matrix td a { display: grid; place-content: center; width: 100%; height: 44px; border-radius: 6px; }
.matrix td a:hover { box-shadow: inset 0 0 0 2px var(--text); }
.matrix thead th.hot div { color: var(--brand-text); }

.chipline.nowrap { flex: none; flex-wrap: nowrap; gap: 6px; }
.field { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; padding: 2px 18px 16px; }
.field .eyebrow { margin-bottom: 8px; }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(70px, 1.1fr) 46px; gap: 10px; align-items: center; height: 30px; font-size: 13px; }
.field-row .nm, .field-res .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.field-row input { width: 100%; margin: 0; accent-color: var(--brand-mark); }
.field-row output { text-align: right; font-size: 12.5px; color: var(--text-2); }
.field-res { display: grid; grid-template-columns: 20px minmax(0, 1fr) 50px 64px; gap: 8px; align-items: center; height: 30px; padding: 0 4px; border-radius: 6px; font-size: 13px; }
.field-res:hover { background: var(--surface-2); }
.field-res .rk { font-size: 12px; color: var(--text-3); }
.field-res .pct { text-align: right; font-weight: 650; }
.meter { display: block; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

.lede-deck { display: flex; align-items: center; gap: 18px; min-width: 0; }
.vs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: center; padding: 22px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.vs-side { display: grid; justify-items: center; gap: 8px; min-width: 0; text-align: center; }
.vs-side .art.xl { width: min(100%, 200px); }
.vs-name { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.vs-name b { font: 700 17px/1.2 var(--font-display); overflow-wrap: anywhere; }
.vs-side:hover .vs-name b { color: var(--brand-text); }
.vs-sub { font-size: 12.5px; color: var(--text-3); }
.vs-mid { display: grid; gap: 10px; min-width: 0; text-align: center; }
.vs-mid h1 { font-size: clamp(20px, 2.4vw, 28px); line-height: 1.2; }
.vs-mid h1 span { font-weight: 600; color: var(--text-3); }
.vs-score { display: flex; justify-content: center; align-items: baseline; gap: 12px; font: 800 clamp(34px, 5vw, 52px)/1 var(--font-display); }
.vs-score span { font-size: 0.6em; color: var(--text-3); }
.vs-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.vs-bar i { position: absolute; inset: 0 auto 0 0; background: var(--brand); }
.vs-bar u { position: absolute; top: 3px; height: 4px; border-radius: 4px; background: var(--brand-ink); opacity: 0.6; }
.vs-bar::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--bg); }
.vs-verdict { font-weight: 650; color: var(--text-2); }
.vs-lede { max-width: 80ch; margin: 0 0 16px; color: var(--text-2); }
.vs-stats { margin-bottom: 4px; }
td.dim .wr { opacity: 0.55; }

@media (max-width: 1080px) {
  .art.lg { width: 96px; }
  .pod { gap: 11px; padding: 10px; }
  .pod-name b { font-size: 16px; }
  .field { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .podium { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .panel-head.wrap { flex-wrap: wrap; }
  .panel-head.wrap > div:first-child { flex: 1 1 100%; }
  .tiers { padding: 0 10px 10px; }
  .tier { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .tier-name { display: flex; justify-content: flex-start; align-items: baseline; gap: 10px; padding: 7px 12px; }
  .tier-name b { font-size: 22px; }
  .tier-decks { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; padding: 6px; }
  .art.xl { width: 104px; }
  .lede-deck { gap: 14px; }
  .input.sm { width: 130px; }
  .mchart { padding: 0 8px 12px; }
  .field { padding: 2px 14px 14px; }
  .vs { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px 12px; padding: 16px 14px; }
  .vs-mid { grid-column: 1 / -1; order: -1; }
  .art.sm { width: 40px; }
}
@media (prefers-reduced-motion: reduce) { .dt, .mchart .series { transition: none; } }

/* ---------- alerts: the price-alert button and popover, the Alerts tab ---------- */
.alert-btn { display: block; width: 100%; margin-top: 10px; padding: 9px 12px; border-radius: 10px; border: 1px dashed var(--line-2); font-size: 13.5px; font-weight: 600; color: var(--text-2); text-align: center; }
.alert-btn:hover { color: var(--text); border-color: var(--text-3); }
.alert-btn.set { border-style: solid; border-color: color-mix(in srgb, var(--brand-mark) 55%, var(--line)); color: var(--brand-text); background: var(--brand-soft); }
.alert-pop { width: 270px; padding: 10px 12px 12px; }
.alert-pop .pop-label { padding: 2px 0 8px; }
.alert-pop label { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; font-weight: 550; }
.alert-pop .pop-row { display: flex; gap: 8px; margin-top: 10px; }
.alert-pop .pop-row .btn { flex: 1; width: auto; justify-content: center; padding: 0 12px; }
.alert-pop .pop-row .btn.primary:hover { background: var(--brand-hover); }
.alert-pop .pop-note { margin-top: 9px; font-size: 12px; color: var(--text-3); }
.money { display: inline-flex; align-items: center; height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-2); }
.money:focus-within { border-color: var(--text-3); }
.money i { font-style: normal; color: var(--text-3); margin-right: 3px; }
.money input { width: 82px; border: 0; background: none; outline: none; color: var(--text); font: 600 14px var(--font-body); font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.money input::-webkit-outer-spin-button, .money input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.alert-note { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }
.alerts-intro { padding-top: 20px; max-width: 70ch; display: grid; gap: 14px; justify-items: start; }
.alerts-intro h2 { font-size: 20px; }
.alerts-intro ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); }
.alerts-intro li b { color: var(--text); }
.notice { padding: 11px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); color: var(--text); font-size: 14px; }
.opts { display: grid; gap: 18px; padding-top: 4px; }
.opt { display: flex; gap: 11px; align-items: flex-start; cursor: pointer; }
.opt input, .chip.pick input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand-mark); flex: none; }
.opt b { display: block; font-size: 14.5px; }
.opt small { color: var(--text-3); font-size: 12.5px; }
.opts .chips { margin-top: 10px; }
.chip.pick { cursor: pointer; padding-left: 10px; }
.chip.pick input { margin: 0; }
.chip.pick:has(input:checked) { color: var(--text); border-color: var(--text-3); background: var(--surface-2); }
table.targets td { padding-top: 8px; padding-bottom: 8px; }
@media (max-width: 760px) {
  .money input { width: 58px; }
  table.targets th:nth-child(2), table.targets td:nth-child(2) { display: none; }
}

/* ---------- deck tools: the builder and price checker, "Open in builder" on every list ---------- */
.buy-row:has(> :nth-child(3)) { grid-template-columns: 1.3fr 1fr 1fr; }
.buy-row .btn { padding: 0 10px; min-width: 0; }
.chart-top.inlist { padding: 8px 18px 0; align-items: baseline; }
.input.area { display: block; width: 100%; height: auto; min-height: 190px; padding: 12px 14px; resize: vertical; font: 500 13.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.deck-import { display: grid; gap: 12px; padding: 0 18px 18px; }
.deck-import[hidden] { display: none; }
.deck-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 0 18px 12px; }
.deck-bar .input { flex: 1 1 200px; height: 44px; }
.deck-bar .adder { flex: 1 1 260px; max-width: none; }
.deck-table tr.unknown .t1 { color: var(--text-2); }
.deck-table tr.unknown .t2 { color: var(--gold); }
.deck-table td.group { padding-top: 14px; }
.panel-head h2.cost-big { font: 800 38px/1.1 var(--font-display); margin-top: 4px; }
.cost-big.dim { opacity: 0.5; }
.sub-line .up { color: var(--up); }
.sub-line .down { color: var(--down); }
.deck-acts { padding: 0 18px 14px; }
.cmp { display: grid; gap: 4px; }
.cmp-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cmp-pick select { flex: 1 1 150px; min-width: 0; height: 40px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: 550 14px var(--font-body); }
.cmp-score { margin: 6px 0 2px; font-size: 14px; color: var(--text-2); }
.cmp-score b { font: 800 22px var(--font-display); color: var(--text); margin-right: 4px; }
.cmp h3 { margin: 14px 0 4px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.cmp-row { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 3px 0; border-top: 1px solid var(--line); }
.cmp-row .btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.row-saved { grid-template-columns: minmax(0, 1fr) auto; }
.row-saved a:hover .t1 { color: var(--brand-text); }
@media (max-width: 760px) {
  .buy-row:has(> :nth-child(3)) { grid-template-columns: 1fr 1fr; }
  .buy-row:has(> :nth-child(3)) > :first-child { grid-column: 1 / -1; }
  .deck-import, .deck-bar { padding-left: 14px; padding-right: 14px; }
  .deck-table .t1 { white-space: normal; overflow-wrap: anywhere; font-size: 14px; line-height: 1.25; }
  .deck-table .qty button { width: 24px; }
  .deck-table .qty span { min-width: 22px; }
  .panel-head h2.cost-big { font-size: 32px; }
}

/* ---- the tournament archive: where an event was played ---- */
.formats.where { flex-wrap: wrap; overflow: visible; }
.more-chips > summary { list-style: none; cursor: pointer; }
.more-chips > summary::-webkit-details-marker { display: none; }
.more-chips[open] { flex-basis: 100%; }
.more-chips[open] > summary { color: var(--text); }
.more-chips-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---- share images (js/share.js) ---- */
.lede-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
dialog.share-dialog { width: min(560px, calc(100vw - 24px)); margin-top: 6vh; }
.share-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.share-head b { font: 800 16px/1 var(--font-display); margin-right: auto; }
.share-head .seg button[aria-pressed="true"] { background: var(--surface-2, var(--line)); color: var(--text); }
.share-head .seg button { border: 0; background: none; color: var(--text-3, var(--text)); font: 600 13px/1 var(--font-body); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.share-head .icon-btn { border: 0; background: none; color: var(--text-3, var(--text)); font-size: 16px; cursor: pointer; padding: 6px 8px; }
.share-stage { display: grid; place-items: center; padding: 16px; background: #06070a; }
.share-stage canvas { display: block; width: auto; max-width: 100%; height: auto; max-height: 56vh; border-radius: 10px; }
.share-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; }
.share-note { color: var(--text-3, var(--text)); font-size: 13px; }

/* local tournaments: the finder on /events and the way to it from the archive */
.near-opts { display: flex; flex-wrap: wrap; gap: 8px 18px; flex: 1 1 100%; margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.near-opts label { display: inline-flex; align-items: center; gap: 8px; }
.near-opts select { height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 550 13.5px var(--font-body); }
.local-out { margin: 12px -18px 0; transition: opacity 0.15s; }
.local-out:empty { display: none; }
.local-out.busy { opacity: 0.5; }
.local-out .formats { padding: 0 18px; margin-bottom: 12px; }
.local-out .formats .chip { cursor: pointer; font-family: inherit; }
.local-out .sub-line { padding: 10px 18px 0; }
.local-out .place { text-align: right; line-height: 1.35; }
.local-more { margin: 16px 18px 8px; font: 700 14px var(--font-display); }
.local-cta { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 16px; }
.local-cta > svg { flex: none; color: var(--brand-text); }
.local-cta .grow { flex: 1; min-width: 0; }
.local-cta b { display: block; font-size: 14.5px; }
.local-cta .grow span { font-size: 13px; color: var(--text-3); }
.local-cta:hover { border-color: var(--line-2); }
@media (max-width: 640px) { .local-out { margin-left: -14px; margin-right: -14px; } .local-cta .btn { display: none; } }

/* the header's plain link, the account button */
.menu-link { height: 36px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 14.5px; color: var(--text-2); display: flex; align-items: center; }
.menu-link:hover, .menu-link.here { color: var(--text); background: var(--surface-2); }
.account-link { position: relative; }
.on-dot { position: absolute; right: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-mark); box-shadow: 0 0 0 2px var(--bg); }
.on-dot[hidden] { display: none; }

/* calendar */
.cal-bar { padding: 16px 18px; margin-bottom: 14px; }
.cal-bar .sub-line { margin-top: 10px; }
.cal-bar .sub-line button.link { font-size: inherit; }
.cal-within select { height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 550 14px var(--font-body); }
.cal-filters { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-bottom: 14px; }
.cal-filters .formats { margin: 0; min-width: 0; }
.cal-filters .chip { font-family: inherit; cursor: pointer; }
.cal { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.cal-month { overflow: hidden; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.cal-head h2 { font-size: 24px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav .icon-btn { width: 36px; height: 36px; font-size: 20px; line-height: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); border-top: 1px solid var(--line); transition: opacity 0.15s; }
.cal-grid.busy { opacity: 0.5; }
.cal-dow { background: var(--surface); padding: 9px 10px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.cal-dow abbr { text-decoration: none; }
.cal-cell { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 6px; min-height: 112px; min-width: 0; padding: 8px; background: var(--surface); text-align: left; color: var(--text); cursor: pointer; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell:focus-visible { outline: 2px solid var(--brand-text); outline-offset: -2px; }
.cal-num { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; font: 700 13.5px var(--font-display); }
.cal-cell.other { background: var(--bg-2); }
.cal-cell.other .cal-num, .cal-cell.past .cal-num { color: var(--text-3); }
.cal-cell.other .cal-evs { opacity: 0.5; }
.cal-cell.today .cal-num { background: var(--brand); color: var(--brand-ink); }
.cal-cell.on { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--brand-mark); }
.cal-evs { display: grid; gap: 3px; min-width: 0; }
.cal-ev { display: block; padding: 2px 6px; border-radius: 5px; border-left: 3px solid var(--g); background: color-mix(in srgb, var(--g) 10%, transparent); font-size: 11.5px; line-height: 1.45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.cal-ev.big { background: color-mix(in srgb, var(--g) 26%, transparent); color: var(--text); font-weight: 650; }
.cal-ev.saved { box-shadow: inset 0 0 0 1px var(--g); color: var(--text); }
.cal-more { padding-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.cal-day .empty p { margin: 14px 0 0; }
.cal-dots { display: none; }
.cal-day { position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow-y: auto; }
.cal-item { padding: 14px 18px; border-top: 1px solid var(--line); }
.cal-item-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.cal-item h3 { margin: 8px 0 4px; font: 650 15px/1.35 var(--font-body); overflow-wrap: anywhere; }
.cal-item h3 a:hover { color: var(--brand-text); }
.cal-item p { margin: 0; font-size: 13px; color: var(--text-2); }
.cal-item p svg { vertical-align: -2px; color: var(--text-3); }
.cal-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cal-acts .btn.saved { color: var(--brand-text); border-color: var(--brand-text); }
.cal-acts .btn svg { width: 14px; height: 14px; }
.cal-credit { margin-top: 14px; }

/* account */
.account { max-width: 620px; }
.account .panel-body { padding-top: 18px; }
.account h2 { margin: 0 0 6px; }
.acc-lead { margin: 0 0 16px; color: var(--text-2); }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid #747775; background: #ffffff; color: #1f1f1f; font-weight: 600; font-size: 15px; }
.google-btn:hover { background: #f5f6f7; }
.google-btn:focus-visible { outline: 2px solid var(--brand-text); outline-offset: 2px; }
.acc-or { display: flex; align-items: center; gap: 12px; margin: 14px 0; font-size: 13px; color: var(--text-3); }
.acc-or::before, .acc-or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.acc-spam { margin: 4px 0 12px; padding: 11px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); font-size: 14px; color: var(--text-2); }
.acc-spam b { color: var(--text); }
.acc-error { margin: 8px 0 0; min-height: 1.5em; font-size: 13.5px; color: var(--down); }
.acc-list, .acc-holds { margin: 8px 0 14px; padding: 0; list-style: none; display: grid; gap: 7px; font-size: 14px; color: var(--text-2); }
.acc-list li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 10px 1px 0; background: var(--brand-mark); border-radius: 2px; }
.acc-holds { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.acc-holds li { padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.acc-holds b { color: var(--text); }
.acc-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.account hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0 4px; }
.acc-del { margin-top: 18px; font-size: 14px; color: var(--text-2); }
.acc-del summary { cursor: pointer; color: var(--text-3); }
.btn.danger { color: var(--down); border-color: var(--down); }

@media (max-width: 900px) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .cal-day { position: static; max-height: none; }
  .cal-filters .formats { flex: 1 1 100%; }
}
@media (max-width: 700px) {
  .cal-cell { min-height: 58px; padding: 5px 2px; align-items: center; gap: 4px; }
  .cal-evs { display: none; }
  .cal-dots { display: flex; gap: 3px; min-height: 7px; }
  .cal-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--g); }
  .cal-cell.other .cal-dots { opacity: 0.45; }
  .cal-dow { padding: 8px 0; text-align: center; font-size: 10px; letter-spacing: 0.04em; }
  .cal-head { padding: 14px; }
  .cal-head h2 { font-size: 18px; white-space: nowrap; }
  .cal-nav { gap: 5px; }
  .cal-nav .icon-btn { width: 34px; height: 34px; }
  .cal-bar .near-form .btn, .cal-within, .cal-within select { flex: 1 1 auto; width: 100%; justify-content: center; }
  .cal-bar .near-form .btn { width: auto; }
  .cal-within { width: auto; }
}
/* the tab bar takes over at 760px; it has six items, the watchlist among them */
@media (max-width: 760px) {
  .watch-link { display: none; }
  .tabbar { grid-template-columns: repeat(6, 1fr); }
}
/* tablets: the header has no room for the words in the search box, only for its icon */
@media (min-width: 761px) and (max-width: 940px) {
  .search-btn { padding: 0; justify-content: center; flex: 0 0 38px; }
  .search-btn span, .search-btn kbd { display: none; }
  .top-row { gap: 10px; }
  .menus { gap: 0; }
  .menu > button, .menu-link { padding: 0 9px; }
}
/* card pages on tablets: four buttons do not fit in a row beside the picture */
@media (max-width: 940px) {
  .actions { grid-template-columns: 1fr 1fr 1fr; }
  .actions .primary { grid-column: 1 / -1; }
}

/* card win rates on deck pages */
#card-win-rates td b.up { color: var(--up); }
#card-win-rates td b.down { color: var(--down); }
#card-win-rates .block { display: block; font-size: 12px; }
#card-win-rates td { vertical-align: middle; }

/* Yu-Gi-Oh! ban list pages */
.ban-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.ban-grid .panel { margin: 0; }
.ban-rows { max-height: 720px; overflow-y: auto; }
.ban-row { grid-template-columns: auto 1fr; min-height: 52px; padding: 6px 16px; }
.ban-row .thumb { width: 28px; }
.ban-row .t1 a { color: inherit; }
.ban-row .t1 a:hover { color: var(--brand-text); }
.set-row { grid-template-columns: minmax(0, 1fr) auto; min-height: 52px; }
.ban-row .grow, .set-row .grow { min-width: 0; }

/* deck builder: Yu-Gi-Oh! format check */
.legal-verdict.ok b { color: var(--up); }
.legal-verdict.bad b { color: var(--down); }
.legal .cmp-row .down { color: var(--down); text-align: right; white-space: normal; }
.legal-foot { margin: 10px 0 0; }
