/* Custom Tripo cockpit artwork. Load after style.css. */
:root {
  --cockpit-gold: #ffe5a1;
  --cockpit-pad: max(26px, env(safe-area-inset-right));
}

.primary-button,
.primary-button:hover,
.primary-button:focus-visible {
  min-height: 76px;
  padding: 15px 38px;
  border: 0;
  clip-path: none;
  color: #09232b;
  background: transparent url('assets/action-plate.webp') center / 100% 100% no-repeat;
  box-shadow: none;
  text-shadow: 0 1px #b5fff657;
  font-size: 16px;
  letter-spacing: 1.7px;
  transition: filter .16s, transform .16s;
  filter: drop-shadow(0 7px 14px #02081860);
}
.primary-button:hover,
.primary-button:focus-visible { filter: brightness(1.09) drop-shadow(0 0 13px #46ded82a); }
.primary-button:active { transform: scale(.98); filter: brightness(.95); }
.primary-button .button-key { border-color: #0e655d66; }
.results-modal .primary-button { min-height: 70px; }

.guide-toggle,
.guide-toggle:hover,
.guide-toggle:focus-visible {
  min-height: 48px;
  padding: 11px 23px;
  border: 0;
  border-radius: 0;
  color: #def8f5;
  background: transparent url('assets/hud-plate.webp') center / 100% 100% no-repeat;
  font-size: 12px;
  text-shadow: 0 1px 3px #000;
}
.guide-toggle:hover { filter: brightness(1.2); }

#boost.boost-button {
  position: relative;
  flex: 0 0 100px;
  width: 100px;
  height: 100px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: block;
  background: transparent url('assets/boost-control.webp') center / contain no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 4px 15px #0007);
  color: #eafffb;
}
#boost.boost-button svg { display: none; }
#boost.boost-button > span {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px #020818;
}
#boost.boost-button.held {
  background: transparent url('assets/boost-control.webp') center / contain no-repeat;
  color: #fff4b5;
  filter: brightness(1.18) drop-shadow(0 0 15px #5ef4e77a);
}
#boost.boost-button:active { transform: scale(.95); }
.race-bottom { bottom: max(34px, calc(env(safe-area-inset-bottom) + 24px)); gap: 32px; }
.boost-panel { margin-bottom: 8px; }

.encounter-cue {
  top: 24px;
  width: 324px;
  max-width: calc(100vw - 430px);
  min-height: 79px;
  padding: 13px 21px 15px 17px;
  gap: 10px;
  border: 0;
  border-radius: 0;
  background: transparent url('assets/hud-plate.webp') center / 100% 100% no-repeat;
  box-shadow: none;
  filter: drop-shadow(0 5px 8px #01081277);
}
.encounter-cue img { width: 58px; height: 45px; flex: 0 0 58px; }
.cue-copy { min-width: 0; gap: 3px; }
.cue-copy strong { font-size: 15px; letter-spacing: .25px; }
.cue-copy span { font-size: 13px; line-height: 1.2; white-space: normal; }
.cue-lane { margin-left: auto; flex: 0 0 auto; }
.cue-lane i { width: 5px; height: 18px; }
.route-board { pointer-events:none; justify-content:center; gap:0; }
.route-board[hidden] { display:none; }
.route-option {
  flex:1; min-width:0; display:flex; justify-content:center; align-items:center; gap:6px;
  color:#ffcc82; font-size:13px; font-weight:700; line-height:1.15; text-align:center;
}
.route-option + .route-option { border-left:1px solid #50717e; }
.route-option::before {
  content:''; display:inline-block; width:6px; height:6px; flex:0 0 6px;
  border-top:2px solid currentColor; border-left:2px solid currentColor; transform:rotate(-15deg);
}
#route-right::before { transform:rotate(105deg); }
.route-board[data-display='pressure'] #route-left { color:#75ffe2; }
.route-board[data-display='freight'] #route-right { color:#90f7ff; }
.route-board[data-display='preview'] #route-right { color:#ffcda0; }

#walrus-call {
  --time-left: 0deg;
  position: absolute;
  z-index: 4;
  right: var(--cockpit-pad);
  bottom: max(188px, calc(env(safe-area-inset-bottom) + 178px));
  width: 116px;
  min-height: 137px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  padding: 5px 2px 0;
  border: 0;
  color: var(--cockpit-gold);
  background: transparent;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 4px 9px #020718a0);
}
.walrus-clock {
  position: relative;
  display: block;
  width: 94px;
  height: 94px;
  flex: 0 0 94px;
  border-radius: 50%;
  isolation: isolate;
}
.walrus-clock::before {
  content: '';
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(from -90deg, #fff2a8 0deg, #f5bf5b var(--time-left), #58787955 var(--time-left), #58787955 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
.walrus-coin {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: url('assets/walrus-call.webp') center / contain no-repeat;
  transition: filter .15s, transform .15s;
}
.walrus-caption {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .7px;
  white-space: nowrap;
  text-shadow: 0 2px 5px #000;
}
.walrus-key { color: #dbe4e8; font-size: 10px; letter-spacing: 1px; line-height: 1.1; }
#walrus-call:hover .walrus-coin,
#walrus-call:focus-visible .walrus-coin { filter: brightness(1.13); }
#walrus-call:active { transform: none; }
#walrus-call:active .walrus-coin { transform: scale(.94); }
#walrus-call[aria-pressed='true'] .walrus-coin,
#walrus-call.active .walrus-coin { filter: brightness(1.13) drop-shadow(0 0 10px #f9cd6180); }
#walrus-call:disabled { cursor: default; }
#walrus-call:disabled .walrus-coin { filter: saturate(.55) brightness(.72); }
#walrus-call:disabled .walrus-caption { color: #d6d6cb; }

#race-score {
  display: block;
  color: var(--cockpit-gold);
  margin-top: 7px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: .8px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px #040b20;
}
#risk-readout {
  display: block;
  margin-top: 5px;
  color: #b9eee4;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: .7px;
  font-variant-numeric: tabular-nums;
}
#risk-results {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 15px;
  padding: 13px 0 15px;
  border-bottom: 1px solid #e9ffff25;
}
#risk-results > div { min-width: 0; text-align: center; }
#risk-results small {
  display: block;
  color: #b8c9d8;
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
#risk-results b,
#risk-results strong { display: block; color: #ffe3a1; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.results-modal { width: 520px; max-height: calc(100dvh - 32px); overflow: auto; touch-action: pan-y; overscroll-behavior: contain; padding: 4px 10px; }
.results-modal h2 { font-size: 44px; margin: 17px 0; }
.results-modal .result-position { margin: 9px 0 19px; }
.results-modal .result-position > strong { font-size: 78px; }
.results-modal .result-stats { margin-bottom: 0; padding: 15px 0; }
#pause-tactics { margin: 16px auto 21px; max-width: 380px; color: #c8dbdf; font-size: 13px; line-height: 1.5; }
.race-message.takedown { color: #ffdca1; text-shadow: 0 0 13px #ff853760, 0 3px 8px #00101e; }
.race-message.rescue { color: #fff0b8; text-shadow: 0 0 17px #f5cd6955, 0 3px 8px #00101e; }

@media (max-width: 1000px) and (min-width: 701px) {
  .encounter-cue { max-width: 300px; top: 26px; min-height: 72px; padding: 12px 19px; }
  .encounter-cue img { width: 47px; flex-basis: 47px; }
}

@media (max-width: 700px) {
  :root { --cockpit-pad: max(18px, env(safe-area-inset-right)); }
  .primary-button,
  .primary-button:hover,
  .primary-button:focus-visible { min-height: 70px; padding: 13px 30px; font-size: 14px; letter-spacing: 1.3px; }
  .primary-button .button-key { display: none; }
  .menu-controls { margin-top: 10px; }
  .menu-controls .touch-hint { font-size: 10px; letter-spacing: 1px; }
  .guide-toggle,
  .guide-toggle:hover,
  .guide-toggle:focus-visible { min-height: 46px; padding: 10px 19px; font-size: 11px; }
  .race-top { top: 96px; }
  .time-panel { max-width: 149px; }
  .time-panel strong { margin-top: 5px; }
  #race-score { margin-top: 7px; font-size: 18px; letter-spacing: .4px; }
  #risk-readout { margin-top: 4px; font-size: 10px; line-height: 1.25; letter-spacing: .25px; min-height: 12px; }
  .encounter-cue { top: 198px; width: 310px; max-width: calc(100vw - 48px); min-height: 73px; padding: 12px 17px 14px; gap: 7px; }
  .encounter-cue img { width: 47px; height: 38px; flex-basis: 47px; }
  .cue-copy strong { font-size: 14px; }
  .cue-copy span { font-size: 12px; }
  .cue-lane { gap: 3px; margin-left: 5px; }
  .cue-lane i { width: 4px; height: 16px; }
  .race-message { top: 34%; font-size: 21px; letter-spacing: 2px; }
  .race-message.countdown { top: 37%; }
  .race-bottom { left: 22px; right: 20px; bottom: max(35px, calc(env(safe-area-inset-bottom) + 24px)); gap: 18px; }
  #boost.boost-button { width: 86px; height: 86px; flex-basis: 86px; margin-left: auto; }
  #boost.boost-button > span { top: calc(100% + 2px); font-size: 10px; letter-spacing: 1.7px; }
  .boost-panel { bottom: 102px; margin-bottom: 0; }
  .boost-label { font-size: 10px; }
  .mobile-steering { bottom: max(156px, calc(env(safe-area-inset-bottom) + 145px)); left: 20px; right: 20px; }
  .mobile-steering button { width: 51px; height: 51px; font-size: 32px; }
  #walrus-call { right: 13px; bottom: max(250px, calc(env(safe-area-inset-bottom) + 239px)); width: 110px; min-height: 119px; gap: 4px; }
  .walrus-clock { width: 80px; height: 80px; flex-basis: 80px; }
  .walrus-caption { font-size: 11px; letter-spacing: .35px; }
  .walrus-key { font-size: 10px; letter-spacing: .65px; }
  .results-modal { width: 450px; max-width: calc(100vw - 28px); padding: 3px 9px; }
  .results-modal h2 { font-size: 38px; margin: 15px 0; }
  .results-modal .result-position { margin: 6px 0 12px; }
  .results-modal .result-position > strong { font-size: 72px; }
  .results-modal .result-stats { padding: 13px 0; }
  .results-modal .result-stats b { font-size: 18px; }
  #risk-results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 18px; padding: 15px 5px; margin-bottom: 13px; }
  #risk-results small { font-size: 10px; margin-bottom: 5px; }
  #risk-results b,
  #risk-results strong { font-size: 22px; }
  #pause-tactics { max-width: 310px; font-size: 13px; }
}

@media (max-width: 370px) {
  .lap-panel { margin-left: 13px; padding-left: 13px; }
  .time-panel { max-width: 128px; }
  .time-panel strong { font-size: 19px; }
  #race-score { font-size: 17px; }
  .encounter-cue { max-width: calc(100vw - 32px); }
}

@media (max-height: 670px) and (min-width: 701px) {
  .primary-button,
  .primary-button:hover,
  .primary-button:focus-visible { min-height: 63px; }
  #walrus-call { bottom: 161px; min-height: 111px; }
  .walrus-clock { width: 76px; height: 76px; flex-basis: 76px; }
  #boost.boost-button { width: 82px; height: 82px; flex-basis: 82px; }
  .results-modal h2 { display: none; }
  .results-modal .result-position { margin: 5px 0 8px; }
  .results-modal .result-position > strong { font-size: 61px; }
  .results-modal .result-stats { padding: 11px 0; }
  #risk-results { padding: 10px 0; margin-bottom: 9px; }
  .results-modal .secondary-button { padding: 14px; }
}

@media (max-height: 670px) and (max-width: 700px) {
  .race-top { top: 87px; }
  .encounter-cue { top: 178px; min-height: 64px; padding-top: 9px; padding-bottom: 10px; }
  .race-message { top: 41%; font-size: 18px; }
  #walrus-call { bottom: 229px; min-height: 105px; }
  .walrus-clock { width: 68px; height: 68px; flex-basis: 68px; }
  .walrus-key { display: none; }
  .walrus-caption { font-size: 10px; }
  #boost.boost-button { width: 76px; height: 76px; flex-basis: 76px; }
  .boost-panel { bottom: 92px; }
  .mobile-steering { bottom: 143px; }
  .results-modal h2 { display: none; }
  .results-modal .result-position { margin: 5px 0 9px; }
  .results-modal .result-position > strong { font-size: 57px; }
  #risk-results { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; padding: 11px 0; }
  #risk-results small { font-size: 9px; letter-spacing: .1px; }
  #risk-results b,
  #risk-results strong { font-size: 18px; }
}

@media (max-height: 450px) and (min-width: 701px) {
  .topbar { padding-top: 14px; padding-bottom: 14px; }
  .race-progress { top: 72px; }
  .race-top { top: 86px; }
  .position-panel > span { font-size: 62px; }
  .time-panel strong { font-size: 23px; }
  #race-score { font-size: 18px; }
  #risk-readout { font-size: 10px; }
  .encounter-cue { top: 8px; min-height: 62px; padding-top: 9px; padding-bottom: 10px; }
  #walrus-call { right: 141px; bottom: 27px; width: 95px; min-height: 87px; }
  .walrus-clock { width: 63px; height: 63px; flex-basis: 63px; }
  .walrus-key { display: none; }
  .walrus-caption { font-size: 10px; }
  .race-bottom { bottom: 25px; }
  .boost-panel { margin-right: 112px; width: 200px; }
  .race-message { top: 39%; }
  #pause-tactics { margin: 8px auto 13px; font-size: 12px; }
}
.menu-art { filter: saturate(1.26) contrast(1.05) brightness(1.08); }
.neon-title { text-shadow: 0 0 20px rgb(255 40 193 / 24%); }
.title-slashes { filter: drop-shadow(0 0 7px rgb(22 255 240 / 52%)); }

.guide-selector button,
.guide-selector button:hover,
.secondary-button,
.secondary-button:hover {
  border: 0;
  border-radius: 0;
  background: transparent url('assets/hud-plate.webp') center / 100% 100% no-repeat;
}
.top-actions .icon-button,
.guide-head .icon-button {
  width:46px; height:46px; padding:0; border:0; border-radius:5px; backdrop-filter:none;
  background-color:transparent; background-position:center; background-repeat:no-repeat; background-size:contain;
}
.top-actions .icon-button:hover,
.guide-head .icon-button:hover { filter:brightness(1.17); }
#sound { background-image:url('assets/rally-sound.webp'); }
#sound.muted { background-image:url('assets/rally-mute.webp'); }
#fullscreen { background-image:url('assets/rally-fullscreen.webp'); }
#pause { background-image:url('assets/rally-pause.webp'); }
#guide-close { background-image:url('assets/rally-close.webp'); }
.guide-toggle::before {
  content:''; flex:0 0 24px; width:24px; height:24px;
  background:url('assets/rally-guide.webp') center / contain no-repeat;
}
.secondary-button,
.secondary-button:hover { padding: 13px 26px; color: #c4e7e9; }
.guide-selector { grid-template-columns:repeat(var(--entry-count, 5), minmax(0, 1fr)); }
.guide-selector button { padding:6px 10px; }
.guide-selector button[aria-pressed='true'] { box-shadow: inset 0 -2px var(--animal-color); }
.guide-sections { display:flex; gap: 19px; border-bottom:1px solid #35515e; }
.guide-sections button {
  min-height: 44px; padding:3px 0; border-bottom:2px solid transparent;
  background:transparent; color:#a9bfc7; font-size:14px;
}
.guide-sections button[aria-pressed='true'] { border-bottom-color:#79ffeb; color:#ecfffc; }

.race-powers { display:flex; align-items:flex-end; flex:0 0 auto; gap:16px; }
.fire-control {
  --fire-size:92px;
  width:var(--fire-size); height:var(--fire-size); position:relative;
  flex:0 0 var(--fire-size); padding:0; border:0; background:transparent;
  color:#ffe7a0; pointer-events:auto; touch-action:manipulation; user-select:none;
  -webkit-user-select:none;
}
.fire-art {
  display:block; width:100%; height:100%;
  background: url('assets/rally-fire-button.webp') center / contain no-repeat;
  filter:drop-shadow(0 4px 9px #01091d9c);
}
.fire-control:enabled:active { transform:scale(.95); }
.pulse-meter {
  --pulse-angle:inherit; position:absolute; inset:3%; border-radius:50%; pointer-events:none; opacity:0;
  background:conic-gradient(from 180deg,#d8c8ff var(--pulse-angle),#241c3b99 var(--pulse-angle));
  -webkit-mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));
  mask:radial-gradient(farthest-side,transparent calc(100% - 3px),#000 calc(100% - 2px));
}
.fire-control.charging .pulse-meter { opacity:1; }
.fire-control.primed .fire-art { filter:drop-shadow(0 0 7px #b99eff) brightness(1.25); }
.fire-control.primed .fire-caption { color:#e2daff; }
.fire-control:disabled { cursor:default; }
.fire-control.empty .fire-art { filter:saturate(.4) brightness(.75); }
.fire-control.empty .fire-caption { color:#c6d9de; }
.fire-charges {
  position:absolute; bottom:4%; left:50%; transform:translateX(-50%);
  display:flex; gap:4px; padding:3px 5px 4px; border-radius:8px;
  border:1px solid #526574; background:#081623;
}
.fire-charges i { width:8px; height:4px; display:block; border-radius:2px; background:#334752; }
.fire-charges .lit { background:#ffcf78; box-shadow:0 0 4px #ffa54cba; }
.fire-caption {
  position:absolute; top:calc(100% + 3px); left:50%; transform:translateX(-50%);
  display:flex; align-items:center; gap:5px; font-size:11px; font-weight:700; line-height:1;
  letter-spacing:1.5px; white-space:nowrap; text-shadow:0 2px 5px #020818;
}
.fire-caption kbd { font:inherit; font-size:8px; letter-spacing:0; padding:2px 3px; border:1px solid #a5986e; border-radius:3px; }
.mobile-steering button {
  position:relative; padding:0; border:0; border-radius:0;
  background:transparent; color:transparent; text-shadow:none;
}
.mobile-steering button::before {
  content:''; position:absolute; inset:0;
  background:url('assets/rally-steer.webp') center / contain no-repeat;
  filter:drop-shadow(0 3px 5px #041024a0);
}
#right::before { transform:scaleX(-1); }
.mobile-steering button:active::before { filter:brightness(1.3); }

@media (max-width:700px) {
  .race-bottom { flex-wrap:nowrap; gap:10px; }
  .race-powers { margin-left:auto; gap:12px; }
  .race-powers #boost.boost-button { margin:0; }
  .fire-control { --fire-size:76px; }
  .fire-caption { font-size:10px; }
  .fire-caption kbd { display:none; }
}
@media (max-width:370px), (max-height:670px) {
  .fire-control { --fire-size:68px; }
}
@media (max-height:490px) and (orientation:landscape) {
  #walrus-call { right:220px; bottom:22px; width:95px; min-height:81px; }
  .walrus-clock { width:59px; height:59px; flex-basis:59px; }
  .walrus-key { display:none; }
  .guide-sections button { min-height:34px; }
}

/* Keep steering under the left thumb and the three actions under the right. */
.drift-control {
  position:relative; flex:0 0 74px; width:74px; height:74px; padding:0;
  background:transparent; color:#ffcced; pointer-events:auto; touch-action:none; user-select:none;
}
.drift-face {
  display:grid; place-items:center; width:100%; height:100%;
  background:url('assets/hud-plate.webp') center / 100% 88% no-repeat;
  filter:drop-shadow(0 3px 7px #010914ab);
}
.drift-face i {
  display:block; width:52%; height:52%; transform:rotate(-32deg);
  background:url('assets/rally-steer.webp') center / contain no-repeat;
}
.drift-caption {
  position:absolute; top:calc(100% + 3px); left:50%; transform:translateX(-50%);
  display:flex; align-items:center; gap:4px; font-size:11px; font-weight:700; line-height:1;
  letter-spacing:1px; white-space:nowrap; text-shadow:0 2px 5px #020818;
}
.drift-caption kbd { font:inherit; font-size:8px; padding:2px 3px; border:1px solid #c98bb8; border-radius:3px; }
.drift-control.held .drift-face { filter:brightness(1.2) drop-shadow(0 0 6px #40ddeb88); }
.drift-control[data-tier='2'] .drift-face { filter:brightness(1.2) drop-shadow(0 0 9px #ffbb5299); }
.drift-control[data-tier='3'] .drift-face { filter:brightness(1.3) drop-shadow(0 0 11px #ff69cfa6); }
.skill-meter {
  --skill-color:#ffb1e2; display:flex; align-items:center; gap:8px; margin-bottom:6px;
  color:var(--skill-color); font-size:10px; font-weight:700; letter-spacing:1px; white-space:nowrap;
  text-shadow:0 1px 3px #000, 0 0 4px #000;
}
.skill-meter[data-mode='wake'] { --skill-color:#90faff; }
.skill-meter[data-mode='surge'] { --skill-color:#ffe297; }
.position-panel { position:relative; }
.pursuer-gap {
  position:absolute; top:calc(100% + 3px); left:0; display:flex; align-items:center; gap:5px;
  height:25px; padding:1px 8px 1px 3px; pointer-events:none; white-space:nowrap;
  border-left:2px solid #56c9d4; background:linear-gradient(90deg,#071925ec,#07192598 85%,transparent);
  color:#cbf6fa; font-size:11px; font-variant-numeric:tabular-nums; letter-spacing:.3px;
}
.pursuer-gap[hidden] { display:none; }
.pursuer-gap img { width:22px; height:100%; object-fit:contain; }
.pursuer-gap.alongside { border-color:#ffd080; color:#ffe2a8; }
@media (max-height:490px) { .pursuer-gap { top:100%; height:20px; } }
.skill-track { display:block; flex:1; height:4px; background:#102f43; transform:skewX(-17deg); }
.skill-track i { display:block; height:100%; background:var(--skill-color); transform-origin:left; box-shadow:0 0 4px var(--skill-color); }
.wake-lesson {
  --wake-light:#8afaff;
  display:flex; align-items:center; gap:5px; margin-bottom:7px; padding:8px 12px 11px 5px;
  color:#eaffff; background:transparent url('assets/hud-plate.webp') center / 100% 100% no-repeat;
  pointer-events:none; filter:drop-shadow(0 3px 4px #010914a8);
}
.wake-lesson:not([hidden]) + .skill-meter { display:none; }
.lesson-rider {
  position:relative; display:flex; align-items:flex-start; justify-content:center;
  width:43px; height:40px; flex:0 0 43px; isolation:isolate;
}
.lesson-rider img { width:100%; height:36px; object-fit:contain; }
.lesson-rider::before, .lesson-rider::after {
  content:''; position:absolute; z-index:-1; bottom:0; width:2px; height:19px;
  background:linear-gradient(var(--wake-light), transparent);
  left:calc(50% - 5px); transform:rotate(15deg);
}
.lesson-rider::after { left:calc(50% + 3px); transform:rotate(-15deg); }
.lesson-copy { min-width:0; flex:1; text-shadow:0 1px 3px #010914; }
.lesson-title { display:block; color:var(--wake-light); font-size:9px; font-weight:700; text-transform:uppercase; letter-spacing:1.4px; }
#wake-instruction { display:block; margin:2px 0 5px; font-size:13px; line-height:1.14; font-weight:600; }
.lesson-track { display:block; height:3px; background:#315568; transform:skewX(-16deg); }
.lesson-track i { display:block; height:100%; transform:scaleX(0); transform-origin:left; background:var(--wake-light); box-shadow:0 0 5px var(--wake-light); }
.wake-lesson[data-stage='release'], .wake-lesson[data-stage='success'] { --wake-light:#c6ff99; }
.wake-lesson[data-stage='release'] .lesson-track { animation:wake-ready .7s ease-in-out infinite alternate; }
@keyframes wake-ready { to { opacity:.6; } }
@media(prefers-reduced-motion:reduce) { .wake-lesson[data-stage='release'] .lesson-track { animation:none; } }
#sector-split { font-size:11px; letter-spacing:.6px; color:#dcf5f9; font-variant-numeric:tabular-nums; }
#sector-split.ahead { color:#77ffcc; }
#sector-split.behind { color:#ffc07e; }
.fastest-lap { margin:0 0 6px; font-size:12px; letter-spacing:1px; color:#aff6ff; font-variant-numeric:tabular-nums; }
.menu-controls { flex-wrap:wrap; column-gap:16px; row-gap:5px; }
.guide-selector { grid-template-columns:repeat(auto-fit,minmax(min(56px,100%),1fr)); }

@media (max-width:700px), (max-height:490px) and (orientation:landscape) {
  .race-bottom {
    left:max(12px, env(safe-area-inset-left)); right:max(12px, env(safe-area-inset-right));
    bottom:max(28px, calc(env(safe-area-inset-bottom) + 22px)); gap:0;
  }
  .mobile-steering {
    display:flex; justify-content:flex-start; gap:2px; width:auto; right:auto;
    left:max(12px, env(safe-area-inset-left)); bottom:max(28px, calc(env(safe-area-inset-bottom) + 22px));
  }
  .mobile-steering button { width:clamp(46px, 14vw, 59px); height:54px; }
  .race-powers { margin-left:auto; gap:clamp(5px,1.6vw,10px); align-items:flex-end; }
  .race-powers .drift-control, .race-powers .fire-control, .race-powers #boost.boost-button {
    --fire-size:clamp(49px,15vw,67px); width:var(--fire-size); height:var(--fire-size);
    flex:0 0 var(--fire-size); margin:0;
  }
  .drift-caption, .fire-caption, #boost.boost-button > span { font-size:9px; letter-spacing:1px; }
  .drift-caption kbd, .fire-caption kbd { display:none; }
  .speed-panel { position:absolute; left:0; bottom:75px; }
  .speed-panel #speed { font-size:clamp(29px,9vw,41px); min-width:0; }
  .speed-panel small { font-size:9px; }
  .speed-bars { margin:5px 0 0; gap:2px; }
  .speed-bars i { width:5px; height:4px; }
  .boost-panel { position:absolute; left:auto; right:0; bottom:76px; width:min(49vw,220px); max-width:none; margin:0; }
  .boost-caption { display:none; }
  .boost-label { font-size:9px; margin-bottom:4px; }
  .skill-meter { gap:6px; margin-bottom:5px; font-size:9px; letter-spacing:.45px; }
  .wake-lesson { padding:6px 10px 8px 3px; gap:4px; }
  .lesson-rider { width:32px; flex-basis:32px; height:35px; }
  .lesson-rider img { height:30px; }
  #wake-instruction { font-size:12px; }
  #sector-split { margin-top:3px; font-size:10px; }
  .guide-selector { grid-template-columns:repeat(auto-fit,minmax(44px,1fr)); gap:4px; }
  .guide-selector button { padding:4px; }
}
@media (max-height:490px) and (orientation:landscape) {
  .speed-panel, .boost-panel { bottom:68px; }
  #walrus-call { right:max(12px, env(safe-area-inset-right)); bottom:144px; }
}

.finish-camera {
  z-index:16; display:grid; place-items:center; padding:64px 18px 24px;
  background:radial-gradient(ellipse at 45% 38%, #142747c4, #020613ed 80%);
}
.camera-card {
  --contender-color:#ffc070; width:min(520px,100%); padding:clamp(15px,4vw,27px);
  color:#eafcfa; background:linear-gradient(125deg,#102536f7,#10182bf7 58%,#13162af7);
  border-top:3px solid #75fce7; border-bottom:1px solid #74e3d47a;
  box-shadow:0 25px 80px #01040c88;
}
.camera-header,.camera-bottom { display:flex; justify-content:space-between; align-items:center; gap:10px; }
.camera-header h2 { margin:0; font-size:clamp(21px,4.8vw,30px); line-height:1; letter-spacing:-.04em; text-transform:uppercase; }
#camera-margin { color:#a2ffee; font-size:clamp(19px,4.5vw,25px); font-variant-numeric:tabular-nums; white-space:nowrap; }
.camera-strip {
  position:relative; isolation:isolate; overflow:hidden; height:clamp(130px,32vw,180px);
  margin:15px 0 11px; border-block:1px solid #497483;
  background:
    linear-gradient(180deg,#081f3133 0%,#081521a6 35%,#06151fd9 54%,#052431e6 100%),
    url('assets/rally-docks-sky.webp') center 60% / cover;
}
.camera-strip::before {
  content:''; position:absolute; inset:14% 0 0;
  background:repeating-linear-gradient(0deg,#65a9ba10 0 1px,transparent 1px 5px),linear-gradient(0deg,transparent 52%,#8cdee459 53%,transparent 54%);
}
.camera-stripe {
  position:absolute; left:76%; top:0; bottom:0; width:4px;
  background:repeating-linear-gradient(#d5fff9 0 5px,#21625e 5px 10px);
  box-shadow:0 0 12px #8effe7aa;
}
.camera-bike { position:absolute; z-index:1; }
.camera-bike::before {
  content:''; position:absolute; right:clamp(35px,9vw,59px); top:-3px; height:6px;
  width:clamp(45px,16vw,100px); background:linear-gradient(90deg,transparent,currentColor); opacity:.55;
}
.camera-rival { top:27%; color:var(--contender-color); }
.camera-orca { top:73%; color:#66fffb; }
.camera-bike img {
  position:absolute; left:0; top:0; display:block; width:clamp(50px,13vw,76px); height:clamp(70px,20vw,105px);
  object-fit:contain; object-position:50% 0; transform-origin:0 0; transform:rotate(90deg) translateX(-50%);
  filter:drop-shadow(3px 0 3px #020812b0);
}
.camera-verdict { margin:0 0 5px; font-size:clamp(18px,4vw,23px); line-height:1.15; }
#camera-order { font-size:clamp(12px,3vw,14px); color:#c0d4dd; font-variant-numeric:tabular-nums; }
.camera-bottom .secondary-button {
  padding:6px 9px; width:auto; min-height:40px; margin:0; color:#96fff0;
  font-size:12px; text-decoration:underline; text-underline-offset:4px;
}
@media (max-height:460px) {
  .finish-camera { padding:42px 14px 8px; }
  .camera-card { padding:10px 17px; }
  .camera-strip { margin:8px 0; height:94px; }
  .camera-bike img { width:39px; height:64px; }
}
