/* ── New Flavor Vote — juicy fruit-stand pop ────────────────────────
   Sun-cream backdrop, blobby fruit-gradient swatch cards, chunky
   rounded display font, sticker badges, candy shadows. */

:root {
  --cream: #fff7e8;
  --card: #ffffff;
  --ink: #3d2c22;
  --ink-soft: #8a7263;
  --mango: linear-gradient(145deg, #ffb347, #ff6b35);
  --coconut: linear-gradient(145deg, #fdf6ec, #e8d5b7);
  --berry: linear-gradient(145deg, #a06cd5, #5e2b97);
  --honey: linear-gradient(145deg, #f5c542, #c98a12);
  --accent: #ff6b35;
  --accent-deep: #d94f1e;
  --err: #d9432f;
  --font-display: 'Baloo 2', cursive;
  --font-body: 'Nunito', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image:
    radial-gradient(28% 22% at 10% 8%, rgba(255, 179, 71, 0.18), transparent 70%),
    radial-gradient(24% 20% at 92% 30%, rgba(160, 108, 213, 0.13), transparent 70%);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.page { display: flex; flex-direction: column; min-height: 100vh; }

.wrap { width: 100%; max-width: 680px; margin: 0 auto; padding: 0 20px; }

main { flex: 1 0 auto; padding-bottom: 70px; }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 62px 20px 34px; }

.brand-line {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 6px 20px;
  margin-bottom: 20px;
  box-shadow: 0 6px 0 rgba(217, 79, 30, 0.15);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 9vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hero h1 .squiggle {
  background: linear-gradient(120deg, #ff6b35, #a06cd5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub { max-width: 480px; margin: 14px auto 0; color: var(--ink-soft); font-size: 1.05rem; font-weight: 600; }

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 16px 22px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid rgba(61, 44, 34, 0.1);
  box-shadow: 0 8px 0 rgba(61, 44, 34, 0.05);
  text-align: center;
  font-weight: 600;
}

/* ── Flavor grid ──────────────────────────────────────────────────── */
.flavor-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.flavor-btn {
  position: relative;
  border: 3px solid transparent;
  border-radius: 26px;
  background: var(--card);
  cursor: pointer;
  overflow: hidden;
  padding: 0 0 18px;
  font-family: inherit;
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 10px 0 rgba(61, 44, 34, 0.07);
}

.flavor-btn:hover { transform: translateY(-4px); box-shadow: 0 14px 0 rgba(61, 44, 34, 0.09); }

.flavor-btn.is-selected {
  border-color: var(--ink);
  transform: translateY(-4px) rotate(-1deg);
  box-shadow: 0 14px 0 rgba(61, 44, 34, 0.16);
}

.swatch {
  height: 120px;
  border-radius: 0 0 55% 55% / 0 0 26% 26%;
  margin-bottom: 14px;
}

.swatch.f-0 { background: var(--mango); }
.swatch.f-1 { background: var(--coconut); }
.swatch.f-2 { background: var(--berry); }
.swatch.f-3 { background: var(--honey); }

.flavor-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
  padding: 0 14px;
}

.pick-sticker {
  position: absolute;
  top: 10px;
  right: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  padding: 6px 14px;
  transform: rotate(6deg);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.flavor-btn.is-selected .pick-sticker { opacity: 1; }

/* ── Vote form ────────────────────────────────────────────────────── */
.vote-form { margin-top: 26px; }

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

input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 2px solid rgba(61, 44, 34, 0.15);
  border-radius: 16px;
  transition: border-color 0.15s ease;
}

input[type="email"]:focus { outline: none; border-color: var(--accent); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.fine { margin-top: 10px; text-align: center; color: var(--ink-soft); font-size: 0.85rem; font-weight: 600; }

.form-error { color: var(--err); font-weight: 700; text-align: center; margin-top: 12px; }

/* ── Buttons ──────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  padding: 14px 28px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  line-height: 1.2;
  white-space: nowrap;
}

.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-deep));
  color: #fff;
  box-shadow: 0 8px 0 rgba(217, 79, 30, 0.3);
}

.btn-primary:hover:not(:disabled) { box-shadow: 0 10px 0 rgba(217, 79, 30, 0.35); }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Results ──────────────────────────────────────────────────────── */
#results-section { text-align: center; padding-top: 10px; }

.results-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}

.results-sub { color: var(--ink-soft); font-weight: 600; margin: 4px 0 24px; }

.results { display: flex; flex-direction: column; gap: 12px; text-align: left; }

.result-row {
  position: relative;
  background: #fff;
  border: 2px solid rgba(61, 44, 34, 0.1);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 6px 0 rgba(61, 44, 34, 0.05);
}

.result-row.is-pick { border-color: var(--ink); }

.result-bar {
  position: absolute;
  inset: 0;
  width: 0%;
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.22;
}

.result-bar.f-0 { background: var(--mango); }
.result-bar.f-1 { background: linear-gradient(145deg, #d8c298, #b99b64); }
.result-bar.f-2 { background: var(--berry); }
.result-bar.f-3 { background: var(--honey); }

.result-inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.result-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; }

.your-pick {
  display: inline-block;
  margin-left: 10px;
  font-family: var(--font-body);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  padding: 3px 10px;
  vertical-align: middle;
}

.result-pct { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }

.result-count { margin-left: 6px; font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; color: var(--ink-soft); }

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--err);
  color: #fff;
  padding: 14px 26px;
  border-radius: 14px;
  font-weight: 700;
  z-index: 120;
  max-width: 92vw;
  text-align: center;
}

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.85rem;
  border-top: 2px dashed rgba(61, 44, 34, 0.15);
}

#wbx-powered-by-slot { margin-top: 12px; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .flavor-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .swatch { height: 90px; }
  .flavor-name { font-size: 1rem; }
  .field-row { flex-direction: column; }
  .btn-primary { width: 100%; }
}

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