/* Mias Lernseite – Buntpapier-Look der Erklärvideos. Farben hier ändern = ganze Seite ändert sich. */
:root {
  --tinte: #2b2a3a;
  --tinte-leise: #5e5a6e;
  --papier: #fffdf5;
  --sand: #ffe9cc;
  --sand-dunkel: #ffd9a8;
  --blau: #2f6fd0;
  --rot: #e8503a;
  --gelb: #ffd23f;
  --gruen: #2e9a59;
  --lila: #8a6fd8;
  --akzent: var(--blau);
  --schatten: 0 6px 0 rgba(43, 42, 58, 0.14);
  --rund: 22px;
  --schrift: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}
.farbe-rot { --akzent: var(--rot); }
.farbe-blau { --akzent: var(--blau); }
.farbe-gelb { --akzent: #d99a00; }
.farbe-gruen { --akzent: var(--gruen); }
.farbe-lila { --akzent: var(--lila); }

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  min-height: 100dvh; display: flex; flex-direction: column;
  font: 500 18px/1.5 var(--schrift); color: var(--tinte);
  background: var(--sand) linear-gradient(var(--sand-dunkel), var(--sand) 340px) no-repeat;
  -webkit-tap-highlight-color: transparent;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2 { line-height: 1.15; text-wrap: balance; }
h1:focus { outline: none; }
:focus-visible { outline: 4px solid var(--blau); outline-offset: 3px; border-radius: 12px; }

/* Rahmen */
#wimpel { height: 46px; overflow: hidden; padding-top: env(safe-area-inset-top); box-sizing: content-box; }
#wimpel svg { width: 100%; height: 46px; }
.kopfzeile, main, .fuss {
  width: 100%; max-width: 1120px; margin-inline: auto;
  padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right));
}
.kopfzeile { padding-block: 4px 6px; }
.marke { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; min-height: 48px; }
main { flex: 1; padding-bottom: 40px; }
.fuss { padding-block: 18px calc(18px + env(safe-area-inset-bottom)); font-size: 0.85rem; color: var(--tinte-leise); text-align: center; }
.im-quiz .kopfzeile, .im-quiz .fuss, .im-quiz #wimpel svg { display: none; }
.laedt { padding: 60px 0; text-align: center; color: var(--tinte-leise); }

.karte { background: var(--papier); border-radius: var(--rund); box-shadow: var(--schatten); }
.etikett { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--akzent); }
.leise { color: var(--tinte-leise); font-size: 0.95rem; }

/* Knöpfe */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px 26px;
  border: 0; border-radius: 18px; background: var(--akzent); color: #fff; font-weight: 900; font-size: 1.1rem;
  box-shadow: 0 5px 0 rgba(43, 42, 58, 0.28); transition: transform 0.08s, box-shadow 0.08s;
}
.knopf:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(43, 42, 58, 0.28); }
.knopf.gross { width: 100%; min-height: 60px; font-size: 1.2rem; }
.knopf.hell { background: var(--papier); color: var(--tinte); }
.knopf:disabled { opacity: 0.45; }
.rund {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%;
  background: var(--papier); box-shadow: 0 4px 0 rgba(43, 42, 58, 0.14);
}
.rund svg { width: 24px; height: 24px; fill: var(--tinte); }

/* Sterne */
.sterne { display: inline-flex; gap: 2px; flex: none; }
.stern svg { width: 24px; height: 24px; fill: #e4dccb; }
.stern.voll svg { fill: var(--gelb); stroke: #c79a00; stroke-width: 1.2; stroke-linejoin: round; }
.sterne.riesig { gap: 8px; }
.sterne.riesig .stern svg { width: 68px; height: 68px; }
.sterne.riesig .stern.voll { animation: plopp 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) backwards; }
.sterne.riesig .stern:nth-child(2) { animation-delay: 0.18s; transform: translateY(-10px); }
.sterne.riesig .stern:nth-child(3) { animation-delay: 0.36s; }
@keyframes plopp { from { transform: scale(0) rotate(-40deg); } }

/* ---------- Startseite ---------- */
.held { padding: 14px 0 22px; }
.held h1 { font-size: clamp(2.2rem, 8vw, 3.4rem); font-weight: 900; letter-spacing: -0.01em; }
.held p { font-size: 1.15rem; color: var(--tinte-leise); margin-top: 6px; }

.filter { display: grid; gap: 10px; margin-bottom: 22px; }
.chips { display: flex; gap: 10px; overflow-x: auto; margin-inline: -18px; padding: 2px 18px 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; min-height: 46px; padding: 8px 20px; border: 0; border-radius: 999px; background: var(--papier);
  font-weight: 800; box-shadow: 0 4px 0 rgba(43, 42, 58, 0.14);
}
.chip[aria-pressed="true"] { background: var(--tinte); color: #fff; }

.themen { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.themenkarte { display: flex; flex-direction: column; overflow: hidden; transition: transform 0.12s; }
.themenkarte:active { transform: scale(0.98); }
.bildrahmen { position: relative; aspect-ratio: 16 / 9; background: var(--sand-dunkel); border-bottom: 6px solid var(--akzent); }
.bildrahmen img { width: 100%; height: 100%; object-fit: cover; }
.ohne-bild { position: absolute; inset: 0; display: grid; place-items: center; font-size: 5rem; font-weight: 900; color: var(--akzent); }
.abspielen {
  position: absolute; right: 14px; bottom: 14px; display: grid; place-items: center; width: 52px; height: 52px;
  border-radius: 50%; background: var(--papier); box-shadow: 0 4px 0 rgba(43, 42, 58, 0.2);
}
.abspielen svg { width: 26px; height: 26px; fill: var(--akzent); margin-left: 3px; }
.karten-text { padding: 16px 20px 20px; display: grid; gap: 4px; }
.karten-text h2 { font-size: 1.7rem; font-weight: 900; }
.unter { color: var(--tinte-leise); }
.hat { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.95rem; font-weight: 700; }
.hat li { display: inline-flex; align-items: center; gap: 6px; }
.hat svg { width: 18px; height: 18px; fill: var(--akzent); }
.sternstand { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 0.95rem; font-weight: 700; color: var(--tinte-leise); }
.sternstand .stern svg { width: 20px; height: 20px; }
.leer, .hinweis { padding: 28px; text-align: center; }
.hinweis { display: grid; gap: 14px; justify-items: center; margin-top: 30px; }

/* ---------- Themenseite ---------- */
.zurueck { display: inline-flex; align-items: center; gap: 4px; min-height: 48px; padding-right: 12px; font-weight: 800; margin-left: -6px; }
.zurueck svg { width: 26px; height: 26px; fill: currentColor; }
.thema-kopf { padding: 6px 0 20px; display: grid; gap: 6px; }
.thema-kopf h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); font-weight: 900; }
.thema-kopf h1 span { display: block; font-size: 0.5em; font-weight: 800; color: var(--tinte-leise); margin-top: 4px; }
.beschreibung { max-width: 62ch; font-size: 1.08rem; }
.thema-raster { display: grid; gap: 26px; }
.haupt, .seite { display: grid; gap: 26px; align-content: start; min-width: 0; }
.videorahmen { overflow: hidden; border: 6px solid var(--papier); background: #000; }
.videorahmen video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; }
.block h2 { font-size: 1.35rem; font-weight: 900; margin-bottom: 12px; }
.block.karte { padding: 20px 22px; }
.ziele { list-style: none; padding: 0; display: grid; gap: 10px; }
.ziele li { position: relative; padding-left: 32px; }
.ziele li::before {
  content: ""; position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--gruen) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.500 10.500l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.500' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.quizliste, .dokliste { display: grid; gap: 12px; }
.quizkarte, .dokument { display: flex; align-items: center; gap: 14px; padding: 14px 16px; min-height: 76px; transition: transform 0.1s; }
.quizkarte:active, .dokument:active { transform: scale(0.98); }
.symbolkreis { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: var(--akzent); }
.symbolkreis svg { width: 28px; height: 28px; fill: #fff; }
.dokument .symbolkreis { background: var(--tinte); }
.quiz-text { flex: 1; min-width: 0; display: grid; }
.quiz-text strong { font-weight: 900; font-size: 1.1rem; }
.quiz-text span { font-size: 0.9rem; color: var(--tinte-leise); }
.ladepfeil svg { width: 26px; height: 26px; fill: var(--tinte-leise); }

/* ---------- Lösungsbereich ---------- */
.fuss a { text-decoration: underline; display: inline-block; padding: 10px 6px; }
.ladepfeil.vor svg { transform: rotate(180deg); }
.loesungen { display: grid; gap: 22px; }
.loesungen.schmal { max-width: 460px; margin-inline: auto; width: 100%; }
.loesungen h2 small { font-size: 0.8rem; font-weight: 700; color: var(--tinte-leise); white-space: nowrap; }
.loesungen > .knopf { justify-self: start; }
.loesungen > .knopf svg { width: 22px; height: 22px; fill: currentColor; }
.tor { padding: 30px 22px; display: grid; gap: 14px; justify-items: center; text-align: center; }
.tor h1 { font-size: 1.9rem; font-weight: 900; }
.symbolkreis.gross { width: 68px; height: 68px; border-radius: 22px; background: var(--tinte); }
.symbolkreis.gross svg { width: 38px; height: 38px; }
.tor input {
  width: 100%; min-height: 60px; padding: 8px 16px; text-align: center; font-size: 1.3rem; font-weight: 800;
  border: 3px solid var(--tinte); border-radius: 18px; background: #fff; -webkit-appearance: none; appearance: none;
}
.tor input:focus { outline: 4px solid var(--gelb); outline-offset: 2px; }
.tor-meldung { min-height: 1.5em; font-weight: 800; color: var(--rot); }
.tor-meldung:empty { display: none; }

/* ---------- Quiz ---------- */
.quiz { max-width: 640px; margin-inline: auto; display: grid; gap: 18px; padding-top: 4px; }
.quiz-kopf { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 2; padding: 8px 0; background: var(--sand-dunkel); box-shadow: 0 0 0 18px var(--sand-dunkel); clip-path: inset(0 -18px); }
.fortschritt { flex: 1; height: 16px; border-radius: 999px; background: var(--papier); overflow: hidden; }
.fortschritt i { display: block; height: 100%; border-radius: 999px; background: var(--gruen); transition: width 0.4s; }
.zaehler { font-weight: 900; font-variant-numeric: tabular-nums; }
.frage { padding: 24px 22px; display: grid; gap: 18px; justify-items: center; text-align: center; }
.frage h1 { font-size: clamp(1.4rem, 5.6vw, 1.9rem); font-weight: 900; line-height: 1.5; }
.aufgabenbild { width: 100%; display: grid; justify-items: center; }
.aufgabenbild svg { width: 100%; max-width: 230px; height: auto; }
.bild-tafel svg { max-width: 360px; }
.bild-uhr svg { max-width: 260px; font-family: var(--schrift); }

.bruch { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; font-weight: 900; margin: 0 0.15em; font-size: 0.92em; }
.bruch span:first-child { color: var(--rot); padding: 0 0.3em 0.06em; border-bottom: 0.14em solid var(--tinte); }
.bruch span:last-child { color: var(--blau); padding-top: 0.06em; }

.antworten { display: grid; gap: 12px; }
.antwort {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; padding: 10px 16px; text-align: left;
  border: 3px solid transparent; border-radius: 20px; background: var(--papier); box-shadow: var(--schatten);
  font-weight: 800; font-size: 1.2rem; transition: transform 0.08s;
}
.antwort:not(:disabled):active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(43, 42, 58, 0.14); }
.buchstabe { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--sand); font-weight: 900; }
.antwort:disabled { color: var(--tinte); opacity: 0.6; }
.antwort.richtig { opacity: 1; border-color: var(--gruen); background: #e6f6ec; }
.antwort.richtig .buchstabe { background: var(--gruen); color: #fff; }
.antwort.falsch { opacity: 1; border-color: var(--rot); background: #fdeae6; animation: wackeln 0.35s; }
.antwort.falsch .buchstabe { background: var(--rot); color: #fff; }
@keyframes wackeln { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

.eingabe { display: grid; gap: 16px; justify-items: center; }
.eingabe .knopf { width: 100%; }
.eingabe input {
  width: 100%; min-height: 64px; padding: 8px 14px; text-align: center; font-size: 1.7rem; font-weight: 900;
  border: 3px solid var(--tinte); border-radius: 18px; background: var(--papier); -webkit-appearance: none; appearance: none;
}
.eingabe input:focus { outline: 4px solid var(--gelb); outline-offset: 2px; }
.eingabe input:disabled { opacity: 1; -webkit-text-fill-color: var(--tinte); }
.textfeld { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 340px; font-weight: 900; font-size: 1.3rem; }
.brucheingabe { display: grid; gap: 10px; width: 130px; }
.brucheingabe i { height: 6px; border-radius: 3px; background: var(--tinte); margin-inline: -10px; }
.brucheingabe input[name="z"] { color: var(--rot); -webkit-text-fill-color: var(--rot); }
.brucheingabe input[name="n"] { color: var(--blau); -webkit-text-fill-color: var(--blau); }
.eingabe.richtig input { border-color: var(--gruen); background: #e6f6ec; }
.eingabe.falsch input { border-color: var(--rot); background: #fdeae6; }
.eingabe.richtig .knopf, .eingabe.falsch .knopf { display: none; }

.rueckmeldung { display: grid; gap: 16px; }
.rueckmeldung:empty { display: none; }
.urteil { padding: 18px 20px; display: grid; gap: 6px; border-left: 10px solid var(--gruen); animation: herein 0.25s ease-out; }
.urteil.schlecht { border-left-color: var(--rot); }
.urteil-titel { font-size: 1.35rem; font-weight: 900; color: var(--gruen); }
.urteil.schlecht .urteil-titel { color: var(--rot); }
@keyframes herein { from { opacity: 0; transform: translateY(10px); } }

.ergebnis { padding-top: 30px; }
.ergebnis .karte { padding: 34px 22px; display: grid; gap: 12px; justify-items: center; text-align: center; }
.ergebnis h1 { font-size: 2rem; font-weight: 900; }

/* ---------- iPad und größer ---------- */
@media (min-width: 700px) {
  body { font-size: 19px; }
  .kopfzeile, main, .fuss { padding-inline: max(32px, env(safe-area-inset-left)) max(32px, env(safe-area-inset-right)); }
  .chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }
  .filter { grid-auto-flow: column; justify-content: space-between; }
  .quiz { padding-top: 24px; }
  .antworten { gap: 14px; }
}
@media (min-width: 960px) {
  .thema-raster { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
