:root {
  --bg: #0b0e14;
  --bg-2: #10141c;
  --elev: #151a24;
  --card: #171c27;
  --line: rgba(232, 236, 247, 0.07);
  --line-2: rgba(232, 236, 247, 0.12);
  --text: #f3f5f9;
  --muted: #8b93a7;
  --muted-2: #6b7386;
  --green: #3ee08f;
  --green-2: #8ff0bc;
  --green-dim: rgba(62, 224, 143, 0.12);
  --gold: #d4b45a;
  --gold-2: #efe0ad;
  --red: #ff7a7a;
  --red-dim: rgba(255, 122, 122, 0.12);
  --radius: 14px;
  --max: 1120px;
  --font: "Noto Sans SC", "DM Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --num: "DM Sans", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: dark; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(212, 180, 90, 0.08), transparent 55%),
    radial-gradient(700px 380px at 100% 0%, rgba(62, 224, 143, 0.05), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font-family: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.grain {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 8; opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; padding: 22px 0 64px; }

.top {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  border: 1px solid rgba(212, 180, 90, 0.45);
  background: linear-gradient(180deg, #1c1810, #12100c);
  color: var(--gold); font-weight: 700; font-size: 18px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text strong { font-size: 18px; letter-spacing: 0.04em; }
.logo-text em {
  font-style: normal; font-size: 10px; letter-spacing: 0.16em;
  color: var(--gold); font-family: var(--num); font-weight: 600;
}
.credit-link {
  color: var(--muted); font-size: 12px; text-decoration: none;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line);
}
.credit-link:hover { color: var(--gold); border-color: rgba(212,180,90,.35); }

.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.pub-date {
  color: var(--gold); font-family: var(--num); font-size: 12px;
  letter-spacing: 0.12em; font-weight: 600;
}

.period-switch {
  display: inline-flex; padding: 3px; border-radius: 999px;
  background: var(--elev); border: 1px solid var(--line);
}
.period-switch button {
  appearance: none; border: 0; background: transparent; color: var(--muted);
  padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 500;
}
.period-switch button[aria-selected="true"] {
  background: #1f2430; color: var(--text); box-shadow: 0 0 0 1px var(--line-2);
}
.period-switch button:hover { color: var(--text); }

.hero { margin-top: 28px; }
.kicker {
  margin: 0 0 8px; color: var(--gold); font-family: var(--num);
  font-size: 11px; letter-spacing: 0.18em; font-weight: 600;
}
h1 {
  margin: 0; font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -0.02em;
}
.dollar { color: var(--gold); font-weight: 600; }
.lede { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 22px 0 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 11px;
  min-height: 72px;
}
.stat .v {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-size: 22px; font-weight: 700; letter-spacing: -0.03em;
}
.stat .v.green { color: var(--green); }
.stat .l { margin-top: 4px; color: var(--muted); font-size: 11px; }

.regions {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 4px 0 2px;
}
.regions button {
  appearance: none; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 5px 11px; font-size: 12px; font-weight: 500;
}
.regions button small {
  margin-left: 6px; color: var(--muted-2); font-family: var(--num);
}
.regions button[aria-selected="true"] {
  color: var(--bg); background: var(--gold); border-color: var(--gold); font-weight: 700;
}
.regions button[aria-selected="true"] small { color: rgba(11,14,20,.65); }
.regions button:hover:not([aria-selected="true"]) {
  color: var(--text); border-color: var(--line-2);
}

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 14px 0 8px;
}
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--elev); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; color: var(--muted); min-width: min(280px, 100%);
}
.search input {
  flex: 1; border: 0; outline: none; background: transparent; color: var(--text); font-size: 13px;
}
.range { margin: 0; color: var(--muted-2); font-size: 12px; font-family: var(--num); }

.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
  box-shadow: 0 20px 50px rgba(0,0,0,.28);
}
table.board {
  width: 100%; border-collapse: collapse; min-width: 760px;
}
.board thead th {
  position: sticky; top: 0; z-index: 2;
  background: #1a1f2b;
  color: var(--muted-2); font-size: 11px; font-weight: 600;
  text-align: left; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.board thead th button,
.board thead th span {
  display: inline-flex; align-items: center; gap: 4px;
  width: 100%; padding: 9px 12px;
  background: none; border: 0; color: inherit; cursor: pointer; font: inherit; text-align: inherit;
}
.board thead th.src span { cursor: default; }
.board thead th.num button { justify-content: flex-end; }
.board thead th.is-active { color: var(--gold-2); }
.board thead th.is-active button::after {
  content: attr(data-dir); font-size: 9px; opacity: .8;
}

.board tbody td {
  padding: 8px 12px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.board tbody tr:last-child td { border-bottom: 0; }
.board tbody tr:hover td { background: rgba(255,255,255,0.02); }
.board .num { text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; }
.rank {
  color: var(--muted); font-weight: 600; font-size: 12px; width: 36px;
}
tr.r1 .rank { color: var(--gold); }
.acct { display: flex; flex-direction: column; gap: 1px; min-width: 140px; }
.acct .name { font-weight: 700; color: var(--text); }
.acct .handle {
  color: var(--muted); font-size: 12px; text-decoration: none; font-family: var(--num);
}
.acct .handle:hover { color: var(--gold); }
.region-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  vertical-align: 1px;
  letter-spacing: 0.02em;
}
.regions button[data-region="all"] { font-weight: 600; }
.usd {
  color: var(--green); font-weight: 700; font-size: 15px; letter-spacing: -0.02em;
  white-space: nowrap;
}
.prev, .views { color: var(--muted); font-size: 13px; white-space: nowrap; }
.chg { font-weight: 600; font-size: 12px; white-space: nowrap; }
.chg.up { color: var(--green); }
.chg.down { color: var(--red); }
.chg.flat { color: var(--muted); }
.approx { opacity: .85; }
.src-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 8px;
  color: var(--muted); border: 1px solid var(--line); text-decoration: none;
}
.src-link:hover { color: var(--gold); border-color: rgba(212,180,90,.4); }
.notes-cell { color: var(--muted); font-size: 12px; max-width: 280px; }

.empty {
  padding: 48px 20px; text-align: center; color: var(--muted);
}
.empty h2 { margin: 0 0 8px; color: var(--text); font-size: 18px; }
.empty p { margin: 0 auto; max-width: 420px; }

.foot { margin-top: 22px; color: var(--muted); font-size: 12px; }
.foot p { margin: 0 0 8px; }
.foot a { color: var(--gold-2); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.credit { color: var(--muted-2); }

@media (max-width: 860px) {
  .hide-md { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { width: min(var(--max), calc(100% - 20px)); padding-top: 16px; }
  .hide-sm { display: none; }
  .top { flex-direction: column; }
  table.board { min-width: 520px; }
  .search { min-width: 0; flex: 1; }
  h1 { font-size: 26px; }
}
.muted { color: var(--muted-2); }
.chg.up, .chg.down, .chg.flat { font-variant-numeric: tabular-nums; }
