/* ── Soccer Watch Party Sweepstakes — street-football festival ──────
   Pitch green with painted touchlines, forward-leaning chunky italic
   display, scarf-stripe banner, chalk-texture card, flag confetti. */

:root {
  --pitch: #1c7a3d;
  --pitch-deep: #135a2b;
  --chalk: #ffffff;
  --cream: #f8f6ef;
  --ink: #14301d;
  --ink-soft: #5d7261;
  --gold: #ffd23f;
  --red: #e4572e;
  --blue: #2660a4;
  --line: rgba(20, 48, 29, 0.16);
  --err: #d64524;
  --font-display: 'Titan One', cursive;
  --font-body: 'Figtree', sans-serif;
}

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

.hidden { display: none !important; }

body {
  font-family: var(--font-body);
  background-color: var(--pitch);
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 2px, transparent 2px),
    linear-gradient(180deg, var(--pitch) 0%, var(--pitch-deep) 100%);
  background-size: 100% 90px, 100% 100%;
  color: var(--chalk);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

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

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

/* ── Scarf stripe ─────────────────────────────────────────────────── */
.scarf {
  height: 16px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold) 0 60px,
    var(--red) 60px 120px,
    var(--chalk) 120px 180px,
    var(--blue) 180px 240px
  );
}

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

.kicker {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  border: 2px solid rgba(255, 210, 63, 0.5);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 20px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 9.5vw, 4rem);
  line-height: 1.02;
  text-transform: uppercase;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
}

.hero h1 .tilt {
  display: inline-block;
  color: var(--gold);
  transform: skewX(-8deg) rotate(-2deg);
}

.hero .sub {
  max-width: 480px;
  margin: 18px auto 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.04rem;
  font-weight: 600;
}

/* ── Notes ────────────────────────────────────────────────────────── */
.note {
  margin: 18px 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-align: center;
  font-weight: 600;
}

/* ── Card ─────────────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--cream);
  color: var(--ink);
  border-radius: 18px;
  padding: 30px 28px 34px;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2), 0 30px 60px rgba(0, 0, 0, 0.3);
}

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

.card-sub { color: var(--ink-soft); text-align: center; margin: 4px 0 22px; font-weight: 600; }

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

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

label {
  display: block;
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

input[type="text"],
input[type="email"],
select {
  width: 100%;
  padding: 13px 15px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.15s ease;
}

input:focus, select:focus { outline: none; border-color: var(--pitch); }
input.error { border-color: var(--err); }
input::placeholder { color: var(--ink-soft); opacity: 0.7; }

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

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

.form-error { color: var(--err); font-weight: 800; 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-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  border-radius: 14px;
  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.5; cursor: not-allowed; }
.btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

.btn-primary {
  background: var(--gold);
  color: var(--ink);
  box-shadow: 0 6px 0 #c9a112;
}

.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 0 #c9a112; }

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--line);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: none;
}

.btn-block { width: 100%; }

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2.5px solid rgba(20, 48, 29, 0.3);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

.flag-confetti { position: absolute; inset: 0; pointer-events: none; }

.flag-confetti span {
  position: absolute;
  top: -14px;
  width: 10px;
  height: 14px;
  animation: flagfall 5s linear infinite;
}

.flag-confetti span:nth-child(1) { left: 12%; background: var(--gold); animation-delay: 0s; }
.flag-confetti span:nth-child(2) { left: 32%; background: var(--red); animation-delay: 1.2s; }
.flag-confetti span:nth-child(3) { left: 52%; background: var(--blue); animation-delay: 0.6s; }
.flag-confetti span:nth-child(4) { left: 72%; background: var(--pitch); animation-delay: 1.8s; }
.flag-confetti span:nth-child(5) { left: 88%; background: var(--gold); animation-delay: 2.4s; }

@keyframes flagfall {
  0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(340px) rotate(400deg); opacity: 0.4; }
}

.share-panel {
  margin-top: 22px;
  border: 3px dashed var(--pitch);
  border-radius: 16px;
  padding: 20px 18px;
  background: #fff;
}

.share-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--pitch);
  margin-bottom: 12px;
}

.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;
  font-weight: 600;
  color: var(--ink);
  background: var(--cream);
  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(19, 90, 43, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

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

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

.modal-head h3 { font-family: var(--font-display); font-size: 1.2rem; text-transform: uppercase; }

.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;
  white-space: pre-wrap;
  font-weight: 500;
}

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

.toast-ok { background: var(--pitch-deep); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  flex-shrink: 0;
  text-align: center;
  padding: 24px 20px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
  font-weight: 600;
  border-top: 2px solid rgba(255, 255, 255, 0.2);
}

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

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .field-grid { grid-template-columns: 1fr; }
  .copy-row { flex-direction: column; }
}

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