/* ===== Referrals v2 (pages/referrals.js) ===== */
.rf-label { font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted, #9aa3b2); }
.rf-hint { font-size: .82rem; color: var(--muted, #9aa3b2); }
.rf-coin { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: var(--gold, #ffd23d); }
.rf-coin-i { display: inline-flex; width: 1.05em; height: 1.05em; }
.rf-coin-i svg { width: 100%; height: 100%; }
.rf-coin.xl { font-size: clamp(2rem, 5vw, 2.8rem); text-shadow: 0 0 24px rgba(255,210,61,.35); }
.rf-num { font-size: 1.35rem; font-weight: 900; }
.rf-loading { display: flex; gap: 8px; justify-content: center; padding: 60px 0; }
.rf-loading i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold, #ffd23d); animation: rf-dot .9s ease-in-out infinite; }
.rf-loading i:nth-child(2) { animation-delay: .15s; }
.rf-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes rf-dot { 50% { transform: translateY(-8px); opacity: .4; } }
.rf-hero, .rf-earn, .rf-steps, .rf-cash, .rf-panel, .rf-two { animation: rf-in .5s cubic-bezier(.2,1.2,.4,1) backwards; }
.rf-earn { animation-delay: .06s; } .rf-steps { animation-delay: .12s; } .rf-cash { animation-delay: .18s; } .rf-panel { animation-delay: .24s; } .rf-two { animation-delay: .3s; }
@keyframes rf-in { from { opacity: 0; transform: translateY(16px); } }

/* hero */
.rf-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 22px; padding: 28px; margin-bottom: 16px; border-radius: 24px; background: radial-gradient(120% 140% at 0% 0%, rgba(255,210,61,.16), transparent 55%), linear-gradient(140deg, #1d2140, #121527 60%, #0e1020); border: 1px solid rgba(255,210,61,.22); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.rf-hero-glow { position: absolute; right: -120px; top: -120px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(124,92,255,.35), transparent 65%); pointer-events: none; }
.rf-hero-main { position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rf-kick { align-self: flex-start; padding: 4px 12px; border-radius: 99px; font-size: .7rem; font-weight: 900; letter-spacing: .18em; text-transform: uppercase; color: #ffe27a; background: rgba(255,210,61,.12); border: 1px solid rgba(255,210,61,.35); }
.rf-h2 { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.15; }
.rf-h2 em { font-style: normal; background: linear-gradient(180deg, #fff3b0, #ffd23d 60%, #e8a21a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rf-codebox { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.08); }
.rf-codebox-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rf-code { padding: 6px 16px; border-radius: 12px; font: 900 1.6rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: #fff; background: repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 8px, transparent 8px 16px), rgba(255,210,61,.1); border: 2px dashed rgba(255,210,61,.55); word-break: break-all; }
.rf-link { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.05); color: var(--muted, #9aa3b2); font-size: .85rem; }
.rf-link .icon { flex: none; width: 16px; height: 16px; }
.rf-link-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.rf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rf-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 800; color: #2a1a00; background: linear-gradient(180deg, #ffe58a, #ffc93a 60%, #e79a12); box-shadow: 0 4px 0 #8a5a06, 0 8px 20px rgba(255,200,61,.25); transition: transform .12s, box-shadow .12s, background .2s; }
.rf-btn .icon { width: 16px; height: 16px; }
.rf-btn:hover { transform: translateY(-1px); }
.rf-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #8a5a06; }
.rf-btn.ghost { color: #fff; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.16); }
.rf-btn.done { color: #052a17; background: linear-gradient(180deg, #8affc1, #2ee59d); box-shadow: 0 4px 0 #0e7a4a; }
.rf-btn:focus-visible, .rf-claim:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.rf-perks { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.rf-perk { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.rf-perk-i { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: #ffd23d; background: rgba(255,210,61,.12); }
.rf-perk-i svg { width: 20px; height: 20px; }
.rf-perk div { display: flex; flex-direction: column; }
.rf-perk b { font-size: 1.2rem; font-weight: 900; }
.rf-perk span { font-size: .78rem; color: var(--muted, #9aa3b2); }

/* earnings */
.rf-earn { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; margin-bottom: 16px; }
.rf-claimcard { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px; border-radius: 22px; background: linear-gradient(160deg, rgba(46,229,157,.1), rgba(255,255,255,.02)); border: 1px solid rgba(46,229,157,.25); }
.rf-claimcard.ready { box-shadow: 0 0 40px rgba(46,229,157,.15); }
.rf-claim { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; padding: 12px 22px; border: 0; border-radius: 14px; cursor: pointer; font-weight: 900; font-size: 1rem; color: #052a17; background: linear-gradient(180deg, #8affc1, #2ee59d 60%, #13b877); box-shadow: 0 4px 0 #0b6b40, 0 10px 24px rgba(46,229,157,.3); transition: transform .12s; }
.rf-claim .icon { width: 18px; height: 18px; }
.rf-claimcard.ready .rf-claim { animation: rf-pulse 1.8s ease-in-out infinite; }
@keyframes rf-pulse { 50% { box-shadow: 0 4px 0 #0b6b40, 0 0 34px rgba(46,229,157,.6); } }
.rf-claim:hover:not(:disabled) { transform: translateY(-1px); }
.rf-claim:disabled { cursor: default; color: var(--muted, #9aa3b2); background: rgba(255,255,255,.06); box-shadow: none; }
.rf-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rf-stat { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); min-width: 0; }
.rf-stat > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rf-stat .rf-coin { font-size: 1.2rem; }
.rf-stat-i { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: #b9a6ff; background: rgba(124,92,255,.15); }
.rf-stat-i svg { width: 18px; height: 18px; }

/* steps */
.rf-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; counter-reset: rf; }
.rf-step { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.rf-step:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 50%; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%; font-size: .8rem; color: #ffd23d; background: #1a1d30; border: 1px solid rgba(255,210,61,.35); }
.rf-step-n { position: absolute; right: 14px; top: 10px; font-size: 2rem; font-weight: 900; color: rgba(255,255,255,.06); }
.rf-step-i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #ffd23d; background: rgba(255,210,61,.12); }
.rf-step-i svg { width: 18px; height: 18px; }
.rf-step b { margin-top: 4px; }
.rf-step > span:last-child { font-size: .82rem; color: var(--muted, #9aa3b2); }

/* cashback */
.rf-cash { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; margin-bottom: 16px; border-radius: 18px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.rf-cash-top { display: flex; align-items: baseline; gap: 10px; }
.rf-cash-v { font-size: 1.4rem; font-weight: 900; color: #b9a6ff; }
.rf-cash-max { font-size: .85rem; color: var(--muted, #9aa3b2); }
.rf-bar { height: 12px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); }
.rf-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7c5cff, #b388ff, #ffd23d); box-shadow: 0 0 14px rgba(179,136,255,.5); animation: rf-grow 1s .3s cubic-bezier(.2,1,.3,1) backwards; }
@keyframes rf-grow { from { width: 0; } }

/* panels + friends */
.rf-panel { padding: 18px 20px; margin-bottom: 16px; border-radius: 20px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.07); }
.rf-panel-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rf-panel-h h2 { margin: 0; font-size: 1.05rem; }
.rf-pill { padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 800; background: rgba(255,255,255,.08); }
.rf-friends { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.rf-friend { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.035); transition: background .15s; }
.rf-friend:hover { background: rgba(255,255,255,.06); }
.rf-friend-n { display: flex; flex-direction: column; min-width: 0; }
.rf-friend-n b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-friend-n span, .rf-friend-v span { font-size: .74rem; color: var(--muted, #9aa3b2); }
.rf-friend-v { display: flex; flex-direction: column; align-items: flex-end; min-width: 90px; font-weight: 800; }
.rf-friend-v.win b { color: #2ee59d; }
.rf-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 10px; text-align: center; }
.rf-empty span:last-child { max-width: 340px; font-size: .85rem; color: var(--muted, #9aa3b2); }
.rf-empty-i { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; color: #ffd23d; background: rgba(255,210,61,.1); }
.rf-empty-i svg { width: 26px; height: 26px; }
.rf-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rf-two .rf-panel { margin-bottom: 0; animation: none; }
.rf-form { display: flex; gap: 8px; margin-top: 10px; }
.rf-form .input { flex: 1; min-width: 0; text-transform: uppercase; }
.rf-done { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; color: #c9ffe6; background: rgba(46,229,157,.1); border: 1px solid rgba(46,229,157,.25); }
.rf-done .icon { flex: none; width: 18px; height: 18px; color: #2ee59d; }

@media (max-width: 860px) {
  .rf-hero, .rf-earn, .rf-two { grid-template-columns: 1fr; }
  .rf-steps { grid-template-columns: 1fr; }
  .rf-step:not(:last-child)::after { content: "↓"; right: 50%; top: auto; bottom: -11px; margin: 0 -11px 0 0; }
}
@media (max-width: 520px) {
  .rf-hero { padding: 18px; }
  .rf-stats { grid-template-columns: 1fr; }
  .rf-friend { grid-template-columns: auto minmax(0, 1fr) auto; }
  .rf-friend-v:not(.win) { display: none; }
}
body.calm .rf-claimcard.ready .rf-claim, body.calm .rf-loading i { animation: none; }
