:root {
  --bg: #2a1446;
  --bg2: #4a1d5e;
  --card: #fffaf3;
  --ink: #2b1b33;
  --muted: #7a6a82;
  --accent: #ff4f8b;
  --gold: #ffc23d;
  --yes: #1fa971;
  --no: #e0484e;
  --o0: #ff4f8b;
  --o1: #3d8bff;
  --o2: #ffb02e;
  --o3: #19b58a;
  --o4: #9b5cff;
  --o5: #ff7a3d;
  --o6: #00a3c4;
  --o7: #d6409f;
  --radius: 18px;
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 15% 10%, rgba(255, 79, 139, .35), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(255, 194, 61, .25), transparent 40%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  background-attachment: fixed;
}

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px 40px;
}
.wrap.host { max-width: 760px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-weight: 700;
  padding: 6px 4px 12px;
}

.pill {
  background: rgba(255, 255, 255, .16);
  padding: 5px 12px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.center { text-align: center; }
.hero { padding: 28px 22px; }
.emoji { font-size: 56px; line-height: 1; margin-bottom: 8px; }

h1 { font-size: 1.7rem; margin: .2em 0 .4em; }
h2 { margin: .2em 0 .5em; }
h3 { margin: 0 0 .6em; }
.q { font-size: 1.45rem; line-height: 1.25; }
.qnum { margin: 0 0 8px; color: var(--muted); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.muted { color: var(--muted); }
.err { background: #ffe4e4; color: #a01c22; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.ok { color: var(--yes); font-weight: 700; }
.warn { color: #b26a00; font-weight: 700; }

.stack { display: grid; gap: 10px; margin-top: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

input {
  font: inherit;
  font-size: 1.15rem;
  padding: 14px 16px;
  border: 2px solid #e6d9ea;
  border-radius: 14px;
  background: #fff;
  width: 100%;
}
input:focus { outline: none; border-color: var(--accent); }

button { font: inherit; cursor: pointer; }

.btn {
  border: 0;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 4px 0 #c22d63;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #c22d63; }
.btn.big { width: 100%; margin-top: 16px; font-size: 1.2rem; padding: 18px; }
.btn.ghost { background: #efe6f2; color: var(--ink); box-shadow: 0 3px 0 #d6c6dc; }

/* answer buttons */
.opts { display: grid; gap: 10px; margin-top: 14px; }
.opt {
  border: 0;
  border-radius: 14px;
  padding: 18px 16px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  text-align: left;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .2);
}
.opt:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.opt.htmx-request, .opts.htmx-request .opt { opacity: .6; }
.o0 { background: var(--o0); } .o1 { background: var(--o1); } .o2 { background: var(--o2); }
.o3 { background: var(--o3); } .o4 { background: var(--o4); } .o5 { background: var(--o5); }
.o6 { background: var(--o6); } .o7 { background: var(--o7); }

.locked {
  margin-top: 14px;
  padding: 16px;
  border-radius: 14px;
  background: #f1e9f5;
  text-align: center;
  font-size: 1.15rem;
}

/* timer */
.timer {
  --p: 100%;
  position: relative;
  height: 34px;
  border-radius: 999px;
  background: #efe6f2;
  overflow: hidden;
  margin-bottom: 14px;
}
.timer .bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p);
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width .2s linear;
}
.timer .secs {
  position: relative;
  display: block;
  text-align: center;
  line-height: 34px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.timer.low .bar { background: var(--no); animation: pulse .5s ease-in-out infinite alternate; }
.timer.low .secs { color: #fff; }
@keyframes pulse { to { opacity: .6; } }

/* reveal */
.answer {
  display: grid;
  gap: 4px;
  text-align: center;
  background: linear-gradient(135deg, #fff1c9, #ffe0ec);
  border-radius: 14px;
  padding: 16px;
  margin: 10px 0;
}
.answer span { color: var(--muted); font-weight: 700; }
.answer b { font-size: 1.6rem; }
.verdict {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  padding: 14px;
  border-radius: 14px;
  background: #f1e9f5;
  margin-top: 10px;
}
.verdict.yes { background: #d9f6e9; color: #0e7a4f; animation: pop .4s ease-out; }
.verdict.no { background: #ffe4e4; color: #a01c22; }
.verdict.void { background: #fff1c9; color: #7a5300; }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* leaderboard */
.board { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.board li {
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f6eff8;
  font-weight: 700;
}
.board li.me { outline: 3px solid var(--accent); }
.board li:nth-child(1) { background: #ffe9a8; }
.board .rank { color: var(--muted); }
.board .pts { font-variant-numeric: tabular-nums; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0; justify-content: center; }
.chips li { background: #f1e9f5; border-radius: 999px; padding: 6px 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.host .chips { justify-content: flex-start; }

/* host */
.groups { display: grid; gap: 8px; margin: 12px 0; }
.group {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  text-align: left;
  border: 2px solid #e6d9ea;
  border-radius: 14px;
  background: #fff;
  padding: 12px 14px;
}
.group.accepted { border-color: var(--yes); background: #e5f8ef; }
.group.accepted .g-answer::after { content: " ✓"; color: var(--yes); }
.g-answer { font-weight: 800; font-size: 1.1rem; }
.g-count { font-weight: 900; font-variant-numeric: tabular-nums; }
.g-names { grid-column: 1 / -1; color: var(--muted); font-size: .9rem; }

.danger summary { cursor: pointer; font-weight: 700; color: var(--muted); }
form.inline { display: inline; margin: 0; }
.x { border: 0; background: none; color: var(--muted); font-size: 1.1rem; padding: 0 2px; line-height: 1; }

/* answer dots under the timer */
.timeline { margin-bottom: 14px; }
.timeline .timer { margin-bottom: 6px; }
.dots { position: relative; height: 26px; }
.dot {
  position: absolute;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: .8rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  border: 2px solid var(--card);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .2);
  animation: dot-in .35s ease-out;
}
.dot.jen { outline: 2px solid var(--gold); z-index: 1; }
@keyframes dot-in { from { transform: scale(0); } to { transform: scale(1); } }

.verdict.jen-wait { background: #fff1c9; color: #7a5300; margin-bottom: 10px; }

/* tap-all-that-apply */
.multi label.opt { display: flex; align-items: center; gap: 10px; cursor: pointer; opacity: .55; }
.multi label.opt input { position: absolute; opacity: 0; pointer-events: none; }
.multi label.opt::before { content: ""; width: 20px; height: 20px; border-radius: 6px; border: 3px solid #fff; flex: none; }
.multi label.opt:has(input:checked) { opacity: 1; }
.multi label.opt:has(input:checked)::before { content: "✓"; display: grid; place-items: center; background: #fff; color: var(--ink); font-size: .8rem; }
.multi .btn { margin-top: 6px; }

/* vote split */
.split-title { margin: 18px 0 8px; font-size: 1rem; }
.split { display: grid; gap: 6px; }
.split-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f1e9f5;
  overflow: hidden;
  font-weight: 700;
}
.split-row.jen { outline: 2px solid var(--gold); }
.split-bar { position: absolute; inset: 0 auto 0 0; background: rgba(255, 79, 139, .22); }
.split-row.jen .split-bar { background: rgba(255, 194, 61, .5); }
.split-label, .split-pct { position: relative; }
.split-pct { font-variant-numeric: tabular-nums; }
.group { position: relative; overflow: hidden; }
.group .split-bar { background: rgba(31, 169, 113, .12); }
.group > :not(.split-bar) { position: relative; }
.hostlink { font-weight: 600; font-size: .85rem; color: #ffd6e5; margin-left: 8px; }

/* join button: brightened forest green */
.btn.go { background: #2e9e4f; box-shadow: 0 4px 0 #1f6e36; }
.btn.go:active { box-shadow: 0 2px 0 #1f6e36; }

/* photos: a small tilted polaroid at the top of a card */
.polaroid {
  margin: 0 auto 14px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 8px 22px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(43, 27, 51, .25);
  transform: rotate(-2deg);
  animation: drop .45s ease-out;
}
.polaroid img { display: block; height: 200px; max-width: 100%; object-fit: cover; border-radius: 2px; }
.hero .polaroid { transform: rotate(2deg); }
@keyframes drop { from { transform: rotate(-8deg) translateY(-12px) scale(.9); opacity: 0; } }

/* end of game: every photo */
.mosaic { columns: 3 110px; column-gap: 8px; }
.mosaic img { width: 100%; display: block; margin-bottom: 8px; border-radius: 10px; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); break-inside: avoid; }

/* looping video of Jen: lobby and end credits */
.polaroid.video video { display: block; height: 340px; max-width: 100%; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 2px; background: #eee; }
.credits .polaroid { transform: rotate(-1.5deg); }
.credits p { margin: 0; }

/* long option lists (star signs) go two across */
.opts.many { grid-template-columns: 1fr 1fr; }
.opts.many .opt { padding: 14px 12px; font-size: 1.05rem; }

/* tribute reveal: what everyone loves about Jen */
.tribute { display: grid; gap: 8px; margin-top: 14px; }
.tribute-row { position: relative; overflow: hidden; padding: 12px 14px; border-radius: 12px; background: #fff4f8; }
.tribute-row > :not(.split-bar) { position: relative; }
.tribute-row b { font-size: 1.15rem; }
.tribute-row .muted { display: block; font-size: .9rem; }
.multi input[name=a]:not([type]) { margin-top: 4px; }

/* end page: each question with its photo, then the vote */
.recap-title { color: #fff; text-align: center; margin: 26px 0 4px; }
.recap { display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; align-items: center; }
.recap.flip { grid-template-columns: 1fr 96px; }
.recap.flip .recap-photo { grid-area: 1 / 2; transform: rotate(3deg); }
.recap.flip .recap-body { grid-area: 1 / 1; }
.recap-photo { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border: 4px solid #fff; border-bottom-width: 14px; box-shadow: 0 4px 12px rgba(0, 0, 0, .25); transform: rotate(-3deg); }
.recap-body h3 { margin: 2px 0 6px; font-size: 1.05rem; }
.recap-body .qnum { margin: 0; }
.recap-answer { margin: 0; font-weight: 800; font-size: 1.2rem; }
.recap-stat { margin: 2px 0 0; }
.recap .split { grid-column: 1 / -1; margin-top: 8px; }
.recap .split-row { padding: 6px 10px; font-size: .9rem; }
