:root {
  --bg: #fbf8f3;
  --card: #ffffff;
  --text: #2b2a33;
  --muted: #6b6878;
  --line: #e6e0d6;
  --accent: #d9622b;
  --accent-text: #ffffff;
  --danger: #c0392b;
  --ok: #2e8b57;
  /* Farben der Themen in der Wolke (auf hellem Grund gut lesbar) */
  --c0: #d9622b; --c1: #2a7ab0; --c2: #3c9a5f; --c3: #8e44ad;
  --c4: #c0392b; --c5: #b7860b; --c6: #16808a; --c7: #c2477a; --cx: #4a4857;
  --font: "Nunito", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
  --bg: #15141c;
  --card: #201f2a;
  --text: #f3f1f7;
  --muted: #a7a3b5;
  --line: #34323f;
  --c0: #ff9a62; --c1: #6cc3ff; --c2: #7ee09b; --c3: #d39bff;
  --c4: #ff7b7b; --c5: #ffd166; --c6: #5ee0e0; --c7: #ff8fc0; --cx: #e8e6ee;
}

/* ---------- Farbpaletten (Einstellung „Farben“ in admin.php) ---------- */
[data-palette="erde"] {
  --bg: #f4eee3; --card: #fbf8f2; --text: #3a2e24; --muted: #7a6b5c; --line: #e2d7c5; --accent: #a4532b;
  --c0: #a4532b; --c1: #5f6f32; --c2: #b07d27; --c3: #6e4a32; --c4: #7c8c5e; --c5: #56707a; --c6: #3f5a4a; --c7: #9a6b4f; --cx: #4b3f35;
}
[data-theme="dark"][data-palette="erde"] {
  --bg: #1f1a15; --card: #2a241d; --text: #f1e8dc; --muted: #b5a693; --line: #3b332a;
  --c0: #e08a5c; --c1: #b3c46e; --c2: #e3b45a; --c3: #c99a75; --c4: #a9bd8a; --c5: #9fb8c2; --c6: #8fb59e; --c7: #d6a684; --cx: #efe5d8;
}
[data-palette="abend"] {
  --bg: #fcf6f1; --card: #ffffff; --text: #34202c; --muted: #7d6370; --line: #eedfd6; --accent: #b8365a;
  --c0: #8e2c5e; --c1: #c8435a; --c2: #e0703a; --c3: #c58a1c; --c4: #6b3f86; --c5: #b4587a; --c6: #9c3d2c; --c7: #5b4b8a; --cx: #4a3442;
}
[data-theme="dark"][data-palette="abend"] {
  --bg: #1d1420; --card: #2a1e2d; --text: #f8ecf1; --muted: #bba3b0; --line: #3d2c40;
  --c0: #e07bb0; --c1: #ff8a95; --c2: #ffa66b; --c3: #f4c95d; --c4: #b99bf0; --c5: #e8a0bd; --c6: #f08a6c; --c7: #9fa6f5; --cx: #f3e6ee;
}
[data-palette="meer"] {
  --bg: #f3f7f8; --card: #ffffff; --text: #1d2f3a; --muted: #5c707c; --line: #dce7ea; --accent: #1f6f8b;
  --c0: #1f5f8b; --c1: #0f8a8a; --c2: #4a8a4f; --c3: #5b5fc7; --c4: #b7793a; --c5: #2f9bc1; --c6: #6c4f9e; --c7: #1d6f5f; --cx: #2c3e4a;
}
[data-theme="dark"][data-palette="meer"] {
  --bg: #0f1c24; --card: #172833; --text: #e8f2f5; --muted: #9bb2bd; --line: #24394a;
  --c0: #6fb4e8; --c1: #4fd1c5; --c2: #86d39a; --c3: #a3a6ff; --c4: #f0b46a; --c5: #7fd3f5; --c6: #c2a4f0; --c7: #5fc4a8; --cx: #e3eef2;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-text-size-adjust: 100%;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ---------- Wolke ---------- */
.wc { position: relative; overflow: hidden; width: 100%; height: 100%; }
.wc-word {
  position: absolute; left: 0; top: 0;
  white-space: nowrap; line-height: 1.12; font-weight: 800;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), font-size .8s cubic-bezier(.2,.8,.2,1), opacity .6s, color .6s;
  will-change: transform;
  color: var(--cx);
}
.wc-word.wc-enter { opacity: 0; }
.wc-word[data-cl="0"] { color: var(--c0); }
.wc-word[data-cl="1"] { color: var(--c1); }
.wc-word[data-cl="2"] { color: var(--c2); }
.wc-word[data-cl="3"] { color: var(--c3); }
.wc-word[data-cl="4"] { color: var(--c4); }
.wc-word[data-cl="5"] { color: var(--c5); }
.wc-word[data-cl="6"] { color: var(--c6); }
.wc-word[data-cl="7"] { color: var(--c7); }
.wc-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 1.1rem; text-align: center; padding: 1rem;
}

/* ---------- Teilnehmer (Handy) ---------- */
.p-wrap { max-width: 640px; margin: 0 auto; padding: 16px; }
.p-question { font-size: 1.5rem; line-height: 1.25; margin: 8px 0 16px; font-weight: 800; }
.p-form { display: flex; gap: 8px; }
.p-form input {
  flex: 1; min-width: 0; padding: 14px 14px; font-size: 1.1rem;
  border: 2px solid var(--line); border-radius: 12px; background: var(--card);
}
.p-form input:focus { outline: none; border-color: var(--accent); }
.btn {
  border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 800; cursor: pointer;
  background: var(--accent); color: var(--accent-text);
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--card); color: var(--text); border: 2px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: .9rem; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.p-hint { color: var(--muted); font-size: .95rem; margin: 8px 2px; min-height: 1.3em; }
.p-msg { margin: 8px 2px; font-weight: 700; min-height: 1.3em; }
.p-msg.err { color: var(--danger); }
.p-msg.ok { color: var(--ok); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 6px 6px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-weight: 700;
}
.chip button {
  border: 0; background: transparent; cursor: pointer; color: var(--muted);
  font-size: 1.1rem; line-height: 1; width: 28px; height: 28px; border-radius: 50%;
}
.chip button:hover { background: var(--line); }
.p-cloud {
  height: 62vh; min-height: 300px; margin-top: 16px; border-radius: 16px;
  background: var(--card); border: 1px solid var(--line);
}
.p-closed { padding: 16px; background: var(--card); border-radius: 12px; border: 1px solid var(--line); }
h2.small { font-size: 1rem; margin: 20px 2px 4px; color: var(--muted); }

/* ---------- Beamer ---------- */
.b-body { height: 100vh; overflow: hidden; }
.b-grid {
  display: grid; height: 100vh; padding: 2.5vh 2.5vw; gap: 1.5vh 2vw;
  grid-template-columns: 1fr auto; grid-template-rows: auto 1fr;
}
.b-question {
  grid-column: 1 / 2; font-size: clamp(22px, 4.6vh, 64px); font-weight: 800; line-height: 1.15; margin: 0;
}
.b-side { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; gap: 1.5vh; width: var(--qr, 28vh); transition: width .4s; }
.b-qr { background: #fff; padding: 1vh; border-radius: 1.5vh; width: var(--qr, 28vh); height: var(--qr, 28vh); cursor: zoom-in; transition: width .4s, height .4s; }
.b-qr svg { width: 100%; height: 100%; display: block; }
.b-url { font-size: 1.6vh; color: var(--muted); text-align: center; word-break: break-all; }
.b-label { font-size: 2.2vh; font-weight: 800; text-align: center; }
.b-count { font-size: 2vh; color: var(--muted); text-align: center; margin-top: auto; }
.b-cloud { grid-column: 1; grid-row: 2; min-height: 0; }
.b-closed { font-size: 2vh; font-weight: 800; color: var(--muted); text-align: center; }
.b-fs {
  position: fixed; right: 10px; bottom: 10px; opacity: 0; transition: opacity .3s;
}
body:hover .b-fs { opacity: .6; }
.b-qr-big {
  position: fixed; inset: 0; display: none; place-items: center; background: rgba(0,0,0,.75); z-index: 5;
}
.b-qr-big.show { display: grid; }
.b-qr-big > div { background: #fff; padding: 3vh; border-radius: 3vh; width: 80vh; height: 80vh; }
.b-qr-big svg { width: 100%; height: 100%; }
