/* 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; }

/* ---------- 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%; }
.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-near { background: #f4f4f6; animation: jumpPulse .45s ease-in-out infinite alternate; }
@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); }
.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; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--primary); margin: 0 auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.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); }

@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-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s2); }
.bike__box { flex-direction: column; align-items: flex-start; text-align: left; gap: 4px; padding: var(--s4); font-weight: 400; height: 100%; justify-content: flex-start; }
.bike__box strong { font-size: 22px; line-height: 1.1; }
.bike__box small { font-size: 13px; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.bike__text { font-size: 15px; line-height: 1.35; color: var(--soft); margin: 6px 0 8px; }
.tile input:checked + .bike__box { color: var(--ink); }
.bike__stats { display: grid; grid-template-columns: max-content 1fr; gap: 4px 10px; width: 100%; font-size: 13px; align-items: center; margin-top: auto; }
.bike__stats span { display: contents; }
.bike__stats i { height: 6px; border-radius: 3px; 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); }
