:root {
  --bg: #2b1a5a;
  --bg2: #3d2680;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b76;
  --accent: #7c4dff;
  --a0: #e21b3c; /* rot   - Dreieck */
  --a1: #1368ce; /* blau  - Raute   */
  --a2: #d89e00; /* gelb  - Kreis   */
  --a3: #26890c; /* grün  - Quadrat */
  --ok: #26890c;
  --bad: #e21b3c;
}

* { box-sizing: border-box; }

html { background: var(--bg2); }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg), var(--bg2));
  background-attachment: fixed;
  color: #fff;
}

.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 16px;
}

.logo {
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -1px;
  margin: 0 0 8px;
}
.logo span { color: #ffd54f; }

.card {
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 20px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card.wide { max-width: 960px; }

input, textarea, select {
  font: inherit;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  width: 100%;
  color: var(--text);
  background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
input.big { font-size: 1.4rem; text-align: center; font-weight: 700; }

button {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  background: #333;
  color: #fff;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
button:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); }
button.light { background: #eee; color: var(--text); }
button.danger { background: var(--bad); }
button.small { padding: 6px 10px; font-size: .9rem; }

.error { color: var(--bad); font-weight: 600; min-height: 1.2em; margin: 0; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Antwortkacheln ---------- */
.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 1100px;
}
.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 14px 18px;
  border-radius: 8px;
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.6rem);
  font-weight: 700;
  text-align: left;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.answer.a0 { background: var(--a0); }
.answer.a1 { background: var(--a1); }
.answer.a2 { background: var(--a2); }
.answer.a3 { background: var(--a3); }
.answer.dim { opacity: .3; }
.answer .count { margin-left: auto; font-size: 1.4em; }

.shape { width: 32px; height: 32px; flex: none; fill: #fff; }

.player-answers { flex: 1; width: 100%; grid-auto-rows: 1fr; }
.player-answers .answer { justify-content: center; min-height: 0; }
.player-answers .shape { width: 64px; height: 64px; }

/* ---------- Spielanzeige ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(0, 0, 0, .25);
  font-weight: 700;
  z-index: 10;
}
.question-text {
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 18px 24px;
  font-size: clamp(1.3rem, 3.5vw, 2.4rem);
  font-weight: 800;
  text-align: center;
  width: 100%;
  max-width: 1100px;
}
.timer {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: var(--accent);
  display: grid;
  place-items: center;
  font-size: 2.4rem;
  font-weight: 900;
}
.pin-box {
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 28px;
  text-align: center;
}
.pin-box .pin { font-size: clamp(3rem, 10vw, 6rem); font-weight: 900; letter-spacing: 6px; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 1100px; }
.chip {
  background: rgba(255, 255, 255, .15);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.chip:hover { background: var(--bad); }

.board { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 8px; }
.board-row {
  display: flex;
  justify-content: space-between;
  background: #fff;
  color: var(--text);
  border-radius: 8px;
  padding: 12px 18px;
  font-size: 1.3rem;
  font-weight: 800;
}

.podium { display: flex; align-items: flex-end; gap: 12px; }
.podium .step {
  width: clamp(90px, 22vw, 180px);
  background: var(--accent);
  border-radius: 8px 8px 0 0;
  text-align: center;
  padding: 12px 6px;
  font-weight: 800;
}
.podium .step .name { font-size: 1.2rem; word-break: break-word; }
.podium .p1 { height: 240px; background: #ffb300; }
.podium .p2 { height: 180px; background: #b0bec5; color: #222; }
.podium .p3 { height: 140px; background: #a1887f; }

.feedback { font-size: 2.4rem; font-weight: 900; text-align: center; }
.feedback.ok { color: #b9f6ca; }
.feedback.bad { color: #ffcdd2; }
.big-number { font-size: 3rem; font-weight: 900; }

/* ---------- Quiz-Editor ---------- */
.quiz-list { display: flex; flex-direction: column; gap: 8px; }
.quiz-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 10px 12px;
  flex-wrap: wrap;
}
.quiz-item .title { font-weight: 700; }
.q-edit {
  border: 2px solid #eee;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.q-edit .answer-edit { display: flex; gap: 8px; align-items: center; }
.q-edit .answer-edit .swatch { width: 14px; align-self: stretch; border-radius: 4px; flex: none; }
.q-edit .answer-edit label { display: flex; gap: 4px; align-items: center; white-space: nowrap; font-size: .9rem; }
.q-edit .answer-edit input[type=checkbox] { width: 20px; height: 20px; }
.q-edit input.time { width: 90px; }

@media (max-width: 600px) {
  .answers { grid-template-columns: 1fr; }
  .player-answers { grid-template-columns: 1fr 1fr; }
}

/* ---------- Erweiterungen: Fragetypen, Berichte, Musik ---------- */
:root {
  --a0-light: #ff8a9b;
  --a1-light: #7fb6ff;
  --a2-light: #ffd666;
  --a3-light: #8fe07a;
}
label.button {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .9rem;
  cursor: pointer;
  background: #eee;
  color: var(--text);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .15);
}
.field { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; flex: 1; min-width: 110px; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid #eee; margin-bottom: 12px; }
.tab { background: none; color: var(--muted); box-shadow: none; border-radius: 8px 8px 0 0; }
.tab.active { color: var(--accent); border-bottom: 3px solid var(--accent); }
.thumb { height: 56px; border-radius: 6px; }

.mute {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  font-size: 1.6rem;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .35);
}
.qr { background: #fff; border-radius: 12px; padding: 8px; width: 150px; height: 150px; }
.q-image { max-height: 260px; max-width: min(480px, 90vw); border-radius: 8px; background: #fff; }
.q-image.small { max-height: 160px; align-self: center; }
.badge { background: #ffd54f; color: #222; font-weight: 800; padding: 8px 14px; border-radius: 999px; }
.info-box {
  background: #fff;
  color: var(--text);
  border-radius: 12px;
  padding: 20px 28px;
  font-size: 1.4rem;
  font-weight: 600;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.word-list { display: flex; flex-wrap: wrap; gap: 8px; }
.word { background: #eee; border-radius: 999px; padding: 6px 14px; font-size: 1.1rem; }
.word.ok { background: #c8f2bd; }
.cloud {
  display: flex; flex-wrap: wrap; gap: 6px 22px; justify-content: center; align-items: center;
  max-width: 1100px; font-weight: 800; line-height: 1.1; padding: 12px;
}
.bars { display: flex; gap: 18px; align-items: flex-end; justify-content: center; min-height: 260px; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; width: clamp(80px, 18vw, 180px); }
.bar { width: 100%; border-radius: 6px 6px 0 0; transition: height .6s; }
.bar.a0 { background: var(--a0); } .bar.a1 { background: var(--a1); }
.bar.a2 { background: var(--a2); } .bar.a3 { background: var(--a3); }
.bar-num { font-size: 1.6rem; font-weight: 900; }
.bar-label { display: flex; gap: 6px; align-items: center; font-weight: 700; text-align: center; }
.bar-label .shape { width: 20px; height: 20px; }
.scale { position: relative; height: 56px; background: #eee; border-radius: 8px; margin-top: 8px; }
.scale .zone { position: absolute; top: 0; bottom: 0; min-width: 4px; background: #c8f2bd; border-radius: 4px; }
.scale .dot { position: absolute; top: 34px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--a1); opacity: .7; }
.scale .mark { position: absolute; top: -2px; margin-left: -10px; color: var(--ok); font-size: 1.4rem; }
.order-list { margin: 0; padding-left: 1.4em; font-size: 1.5rem; }

.p-body { flex: 1; width: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.p-body .card { margin-top: 12px; }
.p-body .hint { color: #ddd; text-align: center; }
.answer.selected { outline: 5px solid #fff; outline-offset: -5px; filter: brightness(1.1); }
.submit { width: 100%; max-width: 420px; font-size: 1.2rem; padding: 14px; }
.order-pick { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 520px; }
.order-pick .answer { min-height: 64px; }
.order-pick .num {
  width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .3);
  display: grid; place-items: center; font-weight: 900; flex: none;
}
input[type=range] { padding: 0; border: 0; accent-color: var(--accent); height: 36px; }

.hint-box { background: #fff4d6; border-radius: 8px; padding: 10px 14px; }
.hint-box ul { margin: 6px 0 0; padding-left: 1.2em; }
.table-wrap { overflow-x: auto; }
table.report { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.report th, table.report td { border-bottom: 1px solid #eee; padding: 6px 8px; text-align: left; vertical-align: top; }
table.report th { background: #f6f4fb; position: sticky; top: 0; }
.cell-ok, .cell-bad, .cell-none, .cell-poll { text-align: center !important; font-weight: 800; cursor: help; }
.cell-ok { background: #d9f5d0; color: var(--ok); }
.cell-bad { background: #fde0e4; color: var(--bad); }
.cell-none { color: #aaa; }
.cell-poll { color: var(--accent); }
.rate {
  display: inline-block; min-width: 70px; padding: 2px 8px; border-radius: 4px; font-weight: 700;
  background: linear-gradient(90deg, #c8f2bd var(--p), #fde0e4 var(--p));
}

@keyframes rise { from { transform: translateY(120%); opacity: 0; } to { transform: none; opacity: 1; } }
.podium .step { animation: rise .8s ease-out both; }

@keyframes blink { 50% { background: var(--bad); } }
.mute.blink { animation: blink 1.2s infinite; font-size: 1.1rem; }
