/* kb- Designsystem, Ausschnitt für das Quiz-Tool */
@import url('https://fonts.googleapis.com/css2?family=Titillium+Web:wght@300;400;600;700&display=swap');

:root {
  --kb-braun:        #4a3728;
  --kb-braun-hell:   #7a6353;
  --kb-orange:       #e2711d;
  --kb-orange-hell:  #f9a03f;
  --kb-gruen:        #4f772d;
  --kb-gruen-hell:   #90a955;
  --kb-blau:         #21618c;
  --kb-blau-hell:    #5499c7;
  --kb-sand:         #f6f1ea;
  --kb-weiss:        #ffffff;
  --kb-grau:         #d9d2c8;
  --kb-text:         #2b2119;
  --kb-radius:       10px;
  --kb-schatten:     0 2px 8px rgba(74, 55, 40, .14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Titillium Web', 'Segoe UI', system-ui, sans-serif;
  background: var(--kb-sand);
  color: var(--kb-text);
  line-height: 1.5;
}

a { color: var(--kb-blau); }

.kb-block {
  background: var(--kb-weiss);
  border: 1px solid var(--kb-grau);
  border-radius: var(--kb-radius);
  box-shadow: var(--kb-schatten);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.kb-wrap { max-width: 900px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }

h1, h2, h3 { font-weight: 600; color: var(--kb-braun); margin-top: 0; }
h1 { font-size: 1.6rem; }

.kb-btn {
  display: inline-block;
  border: 0;
  border-radius: var(--kb-radius);
  background: var(--kb-orange);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: .6rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
}
.kb-btn:hover { background: var(--kb-orange-hell); }
.kb-btn--blau  { background: var(--kb-blau); }
.kb-btn--blau:hover { background: var(--kb-blau-hell); }
.kb-btn--gruen { background: var(--kb-gruen); }
.kb-btn--gruen:hover { background: var(--kb-gruen-hell); }
.kb-btn--still { background: transparent; color: var(--kb-braun); border: 1px solid var(--kb-grau); }
.kb-btn[disabled] { opacity: .45; cursor: not-allowed; }

label { display: block; font-weight: 600; margin: .75rem 0 .25rem; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: .55rem .7rem; font: inherit;
  border: 1px solid var(--kb-grau); border-radius: var(--kb-radius); background: #fff;
}
textarea { min-height: 4.5rem; }

.kb-hinweis { color: var(--kb-braun-hell); font-size: .9rem; }
.kb-fehler  { color: #b03a2e; font-weight: 600; }
.kb-erfolg  { background: var(--kb-gruen); color: #fff; padding: .5rem .9rem; border-radius: var(--kb-radius); }

/* ---------- Studierendenansicht (Handy) ---------- */
.kb-frage { margin-bottom: 1.5rem; }
.kb-frage img { max-width: 100%; border-radius: var(--kb-radius); border: 1px solid var(--kb-grau); }

.kb-option {
  display: flex; gap: .7rem; align-items: center;
  border: 2px solid var(--kb-grau); border-radius: var(--kb-radius);
  padding: .8rem .9rem; margin-bottom: .6rem; background: #fff; cursor: pointer;
}
.kb-option:hover { border-color: var(--kb-blau-hell); }
.kb-option input { width: 1.15rem; height: 1.15rem; flex: none; }
.kb-option img { max-height: 110px; border-radius: 6px; }
.kb-option--gewaehlt { border-color: var(--kb-blau); background: #eef5fb; }
.kb-option--richtig  { border-color: var(--kb-gruen); background: #eef6e8; }
.kb-option--falsch   { border-color: #b03a2e; background: #fbeeec; }

.kb-fortschritt { position: sticky; top: 0; background: var(--kb-sand); padding: .6rem 0; z-index: 5; }
.kb-balken { height: 8px; background: var(--kb-grau); border-radius: 99px; overflow: hidden; }
.kb-balken > i { display: block; height: 100%; background: var(--kb-gruen); transition: width .3s; }

/* ---------- Dozentenansicht / Folie ---------- */
.kb-folie {
  min-height: 100vh; display: flex; flex-direction: column;
  background: var(--kb-weiss); padding: 1.2rem 1.6rem;
}
.kb-folie--embed { padding: .8rem 1rem; }
.kb-folie h2 { font-size: clamp(1.1rem, 2.4vw, 1.9rem); }

.kb-code {
  font-size: clamp(2rem, 7vw, 4.5rem); font-weight: 700; letter-spacing: .12em;
  color: var(--kb-blau); line-height: 1.1;
}
.kb-lobby { display: flex; gap: 2rem; align-items: center; flex-wrap: wrap; }
.kb-qr { width: min(38vw, 320px); }
.kb-qr img, .kb-qr svg { width: 100%; height: auto; }

.kb-zaehler { font-size: clamp(1.6rem, 5vw, 3rem); font-weight: 700; color: var(--kb-gruen); }

.kb-verteilung { list-style: none; padding: 0; margin: 1rem 0 0; }
.kb-verteilung li { margin-bottom: .55rem; }
.kb-verteilung .kb-zeile { display: flex; justify-content: space-between; gap: 1rem; font-weight: 600; }
.kb-verteilung .kb-spur { height: 26px; background: #eee7dd; border-radius: 6px; overflow: hidden; }
.kb-verteilung .kb-spur > i { display: block; height: 100%; background: var(--kb-blau-hell); transition: width .4s; }
.kb-verteilung li.ist-richtig .kb-spur > i { background: var(--kb-gruen); }
.kb-verteilung li.ist-richtig .kb-zeile { color: var(--kb-gruen); }

.kb-steuerung { margin-top: auto; padding-top: 1rem; display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.kb-steuerung .kb-hinweis { margin-left: auto; }

.kb-pillen { display: flex; gap: .3rem; flex-wrap: wrap; margin: .5rem 0; }
.kb-pille {
  width: 26px; height: 26px; border-radius: 6px; background: var(--kb-grau);
  display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: #fff;
}
.kb-pille--fertig { background: var(--kb-gruen); }
.kb-pille--aktiv  { outline: 3px solid var(--kb-orange); }

/* ---------- Bilder zur Frage ---------- */
.kb-bilder { display: flex; gap: .4rem; flex-wrap: wrap; margin: .6rem 0 .3rem; }
.kb-bilder img { max-height: 130px; border-radius: 8px; border: 1px solid var(--kb-grau); display: block; }
.kb-bilder a { line-height: 0; }

/* ---------- Reihenfolge sortieren ---------- */
.kb-sortier { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-direction: column; gap: .45rem; counter-reset: platz; }
.kb-sortier li {
  display: flex; align-items: center; gap: .6rem;
  border: 2px solid var(--kb-grau); border-radius: var(--kb-radius);
  padding: .55rem .7rem; background: #fff; transition: background .3s, border-color .2s;
}
.kb-sortier .kb-platz { font-weight: 700; color: var(--kb-braun-hell); min-width: 1.4rem; }
.kb-sortier .kb-text { flex: 1; }
.kb-sortier .kb-pfeile { display: flex; flex-direction: column; gap: .15rem; }
.kb-sortier .kb-pfeile button {
  border: 1px solid var(--kb-grau); background: var(--kb-sand); color: var(--kb-braun);
  border-radius: 6px; width: 2.1rem; height: 1.5rem; font-size: .7rem; line-height: 1; cursor: pointer;
}
.kb-sortier .kb-pfeile button:hover { background: var(--kb-grau); }
.kb-sortier .kb-pfeile button:disabled { opacity: .35; cursor: not-allowed; }
.kb-sortier li.kb-bewegt { background: #eef5fb; }
.kb-sortier li.kb-sortier--richtig { border-color: var(--kb-gruen); background: #eef6e8; }
.kb-sortier li.kb-sortier--falsch  { border-color: #b03a2e; background: #fbeeec; }

.kb-nav { display: flex; gap: .6rem; margin-top: 1rem; }

/* Reihenfolge auf der Folie */
.kb-reihe { list-style: none; padding: 0; margin: .5rem 0 0; display: flex; flex-direction: column; gap: .4rem; }
.kb-reihe li { display: grid; grid-template-columns: 2rem 1fr auto; gap: .6rem; align-items: center; }
.kb-reihe .kb-platz {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--kb-braun); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.kb-reihe .kb-spur { height: 22px; background: #eee7dd; border-radius: 6px; overflow: hidden; }
.kb-reihe .kb-spur > i { display: block; height: 100%; background: var(--kb-gruen); transition: width .4s; }
.kb-folie .kb-bilder img { max-height: 22vh; }

/* ---------- Präsentationsmodus (Vollbild im Browser) ---------- */
.kb-buehne {
  position: fixed; inset: 0; background: #14100c; color: #f3ece1;
  display: grid; place-items: stretch; overflow: hidden;
}
.kb-ebene { position: absolute; inset: 0; display: grid; place-items: center; }
.kb-ebene[hidden] { display: none; }
#folie-bild { max-width: 100%; max-height: 100%; object-fit: contain; }

.kb-leer { text-align: center; max-width: 34rem; padding: 2rem; }
.kb-leer h2 { color: #f3ece1; }
.kb-leer p { color: #b9a893; }
.kb-leer em { color: #f9a03f; font-style: normal; }

.kb-quizfeld {
  background: var(--kb-weiss); color: var(--kb-text);
  width: min(1100px, 92vw); max-height: 88vh; overflow-y: auto;
  border-radius: 14px; padding: 1.8rem 2.2rem; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.kb-quizfeld h2 { font-size: clamp(1.2rem, 2.4vw, 2rem); }
.kb-quizfeld .kb-verteilung .kb-zeile { font-size: clamp(.95rem, 1.5vw, 1.25rem); }
.kb-quizfeld .kb-spur { height: 30px; }
.kb-quizfeld .kb-qr img { width: min(30vw, 260px); }

.kb-leiste {
  position: absolute; left: 50%; bottom: 1.2rem; transform: translateX(-50%);
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center;
  background: rgba(20,16,12,.92); border: 1px solid #3b2f26; border-radius: 999px;
  padding: .5rem .9rem; transition: opacity .3s; z-index: 10;
}
.kb-leiste.kb-versteckt { opacity: 0; pointer-events: none; }
.kb-leiste button, .kb-leiste a {
  font: inherit; font-size: .88rem; font-weight: 600; color: #f3ece1;
  background: #2e251d; border: 0; border-radius: 999px; padding: .45rem .9rem;
  cursor: pointer; text-decoration: none;
}
.kb-leiste button:hover, .kb-leiste a:hover { background: #45372c; }
.kb-leiste button.kb-haupt { background: var(--kb-orange); }
.kb-leiste button.kb-haupt:hover { background: var(--kb-orange-hell); }
.kb-leiste kbd {
  font-family: inherit; font-size: .72rem; background: rgba(255,255,255,.18);
  border-radius: 4px; padding: 0 .3rem; margin-left: .3rem;
}
.kb-leiste .kb-stand { font-size: .85rem; color: #b9a893; min-width: 4.5rem; text-align: center; }
.kb-leiste .kb-trenner { width: 1px; height: 1.4rem; background: #45372c; }
.kb-quizsteuerung { display: flex; gap: .4rem; }
.kb-quizsteuerung[hidden] { display: none; }
.kb-foliensteuerung { display: flex; align-items: center; gap: .5rem; }
.kb-foliensteuerung[hidden] { display: none; }
