/* LaunchDarkly 2026 identity. Palette from SPEC.md section 7. No colors outside it. */
@font-face {
  font-family: "Sora";
  src: url("/static/fonts/sora-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ld-black: #191919;
  --white: #ffffff;
  --gray-02: #d1d6d9;
  --gray-04: #6d6e71;
  --lime: #ddff46;
  --blue: #405bff;
  --pink: #ff35a2;
  --orange: #ff9d29;
  --cyan: #3dd6f5;
  --purple: #a34fde;

  --dot-v1: var(--gray-04);
  --dot-v2: var(--lime);
  --dot-slow: var(--orange);
  --dot-error: var(--pink);
  --dot-ripple: var(--cyan);
  --dot-phone: var(--white);

  --display: "Sora", sans-serif;
  --text: "Inter", sans-serif;
  --u: 1vh;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ld-black);
  color: var(--gray-02);
  font-family: var(--text);
  font-size: calc(var(--u) * 2);
  overflow: hidden;
}

body {
  display: grid;
  grid-template-rows: calc(var(--u) * 9) minmax(0, 1fr) calc(var(--u) * 15);
}

h1, h2 {
  font-family: var(--display);
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.source {
  color: var(--gray-02);
  font-size: calc(var(--u) * 1.5);
  margin: 0;
}

/* Header */
.top {
  display: grid;
  grid-template-columns: 23vw minmax(0, 1fr) 23vw;
  align-items: center;
  padding: 0 2vw;
}
.top h1 { font-size: calc(var(--u) * 3.6); }
.player { font-size: calc(var(--u) * 1.9); color: var(--lime); min-height: 1.2em; }
.banner {
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(var(--u) * 4.4);
  color: var(--white);
  text-align: center;
}
.top .right { justify-self: end; display: flex; align-items: center; gap: 1.2vw; }
/* Replay mode. Always visible while a recording plays (CLAUDE.md rule 5). */
.replay-badge {
  background: var(--orange);
  color: var(--ld-black);
  border-radius: 1vh;
  padding: 0.8vh 1.2vw;
  line-height: 1.15;
  text-align: center;
}
.replay-badge strong { display: block; font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 3); }
.replay-badge span { font-size: calc(var(--u) * 1.5); }
body.replay { box-shadow: inset 0 0 0 0.8vh var(--orange); }
body.replay .source::after { content: " (recorded)"; color: var(--orange); }
.conn {
  justify-self: end;
  font-size: calc(var(--u) * 1.6);
  color: var(--gray-02);
}
.conn::before {
  content: "";
  display: inline-block;
  width: 1.2vh;
  height: 1.2vh;
  border-radius: 50%;
  margin-right: 0.8vh;
  background: var(--pink);
}
.conn.live::before { background: var(--lime); }

body[data-phase="ROLLING"] .banner { color: var(--lime); }
body[data-phase="CAUGHT"] .banner { color: var(--cyan); }
body[data-phase="SHIPPED"] .banner { color: var(--lime); }
body[data-phase="TIMEOUT"] .banner { color: var(--orange); }

/* Main */
main {
  display: grid;
  grid-template-columns: 23vw minmax(0, 1fr) 23vw;
  gap: 1.2vw;
  padding: 0 1.2vw;
  min-height: 0;
}

.panel {
  min-width: 0;
  border: 0.2vh solid var(--gray-04);
  border-radius: 1.6vh;
  padding: 2.4vh 1.6vw;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 1vw; height: 6vh; }
.brand img { height: 5vh; width: auto; max-width: 45%; object-fit: contain; }
.brand h2 { font-size: calc(var(--u) * 3.4); }
.brand img + h2 { position: absolute; left: -9999px; }

dl { margin: 1vh 0 0; display: flex; flex-direction: column; gap: 2.4vh; }
.stat dt { font-size: calc(var(--u) * 1.9); color: var(--gray-02); }
.stat dd {
  margin: 0.4vh 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: calc(var(--u) * 4.2);
  line-height: 1.1;
  color: var(--white);
}
#ld-regressed.hit { color: var(--pink); }
body[data-phase="CAUGHT"] #ld-status { color: var(--cyan); }

.metrics { list-style: none; margin: auto 0 0; padding: 0; display: flex; flex-direction: column; gap: 1vh; }
.metrics li { display: flex; align-items: center; gap: 0.8vw; font-size: calc(var(--u) * 2); color: var(--white); }
.metrics li::before {
  content: "";
  width: 1.6vh;
  height: 1.6vh;
  border-radius: 50%;
  background: var(--gray-04);
  flex: none;
}
.metrics li.ok::before { background: var(--lime); }
.metrics li.regressed::before { background: var(--pink); }
.metrics li span { margin-left: auto; color: var(--gray-02); }

.nr-rows { display: flex; flex-direction: column; gap: 2.4vh; margin-top: 1vh; }
.nr-version h3 { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 2.6); color: var(--white); margin: 0 0 0.8vh; }
.nr-version[data-variation="v2"] h3 { color: var(--lime); }
.nr-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 1vw; margin-top: 0.6vh; }
.nr-stat .label { font-size: calc(var(--u) * 1.9); color: var(--gray-02); }
.nr-stat .value { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 4.2); line-height: 1.1; color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nr-stat .value.empty { font-size: calc(var(--u) * 2.4); color: var(--gray-02); }
.nr-stat .value.slow { color: var(--orange); }
.nr-stat .value.bad { color: var(--pink); }
.nr-count { font-size: calc(var(--u) * 1.5); color: var(--gray-02); margin-top: 0.4vh; min-height: 1.2em; }
#nr-status { margin-top: auto; }

/* Center */
.center {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 1.2vh;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.counters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1vw; }
.counter { text-align: center; }
.counter .value {
  font-family: var(--display);
  font-weight: 700;
  font-size: min(calc(var(--u) * 11), 6.4vw);
  line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}
.counter .label { font-size: calc(var(--u) * 2.4); color: var(--white); margin-top: 0.6vh; }
.counter.affected .value { color: var(--pink); }
.counter.protected .value { color: var(--lime); }
body[data-phase="CAUGHT"] .counter.timer .value { color: var(--cyan); }

.grid-wrap { position: relative; min-height: 0; }
#dots { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.legend {
  display: flex;
  align-items: center;
  gap: 0.4vh 1.2vw;
  flex-wrap: wrap;
  font-size: calc(var(--u) * 1.7);
  color: var(--white);
}
.legend .source { margin-right: auto; }
.legend .count { color: var(--gray-02); }
.key { display: inline-flex; align-items: center; gap: 0.5vw; white-space: nowrap; }
.legend .source, .legend .count { white-space: nowrap; }
.dot { width: 1.6vh; height: 1.6vh; border-radius: 50%; display: inline-block; }
.dot.v1 { background: var(--dot-v1); }
.dot.v2 { background: var(--dot-v2); }
.dot.slow { background: var(--dot-slow); }
.dot.err { background: var(--dot-error); }
.dot.phone { background: transparent; border: 0.3vh solid var(--dot-phone); }

/* IDLE shows the attract block, ARMED the countdown, every other phase the counters. */
.attract, .armed { display: none; align-items: center; justify-content: center; gap: 2.4vw; min-height: calc(var(--u) * 19); }
body[data-phase="IDLE"] .attract, body[data-phase="RESETTING"] .attract { display: flex; }
body[data-phase="ARMED"] .armed { display: flex; }
body[data-phase="IDLE"] .counters, body[data-phase="RESETTING"] .counters, body[data-phase="ARMED"] .counters { display: none; }
.qr-big { height: 19vh; width: 19vh; border-radius: 1vh; display: block; }
.attract .headline, .armed .headline { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 5); line-height: 1.1; color: var(--white); }
.attract .url, .armed .url { font-size: calc(var(--u) * 3.4); color: var(--lime); margin-top: 1vh; }
.attract .source { margin-top: 0.8vh; }
.countdown { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 17); line-height: 1; color: var(--lime); font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: center; }
body[data-phase="ARMED"] .banner { color: var(--lime); }
/* The attract block already shows the QR code, so the footer copy steps aside while idle. */
body[data-phase="IDLE"] .bottom .join, body[data-phase="RESETTING"] .bottom .join { visibility: hidden; }

/* Phones strip: readable nicknames, each with a dot showing that phone's last order */
.phones-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1.2vw; align-items: start; }
.phones-head { display: flex; flex-direction: column; gap: 0.3vh; }
.phones-head .title { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 2.2); color: var(--white); white-space: nowrap; }
.phones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6vh 1vw;
  height: calc(var(--u) * 9.6);
  overflow: hidden;
  align-content: flex-start;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5vw;
  font-size: calc(var(--u) * 2);
  line-height: calc(var(--u) * 2.6);
  color: var(--white);
  white-space: nowrap;
}
.chip.more { color: var(--gray-02); }
.dot.ring { outline: 0.3vh solid var(--dot-phone); outline-offset: 0.2vh; margin: 0 0.4vh; }

/* Footer */
.bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 0 2vw;
  font-size: calc(var(--u) * 1.8);
  color: var(--gray-02);
}
.board { justify-self: end; min-width: 0; }
.board-head { display: flex; align-items: baseline; gap: 1vw; }
.board-head .title { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 2.4); color: var(--white); }
#board { list-style: none; margin: 0.6vh 0 0; padding: 0; display: grid; gap: 0.3vh; }
#board li { display: grid; grid-template-columns: 2.4vw 5vw minmax(0, 15vw) 8vw 12vw; gap: 1vw; font-size: calc(var(--u) * 2.2); color: var(--white); align-items: baseline; }
#board li .who { font-family: var(--display); font-weight: 700; color: var(--lime); }
#board li .n { color: var(--gray-02); }
#board li.empty { display: block; color: var(--gray-02); }
.join { display: flex; align-items: center; gap: 1.4vw; }
.join .qr { height: 12.5vh; width: 12.5vh; border-radius: 0.8vh; display: block; }
.join .cta { font-family: var(--display); font-weight: 700; font-size: calc(var(--u) * 3.4); color: var(--white); }
.join .url { font-size: calc(var(--u) * 2.6); color: var(--lime); margin-top: 0.6vh; }
