/* ---------- Stage: fixed 1280×720, scaled to fit, centred, white letterbox ---------- */

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--white);
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  box-sizing: border-box;
  transform-origin: 50% 50%;
  transform: translate(-50%, -50%) scale(var(--scale, 1));
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
  font-variant-numeric: tabular-nums;
}

.stage p { margin: 0; }
.stage h1 { margin: 0; }
.display { font-family: var(--font-display); }

/* Motion: bar widths and marker positions only */
.stage.is-live .anim-w { transition: width var(--motion); }
.stage.is-live .anim-l { transition: left var(--motion); }

/* Partner logos, bottom centre, in source order.
   The PNGs are cropped to the logo and saved at 6× these heights (originals in docs/logos/),
   so they stay sharp when the stage is scaled up to a large screen. */
.brands { display: flex; align-self: center; align-items: center; gap: 40px; }
.brands img { display: block; height: 48px; width: auto; }
/* The round club crests read small at 48px; the negative margin keeps the row 48px tall */
.brands .brand-crest { height: 56px; margin: -4px 0; }

/* Live mode (?socket= / ?race=): shown while there's no connection to the race */
.stage[data-link="down"]::after {
  content: "Connecting to ErgRace…";
  position: absolute;
  left: 64px;
  bottom: 16px;
  font: 600 13px var(--font-body);
  color: var(--pending);
}

/* =====================================================================
   Page frame: header and footer (index.html)
   ===================================================================== */

.route {
  padding: 48px 64px 44px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header */
.r-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; }
.r-head-l { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.r-chiprow { display: flex; align-items: center; gap: 12px; min-width: 0; }
.r-chiprow .chip { flex-shrink: 0; white-space: nowrap; }
/* Competition and race names come from ErgRace: cut a name too long for one line with "…"
   rather than run into the clock. The padding keeps descenders inside the clip. */
.stage .r-h1, .stage .r-sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
}
.chip {
  padding: 4px 10px;
  background: var(--black);
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
}
.r-sub { font-size: 15px; color: var(--muted); }
.r-h1 { font-family: var(--font-display); font-weight: 700; font-size: 42px; line-height: 1.1; }
.r-head-r { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.r-elapsed { font-family: var(--font-display); font-weight: 700; font-size: 32px; }
.r-started { font-size: 14px; color: var(--muted); }

/* Footer */
.r-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  border-top: 1px solid var(--cool-gray);
  padding-top: 24px;
}
.route .brands { margin-top: auto; }
.r-col { display: flex; flex-direction: column; gap: 6px; }
.r-col-mid { align-items: center; text-align: center; }
.r-col-right { align-items: flex-end; text-align: right; }
.r-team { display: flex; align-items: center; gap: 8px; }
.r-team p { font-size: 14px; font-weight: 600; }
.swatch { width: 12px; height: 12px; }
.swatch-1 { background: var(--team1); }
.swatch-2 { background: var(--team2); }
.r-togo { font-family: var(--font-display); font-weight: 700; font-size: 38px; }
.r-note { font-size: 14px; color: var(--muted); }
.r-lead-label { font-size: 14px; font-weight: 600; }
.r-lead { font-family: var(--font-display); font-weight: 800; font-size: 38px; }
.blue { color: var(--c2-blue); }
