/* ==========================================================================
   Sabiene – Stockwaagen Schleswig-Holstein
   Hell, freundlich, ein bisschen verspielt. Farben aus dem Sabiene-Logo
   (Honiggelb, Blau, warmes Braun) und dem LV-Logo (Blau/Rot).
   ========================================================================== */
:root {
  --honey: #F5B300;
  --honey-2: #FFD23F;
  --honey-3: #FFF1BF;
  --cream: #FFF8E7;
  --cream-2: #FFF3D6;
  --brown: #6E3B14;
  --ink: #2B2522;
  --ink-2: #5E554E;
  --ink-3: #8D837A;
  --blue: #1D6FB8;
  --blue-2: #8CCBF0;
  --sea: #BFE4F6;
  --red: #E0303A;
  --green: #3C9A4A;
  --card: rgba(255, 252, 244, .94);
  --line: rgba(110, 59, 20, .12);
  --shadow: 0 10px 30px rgba(94, 60, 10, .14), 0 1px 3px rgba(94, 60, 10, .08);
  --radius: 18px;
  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --side-w: 340px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--sea);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; font-weight: 800; letter-spacing: -.01em; }

/* ---------- Bühne / Karte ---------- */
/* Kein Seiten-Zoom per Zwei-Finger-Geste (sonst zoomt der Browser die ganze Seite statt der Karte) */
html, body { touch-action: pan-x pan-y; }
.stage { position: fixed; inset: 0; touch-action: none; cursor: grab; }
.stage.is-dragging { cursor: grabbing; }
.map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; transform-origin: 0 0; }
.layer-svg { pointer-events: none; }
.stage.is-gesturing .map { will-change: transform; }
.stage.is-gesturing #windLayer { visibility: hidden; }
body.fx-paused .stage *, body.fx-paused .aurora { animation-play-state: paused !important; }
/* Fehlersuche: ?fx=0 bzw. ?off=… (siehe app.js) */
body.off-css .stage *, body.off-css .windcard *, body.off-css .aurora { animation: none !important; }
.kreise-shadow path { fill: #2b6d9b; fill-opacity: .16; stroke: #2b6d9b; stroke-opacity: .10; stroke-width: 4; stroke-linejoin: round; }


.neighbour { fill: #EEE9D8; stroke: #d9d2bd; stroke-width: 1; }
.kreis { fill: url(#landGrad); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; transition: fill .25s; }
.kreis:hover { fill: #FBF3C8; }
.land-outline { fill: none; stroke: #c9b98a; stroke-width: 1.2; pointer-events: none; }
.kreis-label { font: 700 9px var(--font); fill: #a0947c; text-anchor: middle; pointer-events: none; letter-spacing: .04em; text-transform: uppercase; }
.sea-label { font: 900 26px var(--font); fill: #6FB4DC; fill-opacity: .55; text-anchor: middle; pointer-events: none; letter-spacing: .3em; text-transform: uppercase; }

/* Marker (Beute) */
.marker { cursor: pointer; }
.marker .blur { pointer-events: none; fill: var(--honey); fill-opacity: .08; stroke: var(--honey); stroke-opacity: .28; stroke-width: .8; stroke-dasharray: 2 2; }
.marker .hive-g { transition: transform .18s; transform-box: fill-box; transform-origin: 50% 80%; }
.marker:hover .hive-g, .marker.is-active .hive-g { transform: scale(1.18); }
.marker.is-off .hive-use { filter: grayscale(.75) opacity(.75); }
.marker .status { stroke: #fff; stroke-width: 1; }
.marker .status.ok { fill: var(--green); }
.marker .status.off { fill: #b9b2a8; }
.marker .badge { font: 800 7px var(--font); fill: #fff; text-anchor: middle; pointer-events: none; }
.marker .badge-bg { rx: 4; }
.marker .badge-bg.up { fill: var(--green); }
.marker .badge-bg.down { fill: var(--red); }
.marker .badge-bg.flat { fill: var(--ink-3); }
.marker .label { font: 800 7px var(--font); fill: var(--brown); text-anchor: middle; pointer-events: none; opacity: 0; transition: opacity .2s; paint-order: stroke; stroke: #fff; stroke-width: 2.4; stroke-linejoin: round; }
.marker:hover .label, .marker.is-active .label, .map.show-labels .label { opacity: 1; }
.marker.is-dim { opacity: .28; }

/* Bienen fliegen um die Beute */
.orbit { animation: orbit 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.orbit.o2 { animation-duration: 8.5s; animation-direction: reverse; }
.orbit.o3 { animation-duration: 11s; }
@keyframes orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.bee-fly { animation: beeBob .7s ease-in-out infinite alternate; }
@keyframes beeBob { from { transform: translateY(0); } to { transform: translateY(-1.2px); } }
.marker.is-off .orbit { display: none; }
.flower-sway { animation: sway 3.6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sway { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }

/* Wetter-Overlays */
.wx { pointer-events: none; }
.wx .moon { fill: #FFF3B0; stroke: #E8C65A; stroke-width: .6; }
.wx .star { fill: #fff; animation: twinkle 2s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .3; } to { opacity: 1; } }
.wx .sun { animation: spin 40s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.wx .sun-core { animation: pulse 3s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { from { transform: scale(1); } to { transform: scale(1.08); } }
.wx .cloud-g { animation: drift 6s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-2px); } to { transform: translateX(2px); } }
.wx .drop { stroke: #4FA3DF; stroke-width: 1.4; stroke-linecap: round; animation: rain .9s linear infinite; }
.wx .drop:nth-child(2) { animation-delay: .3s; }
.wx .drop:nth-child(3) { animation-delay: .6s; }
.wx .drop:nth-child(4) { animation-delay: .15s; }
@keyframes rain { from { transform: translateY(0); opacity: 1; } to { transform: translateY(9px); opacity: 0; } }
.wx .flake { fill: #fff; stroke: #BFE4F6; stroke-width: .5; animation: snow 2.4s linear infinite; }
.wx .flake:nth-child(2) { animation-delay: .8s; }
.wx .flake:nth-child(3) { animation-delay: 1.6s; }
@keyframes snow { from { transform: translateY(0) translateX(0); opacity: 1; } 50% { transform: translateY(5px) translateX(1.5px); } to { transform: translateY(10px) translateX(-1px); opacity: 0; } }
.wx .bolt { fill: #FFD23F; stroke: #E8A400; stroke-width: .5; animation: flash 2.2s steps(1) infinite; }
@keyframes flash { 0%, 80% { opacity: 0; } 85%, 100% { opacity: 1; } 92% { opacity: .2; } }
.wx .fog line { stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: .8; animation: drift 4s ease-in-out infinite alternate; }
.wx { opacity: .92; }
.wx .temp { font: 900 8.5px var(--font); fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3; stroke-linejoin: round; }

/* ---------- Kopf ---------- */
.brand {
  position: fixed; top: 14px; left: 14px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  background: var(--card); backdrop-filter: blur(10px);
  border-radius: 999px; padding: 8px 18px 8px 8px; box-shadow: var(--shadow);
  border: 1px solid #fff;
}
.brand-logo img { width: 58px; height: 58px; object-fit: contain; display: block; animation: hover 3s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-3px) rotate(2deg); } }
.brand h1 { font-size: 26px; color: var(--brown); line-height: 1; font-weight: 900; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--ink-2); font-weight: 600; max-width: 260px; }
.views { display: flex; gap: 4px; margin-left: 10px; background: var(--cream-2); border-radius: 999px; padding: 4px; }
.view-btn { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-weight: 800; color: var(--ink-2); }
.view-btn.is-active { background: var(--honey); color: var(--brown); box-shadow: 0 2px 6px rgba(245,179,0,.4); }

.lv {
  position: fixed; top: 14px; right: 14px; z-index: 20; display: flex; align-items: center; gap: 10px;
  background: var(--card); backdrop-filter: blur(10px); border-radius: 16px; padding: 8px 14px 8px 8px;
  box-shadow: var(--shadow); text-decoration: none; color: var(--ink-2); font-size: 12px; font-weight: 700; line-height: 1.15; border: 1px solid #fff;
}
.lv img { width: 46px; height: 52px; object-fit: contain; }

/* ---------- Seitenleiste ---------- */
.side {
  position: fixed; top: 96px; left: 14px; bottom: 70px; width: var(--side-w); z-index: 15;
  display: flex; flex-direction: column;
  background: var(--card); backdrop-filter: blur(10px); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #fff;
  transition: transform .3s;
}
.side.is-hidden { transform: translateX(calc(-100% - 20px)); }
.side-toggle {
  position: fixed; top: 110px; left: calc(var(--side-w) + 20px); z-index: 16; width: 30px; height: 44px;
  border: 1px solid #fff; border-radius: 0 12px 12px 0; background: var(--card); box-shadow: var(--shadow); color: var(--brown); font-weight: 900; font-size: 18px;
  transition: left .3s;
}
.side-toggle.is-hidden { left: 0; border-radius: 0 12px 12px 0; }
.side-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi { background: var(--honey-3); border-radius: 12px; padding: 8px 6px; text-align: center; }
.kpi b { display: block; font-size: 20px; font-weight: 900; color: var(--brown); line-height: 1.05; }
.kpi span { font-size: 11px; color: var(--ink-2); font-weight: 700; }
.searchbox { margin-top: 10px; }
.searchbox input {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 12px; font: inherit; font-weight: 600;
}
.searchbox input:focus { outline: 2px solid var(--honey); border-color: transparent; }
.sortbar { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; color: var(--ink-2); font-weight: 700; }
.sortbar select { font: inherit; font-weight: 700; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; background: #fff; margin-left: 4px; }
.chk input { vertical-align: -2px; accent-color: var(--honey); }
.list { list-style: none; margin: 0; padding: 6px; overflow: auto; flex: 1; scrollbar-width: thin; }
.list li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 9px 10px; border-radius: 12px; cursor: pointer; align-items: center;
}
.list li:hover, .list li.is-active { background: var(--honey-3); }
.list .nm { grid-column: 1; grid-row: 1; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .nm i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: #b9b2a8; vertical-align: 1px; }
.list .nm i.ok { background: var(--green); }
.list .lc { grid-column: 1; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.list .val { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-weight: 900; font-size: 15px; color: var(--brown); }
.list .val small { display: block; font-size: 11px; font-weight: 700; color: var(--ink-3); }
.list .val.up { color: var(--green); } .list .val.down { color: var(--red); }
.side-foot { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); font-weight: 600; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; }
.side-foot a { color: inherit; }

/* ---------- Tooltip ---------- */
.tip {
  position: fixed; z-index: 30; pointer-events: none; min-width: 210px; max-width: 280px;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 12.5px; border: 1px solid #fff;
  transform: translate(14px, 14px);
}
.tip h4 { margin: 0 0 2px; font-size: 14px; font-weight: 900; color: var(--brown); }
.tip .sub { color: var(--ink-3); font-weight: 700; margin-bottom: 6px; }
.tip table { border-collapse: collapse; width: 100%; }
.tip td { padding: 2px 0; font-weight: 700; }
.tip td:last-child { text-align: right; font-weight: 900; }
.tip .wx-line { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); color: var(--ink-2); font-weight: 700; }
.tip .hint { margin-top: 5px; font-size: 11px; color: var(--ink-3); }
.up { color: var(--green); } .down { color: var(--red); }

/* ---------- Detail-Drawer ---------- */
.detail {
  position: fixed; top: 96px; right: 14px; bottom: 70px; width: min(440px, calc(100vw - 28px)); z-index: 25;
  background: var(--card); backdrop-filter: blur(10px); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid #fff;
  overflow: auto; scrollbar-width: thin; animation: slideIn .3s ease-out;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.detail-close { position: sticky; top: 8px; float: right; margin: 8px 8px 0 0; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--cream-2); color: var(--brown); font-size: 22px; font-weight: 900; line-height: 1; z-index: 2; }
.detail-body { padding: 16px 18px 22px; }
.detail h2 { font-size: 22px; color: var(--brown); line-height: 1.1; padding-right: 36px; }
.detail .sub { color: var(--ink-2); font-weight: 700; margin: 4px 0 12px; font-size: 13px; }
.detail .pill { display: inline-block; background: var(--honey-3); color: var(--brown); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 800; margin: 0 4px 4px 0; }
.detail .pill.flow { background: #E3F3E5; color: #246b30; }
.detail .pill.off { background: #eee; color: #777; }
.dgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 14px; }
.dgrid div { background: #fff; border-radius: 12px; padding: 8px; text-align: center; border: 1px solid var(--line); }
.dgrid b { display: block; font-size: 18px; font-weight: 900; color: var(--brown); }
.dgrid span { font-size: 11px; color: var(--ink-3); font-weight: 700; }
.detail h3 { font-size: 14px; margin: 16px 0 8px; color: var(--ink-2); text-transform: uppercase; letter-spacing: .06em; }
.chart-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.chart-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; color: var(--ink-2); }
.chart-tabs button.is-active { background: var(--honey); border-color: var(--honey); color: var(--brown); }
.detail canvas { width: 100% !important; }
.note { background: #fff; border-left: 4px solid var(--honey); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 6px 0 8px 18px; border-left: 2px solid var(--honey-3); margin-left: 6px; font-size: 13px; }
.timeline li::before { content: ''; position: absolute; left: -6px; top: 10px; width: 10px; height: 10px; border-radius: 50%; background: var(--honey); border: 2px solid #fff; }
.timeline time { display: block; font-size: 11px; color: var(--ink-3); font-weight: 800; }
.timeline .q { white-space: pre-line; }
.timeline .y { font-weight: 900; }
.wxcard { display: flex; gap: 10px; align-items: center; background: linear-gradient(135deg, #E8F6FF, #fff); border-radius: 14px; padding: 10px 12px; border: 1px solid #dceefb; }
.wxcard .big { font-size: 26px; font-weight: 900; color: var(--blue); }
.wxcard .fc { display: flex; gap: 8px; margin-left: auto; }
.wxcard .fc div { text-align: center; font-size: 11px; font-weight: 800; color: var(--ink-2); }
.wxcard .fc b { display: block; font-size: 13px; color: var(--ink); }
.wxcard .fc small { color: var(--blue); }

/* ---------- Dashboard ---------- */
.dash { position: fixed; inset: 0; z-index: 18; overflow: auto; background: linear-gradient(180deg, rgba(255,248,231,.92), rgba(255,248,231,.97)); backdrop-filter: blur(6px); padding: 104px 24px 90px; }
.dash-inner { max-width: 1180px; margin: 0 auto; }
.dash-head h2 { font-size: 30px; color: var(--brown); }
.dash-head p { color: var(--ink-2); font-weight: 700; margin: 4px 0 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tile { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid #fff; position: relative; overflow: hidden; }
.tile b { display: block; font-size: 30px; font-weight: 900; color: var(--brown); line-height: 1; }
.tile b small { font-size: 14px; color: var(--ink-3); margin-left: 2px; }
.tile span { font-size: 12px; font-weight: 800; color: var(--ink-2); }
.tile.honey { background: linear-gradient(135deg, #FFE38A, #FFC93C); }
.tile .ico { position: absolute; right: 10px; top: 8px; font-size: 26px; opacity: .55; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid #fff; }
.card-wide { grid-column: 1 / -1; }
.card h3 { font-size: 14px; color: var(--ink-2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .05em; }
.top { margin: 0; padding: 0 0 0 20px; columns: 2; column-gap: 24px; font-weight: 700; }
.top li { padding: 4px 0; break-inside: avoid; }
.top li b { float: right; color: var(--green); font-weight: 900; }
.top li small { display: block; color: var(--ink-3); font-weight: 600; font-size: 11px; }
.dash-note { color: var(--ink-3); font-size: 12px; font-weight: 600; margin-top: 16px; }

/* ---------- Steuerung, Legende, Sponsor ---------- */
.controls { position: fixed; right: 14px; bottom: 76px; z-index: 20; display: flex; flex-direction: column; gap: 6px; }
.controls button { width: 38px; height: 38px; border-radius: 12px; border: 1px solid #fff; background: var(--card); box-shadow: var(--shadow); font-weight: 900; font-size: 18px; color: var(--brown); }
.controls button:hover { background: var(--honey-3); }
.legend { position: fixed; left: 14px; bottom: 14px; z-index: 20; display: flex; gap: 12px; background: var(--card); border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 700; color: var(--ink-2); box-shadow: var(--shadow); border: 1px solid #fff; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.dot.ok { background: var(--green); } .dot.off { background: #b9b2a8; } .dot.up { background: var(--green); border-radius: 2px; } .dot.down { background: var(--red); border-radius: 2px; }

.sponsor {
  position: fixed; right: 14px; bottom: 14px; z-index: 20; display: flex; flex-direction: column; align-items: flex-end;
  background: #fff; border-radius: 16px; padding: 8px 14px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1px solid #fff;
}
.sponsor-label { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 800; }
.sponsor-logo { display: block; height: 34px; width: auto; max-width: 240px; margin-top: 2px; }

.loading { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--cream); color: var(--brown); font-weight: 800; transition: opacity .4s; }
.loading.is-done { opacity: 0; pointer-events: none; }
.loading-bee { animation: beeLoop 1.6s ease-in-out infinite alternate; }
@keyframes beeLoop { from { transform: translateX(-30px) rotate(-10deg); } to { transform: translateX(30px) rotate(10deg); } }

.empty { padding: 20px; text-align: center; color: var(--ink-3); font-weight: 700; }

/* ---------- Meer: Farbe + wandernde Wellen (GPU) ---------- */
.sea-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; background: #BCE3F6; transform-origin: 0 0; }
.sea-waves { position: absolute; top: 0; bottom: 0; right: 0; left: calc(-1 * var(--tw, 120px));
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='60' viewBox='0 0 120 60'><g fill='none' stroke='%23fff' stroke-linecap='round'><path d='M0 30 Q15 20 30 30 T60 30 T90 30 T120 30' stroke-opacity='.55' stroke-width='2.2'/><path d='M0 52 Q15 44 30 52 T60 52 T90 52 T120 52' stroke-opacity='.35' stroke-width='1.8'/><path d='M0 10 Q12 3 24 10 T48 10 T72 10 T96 10 T120 10' stroke-opacity='.3' stroke-width='1.6'/></g></svg>");
  background-repeat: repeat; background-size: var(--tw, 120px) var(--th, 60px); background-position: var(--bx, 0) var(--by, 0);
  animation: seadrift var(--wdur, 9s) linear infinite; will-change: transform; }
@keyframes seadrift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(var(--tw, 120px), 0, 0); } }
body.off-waves .sea-waves { animation: none !important; }
.stage.is-gesturing .sea-bg { will-change: transform; }

/* Nachbarland-Beschriftung */
.country-label { font: 900 13px var(--font); fill: #A0947C; opacity: .55; letter-spacing: .35em; text-anchor: middle; text-transform: uppercase; pointer-events: none; }

/* Nord-Ostsee-Kanal */
.waterways { pointer-events: none; }
.river { fill: #BCE3F6; }
.river-waves { fill: url(#wavesStatic); }
.river-bank { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.river-label { font: 900 7px var(--font); fill: #2E6A9A; letter-spacing: .35em; opacity: .6; text-transform: uppercase; }
.canal-bank { fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.canal { fill: none; stroke: #A9DBF3; stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }
.canal-label { font: 800 5px var(--font); fill: #2E6A9A; letter-spacing: .08em; opacity: 0; transition: opacity .3s; paint-order: stroke; stroke: #fff; stroke-width: 1.6; }
.show-labels .canal-label { opacity: .9; }

/* Waage ohne Standort */
.noloc { color: #B3741A; font-weight: 800; }

/* ---------- Wind: Strömung, Windsack, Kompass ---------- */
.wshadow { fill: none; stroke: #1D4F78; stroke-opacity: .13; stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.wstreak { fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
#windLayer { pointer-events: none; }
canvas#windLayer { width: 100%; height: 100%; }
.boat { cursor: help; }
.sock .pole { stroke: #6E3B14; stroke-width: 1; stroke-linecap: round; }
.sock .pole-top { fill: #6E3B14; }
.sock-seg.r { fill: #E8463C; } .sock-seg.w { fill: #fff; }
.sock-seg { stroke: rgba(110,59,20,.35); stroke-width: .3; }

.windcard {
  position: fixed; top: 84px; right: 14px; z-index: 18; width: 252px; max-height: calc(100vh - 190px); overflow-y: auto;
  display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; align-items: center;
  background: var(--card); border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); border: 1px solid #fff;
  font-size: 12px; font-weight: 700; color: var(--ink-2); transition: opacity .25s;
}
body.has-detail .windcard { opacity: 0; pointer-events: none; }
.wc-head { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); font-weight: 800; }
.wc-speed b { font-size: 26px; font-weight: 900; color: var(--blue); line-height: 1; }
.wc-speed small { margin-left: 3px; color: var(--ink-3); }
.wc-dir b { color: var(--ink); }
.wc-bft { color: var(--ink-3); font-size: 11px; }
.windcard .fly { grid-column: 1 / -1; }
.wc-toggles { grid-column: 1 / -1; display: flex; gap: 6px; margin-top: 2px; }
.wc-toggles button { flex: 1 1 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 8px; font-size: 11px; font-weight: 800; color: var(--ink-3); }
.wc-toggles button[aria-pressed="true"] { background: var(--honey-3); color: var(--brown); border-color: var(--honey); }

.compass .ring { fill: #fff; stroke: #CFE6F4; stroke-width: 2; }
.compass .gustring { fill: none; stroke: #8CCBF0; stroke-width: 2; stroke-dasharray: calc(188.5 * var(--g)) 188.5; transform: rotate(-90deg); stroke-linecap: round; }
.compass .ticks line { stroke: #8D837A; stroke-width: 1.2; stroke-linecap: round; }
.compass text { font: 900 7px var(--font); fill: var(--ink-3); text-anchor: middle; }
.compass .cn { fill: var(--red); font-size: 8px; }
.compass .needle { fill: var(--blue); transform: rotate(var(--rot, 0deg)); animation: needle var(--dur, 1.6s) ease-in-out infinite alternate; transition: transform .8s; }
.compass .hub { fill: #fff; stroke: var(--blue); stroke-width: 1.5; }
@keyframes needle { from { transform: rotate(calc(var(--rot, 0deg) - var(--amp, 4deg))); } to { transform: rotate(calc(var(--rot, 0deg) + var(--amp, 4deg))); } }

.fly { border-radius: 10px; padding: 4px 8px; font-size: 11.5px; font-weight: 800; background: #EEF6E9; color: #2F7A3B; }
.fly.mid { background: var(--honey-3); color: var(--brown); }
.fly.no { background: #FBE7E4; color: #A8322A; }
.fly.night { background: #E8ECF6; color: #3B4A72; }
.fly small { font-weight: 700; opacity: .7; }

.warr { display: inline-block; font-weight: 900; color: var(--blue); transform-origin: 50% 55%; line-height: 1; }
.tip .wind-line { border-top: 0; margin-top: 2px; padding-top: 0; }

.windbox { display: grid; grid-template-columns: 92px 1fr; gap: 12px; align-items: center; background: #F2F8FC; border-radius: 14px; padding: 10px 12px; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.windbox .big { font-size: 28px; font-weight: 900; color: var(--blue); line-height: 1.05; }
.windbox .big small { font-size: 13px; color: var(--ink-3); }
.windbox .bft { margin: 4px 0; display: flex; align-items: center; gap: 6px; }
.bft-bar { display: inline-block; width: 60px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #8CCBF0 0, #1D6FB8 calc(var(--b) / 12 * 100%), #E6EEF3 calc(var(--b) / 12 * 100%)); }
.windbox .fly { margin-top: 4px; display: inline-block; }
.fc small + small { margin-top: 1px; }

/* ---------- Schiffe & Segelboote ---------- */
.ship { cursor: pointer; }
.ship .hull { stroke: #fff; stroke-width: .8; paint-order: stroke; }
.ship .deckhouse { fill: #fff; stroke: rgba(0,0,0,.25); stroke-width: .25; }
.ship .box { stroke: rgba(0,0,0,.25); stroke-width: .2; }
.ship .box.b1 { fill: #E8463C; } .ship .box.b2 { fill: #F5B300; } .ship .box.b3 { fill: #1D6FB8; }
.ship .pipe { stroke: #F3D9A4; stroke-width: .7; stroke-linecap: round; } .ship .pipe.thin { stroke-width: .45; }
.ship .tank { fill: #E9837A; stroke: #F3D9A4; stroke-width: .4; }
.ship .deck { fill: #EAF4FB; stroke: #1D6FB8; stroke-width: .35; }
.ship .win circle { fill: #1D6FB8; }
.ship .funnel { fill: #E8463C; stroke: #fff; stroke-width: .35; }
.ship .boom { stroke: #6E3B14; stroke-width: .5; stroke-linecap: round; fill: none; }
.ship .mast { fill: #6E3B14; }
.ship .fender { fill: none; stroke: #2B2522; stroke-width: .9; }
.ship .sail { fill: #fff; stroke: #8E44AD; stroke-width: .45; }
.ship .screen { fill: #2B4B66; }
.ship .wake path { fill: none; stroke: #fff; stroke-width: 1.1; stroke-linecap: round; opacity: .85; animation: wake 1.8s ease-in-out infinite alternate; }
.ship.is-still .ship-inner { opacity: .85; }
.c-cargo .hull { fill: #2F7D3A; } .c-tanker .hull { fill: #B83227; } .c-pass .hull { fill: #fff; stroke: #1D6FB8; stroke-width: .6; }
.c-fish .hull { fill: #E89A3C; } .c-service .hull { fill: #0E9AA7; } .c-sail .hull { fill: #fff; stroke: #8E44AD; stroke-width: .6; }
.c-yacht .hull { fill: #fff; stroke: #8E44AD; stroke-width: .6; } .c-other .hull { fill: #8D837A; }
.ship:hover .hull { stroke: var(--honey); stroke-width: 1.3; }
@keyframes wake { from { opacity: .35; } to { opacity: .9; } }
#legShips { display: inline-flex; gap: 9px; align-items: center; padding-left: 10px; border-left: 1px solid var(--line); }
#legShips[hidden] { display: none; }
.lg-ship { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.ship-tip-head { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.ship-tip-head .sub { margin-bottom: 0; }

.boat-bob { animation: bob 3.2s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes bob { from { transform: rotate(-4deg) translateY(0); } to { transform: rotate(4deg) translateY(-.6px); } }
.b-hull { fill: #FFFDF6; stroke: #6E3B14; stroke-width: .7; }
.b-main { fill: #fff; stroke: #5E554E; stroke-width: .35; }
.b-jib { fill: var(--honey); }
.b-mast { stroke: #6E3B14; stroke-width: .7; stroke-linecap: round; }
.b-flag { fill: var(--red); }
.b-wake { fill: none; stroke: #fff; stroke-width: 1; stroke-linecap: round; opacity: .7; }

/* ---------- Heute in SH (Wind-Karte erweitert) ---------- */
.sky-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 2px 9px; font-size: 11.5px; font-weight: 800; color: var(--ink-2); padding-top: 4px; border-top: 1px dashed var(--line); }
.sky-row span { white-space: nowrap; cursor: default; }
.nat-toggle { grid-column: 1 / -1; border: 0; background: none; padding: 2px 0; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 900; color: var(--ink-3); }
.nat-toggle span { display: inline-block; transition: transform .2s; }
.windcard.is-open .nat-toggle span { transform: rotate(180deg); }
.nat-box { grid-column: 1 / -1; display: none; flex-direction: column; gap: 4px; }
.windcard.is-open .nat-box { display: flex; }
.nat-row { font-size: 11.5px; font-weight: 700; color: var(--ink-2); line-height: 1.35; }
.nat-row:empty { display: none; }
.nat-row b { color: var(--ink); }
.nat-row small { color: var(--ink-3); font-weight: 600; }
.nat-row.hot { background: #FFF1D6; border-radius: 8px; padding: 3px 6px; color: var(--brown); }
.chips { flex-wrap: wrap; }
.chips button { flex: 0 1 auto; }

/* ---------- Nacht, Polarlicht ---------- */
#nightShade { transition: fill-opacity 2s; }
body.is-night .orbit, body.is-night .bee-fly { display: none; }
body.is-night .marker .hive-use { filter: drop-shadow(0 0 4px rgba(255, 200, 80, .9)); }
body.is-night .sea-label, body.is-night .kreis-label { fill-opacity: .8; }
.aurora { position: fixed; left: 0; right: 0; top: 0; height: 42vh; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(100deg, rgba(120,255,190,0) 0 22px, rgba(120,255,190,.10) 22px 30px, rgba(120,255,190,0) 30px 58px),
    radial-gradient(120% 75% at 30% -5%, rgba(70,240,160,.55), rgba(70,240,160,0) 62%),
    radial-gradient(90% 65% at 78% -5%, rgba(160,90,255,.45), rgba(160,90,255,0) 66%);
  -webkit-mask-image: linear-gradient(#000 35%, transparent); mask-image: linear-gradient(#000 35%, transparent);
  animation: aurora 9s ease-in-out infinite alternate; }
@keyframes aurora { from { background-position: 0 0, 0 0, 0 0; opacity: .6; } to { background-position: 160px 0, 40px 0, -40px 0; opacity: 1; } }

/* ---------- ISS ---------- */
.iss { cursor: help; }
.iss .panel { fill: #2B5E9A; stroke: #fff; stroke-width: .5; }
.iss .truss { stroke: #8D837A; stroke-width: 1; }
.iss .body { fill: #F2F2F2; stroke: #5E554E; stroke-width: .4; }
.iss .halo { fill: none; stroke: #fff; stroke-width: .6; stroke-dasharray: 2 2; animation: spin 12s linear infinite; transform-box: fill-box; transform-origin: center; }

/* ---------- Natur-Symbole auf der Karte ---------- */
.nat-icon { cursor: pointer; }
.nat-icon .emo { font-size: 9px; text-anchor: middle; }
.bloom-bg { fill: #fff; stroke: var(--honey); stroke-width: 1.2; }
.hornet-ring { fill: #FFF3E8; stroke: var(--red); stroke-width: 1.4; }
.hornet-body .abd { fill: #2B2522; } .hornet-body .head { fill: #E8A400; }
.hornet-body .stripe { stroke: #F5B300; stroke-width: .9; fill: none; }
.hornet-body .wing { fill: rgba(255,255,255,.85); stroke: #5E554E; stroke-width: .3; }
.gauge .pole { fill: #fff; stroke: #1D6FB8; stroke-width: .6; }
.gauge .ticks { stroke: #1D6FB8; stroke-width: .5; }
.gauge .lbl-bg { fill: rgba(255,255,255,.92); stroke: #8CCBF0; stroke-width: .5; }
.gauge .lbl { font: 900 5px var(--font); fill: #1D4F78; }
.gauge.up .lbl { fill: #1D6FB8; } .gauge.down .lbl { fill: #B3741A; }
.marine .sea-val { font: 900 6px var(--font); fill: #1D4F78; text-anchor: middle; paint-order: stroke; stroke: rgba(255,255,255,.85); stroke-width: 2; stroke-linejoin: round; }

/* Warnungen: Kreise einfärben */
.kreis.warn1 { fill: #FFF3A6; } .kreis.warn2 { fill: #FFD27A; } .kreis.warn3 { fill: #FF9C8A; } .kreis.warn4 { fill: #E9A6FF; }

/* ---------- Dashboard: Natur ---------- */
.dash-sub { margin: 26px 0 10px; font-size: 18px; color: var(--brown); }
.bloomtab, .poltab { width: 100%; border-collapse: collapse; font-size: 13px; }
.bloomtab th, .poltab th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 4px 6px; border-bottom: 1px solid var(--line); }
.bloomtab td, .poltab td { padding: 5px 6px; border-bottom: 1px solid var(--line); font-weight: 700; vertical-align: top; }
.bloomtab td small { display: block; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.bloomtab .num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800; }
.badge.ok { background: #EEF6E9; color: #2F7A3B; } .badge.mid { background: var(--honey-3); color: var(--brown); } .badge.past { background: #F1EEE9; color: var(--ink-3); }
.plv { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 3px; background: #E8F3E4; border: 1px solid rgba(0,0,0,.06); }
.plv.l1 { background: #D9EFC4; } .plv.l2 { background: #F7E98C; } .plv.l3 { background: #F9D36A; } .plv.l4 { background: #F6A957; } .plv.l5 { background: #EE7D4B; } .plv.l6 { background: #D9473A; }
.big-num { font-size: 42px; font-weight: 900; color: var(--red); margin: 0; line-height: 1; }

/* ---------- Mobil ---------- */
@media (max-width: 900px) {
  :root { --side-w: min(300px, 80vw); }
  .brand { padding: 6px 12px 6px 6px; gap: 8px; left: 10px; top: 10px; right: 10px; }
  .brand-logo img { width: 44px; height: 44px; }
  .brand h1 { font-size: 20px; }
  .brand p { display: none; }
  .views { margin-left: auto; }
  .view-btn { padding: 6px 10px; font-size: 13px; }
  .lv { top: auto; bottom: 64px; left: 10px; right: auto; padding: 6px; }
  .lv span { display: none; }
  .lv img { width: 36px; height: 40px; }
  .side { top: 70px; left: 10px; bottom: 120px; }
  .side.is-hidden { transform: translateX(calc(-100% - 16px)); }
  .side-toggle { top: 80px; }
  .legend { display: none; }
  .detail { top: auto; bottom: 0; right: 0; left: 0; width: auto; max-height: 72vh; border-radius: 20px 20px 0 0; }
  .controls { bottom: 140px; }
  .sponsor { bottom: 10px; right: 10px; padding: 6px 10px; }
  .sponsor-logo { height: 26px; max-width: 170px; }
  .dash { padding: 80px 12px 90px; }
  .grid { grid-template-columns: 1fr; }
  .top { columns: 1; }
  .dgrid { grid-template-columns: repeat(3, 1fr); }
  .windcard { max-height: calc(100vh - 230px); }
  .sky-row { font-size: 10.5px; gap: 1px 6px; }
  .windcard.is-open { width: min(300px, calc(100vw - 20px)); }
  .windcard { top: 70px; right: 10px; width: 168px; grid-template-columns: 44px 1fr; padding: 7px 9px; gap: 2px 8px; }
  .windcard .compass { width: 44px; height: 44px; }
  .wc-head, .wc-bft { display: none; }
  .wc-speed b { font-size: 20px; }
  .windcard .fly { font-size: 10.5px; padding: 3px 6px; }
  .wc-toggles button { padding: 3px 4px; font-size: 10px; }
  .windbox { grid-template-columns: 76px 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .orbit, .bee-fly, .flower-sway, .wx .sun, .wx .cloud-g, .wx .drop, .wx .flake, .brand-logo img, .loading-bee,
  .compass .needle, .boat-bob, .ship .wake path, .aurora, .iss .halo { animation: none !important; }
}
