:root {
  --bg: #0b1220;
  --glass: rgba(16, 24, 40, 0.72);
  --glass-brd: rgba(255, 255, 255, 0.09);
  --text: #eef3fb;
  --muted: #8d9bb3;
  --accent: #5ac8fa;
  --r1: #7dd3fc; /* leicht */
  --r2: #38bdf8; /* mäßig */
  --r3: #2563eb; /* stark */
  --r4: #a855f7; /* sehr stark */
  --dry: rgba(255, 255, 255, 0.08);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: Inter, -apple-system, system-ui, sans-serif; overflow: hidden; }
#map { position: fixed; inset: 0; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

.glass { background: var(--glass); border: 1px solid var(--glass-brd);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: 0 8px 30px rgba(0,0,0,.35); }

/* Kopfzeile */
.top { position: fixed; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; z-index: 5;
  display: flex; gap: 8px; align-items: center; }
.icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; }
.place { flex: 1; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  gap: 6px; font-weight: 600; font-size: 17px; min-width: 0; }
#place-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stamp { height: 44px; padding: 0 12px; border-radius: 14px; display: grid; place-items: center;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 15px; min-width: 64px; }
.stamp.future { color: var(--accent); }

/* Suche */
.search { position: fixed; inset: 0; z-index: 20; padding: calc(12px + var(--safe-t)) 12px 12px;
  background: rgba(5, 9, 18, .55); }
.search-box { display: flex; align-items: center; border-radius: 14px; padding: 0 6px 0 14px; height: 48px; }
.search-box input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font: inherit; font-size: 17px; }
.link { color: var(--accent); padding: 8px; font-weight: 500; }
.results { list-style: none; margin: 8px 0 0; padding: 4px; border-radius: 14px; max-height: 60vh; overflow: auto; }
.results:empty { display: none; }
.results li { padding: 12px; border-radius: 10px; cursor: pointer; }
.results li:hover, .results li:focus { background: rgba(255,255,255,.07); }
.results small { color: var(--muted); margin-left: 6px; }

/* Radar-Player */
.player { position: fixed; z-index: 5; left: 12px; right: 12px; bottom: calc(var(--sheet-peek, 252px) + 12px);
  height: 48px; border-radius: 16px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 6px; }
.icon-sm { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.icon-sm:hover { background: rgba(255,255,255,.07); }
#frame { flex: 1; accent-color: var(--accent); }
.legend i { display: block; width: 54px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, var(--r1), var(--r2), var(--r3), var(--r4)); }

/* Bottom Sheet */
.sheet { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; max-height: 78vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(14,21,36,.94), rgba(10,16,28,.98));
  border-top: 1px solid var(--glass-brd); border-radius: 24px 24px 0 0;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  padding: 8px 18px calc(18px + var(--safe-b)); transform: translateY(calc(100% - var(--sheet-peek, 252px)));
  transition: transform .35s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
.sheet.open { transform: translateY(0); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.22); margin: 2px auto 12px; cursor: grab; }
.headline { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; cursor: pointer; }
.drop { width: 46px; height: 46px; flex: none; border-radius: 50% 50% 50% 8%; transform: rotate(-45deg);
  background: var(--dry); transition: background .4s; }
.drop.rain { background: linear-gradient(135deg, var(--r1), var(--r3)); box-shadow: 0 0 24px rgba(56,189,248,.45); }
h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
#subline { margin: 3px 0 0; color: var(--muted); font-size: 14px; }

.block { background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.05); border-radius: 18px;
  padding: 14px 14px 10px; margin-bottom: 10px; }
.block-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: #c5d0e2; margin-bottom: 10px; }
.muted { color: var(--muted); font-weight: 500; text-transform: none; letter-spacing: 0; }

.bars { display: flex; align-items: flex-end; gap: 4px; height: 76px; }
.bar { flex: 1; border-radius: 5px 5px 3px 3px; background: var(--dry); min-height: 4px; position: relative;
  transition: height .5s cubic-bezier(.2,.8,.2,1); }
.bar.now::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 4px; height: 4px; border-radius: 2px;
  background: var(--accent); transform: translateX(-50%); }
.axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-top: 8px;
  font-variant-numeric: tabular-nums; }
.prob { width: 100%; height: 96px; display: block; overflow: visible; }

.wind { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.wind .compass { width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.12);
  display: grid; place-items: center; flex: none; }
.wind b { font-weight: 600; }
.wind span { color: var(--muted); font-size: 13px; display: block; margin-top: 2px; }
.source { color: #5c6a82; font-size: 11px; text-align: center; margin: 8px 0 0; }

/* Zugbahn-Markierungen */
.eta { padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #06121f;
  background: #e8f4ff; box-shadow: 0 2px 10px rgba(0,0,0,.35); white-space: nowrap; font-variant-numeric: tabular-nums; }
.eta small { font-weight: 500; color: #3b4a60; margin-left: 4px; }
.eta.rain { background: var(--r2); color: #fff; }
.eta.rain small { color: #e0f2fe; }
.me { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid #fff;
  box-shadow: 0 0 0 0 rgba(90,200,250,.6); animation: pulse 2.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(90,200,250,.55); } 100% { box-shadow: 0 0 0 22px rgba(90,200,250,0); } }

.toast { position: fixed; z-index: 30; top: calc(68px + var(--safe-t)); left: 50%; transform: translateX(-50%);
  background: rgba(20,28,44,.95); border: 1px solid var(--glass-brd); padding: 10px 14px; border-radius: 12px;
  font-size: 14px; max-width: calc(100% - 24px); }

.maplibregl-ctrl-attrib { background: rgba(10,16,28,.6) !important; color: #8d9bb3; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: #a9b6cc !important; }
.maplibregl-ctrl-bottom-right { bottom: auto; top: calc(64px + var(--safe-t)); }

/* Desktop: Seitenpanel statt Bottom Sheet */
@media (min-width: 900px) {
  .sheet { left: 16px; right: auto; top: 76px; bottom: 16px; width: 380px; max-height: none;
    border-radius: 24px; border: 1px solid var(--glass-brd); transform: none; }
  .grab { display: none; }
  .player { left: 412px; right: auto; width: 420px; bottom: 16px; }
  .top { right: auto; width: 380px; left: 16px; top: 16px; }
}
