/* ═══════════════════════════════════════════════════════════════════════════
   PREDICTER · LAYOUT  (css/app.css)
   Gate · shell regions · views · board · Theatre flagship · mobile bottom-nav.
   Tokens + primitives come from system.css.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── GATE (pre-login) — app-shaped, not a brochure ──────────────────────── */
#gate {
  height: 100%; display: grid; grid-template-rows: var(--head-h) 1fr;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(240, 192, 96, .1), transparent 55%),
    radial-gradient(700px 400px at 90% 20%, rgba(93, 255, 177, .06), transparent 50%),
    var(--bg0);
}
#gate .g-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; border-bottom: 1px solid var(--line);
  background: rgba(7, 6, 10, .85); backdrop-filter: blur(12px);
}
#gate .g-body {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px;
  padding: 28px 24px; max-width: 1200px; width: 100%; margin: 0 auto;
  align-items: center; overflow: auto;
}
@media (max-width: 900px) { #gate .g-body { grid-template-columns: 1fr; padding: 20px 16px 40px; } }

.g-copy h1 {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl);
  line-height: .98; margin: 14px 0 12px; letter-spacing: -.02em;
}
.g-copy h1 em { font-style: normal; color: var(--gold); text-shadow: 0 0 40px rgba(240, 192, 96, .3); }
.g-copy .lede {
  font-size: var(--fs-md); color: var(--mute); max-width: 36ch;
  line-height: 1.35; font-weight: 500; margin: 0 0 18px;
}
.g-copy .clerk-line {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--red);
  border-left: 3px solid var(--red); padding: 8px 12px; margin: 0 0 22px;
  background: var(--red-dim); max-width: 40ch; line-height: 1.4;
}
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 22px; }
@media (max-width: 700px) { .steps { grid-template-columns: 1fr 1fr; } }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.step b {
  display: block; font-family: var(--font-mono); font-size: var(--fs-2xs);
  color: var(--gold); letter-spacing: .14em; margin-bottom: 4px;
}
.step span { font-size: var(--fs-sm); color: var(--mute); font-weight: 500; line-height: 1.25; }
.not-diablo { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute2); letter-spacing: .06em; }

.gate-card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--elev-2);
}
.gate-card label {
  display: grid; gap: 6px; font-size: var(--fs-2xs); letter-spacing: .14em;
  text-transform: uppercase; color: var(--mute); margin-bottom: 12px;
}
.gate-card input {
  background: #0a0910; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font-family: var(--font-mono); font-size: var(--fs-sm);
}
.gate-card input:focus { outline: none; border-color: var(--gold); }
.gate-note { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute2); margin-top: 14px; line-height: 1.4; }

/* ── APP SHELL ─────────────────────────────────────────────────────────── */
#app {
  height: 100%; display: grid;
  grid-template-columns: var(--nav-w) 1fr var(--rail-w);
  grid-template-rows: var(--head-h) 1fr auto;
  grid-template-areas: "head head head" "nav main rail" "foot foot foot";
  position: relative; z-index: 1;
}

#head {
  grid-area: head; display: flex; align-items: center; gap: 14px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 14, .92); backdrop-filter: blur(14px); z-index: 20;
}
#head .spacer { flex: 1; }
#head .live-bug {
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent);
  border: 1px solid var(--accent-soft); background: rgba(0, 0, 0, .35);
  padding: 5px 10px; border-radius: var(--radius-pill); display: flex; align-items: center; gap: 8px;
}
#head .live-bug .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); animation: pulse 1.6s ease infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
#head .clock {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute);
  letter-spacing: .08em; min-width: 9ch; text-align: right;
}
/* APP-CONSOLE badge — proves the standalone surface reads the SAME build id.
   Hidden on the web surface; shown only when running as the installed console. */
.surface-badge {
  display: none; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .12em;
  text-transform: uppercase; color: var(--violet);
  border: 1px solid rgba(183, 148, 255, .32); background: var(--violet-dim);
  padding: 5px 10px; border-radius: var(--radius-pill);
}
.surface-badge b { color: var(--mint); font-weight: 600; }
body[data-surface="console"] .surface-badge { display: flex; }
#head .user {
  display: flex; align-items: center; gap: 8px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; font-size: var(--fs-sm);
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--gold));
  display: grid; place-items: center; font-size: var(--fs-2xs); font-weight: 800; color: #120e08;
}

#nav {
  grid-area: nav; background: var(--bg1); border-right: 1px solid var(--line);
  padding: 12px 10px; display: flex; flex-direction: column; gap: 4px;
}
.nav-btn {
  text-align: left; background: transparent; border: 1px solid transparent;
  border-radius: 10px; padding: 12px 12px; color: var(--mute);
  text-transform: uppercase; letter-spacing: .14em; font-weight: 700;
  font-size: var(--fs-sm); transition: .15s var(--ease);
}
.nav-btn:hover { color: var(--text); background: rgba(240, 192, 96, .06); }
.nav-btn.active { color: var(--gold); background: rgba(240, 192, 96, .1); border-color: rgba(240, 192, 96, .22); }
.nav-btn .k {
  display: block; font-family: var(--font-mono); font-size: var(--fs-2xs);
  color: var(--mute2); letter-spacing: .08em; font-weight: 500; margin-top: 2px; text-transform: none;
}
.nav-btn.active .k { color: var(--gold-dim); }
#nav .leave {
  margin-top: auto; background: none; border: none; color: var(--mute2);
  font-size: var(--fs-2xs); letter-spacing: .12em; text-transform: uppercase; padding: 12px; text-align: left;
}
#nav .leave:hover { color: var(--red); }

#main {
  grid-area: main; overflow: auto; padding: 16px 18px 24px;
  background: radial-gradient(600px 300px at 0% 0%, rgba(240, 192, 96, .04), transparent 60%), var(--bg0);
}
#rail {
  grid-area: rail; background: var(--bg1); border-left: 1px solid var(--line);
  padding: 14px; overflow: auto; display: flex; flex-direction: column; gap: 12px;
}
.rail-h {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-dim); font-weight: 600; margin: 0 0 10px;
}
.rail-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-hi), transparent); }

#foot {
  grid-area: foot; display: flex; align-items: center; gap: 14px;
  padding: 6px 16px 10px; border-top: 1px solid var(--line);
  background: rgba(7, 6, 10, .9); font-family: var(--font-mono);
  font-size: 11px; color: var(--mute2); letter-spacing: .08em; position: relative; z-index: 25;
}
#foot b { color: var(--mute); font-weight: 600; }
#foot .sp { flex: 1; }

/* ── STAGE STRIP — the one hero readout per view (single primary action) ─── */
.stage-strip {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, #14121c 0%, #0c0a12 55%, #0a0810 100%);
  border: 1px solid var(--line-hi); border-radius: 14px; padding: 18px 20px 16px; margin-bottom: 12px;
}
.stage-strip .kicker {
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-dim); margin: 0 0 4px;
}
.stage-strip .phase {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-display);
  line-height: .95; letter-spacing: -.02em; margin: 0 0 6px;
  color: var(--gold-hi); text-shadow: 0 0 36px rgba(240, 192, 96, .28), 0 4px 12px rgba(0, 0, 0, .5);
}
.stage-strip .caption {
  font-size: var(--fs-sm); color: var(--mute); margin: 0 0 14px; max-width: 48ch; font-weight: 500; line-height: 1.3;
}
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 700px) { .meters { grid-template-columns: repeat(2, 1fr); } }
.m { background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .05); border-radius: 10px; padding: 10px 12px; }
.m .l {
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold-dim); margin-bottom: 4px;
}
.m .v {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg);
  color: var(--text); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stage-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ── CALL CARDS ────────────────────────────────────────────────────────── */
.call-list { display: flex; flex-direction: column; gap: 8px; }
.call {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  background: var(--panel2); border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: border-color .15s, transform .15s var(--ease), background .15s;
}
.call:hover { border-color: var(--line-hi); transform: translateY(-1px); background: var(--panel3); }
.call .who { font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: var(--fs-sm); }
.call .thesis { color: var(--mute); font-size: var(--fs-sm); margin-top: 2px; font-weight: 500; }
.call .meta {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute2);
  margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
}
.score { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); min-width: 56px; text-align: right; line-height: 1; }
.score.hit { color: var(--mint); }
.score.miss { color: var(--red); }
.score.open { color: var(--gold); font-size: var(--fs-xs); letter-spacing: .14em; padding-top: 10px; text-transform: uppercase; }

/* ── LEADERBOARD / STATS ───────────────────────────────────────────────── */
.lb-row {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 8px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.lb-row:last-child { border-bottom: 0; }
.lb-row .r { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute2); }
.lb-row .n { font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: var(--fs-sm); }
.lb-row .a { font-family: var(--font-mono); color: var(--mint); font-size: var(--fs-sm); }
.lb-row.me .n { color: var(--gold); }

.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--panel2); border: 1px solid rgba(255, 255, 255, .04); border-radius: 12px; padding: 12px; }
.stat b { display: block; font-family: var(--font-display); font-size: var(--fs-xl); color: var(--gold); line-height: 1; }
.stat span { font-family: var(--font-mono); font-size: 10px; color: var(--mute); letter-spacing: .12em; text-transform: uppercase; }

.foot-stamp { font-family: var(--font-mono); font-size: 10px; color: var(--mute2); letter-spacing: .08em; padding: 8px 2px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   THEATRE — THE FLAGSHIP.  Receipt film: seal → path → resolve, score reveal
   as a finish-move. Seal timestamp + "time since seal" are ALWAYS visible.
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-bg {
  position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .78);
  display: grid; place-items: center; padding: 16px; backdrop-filter: blur(10px);
}
.modal {
  width: min(880px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--elev-3);
}
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-family: var(--font-display); font-size: var(--fs-md); letter-spacing: .06em; }
.modal-b { padding: 16px; }

/* ALWAYS-ON RECEIPT BAR — seal time + live "since seal" clock, never hidden */
.th-receipt {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  font-family: var(--font-mono); font-size: var(--fs-2xs); letter-spacing: .08em;
  color: var(--mute); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 12px; background: rgba(0, 0, 0, .3);
}
.th-receipt .k { color: var(--gold-dim); text-transform: uppercase; letter-spacing: .14em; }
.th-receipt .v { color: var(--text); }
.th-receipt .since { color: var(--mint); font-weight: 600; }
.th-receipt .since.frozen { color: var(--gold); }

.stage {
  aspect-ratio: 16/9; border-radius: 12px; background: #0a0c12;
  border: 1px solid rgba(255, 255, 255, .06); position: relative; overflow: hidden;
  display: grid; place-items: center;
}
.stage .chart {
  width: 82%; height: 52%; border-radius: 8px; position: relative;
  background:
    linear-gradient(180deg, rgba(93, 255, 177, .06), transparent),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 22px);
}
.stage .chart::after {
  content: ""; position: absolute; left: 6%; right: 6%; top: 30%; height: 50%;
  background: linear-gradient(180deg, rgba(93, 255, 177, .5), rgba(93, 255, 177, .04));
  clip-path: polygon(0 70%, 20% 55%, 35% 65%, 50% 30%, 65% 40%, 80% 15%, 100% 25%, 100% 100%, 0 100%);
  transition: opacity .3s var(--ease);
}
.stage .flabel {
  position: absolute; top: 12px; left: 12px; font-family: var(--font-mono);
  font-size: var(--fs-2xs); letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); background: rgba(0, 0, 0, .55); padding: 5px 9px; border-radius: 6px;
}
.stage .stamp { position: absolute; top: 14px; right: 14px; transform: rotate(8deg); font-size: var(--fs-md); }
.stage .wa {
  position: absolute; left: 14px; bottom: 14px; max-width: 74%;
  background: #1f2c34; border-radius: 10px 10px 10px 3px; padding: 9px 11px;
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: #e9edef; box-shadow: var(--elev-1);
}
.stage .wa .t { opacity: .55; margin-top: 4px; font-size: 10px; }

/* SCORE REVEAL — the finish-move. Mega number counts up, band label snaps in. */
.reveal {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  background: radial-gradient(80% 80% at 50% 45%, rgba(0, 0, 0, .55), rgba(0, 0, 0, .85));
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.reveal.on { opacity: 1; }
.reveal .score-mega {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-mega);
  line-height: .82; letter-spacing: -.03em; color: var(--gold);
  text-shadow: 0 0 60px rgba(240, 192, 96, .5), 0 6px 30px rgba(0, 0, 0, .6);
}
.reveal.hit  .score-mega { color: var(--mint); text-shadow: 0 0 60px rgba(93, 255, 177, .5); }
.reveal.miss .score-mega { color: var(--red);  text-shadow: 0 0 60px rgba(255, 92, 122, .5); }
.reveal .band {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-lg);
  letter-spacing: .2em; text-transform: uppercase; margin-top: 8px;
  color: var(--text); opacity: 0; transform: scale(1.4);
}
.reveal.on .band { animation: bandSnap .45s var(--ease-out) .35s forwards; }
@keyframes bandSnap { to { opacity: 1; transform: scale(1); } }
.reveal .verdict {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--violet);
  letter-spacing: .06em; margin-top: 12px; max-width: 42ch; line-height: 1.5; opacity: 0;
}
.reveal.on .verdict { animation: fadeUp .4s var(--ease-out) .7s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* score component breakdown — transparent formula (PRODUCT_SPEC §8) */
.score-breakdown { display: grid; gap: 6px; margin-top: 12px; }
.sb-row {
  display: grid; grid-template-columns: 12ch 1fr auto; gap: 10px; align-items: center;
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute);
}
.sb-row .bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.sb-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 3px; }
.sb-row .pts { color: var(--gold); min-width: 5ch; text-align: right; }

.scrub { margin-top: 12px; display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; }
.scrub input[type=range] { width: 100%; accent-color: var(--gold); }
#th-play { min-width: 44px; }
#th-play.playing { border-color: var(--gold); color: var(--gold); background: rgba(240, 192, 96, .1); }

/* v23 — per-frame caption strip (thesis / path note / verdict) */
.th-caption {
  margin-top: 10px; font-family: var(--font-mono); font-size: var(--fs-2xs);
  color: var(--mute); letter-spacing: .04em; line-height: 1.5; min-height: 1.5em;
  border-left: 3px solid var(--gold-dim); padding: 2px 0 2px 10px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COMPOSE v2 — live preview card + the SEAL finish-move (full-screen stamp).
   ═══════════════════════════════════════════════════════════════════════════ */
.call.preview { cursor: default; border-style: dashed; border-color: var(--line-hi); background: rgba(240, 192, 96, .03); }
.call.preview:hover { transform: none; background: rgba(240, 192, 96, .03); }
.call .thesis .ph { color: var(--mute2); font-style: italic; }
.call .meta .proof { color: var(--mint); }

/* SEAL FINISH-MOVE — the rubber stamp slams the whole screen on seal */
.seal-fx {
  position: fixed; inset: 0; z-index: 70; display: grid; place-content: center; text-align: center;
  background: radial-gradient(70% 70% at 50% 45%, rgba(10, 8, 14, .82), rgba(4, 3, 6, .95));
  backdrop-filter: blur(6px); opacity: 0; pointer-events: none;
}
.seal-fx.on { opacity: 1; animation: sealFade 1.5s var(--ease) forwards; }
@keyframes sealFade { 0%, 78% { opacity: 1; } 100% { opacity: 0; } }
.seal-fx-stamp {
  font-family: var(--font-display); font-weight: 800; font-size: var(--fs-mega);
  letter-spacing: .04em; color: var(--mint); line-height: .9;
  border: 8px solid var(--mint); border-radius: 18px; padding: 10px 40px;
  transform: rotate(-9deg) scale(2.4); opacity: 0;
  text-shadow: 0 0 50px rgba(93, 255, 177, .5); box-shadow: 0 0 70px rgba(93, 255, 177, .28), inset 0 0 40px rgba(93, 255, 177, .12);
}
.seal-fx.on .seal-fx-stamp { animation: stampSlam .5s var(--ease-out) forwards; }
@keyframes stampSlam {
  0% { transform: rotate(-9deg) scale(2.4); opacity: 0; }
  60% { transform: rotate(-9deg) scale(.92); opacity: 1; }
  80% { transform: rotate(-9deg) scale(1.05); }
  100% { transform: rotate(-9deg) scale(1); opacity: 1; }
}
.seal-fx-asset {
  font-family: var(--font-mono); font-size: var(--fs-md); letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold); margin-top: 22px; opacity: 0;
}
.seal-fx-sub {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--violet);
  letter-spacing: .06em; margin-top: 10px; max-width: 42ch; line-height: 1.5; opacity: 0;
  padding: 0 20px;
}
.seal-fx.on .seal-fx-asset { animation: fadeUp .4s var(--ease-out) .4s forwards; }
.seal-fx.on .seal-fx-sub   { animation: fadeUp .4s var(--ease-out) .58s forwards; }
@media (prefers-reduced-motion: reduce) {
  .seal-fx.on { animation: none; opacity: 1; }
  .seal-fx.on .seal-fx-stamp { animation: none; transform: rotate(-9deg) scale(1); opacity: 1; }
  .seal-fx.on .seal-fx-asset, .seal-fx.on .seal-fx-sub { animation: none; opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PROFILE v2 — fighter head · 4 stat tiles · band distribution.
   ═══════════════════════════════════════════════════════════════════════════ */
.fighter-head { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-bottom: 14px; }
.fh-av {
  width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(135deg, var(--violet), var(--gold)); color: #120e08;
  display: grid; place-items: center; font-family: var(--font-display);
  font-weight: 800; font-size: var(--fs-lg); box-shadow: var(--glow-gold);
}
.fh-name { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-xl); letter-spacing: .04em; line-height: 1; }
.fh-sub { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mint); letter-spacing: .06em; margin-top: 6px; }
.fh-sub .mut, .mut { color: var(--mute2); }
.fh-rank { text-align: right; }
.fh-rank b { display: block; font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); color: var(--gold); line-height: 1; }
.fh-rank span { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.stats4 { grid-template-columns: repeat(4, 1fr); }
.stat b#st-best { color: var(--mint); }

.pf-bands-wrap { margin-top: 4px; }
.pf-bands { display: grid; gap: 5px; }
.pf-band { display: grid; grid-template-columns: 13ch 1fr 3ch; gap: 10px; align-items: center; font-family: var(--font-mono); font-size: var(--fs-2xs); }
.pf-band .lbl { color: var(--mute); letter-spacing: .1em; text-transform: uppercase; }
.pf-band .bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.pf-band .bar i { display: block; height: 100%; border-radius: 4px; }
.pf-band.hit  .bar i { background: linear-gradient(90deg, rgba(93, 255, 177, .35), var(--mint)); }
.pf-band.miss .bar i { background: linear-gradient(90deg, rgba(255, 92, 122, .3), var(--red)); }
.pf-band .n { text-align: right; color: var(--text); }
.pf-bands-empty { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute2); margin: 4px 0 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   SQUAD v2 — invite · podium · standings table · Clerk roast.
   ═══════════════════════════════════════════════════════════════════════════ */
.invite {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(93, 255, 177, .05); border: 1px solid rgba(93, 255, 177, .22);
  border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
}
.inv-l { display: flex; flex-direction: column; gap: 2px; }
.inv-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.inv-code { font-family: var(--font-mono); font-size: var(--fs-md); font-weight: 600; color: var(--mint); letter-spacing: .12em; }
.squad-note { color: var(--mute); font-size: var(--fs-sm); margin: 0 0 14px; font-weight: 500; line-height: 1.35; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; }
.pod {
  background: var(--panel2); border: 1px solid rgba(255, 255, 255, .05); border-radius: 12px;
  padding: 12px 10px 14px; text-align: center; position: relative;
}
.pod.p1 { border-color: rgba(240, 192, 96, .4); background: linear-gradient(180deg, rgba(240, 192, 96, .1), var(--panel2)); box-shadow: var(--glow-gold); transform: translateY(-6px); }
.pod.p2 { border-color: rgba(220, 220, 230, .18); }
.pod.p3 { border-color: rgba(205, 130, 90, .22); }
.pod.me { outline: 1px solid var(--line-hi); }
.pod .medal { font-size: var(--fs-lg); line-height: 1; }
.pod-name { font-family: var(--font-ui); font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-sm); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod-avg { font-family: var(--font-display); font-weight: 800; font-size: var(--fs-2xl); color: var(--gold); line-height: 1; margin-top: 4px; }
.pod.p2 .pod-avg, .pod.p3 .pod-avg { color: var(--text); font-size: var(--fs-xl); }
.pod-sub { font-family: var(--font-mono); font-size: 10px; color: var(--mute); letter-spacing: .06em; margin-top: 4px; }

.sq-head, .sq-row { display: grid; grid-template-columns: 34px 1fr 5ch 5ch 5ch 6ch 6ch; gap: 8px; align-items: center; }
.sq-head { padding: 0 0 8px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-dim); }
.sq-head .avg, .sq-head .d1, .sq-head .hit, .sq-head .stk, .sq-head .elo { text-align: right; }
.sq-row { padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .04); }
.sq-row:last-child { border-bottom: 0; }
.sq-row .r { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute2); }
.sq-row .n { font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sq-row .n em { font-style: normal; font-family: var(--font-mono); font-size: 9px; color: var(--gold); letter-spacing: .1em; }
.sq-row .avg { font-family: var(--font-display); font-weight: 800; color: var(--gold); text-align: right; }
.sq-row .hit { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mint); text-align: right; }
.sq-row .stk { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--gold); text-align: right; }
.sq-row .elo { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute); text-align: right; }
.sq-row.me { background: rgba(240, 192, 96, .05); border-radius: 8px; }
.sq-row.me .n { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — collapses to single column + bottom-nav (mobile-wrap ready).
   Screen map + safe-area plan documented in ARCHITECTURE.md.
   ═══════════════════════════════════════════════════════════════════════════ */
#bottomnav { display: none; }

@media (max-width: 960px) {
  body { overflow: auto; }
  #app {
    height: auto; min-height: 100%;
    grid-template-columns: 1fr;
    grid-template-rows: var(--head-h) 1fr auto;
    grid-template-areas: "head" "main" "rail";
    padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom));
  }
  #head { padding-top: var(--safe-top); }
  #nav { display: none; }               /* side rail → bottom-nav on mobile */
  #rail { border-left: 0; border-top: 1px solid var(--line); }
  #foot { display: none; }

  /* fixed bottom-nav — the native-app tab bar (maps to iOS/Android wrap) */
  #bottomnav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--bottomnav-h) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: rgba(10, 8, 14, .96); border-top: 1px solid var(--line-hi);
    backdrop-filter: blur(14px);
  }
  #bottomnav button {
    background: none; border: 0; color: var(--mute);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  }
  #bottomnav button .ic { font-size: 18px; line-height: 1; }
  #bottomnav button.active { color: var(--gold); }
  .reveal .score-mega { font-size: clamp(88px, 30vw, 160px); }
}

/* ── v3 Resolve desk ─────────────────────────────────────────────────────── */
.res-modal { max-width: 480px; }
.res-thesis { font-size: var(--fs-md); font-weight: 600; margin: 0 0 6px; line-height: 1.3; }
.res-meta { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute); margin: 0; letter-spacing: .04em; }
.res-void-block {
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: grid; gap: 8px;
}
.badge.void { color: var(--mute); border-color: rgba(154,145,132,.4); }
.score.void { color: var(--mute2); font-size: var(--fs-sm); letter-spacing: .1em; }
.card-acts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip-win {
  font-family: var(--font-mono); font-size: 10px; color: var(--gold-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px;
}
.call:focus {
  outline: none; border-color: var(--line-hi);
  box-shadow: 0 0 0 1px rgba(240,192,96,.35);
}

/* ── v6 price path · v21 seeded noise + S/R guide lines ─────────────────── */
.path-svg { width: 100%; height: 100%; display: block; }
#th-chart { position: relative; width: 82%; height: 52%; }
#th-chart .path-svg { position: absolute; inset: 0; }
.path-svg .guide { stroke-width: .7; stroke-dasharray: 2.5 2.5; }
.path-svg .g-s { stroke: rgba(93, 255, 177, .42); }
.path-svg .g-r { stroke: rgba(240, 192, 96, .45); }

/* ── v7 coach ────────────────────────────────────────────────────────────── */
.coach {
  margin-bottom: 12px; border: 1px solid rgba(183,148,255,.3);
  background: rgba(183,148,255,.07); border-radius: 12px; padding: 12px 14px;
}
.coach-inner strong {
  display: block; font-family: var(--font-display); letter-spacing: .04em;
  margin-bottom: 8px; color: var(--violet);
}
.coach ol { margin: 0 0 10px; padding-left: 1.2em; color: var(--mute); font-size: var(--fs-sm); line-height: 1.4; }
.coach li { margin-bottom: 4px; }
.coach b { color: var(--gold); font-weight: 700; }

/* ── v9–v13 board tools ──────────────────────────────────────────────────── */
.board-tools {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.board-tools select,
.board-tools input[type="search"] {
  background: #0a0910; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-family: var(--font-mono); font-size: var(--fs-2xs);
  color: var(--text); min-height: 36px;
}
.board-tools input[type="search"] { flex: 1 1 140px; min-width: 120px; }
.board-tools select { min-width: 7.5rem; }
.bf-import-lab { cursor: pointer; margin: 0; display: inline-flex; align-items: center; }
.keys-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.keys-table td { padding: 8px 6px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.keys-table td:first-child { width: 38%; color: var(--gold); font-family: var(--font-mono); font-size: var(--fs-2xs); }
.keys-table kbd {
  display: inline-block; padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line-hi); background: rgba(0,0,0,.35);
  font-family: var(--font-mono); font-size: 11px; margin: 0 2px;
}
.call-list.compact .call { padding: 8px 10px; }
.call-list.compact .thesis { font-size: var(--fs-2xs); }
.call-list.compact .call .meta { gap: 4px; }
#bf-density[aria-pressed="true"] {
  border-color: var(--mint); color: var(--mint); background: rgba(93, 255, 177, .08);
}

/* ── v14 install chip · v15 offline strip ───────────────────────────────── */
.shell-strip {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 14px; font-family: var(--font-mono); font-size: var(--fs-2xs);
  letter-spacing: .06em; text-transform: uppercase;
}
.offline-strip {
  background: rgba(255, 92, 122, .14); border-bottom: 1px solid rgba(255, 92, 122, .45);
  color: #ffb3c0;
}
.shell-strip-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red); flex-shrink: 0;
}
body[data-offline="1"] #gate,
body[data-offline="1"] #app { padding-top: 36px; }
.install-chip {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  z-index: 75; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px; max-width: min(520px, calc(100vw - 24px));
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line-hi); border-radius: var(--radius-pill);
  box-shadow: var(--elev-2);
}
.install-chip-copy {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute);
  letter-spacing: .04em; line-height: 1.3;
}
@media (max-width: 600px) {
  .install-chip { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); left: 12px; right: 12px; transform: none; max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEG D (v24–v28) — fighter card polish · histogram · standings drama · podium.
   ═══════════════════════════════════════════════════════════════════════════ */

/* v24 — rank badge metal tones + streak glow + BEST chip */
.fh-rank b.r1 { color: var(--gold); text-shadow: 0 0 28px rgba(240, 192, 96, .55); }
.fh-rank b.r2 { color: #d6dae6; text-shadow: 0 0 18px rgba(214, 218, 230, .35); }
.fh-rank b.r3 { color: #cd825a; text-shadow: 0 0 18px rgba(205, 130, 90, .4); }
#pf-streak.hot {
  color: var(--gold); text-shadow: 0 0 14px rgba(240, 192, 96, .5);
  animation: streakGlow 1.6s ease-in-out infinite;
}
@keyframes streakGlow { 50% { text-shadow: 0 0 26px rgba(240, 192, 96, .9); } }
.best-chip {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em;
  color: var(--mint); border: 1px solid rgba(93, 255, 177, .35);
  background: rgba(93, 255, 177, .07); padding: 2px 7px;
  border-radius: var(--radius-pill); margin-left: 8px;
}

/* v25 — band histogram: share % + home-band highlight + summary */
.pf-band { grid-template-columns: 13ch 1fr auto; }
.pf-band .n .pct { font-style: normal; color: var(--mute2); margin-left: 6px; }
.pf-band.top .lbl { color: var(--gold); }
.pf-band.top .bar { box-shadow: 0 0 0 1px rgba(240, 192, 96, .25); }
.pf-band-sum {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute);
  letter-spacing: .04em; margin: 8px 0 0; padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.pf-band-sum b { color: var(--gold); font-weight: 600; }

/* v26 — standings drama: Δ vs #1 column + louder self row + chase line */
.sq-row .d1 { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--red); text-align: right; }
.sq-row .d1.lead { color: var(--gold); font-size: 9px; letter-spacing: .12em; }
.sq-row .d1.mut { color: var(--mute2); }
.sq-row.me {
  background: linear-gradient(90deg, rgba(240, 192, 96, .12), rgba(240, 192, 96, .02));
  border-left: 3px solid var(--gold); padding-left: 5px; border-radius: 8px;
}
.sq-me-line {
  font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--mute);
  letter-spacing: .04em; margin: 0 0 10px; padding: 8px 12px;
  background: rgba(240, 192, 96, .05); border: 1px solid rgba(240, 192, 96, .18);
  border-radius: 10px;
}
.sq-me-line b { color: var(--gold); font-weight: 600; }

/* v27 — podium energy: place labels + gold/silver/bronze metal tones */
.pod .place {
  position: absolute; top: 8px; left: 10px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .18em; color: var(--mute2);
}
.pod.p1 {
  border-color: rgba(240, 192, 96, .55);
  background: linear-gradient(180deg, rgba(240, 192, 96, .16), rgba(240, 192, 96, .03) 60%, var(--panel2));
  box-shadow: 0 0 34px rgba(240, 192, 96, .16), var(--glow-gold);
  transform: translateY(-8px);
}
.pod.p1 .place { color: var(--gold); }
.pod.p1 .medal { filter: drop-shadow(0 0 10px rgba(240, 192, 96, .6)); }
.pod.p1 .pod-avg { text-shadow: 0 0 26px rgba(240, 192, 96, .45); }
.pod.p2 {
  border-color: rgba(214, 218, 230, .35);
  background: linear-gradient(180deg, rgba(214, 218, 230, .09), var(--panel2));
}
.pod.p2 .place { color: #d6dae6; }
.pod.p2 .medal { filter: drop-shadow(0 0 8px rgba(214, 218, 230, .45)); }
.pod.p3 {
  border-color: rgba(205, 130, 90, .42);
  background: linear-gradient(180deg, rgba(205, 130, 90, .1), var(--panel2));
}
.pod.p3 .place { color: #cd825a; }
.pod.p3 .medal { filter: drop-shadow(0 0 8px rgba(205, 130, 90, .5)); }

@media (prefers-reduced-motion: reduce) {
  #pf-streak.hot { animation: none; }
}

/* ── v18 reduced-motion — Theatre reveal finish-move ────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #head .live-bug .dot { animation: none; opacity: 1; }
  .reveal.on .band { animation: none; opacity: 1; transform: scale(1); }
  .reveal.on .verdict { animation: none; opacity: 1; transform: none; }
  .reveal.on .score-mega { transition: none; }
}
