/* Oberfläche der AR-Seite (Spez. §1, §3). Große Knöpfe, rooomBooks-Farben (Petrol/Türkis, Anthrazit).
   Keine fremden Schriften (Spez. §10): runde Systemschrift, sonst serifenlos. */
:root {
  --petrol: #0c7a92;
  --akzent: #0c7a92;   /* Text und Rahmen in Petrol auf dem Seitengrund; im dunklen Schema Türkis (Kontrast, Prüfung P4) */
  --tuerkis: #1fb5c9;
  --eisblau: #dceff8;
  --anthrazit: #2b3236;
  --grund: #f6fbfd;
  --text: #2b3236;
  --text-leise: #5a6a72;
  --karte: #ffffff;
  --rot: #c8323f;
  --gelb: #ffd166;
  --radius: 18px;
  --schrift: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --grund: #132227; --text: #e9f3f6; --text-leise: #a8bcc3; --karte: #1c3037; --eisblau: #24414a; --akzent: #1fb5c9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --grund: #132227; --text: #e9f3f6; --text-leise: #a8bcc3; --karte: #1c3037; --eisblau: #24414a; --akzent: #1fb5c9;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--grund); color: var(--text);
  font-family: var(--schrift); font-size: 18px; line-height: 1.45;
  -webkit-text-size-adjust: 100%; overscroll-behavior: none;
}
[hidden] { display: none !important; }

/* ── Ansichten: genau eine sichtbar (body[data-zustand]) ── */
.ansicht { min-height: 100%; padding: 24px 16px 32px; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.ansicht.mitte { justify-content: center; }
h1 { font-size: 1.65rem; line-height: 1.2; margin: 8px 0 0; color: var(--akzent); }
h1 .zusatz { display: block; font-size: 1.05rem; color: var(--text-leise); font-weight: 600; margin-top: 4px; }
h2 { font-size: 1.25rem; margin: 0; }
p { margin: 0; }
.leise { color: var(--text-leise); font-size: 0.95rem; }

.schritte { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.schritte li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; background: var(--karte); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.schritte .nr { width: 44px; height: 44px; border-radius: 50%; background: var(--tuerkis); color: #fff; font-weight: 800; font-size: 1.3rem; display: grid; place-items: center; }

.knopf {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800;
  min-height: 64px; padding: 14px 22px; border-radius: 999px; width: 100%;
  background: var(--petrol); color: #fff; font-size: 1.3rem; box-shadow: 0 4px 0 #075567;
  touch-action: manipulation;
}
.knopf:active { transform: translateY(2px); box-shadow: 0 2px 0 #075567; }
.knopf.zweit { background: var(--karte); color: var(--akzent); box-shadow: inset 0 0 0 2px var(--akzent); min-height: 52px; font-size: 1.05rem; }
.knopf.klein { min-height: 48px; font-size: 1rem; width: auto; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; }
.reihe > .knopf { flex: 1 1 160px; }
.hinweis { background: #fff4d6; color: #5a4300; border-radius: var(--radius); padding: 12px 14px; font-size: 0.95rem; display: grid; gap: 10px; }
.hinweis .knopf.zweit { justify-self: start; }
.adresse { font-weight: 800; word-break: break-all; background: var(--karte); padding: 10px 12px; border-radius: 12px; }
details.eltern { background: var(--karte); border-radius: var(--radius); padding: 12px 14px; }
/* Tippziele ≥ 44 px (Prüfung Technik 05.11.: „Für Eltern“ war 32 px, Impressum/Datenschutz 21 px hoch) */
details.eltern summary { cursor: pointer; font-weight: 700; min-height: 44px; padding: 9px 0; }
details.eltern p { margin-top: 8px; font-size: 0.95rem; }
a { color: var(--akzent); }
.fuss { display: flex; gap: 16px; justify-content: center; font-size: 0.9rem; }
.fuss a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }

/* ── Tropfen (Ladeanzeige, Logo) ── */
.tropfen { width: 1em; height: 1em; display: inline-block; background: linear-gradient(135deg, #dceff8, #1e88ae); border-radius: 0 50% 50% 50%; transform: rotate(45deg); }
.ladetropfen { font-size: 64px; animation: wippen 1.1s ease-in-out infinite; margin: 0 auto; }
@keyframes wippen { 0%,100% { transform: rotate(45deg) translate(0,0) scale(1); } 50% { transform: rotate(45deg) translate(-8px,-8px) scale(.92,1.06); } }
.fortschritt { display: flex; gap: 10px; justify-content: center; font-size: 26px; }
.fortschritt .tropfen { opacity: .25; transition: opacity .3s; }
.fortschritt .tropfen.voll { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .ladetropfen { animation: none; } }

/* ── AR-Ansicht ── */
body[data-zustand="AR"] { overflow: hidden; background: #000; }
#ar { position: fixed; inset: 0; overflow: hidden; background: #000; }
#ar .ar-video { position: absolute; z-index: 0; object-fit: cover; }
#ar .ar-zeichenflaeche { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; touch-action: manipulation; }
.ueber { position: absolute; z-index: 2; left: 0; right: 0; padding: 0 16px; pointer-events: none; }
.ueber > * { pointer-events: auto; }
.ueber.unten { bottom: max(18px, env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.ueber.oben { top: max(12px, env(safe-area-inset-top)); display: flex; justify-content: flex-end; gap: 10px; }
.ueber.oben.zwischen { justify-content: space-between; }
.blase { background: rgba(255,255,255,.92); color: var(--anthrazit); border-radius: var(--radius); padding: 12px 16px; font-weight: 700; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.rund:focus-visible, .knopf:focus-visible, .kapitelliste button:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; }
.rund { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); color: var(--petrol); font: inherit; font-size: 22px; font-weight: 800; cursor: pointer; display: grid; place-items: center; }
.ladeschirm { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; gap: 22px; background: var(--grund); color: var(--text); text-align: center; padding: 16px; }

/* ── Kapitelwahl (nur Ohne-Kamera) — Zurück-Knopf fest oben, nicht unter der langen Liste (Hans 06.11.2026) ── */
#KAPITEL .kopfzeile { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; padding: 8px 0; background: var(--grund, #fff); }
#KAPITEL .kopfzeile h2 { margin: 0; }
.kapitelliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kapitelliste button { width: 100%; min-height: 56px; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; text-align: left; border: 0; border-radius: 14px; background: var(--karte); color: var(--text); font: inherit; padding: 8px 14px; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.kapitelliste .seite { color: var(--text-leise); font-variant-numeric: tabular-nums; }
.kapitelliste .tropfen { font-size: 20px; margin-left: 6px; }
.kapitelliste button.zusatz { background: var(--eisblau); }
#kapitel-titel:focus { outline: none; }

/* ── Ohne Kamera ── */
#ohnekamera-buehne { position: fixed; inset: 0; background: linear-gradient(#f4fafc, #dfeef4); }
#ohnekamera-buehne canvas { display: block; width: 100%; height: 100%; touch-action: none; }
body[data-zustand="OHNE"] { overflow: hidden; }
#OHNE .blase { font-size: 1rem; }
#OHNE .leise-blase { font-weight: 600; font-size: .88rem; color: #5a6a72; background: rgba(255,255,255,.8); padding: 8px 12px; }
/* die Blasen und Knöpfe über der hellen Bühne bleiben hell — auch im dunklen Schema (Prüfung P4: Text war hell auf Weiß) */
#OHNE .reihe > .knopf { flex: 1 1 120px; background: rgba(255,255,255,.95); color: var(--petrol); box-shadow: inset 0 0 0 2px var(--petrol); }
#OHNE .knopf:disabled { opacity: .45; cursor: default; }

/* ── Messanzeige (?mess=1) ── */
.messanzeige { position: fixed; z-index: 10; left: 8px; top: max(8px, env(safe-area-inset-top)); max-width: calc(100% - 80px); background: rgba(0,0,0,.72); color: #e8fff4; font: 12px/1.35 ui-monospace, Consolas, monospace; padding: 8px 10px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; overflow: hidden; }
@media (max-width: 420px) { .messanzeige { font-size: 10.5px; max-width: calc(100% - 72px); } }
.messanzeige .rot { color: #ff8a8a; font-weight: 700; }
.messanzeige button { margin-top: 6px; font: inherit; background: #e8fff4; color: #000; border: 0; border-radius: 6px; padding: 4px 8px; }

/* ── Impressum, Datenschutz ── */
.recht { gap: 12px; }
.recht h2 { font-size: 1.1rem; margin-top: 10px; color: var(--akzent); }
.recht p, .recht li { font-size: 0.98rem; }
.recht ul { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.recht code { font-size: 0.9em; background: var(--eisblau); padding: 0 4px; border-radius: 4px; word-break: break-all; }
.offen { background: #fff4d6; color: #5a4300; border-radius: 6px; padding: 0 4px; font-size: 0.92em; }
