/* ── Classic Giveaway — celebration burst ───────────────────────────
   Violet-to-coral gradient, drifting CSS confetti, crisp white card,
   chunky geometric sans, gold ribbon, party-invitation share panel. */

:root {
  --violet: #6d28d9;
  --coral: #fb7185;
  --deep: #4c1d95;
  --card: #ffffff;
  --ink: #241b3a;
  --ink-soft: #6f6688;
  --gold: #fbbf24;
  --line: #e9e4f5;
  --err: #dc2626;
  --font-display: 'Fredoka', sans-serif;
  --font-body: 'Rubik', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background: linear-gradient(135deg, var(--deep) 0%, var(--violet) 45%, var(--coral) 100%);
  background-attachment: fixed;
  color: #fff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.wrap { position: relative; z-index: 2; width: 100%; max-width: 560px; margin: 0 auto; padding: 0 20px; }

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

/* ── Confetti ─────────────────────────────────────────────────────── */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 1; }

.confetti span {
  position: absolute;
  top: -20px;
  width: 12px;
  height: 12px;
  opacity: 0.85;
  animation: fall linear infinite;
}

.confetti span:nth-child(1)  { left: 6%;  background: var(--gold);  animation-duration: 9s;  animation-delay: 0s;   border-radius: 2px; }
.confetti span:nth-child(2)  { left: 14%; background: #fff;         animation-duration: 12s; animation-delay: 2s;   border-radius: 50%; width: 8px; height: 8px; }
.confetti span:nth-child(3)  { left: 24%; background: var(--coral); animation-duration: 10s; animation-delay: 4s;   border-radius: 2px; }
.confetti span:nth-child(4)  { left: 33%; background: var(--gold);  animation-duration: 13s; animation-delay: 1s;   border-radius: 50%; width: 9px; height: 9px; }
.confetti span:nth-child(5)  { left: 42%; background: #fff;         animation-duration: 8s;  animation-delay: 3s;   border-radius: 2px; }
.confetti span:nth-child(6)  { left: 51%; background: #a78bfa;      animation-duration: 11s; animation-delay: 5s;   border-radius: 2px; }
.confetti span:nth-child(7)  { left: 60%; background: var(--gold);  animation-duration: 9s;  animation-delay: 2.5s; border-radius: 50%; width: 7px; height: 7px; }
.confetti span:nth-child(8)  { left: 68%; background: #fff;         animation-duration: 14s; animation-delay: 0.5s; border-radius: 2px; }
.confetti span:nth-child(9)  { left: 76%; background: var(--coral); animation-duration: 10s; animation-delay: 4.5s; border-radius: 2px; }
.confetti span:nth-child(10) { left: 84%; background: var(--gold);  animation-duration: 12s; animation-delay: 1.5s; border-radius: 2px; }
.confetti span:nth-child(11) { left: 91%; background: #fff;         animation-duration: 9s;  animation-delay: 3.5s; border-radius: 50%; width: 8px; height: 8px; }
.confetti span:nth-child(12) { left: 97%; background: #a78bfa;      animation-duration: 13s; animation-delay: 6s;   border-radius: 2px; }

@keyframes fall {
  0%   { transform: translateY(-4vh) rotate(0deg); }
  100% { transform: translateY(105vh) rotate(540deg); }
}

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

.ribbon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  background: var(--gold);
  color: #5b3b00;
  border-radius: 999px;
  padding: 8px 22px;
  margin-bottom: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 9vw, 3.8rem);
  line-height: 1.05;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.hero .sub {
  max-width: 440px;
  margin: 16px auto 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.05rem;
}

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(8px);
  text-align: center;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  color: var(--ink);
  border-radius: 22px;
  padding: 32px 30px 36px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  text-align: center;
}

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

/* Fields */
.field { margin-bottom: 16px; }

label {
  display: block;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: #faf9fd;
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12);
}

input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.6; }

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

.rules-link {
  background: none;
  border: none;
  color: var(--violet);
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.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: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  padding: 15px 30px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
  line-height: 1.2;
  white-space: nowrap;
}

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

.btn-primary {
  background: linear-gradient(120deg, var(--violet), var(--coral));
  color: #fff;
  box-shadow: 0 14px 34px rgba(109, 40, 217, 0.35);
}

.btn-ghost {
  background: #f4f1fb;
  color: var(--violet);
  border: 1.5px solid var(--line);
}

.btn-block { width: 100%; }

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

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

/* ── Done + share ─────────────────────────────────────────────────── */
.done-card { text-align: center; }

.done-pop { font-size: 2.6rem; margin-bottom: 8px; }

.share-panel {
  margin-top: 24px;
  border: 2px dashed var(--violet);
  border-radius: 18px;
  padding: 22px 20px;
  background: #faf8ff;
}

.share-title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; }
.share-title strong { color: var(--violet); }

.share-sub { color: var(--ink-soft); font-size: 0.9rem; margin: 4px 0 16px; }

.copy-row { display: flex; gap: 8px; margin-bottom: 12px; }

#share-url {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
}

.share-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── Rules modal ──────────────────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(36, 27, 58, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-card {
  background: #fff;
  color: var(--ink);
  border-radius: 18px;
  max-width: 620px;
  width: 100%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.45);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  font-size: 0.92rem;
  color: var(--ink);
  white-space: pre-wrap;
}

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

.toast-ok { background: #15803d; }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px 20px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.85rem;
}

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

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .copy-row { flex-direction: column; }
  .share-row .btn { flex: 1; }
}

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