/* ── Themed Birthday Invite + Party Poll — retro roller-rink ────────
   Grape-purple rink floor with glossy sheen, rainbow ribbon sweep,
   chrome bubble script headline with hot-pink outline, mixtape
   cassette poll cards, neon-bordered RSVP card, disco sparkles. */

:root {
  --grape: #3c1a5e;
  --grape-deep: #2a1043;
  --pink: #ff4fa0;
  --tangerine: #ff9540;
  --lemon: #ffe14d;
  --teal: #33d6c3;
  --white: #fff7fd;
  --ink: #2a1043;
  --soft: rgba(255, 247, 253, 0.75);
  --err: #ffb3c9;
  --head: 'Baloo 2', cursive;
  --body: 'Nunito', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--body);
  color: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(255, 79, 160, 0.28), transparent 55%),
    radial-gradient(ellipse at 85% 100%, rgba(51, 214, 195, 0.16), transparent 50%),
    linear-gradient(180deg, var(--grape), var(--grape-deep));
  background-attachment: fixed;
  min-height: 100vh;
}

.page { position: relative; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }

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

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

/* ── Sparkles ─────────────────────────────────────────────────────── */
.spark {
  position: absolute;
  color: var(--lemon);
  opacity: 0.7;
  animation: twinkle 2.8s ease-in-out infinite;
  pointer-events: none;
  font-size: 1.2rem;
}

.s1 { top: 8%; left: 8%; animation-delay: 0s; }
.s2 { top: 14%; right: 10%; font-size: 1.6rem; animation-delay: 0.6s; color: var(--teal); }
.s3 { top: 40%; left: 4%; font-size: 0.9rem; animation-delay: 1.2s; color: var(--pink); }
.s4 { top: 55%; right: 5%; animation-delay: 1.8s; }
.s5 { top: 78%; left: 10%; font-size: 1.4rem; animation-delay: 2.2s; color: var(--teal); }

@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 0.9; transform: scale(1.15) rotate(20deg); }
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero { position: relative; text-align: center; padding-top: 64px; padding-bottom: 10px; }

.ribbon {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 46%;
  width: 120%;
  height: 150px;
  z-index: 0;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.3));
}

.eyebrow {
  position: relative;
  z-index: 1;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 10px;
}

.hero h1 {
  position: relative;
  z-index: 1;
  font-family: var(--head);
  font-weight: 800;
  font-size: clamp(2.8rem, 11vw, 4.6rem);
  line-height: 1.0;
  color: var(--white);
  text-shadow:
    3px 3px 0 var(--pink),
    6px 6px 0 rgba(0, 0, 0, 0.35);
  letter-spacing: 0.01em;
}

.pop {
  display: inline-block;
  background: linear-gradient(180deg, #fff, #cfe8ff 45%, #8fb8e8 50%, #fff 60%, #e6f2ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px var(--pink);
  font-size: 1.25em;
  transform: rotate(-3deg);
}

.party-meta {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.meta-chip {
  font-weight: 800;
  font-size: 0.85rem;
  background: rgba(255, 247, 253, 0.12);
  border: 1.5px solid rgba(255, 247, 253, 0.35);
  border-radius: 999px;
  padding: 8px 16px;
  backdrop-filter: blur(3px);
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  position: relative;
  background: rgba(42, 16, 67, 0.72);
  border: 2px solid var(--pink);
  border-radius: 20px;
  padding: 34px 30px;
  margin-top: 34px;
  box-shadow:
    0 0 0 1px rgba(255, 79, 160, 0.35),
    0 0 26px rgba(255, 79, 160, 0.35),
    inset 0 0 22px rgba(255, 79, 160, 0.08);
}

.card h2 {
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.7rem;
  text-align: center;
  margin-bottom: 6px;
}

.card-sub { color: var(--soft); text-align: center; font-size: 0.95rem; margin-bottom: 24px; }

/* ── Fields ───────────────────────────────────────────────────────── */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }

label, legend {
  display: block;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 7px;
  color: var(--lemon);
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: var(--body);
  font-weight: 600;
  color: var(--white);
  background: rgba(255, 247, 253, 0.08);
  border: 1.5px solid rgba(255, 247, 253, 0.28);
  border-radius: 12px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

input:focus { outline: none; border-color: var(--teal); background: rgba(255, 247, 253, 0.14); }
input.error { border-color: var(--err); }
input::placeholder { color: rgba(255, 247, 253, 0.4); }

.attending { border: none; margin-bottom: 22px; }

.attend-row { display: flex; gap: 12px; }

.attend-opt { position: relative; flex: 1; cursor: pointer; margin: 0; }

.attend-opt input { position: absolute; opacity: 0; }

.attend-opt span {
  display: block;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--soft);
  padding: 13px 10px;
  border: 1.5px solid rgba(255, 247, 253, 0.28);
  border-radius: 12px;
  transition: all 0.18s ease;
}

.attend-opt input:checked + span {
  color: var(--ink);
  background: var(--teal);
  border-color: var(--teal);
  box-shadow: 0 0 16px rgba(51, 214, 195, 0.5);
}

.attend-opt input:focus-visible + span { outline: 2px solid var(--lemon); outline-offset: 3px; }

/* ── Poll — mixtape cards ─────────────────────────────────────────── */
.poll-block { margin-bottom: 24px; }

.poll-question {
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--lemon);
  margin-bottom: 12px;
}

.choices { display: grid; gap: 10px; }

.tape {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--white);
  background: rgba(255, 247, 253, 0.07);
  border: 1.5px solid rgba(255, 247, 253, 0.25);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.tape:hover { transform: rotate(-0.8deg) translateY(-2px); border-color: var(--pink); }

.tape.is-selected {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  box-shadow: 0 0 18px rgba(255, 79, 160, 0.55);
  transform: rotate(-0.8deg);
}

/* cassette hubs */
.tape .hubs {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.tape .hubs i {
  width: 16px;
  height: 16px;
  border: 2.5px solid currentColor;
  border-radius: 50%;
  display: block;
  opacity: 0.75;
}

.tape.is-selected .hubs i { animation: reel 1.4s linear infinite; }

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

/* ── Button ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--head);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 16px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
  line-height: 1.2;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--tangerine));
  color: #fff;
  box-shadow: 0 8px 22px rgba(255, 79, 160, 0.45);
}

.btn-primary:hover:not(:disabled) { transform: translateY(-2px) scale(1.01); box-shadow: 0 12px 28px rgba(255, 79, 160, 0.55); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--lemon); outline-offset: 3px; }

.btn-block { width: 100%; }

.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); } }

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

/* ── Results ──────────────────────────────────────────────────────── */
.results { display: grid; gap: 12px; margin-top: 6px; }

.result-row { position: relative; }

.result-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 6px;
}

.result-label .pct { color: var(--lemon); font-family: var(--head); font-size: 1.05rem; }

.result-track {
  height: 16px;
  background: rgba(255, 247, 253, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.result-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--pink));
  transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.result-row.is-pick .result-fill { background: linear-gradient(90deg, var(--pink), var(--tangerine), var(--lemon)); }

.result-row.is-pick .result-label::after {
  content: 'YOUR PICK';
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  color: var(--ink);
  background: var(--lemon);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
}

.results-note { text-align: center; color: var(--soft); font-size: 0.85rem; margin-top: 20px; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 26px 20px;
  color: var(--soft);
  font-size: 0.8rem;
  font-weight: 600;
}

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

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
  .attend-row { flex-direction: column; }
  .ribbon { top: 52%; }
}
