/* Ritten Downhill – dunkles, zurückhaltendes Design: zwei Flächentöne, helle Schrift, Farbe nur sparsam.
   Raster, Rundungen und Schaltflächenform stammen aus dem Vereins-Shop. */
:root {
  --primary: #6f9fc9; --on-primary: #0d0f12;
  --accent: #b9545f; --on-accent: #fff;
  --ink: #e9e9eb; --on-ink: #101114;
  --bg: #0f1012; --card: #191b1e;
  --radius: 18px; --radius-s: 12px; --btn-radius: 999px;
  --font: "rucksack", "Barlow Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --primary-dark: color-mix(in srgb, var(--primary) 84%, var(--ink));
  --soft: color-mix(in srgb, var(--ink) 58%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 13%, var(--bg));
  --edge: color-mix(in srgb, var(--ink) 34%, var(--bg));
  --grey: #4a4d53; --ok: #7fb58a; --danger: #d0727b; --gold: #c9a55a;
  --wrap: 1200px; --gutter: clamp(20px, 4vw, 44px);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --nav-h: 56px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 18px/1.45 var(--font); -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; }
img, svg, canvas { display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p, ul, ol, dl, dd, figure, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.narrow { max-width: 880px; }
.center { text-align: center; }
.muted { color: var(--soft); }
.small { font-size: 15px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--on-ink); padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }

/* ---------- Kopfzeile ---------- */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--line); }
.nav__inner { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; display: flex; align-items: stretch; justify-content: space-between; gap: var(--s4); min-height: var(--nav-h); }
.brand { display: flex; align-items: center; gap: var(--s3); color: var(--ink); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 36px; width: 36px; flex: none; }
.brand__text { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; min-width: 0; }
.brand__text small { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand__text strong { font-size: 19px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; white-space: nowrap; }
.nav__links { display: flex; align-items: stretch; flex: none; }
.nav__btn { display: flex; align-items: center; padding: 0 20px; color: var(--ink); font-weight: 700; font-size: 15px; text-transform: uppercase; letter-spacing: .04em; border: 0; background: none; cursor: pointer; transition: filter .15s, color .15s; white-space: nowrap; }
.nav__btn { color: var(--soft); }
.nav__btn:hover { text-decoration: none; color: var(--ink); }
.nav__btn.is-active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.nav__btn--accent, .nav__btn--accent:hover { color: var(--ink); }
.nav__btn--primary, .nav__btn--primary:hover { background: var(--card); color: var(--ink); box-shadow: inset 1px 0 0 var(--line); }
.nav__btn--primary:hover { background: color-mix(in srgb, var(--card) 80%, var(--ink)); }

/* ---------- Seitenkopf ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--s5) var(--s8); align-items: end; padding: clamp(40px, 6vw, 88px) 0 clamp(32px, 4vw, 56px); }
.hero__title { font-size: clamp(40px, 6vw, 84px); line-height: 1; font-weight: 700; letter-spacing: -.02em; text-wrap: balance; }
.hero__title > span:first-child { color: var(--ink); display: inline-block; }
.headline__soft { color: var(--soft); }
.hero__side { color: var(--soft); display: grid; gap: var(--s4); padding-bottom: 8px; }
.hero__cta { display: flex; gap: var(--s2); flex-wrap: wrap; }
.page__title { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.05; font-weight: 700; letter-spacing: -.02em; padding: clamp(32px, 5vw, 64px) 0 var(--s6); }
.section__title { font-size: 28px; font-weight: 700; letter-spacing: -.01em; margin: var(--s7) 0 var(--s5); }
.hero + .wrap .section__title { margin-top: 0; }
.note { margin-top: var(--s5); max-width: 70ch; }

/* ---------- Startbild: Video aus dem Spiel, bildschirmfüllend ---------- */
/* Füllt beim Öffnen den ganzen Bildschirm (auch unter der Kopfzeile). svh = kleinste sichtbare Höhe: am Handy springt
   nichts, wenn die Adressleiste ein- und ausfährt. Bis das Video läuft (oder statt seiner), zeigt sich ein Standbild. */
.hv { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 100vh; min-height: 100svh; margin-top: calc(-1 * var(--nav-real, var(--nav-h)));
  padding: calc(var(--nav-real, var(--nav-h)) + 24px) 0 clamp(84px, 13vh, 128px);
  background: #0b0c0f url(../img/hero-land.jpg?v=1.41) center / cover no-repeat; }
@media (max-aspect-ratio: 4/5) { .hv { background-image: url(../img/hero-port.jpg?v=1.41); } }
/* immer sichtbar (Safari spielt unsichtbare Videos nicht ab); bis es läuft, zeigt es sein Standbild */
.hv__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; pointer-events: none; background: transparent; }
.hv__shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 9, 11, .55) 0, rgba(8, 9, 11, 0) 22%),
              radial-gradient(120% 70% at 0% 100%, rgba(8, 9, 11, .62), rgba(8, 9, 11, 0) 62%),
              linear-gradient(0deg, var(--bg) 0, color-mix(in srgb, var(--bg) 70%, transparent) 14%, rgba(8, 9, 11, 0) 46%); }
.hv__content { display: grid; gap: var(--s4); }
.hv .hero__title { color: #fff; max-width: 19ch; font-size: clamp(40px, 5.4vw, 80px); text-shadow: 0 2px 24px rgba(0, 0, 0, .35); }
.hv .hero__title > span:first-child { color: #fff; }
.hv .headline__soft { color: rgba(255, 255, 255, .8); }
.hv__lead { max-width: 46ch; font-size: clamp(18px, 1.7vw, 22px); color: rgba(255, 255, 255, .9); text-shadow: 0 1px 14px rgba(0, 0, 0, .55); }
.hv .hero__cta { margin-top: var(--s2); }
.btn--big { padding: 16px 32px; font-size: 19px; }
.btn--glass { background: rgba(12, 13, 16, .38); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); -webkit-backdrop-filter: blur(12px) saturate(140%); backdrop-filter: blur(12px) saturate(140%); }
.btn--glass:hover { background: rgba(12, 13, 16, .55); }
.hv__more { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 0;
  border: 0; background: none; color: rgba(255, 255, 255, .85); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; cursor: pointer; padding: 8px 16px; }
.hv__more svg { animation: hv-bob 1.8s ease-in-out infinite; }
@keyframes hv-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
.hv__pause { position: absolute; right: var(--gutter); bottom: max(22px, env(safe-area-inset-bottom)); width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  color: #fff; background: rgba(12, 13, 16, .4); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); opacity: .75; transition: opacity .15s; }
.hv__pause:hover { opacity: 1; }
.hv__pause .i-play, .hv__pause.is-paused .i-pause { display: none; }
.hv__pause.is-paused .i-play { display: inline; }
.hv:not(.has-video) .hv__pause { display: none; }
.home__rest { padding-top: var(--s6); scroll-margin-top: calc(var(--nav-real, var(--nav-h)) - var(--s5)); }
.home__rest .section__title { margin-top: 0; }
/* Kopfzeile über dem Startbild: durchsichtig, erst beim Scrollen wieder mit Fläche */
.nav { transition: background-color .3s, border-color .3s; }
body.at-hero .nav { background: linear-gradient(180deg, rgba(8, 9, 11, .5), rgba(8, 9, 11, 0)); border-bottom-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
body.at-hero .nav__btn { color: rgba(255, 255, 255, .82); }
body.at-hero .nav__btn.is-active, body.at-hero .nav__btn:hover { color: #fff; }
body.at-hero .nav__links { border-top-color: rgba(255, 255, 255, .14); }
body.at-hero .nav__btn--primary { background: rgba(12, 13, 16, .35); }
@media (max-height: 560px) and (orientation: landscape) {
  .hv .hero__title { font-size: clamp(28px, 5vw, 44px); max-width: 24ch; }
  .hv__content { gap: var(--s2); }
  .hv__lead { font-size: 15px; max-width: 52ch; }
  .hv { padding-top: calc(var(--nav-real, var(--nav-h)) + 12px); padding-bottom: 52px; }
  .btn--big { padding: 12px 24px; font-size: 17px; }
  .hv .hero__cta .btn--glass { padding: 12px 22px; font-size: 17px; }
  .hv__more { bottom: 4px; } .hv__more span { display: none; }
  .hv__pause { bottom: 12px; }
}
@media (max-width: 520px) {
  .hv .hero__cta .btn { flex: 1 1 auto; }
  .hv__pause { bottom: auto; top: calc(var(--nav-real, var(--nav-h)) + 12px); }
}
@media (prefers-reduced-motion: reduce) { .hv__more svg { animation: none; } .hv__video { transition: none; } }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: var(--btn-radius); padding: 13px 26px; font-weight: 700; font-size: 18px; line-height: 1.2; text-align: center; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn--primary { background: var(--ink); color: var(--on-ink); }
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--bg)); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--edge); }
.btn--ghost:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn--small { padding: 8px 16px; font-size: 15px; }
.btn--wide { width: 100%; padding-block: 16px; }
.btn[disabled] { background: var(--grey); color: var(--soft); cursor: not-allowed; box-shadow: none; }

/* ---------- Streckenkarten ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--s5); }
.card { background: var(--card); border-radius: var(--radius); padding: var(--s6); display: flex; flex-direction: column; gap: var(--s4); min-width: 0; transition: transform .3s ease, box-shadow .3s ease; position: relative; overflow: hidden; }
.card:hover { transform: scale(1.012); box-shadow: 0 0 0 1px var(--line), 0 12px 34px rgba(0, 0, 0, .4); }
.card__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); font-size: 14px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.card__name { font-size: 30px; font-weight: 700; line-height: 1.05; letter-spacing: -.015em; }
.card__name small { display: block; font-size: 16px; font-weight: 400; color: var(--soft); letter-spacing: 0; margin-top: 4px; }
.card__profile { height: 64px; width: 100%; color: var(--ink); }
.card__sub { color: var(--soft); font-size: 16px; line-height: 1.35; flex: 1; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.facts div { background: var(--bg); border-radius: var(--radius-s); padding: 8px 10px; }
.facts dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.facts dd { font-size: 20px; font-weight: 700; }
.dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ink); }
.card__pb { font-size: 15px; display: flex; justify-content: space-between; gap: var(--s3); min-height: 22px; }
.card__foot { display: flex; gap: var(--s2); flex-wrap: wrap; }
.card__foot .btn { flex: 1; padding-inline: 16px; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.medal { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -1px; margin-right: 5px; background: var(--line); }
.medal--gold { background: #c9a55a; } .medal--silver { background: #a4a8ae; } .medal--bronze { background: #9a6a48; }
.status { background: var(--card); border-radius: var(--radius-s); padding: var(--s3) var(--s4); margin-bottom: var(--s5); border-left: 3px solid var(--soft); font-size: 16px; }

/* ---------- Flächen, Formulare ---------- */
.panel { background: var(--card); border-radius: var(--radius); padding: var(--s6); display: grid; gap: var(--s5); align-content: start; }
.panel h2 { font-size: 24px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }
.stage { background: var(--card); border-radius: var(--radius); padding: var(--s4); position: sticky; top: calc(var(--nav-h) + var(--s4)); }
.stage canvas { width: 100%; aspect-ratio: 1; border-radius: var(--radius-s); background: radial-gradient(120% 90% at 50% 35%, #3a3e45, #17181b); touch-action: none; cursor: grab; }
legend { font-weight: 700; margin-bottom: var(--s3); font-size: 16px; text-transform: uppercase; letter-spacing: .05em; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s2); }
.tile { position: relative; cursor: pointer; display: block; }
.tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tile__box { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: var(--s2) var(--s3); background: var(--bg); border-radius: var(--radius-s); box-shadow: inset 0 0 0 1px var(--edge); text-align: center; font-weight: 700; }
.tile:hover .tile__box { box-shadow: inset 0 0 0 1px var(--ink); }
.tile input:checked + .tile__box { box-shadow: inset 0 0 0 2px var(--ink); color: var(--ink); background: var(--card); }
.tile input:focus-visible + .tile__box { outline: 3px solid var(--primary); outline-offset: 3px; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s3); }
.colors legend { grid-column: 1 / -1; }
.color { display: flex; align-items: center; gap: var(--s3); cursor: pointer; font-size: 16px; }
.color input { width: 44px; height: 44px; padding: 0; border: 1px solid var(--edge); border-radius: 50%; background: none; cursor: pointer; flex: none; overflow: hidden; }
.color input::-webkit-color-swatch-wrapper { padding: 0; } .color input::-webkit-color-swatch { border: 0; border-radius: 50%; } .color input::-moz-color-swatch { border: 0; border-radius: 50%; }
.swatches { display: flex; gap: var(--s2); flex-wrap: wrap; }
.swatches button { width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--edge); }
.swatches button.is-on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--ink); }
.field { display: grid; gap: var(--s2); font-size: 16px; align-content: start; }
.field > span { font-weight: 700; }
.field input, .field select { width: 100%; height: 56px; padding: 0 var(--s4); border: 1px solid var(--edge); border-radius: var(--radius-s); background: var(--bg); color: var(--ink); font-size: 18px; }
.field small { color: var(--soft); line-height: 1.35; }
.form__foot { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.error { color: var(--danger); font-weight: 700; font-size: 16px; }
.check { display: flex; gap: var(--s3); align-items: center; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.chip { border: 0; color: var(--ink); background: var(--card); border-radius: 999px; height: 40px; padding: 0 18px; cursor: pointer; font-size: 16px; }
.chip:hover { box-shadow: inset 0 0 0 1px var(--edge); }
.chip.is-active { background: var(--ink); color: var(--on-ink); }

/* ---------- Bestenliste, Lobby ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 17px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); font-weight: 700; padding: 0 8px 8px; }
.table td { padding: 10px 8px; border-top: 1px solid var(--line); }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table tr.is-me td { background: color-mix(in srgb, var(--ink) 8%, transparent); font-weight: 700; }
.table td:first-child { width: 44px; color: var(--soft); font-weight: 700; }
.board__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); flex-wrap: wrap; }
.lobby__head { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); }
.lobby__code { display: block; font-size: 56px; line-height: 1; letter-spacing: .12em; color: var(--ink); }
.lobby__track { font-size: 22px; font-weight: 700; }
.players { display: grid; gap: var(--s2); }
.players li { display: flex; align-items: center; gap: var(--s3); background: var(--bg); border-radius: var(--radius-s); padding: 10px 14px; font-weight: 700; }
.players li small { margin-left: auto; font-weight: 400; color: var(--soft); }
.players .jersey { width: 22px; height: 22px; border-radius: 6px; flex: none; }
.roomrow { display: flex; align-items: center; gap: var(--s4); padding: 10px 0; border-top: 1px solid var(--line); }
.roomrow:first-child { border-top: 0; padding-top: 0; }
.roomrow div { flex: 1; min-width: 0; }
.roomrow strong { display: block; }

/* ---------- Hilfe ---------- */
.help h2 { font-size: 24px; }
.keys { display: grid; grid-template-columns: max-content 1fr; gap: 10px var(--s5); align-items: baseline; }
.keys dt { white-space: nowrap; }
kbd { display: inline-block; min-width: 28px; padding: 2px 7px; border-radius: 7px; background: var(--bg); box-shadow: inset 0 -2px 0 var(--edge), inset 0 0 0 1px var(--edge); font: 700 14px/1.5 var(--font); text-align: center; }
.list { display: grid; gap: var(--s3); }
.list li { padding-left: 22px; position: relative; }
.list li::before { content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--soft); }

/* ---------- Fußzeile ---------- */
.footer { margin-top: var(--s8); padding: var(--s7) 0 var(--s6); font-size: 15px; line-height: 1.5; color: var(--soft); border-top: 1px solid var(--line); }
.footer h2 { font-size: 13px; font-weight: 700; color: var(--ink); text-transform: uppercase; letter-spacing: .06em; margin-bottom: var(--s3); }
.footer__cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: var(--s6) var(--s8); }
.footer__cols p + p { margin-top: var(--s3); }

/* ---------- Dialoge ---------- */
.dialog { border: 0; border-radius: var(--radius); padding: var(--s6); width: min(440px, calc(100% - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(0, 0, 0, .66); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog[open] { display: grid; gap: var(--s4); }
.dialog h2 { font-size: 30px; }
.dialog form { display: grid; gap: var(--s4); }
.dialog__close { position: absolute; right: 10px; top: 8px; }
.dialog__close button { border: 0; background: none; font-size: 30px; line-height: 1; width: 44px; height: 44px; cursor: pointer; color: var(--soft); border-radius: 50%; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 999px; padding: 4px; }
.seg button { border: 0; background: none; border-radius: 999px; padding: 9px; cursor: pointer; font-weight: 700; }
.seg button.is-on { background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--ink); }
.acc__level { font-size: 22px; font-weight: 700; }
.bar { height: 10px; border-radius: 5px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.danger summary { cursor: pointer; color: var(--soft); font-size: 15px; }
.danger form { margin-top: var(--s4); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #2a2d32; color: var(--ink); padding: 12px 22px; border-radius: 999px; z-index: 200; font-weight: 700; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); }
.toast button { margin-left: 12px; border: 0; background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 12px; font-weight: 700; cursor: pointer; }

/* ---------- Spiel ---------- */
.game { position: fixed; inset: 0; z-index: 100; background: #0f1012; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none; }
body.in-game { overflow: hidden; }
.game canvas { width: 100%; height: 100%; }
.game .game__mud { position: absolute; inset: 0; pointer-events: none; }
.hud { position: absolute; inset: 0; pointer-events: none; padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); font-variant-numeric: tabular-nums; }
/* Anflug: Kinobalken, Anzeigen ausgeblendet, Bild blendet aus Schwarz auf */
.hud::before, .hud::after { content: ''; position: absolute; left: 0; right: 0; height: 9vh; background: #000; transition: transform .7s cubic-bezier(.4, 0, .2, 1); pointer-events: none; }
.hud::before { top: 0; transform: translateY(-101%); } .hud::after { bottom: 0; transform: translateY(101%); }
.hud.is-fly::before, .hud.is-fly::after { transform: none; }
.hud__top, .hud__bottom { transition: opacity .5s; }
.hud.is-fly .hud__top, .hud.is-fly .hud__bottom { opacity: 0; }
.hud.is-fly { animation: flyfade .8s ease-out; }
@keyframes flyfade { 0%, 15% { background: #000; } 100% { background: transparent; } }
/* Kopfbereich in drei Spalten: links Zeit, Mitte Höhenprofil und Kurvenwarnung, rechts Punkte und Streckenkarte */
.hud__top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 12px; }
.hud__col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.hud__col--l { align-items: flex-start; } .hud__col--m { align-items: center; } .hud__col--r { align-items: flex-end; }
dialog.dlg-fallback { position: fixed; inset: 0; margin: auto; z-index: 60; max-height: 90vh; overflow: auto; }
.hud__box { color: #ececee; background: rgba(16, 17, 20, .76); border-radius: var(--radius-s); padding: 8px 14px; min-width: 132px; display: grid; line-height: 1.1; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
.hud__box small { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.hud__box strong { font-size: 32px; }
.hud__scorebox { text-align: right; margin-right: 52px; }
.hud__scorebox span { font-size: 14px; font-weight: 700; color: #b9c7d6; min-height: 0; }
.hud__split { font-size: 16px; font-weight: 700; }
.hud__split.is-good { color: var(--ok); } .hud__split.is-bad { color: var(--danger); }
.hud__signs { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 60px; }
/* Sprung-Ankündigung: Rampe mit Flugbogen und Entfernung */
.hud__jump { display: flex; align-items: center; gap: 8px; height: 60px; padding: 0 16px 0 12px; border-radius: 30px; background: #e8c35a; color: #14151a; font-weight: 800; font-size: 15px; white-space: nowrap; opacity: 0; transform: scale(.85); transition: opacity .2s, transform .2s, background .2s; font-variant-numeric: tabular-nums; }
.hud__jump svg { width: 34px; height: 34px; flex: none; }
.hud__jump.is-on { opacity: 1; transform: none; }
.hud__jump.is-drop svg { transform: scaleY(-1); }
.hud__jump.is-branch { background: #ffb347; } .hud__jump.is-branch svg { transform: rotate(-35deg); }
.hud__jump.is-near { background: #f4f4f6; animation: jumpPulse .45s ease-in-out infinite alternate; }
.hud__jump.is-variant { background: #7b4fd0; color: #fff; } .hud__jump.is-variant.is-near { background: #9b6bff; color: #fff; }
@keyframes jumpPulse { to { transform: scale(1.08); } }
.hud__turn { width: 60px; height: 60px; border-radius: 50%; background: rgba(16, 17, 20, .72); display: grid; place-items: center; opacity: 0; transition: opacity .2s, background .2s; color: #ececee; transform: scaleX(-1); }
.hud__turn.is-left { transform: none; }
.hud__turn svg { width: 36px; height: 36px; }
.hud__turn.sev1 { opacity: .85; }
.hud__turn.sev2 { opacity: 1; background: #d8b75a; color: #14151a; }
.hud__turn.sev3 { opacity: 1; background: #c4525e; color: #fff; }
.hud__prog { position: relative; width: min(38vw, 420px); height: 54px; background: rgba(16, 17, 20, .66); border-radius: var(--radius-s); overflow: hidden; box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
.hud__prog canvas { display: block; position: static; width: 100%; height: 100%; }
.hud__prog span { position: absolute; right: 10px; top: 5px; font-size: 12px; font-weight: 700; color: #e6e8ec; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums; }
#hud-map { display: block; position: static; width: 196px; height: 196px; background: rgba(16, 17, 20, .66); border-radius: var(--radius-s); box-shadow: 0 4px 18px rgba(0, 0, 0, .12); }
.hud__msg { position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%) scale(.8); opacity: 0; text-align: center; display: grid; gap: 2px; transition: opacity .3s; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); color: #fff; width: 90%; }
.hud__msg strong { font-size: clamp(30px, 5.5vw, 58px); line-height: 1; text-transform: uppercase; letter-spacing: .01em; font-style: italic; }
.hud__msg span { font-size: clamp(17px, 2.4vw, 24px); font-weight: 700; }
.hud__msg.is-on { opacity: 1; }
.hud__msg.is-pop { animation: pop .35s cubic-bezier(.2, 1.6, .4, 1) forwards; }
.hud__msg.lvl3 strong { color: #e6c87a; } .hud__msg.lvl4 strong { color: #e58590; }
@keyframes pop { to { transform: translate(-50%, -50%) scale(1); } }
.hud__count { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); font-size: clamp(70px, 16vw, 170px); font-weight: 700; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .5); font-style: italic; }
.hud__bottom { position: absolute; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 16px; }
.hud__speed { background: rgba(16, 17, 20, .78); color: #fff; border-radius: var(--radius-s); padding: 6px 16px 8px; display: flex; align-items: baseline; gap: 6px; min-width: 128px; justify-content: flex-end; }
.hud__speed strong { font-size: 52px; line-height: 1; font-style: italic; }
.hud__speed small { font-size: 14px; opacity: .7; }
.hud__meters { display: grid; gap: 6px; padding-bottom: 4px; }
.meter { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.meter span { width: 38px; }
.meter div { width: 150px; height: 10px; border-radius: 5px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.meter i { display: block; height: 100%; background: #fff; transform-origin: left; transition: transform .1s linear; }
.meter--flow i { background: #d8b75a; }
.meter--flow.is-ready div { box-shadow: 0 0 0 2px #d8b75a; }
.meter--flow.is-on i { background: #fff; }
.hud__pause { pointer-events: auto; position: absolute; right: max(14px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); width: 44px; height: 44px; border-radius: 50%; border: 0; color: #ececee; background: rgba(16, 17, 20, .72); font-weight: 700; cursor: pointer; }

.pad { display: none; position: absolute; inset: auto 0 0 0; padding: 0 max(12px, env(safe-area-inset-right)) max(92px, calc(env(safe-area-inset-bottom) + 92px)) max(12px, env(safe-area-inset-left)); justify-content: space-between; align-items: flex-end; pointer-events: none; }
@media (pointer: coarse) { .pad { display: flex; } .hud__bottom { transform: scale(.8); transform-origin: left bottom; } }
.pad button { pointer-events: auto; border: 0; border-radius: 50%; background: rgba(16, 17, 20, .55); color: #f2f2f3; font-weight: 700; touch-action: none; -webkit-tap-highlight-color: transparent; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .45); }
.pad button.is-down { background: #ececee; color: #14151a; }
.pad__l { display: flex; gap: 14px; position: relative; pointer-events: auto; touch-action: none; padding: 10px 6px 16px; margin: -10px -6px -16px; --sx: 0; }
.pad__l button { pointer-events: none; }
/* Lenkfläche: der Daumen schiebt stufenlos, der Strich zeigt den Einschlag */
.pad__knob { position: absolute; left: 50%; bottom: 2px; width: 34px; height: 5px; margin-left: -17px; border-radius: 3px; background: #fff; opacity: .28; transform: translateX(calc(var(--sx) * 70px)); transition: opacity .15s; }
.pad__l.is-on .pad__knob { opacity: .95; }
.pad__l button { width: 84px; height: 84px; font-size: 30px; }
.pad__r { display: grid; grid-template-columns: repeat(3, auto); gap: 10px; justify-items: end; align-items: end; }
.pad__s { width: 58px; height: 58px; font-size: 13px; }
.pad__b { width: 80px; height: 80px; font-size: 15px; }
.pad__boost { box-shadow: inset 0 0 0 2px #d8b75a !important; }
.pad__hop { box-shadow: inset 0 0 0 2.5px #fff !important; }

.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); padding: 16px; overflow: auto; touch-action: auto; }
#ov-load { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }      /* deckend: Unschärfe wäre nur Arbeit (und bremst in Safari den Ladekreis) */
.sheet { background: var(--card); border-radius: var(--radius); padding: var(--s6); width: min(480px, 100%); display: grid; gap: var(--s4); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); user-select: text; }
.sheet h2 { font-size: 34px; line-height: 1; }
.stack { display: grid; gap: var(--s2); }
.keys-mini { line-height: 2; }
/* Ladeanzeige: drehendes Laufrad mit Vereinslogo – nur per transform animiert, läuft auf der Grafikkarte weiter (Safari!). */
.wheelload { position: relative; width: 84px; height: 84px; margin: 0 auto 6px; contain: strict; }
.wheelload__spin { position: absolute; inset: 0; will-change: transform; animation: wl-roll 12s linear infinite; }
@keyframes wl-roll { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wheelload__spin { animation-duration: 30s; } }
.result__medal { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); }
.result__time { font-size: 64px; font-weight: 700; line-height: 1; font-style: italic; color: var(--ink); font-variant-numeric: tabular-nums; }
.result__note { font-weight: 700; }
.result__note.is-pb { color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.stats div { background: var(--bg); border-radius: var(--radius-s); padding: 8px 10px; }
.stats dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.stats dd { font-size: 20px; font-weight: 700; }
.standing { display: grid; gap: 6px; counter-reset: p; }
.standing li { counter-increment: p; display: flex; gap: var(--s3); background: var(--bg); border-radius: var(--radius-s); padding: 9px 14px; font-weight: 700; }
.standing li::before { content: counter(p) "."; color: var(--soft); width: 22px; }
.standing li span { margin-left: auto; font-variant-numeric: tabular-nums; }
.standing li.is-me { box-shadow: inset 0 0 0 2px var(--ink); }

/* Fahrer-Editor: Vorschau steht fest, nur die Auswahl-Liste rollt */
@media (min-width: 961px) {
  #view-avatar .split { height: calc(100vh - var(--nav-h) - 120px); min-height: 460px; }
  #view-avatar .stage { position: static; height: 100%; display: flex; flex-direction: column; box-sizing: border-box; }
  #view-avatar .stage canvas { flex: 1; min-height: 0; aspect-ratio: auto; }
  #view-avatar .split > .panel { max-height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
}
@media (max-width: 960px) {
  #view-avatar .stage { position: sticky; top: var(--nav-real, var(--nav-h)); z-index: 3; padding: var(--s2); box-shadow: 0 8px 18px rgba(0, 0, 0, .25); }
  #view-avatar .stage canvas { aspect-ratio: auto; height: min(30vh, 260px); }
  #view-avatar .stage p { display: none; }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .stage { position: static; }
  .stage canvas { aspect-ratio: 4 / 3; }
  .footer__cols { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav__inner { flex-wrap: wrap; width: 100%; gap: 0; }
  .brand { padding: 8px var(--gutter); }
  .nav__links { width: 100%; overflow-x: auto; min-height: 44px; border-top: 1px solid var(--line); }
  .nav__btn { padding: 0 14px; font-size: 14px; flex: 1; justify-content: center; }
  .grid { grid-template-columns: 1fr; }
  .card, .panel { padding: var(--s5); }
  .keys { grid-template-columns: 1fr; gap: 2px; } .keys dd { margin-bottom: 10px; }
  .hud__box strong { font-size: 24px; } .hud__box { min-width: 104px; padding: 6px 10px; }
  .hud__turn { width: 48px; height: 48px; } .hud__turn svg { width: 28px; height: 28px; }
  .hud__signs { min-height: 48px; gap: 8px; } .hud__jump { height: 48px; font-size: 13px; padding: 0 12px 0 9px; } .hud__jump svg { width: 26px; height: 26px; }
  .meter div { width: 110px; }
}
@media (max-height: 520px) {
  .pad { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .pad__l { margin-bottom: 78px; }
  .hud__prog { width: 30vw; height: 40px; } .hud__col { gap: 6px; }
  #hud-map { width: 112px; height: 112px; }
  .sheet { padding: var(--s5); gap: var(--s3); } .result__time { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 520px) {
  .pad { padding-inline: 10px; }
  .pad__l { gap: 8px; } .pad__l button { width: 62px; height: 62px; font-size: 24px; }
  .pad__r { gap: 7px; } .pad__s { width: 50px; height: 50px; font-size: 12px; } .pad__b { width: 62px; height: 62px; font-size: 13px; }
}
.field--row select { height: 48px; font-size: 16px; }
/* ---------- Bike-Auswahl ---------- */
.bikes { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: var(--s2); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 3px 3px 8px; margin: -3px -3px 0; scrollbar-width: thin; }
.bikes .tile { scroll-snap-align: start; }
.bike__box { flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 10px 12px; font-weight: 400; height: 100%; min-height: 0; justify-content: flex-start; }
.bike__box strong { font-size: 16px; line-height: 1.15; }
.tile input:checked + .bike__box { color: var(--ink); }
.bike__stats { display: grid; grid-template-columns: max-content 1fr; gap: 3px 6px; width: 100%; font-size: 11px; color: var(--soft); align-items: center; margin-top: 6px; }
.bike__stats span { display: contents; }
.bike__info { margin: 6px 0 0; }
.bike__stats i { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--ink) calc(var(--v) * 20%), var(--line) 0); }

/* Steigungsanzeige */
.hud__grade { display: grid; line-height: 1; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); padding-bottom: 6px; min-width: 64px; }
.hud__grade strong { font-size: 26px; font-style: italic; }
.hud__grade small { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; opacity: .75; }
.hud__grade.is-steep strong { color: #e6c87a; }
select, input { color-scheme: dark; }
/* ---------- Level, Karte, Sperre ---------- */
.level { margin: var(--s7) 0 var(--s4); display: grid; gap: 4px; }
.level:first-child { margin-top: 0; }
.level__title { font-size: 26px; font-weight: 700; display: flex; align-items: baseline; gap: var(--s3); }
.level__no { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--soft); border: 1px solid var(--edge); border-radius: 99px; padding: 3px 10px; }
.level__text { color: var(--soft); max-width: 78ch; }
.level.is-locked .level__title { color: var(--soft); }
.card__viz { display: grid; grid-template-columns: 88px 1fr; gap: var(--s4); align-items: end; }
.card__map { width: 88px; height: 88px; border-radius: var(--radius-s); background: var(--bg); color: var(--ink); }
.card.is-locked { opacity: .62; }
.card.is-locked:hover { transform: none; box-shadow: none; }
/* ---------- Tastenhinweise im Spiel ---------- */
.hud__hint { position: absolute; left: 50%; bottom: max(96px, calc(env(safe-area-inset-bottom) + 96px)); transform: translate(-50%, 12px); opacity: 0; transition: opacity .25s, transform .25s; display: flex; align-items: center; gap: 12px; background: rgba(16, 17, 20, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #ececee; border-radius: 999px; padding: 10px 20px 10px 12px; font-size: 18px; font-weight: 700; white-space: nowrap; max-width: 94vw; }
.hud__hint.is-on { opacity: 1; transform: translate(-50%, 0); }
.hud__hint kbd { background: #ececee; color: #14151a; box-shadow: inset 0 -2px 0 #9a9ca1; font-size: 15px; min-width: 30px; padding: 3px 9px; }
.hud__hint span { display: inline-flex; gap: 5px; }
@media (pointer: coarse) { .hud__hint { bottom: auto; top: 32%; font-size: 16px; } }
@media (min-width: 1300px) and (pointer: fine) { .hud__hint { bottom: max(22px, env(safe-area-inset-bottom)); } }
/* ---------- Sprache, Uploads, Verwaltung ---------- */
.nav__lang { display: flex; align-items: center; gap: 2px; padding: 0 10px; }
.nav__lang button { border: 0; background: none; color: var(--soft); font-size: 13px; font-weight: 700; padding: 6px 6px; cursor: pointer; border-radius: 6px; }
.nav__lang button:hover { color: var(--ink); }
.nav__lang button.is-on { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.uploads { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3); margin: var(--s3) 0; }
.field input[type=file] { height: auto; padding: 12px; font-size: 15px; }
.tabs { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s5); }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.sponsor { background: var(--bg); border-radius: var(--radius-s); padding: var(--s4); display: grid; gap: var(--s3); }
.sponsor img { width: 100%; height: 90px; object-fit: contain; background: #f3f3f4; border-radius: 8px; padding: 8px; }
.sponsor.is-off { opacity: .55; }
.sponsor__row { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; justify-content: space-between; font-size: 15px; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s4); align-items: end; }
.jersey-thumb { width: 100%; aspect-ratio: 2.125; object-fit: cover; border-radius: 8px; background: #2a2d32; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.kpis div { background: var(--bg); border-radius: var(--radius-s); padding: 10px 14px; }
.kpis dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--soft); }
.kpis dd { font-size: 26px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.linkbtn { border: 0; background: none; color: var(--primary); cursor: pointer; padding: 2px 4px; font-size: 15px; }
.linkbtn--danger { color: var(--danger); }

/* Eigene Strecken */
.tag { display: inline-block; margin-left: 8px; padding: 1px 7px; border: 1px solid var(--line, #2c2f34); border-radius: 999px; font-style: normal; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--soft); }
.card__credit { display: block; margin-top: 6px; font-size: 11px; line-height: 1.3; opacity: .7; }
.tr-maps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.tr-maps canvas { width: 100%; height: auto; background: var(--bg); border-radius: var(--radius-s); display: block; }
#tr-map { cursor: crosshair; }
.tr-side { display: grid; gap: var(--s3); }
.tr-kpis { grid-template-columns: repeat(2, 1fr); }
.tr-kpis dd { font-size: 20px; }
.tr-set { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s4); display: grid; gap: var(--s4); min-width: 0; }
.tr-set legend { padding: 0 8px; font-weight: 700; }
.tr-set input[type=range] { height: 32px; padding: 0; border: 0; background: none; accent-color: var(--primary); }
.tr-feats { max-height: 360px; overflow: auto; }
.tr-feats input, .tr-feats select { height: 36px; padding: 0 8px; border: 1px solid var(--edge); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 15px; width: 100%; min-width: 64px; }
.tr-feats td:first-child { width: auto; color: inherit; font-weight: 400; }
.tr-feats tr.is-sel td { background: color-mix(in srgb, var(--primary) 14%, transparent); }
.trackcard svg { width: 100%; height: 110px; color: var(--ink); background: var(--card); border-radius: 8px; }
@media (max-width: 760px) { .tr-maps { grid-template-columns: 1fr; } }

/* ================= Auffrischung 1.13 =================
   Drei klar getrennte Flächentöne (Grund, Karte, Einsatz), feine Ränder, ein Blau als Leitfarbe und je Level eine Kennfarbe. */
:root {
  --bg: #0b0c0f; --card: #181b20; --raise: #232830;
  --primary: #7db4e6; --on-primary: #08101a; --accent: #d0616d;
  --soft: color-mix(in srgb, var(--ink) 64%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 15%, var(--bg));
  --edge: color-mix(in srgb, var(--ink) 36%, var(--bg));
  --l1: #7fc08f; --l2: #7db4e6; --l3: #e0717c;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --gutter: max(clamp(20px, 4vw, 44px), var(--safe-l), var(--safe-r));
}
html { -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--nav-h) + var(--safe-t) + 12px); }
body { background: radial-gradient(1100px 520px at 85% -120px, rgba(125, 180, 230, .11), transparent 62%), radial-gradient(900px 480px at -10% 10%, rgba(208, 97, 109, .05), transparent 60%), var(--bg); background-repeat: no-repeat; }
button, a, .chip, .btn { touch-action: manipulation; }

/* iPhone: Kopfzeile unter Notch und Statusleiste hervorholen, Ränder im Querformat freihalten */
.nav { padding-top: var(--safe-t); background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom-color: var(--line); box-shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 10px 30px rgba(0, 0, 0, .28); }
.footer { padding-bottom: calc(var(--s6) + var(--safe-b)); background: #07080a; }
.toast { bottom: calc(24px + var(--safe-b)); border: 1px solid var(--edge); }
.overlay { padding: max(16px, var(--safe-t)) max(16px, var(--safe-r)) max(16px, var(--safe-b)) max(16px, var(--safe-l)); }
.nav, .btn, .chip, .pad, .hud { -webkit-touch-callout: none; }
@media (display-mode: standalone) { html, body { overscroll-behavior-y: none; } .nav { -webkit-user-select: none; user-select: none; } }

/* Flächen */
.card, .panel, .sheet { border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 10px 28px rgba(0, 0, 0, .28); }
.card:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 0 0 1px var(--edge), 0 16px 40px rgba(0, 0, 0, .45); }
.card.is-locked:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .045), 0 10px 28px rgba(0, 0, 0, .28); }
.lv1 { --lv: var(--l1); } .lv2 { --lv: var(--l2); } .lv3 { --lv: var(--l3); }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--lv, var(--edge)); opacity: .9; }
.level__no { color: var(--lv, var(--soft)); border-color: color-mix(in srgb, var(--lv, var(--edge)) 55%, transparent); background: color-mix(in srgb, var(--lv, transparent) 10%, transparent); }
.dots i { background: color-mix(in srgb, var(--ink) 18%, var(--bg)); }
.dots i.on { background: var(--lv, var(--ink)); }
.facts div, .kpis div, .card__map { background: var(--raise); border: 1px solid var(--line); }
.card__profile { color: var(--lv, var(--ink)); }
.card__map { color: var(--ink); }
.status { border: 1px solid var(--line); border-left: 3px solid var(--primary); }
.sponsor { background: var(--raise); border: 1px solid var(--line); }

/* Schaltflächen und Auswahl */
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px rgba(125, 180, 230, .18); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 86%, #fff); }
.btn--ghost { background: color-mix(in srgb, var(--ink) 4%, transparent); box-shadow: inset 0 0 0 1.5px var(--edge); }
.btn--ghost:hover { background: color-mix(in srgb, var(--ink) 11%, transparent); }
.btn[disabled] { background: var(--raise); color: var(--soft); box-shadow: inset 0 0 0 1px var(--line); }
.chip { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.chip:hover { box-shadow: inset 0 0 0 1px var(--edge); }
.chip.is-active { background: var(--primary); color: var(--on-primary); box-shadow: none; font-weight: 700; }
.nav__btn.is-active { box-shadow: inset 0 -2px 0 var(--primary); }
.nav__btn--primary, .nav__btn--primary:hover { background: var(--raise); }
.tag { border-color: var(--edge); color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }

/* Eingaben, Tabellen */
.field input, .field select { background: #0d0f13; border-color: var(--edge); }
.field input:focus, .field select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent); }
.table th { border-bottom: 1px solid var(--edge); padding-bottom: 10px; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.table tr.is-me td { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.roomrow { border-top-color: var(--line); }
.tr-set { border-color: var(--edge); background: color-mix(in srgb, var(--ink) 2%, transparent); }
:focus-visible { outline-color: var(--primary); }
.tile input:checked + .tile__box { box-shadow: inset 0 0 0 2px var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--card)); }
.swatches button.is-on { box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--primary); }
.nav__lang button.is-on { box-shadow: inset 0 -2px 0 var(--primary); }

/* Quellenangabe, solange im Anflug die Landkarte zu sehen ist */
.hud__credit { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); padding: 3px 9px; border-radius: 6px; background: rgba(255, 255, 255, .82); color: #1b1d21; font-size: 13px; font-weight: 600; }

/* Neigungssteuerung: gelenkt wird durch Kippen, die Pfeiltasten entfallen */
.pad.is-tilt .pad__l { visibility: hidden; }
.seg--3 { grid-template-columns: repeat(3, 1fr); margin-top: 6px; }
#opt-tilt button { color: inherit; min-height: 40px; }
#opt-tilt-state { margin: 6px 0 0; color: var(--l1, #6fcf8e); }
#opt-tilt-state.is-bad { color: var(--l3, #ef6b6b); }

/* ---------- Trainingsfahrt: Coach-Sprechblase, Autopilot-Hinweis, Coach-Auswahl ---------- */
.hud__coach { position: absolute; left: max(16px, env(safe-area-inset-left)); top: max(150px, calc(env(safe-area-inset-top) + 150px)); max-width: min(360px, 42vw); display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-s); background: rgba(16, 17, 20, .82); color: #eef0f3; font-size: 15px; line-height: 1.35; opacity: 0; transform: translateX(-12px); transition: opacity .3s, transform .3s; pointer-events: none; }
.hud__coach.is-on { opacity: 1; transform: none; }
.hud__coach b { flex: none; padding: 3px 9px; border-radius: 12px; color: #fff; font-size: 13px; letter-spacing: .02em; }
.hud__auto { position: absolute; left: 50%; bottom: max(118px, calc(env(safe-area-inset-bottom) + 118px)); transform: translateX(-50%); padding: 6px 12px; border-radius: 14px; background: rgba(16, 17, 20, .7); color: #cfd3da; font-size: 13px; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.hud__auto.is-on { opacity: 1; } .hud__auto.is-self { color: #e8c35a; }
.coaches { display: grid; gap: 10px; margin-top: 14px; }
.coach { display: grid; grid-template-columns: 54px 1fr; gap: 4px 14px; align-items: center; text-align: left; padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .04); color: inherit; cursor: pointer; font: inherit; }
.coach:hover, .coach:focus-visible { border-color: var(--primary); background: rgba(125, 180, 230, .08); }
.coach i { grid-row: span 2; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 22px; color: #fff; }
.coach strong { font-size: 17px; } .coach strong small { font-weight: 600; opacity: .7; margin-left: 6px; font-size: 13px; }
.coach span { font-size: 13px; opacity: .8; }
.rides { margin-top: 20px; }
.rides table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rides td { padding: 7px 6px; border-top: 1px solid rgba(255, 255, 255, .08); vertical-align: middle; }
.rides td:last-child { text-align: right; white-space: nowrap; }
@media (max-height: 520px) { .hud__coach { top: 92px; font-size: 13px; max-width: 46vw; padding: 9px 11px; } .hud__auto { bottom: 92px; } }

.hud__count.is-small { top: 14%; transform: translate(-50%, -50%) scale(.45); }

/* ---------- Analyse mit dem Coach ---------- */
.hud__replay { position: absolute; left: 50%; bottom: max(24px, calc(env(safe-area-inset-bottom) + 24px)); transform: translateX(-50%); display: none; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-radius: 28px; background: rgba(16, 17, 20, .86); color: #eef0f3; pointer-events: auto; white-space: nowrap; }
.hud__replay.is-on { display: flex; }
.hud__rp-t { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .7; }
.hud__replay b { font-size: 15px; margin-right: 6px; font-variant-numeric: tabular-nums; }
.hud__replay button { min-width: 44px; height: 40px; border-radius: 20px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: inherit; font: inherit; font-weight: 700; padding: 0 14px; cursor: pointer; }
.hud__replay button:disabled { opacity: .35; cursor: default; }
.hud.is-replay .hud__bottom, .hud.is-replay .hud__timebox, .hud.is-replay .hud__scorebox, .hud.is-replay ~ .pad { visibility: hidden; }
.hud.is-replay .hud__coach { top: auto; bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px)); left: 50%; transform: translateX(-50%); max-width: min(620px, 80vw); font-size: 16px; }
.hud.is-replay .hud__coach.is-on { transform: translateX(-50%); }

/* ----- Community-Strecke: Kachel ----- */
.card--commu { background: linear-gradient(160deg, rgba(111, 159, 201, .16), rgba(127, 181, 138, .1)), var(--card); }
.card--commu { align-self: start; }                        /* nur so hoch wie ihr Inhalt */
.card--commu .card__viz { align-items: center; }
.card--commu .card__sub { margin: 0; }

.chat { position: absolute; left: max(14px, env(safe-area-inset-left)); top: max(150px, calc(env(safe-area-inset-top) + 150px)); width: min(300px, 38vw); max-height: calc(100% - 330px); min-height: 0; display: flex; flex-direction: column; border-radius: var(--radius-s); background: rgba(14, 15, 18, .72); color: #eef0f3; font-size: 14px; line-height: 1.35; pointer-events: auto; -webkit-backdrop-filter: none; backdrop-filter: none; }
.chat[hidden] { display: none; }
.chat__head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 12px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
.chat__head span { flex: 1; color: #aab0b9; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat__head i { font-style: normal; transition: transform .2s; }
.chat__badge { padding: 1px 7px; border-radius: 10px; background: var(--accent); color: #fff; font-style: normal; font-size: 12px; }
.chat.is-closed .chat__body { display: none; }
.chat.is-closed .chat__head i { transform: rotate(-90deg); }
.chat__body { display: flex; flex-direction: column; min-height: 0; flex: 1; border-top: 1px solid rgba(255, 255, 255, .08); }
.chat__list { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 60px; max-height: 260px; overscroll-behavior: contain; }
.chat__list li { margin: 0 0 5px; overflow-wrap: anywhere; }
.chat__list li b { margin-right: 6px; color: #9cc6ee; }
.chat__list li.is-me b { color: #e8c35a; }
.chat__list li.is-sys { color: #9aa1aa; font-size: 12px; font-style: italic; }
.chat__form { display: flex; gap: 6px; padding: 8px; }
.chat__form input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .35); color: inherit; font: inherit; font-size: 16px; }
.chat__form input:focus { outline: none; border-color: var(--primary); }
.chat__form button { flex: none; width: 38px; border-radius: 8px; border: 0; background: var(--primary); color: var(--on-primary); font-size: 15px; cursor: pointer; }
.chat__guest { margin: 0; padding: 10px 12px; color: #c7ccd3; font-size: 13px; }
@media (max-width: 760px), (max-height: 520px) { .chat { top: max(118px, calc(env(safe-area-inset-top) + 118px)); width: min(260px, 60vw); max-height: calc(100% - 290px); font-size: 13px; } .chat__list { max-height: 150px; } }
@media (max-width: 640px) and (min-height: 521px) { .chat { top: calc(env(safe-area-inset-top) + 300px); width: min(270px, 66vw); max-height: calc(100% - 470px); } .chat__list { max-height: 120px; } }

/* ----- Bilder: Coaches und Fahrer ----- */
.face { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; overflow: hidden; background: var(--grey); color: #fff; font-weight: 800; font-size: 12px; font-style: normal; vertical-align: middle; }
.face img { width: 100%; height: 100%; object-fit: cover; display: block; }
.face--s { width: 20px; height: 20px; font-size: 10px; }
.face--xl { width: 84px; height: 84px; font-size: 32px; }
.acc__photo { display: flex; gap: 16px; align-items: center; margin: 4px 0 16px; }
.acc__photo p { margin: 0 0 8px; }
.acc__photo-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav__btn .face { margin: -4px 8px -4px -6px; width: 24px; height: 24px; }
.table td .face { margin-right: 8px; }
.chat__list li .face { margin-right: 6px; width: 20px; height: 20px; font-size: 10px; }
#lobby-players .face { margin-right: 8px; }
.coach i { background-size: cover; background-position: center; box-shadow: 0 0 0 3px var(--ring, transparent); }
.coach i.has-photo { color: transparent; }
#hud-coach-p { flex: none; width: 44px; height: 44px; border-radius: 50%; object-fit: cover; margin: -4px 0; }
#hud-coach-p[hidden] { display: none; }

/* ----- Tricks auf der Community-Strecke ----- */
.tricks { position: absolute; right: max(14px, env(safe-area-inset-right)); top: max(312px, calc(env(safe-area-inset-top) + 312px)); width: 250px; max-height: calc(100% - 450px); overflow-y: auto; border-radius: var(--radius-s); background: rgba(14, 15, 18, .72); color: #eef0f3; font-size: 13px; line-height: 1.3; pointer-events: auto; }
.tricks[hidden] { display: none; }
.tricks.is-closed .tricks__list { display: none; }
.tricks.is-closed .chat__head i { transform: rotate(-90deg); }
.tricks__list { list-style: none; margin: 0; padding: 4px 8px 8px; border-top: 1px solid rgba(255, 255, 255, .08); }
.tricks__list li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; align-items: baseline; padding: 4px 4px; border-radius: 6px; transition: background .12s; }
.tricks__list li.is-on { background: rgba(111, 159, 201, .35); }
.tricks__list kbd { display: inline-block; min-width: 1.6em; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, .14); color: #fff; font: 600 11px/1.4 system-ui, sans-serif; text-align: center; margin: 0 2px 2px 0; }
.tricks__list span { color: #cdd2d9; }
.tricks__list b { color: #fff; font-weight: 700; }
@media (max-width: 760px), (max-height: 560px) { .tricks { top: auto; bottom: calc(env(safe-area-inset-bottom) + 250px); width: 220px; max-height: 40vh; } }
.chat__input-on { box-shadow: 0 0 0 2px var(--primary); }
/* Verwaltung: Fortschritt beim Laden der Umgebung; Sprungziel unter der festen Kopfzeile */
.tr-prog { display: grid; gap: 6px; }
.tr-prog[hidden] { display: none; }
.tr-prog__bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }
.tr-prog__bar i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 5px; transition: width .35s ease; }
.tr-prog span { font-size: 13px; color: var(--soft); }
#f-track { scroll-margin-top: 84px; }
.hud.is-fly .chat, .hud.is-fly .tricks { opacity: 0; pointer-events: none; }
.chat, .tricks { transition: opacity .4s; }
.hud__count.is-wait { font-size: clamp(18px, 2.6vw, 30px); letter-spacing: 0; }
/* mittlere Breiten (Tablet hochkant, Handy quer): Vereinszeile im Logo ausblenden, sonst schiebt sich das Menü darüber */
@media (min-width: 761px) and (max-width: 1040px) { .brand__text { display: none; } }

/* ---------- 1.37.2: Coach-Hinweise und Chat am Handy ---------- */
/* Coach-Hinweis als Karte: Bild links, darüber der Name, darunter der Text über die ganze Breite (statt drei schmaler Spalten) */
.hud__coach { display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; align-items: start; max-width: min(440px, 44vw);
  background: rgba(12, 13, 16, .9); color: #fff; font-size: 16px; line-height: 1.4; padding: 12px 16px 13px 12px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); z-index: 3; }
#hud-coach-p { grid-column: 1; grid-row: 1 / span 2; margin: 0; }
.hud__coach b { grid-column: 2; grid-row: 1; justify-self: start; }
#hud-coach-t { grid-column: 2; grid-row: 2; min-width: 0; overflow-wrap: break-word; hyphens: auto; text-wrap: pretty; }
.hud__coach:has(#hud-coach-p[hidden]) { grid-template-columns: minmax(0, 1fr); }
.hud__coach:has(#hud-coach-p[hidden]) b, .hud__coach:has(#hud-coach-p[hidden]) #hud-coach-t { grid-column: 1; }
@media (max-height: 520px) { .hud__coach { top: 92px; font-size: 14px; max-width: 48vw; padding: 9px 12px 10px 10px; grid-template-columns: 36px minmax(0, 1fr); } #hud-coach-p { width: 36px; height: 36px; } }
.hud.is-replay .hud__coach { max-width: min(620px, 86vw); }
/* Chat und Trickliste: auf großen Bildschirmen wie bisher frei platziert */
.hud__side { display: contents; }
/* Handy hochkant: Coach-Karte über die ganze Breite direkt unter der oberen Leiste (Karte blendet so lange aus);
   Chat und Tricks als schmale Leiste links unter der Zeit – weg von der Fahrlinie und weg von den Knöpfen */
@media (max-width: 640px) and (min-height: 521px) {
  .hud__coach { left: 12px; right: 12px; top: max(112px, calc(env(safe-area-inset-top) + 58px)); max-width: none; font-size: 15px; }
  .hud:has(.hud__coach.is-on) .hud__map { opacity: 0; }
  .hud__map { transition: opacity .3s; }
}
/* Chat und Tricks als schmale Leiste links unter der Zeit: Handy hochkant und Handy quer */
@media (max-width: 640px) and (min-height: 521px), (max-height: 520px) {
  .hud__side { display: flex; flex-direction: column; gap: 8px; position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(112px, calc(env(safe-area-inset-top) + 58px));
    width: min(46vw, 200px); max-height: 46vh; pointer-events: none; }
  .hud__side .chat, .hud__side .tricks { position: static; inset: auto; width: 100%; max-height: none; min-height: 0; pointer-events: auto; font-size: 13px; }
  .hud__side .chat__head { padding: 8px 10px; }
  .hud__side .chat__head span { display: none; }
  .hud__side .chat__head strong { flex: 1; }
  /* aufgeklappt darf es breiter werden – dann liest oder schreibt man gerade */
  .hud__side:has(.chat:not(.is-closed):not([hidden])), .hud__side:has(.tricks:not(.is-closed):not([hidden])) { width: min(calc(100vw - 24px), 330px); }
  .hud__side .chat:not(.is-closed) .chat__list { max-height: 24vh; }
  .hud__side .tricks:not(.is-closed) { max-height: 34vh; overflow-y: auto; }
}
@media (max-height: 520px) {
  .hud__side { top: max(80px, calc(env(safe-area-inset-top) + 76px)); left: max(14px, env(safe-area-inset-left)); max-height: calc(100% - 96px); }
  .hud__side .chat:not(.is-closed) .chat__list { max-height: 30vh; }
  .hud__side .tricks:not(.is-closed) { max-height: 52vh; }
}
/* neue Nachricht bei zugeklapptem Chat */
.chat__peek { display: flex; align-items: flex-start; gap: 6px; width: 100%; margin: 0; padding: 4px 10px 9px; border: 0; background: none; color: #eef0f3; font: inherit; font-size: 13px; line-height: 1.35; text-align: left; cursor: pointer; overflow-wrap: anywhere; animation: peek-in .25s ease; }
.chat__peek[hidden] { display: none; }
.chat__peek b { color: #9cc6ee; margin-right: 4px; white-space: nowrap; }
.chat__peek .face { width: 20px; height: 20px; font-size: 10px; }
.chat:not(.is-closed) .chat__peek { display: none; }
@keyframes peek-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- 1.39: saubere Zeilenumbrüche in Überschriften (Schrift wie bisher) ---------- */
h1, h2, h3, .hero__title, .section__title, .card__name, .sheet h2, .dialog h2 { text-wrap: balance; hyphens: manual; overflow-wrap: normal; }
p, li, .hv__lead { text-wrap: pretty; }
/* Startbild: „Downhill.“ auf eigener Zeile, darunter der Zusatz – bricht in jeder Sprache sauber */
.hv .hero__title > span:first-child { display: block; }
.hv .hero__title .headline__soft { display: block; max-width: 22ch; }

/* ---------- Verwaltung › Texte ---------- */
.tx-group { margin-top: var(--s5); }
.tx-row { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.tx-row:first-of-type { border-top: 0; }
.tx-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.tx-langs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.tx-field > span { font-size: 13px; font-weight: 600; color: var(--soft); }
.tx-field input { height: 46px; font-size: 16px; }
.tx-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--edge); border-radius: var(--radius-s); background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.4; resize: vertical; }
.tx-field .is-changed { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.btn--small { padding: 4px 12px; min-height: 32px; font-size: 15px; }
.tx-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: var(--s3); padding: var(--s4) 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 2; }
@media (max-width: 760px) { .tx-langs { grid-template-columns: 1fr; } }

/* 1.42: Varianten, Feedback */
.card__vars { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--soft); margin-top: -4px; }
.card__vars span { display: inline-flex; align-items: center; gap: 6px; }
.card__vars .medal { transform: scale(.8); }
.board__vars { margin: 0 0 var(--s4); }
.chip--small { height: 32px; padding: 0 14px; font-size: 14px; }
.fbk { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(14px, env(safe-area-inset-bottom)); z-index: 30; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px 0 12px; border: 0; border-radius: 999px; background: rgba(20, 22, 26, .72); color: #f1f2f4; font-family: inherit; font-weight: 600; font-size: 14px; line-height: 1; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.fbk:hover, .fbk:focus-visible { background: rgba(20, 22, 26, .9); }
body.in-game .fbk { display: none; }
@media (max-width: 640px) { .fbk { height: 32px; padding: 0 11px 0 10px; font-size: 13px; } }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); align-items: end; }
@media (max-width: 520px) { .fb-row { grid-template-columns: 1fr; } }
#dlg-feedback { width: min(560px, calc(100% - 32px)); }
#fb-form textarea { width: 100%; resize: vertical; min-height: 120px; padding: 12px var(--s4); border: 1px solid var(--edge); border-radius: var(--radius-s); background: #0d0f13; color: var(--ink); font: inherit; font-size: 17px; line-height: 1.4; }
#fb-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 28%, transparent); }
.fb-shots { display: flex; flex-wrap: wrap; gap: 10px; }
.fb-shot, .fb-add { position: relative; width: 92px; height: 68px; border-radius: 8px; overflow: hidden; background: rgba(127, 127, 127, .12); }
.fb-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-shot button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .65); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.fb-add { display: grid; place-items: center; cursor: pointer; border: 1.5px dashed rgba(127, 127, 127, .5); font-size: 28px; color: var(--soft); }
.fb-add:hover { border-color: var(--primary); color: var(--primary); }
.fb-done { text-align: center; padding: var(--s4) 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 1.43: Update-Hinweis über der Startseite */
.upd { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: rgba(10, 11, 14, .72); -webkit-backdrop-filter: blur(10px) saturate(1.1); backdrop-filter: blur(10px) saturate(1.1); animation: upd-in .35s ease-out; }
.upd[hidden] { display: none; }
.upd__card { width: min(440px, 100%); background: var(--card); color: var(--ink); border-radius: var(--radius); padding: var(--s6); box-shadow: 0 30px 80px rgba(0, 0, 0, .45); display: grid; gap: var(--s3); text-align: center; }
.upd__card h2 { font-size: 28px; line-height: 1.15; }
.upd__icon { justify-self: center; width: 56px; height: 56px; display: grid; place-items: center; }
.upd__ring { stroke: var(--primary); stroke-dasharray: 90 40; transform-origin: 24px 24px; animation: upd-spin 1s linear infinite; }
.upd__check { stroke: var(--ok, #4caf7a); stroke-dasharray: 40; stroke-dashoffset: 40; opacity: 0; }
.upd.is-done .upd__ring { animation: none; stroke: var(--ok, #4caf7a); stroke-dasharray: none; opacity: .25; }
.upd.is-done .upd__check { opacity: 1; animation: upd-check .45s .1s ease-out forwards; }
.upd__text { color: var(--soft); }
.upd__bar { height: 10px; border-radius: 999px; background: rgba(127, 127, 127, .2); overflow: hidden; }
.upd__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #fff)); transition: width .35s ease-out; }
.upd.is-done .upd__bar i { background: var(--ok, #4caf7a); }
.upd__meta { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }
@keyframes upd-in { from { opacity: 0; } }
@keyframes upd-spin { to { transform: rotate(360deg); } }
@keyframes upd-check { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .upd, .upd__ring { animation: none; } }
.bike__brand { display: block; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-top: 2px; }

/* ---------- 1.43.4: HUD sauber ausgerichtet ---------- */
/* Tasten rechts: feste Spalten (so breit wie die großen Tasten), alles mittig darin – vorher lagen die kleinen Tasten am
   rechten Spaltenrand und die großen standen über die Spalten hinaus, die Reihen wirkten versetzt */
.pad__r { grid-template-columns: repeat(3, 80px); justify-items: center; align-items: center; }
.hud__grade strong { white-space: nowrap; }
@media (max-width: 520px) { .pad__r { grid-template-columns: repeat(3, 62px); gap: 10px; } }
@media (max-height: 520px) { .pad__r { grid-template-columns: repeat(3, 70px); } }

/* Handy hochkant: obere Leiste als Raster – Zeit | Punkte | (Pause), darunter das Höhenprofil über die volle Breite,
   darunter links die Hinweise (Kurve, Sprung), rechts die Karte. Einheitlicher Abstand 8 px, gleiche Höhen. */
@media (max-width: 640px) and (min-height: 521px) {
  .hud__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; grid-template-rows: 56px 44px auto; gap: 8px; }
  .hud__col--m, .hud__col--r { display: contents; }
  .hud__col--l { grid-column: 1; grid-row: 1; }
  .hud__box { height: 56px; min-width: 0; width: 100%; padding: 0 12px; align-content: center; box-sizing: border-box; }
  .hud__box strong { font-size: 24px; line-height: 1.05; }
  .hud__box small { font-size: 11px; max-width: 100%; }
  .hud__scorebox { grid-column: 2; grid-row: 1; justify-items: end; }
  .hud__scorebox #hud-pos { display: none; }
  .hud__pause { top: calc(max(12px, env(safe-area-inset-top)) + 6px); right: max(14px, env(safe-area-inset-right)); }
  .hud__prog { grid-column: 1 / -1; grid-row: 2; width: 100%; height: 44px; }
  .hud__signs { grid-column: 1; grid-row: 3; flex-direction: column; align-items: flex-start; justify-content: flex-start; min-height: 0; gap: 8px; }
  .hud__map { grid-column: 2 / -1; grid-row: 3; justify-self: end; }
  #hud-map { width: min(38vw, 168px); height: min(38vw, 168px); }
  /* Coach-Karte, Chat und Tricks beginnen unter dem Höhenprofil (vorher lagen sie darauf) */
  .hud__coach { top: calc(max(12px, env(safe-area-inset-top)) + 116px); }
  .hud__side { top: calc(max(12px, env(safe-area-inset-top)) + 116px); }
  /* „Autopilot …“ / „Du fährst selbst“: über den Tasten statt quer darüber */
  .hud__auto { bottom: calc(max(92px, env(safe-area-inset-bottom) + 92px) + 196px); white-space: normal; text-align: center; max-width: calc(100% - 40px); width: max-content; }
  /* untere Leiste: Tempo, Gefälle, Flow/Kraft auf einer Linie, ohne Umbruch */
  .hud__bottom { gap: 12px; align-items: center; right: max(14px, env(safe-area-inset-right)); transform: none; }
  .hud__speed { min-width: 96px; padding: 4px 12px 6px; } .hud__speed strong { font-size: 40px; } .hud__grade { min-width: 0; padding-bottom: 0; } .hud__grade strong { font-size: 22px; }
  .hud__meters { padding-bottom: 0; }
  .hud__meters { flex: 1; min-width: 0; } .meter div { width: auto; flex: 1; min-width: 60px; }
}
/* Handy quer: Tasten rechts bis an den unteren Rand (die Leiste unten liegt nur links), etwas kleiner, gleiche Spalten;
   Karte kleiner, damit sie nicht in die oberste Tastenreihe ragt */
@media (max-height: 520px) {
  .pad { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .pad__r { grid-template-columns: repeat(3, 64px); gap: 8px; }
  .pad__s { width: 52px; height: 52px; font-size: 12px; } .pad__b { width: 64px; height: 64px; font-size: 13px; }
  #hud-map { width: 100px; height: 100px; }
}

/* ----- Gymkhana ----- */
.gymlevel { margin-bottom: var(--s5); }
.card--gym { border-color: rgba(242, 100, 28, .55); background: linear-gradient(135deg, rgba(242, 100, 28, .16), transparent 55%), var(--card, rgba(255, 255, 255, .04)); max-width: 760px; }
.card--gym .card__foot { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gymtip { position: absolute; left: 50%; bottom: max(96px, 17%); transform: translate(-50%, 8px); max-width: min(560px, 86vw); padding: 10px 16px; border-radius: 14px; background: rgba(18, 20, 24, .82); color: #fff; font-size: 16px; line-height: 1.35; opacity: 0; transition: opacity .2s, transform .2s; text-align: center; }
.gymtip.is-on { opacity: 1; transform: translate(-50%, 0); }
.gymtip strong { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #ff9d5c; margin-bottom: 2px; }
.gympen { position: absolute; left: 50%; top: max(150px, calc(env(safe-area-inset-top) + 150px)); transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(18, 20, 24, .72); color: #fff; font-weight: 700; font-size: 14px; }
.gympen.is-bad { background: rgba(200, 32, 47, .88); }
/* Rad & Abstimmung vor dem Start */
.dialog--setup { width: min(760px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: hidden; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.setup { overflow-y: auto; display: grid; gap: 10px; padding: 2px 4px 2px 2px; overscroll-behavior: contain; }
.setup h3 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--soft); margin-top: 6px; }
.su-bikes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.su-tyres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.su-bike, .su-tyre { display: grid; gap: 3px; text-align: left; padding: 10px 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font: inherit; }
.su-bike small, .su-tyre small { font-size: 12px; opacity: .75; } .su-tyre span { font-size: 12px; opacity: .8; line-height: 1.35; }
.su-bike.is-on, .su-tyre.is-on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; background: var(--card); }
.su-range { display: grid; gap: 2px; font-size: 14px; font-weight: 700; }
.su-range output { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.su-range input[type=range] { width: 100%; height: 30px; padding: 0; border: 0; background: none; accent-color: var(--primary); }
.su-range small { display: flex; justify-content: space-between; gap: 12px; font-weight: 500; font-size: 12px; opacity: .7; } .su-range small i { font-style: normal; } .su-range small i:last-child { text-align: right; }
.su-susrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.su-sus { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 12px 10px; display: grid; gap: 8px; min-width: 0; } .su-sus legend { font-weight: 800; padding: 0 6px; font-size: 14px; }
.su-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.su-stat { display: inline-flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: var(--bg); font-size: 12.5px; }
.su-stat b { font-variant-numeric: tabular-nums; opacity: .6; } .su-stat.is-up b { color: #1f9d55; opacity: 1; } .su-stat.is-down b { color: #c8202f; opacity: 1; }
.su-foot { display: flex; justify-content: space-between; gap: 10px; }
@media (max-width: 620px) { .su-tyres { grid-template-columns: 1fr; } .dialog--setup { padding: var(--s4); } }
/* Trackstand: große Balance-Anzeige mitten im Bild */
.tsmeter { position: absolute; left: 50%; top: 31%; transform: translate(-50%, -6px) scale(.96); width: min(380px, 78vw); padding: 10px 14px 12px; border-radius: 16px; background: rgba(18, 20, 24, .8); color: #fff; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; box-shadow: 0 0 0 2px rgba(255, 210, 31, .85), 0 8px 28px rgba(0, 0, 0, .35); }
.tsmeter.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.tsmeter__l { font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; text-align: center; margin-bottom: 8px; color: #ffd21f; }
.tsmeter__bar { position: relative; height: 18px; border-radius: 9px; background: linear-gradient(90deg, #c8202f 0, #c8202f 12%, #e9a21a 26%, #2c9d5b 42%, #2c9d5b 58%, #e9a21a 74%, #c8202f 88%, #c8202f 100%); }
.tsmeter__zone { position: absolute; left: 42%; right: 42%; top: -3px; bottom: -3px; border: 2px solid rgba(255, 255, 255, .7); border-radius: 6px; }
.tsmeter__mid { position: absolute; left: 50%; top: -5px; bottom: -5px; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, .85); }
.tsmeter__dot { position: absolute; top: 50%; left: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: #fff; border: 3px solid #16181c; box-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.tsmeter__time { height: 6px; margin-top: 10px; border-radius: 3px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.tsmeter__time i { display: block; height: 100%; width: 0; background: #ffd21f; }
.tsmeter.is-good .tsmeter__time i { background: #35b56a; }
.tsmeter.is-edge { box-shadow: 0 0 0 3px rgba(233, 90, 26, .95), 0 8px 28px rgba(0, 0, 0, .35); }
.tsmeter.is-bad { box-shadow: 0 0 0 3px rgba(200, 32, 47, .95), 0 8px 28px rgba(0, 0, 0, .35); }
.tsmeter.is-bad .tsmeter__l { color: #ff8a8f; }
.hud.is-fly .tsmeter { opacity: 0; }
.hud.is-fly .gymtip, .hud.is-fly .gympen { opacity: 0; }
@media (max-width: 700px) { .gymtip { font-size: 14px; bottom: max(150px, 30%); } }
.gymset { border: 1px solid var(--line, rgba(255,255,255,.12)); border-radius: 12px; padding: 12px 14px; margin: 0 0 12px; } .gymset legend { font-weight: 700; padding: 0 6px; }
.tr-more { margin-top: 8px; } .tr-more summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }

/* ----- Touch-Geräte, die sich nicht als „grober Zeiger“ melden (iPad mit Tastatur/Trackpad/Stift) ----- */
.is-touch .pad { display: flex; }
.is-touch .hud__bottom { transform: scale(.8); transform-origin: left bottom; }
/* ----- Tablet: große Knöpfe auf Daumenhöhe (das Gerät wird seitlich gehalten, die Daumen liegen im unteren Drittel) ----- */
@media (min-width: 700px) and (min-height: 600px) {
  .is-tablet .pad { padding-bottom: max(16vh, calc(env(safe-area-inset-bottom) + 110px)); padding-inline: max(22px, env(safe-area-inset-left)) max(22px, env(safe-area-inset-right)); }
  .is-tablet .pad__l { gap: 20px; margin-bottom: 0; } .is-tablet .pad__l button { width: 124px; height: 124px; font-size: 44px; }
  .is-tablet .pad__knob { width: 50px; height: 7px; margin-left: -25px; transform: translateX(calc(var(--sx) * 104px)); }
  .is-tablet .pad__r { grid-template-columns: repeat(3, 112px); gap: 14px; }
  .is-tablet .pad__s { width: 84px; height: 84px; font-size: 16px; } .is-tablet .pad__b { width: 112px; height: 112px; font-size: 19px; }
}
