/* Schriften lokal eingebunden, keine Verbindung zu Google Fonts */
@font-face { font-family: 'Figtree'; src: url('../fonts/figtree.woff2') format('woff2'); font-weight: 300 900; font-display: swap; }
@font-face { font-family: 'Literata'; src: url('../fonts/literata-italic.woff2') format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Give You Glory'; src: url('../fonts/give-you-glory.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #fbf6f1;
  --flaeche: #ffffff;
  --sand: #f3e7dc;
  --sand-2: #ead8c8;
  --text: #2c1e18;
  --text-2: #6b564b;
  --marke: #a03215;
  --marke-2: #b85d33;
  --auf-marke: #ffffff;
  --linie: #e6d6c8;
  --ruhe: #51705f;
  --ruhe-bg: #e8efe9;
  --schatten: 0 1px 2px rgba(74, 38, 20, .06), 0 8px 24px rgba(74, 38, 20, .06);
  --radius: 18px;
  --leiste-h: 68px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1613;
    --flaeche: #2a1e1a;
    --sand: #33251f;
    --sand-2: #44322a;
    --text: #f4e9e1;
    --text-2: #c4ada0;
    --marke: #e38a5e;
    --marke-2: #d9774a;
    --auf-marke: #24140d;
    --linie: #46342c;
    --ruhe: #a5c6b3;
    --ruhe-bg: #26332c;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Figtree', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  min-height: 100dvh;
  padding-bottom: calc(var(--leiste-h) + env(safe-area-inset-bottom));
}
h1, h2 { font-weight: 500; line-height: 1.2; margin: 0 0 .5em; text-wrap: balance; }
h3, h4 { font-weight: 600; line-height: 1.3; margin: 0 0 .4em; }
h1 { font-size: clamp(1.75rem, 6vw, 2.3rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1em; }
a { color: var(--marke); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--marke-2); outline-offset: 3px; border-radius: 6px; }
#view:focus { outline: none; }
.hope { font-family: 'Give You Glory', cursive; font-size: 1.25em; color: var(--marke); font-weight: 400; line-height: 1; padding: 0 .08em; }
.skip { position: absolute; left: -999px; top: 0; background: var(--marke); color: var(--auf-marke); padding: .6em 1em; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }

/* Kopf */
.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 10px; color: var(--marke); text-decoration: none; }
.marke-text { display: flex; flex-direction: column; line-height: 1.15; }
.marke-name { font-weight: 500; font-size: 1.05rem; color: var(--text); }
.marke-zusatz { font-weight: 600; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--marke); }
.akut {
  font-size: .9rem; font-weight: 600; text-decoration: none;
  padding: .45em .95em; border-radius: 999px;
  border: 1.5px solid var(--marke); color: var(--marke); white-space: nowrap;
}

/* Inhalt */
#view { max-width: 680px; margin: 0 auto; padding: 24px 16px 40px; }
.eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; color: var(--marke-2); margin: 0 0 .7em; }
.lead { font-size: 1.08rem; color: var(--text-2); }
.klein { font-size: .88rem; color: var(--text-2); }
.mitte { text-align: center; }
.stapel > * + * { margin-top: 14px; }
.abstand { margin-top: 28px; }

.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--schatten);
}
.karte > :last-child { margin-bottom: 0; }
.karte.sand { background: var(--sand); box-shadow: none; }
.karte.ruhe { background: var(--ruhe-bg); border-color: transparent; box-shadow: none; }
.karte.akut-box { border: 2px solid var(--marke); }

.zitat { font-family: 'Literata', Georgia, serif; font-style: italic; font-size: 1.3rem; line-height: 1.45; margin: 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: .7em 1.4em; width: 100%;
  font: inherit; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.3;
  border-radius: 999px; border: 1.5px solid var(--marke); cursor: pointer;
  background: var(--marke); color: var(--auf-marke);
  transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.zweit { background: transparent; color: var(--marke); }
.btn.leise { background: transparent; border-color: var(--linie); color: var(--text); font-weight: 500; }
.btn.gross { min-height: 64px; font-size: 1.1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.textlink { background: none; border: 0; padding: .5em; font: inherit; color: var(--marke); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; }
.reihe > * { flex: 1 1 150px; }

/* Kachelliste */
.kacheln { display: grid; gap: 12px; grid-template-columns: 1fr; list-style: none; padding: 0; margin: 0; }
@media (min-width: 520px) { .kacheln.zwei { grid-template-columns: 1fr 1fr; } }
.kachel {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--text); box-shadow: var(--schatten);
  height: 100%;
}
.kachel strong { font-weight: 600; font-size: 1.05rem; grid-column: 1; }
.kachel span { grid-column: 1; color: var(--text-2); font-size: .93rem; line-height: 1.45; }
.kachel em { grid-column: 2; grid-row: 1 / span 2; font-style: normal; font-size: .8rem; font-weight: 600; color: var(--marke-2); white-space: nowrap; }
.kachel::after { content: '›'; grid-column: 2; grid-row: 1 / span 2; font-size: 1.5rem; color: var(--marke-2); }
.kachel:has(em)::after { content: none; }

/* Spieler für Übungen */
.spieler { min-height: calc(100dvh - 240px); display: flex; flex-direction: column; justify-content: center; gap: 22px; text-align: center; }
.spieler .satz { font-size: clamp(1.3rem, 5vw, 1.65rem); line-height: 1.4; font-weight: 500; margin: 0; text-wrap: balance; }
.punkte { display: flex; gap: 6px; justify-content: center; }
.punkte i { width: 8px; height: 8px; border-radius: 50%; background: var(--sand-2); }
.punkte i.an { background: var(--marke); }

.atem { display: grid; place-items: center; height: 250px; }
.atem-kreis {
  --dauer: 4s;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, var(--marke-2), var(--marke));
  opacity: .9; transform: scale(.45);
  transition: transform var(--dauer) ease-in-out;
}
.atem-kreis.ein { transform: scale(1); }
.atem-text { font-size: 1.5rem; font-weight: 500; margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .atem-kreis { transition: opacity var(--dauer) linear; transform: scale(.8); opacity: .45; }
  .atem-kreis.ein { transform: scale(.8); opacity: 1; }
  .btn { transition: none; }
}

/* Orientierung */
.fortschritt { height: 6px; background: var(--sand-2); border-radius: 99px; overflow: hidden; }
.fortschritt i { display: block; height: 100%; width: calc(var(--w, 0) * 1%); background: var(--marke); border-radius: 99px; transition: width .25s ease; }
.frage { font-size: 1.3rem; font-weight: 500; line-height: 1.4; margin: 22px 0; text-wrap: pretty; }
.antworten { display: grid; gap: 10px; }
.antworten .btn { justify-content: flex-start; text-align: left; border-radius: 16px; padding-left: 1.2em; }
.antworten .btn.gewaehlt { background: var(--marke); color: var(--auf-marke); border-color: var(--marke); }
.balken { display: grid; gap: 14px; }
.balken-zeile { display: grid; gap: 6px; }
.balken-kopf { display: flex; justify-content: space-between; gap: 12px; font-size: .95rem; font-weight: 600; }
.balken-kopf span:last-child { font-weight: 400; color: var(--text-2); white-space: nowrap; }
.balken-spur { height: 10px; background: var(--sand-2); border-radius: 99px; overflow: hidden; }
.balken-spur i { display: block; height: 100%; width: calc(var(--w, 0) * 1%); background: var(--marke-2); border-radius: 99px; }

/* Verstehen */
details.wissen { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 0 18px; }
details.wissen summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 600; list-style: none; position: relative; }
details.wissen summary::-webkit-details-marker { display: none; }
details.wissen summary::after { content: '+'; position: absolute; right: 0; top: 12px; font-size: 1.5rem; font-weight: 400; color: var(--marke-2); }
details.wissen[open] summary::after { content: '−'; }
details.wissen > div { padding-bottom: 6px; }

/* Formulare */
label, legend { font-weight: 600; display: block; margin-bottom: 6px; }
fieldset { border: 0; padding: 0; margin: 0; }
input[type=text], input[type=email], textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--flaeche);
  border: 1.5px solid var(--sand-2); border-radius: 14px; padding: .75em 1em;
}
textarea { min-height: 96px; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--marke); height: 36px; }
.skala-enden { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-2); }
.wert { font-size: 2rem; font-weight: 500; color: var(--marke); line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { margin: 0; font-weight: 500; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-block; padding: .55em 1.1em; border-radius: 999px; border: 1.5px solid var(--sand-2); background: var(--flaeche); cursor: pointer; }
.chips input:checked + span { background: var(--marke); border-color: var(--marke); color: var(--auf-marke); }
.chips input:focus-visible + span { outline: 3px solid var(--marke-2); outline-offset: 2px; }
.haken { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; font-weight: 400; font-size: .92rem; line-height: 1.5; }
.haken input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--marke); }
.falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.meldung { padding: 14px 16px; border-radius: 14px; background: var(--ruhe-bg); color: var(--text); }
.meldung.fehler { background: var(--sand); border: 1.5px solid var(--marke); }

/* Verlauf */
.diagramm { width: 100%; height: auto; display: block; }
.diagramm .linie { fill: none; stroke: var(--marke); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.diagramm .punkt { fill: var(--marke); }
.diagramm .raster { stroke: var(--linie); stroke-width: 1; }
.diagramm text { fill: var(--text-2); font-size: 11px; font-family: inherit; }
.eintraege { list-style: none; padding: 0; margin: 0; }
.eintraege li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.eintraege li:last-child { border-bottom: 0; }
.eintraege .datum { font-weight: 600; font-size: .93rem; }
.eintraege .notiz { grid-column: 1 / -1; color: var(--text-2); font-size: .93rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.eintraege button { background: none; border: 0; color: var(--text-2); font: inherit; font-size: .85rem; text-decoration: underline; cursor: pointer; padding: 4px; }

/* Akute Hilfe */
.nummer { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--linie); }
.nummer:last-child { border-bottom: 0; padding-bottom: 0; }
.nummer:first-child { padding-top: 0; }
.nummer strong { font-weight: 600; }
.nummer p { grid-column: 1 / -1; margin: 0; font-size: .9rem; color: var(--text-2); line-height: 1.5; }
.nummer a { font-weight: 600; font-size: 1.05rem; white-space: nowrap; text-decoration: none; padding: .35em .9em; border-radius: 999px; background: var(--marke); color: var(--auf-marke); }

/* Untere Leiste */
.leiste {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--flaeche); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom);
}
.leiste a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  height: var(--leiste-h); text-decoration: none; color: var(--text-2); font-size: .72rem; font-weight: 600;
}
.leiste svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.leiste a[aria-current=page] { color: var(--marke); }

/* Dialog */
.dialog { border: 0; border-radius: var(--radius); padding: 24px; max-width: min(92vw, 440px); background: var(--flaeche); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.dialog::backdrop { background: rgba(30, 15, 8, .55); }

.fuss { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--linie); font-size: .85rem; color: var(--text-2); text-align: center; }
.fuss a { color: var(--text-2); }

/* Ergänzungen */
.nummer .jetzt { color: var(--ruhe); font-weight: 600; }
.nummer p a { padding: 0; border-radius: 0; background: none; color: var(--marke); font-size: inherit; text-decoration: underline; white-space: normal; }
.person { display: flex; align-items: center; gap: 14px; }
.person img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.person p { margin: 0; }

input[type=tel] { width: 100%; font: inherit; color: var(--text); background: var(--flaeche); border: 1.5px solid var(--sand-2); border-radius: 14px; padding: .75em 1em; }
::placeholder { color: var(--text-2); opacity: .75; }
.vorformat { white-space: pre-wrap; overflow-wrap: anywhere; }
audio { width: 100%; }

/* per Skript fokussierte Überschriften und Sätze ohne Rahmen */
[tabindex="-1"]:focus { outline: none; }
