/* Klangfeld Menti — gemeinsames Design */
:root {
  --bg: #0f1020;
  --bg-soft: #1a1b35;
  --card: #21223f;
  --card-2: #2a2b4d;
  --line: #34355c;
  --text: #f2f2fa;
  --muted: #a6a7c9;
  --accent: #7c5cff;
  --accent-2: #ff7ac6;
  --accent-3: #36d6c3;
  --good: #46d17f;
  --bad: #ff5d6c;
  --warn: #ffce5c;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --grad: linear-gradient(135deg, #7c5cff 0%, #ff7ac6 100%);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 700px at 80% -10%, #2a1d4f 0%, transparent 60%),
              radial-gradient(900px 600px at -10% 110%, #14304a 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 960px; margin: 0 auto; padding: 24px; }
.wrap-narrow { max-width: 520px; margin: 0 auto; padding: 24px; }

/* Header / Logo */
.brand {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; letter-spacing: -0.02em; font-size: 20px;
}
.brand .dot {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad);
  box-shadow: 0 6px 18px rgba(124, 92, 255, 0.45);
  display: grid; place-items: center; color: #fff; font-size: 16px;
}
.brand small { color: var(--muted); font-weight: 600; font-size: 12px; }

/* Karten */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

/* Buttons */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font-family: var(--font); font-weight: 700; font-size: 15px;
  padding: 12px 18px; border-radius: 12px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line);
  transition: transform 0.06s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 10px 26px rgba(124, 92, 255, 0.4); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
.btn.small { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* Inputs */
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font-family: var(--font); font-size: 15px;
  padding: 12px 14px; border-radius: 12px;
  background: var(--bg-soft); color: var(--text);
  border: 1px solid var(--line); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
textarea { resize: vertical; min-height: 70px; }

.muted { color: var(--muted); }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.tag {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: 7px; background: rgba(124,92,255,0.18); color: #c9bcff;
}

/* Balken-Ergebnisse */
.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-item .bar-label { display: flex; justify-content: space-between; margin-bottom: 6px; font-weight: 600; }
.bar-track { height: 36px; background: var(--bg-soft); border-radius: 10px; overflow: hidden; position: relative; }
.bar-fill {
  height: 100%; width: 0;
  background: var(--grad);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(.2,.8,.2,1);
}
.bar-fill.correct { background: linear-gradient(135deg, #46d17f, #36d6c3); }
.bar-fill.wrong { background: linear-gradient(135deg, #5b5c80, #3a3b5c); }
.bar-pct { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-weight: 800; }

/* Word cloud */
.cloud { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: center; padding: 10px; }
.cloud span { font-weight: 800; line-height: 1; transition: all 0.4s ease; }

/* Q&A Kacheln */
.qa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.qa-card {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font-size: 16px; line-height: 1.4;
  animation: pop 0.35s ease;
}
@keyframes pop { from { transform: scale(0.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Skala */
.scale-row { display: flex; gap: 10px; flex-wrap: wrap; }
.scale-btn {
  flex: 1; min-width: 54px; padding: 18px 0; font-size: 22px; font-weight: 800;
  border-radius: 14px; border: 1px solid var(--line); background: var(--card-2);
  color: var(--text); cursor: pointer; transition: all 0.12s ease;
}
.scale-btn:hover { border-color: var(--accent); }
.scale-btn.selected { background: var(--grad); border: 0; }

/* Choice-Optionen (Teilnehmer) */
.options { display: flex; flex-direction: column; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-radius: 14px; cursor: pointer;
  background: var(--card-2); border: 2px solid var(--line);
  font-size: 17px; font-weight: 600; transition: all 0.12s ease;
}
.opt:hover { border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: rgba(124,92,255,0.18); }
.opt .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--muted); flex: 0 0 auto; }
.opt.selected .dot { background: var(--accent); border-color: var(--accent); }

.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow);
  font-weight: 600; z-index: 99; opacity: 0; transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.hidden { display: none !important; }
.fadein { animation: fade 0.4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* Folien-Vorschau (Admin) */
.slide-thumb {
  background: #0b0b16; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: grid; place-items: center; min-height: 90px;
}
.slide-thumb img { display: block; max-width: 100%; max-height: 320px; object-fit: contain; }

/* Upload-Overlay + Spinner */
#overlay {
  position: fixed; inset: 0; background: rgba(8,8,18,0.82); z-index: 200;
  display: none; align-items: center; justify-content: center; backdrop-filter: blur(3px);
}
.ov-box {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 28px 34px; text-align: center; box-shadow: var(--shadow); max-width: 420px;
}
.spinner {
  width: 42px; height: 42px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Folien-Vollbild (Teilnehmer & Leinwand) */
.slide-full { width: 100%; display: grid; place-items: center; }
.slide-full img { display: block; max-width: 100%; max-height: 78vh; object-fit: contain; border-radius: 12px; box-shadow: var(--shadow); }
.slide-caption { text-align: center; margin-top: 14px; font-weight: 600; }
