/* Should we eat? "Chilli" theme: white surfaces, one hot red, rounded cards, pill buttons. */

:root {
  --ink: #191919;
  --bg: #FFFFFF;
  --surface: #F3F3F3;
  --card: #FFFFFF;
  --accent: #D91F26;
  --accent-hover: #B8161C;
  --accent-soft: #FFF1F1;
  --on-accent: #FFFFFF;
  --muted: #6B6B6B;
  --body: #2B2B2B;
  --rule: #EBEBEB;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); }
a:hover { color: var(--accent); }

button, input { font: inherit; color: var(--ink); }

input::placeholder { color: var(--muted); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.mono { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }

.eyebrow { font-size: 14px; font-weight: 700; color: var(--accent); }

/* Shell */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}

.top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
  align-items: center;
  padding: 12px max(24px, calc((100% - 1192px) / 2));
}

.top-meta { font-size: 14px; color: var(--muted); }

.top-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.top-link {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.top-link:hover { color: var(--ink); background: #E8E8E8; }

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.wordmark:hover { color: var(--ink); }

.logo-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 24px 20px 64px; display: flex; flex-direction: column; gap: 20px; }

/* Home */

.hero {
  max-width: 1192px;
  margin: 24px auto 0;
  padding: 40px;
  border-radius: 24px;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  align-items: flex-start;
}

@media (max-width: 1240px) {
  .hero { margin: 16px 16px 0; }
}

.pitch { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding-top: 8px; }

.pitch .eyebrow {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--on-accent);
  color: var(--accent);
  font-size: 13px;
}

.pitch h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.pitch h1 mark { background: none; color: inherit; box-shadow: inset 0 -0.22em 0 rgba(255, 255, 255, 0.28); }

.lede { margin: 0; font-size: clamp(18px, 2.2vw, 19px); line-height: 1.5; max-width: 30em; }

.hero .lede { color: var(--on-accent); }

.steps { list-style: none; margin: 0; padding: 0; max-width: 30em; display: flex; flex-direction: column; gap: 12px; }

.steps li { display: flex; gap: 14px; align-items: center; font-size: 17px; font-weight: 700; }

.steps b {
  font-size: 14px;
  font-weight: 800;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero .steps b { background: var(--on-accent); }

.band { background: var(--ink); color: #FFFFFF; margin-top: 8px; }

.band-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  align-items: center;
  justify-content: space-between;
}

.band strong { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; font-weight: 600; }

.pills span { padding: 8px 14px; border-radius: 999px; background: #2E2E2E; }

/* Cards */

.ticket {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
}

.hero .ticket { flex: 1 1 400px; max-width: 520px; min-width: 0; border: 0; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22); }

.ticket-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ticket-top span + span { font-size: 14px; font-weight: 600; color: var(--muted); }

.ticket-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 18px; }

/* Forms */

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.field label, .legend { font-size: 15px; font-weight: 700; }

.field label span, .legend span { font-weight: 500; color: var(--muted); }

.input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 2px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  font-size: 16px;
}

.input:focus { outline: none; border-color: var(--accent); background: var(--card); }

.input.empty { background: var(--surface); }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }

legend { padding: 0; margin-bottom: 10px; }

.place-row { display: flex; gap: 8px; align-items: center; }

.place-num {
  font-size: 13px;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}

.icon-btn:hover { color: var(--accent); background: var(--accent-soft); }

.text-btn {
  align-self: flex-start;
  min-height: 44px;
  padding: 0 16px;
  margin-left: 30px;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.text-btn:hover { background: #FFE2E2; }

.text-btn small { font-weight: 600; font-size: 13px; }

.btn {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn:hover { color: var(--ink); background: #E8E8E8; }

.btn.primary { background: var(--accent); color: var(--on-accent); font-size: 18px; font-weight: 800; min-height: 56px; }
.btn.primary:hover { background: var(--accent-hover); color: var(--on-accent); }

.btn.dark { background: var(--ink); color: #FFFFFF; }
.btn.dark:hover { background: #333333; color: #FFFFFF; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

.note { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }

.note a { color: inherit; text-underline-offset: 2px; }

.center { text-align: center; }

.error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  color: #A3141A;
  font-size: 15px;
  font-weight: 600;
  background: var(--accent-soft);
}

.error:empty { display: none; }

/* Poll page */

.poll-head { display: flex; flex-direction: column; gap: 8px; }

.poll-head h1, .page-title {
  margin: 0;
  font-size: clamp(30px, 8vw, 36px);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }

.chip {
  font-size: 14px;
  font-weight: 600;
  padding: 7px 12px;
  background: var(--surface);
  border-radius: 999px;
}

.chip.plain { background: none; color: var(--muted); padding-left: 2px; }

.choice {
  width: 100%;
  min-height: 68px;
  padding: 12px 14px;
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}

.choice:hover { border-color: #D6D6D6; }

.choice[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }

.choice-num {
  font-size: 13px;
  font-weight: 800;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice[aria-pressed="true"] .choice-num { background: var(--card); color: var(--accent); }

.choice-name { flex: 1; min-width: 0; font-size: 17px; font-weight: 700; overflow-wrap: anywhere; }

.dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #CFCFCF;
  background: var(--card);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.choice[aria-pressed="true"] .dot { background: var(--accent); border-color: var(--accent); }

.link-box { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; }

.link-box code {
  flex: 1;
  min-width: 0;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-box .btn { min-height: 44px; font-size: 15px; background: var(--accent); color: var(--on-accent); }
.link-box .btn:hover { background: var(--accent-hover); }

.share-list { display: flex; flex-direction: column; gap: 10px; }

.share-btn { justify-content: flex-start; min-height: 56px; padding: 0 18px; gap: 12px; }
.share-btn .grow { flex: 1; text-align: left; }
.share-btn small { font-weight: 500; font-size: 13px; color: var(--muted); }
.share-btn.dark small { color: #C9C9C9; }

/* Results */

.leader {
  position: relative;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: 20px;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stamp {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent);
}

.stamp.red { position: static; align-self: flex-start; background: var(--accent); color: var(--on-accent); }

.leader-name { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; padding-right: 110px; overflow-wrap: anywhere; }

.tally-row { display: flex; align-items: center; gap: 12px; font-weight: 700; }

.bar { flex: 1; height: 10px; border-radius: 999px; background: var(--surface); overflow: hidden; min-width: 60px; }
.bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.leader .bar { background: rgba(255, 255, 255, 0.3); }
.leader .bar span { background: var(--on-accent); }

.voters { display: flex; flex-wrap: wrap; gap: 6px; }

.voters span { font-size: 14px; font-weight: 600; padding: 4px 10px; background: rgba(255, 255, 255, 0.18); border-radius: 999px; }

.rest { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; overflow: hidden; }

.rest-item { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--rule); }
.rest-item:last-child { border-bottom: 0; }

.rest-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 17px; font-weight: 700; }
.rest-line .num { font-size: 13px; font-weight: 800; color: var(--muted); margin-right: 8px; }
.rest-item.zero .rest-line { color: var(--muted); }

.rest-voters { font-size: 14px; color: var(--muted); }

.admin { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--rule); padding-top: 16px; }

.notice { background: var(--surface); border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.notice p { margin: 0; }
.notice .big { font-size: 24px; line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.notice .btn { background: var(--card); }
.notice .btn:hover { background: #FAFAFA; }

/* Optional account */

.upsell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: var(--accent-soft);
}

.upsell:hover { background: #FFE6E6; color: var(--ink); }

.upsell-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upsell-text strong { font-size: 16px; font-weight: 800; }
.upsell-text span { font-size: 14px; color: var(--muted); }
.upsell svg { color: var(--accent); }

.poll-link { text-decoration: none; color: var(--ink); }
.poll-link:hover { background: #FAFAFA; color: var(--ink); }
.poll-link .rest-line { align-items: center; }

/* Home: uses and FAQ */

.uses-inner, .faq-inner { max-width: 1240px; margin: 0 auto; padding: 44px 24px 8px; }

.uses h2, .faq h2 { margin: 0 0 18px; font-size: clamp(24px, 3.5vw, 30px); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }

.use-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }

.use-list li { font-size: 15px; font-weight: 700; padding: 11px 18px; border-radius: 999px; background: var(--surface); }

.use-list li:nth-child(3n + 1) { background: var(--accent-soft); color: var(--accent-hover); }

.faq-inner { max-width: 1240px; padding-bottom: 48px; }

.faq details { border-bottom: 1px solid var(--rule); max-width: 760px; }
.faq details:first-of-type { border-top: 1px solid var(--rule); }

.faq summary {
  list-style: none;
  cursor: pointer;
  min-height: 60px;
  padding: 14px 52px 14px 0;
  position: relative;
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: '+';
  position: absolute;
  right: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
}

.faq details[open] summary::after { content: '−'; background: var(--accent-soft); color: var(--accent); }

.faq details p { margin: 0 0 18px; font-size: 16px; line-height: 1.6; color: var(--body); max-width: 40em; }

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.2s;
  max-width: calc(100vw - 32px);
  z-index: 10;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.loading { padding: 80px 20px; text-align: center; color: var(--muted); }

@media (max-width: 480px) {
  .top { padding: 10px 16px; }
  .top-meta { display: none; }
  .wordmark { font-size: 19px; }
  .logo-dot { width: 28px; height: 28px; font-size: 17px; }
  .hero { padding: 24px 16px 16px; border-radius: 20px; margin: 12px 12px 0; }
  .hero .ticket { margin: 0 -4px; }
  .wrap { padding: 20px 16px 56px; }
  .ticket-body { padding: 16px; }
  .uses-inner, .faq-inner { padding-left: 16px; padding-right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
