@font-face { font-family: Barlow; src: url('/fonts/barlow-regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Barlow; src: url('/fonts/barlow-semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/barlow-condensed-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  color-scheme: light;
  --paper: #e6dfd1;
  --surface: #f3ede2;
  --ink: #3b3027;
  --muted: #766657;
  --rule: #c8bcaa;
  --clay: #a14f34;
  --olive: #526044;
  --heading: 'Barlow Condensed', 'Avenir Next Condensed', sans-serif;
  font-family: Barlow, 'Avenir Next', sans-serif;
  font-size: 1.25vw;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; }
h1, h2, p, ol, ul, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
.scoreboard { height: 100vh; height: 100dvh; padding: 2.8vh 2.6vw 1.7vh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 2.2vh; overflow: hidden; }
.masthead { display: flex; align-items: center; padding-bottom: 2.1vh; border-bottom: 2px solid var(--ink); gap: 3vw; }
.identity { display: flex; gap: 1.3vw; align-items: center; flex: 1; }
.event-mark { width: 4.4vw; height: 5vw; color: var(--clay); flex: none; }
.eyebrow { font-size: .57rem; font-weight: 600; text-transform: uppercase; letter-spacing: .15em; line-height: 1.5; color: var(--muted); }
.edition { color: var(--clay); margin-bottom: .1vh; }
h1 { font-family: var(--heading); font-size: 3.1rem; line-height: .98; letter-spacing: -.025em; font-weight: 700; white-space: nowrap; }
.title-dot { color: var(--clay); }
.event-totals { display: flex; gap: 2vw; align-self: stretch; align-items: center; padding-right: 2.8vw; border-right: 1px solid var(--rule); }
.event-totals > div { display: flex; flex-direction: column-reverse; align-items: center; min-width: 2.8vw; }
.event-totals dt { color: var(--muted); font-size: .61rem; text-transform: uppercase; letter-spacing: .06em; }
.event-totals dd { font-family: var(--heading); font-size: 2.2rem; line-height: 1.12; font-variant-numeric: tabular-nums; }
.event-totals > div:nth-child(2) dd { color: var(--olive); }
.clock-block { text-align: right; display: flex; flex-direction: column; gap: .25vh; }
.clock { font-family: var(--heading); font-size: 2rem; line-height: 1.05; font-variant-numeric: tabular-nums; }
.clock-block .eyebrow { font-size: .55rem; letter-spacing: .07em; }
.competition { display: grid; grid-template-columns: 1.07fr 1fr; gap: 2.5vw; min-height: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: .8vw; padding-bottom: 1.4vh; flex-shrink: 0; }
h2 { font-family: var(--heading); font-size: 1.8rem; line-height: 1.08; font-weight: 700; letter-spacing: -.01em; }
.section-heading .eyebrow { margin-bottom: .25vh; }
.section-note { font-size: .53rem; font-weight: 600; color: var(--muted); letter-spacing: .08em; padding-bottom: .35vh; white-space: nowrap; }
.ranking-panel { display: flex; min-height: 0; flex-direction: column; }
.ranking-columns, .ranking-row { display: grid; grid-template-columns: 2.6vw minmax(0, 1fr) 4.5vw 4.3vw; gap: .65vw; align-items: center; padding-left: 1.15vw; padding-right: 1.15vw; }
.ranking-columns { font-size: .51rem; font-weight: 600; letter-spacing: .08em; color: var(--muted); padding-top: .7vh; padding-bottom: .9vh; border-top: 1px solid var(--rule); }
.ranking-columns > :nth-child(n+3) { text-align: right; }
.ranking-list { flex: 1; display: flex; flex-direction: column; min-height: 0; background: var(--surface); }
.ranking-row { flex: 1; min-height: 0; border-bottom: 1px solid #d8cdbc; }
.place { font-family: var(--heading); font-size: 1.5rem; color: var(--muted); line-height: 1; font-variant-numeric: tabular-nums; }
.team { min-width: 0; }
.team-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 1.03rem; }
.team .leader-label { display: block; text-transform: uppercase; letter-spacing: .18em; font-size: .47rem; color: #d7bd94; margin-bottom: .5vh; }
.score { font-family: var(--heading); font-size: 1.65rem; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.climb-count { text-align: right; font-size: .9rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.ranking-row:first-child { flex: 1.55; background: var(--ink); color: var(--surface); border: none; position: relative; }
.ranking-row:first-child::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: .25vw; background: #c88d55; }
.ranking-row:first-child .place { color: #dbb989; font-size: 2.15rem; }
.ranking-row:first-child .team-name { font-size: 1.25rem; }
.ranking-row:first-child .score { font-size: 2.35rem; color: #ebd6b7; }
.ranking-row:first-child .climb-count { color: #dccfba; }
.score.compact-score, .ranking-row:first-child .score.compact-score { font-size: 1.3rem; }
.ranking-row:nth-child(2), .ranking-row:nth-child(3) { background: #e9dfcd; }
.ranking-footnote { display: flex; justify-content: space-between; color: var(--muted); font-size: .56rem; padding-top: 1.2vh; }
.side-panels { display: grid; grid-template-rows: 1.17fr 1fr; gap: 2.2vh; min-height: 0; }
.activity-panel, .pinnacles-panel { display: flex; flex-direction: column; min-height: 0; }
.activity-list { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.activity-row { flex: 1; min-height: 0; display: flex; align-items: center; gap: 1vw; border-bottom: 1px solid var(--rule); }
.activity-time { font-variant-numeric: tabular-nums; font-size: .66rem; color: var(--muted); flex: 0 0 3.2vw; display: flex; flex-direction: column; gap: .2vh; }
.activity-time small { font-size: .47rem; }
.activity-content { flex: 1; min-width: 0; }
.activity-team { font-weight: 600; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.activity-route { color: var(--muted); font-size: .65rem; margin-top: .25vh; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-points { font-family: var(--heading); color: var(--clay); font-size: 1.35rem; text-align: right; font-variant-numeric: tabular-nums; min-width: 2.8vw; }
.activity-points small { display: block; font-family: Barlow, sans-serif; font-size: .43rem; font-weight: 600; line-height: 1.1; text-transform: uppercase; letter-spacing: .08em; }
.activity-row:first-child .activity-time { color: var(--clay); }
.activity-row:first-child .activity-points { background: var(--clay); color: var(--surface); padding: .45vh .4vw; }
.small-dot { width: .35rem; height: .35rem; display: inline-block; background: var(--clay); border-radius: 50%; margin-right: .18rem; vertical-align: .02rem; }
.pinnacles-panel { background: #ddd4c2; padding: 1.6vh 1.2vw; }
.pinnacles-panel h2 { font-size: 1.55rem; }
.pinnacles-panel .section-heading { padding-bottom: 1vh; }
.pinnacle-list { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: .5vh; }
.pinnacle-row { display: grid; grid-template-columns: 10vw minmax(0, 1fr) 1.5vw; gap: .8vw; flex: 1; min-height: 0; align-items: center; }
.pinnacle-name { font-size: .77rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { height: .55rem; background: #c8bda9; }
.bar-fill { height: 100%; background: #a87959; min-width: 2px; }
.pinnacle-row:first-child .bar-fill { background: var(--clay); }
.pinnacle-total { font-family: var(--heading); font-size: 1.1rem; text-align: right; }
.pinnacle-unit { display: block; text-align: right; color: var(--muted); font-size: .48rem; margin-top: .65vh; }
.active-strip { display: flex; align-items: center; gap: 1.7vw; padding: 1.6vh 1.2vw; border: 1px solid #bdbea9; background: #daddcb; min-height: 8vh; }
.active-heading { display: flex; gap: .65vw; align-items: center; flex-shrink: 0; padding-right: 1.5vw; border-right: 1px solid #b3b69e; }
.active-heading h2 { font-size: 1.35rem; color: #394532; }
.active-heading span:not(.route-symbol) { font-size: .51rem; color: #526044; white-space: nowrap; }
.route-symbol { font-size: 1.7rem; line-height: 1; color: var(--olive); }
.active-teams { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8vh 1.8vw; flex: 1; min-width: 0; }
.active-teams li { position: relative; padding-left: .75vw; font-size: .8rem; color: #394532; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.active-teams li::before { content: ''; width: .22rem; height: .22rem; position: absolute; left: 0; top: .4em; border-radius: 50%; background: #687857; }
.active-teams .active-empty { grid-column: 1 / -1; }
.active-overflow { font-size: .64rem; font-weight: 600; color: var(--olive); white-space: nowrap; }
.active-overflow:empty { display: none; }
.broadcast-footer { display: flex; align-items: center; gap: 1.15vw; font-size: .55rem; color: var(--muted); min-height: 2.5vh; }
.connection { display: flex; align-items: center; gap: .4vw; color: var(--olive); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.status-dot { width: .3rem; height: .3rem; border-radius: 50%; background: currentColor; }
.connection[data-state='error'] { color: #963d26; }
.connection[data-state='loading'] { color: var(--muted); }
#updated-at { padding-left: 1.15vw; border-left: 1px solid var(--rule); }
.refresh-note { margin-left: auto; }
.fullscreen { display: flex; align-items: center; gap: .35vw; background: transparent; color: var(--muted); border: 0; padding: .15rem .25rem; cursor: pointer; font-size: .55rem; }
.fullscreen svg { width: .8rem; height: .8rem; }
.fullscreen:hover { color: var(--ink); background: #d8cebd; }
.fullscreen:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }
.empty-state { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1vw; text-align: center; color: var(--muted); font-size: .85rem; }
@media (max-aspect-ratio: 3/2) { .scoreboard { max-height: 75vw; } }
@media (min-aspect-ratio: 2/1) { :root { font-size: 2.5vh; } .scoreboard { max-width: 200vh; margin-inline: auto; } }
