@font-face { font-family: "Sora"; src: url("../schrift/sora.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("../schrift/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --tinte: #02050f;
  --nacht: #071226;
  --karte: rgba(7, 15, 32, 0.66);
  --linie: rgba(130, 200, 255, 0.18);
  --text: #e6f0ff;
  --leise: #8fa6c6;
  --ak: #4fd8ff;
  --ak-weich: color-mix(in srgb, var(--ak) 16%, transparent);
  --kopf: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --fliess: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --rand: clamp(12px, 2vw, 22px);
  --weich: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--fliess);
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% 42%, #0d2347 0%, rgba(7, 18, 38, 0.0) 62%),
    radial-gradient(900px 600px at 85% 110%, rgba(61, 20, 90, 0.5) 0%, rgba(0, 0, 0, 0) 60%),
    linear-gradient(180deg, #02050f 0%, #040a1a 55%, #02050f 100%);
  overflow: clip;
  -webkit-font-smoothing: antialiased;
}

#buehne { position: fixed; inset: 0; }
#gl { width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; }
#gl.zeigt { cursor: pointer; }
#gl:active { cursor: grabbing; }
#linien, #etiketten { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; overflow: hidden; }

/* ---------- Titel ---------- */
.kopf {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: clamp(14px, 2.4vh, 26px) var(--rand) 30px;
  text-align: center; pointer-events: none;
  background: linear-gradient(180deg, rgba(2, 5, 15, 0.82) 0%, rgba(2, 5, 15, 0) 100%);
}
.kopf h1 {
  margin: 0; font-family: var(--kopf); font-weight: 600; text-transform: uppercase;
  font-size: clamp(0.95rem, 2.3vw, 1.85rem); letter-spacing: 0.17em; line-height: 1.25;
  background: linear-gradient(95deg, #ffffff 10%, #9ff0ff 55%, #7dffc4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.kopf p {
  margin: 0.55em 0 0; font-size: clamp(0.72rem, 1.25vw, 0.95rem); color: var(--leise);
  letter-spacing: 0.06em;
}
.kopf::after {
  content: ""; display: block; width: min(320px, 50vw); height: 1px; margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--ak), transparent);
  transform-origin: center; animation: linieAuf 1.4s var(--weich) 0.4s both;
}
@keyframes linieAuf { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 0.8; } }

/* ---------- Karten ---------- */
.karte {
  position: fixed; z-index: 6;
  background: var(--karte);
  border: 1px solid var(--linie);
  border-radius: 18px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Liste links */
#liste {
  left: var(--rand); top: clamp(92px, 14vh, 128px); bottom: 84px;
  width: 262px; display: flex; flex-direction: column; padding: 14px 10px 10px;
}
.liste-kopf { display: flex; justify-content: space-between; align-items: center; padding: 0 8px 8px; }
#liste h2 {
  margin: 0; font-family: var(--kopf); font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--leise);
}
#listeUl { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; scrollbar-width: thin; scrollbar-color: #2a4468 transparent; }
.eintrag {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px;
  border-radius: 12px; border: 1px solid transparent;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.eintrag:hover { background: rgba(120, 190, 255, 0.07); }
.eintrag.aktiv { background: color-mix(in srgb, var(--fa) 14%, transparent); border-color: color-mix(in srgb, var(--fa) 55%, transparent); }
.eintrag.aus .wahl { opacity: 0.42; }
.wahl {
  all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 8px 6px 8px 10px; min-width: 0; border-radius: 12px;
}
.wahl:focus-visible, .auge:focus-visible, .knopf:focus-visible, .text-knopf:focus-visible, .icon-knopf:focus-visible, .etikett:focus-visible {
  outline: 2px solid var(--ak); outline-offset: 2px;
}
.punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--fa); box-shadow: 0 0 10px var(--fa); flex: none; }
.wahl span.t { display: flex; flex-direction: column; min-width: 0; }
.wahl b { font-weight: 600; font-size: 0.86rem; line-height: 1.2; }
.wahl small { color: var(--leise); font-size: 0.72rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.auge {
  all: unset; box-sizing: border-box; cursor: pointer; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: var(--leise); margin-right: 4px;
  transition: color 0.15s ease, background 0.15s ease;
}
.auge:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); }
.auge svg { width: 18px; height: 18px; }
.eintrag.aus .auge { color: #ff8da0; }
.liste-fuss { display: flex; gap: 6px; padding: 10px 6px 2px; border-top: 1px solid var(--linie); margin-top: 8px; }

/* Info rechts */
#info {
  right: var(--rand); top: clamp(92px, 14vh, 128px); bottom: 84px; width: min(410px, calc(100vw - 2 * var(--rand)));
  display: flex; flex-direction: column;
  border-color: color-mix(in srgb, var(--ak) 40%, transparent);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 60px -20px var(--ak);
  animation: rein 0.45s var(--weich);
}
#info[hidden] { display: none; }
@keyframes rein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.info-kopf { padding: 20px 56px 14px 22px; border-bottom: 1px solid var(--linie); position: relative; }
.info-kopf::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 16px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--ak); box-shadow: 0 0 14px var(--ak);
}
.info-stadt { margin: 0 0 4px; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ak); font-weight: 700; }
.info-kopf h2 { margin: 0; font-family: var(--kopf); font-weight: 600; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.2; text-wrap: balance; }
.info-lat { margin: 6px 0 0; color: var(--leise); font-size: 0.82rem; }
.info-inhalt { overflow-y: auto; padding: 6px 22px 10px; flex: 1; scrollbar-width: thin; scrollbar-color: #2a4468 transparent; }
.info-inhalt section { padding: 14px 0 4px; }
.info-inhalt h3 {
  margin: 0 0 8px; font-family: var(--kopf); font-size: 0.7rem; letter-spacing: 0.17em; text-transform: uppercase;
  color: var(--ak); font-weight: 600;
}
.info-inhalt p, .info-inhalt li { font-size: 0.9rem; line-height: 1.62; color: #d3e1f7; margin: 0 0 8px; }
.info-inhalt ul { list-style: none; margin: 0; padding: 0; }
.info-inhalt li { position: relative; padding-left: 16px; }
.info-inhalt li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 6px; height: 6px; border-radius: 50%; background: var(--ak); opacity: 0.8; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
.chip {
  font-size: 0.74rem; padding: 4px 10px; border-radius: 999px; color: var(--text);
  background: var(--ak-weich); border: 1px solid color-mix(in srgb, var(--ak) 38%, transparent);
}
.info-fuss { display: flex; justify-content: space-between; padding: 10px 14px 12px; border-top: 1px solid var(--linie); }

/* Knöpfe */
.icon-knopf {
  all: unset; box-sizing: border-box; cursor: pointer; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.5rem; line-height: 1; color: var(--leise); transition: background 0.15s ease, color 0.15s ease;
}
#infoZu { position: absolute; top: 14px; right: 14px; z-index: 2; }
.icon-knopf:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.text-knopf {
  all: unset; box-sizing: border-box; cursor: pointer; font-size: 0.8rem; color: var(--leise); padding: 8px 12px; border-radius: 10px;
  transition: background 0.15s ease, color 0.15s ease;
}
.text-knopf:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.leiste {
  position: fixed; z-index: 7; left: 50%; bottom: 40px; transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 999px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.knopf {
  all: unset; box-sizing: border-box; cursor: pointer; font-size: 0.82rem; font-weight: 600; padding: 10px 18px; border-radius: 999px;
  color: var(--text); white-space: nowrap; transition: background 0.18s ease, color 0.18s ease, transform 0.12s ease;
}
.knopf:hover { background: rgba(255, 255, 255, 0.09); }
.knopf:active { transform: scale(0.97); }
.knopf[aria-pressed="true"] { background: var(--ak-weich); color: var(--ak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ak) 45%, transparent); }
.hinweis {
  position: fixed; z-index: 6; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0;
  font-size: 0.74rem; color: var(--leise); letter-spacing: 0.04em; text-align: center; pointer-events: none; width: max-content; max-width: 92vw;
  transition: opacity 0.6s ease;
}
.hinweis.weg { opacity: 0; }

/* ---------- Beschriftung ---------- */
.etikett {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; will-change: transform;
  display: flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; white-space: nowrap;
  font-family: var(--fliess); font-size: 12px; line-height: 1.2; color: var(--text);
  background: rgba(5, 12, 28, 0.78); border: 1px solid color-mix(in srgb, var(--fa) 55%, transparent); border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.25s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.etikett:hover, .etikett.aktiv { background: color-mix(in srgb, var(--fa) 22%, rgba(5, 12, 28, 0.85)); box-shadow: 0 0 18px -4px var(--fa); }
.etikett i { width: 8px; height: 8px; border-radius: 50%; background: var(--fa); box-shadow: 0 0 8px var(--fa); flex: none; }
.etikett b { font-weight: 700; }
.etikett small { color: var(--leise); font-size: 11px; }
.etikett.verdeckt { opacity: 0.4; }
.etikett.weg { opacity: 0; pointer-events: none; }
#linien line { stroke-width: 1.2; stroke-linecap: round; opacity: 0.85; transition: opacity 0.25s ease; }
#linien circle { opacity: 0.95; }
#linien .weg { opacity: 0; }

/* ---------- Lader ---------- */
#lader { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: #02050f; transition: opacity 0.9s ease, visibility 0.9s; }
#lader.fertig { opacity: 0; visibility: hidden; }
.lader-kern { text-align: center; color: var(--leise); font-size: 0.9rem; letter-spacing: 0.1em; }
.lader-ring { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; border: 2px solid rgba(79, 216, 255, 0.18); border-top-color: var(--ak); animation: dreh 0.9s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.ohne-js { position: fixed; inset: 0; display: grid; place-items: center; background: #02050f; color: #fff; z-index: 99; margin: 0; }

.nur-klein { display: none; }

/* ---------- Schmale Bildschirme ---------- */
@media (max-width: 900px) {
  #liste { width: min(300px, calc(100vw - 2 * var(--rand))); bottom: 90px; transform: translateX(-120%); transition: transform 0.4s var(--weich); z-index: 9; }
  #liste.offen { transform: none; }
  .nur-klein { display: grid; }
  .knopf.nur-klein { display: block; }
  #info {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 62vh; border-radius: 20px 20px 0 0; z-index: 8;
    animation: hoch 0.4s var(--weich);
  }
  @keyframes hoch { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
  body.info-offen .leiste, body.info-offen .hinweis { display: none; }
  .leiste { bottom: 24px; }
  .hinweis { display: none; }
}
@media (max-width: 520px) {
  .leiste { flex-wrap: wrap; justify-content: center; width: calc(100vw - 24px); border-radius: 22px; gap: 4px; }
  .knopf { padding: 9px 12px; font-size: 0.75rem; }
  .etikett { font-size: 11px; padding: 4px 9px 4px 7px; }
  .etikett small { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
