/* ============================================================
 *  wobl - site.css
 *  The design system, extracted from wobl-site-mockup.html.
 *
 *  Rules this file exists to hold in one place:
 *    - near-black ground, 1px lines, no rounded corners to speak of
 *    - ONE accent (acid). Red appears only where something is
 *      literally live or out. Every other colour on the page comes
 *      from the marble art itself.
 *    - Archivo Black for display, IBM Plex Mono for anything that is
 *      data. Both self-hosted: a webfont that fails mid-stream is a
 *      visible failure.
 *
 *  The OBS scene draws its HUD on canvas with the same tokens, so the
 *  stream and the site read as one thing. Keep them in sync.
 * ============================================================ */

@font-face {
  font-family: 'Archivo Black';
  src: url('/public/fonts/ArchivoBlack-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/public/fonts/IBMPlexMono-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('/public/fonts/IBMPlexMono-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --bg:       #07070A;
  --panel:    #0E0F14;
  --panel-2:  #0B0C11;
  --line:     #1E212B;
  --line-hot: #2E3342;
  --ink:      #F2F4F8;
  --dim:      #8A90A2;
  --dimmer:   #585E6E;
  --acid:     #C8FF2E;
  --live:     #FF3B30;

  --display: 'Archivo Black', 'Archivo Black Fallback', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --wrap: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* CRT texture, barely there */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

a { color: var(--acid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- ticker ---------- */

.ticker {
  border-bottom: 1px solid var(--line); background: #0A0B0F;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em;
  overflow: hidden; white-space: nowrap; position: sticky; top: 0; z-index: 50;
}
.ticker-inner { display: inline-block; padding: 9px 0; animation: slide 38s linear infinite; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker span { padding: 0 22px; color: var(--dim); }
.ticker b { color: var(--acid); font-weight: 500; }
.ticker i { color: var(--live); font-style: normal; }
@media (prefers-reduced-motion: reduce) { .ticker-inner { animation: none; } }

/* ---------- nav ---------- */

nav {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0 6%, var(--acid) 22%, #4C7A00 70%, #101403 100%);
  box-shadow: 0 0 22px rgba(200,255,46,.35); flex: none;
}
.brand-name { font-family: var(--display); font-size: 21px; letter-spacing: .02em; color: var(--ink); }
.brand:hover { text-decoration: none; }
.navlinks { display: flex; gap: 26px; font-family: var(--mono); font-size: 12px; letter-spacing: .1em; }
.navlinks a { color: var(--dim); text-decoration: none; }
.navlinks a:hover, .navlinks a.on { color: var(--ink); }
.chip {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  border: 1px solid var(--line-hot); border-radius: 100px; padding: 6px 12px; color: var(--dim);
}
.chip.live { color: var(--acid); border-color: rgba(200,255,46,.35); }

/* ---------- type ---------- */

h1 {
  font-family: var(--display); font-size: clamp(44px, 7.4vw, 92px); line-height: .92;
  letter-spacing: -.02em; text-transform: uppercase;
}
h1 em { font-style: normal; color: var(--acid); }
h2 { font-family: var(--display); font-size: 30px; letter-spacing: -.01em; text-transform: uppercase; }
h3 { font-family: var(--display); font-size: 17px; letter-spacing: 0; text-transform: uppercase; margin-bottom: 10px; }
p { color: var(--dim); line-height: 1.65; }
p + p { margin-top: 12px; }
.lead { font-size: 17px; color: var(--dim); max-width: 60ch; }
.lead b, p b { color: var(--ink); font-weight: 600; }

.kicker {
  font-family: var(--mono); font-size: 12px; letter-spacing: .22em; color: var(--dim);
  margin-bottom: 22px; display: flex; align-items: center; gap: 10px;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 12px var(--live); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

/* ---------- sections ---------- */

section { padding: 74px 0; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 34px; flex-wrap: wrap; }
.sec-num { font-family: var(--mono); font-size: 11px; color: var(--dimmer); letter-spacing: .2em; }
.sec-note { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--dimmer); letter-spacing: .1em; }

/* ---------- buttons ---------- */

.cta { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.btn {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .12em; text-decoration: none;
  padding: 15px 26px; border-radius: 2px; display: inline-block; border: 1px solid transparent;
  cursor: pointer; transition: opacity .15s ease;
}
.btn:hover { text-decoration: none; opacity: .85; }
.btn-primary { background: var(--acid); color: #0B1000; font-weight: 600; }
.btn-ghost { border-color: var(--line-hot); color: var(--ink); background: transparent; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- panels ---------- */

.panel { border: 1px solid var(--line); background: var(--panel); padding: 24px; }
.panel.hot { border-color: var(--line-hot); }
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* left-rule explainer blocks, as in the mockup */
.explain { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 26px; }
.explain > div { border-left: 2px solid var(--line-hot); padding-left: 14px; }
.explain h5 { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; color: var(--acid); margin-bottom: 7px; font-weight: 500; }
.explain p { font-size: 13.5px; color: var(--dim); line-height: 1.55; }

/* ---------- data ---------- */

table { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12.5px; }
th {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line);
  color: var(--dimmer); font-weight: 400; font-size: 10px; letter-spacing: .16em;
}
td { padding: 14px 12px; border-bottom: 1px solid var(--line); color: var(--dim); vertical-align: middle; }
td.win { color: var(--acid); }
td .addr { color: var(--dimmer); font-size: 11px; word-break: break-all; }
tbody tr:hover td { background: rgba(255,255,255,.02); }
.empty { padding: 34px 12px; text-align: center; color: var(--dimmer); font-family: var(--mono); font-size: 12px; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-family: var(--mono); font-size: 12.5px; }
.kv dt { color: var(--dimmer); letter-spacing: .1em; font-size: 10.5px; }
.kv dd { color: var(--ink); word-break: break-all; }

.mono { font-family: var(--mono); }
.muted { color: var(--dimmer); font-size: 12px; font-family: var(--mono); }
.acid { color: var(--acid); }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 10px; letter-spacing: .14em;
  border: 1px solid var(--line-hot); padding: 4px 9px; color: var(--dim); border-radius: 2px;
}
.tag.on { color: var(--acid); border-color: rgba(200,255,46,.4); }
.tag.off { color: var(--live); border-color: rgba(255,59,48,.4); }

/* ---------- marble grid ---------- */

.marbles { display: grid; grid-template-columns: repeat(8, 1fr); gap: 20px; }
.m { text-align: center; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: inherit; }
.m-img {
  aspect-ratio: 1; border-radius: 50%; overflow: hidden; position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); transition: transform .18s ease;
  background: #05060a;
}
.m:hover .m-img, .m:focus-visible .m-img { transform: translateY(-4px) scale(1.05); }
.m:focus-visible { outline: none; }
.m:focus-visible .m-img { box-shadow: inset 0 0 0 2px var(--acid); }
.m-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-name { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--dim); margin-top: 10px; }
.m-tag { font-family: var(--mono); font-size: 9px; color: var(--dimmer); margin-top: 2px; }
.m[aria-pressed="true"] .m-name { color: var(--acid); }

/* ---------- watch embed ---------- */

.screen { border: 1px solid var(--line-hot); background: var(--panel-2); border-radius: 3px; overflow: hidden; box-shadow: 0 40px 90px rgba(0,0,0,.6); }
.screen-bar {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 11px;
  letter-spacing: .12em; color: var(--dim);
}
.live-tag { background: var(--live); color: #fff; padding: 3px 8px; border-radius: 2px; font-weight: 600; letter-spacing: .1em; }
/* Nothing claims to be live until a race is actually running. */
.live-tag.idle { background: transparent; color: var(--dimmer); border: 1px solid var(--line-hot); padding: 2px 7px; }
.screen-frame { position: relative; aspect-ratio: 16 / 9; background: #05060a; }
.screen-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.screen-poster {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--dim);
  /* A real frame of the scene sits behind the button, so it is obvious
     what starts on click instead of an empty black rectangle. */
  background: #08090E center/cover no-repeat url('/public/watch-poster.png');
  border: 0; width: 100%; padding: 0;
}
.screen-poster::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(7,7,10,.45), rgba(7,7,10,.88) 70%);
}
.poster-cta {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  align-items: center; text-align: center;
}
.screen-poster:hover { color: var(--ink); }
.screen-poster:hover::before { background: radial-gradient(ellipse at 50% 45%, rgba(7,7,10,.3), rgba(7,7,10,.8) 70%); }

/* ---------- token ---------- */

.token-box {
  border: 1px solid var(--line-hot); border-radius: 3px; padding: 34px; text-align: center;
  background: linear-gradient(180deg, #0D0E13, #0A0B10);
}
.token-state { font-family: var(--display); font-size: clamp(24px, 5vw, 34px); letter-spacing: .02em; color: var(--dimmer); text-transform: uppercase; }
.token-sub { font-family: var(--mono); font-size: 11.5px; color: var(--dimmer); letter-spacing: .12em; margin-top: 12px; }
.ca {
  font-family: var(--mono); font-size: 13px; word-break: break-all; color: var(--acid);
  border: 1px dashed var(--line-hot); padding: 14px; margin-top: 18px; background: #06070B;
}

/* ---------- forms ---------- */

input[type=text], input[type=password] {
  font-family: var(--mono); font-size: 13px; background: #06070B; color: var(--ink);
  border: 1px solid var(--line-hot); padding: 12px; width: 100%; border-radius: 2px;
}
input:focus { outline: none; border-color: var(--acid); }
label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--dimmer); margin-bottom: 6px; }

/* ---------- footer ---------- */

footer { border-top: 1px solid var(--line); padding: 44px 0 70px; color: var(--dimmer); font-size: 12px; line-height: 1.8; }
footer strong { color: var(--dim); }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .marbles { grid-template-columns: repeat(4, 1fr); }
  .explain, .foot-grid { grid-template-columns: 1fr; }
  .navlinks { gap: 16px; font-size: 11px; }
  section { padding: 54px 0; }
}
@media (max-width: 520px) {
  .marbles { grid-template-columns: repeat(3, 1fr); }
  .sec-note { display: none; }
}
