@font-face {
  font-family: "Atkinson Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Next";
  src: url("/fonts/atkinson-hyperlegible-next-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --papier: #F6F8FB;
  --karo: #DCE6F3;
  --tinte: #2340B0;
  --tinte-hell: #E3E8FA;
  --graphit: #262A31;
  --graphit-leise: #5B6270;
  --marker: #FFE15A;
  --marker-text: #262A31;
  --rot: #C8243B;
  --gruen: #1E7A4C;
  --gruen-hell: #E2F4EA;
  --rot-hell: #FBE6E9;
  --flaeche: #FFFFFF;

  --schrift: "Atkinson Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --raster: 24px;

  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --papier: #141A24;
    --karo: #1F2938;
    --tinte: #8EA4FF;
    --tinte-hell: #222D4A;
    --graphit: #E8ECF3;
    --graphit-leise: #A3ABBA;
    --marker: #FFE15A;
    --marker-text: #1A1D22;
    --rot: #FF7A8C;
    --gruen: #6FD39B;
    --gruen-hell: #173326;
    --rot-hell: #3A1C23;
    --flaeche: #1A2230;
  }
}

*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--schrift);
  font-size: 1.1875rem;
  line-height: 1.5;
  color: var(--graphit);
  background-color: var(--papier);
  /* Rechenkaro wie im Schulheft */
  background-image:
    linear-gradient(var(--karo) 1px, transparent 1px),
    linear-gradient(90deg, var(--karo) 1px, transparent 1px);
  background-size: var(--raster) var(--raster);
}

.kopf {
  max-width: 34rem;
  margin: 0 auto;
  padding: 16px 20px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.kopf-profil {
  display: inline-flex; align-items: center; gap: 6px; max-width: 60%;
  padding: 4px 12px 4px 4px; border: 2px solid var(--tinte-hell); border-radius: 999px;
  background: var(--flaeche); color: var(--graphit); font: inherit; font-size: 0.9375rem; font-weight: 700; cursor: pointer;
}
.kopf-profil #kopf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--tinte-hell); font-size: 1.25rem; line-height: 1; }
.gross-bruno { display: block; width: 160px; height: 86px; margin: 8px auto 16px; }
#s-koppeln h1, #s-koppeln > .hinweis { text-align: center; }
#koppel-code { text-transform: uppercase; letter-spacing: 0.15em; font-size: 1.375rem; text-align: center; }
.profil-liste { list-style: none; margin: 8px 0 24px; padding: 0; display: grid; gap: 12px; }
.profil-liste button {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 76px; padding: 10px 16px;
  font: inherit; font-size: 1.375rem; font-weight: 700; color: var(--graphit); text-align: left;
  background: var(--flaeche); border: 2px solid var(--tinte); border-radius: 16px; cursor: pointer;
}
.profil-liste .avatar { width: 52px; height: 52px; font-size: 2rem; }
.marke {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--tinte);
}
.marke-bruno { width: 44px; height: 24px; }

main {
  max-width: 34rem;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

h1 {
  font-size: 1.875rem;
  line-height: 1.2;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
h2 { font-size: 1.375rem; line-height: 1.25; margin: 0 0 12px; }
.hinweis { margin: 0 0 24px; color: var(--graphit-leise); max-width: 30em; }

button, .kamera { font: inherit; }
:focus-visible { outline: 3px solid var(--tinte); outline-offset: 3px; }
h1:focus { outline: none; } /* Überschrift bekommt den Fokus nur für Screenreader beim Ansichtswechsel */

/* ---------- Fotos ---------- */

.seiten {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.seiten li { position: relative; }
.seiten img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border: 2px solid var(--graphit);
  background: var(--flaeche);
}
.seiten .nummer {
  position: absolute; left: 6px; bottom: 6px;
  background: var(--papier); color: var(--graphit);
  font-size: 0.875rem; font-weight: 700; padding: 0 6px;
}
.seiten .weg {
  position: absolute; top: -10px; right: -10px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--graphit); background: var(--papier); color: var(--graphit);
  font-size: 1.25rem; line-height: 1; cursor: pointer;
}

/* Der große Kameraknopf ist das eine laute Element der App */
.kamera {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  width: 200px; height: 200px; margin: 8px auto 24px;
  border-radius: 50%;
  background: var(--tinte); color: var(--papier);
  font-weight: 700; text-align: center;
  cursor: pointer;
  box-shadow: 0 0 0 8px var(--tinte-hell);
  transition: transform 120ms ease;
}
.kamera:active { transform: scale(0.96); }
.kamera svg { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.kamera input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.kamera:focus-within { outline: 3px solid var(--tinte); outline-offset: 12px; }
/* sobald ein Foto da ist, tritt der Knopf zurück */
.kamera.klein {
  flex-direction: row; width: 100%; height: 56px; border-radius: 28px; margin: 0 0 12px;
  background: var(--flaeche); color: var(--tinte); border: 2px solid var(--tinte); box-shadow: none;
}
.kamera.klein svg { width: 28px; height: 28px; }

.los {
  display: block; width: 100%; min-height: 60px;
  border: 0; border-radius: 30px;
  background: var(--tinte); color: var(--papier);
  font-weight: 700; font-size: 1.25rem; cursor: pointer;
}
.los:disabled { opacity: 0.5; cursor: wait; }
.leise {
  display: block; margin: 16px auto 0; padding: 10px 16px;
  border: 0; background: none; color: var(--graphit-leise);
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}

/* ---------- Warten ---------- */

.schritte { margin: 8px 0 24px; padding: 0; list-style: none; counter-reset: s; }
.schritte li {
  counter-increment: s;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; color: var(--graphit-leise);
}
.schritte li::before {
  content: counter(s);
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid currentColor; font-weight: 700;
}
.schritte li.aktiv { color: var(--graphit); font-weight: 700; }
.schritte li.aktiv::before { border-color: var(--tinte); color: var(--tinte); animation: puls 1.4s ease-in-out infinite; }
.schritte li.erledigt { color: var(--graphit); }
.schritte li.erledigt::before { content: "✓"; background: var(--tinte); border-color: var(--tinte); color: var(--papier); }
@keyframes puls { 50% { box-shadow: 0 0 0 6px var(--tinte-hell); } }

/* ---------- Rückfrage ---------- */

.satz {
  font-size: 1.5rem; line-height: 1.6;
  background: var(--flaeche); padding: 16px 20px; margin: 0 0 24px;
  border-left: 4px solid var(--tinte);
}
.luecke {
  display: inline-block; min-width: 4em; padding: 0 6px;
  background: var(--marker); color: var(--marker-text); font-weight: 700;
  text-align: center;
}
.optionen { display: grid; gap: 12px; }
.optionen button {
  min-height: 60px; padding: 8px 20px;
  border: 2px solid var(--tinte); border-radius: 30px;
  background: var(--flaeche); color: var(--graphit);
  font-size: 1.375rem; font-weight: 700; cursor: pointer;
}
.optionen button:active { background: var(--marker); color: var(--marker-text); border-color: var(--marker); }
.heft-ansicht { margin-top: 24px; }
.heft-ansicht summary { cursor: pointer; color: var(--tinte); font-weight: 700; padding: 8px 0; }
.heft-ansicht img { display: block; width: 100%; margin-top: 12px; border: 2px solid var(--graphit); }
.zaehler { margin-top: 24px; color: var(--graphit-leise); font-size: 1rem; }

/* ---------- Ergebnis ---------- */

.eintrag {
  background: var(--flaeche); padding: 20px; margin: 0 0 24px;
  border-left: 4px solid var(--tinte);
}
#fertig-text { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- Hörspiel ---------- */

.player { margin: 8px 0 32px; text-align: center; }
.folge { font-size: 1.375rem; font-weight: 700; margin: 0 0 20px; }
.abspielen {
  display: grid; place-items: center;
  width: 160px; height: 160px; margin: 0 auto 24px;
  border: 0; border-radius: 50%;
  background: var(--tinte); color: var(--papier);
  box-shadow: 0 0 0 8px var(--tinte-hell);
  cursor: pointer; transition: transform 120ms ease;
}
.abspielen:active { transform: scale(0.96); }
.abspielen svg { width: 72px; height: 72px; fill: currentColor; }
.abspielen .icon-pause { display: none; }
.abspielen.laeuft .icon-play { display: none; }
.abspielen.laeuft .icon-pause { display: block; }
.abspielen:disabled { opacity: 0.5; cursor: wait; }
#fortschritt { width: 100%; accent-color: var(--tinte); height: 32px; }
.zeiten { display: flex; justify-content: space-between; font-size: 1rem; color: var(--graphit-leise); font-variant-numeric: tabular-nums; }
.heft-text { margin: 0 0 24px; }
.heft-text summary { cursor: pointer; color: var(--tinte); font-weight: 700; padding: 8px 0; }
.heft-text .eintrag { margin-top: 12px; }

/* Steuerung: 10 s zurück / vor neben dem großen Knopf */
.steuerung { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 24px; }
.steuerung .abspielen { margin: 0; }
.springen {
  position: relative; display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--tinte); background: var(--flaeche); color: var(--tinte); cursor: pointer;
}
.springen svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.springen span { position: absolute; font-size: 0.8125rem; font-weight: 700; }

/* ---------- Meine Hörspiele ---------- */

.meine {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; margin-top: 16px;
  border: 2px solid var(--tinte); border-radius: 28px;
  background: var(--flaeche); color: var(--tinte);
  font: inherit; font-weight: 700; cursor: pointer;
}
.meine svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
#anzahl-hoerspiele { font-weight: 400; }
.hoerspiele { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; }
.hoerspiele button {
  display: block; width: 100%; text-align: left; padding: 14px 16px;
  font: inherit; color: var(--graphit); background: var(--flaeche);
  border: 0; border-left: 4px solid var(--tinte); cursor: pointer;
}
.hoerspiele b { display: block; font-size: 1.1875rem; }
.hoerspiele small { display: block; color: var(--graphit-leise); font-size: 0.9375rem; margin-top: 2px; }

/* ---------- Kleinteile ---------- */

.ueber { margin: 0 0 4px; font-size: 0.9375rem; font-weight: 700; color: var(--tinte); text-transform: uppercase; letter-spacing: 0.06em; }
.tipp { margin: -8px 0 24px; text-align: center; font-size: 1rem; color: var(--graphit-leise); }
.kamera.klein ~ .tipp { display: none; }
.fuss { display: flex; justify-content: center; flex-wrap: wrap; gap: 0 24px; margin-top: 8px; }
.fuss .leise { margin: 0; }

/* Erinnerung an fällige Wiederholungen – freundlich, ohne Druck */
.erinnerung {
  display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 24px; padding: 12px 16px;
  font: inherit; text-align: left; color: var(--graphit); cursor: pointer;
  background: var(--flaeche); border: 2px solid var(--marker); border-radius: 12px;
}
.erinnerung svg { flex: none; width: 64px; height: 34px; }

/* ---------- Warten: Ermittlungsweg mit Bruno ---------- */

.ermittlungsweg { position: relative; padding-top: 44px; margin: 8px 0 28px; }
.weg-bruno {
  position: absolute; top: 0; left: 0; width: 72px; height: 38px;
  transform: translateX(var(--bruno-x, 0px));
  transition: transform 1.2s cubic-bezier(.5, 0, .3, 1);
}
.weg-bruno { display: grid; place-items: center; }
.weg-bruno svg { width: 72px; height: 38px; }
.weg-bruno .emoji { font-size: 34px; line-height: 38px; }
.weg-bruno > * { animation: tapsen 0.5s ease-in-out infinite alternate; transform-origin: center; }
@keyframes tapsen { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-3px) rotate(1.5deg); } }
.stationen {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  position: relative;
}
.stationen::before {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 21px;
  border-top: 3px dashed var(--karo-dunkel, var(--graphit-leise)); opacity: .5;
}
.stationen li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--graphit-leise); font-size: 0.9375rem; }
.stationen .punkt {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--flaeche); border: 2px solid currentColor;
}
.stationen svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.stationen li.aktiv { color: var(--tinte); font-weight: 700; }
.stationen li.aktiv .punkt { box-shadow: 0 0 0 6px var(--tinte-hell); animation: puls 1.4s ease-in-out infinite; }
.stationen li.erledigt { color: var(--graphit); }
.stationen li.erledigt .punkt { background: var(--tinte); border-color: var(--tinte); color: var(--papier); }

.uhr { display: grid; justify-items: center; gap: 4px; margin: 0 0 28px; text-align: center; }
.uhr-zeit { font-size: 3.25rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--tinte); }
.uhr-rest { font-size: 1.125rem; font-weight: 700; }
.uhr-detail { font-size: 0.9375rem; color: var(--graphit-leise); min-height: 1.4em; }
.balken { width: 100%; height: 12px; margin: 8px 0 2px; border-radius: 6px; background: var(--tinte-hell); overflow: hidden; }
.balken span {
  display: block; height: 100%; width: 0; border-radius: 6px; background: var(--tinte);
  background-image: repeating-linear-gradient(45deg, transparent 0 8px, rgba(255,255,255,.18) 8px 16px);
  background-size: 22px 22px; animation: streifen 1s linear infinite; transition: width .8s ease;
}
@keyframes streifen { to { background-position: 22px 0; } }

.aufgabe { background: var(--flaeche); border-left: 4px solid var(--marker); padding: 14px 18px; margin: 0 0 24px; }
.aufgabe-kopf { margin: 0 0 6px; font-size: 0.875rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--graphit-leise); }
.aufgabe-text { margin: 0; font-size: 1.25rem; line-height: 1.45; }
.aufgabe .leise { margin: 8px 0 0; padding-left: 0; }

/* ---------- Hörspiel: Einladung zum Fall-Check ---------- */

.check-karte { background: var(--flaeche); border: 2px solid var(--tinte); border-radius: 16px; padding: 18px; margin: 0 0 24px; }
.check-text { margin: 0 0 14px; font-size: 1.1875rem; }
.los.zweitrangig { background: var(--flaeche); color: var(--tinte); border: 2px solid var(--tinte); }
.check-karte.bereit { border-color: var(--marker); box-shadow: 0 0 0 6px color-mix(in srgb, var(--marker) 35%, transparent); }

/* ---------- Fall-Check ---------- */

.pfoten { list-style: none; display: flex; gap: 10px; margin: 6px 0 18px; padding: 0; }
.pfoten li { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--graphit-leise); display: grid; place-items: center; font-size: 0.875rem; font-weight: 700; color: var(--graphit-leise); }
.pfoten li.jetzt { border-color: var(--tinte); color: var(--tinte); box-shadow: 0 0 0 4px var(--tinte-hell); }
.pfoten li.richtig { background: var(--gruen); border-color: var(--gruen); color: var(--papier); }
.pfoten li.falsch { background: var(--marker); border-color: var(--marker); color: var(--marker-text); }
.quiz-frage { font-size: 1.625rem; line-height: 1.3; margin-bottom: 20px; }
.quiz-nochmal { margin: -8px 0 16px; font-weight: 700; color: var(--tinte); }
.quiz-optionen { display: grid; gap: 12px; margin-bottom: 20px; }
.quiz-optionen button {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px; text-align: left;
  font: inherit; font-size: 1.1875rem; color: var(--graphit); background: var(--flaeche);
  border: 2px solid var(--tinte); border-radius: 16px; cursor: pointer;
}
.quiz-optionen .buchstabe {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--tinte-hell); color: var(--tinte); font-weight: 700;
}
.quiz-optionen button:disabled { cursor: default; opacity: .55; }
.quiz-optionen button.richtig { opacity: 1; border-color: var(--gruen); background: var(--gruen-hell); }
.quiz-optionen button.richtig .buchstabe { background: var(--gruen); color: var(--papier); }
.quiz-optionen button.falsch { opacity: 1; border-color: var(--rot); background: var(--rot-hell); }
.quiz-optionen button.falsch .buchstabe { background: var(--rot); color: var(--papier); }
.rueckmeldung { background: var(--flaeche); border-left: 4px solid var(--gruen); padding: 14px 18px 18px; margin-bottom: 8px; }
.rueckmeldung.fast { border-left-color: var(--marker); }
.rueck-titel { margin: 0 0 4px; font-size: 1.25rem; font-weight: 700; }
.rueckmeldung p:not(.rueck-titel) { margin: 0 0 16px; }

/* ---------- Ergebnis mit Stempel ---------- */

.stempel {
  width: max-content; margin: 8px auto 20px; padding: 10px 22px;
  border: 4px solid var(--rot); border-radius: 10px; color: var(--rot);
  font-size: 1.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  transform: rotate(-8deg); animation: stempeln .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
.stempel.offen { border-color: var(--tinte); color: var(--tinte); }
@keyframes stempeln { from { transform: rotate(-8deg) scale(2.2); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
#s-ergebnis h1, #s-ergebnis > .hinweis { text-align: center; }
.naechstes { text-align: center; color: var(--graphit-leise); margin: 0 0 24px; }

/* ---------- Status-Kärtchen in „Meine Hörspiele“ ---------- */

.hoerspiele .chip {
  display: inline-block; margin-top: 8px; padding: 2px 10px; border-radius: 999px;
  font-size: 0.875rem; font-weight: 700; background: var(--tinte-hell); color: var(--tinte);
}
.hoerspiele .chip.offen { background: var(--marker); color: var(--marker-text); }
.hoerspiele .chip.faellig { background: var(--rot-hell); color: var(--rot); }
.hoerspiele .chip.geloest { background: var(--gruen-hell); color: var(--gruen); }

/* ---------- Vorlesen ---------- */

.mit-vorlesen { display: flex; align-items: flex-start; gap: 12px; }
.mit-vorlesen > :first-child { flex: 1; }
.vorlesen {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; margin-top: 2px;
  border: 2px solid var(--tinte); border-radius: 50%; background: var(--flaeche); color: var(--tinte); cursor: pointer;
}
.vorlesen svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.vorlesen.spricht { background: var(--tinte); color: var(--papier); animation: puls 1.4s ease-in-out infinite; }
.vorlesen-aus .vorlesen { display: none; }
#s-frage .mit-vorlesen .satz { margin-bottom: 24px; }

/* ---------- Einstiegsfragen ---------- */

.einstieg-figur { display: grid; place-items: center; min-height: 0; }
.einstieg-figur svg { width: 150px; height: 80px; }
.einstieg-figur .emoji { font-size: 64px; }
.karten-wahl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 20px; }
.karten-wahl.einspaltig { grid-template-columns: 1fr; }
.karten-wahl button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 112px; padding: 12px 10px; text-align: center;
  font: inherit; font-size: 1.125rem; font-weight: 700; color: var(--graphit);
  background: var(--flaeche); border: 2px solid var(--tinte-hell); border-radius: 18px; cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease;
}
.karten-wahl.einspaltig button { flex-direction: row; justify-content: flex-start; min-height: 72px; text-align: left; font-size: 1.25rem; }
.karten-wahl .bild { font-size: 2.5rem; line-height: 1; }
.karten-wahl small { font-size: 0.875rem; font-weight: 400; color: var(--graphit-leise); }
.karten-wahl button[aria-pressed="true"] { border-color: var(--tinte); background: var(--tinte-hell); transform: scale(0.98); }
.karten-wahl button:active { transform: scale(0.96); }
.zusammenfassung { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; }
.zusammenfassung li { display: flex; align-items: center; gap: 12px; background: var(--flaeche); padding: 10px 14px; border-left: 4px solid var(--tinte); font-size: 1.125rem; }
.zusammenfassung .bild { font-size: 1.75rem; }

.schauplatz-chip {
  display: inline-flex; align-items: center; gap: 8px; margin: -8px 0 20px; padding: 6px 14px;
  font: inherit; font-size: 1rem; color: var(--graphit); background: var(--flaeche);
  border: 2px solid var(--tinte-hell); border-radius: 999px; cursor: pointer;
}
.schauplatz-chip b { color: var(--tinte); }

/* ---------- Code ---------- */

.code-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.code-form input {
  width: 100%; min-height: 56px; margin-bottom: 16px; padding: 0 16px;
  font: inherit; color: var(--graphit); background: var(--flaeche);
  border: 2px solid var(--graphit); border-radius: 8px;
}

/* ---------- Debug-Fenster (immer dunkel, wie ein Terminal) ---------- */

body.mit-debug { padding-bottom: 46vh; }
.debug {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-direction: column; max-height: 45vh;
  background: #0D1117; color: #C9D1D9;
  border-top: 2px solid #30363D;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
.debug-kopf { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #30363D; font-size: 0.8125rem; }
.debug-kopf strong { color: #7EE787; }
.debug-zahl { flex: 1; color: #8B949E; }
.debug-kopf button {
  font: inherit; font-size: 0.8125rem; color: #C9D1D9; background: #21262D;
  border: 1px solid #30363D; border-radius: 6px; padding: 4px 10px; cursor: pointer;
}
.debug-log {
  margin: 0; padding: 8px 10px; overflow: auto; flex: 1;
  font: inherit; font-size: 0.75rem; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.debug.zu .debug-log { display: none; }
body.mit-debug:has(.debug.zu) { padding-bottom: 48px; }
.d-info { color: #9AA4B2; }
.d-ok { color: #7EE787; }
.d-warnung { color: #E3B341; }
.d-fehler { color: #FF7B72; }

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