/* HEZARFEN UI. One unit (1em on #ui) is 16 px at 900 px of viewport height and scales with the height, so the HUD
   keeps the reference's proportions from 1280x720 to 3440x1440. All text is Turkish (lang="tr" on #ui). */

@font-face { font-family: 'Barlow'; font-weight: 400; font-display: block; src: url('../assets/fonts/Barlow-Regular.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-display: block; src: url('../assets/fonts/Barlow-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-display: block; src: url('../assets/fonts/Barlow-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-display: block; src: url('../assets/fonts/BarlowCondensed-Medium.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: block; src: url('../assets/fonts/BarlowCondensed-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-weight: 600; font-display: block; src: url('../assets/fonts/CormorantGaramond-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'Marcellus'; font-weight: 400; font-display: block; src: url('../assets/fonts/Marcellus-Regular.ttf') format('truetype'); }

html, body { margin: 0; height: 100%; background: #1a1418; overflow: hidden; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }

#ui {
  --ink: #fffdf9;
  --ink-soft: rgba(255, 253, 249, 0.74);
  --ink-faint: rgba(255, 253, 249, 0.46);
  --gold: #f8cf8e;
  --shadow-strong: 0 0 2px rgba(var(--plum), 0.85), 0 1px 3px rgba(var(--plum), 0.7), 0 0 0.8em rgba(var(--plum), 0.4);
  --warn: #ff9478;
  --warn-text: #ffc7b4;
  --plum: 24, 16, 26;
  --shadow: 0 1px 2px rgba(var(--plum), 0.6), 0 0 0.7em rgba(var(--plum), 0.38);
  --edge: 0 0 2px rgba(var(--plum), 0.9), 0 0 5px rgba(var(--plum), 0.55), 0 1px 0.9em rgba(var(--plum), 0.5);
  --shadow-svg: drop-shadow(0 1px 1.5px rgba(var(--plum), 0.62));
  --sans: 'Barlow', 'DIN Alternate', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Marcellus', 'Cormorant Garamond', Georgia, serif;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --mx: clamp(2.6em, 5.4vw, 9em);
  --my: clamp(2.2em, 8.6vh, 6.4em);
  --ease: cubic-bezier(0.22, 0.7, 0.2, 1);
  position: fixed; inset: 0; pointer-events: none; user-select: none; -webkit-user-select: none;
  font: 500 clamp(13px, 1.778vh, 27px)/1.2 var(--sans);
  color: var(--ink);
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-smoothing: antialiased;
}
#ui.nohud { display: none; }
:where(#ui *) { box-sizing: border-box; }
:where(#ui svg) { display: block; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
:where(#ui button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; pointer-events: auto; letter-spacing: inherit; }
:where(#ui h1, #ui h2, #ui h3, #ui p, #ui ul) { margin: 0; padding: 0; font-weight: inherit; }
:where(#ui ul) { list-style: none; }

.layer { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.28s var(--ease), visibility 0s linear 0.28s; }
.layer.on { opacity: 1; visibility: visible; transition: opacity 0.28s var(--ease), visibility 0s; }

/* ---- key caps (follow the device in use) ---------------------------------------------------------------------- */
#ui kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.95em; height: 1.95em; padding: 0 0.62em;
  font: 600 0.74em/1 var(--sans); letter-spacing: 0.06em; color: #2b2229; text-shadow: none;
  background: linear-gradient(#f6f1ea, #e2dbd1); border-radius: 0.32em;
  box-shadow: 0 0.14em 0 rgba(var(--plum), 0.55), 0 0.2em 0.6em rgba(var(--plum), 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}
#ui kbd.round { border-radius: 50%; padding: 0; }
#ui kbd + kbd { margin-left: 0.36em; }
.mouse-cap { display: inline-flex; align-items: center; gap: 0.5em; }
.mouse-cap svg { width: 1.05em; height: 1.5em; filter: var(--shadow-svg); }
.mouse-cap svg .hot { fill: currentColor; stroke: none; }
.mouse-cap em { font: 500 0.7em/1 var(--sans); letter-spacing: 0.14em; text-shadow: var(--shadow); }
#ui .dev-keyboard, #ui .dev-mouse, #ui .dev-gamepad { display: none; }
#ui[data-device='keyboard'] .dev-keyboard, #ui[data-device='mouse'] .dev-mouse, #ui[data-device='gamepad'] .dev-gamepad { display: inline-flex; }

/* ---- in-flight HUD -------------------------------------------------------------------------------------------- */
#hud-shiver { position: absolute; inset: 0; will-change: transform; }
.readout { position: absolute; top: var(--my); text-shadow: var(--shadow); }
.readout .lbl { font-size: 0.86em; letter-spacing: 0.085em; color: var(--ink); opacity: 0.94; }
.readout .val { margin-top: 0.32em; font-size: 1.5em; line-height: 1; letter-spacing: 0.012em; display: flex; align-items: baseline; white-space: nowrap; }
.readout .unit { margin-left: 0.26em; }
.hud-tl { left: var(--mx); }
.hud-tr { right: var(--mx); text-align: right; padding-right: 2.2em; }
.hud-tr .val { justify-content: flex-end; position: relative; }
.trend { width: 0.5em; height: 0.5em; margin-left: 0.4em; align-self: center; opacity: 0; filter: var(--shadow-svg); transition: opacity 0.25s, transform 0.25s var(--ease), color 0.25s; }
.trend.up { opacity: 1; color: var(--gold); stroke-width: 2; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)); }
.trend.down { opacity: 0.62; transform: rotate(180deg); }
.goal-arrow { position: absolute; right: -1.5em; bottom: -0.06em; width: 1.05em; height: 1.05em; will-change: transform; }
.goal-arrow svg { width: 100%; height: 100%; stroke-width: 1.7; filter: var(--shadow-svg); }

.goal-mark { position: absolute; left: 0; top: 0; width: 1.6em; height: 2.24em; margin: -2.24em 0 0 -0.8em; opacity: 0; transition: opacity 0.28s; will-change: transform; color: var(--ink); }
.goal-mark.on { opacity: 0.92; }
.goal-mark svg { width: 100%; height: 100%; stroke-width: 1.5; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)) drop-shadow(0 1px 2px rgba(var(--plum), 0.6)); }

/* call-outs: quiet lines under the top edge, centred, stacking downward */
.callouts { position: absolute; top: var(--my); left: 50%; width: 30em; margin-left: -15em; display: flex; flex-direction: column; align-items: center; gap: 0.5em; }
.callout { display: flex; align-items: center; gap: 0.7em; font-size: 0.9em; letter-spacing: 0.14em; white-space: nowrap; text-shadow: var(--shadow);
  opacity: 0; transform: translateY(-0.5em); transition: opacity 0.24s var(--ease), transform 0.24s var(--ease); }
.callout.on { opacity: 1; transform: none; }
.callout svg { width: 1.15em; height: 1.15em; filter: var(--shadow-svg); }
.callout .c-what { color: rgba(255, 253, 249, 0.9); }
.callout .c-what::before { content: ''; display: inline-block; width: 0.28em; height: 0.28em; margin: 0 0.75em 0.2em 0; background: currentColor; transform: rotate(45deg); opacity: 0.7; }
.callout .c-what:empty, .callout .c-pts:empty { display: none; }
.callout .c-pts { color: #fff1d6; letter-spacing: 0.04em; font-weight: 600; min-width: 2.6em; text-shadow: var(--shadow-strong); }
.callout.warm svg { color: var(--gold); }
.callout.warm .c-what { font-weight: 600; }
.callout.warm .c-title { text-shadow: var(--shadow-strong); }

/* stall warning: upper third, in the sky, never over the centre */
.warn { position: absolute; left: 50%; top: 21%; width: 19em; margin-left: -9.5em; padding: 0.85em 0 0.95em; display: flex; flex-direction: column; align-items: center; text-align: center;
  isolation: isolate; text-shadow: var(--shadow); opacity: 0; transform: scale(0.97); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease); }
.warn::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent, var(--warn) 24%, var(--warn) 76%, transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, var(--warn) 24%, var(--warn) 76%, transparent) bottom / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(var(--plum), 0.4) 26%, rgba(var(--plum), 0.4) 74%, transparent); }
.warn.on { opacity: 1; transform: none; }
.warn svg { width: 1.45em; height: 1.45em; margin-bottom: 0.4em; color: var(--warn); filter: var(--shadow-svg); }
.warn-1 { font-size: 1.1em; font-weight: 600; letter-spacing: 0.22em; margin-right: -0.22em; color: #ffe9e0; }
.warn-2 { margin-top: 0.42em; font-size: 0.8em; letter-spacing: 0.2em; margin-right: -0.2em; color: var(--ink); opacity: 0.92; }
.warn.deep .warn-1 { animation: pulse 0.5s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: 0.55; } }

/* speed: a corner read-out of its own, beside the height */
.hud-spd { left: calc(var(--mx) + 11.5em); }
.hud-spd .unit { font-size: 0.62em; letter-spacing: 0.05em; margin-left: 0.4em; opacity: 0.92; }

/* the variometer: a slim tape on the left edge under the height block, the same white line and type as the corners,
   no backing. It ends above the wings' sweep (the rig covers the lower-left corner from about 40% of the height). */
.vario { position: absolute; left: var(--mx); top: calc(var(--my) + 6.5em); width: 12em; height: 9.6em; text-shadow: var(--shadow); }
.v-track { position: absolute; left: 0; top: 0; bottom: 0; width: 0.6em; border-radius: 0.3em; background: rgba(var(--plum), 0.15); box-shadow: inset 0 0 0 1px rgba(255, 253, 249, 0.85), 0 0 3px rgba(var(--plum), 0.55); }
.v-fill { position: absolute; left: 2px; right: 2px; height: calc(50% - 2px); will-change: transform; transform: scaleY(0); }
.v-up { bottom: 50%; transform-origin: 50% 100%; border-radius: 0.2em 0.2em 0 0; background: linear-gradient(0deg, #f3b765, #ffdfa6); }
.v-down { top: 50%; transform-origin: 50% 0; border-radius: 0 0 0.2em 0.2em; background: linear-gradient(180deg, #c3cfec, #e6ecfb); }
.v-zero { position: absolute; left: -0.28em; width: 1.3em; top: 50%; height: 1px; background: var(--ink); box-shadow: 0 0 2px rgba(var(--plum), 0.8); }
.v-ticks { position: absolute; inset: 0; }
.v-ticks i { position: absolute; left: 0.8em; width: 0.3em; height: 1px; background: var(--ink); opacity: 0.85; box-shadow: 0 0 2px rgba(var(--plum), 0.7); }
.v-air { position: absolute; left: -0.86em; top: 50%; width: 0.6em; height: 0.6em; margin-top: -0.3em; color: var(--ink); will-change: transform; }
.v-air svg { width: 100%; height: 100%; fill: currentColor; stroke: none; filter: var(--shadow-svg); }
.v-read { position: absolute; left: 1.8em; top: 50%; margin-top: -0.78em; white-space: nowrap; }
.v-num { font-size: 1.5em; line-height: 1; letter-spacing: 0.012em; display: flex; align-items: baseline; transition: color 0.25s; }
.v-num .unit { margin-left: 0.4em; font-size: 0.56em; letter-spacing: 0.06em; opacity: 0.92; }
.v-word { margin-top: 0.5em; font-size: 0.8em; font-weight: 600; letter-spacing: 0.2em; opacity: 0; transition: opacity 0.25s; }
.v-word::before { content: ''; display: inline-block; width: 0.42em; height: 0.42em; margin: 0 0.75em 0.1em 0.1em; background: var(--gold); transform: rotate(45deg); box-shadow: 0 0 2px rgba(var(--plum), 0.9); }
/* rising air is unmistakable: warm fill with a soft pulse, warm number, the word TERMAL, warm pointer */
.vario.climb .v-num { color: #fff1d6; font-weight: 600; text-shadow: var(--shadow-strong); }
.vario.lift .v-word { opacity: 1; }
.vario.lift .v-air { color: var(--gold); }
.vario.lift .v-track { animation: liftpulse 1.1s ease-in-out infinite; }
@keyframes liftpulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 253, 249, 0.85), 0 0 0.3em rgba(246, 190, 110, 0.35); }
  50% { box-shadow: inset 0 0 0 1px #ffdfa6, 0 0 1em rgba(246, 190, 110, 0.95); }
}
/* and felt at the edge of the eye: a warm glow along the bottom of the frame while the air under the wings rises */
.lift-glow { position: absolute; left: 0; right: 0; bottom: 0; height: 30vh; opacity: 0; will-change: opacity; transition: opacity 0.25s linear;
  background: radial-gradient(75% 100% at 50% 100%, rgba(250, 190, 104, 0.62), rgba(250, 190, 104, 0.2) 55%, transparent 80%); }

/* top-right: the next stork column while the glide does not reach, Üsküdar once it does */
.hud-tr .lbl { display: flex; align-items: center; justify-content: flex-end; }
.t-ico { display: none; width: 1.5em; height: 0.9em; margin-right: 0.6em; color: #ffd596; }
.t-ico svg[viewBox='0 0 24 24'] { width: 1em; height: 1em; margin: -0.05em 0 0 auto; }
.t-ico svg { width: 100%; height: 100%; stroke-width: 1.8; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)); }
.hud-tr.thermal .t-ico { display: block; }
.hud-tr.thermal .lbl-sub { display: none; }
.hud-tr.thermal .lbl { font-size: 0.95em; font-weight: 600; letter-spacing: 0.12em; opacity: 1; text-shadow: var(--shadow-strong); }
.t-name { font-size: 0.72em; letter-spacing: 0.1em; margin-right: 0.7em; }
.t-name:empty { display: none; }
.t-sub { justify-content: flex-end; min-height: 1.2em; }
.t-sub:empty { visibility: hidden; }
.t-sub b { margin-left: 0.2em; }
.goal-arrow { transition: opacity 0.3s; }
.lbl-sub { margin-left: 0.7em; font-size: 0.82em; letter-spacing: 0.12em; opacity: 0.72; }
.lbl-sub::before { content: ''; display: inline-block; width: 0.3em; height: 0.3em; margin: 0 0.7em 0.16em 0; background: currentColor; transform: rotate(45deg); opacity: 0.8; }
.readout .sub { margin-top: 0.5em; display: flex; align-items: baseline; gap: 0.45em; font-size: 0.74em; letter-spacing: 0.14em; opacity: 0.88; }
.readout .sub b { font-weight: 600; font-size: 1.12em; letter-spacing: 0.02em; }
/* the second line (Üsküdar, with the height to spare or short): large enough to read, with a soft dark edge so it
   holds against a bright sky */
.readout .t-sub { margin-top: 0.5em; font-size: 1em; font-weight: 500; letter-spacing: 0.07em; opacity: 1; text-shadow: var(--edge); }
.t-margin { font-size: 0.72em; letter-spacing: 0.04em; white-space: pre; }
.hud-tr .val, .hud-tr .lbl { text-shadow: var(--edge); }

/* a gate on the guided line: two thin posts to fly between (as wide on screen as the gate is), with its distance */
.gate-mark { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity 0.3s; will-change: transform; text-shadow: var(--edge); }
.gate-mark.on { opacity: 1; }
.gt-post { position: absolute; left: -1px; top: -1.5em; width: 2px; height: 3em; border-radius: 1px; background: linear-gradient(180deg, transparent, var(--ink) 22%, var(--ink) 78%, transparent); box-shadow: 0 0 3px rgba(var(--plum), 0.9); will-change: transform; }
.gt-dot { position: absolute; left: -0.2em; top: -0.2em; width: 0.4em; height: 0.4em; background: #ffd596; transform: rotate(45deg); box-shadow: 0 0 3px rgba(var(--plum), 0.9); }
.gt-dist { position: absolute; left: -3em; width: 6em; top: 1.7em; text-align: center; font-size: 0.82em; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; }
.gt-edge { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity 0.2s; }
.gt-edge svg { position: absolute; left: -0.45em; top: -3em; width: 0.9em; height: 0.9em; color: #ffd596; stroke-width: 2; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)); }
.gate-mark.edge .gt-edge { opacity: 1; }
.t-ico svg path { vector-effect: non-scaling-stroke; }

/* the landing square in the view: a diamond that stays (at the frame's edge when out of sight) and, close in, a ring on the carpets */
.goal-mark .gm-edge { position: absolute; left: 50%; top: 34%; width: 0; height: 0; opacity: 0; transition: opacity 0.2s; }
.goal-mark .gm-edge svg { position: absolute; left: -0.45em; top: -2em; width: 0.9em; height: 0.9em; stroke-width: 2; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)); }
.goal-mark.edge .gm-edge { opacity: 1; }
.goal-mark.edge .gm-diamond path:last-child { opacity: 0; }
.goal-ring { position: absolute; left: 0; top: 0; width: 40px; height: 20px; margin: 0; border-radius: 50%; border: 1.5px solid var(--ink); box-shadow: 0 0 0 1px rgba(var(--plum), 0.35), inset 0 0 0 1px rgba(var(--plum), 0.3), 0 0 0.9em rgba(246, 207, 150, 0.55);
  opacity: 0; transition: opacity 0.3s; will-change: transform, width, height; }
.goal-ring.on { opacity: 0.95; }

/* the nearest reachable rising air: a small bird with its distance, at the thermal or at the edge of the frame */
.th-mark { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; transition: opacity 0.3s; will-change: transform; color: var(--ink); text-shadow: var(--shadow-strong); }
.th-mark.on { opacity: 1; }
.th-bird { position: absolute; left: -1.2em; top: -1.5em; width: 2.4em; height: 1.2em; color: #ffd596; stroke-width: 1.9; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)) drop-shadow(0 1px 2px rgba(var(--plum), 0.6)); }
.th-dist { position: absolute; left: -3em; width: 6em; top: 0.05em; text-align: center; font-size: 0.82em; font-weight: 600; letter-spacing: 0.06em; white-space: nowrap; }
.th-edge { position: absolute; left: 0; top: -0.75em; width: 0; height: 0; opacity: 0; transition: opacity 0.2s; }
.th-edge svg { position: absolute; left: -0.45em; top: -3em; width: 0.9em; height: 0.9em; color: var(--gold); stroke-width: 2; filter: drop-shadow(0 0 1.5px rgba(var(--plum), 0.9)); }
.th-mark.edge .th-edge { opacity: 1; }

/* coaching: one calm line in the sky, same band as the prompts */
.coach { position: absolute; left: 50%; top: 21%; transform: translate(-50%, 0.4em); padding: 0.8em 3.4em; display: flex; align-items: center; gap: 0.9em; white-space: nowrap; isolation: isolate;
  text-shadow: var(--shadow); opacity: 0; transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); }
.coach.on { opacity: 1; transform: translate(-50%, 0); }
.coach::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent, rgba(255, 253, 249, 0.8) 24%, rgba(255, 253, 249, 0.8) 76%, transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 253, 249, 0.8) 24%, rgba(255, 253, 249, 0.8) 76%, transparent) bottom / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(var(--plum), 0.4) 22%, rgba(var(--plum), 0.4) 78%, transparent); }
.coach-ico { width: 1.7em; height: 1.7em; color: var(--gold); }
.coach-ico svg { width: 100%; height: 100%; stroke-width: 1.6; filter: var(--shadow-svg); }
.coach.circle .coach-ico svg { animation: turn 2.6s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
.coach-text { font-size: 1.22em; font-weight: 500; letter-spacing: 0.2em; margin-right: -0.2em; }

/* arrival: one quiet line while the crowd has its moment */
.arrival-line { position: absolute; left: 0; right: 0; top: 13%; display: flex; align-items: center; justify-content: center; gap: 1.2em; text-shadow: var(--shadow); }
.arrival-line span { font-size: 1.05em; letter-spacing: 0.34em; margin-right: -0.34em; text-shadow: var(--shadow-strong); }
.arrival-line em, .res-over em { font-style: normal; color: var(--ink); opacity: 0.86; }
.arrival-line em::before, .res-over em::before { content: ''; display: inline-block; width: 0.3em; height: 0.3em; margin: 0 1em 0.16em 0.7em; background: var(--gold); transform: rotate(45deg); }
.arrival-line i { width: 6em; height: 1px; background: linear-gradient(90deg, transparent, var(--ink)); box-shadow: 0 1px 2px rgba(var(--plum), 0.5); }
.arrival-line i:last-child { transform: scaleX(-1); }
#arrival { transition: opacity 0.9s var(--ease), visibility 0s linear 0.9s; }
#arrival.on { transition: opacity 0.9s var(--ease), visibility 0s; }

/* ---- prompts -------------------------------------------------------------------------------------------------- */
.prompt { position: absolute; left: 50%; top: 63%; width: 17em; margin-left: -8.5em; padding: 0.95em 0 1.05em; display: flex; flex-direction: column; align-items: center; gap: 0.62em; isolation: isolate;
  opacity: 0; transform: translateY(0.5em); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); }
.prompt.on { opacity: 1; transform: none; }
.prompt::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, transparent, rgba(255, 253, 249, 0.85) 22%, rgba(255, 253, 249, 0.85) 78%, transparent) top / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(255, 253, 249, 0.85) 22%, rgba(255, 253, 249, 0.85) 78%, transparent) bottom / 100% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(var(--plum), 0.46) 26%, rgba(var(--plum), 0.46) 74%, transparent); }
.prompt::after { content: ''; position: absolute; left: 50%; top: -0.19em; width: 0.38em; height: 0.38em; margin-left: -0.19em; background: var(--ink); transform: rotate(45deg); box-shadow: 0 0 3px rgba(var(--plum), 0.6); }
.prompt-word { font-size: 1.7em; line-height: 1; letter-spacing: 0.1em; margin-right: -0.1em; text-shadow: var(--shadow); }
.prompt-keys { display: inline-flex; align-items: center; }
#p-jump { top: 66%; }

.hint { position: absolute; left: 50%; top: 70%; transform: translate(-50%, 0.5em); display: flex; gap: 2.6em; white-space: nowrap; opacity: 0; transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); }
.hint.on { opacity: 1; transform: translate(-50%, 0); }
/* the brake hint sits in the target corner, on the line the reach figure leaves free once the glide reaches */
.hint.brake { left: auto; right: calc(var(--mx) + 2.2em); top: calc(var(--my) + 3.75em); transform: translateY(0.3em); }
.hint.brake.on { transform: none; }
.hint.brake .hint-item { font-size: 0.86em; gap: 0.8em; text-shadow: var(--edge); }
#ui .hint-item { align-items: center; gap: 0.7em; font-size: 0.8em; letter-spacing: 0.16em; text-shadow: var(--shadow); }
.hint-item .keys { display: inline-flex; align-items: center; font-size: 1.12em; }

/* ---- title ---------------------------------------------------------------------------------------------------- */
#title::before { content: ''; position: absolute; inset: 0; background:
  radial-gradient(46% 34% at 50% 22%, rgba(var(--plum), 0.3), rgba(var(--plum), 0.12) 60%, transparent 100%),
  linear-gradient(0deg, rgba(var(--plum), 0.3), transparent 22%); }
.title-block { position: absolute; left: 0; right: 0; top: clamp(2.6em, 9.4vh, 7em); display: flex; flex-direction: column; align-items: center; text-align: center; }
#title h1 { font: 400 5.4em/1 var(--display); letter-spacing: 0.26em; margin-right: -0.26em; text-shadow: 0 2px 3px rgba(var(--plum), 0.5), 0 0 0.6em rgba(var(--plum), 0.36); }
.title-rule { display: flex; align-items: center; gap: 0.8em; margin-top: 1.25em; color: var(--gold); }
.title-rule i { width: 7.5em; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: 0.9; }
.title-rule i:last-child { transform: scaleX(-1); }
.title-rule svg { width: 0.56em; height: 0.56em; fill: currentColor; stroke: none; filter: var(--shadow-svg); }
.title-sub { margin-top: 1.25em !important; font-size: 0.9em; letter-spacing: 0.34em; margin-right: -0.34em !important; text-transform: uppercase; text-shadow: var(--shadow); }
.title-legend { margin-top: 1.05em !important; max-width: 31em; font: 600 1.3em/1.36 var(--serif); letter-spacing: 0.005em; color: rgba(255, 253, 249, 0.93); text-shadow: var(--shadow); text-wrap: balance; }
#title::before { transition: opacity 0.3s; }
#title.intro::before { opacity: 0; }
#title.intro .title-block { top: auto; bottom: 12%; }
#title.intro .title-legend { display: none; }
#title.intro h1 { text-shadow: 0 0 2px rgba(var(--plum), 0.9), 0 2px 6px rgba(var(--plum), 0.7), 0 0 0.35em rgba(var(--plum), 0.6), 0 0 0.9em rgba(var(--plum), 0.45); }
#title.intro .title-sub { text-shadow: var(--edge); }
#title.introout.on .title-block > * { opacity: 0; transform: none; transition-delay: 0s; }
#title .title-block > * { opacity: 0; transform: translateY(0.5em); transition: opacity 0.3s var(--ease), transform 0.3s var(--ease); }
#title.on .title-block > * { opacity: 1; transform: none; }
#title.on .title-block > :nth-child(2) { transition-delay: 0.12s; }
#title.on .title-block > :nth-child(3) { transition-delay: 0.2s; }
#title.on .title-block > :nth-child(4) { transition-delay: 0.3s; }
.title-links { position: absolute; left: var(--mx); top: calc(var(--my) - 0.5em); display: flex; flex-direction: column; gap: 0.5em; }
#ui .link { display: inline-flex; align-items: center; gap: 0.7em; font-size: 0.8em; letter-spacing: 0.2em; color: rgba(255, 253, 249, 0.86); text-shadow: var(--shadow); padding: 0.5em 0; transition: color 0.18s; }
#ui .link svg { width: 1.5em; height: 1.05em; stroke-width: 1.2; filter: var(--shadow-svg); }
#ui .link:hover, #ui .link:focus-visible { color: var(--ink); outline: none; }
#ui .link kbd { font-size: 0.9em; margin-left: 0.2em; }
#ui .link span { border-bottom: 1px solid transparent; padding-bottom: 0.2em; transition: border-color 0.18s; }
#ui .link:hover span, #ui .link:focus-visible span { border-color: var(--gold); }

/* ---- result --------------------------------------------------------------------------------------------------- */
#result::before { content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s; background: linear-gradient(90deg, rgba(var(--plum), 0.74), rgba(var(--plum), 0.5) 34%, rgba(var(--plum), 0) 68%); }
#result.aside::before { opacity: 1; }
.res { position: absolute; display: none; text-shadow: var(--shadow); }
.res.on { display: block; }
.res-win, .res-down { left: var(--mx); top: 50%; transform: translateY(-60%); width: 34em; }
.res > * { opacity: 0; transform: translateY(0.6em); animation: rise 0.3s var(--ease) forwards; }
.res > :nth-child(2) { animation-delay: 0.08s; }
.res > :nth-child(3) { animation-delay: 0.18s; }
.res > :nth-child(4) { animation-delay: 0.4s; }
.res > :nth-child(5) { animation-delay: 0.52s; }
.res > :nth-child(6) { animation-delay: 0.64s; }
.res > :nth-child(7) { animation-delay: 0.76s; }
@keyframes rise { to { opacity: 1; transform: none; } }
.res-over { font-size: 0.8em; letter-spacing: 0.34em; color: var(--gold); }
.res h2 { font: 400 4.6em/1 var(--display); letter-spacing: 0.16em; margin-top: 0.22em !important; margin-left: -0.04em !important; }
.res-down h2 { font-size: 3.4em; letter-spacing: 0.14em; }
.stars { display: flex; gap: 0.7em; margin-top: 1.5em; color: var(--gold); }
.stars svg { width: 2.1em; height: 2.1em; stroke-width: 1.2; filter: var(--shadow-svg); }
.stars .s-fill { fill: currentColor; stroke: none; opacity: 0; transform: scale(0.3); transform-origin: 50% 54%; transform-box: fill-box; transition: opacity 0.28s var(--ease), transform 0.28s cubic-bezier(0.3, 1.5, 0.5, 1); }
.stars svg.lit .s-fill { opacity: 1; transform: none; }
.stars svg:not(.lit) .s-line { color: var(--ink-faint); }
.stars svg:nth-child(1) .s-fill { transition-delay: 0.75s; }
.stars svg:nth-child(2) .s-fill { transition-delay: 1s; }
.stars svg:nth-child(3) .s-fill { transition-delay: 1.25s; }
.res-line { margin-top: 1.1em !important; max-width: 24em; font: 600 1.5em/1.32 var(--serif); letter-spacing: 0.005em; text-wrap: balance; }
.res-sub { margin-top: 0.75em !important; font-size: 0.95em; letter-spacing: 0.04em; color: var(--ink-soft); }
.stats { display: flex; gap: 2.5em; margin-top: 1.6em; padding-top: 1.35em; position: relative; }
.stats::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 1px; background: linear-gradient(90deg, rgba(255, 253, 249, 0.6), rgba(255, 253, 249, 0.12) 80%, transparent); }
.st-lbl { font-size: 0.7em; letter-spacing: 0.18em; color: var(--ink-soft); white-space: nowrap; }
.st-val { margin-top: 0.5em; font-size: 1.36em; line-height: 1; white-space: nowrap; }
.st-val small, .total-val small { font-size: 0.62em; margin-left: 0.3em; color: var(--ink-soft); letter-spacing: 0.04em; }
.feats { margin-top: 1.5em; }
.feats ul { display: flex; flex-wrap: wrap; gap: 0.6em 0.7em; margin-top: 0.6em; }
.feats li { display: inline-flex; align-items: baseline; gap: 0.7em; padding: 0.42em 0.8em 0.4em; font-size: 0.78em; letter-spacing: 0.14em; border: 1px solid rgba(246, 207, 150, 0.55); border-radius: 0.2em; background: rgba(var(--plum), 0.3); }
.feats li b { font-weight: 600; letter-spacing: 0.03em; color: var(--gold); }
.feats-none { margin-top: 0.55em; font: 600 1.08em/1.35 var(--serif); color: var(--ink-soft); display: none; }
.feats.none ul { display: none; }
.feats.none .feats-none { display: block; }
.total { margin-top: 1.5em; }
.total-val { margin-top: 0.3em; font: 500 2.9em/1 var(--sans); letter-spacing: 0.01em; color: var(--gold); }

.res-fall { left: 0; right: 0; top: 41%; text-align: center; }
.fall-line { font: 600 2.5em/1.2 var(--serif); letter-spacing: 0.01em; }
.res-fall .res-sub { margin-top: 0.95em !important; font-size: 1em; }

.retry { position: absolute; display: flex; align-items: center; gap: 2.6em; opacity: 0; transform: translateY(0.4em); transition: opacity 0.28s var(--ease), transform 0.28s var(--ease); text-shadow: var(--shadow); }
.retry.on { opacity: 1; transform: none; }
.retry-opt { display: inline-flex; align-items: center; gap: 0.9em; }
.retry-opt[hidden] { display: none; }
.retry-main { display: inline-flex; align-items: center; margin-right: 0.36em; }
.retry-main[hidden] { display: none; }
.retry-word { font-size: 1em; letter-spacing: 0.24em; }
#result.aside .retry { left: var(--mx); bottom: 14.5vh; } /* above the bar and the hands, which are in view after a landing */
#result:not(.aside) .retry { left: 50%; top: 61%; transform: translate(-50%, 0.4em); white-space: nowrap; }
#result:not(.aside) .retry.on { transform: translate(-50%, 0); }
.total .st-lbl em { display: none; margin-left: 1.2em; font-style: normal; color: var(--gold); }
.total.best .st-lbl em { display: inline; }

/* the record on the title: best score and the feats ever flown */
.title-record { position: absolute; right: var(--mx); top: var(--my); width: 13.5em; text-shadow: var(--shadow); opacity: 0; transition: opacity 0.3s; }
.title-record.on { opacity: 1; }
.title-record .rec-row { display: flex; align-items: baseline; justify-content: space-between; padding: 0.42em 0; border-bottom: 1px solid rgba(255, 253, 249, 0.28); }
.title-record .rec-row .st-lbl { color: var(--ink); opacity: 0.9; }
.title-record .rec-row b { font-size: 1.15em; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); text-shadow: var(--shadow-strong); }
.title-record ul { display: grid; grid-template-columns: 1fr; gap: 0.36em; margin-top: 0.75em; }
.title-record li { position: relative; padding-left: 1.25em; font-size: 0.8em; font-weight: 500; letter-spacing: 0.03em; color: rgba(255, 253, 249, 0.74); white-space: nowrap; }
.title-record li::before { content: ''; position: absolute; left: 0.1em; top: 0.36em; width: 0.42em; height: 0.42em; transform: rotate(45deg); box-shadow: inset 0 0 0 1px currentColor; }
.title-record li.got { color: var(--ink); font-weight: 600; }
.title-record li.got::before { background: var(--gold); box-shadow: none; }
#title.intro .title-links, #title.intro .title-record, #title.intro.on .title-legend { opacity: 0; pointer-events: none; }
.title-links { transition: opacity 0.3s; }

/* ---- pause, controls, settings -------------------------------------------------------------------------------- */
#overlay { pointer-events: none; }
#overlay.on { pointer-events: auto; }
.scrim { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(var(--plum), 0.8), rgba(var(--plum), 0.62) 45%, rgba(var(--plum), 0.5)); }
.menu, .panel { position: absolute; top: 50%; opacity: 0; visibility: hidden; transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0s linear 0.24s; }
.menu.on, .panel.on { opacity: 1; visibility: visible; transition: opacity 0.24s var(--ease), transform 0.24s var(--ease), visibility 0s; }
.menu { left: var(--mx); transform: translate(-0.6em, -50%); }
.menu.on { transform: translate(0, -50%); }
.menu.dim { opacity: 0.34; }
.menu h2 { font: 400 2.1em/1 var(--display); letter-spacing: 0.24em; }
.menu h2::after { content: ''; display: block; width: 3.2em; height: 1px; margin: 0.85em 0 0.25em; background: var(--gold); }
.menu li { margin-top: 0.5em; }
.menu li[hidden] { display: none; }
.menu button { position: relative; padding: 0.5em 0 0.5em 1.5em !important; font-size: 1.08em; letter-spacing: 0.2em; color: var(--ink-faint) !important; transition: color 0.16s, padding 0.2s var(--ease); }
.menu button::before { content: ''; position: absolute; left: 0.1em; top: 50%; width: 0.44em; height: 0.44em; margin-top: -0.22em; background: var(--gold); transform: rotate(45deg) scale(0); transition: transform 0.2s var(--ease); }
.menu button.sel { color: var(--ink) !important; }
.menu button.sel::before { transform: rotate(45deg) scale(1); }
.menu button:focus { outline: none; }

.panel { left: 50%; width: 35em; transform: translate(-50%, calc(-50% + 0.6em)); padding: 2.2em 2.6em 1.8em; background: rgba(var(--plum), 0.5); border-top: 1px solid rgba(255, 253, 249, 0.55); border-bottom: 1px solid rgba(255, 253, 249, 0.55); }
.panel.on { transform: translate(-50%, -50%); }
/* settings grew to ten rows (forgiving wings, four volume sliders, language): tighter rows, and it scrolls on short screens */
#panel-settings { max-height: 94vh; overflow-y: auto; scrollbar-width: thin; }
#panel-settings .set-row { padding-top: 0.55em; padding-bottom: 0.55em; }
#panel-settings h3 { margin-bottom: 0.9em !important; }
/* Settings > HUD off: nothing over the flight (the menus, results and title still show) */
#ui.clean #hud, #ui.clean #prompts { display: none !important; }
#overlay.with-menu .panel { left: auto; right: max(var(--mx), calc(50% - 26em)); transform: translate(0, calc(-50% + 0.6em)); }
#overlay.with-menu .panel.on { transform: translate(0, -50%); }
.panel h3 { font: 400 1.5em/1 var(--display); letter-spacing: 0.26em; margin-bottom: 1.3em !important; }
.keys-table { width: 100%; border-collapse: collapse; }
.keys-table td { padding: 0.5em 0; border-bottom: 1px solid rgba(255, 253, 249, 0.12); font-size: 0.95em; font-weight: 400; vertical-align: middle; }
.keys-table td:nth-child(2) { width: 12em; white-space: nowrap; }
.keys-table td:nth-child(3) { width: 8.5em; color: var(--ink-soft); font-size: 0.86em; }
.panel-note { margin-top: 1.15em !important; font-size: 0.86em; font-weight: 400; color: var(--ink-soft); line-height: 2; }
.panel-tip { margin-top: 0.9em !important; font: 600 1.14em/1.4 var(--serif); color: var(--gold); }
.panel-back { margin-top: 1.6em; }
.panel-back button { display: inline-flex; align-items: center; gap: 0.8em; font-size: 0.8em; letter-spacing: 0.22em; color: var(--ink-soft) !important; }
.panel-back button:hover { color: var(--ink) !important; }
.panel-back kbd { font-size: 0.86em !important; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 2em; padding: 0.82em 0.7em 0.82em 0.9em; margin: 0 -0.9em; border-bottom: 1px solid rgba(255, 253, 249, 0.12); position: relative; }
.set-row::before { content: ''; position: absolute; left: 0; top: 22%; bottom: 22%; width: 2px; background: var(--gold); opacity: 0; transition: opacity 0.16s; }
.set-row.sel::before { opacity: 1; }
.set-row.sel { background: rgba(255, 253, 249, 0.05); }
.set-lbl { font-size: 1em; font-weight: 400; }
.set-lbl small { display: block; margin-top: 0.3em; font-size: 0.74em; color: var(--ink-faint); }
.set-ctl { display: flex; align-items: center; gap: 1em; }
.seg { gap: 0; border: 1px solid rgba(255, 253, 249, 0.38); border-radius: 0.3em; overflow: hidden; }
.seg button { padding: 0.5em 1.05em !important; font-size: 0.82em; letter-spacing: 0.08em; color: var(--ink-soft) !important; transition: background 0.16s, color 0.16s; }
.seg button + button { border-left: 1px solid rgba(255, 253, 249, 0.22) !important; }
.seg button.cur { background: #f1ebe2 !important; color: #2b2229 !important; text-shadow: none; }
.set-ctl output { width: 2.2em; text-align: right; font-size: 0.95em; }
#ui input[type='range'] { -webkit-appearance: none; appearance: none; pointer-events: auto; width: 11em; height: 1.4em; margin: 0; background: transparent; cursor: pointer; }
#ui input[type='range']::-webkit-slider-runnable-track { height: 2px; background: rgba(255, 253, 249, 0.42); }
#ui input[type='range']::-webkit-slider-thumb { -webkit-appearance: none; width: 0.8em; height: 0.8em; margin-top: calc(-0.4em + 1px); background: var(--ink); transform: rotate(45deg); box-shadow: 0 0 0.3em rgba(var(--plum), 0.6); }
#ui input[type='range']::-moz-range-track { height: 2px; background: rgba(255, 253, 249, 0.42); }
#ui input[type='range']::-moz-range-thumb { width: 0.7em; height: 0.7em; border: 0; border-radius: 0; background: var(--ink); transform: rotate(45deg); }
#ui input[type='range']:focus { outline: none; }

/* ---- ?clip=1: a clean HUD for recordings ---------------------------------------------------------------------- */
#ui.clip .coach, #ui.clip #prompts, #ui.clip .warn, #ui.clip .title-links, #ui.clip .title-record { display: none; }

/* ---- loading -------------------------------------------------------------------------------------------------- */
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(90% 70% at 50% 46%, #2a1f27, #1a1418 70%); color: #efe3d2; transition: opacity 0.8s; }
#loading span { position: relative; font: 400 clamp(22px, 4.2vh, 60px)/1 'Marcellus', Georgia, serif; letter-spacing: 0.42em; margin-right: -0.42em; padding-bottom: 1.1em; }
#loading span::after { content: ''; position: absolute; left: 12%; right: calc(12% + 0.42em); bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, #f6cf96, transparent); background-size: 220% 100%; animation: loadline 1.8s ease-in-out infinite; opacity: 0.85; }
@keyframes loadline { from { background-position: 130% 0; } to { background-position: -30% 0; } }
#loading.hidden span { opacity: 0; transition: opacity 0.2s; }
#loading.hidden { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity 0.25s, visibility 0s 0.25s; }
