:root {
  --bg: #ffffff;
  --fg: #1a1a1f;
  --muted: #6b6b76;
  --line: #e6e6ea;
  --card: #f4f4f6;
  --accent: #5a5af0;
  --accent-fg: #ffffff;
  --q0: #5d6bf2; --q1: #f2786d; --q2: #2f2f7a; --q3: #8f8ff0; --q4: #b0272d; --q5: #f3a49c;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
}
h1 { font-weight: 400; letter-spacing: -0.02em; margin: 0; font-size: clamp(1.6rem, 4vw, 3rem); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

.topbar, .bottombar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px;
}
.logo { height: 64px; width: auto; display: block; }
.conn { width: 10px; height: 10px; border-radius: 50%; background: #c9c9cf; }
.conn.on { background: #2fb36b; }

.stage { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 8px 16px 16px; overflow-y: auto; overflow-x: hidden; }
.slide { display: none; }
.slide.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.slide-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 12px 0 28px; }
.count { color: var(--muted); font-size: .95rem; white-space: nowrap; }
.eyebrow { color: var(--muted); margin: 16px 0 0; font-size: .95rem; }

/* Slide 1 */
.join-title { text-align: center; margin: 4vh 0 5vh; }
.join-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.join-text { text-align: center; font-size: 1.2rem; }
.join-url { display: block; font-size: clamp(1.4rem, 3.4vw, 2.8rem); font-weight: 700; color: var(--fg); text-decoration: none; margin: 12px 0 24px; word-break: break-all; }
.join-qr { text-align: center; }
.join-qr img { width: min(100%, 360px); aspect-ratio: 1; image-rendering: pixelated; }

/* Slide 2 */
.vote-form { margin-bottom: 24px; }
.slider-row { margin-bottom: 22px; }
.slider-row label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 1.05rem; }
.slider-row output { font-weight: 600; min-width: 2ch; text-align: right; }
.slider-row input[type=range] { width: 100%; accent-color: var(--c); height: 28px; }

.result-row { position: relative; padding-top: 18px; margin-bottom: 18px; }
.result-row .q { position: relative; z-index: 1; font-size: clamp(1rem, 1.9vw, 1.6rem); margin-bottom: 10px; pointer-events: none; }
.dist { position: absolute; left: 0; right: 0; bottom: 6px; width: 100%; height: calc(100% - 6px); overflow: visible; }
.dist-area { fill: var(--c); opacity: .3; }
.dist-hit { fill: transparent; cursor: help; }
.dist-prev { fill: none; stroke: var(--fg); stroke-opacity: .45; stroke-width: 1.5; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.result-row .q { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.delta { font-size: .85rem; font-weight: 600; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: #1f9d5a; }
.delta.down { color: #c62f35; }
.ghost {
  position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 1;
  min-width: 30px; height: 30px; padding: 0 5px; border-radius: 15px;
  background: var(--bg); border: 2px dashed var(--c); color: var(--muted);
  font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* Vergleichs-Schalter */
.head-right { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-btn {
  font: inherit; font-size: .85rem; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
}
.compare-btn[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.compare-btn:disabled { opacity: .45; cursor: default; }
.comments.prev { border-style: dashed; border-color: var(--line); }
.comments.prev .comment { opacity: .75; }
.track { position: relative; height: 6px; background: var(--line); border-radius: 3px; }
.fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c); transition: width .6s ease; }
.bubble {
  position: absolute; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: 17px; border: 3px solid var(--bg);
  background: var(--c); color: #fff; font-size: .8rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums;
}
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; margin-top: 24px; }

/* Slide 3 */
.comment-form { margin-bottom: 20px; }
.comment-form textarea {
  width: 100%; resize: vertical; font: inherit; font-size: 1rem; padding: 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--fg);
}
.comment-form textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }
.comment-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.comments {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px;
  border: 1px solid #b9b2f0; border-radius: 12px; padding: 12px; min-height: 160px; align-content: start;
}
.comments .empty { grid-column: 1 / -1; color: var(--muted); padding: 24px; text-align: center; }
.comment { background: var(--card); border-radius: 12px; padding: 16px 18px; font-size: 1.05rem; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment.new { animation: fade .3s ease; }

/* Buttons & Footer */
.btn { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 999px; padding: 10px 24px; font: inherit; font-weight: 600; cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.bottombar { border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.bottombar b { color: var(--fg); }
.nav { display: flex; align-items: center; gap: 10px; }
.nav-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font-size: 1.6rem; line-height: 1; cursor: pointer; }
.nav-btn:disabled { opacity: .35; cursor: default; }
.dots { display: flex; gap: 6px; }
.dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 0; background: var(--line); cursor: pointer; }
.dots button.on { background: var(--accent); }
.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .95rem; }

/* Praesentationsansicht: keine Eingaben, groessere Darstellung */
body.present .vote-form, body.present .comment-form { display: none !important; }
body.present .stage { max-width: 1400px; }
.footer-join, .footer-spacer { flex: 1; }
.footer-spacer { display: block; }

/* Slide 4 */
h2 { font-weight: 500; font-size: 1.3rem; margin: 32px 0 12px; }
.round-box { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; background: var(--card); border-radius: 12px; padding: 16px 20px; }
.round-box p { margin: 4px 0 0; }
.archive-item { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.archive-item summary { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; cursor: pointer; }
.archive-item summary .link-btn { margin-left: auto; }
.archive-body { padding: 0 18px 18px; }
.archive-body .comments { margin-top: 12px; min-height: 0; }

@media (max-width: 640px) {
  .join-grid { grid-template-columns: 1fr; }
  .join-title { margin: 2vh 0 3vh; }
  .footer-join, .footer-spacer { display: none; }
  .bottombar { justify-content: center; }
}
