/* /live and /live/embed: the valley full width, one header strip, one readout strip. Colours, type and motion come from tokens.css. */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--bg); color: var(--fg); font-family: var(--font); font-size: var(--fs); }
#live { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; width: 100%; overflow: hidden; }
body[data-embed="1"] #live-top { display: none; }
body[data-embed="1"] #live { grid-template-rows: minmax(0, 1fr) auto; }

#live-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s5); min-height: var(--plate-h); padding: var(--s2) var(--s5); background: var(--plate); border-bottom: 1px solid var(--line); }
.live-brand { margin: 0; font-size: var(--t-m); font-weight: var(--w-title); letter-spacing: var(--track-title); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-play { flex: none; display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 var(--s5); background: var(--amber); color: var(--amber-ink); font-weight: var(--w-strong); font-size: var(--t-s); text-decoration: none; border-radius: var(--r); }
.live-play:hover { filter: brightness(1.08); }
.live-play:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

#live-stage { position: relative; min-height: 0; min-width: 0; background: var(--well); }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; }
/* The map's Pixi stage (view/stage.js) lies on #map. Left in the flow it sat under #map, out of sight, and grew a few pixels on every resize it caused itself, which pegged a core (sweep 2026-12-01). */
#live-stage > .scene { position: absolute; inset: 0; pointer-events: none; }
#live-stage > .scene canvas { display: block; width: 100%; height: 100%; }
.live-boot { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--dim); background: var(--well); }
.live-boot[hidden] { display: none; }

#live-hud { background: var(--panel); border-top: 1px solid var(--line); padding: var(--s4) var(--s5); display: grid; gap: var(--s3); padding-bottom: max(var(--s4), env(safe-area-inset-bottom)); }
.live-caption { margin: 0; min-height: 1.4em; font-size: var(--t-l); font-weight: var(--w-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-caption:empty::before { content: "\00a0"; }
.live-row { display: flex; align-items: center; gap: var(--s5) var(--s6); min-width: 0; }
.live-works { margin: 0; flex: none; max-width: 40%; font-size: var(--t-m); font-weight: var(--w-title); letter-spacing: var(--track-title); text-transform: uppercase; color: var(--amber-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-contract { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--s4); }
.live-pct { flex: none; min-width: 3.4em; text-align: right; font-family: var(--font-num); font-weight: 700; }
#live-bar { flex: 0 1 14rem; width: 14rem; min-width: 4rem; height: 10px; appearance: none; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--well); overflow: hidden; }
#live-bar::-webkit-progress-bar { background: var(--well); }
#live-bar::-webkit-progress-value { background: var(--amber); }
#live-bar::-moz-progress-bar { background: var(--amber); }
.live-goods { flex: 1 1 auto; min-width: 0; margin: 0; padding: 0; list-style: none; display: flex; gap: var(--s5); overflow: hidden; white-space: nowrap; color: var(--dim); font-size: var(--t-s); }
.live-goods li { flex: none; }
.live-goods b { font-family: var(--font-num); font-weight: 700; color: var(--fg); }
.live-seals { flex: none; margin: 0; padding: 0; list-style: none; display: flex; gap: var(--s3); }
.live-seals li { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line); border-radius: var(--r); background: var(--well); opacity: 0.4; }
.live-seals li.earned { opacity: 1; border-color: var(--amber-line); background: var(--amber-soft); }
/* house chrome on /live and /live/embed: build · report · back (audit SW-6) */
.live-chrome { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s5); font-size: var(--t-xs); color: var(--dim); }
.live-ver { font-family: var(--font-num); }
.live-chrome a { display: inline-flex; align-items: center; min-height: 24px; color: var(--dim); text-decoration: underline; text-underline-offset: 2px; }
.live-chrome a:hover { color: var(--fg); }
.live-chrome a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.live-seals img { width: 20px; height: 20px; image-rendering: pixelated; display: block; }

@media (max-width: 700px) {
  .live-row { flex-wrap: wrap; }
  .live-works { max-width: 100%; flex: 1 1 auto; }
  .live-contract { order: 3; flex: 1 1 100%; }
  #live-bar { flex: 1 1 auto; width: auto; }
  .live-contract { flex-wrap: wrap; }
  .live-goods { order: 4; flex: 1 1 100%; }
  .live-caption { font-size: var(--t-m); }
}
@media (max-height: 420px) {
  #live-hud { padding-block: var(--s2); gap: 0; }
  #live-top { min-height: 0; padding-block: 0; }
  .live-play { min-height: var(--tap-s); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
