/* Referral Tracker Styles */

.refTracker {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* State 2: Reveal card upgrade */
.refTracker--reveal {
  border-color: rgba(216,180,90,0.25);
}
.refTracker--reveal::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 18px;
  padding: 1px;
  background: linear-gradient(var(--rt-angle, 0deg), transparent 40%, rgba(216,180,90,0.15) 50%, transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rtShimmer 4s linear infinite;
  pointer-events: none;
}
.refTracker--reveal::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 120px;
  background: radial-gradient(ellipse at top, rgba(216,180,90,0.06), transparent 60%);
  pointer-events: none;
}

/* State 3: Redeemed — muted */
.refTracker--redeemed {
  border-color: rgba(255,255,255,0.06);
}

/* Shimmer keyframes using custom property */
@property --rt-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rtShimmer {
  to { --rt-angle: 360deg; }
}

/* Fallback shimmer for browsers without @property */
@supports not (background: paint(something)) {
  .refTracker--reveal::before {
    background: linear-gradient(90deg, transparent 40%, rgba(216,180,90,0.15) 50%, transparent 60%);
    background-size: 200% 100%;
    animation: rtShimmerFallback 4s linear infinite;
  }
}
@keyframes rtShimmerFallback {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Headline */
.refTracker__headline {
  font-size: 15px;
  font-weight: 700;
  color: rgba(255,255,255,0.88);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}

/* Progress dots */
.refTracker__dots {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  position: relative;
}
.refTracker__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
  transition: all 0.3s ease;
  flex-shrink: 0;
}
.refTracker__dot--filled {
  background: #D8B45A;
  border-color: rgba(216,180,90,0.6);
  box-shadow: 0 0 8px rgba(216,180,90,0.3);
}
/* Gold connecting line for 3/3 */
.refTracker__dotsLine {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 2px;
  background: #D8B45A;
  width: 0;
  transition: width 0.6s ease;
  z-index: 0;
}
.refTracker__dots--complete .refTracker__dotsLine {
  width: 56px;
}
.refTracker__dot {
  position: relative;
  z-index: 1;
}

/* Status text */
.refTracker__count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: 4px;
}
.refTracker__motivation {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 16px;
}

/* Referral link section */
.refTracker__linkSection {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 16px;
}
.refTracker__linkDisplay {
  flex: 1;
  background: rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, Menlo, Monaco, monospace;
}
.refTracker__btn {
  flex-shrink: 0;
  padding: 9px 14px;
  background: rgba(216,180,90,0.12);
  border: 1px solid rgba(216,180,90,0.25);
  border-radius: 10px;
  color: #D8B45A;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
}
.refTracker__btn:hover {
  background: rgba(216,180,90,0.18);
}
.refTracker__btn:active {
  transform: scale(0.97);
}

/* Reveal state elements */
.refTracker__trophy {
  font-size: 32px;
  margin-bottom: 8px;
  animation: rtFloat 3s ease-in-out infinite;
}
.refTracker__revealTitle {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.refTracker__revealSub {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 20px;
}

/* Code box */
.refTracker__codeBox {
  background: rgba(216,180,90,0.06);
  border: 1px solid rgba(216,180,90,0.2);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 auto;
  max-width: 300px;
  position: relative;
}
.refTracker__codeLabel {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(216,180,90,0.5);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.refTracker__code {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', ui-monospace, monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #D8B45A;
  display: inline-block;
}
.refTracker__code span {
  display: inline-block;
}
.refTracker__copyBtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(216,180,90,0.3);
  color: #D8B45A;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.refTracker__copyBtn:hover {
  background: rgba(216,180,90,0.1);
}
.refTracker__helper {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-top: 14px;
}

/* Reveal muted link section */
.refTracker__linkSection--muted {
  opacity: 0.6;
}

/* Redeemed state */
.refTracker__redeemed {
  font-size: 13px;
  color: rgba(216,180,90,0.6);
  font-weight: 600;
  margin-top: 8px;
}

/* Animations */
@keyframes rtFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes charReveal {
  from { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

@keyframes revealPulse {
  0% { box-shadow: 0 0 0 0 rgba(216,180,90,0); }
  50% { box-shadow: 0 0 30px 4px rgba(216,180,90,0.2); }
  100% { box-shadow: 0 0 0 0 rgba(216,180,90,0); }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .refTracker--reveal::before,
  .refTracker__trophy {
    animation: none !important;
  }
  .refTracker__code span {
    animation: none !important;
    opacity: 1 !important;
  }
  .refTracker__codeBox {
    animation: none !important;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .refTracker {
    padding: 20px;
  }
  .refTracker__code {
    font-size: 15px;
  }
  .refTracker__linkSection {
    flex-wrap: wrap;
  }
  .refTracker__linkDisplay {
    flex: 1 1 100%;
  }
}
