/* 1los.de – Vulkan und Tsunami App · „Basalt & Glut“ */
:root {
  --bg: #0b0908;
  --panel: rgba(18, 15, 13, .84);
  --panel-fest: #15110f;
  --linie: rgba(255, 232, 214, .10);
  --linie2: rgba(255, 232, 214, .18);
  --text: #f1eae3;
  --leise: #a59a90;
  --glut: #ff6a1a;
  --glut2: #ffb04a;
  --rot: #ff3d2e;
  --aktiv: #ff8a2a;
  --unruhe: #f2c94c;
  --ruhend: #8d8178;
  --beben: #e9e3b6;
  --tsu-gross: #b84dff;
  --tsu-warn: #ff2f3a;
  --tsu-hinweis: #ffd23a;
  --tsu-info: #7cc4ff;
  --ok: #7cc47a;
  --schatten: 0 12px 40px rgba(0, 0, 0, .45);
  --mono: "Cascadia Mono", "Cascadia Code", Consolas, ui-monospace, monospace;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
:root[data-theme="hell"] {
  --bg: #e2dace;
  --panel: rgba(241, 235, 225, .88);
  --panel-fest: #f1ebe2;
  --linie: rgba(84, 60, 38, .12);
  --linie2: rgba(84, 60, 38, .22);
  --text: #2a211b;
  --leise: #74675b;
  --glut: #cf4d0d;
  --glut2: #e07a1c;
  --rot: #cc2416;
  --aktiv: #d9650f;
  --unruhe: #a87d08;
  --ruhend: #8a7c6f;
  --beben: #4b443e;
  --tsu-info: #2f78b8;
  --tsu-hinweis: #b89200;
  --schatten: 0 14px 36px rgba(70, 45, 20, .16), 0 2px 6px rgba(70, 45, 20, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Weltraum + Karte */
#sterne { position: fixed; inset: 0; background:
  radial-gradient(ellipse at 50% 55%, rgba(255, 120, 40, .07), transparent 55%),
  radial-gradient(ellipse at 50% 50%, #17110d 0%, #070605 70%); }
#sterne::before, #sterne::after { content: ""; position: absolute; inset: 0; background-repeat: repeat; opacity: .75;
  background-image:
    radial-gradient(1px 1px at 20px 30px, #fff9, transparent 60%),
    radial-gradient(1px 1px at 140px 80px, #fff7, transparent 60%),
    radial-gradient(1.4px 1.4px at 90px 160px, #ffe8cfaa, transparent 60%),
    radial-gradient(1px 1px at 200px 220px, #fff6, transparent 60%),
    radial-gradient(1px 1px at 260px 40px, #fff8, transparent 60%),
    radial-gradient(1.2px 1.2px at 320px 190px, #ffd9b5aa, transparent 60%);
  background-size: 360px 260px; }
#sterne::after { background-size: 530px 410px; opacity: .45; transform: translate(70px, 40px); }
:root[data-theme="hell"] #sterne { background: radial-gradient(ellipse at 50% 50%, #fbf8f3 0%, #e6dfd5 75%); }
:root[data-theme="hell"] #sterne::before, :root[data-theme="hell"] #sterne::after { display: none; }
#karte { position: fixed; inset: 0; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { background: transparent !important; font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--leise) !important; }
.maplibregl-ctrl-bottom-right { bottom: 46px; }
.maplibregl-ctrl-group { background: var(--panel) !important; border: 1px solid var(--linie); box-shadow: none !important; backdrop-filter: blur(10px); }
.maplibregl-ctrl-group button { width: 32px; height: 32px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--linie) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(var(--icon-invert, .9)); }
:root[data-theme="hell"] { --icon-invert: 0; }

/* ---------- Kopf */
#kopf { position: fixed; top: 0; left: 0; right: 0; height: 52px; display: flex; align-items: center; gap: 16px;
  padding: 0 12px 0 14px; background: linear-gradient(to bottom, var(--panel), var(--panel)); border-bottom: 1px solid var(--linie);
  backdrop-filter: blur(14px) saturate(1.2); z-index: 20; }
.marke { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.marke b { display: block; letter-spacing: .22em; font-size: 13px; font-weight: 700; }
.marke b em { font-style: normal; color: var(--glut); }
.marke span { display: block; font-size: 11px; color: var(--leise); letter-spacing: .02em; }
.logo { width: 30px; height: 30px; }
.logo-berg { fill: var(--text); stroke: none; opacity: .92; }
.logo-rauch { stroke: var(--leise); stroke-width: 1.6; }
.logo-glut { fill: var(--glut); stroke: none; filter: drop-shadow(0 0 4px var(--glut)); }
.zaehler { flex: 1; display: flex; justify-content: center; gap: 6px; }
.z { display: flex; align-items: baseline; gap: 7px; padding: 6px 12px 6px 10px; border: 1px solid var(--linie); background: transparent;
  border-radius: 6px; transition: background .15s, border-color .15s; }
.z:hover { background: var(--linie); border-color: var(--linie2); }
.z.an { border-color: var(--text); }
.z i { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.z b { font: 600 16px/1 var(--mono); }
.z span { color: var(--leise); font-size: 12px; }
.z-ausbruch i { background: var(--rot); box-shadow: 0 0 10px var(--rot); }
.z-aktiv i { background: var(--aktiv); }
.z-unruhe i { background: var(--unruhe); }
.z-beben i { background: transparent; border: 1.5px solid var(--beben); }
.z-tsunami i { background: var(--tsu-info); border-radius: 2px; transform: rotate(45deg); width: 7px; height: 7px; }
.z-tsunami.warn i { background: var(--tsu-warn); box-shadow: 0 0 10px var(--tsu-warn); }
.z-ausbruch.heiss b { color: var(--rot); }
.werkzeuge { display: flex; gap: 4px; }
.werkzeuge button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid transparent; background: transparent;
  border-radius: 6px; color: var(--leise); }
.werkzeuge button:hover { color: var(--text); background: var(--linie); }
.werkzeuge button.an { color: var(--glut); border-color: var(--linie2); }
.werkzeuge svg { width: 19px; height: 19px; }
#k-ton .ton-aus { display: none; }
#k-neu.dreht svg { animation: drehen 1s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.stand { color: var(--leise); font: 11px var(--mono); }
.kegel.alt { border-bottom-color: transparent; position: relative; }
.kegel.alt::after { content: ""; position: absolute; left: -5px; top: 3px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--panel-fest); }
.kegel.alt { border-bottom-color: var(--ruhend); }
#k-ton.stumm .ton-aus { display: inline; } #k-ton.stumm .ton-an { display: none; }
#k-ton.stumm { color: var(--rot); }

/* ---------- Seitenleiste */
#seite { position: fixed; top: 62px; left: 10px; bottom: 56px; width: 352px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--linie); border-radius: 10px; backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--schatten); z-index: 15; transition: transform .25s ease; }
#seite.zu { transform: translateX(calc(-100% - 12px)); }
.seite-zu { position: absolute; right: -27px; top: 12px; width: 26px; height: 40px; border: 1px solid var(--linie); border-left: 0;
  background: var(--panel); border-radius: 0 6px 6px 0; color: var(--leise); display: grid; place-items: center; }
.seite-zu svg { width: 16px; height: 16px; transition: transform .25s; }
#seite.zu .seite-zu svg { transform: rotate(180deg); }
.reiter { display: flex; border-bottom: 1px solid var(--linie); padding: 0 6px; }
.reiter button { flex: 1; padding: 11px 4px 10px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--leise);
  font-weight: 600; font-size: 12.5px; }
.reiter button.an { color: var(--text); border-bottom-color: var(--glut); }
.reiter em { font-style: normal; margin-left: 5px; background: var(--rot); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10.5px; }
.reiter em:empty { display: none; }
.suche { padding: 10px 10px 4px; }
.suche input { width: 100%; padding: 7px 10px; border: 1px solid var(--linie2); border-radius: 6px; background: transparent; outline: none; }
.suche input:focus { border-color: var(--glut); }
.filterleiste { display: flex; gap: 4px; padding: 6px 10px; flex-wrap: wrap; }
.filterleiste:empty { display: none; }
.filterleiste button { padding: 3px 9px; border: 1px solid var(--linie2); border-radius: 4px; background: none; color: var(--leise); font-size: 12px; }
.filterleiste button.an { color: var(--text); border-color: var(--glut); background: color-mix(in srgb, var(--glut) 14%, transparent); }
.liste { flex: 1; overflow-y: auto; padding: 4px 6px 10px; scrollbar-width: thin; scrollbar-color: var(--linie2) transparent; }
.gruppe { padding: 12px 8px 4px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--leise); display: flex; justify-content: space-between; }
.eintrag { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; align-items: center; padding: 8px; border-radius: 6px;
  cursor: pointer; border: 1px solid transparent; }
.eintrag:hover { background: var(--linie); }
.eintrag.gewaehlt { border-color: var(--linie2); background: var(--linie); }
.eintrag .sym { grid-row: span 2; display: grid; place-items: center; }
.eintrag .n { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag .u { color: var(--leise); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 2; }
.eintrag .w { grid-row: span 2; text-align: right; font: 12px var(--mono); color: var(--leise); white-space: nowrap; }
.eintrag .w b { display: block; font-size: 15px; color: var(--text); }
.leer { padding: 28px 16px; color: var(--leise); text-align: center; }
.kegel { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 12px solid var(--ruhend); }
.kegel.ausbruch { border-bottom-color: var(--rot); filter: drop-shadow(0 0 5px var(--rot)); }
.kegel.aktiv { border-bottom-color: var(--aktiv); }
.kegel.unruhe { border-bottom-color: var(--unruhe); }
.ring { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--beben); }
.raute { width: 10px; height: 10px; transform: rotate(45deg); background: var(--tsu-info); }
.raute.gross { background: var(--tsu-gross); } .raute.warn { background: var(--tsu-warn); } .raute.hinweis { background: var(--tsu-hinweis); }
.raute.boje { background: transparent; border: 2px solid var(--leise); }
.mag { font: 600 12px var(--mono); width: 30px; height: 22px; display: grid; place-items: center; border-radius: 4px; background: var(--linie); }
.mag.m6 { background: color-mix(in srgb, var(--aktiv) 30%, transparent); }
.mag.m7 { background: var(--rot); color: #fff; }

/* ---------- Detailkarte */
#detail { position: fixed; right: 10px; top: 62px; width: 380px; max-height: calc(100% - 110px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--linie); border-radius: 10px; backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--schatten); z-index: 16; scrollbar-width: thin; animation: rein .2s ease; }
@keyframes rein { from { opacity: 0; transform: translateY(-6px); } }
.d-kopf { padding: 16px 16px 12px; border-bottom: 1px solid var(--linie); position: relative; }
.d-kopf h2 { margin: 6px 0 2px; font-size: 21px; letter-spacing: -.01em; line-height: 1.2; padding-right: 70px; }
.d-kopf .u { color: var(--leise); }
.d-knoepfe { position: absolute; right: 8px; top: 8px; display: flex; gap: 0; }
.d-knoepfe button { width: 30px; height: 30px; border: 0; background: none; color: var(--leise); border-radius: 6px; display: grid; place-items: center; padding: 0; }
.d-knoepfe button:hover { background: var(--linie); color: var(--text); }
.d-knoepfe svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d-merken.an { color: #f2b632; }
.d-merken.an svg { fill: currentColor; }
html.exe .d-teilen { display: none; }   /* in der App gibt es keine teilbare Adresse */
.knopf.wiki { color: var(--leise); }
.eintrag .stern { font-style: normal; color: #f2b632; font-size: 11px; margin-right: 5px; vertical-align: 1px; }
.toast-link { width: min(420px, 80vw); font: 12px var(--mono); background: none; border: 0; color: var(--text); outline: none; }
.abzeichen { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 4px; background: var(--linie); }
.abzeichen.ausbruch { background: var(--rot); color: #fff; }
.abzeichen.aktiv { background: color-mix(in srgb, var(--aktiv) 22%, transparent); color: var(--aktiv); }
.abzeichen.unruhe { background: color-mix(in srgb, var(--unruhe) 22%, transparent); color: var(--unruhe); }
.abzeichen.gross { background: var(--tsu-gross); color: #fff; }
.abzeichen.warn { background: var(--tsu-warn); color: #fff; }
.abzeichen.hinweis { background: var(--tsu-hinweis); color: #1c1714; }
.abzeichen.info { background: color-mix(in srgb, var(--tsu-info) 22%, transparent); color: var(--tsu-info); }
.werte { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--linie); }
.werte div { padding: 10px 14px; border-right: 1px solid var(--linie); }
.werte div:last-child { border-right: 0; }
.werte span { display: block; font-size: 11px; color: var(--leise); }
.werte b { font: 600 15px var(--mono); }
.abschnitt { padding: 12px 16px; border-bottom: 1px solid var(--linie); }
.abschnitt:last-child { border-bottom: 0; }
.abschnitt h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--leise); font-weight: 600; }
.grund { display: grid; grid-template-columns: 92px 1fr; gap: 1px 10px; padding: 6px 0; border-top: 1px dashed var(--linie); }
.grund:first-of-type { border-top: 0; }
.grund .q { font: 11px var(--mono); color: var(--leise); padding-top: 2px; }
.grund .t { font-weight: 600; }
.grund .z { grid-column: 2; color: var(--leise); font-size: 12px; padding: 0; border: 0; display: block; }
.grund a { color: var(--glut); text-decoration: none; }
.grund a:hover { text-decoration: underline; }
details { margin-top: 6px; }
details summary { cursor: pointer; color: var(--leise); font-size: 12px; }
details p { margin: 6px 0 0; font-size: 12px; color: var(--leise); }
.knopfreihe { display: flex; gap: 6px; flex-wrap: wrap; }
.knopf { padding: 6px 12px; border: 1px solid var(--linie2); border-radius: 6px; background: none; text-decoration: none; color: var(--text); font-size: 12.5px; }
.knopf:hover { border-color: var(--glut); }
.knopf.haupt, button.haupt { background: var(--glut); border-color: var(--glut); color: #fff; }
.funke { width: 100%; height: 70px; display: block; }
.funke path.linie { stroke: var(--tsu-info); stroke-width: 1.5; }
.funke path.flaeche { fill: color-mix(in srgb, var(--tsu-info) 16%, transparent); stroke: none; }
.funke circle { fill: var(--tsu-warn); stroke: none; }
.gebiete { display: flex; flex-direction: column; gap: 3px; }
.gebiet { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.gebiet span:last-child { font-family: var(--mono); color: var(--leise); white-space: nowrap; }
.klein { font-size: 11.5px; color: var(--leise); }

/* ---------- Pop-ups */
.pop { position: fixed; top: 58px; right: 12px; width: 270px; padding: 12px 14px; background: var(--panel-fest); border: 1px solid var(--linie2);
  border-radius: 10px; box-shadow: var(--schatten); z-index: 30; display: flex; flex-direction: column; gap: 7px; }
.pop[hidden] { display: none; }
.pop h4 { margin: 0 0 2px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--leise); }
.pop label { display: flex; align-items: center; gap: 8px; }
.pop label.zeile { justify-content: space-between; }
.pop select, .pop input[type=range] { accent-color: var(--glut); background: var(--panel-fest); border: 1px solid var(--linie2); border-radius: 4px; padding: 2px 4px; }
.pop input[type=checkbox] { accent-color: var(--glut); width: 15px; height: 15px; }
.knoepfe { display: flex; gap: 6px; margin-top: 4px; justify-content: flex-end; }
.knoepfe button { padding: 6px 12px; border: 1px solid var(--linie2); background: none; border-radius: 6px; }
.knoepfe button:hover { border-color: var(--glut); }
/* Einstellungen: Knöpfe passen immer in die Kachel (zwei nebeneinander, der dritte darunter in voller Breite) */
.einst-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.einst-knoepfe button { padding: 7px 8px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.einst-knoepfe button:last-child { grid-column: 1 / -1; }

/* ---------- Fuß */
#fuss { position: fixed; left: 372px; right: 10px; bottom: 22px; height: 28px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; z-index: 14; pointer-events: none; transition: left .25s; }
body.seite-zu #fuss { left: 10px; }
#fuss > * { pointer-events: auto; background: var(--panel); border: 1px solid var(--linie); border-radius: 6px; padding: 4px 10px; backdrop-filter: blur(10px); }
.quellen { display: flex; gap: 10px; font-size: 11.5px; color: var(--leise); overflow: hidden; white-space: nowrap; }
.quellen span { display: inline-flex; align-items: center; gap: 5px; cursor: default; }
.quellen i { width: 7px; height: 7px; border-radius: 50%; background: var(--leise); }
.quellen i.ok { background: var(--ok); } .quellen i.alt { background: var(--unruhe); } .quellen i.fehler { background: var(--rot); }
.legende { display: flex; gap: 12px; font-size: 11.5px; color: var(--leise); white-space: nowrap; }
.legende span { display: inline-flex; align-items: center; gap: 5px; }
.lg { display: inline-block; }
.lg-ausbruch, .lg-aktiv, .lg-unruhe, .lg-ruhend { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid; }
.lg-ausbruch { border-bottom-color: var(--rot); } .lg-aktiv { border-bottom-color: var(--aktiv); }
.lg-unruhe { border-bottom-color: var(--unruhe); } .lg-ruhend { border-bottom-color: var(--ruhend); }
.lg-beben { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--beben); }
.lg-dart { width: 7px; height: 7px; transform: rotate(45deg); border: 1.5px solid var(--leise); }

#tooltip { position: fixed; z-index: 40; pointer-events: none; background: var(--panel-fest); border: 1px solid var(--linie2); border-radius: 6px;
  padding: 6px 9px; font-size: 12px; box-shadow: var(--schatten); max-width: 280px; }
#tooltip b { display: block; font-size: 13px; }
#tooltip span { color: var(--leise); }

/* ---------- Ausbruchs-Marker (HTML): Glut, Druckwelle, Aschesäule, Lavabrocken, Blitze */
.eruption { position: relative; width: 0; height: 0; pointer-events: none; }
.eruption.verdeckt { visibility: hidden; }   /* Vulkan auf der Rückseite des Globus */
.eruption .innen { position: absolute; left: 0; top: 0; transform: scale(var(--eruk, 1)); transform-origin: 0 0; }
.eruption .halo { position: absolute; left: -34px; top: -34px; width: 68px; height: 68px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 120, 30, .55) 0%, rgba(255, 70, 0, .22) 38%, transparent 70%); animation: halo 2.4s ease-in-out infinite; }
@keyframes halo { 50% { transform: scale(1.25); opacity: .7; } }
.eruption .welle { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid rgba(255, 190, 120, .9);
  animation: druck 3.2s ease-out infinite; opacity: 0; }
@keyframes druck { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(5.5); opacity: 0; } }
.eruption .krater { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(circle, #fffbe8 0%, #ffd27a 30%, #ff6a1a 62%, #e02a00 75%, transparent 78%);
  box-shadow: 0 0 12px 5px rgba(255, 100, 20, .8), 0 0 34px 12px rgba(255, 60, 0, .32); animation: flackern 1.1s steps(1) infinite, puls 1.6s ease-in-out infinite; }
@keyframes puls { 50% { transform: scale(1.3); } }
@keyframes flackern { 0%, 100% { filter: brightness(1); } 33% { filter: brightness(1.25); } 66% { filter: brightness(.9); } }
.eruption .saeule { position: absolute; left: 0; top: -6px; }
.eruption .saeule span { position: absolute; left: -10px; top: -9px; width: 20px; height: 16px; border-radius: 50% 46% 54% 48% / 55% 50% 50% 45%; opacity: 0;
  background: radial-gradient(ellipse at 45% 40%, rgba(214, 204, 194, .62), rgba(140, 130, 122, .38) 45%, rgba(90, 82, 76, 0) 72%);
  filter: blur(1.6px); animation: asche 5.4s cubic-bezier(.25, .6, .45, 1) infinite; animation-delay: var(--v); }
:root[data-theme="hell"] .eruption .saeule span { background: radial-gradient(ellipse at 45% 40%, rgba(105, 96, 90, .6), rgba(70, 64, 60, .36) 45%, rgba(40, 36, 34, 0) 72%); }
@keyframes asche {
  0% { transform: translate(var(--x), 0) scale(.3) rotate(0deg); opacity: 0; box-shadow: inset 0 -5px 7px rgba(255, 110, 40, .55); }
  10% { opacity: .9; }
  35% { box-shadow: inset 0 -2px 6px rgba(255, 110, 40, 0); }
  100% { transform: translate(calc(var(--x) + var(--drift) * 1.6), -84px) scale(var(--s)) rotate(40deg); opacity: 0; }
}
/* Lavabrocken: außen waagerecht gleichmäßig, innen hoch und wieder herunter = Wurfparabel */
.eruption .lava i { position: absolute; left: 0; top: -2px; animation: lava-x var(--d) linear infinite; animation-delay: var(--v); }
.eruption .lava b { display: block; width: 3px; height: 3px; margin: -1.5px; border-radius: 50%; background: #ffe2a0; box-shadow: 0 0 5px 1px #ff7a10;
  animation: lava-y var(--d) infinite; animation-delay: var(--v); opacity: 0; }
@keyframes lava-x { from { transform: translateX(0); } to { transform: translateX(var(--x)); } }
@keyframes lava-y {
  0% { transform: translateY(0); opacity: 1; animation-timing-function: cubic-bezier(.2, .7, .4, 1); }
  45% { transform: translateY(var(--h)); opacity: 1; animation-timing-function: cubic-bezier(.6, 0, .8, .3); }
  100% { transform: translateY(6px); opacity: 0; background: #b83a10; }
}
.eruption .blitz { position: absolute; left: 4px; top: -62px; width: 9px; height: 18px; fill: #fff7d0; filter: drop-shadow(0 0 4px #ffe680); opacity: 0;
  animation: blitz 7s linear infinite; animation-delay: 2.5s; }
@keyframes blitz { 0%, 90%, 92.5%, 100% { opacity: 0; } 91%, 93.5% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .eruption * { animation-duration: 0s !important; animation-iteration-count: 1 !important; } .eruption .krater, .eruption .halo { opacity: 1; } }

/* ---------- Alarm */
#alarmglut { position: fixed; inset: 0; pointer-events: none; z-index: 12; opacity: 0; transition: opacity .6s;
  box-shadow: inset 0 0 160px 40px rgba(255, 40, 20, .55); }
body.alarm-rot #alarmglut { opacity: 1; animation: glut 1.6s ease-in-out infinite; }
body.alarm-tsunami #alarmglut { opacity: 1; box-shadow: inset 0 0 160px 40px rgba(160, 60, 255, .5); animation: glut 2.2s ease-in-out infinite; }
body.alarm-orange #alarmglut { opacity: .6; box-shadow: inset 0 0 140px 30px rgba(255, 140, 20, .45); }
@keyframes glut { 50% { opacity: .35; } }
#alarm { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(560px, calc(100% - 24px)); }
#alarm[hidden] { display: none; }
.alarm-karte { background: var(--panel-fest); border: 1px solid var(--rot); border-radius: 12px; box-shadow: 0 20px 70px rgba(0, 0, 0, .55), 0 0 0 4px color-mix(in srgb, var(--rot) 22%, transparent);
  padding: 16px 18px 14px; animation: rein .25s ease; }
#alarm.orange .alarm-karte { border-color: var(--aktiv); box-shadow: 0 20px 70px rgba(0, 0, 0, .5), 0 0 0 4px color-mix(in srgb, var(--aktiv) 22%, transparent); }
#alarm.gelb .alarm-karte { border-color: var(--unruhe); box-shadow: 0 20px 70px rgba(0, 0, 0, .5); }
#alarm.tsunami .alarm-karte { border-color: var(--tsu-gross); box-shadow: 0 20px 70px rgba(0, 0, 0, .55), 0 0 0 4px color-mix(in srgb, var(--tsu-gross) 25%, transparent); }
.alarm-kopf { display: flex; justify-content: space-between; font: 700 12px var(--mono); letter-spacing: .18em; color: var(--rot); }
#alarm.orange .alarm-kopf { color: var(--aktiv); } #alarm.gelb .alarm-kopf { color: var(--unruhe); } #alarm.tsunami .alarm-kopf { color: var(--tsu-gross); }
.alarm-kopf span:last-child { color: var(--leise); letter-spacing: 0; font-weight: 400; }
#alarm h2 { margin: 6px 0 4px; font-size: 26px; letter-spacing: -.01em; }
#alarm p { margin: 0 0 12px; color: var(--leise); }
.alarm-knoepfe { display: flex; gap: 8px; justify-content: flex-end; }
.alarm-knoepfe button { padding: 8px 16px; border-radius: 6px; border: 1px solid var(--linie2); background: none; font-weight: 600; }
.alarm-knoepfe button.haupt { background: var(--rot); border-color: var(--rot); }
#alarm.orange .haupt { background: var(--aktiv); border-color: var(--aktiv); }
#alarm.gelb .haupt { background: var(--unruhe); border-color: var(--unruhe); color: #1c1714; }
#alarm.tsunami .haupt { background: var(--tsu-gross); border-color: var(--tsu-gross); }
#alarm-mehr { font-size: 12px; color: var(--leise); margin-top: 8px; }
#alarm-mehr:empty { display: none; }
#tonsperre { position: fixed; bottom: 46px; left: 50%; transform: translateX(-50%); z-index: 45; }
#tonsperre button { padding: 9px 16px; border-radius: 8px; border: 1px solid var(--glut); background: var(--panel-fest); color: var(--text);
  box-shadow: var(--schatten); font-weight: 600; }

/* ---------- Info */
dialog { border: 1px solid var(--linie2); border-radius: 12px; background: var(--panel-fest); color: var(--text); width: min(600px, calc(100% - 24px));
  padding: 6px 22px 16px; box-shadow: var(--schatten); }
dialog::backdrop { background: rgba(0, 0, 0, .45); backdrop-filter: blur(2px); }
dialog h3 { margin: 14px 0 6px; font-size: 18px; }
dialog h3 small { font: 12px var(--mono); color: var(--leise); margin-left: 6px; }
dialog h4 { margin: 14px 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--leise); }
.warnhinweis { padding: 8px 10px; border-left: 3px solid var(--glut); background: var(--linie); border-radius: 0 6px 6px 0; margin: 8px 0; }
.quellenliste { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--leise); }
.quellenliste li { margin: 3px 0; }
.quellenliste b { color: var(--text); font-weight: 600; }
.recht { font-size: 11.5px; color: var(--leise); border-top: 1px solid var(--linie); padding-top: 10px; margin-top: 14px; }

/* ---------- schmale Fenster */
@media (max-width: 1100px) { .z span { display: none; } }
@media (max-width: 1360px) { .legende { display: none !important; } }
@media (max-width: 760px) {
  .marke div { display: none; } .marke { min-width: 0; }
  .zaehler { justify-content: flex-start; overflow-x: auto; }
  #seite { width: auto; right: 10px; top: auto; height: 42%; }
  #seite.zu { transform: translateY(calc(100% + 12px)); }
  .seite-zu { display: none; }
  #detail { left: 10px; right: 10px; width: auto; top: 62px; max-height: 50%; }
  #fuss { left: 10px; }
  .quellen { display: none !important; }
}

/* ---------- Start-Fenster + Rechtliches */
#start { width: min(560px, calc(100% - 24px)); padding: 6px 24px 14px; }
.start-kopf { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; }
.start-kopf .logo { width: 38px; height: 38px; }
.start-kopf b { display: block; letter-spacing: .22em; font-size: 16px; }
.start-kopf b em, .rechtlink em { font-style: normal; color: var(--glut); }
.start-kopf span { display: block; color: var(--leise); font-size: 12.5px; }
.start-liste { margin: 0; padding-left: 18px; font-size: 13px; }
.start-liste li { margin: 4px 0; }
.start-liste li::marker { color: var(--glut); }
.start-link { margin: 12px 0 4px; font-size: 13px; }
.start-link a, .recht a { color: var(--glut); text-decoration: none; }
.start-link a:hover, .recht a:hover { text-decoration: underline; }
.start-fuss { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.start-fuss label { display: flex; align-items: center; gap: 8px; color: var(--leise); font-size: 12.5px; }
.start-fuss input { accent-color: var(--glut); }
.start-fuss button { padding: 8px 20px; border-radius: 6px; border: 1px solid var(--glut); font-weight: 600; }
.besucher { display: inline-flex; align-items: center; gap: 5px; color: var(--leise); font-size: 11.5px; white-space: nowrap; }
.besucher[hidden] { display: none !important; }
.besucher svg { width: 14px; height: 14px; }
.besucher b { color: var(--text); font: 600 12px var(--mono); }
.besucher i { font-style: normal; opacity: .5; }
.rechtlink { color: var(--leise) !important; text-decoration: none; font-size: 11.5px; white-space: nowrap; }
.rechtlink:hover { color: var(--text) !important; }
@media (max-width: 760px) {
  #fuss { display: flex !important; left: auto; right: 10px; bottom: auto; top: 58px; width: auto; }
  #fuss .quellen, #fuss .legende { display: none !important; }
}

/* ---------- Verbindungs-Hinweis */
#netz { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 25; width: min(640px, calc(100% - 24px));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; background: var(--panel-fest);
  border: 1px solid var(--rot); border-left-width: 4px; border-radius: 10px; box-shadow: var(--schatten); animation: rein .25s ease; }
#netz[hidden] { display: none; }
#netz.gelb { border-color: var(--unruhe); }
.netz-symbol { width: 26px; height: 26px; flex: none; color: var(--rot); }
#netz.gelb .netz-symbol { color: var(--unruhe); }
.netz-symbol circle { fill: currentColor; stroke: none; }
.netz-strich { stroke-width: 2.2; }
.netz-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.netz-text b { font-size: 14px; }
.netz-text span { color: var(--leise); font-size: 12.5px; }
.netz-text code { font: 11.5px var(--mono); color: var(--text); background: var(--linie); border-radius: 4px; padding: 3px 6px; margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.netz-knoepfe { display: flex; flex-direction: column; gap: 5px; }
.netz-knoepfe button { padding: 6px 12px; border: 1px solid var(--linie2); border-radius: 6px; background: none; font-size: 12.5px; white-space: nowrap; }
.netz-knoepfe button:hover { border-color: var(--glut); }
.netz-knoepfe button:disabled { opacity: .5; cursor: default; }
#toast { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 26; padding: 8px 14px; border-radius: 8px;
  background: var(--panel-fest); border: 1px solid var(--ok); box-shadow: var(--schatten); font-size: 13px; animation: rein .2s ease; }
#toast[hidden] { display: none; }
@media (max-width: 760px) { #netz { top: 96px; flex-wrap: wrap; } .netz-knoepfe { flex-direction: row; } }

/* ---------- Handy: Kopfzeile zweizeilig (Marke + Knöpfe oben, alle Zähler darunter) */
@media (max-width: 760px) {
  #kopf { height: auto; flex-wrap: wrap; padding: 6px 8px 7px 10px; row-gap: 6px; gap: 8px; }
  .marke { order: 1; }
  .marke div { display: block; } .marke span { display: none; } .marke b { font-size: 12px; letter-spacing: .16em; }
  .werkzeuge { order: 2; margin-left: auto; gap: 0; }
  .werkzeuge button { width: 32px; height: 32px; }
  .zaehler { order: 3; flex: 1 0 100%; justify-content: space-between; gap: 4px; overflow-x: auto; scrollbar-width: none; }
  .zaehler::-webkit-scrollbar { display: none; }
  .z { flex: 1; justify-content: center; padding: 5px 6px; gap: 5px; }
  .z b { font-size: 15px; }
  #detail, #alarm { top: 100px; }
  #detail { max-height: calc(58% - 100px); }
  .pop { top: 96px; }
  #netz, #toast { top: 102px; }
  #fuss { top: 100px; }
  .rechtlink { font-size: 11px; }
  .maplibregl-ctrl-bottom-right { display: none; }   /* Zoomen mit zwei Fingern */
}
/* Handy: Detailkarte unten an Stelle der Liste – die Karte oben bleibt sichtbar */
@media (max-width: 760px) {
  #detail { top: auto; bottom: 22px; max-height: 55%; }
  body.detail-offen #seite { transform: translateY(calc(100% + 12px)); }
}
/* Tablet / schmale Fenster: offene Detailkarte schiebt die Liste beiseite, damit die Karte sichtbar bleibt */
@media (min-width: 761px) and (max-width: 1100px) {
  body.detail-offen #seite { transform: translateX(calc(-100% - 12px)); }
  body.detail-offen #fuss { left: 10px; }
}

/* ---------- Copyright ganz unten, klein */
#copyright { position: fixed; left: 0; right: 0; bottom: 3px; z-index: 13; text-align: center; pointer-events: none;
  font-size: 10px; letter-spacing: .02em; color: var(--leise); opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
@media (max-width: 760px) { #copyright { font-size: 9.5px; } }
@media (max-width: 760px) { #seite { bottom: 22px; } }

/* ---------- Sprachumschalter */
.werkzeuge .textknopf { font: 700 11.5px var(--mono); letter-spacing: .04em; color: var(--leise); }
.werkzeuge .textknopf.an { color: var(--glut); border-color: var(--glut); background: color-mix(in srgb, var(--glut) 12%, transparent); }
.werkzeuge .sprachknopf { width: auto; min-width: 34px; padding: 0 6px; font: 700 11.5px var(--mono); letter-spacing: .06em; color: var(--leise); border: 1px solid var(--linie2); }
.werkzeuge .sprachknopf:hover { color: var(--glut); border-color: var(--glut); }
.start-kopf { flex-wrap: wrap; }
.sprachwahl { margin-left: auto; display: inline-flex; border: 1px solid var(--linie2); border-radius: 7px; overflow: hidden; }
.sprachwahl button { padding: 5px 11px; border: 0; background: none; color: var(--leise); font-size: 12.5px; font-weight: 600; }
.sprachwahl button + button { border-left: 1px solid var(--linie2); }
.sprachwahl button.an { background: var(--glut); color: #fff; }
.sprachwahl button:not(.an):hover { color: var(--text); }
@media (max-width: 760px) { .werkzeuge .sprachknopf { min-width: 30px; padding: 0 4px; } }


/* ---------- Helles Design „Sandstein“: warme Steintöne statt Weiß */
:root[data-theme="hell"] #sterne { background:
  radial-gradient(ellipse 70% 60% at 62% 48%, rgba(255, 248, 238, .9) 0%, rgba(255, 248, 238, 0) 60%),
  linear-gradient(160deg, #ece5da 0%, #ddd3c5 55%, #cdc1b0 100%); }
:root[data-theme="hell"] #kopf { background: linear-gradient(to bottom, rgba(243, 237, 228, .94), rgba(236, 229, 218, .9)); border-bottom-color: rgba(84, 60, 38, .14); }
:root[data-theme="hell"] #seite, :root[data-theme="hell"] #detail { background: linear-gradient(180deg, rgba(237, 229, 217, .92), rgba(229, 220, 207, .9)); border-color: rgba(84, 60, 38, .16); }
:root[data-theme="hell"] .reiter { border-bottom-color: rgba(84, 60, 38, .14); }
:root[data-theme="hell"] .suche input { background: rgba(255, 252, 247, .6); border-color: rgba(84, 60, 38, .18); }
:root[data-theme="hell"] .suche input:focus { background: #fffdf9; }
:root[data-theme="hell"] .filterleiste button, :root[data-theme="hell"] .z { background: rgba(255, 252, 247, .45); }
:root[data-theme="hell"] .filterleiste button.an { background: rgba(207, 77, 13, .12); }
:root[data-theme="hell"] .gruppe { color: #7c5e47; background: rgba(84, 60, 38, .06); border-radius: 5px; margin: 8px 2px 2px; padding: 5px 8px; }
:root[data-theme="hell"] .eintrag:hover { background: rgba(84, 60, 38, .06); }
:root[data-theme="hell"] .eintrag.gewaehlt { background: rgba(207, 77, 13, .08); border-color: rgba(207, 77, 13, .22); }
:root[data-theme="hell"] .eintrag .w b { color: var(--text); }
:root[data-theme="hell"] .werte div, :root[data-theme="hell"] .abschnitt, :root[data-theme="hell"] .d-kopf { border-color: rgba(84, 60, 38, .12); }
:root[data-theme="hell"] #fuss > * { background: rgba(241, 235, 225, .88); border-color: rgba(84, 60, 38, .14); }
:root[data-theme="hell"] .maplibregl-ctrl-group { background: rgba(241, 235, 225, .9) !important; }
:root[data-theme="hell"] .maplibregl-ctrl-attrib { color: #74675b; }
:root[data-theme="hell"] dialog, :root[data-theme="hell"] .pop { background: #f1ebe2; }
:root[data-theme="hell"] #copyright { color: #6a5d51; }
:root[data-theme="hell"] .mag { background: rgba(84, 60, 38, .09); }
/* ausgewählte Zeile in beiden Designs mit Glut-Akzent */
.eintrag.gewaehlt { box-shadow: inset 3px 0 0 var(--glut); }
:root[data-theme="hell"] .eintrag + .eintrag { border-top-color: transparent; box-shadow: 0 -1px 0 rgba(84, 60, 38, .07); }
:root[data-theme="hell"] .eintrag.gewaehlt { box-shadow: inset 3px 0 0 var(--glut); }
/* Handy: alle Knöpfe in eine Zeile (Drehen geht dort mit dem Finger) */
@media (max-width: 760px) {
  .werkzeuge button { width: 30px; }
  .werkzeuge svg { width: 18px; height: 18px; }
  #k-neu { display: none; }   /* Handy: Platz für „Zentrieren“; aktualisiert wird ohnehin automatisch */
  .marke { gap: 7px; }
  .logo { width: 26px; height: 26px; }
}

/* ---------- Zusatzebenen im Ebenen-Menü */
.pop h4.zusatz { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--linie); }
.ebene-knopf { margin-top: 6px; width: 100%; padding: 6px 10px; border: 1px solid var(--linie2); border-radius: 6px; background: none; color: var(--text); font-size: 12.5px; text-align: left; }
.ebene-knopf:hover, .filterleiste .zl-knopf:hover { border-color: var(--glut); }
.filterleiste .zl-knopf { margin-left: auto; color: var(--text); }

/* ---------- Zeitleiste (Erdbeben der letzten 7 Tage) */
#zeitleiste { position: fixed; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 18; width: min(560px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel-fest); border: 1px solid var(--linie2);
  border-radius: 10px; box-shadow: var(--schatten); animation: rein .2s ease; }
#zeitleiste[hidden] { display: none; }
#zeitleiste button { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--linie2); background: none; color: var(--text); display: grid; place-items: center; padding: 0; }
#zl-spiel { background: var(--glut) !important; border-color: var(--glut) !important; color: #fff !important; }
#zl-spiel svg { width: 16px; height: 16px; fill: currentColor; }
#zl-spiel .zl-pause, #zl-spiel.laeuft .zl-play { display: none; }
#zl-spiel.laeuft .zl-pause { display: inline; }
#zl-zu { border: 0 !important; color: var(--leise) !important; }
.zl-mitte { flex: 1; min-width: 0; }
.zl-text { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--leise); }
.zl-text b { color: var(--text); font: 600 13px var(--mono); }
#zl-regler { width: 100%; accent-color: var(--glut); margin: 4px 0 0; }
.zl-skala { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--leise); }
@media (max-width: 760px) { #zeitleiste { top: 100px; bottom: auto; } body.zeit-an #detail { display: none; } }

/* ---------- Feinschliff */
#karte { opacity: 0; transition: opacity 1s ease; }
body.karte-bereit #karte { opacity: 1; }
#kopf::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--glut) 70%, transparent), transparent); opacity: .55; }
#seite, #detail, .pop, #zeitleiste, #fuss .quellen { box-shadow: var(--schatten), inset 0 1px 0 rgba(255, 255, 255, .05); }
:root[data-theme="hell"] #seite, :root[data-theme="hell"] #detail, :root[data-theme="hell"] .pop { box-shadow: var(--schatten), inset 0 1px 0 rgba(255, 255, 255, .6); }
.eintrag { transition: background .15s ease, border-color .15s ease; }
.eintrag:hover .n { color: var(--text); }
.z-ausbruch.heiss i { animation: zpuls 1.6s ease-in-out infinite; }
@keyframes zpuls { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--rot) 25%, transparent), 0 0 14px var(--rot); } }
.werkzeuge button, .knopf, .filterleiste button, .reiter button { transition: color .15s, background .15s, border-color .15s; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--glut) 75%, transparent); outline-offset: 2px; }
.maplibregl-canvas:focus-visible { outline: none; }
@media (prefers-reduced-motion: reduce) { #karte { transition: none; } .z-ausbruch.heiss i { animation: none; } }
