:root {
  --bg: #000;
  --ivory: #f3eee4;
  --gold: #d8b56a;
  --silver: #c8c4bd;
  --grey: #6b6f78;
  --muted: #8a8f9c;
  --line: rgba(243, 238, 228, 0.09);
  --kda: #a9a39a;
  --dsa: #5b93a0;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  font: 16px/1.65 "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }

/* ---- starfield ---- */
#stars { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ---- header ---- */
header { position: relative; z-index: 1; padding: 36px 6vw 24px; }
.hdr-in { max-width: 1180px; margin: 0 auto; }
h1 { margin: 0; font: 300 clamp(34px, 6.5vw, 68px)/1 "Sora", sans-serif; letter-spacing: .26em; text-shadow: 0 0 40px rgba(243, 238, 228, .22); }
.h1-sep { color: var(--muted); font-weight: 300; }
.h1-gold { color: var(--gold); }
.tag { margin-top: 14px; font: 700 clamp(12px, 1.6vw, 16px)/1 "Sora", sans-serif; letter-spacing: .34em; text-transform: uppercase; color: var(--gold); }
.lede { margin-top: 20px; max-width: 720px; color: #cfd2dc; font-weight: 300; font-size: 16px; }
.mode-badge {
  display: inline-block; margin-top: 22px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(107, 111, 120, .5); color: #b9bdc9;
  font: 400 12px/1 "JetBrains Mono", monospace; letter-spacing: .08em;
  background: rgba(107, 111, 120, .08);
}
.mode-badge.replay { border-color: rgba(107, 111, 120, .6); color: #c3c6cd; }
.mode-badge.live { border-color: rgba(216, 181, 106, .5); color: var(--gold); }
.mode-badge.hidden { display: none; }

.legend { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 16px 22px; font-size: 11.5px; letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.lg { display: inline-flex; align-items: center; gap: 7px; }
.lg i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.lg.active { color: #c3c6cd; }
.lg.active i { box-shadow: 0 0 8px rgba(107, 111, 120, .8); }

/* ---- hero: lattice + stream ---- */
.hero { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; margin: 8px 6vw 0; max-width: 1180px; height: 58vh; min-height: 470px; }
.lattice-col { display: flex; flex-direction: column; min-width: 0; }
#lattice { position: relative; flex: 1; min-height: 0; width: 100%; }
#lattice canvas { display: block; }
.lattice-meta {
  position: relative; z-index: 2; padding: 8px 4px 0; text-align: center;
  font-size: 11px; color: var(--muted); letter-spacing: .06em;
}
.lattice-meta .kda { color: var(--kda); }
.lattice-meta .dsa { color: var(--dsa); }

/* ---- panels & stream ---- */
.panel { position: relative; z-index: 1; padding: 22px 24px; border: 1px solid var(--line); border-radius: 16px; background: rgba(12, 12, 16, .55); backdrop-filter: blur(12px); }
.stream-col { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h2 { margin: 0 0 12px; font: 300 22px/1.2 "Sora", sans-serif; letter-spacing: .06em; }
#stream-status { font-size: 11.5px; color: var(--muted); }

.stream { flex: 1; min-height: 0; overflow-y: auto; scroll-behavior: smooth; }
.stream-wait { color: var(--muted); font-size: 13px; }
.channel-label { margin: 10px 0 4px; font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--muted); }
.channel-label.answer { color: var(--gold); }
.think-text { color: var(--ivory); font-weight: 300; white-space: pre-wrap; }
.answer-text { color: var(--gold); font-weight: 400; white-space: pre-wrap; }

/* ---- empty-state grid ---- */
.grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 26px 6vw 0; max-width: 1180px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; background: rgba(12, 12, 16, .5); backdrop-filter: blur(12px); }
.card h3 { margin: 12px 0 8px; font: 500 15px/1.4 "Sora", sans-serif; }
.card p { margin: 0 0 10px; font-size: 13.5px; color: #b9bdc9; font-weight: 300; }
.card p b { color: var(--ivory); font-weight: 500; }
.card .ev { font-size: 11.5px; color: var(--muted); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(107, 111, 120, .5); color: #a9adb6; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }

footer { position: relative; z-index: 1; margin: 34px 0 0; padding: 26px 6vw 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; letter-spacing: .03em; }
footer b { color: var(--grey); font-weight: 500; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; height: auto; }
  #lattice { height: 42vh; min-height: 320px; }
  .stream-col { height: 44vh; min-height: 300px; }
  .grid { margin: 18px 16px 0; grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  h1 { letter-spacing: .14em; }
  .lede { font-size: 14px; }
  .hero { margin: 8px 16px 0; }
  .grid { margin: 18px 16px 0; grid-template-columns: 1fr; }
}
