html:has(.referral-campaign),
body:has(.referral-campaign) {
  overflow-x: hidden;
}

.referral-campaign {
  --ref-red: #6d5efc;
  --ref-red-deep: #2d1b69;
  --ref-gold: #ffd6ef;
  --ref-gold-deep: #ff2f92;
  --ref-cream: #f7f5ff;
  --ref-ink: #241b4a;
  position: relative;
  left: 50%;
  width: 100vw;
  margin: -1.5rem 0 -1.5rem -50vw;
  color: var(--ref-ink);
  background: var(--ref-cream);
  overflow: hidden;
}

.referral-campaign .ref-wrap {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto;
}

.ref-hero {
  position: relative;
  padding: 2.5rem 0 3.25rem;
  color: #fff;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 47, 146, 0.42), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(80, 230, 255, 0.28), transparent 26%),
    linear-gradient(160deg, #24105a 0%, #4a27b8 52%, #2a1468 100%);
}

.ref-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%);
  pointer-events: none;
}

.ref-confetti {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.ref-confetti span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #ff4fa3;
  animation: ref-float 4.5s ease-in-out infinite;
}

.ref-confetti span:nth-child(1) { top: 18%; left: 8%; background: #ff4fa3; }
.ref-confetti span:nth-child(2) { top: 28%; right: 12%; left: auto; width: 8px; height: 8px; border-radius: 50%; background: #5ce1ff; animation-delay: -1s; }
.ref-confetti span:nth-child(3) { top: 62%; left: 14%; width: 7px; height: 14px; background: #ffe56a; animation-delay: -2s; }
.ref-confetti span:nth-child(4) { top: 70%; right: 16%; left: auto; border-radius: 50%; background: #8d7cff; animation-delay: -0.6s; }
.ref-confetti span:nth-child(5) { top: 16%; left: 46%; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation-delay: -1.6s; }
.ref-confetti span:nth-child(6) { top: 48%; right: 7%; left: auto; background: #ff4fa3; transform: rotate(30deg); animation-delay: -2.4s; }

.ref-hero-copy {
  position: relative;
  z-index: 1;
  text-align: center;
}

.ref-off {
  display: inline-block;
  margin: 0 0 0.85rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0.55rem;
  background: #ff2f92;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ref-eyebrow {
  display: inline-block;
  margin: 0 0 0.85rem 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
}

.ref-hero h1,
.ref-close h2,
.ref-section-head h2,
.ref-terms h2,
.ref-who h2,
.ref-who h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.2;
}

.ref-hero h1 {
  font-size: clamp(1.85rem, 7vw, 3.4rem);
  color: #fff;
}

.ref-lead,
.ref-note,
.ref-section-head p,
.ref-close p,
.ref-who p,
.ref-fine,
.ref-terms li,
.ref-step-list p {
  line-height: 1.7;
}

.ref-lead {
  max-width: 40rem;
  margin: 1rem auto 0;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
}

.ref-note {
  margin: 0.85rem 0 0;
  color: #ffd6ef;
  font-weight: 700;
}

.ref-deadline {
  margin: 0.65rem 0 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.82rem;
  font-weight: 400;
}

.ref-ended {
  max-width: 36rem;
  margin: 1rem auto 0;
  color: #fff8ef;
  font-weight: 700;
}

.ref-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.ref-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1.2rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.ref-btn-primary {
  color: #fff;
  background: linear-gradient(90deg, #6d5efc 0%, #ff2f92 100%);
  box-shadow: 0 12px 24px rgba(36, 16, 90, 0.28);
}

.ref-btn-ghost {
  color: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.75);
}

.ref-btn:hover,
.ref-btn:focus {
  color: #fff;
  text-decoration: none;
}

.ref-btn-primary:hover,
.ref-btn-primary:focus {
  color: #fff;
  filter: brightness(1.06);
}

.ref-btn-ghost:hover,
.ref-btn-ghost:focus {
  color: #2d1b69;
  background: #fff;
}

.ref-band,
.ref-example,
.ref-who {
  padding: 2.75rem 0;
}

.ref-section-head {
  max-width: 40rem;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.ref-section-head h2,
.ref-terms h2,
.ref-who h2,
.ref-close h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
  color: var(--ref-red-deep);
}

.ref-who h3 {
  margin-bottom: 0.45rem;
  font-size: 1.2rem;
  color: var(--ref-red-deep);
}

.ref-section-head p {
  margin: 0.7rem 0 0;
}

.ref-tickets {
  display: grid;
  gap: 1rem;
}

.ref-ticket {
  position: relative;
  padding: 1.35rem 1.2rem 1.15rem;
  text-align: center;
  background: #fff;
  border-radius: 1.1rem;
  box-shadow: 0 16px 36px rgba(45, 27, 105, 0.08);
}

.ref-ticket.is-best {
  background: #fff;
  box-shadow: 0 18px 36px rgba(109, 94, 252, 0.16), inset 0 0 0 2px #ff2f92;
}

.ref-ribbon {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #ff2f92;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.ref-ticket-count {
  margin: 0;
  color: var(--ref-gold-deep);
  font-weight: 800;
}

.ref-ticket-pay {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.15rem;
  margin: 0.2rem 0 0;
  color: var(--ref-red);
  line-height: 1;
}

.ref-ticket-rate {
  font-size: clamp(2.6rem, 8vw, 3.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.ref-ticket-unit {
  font-size: 0.95rem;
  font-weight: 700;
}

.ref-stack-note {
  max-width: 40rem;
  margin: 1.15rem auto 0;
  color: var(--ref-red-deep);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

.ref-ticket-meta {
  margin: 0.35rem 0 0;
  color: #6b628a;
}

.ref-steps {
  padding: 2.75rem 0;
  color: #fff;
  background:
    radial-gradient(circle at 80% 0, rgba(255, 47, 146, 0.28), transparent 32%),
    linear-gradient(165deg, #3a1d93, #24105a);
}

.ref-section-head-light h2 {
  color: #fff;
}

.ref-step-list {
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ref-step-list li {
  padding: 1.1rem 1rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.ref-step-list span {
  display: inline-block;
  margin-bottom: 0.35rem;
  color: #ffd6ef;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.ref-step-list h3 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.ref-step-list p {
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

.ref-math {
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 16px 36px rgba(45, 27, 105, 0.08);
}

.ref-math-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border-top: 1px solid rgba(45, 27, 105, 0.08);
}

.ref-math-head {
  border-top: 0;
  background: #2d1b69;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
}

.ref-math-row strong {
  color: var(--ref-red);
  font-size: 1.05rem;
}

.ref-fine {
  margin: 0.9rem 0 0;
  color: #6b628a;
  font-size: 0.92rem;
  text-align: center;
}

.ref-fine a {
  color: var(--ref-red);
  font-weight: 800;
}

.ref-who-grid {
  display: grid;
  gap: 1rem;
}

.ref-who article {
  padding: 1.25rem 1.15rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(109, 94, 252, 0.22);
}

.ref-who p {
  margin: 0;
}

.ref-terms {
  padding: 3.5rem 0 2.75rem;
}

.ref-terms h2 {
  margin-bottom: 0.8rem;
}

.ref-terms ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ref-terms li {
  position: relative;
  margin: 0;
  padding: 0.95rem 0 0.95rem 1.6rem;
  border-top: 1px solid rgba(45, 27, 105, 0.1);
}

.ref-terms h3 {
  margin: 0 0 0.35rem;
  color: var(--ref-red-deep);
  font-size: 1.05rem;
  font-weight: 800;
}

.ref-terms li p {
  margin: 0.45rem 0 0;
}

.ref-terms li a {
  color: var(--ref-red);
  font-weight: 800;
}

.ref-terms li::before {
  content: "";
  position: absolute;
  top: 1.15rem;
  left: 0;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff4fa3, #6d5efc);
}

.ref-close {
  padding: 2.75rem 0 3rem;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0, rgba(255, 47, 146, 0.28), transparent 36%),
    linear-gradient(180deg, #4a27b8, #24105a);
}

.ref-close h2 {
  color: #fff;
}

.ref-close p {
  max-width: 36rem;
  margin: 0.75rem auto 0;
}

@media (max-width: 575.98px) {
  .ref-math-row {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .ref-math-head {
    display: none;
  }

  .ref-math-row strong {
    font-size: 1.25rem;
  }
}

@media (min-width: 768px) {
  .ref-hero {
    padding: 3.5rem 0 4rem;
  }

  .ref-actions {
    flex-direction: row;
    justify-content: center;
  }

  .ref-btn {
    min-width: 14rem;
  }

  .ref-tickets,
  .ref-step-list,
  .ref-who-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ref-step-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ref-who-wide {
    grid-column: 1 / -1;
  }
}

@keyframes ref-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(12deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ref-confetti span {
    animation: none;
  }
}
