:root {
  --navy: #10233a;
  --deep: #0b1829;
  --blue: #0d4774;
  --ice: #86dbff;
  --paper: #f4f8fc;
  --muted: #52667b;
  --line: #d1deea;
  --red: #b81835;
  --good: #99f5b8;
  --bad: #ffb3b8;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: #edf3f8;
  color: var(--navy);
  font: 16px/1.45 system-ui, sans-serif;
}
button,input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .53; }
:focus-visible { outline: 3px solid #2789c8; outline-offset: 3px; }
[hidden] { display: none !important; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.mono, .kicker, .eyebrow, .hud, .badge, .split-head {
  font: 800 11px/1.3 ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.masthead { background: var(--deep); color: white; border-bottom: 3px solid var(--red); }
.masthead .shell { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 41px; height: 41px; object-fit: contain; }
.brand b { display: block; font-size: 13px; }
.brand span { display: block; color: #aed0e7; font-size: 11px; }
.series { display: flex; align-items: center; gap: 8px; color: #d4e5f3; white-space: nowrap; }
.series::before { content: ''; width: 16px; height: 16px; background: conic-gradient(white 25%,#e74555 0 50%,white 0 75%,#e74555 0) 0 0 / 8px 8px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 25px 0 21px; }
.kicker { color: var(--blue); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.flag { position: relative; display: inline-block; flex: none; width: 21px; height: 14px; background: white; border: 1px solid #b6c9dc; border-radius: 2px; overflow: hidden; }
.flag::before,.flag::after { content: ''; position: absolute; background: #175482; }
.flag::before { width: 3px; height: 100%; left: 5px; }
.flag::after { height: 3px; width: 100%; top: 4px; }
h1 { font-size: clamp(42px,7.3vw,84px); line-height: .92; font-weight: 950; letter-spacing: -.075em; margin: 0; text-transform: uppercase; }
h1 em { color: var(--red); font-style: normal; }
.hero .lede { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.game { display: grid; grid-template-columns: minmax(0,2.2fr) minmax(298px,1fr); gap: 14px; align-items: stretch; }
.track,.panel { min-width: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px #10233a12; }
.track { background: var(--deep); color: white; border: 1px solid #1f3b57; }
.rival-choice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border-bottom: 1px solid #33516b; background: #132e46; }
.rival-choice .mono { color: #b6d4eb; font-size: 10px; }
.rival-buttons { display: flex; gap: 6px; margin-top: 5px; }
.rival-buttons button { min-height: 44px; padding: 7px 14px; border: 1px solid #6e8eaa; border-radius: 5px; background: #203e57; color: white; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; }
.rival-buttons button[aria-pressed="true"] { background: #d5f3ff; border-color: #a9e8ff; color: #123750; }
.rival-buttons button:disabled { cursor: default; opacity: .5; }
.rival-choice p { max-width: 265px; margin: 0; color: #c3d9e8; font-size: 11px; line-height: 1.45; }
.race-screen p.ghost-message { margin: 7px 0 11px; font-size: 11px; color: #bdefff; }
.hud { display: flex; align-items: center; justify-content: space-between; min-height: 39px; gap: 8px; padding: 0 13px; }
.hud span:first-child { color: #b6d4eb; }
.hud strong { color: white; display: flex; align-items: center; gap: 7px; text-align: right; }
.hud strong::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #ff896b; }
.track-window { position: relative; overflow: hidden; }
canvas { width: 100%; display: block; background: #eaf6ff; touch-action: none; cursor: crosshair; }
canvas:focus-visible { outline-offset: -4px; }
.live-gap { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; pointer-events: none; padding: 8px 13px; border: 1px solid #8ed9fa; background: #0b1829f5; color: white; border-radius: 7px; box-shadow: 0 4px 14px #10233a44; }
.live-gap strong { font-size: clamp(27px,4vw,36px); font-weight: 950; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; white-space: nowrap; }
.live-gap .mono { font-size: 9px; letter-spacing: .04em; }
.live-gap small { display: block; font-size: 12px; font-weight: 800; }
.live-gap.negative { border-color: #62e9a4; background: #095433f5; color: white; }
.live-gap.positive { border-color: #ff9d9f; background: #9e1732f5; color: white; }
.live-gap.level { border-color: #a6c9e0; background: #163850f5; }
.split-banner { position: absolute; left: 12px; right: 12px; bottom: 91px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 13px; border: 2px solid #a6c9e0; border-radius: 8px; background: #163850f7; color: white; pointer-events: none; box-shadow: 0 4px 18px #10233a55; }
.split-banner > div:last-child { text-align: right; }
.split-banner strong { font-size: clamp(30px,4.5vw,42px); font-weight: 950; line-height: 1; letter-spacing: -.04em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.split-banner small { display: block; margin-top: 4px; font-size: 11px; }
.split-banner.negative { color: white; background: #095433f7; border-color: #62e9a4; }
.split-banner.positive { color: white; background: #9e1732f7; border-color: #ff9d9f; }
.split-recap { display: flex; gap: 6px; padding: 3px 9px 9px; }
.split-chip { flex: 1; min-width: 0; padding: 5px 8px; background: #163850; border-radius: 4px; color: white; }
.split-chip small { display: block; font-size: 9px; }
.split-chip strong { display: block; font-size: 17px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.split-chip.negative { color: white; background: #095433; }
.split-chip.positive { color: white; background: #9e1732; }
.track-foot { display: flex; justify-content: space-between; gap: 4px 8px; flex-wrap: wrap; padding: 9px 13px; color: #bad2e6; font-size: 11px; }
.legend { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.swatch { width: 14px; border-top: 3px solid #ff7784; border-radius: 3px; }
.swatch.rival { border-color: #6fd2ff; border-top-style: dashed; }
.panel { display: flex; flex-direction: column; background: white; border: 1px solid var(--line); }
.bib-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 13px; background: #e4edf6; border-bottom: 1px solid var(--line); }
.bib-id { min-width: 0; display: flex; align-items: center; gap: 8px; }
.bib-id span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bib-number { background: var(--red); color: white; padding: 3px 6px; border-radius: 3px; font-variant-numeric: tabular-nums; }
.edit-bib { background: transparent; border: 0; color: #174b74; font-size: 12px; font-weight: 800; padding: 5px 0 5px 8px; white-space: nowrap; }
.bib-form { padding: 9px 13px 0; }
.bib-form label { display: block; font-size: 12px; font-weight: 800; }
.bib-form small { color: var(--muted); display: block; margin-top: 4px; }
.bib-form .actions { margin-top: 5px; flex-wrap: nowrap; }
.bib-form input,.share input { min-width: 0; width: 100%; background: #f3f7fb; border: 1px solid #adc2d5; border-radius: 5px; color: var(--navy); padding: 7px; }
.panel-main { display: flex; flex-direction: column; gap: 11px; padding: 15px 13px 12px; flex: 1; }
.panel h2 { margin: 3px 0 5px; line-height: 1.04; font-size: 25px; letter-spacing: -.048em; }
.panel p { margin: 0; font-size: 13px; color: var(--muted); }
.eyebrow { color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 7px; }
.button { min-height: 42px; border: 1px solid #a9bdcf; border-radius: 6px; padding: 7px 10px; background: #f1f6fb; color: var(--navy); font-size: 13px; font-weight: 800; }
.button:hover:enabled { filter: brightness(.93); }
.primary { background: var(--red); border-color: var(--red); color: white; flex: 1; }
.secondary { background: white; }
.badge { display: inline-block; color: #154d72; background: #e9f3fb; border-radius: 4px; padding: 4px 6px; margin-top: 7px; }
.timing { margin-top: auto; background: var(--deep); color: white; border-radius: 7px; padding: 9px 10px; }
.clock { display: flex; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 5px; }
.split-head,.splits th { color: #c6d7e8; }
.clock strong { color: white; white-space: nowrap; font-size: 28px; font-weight: 900; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.splits { table-layout: fixed; width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.splits th,.splits td { text-align: right; padding: 4px 0; border-top: 1px solid #2e455c; }
.splits th:first-child,.splits td:first-child { text-align: left; }
.splits th { font-size: 10px; }
.splits tr:last-child td { font-weight: 800; border-top-color: #7890a9; }
.splits td.positive,.splits td.negative { font-weight: 900; border-radius: 3px; padding-inline: 4px; }
.splits td.positive { color: white; background: #9e1732; }
.splits td.negative { color: white; background: #095433; }
.positive { color: var(--bad); }
.negative { color: var(--good); }
details { color: var(--muted); font-size: 12px; }
summary { cursor: pointer; width: max-content; }
details p { margin-top: 5px !important; }
.key-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.key-row button { min-width: 40px; min-height: 38px; }
.share { font-size: 12px; }
footer { padding: 13px 0 23px; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .masthead .shell { min-height: 48px; }
  .brand img { width: 35px; height: 35px; }
  .hero { padding: 16px 0 13px; }
  .hero .lede { margin-top: 7px; font-size: 13px; }
  .game { grid-template-columns: 1fr; gap: 8px; }
  .track-window canvas { width: 126%; margin-left: -13%; }
  .hud { min-height: 31px; padding: 0 8px; font-size: 10px; }
  .track-foot { padding: 6px 8px; font-size: 10px; }
  .panel-main { display: contents; }
  .race-actions { order: -1; padding: 9px 12px; }
  .panel-main > :not(.race-actions) { margin: 10px 12px 0; }
  .panel-main > details { margin-bottom: 12px; }
  .panel h2 { font-size: 22px; }
}
@media (max-width: 365px) {
  h1 { font-size: 38px; }
  .series { font-size: 9px; gap: 5px; }
  .brand b { font-size: 11px; }
}

.venue-photo {
  align-self: stretch;
  position: relative;
  flex: 0 0 clamp(170px,25vw,300px);
  min-height: 103px;
  margin: 0;
  overflow: hidden;
  border-radius: 7px;
  background: #c4d7e2;
}
.venue-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 55%; }
.venue-photo figcaption {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  padding: 12px 10px 6px;
  color: white;
  background: linear-gradient(transparent,#081525e6);
}
.venue-photo b { font-size: 13px; }
.venue-photo span { font-size: 10px; }
.photo-section {
  display: grid;
  grid-template-columns: minmax(155px,.82fr) minmax(0,2.2fr);
  gap: 18px;
  padding-top: 17px;
  margin-top: 24px;
  border-top: 1px solid #bdcede;
}
.photo-heading h2 { margin: 4px 0 6px; font-size: clamp(25px,3.4vw,43px); line-height: .95; letter-spacing: -.06em; }
.photo-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.photo-heading .eyebrow { display: flex; align-items: center; gap: 7px; color: var(--red); font-size: 11px; }
.cro-check { width: 16px; height: 12px; background: conic-gradient(white 25%,#d0203e 0 50%,white 0 75%,#d0203e 0) 0 0 / 8px 8px; }
.photo-grid { min-width: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ski-photo { margin: 0; min-width: 0; overflow: hidden; border: 1px solid #c7d6e3; border-radius: 8px; background: #fff; }
.ski-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16/10; object-fit: cover; }
.ski-photo:first-child img { object-position: center 62%; }
.ski-photo figcaption { display: grid; gap: 2px; padding: 7px 9px; }
.ski-photo strong { line-height: 1.15; }
.ski-photo .mono { color: var(--muted); font-size: 10px; }
.credits ul { padding-left: 18px; }
.credits a { color: #155077; }
footer > p { margin: 0 0 5px; }
@media (max-width: 760px) {
  .hero { align-items: center; gap: 10px; }
  .venue-photo { flex-basis: clamp(87px,26vw,164px); min-height: 84px; }
  .venue-photo figcaption { padding: 8px 5px 4px; }
  .venue-photo b { font-size: 10px; }
  .venue-photo span { display: none; }
  .photo-section { grid-template-columns: minmax(0,1fr); gap: 10px; margin-top: 18px; }
  .ski-photo img { aspect-ratio: 5/4; }
}
@media (max-width: 440px) {
  .hero h1 { font-size: clamp(30px,9vw,42px); }
}

.lineup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.lineup-title { display: flex; align-items: center; gap: 7px; }
.lineup-title h2 { margin: 0; font-size: 13px; line-height: 1.2; }
.lineup-options { display: flex; gap: 6px; min-width: 0; }
.avatar-option {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  padding: 2px 11px 2px 4px;
  border: 1px solid #acbfd1;
  border-radius: 7px;
  color: var(--navy);
  background: white;
  text-align: left;
}
.avatar-option img { flex: none; width: 42px; height: 42px; }
.avatar-option strong { display: block; font-size: 12px; line-height: 1.15; }
.avatar-option small { color: var(--muted); font: 800 9px ui-monospace,monospace; letter-spacing: .1em; }
.avatar-option:hover:enabled { background: #edf6fc; }
.avatar-option[aria-pressed="true"] { background: #fff3f5; border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.avatar-option[aria-pressed="true"] small { color: #9c1733; }
.course-profile {
  display: grid;
  grid-template-columns: minmax(170px,.8fr) minmax(0,1.6fr);
  gap: 14px 20px;
  padding: 14px 16px;
  margin-top: 17px;
  background: #f9fcff;
  border: 1px solid #c7d6e3;
  border-radius: 8px;
}
.profile-heading h2 { margin: 3px 0 5px; font-size: clamp(24px,3.2vw,37px); letter-spacing: -.06em; line-height: 1; }
.profile-heading p { margin: 0; font-size: 13px; color: var(--muted); }
.profile-heading .eyebrow { color: var(--red); font-size: 11px; }
.profile-heading .profile-source { margin-top: 7px; font-size: 11px; }
.profile-source a { color: #155077; }
.profile-chart { min-width: 0; }
.profile-chart svg { display: block; width: 100%; height: auto; max-height: 107px; }
.profile-elevations,.profile-sectors { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #405b71; font-size: 10px; }
.profile-elevations strong { color: var(--navy); text-align: center; }
.profile-sectors span:nth-child(2) { color: var(--red); }
.profile-legend { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.profile-legend i { width: 16px; border-top: 3px solid var(--red); border-radius: 3px; }
@media(max-width: 760px) {
  .lineup { gap: 7px; margin-bottom: 7px; }
  .lineup-title { flex: 0 0 53px; }
  .lineup-title .cro-check { display: none; }
  .lineup-title h2 { font-size: 11px; }
  .lineup-options { flex: 1; }
  .avatar-option { flex: 1; padding-right: 4px; gap: 3px; min-height: 44px; }
  .avatar-option img { width: 36px; height: 36px; }
  .avatar-option strong { font-size: 11px; }
  .course-profile { grid-template-columns: minmax(0,1fr); gap: 8px; padding: 12px; }
  .profile-elevations,.profile-sectors { font-size: 9px; }
}
.track-foot a { color: inherit; text-underline-offset: 2px; }

/* Full-run racing view. */
.game { grid-template-columns: minmax(0,2.15fr) minmax(295px,1fr); }
.track-window { isolation: isolate; }
canvas { cursor: grab; }
canvas:active { cursor: grabbing; }
.pause-button { border: 1px solid #36516a; color: #e4f2fc; background: #172c43; border-radius: 5px; padding: 4px 8px; font-size: 11px; font-weight: 800; min-height: 29px; }
.race-hud { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; gap: 6px; padding: 10px 14px 19px; background: linear-gradient(#0b1b32e6,#10233a00); pointer-events: none; }
.race-hud div { display: flex; flex-direction: column; text-align: center; }
.race-hud div:first-child { text-align: left; }
.race-hud div:last-child { text-align: right; }
.race-hud span { color: #c7e4f4; font: 800 9px ui-monospace,monospace; text-transform: uppercase; letter-spacing: .08em; }
.race-hud strong { color: white; font-size: 25px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.race-screen { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(350px, calc(100% - 35px)); padding: 17px 19px 19px; display: flex; flex-direction: column; align-items: center; border: 1px solid #e8f4ffbb; border-radius: 15px; background: #101e33ed; box-shadow: 0 15px 50px #0b223b50; color: white; text-align: center; backdrop-filter: blur(8px); }
.race-screen > img { width: 112px; height: 112px; margin-top: -4px; }
.race-screen h2 { font-size: 31px; line-height: 1; letter-spacing: -.05em; margin: 7px 0 9px; }
.race-screen .eyebrow { color: #b9d9ed; font-size: 10px; }
.race-screen p { margin: 0 0 15px; color: #d4e4f0; font-size: 13px; }
.race-screen .primary { flex: none; width: 100%; min-height: 45px; background: #df3152; border-color: #ed6b83; font-size: 15px; }
.race-screen .share-button { width: 100%; margin-top: 7px; color: white; background: #283e56; border-color: #698096; }
.race-screen.gold { border-color: #edc66d; }
.race-screen.silver { border-color: #d0e0ee; }
.race-screen.bronze { border-color: #d2a17a; }
.result-screen.gold .eyebrow { color: #ffda78; }
.result-screen.gold h2 { color: #ffe5a1; }
.race-screen.result-screen { max-height: calc(100% - 16px); overflow-y: auto; }
.race-screen.result-screen > img { width: 72px; height: 72px; }
.result-summary { border-top: 1px solid #718297; padding-top: 9px; margin-bottom: 12px; width: 100%; font-size: 13px; color: #e9f3fb; }
.challenge-line { font-size: 12px !important; color: #ffda9f !important; }
.race-toast { position: absolute; top: 85px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 24px); padding: 7px 12px; font-size: 13px; font-weight: 900; background: #10233ae8; color: white; border-radius: 5px; box-shadow: 0 3px 10px #10233a33; pointer-events: none; }
.race-toast.clean { color: #b0f4cb; }
.race-toast.miss { background: #8e1c37ed; color: white; }
.countdown { position: absolute; left: 50%; top: 45%; transform: translate(-50%,-50%); padding: 5px 18px; border-radius: 12px; background: #0d223bd9; color: white; text-align: center; font-size: clamp(44px,7vw,78px); line-height: 1.2; font-weight: 950; pointer-events: none; letter-spacing: -.06em; }
.driving-controls { display: flex; align-items: center; justify-content: space-between; padding: 7px 9px; gap: 5px; background: #0b1829; }
.driving-controls span { font-size: 11px; color: #c5d8e8; text-align: center; }
.steer-button { min-width: 64px; min-height: 39px; border: 1px solid #36536d; border-radius: 6px; color: white; background: #1c344c; font-size: 22px; font-weight: 800; touch-action: none; user-select: none; }
/* Holding a game control must steer, including over its label in iOS Safari. */
.steer-button, .steer-button *, #slope {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.steer-button:active:enabled { background: #b81835; }
.steer-button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 88px; min-height: 62px; border-color: #6f97b7; box-shadow: inset 0 1px #ffffff20; }
.steer-button strong { font-size: 32px; line-height: 1; }
.steer-button small { font-size: 10px; line-height: 1.3; letter-spacing: .03em; }
.control-hint { margin: 0; padding: 0 10px 3px; background: #0b1829; color: #c2d9ea; text-align: center; font-size: 10px; line-height: 1.4; }
.track-foot { padding-top: 3px; }
.live-gap { bottom: 12px; font-variant-numeric: tabular-nums; }
.race-progress { position: absolute; top: 75px; right: 9px; bottom: 48px; width: 4px; background: #466a8866; border-radius: 5px; overflow: hidden; pointer-events: none; }
.race-progress i { display: block; height: 0; width: 100%; background: #d6244c; }
.race-brief h2 { font-size: 29px; }
.medal-targets { display: flex; gap: 21px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.medal-targets span { color: var(--muted); font-size: 11px; }
.medal-targets b { display: block; color: var(--navy); font-size: 24px; letter-spacing: -.06em; line-height: 1.1; }
.panel-main .timing { margin-top: 7px; }
.run-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; font-size: 10px; color: var(--muted); }
.run-stats div { display: flex; flex-direction: column; padding: 5px 0; }
.run-stats strong { font-size: 17px; color: var(--navy); font-variant-numeric: tabular-nums; }
@media(max-width:760px) {
  .game { grid-template-columns: minmax(0,1fr); }
  .track-window canvas { width: 150%; margin-left: -25%; }
  .race-screen { width: min(300px,calc(100% - 24px)); padding: 13px 15px 15px; }
  .race-screen > img { width: 98px; height: 98px; }
  .race-screen h2 { font-size: 28px; }
  .race-screen p { margin-bottom: 11px; }
  .race-screen .primary { min-height: 43px; }
  .panel-main { display: flex; padding: 12px; }
  .panel-main > :not(.race-actions) { margin: 0; }
  .race-brief { display: none; }
  .panel-main .timing { margin-top: 0; }
  .panel-main > details { margin-bottom: 0; }
  .race-hud { padding: 9px 10px 18px; }
  .race-hud strong { font-size: 22px; }
  body.racing .masthead, body.racing .hero, body.racing .lineup,
  body.racing .rival-choice,
  body.racing .panel, body.racing .course-profile, body.racing .photo-section, body.racing .test-panel,
  body.racing footer { display: none; }
  body.racing main { width: 100%; }
  body.racing .track { border-radius: 0; }
  body.racing .hud { min-height: 38px; }
  body.racing .track-window canvas { width: 150%; }
}
@media(max-width:760px) { .rival-choice { gap: 12px; } .rival-choice p { max-width: 170px; font-size: 10px; } .rival-buttons button { padding-inline: 11px; white-space: nowrap; } }
@media(prefers-reduced-motion:reduce) {
  .race-screen { backdrop-filter: none; }
}
.stance { flex: 1; max-width: 250px; min-width: 0; padding: 3px 4px; text-align: center; color: #e5f5ff; pointer-events: none; }
.stance strong { display: block; font-size: 13px; letter-spacing: .02em; }
.stance small { display: block; font-size: 10px; line-height: 1.2; margin-top: 2px; color: #bcd3e4; }
.stance.gliding strong { color: #93f0c1; }
.stance.on-wave strong { color: #ffdb8a; }
.glide-meter { height: 3px; max-width: 105px; margin: 5px auto 0; border-radius: 3px; overflow: hidden; background: #355067; }
.glide-meter i { display: block; height: 100%; width: 0; background: #93f0c1; }
.speed-meter { display: flex; align-items: center; gap: 5px; }
.speed-meter meter { width: 63px; height: 10px; accent-color: #91deff; }
@media(max-width:760px) {
  .driving-controls { gap: 10px; }
  .steer-button { min-width: 86px; min-height: 62px; }
}
.series #test-badge { padding: 3px 5px; border: 1px solid #e7758d; color: #ffcbd6; border-radius: 3px; font-size: 9px; }
.test-panel { margin-top: 18px; padding: 20px; border: 1px solid #b9ccdc; border-radius: 9px; background: #fff; }
.test-panel h2 { margin: 4px 0 7px; font-size: 26px; line-height: 1.1; letter-spacing: -.04em; }
.test-panel p { margin: 6px 0; font-size: 13px; color: #405b71; }
.test-panel details { margin: 10px 0; }
.test-panel form { margin-top: 14px; }
.test-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.test-panel label { display: block; font-size: 12px; font-weight: 800; }
.test-panel select,.test-panel textarea { display: block; width: 100%; margin-top: 4px; border: 1px solid #9eb6c9; border-radius: 5px; background: #f7fbff; color: #10233a; padding: 9px; font: inherit; font-size: 13px; }
.test-panel textarea { resize: vertical; }
.test-panel .test-privacy { font-size: 11px; }
.test-panel button { margin-top: 8px; }
@media(max-width:760px) { .test-panel { padding: 14px; } .test-fields { grid-template-columns: minmax(0,1fr); } .series { gap: 5px; font-size: 8px; } .control-hint { font-size: 9px; } }

.lineup { display: block; }
.lineup-title { margin-bottom: 6px; }
.lineup-options { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); }
.avatar-option { min-height: 67px; }
.portrait-crop { position: relative; display: block; flex: none; width: 48px; height: 60px; overflow: hidden; border-radius: 5px; }
.avatar-option .skier-portrait { position: absolute; width: 260%; height: auto; max-width: none; top: 0; left: 50%; transform: translateX(calc(-1 * var(--face-x,50%))); }
.avatar-option > span { min-width: 0; }
@media(max-width:960px) {
  .lineup-options { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media(max-width:760px) {
  .lineup-title .cro-check { display: block; }
  .lineup-title h2 { font-size: 12px; }
  .avatar-option { padding-left: 2px; gap: 3px; min-height: 59px; }
  .portrait-crop { width: 40px; height: 50px; }
  .avatar-option strong { font-size: 10px; }
  .stance small { font-size: 9px; }
}

.leaderboard { margin-top: 18px; padding: 22px; background: #fff; border: 1px solid #b9ccdc; border-radius: 12px; scroll-margin-top: 12px; }
.board-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.board-heading .eyebrow { margin: 0 0 5px; color: #41627b; }
.board-heading h2 { margin: 0; font-size: clamp(28px,4vw,39px); line-height: 1; letter-spacing: -.05em; }
.board-refresh { flex: none; border: 1px solid #9bb3c8; background: #eef6fc; color: #193c59; border-radius: 5px; padding: 9px 12px; min-height: 44px; font-size: 12px; font-weight: 800; }
.board-intro { font-size: 13px; color: #405b71; margin: 12px 0 16px; }
.board-filters { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.board-period { display: flex; gap: 6px; }
.board-period button { min-height: 44px; border: 1px solid #a8bece; border-radius: 5px; background: #f1f7fb; color: #173b58; padding: 9px 14px; font-size: 13px; font-weight: 800; }
.board-period button[aria-pressed="true"] { background: #153b58; color: #fff; border-color: #153b58; }
.board-clean { display: flex; align-items: center; gap: 7px; min-height: 44px; font-size: 12px; font-weight: 800; }
.board-clean input { width: 22px; height: 22px; accent-color: #163e5a; }
.board-status { font-size: 11px; color: #466078; margin: 12px 0 8px; }
.my-place { margin: 0 0 12px; padding: 11px 13px; background: #edf5fc; border-left: 3px solid #82b8d6; font-size: 13px; font-weight: 700; }
.my-place.has-result { color: #13563d; background: #e7f6ef; border-color: #25865e; }
.board-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.board-table th { text-align: left; padding: 8px; color: #4b6277; font-size: 10px; text-transform: uppercase; border-bottom: 2px solid #afc5d6; }
.board-table td { padding: 10px 8px; border-bottom: 1px solid #e0eaf2; }
.board-table th:nth-last-child(-n+2), .board-table td:nth-last-child(-n+2) { text-align: right; white-space: nowrap; }
.board-table td:nth-last-child(2) { font-weight: 900; }
.board-table td strong { display: block; overflow-wrap: anywhere; }
.board-table td small { display: block; color: #526a80; font-size: 10px; }
.board-table .my-result { background: #e7f6ef; }
.board-empty { text-align: center; padding: 25px 10px; color: #526a80; font-size: 13px; }
.board-privacy { font-size: 10px; color: #526a80; line-height: 1.5; margin: 12px 0 0; }
.publish-form { border: 1px solid #a6c8dc; background: #edf6fc; padding: 16px; margin: 16px 0; border-radius: 7px; }
.publish-form h3 { font-size: 20px; margin: 0 0 5px; }
.publish-form p { font-size: 12px; }
.publish-form label { display: block; font-size: 12px; font-weight: 800; margin-bottom: 5px; }
.publish-actions { display: flex; gap: 8px; align-items: stretch; }
.publish-actions input { min-width: 0; flex: 1; width: 100%; padding: 10px; border: 1px solid #9bb5ca; border-radius: 5px; color: #10233a; background: white; }
.publish-actions .primary { background: #bd2446; color: white; border: 1px solid #ad1f3e; }
#publish-status { font-weight: 700; }
@media(max-width:760px) {
  .leaderboard { padding: 14px; }
  .board-heading { align-items: flex-start; }
  .board-refresh { max-width: 100px; padding: 7px; font-size: 10px; }
  .board-filters { gap: 7px; }
  .board-table { font-size: 12px; }
  .board-table td, .board-table th { padding-inline: 4px; }
  .publish-actions { flex-direction: column; }
  body.racing .leaderboard { display: none; }
}
