/* WSG26 Speed overlay — placeholder branding.
   All brand values live in :root so a single edit re-skins every overlay once
   the official WSG26 logo/palette lands. */
:root {
  /* WSG26 ASU26 palette (from the official brand). Overridable live by the admin panel. */
  --brand-primary:   #141210;   /* near-black */
  --brand-accent:    #c8a04b;   /* WSG26 gold */
  --brand-ink:       #fff8e1;   /* cream white (avoid pure #fff for broadcast) */
  --gold:            #d4af37;   /* leader / rank 1 */
  --green:           #01d04a;   /* improved / new best / confirmed */
  --red:             #c62828;   /* fault / DNF / DSQ */
  --panel-bg:        rgba(18, 15, 10, 0.88);
  --panel-bg-2:      rgba(18, 15, 10, 0.72);
  --font: "Rajdhani", "Segoe UI", "Arial Narrow", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 1920px; height: 1080px;
  background: transparent;            /* keyed out by vMix/OBS */
  overflow: hidden;
  font-family: var(--font);
  color: var(--brand-ink);
  -webkit-font-smoothing: antialiased;
}

#stage { position: relative; width: 1920px; height: 1080px; }

.hidden { opacity: 0 !important; pointer-events: none; }

/* ── Lower third (bottom, inside title-safe) ─────────────────────────────── */
#lowerthird {
  position: absolute;
  left: 96px; bottom: 96px;
  height: 108px;
  display: flex; align-items: stretch;
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  overflow: hidden;
  transform-origin: left bottom;
  transition: opacity .45s ease;
}
.accent { width: var(--accent-w, 10px); background: var(--brand-accent); flex: 0 0 auto; }

.lt-logo { display: none; height: 56px; width: auto; align-self: center; margin: 0 24px 0 10px; object-fit: contain; }

.ioc-box {
  display: flex; align-items: center; justify-content: center;
  min-width: 132px; padding: 0 22px;
  background: var(--brand-primary);
  font-weight: 700; font-size: 44px; letter-spacing: 2px;
}
.who {
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 34px 0 26px; min-width: 420px;
}
.who .name { font-size: 46px; font-weight: 700; line-height: 1; text-transform: uppercase; letter-spacing: .5px; }
.who .meta { font-size: 24px; opacity: .7; margin-top: 8px; letter-spacing: 3px; text-transform: uppercase; }

.clock-box {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  padding: 0 30px; min-width: 260px;
  background: var(--panel-bg-2);
  border-left: 2px solid rgba(255,255,255,.08);
}
.clock { font-size: 62px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.clock.finished { color: var(--green); }
.clock.leader { color: var(--gold); }
.gap { font-size: 26px; font-weight: 600; opacity: .85; margin-top: 6px; font-variant-numeric: tabular-nums; }
.gap.leader { color: var(--gold); }

.status-tag {
  display: none; align-items: center; padding: 0 22px;
  font-size: 30px; font-weight: 700; letter-spacing: 2px;
  background: var(--gold); color: #101010;
}
.status-tag.show { display: flex; }
.status-tag.dnf { background: var(--red); color: #fff; }

/* ── Leaderboard (top-right, inside title-safe) ──────────────────────────── */
#leaderboard {
  position: absolute;
  right: 96px; top: 96px;
  width: 460px;
  background: var(--panel-bg);
  border-radius: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.45);
  overflow: hidden;
  transform-origin: right top;
  transition: opacity .45s ease;
}
#leaderboard header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; background: var(--brand-primary);
}
.lb-title { font-size: 26px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
.brand { font-size: 22px; font-weight: 700; color: var(--brand-accent); letter-spacing: 3px; }
.brand-logo { display: none; height: 40px; width: auto; object-fit: contain; }

#lb-rows { list-style: none; }
#lb-rows li {
  display: grid; grid-template-columns: 46px 62px 1fr auto;
  align-items: center; gap: 10px;
  padding: 12px 20px; font-size: 27px;
  border-top: 1px solid rgba(255,255,255,.06);
  transition: background .3s ease;
}
#lb-rows li .rk   { font-weight: 700; opacity: .8; }
#lb-rows li .ioc  { font-weight: 700; color: var(--brand-accent); letter-spacing: 1px; }
#lb-rows li .nm   { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; }
#lb-rows li .tm   { font-weight: 700; font-variant-numeric: tabular-nums; }
#lb-rows li .gp   { font-size: 20px; opacity: .7; font-variant-numeric: tabular-nums; }
#lb-rows li.leader { background: linear-gradient(90deg, rgba(212,175,55,.28), transparent); }
#lb-rows li.leader .rk { color: var(--gold); opacity: 1; }
#lb-rows li.current { background: rgba(0,180,216,.18); }
