/* ============================================================
   PARACHUTE JUMP — interface
   Thin type, cold alpine glass, one warm accent for the cord.
   Everything is scoped to #app so the folder stays relocatable.
   ============================================================ */

:root {
  --ice: #d6e7ff;
  --amber: #ffb23c;
  --amber-hot: #ffd999;
  --amber-deep: #e07a14;
  --danger: #ff5340;
  --danger-deep: #a01a0c;
  --go: #7ce6a0;
  --panel: rgba(7, 12, 20, 0.42);
  --panel-hard: rgba(6, 10, 17, 0.82);
  --stroke: rgba(255, 255, 255, 0.14);
  --stroke-soft: rgba(255, 255, 255, 0.07);
  --text: #eef4fc;
  --dim: rgba(238, 244, 252, 0.6);
  --dimmer: rgba(238, 244, 252, 0.34);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05080e;
  color: var(--text);
  font-family: var(--font);
  user-select: none;
  -webkit-user-select: none;
  /* Mobile: no page pan, no pinch-zoom, no pull-to-refresh mid-drag. */
  overscroll-behavior: none;
  touch-action: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.hidden {
  display: none !important;
}

/* ------------------------------------------------------- overlays */

#vignette,
#hurt,
#whiteout,
#flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#vignette {
  background: radial-gradient(
    ellipse at 50% 48%,
    rgba(0, 0, 0, 0) 32%,
    rgba(0, 0, 0, 0.34) 68%,
    rgba(2, 4, 9, 0.82) 100%
  );
}

#hurt {
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(255, 40, 20, 0) 26%,
    rgba(220, 30, 14, 0.55) 78%,
    rgba(120, 6, 0, 0.8) 100%
  );
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

#whiteout {
  background: #f2f7ff;
  opacity: 0;
}

#flash {
  background: #fff6e6;
  opacity: 0;
}

.bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  background: #04070c;
  pointer-events: none;
  z-index: 30;
}
#bar-t {
  top: 0;
}
#bar-b {
  bottom: 0;
}

/* ------------------------------------------------------------ HUD */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  backdrop-filter: blur(7px) saturate(1.1);
  -webkit-backdrop-filter: blur(7px) saturate(1.1);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.lbl {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}

/* -- score ---------------------------------------------------- */

#hud-tl {
  position: absolute;
  top: 18px;
  left: 20px;
}

#hud-tl .readout {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

#hud-tl .lbl {
  font-size: 10px;
}

#hud-tl .val {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

#hud-tl .val.tick {
  animation: tick 0.22s ease-out;
}

@keyframes tick {
  0% {
    transform: translateY(-3px) scale(1.06);
    color: var(--amber-hot);
  }
  100% {
    transform: none;
  }
}

#hud-tl .sub {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.19em;
  color: var(--dim);
  text-transform: uppercase;
}

#earn {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--amber);
  opacity: 0;
  transition: opacity 0.3s linear;
}
#earn.on {
  opacity: 0.95;
}

/* -- wind ----------------------------------------------------- */

#hud-tc {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

#wind {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px 7px 10px;
}

#wind .warrow {
  width: 22px;
  height: 22px;
  color: var(--ice);
  opacity: 0.92;
  transition: color 0.3s linear;
  filter: drop-shadow(0 0 6px rgba(120, 180, 255, 0.4));
}
#wind.gusting .warrow {
  color: var(--amber);
  filter: drop-shadow(0 0 8px rgba(255, 170, 60, 0.6));
}

#wind .wtext {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 16px;
  font-weight: 700;
}
#wind .wtext small {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--dim);
}
#wind .wlabel {
  font-size: 8px;
  letter-spacing: 0.2em;
  color: var(--dimmer);
  padding-left: 8px;
  border-left: 1px solid var(--stroke-soft);
}

#gust {
  padding: 3px 11px;
  border-radius: 20px;
  background: rgba(255, 150, 40, 0.16);
  border: 1px solid rgba(255, 170, 70, 0.4);
  color: var(--amber-hot);
  font-size: 9px;
  letter-spacing: 0.22em;
  animation: gustpulse 0.7s ease-in-out infinite;
}
@keyframes gustpulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

/* -- altitude tape -------------------------------------------- */

#hud-tr {
  position: absolute;
  top: 18px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#altimeter {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

#altimeter .alt-head {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 8px;
  letter-spacing: 0.22em;
  color: var(--dimmer);
  text-transform: uppercase;
  padding: 4px 0;
}
#altimeter .alt-head .unit {
  color: var(--dim);
}

.alt-body {
  display: flex;
  gap: 9px;
  align-items: flex-start;
}

.alt-track {
  position: relative;
  width: 14px;
  height: 236px;
  border-radius: 7px;
  background: linear-gradient(to top, rgba(4, 8, 15, 0.75), rgba(10, 18, 30, 0.42));
  border: 1px solid var(--stroke);
  overflow: hidden;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.alt-band {
  position: absolute;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(124, 230, 160, 0.5), rgba(124, 230, 160, 0.18));
  border-top: 1px solid rgba(160, 255, 200, 0.85);
  border-bottom: 1px solid rgba(160, 255, 200, 0.55);
  box-shadow: 0 0 14px rgba(110, 240, 170, 0.28);
}
.alt-band.band-late {
  background: linear-gradient(to top, rgba(255, 170, 60, 0.42), rgba(255, 130, 40, 0.12));
  border-top-color: rgba(255, 190, 110, 0.7);
  border-bottom-color: rgba(255, 190, 110, 0.55);
  box-shadow: 0 0 12px rgba(255, 160, 60, 0.22);
}

.alt-ticks {
  position: absolute;
  inset: 0;
}
.alt-ticks .tick {
  position: absolute;
  right: 0;
  width: 6px;
  height: 1px;
  background: rgba(255, 255, 255, 0.3);
}
.alt-ticks .tick.major {
  width: 14px;
  background: rgba(255, 255, 255, 0.5);
}
.alt-ticks .tick span {
  position: absolute;
  right: 18px;
  top: -6px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--dim);
  white-space: nowrap;
}

.alt-marker {
  position: absolute;
  left: -4px;
  right: -4px;
  height: 2px;
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
  transition: background 0.2s linear;
}
.alt-marker i {
  position: absolute;
  left: -3px;
  top: -4px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #fff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}
.alt-marker.danger {
  background: var(--danger);
  box-shadow: 0 0 12px rgba(255, 70, 50, 0.9);
}
.alt-marker.danger i {
  border-left-color: var(--danger);
}

.alt-num {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  min-width: 86px;
}
.alt-num > span {
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}
.alt-num small {
  margin-top: 4px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
}
.alt-num small.good {
  color: var(--go);
}
.alt-num small.bad {
  color: var(--danger);
}

/* -- descent rate --------------------------------------------- */

#vsi {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.vsi-track {
  position: relative;
  width: 74px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.vsi-safe {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 38%;
  background: rgba(124, 230, 160, 0.22);
  border-right: 1px solid rgba(150, 255, 195, 0.55);
}
.vsi-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--go), var(--amber) 55%, var(--danger));
  border-radius: 4px;
}
.vsi-foot {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
}
.vsi-foot small {
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

/* -- speed ---------------------------------------------------- */

#speedo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.sp-num {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 20px;
  font-weight: 700;
}
.sp-num small {
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--dim);
}
.sp-track {
  width: 150px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.sp-fill {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #6fd0ff, var(--amber) 62%, var(--danger));
  box-shadow: 0 0 10px rgba(255, 160, 80, 0.5);
}

/* -- target pointer ------------------------------------------- */

#target-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.3s linear;
  will-change: transform;
}
#target-marker.on {
  opacity: 0.9;
}
#target-marker svg {
  width: 20px;
  height: 20px;
  color: var(--amber-hot);
  filter: drop-shadow(0 0 7px rgba(255, 170, 60, 0.75));
}
#target-marker span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--amber-hot);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}
#target-marker.over svg {
  color: var(--go);
}

/* -- prompt --------------------------------------------------- */

#prompt {
  position: absolute;
  left: 50%;
  bottom: 15%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.pr-ring svg {
  width: 108px;
  height: 108px;
  transform: rotate(-90deg);
}
#pr-arc {
  fill: none;
  stroke: var(--amber);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 327;
  stroke-dashoffset: 327;
  filter: drop-shadow(0 0 6px rgba(255, 180, 70, 0.7));
}

.pr-body {
  text-align: center;
}
.pr-body strong {
  display: block;
  font-size: 15px;
  letter-spacing: 0.3em;
  font-weight: 800;
  color: var(--amber-hot);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
}
.pr-body small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
}
#prompt.urgent .pr-body strong {
  color: #fff;
  animation: gustpulse 0.45s ease-in-out infinite;
}
#prompt.urgent #pr-arc {
  stroke: var(--danger);
}

/* -- warnings ------------------------------------------------- */

#warn {
  position: absolute;
  left: 50%;
  top: 22%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
#warn .w {
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.24em;
  background: rgba(150, 20, 10, 0.42);
  border: 1px solid rgba(255, 90, 70, 0.5);
  color: #ffd9d2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: warnin 0.24s ease-out;
}
#warn .w.warm {
  background: rgba(160, 90, 10, 0.38);
  border-color: rgba(255, 180, 80, 0.5);
  color: #ffe9c8;
}
#warn .w.soft {
  background: rgba(20, 60, 110, 0.35);
  border-color: rgba(130, 190, 255, 0.4);
  color: #dceaff;
}
@keyframes warnin {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
}

/* -- popups --------------------------------------------------- */

#popups {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}
#popups .p {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85), 0 0 22px rgba(255, 190, 90, 0.35);
  animation: pop 1.5s cubic-bezier(0.16, 0.9, 0.3, 1) forwards;
  white-space: nowrap;
}
#popups .p.good {
  color: var(--go);
}
#popups .p.warm {
  color: var(--amber-hot);
}
#popups .p.bad {
  color: #ff8f7c;
}
#popups .p .amt {
  font-size: 12px;
  opacity: 0.85;
  margin-left: 5px;
}
@keyframes pop {
  0% {
    opacity: 0;
    transform: translateY(9px) scale(0.94);
  }
  14% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-22px) scale(1);
  }
}

/* -- toast + grade -------------------------------------------- */

#toast {
  position: absolute;
  left: 50%;
  top: 74px;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 20px;
  background: var(--panel-hard);
  border: 1px solid var(--stroke);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ice);
  opacity: 0;
  transition: opacity 0.32s linear;
  white-space: nowrap;
}
#toast.on {
  opacity: 1;
}

#grade {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  font-size: 13px;
  letter-spacing: 0.3em;
  font-weight: 700;
  color: var(--amber-hot);
  opacity: 0;
  transition: opacity 0.24s linear;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}
#grade.on {
  opacity: 1;
}

/* -- hints ---------------------------------------------------- */

#hints {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--dimmer);
  transition: opacity 0.6s linear;
}
#hints.dim {
  opacity: 0;
}
#hints span {
  display: flex;
  align-items: center;
  gap: 5px;
}

kbd {
  display: inline-block;
  min-width: 18px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--stroke);
  border-bottom-width: 2px;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
}

/* -------------------------------------------------------- touch */

#touch {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  -webkit-touch-callout: none;
}
#t-left {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 52%;
  pointer-events: auto;
  touch-action: none;
}
/* The stick is the drag's shadow: idle it waits near the lower-left thumb
   rest; on contact it jumps under the finger and tracks the deflection. */
#t-stick {
  position: absolute;
  left: 76px;
  top: auto;
  bottom: 104px;
  width: 96px;
  height: 96px;
  margin-left: -48px;
  margin-top: -48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.5;
  transition: left 0.14s ease-out, top 0.14s ease-out, opacity 0.14s;
  pointer-events: none;
}
#touch.holding #t-stick {
  opacity: 1;
}
#t-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  border: 1px solid rgba(214, 231, 255, 0.6);
  background: radial-gradient(circle at 50% 38%, rgba(214, 231, 255, 0.55), rgba(90, 130, 190, 0.28));
  transform: translate(0px, 0px);
  transition: transform 0.06s linear;
}
/* The pause control. Safe-area aware: on a notched phone in landscape the
   top-right corner is where the grip and the notch both live. */
#t-pause {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: calc(14px + env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(7, 12, 20, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: auto;
  touch-action: none;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
#t-pause i {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: rgba(238, 244, 252, 0.85);
}
#t-pause:active,
#t-pause.pressed {
  filter: brightness(1.6);
}
#t-right {
  position: absolute;
  right: calc(26px + env(safe-area-inset-right));
  bottom: calc(40px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: auto;
}
.tbtn {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(255, 180, 80, 0.45);
  background: radial-gradient(circle at 50% 40%, rgba(255, 175, 70, 0.3), rgba(120, 60, 0, 0.18));
  color: var(--amber-hot);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.16em;
  touch-action: none;
  -webkit-touch-callout: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.tbtn.small {
  width: 88px;
  height: 88px;
  font-size: 11px;
  border-color: rgba(160, 200, 255, 0.35);
  background: radial-gradient(circle at 50% 40%, rgba(120, 170, 255, 0.22), rgba(20, 40, 80, 0.16));
  color: var(--ice);
}
.tbtn:active,
.tbtn.pressed {
  filter: brightness(1.5);
}

/* ------------------------------------------------------ screens */

.screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 40%, rgba(6, 12, 24, 0.55), rgba(3, 6, 12, 0.9));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadein 0.4s ease-out;
  overflow: auto;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}

.inner {
  width: min(880px, 100%);
  text-align: center;
  animation: risein 0.5s cubic-bezier(0.16, 0.9, 0.3, 1);
}
.inner.small {
  width: min(560px, 100%);
}
@keyframes risein {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

.logo h1 {
  margin: 10px 0 0;
  font-size: clamp(38px, 7vw, 76px);
  line-height: 0.88;
  letter-spacing: 0.06em;
  font-weight: 800;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.7);
}
.logo h1 em {
  font-style: normal;
  color: var(--amber);
  text-shadow: 0 0 34px rgba(255, 170, 60, 0.45), 0 6px 40px rgba(0, 0, 0, 0.7);
}
.logo .chute {
  display: block;
  width: 46px;
  height: 26px;
  margin: 0 auto;
  border-radius: 24px 24px 4px 4px;
  background: linear-gradient(90deg, #e8402c 0 25%, #f4f7ff 25% 50%, #e8402c 50% 75%, #f4f7ff 75%);
  box-shadow: 0 0 28px rgba(255, 120, 90, 0.4);
}

.kicker {
  margin: 12px 0 0;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--dim);
}

.hook {
  max-width: 620px;
  margin: 20px auto 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--dim);
}
.hook strong {
  color: var(--text);
  font-weight: 600;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 26px 0 8px;
  text-align: left;
}
.step {
  position: relative;
  padding: 14px 14px 15px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke-soft);
}
.step .n {
  position: absolute;
  top: -9px;
  left: 13px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--amber);
  color: #201000;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
}
.step h3 {
  margin: 4px 0 5px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.step p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dim);
}

.best {
  margin-top: 20px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--dimmer);
}
.best span {
  color: var(--text);
  font-weight: 700;
}

.footer-note {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--dimmer);
  line-height: 2;
}

.row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn {
  appearance: none;
  padding: 13px 26px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.12s ease-out, background 0.2s linear, box-shadow 0.2s linear;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.11);
}
.btn:active {
  transform: scale(0.97);
}
.btn.primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  border-color: rgba(255, 210, 150, 0.5);
  color: #221000;
  box-shadow: 0 8px 26px rgba(255, 140, 40, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.primary:hover {
  box-shadow: 0 10px 32px rgba(255, 150, 50, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn.icon {
  padding: 13px 16px;
  letter-spacing: 0.14em;
  font-size: 11px;
}

.verdict {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  background: rgba(150, 20, 10, 0.36);
  border: 1px solid rgba(255, 90, 70, 0.45);
  color: #ffd2c8;
}
.verdict.win {
  background: rgba(30, 120, 70, 0.32);
  border-color: rgba(120, 240, 170, 0.5);
  color: #cfffe4;
}
.verdict.clean {
  background: rgba(150, 100, 10, 0.3);
  border-color: rgba(255, 190, 90, 0.5);
  color: #ffedcb;
}

.screen h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0.02em;
  font-weight: 800;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 9px;
  margin: 22px 0 6px;
}
.stat {
  padding: 11px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke-soft);
}
.stat .k {
  display: block;
  font-size: 9px;
  letter-spacing: 0.19em;
  color: var(--dimmer);
  text-transform: uppercase;
}
.stat .v {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  font-weight: 800;
}
.stat .v.hot {
  color: var(--amber-hot);
}
.stat .v.good {
  color: var(--go);
}
.stat .v.bad {
  color: #ff8f7c;
}

.rank {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
}
.rank strong {
  color: var(--amber-hot);
  font-weight: 800;
  letter-spacing: 0.1em;
}

.next {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--amber);
  text-transform: uppercase;
}

/* ------------------------------------------------------ loading */

#loading {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05080e;
  transition: opacity 0.5s linear;
}
#loading.done {
  opacity: 0;
  pointer-events: none;
}
.load-inner {
  text-align: center;
}
.load-chute {
  width: 54px;
  height: 30px;
  margin: 0 auto 20px;
  border-radius: 28px 28px 4px 4px;
  background: linear-gradient(90deg, #e8402c 0 25%, #f4f7ff 25% 50%, #e8402c 50% 75%, #f4f7ff 75%);
  animation: sway 2.4s ease-in-out infinite;
}
@keyframes sway {
  0%,
  100% {
    transform: translateX(-9px) rotate(-4deg);
  }
  50% {
    transform: translateX(9px) rotate(4deg);
  }
}
.load-text {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--dim);
  text-transform: uppercase;
}

/* --------------------------------------------------- responsive */

@media (max-width: 760px) {
  #hud-tl .val {
    font-size: 26px;
  }
  .alt-track {
    height: 168px;
  }
  .alt-num > span {
    font-size: 24px;
  }
  .alt-num {
    min-width: 66px;
  }
  .sp-track {
    width: 104px;
  }
  #hints {
    display: none;
  }
  #hud-tl {
    top: 12px;
    left: 12px;
  }
  #hud-tr {
    top: 12px;
    right: 12px;
  }
  #hud-tc {
    top: 12px;
  }
  .steps {
    grid-template-columns: 1fr 1fr;
  }
  .logo h1 {
    font-size: 34px;
  }
}

/* ------------------------------------------------- predicted landing */

#predict {
  position: absolute;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity 0.25s linear, border-color 0.25s linear;
  white-space: nowrap;
}
#predict.on {
  opacity: 1;
}
#predict .p-lbl {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dimmer);
}
#predict .p-val {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--amber-hot);
}
#predict.on-target {
  border-color: rgba(120, 240, 160, 0.55);
  background: rgba(20, 60, 40, 0.42);
}
#predict.on-target .p-val {
  color: var(--go);
}
#predict.close .p-val {
  color: var(--amber-hot);
}
#predict.far .p-val {
  color: #ff9a86;
}

@media (max-width: 760px) {
  #predict {
    bottom: 92px;
  }
}

/* --------------------------------------------------- hazard warnings */

#threats {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#threats .th {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #ff8a6a;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
  animation: thin 0.5s ease-in-out infinite;
}
#threats .th svg {
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 6px rgba(255, 80, 40, 0.9));
}
#threats .th span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
}
#threats .th.bird {
  color: #ffd07a;
}
#threats .th.bird svg {
  filter: drop-shadow(0 0 6px rgba(255, 190, 80, 0.9));
}
@keyframes thin {
  0%, 100% { opacity: 0.62; }
  50% { opacity: 1; }
}

/* -------------------------------------------------- descent profile */

#profile {
  position: absolute;
  left: 20px;
  bottom: 18px;
  width: 168px;
  padding: 6px 6px 4px;
  border-radius: 10px;
  background: var(--panel);
  border: 1px solid var(--stroke);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
#profile svg {
  display: block;
  width: 168px;
  height: 118px;
  overflow: visible;
}
#pf-terrain {
  fill: rgba(190, 210, 235, 0.16);
  stroke: rgba(220, 235, 255, 0.55);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
#pf-band {
  fill: rgba(124, 230, 160, 0.34);
  stroke: none;
}
#pf-target {
  stroke: #7ce6a0;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 4 3;
}
#pf-dot {
  fill: #ffb23c;
  stroke: #2a1a00;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
#pf-lbl, #profile .pf-lbl {
  margin-top: 3px;
  font-size: 8px;
  letter-spacing: 0.18em;
  color: var(--dimmer);
  text-align: center;
}

@media (max-width: 900px) {
  #profile { display: none; }
}

/* ------------------------------------------------------- throttle state */

#throttle {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.25s linear;
}
#throttle.on {
  opacity: 1;
}
#throttle i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dim);
  box-shadow: 0 0 8px currentColor;
}
#throttle span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--dim);
}
#throttle.drive i { background: #6fd0ff; }
#throttle.drive span { color: #9fe0ff; }
#throttle.spread i { background: var(--amber); }
#throttle.spread span { color: var(--amber-hot); }
#throttle.neutral i { background: var(--dimmer); }

/* -------------------------------------------------- next-gate marker */

#ring-marker {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.24s linear;
  will-change: transform;
  pointer-events: none;
}
#ring-marker.on { opacity: 0.95; }
#ring-marker svg {
  width: 30px;
  height: 30px;
  color: #ffe6b0;
  filter: drop-shadow(0 0 7px rgba(255, 200, 90, 0.85));
}
#ring-marker span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffe6b0;
  text-shadow: 0 1px 7px rgba(0, 0, 0, 0.85);
}
#ring-marker.close svg { color: var(--go); }
#ring-marker.close span { color: var(--go); }

/* ------------------------------------------------ landing coach line */

#predict {
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
#predict .p-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
#predict .p-hint {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--amber-hot);
  text-transform: lowercase;
  min-height: 14px;
}
#predict .p-hint.good { color: var(--go); }
#predict .p-hint.bad {
  color: #ff8f7c;
  animation: gustpulse 0.5s ease-in-out infinite;
}
#predict .p-hint.warn { color: var(--amber-hot); }

/* ------------------------------------------------ mobile pass
   Phones play in landscape. In portrait, a small non-blocking nudge — it never
   eats a touch, and it disappears the moment the device is turned. */
@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
  #app::after {
    content: "↻  Best played in landscape";
    position: fixed;
    left: 50%;
    bottom: max(10px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 9999;
    padding: 0.42rem 0.9rem;
    border: 1px solid rgba(243, 237, 225, 0.18);
    border-radius: 999px;
    background: rgba(8, 10, 16, 0.82);
    color: #f3ede1;
    font: 600 0.72rem/1.2 system-ui, -apple-system, sans-serif;
    letter-spacing: 0.04em;
    white-space: nowrap;
    pointer-events: none;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

/* Phone landscape leaves ~300px of height once the browser's own UI is showing
   — far less than the menu is tall. The menu scales to the height it is given,
   and scrolls as the backstop, so the launch button is always reachable. */
@media (max-height: 520px) {
  .screen {
    padding: 8px;
    overflow-y: auto;
  }
  .screen > .inner {
    margin: auto;
    transform: scale(0.72);
  }
}
@media (max-height: 460px) { .screen > .inner { transform: scale(0.6); } }
@media (max-height: 400px) { .screen > .inner { transform: scale(0.5); } }
@media (max-height: 360px) { .screen > .inner { transform: scale(0.42); } }
@media (max-height: 320px) { .screen > .inner { transform: scale(0.34); } }

/* ── promo capture: narrative captions (?cine=1) ──────────────────────────
   Fades on GAME time (hud.storyUpdate), so fixed-stepped video capture keeps
   each line on screen for its full scripted duration. */
#story-line {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  width: min(82vw, 760px);
  text-align: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: clamp(19px, 3.2vw, 28px);
  line-height: 1.45;
  color: #eaf2fb;
  background: rgba(5, 7, 10, 0.48);
  padding: 10px 28px;
  border-radius: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95), 0 0 22px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
  z-index: 30;
}
#story-line.on { opacity: 1; }
