/* =========================================================
   Gemeinsamer Rahmen für die Präsentationen (Teilbarkeit durch 2, 3)
   Grundtöne wie auf der Übersichtsseite (RLP-Schulcampus +
   Superlehrer-Logo), Datenfarben aus der Okabe-Ito-Palette.
   ========================================================= */
@font-face {
  font-family: "Open Sans";
  src: url("fonts/open-sans-latin-wght.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #2F3A48;
  --muted: #5C646F;
  --line: #E3E3E5;
  --rand: #8C939C;          /* Ränder von Bedienelementen, ≥ 3:1 auf Weiß */
  --himmel: #E4F4FD;
  --strahl: #CFEAFB;
  --sonne: #F9B815;
  --link: #0570AD;

  /* Datenfarben – jede Farbe hat auf allen Folien dieselbe Bedeutung */
  --g1: #0072b2;            /* Gruppe A (blau) */
  --g1-hell: #E6F1F8;
  --g2: #f0e442;            /* Gruppe B (gelb) */
  --g2-rand: #857c00;
  --rest: #c45200;          /* „übrig“ – orange */
  --rest-hell: #FCEBDD;
  --ja: #12753a;            /* „teilbar“ – grün, immer mit Haken */
  --ja-hell: #E3F3E8;
  --nein: #c8102e;          /* „nicht teilbar“ – rot, immer mit Kreuz */
  --nein-hell: #FBE6E9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Open Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-text-size-adjust: 100%;
}
::selection { background: var(--strahl); color: var(--ink); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }

.praes {
  max-width: 1280px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}

/* ---------- Kopf: ruhiges Himmelband, ohne Logo ---------- */
.kopf {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 12px 8px 18px;
  border-radius: 12px;
  background: var(--himmel);
}
.kopf h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: clamp(1.15rem, .9rem + 1vw, 1.75rem);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
}
.kopf h1::after {
  content: "";
  display: block;
  width: 3rem;
  height: 4px;
  border-radius: 4px;
  background: var(--sonne);
  margin-top: .3rem;
}
.kopf-rechts { display: flex; align-items: center; gap: 8px; flex: none; }
.zaehler { color: var(--muted); font-size: .9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.ton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 10px;
  border: 1px solid var(--rand);
  background: #fff;
  font-size: .95rem;
  cursor: pointer;
  transition: background-color .15s, box-shadow .2s;
}
.ton svg { width: 20px; height: 20px; flex: none; }
.ton[aria-pressed="false"] { color: var(--muted); }
.ton[aria-pressed="false"] .an, .ton[aria-pressed="true"] .aus { display: none; }
@media (hover: hover) { .ton:hover { background: var(--himmel); } }
/* Browser hat den Ton blockiert: Knopf deutlich anbieten */
.ton.hinweis {
  background: var(--sonne);
  border-color: var(--ink);
  box-shadow: 0 2px 10px rgba(47, 58, 72, .25);
  animation: anstupsen 1.6s ease-in-out infinite;
}
@keyframes anstupsen { 50% { transform: scale(1.06); } }

/* ---------- Bühne ---------- */
.buehne {
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vh, 24px);
  padding: 4px 0;
}
.text {
  font-size: clamp(1.15rem, 1rem + .7vw, 1.6rem);
  line-height: 1.45;
  text-align: center;
  max-width: 34ch;
  min-height: 2.9em;
  text-wrap: pretty;
}
.text b, .urteil b { font-weight: 750; }
.gross { font-size: clamp(3.5rem, 2rem + 6vw, 6rem); font-weight: 700; letter-spacing: .02em; line-height: 1; font-variant-numeric: tabular-nums; }
.rechnung { font-size: clamp(1.3rem, 1rem + 1vw, 2rem); font-variant-numeric: tabular-nums; text-align: center; line-height: 1.5; }
.ziffer { font-weight: 800; }
/* Rechnung mit Erklärung direkt darunter */
.beispiel { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.erkl {
  font-size: clamp(1.05rem, .95rem + .5vw, 1.4rem);
  line-height: 1.4;
  text-align: center;
  max-width: 40ch;
  color: var(--muted);
  text-wrap: pretty;
}
.erkl b { color: var(--ink); }

/* teilbar / nicht teilbar: Farbe UND Zeichen */
.ja, .nein { font-weight: 750; }
.ja { color: var(--ja); }
.nein { color: var(--nein); }
.icon { display: inline-block; width: 1em; height: 1em; vertical-align: -.14em; margin-right: .2em; }
.urteil {
  font-size: clamp(1.1rem, 1rem + .5vw, 1.45rem);
  font-weight: 700;
  min-height: 1.6em;
  text-align: center;
  line-height: 1.4;
}

/* Zweispaltig auf breiten Bildschirmen (Beamer): Text links, Bild rechts */
.buehne.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: center; }
.seite { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 34rem; }
@media (min-aspect-ratio: 5/4) and (min-width: 820px) {
  .buehne.zweispaltig {
    grid-template-columns: minmax(16rem, 30rem) auto;
    column-gap: clamp(28px, 4vw, 64px);
    justify-content: center;
    align-items: center;
  }
  .zweispaltig .seite { align-items: flex-start; }
  .zweispaltig .text, .zweispaltig .urteil { text-align: left; }
}

.merk {
  border: 3px solid var(--g1);
  border-radius: 14px;
  padding: 20px 28px;
  font-size: clamp(1.25rem, 1rem + 1vw, 1.9rem);
  line-height: 1.45;
  max-width: 32ch;
  text-align: center;
  background: var(--g1-hell);
  text-wrap: balance;
}

.einblenden { opacity: 0; transform: translateY(8px); transition: opacity .5s cubic-bezier(.2, .7, .3, 1), transform .5s cubic-bezier(.2, .7, .3, 1); }
.einblenden.da { opacity: 1; transform: none; }

/* Auswahlknöpfe (Vorhersage, Quiz) */
.wahl { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.wahl button {
  min-height: 52px;
  padding: 10px 22px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: #fff;
  font-size: clamp(1.05rem, 1rem + .3vw, 1.3rem);
  font-weight: 600;
  cursor: pointer;
  transition: background-color .15s, transform .1s;
}
@media (hover: hover) { .wahl button:not(:disabled):hover { background: var(--himmel); } }
.wahl button:not(:disabled):active { transform: translateY(1px); }
.wahl button:disabled { cursor: default; color: var(--muted); border-color: var(--line); }
.wahl button.gewaehlt { background: var(--ink); color: #fff; border-color: var(--ink); }
.wahl button.haupt { background: var(--sonne); border-color: var(--ink); }
.wahl button.versteckt { visibility: hidden; }
.leise { color: var(--muted); font-size: 1rem; text-align: center; }
.leise a { color: var(--link); }

/* Abschlussfolie */
.abschluss { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.abschluss .gross { color: var(--ink); }

/* ---------- Fuß: Zurück · Folienpunkte · Weiter ---------- */
.fuss {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.fuss .nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 20px;
  border-radius: 12px;
  border: 1px solid var(--rand);
  background: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
}
.fuss .nav svg { width: 18px; height: 18px; }
.fuss .nav.haupt { background: var(--sonne); border-color: var(--ink); }
@media (hover: hover) { .fuss .nav:not(:disabled):hover { filter: brightness(.96); background-color: var(--himmel); } .fuss .nav.haupt:not(:disabled):hover { background-color: #ffc93d; } }
.fuss .nav:disabled { opacity: .4; cursor: default; }

.fortschritt { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; align-items: center; }
.fortschritt button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 32px;
  padding: 0 4px;
  border: 0;
  background: none;
  cursor: pointer;
}
.fortschritt .punkt { display: block; width: 12px; height: 12px; border-radius: 6px; background: var(--line); transition: background-color .2s; }
.fortschritt button.gesehen .punkt { background: var(--rand); }
/* aktuelle Folie: Pille mit einem Abschnitt pro Schritt */
.fortschritt button.aktiv .punkt { display: none; }
.fortschritt .schritte { display: none; gap: 3px; padding: 3px; border-radius: 8px; background: var(--ink); }
.fortschritt button.aktiv .schritte { display: flex; }
.fortschritt .schritte i { display: block; width: 10px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .3); }
.fortschritt .schritte i.an { background: var(--sonne); }

.quelle { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.quelle a { color: inherit; }

@media (max-width: 600px) {
  .praes { padding: 8px 10px; gap: 8px; }
  .kopf { padding: 6px 8px 6px 12px; gap: 10px; }
  .ton .wort, .zaehler { display: none; }
  .fuss .nav { padding: 8px 12px; }
  .fuss .nav .wort { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; transition-delay: 0s !important; animation: none !important; }
}
