/* Winter Games – broadcast-style overlay UI.
   All UI classes are prefixed "wg-". Layout: a fixed full-screen #ui overlay above the 3D
   canvas that ignores pointer events except on interactive panels. */

@import url('fonts.css');

:root {
  --wg-font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --wg-font-cond: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', var(--wg-font);
  --wg-text: #f4f7fb;
  --wg-muted: #a8b6c8;
  --wg-dim: #6f7f95;
  --wg-ice: #5cc8ff;
  --wg-blue: #2f7cff;
  --wg-navy: #0b1424;
  --wg-green: #34d17f;
  --wg-green-deep: #13a35a;
  --wg-red: #ff4b5c;
  --wg-amber: #ffbe3b;
  --wg-gold: #f2c443;
  --wg-silver: #c9d3de;
  --wg-bronze: #d58b54;
  --wg-glass: linear-gradient(180deg, rgba(20, 31, 51, 0.74), rgba(9, 15, 27, 0.7));
  --wg-glass-strong: linear-gradient(180deg, rgba(18, 28, 46, 0.93), rgba(8, 13, 24, 0.92));
  --wg-line: rgba(255, 255, 255, 0.13);
  --wg-radius: 10px;
  --wg-sp: clamp(10px, 1.6vw, 20px);
  --wg-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 2px 6px rgba(0, 0, 0, 0.2);
  --wg-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a1220;
  color: var(--wg-text);
  font-family: var(--wg-font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

canvas#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
}

/* ------------------------------------------------------------------ loading (fallback look) */
#loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(120% 90% at 50% 0%, #1d3557 0%, #0a1220 70%);
  color: var(--wg-text);
  font-family: var(--wg-font-cond);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: opacity 0.6s ease;
}
#loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ root overlay */
#ui,
.wg-ui {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-family: var(--wg-font);
  color: var(--wg-text);
  user-select: none;
  -webkit-user-select: none;
}
.wg-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wg-hud { z-index: 1; }
.wg-touch { z-index: 2; }
.wg-fx { z-index: 3; }
.wg-modals { z-index: 4; }
.wg-menu-layer { z-index: 5; }
.wg-help-layer { z-index: 6; }
.wg-dialog-layer { z-index: 7; }
/* Menus own the screen: the in-game HUD never peeks through a screen's scrim. */
.wg-ui.menu-open .wg-hud { visibility: hidden; }

.wg-panel {
  background: var(--wg-glass);
  border: 1px solid var(--wg-line);
  border-radius: var(--wg-radius);
  box-shadow: var(--wg-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px) saturate(1.25);
  -webkit-backdrop-filter: blur(10px) saturate(1.25);
}
.wg-panel-strong { background: var(--wg-glass-strong); }

.wg-label {
  display: block;
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wg-muted);
}
.wg-unit {
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--wg-muted);
  margin-left: 4px;
}
.wg-kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom-width: 2px;
  background: rgba(255, 255, 255, 0.1);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 0.86em;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--wg-text);
}
.wg-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wg-tag-fall { background: var(--wg-red); color: #fff; }
.wg-tag-lead { background: var(--wg-gold); color: #1d1606; }

/* names & flags */
.wg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-name-first { font-weight: 500; opacity: 0.92; }
.wg-name-last { font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.wg-nation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.wg-flag {
  position: relative;
  display: inline-flex;
  flex: none;
  width: 21px;
  height: 14px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
}
.wg-flag-h { flex-direction: column; }
.wg-flag-v { flex-direction: row; }
.wg-flag-stripe { flex: 1; }
.wg-flag-bar { position: absolute; display: block; }
.wg-flag-nordic .wg-flag-bar-v { left: 28%; width: 22%; top: 0; bottom: 0; }
.wg-flag-nordic .wg-flag-bar-h { top: 39%; height: 22%; left: 0; right: 0; }
.wg-flag-swiss .wg-flag-bar-v { left: 43%; width: 14%; top: 20%; bottom: 20%; }
.wg-flag-swiss .wg-flag-bar-h { top: 40%; height: 20%; left: 26%; right: 26%; }
.wg-flag-inner { position: absolute; inset: 22%; display: block; }
.wg-flag-bar-v .wg-flag-inner { inset: 0 25%; }
.wg-flag-bar-h .wg-flag-inner { inset: 25% 0; }
.wg-flag-canton-box { position: absolute; left: 0; top: 0; width: 42%; height: 54%; display: block; }
.wg-flag-tri { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; display: block; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.wg-flag .wg-flag-taegeuk-dot { width: 7px; height: 7px; left: calc(50% - 3.5px); top: calc(50% - 3.5px); }
.wg-flag-tri-bars { position: absolute; width: 3px; height: 3px; display: block; background: #000; opacity: 0.85; }
.wg-flag-tri-bars.is-tl { left: 2px; top: 2px; }
.wg-flag-tri-bars.is-tr { right: 2px; top: 2px; }
.wg-flag-tri-bars.is-bl { left: 2px; bottom: 2px; }
.wg-flag-tri-bars.is-br { right: 2px; bottom: 2px; }
.wg-flag-emblem { position: absolute; left: 22%; top: 18%; width: 22%; height: 40%; display: block; border: 1px solid; border-radius: 0 0 45% 45%; box-sizing: border-box; }
.wg-flag-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  left: calc(50% - 4px);
  top: calc(50% - 4px);
  border-radius: 50%;
}

/* ------------------------------------------------------------------ HUD */
.wg-hud {
  opacity: 0;
  transition: opacity 0.35s ease;
}
.wg-hud.is-visible { opacity: 1; }
.wg-hud .is-empty { display: none !important; }

/* broadcast bug (top-left) */
.wg-bug {
  position: absolute;
  top: var(--wg-sp);
  left: var(--wg-sp);
  padding: 8px 12px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 3px solid var(--wg-ice);
}
.wg-bug-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--wg-font-cond);
  text-transform: uppercase;
  line-height: 1;
}
.wg-bug-mark {
  width: 14px;
  height: 14px;
  /* a stylised snow crystal: two rotated squares */
  background: conic-gradient(from 45deg, var(--wg-ice) 0 25%, #fff 0 50%, var(--wg-ice) 0 75%, #fff 0);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.wg-bug-title { font-weight: 800; font-size: 15px; letter-spacing: 0.12em; }
.wg-bug-sport { font-weight: 600; font-size: 13px; letter-spacing: 0.1em; color: var(--wg-ice); }
.wg-bug-info {
  display: flex;
  gap: 10px;
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wg-muted);
}
.wg-bug-gate { color: var(--wg-text); }

/* top-right column: wind + to beat */
.wg-topright {
  position: absolute;
  top: var(--wg-sp);
  right: var(--wg-sp);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.wg-wind {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px 8px 8px;
}
.wg-wind-dial {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0 55%, rgba(255, 255, 255, 0.02) 56%);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.wg-wind-dir {
  /* tick at the top: the jump direction */
  position: absolute;
  left: calc(50% - 4px);
  top: -1px;
  border: 4px solid transparent;
  border-top: 6px solid rgba(255, 255, 255, 0.85);
}
.wg-wind-arrow {
  position: absolute;
  left: calc(50% - 5px);
  top: 6px;
  width: 10px;
  height: 36px;
  transform-origin: 50% 50%;
  transition: transform 0.25s linear;
  color: var(--wg-muted);
}
.wg-wind-arrow-shaft {
  position: absolute;
  left: 3.5px;
  top: 8px;
  bottom: 2px;
  width: 3px;
  border-radius: 2px;
  background: currentColor;
}
.wg-wind-arrow-head {
  position: absolute;
  left: 0;
  top: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid currentColor;
}
.wg-wind.is-head .wg-wind-arrow,
.wg-wind.is-head .wg-wind-val,
.wg-wind.is-head .wg-wind-kind { color: var(--wg-green); }
.wg-wind.is-tail .wg-wind-arrow,
.wg-wind.is-tail .wg-wind-val,
.wg-wind.is-tail .wg-wind-kind { color: var(--wg-red); }
.wg-wind-text { display: flex; flex-direction: column; line-height: 1.05; }
.wg-wind-valrow { display: flex; align-items: baseline; }
.wg-wind-val {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.wg-wind-kind {
  font-family: var(--wg-font-cond);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wg-muted);
}

/* to beat: the TV green line label */
.wg-tobeat {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #1fcf72, #10a95a);
  color: #04210f;
  box-shadow: 0 6px 18px rgba(16, 169, 90, 0.35);
}
.wg-tobeat-label {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.wg-tobeat-val {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

/* start traffic light (top centre) */
.wg-light {
  position: absolute;
  top: calc(var(--wg-sp) + 6px);
  left: 50%;
  display: flex;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #1b222d, #0b0f15);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--wg-shadow);
  transform: translate(-50%, -8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s var(--wg-ease), visibility 0.3s;
}
.wg-light.is-on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.wg-lamp {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2a2f37;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  transition: background 0.12s, box-shadow 0.12s;
}
.wg-lamp-red { background: #4a1a1e; }
.wg-lamp-yellow { background: #4a3a14; }
.wg-lamp-green { background: #163a24; }
.wg-lamp-red.on { background: radial-gradient(circle at 40% 35%, #ffb3b3, #ff2d3d 55%, #b3101c); box-shadow: 0 0 18px 4px rgba(255, 45, 61, 0.65); }
.wg-lamp-yellow.on { background: radial-gradient(circle at 40% 35%, #fff1b8, #ffc21f 55%, #b57d00); box-shadow: 0 0 18px 4px rgba(255, 194, 31, 0.6); }
.wg-lamp-green.on { background: radial-gradient(circle at 40% 35%, #c6ffd9, #22e06f 55%, #0b8a3e); box-shadow: 0 0 20px 5px rgba(34, 224, 111, 0.65); }

/* flight instruments (right side, vertically centred) */
.wg-flight {
  position: absolute;
  right: var(--wg-sp);
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  transform: translate(12px, -50%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.35s var(--wg-ease), visibility 0.3s;
}
.wg-hud[data-phase='flight'] .wg-flight {
  opacity: 1;
  visibility: visible;
  transform: translate(0, -50%);
}
.wg-attack {
  position: relative;
  width: 236px;
  box-sizing: border-box;
  padding: 8px 10px 8px;
  text-align: center;
  --wg-assist: 0;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}
.wg-gauge { display: block; width: 100%; height: auto; overflow: visible; }
.wg-gauge-track { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 10; }
.wg-gauge-danger { fill: none; stroke: rgba(255, 75, 92, 0.75); stroke-width: 10; }
.wg-gauge-warn { fill: none; stroke: rgba(255, 190, 59, 0.55); stroke-width: 10; }
.wg-gauge-band {
  fill: none;
  stroke: var(--wg-green);
  stroke-width: 12;
  filter: drop-shadow(0 0 4px rgba(52, 209, 127, 0.7));
}
.wg-gauge-tick { stroke: rgba(255, 255, 255, 0.35); stroke-width: 1; }
.wg-gauge-tick.major { stroke: rgba(255, 255, 255, 0.7); stroke-width: 1.6; }
.wg-gauge-needle line { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.wg-gauge-needle circle { fill: #fff; stroke: rgba(0, 0, 0, 0.4); stroke-width: 1; }
.wg-attack.is-good .wg-gauge-needle line { stroke: #c9ffe1; }
.wg-attack.is-danger .wg-gauge-needle line,
.wg-attack.is-danger .wg-gauge-needle circle { stroke: var(--wg-red); fill: var(--wg-red); }
.wg-attack-val {
  display: inline-block;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  color: var(--wg-amber);
  transition: color 0.15s;
}
.wg-attack.is-good .wg-attack-val { color: var(--wg-green); }
.wg-attack.is-danger .wg-attack-val { color: var(--wg-red); }

.wg-roll {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
}
.wg-roll .wg-label { writing-mode: vertical-rl; transform: rotate(180deg); }
.wg-roll-dial {
  position: relative;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}
.wg-roll-horizon {
  position: absolute;
  inset: -40%;
  transition: transform 0.05s linear;
}
.wg-roll-sky,
.wg-roll-ground { position: absolute; left: 0; right: 0; height: 50%; }
.wg-roll-sky { top: 0; background: linear-gradient(180deg, #1b5fa8, #5aa9e6); }
.wg-roll-ground {
  bottom: 0;
  background: linear-gradient(180deg, #f2f6fb, #b9c9d9);
  border-top: 2px solid #fff;
}
.wg-roll-pointer {
  position: absolute;
  left: calc(50% - 5px);
  top: calc(20% + 2px);
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid #fff;
}
.wg-roll-scale { position: absolute; inset: 0; width: 100%; height: 100%; }
.wg-roll-tick { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.6; }
.wg-roll-limit { stroke: var(--wg-red); stroke-width: 3; }
.wg-roll-mark {
  /* the fixed "athlete" reference: a short bar with a centre dot */
  position: absolute;
  left: 22%;
  right: 22%;
  top: calc(50% - 1.5px);
  height: 3px;
  border-radius: 2px;
  background: var(--wg-amber);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.wg-roll-mark::after {
  content: '';
  position: absolute;
  left: calc(50% - 3.5px);
  top: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wg-amber);
}
.wg-roll-val {
  min-width: 46px;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}
.wg-roll.is-warn .wg-roll-val { color: var(--wg-amber); }
.wg-roll.is-danger .wg-roll-val { color: var(--wg-red); }
.wg-roll.is-danger .wg-roll-dial { border-color: var(--wg-red); box-shadow: 0 0 12px rgba(255, 75, 92, 0.6); }

/* bottom-centre stack: take-off zone / telemark cue above the in-run balance meter */
.wg-cstack {
  position: absolute;
  left: 50%;
  bottom: calc(var(--wg-sp) + 62px);
  width: min(380px, calc(100vw - 2 * var(--wg-sp)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}
.wg-balance {
  box-sizing: border-box;
  width: min(300px, 100%);
  padding: 8px 14px 10px;
  text-align: center;
  display: none;
}
.wg-hud[data-phase='inrun'] .wg-balance {
  display: block;
  animation: wg-rise 0.3s var(--wg-ease) both;
}
.wg-bal-track {
  position: relative;
  height: 10px;
  margin-top: 6px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgba(255, 75, 92, 0.75), rgba(255, 190, 59, 0.55) 22%, rgba(255, 255, 255, 0.12) 35%, rgba(255, 255, 255, 0.12) 65%, rgba(255, 190, 59, 0.55) 78%, rgba(255, 75, 92, 0.75));
}
.wg-bal-zone {
  position: absolute;
  left: 35%;
  right: 35%;
  top: 0;
  bottom: 0;
  border-radius: 5px;
  background: rgba(52, 209, 127, 0.55);
}
.wg-bal-center {
  position: absolute;
  left: calc(50% - 1px);
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.85);
}
.wg-bal-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 10px rgba(255, 255, 255, 0.6);
}
.wg-balance.is-warn .wg-bal-marker { background: var(--wg-amber); }
.wg-balance.is-danger .wg-bal-marker { background: var(--wg-red); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35), 0 0 12px rgba(255, 75, 92, 0.8); }

/* lower third name plate (bottom-left) */
.wg-plate {
  position: absolute;
  left: var(--wg-sp);
  bottom: var(--wg-sp);
  display: flex;
  align-items: stretch;
  max-width: min(460px, calc(100vw - 2 * var(--wg-sp) - 190px));
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--wg-shadow);
  animation: wg-slide-in-left 0.5s var(--wg-ease) both;
}
.wg-plate-bib {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 0 10px;
  background: linear-gradient(180deg, #ffe066, #f2c443);
  color: #1d1606;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 24px;
  font-variant-numeric: tabular-nums;
}
.wg-plate-body {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 10px 16px;
  background: var(--wg-glass-strong);
  border-left: 3px solid var(--wg-ice);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.wg-plate-name { font-size: 22px; line-height: 1.1; }
.wg-plate-body .wg-nation { font-size: 16px; color: var(--wg-muted); }

/* speed + distance readout (bottom-right) */
.wg-readout {
  position: absolute;
  right: var(--wg-sp);
  bottom: var(--wg-sp);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.wg-speed {
  /* grid (not wrapping flex) so the panel is only as wide as its widest row */
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  justify-content: end;
  padding: 6px 14px 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s var(--wg-ease), visibility 0.3s;
}
.wg-hud:is([data-phase='inrun'], [data-phase='flight'], [data-phase='landed'], [data-phase='outrun']) .wg-speed {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.wg-speed-val {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.wg-height {
  grid-column: 1 / -1;
  text-align: right;
  font-family: var(--wg-font-cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wg-muted);
}
.wg-height:empty { display: none; }
.wg-dist {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 16px 8px;
  border-right: 4px solid var(--wg-ice);
  animation: wg-pop 0.45s var(--wg-ease) both;
}
.wg-dist-val {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 46px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.wg-dist.is-beaten { border-right-color: var(--wg-green); }
.wg-dist.is-beaten .wg-dist-val { color: #b9ffd6; text-shadow: 0 0 18px rgba(52, 209, 127, 0.55); }

/* ------------------------------------------------------------------ flash, hint, ticker, replay */
.wg-flashstack {
  position: absolute;
  left: 50%;
  top: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}
.wg-flash {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 28px 12px;
  border-radius: 12px;
  transform: scale(0.9);
  opacity: 0;
  visibility: hidden;
  text-align: center;
  white-space: nowrap;
  background: rgba(8, 14, 26, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.wg-flash.is-on {
  visibility: visible;
  animation: wg-flash-in 0.4s var(--wg-ease) both;
}
.wg-flash.is-on.is-out { animation: wg-flash-out 0.3s ease-in both; }
.wg-flash-text {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.45);
}
.wg-flash-sub {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: clamp(16px, 2.2vw, 22px);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--wg-muted);
}
.wg-flash-sub:empty { display: none; }
.wg-flash.is-perfect { border-color: rgba(242, 196, 67, 0.6); box-shadow: 0 0 40px rgba(242, 196, 67, 0.25); }
.wg-flash.is-perfect .wg-flash-text {
  background: linear-gradient(180deg, #fff6c9, #f2c443 60%, #e0a21a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wg-flash.is-good { border-color: rgba(52, 209, 127, 0.55); }
.wg-flash.is-good .wg-flash-text { color: var(--wg-green); }
.wg-flash.is-bad { border-color: rgba(255, 75, 92, 0.55); }
.wg-flash.is-bad .wg-flash-text { color: var(--wg-red); }
.wg-flash.is-info .wg-flash-text { color: var(--wg-text); }

.wg-hint {
  position: absolute;
  left: 50%;
  bottom: var(--wg-sp);
  max-width: min(560px, calc(100vw - 2 * var(--wg-sp)));
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(8, 14, 26, 0.62);
  border: 1px solid var(--wg-line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  color: var(--wg-text);
  transform: translate(-50%, 10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s var(--wg-ease), visibility 0.3s;
}
.wg-hint.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
/* Keep the hint clear of the lower third and the readout on mid-size screens. */
.wg-ui.hud-on .wg-hint { bottom: calc(var(--wg-sp) + 2px); }

.wg-ticker {
  position: absolute;
  box-sizing: border-box;
  left: var(--wg-sp);
  bottom: calc(var(--wg-sp) + 64px);
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 2 * var(--wg-sp));
  padding: 6px 14px 6px 6px;
  border-radius: 8px;
  background: var(--wg-glass-strong);
  border: 1px solid var(--wg-line);
  box-shadow: var(--wg-shadow);
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-16px);
  transition: opacity 0.3s ease, transform 0.35s var(--wg-ease), visibility 0.3s;
}
.wg-ticker.is-on { opacity: 1; visibility: visible; transform: none; }
.wg-ticker-tag {
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--wg-blue);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wg-ticker-bib {
  min-width: 26px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--wg-gold);
  color: #1d1606;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  text-align: center;
}
.wg-ticker .wg-nation { color: var(--wg-muted); font-size: 14px; }
.wg-ticker-dist,
.wg-ticker-pts,
.wg-ticker-rank {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}
.wg-ticker-pts { color: var(--wg-muted); font-weight: 600; }
.wg-ticker-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.wg-ticker-rank { color: var(--wg-ice); }

.wg-replay {
  position: absolute;
  top: var(--wg-sp);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(8, 14, 26, 0.75);
  border: 1px solid rgba(255, 75, 92, 0.6);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translate(-50%, -8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, transform 0.3s var(--wg-ease), visibility 0.3s;
}
.wg-replay.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.wg-replay-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wg-red);
  box-shadow: 0 0 10px var(--wg-red);
  animation: wg-blink 1.1s ease-in-out infinite;
}

/* ------------------------------------------------------------------ buttons & form controls */
.wg-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--wg-text);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
}
.wg-btn:hover { background: rgba(255, 255, 255, 0.13); border-color: rgba(255, 255, 255, 0.28); }
.wg-btn:active { transform: translateY(1px) scale(0.99); }
.wg-btn:focus-visible,
.wg-seg-btn:focus-visible,
.wg-tab:focus-visible,
.wg-range:focus-visible {
  outline: 2px solid var(--wg-ice);
  outline-offset: 2px;
}
.wg-btn-primary {
  border-color: transparent;
  background: linear-gradient(180deg, #4aa8ff, var(--wg-blue));
  box-shadow: 0 6px 18px rgba(47, 124, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.wg-btn-primary:hover { background: linear-gradient(180deg, #62b5ff, #3d87ff); }
.wg-btn-primary .wg-kbd { border-color: rgba(255, 255, 255, 0.45); background: rgba(0, 0, 0, 0.18); }
.wg-btn-ghost { background: transparent; }
.wg-btn-danger:hover { border-color: rgba(255, 75, 92, 0.7); background: rgba(255, 75, 92, 0.15); }
.wg-btn-big { min-height: 52px; font-size: 19px; }
.wg-btn .wg-kbd { font-size: 12px; }

.wg-field { display: flex; flex-direction: column; gap: 6px; }
.wg-field-label {
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wg-muted);
}
.wg-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wg-seg-btn {
  pointer-events: auto;
  flex: 1 1 0;
  min-width: 90px;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--wg-text);
  font-family: var(--wg-font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.wg-seg-btn:hover { background: rgba(255, 255, 255, 0.1); }
.wg-seg-btn.is-on {
  border-color: var(--wg-ice);
  background: rgba(92, 200, 255, 0.16);
  box-shadow: inset 0 0 0 1px var(--wg-ice), 0 0 16px rgba(92, 200, 255, 0.18);
}
.wg-seg-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.wg-seg-main { font-weight: 600; font-size: 15px; }
.wg-seg-sub {
  font-family: var(--wg-font-cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--wg-muted);
}
.wg-swatch {
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.wg-swatch-day { background: radial-gradient(circle at 35% 35%, #fff7c2 0 22%, #8fd0ff 24%, #3d8fe0); }
.wg-swatch-dusk { background: linear-gradient(180deg, #5a3d8f, #e66f5c 60%, #ffc27a); }
.wg-swatch-night { background: radial-gradient(circle at 65% 35%, #e9eefc 0 14%, transparent 16%), linear-gradient(180deg, #050b1c, #1b2b52); }

.wg-stepper { display: flex; align-items: center; gap: 8px; }
.wg-step {
  width: 46px;
  min-width: 46px;
  padding: 0;
  font-size: 24px;
  font-family: var(--wg-font);
}
.wg-step-val {
  min-width: 42px;
  text-align: center;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.wg-range {
  pointer-events: auto;
  flex: 1;
  min-width: 80px;
  height: 44px;
  accent-color: var(--wg-ice);
  background: transparent;
  cursor: pointer;
}

/* ------------------------------------------------------------------ modals */
.wg-modal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wg-sp);
  box-sizing: border-box;
  pointer-events: none;
}
.wg-modal > * { pointer-events: auto; }
.wg-modal-dim { background: rgba(4, 8, 16, 0.55); pointer-events: auto; animation: wg-fade 0.25s ease both; }
.wg-modal-center { justify-content: center; }
.wg-modal-side {
  justify-content: flex-end;
  /* a soft scrim on the card side keeps the replay/3D view visible on the other side */
  background: linear-gradient(90deg, transparent 40%, rgba(4, 8, 16, 0.45));
}
.wg-h2 {
  margin: 0;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 28px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.wg-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.wg-empty { color: var(--wg-muted); }

/* result card */
.wg-result {
  width: min(470px, 100%);
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 18px 20px 18px;
  margin-right: clamp(0px, 3vw, 40px);
  animation: wg-slide-in-right 0.5s var(--wg-ease) both;
}
.wg-result-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.wg-result-head .wg-plate-bib { border-radius: 6px; min-height: 40px; }
.wg-result-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.wg-result-who .wg-name { font-size: 22px; }
.wg-result-who .wg-nation { color: var(--wg-muted); font-size: 14px; }
.wg-result-rank { display: flex; flex-direction: column; align-items: flex-end; }
.wg-result-rank-val {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
}
.wg-result-rank.is-p1 .wg-result-rank-val { color: var(--wg-gold); }
.wg-result-rank.is-p2 .wg-result-rank-val { color: var(--wg-silver); }
.wg-result-rank.is-p3 .wg-result-rank-val { color: var(--wg-bronze); }
.wg-result-big {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 12px 0 2px;
}
.wg-result-dist {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 64px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.wg-result-meta {
  margin: 4px 0 12px;
  font-size: 14px;
  color: var(--wg-muted);
}
.wg-judges { margin: 6px 0 10px; }
.wg-judge-cells {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
}
.wg-judge {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: wg-judge-in 0.35s var(--wg-ease) both;
  animation-delay: calc(0.35s + var(--j, 0) * 0.09s);
}
.wg-judge-id {
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--wg-dim);
}
.wg-judge-val {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.wg-judge.is-dropped .wg-judge-val {
  color: var(--wg-dim);
  animation: wg-dim 0.3s ease both;
  animation-delay: 1s;
}
.wg-judge.is-dropped::after {
  /* strike-through drawn after all five marks are in */
  content: '';
  position: absolute;
  left: 18%;
  right: 18%;
  top: 62%;
  height: 2px;
  background: var(--wg-red);
  transform: scaleX(0) rotate(-12deg);
  transform-origin: left center;
  animation: wg-strike 0.3s ease-out both;
  animation-delay: 1s;
}
.wg-breakdown { display: flex; flex-direction: column; }
.wg-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wg-line-label { color: var(--wg-muted); font-size: 15px; }
.wg-line-val {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 21px;
  font-variant-numeric: tabular-nums;
}
.wg-line.is-pos .wg-line-val { color: var(--wg-green); }
.wg-line.is-neg .wg-line-val { color: var(--wg-red); }
.wg-line-total {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 2px solid rgba(255, 255, 255, 0.25);
}
.wg-line-total .wg-line-label {
  color: var(--wg-text);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wg-line-total .wg-line-val { font-size: 34px; color: var(--wg-ice); }
.wg-stagger {
  animation: wg-row-in 0.45s var(--wg-ease) both;
  animation-delay: calc(0.08s + var(--i, 0) * 0.07s);
}

/* standings */
.wg-standings {
  width: min(680px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 18px 20px;
  animation: wg-pop 0.4s var(--wg-ease) both;
}
.wg-standings-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wg-standings-sub { color: var(--wg-muted); font-size: 14px; }
.wg-table-wrap {
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  scrollbar-width: thin;
}
.wg-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.wg-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 8px 10px;
  background: #0f1a2c;
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wg-muted);
  text-align: left;
}
.wg-table td {
  padding: 7px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 15px;
  white-space: nowrap;
}
.wg-table tbody tr { animation: wg-row-in 0.35s var(--wg-ease) both; animation-delay: calc(var(--i, 0) * 0.03s); }
.wg-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.wg-table .c-rank { width: 44px; font-family: var(--wg-font-cond); font-weight: 800; font-size: 18px; }
.wg-table th.c-rank { font-size: 12px; }
.wg-table .c-bib { width: 40px; color: var(--wg-muted); }
.wg-table .c-name { max-width: 0; width: 100%; }
.wg-table .c-name-box { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.wg-table .c-name-box .wg-name { min-width: 0; }
.wg-table td.c-name .wg-nation { min-width: 56px; flex: none; font-size: 13px; color: var(--wg-muted); }
.wg-table .c-d,
.wg-table .c-pts { text-align: right; font-family: var(--wg-font-cond); font-size: 18px; font-weight: 600; }
.wg-table th.c-d,
.wg-table th.c-pts { text-align: right; font-size: 12px; }
.wg-table td.c-pts { font-weight: 800; }
.wg-table td.is-fell { color: var(--wg-red); }
.wg-table tr.is-p1 .c-rank { color: var(--wg-gold); }
.wg-table tr.is-p2 .c-rank { color: var(--wg-silver); }
.wg-table tr.is-p3 .c-rank { color: var(--wg-bronze); }
.wg-table tr.is-player {
  background: linear-gradient(90deg, rgba(92, 200, 255, 0.25), rgba(92, 200, 255, 0.08));
  box-shadow: inset 3px 0 0 var(--wg-ice);
}
.wg-table tr.is-player td.c-pts { color: var(--wg-ice); }

/* pause */
.wg-pause {
  width: min(360px, 100%);
  padding: 22px;
  box-sizing: border-box;
  text-align: center;
  animation: wg-pop 0.3s var(--wg-ease) both;
}
.wg-pause-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }

/* help */
.wg-help {
  width: min(640px, 100%);
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 20px 22px;
  animation: wg-pop 0.3s var(--wg-ease) both;
}
.wg-help-grid { display: flex; flex-direction: column; margin-top: 12px; }
.wg-help-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wg-help-what { display: flex; flex-direction: column; gap: 2px; }
.wg-help-title { font-weight: 600; font-size: 16px; }
.wg-help-tip { font-size: 13px; color: var(--wg-muted); line-height: 1.35; }
.wg-help-keys { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 4px; max-width: 260px; }
.wg-help-pointer {
  margin-left: 6px;
  font-family: var(--wg-font-cond);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--wg-muted);
  text-transform: uppercase;
}
.wg-help-foot { margin: 12px 0 0; font-size: 13px; color: var(--wg-muted); }

/* ------------------------------------------------------------------ main menu */
.wg-menu {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  align-items: center;
  gap: clamp(16px, 4vw, 64px);
  padding: clamp(16px, 5vw, 64px);
  box-sizing: border-box;
  pointer-events: auto;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(5, 10, 20, 0.78) 0%, rgba(5, 10, 20, 0.35) 55%, rgba(5, 10, 20, 0.55) 100%),
    linear-gradient(180deg, rgba(5, 10, 20, 0) 60%, rgba(5, 10, 20, 0.6));
  animation: wg-fade 0.5s ease both;
}
.wg-menu-hero { align-self: center; animation: wg-slide-in-left 0.7s var(--wg-ease) both; }
.wg-menu-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: clamp(14px, 1.6vw, 18px);
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--wg-ice);
}
.wg-menu-kicker::before {
  content: '';
  width: 34px;
  height: 3px;
  border-radius: 2px;
  background: var(--wg-ice);
}
.wg-menu-title {
  margin: 6px 0 8px;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: clamp(48px, 8.5vw, 112px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
}
.wg-menu-tag {
  margin: 0;
  max-width: 40ch;
  font-size: clamp(15px, 1.5vw, 19px);
  color: #d6e2f0;
}
.wg-menu-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  animation: wg-slide-in-right 0.6s var(--wg-ease) both;
}
.wg-tabs {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
}
.wg-tab {
  pointer-events: auto;
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--wg-muted);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.wg-tab:hover { color: var(--wg-text); }
.wg-tab.is-on { background: rgba(255, 255, 255, 0.12); color: var(--wg-text); box-shadow: inset 0 -2px 0 var(--wg-ice); }
.wg-menu-body { display: flex; flex-direction: column; gap: 14px; }
.wg-menu-desc { margin: 0; font-size: 14px; line-height: 1.45; color: var(--wg-muted); }
.wg-menu-body .wg-btn-primary { margin-top: 4px; width: 100%; }
.wg-menu-foot {
  margin: 0;
  text-align: center;
  font-family: var(--wg-font-cond);
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--wg-dim);
}

/* ------------------------------------------------------------------ touch controls */
.wg-touch { display: none; }
.wg-ui.is-touch.hud-on:not(.modal-open):not(.menu-open):not(.help-open) .wg-touch { display: block; }
.wg-tbtn {
  pointer-events: auto;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(10, 18, 32, 0.45);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: background 0.08s, transform 0.08s;
}
.wg-tbtn.is-down { background: rgba(92, 200, 255, 0.45); transform: scale(0.95); }
.wg-tbtn-glyph { font-size: 22px; line-height: 1; pointer-events: none; }
.wg-tpad {
  position: absolute;
  left: calc(var(--wg-sp) + env(safe-area-inset-left, 0px));
  bottom: calc(var(--wg-sp) + env(safe-area-inset-bottom, 0px));
  width: 186px;
  height: 186px;
}
.wg-tpad .wg-tbtn { width: 62px; height: 62px; border-radius: 14px; }
.wg-t-up { left: 62px; top: 0; }
.wg-t-down { left: 62px; bottom: 0; }
.wg-t-left { left: 0; top: 62px; }
.wg-t-right { right: 0; top: 62px; }
.wg-t-action {
  right: calc(var(--wg-sp) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--wg-sp) + 18px + env(safe-area-inset-bottom, 0px));
  width: 112px;
  height: 112px;
  border-radius: 50%;
  flex-direction: column;
  background: radial-gradient(circle at 40% 30%, rgba(98, 181, 255, 0.85), rgba(47, 124, 255, 0.75));
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(47, 124, 255, 0.4);
}
.wg-t-action.is-down { background: radial-gradient(circle at 40% 30%, #9fd4ff, #2f7cff); }
.wg-t-action-label {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}
.wg-t-pause {
  left: calc(var(--wg-sp) + env(safe-area-inset-left, 0px));
  top: calc(var(--wg-sp) + env(safe-area-inset-top, 0px));
  width: 48px;
  height: 48px;
  border-radius: 12px;
}
.wg-t-pause .wg-tbtn-glyph { font-family: var(--wg-font-cond); font-weight: 800; font-size: 18px; letter-spacing: 0.05em; }
/* ski-jump CAM: in the gap between the D-pad and the action button (the top-left column holds the
   flight instruments on phones) */
.wg-t-cam {
  left: calc(var(--wg-sp) + 196px + env(safe-area-inset-left, 0px));
  bottom: calc(var(--wg-sp) + 6px + env(safe-area-inset-bottom, 0px));
  width: 52px;
  height: 40px;
  border-radius: 10px;
}
.wg-t-cam .wg-tbtn-glyph { font-family: var(--wg-font-cond); font-weight: 800; font-size: 12px; letter-spacing: 0.1em; }

/* With touch controls, lift the bottom panels above the buttons and make room for pause. */
.wg-ui.is-touch .wg-bug { left: calc(var(--wg-sp) + 58px); }
.wg-ui.is-touch .wg-plate { bottom: calc(var(--wg-sp) + 200px); max-width: calc(100vw - 2 * var(--wg-sp)); }
.wg-ui.is-touch .wg-ticker { bottom: calc(var(--wg-sp) + 262px); }
.wg-ui.is-touch .wg-readout { bottom: calc(var(--wg-sp) + 146px); }
.wg-ui.is-touch .wg-cstack { bottom: calc(var(--wg-sp) + 200px); }
.wg-ui.is-touch .wg-hint { bottom: auto; top: calc(var(--wg-sp) + 84px); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 900px) {
  .wg-menu {
    grid-template-columns: 1fr;
    align-content: start;
    justify-items: center;
    background: linear-gradient(180deg, rgba(5, 10, 20, 0.55), rgba(5, 10, 20, 0.85));
  }
  .wg-menu-hero { justify-self: stretch; text-align: left; max-width: 520px; width: 100%; }
  .wg-menu-panel { width: 100%; max-width: 520px; box-sizing: border-box; }
  .wg-modal-side { justify-content: center; background: rgba(4, 8, 16, 0.35); }
  .wg-result { margin-right: 0; }
}

/* Narrower screens: the bottom edge holds the name plate and the readout, so the hint,
   ticker and balance meter stack above them. */
@media (max-width: 1000px) {
  .wg-ui:not(.is-touch) .wg-hint { bottom: calc(var(--wg-sp) + 64px); }
  .wg-ui:not(.is-touch) .wg-ticker { bottom: calc(var(--wg-sp) + 116px); }
  .wg-ui:not(.is-touch) .wg-cstack { bottom: calc(var(--wg-sp) + 168px); }
}

@media (max-width: 760px) {
  .wg-bug { padding: 6px 10px 6px 8px; }
  .wg-bug-title { font-size: 13px; }
  .wg-bug-sport { display: none; }
  .wg-wind { padding: 6px 10px 6px 6px; gap: 8px; }
  .wg-wind-dial { width: 40px; height: 40px; }
  .wg-wind-arrow { top: 3px; height: 32px; }
  .wg-wind-val { font-size: 22px; }
  .wg-tobeat-val { font-size: 19px; }
  .wg-plate-name { font-size: 18px; }
  .wg-plate-bib { font-size: 20px; min-width: 38px; }
  .wg-plate-body { padding: 8px 12px; gap: 10px; }
  .wg-speed-val { font-size: 32px; }
  .wg-dist-val { font-size: 36px; }
  .wg-attack { width: 196px; }
  .wg-attack-val { font-size: 19px; }
  .wg-roll-dial { width: 60px; height: 60px; }
  .wg-hint { font-size: 13px; }
  .wg-table .c-bib { display: none; }
  .wg-result-dist { font-size: 54px; }
}

@media (max-width: 520px) {
  .wg-plate { max-width: calc(100vw - 2 * var(--wg-sp)); bottom: calc(var(--wg-sp) + 84px); }
  .wg-ui:not(.is-touch) .wg-hint { bottom: calc(var(--wg-sp) + 142px); }
  .wg-ui:not(.is-touch) .wg-ticker { bottom: calc(var(--wg-sp) + 194px); }
  .wg-ui:not(.is-touch) .wg-cstack { bottom: calc(var(--wg-sp) + 246px); }
  .wg-plate-body .wg-nation .wg-nation-code { display: none; }
  .wg-judge-val { font-size: 19px; }
  .wg-help-row { grid-template-columns: 1fr; gap: 6px; }
  .wg-help-keys { justify-content: flex-start; max-width: none; }
  .wg-table td.c-name .wg-nation { width: auto; }
  .wg-table td.c-name .wg-nation-code { display: none; }
  .wg-table td, .wg-table th { padding-left: 6px; padding-right: 6px; }
}

/* Phones in portrait with touch controls: name plate goes to the top, readout sits above
   the action button, instruments in the right-hand middle, flash below them. */
@media (max-width: 520px) {
  .wg-ui.is-touch .wg-plate { top: calc(var(--wg-sp) + 118px); bottom: auto; max-width: calc(100vw - 2 * var(--wg-sp)); }
  .wg-ui.is-touch .wg-plate-name { font-size: 17px; }
  .wg-ui.is-touch .wg-readout { bottom: calc(var(--wg-sp) + 142px); }
  /* The middle of a portrait screen belongs to the athlete: the flight instruments sit side by
     side just above the speed readout, the cues just above the touch controls, the hint is a
     full-width strip under the name plate and the flash between them. */
  .wg-ui.is-touch .wg-flight,
  .wg-ui.is-touch .wg-hud[data-phase='flight'] .wg-flight {
    top: auto;
    bottom: calc(var(--wg-sp) + 258px);
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    transform: none;
  }
  .wg-ui.is-touch .wg-attack { width: 170px; padding: 6px 8px; }
  .wg-ui.is-touch .wg-attack-val { font-size: 17px; }
  .wg-ui.is-touch .wg-roll { padding: 6px 8px 6px 6px; gap: 6px; }
  .wg-ui.is-touch .wg-roll-dial { width: 52px; height: 52px; }
  .wg-ui.is-touch .wg-flashstack { top: 31%; }
  .wg-ui.is-touch .wg-hint,
  .wg-ui.is-touch .wg-hint.is-on {
    top: calc(var(--wg-sp) + 166px);
    bottom: auto;
    left: var(--wg-sp);
    right: var(--wg-sp);
    max-width: none;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12.5px;
    text-align: left;
    transform: none;
  }
  .wg-ui.is-touch .wg-ticker { top: calc(var(--wg-sp) + 210px); bottom: auto; }
  .wg-ui.is-touch .wg-cstack { top: auto; bottom: calc(var(--wg-sp) + 196px); }
  .wg-ui.is-touch .wg-topright { top: calc(var(--wg-sp) + 0px); }
}

/* Short landscape screens (phones held sideways): instruments side by side under the
   wind panel, plate and readout share the bottom edge between the touch controls. */
@media (max-height: 520px) {
  .wg-flight {
    flex-direction: row;
    align-items: flex-start;
    top: calc(var(--wg-sp) + 112px);
    transform: translate(12px, 0);
  }
  .wg-hud[data-phase='flight'] .wg-flight { transform: none; }
  .wg-attack { width: 150px; padding: 6px 6px 4px; }
  .wg-attack-val { font-size: 18px; }
  .wg-roll { padding: 6px 8px 6px 6px; gap: 6px; }
  .wg-roll .wg-label { display: none; }
  .wg-roll-dial { width: 54px; height: 54px; }
  .wg-roll-val { font-size: 17px; min-width: 40px; }
  .wg-speed-val { font-size: 30px; }
  .wg-dist-val { font-size: 34px; }
  .wg-flashstack { top: 34%; }
  .wg-hint { font-size: 13px; padding: 6px 12px; }
  .wg-wind { padding: 5px 10px 5px 5px; }
  .wg-wind-dial { width: 40px; height: 40px; }
  .wg-wind-arrow { top: 3px; height: 32px; }
  .wg-ui.is-touch .wg-tpad { transform: scale(0.8); transform-origin: left bottom; }
  .wg-ui.is-touch .wg-t-action { width: 100px; height: 100px; bottom: var(--wg-sp); }
  .wg-ui.is-touch .wg-plate {
    top: auto;
    bottom: var(--wg-sp);
    left: calc(var(--wg-sp) + 160px);
    max-width: calc(100vw - 2 * var(--wg-sp) - 560px);
    min-width: 200px;
  }
  .wg-ui.is-touch .wg-plate-name { font-size: 16px; }
  .wg-ui.is-touch .wg-plate-body .wg-nation-code { display: none; }
  /* readout as a row (distance | speed) to keep the right-hand column free for instruments */
  .wg-ui.is-touch .wg-readout { bottom: var(--wg-sp); right: calc(var(--wg-sp) + 116px); flex-direction: row-reverse; align-items: flex-end; }
  .wg-ui.is-touch .wg-height { display: none; }
  .wg-ui.is-touch .wg-cstack { top: auto; bottom: calc(var(--wg-sp) + 86px); width: min(340px, 44vw); }
  .wg-ui.is-touch .wg-hint { top: calc(var(--wg-sp) + 58px); bottom: auto; }
  .wg-ui.is-touch .wg-ticker { top: auto; bottom: calc(var(--wg-sp) + 64px); left: calc(var(--wg-sp) + 160px); }
  .wg-ui.is-touch .wg-flashstack { top: 40%; }
}

/* ------------------------------------------------------------------ animations */
@keyframes wg-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wg-pop {
  from { opacity: 0; transform: scale(0.96) translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes wg-slide-in-left {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: none; }
}
@keyframes wg-slide-in-right {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes wg-row-in {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes wg-judge-in {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to { opacity: 1; transform: none; }
}
@keyframes wg-strike { to { transform: scaleX(1) rotate(-12deg); } }
@keyframes wg-dim { from { color: var(--wg-text); } to { color: var(--wg-dim); } }
@keyframes wg-blink { 0% { opacity: 1; } 50% { opacity: 0.2; } 100% { opacity: 1; } }
@keyframes wg-flash-in {
  0% { opacity: 0; transform: translateY(8px) scale(0.85); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { opacity: 1; transform: none; }
}
@keyframes wg-flash-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-10px) scale(0.98); }
}
@keyframes wg-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wg-ui *,
  .wg-ui *::before,
  .wg-ui *::after,
  #loading {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
  .wg-flash.is-on { animation: none; opacity: 1; transform: none; }
  .wg-flash.is-on.is-out { opacity: 0; }
}

/* ==================================================================================
   Phase 2: menu screens, dialogs, widgets and the new HUD cues.
   Screens (.wg-scr) fill the overlay, own their pointer events and keep a translucent scrim
   so the 3D venue stays visible behind them. Content is centred at max ~1240 px, respects
   safe-area insets and collapses to one column on phones.
   ================================================================================== */

.wg-ui [hidden] { display: none !important; }
.wg-ui :is(button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--wg-ice);
  outline-offset: 2px;
}
.wg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.wg-ui.is-touch .wg-kbd-hint { display: none; }
.wg-icon {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wg-ui button { font-family: inherit; }
.wg-btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.wg-ui.is-touch .wg-btn-sm { min-height: 44px; }
.wg-btn-danger { color: #ffb3bb; }
.wg-btn-danger-solid {
  border-color: transparent;
  background: linear-gradient(180deg, #ff6474, #df2a3d);
  box-shadow: 0 6px 18px rgba(223, 42, 61, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.wg-btn-danger-solid:hover { background: linear-gradient(180deg, #ff7a88, #e93a4c); }
.wg-btn:disabled,
.wg-btn[disabled] {
  opacity: 0.42;
  cursor: default;
  box-shadow: none;
  transform: none;
}
.wg-icon-btn { width: 44px; min-width: 44px; padding: 0; }
.wg-actions-center { justify-content: center; }
.wg-actions-start { justify-content: flex-start; margin-top: 12px; }
.wg-tag-soft { background: rgba(255, 255, 255, 0.1); color: #d6e2f0; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.wg-tag-custom { background: rgba(92, 200, 255, 0.2); color: var(--wg-ice); font-size: 11px; padding: 1px 7px; }
.wg-tag-next { background: var(--wg-ice); color: #06121f; font-size: 12px; }
.wg-tag-ok { background: var(--wg-green); color: #04210f; font-size: 12px; }
.wg-tag-xs { font-size: 10px; padding: 1px 5px; flex: none; }
.wg-tag-rec {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px 1px 5px;
  background: var(--wg-gold);
  color: #1d1606;
  font-size: 11px;
}
.wg-tag-rec .wg-icon { width: 12px; height: 12px; stroke-width: 2.6; }

/* ------------------------------------------------------------------ screen frame */
.wg-scr {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding-left: max(var(--wg-sp), env(safe-area-inset-left, 0px), calc((100% - 1240px) / 2));
  padding-right: max(var(--wg-sp), env(safe-area-inset-right, 0px), calc((100% - 1240px) / 2));
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(5, 10, 20, 0.84) 0%, rgba(5, 10, 20, 0.62) 38%, rgba(5, 10, 20, 0.7) 70%, rgba(5, 10, 20, 0.9) 100%);
  animation: wg-fade 0.28s ease both;
}
/* A screen whose callback fired waits (inert, dimmed) until the next screen arrives. The dim
   is delayed so a quick screen change never flickers. */
.wg-screen.is-busy { pointer-events: none; }
.wg-screen.is-busy :is(.wg-scr-body, .wg-scr-foot, .wg-hub-list, .wg-creator-panel) {
  opacity: 0.5;
  transition: opacity 0.2s ease 0.18s;
}
.wg-scr-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: calc(var(--wg-sp) + env(safe-area-inset-top, 0px)) 0 12px;
}
.wg-back { flex: none; padding: 0 14px 0 8px; }
.wg-back .wg-icon { width: 22px; height: 22px; }
.wg-scr-titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wg-scr-kicker {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--wg-ice);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-scr-title {
  margin: 0;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: clamp(26px, 3.3vw, 40px);
  line-height: 1;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-scr-sub { color: var(--wg-muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-scr-right { flex: none; display: flex; align-items: center; gap: 8px; }
.wg-scr-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 4px 4px 16px;
  margin: 0 -4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.wg-scr-foot {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 12px 0 calc(var(--wg-sp) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--wg-line);
}
.wg-scr-foot .wg-field { gap: 4px; }
.wg-scr-foot .wg-field-label { font-size: 11px; }
.wg-foot-summary { display: flex; align-items: center; gap: 10px; flex: 1 1 220px; min-width: 0; overflow: hidden; }
.wg-foot-name {
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.wg-foot-summary .wg-nation { color: var(--wg-muted); flex: none; }
.wg-foot-meta { color: var(--wg-muted); font-size: 14px; white-space: nowrap; }
.wg-foot-spacer { flex: 1 1 0; }
.wg-foot-go { margin-left: auto; min-width: 210px; }
.wg-foot-left { margin-right: auto; }
.wg-foot-gate .wg-step-val { font-size: 24px; min-width: 34px; }

/* ------------------------------------------------------------------ cards & small pieces */
.wg-card {
  box-sizing: border-box;
  min-width: 0;
  padding: 14px 16px;
  border-radius: var(--wg-radius);
  border: 1px solid var(--wg-line);
  background: linear-gradient(180deg, rgba(18, 29, 49, 0.9), rgba(10, 17, 31, 0.88));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.wg-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 10px;
}
.wg-h3 {
  margin: 0;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.wg-card-meta { font-family: var(--wg-font-cond); font-weight: 600; font-size: 14px; letter-spacing: 0.06em; color: var(--wg-muted); }
.wg-card-sub { display: block; margin: 0 0 10px; font-size: 13px; line-height: 1.4; color: var(--wg-muted); }
.wg-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--wg-ice);
  background: rgba(92, 200, 255, 0.08);
  font-size: 14px;
  line-height: 1.45;
  color: #d6e2f0;
}
.wg-field-hint { font-size: 12.5px; color: var(--wg-muted); }
.wg-progress { height: 6px; border-radius: 3px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.wg-progress-fill { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--wg-blue), var(--wg-ice)); }
.wg-kstat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}
.wg-kstat-k { font-family: var(--wg-font-cond); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; color: var(--wg-muted); }
.wg-kstat-v { font-family: var(--wg-font-cond); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.wg-line-note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-size: 13.5px; color: var(--wg-muted); }
.wg-line-note .wg-icon { width: 18px; height: 18px; }
.wg-line-note.is-good { color: var(--wg-green); }
.wg-line-note.is-bad { color: #ff8f9a; }
.wg-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--wg-muted); }
.wg-legend-pot { width: 2px; height: 12px; border-radius: 1px; background: #fff; }

/* ------------------------------------------------------------------ form widgets */
.wg-input {
  pointer-events: auto;
  box-sizing: border-box;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.3);
  color: var(--wg-text);
  font-family: var(--wg-font);
  font-weight: 600;
  font-size: 18px;
  user-select: text;
  -webkit-user-select: text;
}
.wg-input::placeholder { color: var(--wg-dim); font-weight: 500; }
.wg-input:focus { border-color: var(--wg-ice); outline: none; box-shadow: 0 0 0 3px rgba(92, 200, 255, 0.25); }
.wg-seg.is-compact .wg-seg-btn { min-width: 0; min-height: 44px; padding: 4px 12px; }
.wg-seg.is-compact .wg-seg-main { font-size: 14px; }
.wg-seg-btn:disabled { opacity: 0.4; cursor: default; }

.wg-slider-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wg-slider-val { font-family: var(--wg-font-cond); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.wg-slider .wg-range { width: 100%; height: 36px; }

.wg-toggle {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--wg-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
}
.wg-toggle:hover { background: rgba(255, 255, 255, 0.08); }
.wg-toggle-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wg-toggle-label { font-weight: 600; font-size: 15px; }
.wg-toggle-sub { font-size: 12.5px; color: var(--wg-muted); line-height: 1.35; }
.wg-toggle-track {
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.15s;
}
.wg-toggle-knob {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s var(--wg-ease);
}
.wg-toggle.is-on .wg-toggle-track { background: var(--wg-green-deep); }
.wg-toggle.is-on .wg-toggle-knob { transform: translateX(20px); }

.wg-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.wg-choice {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--wg-text);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.wg-choice:hover { background: rgba(255, 255, 255, 0.1); }
.wg-choice.is-on {
  border-color: var(--wg-ice);
  background: rgba(92, 200, 255, 0.16);
  box-shadow: inset 0 0 0 1px var(--wg-ice);
}

.wg-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.wg-chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--wg-text);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.wg-ui.is-touch .wg-chip { min-height: 44px; }
.wg-chip:hover { background: rgba(255, 255, 255, 0.12); }
.wg-chip.is-on { border-color: var(--wg-ice); background: rgba(92, 200, 255, 0.18); }
.wg-chip-count { padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-size: 12px; letter-spacing: 0; }

.wg-tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; padding: 0 8px; }
.wg-tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-tab-badge {
  flex: none;
  min-width: 20px;
  padding: 1px 6px;
  box-sizing: border-box;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  color: var(--wg-text);
  font-size: 12px;
  letter-spacing: 0;
  line-height: 1.4;
}
.wg-tab-badge.is-ok { background: var(--wg-green); color: #04210f; }
.wg-tab-badge.is-warn { background: var(--wg-amber); color: #2a1d00; }

/* attribute bars */
.wg-attr {
  display: grid;
  grid-template-columns: minmax(70px, 34%) minmax(0, 1fr) 32px 30px;
  align-items: center;
  gap: 8px;
  min-height: 26px;
}
.wg-attr-label { font-size: 14px; color: #d6e2f0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-attr-bar { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); }
.wg-attr-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 4px;
  background: var(--wg-ice);
  transition: width 0.25s var(--wg-ease);
}
.wg-attr-fill[data-tier='low'] { background: #e07a52; }
.wg-attr-fill[data-tier='mid'] { background: var(--wg-ice); }
.wg-attr-fill[data-tier='high'] { background: var(--wg-green); }
.wg-attr-fill[data-tier='elite'] { background: linear-gradient(90deg, #f6d36b, var(--wg-gold)); box-shadow: 0 0 8px rgba(242, 196, 67, 0.45); }
.wg-attr-band {
  position: absolute;
  top: -3px;
  bottom: -3px;
  border-left: 1px dashed rgba(255, 255, 255, 0.35);
  border-right: 1px dashed rgba(255, 255, 255, 0.35);
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 4px, transparent 4px 8px);
}
.wg-attr-pot {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.wg-attr-num { font-family: var(--wg-font-cond); font-weight: 700; font-size: 16px; text-align: right; font-variant-numeric: tabular-nums; }
.wg-attr-delta { font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.wg-attr-delta.is-up { color: var(--wg-green); }
.wg-attr-delta.is-down { color: #ff8f9a; }
.wg-attr.is-compact {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'label num' 'bar bar';
  gap: 2px 4px;
  min-height: 0;
}
.wg-attr.is-compact .wg-attr-label {
  grid-area: label;
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--wg-muted);
}
.wg-attr.is-compact .wg-attr-num { grid-area: num; font-size: 13px; }
.wg-attr.is-compact .wg-attr-bar { grid-area: bar; height: 5px; }
.wg-attr.is-compact .wg-attr-delta { display: none; }
.wg-attr-desc { display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.35; color: var(--wg-muted); }

/* meters (form, fatigue) */
.wg-meter + .wg-meter { margin-top: 14px; }
.wg-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.wg-meter-val { font-family: var(--wg-font-cond); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.wg-meter-track { position: relative; height: 10px; border-radius: 5px; background: rgba(255, 255, 255, 0.1); }
.wg-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--wg-ice); }
.wg-meter-fill[data-level='good'] { background: var(--wg-green); }
.wg-meter-fill[data-level='ok'] { background: var(--wg-amber); }
.wg-meter-fill[data-level='bad'] { background: var(--wg-red); }
.wg-meter-mid { position: absolute; left: calc(50% - 1px); top: -3px; bottom: -3px; width: 2px; background: rgba(255, 255, 255, 0.7); }
.wg-meter-sub { display: block; margin-top: 4px; font-size: 12px; color: var(--wg-muted); }

/* rating badge: a ring filled to the rating */
.wg-rating {
  --ring: var(--wg-ice);
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: conic-gradient(var(--ring) calc(var(--wg-rating, 0) * 1%), rgba(255, 255, 255, 0.12) 0);
}
.wg-rating::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #0d1628; }
.wg-rating-num { position: relative; font-family: var(--wg-font-cond); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.wg-rating[data-tier='low'] { --ring: #e07a52; }
.wg-rating[data-tier='high'] { --ring: var(--wg-green); }
.wg-rating[data-tier='elite'] { --ring: var(--wg-gold); }
.wg-rating-s { width: 32px; height: 32px; }
.wg-rating-s::before { inset: 3px; }
.wg-rating-s .wg-rating-num { font-size: 14px; }
.wg-rating-l { width: 62px; height: 62px; }
.wg-rating-l::before { inset: 5px; }
.wg-rating-l .wg-rating-num { font-size: 25px; }

/* athlete kit badge: helmet + suit silhouette in the athlete's colours */
.wg-kit { position: relative; display: inline-block; flex: none; width: 34px; height: 42px; }
.wg-kit-s { width: 24px; height: 30px; }
.wg-kit-l { width: 54px; height: 66px; }
.wg-kit-helmet {
  position: absolute;
  left: 31%;
  width: 38%;
  top: 0;
  height: 30%;
  border-radius: 50% 50% 42% 42%;
  background: var(--helmet);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.wg-kit-body {
  position: absolute;
  left: 10%;
  right: 10%;
  top: 33%;
  bottom: 0;
  border-radius: 42% 42% 14% 14% / 30% 30% 10% 10%;
  background: var(--suit);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}
.wg-kit[data-pattern='stripes'] .wg-kit-body { background: linear-gradient(90deg, var(--suit) 0 26%, var(--accent) 26% 38%, var(--suit) 38% 62%, var(--accent) 62% 74%, var(--suit) 74%); }
.wg-kit[data-pattern='chevron'] .wg-kit-body {
  background:
    linear-gradient(to bottom right, transparent 44%, var(--accent) 44% 60%, transparent 60%) left / 50% 100% no-repeat,
    linear-gradient(to bottom left, transparent 44%, var(--accent) 44% 60%, transparent 60%) right / 50% 100% no-repeat,
    var(--suit);
}
.wg-kit[data-pattern='split'] .wg-kit-body { background: linear-gradient(90deg, var(--suit) 50%, var(--accent) 50%); }
.wg-kit[data-pattern='sash'] .wg-kit-body { background: linear-gradient(120deg, var(--suit) 36%, var(--accent) 36% 56%, var(--suit) 56%); }
.wg-kit[data-pattern='panels'] .wg-kit-body { background: linear-gradient(90deg, var(--accent) 0 20%, var(--suit) 20% 80%, var(--accent) 80%); }

/* colour swatches */
.wg-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.wg-swatch-btn {
  pointer-events: auto;
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: var(--sw, #888);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s;
}
.wg-ui.is-touch .wg-swatch-btn { width: 44px; height: 44px; }
.wg-swatch-btn:hover { transform: scale(1.07); }
.wg-swatch-btn.is-light { border-color: rgba(0, 0, 0, 0.35); }
.wg-swatch-btn.is-default { background: linear-gradient(135deg, #18212d, #7d95b2 45%, #263444 56%, #0b1119); }
.wg-swatch-btn.is-on { box-shadow: 0 0 0 3px #0b1424, 0 0 0 5px var(--wg-ice); }
.wg-swatch-custom {
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(var(--sw, transparent), var(--sw, transparent)), conic-gradient(#ff4b5c, #ffbe3b, #34d17f, #5cc8ff, #2f7cff, #b066ff, #ff4b5c);
}
.wg-swatch-custom .wg-icon { position: relative; width: 18px; height: 18px; stroke: #fff; stroke-width: 3; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); pointer-events: none; }
.wg-color-input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }

/* venue theme art (SVG horizon on the hill cards) */
.wg-theme-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.wg-theme-art.is-day { background: linear-gradient(180deg, #4f97d6 0%, #a9d3f2 70%, #d9ebf7 100%); }
.wg-theme-art.is-dusk { background: linear-gradient(180deg, #3b2f6e 0%, #b9587a 55%, #f2a66b 100%); }
.wg-theme-art.is-night { background: radial-gradient(40% 50% at 78% 22%, rgba(255, 255, 255, 0.18), transparent 60%), linear-gradient(180deg, #050b1c 0%, #142449 100%); }
.wg-art-far { fill: rgba(84, 110, 140, 0.75); }
.wg-art-trees { fill: #1d3b33; }
.wg-art-sea { fill: #2d6ea3; }
.wg-art-hill { fill: #e9f1f8; stroke: rgba(0, 0, 0, 0.12); stroke-width: 0.5; }
.wg-art-snow { fill: #f4f8fb; }
.wg-art-ramp { fill: none; stroke: #f4f8fb; stroke-width: 2.2; stroke-linecap: round; }
.wg-art-tower { fill: none; stroke: rgba(30, 44, 64, 0.85); stroke-width: 1; }
.is-dusk .wg-art-ramp { stroke: #f6e3da; }
.is-night .wg-art-ramp { stroke: #e6eef8; filter: drop-shadow(0 0 3px rgba(255, 244, 214, 0.7)); }
.is-night .wg-art-tower { stroke: rgba(150, 170, 200, 0.6); }
.is-dusk .wg-art-far { fill: rgba(70, 52, 96, 0.8); }
.is-dusk .wg-art-trees { fill: #241c33; }
.is-dusk .wg-art-hill { fill: #f2d9cf; }
.is-dusk .wg-art-snow { fill: #f6e3da; }
.is-night .wg-art-far { fill: rgba(40, 56, 88, 0.9); }
.is-night .wg-art-trees { fill: #0b1620; }
.is-night .wg-art-sea { fill: #10284a; }
.is-night .wg-art-hill { fill: #cfe0f2; filter: drop-shadow(0 0 4px rgba(255, 244, 214, 0.55)); }
.is-night .wg-art-snow { fill: #b8c9dd; }

/* difficulty chip */
.wg-diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--wg-text);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wg-diff-chip.is-easy { background: var(--wg-green-deep); color: #fff; }
.wg-diff-chip.is-normal { background: var(--wg-blue); color: #fff; }
.wg-diff-chip.is-pro { background: #c92a3b; color: #fff; }
.wg-diff-chip-lg {
  pointer-events: auto;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 14px;
  box-shadow: var(--wg-shadow);
}
button.wg-diff-chip-lg { min-height: 44px; cursor: pointer; }
.wg-diff-chip-k { font-weight: 600; opacity: 0.8; letter-spacing: 0.16em; }

/* ------------------------------------------------------------------ hub */
.wg-hub {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 440px);
  grid-template-rows: auto 1fr auto;
  column-gap: clamp(16px, 4vw, 64px);
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(5, 10, 20, 0.8) 0%, rgba(5, 10, 20, 0.3) 52%, rgba(5, 10, 20, 0.62) 100%),
    linear-gradient(180deg, rgba(5, 10, 20, 0) 60%, rgba(5, 10, 20, 0.6));
}
.wg-hub-top {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  min-height: 44px;
  padding-top: calc(var(--wg-sp) + env(safe-area-inset-top, 0px));
}
.wg-hub-hero { grid-column: 1; grid-row: 2; align-self: center; animation: wg-slide-in-left 0.6s var(--wg-ease) both; }
.wg-hub-list { grid-column: 2; grid-row: 2; align-self: center; display: flex; flex-direction: column; gap: 8px; padding: 12px 0; }
.wg-hub-foot { grid-column: 1 / -1; grid-row: 3; padding: 8px 0 calc(var(--wg-sp) + env(safe-area-inset-bottom, 0px)); }
.wg-hub-item {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--wg-line);
  background: var(--wg-glass-strong);
  box-shadow: var(--wg-shadow);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
  animation: wg-slide-in-right 0.5s var(--wg-ease) both;
  animation-delay: calc(0.05s + var(--i, 0) * 0.05s);
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--wg-ease);
}
.wg-hub-item:hover:not(:disabled) { border-color: rgba(92, 200, 255, 0.6); transform: translateX(-3px); }
.wg-hub-item:disabled { opacity: 0.45; cursor: default; }
.wg-hub-item.is-featured {
  background: linear-gradient(100deg, rgba(47, 124, 255, 0.55), rgba(14, 24, 42, 0.94) 70%);
  box-shadow: var(--wg-shadow), inset 4px 0 0 var(--wg-red);
}
.wg-hub-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: rgba(92, 200, 255, 0.13);
  color: var(--wg-ice);
}
.wg-hub-item.is-featured .wg-hub-icon { background: rgba(255, 255, 255, 0.16); color: #fff; }
.wg-hub-icon .wg-icon { width: 24px; height: 24px; }
.wg-hub-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.wg-hub-label {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.05;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.wg-hub-sub { font-size: 13px; color: var(--wg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-hub-item.is-featured .wg-hub-sub { color: #d6e2f0; }
.wg-hub-chev { color: var(--wg-dim); }

/* ------------------------------------------------------------------ venue select */
.wg-venue-groups { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 28px; }
.wg-venue-group { flex: 0 1 auto; min-width: 0; max-width: 100%; }
.wg-group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.wg-group-title::before { content: ''; align-self: center; width: 4px; height: 18px; border-radius: 2px; background: var(--wg-red); }
.wg-group-meta { font-size: 14px; letter-spacing: 0.08em; color: var(--wg-muted); }
.wg-venue-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.wg-venue-grid > .wg-venue-card { flex: 0 0 232px; width: 232px; }
.wg-venue-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--wg-line);
  background: linear-gradient(180deg, rgba(16, 26, 45, 0.95), rgba(9, 15, 28, 0.95));
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
  animation: wg-pop 0.4s var(--wg-ease) both;
  animation-delay: calc(var(--i, 0) * 0.03s);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--wg-ease);
}
.wg-venue-card:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
.wg-venue-card.is-on { border-color: var(--wg-ice); box-shadow: 0 0 0 2px var(--wg-ice), 0 12px 28px rgba(92, 200, 255, 0.2); }
.wg-venue-art { position: relative; display: block; flex: none; height: 88px; overflow: hidden; }
.wg-venue-type {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(6, 12, 24, 0.78);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wg-venue-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px 12px 12px; }
.wg-venue-where { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--wg-muted); }
.wg-venue-where .wg-nation-code { display: none; }
.wg-venue-country { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-venue-name {
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-venue-stats { display: flex; gap: 6px; }
.wg-venue-stat { display: flex; flex-direction: column; min-width: 44px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.wg-venue-stat-k { font-family: var(--wg-font-cond); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wg-muted); }
.wg-venue-stat-v { font-family: var(--wg-font-cond); font-weight: 700; font-size: 18px; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-venue-stat.is-pb .wg-venue-stat-v { color: var(--wg-ice); }
.wg-venue-record {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: var(--wg-muted);
}
.wg-venue-record-k { font-family: var(--wg-font-cond); font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.wg-venue-record-v { font-family: var(--wg-font-cond); font-weight: 700; font-size: 16px; color: var(--wg-text); }
.wg-venue-record-who { display: flex; align-items: baseline; gap: 6px; min-width: 0; max-width: 100%; overflow: hidden; }
.wg-venue-record-who .wg-name { min-width: 0; }
.wg-venue-record-nat { flex: none; font-family: var(--wg-font-cond); font-weight: 700; letter-spacing: 0.08em; }
.wg-foot-tod .wg-seg-btn { min-width: 76px; }

/* ------------------------------------------------------------------ athlete select */
.wg-ath-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.wg-ath-listcol { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wg-ath-tools-bar {
  position: sticky;
  top: -4px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 8px;
  background: #070d19;
  box-shadow: 0 6px 10px -6px rgba(0, 0, 0, 0.6);
}
.wg-ath-sort .wg-field-label { display: none; }
.wg-tabs-sm { flex: 1 1 380px; max-width: 500px; grid-template-columns: repeat(var(--n, 3), minmax(min-content, auto)); }
.wg-tabs-sm .wg-tab { font-size: 15px; letter-spacing: 0.05em; padding: 0 10px; }
.wg-ath-sort { flex: 0 1 300px; }
.wg-ath-list { display: flex; flex-direction: column; gap: 6px; }
.wg-ath-create {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(92, 200, 255, 0.55);
  background: rgba(92, 200, 255, 0.07);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
}
.wg-ath-create:hover { background: rgba(92, 200, 255, 0.14); }
.wg-ath-create-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--wg-ice); color: #06121f; flex: none; }
.wg-ath-create-text { display: flex; flex-direction: column; min-width: 0; }
.wg-ath-create-label { font-family: var(--wg-font-cond); font-weight: 800; font-size: 18px; letter-spacing: 0.06em; text-transform: uppercase; }
.wg-ath-create-sub { font-size: 13px; color: var(--wg-muted); }
.wg-ath-row {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--wg-line);
  background: rgba(13, 22, 39, 0.9);
  animation: wg-row-in 0.35s var(--wg-ease) both;
  animation-delay: calc(var(--i, 0) * 0.02s);
}
.wg-ath-row.is-on { border-color: var(--wg-ice); background: linear-gradient(90deg, rgba(92, 200, 255, 0.18), rgba(13, 22, 39, 0.92) 60%); box-shadow: inset 3px 0 0 var(--wg-ice); }
.wg-ath-main {
  pointer-events: auto;
  flex: 1;
  min-width: 0;
  min-height: 62px;
  display: grid;
  grid-template-columns: auto minmax(150px, 0.8fr) minmax(0, 1.6fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  background: none;
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
}
.wg-ath-main:hover { background: rgba(255, 255, 255, 0.04); }
.wg-ath-who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wg-ath-name { font-size: 17px; }
.wg-ath-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0; font-size: 13px; color: var(--wg-muted); }
.wg-ath-bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wg-ath-rowtools { display: flex; flex-direction: column; justify-content: center; border-left: 1px solid rgba(255, 255, 255, 0.07); }
.wg-ath-rowtools .wg-icon-btn { border: 0; border-radius: 0; flex: 1; min-height: 31px; }
.wg-ath-detail { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.wg-ath-dtop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.wg-ath-dwho { display: flex; flex-direction: column; gap: 5px; min-width: 0; align-items: flex-start; }
.wg-ath-dname { font-size: 22px; white-space: normal; line-height: 1.1; }
.wg-ath-country { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-ath-dbars { display: flex; flex-direction: column; gap: 10px; }
.wg-ath-dattr .wg-attr { grid-template-columns: minmax(0, 1fr) 32px; grid-template-areas: 'label num' 'bar bar'; gap: 4px 8px; }
.wg-ath-dattr .wg-attr-label { grid-area: label; font-weight: 600; }
.wg-ath-dattr .wg-attr-num { grid-area: num; }
.wg-ath-dattr .wg-attr-bar { grid-area: bar; }
.wg-ath-dattr .wg-attr-delta { display: none; }
.wg-foot-create .wg-icon,
.wg-foot-random .wg-icon { width: 18px; height: 18px; }

/* ------------------------------------------------------------------ athlete creator */
.wg-creator.wg-scr {
  display: grid;
  grid-template-columns: minmax(0, 40fr) minmax(0, 60fr);
  padding: 0;
  background: none; /* the stage is transparent: the integrator renders the 3D athlete there */
}
.wg-stage { position: relative; min-width: 0; min-height: 0; pointer-events: none; }
.wg-stage.is-draggable { pointer-events: auto; cursor: grab; touch-action: pan-y; }
.wg-stage.is-dragging { cursor: grabbing; }
.wg-stage-corner { position: absolute; width: 26px; height: 26px; border: 0 solid rgba(255, 255, 255, 0.55); }
.wg-stage-corner.is-tl { left: 18px; top: calc(18px + env(safe-area-inset-top, 0px)); border-left-width: 3px; border-top-width: 3px; }
.wg-stage-corner.is-tr { right: 18px; top: calc(18px + env(safe-area-inset-top, 0px)); border-right-width: 3px; border-top-width: 3px; }
.wg-stage-corner.is-bl { left: 18px; bottom: 18px; border-left-width: 3px; border-bottom-width: 3px; }
.wg-stage-corner.is-br { right: 18px; bottom: 18px; border-right-width: 3px; border-bottom-width: 3px; }
/* framing box for the 3D athlete (ui.getPreviewRect): below the view toggle, above the plate */
.wg-stage-frame { position: absolute; left: 18px; right: 18px; top: calc(80px + env(safe-area-inset-top, 0px)); bottom: 98px; pointer-events: none; }
.wg-stage-view { position: absolute; left: 50%; top: calc(20px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); width: min(280px, calc(100% - 100px)); }
.wg-stage-view .wg-seg { flex-wrap: nowrap; padding: 3px; border-radius: 10px; background: rgba(6, 12, 24, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.wg-stage-view .wg-seg-btn { border-color: transparent; background: transparent; }
.wg-stage-view .wg-seg-btn.is-on { background: rgba(92, 200, 255, 0.22); }
.wg-stage-plate {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 420px;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--wg-ice);
  background: var(--wg-glass-strong);
  box-shadow: var(--wg-shadow);
  box-sizing: border-box;
}
.wg-stage-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.wg-stage-name { font-size: 19px; line-height: 1.1; }
.wg-stage-who .wg-nation { font-size: 13px; color: var(--wg-muted); }
.wg-stage-hint {
  position: absolute;
  right: 30px;
  top: calc(66px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.wg-stage-hint .wg-icon { width: 18px; height: 18px; }
.wg-creator-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0 max(var(--wg-sp), env(safe-area-inset-right, 0px)) 0 var(--wg-sp);
  border-left: 1px solid var(--wg-line);
  background: linear-gradient(180deg, rgba(14, 23, 40, 0.97), rgba(7, 12, 23, 0.97));
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.3);
  animation: wg-slide-in-right 0.45s var(--wg-ease) both;
}
.wg-creator-panel > .wg-tabs { flex: none; margin-bottom: 10px; grid-template-columns: repeat(var(--n, 3), minmax(min-content, auto)); }
.wg-creator-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 6px 6px 16px; margin: 0 -6px; scrollbar-width: thin; }
.wg-pane { display: flex; flex-direction: column; gap: 16px; }
.wg-pane-sub { margin: 4px 0 -4px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.wg-nation-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.wg-nation-btn { justify-content: center; padding: 4px 8px; }
.wg-nation-btn .wg-nation { font-size: 14px; }
.wg-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.wg-part-dot { width: 16px; height: 16px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.45); }
.wg-part-palette { padding: 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); }
.wg-choice .wg-kit { margin: -2px 0; }
.wg-foot-reason {
  pointer-events: auto;
  flex: 1 1 160px;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--wg-amber);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-foot-reason::before { content: '● '; }
.wg-foot-reason.is-ok { color: var(--wg-green); cursor: default; }
.wg-creator .wg-foot-go { min-width: 190px; }
/* attribute allocation */
.wg-points {
  position: sticky;
  top: -4px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--wg-line);
  background: rgba(8, 14, 26, 0.96);
}
.wg-points-main { display: flex; flex-direction: column; }
.wg-points-num { font-family: var(--wg-font-cond); font-weight: 800; font-size: 40px; line-height: 1; color: var(--wg-amber); font-variant-numeric: tabular-nums; }
.wg-points-num.is-done { color: var(--wg-green); }
.wg-points-num.is-over { color: var(--wg-red); }
.wg-points-meter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wg-points-track { height: 8px; border-radius: 4px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.wg-points-fill { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--wg-blue), var(--wg-ice)); transition: width 0.2s var(--wg-ease); }
.wg-points-rule { font-size: 12.5px; color: var(--wg-muted); }
.wg-alloc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'text step' 'bar bar';
  align-items: center;
  gap: 8px 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.wg-alloc-text { grid-area: text; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wg-alloc-name { font-weight: 600; font-size: 16px; }
.wg-alloc-desc { font-size: 12.5px; line-height: 1.35; color: var(--wg-muted); }
.wg-alloc .wg-stepper { grid-area: step; }
.wg-alloc .wg-step-val { font-size: 24px; min-width: 38px; }
.wg-alloc-bar { grid-area: bar; grid-template-columns: minmax(0, 1fr); }
.wg-alloc-bar .wg-attr-label,
.wg-alloc-bar .wg-attr-num,
.wg-alloc-bar .wg-attr-delta { display: none; }
.wg-alloc-bar .wg-attr-bar { height: 10px; }
.wg-alloc-bar { padding-bottom: 14px; }
/* allowed range labels under the band ends (the band is min..max of the allocation) */
.wg-alloc-bar .wg-attr-band::before,
.wg-alloc-bar .wg-attr-band::after {
  position: absolute;
  top: calc(100% + 2px);
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  color: var(--wg-muted);
  font-variant-numeric: tabular-nums;
}
.wg-alloc-bar .wg-attr-band::before { content: attr(data-lo); left: 0; transform: translateX(-50%); }
.wg-alloc-bar .wg-attr-band::after { content: attr(data-hi); right: 0; transform: translateX(50%); }

/* ------------------------------------------------------------------ season calendar */
.wg-cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.wg-cal-list .wg-progress { margin-bottom: 12px; }
.wg-cal-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wg-cal-ev {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 12px 6px 8px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.035);
  animation: wg-row-in 0.35s var(--wg-ease) both;
  animation-delay: calc(var(--i, 0) * 0.03s);
}
.wg-cal-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 16px;
}
.wg-cal-ev.is-done .wg-cal-num { background: rgba(52, 209, 127, 0.18); color: var(--wg-green); }
.wg-cal-ev.is-next { border-color: var(--wg-ice); background: rgba(92, 200, 255, 0.1); }
.wg-cal-ev.is-next .wg-cal-num { background: var(--wg-ice); color: #06121f; }
.wg-cal-ev.is-pending { opacity: 0.8; }
.wg-cal-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wg-cal-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wg-cal-date { flex: none; min-width: 46px; font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wg-muted); }
.wg-cal-top .wg-nation-code,
.wg-cal-winner .wg-nation-code,
.wg-next-venue .wg-nation-code { display: none; }
.wg-cal-venue {
  min-width: 0;
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-cal-hill { font-size: 13px; color: var(--wg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wg-cal-res { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; max-width: 230px; text-align: right; }
.wg-cal-winner { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 14px; }
.wg-cal-winner .wg-name { min-width: 0; }
.wg-cal-trophy { width: 16px; height: 16px; color: var(--wg-gold); }
.wg-cal-you { font-family: var(--wg-font-cond); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; color: var(--wg-ice); }
.wg-cal-you.is-podium { color: var(--wg-gold); }
.wg-cal-pending { font-size: 13px; color: var(--wg-dim); }
.wg-cal-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 16px; }
.wg-next {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  border-left: 4px solid var(--wg-red);
  background: linear-gradient(130deg, rgba(47, 124, 255, 0.4), rgba(12, 20, 36, 0.94) 62%);
}
.wg-next.is-complete { border-left-color: var(--wg-gold); }
.wg-next-venue { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wg-next-venue .wg-flag { width: 30px; height: 20px; }
.wg-next-name {
  min-width: 0;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 32px;
  line-height: 1.02;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-next-country { font-size: 14px; color: var(--wg-muted); }
.wg-next-hill { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wg-next-type { margin-right: 4px; font-family: var(--wg-font-cond); font-weight: 700; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wg-ice); }
.wg-next-go { align-self: flex-start; margin-top: 8px; }
.wg-mini-board .wg-table td { padding: 6px 8px; font-size: 14px; }
.wg-mini-board .wg-nation-code { display: none; }
.wg-table td.c-name .wg-mini-nat, .wg-mini-board .wg-table td.c-name .wg-nation { min-width: 0; }
@media (min-width: 901px) {
  .wg-calendar .wg-scr-body { overflow: hidden; display: flex; flex-direction: column; }
  .wg-calendar .wg-cal-layout { flex: 1 1 auto; min-height: 0; align-items: stretch; }
  .wg-calendar .wg-cal-list { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
  .wg-calendar .wg-cal-events { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 2px; margin: -2px; scrollbar-width: thin; }
  .wg-calendar .wg-cal-side { min-height: 0; overflow: auto; }
}
.wg-mini-board .wg-table .c-pts { font-size: 16px; }
.wg-table-wrap.is-static { overflow: visible; border: 0; }
.wg-table-wrap.is-static .wg-table th { position: static; background: transparent; }

/* ------------------------------------------------------------------ standings & results */
.wg-cup .wg-scr-body,
.wg-results .wg-scr-body { display: flex; flex-direction: column; overflow: hidden; }
.wg-table-card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 6px; }
.wg-scr-table { flex: 1 1 auto; border: 0; }
.wg-table th.c-delta,
.wg-table td.c-delta { width: 42px; text-align: center; padding-left: 2px; padding-right: 2px; }
.wg-delta { display: inline-flex; align-items: center; gap: 2px; font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; }
.wg-delta.is-up { color: var(--wg-green); }
.wg-delta.is-down { color: #ff7b89; }
.wg-delta.is-same { color: var(--wg-dim); }
.wg-delta-arrow { font-size: 10px; }
.wg-table .c-gap,
.wg-table .c-num,
.wg-table .c-cup { text-align: right; font-family: var(--wg-font-cond); font-size: 16px; font-weight: 600; }
.wg-table th.c-gap,
.wg-table th.c-num,
.wg-table th.c-cup { font-size: 12px; }
.wg-table td.c-gap { color: var(--wg-muted); }
.wg-table td.c-name { text-align: left; }
.wg-table .is-fell { color: var(--wg-red); }
.wg-cup-pts { display: inline-block; padding: 1px 8px; border-radius: 5px; background: rgba(92, 200, 255, 0.16); color: var(--wg-ice); font-family: var(--wg-font-cond); font-weight: 800; font-size: 15px; }
.wg-table tr.is-player .wg-cup-pts { background: var(--wg-ice); color: #06121f; }
.wg-podium {
  flex: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  width: 100%;
  max-width: 660px;
  margin: 0 auto 14px;
}
.wg-podium-step {
  --c: var(--wg-silver);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 12px 8px;
  border-radius: 10px 10px 4px 4px;
  border-top: 4px solid var(--c);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.03));
  animation: wg-rise 0.5s var(--wg-ease) both;
}
.wg-podium-step.is-p1 { --c: var(--wg-gold); padding-top: 26px; animation-delay: 0.2s; }
.wg-podium-step.is-p2 { padding-top: 16px; animation-delay: 0.1s; }
.wg-podium-step.is-p3 { --c: var(--wg-bronze); }
.wg-podium-step.is-player { box-shadow: 0 0 0 2px var(--wg-ice); }
.wg-podium-rank { font-family: var(--wg-font-cond); font-weight: 800; font-size: 34px; line-height: 1; color: var(--c); }
.wg-podium-name { max-width: 100%; font-size: 16px; }
.wg-podium-step .wg-nation { font-size: 13px; color: var(--wg-muted); }
.wg-podium-pts { font-family: var(--wg-font-cond); font-weight: 700; font-size: 15px; color: var(--wg-muted); }
.wg-podium.is-steps-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 460px; }
.wg-podium.is-steps-1 { grid-template-columns: minmax(0, 1fr); max-width: 260px; }
.wg-podium-who { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; max-width: 100%; }
.wg-podium-rankrow { display: flex; align-items: center; gap: 6px; }
.wg-podium-step.is-tied { gap: 4px; }
.wg-podium-step.is-p2.is-tied,
.wg-podium-step.is-p3.is-tied { padding-top: 6px; }
/* tied athletes: one compact line each (flag + name) so a shared step stays podium-sized */
.wg-podium-step.is-tied .wg-podium-who { flex-direction: row; justify-content: center; gap: 5px; }
.wg-podium-step.is-tied .wg-podium-who .wg-nation { order: -1; flex: none; }
.wg-podium-step.is-tied .wg-podium-who .wg-nation-code { display: none; }
.wg-podium-step.is-tied .wg-podium-name { font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg-podium-tie { padding: 0 6px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); font-family: var(--wg-font-cond); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wg-text); }
.wg-podium-who.is-me .wg-podium-name { color: var(--wg-ice); }
/* round distances under the name: only when the round columns are hidden (phones) */
.wg-res-dists { display: none; }

/* ------------------------------------------------------------------ career hub */
.wg-career-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.wg-career-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wg-car-history { grid-column: 1 / -1; }
.wg-car-who { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.wg-car-whotext { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.wg-car-name { font-size: 22px; line-height: 1.1; white-space: normal; }
.wg-car-tier { margin-top: 14px; }
.wg-car-tier-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.wg-tier-badge {
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--wg-blue);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.wg-tier-badge.is-world { background: linear-gradient(180deg, #ffe27a, var(--wg-gold)); color: #1d1606; }
.wg-tier-badge.is-continental { background: #1f8a8a; }
.wg-car-rank { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.wg-car-rank-main { display: flex; flex-direction: column; }
.wg-car-rank-num { font-family: var(--wg-font-cond); font-weight: 800; font-size: 42px; line-height: 1; }
.wg-car-rank-stats { display: flex; gap: 16px; }
.wg-car-stat { display: flex; flex-direction: column; align-items: flex-end; }
.wg-car-stat-v { font-family: var(--wg-font-cond); font-weight: 800; font-size: 22px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-car-stat-k { font-family: var(--wg-font-cond); font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wg-muted); }
.wg-car-next .wg-actions { margin-top: 10px; }
.wg-train-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.wg-train {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--wg-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.wg-train:hover:not(:disabled) { border-color: var(--wg-ice); background: rgba(92, 200, 255, 0.08); }
.wg-train.is-rec { border-color: rgba(242, 196, 67, 0.6); background: rgba(242, 196, 67, 0.07); }
.wg-train:disabled { opacity: 0.5; cursor: default; }
.wg-train-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wg-train-name { font-family: var(--wg-font-cond); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; text-transform: uppercase; }
.wg-train-desc { font-size: 12.5px; line-height: 1.35; color: var(--wg-muted); }
.wg-train-fx { display: flex; flex-wrap: wrap; gap: 4px; }
.wg-fx { padding: 1px 6px; border-radius: 4px; font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.02em; white-space: nowrap; }
.wg-fx.is-up { background: rgba(52, 209, 127, 0.16); color: var(--wg-green); }
.wg-fx.is-cost { background: rgba(255, 75, 92, 0.14); color: #ff8f9a; }
.wg-car-train .wg-note { margin-bottom: 10px; }
.wg-car-attrs .wg-attr + .wg-attr { margin-top: 8px; }
.wg-car-attrs .wg-card-sub { margin: 10px 0 0; }
.wg-goals,
.wg-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wg-goals li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; line-height: 1.35; }
.wg-goal-box { display: grid; place-items: center; flex: none; width: 20px; height: 20px; box-sizing: border-box; border-radius: 5px; border: 2px solid rgba(255, 255, 255, 0.35); }
.wg-goal-box .wg-icon { width: 14px; height: 14px; stroke-width: 3; }
.wg-goals li.is-done .wg-goal-box { background: var(--wg-green); border-color: var(--wg-green); color: #04210f; }
.wg-goals li.is-done .wg-goal-text { color: var(--wg-muted); }
.wg-log li { position: relative; padding-left: 14px; font-size: 13.5px; line-height: 1.4; color: #d6e2f0; }
.wg-log li::before { content: ''; position: absolute; left: 2px; top: 0.55em; width: 5px; height: 5px; border-radius: 50%; background: var(--wg-ice); }
.wg-hist-table td.c-name { max-width: none; width: auto; }

/* ------------------------------------------------------------------ settings */
.wg-diff-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.wg-diff-card {
  --c: var(--wg-blue);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--wg-line);
  border-top: 4px solid var(--c);
  background: rgba(255, 255, 255, 0.04);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.wg-diff-card.is-easy { --c: var(--wg-green); }
.wg-diff-card.is-pro { --c: var(--wg-red); }
.wg-diff-card:hover { background: rgba(255, 255, 255, 0.08); }
.wg-diff-card.is-on { border-color: var(--c); background: rgba(255, 255, 255, 0.09); box-shadow: 0 0 0 1px var(--c), 0 10px 26px rgba(0, 0, 0, 0.3); }
.wg-diff-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wg-diff-card-name { font-family: var(--wg-font-cond); font-weight: 800; font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; }
.wg-diff-card-check { display: grid; place-items: center; width: 26px; height: 26px; box-sizing: border-box; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.3); color: transparent; }
.wg-diff-card-check .wg-icon { width: 16px; height: 16px; stroke-width: 3; }
.wg-diff-card.is-on .wg-diff-card-check { background: var(--c); border-color: var(--c); color: #06121f; }
.wg-diff-card-desc { font-size: 13.5px; line-height: 1.4; color: #d6e2f0; }
.wg-diff-card-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--wg-muted); }
.wg-set-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.wg-set-cols .wg-card { display: flex; flex-direction: column; gap: 14px; }
.wg-set-cols .wg-card-head { margin-bottom: 0; }
.wg-set-cols .wg-card > .wg-btn { align-self: flex-start; }

/* ------------------------------------------------------------------ dialogs */
.wg-dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: 100%;
  overflow: auto;
  box-sizing: border-box;
  padding: 22px;
  animation: wg-pop 0.3s var(--wg-ease) both;
}
.wg-dialog-title { font-size: 26px; margin-bottom: 6px; }
.wg-dialog-text { margin: 6px 0; font-size: 15px; line-height: 1.5; color: #d6e2f0; }
.wg-dialog-lines .wg-dialog-text { animation: wg-row-in 0.4s var(--wg-ease) both; animation-delay: calc(0.25s + var(--i, 0) * 0.08s); }
.wg-confirm.is-danger { border-top: 3px solid var(--wg-red); }
.wg-message { --c: var(--wg-blue); text-align: center; border-top: 4px solid var(--c); overflow: visible; }
.wg-message.is-promotion { --c: var(--wg-green); }
.wg-message.is-relegation { --c: var(--wg-red); }
.wg-message.is-season { --c: var(--wg-ice); }
.wg-message.is-trophy { --c: var(--wg-gold); }
.wg-emblem {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin: 2px auto 14px;
  border-radius: 50%;
  background: var(--c);
  color: #06121f;
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.06), 0 0 42px var(--c);
  animation: wg-pop 0.5s var(--wg-ease) both;
}
.wg-emblem .wg-icon { width: 42px; height: 42px; stroke-width: 2.2; }
.wg-spark {
  position: absolute;
  left: calc(50% - 3px);
  top: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
  opacity: 0;
  animation: wg-spark 1.3s ease-out 0.2s 2 both;
}

/* ------------------------------------------------------------------ HUD: phase-2 cues */
.wg-bug-info { align-items: center; }
.wg-bug-info .wg-diff-chip { letter-spacing: 0.12em; }
.wg-slowmo {
  position: absolute;
  top: calc(var(--wg-sp) + 4px);
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(92, 200, 255, 0.6);
  background: rgba(8, 14, 26, 0.75);
  color: var(--wg-ice);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translate(-50%, -8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.25s var(--wg-ease), visibility 0.2s;
}
.wg-slowmo.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.wg-slowmo-icon {
  position: relative;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid currentColor;
}
.wg-slowmo-icon::after {
  /* a clock hand turning slowly */
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 2px;
  height: 5px;
  border-radius: 1px;
  background: currentColor;
  transform-origin: 1px 4px;
  animation: wg-spin 2.4s linear infinite;
}
.wg-attack-head { display: flex; align-items: center; justify-content: center; gap: 8px; }
.wg-assist-tag {
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(92, 200, 255, 0.22);
  color: var(--wg-ice);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
}
.wg-attack.is-assist .wg-assist-tag { opacity: 1; }
.wg-attack.is-assist {
  border-color: rgba(92, 200, 255, 0.55);
  box-shadow: var(--wg-shadow), 0 0 calc(8px + var(--wg-assist) * 26px) rgba(92, 200, 255, 0.45);
}
.wg-attack.is-good { border-color: rgba(52, 209, 127, 0.5); }
.wg-attack-foot { display: flex; align-items: baseline; justify-content: center; gap: 10px; min-height: 26px; }
.wg-attack-advice { font-family: var(--wg-font-cond); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wg-amber); }
.wg-attack-advice.is-empty { display: none; }
.wg-gauge-trend { opacity: 0; transition: opacity 0.15s; }
.wg-gauge-trend.is-on { opacity: 1; }
.wg-gauge-trend path:first-child { fill: none; stroke: var(--wg-green); stroke-width: 3; stroke-linecap: round; }
.wg-gauge-trend path:last-child { fill: var(--wg-green); }
.wg-gauge-trend.is-away path:first-child { stroke: var(--wg-amber); }
.wg-gauge-trend.is-away path:last-child { fill: var(--wg-amber); }

.wg-cue {
  display: none;
  box-sizing: border-box;
  width: 100%;
  padding: 7px 14px 18px;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.wg-cue.is-on { display: block; animation: wg-rise 0.25s var(--wg-ease) both; }
.wg-cue-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.wg-cue-status { font-family: var(--wg-font-cond); font-weight: 800; font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.wg-cue-track { position: relative; height: 16px; margin-top: 6px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); }
.wg-cue-zone { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.wg-cue-zone.is-window { background: rgba(255, 255, 255, 0.16); }
.wg-cue-zone.is-good { background: rgba(255, 190, 59, 0.6); }
.wg-cue-zone.is-perfect { background: rgba(52, 209, 127, 0.9); }
.wg-cue-beat { position: absolute; top: 4px; bottom: 4px; width: 2px; margin-left: -1px; border-radius: 1px; background: rgba(255, 255, 255, 0.45); }
.wg-cue-beat.is-past { background: var(--wg-ice); }
.wg-cue-edge { position: absolute; top: -5px; bottom: -5px; width: 3px; margin-left: -1.5px; border-radius: 2px; background: #fff; }
.wg-cue-edge::after {
  content: attr(data-label);
  position: absolute;
  top: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--wg-font-cond);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--wg-muted);
}
.wg-cue-landing .wg-cue-edge::after { left: auto; right: 0; transform: none; }
.wg-cue-marker {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 10px rgba(255, 255, 255, 0.6);
  transition: background 0.06s, transform 0.08s;
}
.wg-cue.in-perfect { border-color: rgba(52, 209, 127, 0.8); box-shadow: var(--wg-shadow), 0 0 22px rgba(52, 209, 127, 0.45); }
.wg-cue.in-perfect .wg-cue-marker { background: var(--wg-green); transform: scale(1.3); box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45), 0 0 16px var(--wg-green); }
.wg-cue.in-perfect .wg-cue-status { color: var(--wg-green); }
.wg-cue.in-good .wg-cue-marker { background: var(--wg-amber); transform: scale(1.15); }
.wg-cue.in-good .wg-cue-status { color: var(--wg-amber); }
.wg-cue.in-window .wg-cue-status { color: #d6e2f0; }
.wg-cue-takeoff:not(.is-armed) { opacity: 0.65; }
.wg-cue.is-prepared .wg-cue-marker { background: var(--wg-green); }
.wg-cue.is-prepared .wg-cue-status { color: var(--wg-green); }
.wg-cue.is-early .wg-cue-marker { background: var(--wg-amber); }
.wg-cue.is-early .wg-cue-status { color: var(--wg-amber); }

/* timing feedback under the flash */
.wg-timing {
  box-sizing: border-box;
  width: min(330px, 82vw);
  padding: 8px 12px 6px;
  border-radius: 10px;
  border: 1px solid var(--wg-line);
  background: rgba(8, 14, 26, 0.66);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.3s var(--wg-ease), visibility 0.25s;
}
.wg-timing.is-on { opacity: 1; visibility: visible; transform: none; }
/* Phones in portrait with touch controls: the right-hand column holds the instruments and
   the readout, so the flash sits in the gap between them and the timing bar / landing cue
   go to the free left-hand column. */
@media (max-width: 520px) {
  .wg-ui.is-touch .wg-bug { max-width: calc(100vw - 2 * var(--wg-sp) - 212px); overflow: hidden; }
  .wg-ui.is-touch .wg-bug-info .wg-diff-chip { display: none; }
  .wg-ui.is-touch .wg-hint,
  .wg-ui.is-touch .wg-hint.is-on { max-width: calc(100vw - 2 * var(--wg-sp) - 200px); white-space: normal; }
  .wg-ui.is-touch .wg-slowmo { top: calc(46% - 44px); }
  .wg-ui.is-touch .wg-flashstack { top: 55%; left: var(--wg-sp); right: var(--wg-sp); transform: none; }
  .wg-ui.is-touch .wg-flash { max-width: 100%; }
  .wg-ui.is-touch .wg-timing { align-self: flex-start; width: calc(100vw - 2 * var(--wg-sp) - 196px); padding: 6px 10px 5px; }
  .wg-ui.is-touch .wg-timing-head .wg-label { display: none; }
  /* flight: the landing cue (left) and the flash / timing card (right) share the band between
     the hint strip and the instruments, so neither covers the attack-angle gauge */
  .wg-ui.is-touch .wg-hud[data-phase='flight'] .wg-cstack {
    top: calc(var(--wg-sp) + 236px);
    bottom: auto;
    left: var(--wg-sp);
    width: calc(50vw - var(--wg-sp) - 4px);
    transform: none;
  }
  .wg-ui.is-touch .wg-hud[data-phase='flight'] ~ .wg-fx .wg-flashstack {
    top: calc(var(--wg-sp) + 236px);
    left: calc(50vw + 4px);
    right: var(--wg-sp);
    align-items: stretch;
  }
  .wg-ui.is-touch .wg-hud[data-phase='flight'] ~ .wg-fx .wg-timing { width: auto; align-self: stretch; }
  .wg-ui.is-touch .wg-hud[data-phase='flight'] .wg-cue { padding: 6px 10px 16px; }
  .wg-ui.is-touch .wg-hud[data-phase='flight'] .wg-cue-status { font-size: 15px; }
  .wg-ticker-pts,
  .wg-ticker .wg-nation-code { display: none; }
  .wg-ticker .wg-name { min-width: 0; }
  .wg-ticker { gap: 6px; padding-right: 10px; }
}
.wg-timing-head { display: flex; align-items: baseline; gap: 8px; }
.wg-timing-label { flex: 1; font-family: var(--wg-font-cond); font-weight: 800; font-size: 17px; letter-spacing: 0.06em; text-transform: uppercase; }
.wg-timing-val { font-family: var(--wg-font-cond); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--wg-muted); }
.wg-timing.is-perfect .wg-timing-label { color: var(--wg-gold); }
.wg-timing.is-good .wg-timing-label { color: var(--wg-green); }
.wg-timing.is-window .wg-timing-label { color: var(--wg-amber); }
.wg-timing.is-miss .wg-timing-label { color: var(--wg-red); }
.wg-timing-track { position: relative; height: 14px; margin: 7px 0 3px; border-radius: 7px; background: rgba(255, 255, 255, 0.08); }
.wg-timing-zone { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.wg-timing-zone.is-window { background: rgba(255, 255, 255, 0.16); }
.wg-timing-zone.is-good { background: rgba(255, 190, 59, 0.6); }
.wg-timing-zone.is-perfect { background: rgba(52, 209, 127, 0.9); }
.wg-timing-center { position: absolute; left: calc(50% - 1px); top: -3px; bottom: -3px; width: 2px; background: #fff; }
.wg-timing-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  border: 2px solid #0b1424;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}
.wg-timing.is-on .wg-timing-dot { animation: wg-pop 0.3s var(--wg-ease) 0.1s both; }
.wg-timing-dot.is-hidden { display: none; }
.wg-timing-scale { display: flex; justify-content: space-between; font-family: var(--wg-font-cond); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wg-muted); }

/* ------------------------------------------------------------------ phase-2 responsive */
@media (max-width: 1100px) {
  .wg-career-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wg-career-col.is-c { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .wg-ath-main { grid-template-columns: auto minmax(0, 1fr) auto; }
  .wg-ath-bars { grid-column: 2 / -1; grid-row: 2; }
}

@media (max-width: 900px) {
  .wg-hub { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto 1fr auto; align-content: start; background: linear-gradient(180deg, rgba(5, 10, 20, 0.5), rgba(5, 10, 20, 0.86)); }
  .wg-hub-hero { grid-column: 1; grid-row: 2; padding: 8px 0 4px; }
  .wg-hub-list { grid-column: 1; grid-row: 3; align-self: start; }
  .wg-hub-foot { grid-row: 4; }
  .wg-hub .wg-menu-title { font-size: clamp(44px, 12vw, 80px); }
  .wg-ath-layout,
  .wg-cal-layout { grid-template-columns: minmax(0, 1fr); }
  .wg-cal-side { position: static; order: -1; }
  .wg-ath-detail { display: none; }
  .wg-set-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 760px) {
  .wg-career-grid,
  .wg-career-col.is-c { grid-template-columns: minmax(0, 1fr); }
  .wg-career-col.is-c { display: flex; }
  .wg-creator.wg-scr { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(210px, 35%) minmax(0, 1fr); }
  .wg-creator-panel {
    padding: 0 max(var(--wg-sp), env(safe-area-inset-right, 0px)) 0 max(var(--wg-sp), env(safe-area-inset-left, 0px));
    border-left: 0;
    border-top: 1px solid var(--wg-line);
    border-radius: 16px 16px 0 0;
    animation-name: wg-rise;
  }
  .wg-creator-panel > .wg-scr-head { padding-top: 12px; }
  .wg-stage-corner { width: 18px; height: 18px; }
  .wg-stage-corner.is-bl,
  .wg-stage-corner.is-br { bottom: 10px; }
  .wg-stage-corner.is-tl,
  .wg-stage-corner.is-bl { left: 10px; }
  .wg-stage-corner.is-tr,
  .wg-stage-corner.is-br { right: 10px; }
  /* phones: the toggle stacks in the top-right corner, beside the (narrow) athlete instead of
     above its head; the framing box spans the stage height above the name plate */
  .wg-stage-view { left: auto; right: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); transform: none; width: 104px; }
  .wg-stage-view .wg-seg { flex-direction: column; gap: 2px; }
  .wg-stage-view .wg-seg-btn { min-height: 42px; padding: 2px 8px; }
  .wg-stage-view .wg-seg-main { font-size: 13px; }
  .wg-stage-frame { left: 10px; right: 10px; top: calc(10px + env(safe-area-inset-top, 0px)); bottom: 68px; }
  .wg-stage-plate { left: 12px; right: auto; bottom: 14px; max-width: calc(100% - 24px); padding: 6px 10px; }
  .wg-stage-name { font-size: 16px; }
  .wg-stage-hint { display: none; }
  .wg-creator .wg-scr-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  .wg-table .c-gap { display: none; }
}

@media (max-width: 520px) {
  .wg-table td.c-name .wg-nation { min-width: 0; }
  .wg-results .wg-table .c-d { display: none; }
  .wg-results .wg-table .c-name-box.has-dists { flex-wrap: wrap; row-gap: 1px; }
  .wg-results .wg-res-dists { display: block; flex: 1 0 100%; padding-left: 30px; font-family: var(--wg-font-cond); font-weight: 600; font-size: 13.5px; letter-spacing: 0.02em; color: var(--wg-muted); font-variant-numeric: tabular-nums; }
  .wg-results .wg-res-dists.is-fell { color: #ff8f9a; }
  .wg-podium-step.is-tied .wg-podium-name { font-size: 12px; }
  .wg-podium-step.is-tied .wg-nation { font-size: 11px; }
  .wg-tab { letter-spacing: 0.03em; padding: 0 6px; }
  .wg-ath-bars .wg-attr.is-compact { grid-template-areas: 'label label' 'bar num'; align-items: center; column-gap: 4px; }
  .wg-ath-bars .wg-attr.is-compact .wg-attr-label { font-size: 10px; letter-spacing: 0.01em; }
  .wg-ath-bars .wg-attr.is-compact .wg-attr-num { font-size: 12px; }
}
@media (max-width: 520px) {
  .wg-back { padding: 0 8px; }
  .wg-back-text,
  .wg-back .wg-kbd { display: none; }
  .wg-scr-head { gap: 10px; }
  .wg-scr-title { font-size: 24px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow-wrap: anywhere; }
  /* filter chips: one swipeable row instead of three wrapped rows */
  .wg-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--wg-sp)); padding-right: var(--wg-sp); scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .wg-chips::-webkit-scrollbar { display: none; }
  .wg-chip { flex: none; padding: 0 12px; }
  .wg-scr-right .wg-diff-chip-k { display: none; }
  .wg-scr-right .wg-btn-sm span:not(.wg-icon) { display: none; }
  .wg-foot-go,
  .wg-creator .wg-foot-go { flex: 1 1 100%; min-width: 0; margin-left: 0; }
  .wg-foot-summary { flex: 1 1 100%; }
  .wg-foot-tod { flex: 1 1 auto; }
  .wg-foot-tod .wg-seg-btn { min-width: 0; padding: 4px 8px; }
  .wg-foot-tod .wg-swatch { display: none; }
  .wg-hub-item { min-height: 58px; }
  .wg-hub-label { font-size: 20px; }
  .wg-hub-sub { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; line-height: 1.25; }
  .wg-venue-groups { display: block; }
  .wg-venue-group + .wg-venue-group { margin-top: 16px; }
  .wg-venue-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .wg-venue-grid > .wg-venue-card { width: auto; }
  .wg-venue-card { flex-direction: row; }
  .wg-venue-art { width: 96px; height: auto; min-height: 100%; }
  .wg-venue-type { left: 4px; right: 4px; top: auto; bottom: 4px; padding: 1px 4px; font-size: 10px; text-align: center; letter-spacing: 0.06em; }
  .wg-venue-body { padding: 8px 10px; gap: 4px; flex: 1; }
  .wg-venue-name { font-size: 21px; }
  .wg-venue-stat { min-width: 0; padding: 2px 6px; }
  .wg-venue-stat-v { font-size: 16px; }
  .wg-tabs-sm { max-width: none; flex-basis: 100%; }
  .wg-ath-sort { flex: 1 1 100%; }
  .wg-ath-main { gap: 8px 10px; padding: 8px 10px; }
  .wg-ath-bars { grid-column: 1 / -1; gap: 6px; }
  .wg-ath-rowtools .wg-icon-btn { min-height: 44px; }
  .wg-cal-ev { grid-template-columns: 30px minmax(0, 1fr); gap: 4px 10px; }
  .wg-cal-num { width: 28px; height: 28px; font-size: 14px; }
  .wg-cal-res { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 10px; max-width: none; text-align: left; }
  .wg-cal-venue { font-size: 17px; }
  .wg-next-name { font-size: 28px; }
  .wg-table .c-pod { display: none; }
  .wg-table .c-d { font-size: 15px; }
  .wg-podium { gap: 6px; }
  .wg-podium-step { padding: 10px 4px; }
  .wg-podium-step.is-p1 { padding-top: 18px; }
  .wg-podium-step.is-p2 { padding-top: 12px; }
  .wg-podium-step.is-p2.is-tied,
  .wg-podium-step.is-p3.is-tied { padding-top: 4px; }
  .wg-podium-rank { font-size: 26px; }
  .wg-podium-name { font-size: 13px; }
  .wg-podium-name .wg-name-first { display: none; }
  .wg-car-rank-num { font-size: 36px; }
  .wg-car-rank-stats { gap: 12px; }
  .wg-points { grid-template-columns: auto minmax(0, 1fr); }
  .wg-points-rating { display: none; }
  .wg-points-num { font-size: 34px; }
  .wg-dialog { padding: 18px; }
  .wg-dialog-title { font-size: 22px; }
  .wg-attr { grid-template-columns: minmax(64px, 32%) minmax(0, 1fr) 28px 28px; gap: 6px; }
  .wg-attr.wg-alloc-bar { grid-template-columns: minmax(0, 1fr); }
}

@keyframes wg-spark {
  0% { opacity: 1; transform: rotate(calc(var(--k, 0) * 45deg)) translateY(-24px) scale(1); }
  100% { opacity: 0; transform: rotate(calc(var(--k, 0) * 45deg)) translateY(-78px) scale(0.4); }
}
@keyframes wg-spin { to { transform: rotate(360deg); } }

/* Narrow desktop windows: let the keyboard hint wrap instead of running off screen. */
@media (max-width: 520px) {
  .wg-ui:not(.is-touch) .wg-hint,
  .wg-ui:not(.is-touch) .wg-hint.is-on { max-width: calc(100vw - 2 * var(--wg-sp)); white-space: normal; text-align: center; }
}

/* ================================================================== Phase 2.1: flight guidance
   (ARCHITECTURE.md P2.1.7). Jumper zone that stays clear during in-run, flight and landing:
   desktop x 33–67 %, y 26–62 %; phone (< 600 px) x 15–85 %, y 28–56 %. */
:root {
  --wg-tone-info: #dfe9f7;
  --wg-tone-info-b: #5b7aa6;
  --wg-tone-action: #ffb020;
  --wg-tone-urgent: #ff3b30;
  --wg-tone-good: #30d158;
}

/* ---- key caps (generic: prompt, legend, tutorial card, result card) */
.wg-kcs { display: inline-flex; align-items: center; gap: 6px; }
.wg-kcs-col { display: inline-flex; flex-direction: column; gap: 6px; }
.wg-kc {
  --kc: 76px;
  --kc-glyph: 44px;
  --ring: var(--wg-tone-action);
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--kc);
  height: var(--kc);
  padding: 0 10px;
  border-radius: 14px;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  line-height: 1;
  flex: none;
}
.wg-kc-glyph { font-size: var(--kc-glyph); }
.wg-kc.is-wide .wg-kc-glyph { font-size: calc(var(--kc-glyph) * 0.62); letter-spacing: 0.02em; }
.wg-kc.is-xwide .wg-kc-glyph { font-size: calc(var(--kc-glyph) * 0.5); }
.wg-kc-alt { position: absolute; right: 6px; bottom: 4px; font-size: 14px; font-weight: 700; opacity: 0.7; }
.wg-kc.is-lit {
  background: #fff;
  color: #0b1626;
  box-shadow: 0 0 0 4px var(--ring), 0 0 18px var(--ring);
}
.wg-kc.is-dim { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.55); border: 1px solid rgba(255, 255, 255, 0.18); }
.wg-kc.is-done { background: rgba(255, 255, 255, 0.16); color: #fff; border: 1px solid rgba(48, 209, 88, 0.6); }
.wg-kc-tick {
  position: absolute;
  right: -7px;
  top: -7px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--wg-tone-good);
  color: #062b12;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wg-kc.is-sm { --kc: 40px; --kc-glyph: 24px; border-radius: 9px; padding: 0 7px; }
.wg-kc.is-sm .wg-kc-alt { font-size: 10px; right: 3px; bottom: 2px; }
.wg-kc.is-xs { --kc: 24px; --kc-glyph: 15px; border-radius: 6px; padding: 0 5px; box-shadow: none; }
.wg-kc.is-xs .wg-kc-alt { display: none; }
.wg-kc.is-legend { --kc: 34px; --kc-glyph: 20px; border-radius: 8px; padding: 0 6px; box-shadow: none; }
.wg-kc.is-legend .wg-kc-alt { font-size: 9px; right: 2px; bottom: 1px; }
.wg-kcs:has(.is-sm) .wg-kcs-col, .wg-kcs:has(.is-sm) { gap: 4px; }
.wg-kcs:has(.is-legend), .wg-kcs:has(.is-legend) .wg-kcs-col { gap: 3px; }

/* ---- bottom-centre guide stack: prompt above the cue bars */
.wg-guide {
  position: absolute;
  left: 50%;
  bottom: 84px;
  width: min(640px, calc(100vw - 2 * var(--wg-sp)));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.wg-ui .wg-guide > .wg-cstack {
  position: static !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  transform: none !important;
  width: min(420px, 100%) !important;
}
.wg-hud:not([data-phase='inrun']) .wg-guide > .wg-cstack:not(:has(.wg-cue.is-on)) { display: none; }

/* ---- prompt */
.wg-prompt {
  --tone: var(--wg-tone-info);
  display: none;
  max-width: 100%;
}
.wg-prompt.is-on { display: block; }
.wg-prompt-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 22px 12px 14px;
  border-radius: 18px;
  background: rgba(8, 18, 36, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 2px solid var(--tone);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
.wg-prompt.is-info { --tone: var(--wg-tone-info-b); }
.wg-prompt.is-action { --tone: var(--wg-tone-action); }
.wg-prompt.is-urgent { --tone: var(--wg-tone-urgent); }
.wg-prompt.is-good { --tone: var(--wg-tone-good); }
.wg-prompt .wg-kc { --ring: var(--tone); }
.wg-prompt.is-info .wg-kc { --ring: var(--wg-tone-info); }
.wg-prompt-keys.is-empty { display: none; }
.wg-prompt-textbox { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.wg-prompt-text {
  font-family: var(--wg-font-cond);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.wg-prompt.is-action .wg-prompt-text { color: #ffe3a8; }
.wg-prompt.is-urgent .wg-prompt-text { color: #ffd2cf; }
.wg-prompt.is-good .wg-prompt-text { color: #c9f7d5; }
.wg-prompt.is-info .wg-prompt-text { color: var(--wg-tone-info); }
.wg-prompt-sub { font-size: 17px; font-weight: 600; color: #c3d2e6; line-height: 1.2; }
.wg-prompt-sub.is-empty { display: none; }
.wg-prompt.is-enter .wg-prompt-inner { animation: wg-prompt-in 0.22s var(--wg-ease) both; }
.wg-prompt.is-urgent .wg-prompt-inner { animation: wg-prompt-pulse 0.4s ease-in-out infinite alternate; }
@keyframes wg-prompt-in { from { opacity: 0.2; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes wg-prompt-pulse {
  from { transform: scale(1); box-shadow: 0 0 0 rgba(255, 59, 48, 0); }
  to { transform: scale(1.06); box-shadow: 0 0 28px rgba(255, 59, 48, 0.55); }
}

/* ---- posture meter */
.wg-meter { position: absolute; inset: 0; pointer-events: none; display: none; }
.wg-meter.is-on { display: block; }
/* the flight posture meter above shares the class name with the menu widget meter (widgets.js
   meter(): career Condition card); keep the menu meters in the normal flow */
.wg-scr .wg-meter { position: static; inset: auto; display: block; pointer-events: auto; }
.wg-meter-vbox { position: absolute; left: calc(50% + 230px); top: calc(44% - 110px); width: 34px; height: 220px; }
.wg-meter-hbox { position: absolute; left: calc(50% + 230px); top: calc(44% + 124px); width: 160px; height: 26px; }
.wg-meter-bar {
  position: relative;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
/* zones: green |x| ≤ 1 (30–70 %), amber to 1.8 (14–86 %), red beyond; range ±2.5 */
.wg-meter-v {
  background: linear-gradient(to top, rgba(255, 59, 48, 0.85) 0 14%, rgba(255, 176, 32, 0.8) 14% 30%, rgba(48, 209, 88, 0.85) 30% 70%, rgba(255, 176, 32, 0.8) 70% 86%, rgba(255, 59, 48, 0.85) 86% 100%);
}
.wg-meter-h {
  background: linear-gradient(to right, rgba(255, 59, 48, 0.85) 0 14%, rgba(255, 176, 32, 0.8) 14% 30%, rgba(48, 209, 88, 0.85) 30% 70%, rgba(255, 176, 32, 0.8) 70% 86%, rgba(255, 59, 48, 0.85) 86% 100%);
}
.wg-meter-mark {
  position: absolute;
  background: #fff;
  border-radius: 3px;
  box-shadow: 0 0 0 2px #0b1626, 0 0 10px rgba(255, 255, 255, 0.7);
}
.wg-meter-v .wg-meter-mark { left: 50%; width: 44px; height: 10px; transform: translate(-50%, 50%); }
.wg-meter-h .wg-meter-mark { top: 50%; width: 10px; height: 44px; transform: translate(-50%, -50%); }
.wg-meter:not(.is-ready) .wg-meter-v .wg-meter-mark { opacity: 0.55; }
.wg-meter-want {
  position: absolute;
  display: none;
  font-size: 20px;
  line-height: 1;
  color: var(--wg-tone-action);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
}
.wg-meter.is-urgent .wg-meter-want { color: var(--wg-tone-urgent); }
.wg-meter-want.is-on { display: block; }
.wg-meter-want.is-down { left: calc(100% + 6px); transform: translateY(80%); }
.wg-meter-want.is-up { left: calc(100% + 6px); transform: translateY(-20%); }
.wg-meter-want.is-left { top: calc(100% + 2px); transform: translateX(-130%); }
.wg-meter-want.is-right { top: calc(100% + 2px); transform: translateX(30%); }
.wg-meter-pin { position: absolute; display: none; font-size: 14px; color: #fff; text-shadow: 0 0 4px #000; }
.wg-meter-pin.is-on { display: block; }
.wg-meter-pin.is-up { top: -18px; left: 50%; transform: translateX(-50%); }
.wg-meter-pin.is-down { bottom: -18px; left: 50%; transform: translateX(-50%); }
.wg-meter-pin.is-left { left: -16px; top: 50%; transform: translateY(-50%); }
.wg-meter-pin.is-right { right: -16px; top: 50%; transform: translateY(-50%); }
.wg-meter-lab {
  position: absolute;
  font-family: var(--wg-font-cond);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.wg-meter-lab-short { display: none; }
.wg-meter-lab.is-up { left: 44px; top: 0; }
.wg-meter-lab.is-down { left: 44px; bottom: 0; }
.wg-meter-lab.is-left { left: 0; top: 30px; }
.wg-meter-lab.is-right { right: 0; top: 30px; }

/* ---- attack gauge: compact (Easy/Normal) or full (Pro) */
.wg-flight.is-compact { scale: 0.62; transform-origin: right center; }

/* ---- camera chip in the broadcast bug */
.wg-cam-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--wg-muted); }
.wg-cam-chip.is-empty { display: none; }

/* ---- key legend (replaces the bracket hint pill during live play) */
.wg-legend {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 18px;
  padding: 6px 14px;
  border-radius: 14px;
  background: rgba(8, 18, 36, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
  pointer-events: none;
}
.wg-legend.is-on { display: flex; }
.wg-ui:not(.hud-on) .wg-legend,
.wg-ui.is-touch .wg-legend { display: none; }
.wg-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.wg-legend-label { font-size: 15px; font-weight: 600; color: #dfe9f7; }
.wg-legend .wg-kcs-col .wg-kc { --kc: 22px; --kc-glyph: 15px; }

/* ---- flashes move to the top centre, clear of the jumper zone */
.wg-ui.hud-on .wg-flashstack,
.wg-ui.hud-on .wg-hud[data-phase] ~ .wg-fx .wg-flashstack {
  top: auto !important;
  bottom: 74% !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  align-items: center !important;
}
.wg-ui.hud-on .wg-flash-text { font-size: clamp(26px, 4vw, 44px); }

/* ---- tutorial card (left of the jumper zone) */
.wg-tcard {
  position: absolute;
  left: var(--wg-sp);
  top: calc(var(--wg-sp) + 84px);
  width: min(380px, calc(33vw - var(--wg-sp) - 8px));
  box-sizing: border-box;
  padding: 14px 16px 14px;
  display: none;
  flex-direction: column;
  gap: 8px;
  pointer-events: auto;
  border-left: 4px solid var(--wg-tone-action);
  white-space: normal;
}
.wg-tcard.is-on { display: flex; }
/* biathlon: clear the race clock box (top left) */
@media (min-width: 600px) {
  .wg-ui:has(.wg-rbug.is-on) .wg-tcard { top: calc(var(--wg-sp) + 108px); }
}
@media (max-width: 599px) {
  .wg-ui:has(.wg-rbug.is-on) .wg-tcard { top: calc(var(--wg-sp) + 78px); }
}
/* at the range the left middle holds the breath meter: the card moves to the bottom-left corner
   (the race cluster is hidden while shooting) */
@media (min-width: 600px) {
  .wg-ui:has(.wg-hud.is-shooting) .wg-tcard { top: auto; bottom: var(--wg-sp); }
}
.wg-tcard.is-enter { animation: wg-prompt-in 0.25s var(--wg-ease) both; }
.wg-tcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wg-tcard-kicker { font-family: var(--wg-font-cond); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wg-tone-action); }
.wg-tcard-paused { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #0b1626; background: var(--wg-tone-action); border-radius: 6px; padding: 2px 7px; }
.wg-tcard-title { font-family: var(--wg-font-cond); font-size: 24px; font-weight: 800; line-height: 1.1; }
.wg-tcard-text { margin: 0; font-size: 16px; line-height: 1.4; color: #e6eef8; }
.wg-tcard-prog { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.wg-tcard-bar { display: block; height: 100%; width: 0; background: var(--wg-tone-action); transition: width 0.2s linear; }
.wg-tcard-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.wg-tcard-actions .wg-btn { gap: 8px; }
.wg-tcard-skip { margin-left: auto; }

/* ---- result card: why you fell + coach tips */
.wg-result-fall {
  margin: 6px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 59, 48, 0.12);
  border: 1px solid rgba(255, 59, 48, 0.45);
}
.wg-result-fall-title { font-family: var(--wg-font-cond); font-size: 22px; font-weight: 800; color: #ffd2cf; }
.wg-result-fall-text { margin: 4px 0 6px; font-size: 15px; line-height: 1.4; }
.wg-result-fall-keys { display: flex; align-items: center; gap: 10px; }
.wg-result-tips { margin: 6px 0 4px; padding: 8px 12px; border-radius: 10px; background: rgba(48, 209, 88, 0.08); border: 1px solid rgba(48, 209, 88, 0.3); }
.wg-result-tips-list { margin: 4px 0 0; padding-left: 18px; font-size: 14.5px; line-height: 1.4; }
.wg-result-tips-list li + li { margin-top: 3px; }

/* ---- hub badge ("Recommended") */
.wg-hub-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--wg-tone-action);
  color: #1b1200;
  font-family: var(--wg-font-cond);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* ---- phones (< 600 px): smaller caps, meter at the right edge, stack above the touch buttons */
@media (max-width: 599px) {
  .wg-kc { --kc: 56px; --kc-glyph: 34px; }
  .wg-kc-alt { font-size: 11px; right: 4px; bottom: 3px; }
  .wg-guide { bottom: 200px; width: 92vw; gap: 6px; }
  .wg-prompt-inner { gap: 12px; padding: 8px 14px 8px 10px; border-radius: 14px; }
  .wg-prompt-text { font-size: 22px; }
  .wg-prompt-sub { font-size: 14px; }
  .wg-kcs, .wg-kcs-col { gap: 4px; }
  .wg-meter-vbox { left: auto; right: 12px; top: calc(40% - 85px); width: 26px; height: 170px; }
  .wg-meter-hbox { left: auto; right: 12px; top: calc(28% - 30px); width: 120px; height: 22px; }
  .wg-meter-v .wg-meter-mark { width: 36px; height: 9px; }
  .wg-meter-h .wg-meter-mark { width: 9px; height: 34px; }
  .wg-meter-lab-long { display: none; }
  .wg-meter-lab-short { display: inline; }
  .wg-meter-lab { font-size: 10px; }
  .wg-meter-lab.is-up { left: 50%; top: -15px; transform: translateX(-50%); }
  .wg-meter-lab.is-down { left: 50%; bottom: -15px; transform: translateX(-50%); }
  .wg-meter-lab.is-left { left: -14px; top: 4px; }
  .wg-meter-lab.is-right { right: auto; left: calc(100% + 4px); top: 4px; display: none; }
  .wg-meter-want.is-down, .wg-meter-want.is-up { left: auto; right: calc(100% + 4px); }
  /* flight instruments: a compact row in the top band, clear of the jumper zone */
  .wg-ui .wg-flight,
  .wg-ui .wg-hud[data-phase='flight'] .wg-flight {
    top: calc(var(--wg-sp) + 96px) !important;
    bottom: auto !important;
    right: 146px !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    transform: none !important;
    transform-origin: right top;
  }
  .wg-ui .wg-flight.is-compact { scale: 0.62; }
  .wg-ui .wg-flight.is-full { scale: 0.72; }
  .wg-hud[data-phase='flight'] .wg-plate { display: none; }
  .wg-ui.hud-on .wg-flashstack,
  .wg-ui.hud-on .wg-hud[data-phase] ~ .wg-fx .wg-flashstack { bottom: 72.5% !important; max-width: 92vw; }
  .wg-tcard { left: var(--wg-sp); right: var(--wg-sp); top: calc(var(--wg-sp) + 56px); width: auto; padding: 8px 12px; gap: 4px; }
  .wg-tcard-title { font-size: 17px; }
  .wg-tcard-text { font-size: 13px; line-height: 1.3; }
  .wg-tcard-keys { display: none; }
  .wg-tcard-actions .wg-btn { padding: 6px 12px; min-height: 36px; font-size: 14px; }
}

/* Guide stack geometry (B4): on desktop the prompt and the cue bars sit side by side so the
   stack never climbs into the jumper zone; on phones the caps of a prompt go in a row and the
   in-run balance gives way to the take-off bar. */
@media (min-width: 600px) {
  .wg-guide { flex-direction: row; align-items: flex-end; justify-content: center; width: max-content; max-width: calc(100vw - 2 * var(--wg-sp)); gap: 14px; }
  .wg-ui .wg-guide > .wg-cstack { width: min(380px, 36vw) !important; }
  .wg-prompt { max-width: min(600px, 54vw); }
}
@media (max-width: 599px) {
  .wg-prompt .wg-kcs-col { flex-direction: row; }
  .wg-hud[data-phase='inrun'] .wg-guide:has(.wg-cue-takeoff.is-on) .wg-balance { display: none; }
}
/* Phone flight HUD: the guide stack ends above the speed readout (which sits above the action
   button), and the camera chip drops its 'Camera:' prefix so the top bar does not clip it. */
@media (max-width: 599px) {
  .wg-ui.is-touch .wg-hud:not(.is-race) .wg-guide { bottom: 214px; }
  .wg-cam-pre { display: none; }
}
/* Phone: the slow-motion badge leaves the jumper zone (x 15–85 %, y 28–56 %) for the band above it. */
@media (max-width: 599px) {
  .wg-ui.is-touch .wg-slowmo,
  .wg-ui .wg-slowmo { top: calc(28% - 38px); left: var(--wg-sp); transform: translate(0, -8px); padding: 4px 10px 4px 8px; font-size: 12px; }
  .wg-ui .wg-slowmo.is-on { transform: translate(0, 0); }
  .wg-guide { bottom: 192px; }
}
@media (min-width: 600px) {
  .wg-guide { bottom: 78px; }
}

/* ================================================================== Multi-sport + biathlon UI
   (docs/biathlon.md §17): sport picker, format select, start list, column results, race summary,
   controls card, generic venue cards, biathlon touch layouts, race HUD and the rear-sight overlay. */

/* ---- sport picker */
.wg-picker {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  padding: 0 calc(var(--wg-sp) + env(safe-area-inset-right, 0px)) 0 calc(var(--wg-sp) + env(safe-area-inset-left, 0px));
  background:
    radial-gradient(ellipse at 20% 0%, rgba(47, 124, 255, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(5, 10, 20, 0.72), rgba(5, 10, 20, 0.9));
}
.wg-picker-top { display: flex; justify-content: flex-end; gap: 8px; min-height: 44px; padding-top: calc(var(--wg-sp) + env(safe-area-inset-top, 0px)); }
.wg-picker-tool { pointer-events: auto; }
.wg-picker-hero { animation: wg-slide-in-left 0.6s var(--wg-ease) both; }
.wg-picker .wg-menu-title { font-size: clamp(40px, 6.4vw, 76px); }
.wg-picker-grid { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 1180px; margin: 0 auto; }
.wg-picker-ready, .wg-picker-soon { display: grid; gap: 14px; }
.wg-picker-ready { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wg-picker-soon { grid-template-columns: repeat(3, minmax(0, 1fr)); padding-bottom: 6px; }
.wg-sport-card {
  --accent: var(--wg-ice);
  pointer-events: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--wg-line);
  background: linear-gradient(180deg, rgba(16, 26, 45, 0.96), rgba(9, 15, 28, 0.96));
  box-shadow: var(--wg-shadow);
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
  animation: wg-pop 0.45s var(--wg-ease) both;
  animation-delay: calc(var(--i, 0) * 0.06s);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--wg-ease);
}
.wg-sport-card:hover:not(.is-soon),
.wg-sport-card:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--wg-shadow); transform: translateY(-3px); }
.wg-sport-card.is-soon { cursor: default; opacity: 0.62; filter: saturate(0.55); }
.wg-sport-art-box { position: relative; display: block; aspect-ratio: 16 / 6.4; overflow: hidden; background: #10223d; }
.wg-sport-card.is-soon .wg-sport-art-box { aspect-ratio: 16 / 5; }
.wg-sport-card.is-soon .wg-sport-body { padding: 8px 14px 10px; }
.wg-sport-art-box svg { display: block; width: 100%; height: 100%; }
.wg-sport-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 12px 16px 14px; border-top: 3px solid var(--accent); }
.wg-sport-name {
  flex: 1 1 auto;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wg-sport-card.is-soon .wg-sport-name { font-size: 20px; }
.wg-sport-tag { flex: 1 0 100%; order: 3; font-size: 14px; color: var(--wg-muted); }
.wg-sport-go,
.wg-sport-soon,
.wg-sport-last {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wg-sport-go, .wg-sport-soon { position: absolute; right: 10px; top: 10px; }
.wg-sport-go { padding: 5px 14px; font-size: 15px; background: var(--accent); color: #06121f; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.wg-sport-soon { background: rgba(6, 12, 24, 0.8); color: var(--wg-muted); }
.wg-sport-last { position: absolute; left: 10px; top: 10px; background: rgba(6, 12, 24, 0.8); color: var(--wg-text); }
/* sport art palette */
.wg-sa-sky { fill: #20416e; }
.wg-sa-sun { fill: #ffe7a8; opacity: 0.85; }
.wg-sa-far { fill: #3b5f8f; }
.wg-sa-trees { fill: #183a33; }
.wg-sa-snow { fill: #e9f2fb; }
.wg-sa-line { fill: none; stroke: #b8cde4; stroke-width: 1.4; }
.wg-sa-track { fill: none; stroke: #9db6d3; stroke-width: 1.2; stroke-dasharray: 3 2; }
.wg-sa-struct { fill: none; stroke: #8a9bb2; stroke-width: 1.6; stroke-linecap: round; }
.wg-sa-skis { stroke: #ff4b5c; stroke-width: 1.8; stroke-linecap: round; fill: none; }
.wg-sa-body { fill: #2f7cff; }
.wg-sa-limbs { fill: none; stroke: #2f7cff; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.wg-sa-limbs.is-arm { stroke-width: 2.6; stroke: #4f93ff; }
.wg-sa-head { fill: #ffd2b0; }
.wg-sa-board { fill: #f4f7fb; stroke: #1b2a40; stroke-width: 1; }
.wg-sa-target { fill: #111a26; }
.wg-sa-hit { fill: #c9d6e6; stroke: #1b2a40; stroke-width: 0.8; }
.wg-sa-rifle { stroke: #2b2f36; stroke-width: 2; stroke-linecap: round; }
.wg-sa-pole { stroke: #d7e2ef; stroke-width: 1; }
.wg-sa-gate-r { fill: #ff4b5c; }
.wg-sa-gate-b { fill: #2f7cff; }

/* ---- format select */
.wg-format-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.wg-format-card {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--wg-line);
  background: linear-gradient(180deg, rgba(16, 26, 45, 0.95), rgba(9, 15, 28, 0.95));
  color: var(--wg-text);
  text-align: left;
  cursor: pointer;
  animation: wg-pop 0.4s var(--wg-ease) both;
  animation-delay: calc(var(--i, 0) * 0.04s);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s var(--wg-ease);
}
.wg-format-card:hover:not(.is-off) { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
.wg-format-card.is-on { border-color: var(--wg-ice); box-shadow: 0 0 0 2px var(--wg-ice), 0 12px 28px rgba(92, 200, 255, 0.2); }
.wg-format-card.is-off { opacity: 0.5; cursor: default; }
.wg-format-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.wg-format-short {
  flex: none;
  min-width: 34px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(92, 200, 255, 0.16);
  color: var(--wg-ice);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-align: center;
}
.wg-format-name { flex: 1; min-width: 0; font-family: var(--wg-font-cond); font-weight: 800; font-size: 24px; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.03em; }
.wg-format-soon,
.wg-format-min { flex: none; font-family: var(--wg-font-cond); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wg-muted); }
.wg-format-desc { margin: 0; font-size: 14px; line-height: 1.4; color: var(--wg-muted); }
.wg-format-facts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.wg-format-fact { display: flex; flex-direction: column; min-width: 52px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); }
.wg-format-fact-k { font-family: var(--wg-font-cond); font-weight: 600; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wg-muted); }
.wg-format-fact-v { font-family: var(--wg-font-cond); font-weight: 700; font-size: 16px; line-height: 1.15; white-space: nowrap; }
.wg-format-options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.wg-format-opt { min-width: 0; }

/* ---- start list */
.wg-startlist .wg-scr-body { display: flex; flex-direction: column; overflow: hidden; }
.wg-start-table .c-bib { width: 54px; text-align: center; font-family: var(--wg-font-cond); font-weight: 700; }
.wg-start-table .c-start { width: 92px; text-align: right; font-family: var(--wg-font-cond); font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.wg-start-table .c-note { text-align: right; color: var(--wg-muted); font-size: 13px; }
.wg-start-table td.c-name { text-align: left; }

/* ---- results with sport columns */
.wg-table .c-x { text-align: right; font-family: var(--wg-font-cond); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wg-table th.c-x { font-size: 12px; }
.wg-table .c-x.is-left { text-align: left; }
.wg-table .c-x.is-center { text-align: center; }
.wg-table td.c-x-gap { color: var(--wg-muted); }
.wg-table td.c-x-time { font-weight: 700; }
.wg-shoot-cell { display: inline-flex; align-items: baseline; gap: 8px; }
.wg-shoot-bouts { letter-spacing: 0.12em; color: var(--wg-muted); }
.wg-shoot-sum { min-width: 18px; padding: 0 6px; border-radius: 5px; background: rgba(255, 75, 92, 0.2); color: #ff8d98; font-weight: 800; text-align: center; }
.wg-shoot-sum.is-clean { background: rgba(52, 209, 127, 0.18); color: var(--wg-green); }

/* ---- generic venue cards (biathlon etc.) */
.wg-venue-card.is-generic .wg-venue-art { height: 96px; }
.wg-venue-stats.is-facts { flex-wrap: wrap; }
.wg-venue-stats.is-facts .wg-venue-stat-v { font-size: 15px; }
.wg-art-target { fill: #111a26; stroke: #f4f7fb; stroke-width: 0.8; }

/* ---- race summary */
.wg-summary .wg-scr-body { overflow: auto; }
.wg-sum-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.wg-sum-hero { grid-column: span 5; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 18px; padding: 16px 18px; border-top: 4px solid var(--wg-ice); }
.wg-sum-hero.is-podium.is-p1 { border-top-color: var(--wg-gold); }
.wg-sum-hero.is-podium.is-p2 { border-top-color: var(--wg-silver); }
.wg-sum-hero.is-podium.is-p3 { border-top-color: var(--wg-bronze); }
.wg-sum-rank { grid-row: span 2; display: flex; flex-direction: column; align-items: center; }
.wg-sum-rank-val { font-family: var(--wg-font-cond); font-weight: 800; font-size: 64px; line-height: 0.95; }
.wg-sum-hero.is-p1 .wg-sum-rank-val { color: var(--wg-gold); }
.wg-sum-hero.is-p2 .wg-sum-rank-val { color: var(--wg-silver); }
.wg-sum-hero.is-p3 .wg-sum-rank-val { color: var(--wg-bronze); }
.wg-sum-field { font-family: var(--wg-font-cond); font-size: 14px; color: var(--wg-muted); }
.wg-sum-time { display: flex; flex-direction: column; }
.wg-sum-time-val { font-family: var(--wg-font-cond); font-weight: 800; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.wg-sum-gap { font-family: var(--wg-font-cond); font-weight: 700; font-size: 22px; color: #ff8d98; font-variant-numeric: tabular-nums; }
.wg-sum-gap.is-lead { color: var(--wg-green); }
.wg-sum-shoot { grid-column: span 7; padding: 14px 16px; }
.wg-sum-misses { font-weight: 800; color: #ff8d98; }
.wg-sum-misses.is-clean { color: var(--wg-green); }
.wg-sum-bouts { display: flex; flex-wrap: wrap; gap: 10px 14px; margin: 8px 0 0; padding: 0; list-style: none; }
.wg-sum-bout { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 4px 8px; padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.wg-sum-bout > .wg-dots { grid-column: span 2; }
.wg-sum-bout-n { font-family: var(--wg-font-cond); font-weight: 800; font-size: 14px; color: var(--wg-muted); }
.wg-sum-bout-st { font-family: var(--wg-font-cond); font-weight: 600; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wg-dim); }
.wg-sum-bout-m { grid-column: span 2; font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; color: #ff8d98; }
.wg-sum-bout-m.is-clean { color: var(--wg-green); }
.wg-dots { display: inline-flex; gap: 5px; }
.wg-dot { width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.3); box-sizing: border-box; }
.wg-dot.is-hit { background: #f4f7fb; border-color: #f4f7fb; }
.wg-dot.is-miss { background: #111a26; border-color: var(--wg-red); }
.wg-sum-coach { grid-column: span 5; padding: 14px 16px; }
.wg-sum-tips { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.35; }
.wg-sum-splits { grid-column: span 7; padding: 10px 12px; }
.wg-split-table .c-x { font-size: 15px; }
.wg-sum-stats { grid-column: span 12; padding: 12px 16px; }
.wg-sum-statlist { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 6px 0 0; }
.wg-sum-stat { display: flex; flex-direction: column; min-width: 90px; }
.wg-sum-stat dt, .wg-sum-stat > :first-child { font-family: var(--wg-font-cond); font-weight: 600; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wg-muted); }
.wg-sum-stat dd, .wg-sum-stat > :last-child { margin: 0; font-family: var(--wg-font-cond); font-weight: 700; font-size: 20px; }

/* ---- controls card */
.wg-help.wg-controls { width: min(980px, calc(100vw - 2 * var(--wg-sp))); max-height: calc(100vh - 2 * var(--wg-sp)); overflow: auto; }
.wg-ctl { display: flex; flex-direction: column; gap: 14px; }
.wg-ctl-sections { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px 22px; }
.wg-ctl-sec { min-width: 0; }
.wg-ctl-title { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-family: var(--wg-font-cond); font-weight: 700; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; }
.wg-ctl-title::before { content: ''; width: 4px; height: 16px; border-radius: 2px; background: var(--wg-red); }
.wg-ctl-rows { display: flex; flex-direction: column; gap: 8px; }
/* the key column grows with wide caps (e.g. '← → ↑ ↓ WASD'), never over the description */
.wg-ctl-row { display: grid; grid-template-columns: fit-content(55%) minmax(0, 1fr); align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.wg-ctl-keys { display: flex; flex-wrap: wrap; justify-content: flex-start; min-width: 96px; }
.wg-ctl-what { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wg-ctl-action { font-weight: 700; font-size: 15px; }
.wg-ctl-note { font-size: 13px; color: var(--wg-muted); line-height: 1.3; }
.wg-ctl-dev { font-family: var(--wg-font-cond); font-size: 12px; letter-spacing: 0.06em; color: var(--wg-dim); white-space: pre; }
.wg-ctl-tips { padding: 10px 12px; border-radius: 8px; background: rgba(92, 200, 255, 0.08); border: 1px solid rgba(92, 200, 255, 0.2); }
.wg-ctl-tips ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* ---- touch layouts: the ski-jump pad is the default; biathlon sets replace it */
.wg-tset { display: none; }
.wg-ui.touch-biathlonSki .wg-tpad,
.wg-ui.touch-biathlonSki .wg-t-action,
.wg-ui.touch-biathlonShoot .wg-tpad,
.wg-ui.touch-biathlonShoot .wg-t-action,
.wg-ui.touch-biathlonSki .wg-t-cam,
.wg-ui.touch-biathlonShoot .wg-t-cam { display: none; }
.wg-ui.touch-biathlonSki .wg-tset-ski,
.wg-ui.touch-biathlonShoot .wg-tset-shoot { display: block; }
.wg-tb-word .wg-tbtn-glyph { font-family: var(--wg-font-cond); font-weight: 800; font-size: 15px; letter-spacing: 0.1em; }
.wg-tb-steer {
  position: absolute;
  left: calc(var(--wg-sp) + env(safe-area-inset-left, 0px));
  bottom: calc(var(--wg-sp) + env(safe-area-inset-bottom, 0px));
  width: 150px;
  height: 70px;
}
.wg-tb-steer .wg-tbtn { width: 70px; height: 70px; border-radius: 16px; bottom: 0; }
.wg-tb-left { left: 0; }
.wg-tb-right { right: 0; }
.wg-tb-draft { left: calc(var(--wg-sp) + 30px + env(safe-area-inset-left, 0px)); bottom: calc(var(--wg-sp) + 84px + env(safe-area-inset-bottom, 0px)); width: 90px; height: 50px; border-radius: 12px; opacity: 0.5; }
.wg-tb-draft.is-avail { opacity: 1; border-color: var(--wg-ice); box-shadow: 0 0 14px rgba(92, 200, 255, 0.5); }
.wg-tb-draft.is-on { background: rgba(92, 200, 255, 0.55); }
.wg-tb-boost,
.wg-tb-fire {
  right: calc(var(--wg-sp) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--wg-sp) + 10px + env(safe-area-inset-bottom, 0px));
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, rgba(255, 190, 59, 0.9), rgba(255, 140, 20, 0.78));
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(255, 150, 30, 0.38);
  color: #2a1600;
}
.wg-tb-fire { background: radial-gradient(circle at 40% 30%, rgba(255, 110, 120, 0.92), rgba(220, 40, 60, 0.82)); color: #fff; box-shadow: 0 8px 24px rgba(255, 60, 80, 0.4); }
.wg-tb-boost .wg-tbtn-glyph,
.wg-tb-fire .wg-tbtn-glyph { font-size: 20px; }
.wg-tb-push { right: calc(var(--wg-sp) + 20px + env(safe-area-inset-right, 0px)); bottom: calc(var(--wg-sp) + 130px + env(safe-area-inset-bottom, 0px)); width: 78px; height: 56px; border-radius: 14px; }
.wg-tb-tuck { right: calc(var(--wg-sp) + 124px + env(safe-area-inset-right, 0px)); bottom: calc(var(--wg-sp) + 26px + env(safe-area-inset-bottom, 0px)); width: 70px; height: 70px; border-radius: 16px; }
.wg-tb-load { right: calc(var(--wg-sp) + 24px + env(safe-area-inset-right, 0px)); bottom: calc(var(--wg-sp) + 130px + env(safe-area-inset-bottom, 0px)); width: 70px; height: 52px; border-radius: 12px; }
.wg-tb-breathe { left: calc(var(--wg-sp) + env(safe-area-inset-left, 0px)); bottom: calc(var(--wg-sp) + 10px + env(safe-area-inset-bottom, 0px)); width: 110px; height: 96px; border-radius: 20px; }
.wg-tb-breathe.is-down { background: rgba(52, 209, 127, 0.5); }
.wg-tb-cam { left: calc(var(--wg-sp) + env(safe-area-inset-left, 0px)); top: calc(var(--wg-sp) + 56px + env(safe-area-inset-top, 0px)); width: 48px; height: 40px; border-radius: 10px; }
.wg-tb-cam .wg-tbtn-glyph { font-size: 12px; }
.wg-tb-aimhint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--wg-sp) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 12, 24, 0.6);
  font-family: var(--wg-font-cond);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--wg-muted);
}

/* ---- race HUD: the ski-jump broadcast pieces step aside */
.wg-hud.is-race .wg-bug,
.wg-hud.is-race .wg-readout,
.wg-hud.is-race .wg-plate,
.wg-hud.is-race .wg-topright,
.wg-hud.is-race .wg-flight,
.wg-hud.is-race .wg-speed { display: none !important; }
.wg-rbug, .wg-rgaps, .wg-rsplit, .wg-rcluster, .wg-rprofile, .wg-rshoot, .wg-sight, .wg-reticle, .wg-rwindmark,
.wg-renergy, .wg-rheart, .wg-rspeed, .wg-reffort, .wg-rslip { display: none; }
.wg-hud.is-race .wg-rcluster { display: flex; }
.wg-rbug.is-on, .wg-rgaps.is-on, .wg-rprofile.is-on, .wg-rshoot.is-on { display: block; }
.wg-renergy.is-on { display: block; }
.wg-rheart.is-on, .wg-rspeed.is-on, .wg-reffort.is-on, .wg-rslip.is-on { display: flex; }
.wg-sight.is-on { display: block; }
.wg-hud.is-shooting .wg-rcluster,
.wg-hud.is-shooting .wg-rprofile,
.wg-hud.is-shooting .wg-rgaps { display: none !important; }

.wg-rbug {
  position: absolute;
  top: var(--wg-sp);
  left: var(--wg-sp);
  min-width: 190px;
  padding: 8px 12px 8px 10px;
  border-left: 3px solid var(--wg-ice);
}
.wg-rbug-top { display: flex; align-items: center; gap: 8px; font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.wg-rbug-format { color: var(--wg-ice); }
.wg-rbug-lap { color: var(--wg-text); }
.wg-rbug-clock { font-family: var(--wg-font-cond); font-weight: 800; font-size: 34px; line-height: 1.05; font-variant-numeric: tabular-nums; }
.wg-rbug-pos { display: flex; align-items: baseline; gap: 6px; font-family: var(--wg-font-cond); }
.wg-rbug-posval { font-weight: 800; font-size: 20px; }
.wg-rbug-poslabel { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wg-muted); }

.wg-rtop { position: absolute; top: var(--wg-sp); right: var(--wg-sp); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.wg-rgaps { min-width: 220px; padding: 6px 10px; }
.wg-rgap { display: grid; grid-template-columns: 52px 1fr auto; align-items: baseline; gap: 8px; padding: 2px 0; font-family: var(--wg-font-cond); }
.wg-rgap-k { font-weight: 600; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wg-muted); }
.wg-rgap-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 15px; }
.wg-rgap-v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.wg-rgap.is-pos .wg-rgap-v { color: #ff8d98; }
.wg-rgap.is-neg .wg-rgap-v { color: var(--wg-green); }
.wg-rgap.is-me .wg-rgap-v { color: var(--wg-gold); }
.wg-rsplit {
  display: none;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  font-family: var(--wg-font-cond);
  border-right: 4px solid #ff8d98;
  animation: wg-slide-in-right 0.35s var(--wg-ease) both;
}
.wg-rsplit.is-on { display: flex; }
.wg-rsplit.is-best { border-right-color: var(--wg-green); }
.wg-rsplit-label { font-weight: 600; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--wg-muted); }
.wg-rsplit-time { font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.wg-rsplit-rank { font-weight: 700; font-size: 18px; }
.wg-rsplit-gap { font-weight: 800; font-size: 20px; color: #ff8d98; }
.wg-rsplit.is-best .wg-rsplit-gap { color: var(--wg-green); }

.wg-rcluster {
  position: absolute;
  left: var(--wg-sp);
  bottom: var(--wg-sp);
  flex-direction: column;
  gap: 6px;
  width: 300px;
}
.wg-renergy { padding: 7px 10px 9px; }
.wg-renergy-head { display: flex; align-items: baseline; gap: 6px; }
.wg-renergy-head .wg-label { flex: 1; }
.wg-renergy-val { font-family: var(--wg-font-cond); font-weight: 800; font-size: 20px; line-height: 1; }
.wg-renergy-trend { font-size: 12px; }
.wg-renergy-trend.is-up { color: var(--wg-green); }
.wg-renergy-trend.is-down { color: #ff8d98; }
.wg-renergy-bar { position: relative; height: 12px; margin-top: 5px; border-radius: 6px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.wg-renergy-low { position: absolute; left: 0; top: 0; bottom: 0; width: 25%; background: rgba(255, 75, 92, 0.18); border-right: 1px dashed rgba(255, 75, 92, 0.6); }
.wg-renergy-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 6px; background: linear-gradient(90deg, #13a35a, #34d17f); transition: width 0.2s linear; }
.wg-renergy.is-mid .wg-renergy-fill { background: linear-gradient(90deg, #d8960f, #ffbe3b); }
.wg-renergy.is-low .wg-renergy-fill { background: linear-gradient(90deg, #c4182b, #ff4b5c); }
.wg-renergy.is-low { border-color: rgba(255, 75, 92, 0.7); animation: wg-race-alarm 0.9s ease-in-out infinite; }
.wg-renergy.is-empty-tank .wg-renergy-val { color: var(--wg-red); }
.wg-rrow { display: flex; align-items: stretch; gap: 6px; }
.wg-rheart, .wg-rspeed { align-items: baseline; gap: 4px; padding: 5px 9px; font-family: var(--wg-font-cond); }
.wg-rheart-icon { display: inline-block; color: var(--wg-red); font-size: 18px; animation: wg-heartbeat 0.8s ease-in-out infinite; }
.wg-rheart-val, .wg-rspeed-val { font-weight: 800; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.wg-rheart.is-calm .wg-rheart-val { color: var(--wg-green); }
.wg-rheart.is-hard .wg-rheart-val { color: var(--wg-amber); }
.wg-rheart.is-max .wg-rheart-val { color: var(--wg-red); }
.wg-rheart.is-max { border-color: rgba(255, 75, 92, 0.7); }
.wg-reffort {
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: var(--wg-radius);
  background: rgba(6, 12, 24, 0.7);
  border: 1px solid var(--wg-line);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.1em;
}
.wg-reffort.is-push { color: var(--wg-amber); border-color: rgba(255, 190, 59, 0.6); }
.wg-reffort.is-boost, .wg-reffort.is-superboost { color: #06121f; background: var(--wg-amber); }
.wg-reffort.is-ease { color: var(--wg-green); }
.wg-reffort.is-tuck { color: var(--wg-ice); border-color: rgba(92, 200, 255, 0.6); }
.wg-reffort-super { display: none; padding: 1px 5px; border-radius: 4px; font-size: 10px; background: rgba(255, 255, 255, 0.14); color: var(--wg-muted); }
.wg-reffort-super.is-ready { display: inline-block; background: var(--wg-gold); color: #241800; }
.wg-rslip { flex-direction: column; gap: 3px; padding: 5px 9px; border-radius: var(--wg-radius); background: rgba(6, 12, 24, 0.66); border: 1px solid rgba(92, 200, 255, 0.35); }
.wg-rslip.is-active { border-color: var(--wg-ice); box-shadow: 0 0 12px rgba(92, 200, 255, 0.45); }
.wg-rslip-text { font-family: var(--wg-font-cond); font-weight: 700; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wg-ice); }
.wg-rslip-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.wg-rslip-fill { display: block; height: 100%; width: 0; background: var(--wg-ice); }

.wg-rprofile {
  position: absolute;
  right: var(--wg-sp);
  bottom: var(--wg-sp);
  width: min(380px, 34vw);
  height: 70px;
  padding: 6px 10px 8px;
  box-sizing: border-box;
}
.wg-rprofile-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.wg-rprofile-area { fill: rgba(92, 200, 255, 0.14); }
.wg-rprofile-line { fill: none; stroke: rgba(220, 235, 250, 0.8); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.wg-rprofile-done { fill: rgba(92, 200, 255, 0.22); }
.wg-rprofile-marks { position: absolute; left: 10px; right: 10px; top: 4px; bottom: 6px; }
.wg-rmark { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; font-family: var(--wg-font-cond); line-height: 1; }
.wg-rmark-glyph { font-size: 12px; color: var(--wg-muted); }
.wg-rmark-label { font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--wg-dim); white-space: nowrap; }
.wg-rmark.is-range .wg-rmark-glyph { color: var(--wg-amber); }
.wg-rmark.is-finish .wg-rmark-glyph { color: #fff; }
.wg-rmark.is-climb .wg-rmark-glyph { color: #ff8d98; }
.wg-rmark.is-descent .wg-rmark-glyph { color: var(--wg-green); }
.wg-rprofile-me {
  position: absolute;
  bottom: 4px;
  width: 12px;
  height: 12px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--wg-ice);
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(92, 200, 255, 0.8);
  transform: translateX(-50%);
}

/* ---- shooting HUD */
.wg-rshoot { position: absolute; inset: 0; pointer-events: none; }
.wg-rtargets {
  position: absolute;
  left: 50%;
  top: var(--wg-sp);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
}
.wg-rtargets-side { display: flex; flex-direction: column; gap: 2px; min-width: 72px; font-family: var(--wg-font-cond); }
.wg-rtargets-side.is-right { align-items: flex-end; }
.wg-rtargets-stance { font-weight: 800; font-size: 18px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wg-ice); }
.wg-rtargets-lane, .wg-rtargets-spares { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wg-muted); }
.wg-rtargets-spares { color: var(--wg-amber); }
.wg-rtargets-shots { font-weight: 800; font-size: 16px; }
.wg-rtargets-timer { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--wg-muted); }
.wg-rplates { display: flex; gap: 8px; }
.wg-rplate { width: 30px; height: 30px; border-radius: 50%; background: #111a26; border: 2px solid rgba(255, 255, 255, 0.55); box-sizing: border-box; transition: background 0.12s, transform 0.12s; }
.wg-rplate.is-hit { background: #f4f7fb; border-color: #fff; animation: wg-pop 0.25s var(--wg-ease); }
.wg-rplate.is-next { border-color: var(--wg-tone-action); box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.35); }
.wg-rready {
  position: absolute;
  left: 50%;
  top: calc(var(--wg-sp) + 62px);
  transform: translateX(-50%);
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(6, 12, 24, 0.7);
  font-family: var(--wg-font-cond);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--wg-amber);
}
.wg-rready.is-ready { color: var(--wg-green); }
.wg-rready.is-empty { display: none; }
/* the player's marker over their skier (start grid, TV and high views) */
.wg-rme { position: absolute; left: 0; top: 0; display: none; pointer-events: none; will-change: transform; }
.wg-rme.is-on { display: block; }
.wg-rme-text, .wg-rme-arrow { position: absolute; left: 0; transform: translateX(-50%); font-family: var(--wg-font-cond); font-weight: 800; color: var(--wg-gold); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85); white-space: nowrap; }
.wg-rme-text { bottom: 14px; font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase; }
.wg-rme-arrow { bottom: 0; font-size: 14px; line-height: 1; }
.wg-rbreath {
  position: absolute;
  left: var(--wg-sp);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 78px;
  padding: 8px 6px;
  font-family: var(--wg-font-cond);
}
.wg-rbreath-bar { position: relative; width: 18px; height: 140px; border-radius: 9px; overflow: hidden; background: rgba(255, 255, 255, 0.1); }
.wg-rbreath-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(0deg, #2f7cff, #5cc8ff); }
.wg-rbreath.is-hold .wg-rbreath-fill { background: linear-gradient(0deg, #13a35a, #34d17f); }
.wg-rbreath.is-gasp .wg-rbreath-fill { background: linear-gradient(0deg, #c4182b, #ff4b5c); }
.wg-rbreath.is-gasp { border-color: rgba(255, 75, 92, 0.7); animation: wg-race-alarm 0.6s ease-in-out infinite; }
.wg-rbreath-state { font-weight: 800; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; }
.wg-rbreath.is-hold .wg-rbreath-state { color: var(--wg-green); }
.wg-rbreath.is-gasp .wg-rbreath-state { color: var(--wg-red); }
.wg-rbreath-hr { display: flex; align-items: baseline; gap: 3px; }
.wg-rbreath-hrval { font-weight: 800; font-size: 18px; }
/* wind: in the top shooting band, right of the target strip (never over the plate) */
.wg-rwind {
  position: absolute;
  left: calc(50% + 222px);
  top: var(--wg-sp);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-family: var(--wg-font-cond);
}
.wg-rwind-arrow { --len: 60%; position: relative; display: block; width: 70px; height: 18px; color: var(--wg-ice); }
.wg-rwind-shaft { position: absolute; left: calc(50% - var(--len) / 2); top: 7px; width: var(--len); height: 4px; border-radius: 2px; background: currentColor; }
.wg-rwind-head { position: absolute; left: calc(50% + var(--len) / 2 - 2px); top: 2px; border-top: 7px solid transparent; border-bottom: 7px solid transparent; border-left: 11px solid currentColor; }
.wg-rwind-arrow.is-calm { color: var(--wg-dim); }
.wg-rwind-text { font-weight: 700; font-size: 15px; }
.wg-reticle {
  --rr: 10px;
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  will-change: transform;
}
.wg-reticle.is-on { display: block; }
.wg-reticle::before,
.wg-reticle::after { content: ''; position: absolute; box-sizing: border-box; }
.wg-reticle::before {
  left: calc(-1 * var(--rr));
  top: calc(-1 * var(--rr));
  width: calc(2 * var(--rr));
  height: calc(2 * var(--rr));
  border-radius: 50%;
  border: 2px solid rgba(255, 176, 32, 0.95);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.wg-reticle::after { left: -2px; top: -2px; width: 4px; height: 4px; border-radius: 50%; background: #ffb020; }
.wg-reticle.is-ready::before { border-color: rgba(48, 209, 88, 0.95); }
.wg-reticle.is-ready::after { background: #30d158; }
.wg-rwindmark { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; border: 2px dashed rgba(92, 200, 255, 0.85); box-sizing: border-box; }
.wg-rwindmark.is-on { display: block; }
.wg-sight { position: absolute; inset: 0; pointer-events: none; }
.wg-sight-ring { position: absolute; left: 0; top: 0; border-radius: 50%; box-sizing: border-box; border: 3px solid rgba(20, 26, 34, 0.95); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.wg-sight-post { position: absolute; left: calc(50% - 2px); top: 50%; width: 4px; height: 50%; background: rgba(15, 20, 28, 0.9); }

@keyframes wg-heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.3); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
}
@keyframes wg-race-alarm {
  0%, 100% { box-shadow: var(--wg-shadow); }
  50% { box-shadow: var(--wg-shadow), 0 0 0 3px rgba(255, 75, 92, 0.45); }
}

/* the guide (prompt) sits above the race cluster on desktop */
.wg-hud.is-race .wg-guide { bottom: calc(var(--wg-sp) + 96px); }
.wg-hud.is-shooting .wg-guide { bottom: calc(var(--wg-sp) + 6px); }

/* touch: lift race pieces above the buttons */
.wg-ui.is-touch .wg-rbug { left: calc(var(--wg-sp) + 58px); }
.wg-ui.is-touch .wg-rcluster { bottom: calc(var(--wg-sp) + 150px); }
.wg-ui.is-touch .wg-rprofile { bottom: calc(var(--wg-sp) + 248px); }
.wg-ui.is-touch .wg-hud.is-race .wg-guide { bottom: calc(var(--wg-sp) + 250px); }
.wg-ui.is-touch .wg-rbreath { top: 42%; }

@media (max-width: 1000px) {
  .wg-rprofile { width: min(300px, 40vw); }
  .wg-rwind { left: auto; right: var(--wg-sp); top: calc(var(--wg-sp) + 64px); }
}
@media (max-width: 899px) {
  .wg-picker-ready { grid-template-columns: minmax(0, 1fr); }
  .wg-sum-hero, .wg-sum-shoot, .wg-sum-coach, .wg-sum-splits, .wg-sum-stats { grid-column: span 12; }
}
@media (max-width: 599px) {
  .wg-picker-soon { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wg-sport-card.is-soon .wg-sport-art-box { aspect-ratio: 16 / 9; }
  .wg-sport-card.is-soon .wg-sport-body { padding: 8px 8px 10px; gap: 4px; }
  .wg-sport-card.is-soon .wg-sport-name { font-size: 14px; letter-spacing: 0.02em; }
  .wg-sport-card.is-soon .wg-sport-tag { display: none; }
  .wg-sport-card.is-soon .wg-sport-soon { font-size: 10px; padding: 2px 6px; }
  .wg-sport-name { font-size: 24px; }
  .wg-sport-art-box { aspect-ratio: 16 / 6; }
  .wg-format-grid { grid-template-columns: minmax(0, 1fr); }
  .wg-table .c-x-opt { display: none; }
  .wg-table .c-x { font-size: 14px; }
  .wg-shoot-bouts { display: none; }
  .wg-start-table .c-note { display: none; }
  .wg-sum-rank-val { font-size: 48px; }
  .wg-sum-time-val { font-size: 30px; }
  .wg-ctl-row { grid-template-columns: fit-content(55%) minmax(0, 1fr); gap: 8px; }
  .wg-ctl-keys { min-width: 84px; }
  /* race HUD on a phone: compact top band, instrument row at the bottom */
  .wg-rbug { min-width: 0; padding: 5px 8px; }
  .wg-rbug-clock { font-size: 24px; }
  .wg-rbug-top { font-size: 11px; gap: 6px; }
  .wg-rbug-posval { font-size: 16px; }
  .wg-rgaps { min-width: 0; width: 168px; padding: 4px 8px; }
  .wg-rgap { grid-template-columns: 40px 1fr auto; gap: 4px; }
  .wg-rgap-name { font-size: 12px; }
  .wg-rgap-v { font-size: 14px; }
  .wg-rbug .wg-diff-chip { display: none; }
  .wg-rtop { top: calc(var(--wg-sp) + 80px); }
  .wg-rsplit { padding: 5px 10px; gap: 8px; }
  .wg-rsplit-time { font-size: 18px; }
  .wg-rsplit-gap, .wg-rsplit-rank { font-size: 16px; }
  .wg-rcluster { width: calc(100vw - 2 * var(--wg-sp)); gap: 5px; }
  .wg-renergy { padding: 5px 9px 7px; }
  .wg-renergy-bar { height: 9px; margin-top: 3px; }
  .wg-rheart, .wg-rspeed { padding: 3px 8px; }
  .wg-rheart-val, .wg-rspeed-val { font-size: 18px; }
  .wg-rslip { padding: 3px 8px; }
  .wg-rprofile { left: var(--wg-sp); right: var(--wg-sp); width: auto; height: 46px; padding: 3px 8px; }
  .wg-rmark-label { display: none; }
  .wg-rtargets { gap: 8px; padding: 6px 8px; top: calc(var(--wg-sp) + 80px); }
  .wg-rplate { width: 24px; height: 24px; }
  .wg-rplates { gap: 5px; }
  .wg-rtargets-side { min-width: 54px; }
  .wg-rtargets-stance { font-size: 14px; }
  .wg-rready { top: calc(var(--wg-sp) + 128px); }
  .wg-rbreath { width: 60px; }
  .wg-rbreath-bar { height: 100px; }
  .wg-rwind { left: auto; right: var(--wg-sp); top: calc(var(--wg-sp) + 124px); padding: 4px 8px; gap: 6px; }
  .wg-rwind-arrow { width: 44px; }
  /* bottom stack on a phone: profile strip, instruments, prompt (touch: above the buttons) */
  .wg-ui:not(.is-touch) .wg-rprofile { bottom: var(--wg-sp); }
  .wg-ui:not(.is-touch) .wg-rcluster { bottom: calc(var(--wg-sp) + 52px); }
  .wg-ui:not(.is-touch) .wg-hud.is-race .wg-guide { bottom: calc(var(--wg-sp) + 180px); }
  .wg-ui.is-touch .wg-rprofile { bottom: calc(var(--wg-sp) + 206px); }
  .wg-ui.is-touch .wg-rcluster { bottom: calc(var(--wg-sp) + 258px); }
  .wg-ui.is-touch .wg-hud.is-race .wg-guide { bottom: calc(var(--wg-sp) + 386px); }
  .wg-ui.is-touch .wg-hud.is-shooting .wg-guide { bottom: calc(var(--wg-sp) + 128px); }
  /* skiing on a phone: the skier zone is the middle band (the trail camera frames the skier at
     ~33–56 % of the height), so the prompt docks in the top band under the gap panel */
  .wg-ui .wg-hud.is-race:not(.is-shooting) .wg-guide { top: calc(var(--wg-sp) + 168px); bottom: auto; }
}

/* Short landscape screens (phones held sideways, small windows): the race prompt shrinks so a
   long text ('Slipstreaming behind …: ← → to pull out') stays inside its box, and it sits above
   the instrument stack instead of under it. */
@media (max-height: 520px) and (min-width: 600px) {
  .wg-hud.is-race:not(.is-shooting) .wg-guide { bottom: calc(var(--wg-sp) + 150px); }
  .wg-hud.is-race .wg-prompt { max-width: min(460px, 50vw); }
  .wg-hud.is-race .wg-prompt-inner { gap: 10px; padding: 6px 14px 6px 8px; border-radius: 14px; }
  .wg-hud.is-race .wg-prompt-text { font-size: 19px; }
  .wg-hud.is-race .wg-prompt-sub { font-size: 13px; }
  .wg-hud.is-race .wg-prompt .wg-kc { --kc: 40px; --kc-glyph: 24px; }
  .wg-hud.is-race .wg-prompt .wg-kcs-col { flex-direction: row; }
}
/* Narrow or short windows: the race key legend would sit on the energy panel and the course
   profile; it gives way (H opens the full controls, the countdown hint lists the keys). */
@media (max-width: 1239px), (max-height: 520px) {
  .wg-ui:has(.wg-hud.is-race) .wg-legend { display: none; }
}
/* otherwise it centres in the gap between the energy panel and the course profile */
.wg-ui:has(.wg-hud.is-race) .wg-legend { left: calc(50% - 40px); gap: 12px; }
