.cup-invite { margin:24px 0 0; padding:22px clamp(18px,3vw,38px); border:1px solid #bab39c; border-left:5px solid #ae492c; display:flex; align-items:center; justify-content:space-between; gap:16px; background:#f0ebdd; color:#19392f }
.cup-invite h2 { font:700 clamp(23px,2.5vw,34px)/1.14 Georgia,serif; margin:5px 0 }
.cup-invite p { margin:0; max-width:58ch }
.cup-invite .btn { flex:none }
.flying .cup-invite { display:none }
.record-list small { display:block; font-size:11px; margin-top:3px }
.board-title { display:flex; flex-wrap:wrap; align-items:baseline; justify-content:space-between; column-gap:12px }
.board-title .text-link { margin-bottom:8px }
.pilot-name-form fieldset { padding:0; margin:16px 0; border:0; min-width:0 }
.pilot-name-form label { display:block; font-weight:650; margin-bottom:5px }
.engine-stand #preflightPilot { max-width:min(94vw,36rem);white-space:normal;overflow-wrap:anywhere;text-align:center }
.name-feedback:not(:empty) { border-left:3px solid #98733f;padding:.4rem .65rem;overflow-wrap:anywhere }
#homePilotIdentity { color:#fff0cf;overflow-wrap:anywhere;font-weight:650 }
.pilot-name-form input { width:100%; min-height:44px; padding:7px 10px; color:var(--ink); background:#fffdf3; border:1px solid #818a77; border-radius:4px; font:inherit }
.pilot-name-form small { display:block; margin-top:6px; color:#425447 }
.race-scores .record-list li > span { min-width:0; overflow-wrap:anywhere }
.race-scores .record-list li > strong { flex-shrink:0 }
.cup-rules { margin-bottom:18px }.race-tabs { flex-wrap:wrap }.race-tabs button { flex:1; white-space:nowrap }
.race-scores { padding:14px 0 18px; border-bottom:1px solid #b9b29c; min-height:46px }.race-scores .record-list { margin:0 }.race-scores strong,.race-splits strong,#value1,.scorebig { font-variant-numeric:tabular-nums }.record-list small { font-weight:400; line-height:1.25 }
.race-splits { display:flex; gap:28px }.race-splits small,.race-splits strong { display:block }.race-splits strong { margin-top:4px; font-size:22px; color:#204332 }
.pilot-details { border-top:1px solid #c5bda6; padding-top:12px }.pilot-details summary { cursor:pointer; font-weight:700 }.pilot-details code { display:block; padding:10px; background:#eae4d5; overflow-wrap:anywhere; user-select:all }.pilot-details label { display:block; font-weight:700; margin:10px 0 4px }.pilot-details input { width:100%; min-width:12ch }
.prize-invite { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 15px; margin:14px 0; padding:13px 15px; border-left:3px solid #9c462c; background:#ece7d8 }
.prize-invite>div { flex:1 1 205px }
.dialog-body .prize-invite p { margin:2px 0 0; font-size:14px }
.prize-form fieldset { border:0; padding:0; margin:14px 0; min-width:0 }
.prize-form legend { font:700 20px Georgia,serif; margin:0 0 12px }
.prize-form label { display:block; font-weight:650; margin-bottom:5px }
.prize-form input[type=tel] { width:100%; min-height:44px; padding:7px 10px; color:var(--ink); background:#fffdf3; border:1px solid #818a77; border-radius:4px; font-size:17px }
.prize-form small { display:block; color:#425447; line-height:1.4; margin:5px 0 12px }
.prize-form .prize-consent { display:flex; align-items:flex-start; gap:9px; padding:5px 0; margin-bottom:12px; font-weight:500; line-height:1.4; cursor:pointer }
.prize-consent input { width:19px; height:19px; flex-shrink:0; margin:2px 0 0; accent-color:#224b36 }
.prize-controls { display:flex; flex-wrap:wrap; align-items:center; gap:12px }
.dialog-body .prize-status:not(:empty) { border-left:3px solid #98733f; padding:6px 10px; font-weight:600 }
#launch:disabled { opacity:.8; cursor:wait }
#groundPace { display:block; font:600 clamp(10px,1vw,13px)/1.2 Barlow,sans-serif; color:#ead3a5 }
.path-cue { align-self:flex-start; max-width:17ch; padding:5px 8px; background:#fff1c9f5; color:#432d1d; border:1px solid #715238; border-left:4px solid #b65c29; border-radius:3px; font:700 clamp(11px,1.2vw,15px)/1.1 Barlow,sans-serif; pointer-events:none }
@media(max-width:700px) {
 .cup-invite { flex-wrap:wrap; margin-top:14px;padding:14px 16px }
}
[hidden] { display:none!important }
.story-film { clear:both; margin:1rem 0 1.4rem }
.story-film video { display:block; width:100%; max-height:55vh; aspect-ratio:3/2; background:#16201e; border-radius:4px }
.story-film figcaption { margin-top:.4rem; color:#405448; font-size:.92rem }
.landing-film video { aspect-ratio:16/9; object-fit:contain; background:#151915 }
.landing-film-button {
  display:flex; align-items:center; gap:.85rem; width:100%; box-sizing:border-box;
  margin:.85rem 0 1rem; padding:.45rem .8rem .45rem .45rem; cursor:pointer; text-align:left;
  background:#233e33; color:#fff7df; border:1px solid #193429; border-radius:5px; font-family:inherit;
}
.landing-film-button:hover { background:#2c4c3f }
.landing-film-button:focus-visible { outline:3px solid #a34429; outline-offset:3px }
.landing-film-button strong,.landing-film-button small { display:block }
.landing-film-button strong { font:700 1.1rem/1.15 Georgia,serif }
.landing-film-button small { margin-top:.28rem; font-size:.875rem; color:#ead5ad }
.film-thumbnail { position:relative; width:clamp(4.25rem,18vw,6.8rem); flex:none; aspect-ratio:16/9; overflow:hidden; border-radius:2px }
.film-thumbnail img { display:block; width:100%; height:100%; object-fit:cover }
.film-thumbnail svg { position:absolute; inset:0; margin:auto; padding:.4rem; width:1.1rem; height:1.1rem; box-sizing:content-box; border-radius:50%; background:#17251ee6; color:#fff4d1; fill:currentColor }

#impactMarker {
  position:absolute; z-index:2; left:0; top:0; width:32px; height:32px;
  box-sizing:border-box; border-radius:50%; border:3px solid #fff0be;
  box-shadow:0 0 0 2px #3b2419, inset 0 0 0 2px #99512b;
  pointer-events:none;
}
#impactMarker::before, #impactMarker::after {
  content:""; position:absolute; width:5px; height:2px; top:calc(50% - 1px);
  background:#fff0be; box-shadow:0 0 0 1px #39271a;
}
#impactMarker::before { left:-8px } #impactMarker::after { right:-8px }
.replay-banner { z-index:3; align-items:flex-end; gap:7px }
.replay-banner .replay-card { min-width:0; max-width:34em }
#stage[data-replay-camera="steps"] .pilot-instruments,
#stage[data-replay-camera="steps"] #routeNotice { display:none }
.replay-banner .replay-card>div { min-width:0 }
.replay-banner .replay-card #replayContact {
  margin-top:3px; font-weight:650; line-height:1.15;
  color:#fff0bd; font-size:clamp(14px,1.4vw,18px); overflow-wrap:anywhere;
}
.replay-banner>.btn { flex:none; min-height:44px; white-space:nowrap }
.impact-debrief { color:#273f32; font-weight:650 }
.wing-notice {
  width:max-content; max-width:100%; box-sizing:border-box;
  padding:5px 9px; border:1px solid #bd9d63; border-left:3px solid #f3c36d;
  border-radius:3px; background:#28392ff2; color:#fff5dd;
  font:650 clamp(12px,1.25vw,15px)/1.2 Barlow,sans-serif;
}
.wing-notice strong,.wing-notice span { display:block }
.wing-notice strong { color:#f6d595 }
.flight-tools { flex-shrink:0 }
.inflight #cockpitSound { display:inline-flex; min-width:40px; min-height:44px; touch-action:manipulation }
#viewToggle { min-height:44px; white-space:nowrap; touch-action:manipulation }
.inflight .pilot-instruments { min-width:0; margin-right:7px }
#stage[data-seat="pilot"] #airGauge, #stage[data-seat="pilot"] .live-tag {
  position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden;
  clip-path:inset(50%); white-space:nowrap; border:0; min-width:0;
}
.field-entry { border-block-end:1px solid #b3a182; padding:.65rem 0 }
.field-entry summary { cursor:pointer; font-weight:700 }
#fieldQuestion [aria-pressed="true"] { outline:2px solid #6c7854 }
.music-control { font:650 .94rem Barlow,sans-serif; color:#254131; background:#faf6e9; border:1px solid #8a9478; border-radius:4px; padding:.46rem .8rem; min-height:40px; cursor:pointer }
.music-control[aria-pressed="true"] { background:#234638; color:#fff4d8 }
#musicFeedback:empty { display:none }
#musicFeedback { flex-basis:100%; font-size:.93rem }
@media(max-width:500px) {
  #viewToggle { padding-inline:8px }
  .inflight .live-tag { max-width:100%; overflow-wrap:anywhere }
}
@media(max-width:500px) {
  #impactMarker { width:26px; height:26px }
  .replay-banner { inset:auto 8px 9px }
  .replay-banner .replay-card { padding:7px 9px; gap:0 }
  .replay-banner .replay-glyph { display:none }
  .replay-banner>.btn { padding:7px 9px }
}
.engine-stand {
  position:absolute; bottom:4%; left:50%; transform:translateX(-50%); z-index:3;
  display:grid; justify-items:center; gap:6px; width:max-content; max-width:calc(100% - 24px);
}
.engine-stand>span {
  color:#fff6dd; background:#1b382ff2; border:1px solid #a29570; border-radius:4px;
  padding:4px 10px; font-weight:650; font-size:clamp(12px,1.4vw,15px);
}
.engine-stand .btn {min-height:44px}
.line-actions { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:6px }
#openStartBoard { background:#203c31; color:#fff2cd; border:1px solid #c0aa79 }
#startPilotName { max-width:12em; color:#21392d; background:#f5e8ca; border:1px solid #8b805d }
#startPilotName span { display:block; overflow:hidden; white-space:nowrap; text-overflow:ellipsis }
.start-scoreboard { margin:24px 0; padding:clamp(17px,3vw,35px); color:#f6f1db; background:#213c33; border:4px solid #866b48; border-radius:5px; box-shadow:inset 0 0 0 1px #baaa80; }
.start-scoreboard h2 { margin:0 0 .75rem; color:#fff5d9; font:700 clamp(1.65rem,4vw,2.65rem)/1.1 Georgia,serif }
.start-scoreboard .board-kicker { margin:0 0 .45rem; color:#efce91; font:700 .86rem/1.4 Barlow,sans-serif; letter-spacing:.095em; text-transform:uppercase }
.board-tabs { display:flex; flex-wrap:wrap; gap:.35rem; margin:.85rem 0 .6rem }
.board-tabs button { cursor:pointer; color:#fcf2d8; background:transparent; border:1px solid #91a095; border-radius:3px; padding:.45rem .8rem; min-height:42px; font:650 1rem/1.1 Barlow,sans-serif }
.board-tabs button[aria-pressed=true] { background:#f3deb0; color:#1a352c; border-color:#f3deb0 }
.board-tabs button:focus-visible,.start-scoreboard button:focus-visible { outline:3px solid #fff; outline-offset:2px }
.start-scoreboard .board-rule,.start-scoreboard .board-status { color:#e4e6d7; font:500 1rem/1.4 Barlow,sans-serif; margin:.55rem 0 }
.board-table { width:100%; border-collapse:collapse; text-align:left; color:#fff9e5; font:600 1.05rem/1.25 Barlow,sans-serif; font-variant-numeric:tabular-nums }
.board-table th,.board-table td { padding:.32rem .5rem; border-bottom:1px solid #ffffff32 }
.board-table th { color:#ebd19c; font-size:.88rem; font-weight:650 }
.board-table td:first-child { color:#eed096; width:3rem }
.board-table td:nth-child(2) { overflow-wrap:anywhere }
.board-table :is(th,td):last-child { text-align:right; white-space:nowrap }
.start-scoreboard .board-office { color:#f4dab1; margin-top:.65rem; min-height:40px; text-decoration:underline }
.standings-dialog { width:min(58rem,calc(100vw - 16px)); max-width:calc(100vw - 16px); max-height:95svh }
.standings-dialog .dialog-body { padding:0 }
.compact-board { padding:clamp(14px,2vh,24px) clamp(14px,3vw,38px); margin:0; border-radius:0 }
.compact-board h2 { font-size:clamp(1.85rem,4.5vw,3rem) }
.compact-board .btn { background:#efe2c1; color:#21392d }
.start-scoreboard .board-table { font-size:clamp(1.125rem,2.3vw,1.5rem) }
.start-scoreboard .board-table :is(th,td) { padding:.4em .45em }
.compact-board .board-table :is(th,td) { padding-block:.23em }
.compact-board .actions { gap:.5rem 1.25rem; margin-top:.65rem }
.start-scoreboard {
  background-color:#213c33;
  background-image:repeating-linear-gradient(0deg,transparent 0 52px,#132d261a 53px 54px);
  border-color:#755636;
}
.start-scoreboard .board-table { border-collapse:separate; border-spacing:0 .18em }
.board-table td { border-bottom:0 }
.start-scoreboard .board-table td { padding:.06em .27em }
.board-table td:first-child { font:700 1em/1.1 Georgia,serif; text-align:center }
.board-table .score-card {
  position:relative; display:block; padding:.19em .73em;
  border:1px solid #1a3026; border-radius:2px;
  box-shadow:0 2px 1px #0a1c16a8,inset 0 1px #fff7d644;
  transform-origin:center .15em;
}
.board-table .score-card::before,.board-table .score-card::after {
  content:''; position:absolute; width:3px; height:3px; top:.23em; border-radius:50%;
  background:#715f45; box-shadow:0 1px #fff7d675;
}
.board-table .score-card::before { left:.22em }
.board-table .score-card::after { right:.22em }
.board-table .name-card { color:#21362a; background:linear-gradient(#f1e6c7,#e2d3aa); font-weight:700 }
.board-table .time-card { color:#fff0c5; background:#172c26; border-color:#6c7967; font:700 .95em/1.32 var(--mono); text-align:center; letter-spacing:.015em }
.board-table td:last-child { width:1% }
.start-scoreboard .board-status:not([hidden]) { width:fit-content; padding:.5em .85em; background:#eee1bd; color:#23392d; border:1px solid #7b7056; box-shadow:0 2px 1px #11261c }
@media(prefers-reduced-motion:no-preference) {
  .posted-card { animation:hang-race-card .48s ease-out both }
  @keyframes hang-race-card { 0%{transform:translateY(-.15em) rotate(-1.3deg)} 55%{transform:rotate(.65deg)} 100%{transform:none} }
}
@media(max-width:430px){.line-actions .btn{padding:.45rem .58rem;gap:5px;font-size:.94rem}.board-tabs button{padding:.4rem .58rem}#startPilotName{max-width:8em}.compact-board .board-table :is(th,td){padding-inline:.27em}}
.engine-stand[hidden] {display:none}
.at-starting-line #flightCanvas { cursor:grab; }
.at-starting-line #flightCanvas:active { cursor:grabbing; }
.at-starting-line .pilot-instruments { visibility:hidden; }
@media(max-height:520px){.engine-stand{bottom:7px;gap:3px}.engine-stand>span{padding:2px 8px}}

/* The flight owns the phone viewport from ignition through the replay. */
html.phone-flight-screen {
  --flight-top: max(8px, env(safe-area-inset-top, 0px));
  --flight-left: max(9px, env(safe-area-inset-left, 0px));
  --flight-right: max(9px, env(safe-area-inset-right, 0px));
  --flight-bottom: max(8px, env(safe-area-inset-bottom, 0px));
  --flight-dash: 54px;
  overflow: hidden;
  overscroll-behavior: none;
  background: #19382f;
}
.phone-flight-screen body { overflow: hidden; overscroll-behavior: none }
.phone-flight-screen .masthead,
.phone-flight-screen .main > :not(#gameShell),
.phone-flight-screen .footer { display: none }
.phone-flight-screen .main { margin: 0; padding: 0 }
.phone-flight-screen #gameShell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.phone-flight-screen #stage { height: 100%; min-height: 0; max-height: none }
.phone-flight-screen .inflight { inset: var(--flight-top) var(--flight-right) auto var(--flight-left) }
.phone-flight-screen .flight-tools { gap: 5px }
.phone-flight-screen .flight-tools .tool { min-width: 44px; min-height: 44px }
.phone-flight-screen .instruments {
  position: absolute;
  inset: auto 0 0;
  height: calc(var(--flight-dash) + var(--flight-bottom));
  min-height: 0;
  padding: 4px var(--flight-right) var(--flight-bottom) var(--flight-left);
  grid-template-columns: repeat(3,minmax(0,1fr));
  background: #19382ff2;
  border-top: 1px solid #ddbd8055;
  pointer-events: none;
}
.phone-flight-screen .instrument { min-width: 0; padding: 0 6px; gap: 6px }
.phone-flight-screen .instrument span { font-size: 9px; letter-spacing: .045em }
.phone-flight-screen .instrument strong { font-size: 16px; line-height: 1.16 }
.phone-flight-screen .instrument > svg { width: 16px; height: 16px }
.phone-flight-screen #groundPace { font-size: 10px; line-height: 1.1 }
.phone-flight-screen #touchPad {
  inset: auto var(--flight-right) calc(var(--flight-dash) + var(--flight-bottom) + 8px) var(--flight-left);
  display: flex;
}

.phone-flight-screen .engine-stand { bottom: calc(var(--flight-dash) + var(--flight-bottom) + 10px) }
.phone-flight-screen #launchCue,
.phone-flight-screen #routeNotice {
  top: auto;
  bottom: calc(var(--flight-dash) + var(--flight-bottom) + 64px);
  max-width: calc(100% - var(--flight-left) - var(--flight-right));
  width: max-content;
}
.phone-flight-screen .replay-banner {
  inset: auto var(--flight-right) calc(var(--flight-dash) + var(--flight-bottom) + 8px) var(--flight-left);
}
.phone-flight-screen dialog {
  inset: var(--flight-top) var(--flight-right) var(--flight-bottom) var(--flight-left);
  margin: auto;
  width: min(520px,calc(100% - var(--flight-left) - var(--flight-right)));
  max-height: calc(100% - var(--flight-top) - var(--flight-bottom));
  max-height: calc(100dvh - var(--flight-top) - var(--flight-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
}
.phone-flight-screen dialog .close { min-width: 44px; min-height: 44px }
@media (max-width: 370px) {
  .phone-flight-screen .instrument > svg { display: none }
}
@media (orientation: landscape) and (min-width: 560px) {
  .phone-flight-screen .instruments {
    inset: auto 0 var(--flight-bottom);
    width: min(380px,calc(100% - 230px - var(--flight-left) - var(--flight-right)));
    height: var(--flight-dash);
    margin-inline: auto;
    padding: 3px;
    border: 1px solid #ddbd8066;
    border-radius: 4px;
  }
  .phone-flight-screen .instrument > svg { display: none }
  .phone-flight-screen #touchPad { bottom: var(--flight-bottom) }
  .phone-flight-screen #launchCue,
  .phone-flight-screen #routeNotice { bottom: calc(var(--flight-dash) + var(--flight-bottom) + 5px) }
}
@media (orientation: landscape) and (max-height: 400px) {
  .phone-flight-screen .pilot-instruments #airGauge { width: 56px }
  .phone-flight-screen #launchCue { padding: 5px 11px }
  .phone-flight-screen .dialog-head { padding: 2px 14px }
  .phone-flight-screen .dialog-body { padding: 10px 16px 14px }
  .phone-flight-screen .dialog-body h2 { margin-bottom: 6px; font-size: 25px }
  .phone-flight-screen .scorebig { margin: 4px 0 8px; font-size: 36px }
  .phone-flight-screen .dialog-body .actions { margin-top: 9px }
}

/* The estate links occupy a row while the plane is parked. Give them space
   before sizing the view so the controls and dashboard fit together. */
html:not(.phone-flight-screen) body.flying:has(#engineStand:not([hidden])) {
  height:100vh;
  height:100svh;
  display:flex;
  flex-direction:column;
}
body.flying:has(#engineStand:not([hidden])) > .masthead { flex:none; }
body.flying:has(#engineStand:not([hidden])) > .main {
  flex:1 1 0;
  min-height:0;
  width:100%;
}
body.flying:has(#engineStand:not([hidden])) #gameShell {
  height:100%;
  max-height:calc(830px + 10rem);
  display:flex;
  flex-direction:column;
}
body.flying:has(#engineStand:not([hidden])) .stage {
  height:auto;
  flex:1 0 164px;
  min-height:164px;
}
body.flying:has(#engineStand:not([hidden])) :is(.estate-shortcuts,.instruments) { flex:none; }
.phone-flight-screen .game-shell .instrument span {
  font-size:11px;
  letter-spacing:.035em;
}
@media (max-width:500px) {
  #estateShortcuts:not([hidden]) {
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:0 .6rem;
    padding:6px 12px;
  }
  #estateShortcuts > span { grid-column:1/-1; }
  #estateShortcuts button { min-height:44px; text-align:left; }
}
