/* katerpfleger.de — weicher, handgemalter Look: Aquarell-Töne, organische Formen.
   Dunkel = Abenddämmerung (Standard), Hell = Sommerwiese am Vormittag. */

:root {
  --bg: #232e33;
  --bg2: #2b3840;
  --karte: #2f3d45;
  --karte-rand: #46565c;
  --text: #f0e7d3;
  --text-gedimmt: #a8b0a4;
  --akzent: #e0a862;
  --akzent-text: #2b2213;
  --gut: #8fae8b;
  --warn: #cf8f7f;
  --wasser: #8fb5c4;
  --schatten: 0 3px 14px rgba(10, 20, 24, 0.35);
  /* Szene im Kopfbereich: Dämmerung */
  --himmel-oben: #26333a;
  --himmel-unten: #3d4a48;
  --huegel-hinten: #3a4a42;
  --huegel-vorne: #46584c;
  --wolke: #56646a;
  --gestirn: #f0d9a0;
}

:root[data-theme="hell"] {
  --bg: #f4edda;
  --bg2: #ece3cb;
  --karte: #faf5e6;
  --karte-rand: #ddd0b2;
  --text: #4a4234;
  --text-gedimmt: #8a8168;
  --akzent: #c98d4b;
  --akzent-text: #fff8ea;
  --gut: #7a9a65;
  --warn: #bd7462;
  --wasser: #6f9cb0;
  --schatten: 0 3px 12px rgba(120, 100, 60, 0.16);
  /* Szene im Kopfbereich: Sommertag */
  --himmel-oben: #cfe3df;
  --himmel-unten: #ecebd2;
  --huegel-hinten: #b5c98f;
  --huegel-vorne: #94b573;
  --wolke: #fdfbf2;
  --gestirn: #f2d98c;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }

a { color: var(--akzent); }

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

/* ---------- Kopfbereich mit Szene ---------- */

.kopf {
  position: relative;
  max-width: none;
  margin: 0;
  padding: 0 18px 6px;
  text-align: center;
  overflow: hidden;
}

.szene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.szene svg { width: 100%; height: 100%; display: block; }

.gestirn {
  position: absolute;
  top: 34px;
  right: 9%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gestirn);
  opacity: 0.92;
  box-shadow: 0 0 0 14px rgba(240, 217, 160, 0.16);
}

.kopf-inhalt {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding-top: 26px;
}

.kopf .karl-svg {
  width: 138px;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 4px 6px rgba(40, 30, 10, 0.18));
}

.kopf h1 {
  font-size: 1.7rem;
  margin: 6px 0 2px;
  text-shadow: 0 1px 0 rgba(255, 250, 235, 0.08);
}

.kopf .untertitel {
  color: var(--text-gedimmt);
  font-size: 0.92rem;
  font-style: italic;
  font-family: Georgia, serif;
  margin: 0 0 14px;
}

.sprechblase {
  position: relative;
  background: var(--karte);
  border: 1.5px solid var(--karte-rand);
  border-radius: 22px 26px 24px 20px / 24px 20px 26px 22px;
  padding: 14px 18px;
  font-size: 1.02rem;
  font-family: Georgia, serif;
  box-shadow: var(--schatten);
  margin: 0 auto 16px;
  max-width: 480px;
}

.sprechblase::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  margin-left: -8px;
  border: 8px solid transparent;
  border-bottom-color: var(--karte-rand);
  border-top: none;
}

/* ---------- Theme-Schalter ---------- */

.theme-schalter {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: var(--karte);
  color: var(--text);
  border: 1.5px solid var(--karte-rand);
  border-radius: 20px 24px 22px 18px / 22px 18px 24px 20px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-family: Georgia, serif;
  cursor: pointer;
  min-height: 40px;
  box-shadow: var(--schatten);
}

/* ---------- Navigation ---------- */

.navi {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  border-bottom: 1.5px solid var(--karte-rand);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.navi::-webkit-scrollbar { display: none; }

.navi ul {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 8px 14px;
  white-space: nowrap;
}

.navi a {
  display: inline-block;
  padding: 9px 14px;
  border-radius: 16px 20px 18px 15px / 18px 15px 20px 17px;
  text-decoration: none;
  color: var(--text-gedimmt);
  font-size: 0.88rem;
  background: var(--bg2);
  border: 1px solid transparent;
}

.navi a:active, .navi a:hover { color: var(--text); border-color: var(--karte-rand); }

/* ---------- Sektionen / Karten ---------- */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 14px 40px;
}

.sektion {
  background: var(--karte);
  border: 1.5px solid var(--karte-rand);
  border-radius: 22px 18px 24px 20px / 20px 24px 18px 22px;
  padding: 20px 18px;
  margin: 20px 0;
  box-shadow: var(--schatten);
  scroll-margin-top: 64px;
}

.sektion:nth-child(even) {
  border-radius: 18px 24px 20px 22px / 24px 20px 22px 18px;
}

.sektion > h2 {
  margin: 0 0 4px;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stationsschild {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-gedimmt);
  margin: 0 0 12px;
}

.karl-kommentar {
  background: var(--bg2);
  border-left: 3px solid var(--akzent);
  border-radius: 4px 16px 14px 4px / 4px 14px 16px 4px;
  padding: 11px 14px;
  margin: 12px 0;
  font-size: 0.98rem;
  font-family: Georgia, serif;
}

.hinweis { color: var(--text-gedimmt); font-size: 0.88rem; }

/* ---------- Buttons ---------- */

button {
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}

.knopf {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 13px 18px;
  border: none;
  border-radius: 18px 22px 20px 16px / 20px 16px 22px 18px;
  background: var(--akzent);
  color: var(--akzent-text);
  font-weight: 600;
  font-size: 1.05rem;
  box-shadow: 0 2px 0 rgba(60, 40, 10, 0.18);
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.knopf:active { transform: scale(0.98); }

.knopf.sekundaer {
  background: var(--bg2);
  color: var(--text);
  border: 1.5px solid var(--karte-rand);
  font-weight: 500;
  box-shadow: none;
}

.knopf + .knopf { margin-top: 10px; }

.knopf:disabled { opacity: 0.5; cursor: default; }

/* ---------- Aufnahmegespräch ---------- */

.frage-zaehler {
  font-size: 0.8rem;
  color: var(--text-gedimmt);
  margin-bottom: 6px;
}

.frage-titel {
  font-size: 1.2rem;
  font-weight: 600;
  font-family: Georgia, serif;
  margin: 4px 0 14px;
}

.antworten .knopf { text-align: left; margin-top: 10px; }

.reue-slider { width: 100%; margin: 18px 0 6px; accent-color: var(--akzent); height: 34px; }

.reue-wert {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 700;
  font-family: Georgia, serif;
  color: var(--akzent);
}

/* ---------- Diagnose ---------- */

.diagnose-karte {
  border: 2px dashed var(--karte-rand);
  border-radius: 16px 20px 18px 14px / 18px 14px 20px 16px;
  padding: 16px;
  margin: 14px 0;
  background: var(--bg2);
}

.diagnose-karte .stadium {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--warn);
  margin: 0;
}

.diagnose-karte h3 { margin: 6px 0 8px; font-size: 1.35rem; }

.diagnose-kopf { display: flex; gap: 14px; align-items: flex-start; }
.diagnose-kopf .karl-svg { width: 88px; flex-shrink: 0; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 16px 0 0; padding: 0; position: relative; }

.timeline::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: var(--karte-rand);
  border-radius: 2px;
}

.timeline li {
  position: relative;
  padding: 0 0 18px 52px;
  min-height: 44px;
}

.timeline .punkt {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  height: 36px;
  border-radius: 50% 46% 52% 48% / 48% 52% 46% 50%;
  border: 2px solid var(--karte-rand);
  background: var(--bg2);
  color: var(--text-gedimmt);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.timeline li.erledigt .punkt {
  background: var(--gut);
  border-color: var(--gut);
  color: #fffdf4;
}

.timeline li.aktuell .punkt { border-color: var(--akzent); color: var(--akzent); }

.timeline .zeit { font-size: 0.78rem; color: var(--text-gedimmt); }

.timeline .titel { font-weight: 600; font-family: Georgia, serif; }

.timeline li.erledigt .titel { text-decoration: line-through; opacity: 0.6; }

.timeline .notiz { font-size: 0.88rem; color: var(--text-gedimmt); }

/* ---------- Wasserzähler ---------- */

.wasser-stand {
  text-align: center;
  font-size: 3.2rem;
  font-weight: 700;
  font-family: Georgia, serif;
  color: var(--wasser);
  margin: 4px 0 0;
}

.wasser-einheit { text-align: center; color: var(--text-gedimmt); margin: 0 0 14px; font-size: 0.9rem; }

.wasser-knopf {
  width: 100%;
  min-height: 76px;
  font-size: 1.3rem;
  border: none;
  border-radius: 22px 26px 24px 20px / 24px 20px 26px 22px;
  background: var(--wasser);
  color: #22333c;
  font-weight: 700;
  box-shadow: 0 2px 0 rgba(30, 50, 60, 0.25);
  transition: transform 0.1s ease;
}
.wasser-knopf:active { transform: scale(0.97); }

/* ---------- PLZ / Orte ---------- */

.plz-zeile { display: flex; gap: 10px; margin: 10px 0; }

.plz-zeile input {
  flex: 1;
  min-width: 0;
  font-size: 1.2rem;
  padding: 12px 14px;
  border-radius: 14px 18px 16px 12px / 16px 12px 18px 14px;
  border: 1.5px solid var(--karte-rand);
  background: var(--bg2);
  color: var(--text);
  letter-spacing: 0.15em;
}

.plz-zeile .knopf { width: auto; flex-shrink: 0; padding: 12px 20px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 10px; }

.tabs button {
  border: 1.5px solid var(--karte-rand);
  background: var(--bg2);
  color: var(--text-gedimmt);
  border-radius: 16px 20px 18px 14px / 18px 14px 20px 16px;
  padding: 9px 14px;
  font-size: 0.88rem;
  min-height: 40px;
}

.tabs button.aktiv {
  background: var(--gut);
  color: #fffdf4;
  border-color: var(--gut);
  font-weight: 600;
}

.orte-liste { list-style: none; margin: 6px 0; padding: 0; }

.orte-liste li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--karte-rand);
}
.orte-liste li:last-child { border-bottom: none; }

.orte-liste .distanz { color: var(--text-gedimmt); font-size: 0.85rem; white-space: nowrap; }

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

.wetter-zeile {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 1.05rem;
}
.wetter-zeile .temp { font-size: 2rem; font-weight: 700; font-family: Georgia, serif; }

/* ---------- Döner-Kompass ---------- */

.kompass-anzeige { text-align: center; margin: 10px 0; }

.kompass-pfeil {
  width: 110px;
  height: 110px;
  margin: 6px auto;
  transition: transform 0.3s ease;
}

.kompass-ziel { font-size: 1.05rem; font-weight: 600; font-family: Georgia, serif; }

/* ---------- Rezepte ---------- */

.rezept {
  border: 1.5px solid var(--karte-rand);
  border-radius: 14px 18px 16px 12px / 16px 12px 18px 14px;
  margin: 12px 0;
  background: var(--bg2);
  overflow: hidden;
}

.rezept summary {
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 600;
  font-family: Georgia, serif;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-height: 48px;
}
.rezept summary::-webkit-details-marker { display: none; }

.rezept .einhand {
  font-size: 0.72rem;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 4px 10px;
  border-radius: 10px 12px 11px 9px / 11px 9px 12px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.einhand.ja { background: var(--gut); color: #fffdf4; }
.einhand.mittel { background: var(--akzent); color: var(--akzent-text); }
.einhand.nein { background: var(--warn); color: #fffdf4; }

.rezept .rumpf { padding: 0 14px 14px; font-size: 0.94rem; }
.rezept .rumpf p { margin: 8px 0; }

/* ---------- Katerfrei-Tafel: Holzschild ---------- */

.unfalltafel {
  border: 4px solid #8a6a45;
  border-radius: 14px 18px 16px 12px / 16px 12px 18px 14px;
  padding: 18px 16px;
  text-align: center;
  background: var(--bg2);
  box-shadow: inset 0 0 0 2px var(--karte), var(--schatten);
  font-family: Georgia, serif;
}

.unfalltafel .tage {
  font-size: 3.4rem;
  font-weight: 700;
  color: var(--akzent);
  line-height: 1.1;
  display: block;
}

.unfalltafel .zeile { text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.8rem; }

/* ---------- Urkunde ---------- */

.urkunde-canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1.5px solid var(--karte-rand);
  display: block;
  margin: 12px 0;
}

/* ---------- Fußzeile ---------- */

footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 34px;
  text-align: center;
  color: var(--text-gedimmt);
  font-size: 0.85rem;
}

footer a { color: var(--text-gedimmt); }

footer .disclaimer { margin-top: 10px; font-size: 0.78rem; font-style: italic; font-family: Georgia, serif; }

/* ---------- Unterseiten ---------- */

.unterseite { max-width: 720px; margin: 0 auto; padding: 24px 18px 40px; }
.unterseite h1 { font-size: 1.6rem; }
.platzhalter { background: var(--warn); color: #fffdf4; padding: 1px 7px; border-radius: 6px; font-size: 0.85em; }

/* ---------- Sichtbarkeit ---------- */

.versteckt { display: none !important; }

/* ---------- Breitere Bildschirme ---------- */

@media (min-width: 700px) {
  .kopf-inhalt { padding-top: 40px; }
  .kopf .karl-svg { width: 168px; }
  .kopf h1 { font-size: 2.2rem; }
  main { padding: 16px 18px 60px; }
  .sektion { padding: 26px 26px; }
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
