/* CHOOMDEX -- Night City census terminal */
@import url("/static/fonts/fonts.css");

:root {
  --bg: #030509;
  --surface: #080b11;
  --surface-2: #0e131b;
  --surface-3: #151c27;
  --line: #1d2939;
  --ink: #d8e2ef;
  --ink-2: #8fa3bd;
  --ink-3: #5a6b84;
  --cyan: #22d3ee;
  --cyan-dim: #0e7490;
  --yellow: #fcee0a;
  --magenta: #ff2a6d;
  --green: #34d399;
  --red: #f87171;
  --violet: #a78bfa;
  --mono: "Chivo Mono", "Cascadia Code", Consolas, monospace;
  --sans: "Segoe UI", system-ui, sans-serif;
  --display: "Genos", "Segoe UI", sans-serif;
  --chrome-grad: linear-gradient(180deg, #f4f7fb 0%, #aab6c6 45%, #7c8ba0 50%, #c9d3df 55%, #5d6b7f 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}

/* faint scanline texture, kept subtle enough to never fight the data */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg, transparent 0 2px, rgba(255,255,255,0.012) 2px 4px);
  z-index: 9999;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: var(--mono);
  background: var(--surface-2);
  color: var(--cyan);
  border: 1px solid var(--cyan-dim);
  padding: 7px 14px;
  cursor: pointer;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background .15s, color .15s;
}
button:hover { background: var(--cyan-dim); color: #06121a; }
button.warn { color: var(--yellow); border-color: #8a8206; }
button.warn:hover { background: #8a8206; color: #111; }
button.danger { color: var(--magenta); border-color: #8a1d44; }
button.danger:hover { background: #8a1d44; color: #fff; }
button:disabled { opacity: .4; cursor: not-allowed; }

input, select, textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 13px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan-dim);
}

/* ------------------------------------------------------------ layout */
/* Compact utility bar: the brand statement lives in the page hero, so the
   header stays a small wordmark + nav and doesn't compete with it. */
header {
  display: flex; align-items: center; gap: 26px;
  padding: 8px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 100;
  flex-wrap: wrap;
}
.hdr-top { display: contents; }

.logo { user-select: none; display: flex; align-items: center; }
.logo img { height: 46px; width: auto; display: block; }

.icon-btn {
  clip-path: none; border: none; background: transparent;
  color: var(--ink-2); font-size: 19px; padding: 5px 8px; position: relative;
}
.icon-btn:hover { color: var(--cyan); background: transparent; }
.icon-btn.bell.hot { color: var(--magenta); }
#bell-n {
  position: absolute; top: -2px; right: -2px;
  font-family: var(--mono); font-size: 9px; color: var(--yellow);
}
#avatar {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--yellow); color: var(--yellow);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
}
#avatar:hover { text-decoration: none; box-shadow: 0 0 10px rgba(252,238,10,.4); }
.plus-btn {
  clip-path: none; background: var(--ink); color: #05070b;
  border: 1px solid var(--ink); font-weight: 700;
}
.plus-btn:hover { background: var(--yellow); border-color: var(--yellow); color: #05070b; }

nav { display: flex; gap: 2px; flex-wrap: wrap; }
nav a {
  font-family: var(--display); font-weight: 600; font-size: 16px;
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--ink-2); padding: 10px 16px;
  border-bottom: 2px solid transparent;
}
nav a:hover { color: var(--cyan); text-decoration: none; background: rgba(34,211,238,.04); }
nav a.active {
  color: var(--yellow);
  border-bottom-color: var(--magenta);
  background: rgba(255,42,109,.05);
}

.hdr-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

#live-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-3);
  display: inline-block;
}
#live-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
#live-label { font-family: var(--mono); font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; }

main { max-width: 1280px; margin: 0 auto; padding: 26px 22px 80px; }

h1 {
  font-family: var(--display); font-weight: 800; font-size: 34px;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px;
  background: var(--chrome-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: #aab6c6;
}
h1::before { content: "▞ "; -webkit-text-fill-color: var(--magenta); }
.sub { color: var(--ink-3); font-size: 13px; margin-bottom: 22px; font-family: var(--mono); }

h2 {
  font-family: var(--display); font-weight: 700; font-size: 19px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--cyan);
  margin: 26px 0 12px; display: flex; align-items: center; gap: 10px;
}
h2::after {
  content: ""; flex: 1; height: 1px; max-width: 220px;
  background: linear-gradient(90deg, var(--cyan-dim), transparent);
}

/* ------------------------------------------------------------ cards & grid */
.grid { display: grid; gap: 14px; }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 16px;
  position: relative;
}
.card::after {
  content: ""; position: absolute; top: 0; left: 0;
  width: 34px; height: 2px; background: var(--cyan);
}

.stat-tile { text-align: left; }
.stat-tile .label { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-3); }
.stat-tile .value { font-family: var(--mono); font-size: 30px; font-weight: 700; color: var(--ink); line-height: 1.2; }
.stat-tile .hint { font-size: 12px; color: var(--ink-2); }

/* ------------------------------------------------------------ tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td { padding: 8px 10px; border-bottom: 1px solid #16202f; vertical-align: middle; }
tr:hover td { background: rgba(34,211,238,.03); }
td.num, th.num { text-align: right; font-family: var(--mono); }
.table-wrap { overflow-x: auto; }

/* ------------------------------------------------------------ badges */
.badge {
  display: inline-block; font-family: var(--mono); font-size: 10.5px;
  padding: 2px 8px; text-transform: uppercase; letter-spacing: .08em;
  border: 1px solid; white-space: nowrap;
}
.badge.conf-confirmed { color: var(--green); border-color: #14532d; }
.badge.conf-probable  { color: var(--cyan); border-color: var(--cyan-dim); }
.badge.conf-estimated { color: var(--yellow); border-color: #713f12; }
.badge.conf-inferred  { color: var(--violet); border-color: #4c1d95; }
.badge.conf-unknown   { color: var(--ink-3); border-color: var(--line); }

.badge.scar-low_supply { color: var(--magenta); border-color: #8a1d44; }
.badge.scar-tightly_held { color: var(--yellow); border-color: #713f12; }
.badge.scar-common_underrated { color: var(--cyan); border-color: var(--cyan-dim); }
.badge.scar-unknown { color: var(--ink-3); border-color: var(--line); }

.badge.vt { color: var(--ink-2); border-color: var(--line); }

/* investment letter chips */
.letter {
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; padding: 3px 7px;
  border: 1px solid;
}
.letter[data-l^="A"] { color: var(--green); border-color: #14532d; background: rgba(52,211,153,.07); }
.letter[data-l^="B"] { color: var(--cyan); border-color: var(--cyan-dim); background: rgba(34,211,238,.06); }
.letter[data-l^="C"] { color: var(--yellow); border-color: #713f12; background: rgba(252,238,10,.05); }
.letter[data-l^="D"], .letter[data-l="F"] { color: var(--ink-3); border-color: var(--line); }
.letter small { font-size: 9px; margin-left: 4px; color: var(--ink-3); }

/* trend: color + arrow glyph + text, never color alone */
.trend { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.flat { color: var(--ink-3); }

/* ------------------------------------------------------------ score bars */
.axis-row { display: grid; grid-template-columns: 170px 1fr 46px; gap: 10px; align-items: center; margin-bottom: 7px; }
.axis-row .name { font-family: var(--mono); font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.axis-row .val { font-family: var(--mono); font-size: 12px; color: var(--ink); text-align: right; }
.bar-track { height: 8px; background: var(--surface-3); position: relative; }
.bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--cyan-dim), var(--cyan));
  border-radius: 0 4px 4px 0;
}
.bar-fill.neutral { background: var(--ink-3); opacity: .55; }

/* ------------------------------------------------------------ card gallery */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.tcg-card {
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform .12s, border-color .12s, box-shadow .12s;
  overflow: hidden;
}
.tcg-card:hover {
  transform: translateY(-4px);
  border-color: var(--magenta);
  box-shadow: 0 6px 24px rgba(255,42,109,.18);
}
.tcg-card img {
  width: 100%; aspect-ratio: 5/7; object-fit: cover; display: block;
  background: var(--surface-2);
}
.tcg-card .c-body { padding: 8px 10px 10px; }
.tcg-card .c-name {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  line-height: 1.25; min-height: 2.5em;
}
.tcg-card .c-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; align-items: center; }

.chip {
  font-family: var(--mono); font-size: 10px; padding: 1px 6px;
  border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap;
}
.chip.cost { color: var(--yellow); border-color: #713f12; }
.chip.pwr  { color: var(--magenta); border-color: #8a1d44; }
.chip.ram  { color: var(--cyan); border-color: var(--cyan-dim); }

.chip.r-common    { color: var(--ink-2); }
.chip.r-uncommon  { color: var(--green); border-color: #14532d; }
.chip.r-rare      { color: var(--cyan); border-color: var(--cyan-dim); }
.chip.r-epic, .chip.r-epic-rare { color: var(--violet); border-color: #4c1d95; }
.chip.r-nova-rare { color: var(--yellow); border-color: #713f12;
  text-shadow: 0 0 8px rgba(252,238,10,.5); }
.chip.r-secret    { color: var(--magenta); border-color: #8a1d44;
  text-shadow: 0 0 8px rgba(255,42,109,.5); }

/* printing / edition badges — Beta and friends are different assets, so they
   read loudly rather than blending in with gameplay stats */
.chip.print { font-weight: 700; letter-spacing: .1em; }
.chip.p-beta {
  color: #05070b; background: var(--yellow); border-color: var(--yellow);
  box-shadow: 0 0 8px rgba(252,238,10,.35);
}
.chip.p-alpha {
  color: #05070b; background: var(--magenta); border-color: var(--magenta);
  box-shadow: 0 0 8px rgba(255,42,109,.4);
}
.chip.p-demo { color: var(--violet); border-color: #4c1d95; }
.chip.p-promo { color: var(--yellow); border-color: #713f12; }
.chip.p-ks {
  color: #05070b; background: var(--cyan); border-color: var(--cyan);
}
.chip.p-starter { color: var(--ink-2); border-color: var(--line); }

.chip.t-legend  { color: var(--yellow); border-color: #713f12; }
.chip.t-unit    { color: var(--ink); }
.chip.t-gear    { color: var(--green); border-color: #14532d; }
.chip.t-program { color: var(--violet); border-color: #4c1d95; }

/* faction dot: color + text label always together (never color alone) */
.fac { font-family: var(--mono); font-size: 10px; color: var(--ink-2); }
.fac::before { content: "●"; margin-right: 3px; }
.fac.f-red::before { color: #f87171; }
.fac.f-blue::before { color: #60a5fa; }
.fac.f-green::before { color: #34d399; }
.fac.f-yellow::before { color: #fcee0a; }
.fac.f-purple::before { color: #a78bfa; }
.fac.f-colorless::before, .fac.f-none::before { color: var(--ink-3); }

/* ---------------------------------------------- dex navigation (Pokedex) */
.dex-nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; padding: 8px 14px;
  border: 1px solid var(--line); background: var(--surface);
}
.dex-arrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  color: var(--cyan); padding: 4px 10px; white-space: nowrap;
}
.dex-arrow:hover { color: var(--yellow); text-decoration: none; }
.dex-arrow.off { color: var(--ink-3); opacity: .4; }
.dex-pos { font-size: 12px; color: var(--ink-3); letter-spacing: .08em; }

/* ------------------------------------------------- quick search overlay */
#qs-wrap {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.72); backdrop-filter: blur(3px);
  display: flex; justify-content: center; align-items: flex-start;
  padding-top: 12vh;
}
.qs-box {
  width: min(620px, 92vw); background: var(--surface);
  border: 1px solid var(--cyan-dim); box-shadow: 0 0 40px rgba(34,211,238,.12);
}
#qs-input {
  width: 100%; border: none; border-bottom: 1px solid var(--line);
  padding: 16px 18px; font-size: 16px; background: transparent;
}
#qs-input:focus { box-shadow: none; border-color: var(--cyan); }
.qs-row {
  display: grid; grid-template-columns: 38px 1fr auto; gap: 12px;
  align-items: center; padding: 8px 14px; cursor: pointer;
  border-bottom: 1px solid #121a26; font-size: 14px;
}
.qs-row img { width: 38px; height: 52px; object-fit: cover; background: var(--surface-2); }
.qs-row:hover, .qs-row.on { background: rgba(34,211,238,.08); }
.qs-hint { padding: 8px 14px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .1em; }

/* --------------------------------------------------------- empty state */
.empty-state { text-align: center; padding: 44px 20px; }
.empty-state .es-icon { font-size: 54px; color: var(--ink-3); opacity: .5; margin-bottom: 8px; }
.empty-state ul { list-style: none; margin: 10px 0 18px; font-size: 13.5px; }
.empty-state li { padding: 3px 0; }

/* ------------------------------------------------------ cookie consent */
#cookie-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 600;
  background: #060a11; border-top: 1px solid var(--cyan-dim);
  padding: 14px 22px; display: flex; gap: 20px; align-items: center;
  flex-wrap: wrap; box-shadow: 0 -8px 30px rgba(0,0,0,.6);
}
#cookie-bar .cb-text { flex: 1; min-width: 260px; font-size: 13px; color: var(--ink-2); }
#cookie-bar .cb-btns { display: flex; gap: 10px; }

/* agent ops panel */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.agent-card { border: 1px solid var(--line); background: var(--surface); padding: 16px; }
.agent-card.revoked { opacity: .45; }
.ag-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ag-name { font-size: 17px; font-weight: 700; color: var(--yellow); letter-spacing: .12em; }
.ag-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-left: auto; }
.ag-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.ag-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); margin-bottom: 8px; }
.ag-stats b { font-size: 15px; }
.ag-acc { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; flex-wrap: wrap; gap: 6px; }

/* agent review queue */
.sugg-row {
  display: flex; justify-content: space-between; gap: 14px;
  align-items: center; padding: 10px 0; border-bottom: 1px solid #121a26;
  flex-wrap: wrap;
}
.sugg-row b { font-size: 14px; }

/* Choom+ */
nav a.plus-link { color: var(--yellow); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; max-width: 900px; }
.plan { border: 1px solid var(--line); background: var(--surface); padding: 22px; }
.plan.featured { border-color: var(--yellow); box-shadow: 0 0 24px rgba(252,238,10,.08); }
.plan h3 { font-family: var(--display); font-size: 24px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2px; }
.plan .price { font-family: var(--mono); font-size: 20px; color: var(--yellow); margin-bottom: 14px; }
.plan ul { list-style: none; }
.plan li { padding: 5px 0; font-size: 14px; border-bottom: 1px solid #121a26; }
.plan li::before { content: "▸ "; color: var(--cyan); }
.plan li.soon::after { content: " (soon)"; color: var(--ink-3); font-size: 11px; }

/* deck verdict banner */
.deck-verdict {
  border: 1px solid var(--line); background: var(--surface);
  padding: 14px 18px; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 18px; flex-wrap: wrap;
}
.deck-verdict.legal { border-color: #14532d; }
.deck-verdict.illegal { border-color: #713f12; }
.dv-grade {
  font-size: 26px; min-width: 54px; padding: 6px 10px; margin-right: 14px;
  vertical-align: middle;
}
.dv-arch {
  font-family: var(--display); font-weight: 800; font-size: 26px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--cyan);
  margin-right: 12px;
}
.dv-blurb { font-size: 13.5px; color: var(--ink-2); }
.dv-legal { font-size: 11px; letter-spacing: .1em; text-align: right; }

/* decks */
.deck-row { display: flex; align-items: center; gap: 14px; }
.curve { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin: 10px 0; }
.curve .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.curve .bar { width: 100%; background: linear-gradient(180deg, var(--cyan), var(--cyan-dim)); border-radius: 3px 3px 0 0; min-height: 2px; }
.curve .lbl { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
.deck-card-row { display: grid; grid-template-columns: 40px 44px 1fr auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #121a26; }
.qty-ctl { display: flex; gap: 4px; align-items: center; }
.qty-ctl button { padding: 2px 9px; }

/* portfolio chart */
.pf-chart { width: 100%; height: 190px; }
.pf-chart .line-value { fill: none; stroke: var(--cyan); stroke-width: 2; }
.pf-chart .line-cost { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 5 4; }
.pf-legend { display: flex; gap: 18px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); margin-top: 6px; }

/* shop links */
.shop-btn { background: #1a2210; color: var(--yellow); border-color: #713f12; }
.shop-btn:hover { background: #713f12; color: #fff; }

/* checklist / ownership */
.own-btn {
  font-family: var(--mono); font-size: 10px; padding: 2px 7px;
  letter-spacing: .06em; clip-path: none;
  background: var(--surface-2); color: var(--ink-3);
  border: 1px solid var(--line);
}
.own-btn:hover { background: var(--surface-3); color: var(--ink); }
.own-btn.on {
  color: #06121a; background: var(--green); border-color: var(--green);
  font-weight: 700;
}
.own-btn.on:hover { background: #2bb381; }
.tcg-card.owned { border-color: #14532d; }
.tcg-card.owned::before {
  content: "✔"; position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: var(--green); color: #06121a; font-weight: 700; font-size: 13px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(52,211,153,.5);
}
.tcg-card { position: relative; }

.own-progress {
  border: 1px solid var(--line); background: var(--surface);
  padding: 12px 16px; margin-bottom: 14px;
}
.own-progress .op-label {
  display: flex; justify-content: space-between; margin-bottom: 8px;
  font-size: 12px; color: var(--ink-2); letter-spacing: .1em;
}
.own-progress .bar-fill {
  background: linear-gradient(90deg, #14532d, var(--green));
  transition: width .3s;
}

/* thumbnails in tables */
.thumb {
  width: 42px; height: 58px; object-fit: cover; display: block;
  border: 1px solid var(--line); background: var(--surface-2);
}

/* ------------------------------------------------- dashboard (mock v2) */
/* Hero: the brand statement. Big logo art with the search bar integrated
   directly beneath it, greebles pinned to the corners. Swap the art by
   dropping a new hero-logo.png in web/img/ — it falls back to banner.png. */
.dash-hero {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 26px 0 22px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.dh-logo {
  display: block;
  width: 100%; max-width: 860px; height: auto;
  margin: 0 auto 4px;
}

@media (max-width: 760px) {
  }
.dh-greeble {
  font-size: 10px; letter-spacing: .16em; color: var(--ink-3); white-space: nowrap;
}
.dh-greeble.right { color: var(--cyan); margin-left: auto; }
.dh-search {
  display: flex; gap: 10px; flex-basis: 100%;
}

@media (max-width: 760px) {
  }

/* Hover: no extra line — the frame *is* the border. Instead the frame itself
   lights up, which reads as the panel powering on rather than a box appearing
   around it. */

@media (prefers-reduced-motion: reduce) {
    }
.dh-search input { flex: 1; padding: 12px 16px; font-size: 15px; }

.stat-row, .cat-row {
  display: grid; gap: 14px; margin-bottom: 18px;
}
.stat-row { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cat-row { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

.ntile {
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 12px;
  align-items: center; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink);
}
.ntile:hover { text-decoration: none; transform: translateY(-2px); }
.ntile .nt-icon { font-size: 27px; grid-row: span 2; }
.ntile .nt-n { font-family: var(--mono); font-size: 27px; font-weight: 700; line-height: 1.15; }
.ntile .nt-l { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--ink-2); }
.ntile .nt-go { grid-column: 1 / -1; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; margin-top: 10px; }
.c-cyan { border-color: #0e4b57; } .c-cyan .nt-icon, .c-cyan .nt-go, .c-cyan .ct-icon { color: var(--cyan); }
.c-mag { border-color: #59122f; } .c-mag .nt-icon, .c-mag .nt-go, .c-mag .ct-icon { color: var(--magenta); }
.c-yel { border-color: #4d4805; } .c-yel .nt-icon, .c-yel .nt-go, .c-yel .ct-icon { color: var(--yellow); }
.c-cyan:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(34,211,238,.12); }
.c-mag:hover { border-color: var(--magenta); box-shadow: 0 0 18px rgba(255,42,109,.12); }
.c-yel:hover { border-color: var(--yellow); box-shadow: 0 0 18px rgba(252,238,10,.1); }

.cat-tile {
  display: flex; flex-direction: column; gap: 8px;
  padding: 20px 18px; background: var(--surface);
  border: 1px solid var(--line); color: var(--ink); min-height: 108px;
}
.cat-tile:hover { text-decoration: none; transform: translateY(-2px); }
.cat-tile .ct-icon { font-size: 30px; }
.cat-tile .ct-label { font-family: var(--mono); font-size: 13px; letter-spacing: .12em; font-weight: 600; }
.cat-tile .ct-arrow { margin-left: auto; color: var(--ink-3); }

/* --- set tracker: card strip + reveal progress (best of v1) ------------ */
.set-tracker {
  border: 1px solid #59122f; margin-bottom: 20px; padding: 18px 20px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48'%3E%3Cpath d='M14 0 L42 0 L56 24 L42 48 L14 48 L0 24 Z' fill='none' stroke='%23ff2a6d' stroke-opacity='0.05'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255,42,109,.05), rgba(34,211,238,.03));
}
.st-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 18px; flex-wrap: wrap; margin-bottom: 12px;
}
.st-head h2 { margin: 0; color: var(--magenta); font-size: 21px; }
.st-head h2::after { display: none; }
.st-sub { font-size: 10.5px; letter-spacing: .16em; margin-top: 2px; }
.st-stats { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); letter-spacing: .1em; }
.st-stats b { color: var(--ink); font-size: 15px; }

.st-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.st-bar { flex: 1; height: 8px; background: var(--surface-3); }
.st-fill {
  height: 100%; border-radius: 0 4px 4px 0;
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
}
.st-count { font-size: 11px; color: var(--ink-2); letter-spacing: .1em; white-space: nowrap; }

.st-order { font-size: 10px; letter-spacing: .16em; margin-bottom: 8px; }

/* a wall of card art, not a thin strip -- one column fewer, larger tiles */
.st-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
  gap: 16px;
}
.st-strip .c-name { font-size: 12px; min-height: 2.4em; }

.st-foot {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  margin-top: 10px; font-size: 11px; letter-spacing: .1em;
}
.st-foot a { color: var(--cyan); }
.st-foot a:hover { color: var(--yellow); text-decoration: none; }
.st-foot .muted { margin-left: auto; font-size: 10px; }

.panel-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px; margin-bottom: 18px;
}
.panel { background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid #10161f;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--ink);
}
.panel-head a { font-size: 10.5px; color: var(--ink-3); }
.panel-head a:hover { color: var(--cyan); }
.p-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px;
  align-items: center; padding: 10px 14px; border-bottom: 1px solid #0d1219;
}
.p-row:hover { background: rgba(34,211,238,.03); }
.p-name { font-size: 13.5px; font-weight: 600; line-height: 1.3; }
.p-time { font-size: 10.5px; }
.panel-foot {
  margin-top: auto; display: flex; justify-content: space-between;
  padding: 10px 14px; border-top: 1px solid #10161f;
  font-size: 10.5px; letter-spacing: .1em;
}

.legacy-banner {
  border: 1px solid #4d4805; padding: 22px 26px; margin-bottom: 8px;
  display: flex; gap: 26px; align-items: center; flex-wrap: wrap;
  background:
    radial-gradient(circle at 8% 50%, rgba(252,238,10,.05), transparent 40%),
    var(--surface);
}
.legacy-banner .lb-title h2 { margin: 0; color: var(--yellow); }
.legacy-banner .lb-title h2::after { display: none; }
.lb-feats { display: flex; gap: 30px; flex-wrap: wrap; margin-left: auto; }
.lb-feats span { font-size: 11.5px; letter-spacing: .08em; color: var(--ink); line-height: 1.6; }
.lb-feats small { color: var(--ink-3); font-size: 10px; letter-spacing: .04em; }

/* footer */
/* ------------------------------------------------------------ footer */
#site-footer {
  border-top: 1px solid var(--line); margin-top: 40px;
  background: var(--surface);
}
.ft-inner {
  max-width: 1280px; margin: 0 auto; padding: 22px 22px 20px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px; font-size: 11.5px; color: var(--ink-3);
}

.ft-brand { display: flex; align-items: center; gap: 12px; }
.ft-badge { width: 40px; height: 40px; display: block; flex-shrink: 0; }
.ft-title { font-size: 11px; letter-spacing: .12em; color: var(--ink-2); }
.ft-copy  { font-size: 10px; letter-spacing: .12em; color: var(--ink-3); margin-top: 2px; }

.ft-links { display: flex; gap: 22px; flex-wrap: wrap; }
.ft-links a { color: var(--ink-3); font-size: 11px; letter-spacing: .14em; }
.ft-links a:hover { color: var(--cyan); text-decoration: none; }

.ft-social { display: flex; align-items: center; gap: 14px; }
.ft-ico {
  background: none; border: none; padding: 0; cursor: pointer;
  width: 26px; height: 26px; display: flex; align-items: center;
  justify-content: center; clip-path: none;
  opacity: .55; transition: opacity .15s, transform .15s, filter .15s;
}
.ft-ico img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ft-ico:hover {
  opacity: 1; transform: translateY(-2px); background: none;
  filter: drop-shadow(0 0 7px rgba(255, 42, 109, .55));
}
.ft-mail {
  color: var(--ink); font-size: 19px; line-height: 1; text-decoration: none;
}
.ft-mail:hover { color: var(--magenta); text-decoration: none; }

.ft-note {
  max-width: 1280px; margin: 0 auto; padding: 0 22px 16px;
  font-size: 11px; color: var(--green); letter-spacing: .1em;
}

@media (max-width: 760px) {
  .ft-inner { justify-content: center; text-align: center; gap: 16px; }
  .ft-links { justify-content: center; gap: 16px; }
}

/* TCG hero on dashboard */
.hero {
  border: 1px solid var(--magenta);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='48'%3E%3Cpath d='M14 0 L42 0 L56 24 L42 48 L14 48 L0 24 Z' fill='none' stroke='%2322d3ee' stroke-opacity='0.06'/%3E%3C/svg%3E"),
    linear-gradient(135deg, rgba(255,42,109,.06), rgba(34,211,238,.05));
  padding: 20px;
  margin-bottom: 22px;
  position: relative;
}
.hero::after {
  content: ""; position: absolute; top: 0; left: 0;
  width: 60px; height: 3px; background: var(--magenta);
}
.hero h2 { margin: 0 0 4px; color: var(--magenta); font-size: 22px; }
.hero h2::after { display: none; }
.hero .hero-sub { font-family: var(--mono); font-size: 12px; color: var(--ink-2); margin-bottom: 14px; }
.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-bottom: 16px; }
.hero-stat .n { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--yellow); }
.hero-stat .l { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.hero-strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.hero-strip .tcg-card { min-width: 132px; max-width: 132px; }
.hero-strip .c-name { font-size: 11px; min-height: 2.4em; }

/* category hub pages */
.cat-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 10px; }
.cat-strip img {
  height: 150px; border: 1px solid var(--line); flex-shrink: 0;
  transition: transform .12s, border-color .12s; cursor: pointer;
}
.cat-strip img:hover { transform: translateY(-3px); border-color: var(--cyan); }
.series-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.series-head .meta { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }

/* codex */
.codex-toc {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.codex-toc a {
  font-family: var(--mono); font-size: 11px; letter-spacing: .08em;
  padding: 6px 11px; border: 1px solid var(--line); color: var(--ink-2);
}
.codex-toc a:hover {
  text-decoration: none; color: var(--cyan); border-color: var(--cyan-dim);
  background: rgba(34,211,238,.05);
}
.cx-flash { animation: cxflash 1.6s ease-out; }
@keyframes cxflash {
  0%, 40% { color: var(--yellow); text-shadow: 0 0 14px rgba(252,238,10,.5); }
  100% { color: var(--cyan); text-shadow: none; }
}

.codex-block { max-width: 860px; }
.codex-block p, .codex-block li { font-size: 14.5px; color: var(--ink); margin-bottom: 8px; }
.codex-block ul { padding-left: 22px; margin-bottom: 12px; }
.codex-block .example { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }

/* circuit divider */
.trace {
  height: 14px; margin: 8px 0 18px; position: relative;
  background:
    linear-gradient(90deg, var(--magenta) 0 40px, transparent 40px) left center / 100% 2px no-repeat;
}
.trace::after {
  content: ""; position: absolute; right: 0; top: 6px; width: 40px; height: 2px;
  background: var(--cyan);
}

/* card detail layout */
.card-detail { display: flex; gap: 24px; flex-wrap: wrap; }
.card-detail .art { max-width: 340px; width: 100%; border: 1px solid var(--line); }
.rules-box {
  background: var(--surface-2); border-left: 3px solid var(--cyan);
  padding: 12px 14px; font-size: 13.5px; margin-top: 10px; white-space: pre-wrap;
}
.flavor { color: var(--ink-3); font-style: italic; font-size: 13px; margin-top: 8px; }

/* ------------------------------------------------------------ feed */
#feed {
  position: fixed; right: 0; bottom: 0; width: 340px; max-height: 42vh;
  background: rgba(10,14,20,.96);
  border: 1px solid var(--line); border-right: none; border-bottom: none;
  overflow-y: auto; z-index: 200;
  font-family: var(--mono); font-size: 12px;
}
#feed .feed-head {
  padding: 7px 12px; color: var(--yellow);
  border-bottom: 1px solid var(--line);
  text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px;
  display: flex; justify-content: space-between;
  position: sticky; top: 0; background: #0c1219;
  cursor: pointer;
}
#feed .entry { padding: 6px 12px; border-bottom: 1px solid #121a26; color: var(--ink-2); }
#feed .entry .t { color: var(--ink-3); font-size: 10px; }
#feed .entry.alert { color: var(--yellow); }
#feed.collapsed .entry { display: none; }

/* ------------------------------------------------------------ item detail */
.detail-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.detail-head img { max-width: 190px; border: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.kv dd { color: var(--ink); word-break: break-word; }

.prov-note { font-size: 12px; color: var(--ink-3); font-style: italic; }

/* forms */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 12px 0; }
.form-grid label { display: block; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 3px; }
.form-grid input, .form-grid select { width: 100%; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }

.msg { padding: 10px 14px; font-family: var(--mono); font-size: 13px; margin: 10px 0; border: 1px solid; }
.msg.ok { color: var(--green); border-color: #14532d; }
.msg.err { color: var(--magenta); border-color: #8a1d44; }

/* login */
.login-banner {
  display: block; width: 100%; max-width: 900px;
  margin: 2vh auto 0; border: 1px solid var(--line);
}
.login-box { max-width: 380px; margin: 4vh auto 8vh; }
.login-box input { width: 100%; margin-bottom: 10px; }

.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.mt { margin-top: 16px; }
.clickable { cursor: pointer; }

/* ------------------------------------------------------------ large monitors */
/* Per-monitor scaling: the layout is px-tuned for ~1440p; on QHD+/4K/5K+ the
   whole UI zooms uniformly so nothing reads small at desk distance. */
@media (min-width: 2200px) {
  body { zoom: 1.22; }
}
@media (min-width: 3200px) {
  body { zoom: 1.5; }          /* 4K */
}
@media (min-width: 4600px) {
  body { zoom: 1.9; }          /* 5K+ */
}

/* ------------------------------------------------------------ mobile */
@media (max-width: 900px) {
  /* On a phone the utility controls can't float over a centred logo — there
     isn't room — so the top row goes back to logo-left / controls-right. */
  .hdr-top { justify-content: space-between; padding: 8px 12px 4px; }
  .hdr-right { position: static; transform: none; }
  .logo img { height: 46px; }
  header.scrolled .logo img { height: 38px; }
  header.scrolled .hdr-top { padding: 6px 12px 2px; }
  nav { justify-content: flex-start; padding: 0 8px; }
  .dh-greeble { display: none; }
  .dh-search { flex-direction: column; }
  .lb-feats { margin-left: 0; gap: 16px; }
  .plus-btn { padding: 6px 8px; font-size: 11px; }
  .set-tracker { padding: 14px; }
  .st-strip { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .st-foot .muted { display: none; }
  nav {
    order: 3; width: 100%;
    overflow-x: auto; flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar { display: none; }
  nav a { font-size: 14px; padding: 6px 9px; white-space: nowrap; }
  .hdr-right { gap: 8px; }
  #who { display: none; }
}

@media (max-width: 760px) {
  main { padding: 16px 12px 90px; }
  h1 { font-size: 26px; }
  #feed { width: 100%; max-height: 30vh; }
  .kv { grid-template-columns: 105px 1fr; }
  .axis-row { grid-template-columns: 105px 1fr 38px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .hero { padding: 14px; }
  .hero-stats { gap: 16px; }
  .hero-stat .n { font-size: 21px; }
  .hero-strip .tcg-card { min-width: 110px; max-width: 110px; }
  .cat-strip img { height: 118px; }
  .detail-head img, .card-detail .art { max-width: 100%; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .filters { gap: 6px; }
  .filters input { min-width: 0 !important; flex: 1; }
  button { padding: 8px 12px; }   /* comfortable touch targets */
  #cookie-bar { padding: 12px 14px; gap: 12px; }
  #cookie-bar .cb-btns { width: 100%; }
  #cookie-bar .cb-btns button { flex: 1; }
  .dex-nav { padding: 6px 10px; }
  #qs-wrap { padding-top: 6vh; }
  td, th { padding: 7px 6px; }
  .login-box { margin: 4vh auto; }
}
