/* RideSim v2: Graphit, Lime, Papier. SF Pro fuer Text, Barlow Condensed fuer grosse Zahlen und Titel. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --display: "Barlow Condensed", "SF Pro Display", -apple-system, sans-serif;
  --bg: #0d0e10;
  --panel: #131417;
  --card: #1a1c20;
  --card-2: #23262b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f4f5f0;
  --muted: rgba(244, 245, 240, 0.62);
  --faint: rgba(244, 245, 240, 0.38);
  --lime: #d4f83c;
  --lime-2: #bfe324;
  --lime-ink: #162000;
  --lime-soft: rgba(212, 248, 60, 0.14);
  --paper: #eceee6;
  --paper-ink: #121410;
  --paper-muted: rgba(18, 20, 16, 0.56);
  --violet: #a79bff;
  --ice: #8ec5ff;
  --amber: #ffb547;
  --red: #ff6b5b;
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --rail: 92px;
  --gap: 18px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden; font-size: 15px;
}
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.4; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; border-radius: 10px; }
.hidden { display: none !important; }
.num { font-family: var(--display); font-weight: 700; font-style: italic; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ico { width: 22px; height: 22px; flex: none; }

/* ---------- Welt ---------- */
#world { position: fixed; inset: 0; }
#world .cesium-viewer, #world .cesium-widget, #world canvas { width: 100%; height: 100%; }
#world .cesium-viewer-bottom, #world .cesium-widget-credits { display: none; }
#credits {
  position: fixed; left: calc(var(--rail) + 16px); bottom: 6px; z-index: 30;
  font-size: 10px; line-height: 1.2; color: rgba(255, 255, 255, 0.75); max-width: 46vw; display: none;
}
body.m-detail #credits, body.m-ride #credits { display: block; }
body.m-ride #credits { left: 16px; }
#credits a, #credits .cesium-credit-expand-link { color: inherit; }
#credits .cesium-credit-logoContainer img { height: 14px !important; width: auto !important; vertical-align: middle; }

/* ---------- App-Rahmen ---------- */
#app { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

/* ---------- Street-View-Modus ---------- */
#sv { position: fixed; inset: 0; z-index: 15; pointer-events: none; display: none; }
body.m-ride #sv.on { display: block; }
#sv .sv-layer { position: absolute; inset: 0; opacity: 0; transition: opacity 0.45s ease; overflow: hidden; background: #0d0e10; }
#sv:not(.covered) .sv-layer { opacity: 0 !important; transition-duration: 0.8s; }
#sv .sv-pano { position: absolute; inset: 0; }
#sv img { display: none; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s linear; }
#sv.sv-img img { display: block; }
#sv.sv-img .sv-pano { display: none; }
#sv .sv-hint { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); padding: 10px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity 0.4s ease; white-space: nowrap; }
#sv.on:not(.covered) .sv-hint { opacity: 1; }
#sv .sv-credit { position: absolute; right: 16px; bottom: 6px; font-size: 10px; color: rgba(255,255,255,0.7); display: none; }
#sv.sv-img.covered .sv-credit { display: block; }
#app > * { pointer-events: auto; }
body.m-ride #app, body.m-onboarding .rail, body.m-loading .rail { display: none; }
.rail {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--rail);
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 0 20px;
  background: rgba(13, 14, 16, 0.92); border-right: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.logo {
  width: 50px; height: 50px; border-radius: 17px; background: var(--lime); color: var(--lime-ink);
  display: grid; place-items: center; margin-bottom: 18px;
}
.logo .ico { width: 28px; height: 28px; stroke-width: 2.4; }
.nav-btn {
  width: 70px; padding: 9px 0 7px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--muted); font-size: 11px; font-weight: 500; transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn .ico { width: 24px; height: 24px; }
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.nav-btn.on { color: var(--lime-ink); background: var(--lime); }
.rail .spacer { flex: 1; }
.avatar {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  font-weight: 700; font-size: 17px; color: var(--lime-ink); background: var(--lime); flex: none;
  background-size: cover; background-position: center;
}

#view {
  position: absolute; left: var(--rail); right: 0; top: 0; bottom: 0; overflow-y: auto; overflow-x: hidden;
  padding: 30px 34px 48px; scroll-behavior: smooth;
}
body:not(.m-detail):not(.m-ride) #view { background: var(--bg); }
body.m-onboarding #view, body.m-loading #view { left: 0; padding: 0; }
.page { max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 64px; line-height: 0.9; letter-spacing: -0.005em; }
.page-head p { color: var(--muted); margin-top: 8px; font-size: 15px; }
.section-title { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin: 34px 0 14px; display: flex; align-items: center; justify-content: space-between; }
.section-title small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- Bausteine ---------- */
.card { position: relative; overflow: hidden; background: var(--card); border-radius: var(--r-xl); padding: 22px; }
.card.paper { background: var(--paper); color: var(--paper-ink); }
.card.paper .muted, .card.paper .label { color: var(--paper-muted); }
.card.lime { background: var(--lime); color: var(--lime-ink); }
.card.lime .muted, .card.lime .label { color: rgba(22, 32, 0, 0.62); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h3 { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.label { font-size: 12.5px; color: var(--muted); }
.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shade-b::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.78) 100%);
}
.shade-l::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(8, 9, 10, 0.92) 0%, rgba(8, 9, 10, 0.55) 45%, rgba(8, 9, 10, 0) 75%),
              linear-gradient(0deg, rgba(8, 9, 10, 0.6) 0%, rgba(8, 9, 10, 0) 40%);
}
.over { position: relative; z-index: 2; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.1); font-size: 13px; font-weight: 550; white-space: nowrap;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.chip .ico { width: 16px; height: 16px; }
.chip.lime { background: var(--lime); color: var(--lime-ink); }
.chip.dark { background: rgba(10, 11, 12, 0.6); }
.chip.paper { background: rgba(18, 20, 16, 0.08); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border-radius: 999px; background: rgba(255, 255, 255, 0.1); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:active { transform: scale(0.98); }
.btn .ico { width: 18px; height: 18px; }
.btn.lime { background: var(--lime); color: var(--lime-ink); }
.btn.lime:hover { background: #e0ff57; }
.btn.white { background: #fff; color: #0d0e10; }
.btn.small { height: 34px; padding: 0 13px; font-size: 13px; }
.btn.icon { width: 44px; padding: 0; }
.card.paper .btn { background: rgba(18, 20, 16, 0.08); }

/* Grosser Start-Knopf: Kreis links, Text, Pfeile */
.go {
  display: inline-flex; align-items: center; gap: 16px; height: 68px; padding: 0 26px 0 8px; border-radius: 999px;
  background: var(--lime); color: var(--lime-ink); font-size: 18px; font-weight: 700; letter-spacing: -0.01em;
  box-shadow: 0 14px 40px rgba(212, 248, 60, 0.28); transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.go:hover { box-shadow: 0 18px 50px rgba(212, 248, 60, 0.4); }
.go:active { transform: scale(0.985); }
.go .disc { width: 52px; height: 52px; border-radius: 50%; background: var(--lime-ink); color: var(--lime); display: grid; place-items: center; }
.go .disc .ico { width: 24px; height: 24px; }
.go .arrows { opacity: 0.55; margin-left: 4px; display: flex; }
.go .arrows .ico { width: 22px; height: 22px; }
.go.wide { width: 100%; justify-content: flex-start; }
.go.wide .arrows { margin-left: auto; }

.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }

.toggle { position: relative; width: 50px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); transition: background 0.2s ease; flex: none; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; }
.toggle.on { background: var(--lime); }
.toggle.on::after { transform: translateX(20px); }
.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }
.seg button { height: 34px; padding: 0 13px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--lime); color: var(--lime-ink); }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--muted); }
.input {
  height: 50px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.05);
  padding: 0 16px; font-size: 16px; outline: none; width: 100%;
}
.input:focus { border-color: var(--lime); }
.input-unit { position: relative; }
.input-unit .input { padding-right: 48px; }
.input-unit i { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; color: var(--muted); font-size: 14px; }

/* ---------- Dashboard ---------- */
.dash { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }

.hello { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.hello h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 60px; line-height: 0.9; }
.hello p { color: var(--muted); margin-top: 8px; }

.hero { min-height: 470px; padding: 32px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero .top { position: absolute; z-index: 2; top: 26px; left: 28px; right: 28px; display: flex; justify-content: space-between; }
.hero h2 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(76px, 8vw, 132px); line-height: 0.86; letter-spacing: -0.01em; }
.hero p { max-width: 46ch; color: rgba(244, 245, 240, 0.8); margin: 12px 0 22px; line-height: 1.45; }
.hero .stats { display: flex; gap: 30px; margin-bottom: 26px; }
.stat-big { display: flex; flex-direction: column; }
.stat-big b { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 42px; line-height: 1; }
.stat-big span { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.card.paper .stat-big span { color: var(--paper-muted); }

.levelcard { display: flex; flex-direction: column; gap: 18px; }
.level-ring { position: relative; width: 168px; height: 168px; margin: 4px auto 0; }
.level-ring svg { width: 100%; height: 100%; }
.level-ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.level-ring .center b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 64px; line-height: 0.9; }
.level-ring .center span { font-size: 12.5px; color: var(--muted); }
.level-meta { text-align: center; }
.level-meta h3 { font-size: 19px; font-weight: 650; }
.level-meta p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.mini-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mini { border-radius: var(--r-md); background: var(--card-2); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.mini .ico { width: 20px; height: 20px; color: var(--lime); margin-bottom: 4px; }
.mini b { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 30px; line-height: 1; }
.mini span { font-size: 12px; color: var(--muted); }

.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 150px; margin-top: 6px; }
.bar { display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar i { width: 100%; max-width: 30px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); position: relative; overflow: hidden; height: 100%; }
.bar i b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 10px; background: var(--lime); }
.bar span { font-size: 12px; color: var(--muted); }
.bar.today span { color: var(--text); font-weight: 650; }
.week-sum { display: flex; gap: 24px; margin-top: 16px; }

.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px 4px; text-align: center; }
.cal .dow { font-size: 11.5px; color: var(--muted); padding-bottom: 4px; }
.cal .d { position: relative; height: 36px; display: grid; place-items: center; font-size: 13.5px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.cal .d.out { color: var(--faint); }
.cal .d.ride::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--lime); }
.cal .d.today { background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.cal .d.today.ride::after { background: var(--lime-ink); }

.challenge { display: flex; flex-direction: column; justify-content: space-between; min-height: 300px; }
.challenge .ringbox { position: relative; width: 130px; height: 130px; margin: 10px auto; }
.challenge .ringbox .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.challenge .ringbox b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 40px; line-height: 0.9; display: block; }

.list { display: flex; flex-direction: column; gap: 10px; }
.act-row {
  display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 16px; padding: 10px 14px 10px 10px;
  border-radius: var(--r-lg); background: var(--card-2); text-align: left; width: 100%; transition: background 0.15s ease;
}
.act-row:hover { background: #2a2d33; }
.act-row .thumb { width: 64px; height: 64px; border-radius: 16px; background: #0f1012; overflow: hidden; display: grid; place-items: center; }
.act-row .thumb svg { width: 100%; height: 100%; }
.act-row h4 { font-size: 16px; font-weight: 650; }
.act-row .meta { font-size: 13px; color: var(--muted); margin-top: 3px; display: flex; gap: 12px; flex-wrap: wrap; }
.act-row .right { display: flex; align-items: center; gap: 8px; }
.empty { padding: 28px; border-radius: var(--r-lg); border: 1px dashed var(--line-2); color: var(--muted); text-align: center; line-height: 1.5; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 9px; text-align: center; padding: 14px 6px 12px; border-radius: var(--r-lg); background: var(--card-2); }
.badge .medal { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: var(--faint); position: relative; }
.badge .medal .ico { width: 28px; height: 28px; }
.badge.got .medal { background: var(--lime); color: var(--lime-ink); box-shadow: 0 8px 26px rgba(212, 248, 60, 0.25); }
.badge.new .medal::after { content: "Neu"; position: absolute; top: -6px; right: -12px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: #fff; color: #0d0e10; }
.badge b { font-size: 12.5px; font-weight: 650; line-height: 1.25; }
.badge small { font-size: 11px; color: var(--muted); line-height: 1.3; }
.badge .prog { width: 70%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.badge .prog i { display: block; height: 100%; background: var(--lime); border-radius: 4px; }
.badges.strip { grid-template-columns: repeat(4, 1fr); }

/* ---------- Strecken ---------- */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: var(--gap); }
.rcard { padding: 0; text-align: left; display: flex; flex-direction: column; transition: transform 0.18s ease; width: 100%; }
.rcard:hover { transform: translateY(-3px); }
.rcard .pic { position: relative; height: 230px; overflow: hidden; background: #16181b; }
.rcard .pic img { transition: transform 0.6s ease; }
.rcard:hover .pic img { transform: scale(1.04); }
.rcard .pic .name {
  position: absolute; z-index: 2; left: 20px; bottom: 14px; right: 20px;
  font-family: var(--display); font-style: italic; font-weight: 800; font-size: 56px; line-height: 0.88;
}
.rcard .pic .tl { position: absolute; z-index: 2; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; gap: 8px; }
.rcard .body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.rcard .desc { font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.rcard .row { display: flex; gap: 22px; }
.rcard .row div { display: flex; flex-direction: column; }
.rcard .row b { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 28px; line-height: 1; }
.rcard .row span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rcard svg.prof { width: 100%; height: 44px; display: block; }
.add-card { border: 1.5px dashed var(--line-2); background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 420px; color: var(--muted); }
.add-card .disc { width: 64px; height: 64px; border-radius: 50%; background: var(--lime); color: var(--lime-ink); display: grid; place-items: center; }
.add-card b { color: var(--text); font-size: 17px; }

/* ---------- Strecken-Detail ueber der 3D-Welt ---------- */
body.m-detail #view { background: transparent; padding: 0; overflow: hidden; }
.detail { position: absolute; inset: 0; pointer-events: none; }
.detail > * { pointer-events: auto; }
.detail .scrim { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%), linear-gradient(0deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 35%); }
.detail .back { position: absolute; top: 26px; left: 28px; }
.detail .title { position: absolute; left: 32px; bottom: 92px; max-width: calc(100% - 520px); pointer-events: none; }
.detail .title h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(90px, 11vw, 170px); line-height: 0.9; padding-right: 0.08em; text-shadow: 0 10px 40px rgba(0,0,0,0.4); }
.detail .title p { margin-top: 14px; text-shadow: 0 2px 14px rgba(0,0,0,0.6); font-size: 17px; color: rgba(244,245,240,0.85); max-width: 48ch; }
.dpanel {
  position: absolute; top: 18px; right: 18px; bottom: 18px; width: 440px; border-radius: var(--r-xl);
  background: rgba(19, 20, 23, 0.82); -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
  border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden;
}
.dpanel .scroll { flex: 1; overflow-y: auto; padding: 24px 24px 12px; display: flex; flex-direction: column; gap: 18px; }
.dpanel .foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border-radius: var(--r-md); background: rgba(255,255,255,0.05); padding: 13px 14px; display: flex; flex-direction: column; }
.tile b { font-family: var(--display); font-style: italic; font-weight: 700; font-size: 30px; line-height: 1; }
.tile span { font-size: 12px; color: var(--muted); margin-top: 3px; }
.profile-svg { width: 100%; height: 120px; display: block; }
.climb { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 11px 12px; border-radius: var(--r-md); background: rgba(255,255,255,0.05); }
.cat { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 20px; background: rgba(255,255,255,0.08); }
.cat.c1, .cat.cHC { background: var(--lime); color: var(--lime-ink); }
.cat .ico { width: 20px; height: 20px; opacity: 0.7; }
.cat.c2 { background: rgba(212,248,60,0.55); color: var(--lime-ink); }
.climb h5 { font-size: 14.5px; font-weight: 650; }
.climb p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.climb .pb { font-size: 13px; font-weight: 600; text-align: right; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.opt:last-child { border-bottom: 0; }
.opt h5 { font-size: 14.5px; font-weight: 600; }
.opt p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.mapthumb { border-radius: var(--r-lg); overflow: hidden; height: 190px; position: relative; background: #111; }
.mapthumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Erfolge ---------- */
.trophy-hero { min-height: 300px; display: flex; align-items: flex-end; padding: 30px; gap: 30px; }
.trophy-hero .photo { object-position: 50% 34%; transform: scaleX(-1); }
.trophy-hero .level-ring { margin: 0; width: 180px; height: 180px; }
.trophy-hero h2 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 72px; line-height: 0.88; }
.totals { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--gap); }
.totals .card { padding: 20px; }
.totals b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 46px; line-height: 1; display: block; }
.totals span { font-size: 13px; color: var(--muted); }
.everest { margin-top: 14px; height: 10px; border-radius: 10px; background: rgba(18,20,16,0.12); overflow: hidden; }
.everest i { display: block; height: 100%; background: var(--paper-ink); border-radius: 10px; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pr-table td { padding: 12px 6px; border-bottom: 1px solid var(--line); }
.pr-table td:last-child { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---------- Profil ---------- */
.profile-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--gap); align-items: start; }
.me { display: flex; align-items: center; gap: 22px; }
.me .avatar { width: 96px; height: 96px; font-size: 38px; cursor: pointer; }
.me h2 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 52px; line-height: 0.9; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.dev { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--r-lg); background: var(--card-2); }
.dev + .dev { margin-top: 10px; }
.dev .di { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: rgba(255,255,255,0.07); color: var(--muted); flex: none; }
.dev.ok .di { background: var(--lime); color: var(--lime-ink); }
.dev .dt { flex: 1; min-width: 0; }
.dev .dt h5 { font-size: 15px; font-weight: 650; }
.dev .dt p { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.people { display: flex; gap: 10px; flex-wrap: wrap; }
.person { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--card-2); font-weight: 600; font-size: 14px; }
.person .avatar { width: 34px; height: 34px; font-size: 14px; }
.person.on { background: var(--lime); color: var(--lime-ink); }
.person.on .avatar { background-color: var(--lime-ink); color: var(--lime); }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: rgba(255,255,255,0.07); padding: 2px 6px; border-radius: 6px; }
.steps { margin: 10px 0 0 18px; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------- Willkommen ---------- */
.onb { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 7vw; }
.onb .content { position: relative; z-index: 2; width: min(520px, 100%); }
.onb h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(72px, 8vw, 120px); line-height: 0.86; margin: 26px 0 16px; }
.onb p { color: rgba(244,245,240,0.82); font-size: 17px; line-height: 1.5; max-width: 42ch; }
.onb .form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 30px 0 26px; }
.onb .form .field:first-child { grid-column: span 2; }
.brandline { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
.brandline .logo { margin: 0; width: 44px; height: 44px; border-radius: 15px; }
.onb .rider-art { position: absolute; right: 4vw; bottom: 6vh; width: min(560px, 42vw); z-index: 2; filter: drop-shadow(0 30px 60px rgba(0,0,0,0.5)); }

/* ---------- Meldungen ---------- */
.toast {
  position: fixed; top: 22px; left: 50%; z-index: 80; transform: translate(-50%, -14px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  background: rgba(24, 26, 30, 0.92); border: 1px solid var(--line-2); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: opacity 0.25s ease, transform 0.25s ease; white-space: nowrap; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ico { width: 18px; height: 18px; color: var(--lime); }
.bigtoast {
  position: fixed; top: 110px; left: 50%; z-index: 85; transform: translate(-50%, -10px) scale(0.96); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 16px; padding: 16px 24px 16px 16px; border-radius: 28px;
  background: var(--lime); color: var(--lime-ink); box-shadow: 0 24px 80px rgba(212, 248, 60, 0.35);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.2,1.4,.4,1);
}
.bigtoast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.bigtoast .disc { width: 56px; height: 56px; border-radius: 50%; background: var(--lime-ink); color: var(--lime); display: grid; place-items: center; }
.bigtoast .disc .ico { width: 28px; height: 28px; }
.bigtoast small { font-size: 12.5px; font-weight: 600; opacity: 0.7; display: block; }
.bigtoast b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 34px; line-height: 1; }
.loader {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 90; display: none; align-items: center; gap: 12px;
  padding: 12px 20px 12px 14px; border-radius: 999px; font-size: 14px; font-weight: 550;
  background: rgba(24, 26, 30, 0.92); border: 1px solid var(--line-2);
}
body.is-busy .loader { display: flex; }
.loader.error { white-space: normal; max-width: min(620px, 92vw); border-color: rgba(255, 107, 91, 0.6); }
.spinner { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--lime); animation: spin 0.9s linear infinite; }
.loader.error .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash { position: absolute; inset: 0; display: grid; place-items: center; background: var(--bg); }
.splash .logo { width: 72px; height: 72px; border-radius: 24px; animation: pulse 1.4s ease-in-out infinite; }
.splash .logo .ico { width: 40px; height: 40px; }
@keyframes pulse { 50% { transform: scale(0.92); opacity: 0.7; } }

/* ---------- Fahrt ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: none; }
body.m-ride #hud { display: block; }
#hud > * { pointer-events: auto; }
#hud .vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,0.38) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 62%, rgba(0,0,0,0.6) 100%); }
.glass {
  background: rgba(16, 17, 20, 0.58); -webkit-backdrop-filter: blur(26px) saturate(170%); backdrop-filter: blur(26px) saturate(170%);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.h-left { position: absolute; top: 20px; left: 20px; width: 290px; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.h-left > * { pointer-events: auto; }
.h-route { border-radius: 26px; padding: 16px 18px; }
.h-route .label { display: flex; align-items: center; gap: 8px; }
.h-route .big { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.h-route .big b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 50px; line-height: 0.9; }
.h-route .big span { color: var(--muted); font-size: 13.5px; }
.h-route .sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.h-climb { border-radius: 26px; padding: 15px 18px 16px; display: none; }
.h-climb.on { display: block; }
.h-climb .row { display: flex; align-items: center; gap: 10px; }
.h-climb .cat { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; }
.h-climb h5 { font-size: 14px; font-weight: 650; }
.h-climb p { font-size: 12.5px; color: var(--muted); }
.h-climb .track { height: 8px; border-radius: 8px; background: rgba(255,255,255,0.12); margin: 12px 0 8px; overflow: hidden; }
.h-climb .track i { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 8px; transition: width 0.3s linear; }
.h-climb .times { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.h-grade {
  position: absolute; top: 20px; left: 50%; transform: translateX(-50%); height: 60px; padding: 0 24px; border-radius: 999px;
  display: flex; align-items: center; gap: 4px;
}
.h-grade b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 40px; line-height: 1; }
.h-grade span { font-size: 16px; color: var(--muted); margin-left: 2px; }
.h-grade.up b { color: #e9ff9a; } .h-grade.steep b { color: var(--lime); } .h-grade.down b { color: var(--ice); }
.h-grade.steep { background: rgba(40, 52, 4, 0.7); }
.h-tools { position: absolute; top: 20px; right: 20px; display: flex; gap: 10px; }
.h-tools .seg { background: rgba(16,17,20,0.58); -webkit-backdrop-filter: blur(26px); backdrop-filter: blur(26px); border: 1px solid rgba(255,255,255,0.1); height: 60px; align-items: center; padding: 6px; }
.h-tools .seg button { height: 46px; padding: 0 16px; }
.roundbtn { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; }
.roundbtn .ico { width: 22px; height: 22px; }

.h-side { position: absolute; right: 20px; top: 104px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.boost-slot {
  width: 86px; height: 86px; border-radius: 50%; display: grid; place-items: center; position: relative;
  border: 2px dashed rgba(255,255,255,0.25); background: rgba(16,17,20,0.45); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.boost-slot .ico { width: 34px; height: 34px; color: var(--faint); }
.boost-slot.full { border: 0; background: var(--bc, var(--lime)); box-shadow: 0 0 0 6px rgba(255,255,255,0.08), 0 10px 40px var(--bc, var(--lime)); animation: glow 1.6s ease-in-out infinite; }
.boost-slot.full .ico { color: #111; }
.boost-slot.active { animation: none; }
.boost-slot svg.timer { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); }
.boost-slot kbd { position: absolute; bottom: -9px; padding: 2px 8px; border-radius: 8px; font: 700 11px var(--font); background: #fff; color: #111; }
@keyframes glow { 50% { box-shadow: 0 0 0 10px rgba(255,255,255,0.05), 0 10px 50px var(--bc, var(--lime)); } }
.pill-stat { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 12px; border-radius: 999px; font-size: 14px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pill-stat .ico { width: 18px; height: 18px; }
.pill-stat.ahead { color: var(--lime); } .pill-stat.behind { color: var(--amber); } .pill-stat.violet .ico { color: var(--violet); }

.h-bottom { position: absolute; left: 20px; right: 20px; bottom: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.h-bottom > * { pointer-events: auto; }
.metrics { width: min(1320px, 100%); display: grid; grid-template-columns: 1.55fr 1.15fr 1fr 1fr 1fr 0.85fr 1.3fr; gap: 6px; padding: 8px; border-radius: 30px; }
.m { padding: 12px 16px; border-radius: 23px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.m .v { display: flex; align-items: baseline; gap: 5px; }
.m .v b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 46px; line-height: 0.92; }
.m .v span { font-size: 13px; color: var(--muted); }
.m .l { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 8px; }
.m.power { background: var(--zc, var(--lime)); color: #101114; transition: background 0.5s ease; }
.m.power .v b { font-size: 60px; }
.m.power .v span, .m.power .l { color: rgba(22,32,0,0.62); }
.m.speed { position: relative; align-items: center; text-align: center; }
.m.speed svg { position: absolute; left: 50%; top: 4px; width: 150px; height: 82px; transform: translateX(-50%); }
.m.speed .v { justify-content: center; margin-top: 18px; }
.m.speed .l { justify-content: center; }
.m.gear { flex-direction: row; align-items: center; gap: 8px; }
.m.gear button { width: 44px; height: 44px; border-radius: 15px; background: rgba(255,255,255,0.1); display: grid; place-items: center; flex: none; }
.m.gear button:hover { background: rgba(255,255,255,0.18); }
.m.gear button .ico { width: 18px; height: 18px; }
.m.gear .mid { flex: 1; display: flex; flex-direction: column; align-items: center; }
.bump { animation: bump 0.3s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }
.h-profile { width: min(1180px, 100%); height: 92px; border-radius: 24px; padding: 8px 14px; }
.h-profile canvas { width: 100%; height: 100%; display: block; }
.h-xp { position: absolute; left: 20px; bottom: 236px; display: flex; gap: 8px; }

.pause-card { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 400px; padding: 30px; border-radius: 34px; text-align: center; display: none; }
body.is-paused .pause-card { display: block; }
.pause-card h3 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 64px; line-height: 0.9; }
.pause-card p { color: var(--muted); font-size: 14px; margin-top: 10px; line-height: 1.45; }
.pause-card .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }

/* ---------- Auswertung ---------- */
.summary { max-width: 1240px; margin: 0 auto; }
.sum-hero { min-height: 380px; padding: 34px; display: flex; flex-direction: column; justify-content: flex-end; }
.sum-hero h1 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(80px, 9vw, 140px); line-height: 0.84; }
.sum-hero .when { color: rgba(244,245,240,0.8); margin-top: 10px; }
.sum-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); margin-top: var(--gap); }
.sum-grid .card { padding: 18px 20px; }
.sum-grid b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 44px; line-height: 1; display: block; }
.sum-grid span { font-size: 12.5px; color: var(--muted); }
.xpbar { height: 14px; border-radius: 14px; background: rgba(22,32,0,0.15); overflow: hidden; margin: 14px 0 8px; }
.xpbar i { display: block; height: 100%; width: 0; background: var(--lime-ink); border-radius: 14px; transition: width 1.6s cubic-bezier(.2,.8,.2,1); }
.chart { width: 100%; height: 220px; display: block; }
.actions-row { display: flex; gap: 10px; flex-wrap: wrap; }

@media (max-width: 1280px) {
  .span-3, .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8 { grid-column: span 12; }
  .totals { grid-template-columns: repeat(3, 1fr); }
  .sum-grid { grid-template-columns: repeat(3, 1fr); }
  .profile-grid { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 760px) {
  :root { --rail: 0px; }
  .rail { display: none; }
  #view { padding: 20px 16px 40px; }
  .span-3, .span-4, .span-5 { grid-column: span 12; }
  .dpanel { left: 12px; right: 12px; width: auto; top: auto; height: 60vh; }
  .detail .title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}


/* ---------- Gruppe im HUD ---------- */
.h-group { border-radius: 24px; padding: 12px 12px 8px; display: none; cursor: pointer; }
.h-group.on { display: block; }
.hg-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--muted); padding: 0 4px 8px; }
.hg-head .ico { width: 16px; height: 16px; color: var(--lime); }
.hg-head span { flex: 1; letter-spacing: 0.04em; }
.hg-head kbd, .boost-slot kbd { font: 700 10.5px var(--sans, -apple-system, sans-serif); padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,0.12); color: var(--text); }
.hg-row { display: grid; grid-template-columns: 18px 10px 1fr auto; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 12px; font-size: 13.5px; }
.hg-row b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 17px; text-align: center; }
.hg-row i { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0,0,0,0.35); }
.hg-row span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.hg-row em { font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 4px; }
.hg-row em .ico { width: 14px; height: 14px; color: var(--lime); }
.hg-row.me { background: rgba(212, 248, 60, 0.14); }
.hg-row.me em { color: var(--lime); }
.pill-stat.draft { display: none; color: #8ec5ff; }
.pill-stat.draft.on { display: flex; animation: pulse-in 0.3s ease; }
@keyframes pulse-in { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#xpPill .x2 { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: #c08bff; color: #160c28; font-size: 12px; }

/* ---------- Countdown ---------- */
.countdown { position: fixed; inset: 0; z-index: 95; display: none; place-items: center; background: radial-gradient(circle at center, rgba(8,9,10,0.35), rgba(8,9,10,0.82)); pointer-events: none; }
.countdown.on { display: grid; }
.cd-inner { text-align: center; }
.cd-inner small { display: block; font-size: 15px; font-weight: 650; color: var(--lime); letter-spacing: 0.12em; text-transform: uppercase; }
.cd-inner b { display: block; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 220px; line-height: 0.95; color: #fff; text-shadow: 0 20px 80px rgba(212,248,60,0.35); }
.cd-inner b.tick { animation: cd-pop 0.9s ease-out; }
.cd-inner span { display: block; font-size: 15px; color: var(--muted); margin-top: 6px; }
@keyframes cd-pop { from { transform: scale(1.35); opacity: 0.2; } 30% { opacity: 1; } to { transform: scale(1); } }

/* ---------- Dialog ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; background: rgba(6,7,8,0.66); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal.on { display: grid; }
.modal-card { width: min(460px, calc(100vw - 32px)); border-radius: 30px; padding: 28px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 30px 90px rgba(0,0,0,0.5); }
.modal-card h3 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 40px; line-height: 0.95; }
.modal-card p { color: var(--muted); font-size: 14px; margin: 10px 0 18px; line-height: 1.45; }
.code-input { width: 100%; font: 800 italic 44px var(--display); letter-spacing: 0.22em; text-transform: uppercase; text-align: center; padding: 12px; border-radius: 20px; background: #0d0e10; color: var(--lime); border: 1.5px solid var(--line-2); outline: none; }
.code-input:focus { border-color: var(--lime); }
.modal-card .row { display: flex; gap: 10px; margin-top: 18px; }
.modal-card .row > * { flex: 1; justify-content: center; }
.modal-card .err { color: #ff6b6b; font-size: 13px; min-height: 18px; margin-top: 8px; }

/* ---------- Garage ---------- */
.section-title { font-size: 19px; font-weight: 650; margin: 30px 0 14px; letter-spacing: -0.01em; }
.garage-hero { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; padding: 34px; min-height: 380px; align-items: center;
  background: radial-gradient(120% 140% at 80% 30%, #23262b 0%, #15171a 55%, #101113 100%); }
.gh-text h2 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 86px; line-height: 0.9; margin: 14px 0 12px; }
.gh-text p { color: var(--muted); font-size: 15px; line-height: 1.5; max-width: 42ch; }
.gh-stats { margin: 22px 0 18px; display: grid; gap: 10px; max-width: 360px; }
.gh-meta { display: flex; gap: 28px; }
.gh-meta b { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 34px; display: block; line-height: 1; }
.gh-meta span { font-size: 12.5px; color: var(--muted); }
.gh-art { position: relative; display: grid; place-items: center; }
.gh-art img { position: relative; width: min(100%, 470px); filter: drop-shadow(0 30px 40px rgba(0,0,0,0.55)); }
.gh-art .glow { position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--jc) 38%, transparent) 0%, transparent 65%); filter: blur(10px); }
.gs { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.gs i { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.gs b { height: 6px; border-radius: 6px; background: rgba(255,255,255,0.1); }
.gs b.on { background: var(--lime); }
.bike-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.bike-card { padding: 16px 18px 18px; text-align: left; display: flex; flex-direction: column; gap: 10px; border: 1.5px solid transparent; transition: transform 0.18s ease, border-color 0.18s ease; }
.bike-card:hover:not(.locked) { transform: translateY(-3px); }
.bike-card.on { border-color: var(--lime); background: linear-gradient(180deg, rgba(212,248,60,0.08), var(--card) 60%); }
.bike-card.locked { opacity: 0.55; cursor: not-allowed; }
.bike-card.locked img { filter: grayscale(1) brightness(0.6); }
.bc-top { display: flex; justify-content: space-between; align-items: center; }
.bc-top .kg { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bike-card img { width: 100%; aspect-ratio: 14 / 8; object-fit: cover; object-position: center 20%; border-radius: 16px; background: #0d0e10; }
.bike-card h4 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 30px; line-height: 1; }
.bc-stats { display: grid; gap: 7px; }
.bc-stats .gs { grid-template-columns: 90px 1fr; font-size: 12px; }
.jersey-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--gap); }
.jersey { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: 22px; background: var(--card); border: 1.5px solid transparent; text-align: left; transition: transform 0.18s ease; }
.jersey:hover:not(.locked) { transform: translateY(-2px); }
.jersey i { width: 54px; height: 54px; border-radius: 18px; background: var(--jc); display: grid; place-items: center; color: #101114; margin-bottom: 8px; box-shadow: 0 10px 30px color-mix(in srgb, var(--jc) 30%, transparent); }
.jersey i .ico { width: 22px; height: 22px; }
.jersey b { font-size: 15px; }
.jersey span { font-size: 12.5px; color: var(--muted); }
.jersey.on { border-color: var(--jc); }
.jersey.locked { opacity: 0.5; cursor: not-allowed; }
.jersey.locked i { background: rgba(255,255,255,0.08); color: var(--muted); box-shadow: none; }
.garage-link { width: 100%; justify-content: flex-start; height: 50px; }
.garage-link .muted { margin-left: auto; font-size: 12.5px; }

/* ---------- Tagesmissionen ---------- */
.missions .m-list { display: grid; gap: 12px; }
.m-row { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 12px; border-radius: 20px; background: rgba(255,255,255,0.04); }
.m-ico { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: rgba(255,255,255,0.07); color: var(--lime); }
.m-ico .ico { width: 21px; height: 21px; }
.m-row.ok .m-ico { background: var(--lime); color: var(--lime-ink); }
.m-top { display: flex; justify-content: space-between; gap: 10px; font-size: 14.5px; }
.m-top em { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--lime); white-space: nowrap; }
.m-track { height: 7px; border-radius: 7px; background: rgba(255,255,255,0.1); margin: 9px 0 6px; overflow: hidden; }
.m-track i { display: block; height: 100%; border-radius: 7px; background: var(--lime); transition: width 0.6s ease; }
.m-row small { font-size: 12px; color: var(--muted); }
.m-row.ok .m-top b { text-decoration: line-through; text-decoration-color: rgba(212,248,60,0.6); color: var(--muted); }
.m-foot { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 14px; }
.m-foot .ico { width: 15px; height: 15px; }

/* ---------- Gruppenfahrt: Karte ---------- */
.group-card { min-height: 290px; display: flex; flex-direction: column; justify-content: flex-end; }
.group-card .photo { object-position: center 35%; }
.gc-over h3 { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 46px; line-height: 0.95; margin: 12px 0 8px; }
.gc-over p { font-size: 14px; color: rgba(244,245,240,0.85); max-width: 38ch; }
.gc-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.group-card.lime { justify-content: space-between; }
.group-card.lime p { color: rgba(22,32,0,0.7); font-size: 14px; }
.gc-code { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 64px; letter-spacing: 0.08em; line-height: 1; margin: 8px 0; }
.head-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Gruppenfahrt: Lobby im Strecken-Detail ---------- */
.grp-box:empty { display: none; }
.grp-empty { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; padding: 14px; border-radius: 22px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); }
.ge-ico { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: rgba(212,248,60,0.14); color: var(--lime); }
.ge-ico .ico { width: 22px; height: 22px; }
.grp-empty h5 { font-size: 14.5px; font-weight: 650; }
.grp-empty p { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.ge-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.ge-actions .btn { flex: 1; justify-content: center; }
.grp-room { padding: 16px; border-radius: 22px; background: linear-gradient(160deg, rgba(212,248,60,0.16), rgba(212,248,60,0.04)); border: 1px solid rgba(212,248,60,0.35); }
.gr-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gr-code { font-family: var(--display); font-style: italic; font-weight: 800; font-size: 44px; letter-spacing: 0.1em; color: var(--lime); line-height: 1; margin-top: 4px; }
.gr-list { display: grid; gap: 6px; margin: 14px 0 10px; }
.gr-rider { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 14px; background: rgba(0,0,0,0.25); font-size: 13.5px; animation: pulse-in 0.3s ease; }
.gr-rider i { width: 12px; height: 12px; border-radius: 50%; }
.gr-rider b em { font-style: normal; font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--lime); color: var(--lime-ink); margin-left: 6px; }
.gr-rider span { color: var(--muted); font-size: 12px; }
.gr-rider.me { background: rgba(0,0,0,0.4); }
.gr-hint { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.link-btn { background: none; border: 0; color: var(--muted); font-size: 12.5px; text-decoration: underline; padding: 8px 0 0; cursor: pointer; }
.go.is-disabled { opacity: 0.55; cursor: default; }

@media (max-width: 1100px) {
  .bike-grid { grid-template-columns: repeat(2, 1fr); }
  .jersey-row { grid-template-columns: repeat(3, 1fr); }
  .garage-hero { grid-template-columns: 1fr; }
}

.group-card .shade-b::after { background: linear-gradient(180deg, rgba(0,0,0,0) 15%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0.92) 100%); }

.gh-art model-viewer { position: relative; width: 100%; height: 420px; background: transparent; }
.gh-hint { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.gh-hint .ico { width: 14px; height: 14px; }
.gh-text .chip + .chip { margin-left: 6px; }
.bike-card.locked { opacity: 0.7; cursor: pointer; }
.bike-card.viewing { box-shadow: 0 0 0 1.5px rgba(255,255,255,0.35) inset; }
.bc-3d { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.bc-3d .ico { width: 15px; height: 15px; }
.bike-card:hover .bc-3d { color: var(--lime); }

.gh-art model-viewer::part(default-progress-bar) { display: none; }

/* ---------- Sprint, Wind, Gegenwind ---------- */
.h-sprint { border-radius: 26px; padding: 15px 18px 16px; display: none; border: 1px solid rgba(75,227,162,0.45); }
.h-sprint.on { display: block; animation: pulse-in 0.3s ease; }
.h-sprint .row { display: flex; align-items: center; gap: 10px; }
.sp-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: #4be3a2; color: #06281a; }
.sp-ico .ico { width: 20px; height: 20px; }
.h-sprint h5 { font-size: 14px; font-weight: 650; }
.h-sprint p { font-size: 12.5px; color: var(--muted); }
.h-sprint .track { height: 8px; border-radius: 8px; background: rgba(255,255,255,0.12); margin: 12px 0 8px; overflow: hidden; }
.h-sprint .track i { display: block; height: 100%; width: 0; background: #4be3a2; border-radius: 8px; transition: width 0.15s linear; }
.h-sprint .times { display: flex; justify-content: space-between; font-size: 13px; font-variant-numeric: tabular-nums; }
.pill-stat.hidden { display: none; }
.pill-stat.wind .warrow { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.12); transition: transform 0.5s ease; }
.pill-stat.wind .warrow .ico { width: 14px; height: 14px; }
.pill-stat.wind.head { color: #ffb4a8; }
.pill-stat.wind.tail { color: #9fe7c4; }
.pill-stat.debuff { color: #ff8a8a; border: 1px solid rgba(255,90,90,0.5); animation: pulse-in 0.3s ease; }
.gr-btns { display: flex; gap: 6px; }

/* ---------- Training ---------- */
.train-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: var(--gap); margin-bottom: 28px; }
.ftp-big { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 18px; }
.ftp-big b { font: 800 italic 76px/0.9 var(--display); color: var(--lime); letter-spacing: -0.01em; }
.ftp-big b.sm { font-size: 40px; color: var(--text); margin-left: 18px; }
.ftp-big span { color: var(--muted); font-size: 14px; }
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.zr { display: grid; grid-template-columns: 10px 28px 1fr auto; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.zr i { width: 10px; height: 10px; border-radius: 3px; }
.zr b { font-weight: 700; }
.zr span { color: var(--muted); }
.zr em { font-style: normal; font-variant-numeric: tabular-nums; }
.ramp-card { position: relative; overflow: hidden; min-height: 320px; display: flex; align-items: flex-end; cursor: pointer; padding: 26px; }
.ramp-card .photo { object-position: center 40%; transition: transform 0.6s ease; }
.ramp-card:hover .photo { transform: scale(1.04); }
.ramp-card h3 { font: 800 italic 54px/0.95 var(--display); margin: 12px 0 8px; }
.ramp-card p { max-width: 420px; color: rgba(255,255,255,0.8); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.wo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--gap); }
.wo-card { text-align: left; display: flex; flex-direction: column; gap: 10px; transition: transform 0.18s ease, background 0.18s ease; }
.wo-card:hover { transform: translateY(-3px); background: var(--card-2); }
.wo-card h4 { font: 800 italic 30px/1 var(--display); }
.wo-card p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.wo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.wo-svg { width: 100%; height: 72px; display: block; border-radius: 12px; background: #0d0e10; }
.wo-svg.big { height: 110px; margin: 14px 0; }
.wo-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.wo-facts div { padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,0.05); display: flex; flex-direction: column; gap: 2px; }
.wo-facts b { font: 800 italic 26px/1 var(--display); }
.wo-facts span { font-size: 12px; color: var(--muted); }
.chip.red { background: var(--red); color: #2a0600; }
select.input { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23d4f83c' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
select.input option { background: #1a1c20; color: var(--text); }

/* Workout im HUD */
.h-workout { display: none; width: min(1180px, 100%); padding: 12px 16px 12px; border-radius: 26px; }
.h-workout.on { display: block; }
.hw-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.hw-label { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; }
.hw-label i { width: 12px; height: 12px; border-radius: 4px; }
.hw-label span { color: var(--muted); font-weight: 500; font-size: 13px; }
.hw-diff { font-size: 13px; font-weight: 650; padding: 4px 10px; border-radius: 999px; }
.hw-diff.ok { background: var(--lime); color: var(--lime-ink); }
.hw-diff.off { background: rgba(255,181,71,0.18); color: var(--amber); }
.hw-main { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.hw-target, .hw-left { display: flex; flex-direction: column; gap: 2px; }
.hw-target b { font: 800 italic 50px/0.9 var(--display); color: var(--lime); font-variant-numeric: tabular-nums; }
.hw-left { text-align: right; align-items: flex-end; }
.hw-left b { font: 800 italic 38px/0.9 var(--display); font-variant-numeric: tabular-nums; }
.hw-target span, .hw-left span { font-size: 12px; color: var(--muted); }
.hw-chart svg { width: 100%; height: 46px; display: block; }
body.in-workout .metrics .gear { opacity: 0.4; pointer-events: none; }

/* ---------- Liga ---------- */
.league-empty { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--gap); }
.le-hero { position: relative; overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; padding: 30px; }
.le-hero h2 { font: 800 italic 64px/0.95 var(--display); margin: 14px 0 10px; }
.le-hero p { max-width: 440px; color: rgba(255,255,255,0.8); line-height: 1.55; font-size: 14.5px; }
.le-form { display: flex; flex-direction: column; gap: 14px; }
.le-form h3 { font-size: 17px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--lime); }
.sep { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; }
.sep::before, .sep::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.code-input.small { font-size: 30px; padding: 10px; border-radius: 16px; }
.league-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: var(--gap); margin-bottom: var(--gap); }
.tier-card { display: flex; align-items: center; gap: 22px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tc) 26%, transparent), var(--card) 60%); }
.tier-badge { width: 96px; height: 96px; flex: none; border-radius: 30px; display: grid; place-items: center; background: var(--tc); color: #111; box-shadow: 0 16px 40px color-mix(in srgb, var(--tc) 40%, transparent); }
.tier-badge .ico { width: 46px; height: 46px; stroke-width: 1.7; }
.tier-card h2 { font: 800 italic 54px/1 var(--display); color: var(--tc); margin: 2px 0 6px; }
.tier-card p { color: var(--muted); font-size: 14px; }
.tier-ladder { display: flex; flex-direction: column-reverse; justify-content: center; gap: 6px; }
.tl { display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 12px; font-size: 14px; color: var(--muted); }
.tl i { width: 14px; height: 14px; border-radius: 5px; background: var(--tc); opacity: 0.55; }
.tl.on { background: color-mix(in srgb, var(--tc) 16%, transparent); color: var(--text); font-weight: 650; }
.tl.on i { opacity: 1; }
.league-table { padding: 8px; }
.lt-row { display: grid; grid-template-columns: 36px 14px 1fr 90px 110px 110px; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; font-size: 14.5px; }
.lt-row + .lt-row { margin-top: 2px; }
.lt-row.up { background: rgba(212,248,60,0.07); }
.lt-row.down { background: rgba(255,107,91,0.07); }
.lt-row.me { background: var(--lime); color: var(--lime-ink); }
.lt-row.me .tr, .lt-row.me .bot { color: var(--lime-ink); }
.lt-row .rk { font: 800 italic 22px var(--display); text-align: center; }
.lt-row .dot { width: 14px; height: 14px; border-radius: 50%; }
.lt-row .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-row .bot { font-style: normal; font-size: 11px; font-weight: 600; color: var(--faint); margin-left: 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.lt-row .tr { color: var(--tc); font-size: 13px; font-weight: 600; }
.lt-row .xp { text-align: right; font-variant-numeric: tabular-nums; font-weight: 650; }
.lt-row .zn { display: flex; align-items: center; justify-content: flex-end; gap: 4px; font-size: 12.5px; }
.lt-row .zn .ico { width: 15px; height: 15px; }
.lt-row .zn .rot .ico { transform: rotate(180deg); }
.lt-row.up .zn { color: var(--lime); }
.lt-row.down .zn { color: var(--red); }
.lt-row.me .zn { color: var(--lime-ink); }
.league-mini { cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.lm-rank { display: flex; align-items: baseline; gap: 10px; }
.lm-rank b { font: 800 italic 60px/0.9 var(--display); color: var(--lime); }
.lm-rank span { color: var(--muted); font-size: 14px; }
.lm-list { display: flex; flex-direction: column; gap: 4px; }
.lm-list div { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; font-size: 14px; }
.lm-list div.me { background: var(--lime-soft); font-weight: 650; }
.lm-list i { width: 10px; height: 10px; border-radius: 50%; }
.lm-list em { margin-left: auto; font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); }
.lm-cta { margin-top: auto; }

/* ---------- Duelle ---------- */
.duel-banner { padding: 16px; border-radius: 22px; margin-bottom: 4px;
  background: radial-gradient(130% 160% at 100% 0%, color-mix(in srgb, var(--dc, #fff) 22%, transparent), rgba(255,255,255,0.04) 70%);
  border: 1px solid color-mix(in srgb, var(--dc, #fff) 40%, transparent); }
.duel-banner h4 { font: 800 italic 28px/1.05 var(--display); margin: 10px 0 6px; }
.duel-banner p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.duel-banner p b { color: var(--text); }
.db-head { display: flex; justify-content: space-between; align-items: center; }
.duel-banner.small { display: flex; align-items: center; gap: 12px; }
.duel-banner.small > .ico { width: 26px; height: 26px; color: var(--lime); flex: none; }
.duel-banner.small div { display: flex; flex-direction: column; gap: 2px; flex: 1; font-size: 14px; }
.duel-banner.small span { color: var(--muted); font-size: 12.5px; }
.duels-card .dl-list { display: flex; flex-direction: column; gap: 6px; }
.dl-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 16px; background: rgba(255,255,255,0.04); text-align: left; width: 100%; }
button.dl-row:hover { background: rgba(255,255,255,0.08); }
.dl-row > i { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dl-row > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.dl-row b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row span { font-size: 12.5px; color: var(--muted); }
.dl-row > em { font-style: normal; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); }
.dl-row > em.go-mini { color: var(--lime-ink); background: var(--lime); padding: 6px 12px; border-radius: 999px; font-weight: 650; }

@media (max-width: 1100px) {
  .train-top, .league-empty, .league-top { grid-template-columns: 1fr; }
  .lt-row { grid-template-columns: 30px 12px 1fr 90px; }
  .lt-row .tr, .lt-row .zn { display: none; }
}

/* Fahrerwahl in der Garage */
.rider-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); max-width: 760px; }
.rider-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 10px 18px 10px 10px; text-align: left; border: 1.5px solid transparent; transition: transform 0.18s ease, border-color 0.18s ease; }
.rider-card:hover { transform: translateY(-2px); }
.rider-card.on { border-color: var(--lime); background: linear-gradient(180deg, rgba(212,248,60,0.08), var(--card) 60%); }
.rider-card img { width: 112px; height: 112px; object-fit: cover; object-view-box: inset(16% 26% 30% 30%); border-radius: 16px; background: #0d0e10; }
.rider-card div { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.rider-card b { font: 800 italic 30px/1 var(--display); }
.rider-card span { color: var(--muted); font-size: 13px; }
.rider-card i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.06); }
.rider-card.on i { background: var(--lime); color: var(--lime-ink); }
.rider-card i .ico { width: 16px; height: 16px; }

/* Video-Modus */
#vid { position: fixed; inset: 0; z-index: 14; pointer-events: none; display: none; background: #0d0e10; }
body.m-ride #vid.on { display: block; }
#vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#vid .vid-credit { position: absolute; right: 20px; bottom: 6px; font-size: 11px; color: rgba(255,255,255,0.55); text-shadow: 0 1px 2px rgba(0,0,0,0.6); }

/* HUD v2: Zonen, Distanz, Puls */
.m .v em.zone-tag { margin-left: auto; align-self: flex-start; font-style: normal; font-weight: 750; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(16,17,20,0.16); color: #101114; }
.m.power .zbar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin-top: 8px; }
.m.power .zbar i { height: 5px; border-radius: 3px; background: rgba(16,17,20,0.16); }
.m.power .zbar i.on { background: rgba(16,17,20,0.75); }
.m.power .l { color: rgba(16,17,20,0.66); }
.m.power .l span + span::before { content: ""; }
.m.dist .pbar { height: 5px; border-radius: 3px; background: rgba(255,255,255,0.1); margin-top: 8px; overflow: hidden; }
.m.dist .pbar i { display: block; height: 100%; width: 0; background: var(--lime); border-radius: 3px; transition: width 0.4s linear; }
.m.hr .v { align-items: center; }
.m.hr .heart { width: 22px; height: 22px; fill: var(--hz, rgba(255,255,255,0.3)); flex: none; align-self: center; margin-right: 2px; }
.m.hr.live .heart { animation: beat var(--beat, 0.8s) ease-in-out infinite; }
.m.hr .l b { color: var(--hz); font-weight: 700; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.22); } 30% { transform: scale(0.96); } }
.m .v b { font-variant-numeric: tabular-nums; }
@media (max-width: 1250px) { .m .v b { font-size: 38px; } .m.power .v b { font-size: 50px; } }

.dev-live { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dev-live:empty { display: none; }
.dev-live span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,0.06); font-size: 13px; font-variant-numeric: tabular-nums; }
.dev-live .ico { width: 15px; height: 15px; color: var(--lime); }

/* Strava-Dialog und Fotos */
.modal-card.wide { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; }
.modal-card textarea.input { font-family: var(--font); resize: vertical; min-height: 120px; line-height: 1.45; padding-top: 12px; font-size: 14px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.shot { padding: 0; border-radius: 12px; overflow: hidden; border: 2px solid transparent; aspect-ratio: 16 / 9; background: #0d0e10; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot.on { border-color: var(--lime); }
.cover-prev { margin-top: 10px; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: #0d0e10; }
.cover-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.photo-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 14px; display: block; transition: transform 0.2s ease; }
.photo-strip a:hover img { transform: scale(1.02); }

.video-badge { position: absolute; right: 12px; top: 12px; z-index: 3; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(13,14,16,0.72); backdrop-filter: blur(8px); font-size: 12px; font-weight: 650; color: var(--lime); }
.video-badge .ico { width: 13px; height: 13px; }

.detail .detail-video { position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.detail.has-video .scrim { z-index: 1; }
.detail.has-video > :not(.detail-video):not(.scrim) { position: relative; z-index: 2; }

/* Status, Minikarte, Pause-Hinweis, Tastenhilfe */
.h-status { display: none; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
body.m-ride .h-status { display: flex; }
.h-status span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.h-status span i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.25); }
.h-status span.on { color: var(--text); }
.h-status span.on i { background: var(--lime); box-shadow: 0 0 8px rgba(212,248,60,0.7); }
.h-status span.warn i { background: var(--amber); }
.h-status b { color: var(--lime); font-weight: 700; margin-left: 2px; }
.h-minimap { width: 180px; height: 180px; border-radius: 24px; display: none; }
body.view-video .h-minimap { display: block; }
.pill-stat.idle { background: rgba(255,181,71,0.2); color: var(--amber); }
.keyhelp { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 96; width: min(440px, calc(100vw - 32px)); padding: 22px 24px; border-radius: 26px; display: none; }
.keyhelp.on { display: block; }
.keyhelp h4 { font: 800 italic 30px var(--display); margin-bottom: 12px; }
.keyhelp dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 16px; font-size: 14px; }
.keyhelp dt { font-weight: 650; }
.keyhelp dd { color: var(--muted); }
.keyhelp p { margin-top: 14px; font-size: 13px; color: var(--muted); }

.devcheck { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,0.05); border: 1.5px solid transparent; text-align: left; }
.dc .ico { width: 22px; height: 22px; color: var(--muted); }
.dc b { font-size: 14px; } .dc span { font-size: 12px; color: var(--muted); }
.dc.on { border-color: var(--lime); background: rgba(212,248,60,0.08); } .dc.on .ico { color: var(--lime); }

/* Auswertung */
.curve-svg { width: 100%; height: 220px; display: block; }
.curve-svg text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend i { width: 16px; height: 3px; border-radius: 2px; margin-left: 8px; }
.legend .lg-l { background: var(--lime); } .legend .lg-m { background: #5ab0ff; }
.legend .lg-b { background: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0 4px, transparent 4px 7px); }
.ana-keys { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.ana-keys div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,0.04); }
.ana-keys span, .ana-keys small { font-size: 12px; color: var(--muted); }
.ana-keys b { font: 800 italic 24px var(--display); }
.zone-bars { display: flex; flex-direction: column; gap: 9px; }
.zb { display: grid; grid-template-columns: 118px 1fr 52px 36px; align-items: center; gap: 10px; font-size: 12.5px; }
.zb-n { color: var(--muted); white-space: nowrap; }
.zb-bar { height: 10px; border-radius: 5px; background: rgba(255,255,255,0.06); overflow: hidden; }
.zb-bar i { display: block; height: 100%; border-radius: 5px; min-width: 2px; }
.zb-t { text-align: right; font-variant-numeric: tabular-nums; } .zb-p { text-align: right; color: var(--muted); }
.ana-load { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.ana-load div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 16px; background: rgba(255,255,255,0.04); }
.ana-load b { font: 800 italic 24px var(--display); } .ana-load span { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .ana { grid-column: span 12 !important; } .ana-keys { grid-template-columns: repeat(2, 1fr); } }

.h-status .fps { color: var(--text); font-variant-numeric: tabular-nums; }
.h-status .fps small { color: var(--muted); margin-left: 4px; font-weight: 500; }

/* ---------- HUD-Layout wie Zwift: Werte oben, Bedienung unten ---------- */
#hud .vignette { background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 26%, rgba(0,0,0,0) 72%, rgba(0,0,0,0.42) 100%); }
.h-top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: min(1240px, calc(100vw - 28px)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.h-top > *, .h-under > * { pointer-events: auto; }
.h-top .metrics { width: 100%; }
.h-under { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; pointer-events: none; }
.h-under .h-grade { position: static; transform: none; height: 46px; padding: 0 18px; }
.h-under .h-grade b { font-size: 30px; }
.h-under .h-workout { width: min(980px, 100%); }
body.in-workout .h-under .h-grade { display: none; }
.h-top .m { padding: 9px 14px; }
.h-top .m .v b { font-size: 40px; }
.h-top .m.power .v b { font-size: 52px; }
.h-top .m .l { margin-top: 4px; }
.h-top .m.speed svg { top: 2px; width: 132px; height: 72px; }
.h-top .m.speed .v { margin-top: 14px; }
.h-top .m.gear button { width: 40px; height: 40px; }
/* Hilfs-Karten links und Statusspalte rechts beginnen unter der Leiste */
.h-route { display: none; }
.h-left { top: 132px; }
.h-side { top: 132px; }
body.in-workout .h-left, body.in-workout .h-side { top: 236px; }
/* Unten: Ansicht und Pause links, Hoehenprofil in der Mitte, XP rechts */
.h-bottom { left: 16px; right: 16px; bottom: 14px; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 12px; }
.h-bottom .h-tools { position: static; flex: none; }
.h-tools .seg { height: 52px; padding: 5px; }
.h-tools .seg button { height: 42px; padding: 0 14px; font-size: 13.5px; }
.h-tools .roundbtn { width: 52px; height: 52px; }
.h-bottom .h-profile { flex: 1 1 auto; max-width: 1000px; height: 74px; padding: 6px 12px; }
.h-bottom .h-xp { position: static; flex: none; min-width: 120px; justify-content: flex-end; }
@media (max-width: 1280px) {
  .h-top .metrics { grid-template-columns: 1.5fr 1.1fr 1fr 1fr 1fr 0.8fr 1.3fr; }
  .h-top .m { padding: 8px 10px; }
  .h-top .m .v b { font-size: 32px; } .h-top .m.power .v b { font-size: 42px; }
  .h-top .m .l { font-size: 11px; }
  .h-top .m.speed svg { display: none; } .h-top .m.speed .v { margin-top: 0; }
  .h-bottom { flex-wrap: wrap; }
  .h-bottom .h-profile { order: -1; flex-basis: 100%; max-width: none; height: 64px; }
  .h-bottom .h-xp { min-width: 0; }
}
/* Schmal (iPhone quer, Tablet hoch): Zeit und Trittfrequenz wandern in die Unterzeilen */
@media (max-width: 900px) {
  .h-top { top: 8px; width: calc(100vw - 16px); }
  .h-top .metrics { grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr; padding: 5px; gap: 4px; border-radius: 22px; }
  .h-top .metrics > .m:nth-child(4), .h-top .metrics > .m:nth-child(6) { display: none; }
  .h-top .m { padding: 6px 8px; border-radius: 17px; }
  .h-top .m .v b { font-size: 26px; } .h-top .m.power .v b { font-size: 32px; }
  .h-top .m .v span { font-size: 11px; }
  .h-top .m.power .zbar { display: none; }
  .h-top .m.gear button { width: 32px; height: 32px; border-radius: 11px; }
  .h-left, .h-side { top: 92px; }
  .h-left { width: 210px; transform: scale(0.85); transform-origin: top left; }
  .h-tools .seg button { padding: 0 9px; font-size: 12px; height: 36px; }
  .h-tools .seg { height: 46px; } .h-tools .roundbtn { width: 46px; height: 46px; }
}
/* Google- und Cesium-Hinweis im Fahrmodus unten rechts unter dem XP-Feld, damit nichts verdeckt wird */
body.m-ride #credits { left: auto; right: 16px; bottom: 5px; width: 46vw; max-width: 46vw; text-align: right; font-size: 10px; opacity: 0.75; white-space: normal; }
body.m-ride .h-bottom { bottom: 30px; }
/* Wenig Hoehe (Handy quer): Profil flach, Hinweise klein */
@media (max-height: 520px) {
  .h-bottom { bottom: 22px; gap: 6px; }
  .h-bottom .h-profile { height: 40px; padding: 4px 10px; border-radius: 16px; }
  .h-tools .seg { height: 40px; padding: 3px; } .h-tools .seg button { height: 34px; }
  .h-tools .roundbtn { width: 40px; height: 40px; }
  .h-bottom .h-xp .pill-stat { height: 34px; }
  body.m-ride #credits { font-size: 8.5px; width: 60vw; max-width: 60vw; bottom: 3px; }
  .h-side { transform: scale(0.8); transform-origin: top right; }
  .h-under .h-grade { height: 36px; } .h-under .h-grade b { font-size: 22px; }
}

/* Hoehenprofil: ganze Strecke links, die naechsten 2 km rechts */
.h-profile { display: flex; gap: 12px; }
.h-profile #hProfile { flex: 1.5 1 0; min-width: 0; }
.h-profile #hAhead { flex: 1 1 0; min-width: 0; height: 100%; display: block; box-shadow: -7px 0 0 -6px rgba(255,255,255,0.12); }
body.in-workout .h-profile #hAhead { display: none; }
@media (max-width: 900px) { .h-profile #hProfile { flex: 1 1 0; } }

/* Anmeldung */
body.m-login .rail { display: none; }
body.m-login #view { padding: 0; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 50% -10%, rgba(212,248,60,0.12), transparent 60%), var(--bg); }
.login { width: min(420px, 100%); padding: 32px 28px; border-radius: 32px; }
.login .login-logo { width: 56px; height: 56px; border-radius: 19px; margin-bottom: 18px; background: var(--lime); -webkit-mask: none; }
.login h1 { font: 800 italic 44px/0.95 var(--display); }
.login p.muted { margin: 8px 0 18px; font-size: 14px; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login .btn.wide { width: 100%; justify-content: center; margin-top: 6px; height: 50px; }
.login-err { color: #ff8a80; font-size: 13.5px; }
.login .link-btn { display: block; margin: 14px auto 0; }
.h-top .m .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Logo "Strampeln.": Berg mit S-Serpentine und Punkt */
.logo { background: url(../assets/img/strampeln-icon.svg) center / cover no-repeat !important; overflow: hidden; }
.logo .ico { display: none; }
body.m-login #view { margin-left: 0 !important; width: 100% !important; }
@media (max-height: 560px) {
  .login-wrap { place-items: start center; padding: 16px; }
  .login { padding: 20px 22px; }
  .login .logo { width: 40px; height: 40px; border-radius: 13px; margin-bottom: 10px; }
  .login h1 { font-size: 32px; }
  .login p.muted { margin: 4px 0 10px; }
  .login form { gap: 8px; }
}

/* ---------- iPhone / iPad: Safe Areas (Notch, Dynamic Island, Home-Balken) und Touch ---------- */
:root {
  --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, a, .nav-btn, .chip, .seg button, .toggle { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#hud, .rail, #world canvas { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.rail { width: calc(var(--rail) + var(--sl)); padding-left: var(--sl); padding-top: max(22px, var(--st)); padding-bottom: max(20px, var(--sb)); }
#view { left: calc(var(--rail) + var(--sl)); padding-right: max(34px, calc(var(--sr) + 14px)); padding-top: max(30px, calc(var(--st) + 12px)); padding-bottom: calc(48px + var(--sb)); }
body.m-onboarding #view, body.m-loading #view, body.m-login #view { left: 0; padding: var(--st) var(--sr) var(--sb) var(--sl); }
#credits { left: calc(var(--rail) + var(--sl) + 16px); bottom: calc(6px + var(--sb)); }
body.m-ride #credits { right: max(16px, calc(var(--sr) + 6px)); bottom: max(5px, var(--sb)); }
.toast { top: max(22px, calc(var(--st) + 10px)); }
.modal { padding: var(--st) var(--sr) var(--sb) var(--sl); }
.h-top { top: calc(14px + var(--st)); width: min(1240px, calc(100vw - 28px - var(--sl) - var(--sr))); }
.h-left { left: max(20px, calc(var(--sl) + 8px)); }
.h-side { right: max(20px, calc(var(--sr) + 8px)); }
.h-bottom { left: max(16px, calc(var(--sl) + 6px)); right: max(16px, calc(var(--sr) + 6px)); }
body.m-ride .h-bottom { bottom: max(30px, calc(var(--sb) + 14px)); }
@media (max-width: 900px) { .h-top { top: calc(8px + var(--st)); width: calc(100vw - 16px - var(--sl) - var(--sr)); } }
@media (max-height: 520px) { body.m-ride .h-bottom { bottom: max(22px, calc(var(--sb) + 8px)); } }
/* Kein "klebendes" Hover auf Touchgeraeten */
@media (hover: none) {
  .nav-btn:hover { background: none; color: var(--muted); }
  .nav-btn.on:hover { background: var(--lime); color: var(--lime-ink); }
  .btn.lime:hover { background: var(--lime); }
  .go:hover { box-shadow: none; }
}
/* Simulator-Watt per Touch, nur ohne Trainer sichtbar */
.m.power { position: relative; }
.sim-pw { display: none; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 6px; }
body.m-ride.sim-power .sim-pw { display: flex; }
.sim-pw button { width: 38px; height: 38px; border-radius: 13px; background: rgba(16,17,20,0.14); color: #101114; display: grid; place-items: center; }
.sim-pw button:active { background: rgba(16,17,20,0.28); transform: scale(0.95); }
.sim-pw button .ico { width: 18px; height: 18px; stroke-width: 2.6; }
body.m-ride.sim-power .m.power .v, body.m-ride.sim-power .m.power .l, body.m-ride.sim-power .m.power .zbar { margin-right: 46px; }
@media (max-width: 900px) {
  .sim-pw { right: 5px; gap: 4px; }
  .sim-pw button { width: 30px; height: 28px; border-radius: 10px; }
  body.m-ride.sim-power .m.power .v, body.m-ride.sim-power .m.power .l { margin-right: 34px; }
  body.m-ride.sim-power .m.power .v em.zone-tag { font-size: 10.5px; padding: 2px 6px; white-space: nowrap; max-width: 64px; overflow: hidden; text-overflow: ellipsis; }
}
/* Navigationsleiste fuer niedrige Bildschirme (iPad mini quer, iPhone quer) */
.rail > * { flex: none; }
@media (max-height: 780px) and (min-width: 761px) {
  .rail { gap: 5px; padding-top: max(14px, var(--st)); padding-bottom: max(14px, var(--sb)); }
  .rail .logo { width: 44px; height: 44px; border-radius: 15px; margin-bottom: 8px; }
  .nav-btn { width: 66px; padding: 6px 0 5px; gap: 3px; border-radius: 17px; font-size: 10.5px; }
  .nav-btn .ico { width: 22px; height: 22px; }
  .avatar { width: 40px; height: 40px; font-size: 15px; }
}
@media (max-height: 620px) and (min-width: 761px) {
  :root { --rail: 72px; }
  .rail { gap: 3px; justify-content: center; padding-top: max(8px, var(--st)); padding-bottom: max(8px, var(--sb)); overflow-y: auto; }
  .rail .logo, .rail .avatar, .rail .spacer { display: none; }
  .nav-btn { width: 52px; height: 42px; padding: 0; justify-content: center; border-radius: 15px; }
  .nav-btn span { display: none; }
  .nav-btn .ico { width: 23px; height: 23px; }
}
/* Seiten auf niedrigen Bildschirmen (iPhone quer) etwas kompakter */
@media (max-height: 620px) and (min-width: 761px) {
  #view { padding-top: max(18px, calc(var(--st) + 8px)); padding-left: 24px; }
  .hello h1, .page-head h1 { font-size: 46px; }
  .hello { margin-bottom: 14px; }
  .page-head { margin-bottom: 16px; }
  .hero { min-height: 330px; padding: 24px; }
  .hero h2 { font-size: clamp(56px, 7vw, 88px); }
  .hero .stats { gap: 22px; margin-bottom: 18px; }
  .stat-big b { font-size: 34px; }
  .section-title { margin: 24px 0 12px; }
}
/* Kartenhinweis im Fahrmodus ganz unten, unter der Bedienleiste */
body.m-ride #credits { bottom: max(3px, calc(var(--sb) - 17px)); }
@media (max-height: 520px) { body.m-ride #credits { width: 52vw; max-width: 52vw; } }
