:root {
  --bg: #0a0e14; --panel: #11161f; --panel2: #161c27; --line: #232b38;
  --text: #e6edf3; --dim: #8b949e; --start: #58a6ff; --gold: #ffd166; --end: #f85149; --green: #3fb950;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { max-width: 1180px; margin: 0 auto; padding: 28px 24px 80px; }

.masthead { text-align: center; padding: 8px 0 18px; }
.brand { font-weight: 800; letter-spacing: .12em; color: var(--start); font-size: 15px; text-transform: uppercase; }
.masthead h1 { font-size: clamp(28px, 4.4vw, 46px); margin: 8px 0 10px; line-height: 1.08; }
.masthead .sub { color: var(--dim); font-size: clamp(15px, 1.7vw, 18px); line-height: 1.5; max-width: 760px; margin: 0 auto; }
.masthead strong { color: var(--text); }

.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 22px 0 26px; }
@media (max-width: 760px) { .cases { grid-template-columns: repeat(2, 1fr); } }
.cases-loading { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 20px; }
.case-btn { appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); border-radius: 12px; padding: 18px 16px; font-size: 17px; font-weight: 650;
  text-align: left; transition: transform .08s ease, border-color .15s, background .15s; min-height: 64px; }
.case-btn:hover { border-color: var(--start); transform: translateY(-2px); }
.case-btn.active { border-color: var(--gold); background: var(--panel2); box-shadow: 0 0 0 1px var(--gold) inset; }
.case-btn:disabled { opacity: .5; cursor: default; transform: none; }
.case-label::before { content: "▶ "; color: var(--start); }

.stage { display: grid; gap: 18px; }
.who, .found { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 22px; }
.who h2, .found h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.who p, .found p { margin: 0; font-size: clamp(16px, 1.9vw, 20px); line-height: 1.55; }
.found { border-color: var(--gold); }
.found h2 { color: var(--gold); }

.viz-wrap { background: #070a0f; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.viz-status { color: var(--gold); font-size: 15px; text-align: center; margin-bottom: 10px; min-height: 20px; }
#trail { width: 100%; height: auto; display: block; border-radius: 8px; }
.viz-html { padding: 18px 6px; }

.bignum { text-align: center; font-size: clamp(60px, 12vw, 120px); font-weight: 800; color: var(--gold); line-height: 1; }
.bignum-sub { text-align: center; color: var(--dim); font-size: 18px; margin-top: 10px; }

.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(180px, 280px) 1fr auto; gap: 12px; align-items: center; }
.bar-name { font-size: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { background: #0a0e14; border-radius: 6px; height: 22px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--start), var(--gold)); border-radius: 6px; }
.bar-val { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 700; min-width: 70px; text-align: right; }

.hubs { margin: 0; padding-left: 26px; display: grid; gap: 8px; }
.hubs li { font-size: 16px; line-height: 1.4; }
.hub-type { display: inline-block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--bg); background: var(--start); border-radius: 4px; padding: 1px 6px; margin-right: 6px; vertical-align: middle; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-num { font-size: clamp(28px, 4vw, 40px); font-weight: 800; color: var(--start); font-variant-numeric: tabular-nums; }
.stat:nth-child(3) .stat-num { color: var(--end); }
.stat-label { color: var(--dim); font-size: 13px; margin-top: 4px; }

.footplate { position: fixed; left: 0; right: 0; bottom: 0; background: #070a0f; border-top: 1px solid var(--line);
  color: var(--dim); font-size: 13px; text-align: center; padding: 9px 16px; }
.footplate .sep { margin: 0 10px; opacity: .5; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #555; margin-right: 7px; vertical-align: middle; }
.dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }
