/* The same Alpine Broadcast palette, typography and cover art as the training menu. */
:root {
  --ink: #07111f;
  --ink-2: #0c1a2e;
  --glass: rgba(7, 17, 31, .8);
  --glass-2: rgba(10, 22, 40, .92);
  --line: rgba(170, 200, 235, .16);
  --line-2: rgba(170, 200, 235, .3);
  --snow: #f3f7fb;
  --mist: #a3b6cc;
  --amber: #ffbf47;
  --amber-hi: #ffd27a;
  --amber-ink: #231500;
  --font: 'Bahnschrift', 'DIN Alternate', 'Segoe UI', system-ui, -apple-system, 'Roboto', 'Ubuntu Sans', sans-serif;
  --cond: 'Bahnschrift', 'DIN Condensed', 'Avenir Next Condensed', 'Roboto Condensed', 'Ubuntu Sans', 'Arial Narrow', sans-serif-condensed, sans-serif;
  --page-left: max(clamp(20px, 4.4vw, 72px), env(safe-area-inset-left, 0px));
  --page-right: max(clamp(20px, 3vw, 48px), env(safe-area-inset-right, 0px));
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }
body { margin: 0; background: var(--ink); color: var(--snow); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, .button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* Full-screen illustrated menu. The lower edge becomes the dark results area. */
.lobby { position: relative; isolation: isolate; overflow: clip; }
.keyart { position: absolute; z-index: -2; inset: 0; background: #0a1630 url('/online/keyart.webp') center / cover no-repeat; }
.lobby::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgba(6,13,26,.86) 0%, rgba(6,13,26,.55) 34%, rgba(6,13,26,0) 65%), linear-gradient(0deg, var(--ink) 0%, rgba(6,13,26,.75) 12%, rgba(6,13,26,0) 55%); }
.menu-grid { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); grid-template-rows: auto 1fr auto; grid-template-areas: 'brand util' 'entry .' 'pick pick'; column-gap: 32px; row-gap: clamp(18px, 2.5vh, 28px); padding: clamp(22px, 5vh, 56px) var(--page-right) 32px var(--page-left); }
.brand { grid-area: brand; }
.wordmark { margin: 0; display: grid; justify-items: start; font: 700 clamp(64px, min(7.6vw, 11.8vh), 116px)/.86 var(--cond); font-stretch: condensed; text-transform: uppercase; letter-spacing: -.005em; transform: skewX(-9deg); transform-origin: left bottom; }
.wordmark span { display: block; }
.wm-2 { color: var(--amber); margin-left: .42em; }
.lede { max-width: 40ch; margin: clamp(14px, 2vh, 20px) 0 0; color: #d3dde8; font-size: 17px; line-height: 1.5; text-shadow: 0 1px 12px rgba(0,0,0,.6); }
.util { grid-area: util; justify-self: end; align-self: start; display: flex; gap: 8px; }
.ubtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px; border-radius: 4px; border: 1px solid var(--line-2); background: rgba(7,17,31,.6); backdrop-filter: blur(8px); font-weight: 600; font-size: 15px; }
.ubtn:hover { border-color: var(--amber); }
.entry { grid-area: entry; max-width: 520px; align-self: start; }
.contest-info { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.contest-info > div { display: grid; gap: 3px; }
#day { color: #d3dde8; font-size: 13px; }
.hill-name { font-size: 14px; color: var(--mist); }
.hill-name b { color: var(--snow); font-weight: 600; margin-left: 6px; }
.countdown { text-align: right; }
#clock { font: 700 30px/1 var(--cond); font-stretch: condensed; font-variant-numeric: tabular-nums; color: var(--amber); }
#deadline { font-size: 11px; color: var(--mist); }
.modes { display: grid; }
.mode { display: grid; grid-template-columns: 34px auto minmax(0, 1fr); align-items: center; gap: 14px; min-height: 56px; padding: 10px 18px 10px 14px; border-bottom: 1px solid var(--line-2); }
.mode .mi { display: grid; place-items: center; width: 34px; height: 34px; border: 1.5px solid var(--line-2); border-radius: 50%; }
.mode .mi .i { width: 16px; height: 16px; }
.mode .mt { font: 700 30px/1 var(--cond); font-stretch: condensed; }
.mode .md { font-size: 14px; color: var(--mist); line-height: 1.3; }
.mode:hover .mt { color: var(--amber); }
.mode.primary { min-height: 72px; margin-bottom: 6px; border: 0; padding-right: 28px; background: var(--amber); color: var(--amber-ink); clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); }
.mode.primary .mt { font-size: 36px; }
.mode.primary .md { color: rgba(35,21,0,.78); font-weight: 600; }
.mode.primary .mi { background: var(--amber-ink); color: var(--amber); border-color: var(--amber-ink); }
.mode.primary:hover { background: var(--amber-hi); }
.mode.primary:hover .mt { color: var(--amber-ink); }
.mode.primary:focus-visible { outline: 3px solid var(--amber-ink); outline-offset: -6px; }
.account { padding-top: 14px; }
.account-line { display: flex; align-items: center; gap: 12px; justify-content: space-between; font-size: 13px; color: #d3dde8; }
.text-button { min-height: 32px; padding: 0 2px; border: 0; background: transparent; color: var(--mist); font-size: 12px; }
.text-button:hover { color: var(--amber); }
#devLogin { display: flex; gap: 8px; margin-top: 8px; }
input, select { min-width: 0; max-width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 4px; background: rgba(7,17,31,.75); color: var(--snow); }
input::placeholder { color: var(--mist); opacity: 1; }
#name { flex: 1; width: 100%; }
button:not(.text-button), .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 8px 18px; background: rgba(7,17,31,.65); color: var(--snow); border: 1px solid var(--line-2); border-radius: 4px; font-weight: 600; font-size: 14px; }
button:not(.text-button):hover, .button:hover { border-color: var(--amber); color: var(--amber-hi); }
button:disabled { opacity: .45; cursor: default; }
#devLogin button { white-space: nowrap; }
#login { width: 100%; margin-top: 12px; }

/* Login popup over the cover art: native <dialog> (focus trap, Esc, top layer). */
.auth-dialog { width: min(460px, calc(100vw - 24px)); max-width: none; max-height: calc(100dvh - 24px); margin: auto; padding: 0; border: 0; background: transparent; color: var(--snow); overflow: visible; }
.auth-dialog::backdrop { background: rgba(4,9,18,.74); backdrop-filter: blur(6px); }
.auth-card { position: relative; max-height: calc(100dvh - 24px); overflow: auto; padding: 30px 28px 22px; border: 1px solid var(--line-2); border-top: 3px solid var(--amber); border-radius: 5px; background: linear-gradient(160deg, rgba(49,63,97,.96), rgba(9,21,38,.99) 62%); box-shadow: 0 30px 90px rgba(0,0,0,.6); }
.auth-dialog[open] .auth-card { animation: auth-in .2s ease-out; }
@keyframes auth-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.auth-close { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 40px; height: 40px; }
.auth-card h2 { margin: 0; padding-right: 36px; font: 700 40px/1 var(--cond); font-stretch: condensed; }
.auth-lede { margin: 10px 0 20px; color: #c0cede; font-size: 14px; }
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 18px; border: 1px solid var(--line-2); border-radius: 4px; background: rgba(7,17,31,.6); }
.auth-switch button { min-height: 38px; border: 0; border-radius: 3px; background: transparent; color: var(--mist); }
.auth-switch button:hover { color: var(--snow); }
.auth-switch button[aria-pressed='true'] { background: var(--amber); color: var(--amber-ink); }
#emailLogin { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--mist); }
.field legend { padding: 0; margin-bottom: 6px; }
.field legend b { margin-left: 6px; color: var(--snow); }
.field input { width: 100%; min-height: 46px; font-size: 16px; font-weight: 400; letter-spacing: 0; }
.field input:focus { border-color: var(--amber); outline: none; }
.country-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.country { position: relative; display: grid; place-items: center; padding: 6px 4px; border: 1px solid var(--line); border-radius: 4px; background: rgba(7,17,31,.5); cursor: pointer; }
.country:hover { border-color: var(--line-2); }
.country:has(input:checked) { border-color: var(--amber); background: rgba(255,191,71,.14); box-shadow: 0 0 0 1px var(--amber); }
.country:has(input:focus-visible) { outline: 2px solid var(--amber); outline-offset: 2px; }
.country .flag { width: 100%; max-width: 36px; height: auto; margin: 0; }
.flag { display: inline-block; width: 21px; height: 14px; margin-right: 8px; vertical-align: -2px; border-radius: 1.5px; box-shadow: 0 0 0 1px rgba(255,255,255,.18); }
.auth-hint { margin: 0; font-size: 12px; color: var(--mist); }
.auth-error { margin: 0; color: #ff9c8a; font-size: 13px; }
.auth-error:empty { display: none; }
.auth-card .auth-submit { width: 100%; min-height: 54px; margin-top: 4px; background: var(--amber); color: var(--amber-ink); border: 0; border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); font: 700 25px/1 var(--cond); font-stretch: condensed; }
.auth-card .auth-submit:hover { background: var(--amber-hi); color: var(--amber-ink); }
.auth-card .auth-submit:focus-visible { outline-color: var(--amber-ink); outline-offset: -5px; }
.auth-foot { margin: 16px 0 0; text-align: center; font-size: 12px; color: var(--mist); }
.account-line #identity { min-width: 0; overflow-wrap: anywhere; }
#openLogin { color: var(--amber); font-size: 13px; font-weight: 600; }
#message { margin: 8px 0 0; color: var(--amber-hi); font-size: 13px; }
#message:empty { display: none; }

/* The three stages occupy the training menu's hill-selection strip. */
.pick { grid-area: pick; min-width: 0; margin-top: 10px; }
.pick-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.pick-heading h2 { margin: 0; font-size: 15px; font-weight: 600; }
.pick-heading > span { font-size: 12px; color: var(--mist); }
.panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.panel { position: relative; min-width: 0; display: flex; flex-direction: column; padding: 14px 18px; border: 1px solid var(--line-2); border-radius: 5px; background: linear-gradient(160deg, rgba(49,63,97,.65), rgba(9,21,38,.95) 66%); backdrop-filter: blur(10px); box-shadow: 0 18px 44px rgba(0,0,0,.2); }
.panel[data-stage='q'] { border-color: var(--amber); box-shadow: inset 0 2px var(--amber), 0 18px 44px rgba(0,0,0,.2); }
.number { font-size: 10px; font-weight: 600; letter-spacing: .12em; color: var(--mist); }
.panel[data-stage='q'] .number { color: var(--amber); }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 5px 0 3px; }
.panel h3 { margin: 0; font: 700 30px/1 var(--cond); font-stretch: condensed; }
.best { font: 700 29px/1 var(--cond); font-stretch: condensed; font-variant-numeric: tabular-nums; white-space: nowrap; }
.best small { font: 400 12px/1 var(--font); color: var(--mist); }
.subtitle { margin: 0 0 10px; font-size: 12px; color: var(--mist); min-height: 18px; }
.attempts { list-style: none; margin: 0 0 12px; padding: 0; flex: 1; }
.attempts li { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-height: 25px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 12px; }
.attempts li > span:first-child { color: var(--mist); }
.attempts li > a { color: var(--amber-hi); }
.panel .button { min-height: 36px; font-size: 14px; }
.panel[data-stage='q'] .button { background: var(--amber); color: var(--amber-ink); border-color: transparent; border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 100%, 0 100%); }
.panel[data-stage='q'] .button:hover { background: var(--amber-hi); }
.panel[data-stage='q'] .button:focus-visible { outline-color: var(--amber-ink); outline-offset: -4px; }
.panel > .muted { margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line); }

/* Training uses the same four hills, profiles and local records as the game. */
.training-hills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.training-hills .training-hill { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-content: end; justify-content: stretch; justify-items: start; gap: 3px; min-width: 0; min-height: clamp(190px, 24vh, 240px); padding: 16px; text-align: left; background: #364c69; border-radius: 5px; }
.training-hill::before { content: ''; position: absolute; inset: 0; z-index: -2; background: url('/online/panorama.webp') center / auto 110% no-repeat; }
.training-hill[data-sky='afternoon'] { background: #825f74; }
.training-hill[data-sky='afternoon']::before { filter: sepia(.35) hue-rotate(325deg); background-position: 35% center; }
.training-hill[data-sky='dusk'] { background: #2d294d; }
.training-hill[data-sky='dusk']::before { filter: brightness(.65) sepia(.2) hue-rotate(330deg); background-position: 65% center; }
.training-hill[data-sky='night'] { background: #101b31; }
.training-hill[data-sky='night']::before { filter: brightness(.45) saturate(.7); background-position: 80% center; }
.training-hill::after { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(180deg, rgba(7,17,31,.05) 10%, rgba(7,17,31,.7) 55%, rgba(7,17,31,.96)); }
.training-hill .hill-profile { position: absolute; z-index: -1; top: 4px; left: 0; width: 100%; height: 52%; }
.training-hills .training-hill:hover { color: var(--snow); }
.training-hill[aria-checked='true'] { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 18px 44px rgba(0,0,0,.4); transform: translateY(-4px); }
.hill-size { display: flex; align-items: baseline; gap: 8px; }
.hill-size b { font: 700 34px/1 var(--cond); }
.training-hill[aria-checked='true'] .hill-size b { color: var(--amber); }
.hill-size > span, .hill-place { font-size: 13px; color: var(--mist); }
.training-hill .hill-name { font-size: 17px; font-weight: 700; line-height: 1.2; color: var(--snow); }
.hill-record { font-size: 12px; font-weight: 400; margin-top: 4px; color: #d3dde8; }
.hill-record b { display: block; color: var(--amber); font-weight: 600; }
.hill-selected { position: absolute; top: 10px; right: 10px; padding: 3px 8px; border-radius: 3px; color: var(--amber-ink); background: var(--amber); font-size: 12px; visibility: hidden; }
.training-hill[aria-checked='true'] .hill-selected { visibility: visible; }
.training-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }
.training-actions p { color: var(--mist); font-size: 14px; }
#startTraining { min-height: 52px; padding: 12px 28px; background: var(--amber); color: var(--amber-ink); border: 0; border-radius: 0; clip-path: polygon(0 0, 100% 0, calc(100% - 12px) 100%, 0 100%); font: 700 25px/1 var(--cond); }
#startTraining:hover { background: var(--amber-hi); }
#startTraining:focus-visible { outline-color: var(--amber-ink); outline-offset: -5px; }
.training-playing { overflow: hidden; }
.training-player { position: fixed; z-index: 1000; inset: 0; height: 100dvh; background: var(--ink); }
.training-player iframe { display: block; border: 0; width: 100%; height: 100%; }
.training-loading { position: absolute; z-index: 1; inset: 0; display: grid; align-content: center; justify-items: center; gap: 16px; background: var(--ink); }

/* Results retain the compact broadcast graphics from the game. */
.lower-content { padding: 28px var(--page-right) 24px var(--page-left); }
.broadcast { padding: 26px 28px; border: 1px solid var(--line-2); border-top: 3px solid var(--amber); border-radius: 4px; background: var(--glass-2); }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.eyebrow { margin: 0 0 7px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; color: var(--mist); }
.lower-content h2 { margin: 0; font: 700 36px/1.1 var(--cond); font-stretch: condensed; }
.section-head label { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--mist); }
#broadcastStatus { margin: 18px 0 0; color: #d3dde8; }
#next { color: var(--amber); font-size: 14px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--mist); font-size: 12px; font-weight: 500; }
td:last-child, th:last-child { text-align: right; font-variant-numeric: tabular-nums; }
td:nth-child(2) { overflow-wrap: anywhere; }
summary { cursor: pointer; color: var(--mist); }
.qualification { margin-top: 25px; }
.rules { padding: 40px 0 32px; max-width: 1120px; }
.rules > p:not(.eyebrow) { max-width: 860px; color: #c0cede; line-height: 1.7; }
.advancement { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.advancement > span { display: flex; align-items: center; gap: 16px; font-size: 14px; color: #d3dde8; }
.advancement b { font: 700 38px/1 var(--cond); font-stretch: condensed; color: var(--amber); white-space: nowrap; }
.muted { color: var(--mist); font-size: 12px; line-height: 1.5; }
footer { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--mist); font-size: 12px; }
.site-name { color: var(--snow); font-size: 15px; font-weight: 700; }
.verification { margin-left: auto; }
#commitment { max-width: 75ch; overflow-wrap: anywhere; font-size: 11px; }
#admin { padding: 24px; margin-bottom: 32px; border: 1px solid var(--line); }
#moderation { display: flex; flex-wrap: wrap; gap: 8px; }
pre { max-height: 500px; overflow: auto; padding: 16px; background: var(--ink-2); font-size: 12px; }

@media (min-width: 1800px) {
  .menu-grid { grid-template-columns: minmax(0, 650px) minmax(0, 1fr); }
  .wordmark { font-size: 128px; }
  .entry { max-width: 580px; }
}
@media (max-width: 1000px) {
  .menu-grid { grid-template-columns: minmax(0, 500px) minmax(0, 1fr); column-gap: 20px; }
  .util { flex-wrap: wrap; justify-content: end; }
  .ubtn { font-size: 13px; padding: 0 10px; }
  .panel { padding: 14px; }
  .panel h3 { font-size: 27px; }
  .subtitle { min-height: 34px; }
  .training-hills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  :root { --page-left: max(16px, env(safe-area-inset-left, 0px)); --page-right: max(16px, env(safe-area-inset-right, 0px)); }
  body { font-size: 14px; }
  .keyart { height: 820px; background-position: 71% 12%; }
  .lobby::before { background: linear-gradient(0deg, var(--ink) 0%, var(--ink) calc(100% - 810px), rgba(6,13,26,.6) calc(100% - 480px), rgba(6,13,26,.3) 100%); }
  .menu-grid { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto auto; grid-template-areas: 'util' 'brand' 'entry' 'pick'; row-gap: 22px; padding-top: max(12px, env(safe-area-inset-top, 0px)); padding-bottom: 0; }
  .util { gap: 6px; flex-wrap: nowrap; }
  .ubtn { min-height: 40px; font-size: 13px; padding: 0 10px; }
  .wordmark { font-size: clamp(64px, 20vw, 96px); }
  .lede { margin-top: 14px; max-width: 34ch; font-size: 15px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 22px rgba(0,0,0,.7); }
  .entry { max-width: none; }
  .contest-info { margin-bottom: 14px; }
  #day { font-size: 12px; }
  .hill-name { font-size: 12px; }
  #clock { font-size: 28px; }
  #deadline { max-width: 130px; font-size: 10px; }
  .mode { grid-template-columns: 30px minmax(0,1fr); column-gap: 12px; row-gap: 3px; padding: 10px 14px; }
  .mode .mi { grid-row: 1 / 3; width: 30px; height: 30px; }
  .mode .mt { font-size: 28px; }
  .mode .md { grid-column: 2; font-size: 13px; }
  .mode.primary .mt { font-size: 34px; }
  #devLogin button { padding: 8px 12px; font-size: 13px; }
  .auth-card { padding: 26px 18px 18px; }
  .auth-card h2 { font-size: 34px; }
  .country-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .account-line { font-size: 12px; }
  .pick { margin-top: 2px; }
  .pick-heading > span { font-size: 10px; }
  .training-hills { gap: 12px; }
  .training-hills .training-hill { min-height: 205px; padding: 12px; transform: none; }
  .training-hill .hill-name { font-size: 16px; }
  .hill-place { font-size: 12px; }
  .hill-selected { top: 7px; right: 7px; font-size: 10px; }
  .training-actions { flex-direction: column; gap: 6px; align-items: stretch; }
  .training-actions p { margin: 0 0 6px; }
  .panels { grid-template-columns: 1fr; gap: 12px; }
  .panel { padding: 14px 16px; }
  .panel h3 { font-size: 30px; }
  .subtitle { min-height: 0; }
  .attempts li { min-height: 29px; font-size: 13px; }
  .panel .button { min-height: 42px; }
  .lower-content { padding-top: 28px; }
  .broadcast { padding: 20px 16px; }
  .section-head { align-items: start; gap: 16px; }
  .lower-content h2 { font-size: 30px; }
  .section-head label { width: 100%; justify-content: space-between; }
  .advancement { grid-template-columns: 1fr; gap: 20px; }
  .advancement b { min-width: 80px; }
  .rules { padding: 32px 0 24px; }
  .verification { width: 100%; margin-left: 0; }
  th, td { padding: 10px 4px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .auth-dialog[open] .auth-card { animation: none; } }
