/* Basetrain Live — Oberfläche (21.10.2026, zweite Fassung)
   Aufbau: Karte vollflächig, dunkler Kopf, Blatt (Bottom Sheet) mit drei Rastpunkten,
   Tab-Leiste unten, Detail als eigene Ebene. Hell/Dunkel nach System. */

:root {
  --deep: #072822; --deep2: #0b3a30; --lime: #b8ff57; --lime-ink: #1e3a0a; --btn: #b3dd78; /* Lime, 40 % weniger gesaettigt */
  --ink: #0e1a16; --ink2: #44524d; --ink3: #7a877f;
  --bg: #f3f4f0; --card: #ffffff; --soft: #eef1ec; --line: #e2e6df; --line2: #cfd6cc;
  --r: 14px; --r-s: 10px;
  --shadow: 0 10px 30px rgba(7, 40, 34, .14);
  --tabs-h: 62px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef2ec; --ink2: #b4bfb7; --ink3: #7c8880;
    --bg: #0c1411; --card: #121b17; --soft: #182420; --line: #22312a; --line2: #2f4036;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Manrope, system-ui, -apple-system, sans-serif; color: var(--ink); background: var(--bg);
  overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.app { position: fixed; inset: 0; }
.map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ---------- Kopf ---------- */
.top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5; padding: env(safe-area-inset-top, 0px) 0 0;
  background: linear-gradient(180deg, var(--deep) 0 72%, rgba(7, 40, 34, 0));
  color: #f5f2eb; pointer-events: none;
}
.top > * { pointer-events: auto; }
.brandrow { display: flex; align-items: center; gap: 12px; padding: 14px 18px 8px; }
.brand { display: flex; align-items: center; gap: 9px; }
.brand svg { width: 26px; height: 26px; stroke: none; }
.brand b { font-family: Syncopate, Manrope, sans-serif; font-weight: 700; font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand b span { color: var(--lime); }
.live-now { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: #cfe6d8; }
.live-now i { width: 8px; height: 8px; border-radius: 50%; background: #ff5d5d; box-shadow: 0 0 0 0 rgba(255, 93, 93, .6); animation: beacon 1.8s ease-out infinite; }
.live-now:empty, .live-now[hidden] { display: none; }
.iconbtn { flex: none; width: 38px; height: 38px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .08); color: #f5f2eb; display: grid; place-items: center; }
.iconbtn.on { background: var(--lime); color: var(--deep); border-color: var(--lime); }
.addclub { flex: none; margin-left: auto; height: 38px; padding: 0 12px; border-radius: 10px; background: var(--lime); color: var(--deep); font-size: 13px; font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; text-decoration: none; }
.addclub[hidden] { display: none; }
@media (max-width: 400px) {
  .brandrow { gap: 8px; }
  .brand b { font-size: 11px; }
  .addclub { padding: 0 10px; font-size: 12.5px; }
}
.chips { display: flex; gap: 8px; padding: 4px 18px 14px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #e6ede8; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c, #cfd6cc); }
.chip.on { background: #f5f2eb; color: var(--deep); border-color: #f5f2eb; }

/* ---------- Blatt ---------- */
.sheet {
  position: absolute; left: 0; right: 0; top: 0; height: 40vh; z-index: 6;
  background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
  transform: translateY(var(--y, 70vh)); transition: transform .32s cubic-bezier(.2, .8, .2, 1), height .32s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column; will-change: transform; touch-action: none;
}
.sheet.dragging { transition: none; }
.sheet .view { padding-bottom: 24px; }
.grip { flex: none; padding: 10px 0 8px; display: grid; place-items: center; cursor: grab; }
.grip i { width: 38px; height: 4px; border-radius: 2px; background: var(--line2); }
.days { flex: none; display: flex; gap: 6px; padding: 2px 16px 10px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.days::-webkit-scrollbar { display: none; }
.days[hidden] { display: none; }
.dchip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line2); background: var(--card); color: var(--ink2); font-size: 13px; font-weight: 800; white-space: nowrap; }
.dchip b { font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 6px; background: var(--soft); color: var(--ink3); }
.dchip.on { background: var(--deep); color: #f5f2eb; border-color: var(--deep); }
.dchip.on b { background: rgba(255, 255, 255, .16); color: var(--lime); }
.view { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 20px; touch-action: pan-y; }
.sheet[data-pos="peek"] .view { overflow: hidden; }

.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 20px 10px; }
.sec b { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.sec span { font-size: 12.5px; color: var(--ink3); font-weight: 600; }
.sec .link { background: none; border: 0; padding: 0; color: var(--green, #1f6b4f); font-weight: 700; font-size: 12.5px; }
.day { display: flex; align-items: baseline; gap: 8px; padding: 20px 20px 8px; }
.day b { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.day span { font-size: 12px; color: var(--ink3); font-weight: 600; }

.items { display: grid; }
.item {
  display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; width: 100%;
  padding: 14px 20px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; --c: var(--lime);
}
.item:active { background: var(--soft); }
.thumb { width: 48px; height: 48px; border-radius: var(--r-s); display: grid; place-items: center; font-weight: 800; font-size: 13px; overflow: hidden; background: color-mix(in srgb, var(--c) 28%, var(--soft)); color: var(--ink); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.item .t { font-weight: 800; font-size: 15px; letter-spacing: -.01em; line-height: 1.25; }
.item .m { margin-top: 5px; font-size: 12.5px; color: var(--ink3); font-weight: 600; display: flex; gap: 6px; flex-wrap: wrap; }
.item .m .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c); align-self: center; }
.item .time { text-align: right; font-weight: 800; font-size: 14px; display: grid; gap: 2px; }
.item .time small { font-size: 11px; color: var(--ink3); font-weight: 700; }
.livebadge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; background: #ff5d5d; color: #fff; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.livebadge i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.soonbadge { font-size: 11px; color: #c77d00; font-weight: 800; }
.empty { padding: 32px 20px; text-align: center; color: var(--ink3); font-weight: 600; font-size: 14px; }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* Platzhalter beim Laden */
.sk { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; padding: 14px 20px; align-items: center; }
.sk i { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
.sk .a { width: 46px; height: 46px; border-radius: var(--r-s); }
.sk .b { height: 14px; width: 70%; margin-bottom: 8px; }
.sk .c { height: 11px; width: 45%; }
.sk .d { width: 42px; height: 16px; }

/* Clubs-Liste */
.club-row { grid-template-columns: 46px 1fr auto; }
.club-row .time small { white-space: nowrap; }
.search { margin: 4px 20px 12px; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--r-s); background: var(--soft); border: 1px solid var(--line); }
.search input { flex: 1; border: 0; background: none; font: inherit; color: var(--ink); outline: none; }
.search svg { width: 18px; height: 18px; color: var(--ink3); }

/* Für dich */
.pref { padding: 4px 20px 16px; }
.pref .lbl { display: block; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); margin: 18px 0 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.pace-in { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line2); background: var(--card); font-weight: 700; }
.pace-in input { width: 64px; border: 0; background: none; font: inherit; font-weight: 800; font-size: 17px; color: var(--ink); outline: none; }
.pace-in span { color: var(--ink3); font-size: 13px; }
.opt { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--card); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.opt i { width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--ink3)); }
.opt.on { background: var(--deep); color: #f5f2eb; border-color: var(--deep); }
.pref select { height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); padding: 0 10px; font: inherit; font-weight: 700; }

/* ---------- Detail ---------- */
.detail {
  position: absolute; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b)); top: 42%; z-index: 7;
  background: var(--card); border-radius: 18px 18px 0 0; overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(0); animation: rise .34s cubic-bezier(.2, .8, .2, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
}
.detail[hidden] { display: none; }
.cover { position: relative; height: 160px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 55%, var(--deep)), var(--deep)); overflow: hidden; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(7, 40, 34, .35), rgba(7, 40, 34, 0) 40%, rgba(7, 40, 34, .55)); }
.cover .rings i { position: absolute; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .35); right: -40px; top: -40px; width: 180px; height: 180px; animation: ring 3.2s ease-out infinite; }
.cover .rings i:nth-child(2) { animation-delay: 1.6s; }
.cover.has-img .rings { display: none; }
.back { position: absolute; z-index: 2; left: 12px; top: 12px; height: 36px; padding: 0 12px 0 8px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .92); color: var(--deep); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; gap: 4px; }
.share { position: absolute; z-index: 2; right: 12px; top: 12px; width: 36px; height: 36px; border-radius: 9px; border: 0; background: rgba(255, 255, 255, .92); color: var(--deep); display: grid; place-items: center; }
.logo-lg { position: absolute; z-index: 2; left: 16px; bottom: -22px; width: 64px; height: 64px; border-radius: 14px; background: var(--card); border: 3px solid var(--card); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); display: grid; place-items: center; font-weight: 800; font-size: 18px; overflow: hidden; color: var(--ink); }
.logo-lg img { width: 100%; height: 100%; object-fit: cover; }
.dbody { padding: 36px 20px 32px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 7px; background: var(--soft); font-size: 12px; font-weight: 800; color: var(--ink2); }
.tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.tag.live { background: #ffe5e5; color: #b42626; } .tag.live i { background: #ff5d5d; animation: blink 1s infinite; }
.tag.soon { background: #fff2d6; color: #8a5a00; } .tag.soon i { background: #f0a500; }
@media (prefers-color-scheme: dark) { .tag.live { background: #3a1616; color: #ff9a9a; } .tag.soon { background: #3a2c10; color: #ffcf7a; } }
.dbody h2 { margin: 14px 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.when { color: var(--ink2); font-weight: 700; font-size: 14px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 5px 9px; border-radius: 6px; background: var(--soft); color: var(--ink2); border: 1px solid var(--line); }
.badge.ok { background: color-mix(in srgb, var(--lime) 35%, var(--card)); color: var(--lime-ink); border-color: color-mix(in srgb, var(--lime) 60%, transparent); }
@media (prefers-color-scheme: dark) { .badge.ok { color: var(--lime); } }
.desc { margin: 18px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink2); }
.facts { display: grid; gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
.fact { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--ink2); font-weight: 600; }
.fact svg { flex: none; width: 20px; height: 20px; color: var(--ink3); }
.fact b { color: var(--ink); font-weight: 800; }
.fact .wx { display: inline-flex; align-items: center; gap: 6px; }
.week { display: flex; gap: 6px; margin-top: 18px; }
.week i { flex: 1; height: 30px; border-radius: 7px; display: grid; place-items: center; font-style: normal; font-size: 11.5px; font-weight: 800; background: var(--soft); color: var(--ink3); border: 1px solid var(--line); }
.week i.on { background: var(--deep); color: #f5f2eb; border-color: var(--deep); }
.week i.today { box-shadow: inset 0 0 0 1.5px var(--lime); }
.crowd { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-weight: 700; color: var(--ink2); font-size: 14px; }
.crowd .n { font-size: 26px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.about { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.about h3 { margin: 0 0 8px; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink3); }
.about p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink); white-space: pre-line; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-s); background: var(--soft); }
.links { display: grid; gap: 10px; margin-top: 18px; }
.links .btn { width: 100%; }
.btn.wa .wa-ico { color: #25d366; stroke: #25d366; }
.btn { height: 50px; padding: 0 18px; border-radius: 12px; border: 0; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: var(--soft); color: var(--ink); }
.btn.primary { background: var(--btn); color: var(--lime-ink); }
.btn.primary.joined { background: var(--deep); color: var(--lime); }
.btn.ghost { border: 1px solid var(--line2); background: transparent; }
.btn.insta .ig { stroke: #e1306c; }
.btn.pop { animation: pop .4s cubic-bezier(.2, .9, .3, 1.4); }
.checkin { position: relative; width: 100%; margin-top: 8px; background: color-mix(in srgb, var(--lime) 30%, var(--card)); color: var(--lime-ink); border: 1px solid color-mix(in srgb, var(--lime) 60%, transparent); }
@media (prefers-color-scheme: dark) { .checkin { color: var(--lime); } }
.checkin.done { background: var(--deep); color: var(--lime); border-color: var(--deep); }
.burst { position: absolute; inset: 0; border-radius: 12px; pointer-events: none; box-shadow: 0 0 0 0 var(--lime); animation: burst .9s ease-out forwards; }

/* ---------- Tabs ---------- */
.tabs {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr); background: var(--card); border-top: 1px solid var(--line);
}
.tab { border: 0; background: none; display: grid; justify-items: center; gap: 3px; padding-top: 9px; color: var(--ink3); font-size: 10.5px; font-weight: 800; letter-spacing: .04em; }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--ink); }
.tab.on svg { color: var(--green, #1f6b4f); }
@media (prefers-color-scheme: dark) { .tab.on svg { color: var(--lime); } }

/* ---------- Karte: Pins ---------- */
.pin { position: relative; width: 60px; height: 60px; display: grid; place-items: center; cursor: pointer; --c: var(--lime); }
.pin .pulse { position: absolute; inset: 6px; border-radius: 50%; background: var(--c); opacity: 0; animation: pulse 2.6s ease-out infinite; }
.pin .pulse.b { animation-delay: 1.3s; }
.pin .core { position: relative; min-width: 40px; height: 40px; padding: 0 6px; border-radius: 20px; background: var(--c); border: 2.5px solid #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .3); display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #0e1a16; transition: transform .15s; }
.pin:hover .core, .pin.hl .core { transform: scale(1.12); }
.pin.live .core { background: #ff5d5d; color: #fff; }
.pin.live .pulse { background: #ff5d5d; }
.pin.soon .core { background: #fff; color: #0e1a16; border: 2.5px solid var(--c); }
.pin.soon .pulse { animation-duration: 4s; opacity: .25; }
.pin.later { width: 46px; height: 46px; }
.pin.later .pulse { display: none; }
.pin.later .core { min-width: 32px; height: 32px; font-size: 10.5px; background: #fff; color: #0e1a16; border: 2px solid color-mix(in srgb, var(--c) 70%, #fff); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.pin.dim { opacity: .35; transition: opacity .3s; }
.pin.sel .core { transform: scale(1.18); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 45%, transparent), 0 8px 20px rgba(0, 0, 0, .3); }
.me { width: 18px; height: 18px; border-radius: 50%; background: #3b82f6; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(59, 130, 246, .2); }
.runner { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--c, var(--lime)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--lime)) 35%, transparent), 0 2px 8px rgba(0,0,0,.4); }

.toast { position: absolute; z-index: 30; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 14px); transform: translate(-50%, -80px); background: var(--deep); color: #f5f2eb; padding: 10px 16px; border-radius: 10px; font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2, .8, .2, 1); white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }

@keyframes pulse { 0% { transform: scale(.7); opacity: .5; } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes ring { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(255, 93, 93, .6); } 100% { box-shadow: 0 0 0 10px rgba(255, 93, 93, 0); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: translateY(0); opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes burst { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lime) 80%, transparent); opacity: 1; } 100% { box-shadow: 0 0 0 26px rgba(184, 255, 87, 0); opacity: 0; } }

/* Geteiltes Element beim Öffnen (View Transitions) */
::view-transition-old(thumb), ::view-transition-new(thumb) { animation-duration: .34s; mix-blend-mode: normal; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .2s; }

/* ---------- Desktop: linke Spalte + Karte ---------- */
@media (min-width: 900px) {
  .top { right: auto; width: 440px; background: var(--deep); border-right: 1px solid rgba(255, 255, 255, .08); }
  .map { left: 440px; }
  .sheet { right: auto; width: 440px; top: 112px; bottom: var(--tabs-h); height: auto !important; border-radius: 0; box-shadow: none; transform: none !important; border-right: 1px solid var(--line); }
  .sheet .grip { display: none; }
  .sheet[data-pos="peek"] .view { overflow-y: auto; }
  .detail { right: auto; width: 440px; top: 0; bottom: var(--tabs-h); border-radius: 0; }
  .tabs { right: auto; width: 440px; border-right: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .pin .pulse, .cover .rings i, .live-now i, .livebadge i, .tag.live i { animation: none; }
  .sheet, .toast, .detail { transition: none; animation: none; }
}
