/* Gemeinsamer Stil der Schueler- und Lehrer-Oberflaeche (gruener Hintergrund, Karten, Caveat-Ueberschriften, Wellen-Kopf).
   Schriften liegen lokal unter /fonts (SIL Open Font License), es werden keine Daten an Dritte gesendet. */
@font-face { font-family: Nunito; src: url(/fonts/nunito-latin.woff2) format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }
@font-face { font-family: Caveat; src: url(/fonts/caveat-700-latin.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg: light-dark(#b5c8b0, #1b281f);
  --panel: light-dark(#fffdf6, #24352a);
  --ink: light-dark(#1c2a21, #edf3e9);
  --soft: light-dark(#5b6b60, #a9b9ad);
  --line: light-dark(#d9dccf, #3a4f41);
  --leaf: light-dark(#e5eedf, #2d4334);
  --pink: #e8839f;
  --blue: #3b78c4;
  --yellow: #f2c94c;
  --ok: light-dark(#22804a, #6fd197);
  --okbg: light-dark(#e3f4e8, #1f3f2b);
  --bad: light-dark(#b8432c, #ff9a83);
  --badbg: light-dark(#fbe7e1, #4a2a22);
  --warn: light-dark(#8a5a00, #f2c94c);
}
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.55 Nunito, system-ui, sans-serif; overflow-x: clip; }

/* ---------- Kopf mit Welle ---------- */
.hero { position: relative; padding: 28px max(5vw, 16px) 70px; overflow: hidden; }
.hero h1 { font: 700 clamp(38px, 7vw, 54px)/1.05 Caveat, cursive; color: #fff; margin: 0; text-wrap: balance; text-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.hero p { margin: 6px 0 0; color: #fff; font-weight: 600; text-shadow: 0 1px 0 rgba(0, 0, 0, .15); }
.hero svg { position: absolute; left: 0; bottom: 0; width: 100%; height: 60px; }
main { max-width: 52rem; margin: -34px auto 40px; padding: 0 14px; position: relative; }

/* ---------- Karten, Texte, Formulare ---------- */
.card { background: var(--panel); border-radius: 22px; padding: clamp(18px, 4vw, 32px); margin: 0 0 1rem; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.card > :first-child { margin-top: 0; }
.card .card { box-shadow: none; background: var(--leaf); border-radius: 16px; padding: 14px 16px; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.3rem; line-height: 1.2; } h3 { font-size: 1.1rem; }
label { display: block; margin-top: 0.8rem; font-weight: 700; }
input, select, textarea { width: 100%; font: inherit; padding: 0.55rem 0.8rem; border: 2px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); }
input[type=checkbox], input[type=radio] { width: auto; }
button { font: inherit; font-weight: 800; font-size: 17px; min-height: 46px; margin-top: 1rem; padding: 8px 22px; border-radius: 14px; border: 0; background: var(--blue); color: #fff; cursor: pointer; }
button.secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[role=alert] { color: var(--bad); font-weight: 700; min-height: 1.5rem; }
.note { color: var(--soft); font-size: 0.9rem; margin: 0.3rem 0 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.85rem; color: var(--soft); }
svg text { fill: var(--ink); }
a { color: var(--blue); font-weight: 700; }

/* ---------- Diagramme ---------- */
.bar { background: var(--leaf); border-radius: 9px; height: 0.9rem; margin: 0.2rem 0 0.8rem; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--blue); border-radius: 9px; }
.bar > span.provisional { background: repeating-linear-gradient(45deg, #7aa7d6, #7aa7d6 6px, #a9c6e4 6px, #a9c6e4 12px); }
.hint { padding: 0.6rem 0.9rem; border-left: 5px solid var(--soft); margin: 0.6rem 0; background: var(--leaf); border-radius: 0 12px 12px 0; }
.hint.FOERDERN { border-color: #cf222e; } .hint.FESTIGEN { border-color: var(--yellow); } .hint.FORDERN { border-color: #1a7f37; }

/* ---------- Schueler: Warteraum, Test, Ergebnis ---------- */
.waiting { text-align: center; padding: 2rem 1rem; }
.pulse { font-size: 1.6rem; color: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.testwrap { padding: 0; overflow: hidden; }
.timerbar { display: flex; gap: .6rem; align-items: baseline; justify-content: space-between; padding: .5rem 1.1rem; background: var(--leaf); font-weight: 700; color: var(--soft); }
.timerbar strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.timerbar strong.warn { color: var(--warn); }
.timerbar strong.danger { color: var(--bad); }
.frame-wrap { position: relative; }
#frame-host iframe { display: block; width: 100%; height: calc(100dvh - 11rem); min-height: 26rem; border: 0; background: var(--panel); }
#timeup { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: color-mix(in srgb, var(--panel) 92%, transparent); font-size: 1.3rem; text-align: center; }
.grade { font-size: clamp(34px, 7vw, 52px); font-weight: 800; line-height: 1.1; color: var(--blue); margin: 0 0 .3rem; }
.material summary { cursor: pointer; font-weight: 700; padding: 0.3rem 0; }
.material-text { white-space: pre-wrap; font-family: inherit; background: var(--leaf); padding: 0.8rem; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
