/* ──────────────────────────────────────────────────────────────
   Gruppenbereich: Login, Karteikarten, Präsentationsmodus, Druck.
   Gleicher Notizbuch-Stil wie style.css.
   ────────────────────────────────────────────────────────────── */

/* ── Seitenleiste: Knopf und mobiles Menü für Login und Gruppenbereich ── */
.app:has(#login:target) .von-login,
.app:has(#intern:target) .von-intern,
.app:has(#karteikarten:target) .von-karteikarten {
  display: flex;
}

@media (max-width: 860px) {
  .app:has(#login:target, #intern:target, #karteikarten:target) .box {
    display: none;
  }
}

/* ── Login ── */
.login-form {
  margin-top: var(--a1);
}

.login-form .knopf {
  margin-top: var(--a1);
}

.login-form .quiz-meldung {
  margin: 0;
}

.wackeln {
  animation: wackeln 0.4s ease;
}

@keyframes wackeln {
  20%,
  60% {
    translate: -8px 0;
  }
  40%,
  80% {
    translate: 8px 0;
  }
}

/* ── Gruppenbereich ── */
.intern-start {
  display: flex;
  flex-wrap: wrap;
  gap: var(--a2) var(--a3);
}

.intern-start .knopf {
  margin-top: 0;
}

.knopf-hell {
  background: var(--notiz);
  color: var(--tinte);
}

.knopf-hell:hover {
  background: var(--salbei-1);
}

button.knopf {
  cursor: pointer;
}

.tasten {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem var(--a2);
  align-items: center;
  margin: var(--a3) 0 var(--a2);
  font-size: 1rem;
}

.tasten dt {
  display: flex;
  gap: 0.3rem;
}

.tasten dd {
  color: var(--leise);
}

kbd {
  display: inline-block;
  min-width: 1.9em;
  padding: 0.1em 0.45em 0.15em;
  background: var(--notiz);
  border: 1.5px solid var(--tinte);
  border-radius: 6px 8px 6px 7px;
  box-shadow: 0 2px 0 var(--tinte);
  font-family: var(--hand);
  font-size: 0.95em;
  line-height: 1.2;
  text-align: center;
  color: var(--tinte);
}

.intern-fuss {
  display: flex;
  flex-wrap: wrap;
  gap: var(--a3);
  margin-top: var(--a4);
  padding-top: var(--a2);
  border-top: 2px dashed var(--salbei-4);
}

.link-knopf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  background: none;
  border: 0;
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--leise);
  cursor: pointer;
}

.link-knopf:hover {
  color: var(--tinte);
  text-decoration: underline;
}

/* ── Karteikarten: eine Seite je Karte mit dem Vorlesetext ── */
.kartei {
  display: grid;
  gap: var(--a2);
  max-width: 44rem;
}

.kartei-reiter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kartei-reiter button {
  min-width: 2.3rem;
  padding: 0.3rem 0.5rem;
  background: var(--notiz);
  border: 2px solid var(--tinte);
  border-radius: var(--rund-klein);
  font-family: var(--hand);
  font-size: 1.1rem;
  color: var(--tinte);
  cursor: pointer;
  transition: background 0.2s;
}

.kartei-reiter button:hover {
  background: var(--salbei-1);
}

.kartei-reiter button[aria-selected="true"] {
  background: var(--salbei-2);
}

/* Karte wie liniertes Karteikarten-Papier */
.kk-seite {
  position: relative;
  padding: 1.1rem 1.4rem 1.3rem;
  background:
    linear-gradient(var(--salbei-4), var(--salbei-4)) 0 3.6rem / 100% 2px no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 calc(2rem - 1px), var(--linie) calc(2rem - 1px) 2rem) 0 3.75rem / 100% calc(100% - 3.75rem) no-repeat,
    var(--notiz);
  border: var(--kontur);
  border-radius: var(--rund);
  box-shadow: 0 5px 0 var(--tinte);
}

.kk-nr {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--salbei-4);
}

.kk-titel {
  min-height: 2.5rem;
  margin-bottom: 0.4rem;
  font-family: var(--hand);
  font-size: 1.7rem;
  line-height: 1.3;
  color: var(--tinte);
}

.kk-vorlesen {
  font-size: 1.12rem;
  line-height: 2rem;
  color: var(--text);
}

/* Hinweis für die Vortragenden (wird nicht vorgelesen) */
.kk-tipp,
.kk-legende-tipp {
  font-size: 0.98rem;
  line-height: 2rem;
  font-style: italic;
  color: var(--leise);
}

.kk-tipp::before {
  content: "✎ ";
  font-style: normal;
}

/* Hier zur nächsten Folie klicken */
.kk-weiter,
.kk-legende-weiter {
  font-family: var(--hand);
  font-size: 1.1rem;
  line-height: 2rem;
  color: var(--gruen);
}

.kk-weiter::before {
  content: "→ ";
}

.kk-legende-weiter,
.kk-legende-tipp {
  white-space: nowrap;
  line-height: inherit;
}

.kk-legende-weiter::before {
  content: "→ ";
}

/* Abschnitt zur aktuellen Folie (Notizen und Referentenansicht) */
.kk-teil {
  transition:
    opacity 0.3s,
    background 0.3s;
}

.kk-markiert .kk-teil {
  opacity: 0.45;
}

.kk-markiert .kk-teil.kk-jetzt {
  opacity: 1;
  margin-inline: -0.5rem;
  padding-inline: 0.5rem;
  background: rgba(195, 220, 174, 0.45);
  border-radius: 8px;
}

.kartei-leiste {
  display: flex;
  justify-content: center;
  gap: var(--a2);
  margin-top: 0.4rem;
}

.kartei-knopf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: var(--notiz);
  border: var(--kontur);
  border-radius: var(--rund-klein);
  box-shadow: 0 4px 0 var(--tinte);
  font-family: var(--hand);
  font-size: 1.2rem;
  line-height: 1;
  color: var(--tinte);
  cursor: pointer;
  transition:
    transform 0.1s,
    box-shadow 0.1s,
    background 0.2s;
}

.kartei-knopf:hover {
  background: var(--salbei-1);
}

.kartei-knopf:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--tinte);
}

.kartei-knopf:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
  box-shadow: 0 4px 0 var(--tinte);
  background: var(--notiz);
}

/* ── Präsentationsmodus ──
   Die Schriftgröße der Seite wird so gesetzt, dass eine 16:9-Folie (64 × 36 rem) auf den
   Bildschirm passt – dadurch wächst alles mit, was in rem angegeben ist. */
html.praesentation {
  font-size: min(calc(100vw / 66), calc(100vh / 37.25));
  font-size: min(calc(100vw / 66), calc(100dvh / 37.25));
}

html.praesentation .app,
html.praesentation .intro {
  display: none;
}

.praesi {
  --kurve: cubic-bezier(0.32, 0.72, 0, 1);
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: var(--papier);
}

.praesi.ruhig {
  cursor: none;
}

/* Die Bühne füllt den ganzen Bildschirm (auch 4:3 wie beim iPad). Auf 16:9 entspricht
   das 64 × 36 rem; auf höheren Bildschirmen gibt es mehr Platz nach unten statt Balken. */
.praesi-buehne {
  position: relative;
  width: calc(100vw - 2rem);
  height: calc(100vh - 1.25rem);
  height: calc(100dvh - 1.25rem);
  background: var(--blatt);
  border: var(--kontur);
  border-radius: var(--rund);
  overflow: clip;
}

.folie {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
  justify-content: safe center;
  padding: 2.4rem 4rem 2.8rem;
  overflow: hidden;
}

.folie.aktiv,
.folie.raus {
  display: flex;
}

.folie.raus {
  z-index: 0;
  pointer-events: none;
}

.folie > .content {
  margin: 0 auto;
  max-width: 50rem;
}

/* Feste Größen statt der bildschirmabhängigen Werte der Seite */
.folie h2 {
  font-size: 3.1rem;
}

.folie .lead {
  font-size: 1.3rem;
  max-width: 40em;
  margin-bottom: var(--a3);
}

.folie .liste li,
.folie .check label {
  font-size: 1.12rem;
}

.folie .fall-titel {
  font-size: 1.8rem;
}

.folie .zwischentitel {
  margin-top: var(--a2);
}

/* Erste Zeile der Folie: keine Trennlinie über einer Zwischenüberschrift direkt unter dem Titel */
.folie h2 + .zwischentitel {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

/* Titel- und Schlussfolie */
.folie-art-titel .content {
  text-align: center;
  max-width: 56rem;
}

.folie-art-titel .lead {
  margin-inline: auto;
  margin-bottom: var(--a3);
}

.folie-art-titel .hero-wort {
  font-size: 5rem;
}

.folie-art-titel .themen {
  margin-bottom: var(--a3);
}

.folie-art-titel .hero-vor,
.folie-art-titel .themen {
  font-size: 1.8rem;
}

.folie-team {
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--tinte);
}

/* Website-Folie: Titel, großer QR-Code, Adresse */
.folie-art-web .content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: none;
  text-align: center;
}

.web-titel {
  margin-bottom: 1.3rem;
}

.web-qr {
  width: 18rem;
  aspect-ratio: 1;
  padding: 1.1rem;
  background: #ffffff;
  border: var(--kontur);
  border-radius: var(--rund);
  box-shadow: 0 6px 0 var(--tinte);
}

.web-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.web-qr svg path {
  fill: var(--tinte);
}

.web-adresse {
  margin-top: 1.5rem;
  font-family: var(--hand);
  font-size: 4.2rem;
  line-height: 1;
  color: var(--tinte);
}

/* Quiz-Lobby auf der Folie größer */
.folie-art-quiz .quiz-qr {
  width: 15rem;
}

.folie-art-quiz .quiz-code {
  font-size: 5rem;
}

/* Globus-Folie: Überschrift und Station oben, der Globus füllt den Rest */
.folie-art-globus {
  justify-content: stretch;
  padding: 1.6rem 2rem 2.2rem;
}

.folie-art-globus .content {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem var(--a2);
  width: 100%;
  max-width: none;
  margin: 0;
}

.folie-art-globus h2 {
  margin: 0;
  font-size: 2.6rem;
}

.folie-art-globus erdkugel-widget {
  grid-column: 1 / -1;
  align-self: stretch;
  height: auto;
  min-height: 0;
}

.folie-station {
  padding: 0.35rem 0.9rem;
  background: var(--notiz);
  border: 2px solid var(--tinte);
  border-radius: var(--rund-klein);
  font-family: var(--hand);
  font-size: 1.3rem;
  color: var(--tinte);
}

.folie-station b {
  font-weight: 400;
  color: var(--salbei-4);
}

.folie-art-globus .content > * {
  --n: 0 !important;
}

/* Quiz-Folie */
.folie-art-quiz .content {
  max-width: 52rem;
}

/* Seitenzahl unten in der Mitte, wie im Heft */
.praesi-seitenzahl {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 0.7rem;
  translate: -50% 0;
  font-family: var(--hand);
  font-size: 1rem;
  color: var(--leise);
  pointer-events: none;
}

.praesi:has(.folie-art-globus.aktiv) .praesi-seitenzahl {
  display: none;
}

/* Blätterzweige wie auf der Seite */
.praesi-buehne::before,
.praesi-buehne::after {
  z-index: 2;
  bottom: 0.5rem;
  width: 3rem;
  height: 4.5rem;
}

/* Wechsel: neue Folie gleitet herein, Inhalte erscheinen nacheinander */
.folie.rein-vor {
  animation: folie-rein 0.45s var(--kurve) both;
}

.folie.rein-zurueck {
  animation: folie-rein 0.45s var(--kurve) both;
  --von: -3rem;
}

.folie.raus-vor {
  animation: folie-raus 0.3s ease both;
}

.folie.raus-zurueck {
  animation: folie-raus 0.3s ease both;
  --nach: 3rem;
}

@keyframes folie-rein {
  from {
    opacity: 0;
    translate: var(--von, 3rem) 0;
  }
}

@keyframes folie-raus {
  to {
    opacity: 0;
    translate: var(--nach, -3rem) 0;
  }
}

.folie.rein-vor > .content > *,
.folie.rein-zurueck > .content > * {
  animation: folie-teil 0.55s var(--kurve) both;
  animation-delay: calc(0.1s + var(--n, 0) * 0.07s);
}

@keyframes folie-teil {
  from {
    opacity: 0;
    translate: 0 0.8rem;
  }
}

/* Fortschritt am unteren Rand */
.praesi-balken {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--salbei-1);
}

.praesi-balken i {
  display: block;
  height: 100%;
  background: var(--gruen);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--kurve);
}

/* Bedienleiste: erscheint bei Mausbewegung */
.praesi-leiste {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  translate: -50% 0;
  background: var(--notiz);
  border: 2.5px solid var(--tinte);
  border-radius: 12px 15px 11px 16px / 15px 11px 16px 12px;
  box-shadow: 0 4px 0 var(--tinte);
  transition:
    opacity 0.3s,
    translate 0.3s;
}

.praesi.ruhig .praesi-leiste {
  opacity: 0;
  translate: -50% 12px;
  pointer-events: none;
}

/* Leiste und Fortschritt ganz ausgeblendet (Knopf oder Taste H) */
.praesi.ohne-leiste .praesi-leiste,
.praesi.ohne-leiste .praesi-balken {
  display: none;
}

/* Touch (iPad): die ausgeblendete Leiste bleibt antippbar, das erste Tippen blendet sie nur ein */
@media (hover: none) {
  .praesi.ruhig .praesi-leiste {
    pointer-events: auto;
  }
}

.praesi-knopf {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  background: none;
  border: 0;
  border-radius: 9px;
  font-family: var(--hand);
  font-size: 20px;
  line-height: 1;
  color: var(--tinte);
  cursor: pointer;
}

.praesi-knopf:hover,
.praesi-knopf[aria-pressed="true"],
.praesi-knopf[aria-expanded="true"] {
  background: var(--salbei-1);
}

.praesi-knopf:disabled {
  opacity: 0.35;
  cursor: default;
  background: none;
}

.praesi-knopf .ic {
  width: 22px;
  height: 22px;
}

.praesi-zaehler {
  min-width: 76px;
}

.praesi-trenner {
  width: 2px;
  height: 26px;
  margin: 0 4px;
  background: var(--linie);
}

/* Notizen: Karteikarte des Kapitels (nur auf dem eigenen Bildschirm sinnvoll) */
.praesi-notiz {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 4;
  width: min(420px, 38vw);
  max-height: 70vh;
  overflow: auto;
  padding: 14px 18px;
  background: var(--notiz);
  border: 2.5px solid var(--tinte);
  border-radius: 14px 18px 12px 20px / 18px 12px 20px 14px;
  box-shadow: 0 4px 0 var(--tinte);
  font-size: 16px;
}

.praesi-notiz .kk-titel {
  min-height: 0;
  font-size: 22px;
}

.praesi-notiz .kk-vorlesen,
.praesi-notiz .kk-tipp,
.praesi-notiz .kk-weiter {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Übersicht aller Folien */
.praesi-uebersicht {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: auto;
  padding: 40px clamp(16px, 5vw, 80px);
  background: rgba(246, 247, 239, 0.97);
}

.praesi-uebersicht-titel {
  margin-bottom: 18px;
  font-family: var(--hand);
  font-size: 34px;
  color: var(--tinte);
}

.praesi-uebersicht ol {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.praesi-uebersicht button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  height: 100%;
  padding: 12px 14px;
  background: var(--notiz);
  border: 2px solid var(--tinte);
  border-radius: 10px 13px 9px 14px / 13px 9px 14px 10px;
  font: 17px var(--sans);
  text-align: left;
  color: var(--text);
  cursor: pointer;
}

.praesi-uebersicht button:hover {
  background: var(--salbei-1);
}

.praesi-uebersicht button[aria-current] {
  background: var(--salbei-2);
}

.praesi-uebersicht b {
  font-family: var(--hand);
  font-size: 22px;
  font-weight: 400;
  color: var(--salbei-4);
}

/* Schwarzbild (Taste B) */
.praesi-schwarz {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: #000;
  cursor: none;
}

[hidden].praesi-notiz,
[hidden].praesi-uebersicht,
[hidden].praesi-schwarz {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .folie,
  .folie > .content > *,
  .praesi-balken i {
    animation: none !important;
    transition: none;
  }
}

/* ── Druck der Karteikarten: eine Karte untereinander, nicht über Seiten geteilt ── */
.druck-karten {
  display: none;
}

@media print {
  html.karten-druck,
  html.karten-druck body {
    height: auto;
    overflow: visible;
    background: #fff;
  }

  html.karten-druck .app,
  html.karten-druck .intro,
  html.karten-druck .praesi {
    display: none !important;
  }

  html.karten-druck .druck-karten {
    display: block;
  }

  .druck-karte {
    margin-bottom: 8mm;
    break-inside: avoid;
    box-shadow: none;
    border-width: 1.5px;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .druck-karte .kk-vorlesen {
    font-size: 12pt;
  }
}

/* ── Gruppenbereich: wer spricht wann ── */
.sprecher {
  max-width: 38rem;
}

.sprecher td {
  padding: 0.5rem var(--a2);
}

.sprecher td:first-child {
  width: auto;
  font-size: 1.15rem;
}

.sprecher td:nth-child(2),
.sprecher th:nth-child(2) {
  width: 5rem;
  text-align: center;
}

.sprecher td:nth-child(3) {
  width: 9rem;
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--tinte);
}

.sprecher-summe {
  max-width: 20rem;
}

@container (max-width: 30rem) {
  .sprecher th,
  .sprecher td {
    padding-inline: 0.6rem;
  }

  .sprecher td:first-child {
    font-size: 1.05rem;
  }

  .sprecher td:nth-child(2),
  .sprecher th:nth-child(2) {
    width: 3.6rem;
  }

  .sprecher td:nth-child(3) {
    width: auto;
  }
}

/* ── Sprecher auf den Karteikarten ── */
.kk-sprecher {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  margin: 0.2rem 0 0.15rem;
  padding: 0 0.6em;
  background: var(--salbei-1);
  border: 1.5px solid var(--salbei-4);
  border-radius: 999px;
  font-family: var(--hand);
  font-size: 1.05rem;
  line-height: 1.6rem;
  color: var(--tinte);
}

.kk-sprecher.kk-ich {
  background: var(--salbei-3);
  border-color: var(--tinte);
}

/* Abschnitte anderer: zum Mitlesen, aber zurückgenommen */
.kk-fremd {
  opacity: 0.45;
}

.kk-alle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: var(--a2);
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--tinte);
  cursor: pointer;
}

.kk-alle input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--gruen);
  cursor: pointer;
}

.sprecher tr.ich td {
  background: var(--salbei-1);
}

.ref-folie .ref-wer {
  color: var(--tinte);
}
