/* Lumio Web: dieselbe Nachtseekarten-Identität wie die Landingpage. Seitenleiste links, Inhalt rechts; auf dem Handy Leiste unten. */
:root {
  --bg: #08141c;
  --bg-raised: #0e202b;
  --bg-hover: #142a37;
  --fg: #e3ecef;
  --muted: #8ea3ad;
  --line: #1f3846;
  --brand: #4fb3e0;
  --beacon: #ffd75e;
  --on-beacon: #1b1400;
  --sec-w: #fff4cf;
  --sec-r: #ef5a4b;
  --sec-g: #35b77a;
  --sec-y: #f2c230;
  --ok: #35b77a;
  --warn: #f2a33a;
  --bad: #ef5a4b;
  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Figtree", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Consolas", monospace;
  --leiste: 232px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #eef3f5; --bg-raised: #ffffff; --bg-hover: #e3ebee; --fg: #0b1f2b; --muted: #4d6470; --line: #cdd9de;
    --brand: #00658f; --beacon: #c98a00; --on-beacon: #ffffff; --sec-w: #b98f1c; --sec-r: #c8372a; --sec-g: #1f8a57; --sec-y: #b88a00;
    --ok: #1f8a57; --warn: #b86e00; --bad: #c8372a; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #eef3f5; --bg-raised: #ffffff; --bg-hover: #e3ebee; --fg: #0b1f2b; --muted: #4d6470; --line: #cdd9de;
  --brand: #00658f; --beacon: #c98a00; --on-beacon: #ffffff; --sec-w: #b98f1c; --sec-r: #c8372a; --sec-g: #1f8a57; --sec-y: #b88a00;
  --ok: #1f8a57; --warn: #b86e00; --bad: #c8372a; color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1; margin: 0; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2.2rem, 4vw, 3.4rem); text-transform: uppercase; }
h2 { font-weight: 800; font-size: 1.7rem; text-transform: uppercase; letter-spacing: .01em; }
h3 { font-weight: 600; font-size: 1.25rem; text-transform: uppercase; letter-spacing: .02em; }
p { margin: 0; }
.mono { font-family: var(--font-mono); }
.eyebrow { font: 500 .72rem/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }

/* Shell */
.shell { display: grid; grid-template-columns: var(--leiste) 1fr; min-height: 100%; }
.seitenleiste {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px;
  padding: 22px 14px; border-right: 1px solid var(--line); background: var(--bg);
}
.logo { display: flex; align-items: center; gap: 10px; padding-inline: 10px; text-decoration: none; font: 800 1.6rem/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.logo svg { width: 24px; height: 24px; }
.hauptnav { display: flex; flex-direction: column; gap: 2px; }
.hauptnav a, .theme-schalter {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-weight: 500; background: none; border: 0; cursor: pointer; width: 100%; text-align: left;
}
.hauptnav svg, .theme-schalter svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hauptnav a:hover, .theme-schalter:hover { background: var(--bg-hover); color: var(--fg); }
.hauptnav a[aria-current="page"] { background: var(--bg-raised); color: var(--fg); box-shadow: inset 3px 0 0 var(--beacon); }
.seitenleiste-fuss { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.app-link { font-size: .85rem; color: var(--muted); padding: 8px 12px; }
.inhalt { min-width: 0; outline: none; }
.seite { max-width: 1240px; margin-inline: auto; padding: 32px clamp(16px, 3vw, 40px) 64px; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .seitenleiste {
    position: fixed; inset: auto 0 0 0; top: auto; height: auto; z-index: 50; flex-direction: row; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--line); gap: 0;
  }
  .logo, .seitenleiste-fuss .app-link { display: none; }
  .hauptnav { flex-direction: row; flex: 1; justify-content: space-around; }
  .hauptnav a, .theme-schalter { flex-direction: column; gap: 3px; font-size: .7rem; padding: 6px 8px; width: auto; }
  .hauptnav a[aria-current="page"] { box-shadow: inset 0 2px 0 var(--beacon); }
  .seitenleiste-fuss { margin: 0; flex-direction: row; align-items: center; gap: 2px; }
  .inhalt { padding-bottom: 72px; }
}

/* Gemeinsame Bausteine */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-raised); cursor: pointer; text-decoration: none; font-weight: 500;
}
.knopf:hover { border-color: var(--muted); }
.knopf.primaer { background: var(--beacon); color: var(--on-beacon); border-color: transparent; font-weight: 600; }
.knopf.primaer:hover { filter: brightness(1.06); }
.knopf svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pille { display: inline-flex; align-items: center; gap: 6px; font: 500 .75rem/1 var(--font-mono); padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pille.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.pille.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pille.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.punkte { display: inline-flex; gap: 4px; }
.punkt { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fg) 25%, transparent); }
.punkt.weiss { background: #f4f0e2; } .punkt.rot { background: #e0473a; } .punkt.gruen { background: #2fa36b; } .punkt.gelb { background: #f2c230; }
.laden, .leer, .fehler { padding: 48px 0; color: var(--muted); }
.fehler { color: var(--bad); }
.ladebalken { height: 2px; width: 120px; background: var(--line); overflow: hidden; border-radius: 2px; margin-top: 12px; }
.ladebalken::after { content: ""; display: block; height: 100%; width: 40%; background: var(--beacon); animation: lauf 1.1s ease-in-out infinite; }
@keyframes lauf { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { .ladebalken::after { animation: none; } }

/* Entdecken */
.kopf { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: 24px; }
.kopf .zaehler { font: 500 .85rem var(--font-mono); color: var(--muted); }
.filterleiste { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 28px; }
.suche { position: relative; flex: 1 1 280px; min-width: 0; }
.suche input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised);
}
.suche svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; }
.auswahl { padding: 10px 34px 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-raised); appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.umschalter { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; user-select: none; background: var(--bg-raised); }
.umschalter input { accent-color: var(--beacon); margin: 0; }

.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.karte-kachel { display: flex; flex-direction: column; text-decoration: none; min-width: 0; border-radius: 14px; }
.karte-kachel .bild { aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--bg-raised); border: 1px solid var(--line); position: relative; }
.karte-kachel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.karte-kachel:hover img { transform: scale(1.03); }
.karte-kachel .ohne-bild { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); }
.karte-kachel .ohne-bild svg { width: 40%; height: 40%; }
.karte-kachel .status { position: absolute; top: 10px; left: 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(6px); }
.karte-kachel .text { padding: 12px 2px 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.karte-kachel .name { font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.karte-kachel .zeile { display: flex; justify-content: space-between; gap: 8px; align-items: center; color: var(--muted); font-size: .85rem; min-width: 0; }
.karte-kachel .kennung { font: 400 .8rem var(--font-mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mehr-laden { display: flex; justify-content: center; margin-top: 32px; }

/* Karte */
.kartenseite { position: relative; height: 100vh; }
@media (max-width: 760px) { .kartenseite { height: calc(100vh - 64px); } }
.kartenseite .map { position: absolute; inset: 0; }
.karten-panel {
  position: absolute; top: 16px; left: 16px; z-index: 5; width: min(340px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 10px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; padding: 14px;
}
.karten-panel .suche { flex: none; }
.karten-panel .suche input { padding-block: 9px; }
.karten-panel .optionen { display: flex; flex-wrap: wrap; gap: 8px; }
.karten-panel .umschalter { padding: 7px 11px; font-size: .88rem; }
.treffer { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.treffer button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 6px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 8px; }
.treffer button:hover { background: var(--bg-hover); }
.treffer small { color: var(--muted); }
.legende { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.maplibregl-popup-content { background: var(--bg-raised); color: var(--fg); border-radius: 12px; padding: 0; overflow: hidden; box-shadow: 0 8px 30px rgb(0 0 0 / .35); font-family: var(--font-body); }
.maplibregl-popup-tip { border-top-color: var(--bg-raised) !important; border-bottom-color: var(--bg-raised) !important; }
.maplibregl-popup-close-button { color: var(--fg); font-size: 18px; padding: 2px 8px; }
.popup { width: 240px; }
.popup img { width: 100%; height: 130px; object-fit: cover; display: block; }
.popup .text { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.popup strong { font-size: 1rem; }
.popup .mono { font-size: .78rem; color: var(--muted); }
.popup a.knopf { margin-top: 6px; padding: 7px 12px; font-size: .85rem; align-self: flex-start; }

/* Detail */
.zurueck { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; margin-bottom: 20px; font-size: .9rem; }
.zurueck:hover { color: var(--fg); }
.detail-kopf { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
@media (max-width: 980px) { .detail-kopf { grid-template-columns: 1fr; } }
.detail-bild { border-radius: 18px; overflow: hidden; background: var(--bg-raised); border: 1px solid var(--line); aspect-ratio: 4 / 3; }
.detail-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bildnachweis { font-size: .75rem; color: var(--muted); margin-top: 8px; }
.detail-titel { display: flex; flex-direction: column; gap: 14px; }
.pillen { display: flex; flex-wrap: wrap; gap: 8px; }
.kennzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-top: 6px; }
.kennzahlen div { background: var(--bg); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kennzahlen b { font: 600 1.35rem/1.1 var(--font-display); letter-spacing: .02em; overflow-wrap: anywhere; }
.kennzahlen span { font-size: .75rem; color: var(--muted); }
.aktionen { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }

.abschnitt { margin-top: 48px; }
.abschnitt > h2 { margin-bottom: 18px; }
.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; }
@media (max-width: 980px) { .zweispaltig { grid-template-columns: 1fr; } }

.feuer-liste { display: flex; flex-direction: column; gap: 10px; }
.feuer { display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-raised); }
.feuer .lampe { width: 30px; height: 30px; border-radius: 50%; margin: auto; background: var(--lampe); opacity: .14; transition: opacity .08s linear, box-shadow .08s linear; }
.feuer .lampe[data-an="1"] { opacity: 1; box-shadow: 0 0 18px 4px color-mix(in srgb, var(--lampe) 70%, transparent); }
.feuer .info { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.feuer .k { font: 500 1rem var(--font-mono); overflow-wrap: anywhere; }
.feuer .d { font-size: .82rem; color: var(--muted); }
.takt { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--fg) 8%, transparent); margin-top: 6px; position: relative; }
.takt i { display: block; height: 100%; }
.takt i.an { background: var(--lampe); }
.takt .kopfzeiger { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--fg); }

.sektor-karte { height: 420px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabelle th { font-weight: 500; color: var(--muted); width: 42%; padding-right: 16px; font-size: .9rem; }
.tabelle td { overflow-wrap: anywhere; }
.tabellen-box { overflow-x: auto; }

.geschichte { max-width: 68ch; display: flex; flex-direction: column; gap: 14px; }
.geschichte .einleitung { font-size: 1.12rem; }
.geschichte p { white-space: pre-line; }

/* Meldungen */
.meldungen { display: flex; flex-direction: column; gap: 12px; }
.meldung { border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; background: var(--bg-raised); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.meldung.abgelaufen { opacity: .7; }
.meldung .oben { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.meldung h3 { font-family: var(--font-body); text-transform: none; font-size: 1.05rem; font-weight: 600; letter-spacing: 0; line-height: 1.35; }
.meldung .beschreibung { white-space: pre-line; color: var(--muted); font-size: .92rem; }
.meldung .unten { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .82rem; color: var(--muted); }
.meldung .unten a { color: var(--brand); }
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.reiter button { border: 1px solid var(--line); background: none; border-radius: 999px; padding: 8px 14px; cursor: pointer; color: var(--muted); }
.reiter button[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }

/* Quiz */
.quiz { max-width: 760px; }
.quiz-start { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 28px; }
.quiz-modus { text-align: left; border: 1px solid var(--line); background: var(--bg-raised); border-radius: 16px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.quiz-modus:hover { border-color: var(--beacon); }
.quiz-modus strong { font: 600 1.25rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .02em; }
.quiz-modus span { color: var(--muted); font-size: .9rem; }
.quiz-modus small { font: 500 .75rem var(--font-mono); color: var(--beacon); margin-top: 4px; }
.fortschritt { display: flex; gap: 4px; margin: 20px 0 24px; }
.fortschritt i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.fortschritt i.richtig { background: var(--ok); } .fortschritt i.falsch { background: var(--bad); } .fortschritt i.jetzt { background: var(--beacon); }
.frage { display: flex; flex-direction: column; gap: 18px; }
.frage .frage-bild { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--bg-raised); border: 1px solid var(--line); }
.frage .frage-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.frage .frage-text { font-size: 1.3rem; font-weight: 600; line-height: 1.35; }
.antworten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 560px) { .antworten { grid-template-columns: 1fr; } }
.antwort { text-align: left; border: 1px solid var(--line); background: var(--bg-raised); border-radius: 12px; padding: 14px 16px; cursor: pointer; font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
.antwort:hover:not(:disabled) { border-color: var(--muted); }
.antwort.mono-antwort { font-family: var(--font-mono); font-size: .92rem; }
.antwort.richtig { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 16%, var(--bg-raised)); }
.antwort.falsch { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--bg-raised)); }
.antwort:disabled { cursor: default; }
.ergebnis { text-align: left; display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.ergebnis .gross { font: 800 5rem/1 var(--font-display); color: var(--beacon); }
