/* ================= Реферальная программа (/ru/referral/) ================= */
.ref-off .ref-cta, .ref-on .ref-soon, .ref-on .ref-soon-note { display: none !important; }
.ref-soon { opacity: .7; cursor: default; }
.ref-soon-note { margin-top: 12px; color: var(--dim); font-size: 14px; }
.ref-hero { padding: calc(var(--hh) + 40px) 0 60px; min-height: 100svh; display: flex; align-items: center; overflow: hidden; }
.ref-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.ref-title { font-size: clamp(40px, 5vw, 76px); line-height: .95; text-transform: uppercase; }
.ref-hl { color: var(--mint); text-shadow: 0 0 40px var(--mint-glow); white-space: nowrap; }
.ref-life { margin-top: 14px; font: 700 clamp(22px, 2.4vw, 30px) var(--display); text-transform: uppercase; letter-spacing: .04em; background: linear-gradient(90deg, var(--mint), #b8ffe0 50%, var(--mint)); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: ref-shine 4s linear infinite; }
@keyframes ref-shine { to { background-position: -200% 0; } }
.ref-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.ref-cta svg { width: 20px; height: 20px; }
.ref-copy .plat-perks { margin-top: 26px; }
.plat-perks span span { all: unset; }

/* Орбиты: bibi в центре, друзья вокруг, бонусы летят к центру */
.ref-orbit { position: relative; width: min(520px, 100%); aspect-ratio: 1; margin: 0 auto 64px; --R1: 34%; --R2: 47%; }
.ro-ring { position: absolute; inset: 50% auto auto 50%; border-radius: 50%; border: 1px dashed rgba(255, 255, 255, .14); translate: -50% -50%; }
.ro-ring1 { width: calc(var(--R1) * 2); height: calc(var(--R1) * 2); }
.ro-ring2 { width: calc(var(--R2) * 2); height: calc(var(--R2) * 2); border-color: rgba(62, 240, 160, .16); }
.ro-glow { position: absolute; inset: 22%; border-radius: 50%; background: radial-gradient(circle, rgba(62, 240, 160, .28), transparent 65%); filter: blur(10px); animation: ro-breathe 4s ease-in-out infinite; }
@keyframes ro-breathe { 50% { transform: scale(1.12); opacity: .7; } }
.ro-spin { position: absolute; inset: 0; animation: ro-rot 60s linear infinite; }
.ro-f { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform: rotate(var(--a)) translateX(var(--R)) rotate(calc(-1 * var(--a))); }
.ro-r1 { --R: calc(var(--orbit, 520px) * .34); } .ro-r2 { --R: calc(var(--orbit, 520px) * .47); }
.ro-f i, .ro-f em { position: absolute; left: 0; top: 0; animation: ro-rot 60s linear infinite reverse; }
.ro-f i { display: grid; place-items: center; width: 50px; height: 50px; margin: -25px 0 0 -25px; border-radius: 50%; font: 700 20px var(--display); font-style: normal; color: #050507; background: hsl(var(--h) 80% 72%); box-shadow: 0 0 0 4px rgba(5, 5, 7, .9), 0 0 0 5px rgba(255, 255, 255, .14); transition: box-shadow .3s, transform .3s; }
.ro-f em { margin: 30px 0 0 -40px; width: 80px; text-align: center; font-size: 12px; font-style: normal; color: var(--dim); }
.ro-f.is-pay i { box-shadow: 0 0 0 4px rgba(5, 5, 7, .9), 0 0 0 6px var(--mint), 0 0 30px var(--mint-glow); transform: scale(1.12); }
@keyframes ro-rot { to { transform: rotate(360deg); } }
.ro-core { position: absolute; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; translate: -50% -50%; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #8dffd0, var(--mint) 60%); color: #050507; box-shadow: 0 0 0 12px rgba(62, 240, 160, .1), 0 0 90px var(--mint-glow); }
.ro-core.is-hit { animation: ro-hit .5s var(--ease); }
@keyframes ro-hit { 40% { transform: scale(1.12); } }
.ro-face { width: 62%; }
.ro-face .face { width: 100%; height: auto; }
.ro-face .face-eyes { opacity: 0; }
.ro-bal { position: absolute; left: 50%; bottom: -56px; translate: -50% 0; z-index: 2; display: grid; justify-items: center; padding: 10px 20px; border-radius: 18px; background: rgba(11, 12, 16, .9); border: 1px solid rgba(62, 240, 160, .4); box-shadow: 0 20px 50px -20px var(--mint-glow); white-space: nowrap; }
.ro-bal small { color: var(--muted); font-size: 12.5px; }
.ro-bal b { font: 700 28px var(--display); color: var(--mint); font-variant-numeric: tabular-nums; }
.ro-coin { position: absolute; left: 0; top: 0; z-index: 3; padding: 5px 10px; border-radius: 999px; background: var(--mint); color: #050507; font: 700 14px var(--display); white-space: nowrap; pointer-events: none; box-shadow: 0 6px 20px -4px var(--mint-glow); will-change: transform, opacity; }

/* Калькулятор */
.calc-card { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-radius: 28px; border: 1px solid var(--line-hi); background: radial-gradient(70% 90% at 100% 0%, rgba(62, 240, 160, .14), transparent 60%), var(--card); overflow: hidden; }
.calc-in { padding: 34px; display: grid; gap: 12px; align-content: start; }
.calc-lbl { display: flex; justify-content: space-between; align-items: baseline; font: 700 15px var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.calc-lbl b { font-size: 44px; color: var(--text); letter-spacing: 0; font-variant-numeric: tabular-nums; }
.calc-range { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; margin: 8px 0 0; border-radius: 999px; background: linear-gradient(90deg, var(--mint) var(--v), rgba(255, 255, 255, .1) var(--v)); outline: none; cursor: pointer; }
.calc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 6px solid var(--mint); box-shadow: 0 0 0 6px rgba(62, 240, 160, .18), 0 6px 20px -4px var(--mint-glow); transition: transform .2s; }
.calc-range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 6px solid var(--mint); }
.calc-range:active::-webkit-slider-thumb { transform: scale(1.15); }
.calc-range:focus-visible::-webkit-slider-thumb { outline: 2px solid #fff; outline-offset: 3px; }
.calc-scale { display: flex; justify-content: space-between; color: var(--dim); font-size: 12.5px; margin-bottom: 14px; }
.ref-plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ref-plan { padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line-hi); font-size: 14.5px; transition: border-color .25s, background .25s; }
.ref-plan.is-on { border-color: var(--mint); background: rgba(62, 240, 160, .1); color: var(--mint); }
.calc-out { position: relative; padding: 34px; display: grid; align-content: start; gap: 10px; border-left: 1px solid var(--line); background: rgba(5, 5, 7, .35); }
.calc-big small { color: var(--muted); font-size: 15px; }
.calc-big b { display: block; font: 700 clamp(48px, 6vw, 84px)/1 var(--display); color: var(--mint); text-shadow: 0 0 50px var(--mint-glow); font-variant-numeric: tabular-nums; }
.calc-row { display: flex; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }
.calc-row b { font: 700 22px var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.calc-covers { color: var(--text); font-size: 15px; }
.calc-covers:empty { display: none; }
.calc-bars { display: flex; align-items: flex-end; gap: 6px; height: 70px; margin-top: 6px; }
.calc-bars i { flex: 1; height: calc((var(--i) + 1) / 12 * 100%); border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--mint), rgba(62, 240, 160, .15)); transform-origin: bottom; transform: scaleY(var(--s, 1)); transition: transform .5s var(--ease); transition-delay: calc(var(--i) * 25ms); }
.calc-bars i.is-off { opacity: .15; }
.calc-note { margin-top: 16px; color: var(--dim); font-size: 14px; max-width: 760px; }

/* Шаги */
.ref-steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: s; }
.ref-step { position: relative; padding: 28px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); overflow: hidden; }
.ref-step::before { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--mint), transparent); transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .2s; }
.ref-step.is-in::before { transform: none; }
.ref-step-n { display: block; font: 700 54px/1 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--mint); margin-bottom: 18px; }
.ref-step h3 { font-size: 24px; text-transform: uppercase; }
.ref-step p { margin-top: 8px; color: var(--muted); }

/* Подарок другу */
.ref-friend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.gift { position: relative; display: grid; place-items: center; min-height: 340px; }
.gift-card { position: relative; overflow: hidden; display: grid; justify-items: start; gap: 4px; width: min(380px, 100%); padding: 28px; border-radius: 26px; background: linear-gradient(135deg, #3ef0a0, #20b97a 55%, #0e7a50); color: #050507; transform: rotate(-6deg); box-shadow: 0 40px 90px -30px var(--mint-glow); animation: gift-float 5s var(--ease-io, ease-in-out) infinite; }
@keyframes gift-float { 50% { transform: rotate(-3deg) translateY(-10px); } }
.gift-from { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.gift-from .face { width: 30px; height: 30px; }
.gift-from .face-eyes { opacity: 0; }
.gift-card b { font: 700 clamp(48px, 5.4vw, 76px)/1 var(--display); margin-top: 22px; white-space: nowrap; }
.gift-card > small { font-size: 18px; font-weight: 500; }
.gift-shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%); transform: translateX(-120%); animation: gift-shine 3.5s ease-in-out infinite 1s; }
@keyframes gift-shine { 40%, 100% { transform: translateX(120%); } }
.gift-conf { position: absolute; width: 10px; height: 16px; border-radius: 3px; background: var(--mint); animation: conf 3.2s ease-in-out infinite; }
.gift-conf:nth-child(2) { left: 12%; top: 18%; background: #fff; animation-delay: .3s; }
.gift-conf:nth-child(3) { right: 10%; top: 12%; background: #f5c451; animation-delay: .9s; }
.gift-conf:nth-child(4) { left: 18%; bottom: 12%; background: #7cc8ff; animation-delay: 1.4s; }
.gift-conf:nth-child(5) { right: 16%; bottom: 18%; animation-delay: .6s; }
.gift-conf:nth-child(6) { left: 46%; top: 4%; background: #ff8ab3; animation-delay: 1.9s; }
.gift-conf:nth-child(7) { right: 40%; bottom: 2%; background: #fff; animation-delay: 2.3s; }
@keyframes conf { 50% { transform: translateY(-16px) rotate(180deg); } }

/* Куда тратить */
.ref-spend-grid { margin-top: 40px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ref-spend-card { display: grid; gap: 10px; align-content: start; padding: 28px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); }
.ref-spend-card.is-cash { border-style: dashed; }
.ref-spend-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: rgba(62, 240, 160, .12); color: var(--mint); }
.ref-spend-ic svg { width: 26px; height: 26px; }
.ref-spend-card h3 { font-size: 22px; text-transform: uppercase; margin-top: 6px; }
.ref-spend-card p { color: var(--muted); }
.ref-spend-card .link { display: inline-flex; align-items: center; gap: 8px; }
.ref-spend-card .link svg { width: 18px; height: 18px; }

/* Окно «Ваша ссылка» */
.ref-code { position: relative; display: block; }
.ref-code input { position: absolute; inset: 0; width: 100%; opacity: 0; font-size: 16px; }
.ref-code span { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; pointer-events: none; }
.ref-code i { display: grid; place-items: center; height: 58px; border-radius: 14px; border: 1px solid var(--line-hi); background: rgba(255, 255, 255, .04); font: 700 26px var(--display); font-style: normal; transition: border-color .2s; }
.ref-code i.is-cur { border-color: var(--mint); box-shadow: 0 0 0 4px rgba(62, 240, 160, .14); }
.ref-code.is-bad i { border-color: #ff7a7a; animation: shake .4s; }
.ref-code-links { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.ref-code-links button:disabled { color: var(--dim); cursor: default; }
.ref-link { display: flex; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 16px; border: 1px solid var(--mint); background: rgba(62, 240, 160, .07); }
.ref-link input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: 500 16px var(--body, inherit); outline: none; }
.ref-share { display: grid; grid-template-columns: 1fr; gap: 8px; }
.ref-share:has([data-native]:not([hidden])) { grid-template-columns: 1fr 1fr; }
.ref-share .btn { justify-content: center; padding: 13px 14px; font-size: 15px; border-radius: 14px; }
.ref-share svg { width: 18px; height: 18px; }
.ref-qr { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 16px; border: 1px solid var(--line); }
.ref-qr [data-qr] { width: 120px; height: 120px; padding: 6px; border-radius: 12px; background: #fff; }
.ref-qr [data-qr] svg { width: 100%; height: 100%; display: block; }
.ref-qr p { color: var(--muted); font-size: 14px; }
.ref-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ref-stats span { display: grid; justify-items: center; padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, .04); text-align: center; }
.ref-stats b { font: 700 18px var(--display); }
.ref-stats small { color: var(--dim); font-size: 11.5px; line-height: 1.2; }
.ref-dlg [data-install] { margin-top: 6px; }

@media (max-width: 1024px) {
  .ref-hero-grid, .ref-friend-grid { grid-template-columns: 1fr; }
  .ref-orbit { width: min(420px, 100%); order: -1; }
  .ref-steps, .ref-spend-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .ref-hero { min-height: 0; padding-top: calc(var(--hh) + 8px); padding-bottom: 40px; }
  .ref-hero-grid { gap: 10px; }
  .ref-orbit { width: min(260px, 70%); margin-bottom: 56px; }
  .ref-title { font-size: clamp(32px, 9vw, 44px); }
  .ref-life { margin-top: 8px; }
  .ref-hero .lead { font-size: 15px; margin-top: 14px; order: 5; }
  .ref-copy { display: flex; flex-direction: column; }
  .ref-copy .badge { display: none; }
  .ref-copy .plat-perks { order: 6; margin-top: 16px; }
  .ref-copy .ref-soon-note { order: 4; }
  .ro-f i { width: 34px; height: 34px; margin: -17px 0 0 -17px; font-size: 14px; box-shadow: 0 0 0 3px rgba(5, 5, 7, .9), 0 0 0 4px rgba(255, 255, 255, .14); }
  .ro-bal { bottom: -50px; }
  .ro-f em { display: none; }
  .ro-bal { padding: 8px 14px; } .ro-bal b { font-size: 22px; }
  .ref-actions { margin-top: 22px; } .ref-actions .btn { flex: 1 1 100%; }
  .calc-card { grid-template-columns: 1fr; }
  .calc-in, .calc-out { padding: 22px; }
  .calc-out { border-left: 0; border-top: 1px solid var(--line); }
  .ref-plans { grid-template-columns: repeat(2, 1fr); }
  .gift { min-height: 260px; }
  .ref-qr { grid-template-columns: 96px 1fr; } .ref-qr [data-qr] { width: 96px; height: 96px; }
  .ref-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .ro-spin, .ro-f i, .ro-f em, .ro-glow, .gift-card, .gift-shine, .gift-conf, .ref-life { animation: none !important; }
}
.ref-dlg .pay-step, .ref-link, .ref-share .btn { min-width: 0; }
.ref-link .btn { flex: none; }
.ref-share .btn { white-space: normal; text-align: center; line-height: 1.2; }
.calc-range { height: 30px; padding: 10px 0; background-clip: content-box; box-sizing: border-box; }
.ref-spend-card .link { min-height: 44px; }

/* Доверие */
.ref-trust { position: relative; z-index: 1; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.ref-trust-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding: 20px 0; }
.ref-trust span { display: inline-flex; align-items: center; gap: 9px; color: var(--muted); font-size: 15px; }
.ref-trust svg { width: 17px; height: 17px; color: var(--mint); flex: none; }
/* Партнёрам */
.rpx-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: clamp(26px, 4vw, 54px); border-radius: 32px; border: 1px solid rgba(62, 240, 160, .35); background: radial-gradient(70% 90% at 0% 0%, rgba(62, 240, 160, .16), transparent 60%), var(--card); }
.rpx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rpx-list li { display: grid; gap: 4px; padding: 18px 20px 18px 56px; border-radius: 18px; border: 1px solid var(--line); background: rgba(5, 5, 7, .4); position: relative; }
.rpx-list li::before { content: ""; position: absolute; left: 20px; top: 22px; width: 20px; height: 20px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 16px var(--mint-glow); -webkit-mask: radial-gradient(circle, #000 35%, transparent 37%), linear-gradient(#000, #000); }
.rpx-list b { font-size: 18px; font-weight: 700; }
.rpx-list small { color: var(--muted); font-size: 14.5px; }
.rpx-list li[data-pcash] { border-style: dashed; }
/* Липкая кнопка (телефон) */
.ref-sticky { position: fixed; left: 16px; right: 16px; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 40; display: none; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: 18px; background: var(--mint); color: #050507; font: 700 17px var(--body, inherit); box-shadow: 0 16px 40px -12px var(--mint-glow); transform: translateY(140%); transition: transform .45s var(--ease); }
.ref-sticky svg { width: 20px; height: 20px; }
.ref-sticky.is-on { transform: none; }
@media (max-width: 860px) {
  .ref-on .ref-sticky { display: flex; }
  .rpx-card { grid-template-columns: 1fr; gap: 24px; }
  .ref-trust-in { display: grid; grid-template-columns: 1fr 1fr; padding: 16px 0; }
  .ref-trust span { font-size: 13px; align-items: flex-start; }
}
.calc-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.calc-big small { font-size: 20px; color: var(--text); }
.calc-avg { color: var(--muted); font-size: 15px; } .calc-avg[hidden], .calc-row[hidden] { display: none; }
.calc-formula { padding: 10px 12px; border-radius: 12px; background: rgba(62, 240, 160, .07); color: var(--text); font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; }
