.blv-referral-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100vw;
  min-height: 100dvh;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  background: rgba(5, 8, 18, 0.58);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.blv-referral-popup-overlay.is-active {
  display: flex;
}

.blv-referral-popup {
  position: relative;
  width: min(100%, 500px);
  padding: 62px 28px 28px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 170, 255, 0.34), transparent 34%),
    radial-gradient(circle at 92% 88%, rgba(97, 66, 255, 0.28), transparent 42%),
    linear-gradient(145deg, rgba(19, 27, 48, 0.96), rgba(8, 12, 24, 0.92));
  box-shadow:
    0 30px 100px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  animation: blvReferralPopupShow 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.blv-referral-popup::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.06), transparent 70%);
}

.blv-referral-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font: 400 28px/1 Arial, sans-serif;
  cursor: pointer;
  transition: transform 0.22s ease, background 0.22s ease;
}

.blv-referral-popup-close:hover {
  transform: rotate(90deg) scale(1.05);
  background: rgba(255, 255, 255, 0.2);
}

.blv-referral-popup-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid rgba(74, 195, 255, 0.34);
  border-radius: 999px;
  color: #8fdcff;
  background: rgba(0, 157, 255, 0.1);
  font-family: Benzin, Inter, sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blv-referral-popup-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.blv-referral-popup-title {
  margin: 0 0 14px;
  font-family: Benzin, Inter, sans-serif;
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-transform: uppercase;
}

.blv-referral-popup-lead {
  max-width: 390px;
  margin: 0 auto 24px;
  color: rgba(255, 255, 255, 0.75);
  font-family: Inter, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

.blv-referral-popup-rewards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.blv-referral-popup-reward {
  padding: 16px 13px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.055);
  text-align: left;
}

.blv-referral-popup-reward strong {
  display: block;
  margin-bottom: 6px;
  font-family: Benzin, Inter, sans-serif;
  font-size: 17px;
  line-height: 1.1;
}

.blv-referral-popup-reward span {
  display: block;
  color: rgba(255, 255, 255, 0.64);
  font-family: Inter, Arial, sans-serif;
  font-size: 12px;
  line-height: 1.42;
}

.blv-referral-popup-actions {
  display: grid;
  gap: 10px;
}

.blv-referral-popup-primary,
.blv-referral-popup-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 999px;
  font-family: Benzin, Inter, sans-serif;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.22s ease, filter 0.22s ease, background 0.22s ease;
}

.blv-referral-popup-primary {
  color: #fff;
  background: linear-gradient(120deg, #0077ff, #00c2ff, #5a52ff, #00aaff);
  background-size: 300% 300%;
  box-shadow: 0 16px 36px rgba(0, 119, 255, 0.34);
  animation: blvReferralGradient 5s ease infinite;
}

.blv-referral-popup-secondary {
  min-height: 48px;
  color: rgba(255, 255, 255, 0.84);
  background: rgba(255, 255, 255, 0.07);
}

.blv-referral-popup-primary:hover,
.blv-referral-popup-secondary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.blv-referral-popup-note {
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.46);
  font-family: Inter, Arial, sans-serif;
  font-size: 10px;
  line-height: 1.45;
}

@keyframes blvReferralGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes blvReferralPopupShow {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px) {
  .blv-referral-popup-overlay {
    align-items: flex-end;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .blv-referral-popup {
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: 58px 18px 22px;
    border-radius: 26px;
  }

  .blv-referral-popup-rewards {
    grid-template-columns: 1fr;
  }

  .blv-referral-popup-title {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blv-referral-popup,
  .blv-referral-popup-primary {
    animation: none;
  }
}