:root {
  --bg: #000;
  --fg: #fff;
  --muted: #9a9a9a;
  --faint: #5c5c5c;
  --line: #1c1c1c;
  --line-2: #2a2a2a;
  --red: #ff3b2f;
  --amber: #ffb02e;
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --font-display: "Clash Display", "General Sans", sans-serif;
  --font-body: "General Sans", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --pad: clamp(16px, 3vw, 40px);
  --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--fg); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; color: #000; padding: 8px 12px; z-index: 10; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }

/* Header */
.top {
  max-width: var(--max); margin: 0 auto; padding: 20px var(--pad) 12px;
  display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
}
.brand { display: flex; gap: 14px; align-items: center; }
.logo { width: 46px; height: 46px; flex: none; color: var(--fg); }
.logo path:first-of-type { transform-origin: 24px 24px; animation: tick 60s steps(60) infinite; }
@keyframes tick { from { transform: rotate(-6deg); } to { transform: rotate(-0.1deg); } }
h1 {
  font-family: var(--font-display); font-weight: 600; font-size: var(--text-2xl);
  line-height: 0.95; margin: 0; letter-spacing: -0.01em; text-transform: uppercase;
}
.tag { margin: 6px 0 0; color: var(--muted); font-size: var(--text-sm); }
.status { display: flex; gap: 28px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .k { font-size: var(--text-xs); color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; display: flex; align-items: center; gap: 6px; }
.stat .v { font-family: var(--font-mono); font-size: var(--text-sm); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); display: inline-block; }
.dot.on { background: var(--red); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* Headline strip */
.headline {
  max-width: var(--max); margin: 4px auto 0; padding: 10px var(--pad);
  display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap;
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.hl-k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.hl-v { font-size: var(--text-lg); }
.hl-v b { font-weight: 600; }
#top-pct { color: var(--red); margin-left: 6px; }

/* Board */
.board { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.cols, .row-btn {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 260px) 172px;
  gap: 16px; align-items: center;
}
.cols { padding: 10px 0 6px; font-size: var(--text-xs); color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.c-pct { text-align: right; }
.list { list-style: none; margin: 0; padding: 0; position: relative; }
.row { border-top: 1px solid var(--line); background: var(--bg); position: relative; }
.row-btn {
  width: 100%; background: none; border: 0; color: inherit; font: inherit; text-align: left;
  padding: 7px 0; cursor: pointer;
}
.row-btn:hover .name { text-decoration: underline; text-decoration-color: var(--faint); text-underline-offset: 4px; }
.rank { color: var(--faint); font-size: var(--text-sm); }
.name-wrap { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.name { font-weight: 600; font-size: var(--text-base); white-space: nowrap; }
.quip { color: var(--muted); font-size: var(--text-xs); line-height: 1.35; white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.sig { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; justify-content: flex-start; }
.chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 3px; white-space: nowrap;
}
.chip.up { color: var(--fg); border-color: #555; }
.chip.hot { color: var(--red); border-color: rgba(255, 59, 47, .5); }
.pct-wrap { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 46px; grid-template-rows: auto 3px; column-gap: 8px; row-gap: 3px; align-items: baseline; }
.pct { text-align: right; font-size: var(--text-lg); font-weight: 500; line-height: 1.15; }
.delta { font-size: 12px; color: var(--faint); min-width: 44px; text-align: right; }
.delta.up { color: var(--red); }
.delta.down { color: #7fd17f; }
.bar { grid-column: 1 / -1; height: 3px; background: var(--line); display: block; }
.bar i { display: block; height: 100%; background: var(--fg); width: 0; transition: width .9s cubic-bezier(.2, .7, .2, 1); }

/* Top three get extra presence */
.row.top3 .row-btn { padding: 12px 0; }
.row.top3 .name { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); letter-spacing: -0.005em; line-height: 1.1; }
.row.top3 .pct { font-size: var(--text-xl); font-weight: 700; }
.row.top3 .rank { color: var(--fg); }
.row.top3 .bar { height: 4px; }
.row.top3 .bar i, .row.danger .bar i { background: var(--red); }
.row.top3 .pct-wrap { grid-template-rows: auto 4px; }
.row.zero .name, .row.zero .pct { color: var(--muted); }
.row.flash .pct { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { color: var(--red); } 100% { color: inherit; } }

/* Detail */
.detail[hidden] { display: none; }
.detail { padding: 4px 0 18px 60px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; font-size: var(--text-sm); }
.detail h3 { margin: 0 0 8px; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 500; }
.detail ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.detail li { color: #d6d6d6; }
.detail li .src { color: var(--muted); white-space: nowrap; }
.math { font-family: var(--font-mono); font-size: 13px; display: grid; gap: 4px; color: #cfcfcf; }
.math .ln { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line-2); padding-bottom: 3px; }
.math .ln span:first-child { color: var(--muted); }
.math .tot { color: var(--fg); font-weight: 700; border-bottom: 0; }

/* Methodology */
.how { max-width: var(--max); margin: 40px auto 0; padding: 28px var(--pad) 48px; border-top: 1px solid var(--line-2); }
.how h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-xl); margin: 0 0 16px; }
.how-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; }
.how p { color: #cfcfcf; font-size: var(--text-sm); margin: 0 0 12px; max-width: 62ch; }
.how b { color: var(--fg); }
.fine { color: var(--faint) !important; margin-top: 16px !important; }

@media (max-width: 900px) {
  .cols, .row-btn { grid-template-columns: 36px minmax(0, 1fr) 156px; }
  .pct-wrap { grid-template-columns: minmax(0, 1fr) 42px; column-gap: 6px; }
  .delta { min-width: 0; }
  .c-sig, .sig { display: none; }
  .name-wrap { gap: 0; }
  .detail { grid-template-columns: 1fr; padding-left: 52px; gap: 18px; }
  .how-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top { align-items: flex-start; gap: 12px; padding-top: 14px; }
  .brand { gap: 10px; }
  .logo { width: 34px; height: 34px; }
  h1 { font-size: var(--text-xl); }
  .tag { font-size: var(--text-xs); margin-top: 4px; }
  .status { gap: 16px; }
  .headline { gap: 4px 10px; padding: 8px var(--pad); }
  .hl-v { font-size: var(--text-base); }
  .cols, .row-btn { grid-template-columns: 26px minmax(0, 1fr) 96px; gap: 10px; }
  .name { white-space: normal; font-size: var(--text-sm); line-height: 1.25; }
  .pct { font-size: var(--text-base); }
  .delta { min-width: 0; }
  .pct-wrap { grid-template-columns: minmax(0, 1fr) 38px; column-gap: 4px; }
  .cols, .row-btn { grid-template-columns: 26px minmax(0, 1fr) 108px; }
  .detail { padding-left: 0; }
  .row-btn { padding: 6px 0; }
  .row.top3 .row-btn { padding: 9px 0; }
  .row.top3 .name { font-size: var(--text-lg); }
  .row.top3 .pct { font-size: var(--text-lg); }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Footer ---------- */
.foot { max-width: var(--max); margin: 0 auto; padding: 22px var(--pad) 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: var(--text-xs); display: flex; flex-wrap: wrap; gap: 10px 28px; justify-content: space-between; align-items: center; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--fg); }
.foot p { margin: 0; }

/* ---------- Ad slots: hidden until <body class="ads-on"> ---------- */
.ad-slot { display: none; }
.ads-on .ad-slot { display: block; min-height: 100px; margin: 18px 0; text-align: center; overflow: hidden; }
.ads-on li.ad-slot { list-style: none; border-top: 1px solid var(--line); padding: 12px 0; margin: 0; }
.ads-on .ad-slot::before { content: "Advertisement"; display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.ad-wide { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.ad-sticky { display: none; }
@media (max-width: 560px) {
  .ads-on .ad-sticky:not(.closed) { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #0a0a0a; border-top: 1px solid var(--line-2); min-height: 56px; justify-content: center; align-items: center; padding: 4px 36px 4px 4px; }
  .ads-on.has-sticky { padding-bottom: 64px; }
}
.ad-close { position: absolute; top: 4px; right: 6px; background: none; border: 1px solid var(--line-2); color: var(--muted); width: 26px; height: 26px; border-radius: 50%; font-size: 14px; line-height: 1; cursor: pointer; }

/* ---------- Explainer link in board rows ---------- */
.more { grid-column: 1 / -1; margin: 0; font-size: var(--text-sm); }
.more a { color: var(--fg); font-weight: 500; }

/* ---------- Sub pages ---------- */
.subtop { max-width: var(--max); margin: 0 auto; padding: 18px var(--pad); display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.brand-sm { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-display); font-weight: 600; text-transform: uppercase; font-size: var(--text-base); letter-spacing: .01em; }
.brand-sm .logo { width: 30px; height: 30px; }
.live-link { font-size: var(--text-sm); color: var(--muted); text-decoration: none; white-space: nowrap; }
.live-link:hover { color: var(--fg); }
.prose { max-width: 720px; margin: 0 auto; padding: 32px var(--pad) 56px; }
.prose.wide { max-width: 900px; }
.prose h1 { font-size: var(--text-2xl); line-height: 1; margin: 6px 0 10px; overflow-wrap: break-word; }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--text-lg); margin: 36px 0 10px; letter-spacing: .005em; }
.prose h3 { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); font-weight: 500; margin: 18px 0 8px; }
.prose p, .prose li { color: #d6d6d6; font-size: var(--text-base); line-height: 1.65; }
.prose p { margin: 0 0 14px; max-width: 68ch; }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose a { color: var(--fg); }
.crumb { font-size: var(--text-xs) !important; color: var(--faint) !important; text-transform: uppercase; letter-spacing: .08em; margin: 0 !important; }
.crumb a { color: var(--muted) !important; text-decoration: none; }
.lede { font-size: var(--text-lg) !important; color: var(--muted) !important; line-height: 1.4 !important; }
.scorebox { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: center; border: 1px solid var(--line-2); padding: 16px 18px; margin: 20px 0 8px; }
.scorebox > div { display: flex; flex-direction: column; gap: 2px; }
.scorebox .k { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.scorebox .v { font-size: var(--text-xl); font-weight: 700; }
.btn { margin-left: auto; background: var(--fg); color: var(--bg) !important; text-decoration: none; padding: 10px 16px; font-weight: 600; font-size: var(--text-sm); white-space: nowrap; }
.btn:hover { background: var(--red); color: var(--fg) !important; }
.moves { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.moves h3 { margin-top: 4px; }
.moves div:first-child h3 { color: var(--red); }
.moves div:last-child h3 { color: #7fd17f; }
.ev a, .sig-list a { color: var(--muted); white-space: nowrap; }
.srcs li { font-size: var(--text-sm) !important; }
.srcs .url { color: var(--faint); font-family: var(--font-mono); font-size: 12px; overflow-wrap: anywhere; }
.prose .fine { font-size: var(--text-sm); margin-top: 24px !important; }
.pn { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 36px; border-top: 1px solid var(--line-2); padding-top: 18px; }
.pn a { text-decoration: none; font-weight: 600; display: flex; flex-direction: column; gap: 2px; }
.pn a span { font-size: var(--text-xs); color: var(--faint); font-weight: 400; text-transform: uppercase; letter-spacing: .08em; }
.pn a.r { text-align: right; }
.hub { list-style: none; padding: 0 !important; margin-top: 24px !important; }
.hub li { margin: 0; border-top: 1px solid var(--line); }
.hub a { display: grid; grid-template-columns: 34px 1fr auto 72px; gap: 14px; align-items: center; padding: 12px 0; text-decoration: none; }
.hub a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.hub .hr { color: var(--faint); font-size: var(--text-sm); }
.hub .hn { display: flex; flex-direction: column; min-width: 0; }
.hub .hn b { color: var(--fg); font-weight: 600; }
.hub .hn small { color: var(--muted); font-size: var(--text-xs); }
.hub .ht { color: var(--faint); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; }
.hub .hp { text-align: right; color: var(--fg); }
@media (max-width: 560px) {
  .moves { grid-template-columns: 1fr; }
  .btn { margin-left: 0; width: 100%; text-align: center; }
  .hub a { grid-template-columns: 28px 1fr 64px; }
  .hub .ht { display: none; }
  .brand-sm span { font-size: var(--text-sm); }
  .ev a, .sig-list a { white-space: normal; }
}
