/* ==========================================================================
   Referral rewards — invite & earn
   Layers: hero → invite ticket → stats → milestone ring → players → keys
   Uses the site's tokens (site.css): gold, ink, panel surfaces.
   ========================================================================== */

.rf-page { --rf-gold: #e5bf77; --rf-gold-soft: rgba(229, 191, 119, 0.16); --rf-ring: rgba(255, 255, 255, 0.09); }

/* ------------------------------------------------------------------ hero */

.rf-hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(229, 191, 119, 0.22);
  margin-bottom: 24px;
  isolation: isolate;
}

.rf-hero-scene { position: absolute; inset: 0; z-index: 0; }
.rf-hero-scene img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.rf-hero-shade {
  position: absolute; inset: 0; z-index: 1;
  background:
    radial-gradient(120% 90% at 8% 20%, rgba(11, 17, 28, 0.92) 0%, rgba(11, 17, 28, 0.72) 42%, rgba(11, 17, 28, 0.3) 75%, rgba(11, 17, 28, 0.55) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, 0.15), rgba(11, 17, 28, 0.9));
}

.rf-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 26px;
  padding: 34px 32px;
  align-items: center;
}

.rf-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--rf-gold); margin: 0 0 10px;
}
.rf-kicker::before {
  content: ''; width: 34px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--rf-gold));
}

.rf-hero h1 {
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.7rem, 3.4vw, 2.55rem);
  line-height: 1.12;
  margin: 0 0 12px;
  color: #fdf8ec;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}
.rf-hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, #f7e3b4, #e5bf77 45%, #c79f57);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.rf-hero p.rf-lead { margin: 0 0 20px; color: #dfe5ec; max-width: 46ch; line-height: 1.62; }

.rf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.rf-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; font-size: 0.8rem; font-weight: 600;
  color: #f3ecdd; background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(6px);
}
.rf-chip .icon { width: 15px; height: 15px; }
.rf-chip.gold { color: #2a2013; background: linear-gradient(150deg, #f2dcaa, #e5bf77); border-color: transparent; }

.rf-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* --------------------------------------------------------- invite ticket */

.rf-ticket {
  position: relative;
  border-radius: 18px;
  padding: 20px 20px 18px;
  background: linear-gradient(165deg, rgba(20, 31, 46, 0.96), rgba(13, 20, 31, 0.98));
  border: 1px solid rgba(229, 191, 119, 0.34);
  box-shadow: 0 22px 50px -22px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* perforation notches, like a torn ticket stub */
.rf-ticket::before, .rf-ticket::after {
  content: ''; position: absolute; top: 50%; width: 18px; height: 18px;
  border-radius: 50%; background: #0b111c; transform: translateY(-50%);
  box-shadow: inset 0 0 0 1px rgba(229, 191, 119, 0.34);
}
.rf-ticket::before { left: -10px; }
.rf-ticket::after { right: -10px; }

.rf-ticket-label {
  font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: #9fb0c4; margin: 0 0 8px;
}

.rf-code {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 16px; border-radius: 12px; margin-bottom: 14px;
  background: linear-gradient(120deg, rgba(229, 191, 119, 0.18), rgba(229, 191, 119, 0.06));
  border: 1px dashed rgba(229, 191, 119, 0.55);
}
.rf-code strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.32rem; letter-spacing: 0.3em; color: #f7e3b4;
  user-select: all; word-break: break-all;
}

.rf-link-row { display: flex; gap: 8px; }
.rf-link-row .input { flex: 1; min-width: 0; font-size: 0.82rem; }

.rf-ticket-note { margin: 14px 0 0; font-size: 0.8rem; color: #93a2b6; line-height: 1.5; }

/* ----------------------------------------------------------------- stats */

.rf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }

.rf-stat {
  position: relative; overflow: hidden;
  padding: 18px 18px 16px; border-radius: 16px;
  background: linear-gradient(170deg, rgba(28, 41, 57, 0.85), rgba(16, 24, 37, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-stat::after {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, transparent, var(--rf-gold), transparent);
  opacity: 0.75;
}
.rf-stat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; margin-bottom: 10px;
  background: var(--rf-gold-soft); color: var(--rf-gold);
}
.rf-stat-icon .icon { width: 17px; height: 17px; }
.rf-stat .k { font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: #93a2b6; }
.rf-stat .v { font-family: Cinzel, Georgia, serif; font-size: 1.85rem; line-height: 1.15; color: #f7f2e7; }
.rf-stat .v small { font-size: 0.85rem; color: #93a2b6; font-family: inherit; }

/* -------------------------------------------------- milestone ring card */

.rf-milestone-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center;
  padding: 24px; margin-bottom: 22px; border-radius: 18px;
  background:
    radial-gradient(90% 140% at 100% 0%, rgba(229, 191, 119, 0.1), transparent 62%),
    linear-gradient(170deg, rgba(28, 41, 57, 0.9), rgba(16, 24, 37, 0.94));
  border: 1px solid rgba(229, 191, 119, 0.18);
}

.rf-ring { position: relative; width: 132px; height: 132px; flex: none; }
.rf-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rf-ring .track { fill: none; stroke: var(--rf-ring); stroke-width: 10; }
.rf-ring .bar {
  fill: none; stroke: url(#rf-ring-grad); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.rf-ring-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.rf-ring-center b { font-family: Cinzel, Georgia, serif; font-size: 1.6rem; color: #f7e3b4; line-height: 1; }
.rf-ring-center span { display: block; font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: #93a2b6; margin-top: 5px; }

.rf-milestone-copy h3 { margin: 0 0 8px; font-family: Cinzel, Georgia, serif; font-size: 1.16rem; color: #f7f2e7; }
.rf-milestone-copy p { margin: 0 0 14px; color: var(--ink-2); line-height: 1.6; }

/* five pips → key */
.rf-pips { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; }
.rf-pip {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-content: center;
  background: rgba(255, 255, 255, 0.055); border: 1px solid rgba(255, 255, 255, 0.12);
  color: #93a2b6; font-size: 0.72rem; font-weight: 700;
}
.rf-pip.on {
  background: linear-gradient(150deg, #f2dcaa, #e5bf77); border-color: transparent; color: #2a2013;
}
.rf-pip.key {
  width: 34px; height: 34px; border-radius: 10px; color: var(--rf-gold);
  border-color: rgba(229, 191, 119, 0.4); background: var(--rf-gold-soft);
}
.rf-pip.key.on { background: linear-gradient(150deg, #f2dcaa, #e5bf77); color: #2a2013; }
.rf-pip.key .icon { width: 16px; height: 16px; }

/* --------------------------------------------------------------- players */

.rf-players { border-radius: 18px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.08); background: rgba(20, 31, 46, 0.66); }
.rf-players-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.rf-players-head h3 { margin: 0; font-family: Cinzel, Georgia, serif; font-size: 1.05rem; color: #f7f2e7; }

.rf-player {
  display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 0.8fr)) minmax(0, 1fr);
  gap: 14px; align-items: center; padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}
.rf-player:last-child { border-bottom: 0; }
.rf-player.qualified { background: linear-gradient(90deg, rgba(95, 216, 164, 0.07), transparent 55%); }

.rf-who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.rf-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-content: center; font-weight: 700; font-size: 0.9rem;
  color: #2a2013; background: linear-gradient(150deg, #e9cd94, #c9a566);
}
.rf-who b { display: block; color: #f2eee4; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-who span { display: block; font-size: 0.74rem; color: #93a2b6; }

.rf-req { font-size: 0.82rem; }
.rf-req .ok { color: #7fe0b0; }
.rf-req .no { color: #ffb0bb; }
.rf-req small { display: block; color: #93a2b6; font-size: 0.74rem; margin-top: 2px; }

.rf-hours-bar { height: 5px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); margin-top: 6px; overflow: hidden; }
.rf-hours-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #e5bf77, #f2dcaa); }

.rf-verdict { justify-self: end; }

/* ------------------------------------------------------------------ keys */

.rf-keys { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }

.rf-claim-card {
  padding: 22px; border-radius: 18px;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(139, 108, 240, 0.14), transparent 60%),
    linear-gradient(170deg, rgba(28, 41, 57, 0.9), rgba(16, 24, 37, 0.94));
  border: 1px solid rgba(139, 108, 240, 0.24);
}
.rf-claim-card h3 { margin: 0 0 6px; font-family: Cinzel, Georgia, serif; font-size: 1.06rem; color: #f7f2e7; }
.rf-claim-card p { margin: 0 0 16px; color: var(--ink-2); font-size: 0.9rem; line-height: 1.55; }

.rf-claim-btn {
  width: 100%; padding: 14px 18px; border: 0; border-radius: 12px; cursor: pointer;
  font-weight: 700; font-size: 0.98rem; letter-spacing: 0.02em;
  color: #22190d; background: linear-gradient(150deg, #f5dca4, #e5bf77 55%, #c9a566);
  box-shadow: 0 14px 28px -14px rgba(229, 191, 119, 0.8);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.rf-claim-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 18px 34px -14px rgba(229, 191, 119, 0.9); }
.rf-claim-btn:disabled {
  cursor: not-allowed; color: #8695a8; background: rgba(255, 255, 255, 0.06);
  box-shadow: none; border: 1px solid rgba(255, 255, 255, 0.1);
}
.rf-claim-btn .icon { width: 17px; height: 17px; }

.rf-claim-hint { margin: 12px 0 0; font-size: 0.8rem; color: #93a2b6; text-align: center; }

.rf-key-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: rgba(16, 24, 37, 0.72); border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}
.rf-key-card:last-child { margin-bottom: 0; }
.rf-key-card .badge {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-content: center;
  background: var(--rf-gold-soft); color: var(--rf-gold);
}
.rf-key-card .badge .icon { width: 18px; height: 18px; }
.rf-key-card.pending .badge { background: rgba(255, 255, 255, 0.06); color: #9aa6b5; }
.rf-key-card b { display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.94rem; color: #f7e3b4; letter-spacing: 0.06em; word-break: break-all; }
.rf-key-card small { display: block; color: #93a2b6; font-size: 0.75rem; margin-top: 3px; }

/* --------------------------------------------------------------- landing */

.rf-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.rf-step { padding: 22px; border-radius: 18px; background: rgba(20, 31, 46, 0.7); border: 1px solid rgba(255, 255, 255, 0.08); }
.rf-step .n {
  display: inline-grid; place-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(150deg, #f2dcaa, #e5bf77); color: #2a2013; font-weight: 800; font-size: 0.85rem; margin-bottom: 12px;
}
.rf-step h3 { margin: 0 0 8px; font-family: Cinzel, Georgia, serif; font-size: 1rem; color: #f7f2e7; }
.rf-step p { margin: 0; font-size: 0.88rem; color: var(--ink-2); line-height: 1.6; }

.rf-qualify { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.rf-qualify-card {
  display: flex; gap: 14px; padding: 20px; border-radius: 18px;
  background: linear-gradient(170deg, rgba(28, 41, 57, 0.82), rgba(16, 24, 37, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.rf-qualify-card .badge { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-content: center; background: var(--rf-gold-soft); color: var(--rf-gold); }
.rf-qualify-card .badge .icon { width: 20px; height: 20px; }
.rf-qualify-card h3 { margin: 0 0 6px; font-size: 0.98rem; color: #f7f2e7; }
.rf-qualify-card p { margin: 0; font-size: 0.86rem; color: var(--ink-2); line-height: 1.55; }

@media (max-width: 900px) {
  .rf-hero-inner { grid-template-columns: minmax(0, 1fr); padding: 26px 22px; }
  .rf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rf-milestone-card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .rf-keys { grid-template-columns: minmax(0, 1fr); }
  .rf-steps, .rf-qualify { grid-template-columns: minmax(0, 1fr); }
  .rf-player { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); row-gap: 10px; }
  .rf-verdict { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .rf-ring .bar, .rf-claim-btn { transition: none; }
}
