/* ==========================================================================
   STEEZERS – HUD im Spiel
   Minimal, gleicher Stil wie das Menü. Score & Tricks folgen in Schritt 04.
   Nutzt dieselben Variablen wie menu.css (--snow, --ink, --signal ...).
   Helle Akzente (--mood-c) kommen aus der Stimmung des gewählten Parks.
   ========================================================================== */

.hud {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
}

.hud[hidden] { display: none; }

/* Tempo unten links – grosse Zahl, kleine Einheit */
.hud__speed {
  position: absolute;
  left: var(--gutter);
  bottom: calc(var(--gutter) + 22px);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.hud__kmh {
  paint-order: stroke fill;
  -webkit-text-stroke: 5px var(--snow);
  font-family: var(--f-display);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 1;
  color: var(--ink);
  min-width: 2ch;
  font-variant-numeric: tabular-nums;
}

.hud__unit { font-size: 10px; font-weight: 600; }

/* Zustand (Boden / Luft / Switch) als kleines Ticket-Label */
.hud__state {
  position: absolute;
  left: var(--gutter);
  bottom: var(--gutter);
  padding: 2px 8px;
  background: var(--ink);
  color: var(--snow);
  font-size: 10px;
  font-weight: 600;
}

.hud__state.is-air { background: var(--mood-c); color: var(--ink); }
.hud__state.is-crash { background: var(--signal); color: var(--ink); }

/* Pop-Balken: füllt sich beim Halten der Leertaste (nur transform/opacity) */
.hud__pop {
  position: absolute;
  left: 50%;
  bottom: calc(var(--gutter) + 8px);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .12s linear, transform .2s var(--ease-out);
}

.hud__pop.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hud__pop-label,
.hud__pop-max {
  font-size: 10px;
  font-weight: 600;
}

.hud__pop-max { opacity: .35; }
.hud__pop.is-full .hud__pop-max { opacity: 1; color: var(--signal); }

.hud__pop-bar {
  position: relative;
  width: clamp(180px, 18vw, 260px);
  height: 16px;
  border: 1px solid var(--edge);
  background: var(--snow);
  overflow: hidden;
}

.hud__pop-fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
}

.hud__pop.is-full .hud__pop-fill { background: var(--signal); }

/* Unterteilung in 10 Zellen wie ein Pegel auf dem Lift-Ticket */
.hud__pop-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), var(--snow) calc(10% - 2px) 10%);
}

/* Balance-Anzeige auf Rails/Boxen: Nadel wandert, Ränder = Absturz */
.hud__balance {
  position: absolute;
  left: 50%;
  top: 76%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .12s linear, transform .2s var(--ease-out);
}

.hud__balance.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hud__balance-label {
  padding: 3px 10px 2px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--snow);
  font-family: var(--f-display);
  font-size: 1.15rem;
  letter-spacing: .03em;
}

/* Fortschritt auf der Rail */
.hud__balance-bar {
  position: relative;
  width: clamp(200px, 20vw, 300px);
  height: 10px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  overflow: hidden;
  background: var(--snow);
}

.hud__balance-track {
  position: absolute;
  inset: 0;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: left center;
}

.hud__balance-keys { font-size: 9px; font-weight: 600; color: var(--ink); text-shadow: 0 0 6px var(--snow); }
.hud__balance-keys b { padding: 0 4px; margin: 0 1px; border: 1px solid var(--edge); border-radius: 4px; background: var(--snow); }

/* Hinweis kurz vor Rail/Box */
.hud__slide {
  position: absolute;
  left: 50%;
  top: 76%;
  padding: 4px 10px;
  background: var(--snow);
  border: 1px solid var(--edge);
  font-size: 10px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s linear, transform .25s var(--ease-out);
}

.hud__slide b {
  font-weight: 600;
  padding: 0 5px;
  margin-left: 4px;
  background: var(--ink);
  color: var(--snow);
}

.hud__slide.is-active {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* --------------------------------------------------------------------------
   Style-Score oben links + Combo-Topf
   -------------------------------------------------------------------------- */

.hud__score {
  position: absolute;
  left: var(--gutter);
  top: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hud__score-label { margin-left: 0; }

.hud__score-label {
  padding: 2px 7px;
  background: var(--ink);
  color: var(--snow);
  font-size: 10px;
  font-weight: 600;
}

.hud__score-num {
  /* Transparent: dünne Schnee-Kontur statt Fläche, lesbar vor Bäumen wie vor Schnee */
  paint-order: stroke fill;
  -webkit-text-stroke: 5px var(--snow);
  font-family: var(--f-display);
  font-size: clamp(2.8rem, 5vw, 4.6rem);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  transform-origin: left center;
}

.hud__score-num.is-pulse { animation: scorePulse .45s var(--ease-out); }
.hud__score-num.is-minus { color: var(--signal); }

@keyframes scorePulse {
  0%   { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Combo: Topf + Multiplikator + Zeitleiste */
.hud__combo {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 8px;
  row-gap: 4px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .15s linear, transform .25s var(--ease-out);
}

.hud__combo.is-active { opacity: 1; transform: none; }

.hud__combo-pot {
  paint-order: stroke fill;
  -webkit-text-stroke: 4px var(--snow);
  font-family: var(--f-display);
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hud__combo-mult {
  padding: 2px 6px;
  background: var(--signal);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
}

.hud__combo-mult.is-bump { animation: scorePulse .35s var(--ease-out); }

.hud__combo-timer {
  grid-column: 1 / -1;
  position: relative;
  width: 100%;
  min-width: 110px;
  height: 3px;
  background: var(--mood-c);
  overflow: hidden;
}

.hud__combo-fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform-origin: left center;
}

/* Gutschrift / Abzug, erscheint kurz unter dem Score */
.hud__delta {
  position: absolute;
  left: -2px;
  top: calc(100% + 6px);
  white-space: nowrap;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 600;
  opacity: 0;
}

.hud__delta.is-plus { background: var(--snow); border: 1px solid var(--edge); }
.hud__delta.is-minus { background: var(--signal); color: var(--ink); }
.hud__delta.is-show { animation: deltaFly 1.8s var(--ease-out) both; }

@keyframes deltaFly {
  0%   { opacity: 0; transform: translateY(14px); }
  12%  { opacity: 1; transform: none; }
  78%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* --------------------------------------------------------------------------
   Live-Anzeige in der Luft
   -------------------------------------------------------------------------- */

.hud__live {
  position: absolute;
  left: 50%;
  top: 16%;
  padding: 3px 9px;
  background: var(--snow);
  border: 1px solid var(--edge);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity .1s linear, transform .2s var(--ease-out);
}

.hud__live.is-active { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Trick-Name nach der Landung (und Sturz-Meldung)
   -------------------------------------------------------------------------- */

.hud__trick {
  position: absolute;
  left: 50%;
  top: 22%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translate(-50%, 0);
}

.hud__trick-name {
  paint-order: stroke fill;
  -webkit-text-stroke: 6px var(--snow);
  font-family: var(--f-display);
  font-size: clamp(2.2rem, 5.5vw, 4.6rem);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
}

.hud__trick.is-bad .hud__trick-name { color: var(--signal); }

.hud__trick-meta {
  display: flex;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
}

.hud__trick-rating,
.hud__trick-pts {
  padding: 2px 8px;
  border: 1px solid var(--edge);
  background: var(--snow);
}

.hud__trick-rating:empty { display: none; }
.hud__trick-rating.is-perfect { background: var(--mood-c); }
.hud__trick-rating.is-sketchy { border-style: dashed; }
.hud__trick-pts { background: var(--ink); color: var(--snow); }
.hud__trick.is-bad .hud__trick-pts { background: var(--signal); color: var(--ink); border-color: var(--signal); }

.hud__trick.is-show { animation: trickIn 1.6s var(--ease-out) both; }

@keyframes trickIn {
  0%   { opacity: 0; transform: translate(-50%, 24px) scale(1.15); }
  10%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  78%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(1); }
}

/* Tasten-Hinweis oben rechts, blendet nach ein paar Sekunden aus */
.hud__hint {
  position: absolute;
  right: var(--gutter);
  top: var(--gutter);
  display: flex;
  gap: 16px;
  font-size: 10px;
  transition: opacity .6s linear;
}

.hud__hint b {
  font-weight: 600;
  padding: 1px 5px;
  border: 1px solid var(--edge);
  margin-right: 4px;
  background: var(--snow);
}

.hud__hint.is-faded { opacity: 0; }

/* --------------------------------------------------------------------------
   Zielbereich + Liftfahrt
   -------------------------------------------------------------------------- */

.hud__lifthint {
  position: absolute;
  left: 50%;
  bottom: 13%;
  padding: 9px 16px 8px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--snow);
  box-shadow: var(--lift);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .2s linear, transform .3s var(--ease-out);
  pointer-events: none;
}

.hud__lifthint.is-active { opacity: 1; transform: translate(-50%, 0); }
.hud__lifthint b { padding: 1px 6px; margin: 0 2px; border: 1px solid var(--edge); border-radius: 5px; background: var(--mood-c); }
.hud__lifthint-or { opacity: .55; margin: 0 4px; }

/* Während der Liftfahrt: normales HUD weg, Karte links */
.hud.is-lift > :not(.liftcard):not(.liftskip) { visibility: hidden; }

.liftcard {
  position: absolute;
  left: clamp(14px, 2.6vw, 44px);
  top: 50%;
  width: min(360px, 34vw);
  border: 1px solid var(--edge);
  border-radius: 16px;
  overflow: hidden;
  background: var(--snow);
  box-shadow: var(--lift-hi);
  opacity: 0;
  transform: translate(-30px, -50%) rotate(-2deg);
  transition: opacity .3s linear, transform .5s var(--ease-out);
  pointer-events: none;
}

.liftcard.is-active { opacity: 1; transform: translate(0, -50%) rotate(-1deg); }

.liftcard__head {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px 8px;
  background:
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .1) 0 10px, transparent 10px 20px),
    linear-gradient(120deg, var(--mood-b), var(--mood-a));
  color: var(--snow);
  border-bottom: 1px solid var(--edge);
  font-size: 10px;
  font-weight: 600;
}

.liftcard__score { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 14px 6px; }
.liftcard__score .mono { font-size: 9px; opacity: .6; }

.liftcard__score b {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 3.6rem;
  line-height: .95;
  transform: none; font-style: italic;
  transform-origin: left bottom;
}

.liftcard__badge {
  margin-top: 4px;
  padding: 3px 9px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--signal);
  font-size: 9px;
  font-weight: 600;
}

.liftcard__badge[hidden] { display: none; }

.liftcard__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0;
  border-top: 2px dashed var(--ink);
  border-bottom: 2px dashed var(--ink);
  font-size: 8px;
}

.liftcard__grid div { padding: 7px 0 7px 14px; }
.liftcard__grid dd { margin: 2px 0 0; font-size: 13px; font-weight: 600; }

.liftcard__besttrick { display: flex; flex-direction: column; gap: 2px; padding: 8px 14px 4px; }
.liftcard__besttrick .mono { font-size: 8px; opacity: .6; }
.liftcard__besttrick b { font-family: var(--f-display); font-weight: 400; font-size: 1.3rem; text-transform: uppercase; }

.liftcard__list {
  margin: 0;
  padding: 4px 14px 8px;
  list-style: none;
  font-size: 10px;
  text-transform: none;
  letter-spacing: .02em;
}

.liftcard__list li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed rgba(17, 17, 17, .2); }
.liftcard__list li b { font-weight: 600; }
.liftcard__list li.is-fail { color: var(--signal); }

.liftcard__foot {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 11px;
  border-top: 1px solid var(--edge);
  background: #E6E2D8;
  font-size: 9px;
  font-weight: 600;
}

.liftcard__bar { height: 8px; border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; background: var(--snow); }
.liftcard__bar span { display: block; height: 100%; width: 0; background: var(--mood-a); }
.liftcard__skip b { padding: 1px 5px; margin-right: 3px; border: 1px solid var(--edge); border-radius: 5px; background: var(--snow); }

@media (max-width: 760px) {
  .liftcard__foot { grid-template-columns: auto 1fr auto; }
  .liftcard__skip:nth-last-child(2) { display: none; } /* Kamera-Taste: auf dem Handy ohne Tastatur */
  .liftcard { width: auto; right: 14px; top: auto; bottom: 14px; transform: translateY(20px); }
  .liftcard.is-active { transform: none; }
  .liftcard__list { display: none; }
}

/* --------------------------------------------------------------------------
   Party: Live-Board oben rechts (bester Run jedes Fahrers)
   -------------------------------------------------------------------------- */

.pboard {
  position: absolute;
  right: var(--gutter);
  top: calc(var(--gutter) + 30px); /* unter dem Tasten-Hinweis */
  width: 220px;
  padding: 8px 10px 6px;
  border: 1px solid var(--edge);
  border-radius: 10px;
  background: rgba(244, 241, 234, .9);
  box-shadow: var(--lift);
}

.pboard[hidden] { display: none; }
.pboard .pboard__list li { padding: 3px 0; font-size: 11px; }
.pboard .pboard__list b { font-size: 1rem; }
.pboard .pboard__list li.is-riding .pboard__rank { color: var(--signal); opacity: 1; }

/* Kurzer Hinweis oben in der Mitte (z. B. Grafik automatisch angepasst) */
.hud__note {
  position: absolute;
  left: 50%;
  top: calc(var(--gutter) + 4px);
  padding: 6px 12px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  background: var(--snow);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity .3s linear, transform .3s ease-out;
  pointer-events: none;
}
.hud__note.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   Replay: Leiste unten, "Replay"-Marke oben links; mit H alles weg
   -------------------------------------------------------------------------- */
body.is-replay #hud,
body.is-replay #ui { display: none !important; }
.replay { position: fixed; inset: 0; z-index: 60; pointer-events: none; font-family: var(--f-mono); color: var(--snow); }
.replay[hidden] { display: none; }
.replay__tag {
  position: absolute; top: 22px; left: 24px; display: flex; align-items: center; gap: 10px;
  padding: 7px 14px 7px 12px; background: var(--ink); border-radius: 999px;
  font: 400 20px/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase;
}
.replay__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--signal); animation: replayDot 1.2s steps(2) infinite; }
@keyframes replayDot { 50% { opacity: .25; } }
.replay__bar {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); width: min(980px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  background: rgba(17, 17, 17, .88); border-radius: 14px; pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.replay__btn { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--signal); cursor: pointer; position: relative; }
.replay__play::before { content: ''; position: absolute; left: 14px; top: 11px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent var(--snow); }
.replay__play.is-playing::before { left: 12px; top: 12px; width: 4px; height: 14px; border: 0; background: var(--snow); box-shadow: 9px 0 0 var(--snow); }
.replay__track { position: relative; flex: 1 1 calc(100% - 170px); height: 26px; display: flex; align-items: center; } /* 1. Zeile: Play, Zeitleiste, Zeit */
.replay__track::before { content: ''; position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(242, 239, 232, .22); }
.replay__fill { position: absolute; left: 0; height: 4px; border-radius: 2px; background: var(--signal); width: 0; }
.replay__range { position: relative; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.replay__range::-webkit-slider-runnable-track { height: 26px; background: transparent; }
.replay__range::-moz-range-track { height: 26px; background: transparent; }
.replay__range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: 5px; border-radius: 50%; background: var(--snow); border: 3px solid var(--signal); }
.replay__range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--snow); border: 3px solid var(--signal); }
.replay__time { flex: none; min-width: 9ch; font-size: 12px; letter-spacing: .06em; font-variant-numeric: tabular-nums; opacity: .85; }
.replay__group { display: flex; gap: 4px; padding: 3px; border-radius: 999px; background: rgba(242, 239, 232, .08); }
.replay__chip {
  padding: 6px 11px; border: 0; border-radius: 999px; background: transparent; color: var(--snow); cursor: pointer;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
}
.replay__chip:hover { background: rgba(242, 239, 232, .14); }
.replay__chip.is-on { background: var(--snow); color: var(--ink); }
.replay__chip--ghost { border: 1.5px solid rgba(242, 239, 232, .35); }
.replay__chip--exit { background: var(--snow); color: var(--ink); }
.replay__save { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; } /* 2. Zeile rechts: Video, Hide UI, Exit */
.replay.is-recording .replay__save { background: var(--signal); border-color: var(--signal); color: var(--snow); animation: rec-blink 1s steps(2) infinite; }
@keyframes rec-blink { 50% { opacity: .65; } }
.replay__chip--exit:hover { background: var(--signal); color: var(--snow); }
.replay__keys { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(17, 17, 17, .72);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.replay__keys b { color: var(--signal); font-weight: 600; }
/* saubere Aufnahme: nur das Bild */
body.is-replay-clean .replay > * { display: none; }
body.is-replay-clean .grain, body.is-replay-clean .scene-fade { display: none; }
@media (max-width: 760px) { .replay__keys { display: none; } }

/* ==========================================================================
   Touch-Steuerung (Handy / Tablet, touch.js)
   Links Daumen-Stick, rechts Pop mit Grabs im Bogen, oben Pause/Respawn
   ========================================================================== */
.touch {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  --tb: rgba(17, 17, 17, .38);
  --tl: rgba(242, 239, 232, .9);
}
.touch[hidden] { display: none; }
.touch > * { pointer-events: auto; }

/* linke Bildhälfte: hier setzt der Daumen auf, der Stick erscheint dort */
.touch__zone {
  position: absolute;
  left: 0;
  top: 64px;
  bottom: 0;
  width: 45%;
}

.touch__stick {
  position: absolute;
  left: 0;
  top: 0;
  width: 108px;
  height: 108px;
  margin: -54px 0 0 -54px;
  border-radius: 50%;
  border: 2px solid var(--tl);
  background: var(--tb);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s linear;
}
.touch__stick.is-active { opacity: 1; }
.touch__knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: var(--tl);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}

.touch__btn {
  -webkit-tap-highlight-color: transparent;
  appearance: none;
  border: 2px solid var(--tl);
  background: var(--tb);
  color: var(--snow);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  touch-action: none;
  transition: transform .08s linear, background .08s linear;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.touch__btn.is-down { transform: scale(.92); background: var(--signal); border-color: var(--signal); color: var(--ink); }

/* oben in der Mitte: Pause, Respawn (halten = Neustart) */
.touch__top {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.touch__btn--sys { width: 40px; height: 40px; border-radius: 50%; font-size: 14px; letter-spacing: 0; }

/* rechts: Pop gross, Grabs klein im Viertelkreis darum (oben/links) */
.touch__pad {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 84px;
  height: 84px;
}
.touch__btn--pop {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  font-size: 13px;
  background: rgba(255, 79, 31, .55);
  border-color: var(--signal);
}
.touch__btn--grab {
  --r: 98px;
  --a: calc(-75deg - var(--i) * 30deg);     /* Bogen von oben rechts (-75°) bis links unten (-195°) */
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  font-size: 8.5px;
  letter-spacing: .02em;
  transform: rotate(var(--a)) translate(var(--r)) rotate(calc(-1 * var(--a)));
}
.touch__btn--grab.is-down { transform: rotate(var(--a)) translate(var(--r)) rotate(calc(-1 * var(--a))) scale(.92); }

/* Zusatzknöpfe nur bei Bedarf (Lift am Ziel, Skip/Kamera auf der Liftfahrt) */
.touch__ctx {
  position: absolute;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 176px);
  display: flex;
  gap: 8px;
}
.touch__btn--ctx { display: none; height: 34px; padding: 0 14px; border-radius: 17px; }
.touch[data-ctx="ride"] [data-show="ride"],
.touch[data-ctx="hint"] [data-show="hint"] { display: block; }
/* auf der Liftfahrt keine Fahr-Knöpfe */
.touch[data-ctx="ride"] .touch__btn--grab { display: none; }

/* Tablet: etwas grösser */
@media (min-height: 600px) {
  .touch__pad { width: 100px; height: 100px; right: 32px; bottom: 32px; }
  .touch__btn--grab { --r: 122px; width: 56px; height: 56px; margin: -28px 0 0 -28px; font-size: 10px; }
  .touch__ctx { right: 32px; bottom: 240px; }
}

/* Tasten-Hinweise passen nicht zu Touch */
.has-touch-ui .hud__hint { display: none; }

/* Hochformat: bitte drehen */
.rotate-note { display: none; }
@media (orientation: portrait) {
  .has-touch-ui .rotate-note {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 14px;
    background: var(--ink);
    color: var(--snow);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-align: center;
  }
  .rotate-note__icon { width: 44px; height: 72px; border: 3px solid var(--snow); border-radius: 8px; animation: rotateHint 2.4s var(--ease-io) infinite; }
}
@keyframes rotateHint { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* Liftfahrt: Knopf zum Überspringen (unten in der Mitte), dünner Fortschritt */
.liftskip {
  position: absolute;
  left: 50%;
  bottom: calc(var(--gutter) + 10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity .25s ease, transform .3s var(--ease-out);
  pointer-events: none;
}
.liftskip.is-active { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.liftskip__info { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 8px rgba(6, 10, 22, .6); }
.liftskip__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(12, 16, 26, .6);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(6, 10, 22, .3);
  transition: background .2s ease, transform .2s var(--ease-out);
}
.liftskip__btn:hover { background: var(--signal); border-color: var(--signal); transform: translateY(-2px); }
.liftskip__btn b { padding: 1px 6px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 5px; font-size: 10px; }
.liftskip__bar { width: 180px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.liftskip__fill { display: block; height: 100%; background: #fff; transform: scaleX(0); transform-origin: left center; }

/* Replay: Auswahl fürs Video und Fortschritt beim Export */
.replay__savemenu { position: absolute; right: 12px; bottom: calc(100% + 8px); display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: rgba(17, 17, 17, .92); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.replay__savemenu[hidden] { display: none; }
.replay.is-exporting { visibility: hidden; }
.vexport { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10, 12, 16, .82); color: var(--snow); }
.vexport[hidden] { display: none; }
.vexport__box { width: min(360px, 86vw); padding: 22px 24px; border-radius: 18px; background: rgba(28, 31, 38, .95); text-align: center; }
.vexport__title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
.vexport__bar { height: 8px; margin: 16px 0 10px; border-radius: 99px; background: rgba(242, 239, 232, .14); overflow: hidden; }
.vexport__fill { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s; }
.vexport__pct { font-size: 12px; opacity: .85; }
.vexport__cancel { margin-top: 16px; padding: 8px 18px; border: 1.5px solid rgba(242, 239, 232, .35); border-radius: 999px; background: transparent; color: var(--snow); cursor: pointer; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.replay:has(.replay__savemenu:not([hidden])) .replay__keys { display: none; }
