:root {
  --bg: #0f0f10;
  --card: #1b1b1d;
  --card-2: #232326;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #fff;
  --muted: #8e8e93;
  --muted-2: #5f5f64;
  --blue: #2f8bff;
  --blue-2: #1f74ee;
  --blue-dim: #173f6e;
  --gold: #ffb21a;
  --red: #ff453a;
  --green: #32d74b;
  --violet: #8f6cff;
  --r-xl: 30px;
  --r-l: 22px;
  --r-m: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --spring: cubic-bezier(.3, 1.35, .5, 1);
  --ease: cubic-bezier(.2, .85, .2, 1);
  --display: "Unbounded", "Inter", -apple-system, sans-serif;
  --font: "Inter", -apple-system, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }
em { font-style: normal; }

#app { max-width: 480px; margin: 0 auto; position: relative; min-height: 100vh; }
.sticker { pointer-events: none; }
.sticker svg { display: block; }

/* ---------- страницы ---------- */
.page { display: none; padding: 10px 12px calc(124px + var(--safe-b)); }
.page.is-active { display: block; animation: pageIn .38s var(--ease); }
.page--overlay { padding-bottom: calc(40px + var(--safe-b)); }
.page--overlay.is-active { animation: pageSlide .38s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pageSlide { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; gap: 8px; position: relative; z-index: 3; }
.topbar--split { justify-content: space-between; margin-bottom: 12px; }

/* ---------- сегмент ---------- */
.segmented {
  position: relative; flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  padding: 4px; border-radius: 999px;
  background: linear-gradient(180deg, #48484b, #363638);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.4);
}
.segmented__thumb {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: 999px; background: linear-gradient(180deg, #fff, #ececec);
  box-shadow: 0 3px 10px rgba(0,0,0,.3), inset 0 -1px 0 rgba(0,0,0,.08);
  transition: transform .45s var(--spring);
}
.segmented[data-index="1"] .segmented__thumb { transform: translateX(100%); }
.segmented.is-moving .segmented__thumb { animation: squish .45s var(--ease); }
@keyframes squish { 40% { scale: 1.12 .86; } }
.segmented__item {
  position: relative; z-index: 1; height: 40px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  font-weight: 700; font-size: 15px; color: rgba(20,20,20,.5); transition: color .25s; white-space: nowrap;
}
.segmented__item img { width: 18px; height: 18px; filter: grayscale(1) brightness(.35); opacity: .7; transition: filter .3s, opacity .3s, transform .4s var(--spring); }
.segmented__item.is-active { color: #111; }
.segmented__item.is-active img { filter: none; opacity: 1; transform: scale(1.12) rotate(-8deg); }

/* ---------- капсула баланса ---------- */
.balance-capsule {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  height: 48px; padding: 0 14px; border-radius: 999px;
  background: linear-gradient(180deg, #172440, #0e1626);
  box-shadow: inset 0 0 0 1px rgba(70,140,255,.28), inset 0 1px 0 rgba(255,255,255,.1), 0 6px 18px rgba(0,0,0,.4);
  font-weight: 700; font-size: 16px; white-space: nowrap;
  transition: transform .2s var(--spring), box-shadow .2s;
}
.balance-capsule .i { width: 17px; height: 17px; color: #fff; }
.balance-capsule:active { transform: scale(.94); }
.balance-capsule.is-bump { animation: bump .6s var(--spring); }
@keyframes bump { 30% { transform: scale(1.12); box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 26px rgba(47,139,255,.55); } }

.icon-btn {
  width: 52px; height: 48px; border-radius: 17px; display: grid; place-items: center;
  background: linear-gradient(180deg, #2c2c2f, #232325); box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 4px 14px rgba(0,0,0,.3);
  transition: transform .3s var(--spring);
}
.icon-btn:active { transform: scale(.92) rotate(-30deg); }
.icon-btn .i { width: 24px; height: 24px; color: #a8a8ad; }

/* ---------- hero ---------- */
.hero { position: relative; height: 252px; margin: 0 -12px; overflow: hidden; --glow: rgba(255, 168, 20, .38); }
.hero[data-theme="premium"] { --glow: rgba(40, 115, 255, .5); }
.hero__bg {
  position: absolute; inset: 0; background: url(../assets/icons/stars-bg.png) center 30% / 520px auto repeat;
  opacity: .5; -webkit-mask: radial-gradient(70% 70% at 50% 45%, #000 30%, transparent 75%); mask: radial-gradient(70% 70% at 50% 45%, #000 30%, transparent 75%);
  animation: drift 40s linear infinite; transition: filter .6s;
}
@keyframes drift { to { background-position: 520px 30%; } }
.hero[data-theme="premium"] .hero__bg { filter: hue-rotate(185deg) saturate(1.4); }
.hero__glow { position: absolute; inset: -30px -20px 0; background: radial-gradient(48% 52% at 50% 50%, var(--glow), transparent 70%); transition: background .6s; }
.hero__ring { position: absolute; left: 50%; top: 52%; width: 240px; height: 240px; margin: -120px 0 0 -120px; border-radius: 50%; border: 1px solid rgba(255,255,255,.05); box-shadow: 0 0 0 36px rgba(255,255,255,.015), 0 0 0 72px rgba(255,255,255,.01); }
.hero__art { position: absolute; left: 50%; top: 38px; width: 176px; height: 176px; margin-left: -88px; transition: opacity .45s, transform .7s var(--spring); filter: drop-shadow(0 16px 26px rgba(0,0,0,.5)) drop-shadow(0 0 30px var(--glow)); animation: heroFloat 5s ease-in-out infinite; }
.hero__art--premium { width: 168px; height: 168px; margin-left: -84px; top: 42px; }
@keyframes heroFloat { 0%, 100% { translate: 0 0; rotate: -4deg; } 50% { translate: 0 -9px; rotate: 4deg; } }
.hero__art--premium { opacity: 0; transform: scale(.5) rotate(-25deg); }
.hero[data-theme="premium"] .hero__art--stars { opacity: 0; transform: scale(.5) rotate(25deg); }
.hero[data-theme="premium"] .hero__art--premium { opacity: 1; transform: none; }
.hero__spark { position: absolute; width: 64px; height: 64px; opacity: .9; }
.hero__spark--1 { left: 8%; top: 96px; }
.hero__spark--2 { right: 11%; top: 30px; width: 44px; height: 44px; opacity: .7; }

/* ---------- карточка покупки ---------- */
.buy-card {
  position: relative; z-index: 2; margin-top: -26px;
  padding: 24px 16px 16px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, rgba(34,34,37,.82), rgba(25,25,27,.97) 100px, #19191b);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.11), inset 0 0 0 1px var(--line), 0 -10px 40px rgba(0,0,0,.35);
}
.buy-card__duck { position: absolute; right: 8px; top: -66px; width: 80px; height: 80px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.4)); }
.buy-card__title { margin: 0; text-align: center; font-size: clamp(21px, 6.5vw, 27px); white-space: nowrap; line-height: 1.15; font-weight: 800; letter-spacing: -.4px; }
.buy-card__subtitle { margin: 8px 0 20px; text-align: center; color: var(--muted); font-size: 15px; font-weight: 500; }

.pay-method { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px 10px 10px 14px; border-radius: var(--r-m); background: rgba(47,139,255,.07); box-shadow: inset 0 0 0 1px rgba(47,139,255,.22); cursor: pointer; }
.pay-method input { display: none; }
.radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #48484a; display: grid; place-items: center; flex: none; transition: border-color .2s; }
.radio::after { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--blue); transform: scale(0); transition: transform .3s var(--spring); }
input:checked + .radio, .is-selected .radio, .is-active > .radio { border-color: var(--blue); }
input:checked + .radio::after, .is-selected .radio::after, .is-active > .radio::after { transform: scale(1); }
.pay-method__logo { width: 40px; height: 40px; flex: none; }
.pay-method__text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pay-method__text b { font-size: 18px; }
.pay-method__text small { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 1px; }
.pay-method__top { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; background: var(--blue-2); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); transition: transform .25s var(--spring); }
.pay-method__top:active { transform: scale(.88); }
.pay-method__top .i { width: 20px; height: 20px; }

/* ---------- поля ---------- */
.field {
  display: flex; align-items: center; height: 56px; padding: 0 16px; margin-bottom: 12px;
  border-radius: var(--r-m); background: #141415;
  box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow .2s;
}
.field:focus-within { box-shadow: inset 0 0 0 1.5px var(--blue), 0 0 0 4px rgba(47,139,255,.12); }
.field.is-error { box-shadow: inset 0 0 0 1.5px var(--red); animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.field__prefix { color: var(--muted); font-size: 17px; margin-right: 4px; font-weight: 600; }
.field__icon { width: 22px; height: 22px; margin-right: 10px; }
.field__ico { width: 20px; height: 20px; color: var(--muted); margin-right: 10px; }
.field__input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 16px; font-weight: 500; }
.field__input::placeholder { color: #66666b; }
.field__input--code { text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }
.field__action { color: var(--blue); font-weight: 600; font-size: 16px; padding: 6px 0 6px 10px; white-space: nowrap; }

.recipient { display: flex; align-items: center; gap: 12px; margin: -2px 0 14px; padding: 8px 12px 8px 8px; border-radius: 16px; background: #141415; animation: pageIn .25s; }
.recipient__ava { width: 38px; height: 38px; border-radius: 50%; flex: none; background: linear-gradient(135deg, #5aa0ff, #2a62d8) center / cover; display: grid; place-items: center; font-weight: 700; }
.recipient__info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recipient__name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipient__hint { font-size: 13px; color: var(--muted); }
.recipient__state { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.recipient__state.is-ok { background: var(--green); animation: pop .4s var(--spring); }
.recipient__state.is-ok::after { content: ""; width: 14px; height: 14px; background: #fff; -webkit-mask: url(../assets/ui/check.svg) center/contain no-repeat; mask: url(../assets/ui/check.svg) center/contain no-repeat; }
.recipient__state.is-bad { background: var(--red); animation: pop .4s var(--spring); }
.recipient__state.is-bad::after { content: ""; width: 12px; height: 12px; background: #fff; -webkit-mask: url(../assets/ui/close.svg) center/contain no-repeat; mask: url(../assets/ui/close.svg) center/contain no-repeat; }
.recipient__state.is-loading { border: 2.5px solid rgba(255,255,255,.15); border-top-color: var(--blue); animation: spin .7s linear infinite; }
@keyframes pop { from { transform: scale(.3); } to { transform: none; } }

/* ---------- чипы ---------- */
.mode-panel { display: none; }
.mode-panel.is-active { display: block; animation: pageIn .3s; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips--center { justify-content: center; margin: 0 0 24px; padding: 0; flex-wrap: wrap; overflow: visible; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 16px 0 12px;
  border-radius: 999px; background: #fff; color: #111; font-weight: 700; font-size: 17px;
  transition: transform .25s var(--spring), background .2s, color .2s, box-shadow .2s;
}
.chip img { width: 20px; height: 20px; }
.chip:active { transform: scale(.92); }
.chip.is-active { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(47,139,255,.4); }
.chip--dark { background: #262628; color: #fff; padding: 0 16px 0 10px; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.chip--dark.is-active { background: rgba(47,139,255,.16); box-shadow: inset 0 0 0 1.5px var(--blue); }
.chip--dark img { width: 22px; height: 22px; }

/* ---------- тарифы ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.plan {
  position: relative; overflow: hidden; text-align: left; padding: 12px; min-height: 138px;
  border-radius: var(--r-m); background: #232326;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: box-shadow .25s, background .25s, transform .25s var(--spring);
}
.plan:active { transform: scale(.95); }
.plan__mark { position: absolute; right: -22px; bottom: -22px; width: 92px; height: 92px; opacity: .1; filter: grayscale(1) brightness(2); transition: opacity .3s, filter .3s, transform .5s var(--spring); }
.plan.is-selected { background: linear-gradient(180deg, #1f2a3d, #1a2030); box-shadow: inset 0 0 0 1.5px rgba(47,139,255,.6), 0 8px 24px rgba(47,139,255,.15); }
.plan.is-selected .plan__mark { opacity: .32; filter: none; transform: rotate(-12deg) scale(1.08); }
.plan__name { position: relative; display: flex; flex-direction: column; font-size: 14px; font-weight: 600; color: #c7c7cc; margin-top: 18px; line-height: 1.1; }
.plan__name b { font-size: 30px; font-weight: 800; color: #fff; letter-spacing: -.5px; }
.plan__price { position: relative; display: flex; align-items: center; gap: 4px; color: var(--blue); font-weight: 700; font-size: 17px; margin-top: 8px; }
.plan__price .i { width: 15px; height: 15px; }
.plan__per { position: relative; font-size: 11.5px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.plan__badge { position: absolute; top: 12px; right: 8px; font-size: 11px; font-weight: 800; padding: 3px 7px; border-radius: 8px; background: rgba(50,215,75,.16); color: var(--green); }

/* ---------- итог ---------- */
.summary { margin: 0 0 14px; padding: 4px 14px; border-radius: var(--r-m); background: #141415; box-shadow: inset 0 0 0 1px var(--line); animation: pageIn .25s; }
.summary__row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 38px; font-size: 14.5px; color: var(--muted); font-weight: 500; }
.summary__row b { color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.summary__row + .summary__row { border-top: 1px dashed rgba(255,255,255,.07); }
.summary__row--total b { font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; gap: 5px; }
.summary__row--total .i { width: 16px; height: 16px; color: var(--blue); }

.trust { display: flex; justify-content: center; gap: 14px; margin-top: 14px; color: var(--muted-2); font-size: 12.5px; font-weight: 600; flex-wrap: wrap; }
.trust span { display: inline-flex; align-items: center; gap: 4px; }
.trust .i { width: 14px; height: 14px; }

/* ---------- кнопки ---------- */
.btn {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; height: 60px; border-radius: 999px; font-weight: 700; font-size: 18px;
  transition: transform .25s var(--spring), background .25s, color .25s, opacity .25s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--primary { background: linear-gradient(180deg, #3a98ff, #2479ef); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 10px 28px rgba(36,121,239,.32); overflow: hidden; }
.btn--primary:not(:disabled):not(.is-dim)::before { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 60%, 100% { left: 130%; } }
.btn--primary:disabled, .btn--primary.is-dim { background: var(--blue-dim); color: rgba(255,255,255,.45); box-shadow: inset 0 1px 0 rgba(255,255,255,.07); cursor: default; }
.btn--primary.is-dim { cursor: pointer; }
.btn__sub { font-size: 13px; font-weight: 600; color: #ff5a50; margin-top: 1px; }
.btn.is-loading .btn__label, .btn.is-loading .btn__sub { opacity: 0; }
.btn.is-loading::after { content: ""; position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn .i { width: 21px; height: 21px; }
.btn--white { background: #fff; color: #111; flex-direction: row; gap: 8px; height: 56px; font-size: 17px; }
.btn--glass { flex-direction: row; gap: 8px; height: 56px; font-size: 17px; color: #fff; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), inset 0 1px 0 rgba(255,255,255,.3); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.btn--dark { background: #2a2a2d; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.08); }
.btn--sm { width: auto; height: 44px; padding: 0 22px; font-size: 15px; font-weight: 600; display: inline-flex; }
.btn--md { flex-direction: row; gap: 8px; height: 50px; font-size: 16px; }
.btn--square { width: 50px; height: 50px; flex: none; border-radius: 17px; }

/* ---------- профиль ---------- */
.profile-hero {
  position: relative; overflow: hidden; padding: 22px 14px 14px; border-radius: var(--r-xl); text-align: center;
  background:
    radial-gradient(70% 60% at 50% 0%, rgba(120,180,255,.5), transparent 70%),
    linear-gradient(180deg, #2167e6 0%, #1748ab 55%, #102c6a 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 12px 32px rgba(20,70,190,.28);
}
.profile-hero__pattern { position: absolute; inset: 0; }
.profile-hero__pattern img { position: absolute; opacity: .12; filter: brightness(0) invert(1); }
.profile-hero__duck { position: absolute; right: 4px; top: 6px; width: 80px; height: 80px; }
.profile-hero__ava {
  position: relative; width: 92px; height: 92px; margin: 0 auto; border-radius: 26px;
  background: linear-gradient(135deg, #6aa8ff, #2a5fd0) center / cover;
  box-shadow: 0 0 0 3px rgba(255,255,255,.3), 0 10px 26px rgba(0,0,0,.3);
  display: grid; place-items: center; font-size: 38px; font-weight: 800;
}
.profile-hero__name { position: relative; margin: 12px 0 6px; font-size: 25px; font-weight: 800; letter-spacing: -.3px; }
.profile-hero__level { position: relative; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 99px; background: rgba(255,255,255,.14); font-size: 13px; font-weight: 700; margin-bottom: 14px; box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.profile-hero__level .i { width: 15px; height: 15px; color: #ffd34d; }
.profile-hero__stats { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stat { padding: 10px 4px; border-radius: 18px; background: rgba(0,12,45,.25); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.stat b { font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.stat b img, .stat b .i { width: 16px; height: 16px; }
.stat span { font-size: 12px; color: rgba(255,255,255,.6); font-weight: 600; }

.balance-row { width: 100%; margin-top: 10px; display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-l); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: transform .25s var(--spring); }
.balance-row:active { transform: scale(.98); }
.balance-row__logo { width: 42px; height: 42px; }
.balance-row__text { flex: 1; display: flex; flex-direction: column; }
.balance-row__text small { color: var(--muted); font-size: 13px; font-weight: 600; }
.balance-row__text b { font-size: 19px; font-weight: 800; }
.balance-row__btn { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 8px 0 14px; border-radius: 99px; background: var(--blue-2); font-weight: 700; font-size: 14px; }
.balance-row__btn .i { width: 16px; height: 16px; }

.level { margin-top: 10px; padding: 16px; border-radius: var(--r-l); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.level__row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.level__caption { color: var(--muted); font-weight: 700; letter-spacing: .5px; }
.level__next { display: inline-flex; align-items: center; gap: 3px; color: #c7c7cc; }
.level__next b { color: #fff; }
.level__next .i { width: 12px; height: 12px; color: var(--blue); }
.level__value { margin: 8px 0 12px; font-size: 25px; font-weight: 800; }
.level__sep { color: var(--muted-2); }
.level__name { color: var(--green); }
.level__bar { height: 8px; border-radius: 8px; background: #2a2a2d; overflow: hidden; }
.level__bar span { display: block; height: 100%; width: 0; border-radius: 8px; background: linear-gradient(90deg, #2479ef, #5fb4ff); box-shadow: 0 0 12px rgba(47,139,255,.6); transition: width 1s var(--ease); }

.ref { position: relative; margin-top: 10px; padding: 16px; border-radius: var(--r-l); overflow: hidden; background: radial-gradient(90% 120% at 100% 0%, rgba(143,108,255,.22), transparent 60%), var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.ref__duck { position: absolute; right: -4px; top: -4px; width: 104px; height: 104px; }
.ref__body { padding-right: 96px; }
.ref__body b { display: block; font-size: 19px; font-weight: 800; }
.ref__body span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; line-height: 1.35; font-weight: 500; }
.ref__body em { color: #b9a6ff; font-weight: 800; }
.ref__stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 12px; }
.ref__stats div { padding: 10px 12px; border-radius: 16px; background: #141415; display: flex; flex-direction: column; }
.ref__stats b { font-size: 18px; display: inline-flex; align-items: center; gap: 4px; }
.ref__stats b .i { width: 14px; height: 14px; color: var(--blue); }
.ref__stats span { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.ref__actions { display: flex; gap: 8px; }

.menu { margin-top: 10px; border-radius: var(--r-l); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.menu__row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 14px; font-size: 16px; font-weight: 600; text-align: left; transition: background .15s; }
.menu__row:active { background: rgba(255,255,255,.04); }
.menu__row + .menu__row { box-shadow: 0 -1px 0 var(--line); }
.menu__ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.menu__ico .i { width: 19px; height: 19px; }
.menu__ico--blue { background: linear-gradient(180deg, #3d9bff, #1f74ee); }
.menu__ico--violet { background: linear-gradient(180deg, #a68aff, #7552f2); }
.menu__ico--cyan { background: linear-gradient(180deg, #4fd2ff, #19a6e6); }
.menu__ico--green { background: linear-gradient(180deg, #4ce06a, #22b14a); }
.menu__ico--red { background: linear-gradient(180deg, #ff6b62, #ec3a30); }
.menu__ico--gray { background: linear-gradient(180deg, #7c7c82, #55555a); }
.menu__chev { margin-left: auto; width: 18px; height: 18px; color: var(--muted-2); }

/* ---------- кошелёк ---------- */
.wallet { padding: 10px; border-radius: var(--r-xl); background: #1d1d1f; box-shadow: inset 0 0 0 1px var(--line); }
.wallet__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 10px 6px; }
.wallet__addr { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 16px; min-width: 0; }
.wallet__addr .i { width: 20px; height: 20px; }
.link { color: var(--blue); font-weight: 700; white-space: nowrap; }
.pill-blue { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--blue-2); font-weight: 700; font-size: 15px; white-space: nowrap; box-shadow: inset 0 1px 0 rgba(255,255,255,.22); }
.wallet__card {
  position: relative; overflow: hidden; padding: 16px 14px 14px; border-radius: 24px;
  background: linear-gradient(110deg, #262628 0%, #23324c 45%, #1f70e8 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}
.wallet__mark { position: absolute; right: -30px; top: -26px; width: 190px; height: 190px; opacity: .14; transform: rotate(12deg); filter: brightness(0) invert(1); }
.wallet__card-label { position: relative; color: #a1a1a6; font-weight: 700; font-size: 15px; }
.wallet__card-value { position: relative; font-size: 44px; font-weight: 800; letter-spacing: -.8px; margin: 2px 0 14px; }
.wallet__card-value em { color: #75757b; }
.wallet__actions { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.filters { display: flex; gap: 8px; overflow-x: auto; margin: 14px -12px 8px; padding: 0 12px 4px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px 0 12px; border-radius: 999px; background: #1f1f21; font-weight: 600; font-size: 14.5px; color: #d1d1d6; box-shadow: inset 0 0 0 1px var(--line); transition: background .2s, color .2s, transform .25s var(--spring); }
.filter:active { transform: scale(.94); }
.filter img, .filter .i { width: 17px; height: 17px; }
.filter.is-active { background: #fff; color: #111; }

.history__list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.tx { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-m); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); animation: pageIn .3s backwards; }
.tx__ico { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.tx__ico img { width: 26px; height: 26px; }
.tx__ico .i { width: 22px; height: 22px; }
.tx__ico--stars { background: rgba(255,178,26,.13); }
.tx__ico--premium { background: rgba(143,108,255,.15); }
.tx__ico--deposit { background: rgba(50,215,75,.13); color: var(--green); }
.tx__ico--promo { background: rgba(47,139,255,.15); color: var(--blue); }
.tx__main { flex: 1; min-width: 0; }
.tx__title { font-weight: 700; font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx__sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tx__sum { font-weight: 800; font-size: 15.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.tx__sum .i { width: 13px; height: 13px; color: var(--blue); }
.tx__sum.is-plus { color: var(--green); }

.empty { display: flex; flex-direction: column; align-items: center; padding: 14px 0 8px; }
.empty__duck { width: 150px; height: 150px; }
.empty__title { font-size: 20px; font-weight: 700; margin: 6px 0 14px; }

/* ---------- пополнение ---------- */
.page-title { margin: 4px 0 14px 4px; font-size: 30px; font-weight: 800; letter-spacing: -.4px; }
.methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.method { display: flex; align-items: center; gap: 10px; padding: 12px 10px 12px 12px; border-radius: var(--r-m); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); text-align: left; transition: box-shadow .2s, background .2s, transform .25s var(--spring); }
.method:active { transform: scale(.96); }
.method img { width: 36px; height: 36px; flex: none; }
.method__round { border-radius: 50%; }
.method > span:not(.radio) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.method b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method small { font-size: 11.5px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.method .radio { width: 20px; height: 20px; }
.method.is-active { background: rgba(47,139,255,.08); box-shadow: inset 0 0 0 1.5px var(--blue); }

.dep-card { display: none; padding: 20px 16px 16px; border-radius: var(--r-xl); background: #18181a; box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.dep-card.is-active { display: block; animation: pageIn .3s; }
.dep-card__caption { color: var(--muted); font-size: 14.5px; font-weight: 600; margin-bottom: 10px; }
.wallet-chip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 999px; background: #262628; box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 700; font-size: 16px; transition: transform .25s var(--spring); }
.wallet-chip:active { transform: scale(.95); }
.wallet-chip .i { width: 20px; height: 20px; color: var(--blue); }
.wallet-chip.is-empty { color: var(--blue); background: rgba(47,139,255,.1); box-shadow: inset 0 0 0 1px rgba(47,139,255,.35); }

.amount { display: flex; align-items: baseline; justify-content: center; gap: 12px; margin: 30px 0 26px; cursor: text; }
.amount__input { width: 1.2ch; min-width: 0; border: 0; outline: 0; background: transparent; text-align: right; font-size: 60px; font-weight: 800; letter-spacing: -1.5px; caret-color: var(--blue); padding: 0; }
.amount__cur { font-size: 42px; font-weight: 800; color: #6a6a70; }

.assets { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.asset { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 14px 0 6px; border-radius: 999px; background: #262628; font-weight: 700; font-size: 15px; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background .2s, transform .25s var(--spring); }
.asset:active { transform: scale(.93); }
.asset img { width: 30px; height: 30px; }
.asset.is-active { background: rgba(47,139,255,.12); box-shadow: inset 0 0 0 1.5px var(--blue); }
.cb-rate { margin: -14px 0 22px; color: var(--muted); font-weight: 600; }

/* ---------- таббар (liquid glass) ---------- */
.tabbar {
  position: fixed; z-index: 20; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; width: min(250px, calc(100% - 80px)); padding: 5px;
  border-radius: 999px; isolation: isolate;
  background: linear-gradient(180deg, rgba(70,70,76,.38), rgba(24,24,26,.5));
  backdrop-filter: blur(16px) saturate(190%) brightness(1.08); -webkit-backdrop-filter: blur(16px) saturate(190%) brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(255,255,255,.06),
    inset 1px 0 0 rgba(255,255,255,.07),
    inset -1px 0 0 rgba(255,255,255,.07),
    0 14px 36px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.3);
  transition: opacity .3s, transform .4s var(--ease);
}
.tabbar::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 90% at 50% -30%, rgba(255,255,255,.18), transparent 55%), radial-gradient(60% 80% at 50% 140%, rgba(47,139,255,.14), transparent 70%);
}
.tabbar.is-hidden { opacity: 0; pointer-events: none; transform: translate(-50%, 40px); }
.tabbar__thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px;
  background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,.16), rgba(255,255,255,.03) 60%), rgba(8,8,10,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), inset 0 0 0 1px rgba(255,255,255,.1), inset 0 -8px 14px rgba(47,139,255,.1), 0 4px 10px rgba(0,0,0,.25);
  transition: transform .5s var(--spring);
}
.tabbar[data-index="1"] .tabbar__thumb { transform: translateX(100%); }
.tabbar.is-moving .tabbar__thumb { animation: squish .5s var(--ease); }
.tab { position: relative; z-index: 1; height: 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #a9a9ae; transition: color .25s; }
.tab__ico { width: 25px; height: 25px; transition: transform .45s var(--spring); }
.tab__label { font-size: 12px; font-weight: 700; }
.tab.is-active { color: var(--blue); }
.tab.is-active .tab__ico, .tab.is-active .tab__ava { transform: scale(1.1); }
.tab__ava { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #6aa8ff, #2a5fd0) center / cover; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; box-shadow: 0 0 0 1.5px rgba(255,255,255,.25); transition: box-shadow .25s, transform .45s var(--spring); }
.tab.is-active .tab__ava { box-shadow: 0 0 0 2px var(--blue); }

/* ---------- шторки ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 31; left: 50%; bottom: 0; width: 100%; max-width: 480px;
  padding: 10px 18px calc(22px + var(--safe-b)); border-radius: 30px 30px 0 0;
  background: #1c1c1e; box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 -20px 50px rgba(0,0,0,.4);
  transform: translate(-50%, 105%); transition: transform .45s var(--ease);
  text-align: center;
}
.sheet.is-open { transform: translate(-50%, 0); }
.sheet__grip { width: 38px; height: 5px; border-radius: 5px; background: #3a3a3c; margin: 0 auto 6px; }
.sheet__close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: #2c2c2e; display: grid; place-items: center; color: #9a9aa0; }
.sheet__close .i { width: 16px; height: 16px; }
.sheet__duck { width: 120px; height: 120px; margin: 0 auto 2px; }
.sheet__duck--sm { width: 90px; height: 90px; }
.sheet__duck--lg { width: 150px; height: 150px; }
.sheet__title { margin: 4px 0 6px; font-size: 24px; font-weight: 800; }
.sheet__text { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.sheet__msg { min-height: 20px; margin: -2px 0 10px; font-size: 14px; font-weight: 600; }
.sheet__msg.is-bad { color: var(--red); }

.list { margin-top: 14px; border-radius: var(--r-m); background: #252527; overflow: hidden; text-align: left; }
.list__row { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 0 14px; font-size: 16px; font-weight: 600; cursor: pointer; }
.list__row + .list__row { box-shadow: 0 -1px 0 var(--line); }
.list__text { flex: 1; }
.list__value { color: var(--muted); font-weight: 500; }
.danger { color: var(--red); }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 30px; background: #3a3a3c; position: relative; cursor: pointer; transition: background .25s; margin: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .3s var(--spring); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.switch:checked { background: var(--green); }
.switch:checked::after { transform: translateX(20px); }

.toast { position: fixed; z-index: 40; left: 50%; top: 12px; transform: translate(-50%, -150%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 18px; background: rgba(40,40,44,.88); backdrop-filter: blur(16px) saturate(180%); -webkit-backdrop-filter: blur(16px) saturate(180%); box-shadow: inset 0 1px 0 rgba(255,255,255,.12), inset 0 0 0 1px var(--line), 0 10px 30px rgba(0,0,0,.45); font-weight: 600; font-size: 15px; transition: transform .45s var(--spring); }
.toast.is-show { transform: translate(-50%, 0); }

@media (max-width: 360px) {
  .plan__name { font-size: 15.5px; }
  .plan__price { font-size: 15px; }
  .chip { font-size: 15px; }
  .balance-capsule { padding: 0 12px; font-size: 14px; }
  .segmented__item { font-size: 14px; }
  .wallet__card-value { font-size: 36px; }
  .method small { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.chips--center { gap: 6px; flex-wrap: nowrap; }
.chips--center .chip { padding: 0 12px 0 8px; font-size: 16px; }
.dep-card__duck { width: 96px; height: 96px; margin: -6px auto 4px; }
.method .radio { display: none; }

/* ---------- загрузка (Cold Store) ---------- */
.splash {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: var(--bg); transition: opacity .3s ease, transform .3s var(--ease);
}
.splash.is-done { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.splash__center { display: flex; flex-direction: column; align-items: center; }
.splash__sticker { width: 148px; height: 148px; animation: splashIn .5s var(--spring) both; }
.splash__brand {
  margin-top: 14px; font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1; color: #fff;
  animation: splashUp .45s .06s var(--ease) both;
}
.splash__brand span { color: #1677ff; margin-left: 10px; }
.splash__bar {
  width: 168px; height: 12px; margin-top: 26px; padding: 3px; border-radius: 99px;
  background: #1c1c1f; box-shadow: inset 0 0 0 1px #2a2a2e;
  animation: splashUp .45s .12s var(--ease) both;
}
.splash__bar span {
  display: block; width: 8%; height: 100%; border-radius: 99px;
  background: repeating-linear-gradient(-45deg, #1677ff 0 6px, #2f86ff 6px 12px) 0 0 / 16.97px 100%;
  animation: barStripes .7s linear infinite; transition: width .2s linear;
}
@keyframes barStripes { to { background-position: 16.97px 0; } }
@keyframes splashIn { from { opacity: 0; transform: scale(.7); } }
@keyframes splashUp { from { opacity: 0; transform: translateY(8px); } }

/* сине-белые ленты сверху и снизу */
.tape {
  position: absolute; left: -10%; width: 120%; height: 54px; display: flex; align-items: center; overflow: hidden;
  background: #1677ff; border-top: 5px solid #fff; border-bottom: 5px solid #fff; box-sizing: content-box;
}
.tape--top { top: calc(70px + env(safe-area-inset-top, 0px)); transform: rotate(-4deg); }
.tape--bottom { bottom: calc(80px + var(--safe-b)); transform: rotate(4deg); background: #fff; border-color: #1677ff; }
.tape__track { display: flex; flex: none; align-items: center; gap: 20px; padding-right: 20px; white-space: nowrap; color: #fff; font-size: 20px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; animation: tapeMove 16s linear infinite; }
.tape--bottom .tape__track { color: #1677ff; animation-direction: reverse; }
.tape__track i { width: 18px; height: 18px; flex: none; background: currentColor; -webkit-mask: url(../assets/icons/GoldStarFill.svg) center/contain no-repeat; mask: url(../assets/icons/GoldStarFill.svg) center/contain no-repeat; }
@keyframes tapeMove { to { transform: translateX(-50%); } }

/* ---------- шрифт заголовков ---------- */
.buy-card__title, .page-title, .profile-hero__name, .wallet__card-value, .sheet__title, .level__value, .plan__name b, .amount__input, .amount__cur, .balance-row__text b, .empty__title, .ref__body b {
  font-family: var(--display); letter-spacing: -.3px;
}
.buy-card__title { font-size: clamp(17px, 5vw, 22px); }
.page-title { font-size: 26px; }
.profile-hero__name { font-size: 22px; }
.wallet__card-value { font-size: 36px; }
.sheet__title { font-size: 21px; }
.level__value { font-size: 22px; }
.plan__name b { font-size: 26px; }
.amount__input { font-size: 52px; letter-spacing: -1px; }
.amount__cur { font-size: 34px; }

/* ---------- возврат при ошибке выдачи ---------- */
.refund-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; background: rgba(50,215,75,.14); color: var(--green); font-size: 13px; font-weight: 700; }
.refund-badge .i { width: 15px; height: 15px; }
.sheet--refund .sheet__title { margin-top: 10px; }
.refund-box { margin: 0 0 16px; padding: 4px 14px; border-radius: var(--r-m); background: #141415; box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.refund-box__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; font-size: 14.5px; color: var(--muted); font-weight: 500; }
.refund-box__row + .refund-box__row { border-top: 1px dashed rgba(255,255,255,.07); }
.refund-box__row b { color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; text-align: right; }
.refund-box__row b.is-plus { color: var(--green); font-size: 17px; }
.refund-box__row b .i { width: 14px; height: 14px; color: var(--blue); }
.refund-box__id { display: inline-flex; align-items: center; gap: 6px; color: var(--blue); font-weight: 700; font-family: ui-monospace, monospace; }
.refund-box__id .i { width: 15px; height: 15px; }
.refund-actions { display: grid; gap: 8px; }
.refund-actions .btn--dark { flex-direction: row; gap: 8px; height: 52px; font-size: 16px; }
body:has(.splash) { overflow: hidden; }


/* ---------- длинные тексты и широкий шрифт ---------- */
/* элементы с data-fit уменьшают шрифт, если текст не помещается (см. fitText в app.js) */
[data-fit] { white-space: nowrap; overflow: hidden; text-overflow: clip; max-width: 100%; }
.topbar .segmented { min-width: 0; }
.topbar .balance-capsule { max-width: 48%; min-width: 0; }
.balance-capsule span { overflow: hidden; text-overflow: ellipsis; }
.buy-card__title { display: block; padding: 0 2px; }
.profile-hero__name { display: block; padding: 0 8px; }
.balance-row__text { min-width: 0; }
.balance-row__text b { display: block; white-space: nowrap; overflow: hidden; font-size: 18px; }
.wallet__head { min-width: 0; }
.wallet__addr { min-width: 0; overflow: hidden; white-space: nowrap; }
.wallet__addr #wallet-label { overflow: hidden; text-overflow: ellipsis; }
.wallet__head .wallet__addr { flex: none; }
.wallet__head .pill-blue { flex: 0 1 auto; min-width: 0; max-width: none; overflow: hidden; text-overflow: ellipsis; display: block; line-height: 36px; }
.wallet__addr #wallet-label { flex: none; }
.wallet__card-value { display: block; white-space: nowrap; overflow: hidden; }
.ref__body b { font-size: 17px; line-height: 1.2; }
.empty__title { text-align: center; font-size: 17px; line-height: 1.3; padding: 0 24px; }
.stat b { font-size: 16px; white-space: nowrap; }
.plan__name { white-space: nowrap; }
@media (max-width: 400px) {
  .segmented__item { font-size: 14px; gap: 4px; }
  .segmented__item img { width: 15px; height: 15px; }
  .balance-capsule { padding: 0 12px; font-size: 14px; gap: 5px; }
  .plan__name b { font-size: 22px; }
}
.method { min-width: 0; }
@media (max-width: 400px) { .method { gap: 8px; padding: 10px; } .method img { width: 30px; height: 30px; } .method b { font-size: 14px; } }
