/* ============================================================
   Sylt Live – Nordsee-Theme
   Palette: tiefes Nordsee-Blau/Petrol, Sand-Beige, Dünengras-Grün,
   Sonnenuntergangs-Koralle. Dunkles Abenddesign, mobile-first.
   Lebendig: animierte Wellen, Live-Pulse, Tageszeit-Themes.
   ============================================================ */

:root {
  --deep: #0a1e30;
  --deep-2: #0d2740;
  --petrol: #0f3a4d;
  --petrol-light: #1b5a72;
  --sea-glow: #2a7ea6;
  --sand: #e8d9b8;
  --sand-dim: #b8a888;
  --grass: #8fb573;
  --coral: #ff8a6b;
  --coral-soft: #ffb29c;
  --live-red: #ff5f56;
  --text: #eef3f6;
  --muted: #9db4c0;
  --card-bg: rgba(255, 255, 255, 0.055);
  --card-border: rgba(255, 255, 255, 0.09);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 20px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, #14344e 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 30%, #0f3a4d 0%, transparent 55%),
    linear-gradient(180deg, var(--deep) 0%, #081726 100%);
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.5;
  transition: background 1.5s ease;
}

a { color: var(--coral-soft); }
.muted { color: var(--muted); font-size: 0.85rem; }

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------- Header ---------------- */

.site-header {
  position: relative;
  overflow: hidden;
  padding: 56px 0 84px;
  background:
    radial-gradient(700px 300px at 75% 0%, rgba(255, 138, 107, 0.22) 0%, transparent 65%),
    linear-gradient(180deg, #123650 0%, var(--deep-2) 70%, transparent 100%);
  transition: background 1.5s ease;
}

/* Tageszeit-Varianten (Klasse am <body>, via JS) */
.theme-dawn .site-header {
  background:
    radial-gradient(720px 320px at 70% 0%, rgba(255, 176, 120, 0.34) 0%, transparent 66%),
    linear-gradient(180deg, #1a3a55 0%, var(--deep-2) 70%, transparent 100%);
}
.theme-day .site-header {
  background:
    radial-gradient(720px 320px at 75% 0%, rgba(255, 214, 140, 0.20) 0%, transparent 66%),
    linear-gradient(180deg, #16425e 0%, var(--deep-2) 70%, transparent 100%);
}
.theme-dusk .site-header {
  background:
    radial-gradient(780px 340px at 72% 0%, rgba(255, 118, 88, 0.38) 0%, transparent 68%),
    linear-gradient(180deg, #1c3050 0%, var(--deep-2) 70%, transparent 100%);
}
.theme-night .site-header {
  background:
    radial-gradient(700px 300px at 75% 0%, rgba(120, 150, 220, 0.13) 0%, transparent 65%),
    linear-gradient(180deg, #091422 0%, #0a1a2c 70%, transparent 100%);
}

/* Sterne (nur nachts sichtbar, per JS generiert) */
.header-stars { position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 2.5s ease; }
.theme-night .header-stars, .theme-dusk .header-stars { opacity: 1; }
.theme-dusk .header-stars { opacity: .45; }
.header-stars .star {
  position: absolute;
  width: 2px; height: 2px;
  border-radius: 50%;
  background: #dfeaff;
  animation: twinkle var(--tw-dur, 3s) ease-in-out infinite;
  animation-delay: var(--tw-del, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: .12; transform: scale(.7); }
  50%      { opacity: .95; transform: scale(1.2); }
}

.header-inner {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-end;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 52px; height: 52px; flex: none; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }

.brand h1 {
  margin: 0;
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  line-height: 1.05;
}
.brand h1 span {
  color: var(--coral);
  font-weight: 400;
  font-style: italic;
}
.place { margin: 2px 0 0; color: var(--sand); font-size: 0.95rem; letter-spacing: 0.14em; text-transform: uppercase; }

.header-meta { text-align: right; }

/* Live-Status-Chip */
.live-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}
.live-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 10px var(--live-red);
  animation: live-pulse 1.6s ease-in-out infinite;
  flex: none;
}
.live-word {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #ffb4a2;
}
.live-age { color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.live-status.stale .live-dot { background: #e8b45a; box-shadow: 0 0 10px #e8b45a; }
.live-status.stale .live-word { color: #e8c98a; }

@keyframes live-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(.55); opacity: .5; }
}

.clock { display: flex; flex-direction: column; align-items: flex-end; }
#clock-time { font-size: 2rem; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.1; }
.sun-times { display: flex; gap: 16px; justify-content: flex-end; margin-top: 6px; color: var(--sand); }
.sun { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.mini-icon { width: 18px; height: 18px; }

/* Header-Wellen: sanftes Pulsieren */
.header-waves { position: absolute; inset: auto 0 0 0; height: 110px; z-index: 1; }
.wave { position: absolute; bottom: 0; left: 0; width: 200%; height: 100%; }
.wave path { fill: rgba(27, 90, 114, 0.5); }
.wave-1 { animation: wave-drift 16s ease-in-out infinite alternate; }
.wave-2 { animation: wave-drift 11s ease-in-out infinite alternate-reverse; opacity: .7; }
.wave-2 path { fill: rgba(15, 58, 77, 0.65); }

@keyframes wave-drift {
  from { transform: translateX(0) translateY(0); }
  to   { transform: translateX(-6%) translateY(6px); }
}

/* ---------------- Warnungs-Banner ---------------- */

.alerts-banner {
  background: linear-gradient(90deg, #7a2c1d, #a03d24);
  border-block: 1px solid rgba(255, 178, 156, 0.4);
  animation: slide-down .45s cubic-bezier(.22,.9,.3,1);
}
@keyframes slide-down {
  from { transform: translateY(-100%); opacity: 0; }
}
.alerts-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.alert-icon { width: 26px; height: 26px; flex: none; color: #ffd7c9; margin-top: 2px; animation: alert-wiggle 2.5s ease-in-out infinite; transform-origin: top center; }
@keyframes alert-wiggle {
  0%, 88%, 100% { transform: rotate(0); }
  90% { transform: rotate(9deg); }
  94% { transform: rotate(-9deg); }
}
#alerts-content h3 { margin: 0 0 2px; font-size: 1rem; }
#alerts-content p { margin: 0 0 6px; font-size: 0.88rem; color: #ffe4da; }
#alerts-content .alert-item + .alert-item { border-top: 1px solid rgba(255,255,255,.18); padding-top: 8px; margin-top: 8px; }

/* ---------------- Karten-Grid ---------------- */

main.container { margin-top: -56px; position: relative; z-index: 3; padding-bottom: 24px; }

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  backdrop-filter: blur(8px);
}
.card:hover {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.45);
}
.card-wide { margin-bottom: 16px; }

/* Eingangsanimation (per IntersectionObserver) */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity .7s ease var(--reveal-delay, 0s),
    transform .7s cubic-bezier(.22,.8,.3,1) var(--reveal-delay, 0s),
    box-shadow .35s ease,
    border-color .35s ease;
}
.reveal.in { opacity: 1; transform: none; }
html:not(.js) .reveal { opacity: 1; transform: none; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; font-size: 1.1rem; letter-spacing: 0.03em; }
.subhead { font-size: 0.95rem; color: var(--sand); margin: 18px 0 10px; display: flex; align-items: center; gap: 8px; }
.card-foot { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.07); }

/* Badges: Kennzeichnung der Datenart */
.badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
}
.badge-measured { background: rgba(143, 181, 115, 0.18); color: var(--grass); border: 1px solid rgba(143,181,115,.4); }
.badge-measured::before { background: var(--grass); box-shadow: 0 0 7px var(--grass); animation: live-pulse 2.4s ease-in-out infinite; }
.badge-forecast { background: rgba(255, 138, 107, 0.15); color: var(--coral-soft); border: 1px solid rgba(255,138,107,.4); }
.badge-forecast::before { background: var(--coral-soft); opacity: .7; }
.badge-model    { background: rgba(120, 170, 210, 0.15); color: #9cc8e8; border: 1px solid rgba(120,170,210,.4); }
.badge-model::before { background: #9cc8e8; opacity: .7; }
.badge-official { background: rgba(232, 217, 184, 0.14); color: var(--sand); border: 1px solid rgba(232,217,184,.4); }
.badge-official::before { background: var(--sand); opacity: .7; }
.badge-live     { background: rgba(255, 90, 90, 0.16); color: #ff9c9c; border: 1px solid rgba(255,90,90,.45); }
.badge-live::before { background: var(--live-red); box-shadow: 0 0 8px var(--live-red); animation: live-pulse 1.6s ease-in-out infinite; }

/* Zahlen */
.big-number { font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.unit { font-size: 1.1rem; color: var(--muted); margin-left: 4px; }

/* Stat-Zeilen */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.stat {
  flex: 1 1 90px;
  background: rgba(255,255,255,.04);
  border-radius: 12px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------- Deck (Kamera + Kernzahlen) ---------------- */

.deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.deck-cam { grid-column: 1 / -1; display: grid; }
.deck-cam .cam-tile { aspect-ratio: 16 / 9; width: 100%; height: 100%; }

.deck-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 10px 12px;
  backdrop-filter: blur(8px);
}
.ds-icon-wrap { flex: none; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.ds-icon-wrap svg { width: 30px; height: 30px; }
.ds-icon-wrap.wind { color: var(--coral); }
.ds-icon-wrap.waves { color: #7db8e8; }
.ds-icon-wrap.water { color: #6fd3e7; }
.ds-arrow { transition: transform 1.2s cubic-bezier(.34,1.3,.5,1); }
.ds-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.ds-value { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ds-value small { font-size: 0.78rem; color: var(--muted); font-weight: 600; margin-left: 1px; }
.ds-label {
  font-size: 0.68rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck-tide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  background: linear-gradient(90deg, rgba(255, 138, 107, 0.14), rgba(27, 90, 114, 0.28));
  border: 1px solid rgba(255, 138, 107, 0.3);
  border-radius: 14px;
  padding: 9px 14px;
}
.deck-tide svg { width: 22px; height: 22px; color: var(--coral-soft); flex: none; }
.dt-main { font-size: 1rem; }
.dt-main strong { color: var(--coral); }
.dt-side { margin-left: auto; }

/* ---------------- Wetter-Hero ---------------- */

.weather-main { display: flex; align-items: center; gap: 16px; }
.weather-icon svg { width: 76px; height: 76px; }
.condition { font-size: 1.05rem; margin: 0; color: var(--sand); }

/* Animierte Wetter-Icons */
.wx-icon { overflow: visible; }
.wx-icon .rays { transform-box: fill-box; transform-origin: center; animation: spin-slow 26s linear infinite; }
.wx-icon .bob { animation: icon-bob 5.5s ease-in-out infinite; }
.wx-icon .drops line { animation: rain-fall 1.3s linear infinite; }
.wx-icon .drops line:nth-child(2) { animation-delay: .45s; }
.wx-icon .drops line:nth-child(3) { animation-delay: .9s; }
.wx-icon .snow-flakes circle { animation: snow-fall 2.6s linear infinite; }
.wx-icon .snow-flakes circle:nth-child(2) { animation-delay: .85s; }
.wx-icon .snow-flakes circle:nth-child(3) { animation-delay: 1.7s; }
.wx-icon .bolt { animation: bolt-flash 3.4s ease-in-out infinite; }
.wx-icon .fog-lines line { animation: fog-drift 4.2s ease-in-out infinite alternate; }
.wx-icon .fog-lines line:nth-child(2) { animation-delay: 1.4s; }
.wx-icon .wind-lines path { stroke-dasharray: 42 16; animation: wind-flow 2.8s linear infinite; }
.wx-icon .wind-lines path:nth-child(2) { animation-delay: .5s; }
.wx-icon .wind-lines path:nth-child(3) { animation-delay: 1.1s; }

@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes icon-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2.5px); }
}
@keyframes rain-fall {
  0%   { transform: translateY(-3px); opacity: 0; }
  25%  { opacity: 1; }
  100% { transform: translateY(7px); opacity: 0; }
}
@keyframes snow-fall {
  0%   { transform: translateY(-3px); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: translateY(5px); opacity: 0; }
}
@keyframes bolt-flash {
  0%, 100% { opacity: .55; }
  8%       { opacity: 1; }
  12%      { opacity: .4; }
  16%      { opacity: 1; }
  30%      { opacity: .6; }
}
@keyframes fog-drift {
  from { transform: translateX(-3px); }
  to   { transform: translateX(3px); }
}
@keyframes wind-flow {
  to { stroke-dashoffset: -58; }
}

/* ---------------- Wind ---------------- */

.wind-main { display: flex; align-items: center; gap: 20px; }
.compass { position: relative; width: 150px; height: 150px; flex: none; }
.compass-svg { width: 100%; height: 100%; }
.compass-ring { fill: rgba(255,255,255,.04); stroke: rgba(255,255,255,.15); stroke-width: 1.5; }
.compass-dash-ring {
  fill: none;
  stroke: rgba(255,255,255,.2);
  stroke-width: 1;
  stroke-dasharray: 3 8;
  transform-box: fill-box;
  transform-origin: center;
  animation: spin-slow 46s linear infinite reverse;
}
.compass-letter { fill: var(--muted); font-size: 11px; text-anchor: middle; font-weight: 600; }
.wind-arrow {
  transform-origin: 60px 60px;
  transform: rotate(0deg);
  transition: transform 1.2s cubic-bezier(.34,1.3,.5,1);
}
.compass-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
}
.compass-center .big-number { font-size: 1.7rem; }
.compass-center .unit { font-size: 0.75rem; margin: 0; }
.wind-facts p { margin: 4px 0; }
.beaufort-text { font-size: 0.85rem; }

/* ---------------- Meer & Wellen (Hero) ---------------- */

.sea-hero-card {
  position: relative;
  overflow: hidden;
  padding: 0;
  min-height: 320px;
}
#sea-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(180deg, transparent 42%, rgba(27, 90, 114, 0.35) 100%);
}
#sea-buoy {
  position: absolute;
  left: 72%;
  top: 58%;
  width: 44px;
  height: 66px;
  z-index: 1;
  pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.35));
  will-change: transform;
}
.sea-content {
  position: relative;
  z-index: 2;
  padding: 20px;
  min-height: inherit;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg,
      rgba(8, 23, 38, 0.88) 0%,
      rgba(8, 23, 38, 0.52) 38%,
      rgba(8, 23, 38, 0.10) 60%,
      rgba(8, 23, 38, 0.42) 100%);
}
.sea-content .card-foot { margin-top: auto; padding-top: 10px; }
/* Freiraum, in dem die animierten Wellen sichtbar bleiben */
.sea-waves-space { flex: none; height: 118px; margin-top: -8px; }
.sea-hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 6px 0 18px;
}
.sea-big-num .big-number { font-size: 3.1rem; }
.sea-big-num .unit { font-size: 1.3rem; }
.sea-dir-line { margin: 8px 0 0; }
.sea-dir-line strong { color: var(--sand); font-weight: 600; }
.sea-side { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.sea-side .stat { flex: 1 1 96px; }

.pegel-box {
  margin-top: 12px;
  background: rgba(232, 217, 184, 0.07);
  border: 1px dashed rgba(232, 217, 184, 0.3);
  border-radius: 12px;
  padding: 8px 12px;
  max-width: 260px;
  font-size: 0.9rem;
}

/* ---------------- Gezeiten ---------------- */

.tide-layout { display: grid; grid-template-columns: 1fr; gap: 16px; }
.tide-next { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; }
.tide-countdown { display: flex; align-items: baseline; gap: 10px; }
.tide-type { font-size: 1.1rem; font-weight: 700; color: var(--coral); }
.tide-countdown .big-number { font-size: 1.9rem; white-space: nowrap; }
.tide-chart svg { width: 100%; height: 110px; display: block; margin-top: 12px; }
.tide-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 0; }
.tide-lists h3 { margin: 0 0 6px; font-size: 0.9rem; color: var(--sand); }
.tide-list { list-style: none; margin: 0; padding: 0; }
.tide-list li {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}
.tide-list li .t-hw { color: var(--coral-soft); font-weight: 600; }
.tide-list li .t-nw { color: #9cc8e8; font-weight: 600; }
.tide-list li.past { opacity: 0.45; }

/* ---------------- Vorhersage ---------------- */

.hourly-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.hour-cell {
  flex: 0 0 64px;
  background: rgba(255,255,255,.045);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  transition: transform .25s ease, background .25s ease;
}
.hour-cell:hover { transform: translateY(-2px); background: rgba(255,255,255,.08); }
.hour-cell.now { outline: 1.5px solid var(--coral); box-shadow: 0 0 16px rgba(255, 138, 107, 0.28); }
.hour-cell .h-time { font-size: 0.72rem; color: var(--muted); }
.hour-cell .h-icon svg { width: 26px; height: 26px; }
.hour-cell .h-temp { font-weight: 700; font-variant-numeric: tabular-nums; }
.hour-cell .h-rain { font-size: 0.72rem; color: #9cc8e8; }
.hour-cell .h-wind { font-size: 0.72rem; color: var(--sand-dim); }

.daily-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.day-cell {
  background: rgba(255,255,255,.045);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform .25s ease, background .25s ease;
}
.day-cell:hover { transform: translateY(-2px); background: rgba(255,255,255,.08); }
.day-cell .d-name { flex: 1 1 auto; font-size: 0.9rem; }
.day-cell .d-icon svg { width: 30px; height: 30px; }
.day-cell .d-temps { font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-cell .d-temps .max { font-weight: 700; }
.day-cell .d-temps .min { color: var(--muted); margin-left: 6px; }
.day-cell .d-rain { font-size: 0.75rem; color: #9cc8e8; white-space: nowrap; }

/* ---------------- Badewasser ---------------- */

.bathing-status { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; margin-bottom: 6px; }
.status-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--muted);
  box-shadow: 0 0 10px currentColor;
}
.status-dot.open { background: var(--grass); color: var(--grass); animation: live-pulse 2.4s ease-in-out infinite; }
.status-dot.closed { background: #ff6b6b; color: #ff6b6b; animation: live-pulse 1.4s ease-in-out infinite; }
.eu-class { margin: 12px 0 0; }
.eu-class strong { color: var(--sand); }

/* ---------------- Luft ---------------- */

.air-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.lqi-circle {
  width: 84px; height: 84px; flex: none;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--grass);
  background: rgba(143, 181, 115, 0.12);
  transition: border-color .8s ease, background .8s ease, box-shadow .8s ease;
  box-shadow: 0 0 18px rgba(143, 181, 115, 0.18);
}
.lqi-circle .big-number { font-size: 2rem; }

/* ---------------- Webcams ---------------- */

.cam-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cam-tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #06121d;
  border: 1px solid var(--card-border);
  cursor: pointer;
  aspect-ratio: 16 / 10;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  width: 100%;
  transition: border-color .3s ease, box-shadow .3s ease;
}
.cam-tile:hover, .cam-tile:focus-visible {
  border-color: rgba(255, 138, 107, 0.45);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.cam-tile img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease, opacity .6s ease;
}
.cam-tile img.cam-loading { opacity: 0; }
.cam-tile:hover img, .cam-tile:focus-visible img { transform: scale(1.03); }
.cam-tile .cam-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(4, 12, 20, 0.85));
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.cam-tile .cam-name { font-weight: 600; font-size: 0.95rem; }
.cam-tile .cam-place { font-size: 0.75rem; color: var(--muted); display: block; }
.cam-tile .cam-play {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 138, 107, 0.9);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s cubic-bezier(.34,1.4,.5,1), background .3s ease;
}
.cam-tile:hover .cam-play { transform: scale(1.12); background: var(--coral); }
.cam-tile .cam-play svg { width: 14px; height: 14px; }
.cam-tile.cam-static { cursor: default; }
.cam-tile.cam-static:hover img { transform: none; }
.cam-tile .cam-error {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.85rem; text-align: center; padding: 12px;
}

/* Live-/Aktualisierungs-Chip auf den Kacheln */
.cam-chip {
  position: absolute;
  top: 10px; left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(4, 12, 20, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(4px);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cam-chip .live-dot { width: 7px; height: 7px; }
.cam-chip.chip-static { color: var(--sand); font-weight: 600; letter-spacing: .04em; text-transform: none; }
.cam-chip.chip-static .live-dot { background: var(--sand); box-shadow: none; animation: none; opacity: .75; }

/* ---------------- Webcam-Modal ---------------- */

.cam-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.cam-modal[hidden] { display: none; }
.cam-modal-backdrop { position: absolute; inset: 0; background: rgba(3, 9, 16, 0.8); backdrop-filter: blur(4px); animation: fade-in .25s ease; }
.cam-modal-box {
  position: relative;
  width: min(960px, 94vw);
  background: var(--deep-2);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: modal-in .3s cubic-bezier(.22,.9,.3,1.15);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in {
  from { transform: translateY(16px) scale(.965); opacity: 0; }
}
.cam-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
}
.cam-modal-head h3 { margin: 0; font-size: 1rem; }
.cam-modal-close {
  background: rgba(255,255,255,.08);
  border: none; color: var(--text);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 1rem; cursor: pointer;
}
.cam-modal-close:hover { background: rgba(255,255,255,.16); }
.cam-modal-body { background: #000; aspect-ratio: 16/9; position: relative; }
.cam-modal-body video { width: 100%; height: 100%; display: block; }
.cam-modal-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  background: #06121d;
  text-align: center; padding: 20px;
}
.cam-modal-error[hidden] { display: none; }

/* ---------------- Footer ---------------- */

.site-footer {
  margin-top: 12px;
  padding: 28px 0 48px;
  border-top: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
}
.site-footer h2 { font-size: 1rem; margin: 0 0 12px; color: var(--sand); }
.source-list { margin: 0; padding-left: 18px; font-size: 0.85rem; color: var(--muted); }
.source-list li { margin-bottom: 6px; }
.disclaimer {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--coral);
  background: rgba(255, 138, 107, 0.08);
  border-radius: 0 10px 10px 0;
  font-size: 0.85rem;
  color: var(--sand);
}

/* ---------------- Desktop ---------------- */

@media (min-width: 700px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .cam-grid { grid-template-columns: repeat(2, 1fr); }
  .daily-grid { grid-template-columns: repeat(4, 1fr); }
  .brand h1 { font-size: 2.8rem; }
  .sea-hero-grid { grid-template-columns: 1.05fr 1.05fr 0.9fr; align-items: start; }
  .sea-side { flex-direction: column; flex-wrap: nowrap; }
  .sea-side .stat { flex: none; }
  .sea-waves-space { height: 72px; }
  .tide-layout { grid-template-columns: 1.5fr 1fr; align-items: start; }
  .tide-chart svg { height: 130px; }
}

@media (min-width: 820px) {
  .deck { grid-template-columns: 1.5fr 1fr 1fr; gap: 12px; }
  .deck-cam { grid-column: 1; grid-row: 1 / 3; }
  .deck-cam .cam-tile { aspect-ratio: auto; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cam-grid { grid-template-columns: repeat(3, 1fr); }
  .daily-grid { grid-template-columns: repeat(7, 1fr); }
  .day-cell { flex-direction: column; text-align: center; gap: 4px; }
}

/* ---------------- Smartphone: alles kompakt ---------------- */

@media (max-width: 699px) {
  .site-header { padding: 24px 0 58px; }
  .header-inner { align-items: center; gap: 8px 12px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand h1 { font-size: 1.65rem; }
  .place { font-size: 0.68rem; letter-spacing: 0.12em; }
  .live-status { margin-bottom: 3px; }
  .live-word { font-size: 0.64rem; }
  .live-age { font-size: 0.72rem; }
  .clock { flex-direction: row; align-items: baseline; gap: 8px; }
  #clock-time { font-size: 1.3rem; }
  .clock .muted { font-size: 0.72rem; }
  .sun-times { font-size: 0.76rem; gap: 10px; margin-top: 3px; }
  .mini-icon { width: 14px; height: 14px; }
  .header-waves { height: 62px; }

  main.container { margin-top: -36px; }
  .card { padding: 16px; border-radius: 16px; }
  .card-head { margin-bottom: 10px; }
  .card-head h2 { font-size: 1rem; }
  .big-number { font-size: 2.1rem; }

  .weather-icon svg { width: 58px; height: 58px; }
  .weather-main { gap: 12px; }
  .compass { width: 116px; height: 116px; }
  .compass-center .big-number { font-size: 1.4rem; }

  .sea-hero-card { min-height: 0; }
  .sea-big-num .big-number { font-size: 2.4rem; }
  .sea-hero-grid { gap: 14px; margin: 4px 0 14px; }
  /* kleiner Puffer: Stats liegen leicht auf den Wellen (Glas-auf-Wasser) */
  .sea-waves-space { height: 34px; }

  .cam-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cam-tile { border-radius: 12px; }
  .cam-tile .cam-label { padding: 16px 8px 8px; }
  .cam-tile .cam-name { font-size: 0.82rem; }
  .cam-tile .cam-place { font-size: 0.66rem; }
  .cam-tile .cam-play { width: 28px; height: 28px; }
  .cam-chip { font-size: 0.58rem; padding: 3px 8px; gap: 5px; top: 7px; left: 7px; }

  .tide-countdown .big-number { font-size: 1.5rem; }
  .tide-chart svg { height: 84px; }
}

/* ---------------- Reduzierte Bewegung ---------------- */

@media (prefers-reduced-motion: reduce) {
  .wave-1, .wave-2,
  .live-dot,
  .badge::before,
  .status-dot,
  .alert-icon,
  .header-stars .star,
  .compass-dash-ring,
  .wx-icon .rays, .wx-icon .bob,
  .wx-icon .drops line, .wx-icon .snow-flakes circle,
  .wx-icon .bolt, .wx-icon .fog-lines line, .wx-icon .wind-lines path {
    animation: none !important;
  }
  .wind-arrow, .cam-tile img, .cam-tile, .hour-cell, .day-cell, .lqi-circle { transition: none; }
  .reveal { transition: none; opacity: 1; transform: none; }
}
