/* ------------------------------------------------------------------
   Wedding game — romantic blush / rose / plum theme.
   Reskin by editing the CSS variables in :root — colours, fonts, radius.
   Floating hearts + soft gradients; readable contrast in light & dark.
   ------------------------------------------------------------------ */
:root {
  --bg: #fff5f7;          /* blush white */
  --bg-2: #ffe1ec;        /* soft pink */
  --ink: #3a2233;         /* deep plum ink */
  --muted: #9c7d8c;
  --accent: #d6336c;      /* vivid romantic rose */
  --accent-2: #7b5ea7;    /* lavender plum */
  --gold: #d9a441;        /* warm gold — used on DARK surfaces only */
  --card: #ffffff;
  --bride: #d6336c;
  --groom: #3b7dd8;
  --ok: #2f9e6b;
  --bad: #d64545;
  --radius: 20px;
  --shadow: 0 12px 34px rgba(150, 40, 90, 0.14);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 15% -10%, #ffd9e6 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #efe1ff 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

.wrap { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 20px 18px 48px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
h1 { font-size: 1.9rem; margin: 0.2em 0; }
h2 { font-size: 1.45rem; margin: 0.2em 0; }
.script { font-family: var(--serif); font-style: italic; color: var(--accent); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 16px 0;
  border: 1px solid rgba(214, 51, 108, 0.08);
}

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input[type="text"], input[type="number"] {
  width: 100%; padding: 14px; font-size: 1.1rem;
  border: 2px solid var(--bg-2); border-radius: 12px; background: #fff; color: var(--ink);
}
input:focus { outline: none; border-color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 15px 18px; font-size: 1.1rem; font-weight: 700;
  border: none; border-radius: 14px; cursor: pointer;
  background: linear-gradient(135deg, #e8477d, var(--accent)); color: #fff;
  box-shadow: 0 8px 18px rgba(214, 51, 108, 0.28);
  transition: transform .06s ease, filter .15s ease;
}
.btn:active { transform: translateY(1px) scale(0.997); }
.btn:disabled { filter: grayscale(0.4) opacity(0.6); cursor: not-allowed; box-shadow: none; }
.btn.secondary { background: linear-gradient(135deg, #8f72c4, var(--accent-2)); }
.btn.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); box-shadow: none; }
.btn.danger { background: transparent; color: #b23a48; border: 2px solid rgba(178, 58, 72, 0.5); box-shadow: none; }
.btn.danger:hover { border-color: #b23a48; background: rgba(178, 58, 72, 0.06); }

.lang-row { display: flex; gap: 8px; }
.lang-row .chip {
  flex: 1; padding: 12px; text-align: center; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--bg-2); background: #fff; font-weight: 600;
}
.lang-row .chip.active { border-color: var(--accent); background: #ffe1ec; color: var(--accent); }

/* answer options */
.options { display: grid; gap: 12px; margin-top: 8px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 16px; font-size: 1.1rem; font-weight: 600; cursor: pointer;
  border: 2px solid var(--bg-2); border-radius: 14px; background: #fff; color: var(--ink);
}
.opt:active { transform: translateY(1px); }
.opt.selected { border-color: var(--accent); background: #ffe1ec; }
.opt.correct { border-color: var(--ok); background: #e6f7ee; }
.opt.wrong { border-color: var(--bad); background: #fdeceb; }
.opt .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color:#fff;
  display:inline-flex; align-items:center; justify-content:center; font-size: .8rem; flex: 0 0 auto; }

.versus { grid-template-columns: 1fr 1fr; }
.versus .opt { flex-direction: column; text-align: center; padding: 22px 12px; }
.versus .opt[data-id="bride"] { border-color: color-mix(in srgb, var(--bride) 45%, #fff); }
.versus .opt[data-id="groom"] { border-color: color-mix(in srgb, var(--groom) 45%, #fff); }

/* progress + status */
.pill { display:inline-block; padding: 5px 12px; border-radius: 999px; background: #ffe1ec;
  color: var(--accent); font-weight: 700; font-size: .85rem; }
.status { margin-top: 14px; font-weight: 600; color: var(--muted); }
.status.sent { color: var(--ok); }

/* bars (results) */
.bars { display: grid; gap: 10px; margin-top: 10px; }
.bar-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.bar-label { display:flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-weight: 600; }
.bar-count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ok-check { color: var(--ok); font-weight: 800; }
.bar-track { height: 16px; background: rgba(0,0,0,0.08); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width .5s ease; }
.bar-fill.bride { background: var(--bride); }
.bar-fill.groom { background: var(--groom); }
.bar-fill.correct { background: var(--ok); }

/* ---- BIG correct-answer treatment (replaces the tiny green ✓) ---- */
.correct-banner {
  display: flex; align-items: center; gap: 14px; margin: 6px 0 16px;
  padding: 16px 20px; border-radius: 16px;
  background: linear-gradient(135deg, #2f9e6b, #1f7d52); color: #fff;
  box-shadow: 0 10px 26px rgba(47,158,107,0.35);
  animation: pop .4s ease;
}
.correct-banner .cb-check {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.22); display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 900;
}
.correct-banner .cb-text { display: flex; flex-direction: column; line-height: 1.15; }
.correct-banner .cb-kicker { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .9; font-weight: 700; }
.correct-banner .cb-answer { font-size: 1.5rem; font-weight: 800; font-family: var(--serif); }
body.host .correct-banner .cb-answer { font-size: 2.1rem; }
body.host .correct-banner .cb-check { width: 58px; height: 58px; font-size: 2.1rem; }

.bar-row.correct-row { background: rgba(47,158,107,0.12); border: 2px solid var(--ok);
  border-radius: 14px; padding: 8px 12px; margin: 2px 0; }
body.host .bar-row.correct-row { background: rgba(47,158,107,0.20); }
.row-check { display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #fff;
  font-weight: 900; font-size: .85rem; vertical-align: middle; }

.result-chip { margin-top: 16px; padding: 14px 16px; border-radius: 14px; font-weight: 800;
  font-size: 1.15rem; text-align: center; animation: pop .35s ease; }
.result-chip.win { background: #e6f7ee; color: #1f7d52; border: 2px solid var(--ok); }
.result-chip.miss { background: #f4eef2; color: var(--muted); border: 2px solid var(--bg-2); }

/* confetti overlay (host + guest celebrations) */
.confetti-canvas { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

/* leaderboard — high contrast: dark names + rose scores on white rows */
.lb { list-style: none; padding: 0; margin: 12px 0 0; }
.lb li { display:flex; align-items:center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff;
  margin-bottom: 8px; box-shadow: 0 4px 14px rgba(150, 40, 90, 0.12); }
.lb .rank { width: 30px; height: 30px; border-radius: 50%; background: #ffe1ec; color: var(--accent);
  display:inline-flex; align-items:center; justify-content:center; font-weight: 800; flex: 0 0 auto; }
.lb li:nth-child(1) .rank { background: var(--gold); color:#4a3410; }
.lb .lb-name { flex: 1; font-weight: 700; color: var(--ink); }
.lb .lb-score { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--accent); }
.lb .off { opacity: .5; }

/* winner (guest, light bg) — rose, never gold-on-white */
.trophy { font-size: 3rem; animation: pop .5s ease; }
.winner-name { color: var(--accent); font-size: 2.2rem; margin: 6px 0; animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------------- language blocks (host shared screen) ---------------- */
.tri { display: grid; gap: 6px; }
.tri-line { display: flex; align-items: baseline; gap: 12px; justify-content: center; }
.tri-line .flag { font-size: 0.9em; flex: 0 0 auto; opacity: .9; }
.tri-line .tri-text { }
/* lead block: big German headline, smaller EN/FR beneath */
.tri-lead .tri-line:first-child .tri-text { font-size: 2.4rem; font-weight: 700; font-family: var(--serif); }
.tri-lead .tri-line:not(:first-child) .tri-text { font-size: 1.35rem; color: #cdbcd6; }
.q-head, .slide-body { margin-top: 10px; }
.slide-body .tri-text { font-size: 1.5rem; }

/* compact stacked variant (option cards, bar labels) */
.tri-mini { display: flex; flex-direction: column; gap: 3px; }
.tri-mini-line { display: flex; align-items: baseline; gap: 8px; line-height: 1.25; }
.tri-mini .tag { font-size: .62rem; font-weight: 800; letter-spacing: .05em; opacity: .55;
  min-width: 1.7em; padding-top: 1px; }

/* ---------------- HOST big-screen ---------------- */
body.host {
  background:
    radial-gradient(1000px 600px at 20% -10%, #3a2140 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 0%, #2a2350 0%, transparent 55%),
    linear-gradient(180deg, #1e1526 0%, #140f1e 100%);
  background-attachment: fixed;
  color: #f7eef5;
}
body.host .wrap { max-width: 1100px; padding: 32px; }
body.host .card { background: rgba(255,255,255,0.06); box-shadow: none; border: 1px solid rgba(255,255,255,0.10); }
body.host h1 { font-size: 3rem; }
body.host h2 { font-size: 2.2rem; }
body.host .muted { color: #cdbcd6; }
body.host .pill { background: rgba(214, 51, 108, 0.22); color: #ffc2d6; }
body.host .opt { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); color: #f7eef5; }
body.host .bar-track { background: rgba(255,255,255,0.14); }
body.host .tri-mini .tag { color: #ffc2d6; opacity: .8; }
.host-grid { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; }
.qr-card { text-align: center; }
.qr-card img { width: 260px; height: 260px; background:#fff; border-radius: 16px; padding: 10px; }
.join-url { font-size: 1.1rem; font-weight: 700; color: var(--gold); word-break: break-all; margin-top: 10px; }
.edit-link { display: inline-block; margin-top: 14px; color: #cdbcd6; text-decoration: none; font-size: .85rem;
  border: 1px solid rgba(255,255,255,0.18); padding: 6px 12px; border-radius: 999px; }
.edit-link:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.host-controls { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px;
  background: rgba(20,15,28,0.88); padding: 14px; border-radius: 16px; }
.host-controls .btn { width: auto; flex: 1 1 auto; min-width: 120px; }
/* Reset stays small + de-emphasized: it never grows to fill the row like the pacing buttons. */
.host-controls .btn.reset-btn { flex: 0 0 auto; min-width: 0; padding: 9px 14px; font-size: 0.85rem; opacity: 0.8; }
.host-controls .btn.reset-btn:hover { opacity: 1; }
.big-count { font-size: 4rem; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.guest-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.guest-chips .g { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.12); font-weight: 600; }
.guest-chips .g.couple { background: color-mix(in srgb, var(--accent) 60%, #000); }
.guest-chips .g.off { opacity: .45; }
.host .bar-track { height: 26px; }
/* host leaderboard rows stay readable on the dark stage */
body.host .lb li { background: rgba(255,255,255,0.08); box-shadow: none; }
body.host .lb .lb-name { color: #f7eef5; }
body.host .lb .lb-score { color: #ffc2d6; }
body.host .lb .rank { background: rgba(255,255,255,0.14); color: #ffc2d6; }
body.host .lb li:nth-child(1) .rank { background: var(--gold); color: #4a3410; }
.winner-big { font-size: 2.8rem; color: var(--gold); font-family: var(--serif); }

.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  background: var(--ink); color:#fff; padding: 10px 18px; border-radius: 999px; font-weight: 600;
  opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 50; }
.toast.show { opacity: .95; }

.fade-in { animation: fade .4s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform:none; } }

/* ---------------- floating hearts background ---------------- */
.hearts { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.hearts span {
  position: absolute; bottom: -8vh; font-size: 26px; line-height: 1;
  opacity: 0; will-change: transform, opacity;
  animation: floatUp linear infinite;
  filter: drop-shadow(0 3px 6px rgba(214,51,108,0.25));
}
body.host .hearts span { filter: drop-shadow(0 3px 8px rgba(0,0,0,0.5)); }
/* Hearts rise ONLY along the left & right margins — never across the content. */
.hearts span:nth-child(1)  { left: 2%;  font-size: 22px; animation-duration: 15s; animation-delay: 0s; }
.hearts span:nth-child(2)  { left: 5%;  font-size: 28px; animation-duration: 19s; animation-delay: 4s; }
.hearts span:nth-child(3)  { left: 8%;  font-size: 18px; animation-duration: 13s; animation-delay: 8s; }
.hearts span:nth-child(4)  { left: 4%;  font-size: 24px; animation-duration: 21s; animation-delay: 2s; }
.hearts span:nth-child(5)  { left: 1%;  font-size: 20px; animation-duration: 17s; animation-delay: 10s; }
.hearts span:nth-child(6)  { left: 97%; font-size: 26px; animation-duration: 18s; animation-delay: 3s; }
.hearts span:nth-child(7)  { left: 93%; font-size: 20px; animation-duration: 14s; animation-delay: 7s; }
.hearts span:nth-child(8)  { left: 95%; font-size: 30px; animation-duration: 20s; animation-delay: 1s; }
.hearts span:nth-child(9)  { left: 99%; font-size: 18px; animation-duration: 16s; animation-delay: 9s; }
.hearts span:nth-child(10) { left: 91%; font-size: 24px; animation-duration: 22s; animation-delay: 5s; }
@keyframes floatUp {
  0%   { transform: translateY(0) rotate(0deg) scale(.9); opacity: 0; }
  12%  { opacity: .45; }
  50%  { transform: translateY(-55vh) rotate(16deg) scale(1.02); opacity: .5; }
  88%  { opacity: .3; }
  100% { transform: translateY(-112vh) rotate(-12deg) scale(1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hearts span { animation: none; opacity: .25; }
}
