:root {
  --grund: #0a0e16;
  --grund2: #141b2a;
  --text: #eef2f8;
  --leise: #9aa6ba;
  --linie: rgba(238, 242, 248, 0.75);
  --akzent: #ffd23f;          /* Gelb wie in den Reels */
  --gut: #49d39a;
  --falsch: #ff8a7a;
  --karte: rgba(16, 22, 34, 0.82);
  --rand: rgba(255, 255, 255, 0.10);
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grund); color: var(--text); font-family: var(--schrift); overflow: hidden; overscroll-behavior: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

#app { position: fixed; inset: 0; height: 100dvh; overflow: hidden;
  background: radial-gradient(110% 75% at 50% 40%, #1b2233 0%, #111623 48%, #05070b 100%); }
#leinwand { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* Kopf */
.kopf { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 6px; pointer-events: none; }
.kopf > * { pointer-events: auto; }
.marke { margin: 0; padding: 0; border: 0; background: none; font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.umschalter { display: flex; background: rgba(255,255,255,0.08); border: 1px solid var(--rand); border-radius: 999px; padding: 3px; }
.umschalter button { border: 0; background: transparent; padding: 7px 13px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--leise); }
.umschalter button[aria-selected="true"] { background: var(--akzent); color: #15120a; }

/* Fester Hinweis im Bild (RP-Auflage 17.11.) */
.hinweis-bild { position: absolute; left: 16px; right: 16px; top: calc(env(safe-area-inset-top) + 56px); margin: 0;
  font-size: 11.5px; line-height: 1.35; color: #d5dbe6; background: rgba(8, 11, 18, 0.55); border: 1px solid var(--rand);
  border-radius: 8px; padding: 6px 9px; pointer-events: none; }

/* Pflichtzeile (Katalog 3) und Quellenzeile (Katalog 3a): eigene Absätze unter dem Hinweis, gleiche Schriftgröße und Farbe wie der Hinweis; nicht antippbar (Block ohne Zeiger) */
.hinweis-bild .pflichtzeile, .hinweis-bild .quellenzeile, .hinweis-bild .quellenzeile-zelle { display: none; margin-top: 4px; }
/* Pflichtzeile: Zoom-Reise (Hals) und Zelle und DNA. Hals-Quellenzeile: nur Zoom-Reise (Hals). Zelle-Quellenzeile: nur Zelle und DNA. */
#app[data-modus="zoom"] .hinweis-bild .pflichtzeile:not(:empty), #app[data-modus="zelle"] .hinweis-bild .pflichtzeile:not(:empty),
#app[data-modus="zoom"] .hinweis-bild .quellenzeile:not(:empty),
#app[data-modus="zelle"] .hinweis-bild .quellenzeile-zelle:not(:empty) { display: block; }

/* Ebenen */
/* --hinweis-unten setzt js/haupt.js (groesse): Unterkante des Hinweisblocks plus Abstand; der Block ist mit der Quellenzeile höher als ohne */
#ebenen-knopf { position: absolute; right: 16px; top: var(--hinweis-unten, calc(env(safe-area-inset-top) + 112px)); z-index: 3; }
#ebenen-liste { position: absolute; right: 16px; top: calc(var(--hinweis-unten, calc(env(safe-area-inset-top) + 112px)) + 40px); z-index: 3; width: min(260px, calc(100% - 32px));
  max-height: 46vh; overflow: auto; background: var(--karte); border: 1px solid var(--rand); border-radius: 12px; padding: 6px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ebene { display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: transparent; padding: 8px 8px; border-radius: 8px; text-align: left; font-size: 14px; }
.ebene:hover { background: rgba(255,255,255,0.06); }
.ebene .farbe { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,0.25); }
.ebene .name { flex: 1; }
.ebene .zustand { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; min-width: 44px; text-align: center; }
.z-voll { background: rgba(255,255,255,0.9); color: #111; }
.z-glas { background: rgba(140, 190, 255, 0.22); color: #cfe3ff; box-shadow: inset 0 0 0 1px rgba(160,200,255,0.5); }
.z-aus { background: transparent; color: var(--leise); box-shadow: inset 0 0 0 1px var(--rand); }

/* Karte unten */
/* Höchsthöhe setzt js/haupt.js (groesse): nie über den Hinweisblock; reicht der Platz nicht, rollt die Karte */
#karte { overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#karte { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 34px);
  width: min(560px, calc(100% - 32px)); background: var(--karte); border: 1px solid var(--rand); border-radius: 16px;
  padding: 14px 16px 12px; -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 12px 40px rgba(0,0,0,0.35); z-index: 2; }
.karte-kopf { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.karte-kopf h2 { margin: 0; font-size: 19px; }
.zaehler { font-size: 12px; font-weight: 600; color: var(--akzent); text-transform: uppercase; letter-spacing: 0.06em; }
.satz { margin: 8px 0 0; font-size: 16px; line-height: 1.45; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.punkte { display: flex; gap: 6px; }
.punkt-nav { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.25); }
.punkt-nav.an { background: var(--akzent); width: 18px; border-radius: 3px; }
.spaeter-zeile { margin: 8px 0 0; font-size: 12px; color: var(--leise); text-align: right; }

.knopf { white-space: nowrap; border: 1px solid var(--rand); background: rgba(255,255,255,0.08); padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 15px; min-height: 44px; }
.knopf.klein { padding: 7px 13px; min-height: 36px; font-size: 13px; background: rgba(16,22,34,0.7); }
.knopf.haupt { background: var(--akzent); color: #15120a; border-color: transparent; }
.knopf:disabled { opacity: 0.4; }
.knopf.haupt:disabled { background: rgba(255,255,255,0.14); color: var(--text); opacity: 0.7; }

/* Beschriftungen */
#ueberlagerung { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.linien { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.linie { fill: none; stroke: rgba(255,255,255,0.78); stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.punkt { fill: #fff; stroke: rgba(255,255,255,0.35); stroke-width: 4; }
.linie.tipp { stroke: var(--akzent); } .punkt.tipp { fill: var(--akzent); stroke: rgba(255,210,63,0.3); }
.etikett { position: absolute; left: 0; top: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; padding: 3px 0; white-space: nowrap;
  color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.9); opacity: 0; transition: opacity .45s; }
.etikett.tipp { color: var(--akzent); }
.etikett.blink { animation: blink .7s; }
@keyframes blink { 30% { color: var(--akzent); } }
.etikett.da { opacity: 1; }

/* Fuß */
.fuss { position: absolute; left: 0; right: 0; bottom: calc(env(safe-area-inset-bottom) + 8px); display: flex; justify-content: center; gap: 8px;
  font-size: 12px; color: var(--leise); z-index: 2; }
.fuss a { color: var(--leise); text-decoration: none; }
.fuss a:hover { color: var(--text); text-decoration: underline; }
.spaeter:empty { display: none; }

#laden { position: absolute; inset: 0; display: grid; place-items: center; background: var(--grund); color: var(--leise); font-size: 15px; z-index: 5; transition: opacity .4s; padding: 24px; text-align: center; }
#laden.weg { opacity: 0; pointer-events: none; }
.ohne-js { position: fixed; inset: auto 16px 50% 16px; text-align: center; }

@media (max-width: 480px) {
  .kopf { flex-wrap: wrap; }
  .marke { font-size: 15px; }
  .umschalter button { padding: 6px 10px; font-size: 13px; }
  .satz { font-size: 15px; }
  #karte { padding: 12px 14px 10px; }
  .etikett { font-size: 10.5px; letter-spacing: 0.07em; }
}
@media (max-width: 400px) {
  .nav .punkte { display: none; }
  .knopf { padding: 9px 13px; font-size: 14px; }
}

/* Unterseiten */
.seite { max-width: 680px; margin: 0 auto; padding: 32px 16px 48px; overflow: auto; height: 100%; line-height: 1.55; }
.seite a { color: var(--akzent); }
.seite h1 { font-size: 24px; }
.platzhalter { border: 1px dashed var(--rand); border-radius: 10px; padding: 12px 14px; color: var(--leise); }

/* Bildwirkung: weiche Randabdunklung und Blende für Szenenwechsel */
#vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(95% 80% at 50% 45%, rgba(0,0,0,0) 55%, rgba(3,5,9,0.55) 100%); }
#blende { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .36s ease; background: radial-gradient(90% 70% at 50% 45%, #1a2132 0%, #0b0f18 60%, #05070b 100%); }
#blende.zu { opacity: 1; }

/* Startseite */
#start { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 120px max(24px, 7vw) 60px; pointer-events: none;
  background: linear-gradient(90deg, rgba(5,7,11,0.82) 0%, rgba(5,7,11,0.45) 42%, rgba(5,7,11,0) 68%); }
#start[hidden] { display: none; }
#start > * { pointer-events: auto; max-width: 430px; }
.start-text h1 { margin: 0; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.05; letter-spacing: -0.01em; }
.start-text p { margin: 10px 0 0; font-size: 17px; line-height: 1.45; color: #cfd6e2; }
.start-karten { display: grid; gap: 10px; }
.start-karte { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; align-items: center; text-align: left; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--rand);
  background: rgba(16, 22, 34, 0.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: background .2s, border-color .2s, transform .2s; }
.start-karte:hover { background: rgba(28, 36, 54, 0.85); border-color: rgba(255,210,63,0.55); transform: translateX(3px); }
.start-karte .nr { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #15120a; background: var(--akzent); }
.start-karte .t { font-size: 17px; font-weight: 700; }
.start-karte .u { font-size: 13.5px; line-height: 1.35; color: var(--leise); }
#app[data-modus="start"] #karte, #app[data-modus="start"] #ebenen-knopf, #app[data-modus="start"] #ebenen-liste, #app[data-modus="zelle"] #ebenen-knopf, #app[data-modus="zelle"] #ebenen-liste { display: none; }

/* Karte: Fortschritt */
.reise-leiste { height: 2px; background: rgba(255,255,255,0.12); border-radius: 2px; margin: -2px 0 10px; overflow: hidden; }
.reise-leiste span { display: block; height: 100%; background: var(--akzent); transition: width .6s ease; }
.knopf.breit { width: 100%; margin-top: 12px; }
#extra:empty { display: none; }

@media (max-width: 700px) {
  #start { justify-content: flex-end; padding: 150px 16px 46px; gap: 14px; background: linear-gradient(180deg, rgba(5,7,11,0) 30%, rgba(5,7,11,0.6) 55%, rgba(5,7,11,0.9) 100%); }
  #start > * { max-width: none; }
  .start-text p { font-size: 15px; }
  .start-karte { padding: 11px 13px; }
  .start-karte .t { font-size: 16px; } .start-karte .u { font-size: 13px; }
  .umschalter button { padding: 6px 9px; font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { #blende { transition: none; } }

/* Kopf am Handy: eine Zeile, Übersicht als Haus-Zeichen */
.marke .kurz { display: none; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 700px) {
  .kopf { flex-wrap: nowrap; padding-left: 12px; padding-right: 12px; }
  .marke .lang { display: none; } .marke .kurz { display: block; }
  .marke { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid var(--rand); flex: none; }
  #app[data-modus="start"] .marke { visibility: hidden; }
}

/* Kopf und fester Hinweis liegen immer über Startseite und Karten (RP 18.11.: Hinweis dauerhaft voll lesbar) */
.kopf, .hinweis-bild { z-index: 4; }
.hinweis-bild { color: #e6eaf2; background: rgba(8, 11, 18, 0.72); }

/* Etiketten auf schmalen Bildschirmen: lange Namen umbrechen, damit sie am Rand bleiben und das Motiv frei lassen */
@media (max-width: 520px) {
  .etikett { white-space: normal; max-width: 104px; line-height: 1.2; font-size: 10px; }
  .etikett.rechts { text-align: right; }
}

/* 19.11.2026: Fuß mit dem Kanalnamen. Auf schmalen Bildschirmen steht der Name in einer zweiten Zeile, Karte und Startseite rücken dafür etwas höher. */
.fuss a, .fuss span { white-space: nowrap; }
@media (max-width: 520px) {
  .fuss { flex-wrap: wrap; row-gap: 1px; padding: 0 10px; }
  .fuss .von-trenner { display: none; }
  .fuss .von { flex-basis: 100%; text-align: center; }
  #karte { bottom: calc(env(safe-area-inset-bottom) + 50px); }
  #start { padding-bottom: 62px; }
}

/* 19.11.2026 (GF, Empfehlung der Rechtsprüfung): Hinweis am Desktop etwas größer. Am Handy bleibt er, wie er geprüft ist. */
@media (min-width: 701px) { .hinweis-bild { font-size: 13px; } }
