:root {
  --bg: #fbf6f2;
  --card: #ffffff;
  --ink: #3d2b3a;
  --muted: #8a7686;
  --line: #eadfdc;
  --rose: #d9898f;
  --rose-soft: #f6e1e1;
  --rose-deep: #b8646c;
  --sage: #7fa392;
  --sage-soft: #e1ece5;
  --sage-deep: #5c8473;
  --gold: #d8b26e;
  --good: #5c8473;
  --bad: #b8646c;
  --radius: 22px;
  --shadow: 0 6px 24px rgba(61, 43, 58, 0.08);
  font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 10% -10%, var(--rose-soft) 0, transparent 45%),
    radial-gradient(circle at 110% 110%, var(--sage-soft) 0, transparent 45%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
button, input { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Handy-Layout ---------- */
.mobile {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
  min-height: 100dvh;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  min-height: 40px;
}
.topbar .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 700;
  white-space: nowrap;
}
.brand {
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: var(--rose-deep);
  font-weight: 800;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.title-big { font-size: clamp(1.8rem, 8vw, 2.4rem); font-weight: 800; }
.question {
  font-size: clamp(1.4rem, 6.4vw, 1.9rem);
  font-weight: 800;
  line-height: 1.25;
}
.qnum { color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 0.98rem; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grow { flex: 1; }

.field {
  width: 100%;
  font-size: 1.35rem;
  padding: 16px 18px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: #fff;
  outline: none;
}
.field:focus { border-color: var(--rose); }

.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 18px;
  padding: 18px 20px;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  background: var(--ink);
  color: #fff;
  transition: transform 0.08s ease, opacity 0.2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.secondary { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.btn.danger { background: #fff; color: var(--bad); border: 2px solid #efcfd2; }
.btn.small { padding: 10px 14px; font-size: 1rem; border-radius: 12px; width: auto; }

.error { color: var(--bad); font-weight: 700; min-height: 1.4em; }

/* Antwort-Buttons */
.answers { display: grid; grid-template-columns: 1fr; gap: 14px; }
.answer {
  border: 3px solid transparent;
  border-radius: 24px;
  padding: 30px 20px;
  font-size: 2rem;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  transition: transform 0.08s ease, box-shadow 0.2s, border-color 0.2s, opacity 0.2s;
  touch-action: manipulation;
  min-height: 120px;
}
.answer:active { transform: scale(0.98); }
.answer.a0 { background: var(--rose-soft); color: var(--rose-deep); }
.answer.a1 { background: var(--sage-soft); color: var(--sage-deep); }
.answer.selected.a0 { background: var(--rose); color: #fff; border-color: var(--rose-deep); box-shadow: 0 8px 24px rgba(184, 100, 108, 0.35); }
.answer.selected.a1 { background: var(--sage); color: #fff; border-color: var(--sage-deep); box-shadow: 0 8px 24px rgba(92, 132, 115, 0.35); }
.answers.has-choice .answer:not(.selected) { opacity: 0.55; }
.answer .check {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 1.2rem;
  opacity: 0;
}
.answer.selected .check { opacity: 1; }

.big-emoji { font-size: 3.6rem; line-height: 1; }
.result-card { text-align: center; padding: 32px 22px; }
.result-card.good { background: var(--sage-soft); }
.result-card.bad { background: var(--rose-soft); }
.result-card.neutral { background: #fff; }
.result-card h2 { font-size: 1.7rem; margin: 12px 0 6px; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #cbbcc6; margin-right: 6px; }
.status-dot.on { background: var(--sage); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--line);
}
.list li:last-child { border-bottom: none; }
.list .rank { width: 2.2em; font-weight: 800; color: var(--muted); }
.list .name { flex: 1; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .pts { font-weight: 800; }
.list li.me { background: var(--rose-soft); border-radius: 10px; padding-left: 8px; padding-right: 8px; }

.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.role-pick .answer { padding: 24px 10px; font-size: 1.6rem; min-height: 0; }

.conn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--ink);
  color: #fff;
  text-align: center;
  padding: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  z-index: 50;
  transform: translateY(-100%);
  transition: transform 0.3s;
}
.conn-banner.show { transform: none; }

/* ---------- Admin ---------- */
.admin-phase {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-phase span {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
}
.admin-phase span.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: 16px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; }
.stat small { color: var(--muted); font-weight: 700; }
.warn { background: #fff4e0; color: #8a5a12; border-radius: 14px; padding: 12px 14px; font-weight: 700; }
.btn.primary-xl { padding: 26px 20px; font-size: 1.5rem; background: var(--rose-deep); }
.section-title { font-size: 1.1rem; font-weight: 800; margin: 6px 0 -4px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

/* ---------- Screen (TV/Beamer) ---------- */
.screen {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 3.2vh 4vw;
  gap: 2.5vh;
  font-size: 2vw;
  cursor: none;
}
.screen-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: var(--muted);
  font-size: 1.6vw;
  min-height: 4vh;
}
.screen-head .brand { font-size: 1.8vw; }
.screen-main { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.lobby { flex: 1; display: grid; grid-template-columns: 34vw 1fr; gap: 4vw; align-items: center; min-height: 0; }
.lobby .qr {
  background: #fff;
  border-radius: 2vw;
  padding: 1.6vw;
  box-shadow: var(--shadow);
  text-align: center;
}
.lobby .qr img { width: 100%; display: block; }
.lobby .qr .url { font-size: 1.7vw; font-weight: 800; margin-top: 1vw; word-break: break-all; }
.lobby h1 { font-size: 5.6vw; font-weight: 900; letter-spacing: -0.01em; }
.lobby h1 .m { color: var(--rose-deep); }
.lobby h1 .p { color: var(--sage-deep); }
.lobby .sub { font-size: 2.2vw; color: var(--muted); font-weight: 700; margin: 1vh 0 3vh; }
.chips { display: flex; flex-wrap: wrap; gap: 0.8vw; align-content: flex-start; max-height: 46vh; overflow: hidden; }
.chip {
  background: #fff;
  border-radius: 999px;
  padding: 0.6vw 1.4vw;
  font-size: 1.8vw;
  font-weight: 800;
  box-shadow: var(--shadow);
  animation: pop 0.4s ease;
}
.lobby .count { font-size: 2vw; font-weight: 800; margin-bottom: 1.5vh; }

.q-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 5vh; }
.q-text { font-size: 4.6vw; font-weight: 900; line-height: 1.15; text-align: center; padding: 0 2vw; }
.q-text.small { font-size: 2.8vw; }
.progress { width: 70%; margin: 0 auto; }
.progress .bar { height: 2.4vh; background: #fff; border-radius: 999px; overflow: hidden; box-shadow: var(--shadow); }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--rose), var(--gold)); width: 0; transition: width 0.4s ease; border-radius: 999px; }
.progress .label { text-align: center; font-size: 3vw; font-weight: 900; margin-top: 2vh; }
.couple-status { display: flex; justify-content: center; gap: 3vw; }
.couple-status .cs {
  display: flex; align-items: center; gap: 1vw;
  padding: 1.2vw 2.4vw; border-radius: 999px; background: #fff; box-shadow: var(--shadow);
  font-size: 2.2vw; font-weight: 800; color: var(--muted);
  transition: background 0.3s, color 0.3s;
}
.couple-status .cs.done.mama { background: var(--rose); color: #fff; }
.couple-status .cs.done.papa { background: var(--sage); color: #fff; }

.reveal { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5vh; }
.reveal-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 4vw; width: 80%; }
.flip { perspective: 1400px; height: 34vh; }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform 0.9s cubic-bezier(0.3, 1.4, 0.5, 1);
  transform-style: preserve-3d;
}
.flip.open .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; border-radius: 2.4vw; display: flex; flex-direction: column;
  align-items: center; justify-content: center; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: var(--shadow); gap: 1vh;
}
.flip-face .who { font-size: 2.4vw; font-weight: 800; opacity: 0.85; }
.flip-face .ans { font-size: 6vw; font-weight: 900; }
.flip-front { background: #fff; color: var(--muted); }
.flip-front .ans { font-size: 6vw; }
.flip-back { transform: rotateY(180deg); color: #fff; }
.flip-back.a0 { background: var(--rose); }
.flip-back.a1 { background: var(--sage); }
.flip-back.none { background: #cbbcc6; }
.verdict {
  font-size: 7vw; font-weight: 900; opacity: 0; transform: scale(0.6);
  transition: opacity 0.4s, transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.verdict.show { opacity: 1; transform: none; }
.verdict.agree { color: var(--sage-deep); }
.verdict.disagree { color: var(--rose-deep); }
.verdict-sub { font-size: 2.2vw; color: var(--muted); font-weight: 700; text-align: center; margin-top: -3vh; opacity: 0; transition: opacity 0.4s 0.3s; }
.verdict-sub.show { opacity: 1; }

.bars { width: 80%; margin: 0 auto; display: flex; flex-direction: column; gap: 4vh; }
.bar-row { display: grid; grid-template-columns: 14vw 1fr 16vw; align-items: center; gap: 2vw; }
.bar-row .lbl { font-size: 3.4vw; font-weight: 900; text-align: right; }
.bar-row .track { height: 10vh; background: #fff; border-radius: 2vw; overflow: hidden; box-shadow: var(--shadow); }
.bar-row .fill { height: 100%; width: 0; border-radius: 2vw; transition: width 1.4s cubic-bezier(0.2, 0.9, 0.3, 1); }
.bar-row.a0 .fill { background: var(--rose); }
.bar-row.a1 .fill { background: var(--sage); }
.bar-row.a0 .lbl { color: var(--rose-deep); }
.bar-row.a1 .lbl { color: var(--sage-deep); }
.bar-row .val { font-size: 3.2vw; font-weight: 900; }
.bar-row .val small { display: block; font-size: 1.6vw; color: var(--muted); font-weight: 800; }
.bar-row.correct .track { outline: 0.5vw solid var(--gold); outline-offset: 0.4vw; }
.couple-mini { text-align: center; font-size: 2.2vw; font-weight: 800; color: var(--muted); }

.top5 { width: 70%; margin: 0 auto; display: flex; flex-direction: column; gap: 1.6vh; }
.top5 .row5 {
  display: grid; grid-template-columns: 6vw 1fr auto; align-items: center;
  background: #fff; border-radius: 1.6vw; padding: 1.6vh 2vw; box-shadow: var(--shadow);
  font-size: 3vw; font-weight: 900;
  animation: slideIn 0.5s ease both;
}
.top5 .row5 .r { color: var(--muted); }
.top5 .row5:nth-child(1) .r { color: var(--gold); }
.top5 .row5 .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top5 .row5 .s { color: var(--rose-deep); }
.screen-title { font-size: 4vw; font-weight: 900; text-align: center; }
.screen-sub { font-size: 2.2vw; font-weight: 700; color: var(--muted); text-align: center; }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 2vw; height: 46vh; margin-top: 2vh; }
.podium .place { width: 20vw; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.podium .names { font-size: 2.4vw; font-weight: 900; text-align: center; margin-bottom: 1vh; line-height: 1.15; max-height: 50%; overflow: hidden; }
.podium .pts { font-size: 1.8vw; color: var(--muted); font-weight: 800; margin-bottom: 1vh; }
.podium .block {
  width: 100%; border-radius: 1.6vw 1.6vw 0 0; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 1.5vh; font-size: 5vw; font-weight: 900; color: #fff;
  animation: rise 1s cubic-bezier(0.2, 0.9, 0.3, 1) both;
  transform-origin: bottom;
}
.podium .p1 .block { height: 55%; background: var(--gold); animation-delay: 1.2s; }
.podium .p2 .block { height: 40%; background: var(--rose); animation-delay: 0.6s; }
.podium .p3 .block { height: 28%; background: var(--sage); animation-delay: 0s; }
.podium .place .names, .podium .place .pts { animation: fadeIn 0.6s both; }
.podium .p1 .names, .podium .p1 .pts { animation-delay: 1.9s; }
.podium .p2 .names, .podium .p2 .pts { animation-delay: 1.3s; }
.podium .p3 .names, .podium .p3 .pts { animation-delay: 0.7s; }
.rest { columns: 3; column-gap: 3vw; font-size: 1.7vw; font-weight: 700; width: 85%; margin: 3vh auto 0; animation: fadeIn 0.8s 2.6s both; }
.rest div { break-inside: avoid; padding: 0.3vh 0; display: flex; gap: 1vw; }
.rest .r { color: var(--muted); width: 3vw; }
.rest .s { margin-left: auto; color: var(--muted); }

.corner-qr { position: fixed; right: 2vw; bottom: 2vh; background: #fff; padding: 0.6vw; border-radius: 1vw; box-shadow: var(--shadow); text-align: center; }
.corner-qr img { width: 8vw; display: block; }
.corner-qr small { font-size: 0.9vw; font-weight: 800; color: var(--muted); }

@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-4vw); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
