:root {
  --bg: #0b0a09;
  --bg-2: #0f0e0c;
  --surface: #151311;
  --surface-2: #1c1a17;
  --line: rgba(239, 235, 228, 0.08);
  --line-2: rgba(239, 235, 228, 0.14);
  --text: #efebe4;
  --muted: #a39e96;
  --faint: #75716b;
  --accent: #e8762c;
  --accent-soft: rgba(232, 118, 44, 0.14);
  --rex: #ffd23f;
  --rex-soft: rgba(255, 210, 63, 0.09);
  --up: #8fd3a0;
  --down: #ff7a6b;
  --radius: 14px;
  --display: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --body: 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(1200px 500px at 70% -10%, rgba(232, 118, 44, 0.07), transparent 60%);
  background-repeat: no-repeat; min-height: 100vh;
}
a { color: var(--text); text-decoration-color: var(--faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
button { font: inherit; color: inherit; }
h2 { font: 600 19px/1.25 var(--display); letter-spacing: -0.01em; margin: 4px 0 0; }
strong { font-weight: 600; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #000; padding: 6px 10px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.label { font: 500 11px/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin: 0; }
.accent { color: var(--accent); }
.note { color: var(--faint); font-size: 12.5px; margin: 12px 0 0; }
.note:empty { display: none; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 10, 9, 0.78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.brand-mark { flex-shrink: 0; }
.brand-name { font: 600 16px/1 var(--display); letter-spacing: -0.02em; white-space: nowrap; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.pill { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); font: 500 11.5px/1 var(--mono); letter-spacing: 0.04em; color: var(--muted); white-space: nowrap; }
.pill[data-state="live"] { color: var(--text); }
.pill[data-state="stale"] { color: var(--rex); border-color: rgba(255, 210, 63, 0.3); }
.pill[data-state="error"] { color: var(--down); border-color: rgba(255, 122, 107, 0.35); }

.btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; font: 600 12.5px/1 var(--body); transition: border-color .15s, background .15s; }
.btn:hover { border-color: var(--accent); }
.btn.bell[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* hero */
.hero { padding: 40px 0 24px; }
.hero-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.title { font: 600 clamp(32px, 4.6vw, 52px)/1.05 var(--display); letter-spacing: -0.025em; margin: 10px 0 0; color: var(--text); }
.lede { color: var(--muted); margin: 8px 0 0; max-width: 62ch; }
.countdown { margin: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.clock { display: flex; align-items: flex-start; gap: 6px; }
.clock i { font: 500 22px/48px var(--mono); color: var(--faint); font-style: normal; }
.tile { display: grid; justify-items: center; gap: 5px; min-width: 58px; padding: 9px 8px 7px; border-radius: 10px; background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.tile::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, 0.35); }
.tile b { font: 500 26px/1 var(--mono); color: var(--text); font-variant-numeric: tabular-nums; }
.tile span { font: 500 9px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.tile b.roll { animation: roll .35s ease-out; }
@keyframes roll { from { transform: translateY(-40%); opacity: 0.2; } }
.clock.final .tile { border-color: rgba(255, 81, 71, 0.45); background: linear-gradient(180deg, rgba(255, 81, 71, 0.16), var(--surface)); }
.clock.final .tile b { color: #ffb4ad; }
.clock.closed b { font: 600 20px var(--body); color: var(--accent); }
.close-at { font: 500 11px var(--mono); color: var(--faint); letter-spacing: 0.04em; }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 26px; background: rgba(21, 19, 17, 0.6); overflow: hidden; }
.stat { padding: 16px 18px 18px; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .v { font: 600 28px/1.1 var(--display); letter-spacing: -0.02em; margin-top: 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .s { color: var(--muted); font-size: 12.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat.rex .v { color: var(--rex); }
.stat .v.up { color: var(--up); } .stat .v.down { color: var(--down); }
.stat .v small { font-size: 15px; color: var(--muted); margin-left: 2px; }

.banner { margin-top: 14px; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(255, 122, 107, 0.3); background: rgba(255, 122, 107, 0.06); color: #ffc1b8; font-size: 13.5px; }
.banner.warn { border-color: rgba(255, 210, 63, 0.3); background: rgba(255, 210, 63, 0.05); color: #ffe7a1; }

/* layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.col-main, .col-side { display: grid; gap: 20px; min-width: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.card-head.tight { margin-bottom: 14px; }

/* segmented controls */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 7px 13px; border-radius: 7px; cursor: pointer; color: var(--muted); font: 600 12.5px/1 var(--body); white-space: nowrap; }
.seg.small button { padding: 6px 10px; font: 500 11px/1 var(--mono); letter-spacing: 0.06em; }
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"], .seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.seg.wide { display: flex; } .seg.wide button { flex: 1; }

/* charts */
.chart-controls { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 100%; order: 3; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 6px 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--text); max-width: min(220px, 100%); min-width: 0; }
.chip i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0 4px; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--text); }
.chip-tools { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 2px; cursor: pointer; color: var(--muted); font: 600 12.5px/1 var(--body); white-space: nowrap; }
.switch i { position: relative; width: 32px; height: 18px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; flex-shrink: 0; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--faint); transition: left .2s, background .2s; }
.switch[aria-checked="true"] { color: var(--text); }
.switch[aria-checked="true"] i { background: var(--accent-soft); border-color: var(--accent); }
.switch[aria-checked="true"] i::after { left: 16px; background: var(--accent); }
.switch.waiting { opacity: 0.6; }
.switch:hover i { border-color: var(--accent); }
.link { border: 0; background: none; padding: 0; cursor: pointer; color: var(--muted); font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.link:hover { color: var(--accent); }
.chart-box { position: relative; height: 360px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); padding: 24px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 14px; }
.chart-empty strong { display: block; font: 600 18px/1.3 var(--display); color: var(--text); margin-bottom: 6px; }

/* momentum bars */
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 26px minmax(0, 1fr) 64px; gap: 12px; align-items: center; font-size: 13.5px; }
.bar .r { font: 400 12px/1 var(--mono); color: var(--faint); text-align: right; }
.bar .track { position: relative; height: 30px; border-radius: 7px; background: var(--bg-2); overflow: hidden; }
.bar .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(232, 118, 44, 0.26), rgba(232, 118, 44, 0.08)); border-radius: 7px; transition: width .5s ease; }
.bar .name { position: absolute; inset: 0 10px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .name span { overflow: hidden; text-overflow: ellipsis; }
.bar .n { font: 500 13px/1 var(--mono); text-align: right; color: var(--up); }
.bar.rex .fill { background: linear-gradient(90deg, rgba(255, 210, 63, 0.32), rgba(255, 210, 63, 0.1)); }
.bar.rex .name { color: var(--rex); font-weight: 600; }
.empty { color: var(--muted); font-size: 14px; padding: 18px; border: 1px dashed var(--line-2); border-radius: 10px; text-align: center; }

/* race lanes */
.race { display: grid; gap: 4px; padding: 6px 0 0; }
.race[hidden], .chart-box[hidden] { display: none; }
.lane { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.lane.axis { border-bottom: 0; padding: 4px 0 0; }
.lane-name { min-width: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); row-gap: 2px; }
.lane-name .r { font: 500 12px/1.4 var(--mono); color: var(--faint); grid-row: span 2; }
.lane-name .nm { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-name .meta { color: var(--faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-name .meta b { font: 500 11.5px var(--mono); }
.lane.rex .nm { color: var(--rex); }
.track { position: relative; height: 34px; }
.track > * { position: absolute; }
.track .grid { top: 0; bottom: 0; width: 1px; background: rgba(239, 235, 228, 0.04); }
.track .cut { top: -12px; bottom: -12px; width: 0; border-left: 1px dashed rgba(240, 123, 63, 0.7); }
.track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px; background: rgba(239, 235, 228, 0.05); border-radius: 2px; }
.track .trail { top: 50%; height: 6px; margin-top: -3px; border-radius: 6px; background: linear-gradient(90deg, transparent, var(--c)); opacity: 0.9; transition: left .6s ease, width .6s ease; }
.track .trail.lost { background: repeating-linear-gradient(90deg, var(--down) 0 6px, transparent 6px 9px); opacity: 0.85; }
.track .ghost { top: 50%; height: 0; border-top: 2px dashed var(--c); opacity: 0.45; transition: left .6s ease, width .6s ease; }
.track .ghost-end { top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1.5px solid var(--c); opacity: 0.6; background: var(--surface); }
.track .dot { top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35), 0 0 16px var(--c); transition: left .6s ease; z-index: 2; }
.lane.rex .dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.track .val, .track .fin { top: -9px; transform: translateX(-50%); font: 500 11px/1 var(--mono); white-space: nowrap; }
.track .val { color: var(--text); transition: left .6s ease; }
.track .fin { color: var(--c); opacity: 0.75; top: auto; bottom: -8px; }
.lane.axis .track { height: 22px; }
.lane.axis .track::before { display: none; }
.lane.axis span { top: 4px; transform: translateX(-50%); font: 400 10.5px/1 var(--mono); color: var(--faint); }
.lane.axis .cut-label { top: -6px; color: var(--accent); font-size: 10px; letter-spacing: 0.04em; transform: translate(-50%, -100%); }
@media (max-width: 720px) {
  .lane { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .lane.axis > div:first-child { display: none; }
  .track { margin: 0 14px; }
}

/* market board */
.mk-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
table.mk { width: 100%; border-collapse: separate; border-spacing: 0 3px; font-size: 13px; }
.mk th { font: 500 10px/1.25 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 4px 8px 8px; text-align: left; white-space: nowrap; vertical-align: bottom; }
.mk th span { display: block; color: var(--muted); }
.mk td { padding: 8px; background: var(--bg-2); white-space: nowrap; }
.mk td:first-child { border-radius: 8px 0 0 8px; }
.mk td:last-child { border-radius: 0 8px 8px 0; }
.mk .num { text-align: right; }
.mk td.r { font: 400 12px var(--mono); color: var(--faint); width: 34px; }
.mk td.nm { max-width: 220px; }
.mk td.nm span { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.mk tr.rex td { background: linear-gradient(0deg, var(--rex-soft), var(--rex-soft)), var(--bg-2); }
.mk tr.rex td.nm { color: var(--rex); }
.mk td.cell { font: 500 12px var(--mono); color: var(--text); min-width: 62px; border-left: 2px solid var(--surface); }
.mk td.cell.none { color: var(--faint); background: transparent; }
.mk td.cell.neg { color: #9fd0ff; }
.mk td.pace { font: 500 12.5px var(--mono); }
.mk td.pace small { color: var(--faint); font-size: 10px; }
.lvl { display: inline-block; font: 600 10px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; }
.lvl.surging { color: #ffd9d6; background: rgba(255, 81, 71, 0.22); box-shadow: 0 0 14px rgba(255, 81, 71, 0.25); }
.lvl.heating { color: #ffcf9e; background: rgba(255, 154, 61, 0.16); }
.lvl.steady { color: var(--muted); background: rgba(239, 235, 228, 0.05); }
.lvl.cooling { color: #b8dcff; background: rgba(111, 182, 255, 0.14); }
.lvl.stalled { color: var(--faint); background: transparent; border: 1px dashed var(--line-2); }
.outlook { font: 600 10px/1 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 7px; border-radius: 6px; border: 1px solid transparent; }
.outlook.safe { color: var(--up); border-color: rgba(143, 211, 160, 0.4); }
.outlook.likely { color: var(--text); border-color: var(--line-2); }
.outlook.in-reach { color: #ff9a3d; border-color: rgba(255, 154, 61, 0.4); }
.outlook.long-shot { color: var(--faint); }
.mk-legend { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--faint); }
.mk-legend b { margin-left: 4px; }
.sw { display: inline-block; width: 14px; height: 10px; border-radius: 3px; vertical-align: -1px; }
.sw.s1 { background: hsla(28, 95%, 55%, 0.15); } .sw.s2 { background: hsla(18, 95%, 55%, 0.35); } .sw.s3 { background: hsla(4, 95%, 55%, 0.56); margin-right: 6px; }

/* signals */
.signals { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.sig { padding: 11px 12px; border-radius: 10px; background: var(--bg-2); border-left: 3px solid var(--line-2); }
.sig-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sig-title { font-weight: 600; font-size: 13px; line-height: 1.3; }
.sig p { margin: 5px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.sig .spark { flex-shrink: 0; }
.sig.surging { border-left-color: #ff5147; background: linear-gradient(90deg, rgba(255, 81, 71, 0.1), var(--bg-2) 60%); }
.sig.heating { border-left-color: #ff9a3d; }
.sig.cooling, .sig.stalled { border-left-color: #6fb6ff; }
.sig.overtake, .sig.line { border-left-color: var(--accent); background: linear-gradient(90deg, var(--accent-soft), var(--bg-2) 60%); }
.sig.closing { border-left-color: #ff9a3d; }
.sig.rex .sig-title { color: var(--rex); }
@media (max-width: 720px) {
  .mk td.r, .mk th:first-child { display: none; }
  .mk td.nm, .mk th:nth-child(2) { position: sticky; left: 0; z-index: 1; max-width: 116px; min-width: 116px; }
  .mk td.nm { border-radius: 8px 0 0 8px; box-shadow: 6px 0 10px -6px rgba(0, 0, 0, 0.6); }
  .mk th:nth-child(2) { background: var(--surface); }
  .mk td.nm span { font-size: 12px; }
}
@media (max-width: 480px) { .brand-name { display: none; } }

/* leaderboard */
.board-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--faint); }
.search:focus-within { border-color: var(--line-2); }
.search input { border: 0; background: none; outline: none; color: var(--text); font: 500 13px var(--body); width: 190px; }
.select { display: flex; align-items: center; gap: 8px; }
.select select { background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: 500 12px var(--mono); }
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
table.board { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.board th { text-align: left; font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 10px 10px; border-bottom: 1px solid var(--line); cursor: pointer; user-select: none; white-space: nowrap; background: var(--surface); }
.board th:hover { color: var(--text); }
.board th[aria-sort] { color: var(--accent); }
.board th[aria-sort="ascending"]::after { content: ' ↑'; } .board th[aria-sort="descending"]::after { content: ' ↓'; }
.board td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; background: var(--surface); }
.board .num { text-align: right; font-variant-numeric: tabular-nums; }
.board td.num { font: 400 13px/1.2 var(--mono); white-space: nowrap; }
.board .sticky-a { position: sticky; left: 0; z-index: 1; width: 44px; }
.board .sticky-b { position: sticky; left: 44px; z-index: 1; min-width: 210px; max-width: 320px; }
.board td.rank { color: var(--muted); }
.board td.votes { color: var(--text); font-size: 14px; font-weight: 500; }
.pname { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.pschool { color: var(--faint); font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.board tr:hover td { background: var(--surface-2); }
.board tr.rex td { background: linear-gradient(0deg, var(--rex-soft), var(--rex-soft)), var(--surface); }
.board tr.rex td:first-child { box-shadow: inset 3px 0 0 var(--rex); }
.board tr.rex .pname, .board tr.rex td.rank, .board tr.rex td.votes { color: var(--rex); }
.board tr.cut td { border-bottom: 1px dashed var(--accent); }
.board tr.cutlabel td { padding: 4px 10px; border-bottom: 0; font: 500 10px/1 var(--mono); letter-spacing: 0.14em; color: var(--accent); text-transform: uppercase; background: var(--surface); }
.up { color: var(--up); } .down { color: var(--down); } .zero { color: var(--faint); }
.collecting { color: var(--faint); font: 500 10.5px/1.25 var(--body) !important; white-space: normal !important; display: inline-block; max-width: 72px; text-align: right; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 5px; font: 500 10px/1.3 var(--mono); letter-spacing: 0.06em; text-transform: uppercase; background: var(--accent-soft); color: var(--accent); }
.lost-tag { display: inline-block; margin-left: 8px; padding: 1px 6px; border-radius: 5px; font: 500 10px/1.5 var(--mono); color: var(--down); background: rgba(255, 122, 107, 0.1); vertical-align: 1px; }
.star { color: var(--rex); margin-right: 3px; font-size: 0.95em; }
.board td.rank { white-space: nowrap; }
.mark { color: var(--rex); font-size: 10px; vertical-align: super; margin-left: 2px; }
[data-tip] { cursor: help; text-decoration: underline dotted transparent; }
[data-tip]:hover { text-decoration-color: var(--faint); }
.toggle { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); background: none; cursor: pointer; display: inline-grid; place-items: center; }
.toggle i { width: 9px; height: 9px; border-radius: 50%; background: transparent; border: 1.5px solid var(--faint); }
.toggle[aria-pressed="true"] i { border: 0; }
.toggle:hover { border-color: var(--accent); }

/* feed */
.feed-card { padding-bottom: 12px; }
.feed { list-style: none; margin: 12px 0 0; padding: 0 4px 0 0; max-height: 620px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.fgroup { padding: 12px 0 10px; border-top: 1px solid var(--line); }
.fgroup:first-child { border-top: 0; }
.fhead { display: flex; justify-content: space-between; gap: 8px; font: 500 10.5px/1.3 var(--mono); letter-spacing: 0.08em; color: var(--faint); text-transform: uppercase; margin-bottom: 8px; }
.fitem { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: baseline; padding: 4px 0; font-size: 13px; }
.fitem .d { font: 500 12.5px/1 var(--mono); text-align: right; }
.fitem .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem .sub { color: var(--faint); font-size: 11.5px; }
.fitem.rex .t { color: var(--rex); font-weight: 600; }
.fitem.alert { background: var(--accent-soft); border-radius: 8px; padding: 7px 8px; margin: 3px -8px; grid-template-columns: 46px minmax(0, 1fr); }
.fitem.alert .t { white-space: normal; }
.fitem.bad { background: rgba(255, 122, 107, 0.08); }
.fmore { color: var(--faint); font-size: 12px; padding-left: 64px; }
.fresh { animation: flash 2.4s ease-out; }
@keyframes flash { 0% { background: rgba(255, 210, 63, 0.18); } 100% { background: transparent; } }

/* projection */
.proj { margin-top: 14px; display: grid; gap: 2px; }
.paces { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 11.5px; }
.paces th { text-align: left; font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 4px 4px 4px 0; }
.paces td { padding: 3px 4px 3px 0; color: var(--muted); border-top: 1px solid var(--line); }
.paces .num { text-align: right; font-family: var(--mono); }
.track .range { top: 50%; height: 12px; margin-top: -6px; border-radius: 6px; background: var(--c); opacity: 0.12; }
.hist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.hist-head h3 { font: 600 15px/1.3 var(--display); margin: 0; }
.hist-head .zero { font-size: 12px; }
.hist-wrap { overflow-x: auto; margin-bottom: 18px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
table.hist { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.hist th { font: 500 10px/1.2 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.hist td { padding: 6px 8px; border-bottom: 1px solid var(--line); font: 400 12px var(--mono); white-space: nowrap; }
table.hist .num { text-align: right; }
table.hist small { font: 500 10px var(--mono); margin-left: 2px; }
table.hist .rexcol { color: var(--rex); }
.days { display: grid; gap: 6px; margin-bottom: 4px; }
.day { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.day .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day > span:nth-child(2) { color: var(--muted); font: 400 12px var(--mono); }
.day.rex .nm { color: var(--rex); }
.badge.ok { background: rgba(143, 211, 160, 0.12); color: var(--up); }
.prow { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.prow:last-child { border-bottom: 0; }
.prow .r { font: 400 12px/1 var(--mono); color: var(--faint); }
.prow .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow .pv { font: 400 12.5px/1.2 var(--mono); text-align: right; white-space: nowrap; }
.prow .pv small { display: block; color: var(--faint); font-size: 10.5px; }
.prow.rex .nm, .prow.rex .pv { color: var(--rex); }
.prow.out { opacity: 0.55; }
.proj-head { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13.5px; }
.proj-head b { font: 600 22px/1.1 var(--display); color: var(--rex); display: block; margin-bottom: 2px; }

/* system */
.sys { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 9px 14px; margin: 14px 0 0; font-size: 13px; }
.sys dt { color: var(--faint); font: 500 10.5px/1.6 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.sys dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.sys dd.err { color: var(--down); }

/* footer */
.foot { margin: 48px 0 40px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.foot-grid p:not(.label) { margin: 8px 0 0; }
.fine { color: var(--faint); font-size: 12.5px; margin-top: 28px; }

/* toasts and tooltip */
.toasts { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 40; width: min(340px, calc(100vw - 32px)); }
.toast { background: rgba(28, 26, 23, 0.96); border: 1px solid var(--line-2); border-left: 3px solid var(--accent); border-radius: 12px; padding: 12px 14px; font-size: 13.5px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); animation: tin .35s ease-out; }
.toast.rex { border-left-color: var(--rex); }
.toast.bad { border-left-color: var(--down); }
.toast .label { margin-bottom: 4px; }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
.tip { position: fixed; z-index: 60; max-width: 300px; background: #24211d; border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; font-size: 12.5px; line-height: 1.45; color: var(--text); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); pointer-events: none; white-space: pre-line; }

/* responsive */
@media (max-width: 1180px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
}
@media (max-width: 1020px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .col-side .feed-card { grid-row: span 2; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  body { font-size: 14.5px; }
  .hero { padding: 34px 0 20px; }
  .countdown { align-items: flex-start; }
  .tile { min-width: 50px; } .tile b { font-size: 22px; } .clock i { line-height: 42px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 13px 14px 15px; }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(4) { border-left: 1px solid var(--line); }
  .stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .stat .v { font-size: 23px; }
  .col-side { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .chart-box { height: 280px; }
  .search input { width: 100%; }
  .search { flex: 1 1 100%; }
  .board .sticky-b { min-width: 150px; max-width: 170px; }
  .pname, .pschool { max-width: 160px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .btn span { display: none; } .btn { padding: 0 9px; }
  .toasts { right: 16px; bottom: 16px; }
}
@media (max-width: 720px) {
  /* leaderboard rows become two-line cards on phones */
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  table.board, .board tbody { display: block; width: 100%; }
  .board thead { display: none; }
  .board tr { display: grid; grid-template-columns: 26px repeat(6, minmax(0, 1fr)); column-gap: 4px; row-gap: 6px; padding: 12px 6px; border-bottom: 1px solid var(--line); background: var(--surface); }
  .board td { display: block; padding: 0; border: 0 !important; background: none !important; min-width: 0; }
  .board tr.rex { background: var(--rex-soft); box-shadow: inset 3px 0 0 var(--rex); border-radius: 8px; }
  .board tr.rex td:first-child { box-shadow: none; }
  .board tr.cut { border-bottom: 1px dashed var(--accent); }
  .board .sticky-a, .board .sticky-b { position: static; min-width: 0; max-width: none; width: auto; }
  .board td.rank { grid-column: 1; grid-row: 1; text-align: left; padding-top: 2px; }
  .board td.namecell { grid-column: 2 / 6; grid-row: 1; }
  .board td.votes { grid-column: 6; grid-row: 1; padding-top: 2px; }
  .board td.togcell { grid-column: 7; grid-row: 1; }
  .board td[data-label] { grid-row: 2; text-align: right; font-size: 12px; }
  .board td[data-label]::before { content: attr(data-label); display: block; font: 500 9.5px/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
  .board td[data-label="Today"], .board td[data-label="Today*"] { grid-column: 2; }
  .pname, .pschool { max-width: 100%; }
  .collecting { font-size: 9.5px !important; max-width: 100%; }
  .board tr.cutlabel { display: block; padding: 6px; }
  .day { grid-template-columns: minmax(0, 1fr) auto; }
  .day > span:nth-child(2) { grid-row: 2; }
  .board tr.cutlabel td { background: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* project picker */
.picker { position: relative; margin-top: 14px; display: inline-block; }
.pick-btn { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--text); font: 500 14px var(--body); }
.pick-btn:hover, .pick-btn[aria-expanded="true"] { border-color: var(--accent); }
.pick-k { font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.pick-btn b { font-weight: 600; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-btn svg { color: var(--faint); }
.pick-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: min(420px, calc(100vw - 32px)); background: #1a1815; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 50px rgba(0, 0, 0, 0.6); overflow: hidden; }
.pick-pop input { width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); padding: 12px 14px; font: 500 14px var(--body); outline: none; }
.pick-pop ul { list-style: none; margin: 0; padding: 4px; max-height: 340px; overflow: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.pick-pop li { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.pick-pop li:hover, .pick-pop li.on { background: var(--surface-2); }
.pick-pop li.on b { color: var(--rex); }
.pick-pop li .r { font: 400 12px var(--mono); color: var(--faint); text-align: right; }
.pick-pop li b { display: block; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-pop li small { display: block; color: var(--faint); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-pop li.none { color: var(--faint); cursor: default; display: block; }

/* sync line: fills until the next refresh, resets when new data loads */
.pill .sync { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--accent); opacity: 0.8; transition: width 1s linear; }
.pill[data-state="stale"] .sync { background: var(--rex); }
.pill[data-state="error"] .sync { background: var(--down); }
.pill[data-state="loading"] .sync, .pill[data-state="closed"] .sync { display: none; }

/* made by */
.made { margin-top: 30px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; grid-template-columns: 1fr auto; gap: 10px 24px; align-items: center; background: linear-gradient(120deg, rgba(232, 118, 44, 0.06), transparent 55%); }
.made-by { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 600; color: var(--text); }
.made-k { font: 500 10.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); margin-right: 4px; }

.made-by .amp { color: var(--faint); font-weight: 400; }
.stamp { grid-row: span 2; display: grid; justify-items: center; gap: 2px; padding: 10px 16px; border: 1.5px dashed rgba(255, 210, 63, 0.55); border-radius: 10px; transform: rotate(-3deg); text-decoration: none; color: var(--rex); transition: transform .2s; }
.stamp:hover { transform: rotate(0deg); }
.stamp span { font: 500 9.5px/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.stamp b { font: 700 18px/1.1 var(--mono); letter-spacing: 0.08em; }
.made-note { margin: 0; color: var(--muted); font-size: 13px; }
@media (max-width: 720px) { .made { grid-template-columns: 1fr; } .stamp { grid-row: auto; justify-self: start; } }

.chip.add { cursor: pointer; background: none; border-style: dashed; color: var(--muted); padding: 5px 12px; font: 500 12px var(--body); }
.chip.add:hover { color: var(--text); border-color: var(--accent); }
.add-pop { top: 100%; left: 0; }
.pick-pop li[data-add] { cursor: pointer; }

/* title tag */
.title-tag { display: inline-flex; align-items: center; gap: 7px; margin-left: 14px; padding: 7px 11px 6px; vertical-align: 0.42em; border: 1.5px solid rgba(232, 118, 44, 0.65); border-radius: 8px; color: var(--accent); font: 600 13px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; transform: rotate(-2deg); background: rgba(232, 118, 44, 0.07); white-space: nowrap; }
.title-tag svg { fill: currentColor; }
.brand-name em { font-style: normal; font-weight: 500; color: var(--accent); margin-left: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
@media (max-width: 720px) { .title-tag { display: flex; width: max-content; margin: 12px 0 0; vertical-align: baseline; font-size: 11.5px; } }

/* leaderboard fold */
.board tr.morerow td { padding: 14px 10px 4px; border-bottom: 0; text-align: center; background: var(--surface); }
.board tr.morerow button { border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); border-radius: 999px; padding: 9px 18px; cursor: pointer; font: 600 12.5px var(--body); }
.board tr.morerow button:hover { border-color: var(--accent); }
.board tr.gaprow td { padding: 2px 10px; text-align: center; color: var(--faint); border-bottom: 1px solid var(--line); background: var(--surface); }
@media (max-width: 720px) { .board tr.morerow, .board tr.gaprow { display: block; } .board tr.morerow td, .board tr.gaprow td { display: block; } }

/* links that look like links: underline + small arrow */
a.ext { color: var(--text); text-decoration: underline; text-decoration-color: rgba(239, 235, 228, 0.35); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: text-decoration-color .15s, color .15s; white-space: nowrap; }
a.ext::after { content: '↗'; display: inline-block; margin-left: 3px; font-size: 0.78em; color: var(--accent); transform: translateY(-1px); transition: transform .15s; }
a.ext:hover { color: #fff; text-decoration-color: var(--accent); }
a.ext:hover::after { transform: translate(2px, -3px); }
.made-top { margin: 14px 0 0; font-size: 13px; color: var(--muted); line-height: 1.7; max-width: 640px; }
.made-top a.ext { font-weight: 600; }

.foot-line { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 16px; font-size: 12.5px; color: var(--faint); }
.foot-line span + span::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); margin: 0 12px 2px -14px; vertical-align: middle; }
.foot-line a.ext { color: var(--muted); }

/* Vote Heat: fixed columns so the whole board fits on laptop and desktop screens */
@media (min-width: 721px) {
  table.mk { table-layout: fixed; }
  .mk col.c-r { width: 38px; }
  .mk col.c-s { width: 58px; }
  .mk col.c-p { width: 62px; }
  .mk col.c-m { width: 96px; }
  .mk col.c-o { width: 84px; }
  .mk td.nm { max-width: none; overflow: hidden; }
  .mk td.cell { min-width: 0; padding: 8px 6px; }
  .mk th { padding: 4px 6px 8px; white-space: normal; }
  .mk td { padding: 8px 6px; }
  .mk td.nm { padding-left: 4px; }
  .mk .lvl, .mk .outlook { font-size: 9.5px; padding: 5px 6px; letter-spacing: 0.04em; }
  .mk-wrap { overflow-x: visible; }
}

/* stat cards: separate, soft and clean, with a glow that follows the cursor */
.stats { border: 0; background: none; overflow: visible; gap: 12px; }
.stats .stat {
  position: relative; overflow: hidden; border: 1px solid rgba(239, 235, 228, 0.09) !important; border-radius: 14px;
  padding: 18px 20px 20px; background: linear-gradient(155deg, #171512, #0d0c0a);
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), border-color .3s, box-shadow .3s;
}
.stats .stat::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%), rgba(232, 118, 44, 0.16), transparent 45%);
}
.stats .stat:hover { transform: translateY(-2px); border-color: rgba(232, 118, 44, 0.35) !important; box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.9); }
.stats .stat:hover::before { opacity: 1; }
.stats .stat > * { position: relative; }
.stats .stat .v { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; background: linear-gradient(180deg, #faf7f1, #b9b3aa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats .stat.rex .v, .stats .stat .v .up, .stats .stat .v .down, .stats .stat .v .zero { -webkit-text-fill-color: initial; }
.stats .stat.rex .v { background: none; color: var(--rex); }
.stats .stat .v small { -webkit-text-fill-color: var(--muted); }
.stats .stat .s { margin-top: 6px; }
@media (max-width: 720px) { .stats { gap: 10px; } .stats .stat { padding: 14px 15px 16px; } .stats .stat .v { font-size: 24px; } }

/* smooth scrolling + reveal on scroll */
html { scroll-behavior: smooth; }
html.reveal-ready .reveal { opacity: 0; transform: translateY(26px); filter: blur(4px); }
html.reveal-ready .reveal.in { opacity: 1; transform: none; filter: none; transition: opacity .8s cubic-bezier(0.22, 1, 0.36, 1), transform .8s cubic-bezier(0.22, 1, 0.36, 1), filter .8s ease; transition-delay: var(--d, 0ms); }
html.reveal-ready .stats.reveal { opacity: 1; transform: none; filter: none; }
html.reveal-ready .stats.reveal:not(.in) .stat { opacity: 0; transform: translateY(18px) scale(0.98); }
.stats.reveal.popping .stat { animation: pop .7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.stats.reveal.popping .stat:nth-child(2) { animation-delay: .06s; }
.stats.reveal.popping .stat:nth-child(3) { animation-delay: .12s; }
.stats.reveal.popping .stat:nth-child(4) { animation-delay: .18s; }
.stats.reveal.popping .stat:nth-child(5) { animation-delay: .24s; }
.stats.reveal.popping .stat:nth-child(6) { animation-delay: .30s; }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.reveal-ready .reveal, html.reveal-ready .stats.reveal:not(.in) .stat { opacity: 1; transform: none; filter: none; }
}

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
