:root {
  --bg: #fbf7f2;
  --card: #ffffff;
  --text: #2a1f1a;
  --muted: #7a6a60;
  --line: #eadfd4;
  --accent: #d9480f;
  --accent-soft: #fff0e6;
  --yes: #2f9e44;
  --no: #adb5bd;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1411;
    --card: #241c18;
    --text: #f3ebe4;
    --muted: #b3a296;
    --line: #3a2e28;
    --accent: #ff7a3d;
    --accent-soft: #3a2418;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
main { max-width: 520px; margin: 0 auto; padding: 16px 16px 48px; }

.hero {
  --heat: .7;
  position: relative; overflow: hidden;
  text-align: center; color: #fff4e8;
  margin: 0 -4px; padding: 8px 16px 20px;
  border-radius: 22px;
  background:
    radial-gradient(120% 70% at 50% 62%, #5a1e0c 0%, transparent 70%),
    linear-gradient(180deg, #0f0b1e 0%, #1c1020 45%, #2a120c 100%);
  box-shadow: 0 14px 40px -18px rgba(217, 72, 15, .7);
}
.hero h1 {
  margin: 0 0 2px; font-size: 34px; font-weight: 900; letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff3bf, #ffa94d 60%, #ff6b1a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(255, 120, 30, .45));
}
.hero .meta { color: #f1c9a8; margin: 0; }
.hero .meta strong { color: #fff; }
.countdown {
  display: inline-block; margin: 12px 0 0; padding: 6px 14px;
  border-radius: 999px; background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 170, 90, .35);
  font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px;
}
.heat { margin: 10px 0 0; font-size: 14px; color: #f1c9a8; }
.heat b { color: #ffd43b; }

/* ---------- animated grill ---------- */
.grill { display: block; width: 100%; max-width: 360px; margin: 0 auto -4px; overflow: visible; }
.grill * { transform-box: fill-box; }

.fire {
  transform-origin: 50% 100%;
  transform: scale(calc(.75 + var(--heat) * .35), var(--heat));
  transition: transform 1s cubic-bezier(.3, 1.6, .5, 1);
}
.hero.flare .fire { transform: scale(1.25, 1.55); transition-duration: .35s; }
.flame {
  transform-origin: 50% 100%;
  animation: flicker var(--t, 1s) ease-in-out var(--d, 0s) infinite alternate;
}
@keyframes flicker {
  0%   { transform: scale(1, 1) skewX(0); }
  25%  { transform: scale(.9, 1.1) skewX(4deg); }
  50%  { transform: scale(1.06, .9) skewX(-3deg); }
  75%  { transform: scale(.94, 1.14) skewX(2deg); }
  100% { transform: scale(1.02, .96) skewX(-1deg); }
}

.ember-glow { animation: coal 2.4s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes coal { from { opacity: .35; } to { opacity: 1; } }

.glow { transform-origin: 50% 50%; animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .55; transform: scale(.95); } to { opacity: 1; transform: scale(1.05); } }

.embers circle {
  opacity: 0;
  animation: rise var(--t, 3s) ease-out var(--d, 0s) infinite;
}
@keyframes rise {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 0), -120px); }
}

.smoke circle { transform-origin: 50% 50%; opacity: 0; animation: smoke 5s ease-out var(--d, 0s) infinite; }
@keyframes smoke {
  0%   { opacity: 0; transform: translate(0, 20px) scale(.5); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translate(12px, -70px) scale(1.8); }
}

.sizzle { animation: sizzle .5s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes sizzle { from { transform: translateY(0); } to { transform: translateY(-1px); } }

.stars circle { animation: twinkle 2.8s ease-in-out var(--d, 0s) infinite alternate; }
@keyframes twinkle { from { opacity: .15; } to { opacity: .9; } }

/* emoji burst after answering */
.burst {
  position: fixed; z-index: 50; pointer-events: none;
  width: 30px; height: 30px; display: grid; place-items: center;
  font-size: 26px; line-height: 1; will-change: transform, opacity;
}
.burst .ico { width: 30px; height: 30px; }

/* ---------- SVG icons ---------- */
.ico { width: 44px; height: 44px; display: block; overflow: visible; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .18)); }
.ico [class] { transform-box: fill-box; transform-origin: center; }
.ico.sm { width: 20px; height: 20px; display: inline-block; vertical-align: -5px; filter: none; }
.ico.xl { width: 84px; height: 84px; }
.lbl { display: inline-flex; align-items: center; gap: 4px; margin: 0 4px; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 5px; }
ul.people .food { display: inline-flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
ul.people .food .lbl { margin: 0 4px 0 0; }

/* hover wiggle + a signature animation per icon while selected */
.choice:hover .ico { transform: rotate(-6deg) scale(1.06); transition: transform .2s; }
.choice input:checked + span .ico { transform: scale(1.12); }

.choice input:checked + span .i-yes .flame-g,
.done .i-yes .flame-g { transform-origin: 50% 100%; animation: ico-flicker .5s ease-in-out infinite alternate; }
@keyframes ico-flicker { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(.94, 1.08) skewX(3deg); } }

.i-no .drop { opacity: 0; }
.choice input:checked + span .i-no .drop,
.done .i-no .drop { animation: ico-rain 1s ease-in infinite; }
.i-no .drop:nth-child(2) { animation-delay: .33s !important; }
.i-no .drop:nth-child(3) { animation-delay: .66s !important; }
@keyframes ico-rain { 0% { opacity: 0; transform: translateY(-6px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(8px); } }

.choice input:checked + span .i-pork .ear-l { transform-origin: 100% 100%; animation: ico-ear .35s ease-in-out infinite alternate; }
.choice input:checked + span .i-pork .ear-r { transform-origin: 0 100%; animation: ico-ear .35s ease-in-out infinite alternate-reverse; }
.choice input:checked + span .i-pork .snout { animation: ico-sniff .6s ease-in-out infinite; }
@keyframes ico-ear { from { transform: rotate(-12deg); } to { transform: rotate(12deg); } }
@keyframes ico-sniff { 0%, 60%, 100% { transform: scale(1); } 30% { transform: scale(1.12, .9); } }

.choice input:checked + span .i-chicken .drum { animation: ico-wobble .8s ease-in-out infinite; }
@keyframes ico-wobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

.choice input:checked + span .i-vegan .leaf-l { transform-origin: 100% 100%; animation: ico-sway 1.2s ease-in-out infinite alternate; }
.choice input:checked + span .i-vegan .leaf-r { transform-origin: 0 100%; animation: ico-sway 1.2s ease-in-out infinite alternate-reverse; }
@keyframes ico-sway { from { transform: rotate(-10deg); } to { transform: rotate(8deg); } }

.choice input:checked + span .i-veggie-skewers .skewer { animation: ico-turn 1.4s ease-in-out infinite; }
@keyframes ico-turn { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-14deg) scale(1.04); } }

.choice input:checked + span .i-vegan-burger .bun-top { animation: ico-bun .6s cubic-bezier(.3, 1.6, .5, 1) infinite alternate; }
@keyframes ico-bun { from { transform: translateY(0); } to { transform: translateY(-5px) rotate(-4deg); } }

.i-mushrooms .steam { opacity: 0; }
.choice input:checked + span .i-mushrooms .steam { animation: ico-steam 1.6s ease-out infinite; }
@keyframes ico-steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-6px); } }

.choice input:checked + span .i-beer .bubble { animation: ico-bubble 1.2s ease-in infinite; }
.i-beer .bubble:nth-child(2) { animation-delay: .4s !important; }
.i-beer .bubble:nth-child(3) { animation-delay: .8s !important; }
.choice input:checked + span .i-beer .foam { transform-origin: 50% 100%; animation: ico-foam .9s ease-in-out infinite alternate; }
@keyframes ico-bubble { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px); } }
@keyframes ico-foam { from { transform: scale(1); } to { transform: scale(1.06, 1.14); } }

.choice input:checked + span .i-tsipouro .shot { transform-origin: 50% 100%; animation: ico-clink 1s ease-in-out infinite; }
@keyframes ico-clink { 0%, 60%, 100% { transform: rotate(0); } 20% { transform: rotate(-18deg) translateX(-3px); } 35% { transform: rotate(-12deg) translateX(-3px); } }

.choice input:checked + span .i-wine .wine-liquid { transform-origin: 50% 0; animation: ico-slosh 1.1s ease-in-out infinite alternate; }
@keyframes ico-slosh { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
}
.card h2 { font-size: 18px; margin: 0 0 12px; }

label.field { display: block; font-weight: 600; margin: 16px 0 6px; }
form > .q:first-child label.field { margin-top: 0; }
input[type=text], textarea, input[type=password] {
  width: 100%;
  font: inherit;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { resize: vertical; min-height: 72px; }

/* Big tappable radio chips */
.choices { display: grid; gap: 8px; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choices.two { grid-template-columns: repeat(2, 1fr); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 84px; padding: 10px 6px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-weight: 600; font-size: 14px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.choice span b { font-size: 22px; font-weight: normal; display: grid; place-items: center; }
.choice span { line-height: 1.2; }
.choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.choice input:checked + span b { animation: pop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { 0% { transform: scale(.6) rotate(-12deg); } 100% { transform: scale(1) rotate(0); } }
.choice span:active { transform: scale(.96); }
.choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn {
  display: block; width: 100%; margin-top: 20px;
  padding: 14px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff;
  font: inherit; font-weight: 700; font-size: 17px; cursor: pointer;
}
.btn:not(.ghost) {
  background: linear-gradient(135deg, #ff922b, #e8590c 55%, #c92a2a);
  box-shadow: 0 8px 20px -8px rgba(232, 89, 12, .8);
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }

.msg { margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
.msg.error { background: #ffe3e3; color: #c92a2a; }
.msg.ok { background: #d3f9d8; color: #2b8a3e; }
@media (prefers-color-scheme: dark) {
  .msg.error { background: #3b1a1a; color: #ffa8a8; }
  .msg.ok { background: #1a3321; color: #8ce99a; }
}

.hidden { display: none !important; }

/* ---------- required fields & inline errors ---------- */
.req { color: var(--accent); font-weight: 800; }
.req-note { margin: 16px 0 0; font-size: 13px; color: var(--muted); }
.field-error { margin: 6px 0 0; font-size: 14px; font-weight: 600; color: #e03131; min-height: 0; }
.field-error:empty { display: none; }
.q.invalid input[type=text] { border-color: #e03131; }
.q.invalid .choice span { border-color: rgba(224, 49, 49, .6); }
.q.invalid .field { color: #e03131; }
@media (prefers-color-scheme: dark) { .field-error, .q.invalid .field { color: #ff8787; } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.btn.incomplete { filter: grayscale(.6); opacity: .7; }

/* Summary */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; text-align: center; }
.stat { padding: 10px 4px; border-radius: 10px; background: var(--bg); }
.stat .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat.yes .n { color: var(--yes); }
.stat.no .n { color: var(--muted); }
.foods { display: flex; flex-wrap: wrap; gap: 6px; }
.tally-row { margin-top: 14px; }
.tally-title { display: block; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.pill { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }

/* People list */
ul.people { list-style: none; margin: 0; padding: 0; }
ul.people li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
ul.people li:first-child { border-top: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot.yes { background: var(--yes); }
.dot.no { background: var(--no); }
ul.people .name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
ul.people .food { color: var(--muted); font-size: 14px; }
ul.people .me { font-size: 12px; color: var(--accent); font-weight: 700; margin-left: 4px; }
.empty { color: var(--muted); text-align: center; margin: 8px 0; }

.done { text-align: center; }
.done .big { font-size: 52px; display: grid; place-items: center; animation: pop .6s cubic-bezier(.3, 1.8, .5, 1); }
.done p { margin: 6px 0; }

/* Admin table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; border-top: 0; }
td button { font: inherit; font-size: 13px; background: none; border: 0; color: #c92a2a; cursor: pointer; padding: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .embers, .smoke { display: none; }
}
