/* UPGIFT — «бархатная шкатулка»: сливовый бархат, атласное золото ленты,
   ореолы-паттерны как у коллекционных подарков Telegram. */

:root {
  --velvet-0: #0d0815;
  --velvet-1: #170f24;
  --velvet-2: #211631;
  --velvet-3: #2c1f40;
  --velvet-4: #3a2a53;
  --line: rgba(246, 230, 255, 0.08);
  --line-2: rgba(246, 230, 255, 0.14);
  --satin: #f6eefb;
  --satin-2: #c9b8dc;
  --satin-3: #8f7ea6;
  --ribbon: #ffc857;
  --ribbon-2: #ff9f2e;
  --ribbon-ink: #2a1703;
  --ton: #4fb0ff;
  --mint: #5be3a6;
  --danger: #ff5c7a;

  --r-common: #93a4c3;
  --r-uncommon: #52a7ff;
  --r-rare: #a06bff;
  --r-epic: #ff5fbf;
  --r-legendary: #ffb547;
  --r-mythic: #ff4d4d;

  --font-display: "Dela Gothic One", "Onest", system-ui, sans-serif;
  --font-ui: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;
  --tab-h: 68px;
  --safe-b: max(env(safe-area-inset-bottom), var(--tg-safe-area-inset-bottom, 0px));
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--velvet-1); color: var(--satin); }
body {
  font: 500 15px/1.4 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
body::before {
  /* бархатный ворс: едва заметное зерно и тёплое пятно света сверху */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 200, 87, .10), transparent 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(160, 107, 255, .10), transparent 70%);
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { max-width: 100%; display: block; -webkit-user-drag: none; user-select: none; }
:focus-visible { outline: 2px solid var(--ribbon); outline-offset: 2px; }
.hidden { display: none !important; }

#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* ───────── загрузка ───────── */
.boot { min-height: 100vh; display: grid; place-content: center; gap: 18px; justify-items: center; }
.boot__mark { font: 28px var(--font-display); letter-spacing: .06em; color: var(--ribbon); }
.boot__bar { width: 120px; height: 3px; border-radius: 3px; background: var(--velvet-3); overflow: hidden; }
.boot__bar i { display: block; height: 100%; width: 40%; background: var(--ribbon); border-radius: 3px; animation: boot 1s ease-in-out infinite; }
@keyframes boot { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* ───────── шапка ───────── */
.top {
  position: sticky; top: 0; z-index: 30;
  padding: 10px 16px 8px;
  background: linear-gradient(var(--velvet-1) 70%, rgba(23, 15, 36, 0));
}
.top__row { display: flex; align-items: center; gap: 10px; }
.logo { display: flex; align-items: center; gap: 8px; font: 19px var(--font-display); letter-spacing: .04em; }
.logo__bow { width: 26px; height: 26px; }
.logo b { color: var(--ribbon); font-weight: 400; }
.top__spacer { flex: 1; }
.wallet {
  display: flex; align-items: center; gap: 0; height: 38px; border-radius: 999px;
  background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.wallet__sum { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; font-weight: 700; font-size: 15px; }
.wallet__plus {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--ribbon), var(--ribbon-2)); color: var(--ribbon-ink);
  box-shadow: 0 6px 18px -6px rgba(255, 170, 60, .7);
}
.wallet__plus svg { width: 18px; height: 18px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--velvet-3); overflow: hidden; display: grid; place-items: center; font-weight: 700; color: var(--satin-2); flex: none; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.ton-ico { width: 14px; height: 14px; color: var(--ton); flex: none; }

/* ───────── лента дропов ───────── */
.live { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.live__badge {
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 52px; height: 58px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 10px; color: var(--satin-3); font-weight: 700; letter-spacing: .06em;
}
.live__badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(91, 227, 166, .6); animation: pulse 1.8s infinite; }
.live__badge b { color: var(--satin); font-size: 13px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(91, 227, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(91, 227, 166, 0); } }
.live__track { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); }
.live__rail { display: flex; gap: 6px; }
.drop {
  position: relative; flex: none; width: 58px; height: 58px; border-radius: 14px; overflow: hidden;
  animation: dropIn .6s var(--ease-out);
}
.drop img.drop__gift { position: absolute; inset: 7px; width: 44px; height: 44px; }
.drop__who { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 4px 2px; font-size: 9px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
@keyframes dropIn { from { transform: scale(.4) translateX(-20px); opacity: 0; } }

/* ───────── ореол (фирменный элемент) ───────── */
.halo {
  --c1: #6d5a8a; --c2: #2a1f3d;
  position: relative; isolation: isolate; overflow: hidden;
  background: radial-gradient(circle at 50% 44%, var(--c1) 0%, var(--c2) 78%);
}
.halo::before {
  content: ""; position: absolute; inset: -12%; z-index: -1;
  background: url("/img/pattern.svg") center 44% / cover no-repeat;
  opacity: .5; mix-blend-mode: soft-light;
}
.halo--spin::before { animation: haloSpin 60s linear infinite; }
@keyframes haloSpin { to { transform: rotate(360deg); } }

.r-common    { --c1: #7b8aa8; --c2: #262a3d; --rc: var(--r-common); }
.r-uncommon  { --c1: #3f86e0; --c2: #16264a; --rc: var(--r-uncommon); }
.r-rare      { --c1: #8a5ae8; --c2: #2a1650; --rc: var(--r-rare); }
.r-epic      { --c1: #e0509f; --c2: #4a1238; --rc: var(--r-epic); }
.r-legendary { --c1: #f0a33a; --c2: #4f2a08; --rc: var(--r-legendary); }
.r-mythic    { --c1: #f04444; --c2: #4a0a14; --rc: var(--r-mythic); }

.t-honey  { --c1: #f2b24a; --c2: #5c3009; }
.t-rose   { --c1: #ff6f9f; --c2: #5a1236; }
.t-candy  { --c1: #ff8fcf; --c2: #5d236a; }
.t-night  { --c1: #6c79ff; --c2: #15103f; }
.t-ice    { --c1: #7fd8ff; --c2: #103a60; }
.t-ember  { --c1: #ff7f36; --c2: #520f07; }
.t-lime   { --c1: #a9e64d; --c2: #1d4b12; }
.t-violet { --c1: #a574ff; --c2: #2b1260; }
.t-gold   { --c1: #ffd064; --c2: #5a3a07; }
.t-ocean  { --c1: #3fcfc0; --c2: #0a3a4a; }
.t-blood  { --c1: #ff4058; --c2: #470716; }

/* ───────── подарок-плитка ───────── */
.gift {
  position: relative; border-radius: 16px; aspect-ratio: 1 / 1.16; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .2s var(--ease-out), box-shadow .2s;
}
.gift__img { position: absolute; left: 14%; right: 14%; top: 8%; width: 72%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); }
.gift__meta { position: relative; width: 100%; padding: 16px 8px 8px; text-align: center; background: linear-gradient(transparent, rgba(8, 4, 14, .72)); }
.gift__name { font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .86); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift__value { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; }
.gift__value .ton-ico { width: 11px; height: 11px; color: #bfe3ff; }
.gift__tag { position: absolute; top: 6px; left: 6px; padding: 2px 6px; border-radius: 8px; font-size: 10px; font-weight: 800; background: rgba(8, 4, 14, .55); backdrop-filter: blur(6px); }
.gift__tag--chance { left: auto; right: 6px; color: var(--satin-2); }
.gift__check {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(8, 4, 14, .5); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .5); display: grid; place-items: center;
}
.gift.is-picked { box-shadow: inset 0 0 0 2px var(--ribbon), 0 0 0 1px var(--ribbon); transform: scale(.96); }
.gift.is-picked .gift__check { background: var(--ribbon); box-shadow: none; color: var(--ribbon-ink); }
.gift.is-off { filter: grayscale(.8) brightness(.6); }
.gift:active { transform: scale(.96); }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 440px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* ───────── кнопки и элементы ───────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 22px; border-radius: 16px; font-weight: 800; font-size: 16px;
  transition: transform .15s var(--ease-out), filter .15s, opacity .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn--gold {
  color: var(--ribbon-ink);
  background: linear-gradient(180deg, #ffe08a 0%, var(--ribbon) 35%, var(--ribbon-2) 100%);
  box-shadow: 0 10px 30px -10px rgba(255, 160, 50, .8), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(120, 60, 0, .25);
}
.btn--gold .ton-ico { color: var(--ribbon-ink); }
.btn--ghost { background: var(--velvet-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--mint { background: linear-gradient(180deg, #8ff5c7, var(--mint)); color: #06301d; }
.btn--block { width: 100%; }
.btn--sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn__sub { font-weight: 600; opacity: .7; }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); }
.seg button { flex: 1; height: 36px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--satin-3); transition: background .2s, color .2s; }
.seg button.on { background: var(--velvet-4); color: var(--satin); box-shadow: 0 4px 12px -6px rgba(0, 0, 0, .6); }

.chip { height: 32px; padding: 0 12px; border-radius: 10px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; font-size: 13px; color: var(--satin-2); flex: none; }
.chip.on { background: rgba(255, 200, 87, .14); color: var(--ribbon); box-shadow: inset 0 0 0 1px rgba(255, 200, 87, .45); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }

.field { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.field input { flex: 1; min-width: 0; background: none; border: 0; outline: none; font-weight: 700; font-size: 16px; }
.field input::placeholder { color: var(--satin-3); font-weight: 500; }
.field__label { font-size: 12px; color: var(--satin-3); font-weight: 600; margin: 0 0 6px 2px; }

.card { border-radius: var(--radius); background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); }
.muted { color: var(--satin-3); }
.small { font-size: 13px; }

/* ───────── страница ───────── */
.page { padding: 4px 16px calc(var(--tab-h) + var(--safe-b) + 24px); animation: pageIn .35s var(--ease-out); }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } }
.h-display { font: 26px/1.05 var(--font-display); letter-spacing: .01em; margin: 0; }
.h-section { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 26px 2px 12px; font: 17px var(--font-display); letter-spacing: .02em; }
.h-section span { font: 600 13px var(--font-ui); color: var(--satin-3); white-space: nowrap; }
.backline { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.backline__btn { width: 38px; height: 38px; border-radius: 12px; background: var(--velvet-2); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); }

/* ───────── нижняя навигация ───────── */
.tabs {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 40;
  width: 100%; max-width: 560px; padding: 8px 10px calc(8px + var(--safe-b));
  background: linear-gradient(rgba(13, 8, 21, 0), var(--velvet-0) 40%);
}
.tabs__inner { display: flex; height: var(--tab-h); border-radius: 22px; background: rgba(33, 22, 49, .92); backdrop-filter: blur(18px); box-shadow: inset 0 0 0 1px var(--line-2), 0 -10px 40px -20px #000; padding: 6px; gap: 2px; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-radius: 16px; font-size: 10.5px; font-weight: 700; color: var(--satin-3); transition: color .2s, background .2s; position: relative; }
.tab svg { width: 24px; height: 24px; }
.tab.on { color: var(--satin); background: var(--velvet-3); }
.tab.on svg { color: var(--ribbon); }
.tab__badge { position: absolute; top: 6px; right: calc(50% - 20px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ribbon); color: var(--ribbon-ink); font-size: 10px; font-weight: 800; display: grid; place-items: center; }

/* ───────── витрина кейсов ───────── */
.hero {
  position: relative; border-radius: 26px; overflow: hidden; min-height: 236px;
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; margin-top: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.hero__text { position: relative; z-index: 2; padding: 22px 0 22px 20px; }
.hero__eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .75); margin-bottom: 8px; }
.hero__title { font: 25px/1.02 var(--font-display); margin: 0 0 10px; text-shadow: 0 2px 20px rgba(0, 0, 0, .3); }
.hero__value { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 18px; margin-bottom: 16px; }
.hero__value .ton-ico { width: 16px; height: 16px; color: #d4ecff; }
.hero__art { position: relative; height: 236px; }
.hero__art .lottie, .hero__art img { position: absolute; inset: 6px -18px 6px -26px; width: auto; height: auto; }
.hero .btn { height: 44px; border-radius: 14px; font-size: 15px; padding: 0 16px; }

.stats-row { display: flex; gap: 8px; margin-top: 10px; }
.stat { flex: 1; padding: 10px 12px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); }
.stat b { display: block; font: 16px var(--font-display); }
.stat span { font-size: 11.5px; color: var(--satin-3); font-weight: 600; }

.cases { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.case {
  position: relative; border-radius: 22px; aspect-ratio: 1 / 1.22; overflow: hidden; text-align: left;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  transition: transform .2s var(--ease-out);
}
.case:active { transform: scale(.97); }
.case__stack { position: absolute; inset: 0 0 34%; }
.case__stack img { position: absolute; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); }
.case__stack .s0 { width: 64%; left: 18%; top: 12%; z-index: 3; }
.case__stack .s1 { width: 40%; left: -2%; top: 30%; z-index: 2; transform: rotate(-14deg); opacity: .9; filter: blur(.4px) drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.case__stack .s2 { width: 40%; right: -2%; top: 28%; z-index: 1; transform: rotate(13deg); opacity: .9; filter: blur(.4px) drop-shadow(0 8px 14px rgba(0, 0, 0, .5)); }
.case__foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 12px; background: linear-gradient(transparent, rgba(8, 4, 14, .78) 45%); }
.case__title { font: 15px/1.1 var(--font-display); margin-bottom: 8px; }
.price {
  display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 10px;
  background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); font-weight: 800; font-size: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}
.price .ton-ico { width: 12px; height: 12px; color: #cfe9ff; }
.case__max { position: absolute; top: 10px; right: 10px; z-index: 4; font-size: 10.5px; font-weight: 800; padding: 3px 7px; border-radius: 8px; background: rgba(8, 4, 14, .5); backdrop-filter: blur(6px); }
.case.is-paused { filter: grayscale(.7); }

/* ───────── экран кейса ───────── */
.casehead { position: relative; border-radius: 26px; overflow: hidden; padding: 16px; text-align: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.casehead__art { height: 150px; position: relative; margin: -4px auto 0; width: 170px; }
.casehead__art .lottie, .casehead__art img { position: absolute; inset: 0; }
.casehead__title { font: 22px var(--font-display); margin: 4px 0 2px; }

.roulette { position: relative; margin: 14px -16px 0; padding: 12px 0; overflow: hidden; }
.roulette + .roulette { margin-top: -6px; }
.roulette__rail { display: flex; gap: 8px; will-change: transform; padding-left: 50%; }
.roulette__rail .gift { flex: none; width: 104px; }
.roulette--multi .roulette__rail .gift { width: 78px; }
.roulette--multi .gift__meta { padding: 10px 4px 5px; }
.roulette--multi .gift__name { display: none; }
.roulette::before, .roulette::after { content: ""; position: absolute; top: 0; bottom: 0; width: 70px; z-index: 2; pointer-events: none; }
.roulette::before { left: 0; background: linear-gradient(90deg, var(--velvet-1), transparent); }
.roulette::after { right: 0; background: linear-gradient(-90deg, var(--velvet-1), transparent); }
.roulette__needle { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; z-index: 3; pointer-events: none; }
.roulette__needle::before, .roulette__needle::after {
  content: ""; position: absolute; left: -9px; border: 9px solid transparent;
}
.roulette__needle::before { top: 0; border-top: 12px solid var(--ribbon); filter: drop-shadow(0 2px 6px rgba(255, 200, 87, .8)); }
.roulette__needle::after { bottom: 0; border-bottom: 12px solid var(--ribbon); filter: drop-shadow(0 -2px 6px rgba(255, 200, 87, .8)); }
.roulette__line { position: absolute; left: 50%; top: 10px; bottom: 10px; width: 2px; margin-left: -1px; background: linear-gradient(transparent, rgba(255, 200, 87, .9), transparent); z-index: 3; }
.roulette .gift.is-hit { box-shadow: inset 0 0 0 2px var(--rc), 0 0 30px -4px var(--rc); transform: scale(1.06); z-index: 1; }

.openbar { display: grid; gap: 10px; margin-top: 14px; }
.openbar__row { display: flex; gap: 8px; align-items: center; }
.openbar__row .seg { flex: 1; }
.toggle { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 700; color: var(--satin-2); flex: none; }
.toggle i { width: 34px; height: 20px; border-radius: 10px; background: var(--velvet-4); position: relative; transition: background .2s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--satin-2); transition: transform .2s var(--ease-out), background .2s; }
.toggle.on i { background: rgba(255, 200, 87, .35); }
.toggle.on i::after { transform: translateX(14px); background: var(--ribbon); }

/* ───────── окно выигрыша ───────── */
.reveal { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px calc(24px + var(--safe-b)); background: rgba(10, 5, 16, .86); backdrop-filter: blur(10px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.reveal__rays { position: absolute; left: 50%; top: 38%; width: 760px; height: 760px; margin: -380px 0 0 -380px; pointer-events: none; opacity: .55;
  background: repeating-conic-gradient(from 0deg, var(--rc, var(--ribbon)) 0deg 6deg, transparent 6deg 24deg);
  mask-image: radial-gradient(circle, #000 0%, transparent 62%); -webkit-mask-image: radial-gradient(circle, #000 0%, transparent 62%);
  animation: haloSpin 24s linear infinite; }
.reveal__label { position: relative; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--rc, var(--ribbon)); margin-bottom: 10px; }
.reveal__stage { position: relative; width: 236px; height: 236px; border-radius: 50%; animation: pop .7s var(--ease-out); box-shadow: 0 0 80px -10px var(--rc, var(--ribbon)); }
.reveal__stage .lottie, .reveal__stage img { position: absolute; inset: 22px; }
@keyframes pop { 0% { transform: scale(.2) rotate(-20deg); opacity: 0; } 60% { transform: scale(1.06); } }
.reveal__title { position: relative; font: 24px var(--font-display); margin: 18px 0 4px; text-align: center; }
.reveal__value { position: relative; display: flex; align-items: center; gap: 8px; font: 30px var(--font-display); }
.reveal__value .ton-ico { width: 22px; height: 22px; }
.reveal__actions { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 420px; margin-top: 26px; }
.reveal__multi { position: relative; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; max-width: 420px; }
.reveal__multi .gift { width: 74px; }
.reveal__multi .gift__name { display: none; }
.reveal--lose .reveal__stage { box-shadow: none; filter: grayscale(.9) brightness(.7); }
.reveal--lose .reveal__label { color: var(--danger); }

/* ───────── апгрейд ───────── */
.dial { position: relative; width: min(300px, 78vw); aspect-ratio: 1; margin: 6px auto 0; }
.dial__bg { position: absolute; inset: 9%; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 30px 60px -30px #000; }
.dial svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial__arc { transition: stroke-dasharray .5s var(--ease-out), transform .5s var(--ease-out); filter: drop-shadow(0 0 6px rgba(255, 200, 87, .7)); }
.dial__pointer { position: absolute; inset: 0; will-change: transform; }
.dial__pointer::before { content: ""; position: absolute; left: 50%; top: -3%; margin-left: -11px; border: 11px solid transparent; border-top: 18px solid var(--satin); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6)); }
.dial__center { position: absolute; inset: 22%; border-radius: 50%; display: grid; place-content: center; text-align: center; }
.dial__center img, .dial__center .lottie { position: absolute; inset: 8%; opacity: .95; }
.dial__chance { position: relative; font: 34px/1 var(--font-display); text-shadow: 0 2px 16px rgba(0, 0, 0, .6); }
.dial__mult { position: relative; font-size: 13px; font-weight: 800; color: rgba(255, 255, 255, .8); margin-top: 4px; text-shadow: 0 1px 8px rgba(0, 0, 0, .6); }
.dial.is-win .dial__arc { stroke: var(--mint); }
.dial.is-lose .dial__bg { filter: grayscale(1) brightness(.6); transition: filter .4s; }

.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.slot { position: relative; border-radius: 20px; min-height: 132px; padding: 10px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; }
.slot--empty { border: 1.5px dashed var(--line-2); box-shadow: none; align-items: center; justify-content: center; text-align: center; color: var(--satin-3); font-size: 13px; font-weight: 600; }
.slot__label { position: absolute; top: 9px; left: 11px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: rgba(255, 255, 255, .7); z-index: 2; }
.slot__imgs { position: absolute; inset: 20px 10px 42px; display: flex; justify-content: center; align-items: center; }
.slot__imgs img { width: 62%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.slot__imgs img + img { margin-left: -30%; }
.slot__sum { position: relative; z-index: 2; display: flex; align-items: center; gap: 5px; font: 16px var(--font-display); }
.slot__sub { position: relative; z-index: 2; font-size: 11.5px; font-weight: 600; color: rgba(255, 255, 255, .7); }

.panel { margin-top: 14px; padding: 12px; border-radius: 20px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); }
.panel__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.panel__head .seg { flex: 1; }
.range { width: 100%; accent-color: var(--ribbon); }

/* ───────── контракт ───────── */
.cslots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cslot { aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed var(--line-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.cslot.filled { border: 0; }
.cslot img { width: 80%; }
.contract-core { position: relative; margin: 8px auto 12px; width: 200px; height: 200px; border-radius: 50%; display: grid; place-content: center; text-align: center; }
.contract-core__sum { font: 26px var(--font-display); display: flex; align-items: center; gap: 6px; justify-content: center; }
.contract-core__range { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .8); margin-top: 4px; }
.contract-core.is-brewing { animation: brew .9s ease-in-out infinite; }
@keyframes brew { 50% { transform: scale(1.05) rotate(3deg); filter: brightness(1.3); } }

/* ───────── инвентарь ───────── */
.invsum { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 20px; margin: 6px 0 12px; }
.invsum b { font: 22px var(--font-display); display: flex; align-items: center; gap: 6px; }
.actionbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tab-h) + var(--safe-b) + 22px); width: calc(100% - 20px); max-width: 540px; z-index: 35; display: flex; gap: 8px; padding: 8px; border-radius: 20px; background: rgba(44, 31, 64, .95); backdrop-filter: blur(16px); box-shadow: 0 20px 40px -10px #000, inset 0 0 0 1px var(--line-2); animation: rise .3s var(--ease-out); }
.actionbar .btn { flex: 1; height: 46px; padding: 0 10px; font-size: 14px; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } }
.wd-status { position: absolute; left: 6px; right: 6px; top: 6px; padding: 3px 6px; border-radius: 8px; font-size: 10px; font-weight: 800; text-align: center; background: rgba(8, 4, 14, .7); color: var(--ribbon); }

.list { display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); }
.row__ico { width: 44px; height: 44px; border-radius: 12px; flex: none; overflow: hidden; display: grid; place-items: center; }
.row__ico img { width: 80%; }
.row__main { flex: 1; min-width: 0; }
.row__title { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__sub { font-size: 12.5px; color: var(--satin-3); }
.row__end { text-align: right; font-weight: 800; white-space: nowrap; }
.plus { color: var(--mint); }
.minus { color: var(--satin-3); }
.status { display: inline-block; padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 800; background: var(--velvet-4); color: var(--satin-2); }
.status--sent { background: rgba(91, 227, 166, .15); color: var(--mint); }
.status--manual, .status--queued, .status--processing { background: rgba(255, 200, 87, .14); color: var(--ribbon); }
.status--refunded { background: rgba(255, 92, 122, .14); color: var(--danger); }

/* ───────── профиль ───────── */
.profile { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 24px; margin-top: 6px; }
.profile .avatar { width: 64px; height: 64px; font-size: 24px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .15); }
.profile__name { font: 20px var(--font-display); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.menu { display: grid; gap: 8px; margin-top: 14px; }
.menu__item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); text-align: left; font-weight: 700; }
.menu__item svg { width: 22px; height: 22px; color: var(--ribbon); flex: none; }
.menu__item span { flex: 1; }
.menu__item small { color: var(--satin-3); font-weight: 600; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; color: var(--satin-2); }

/* ───────── нижний лист ───────── */
.sheet-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; justify-content: center; background: rgba(8, 4, 14, .6); backdrop-filter: blur(4px); animation: fade .2s; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; padding: 8px 16px calc(20px + var(--safe-b)); border-radius: 28px 28px 0 0; background: var(--velvet-1); box-shadow: inset 0 1px 0 var(--line-2), 0 -30px 60px -20px #000; animation: sheetUp .35s var(--ease-out); }
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet__grab { width: 40px; height: 4px; border-radius: 2px; background: var(--velvet-4); margin: 4px auto 12px; }
.sheet__title { font: 20px var(--font-display); margin: 0 0 14px; }

.amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 10px 0; }
.amounts button { height: 40px; border-radius: 12px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; }
.amounts button.on { background: rgba(79, 176, 255, .14); box-shadow: inset 0 0 0 1px rgba(79, 176, 255, .6); color: #cfe9ff; }
.copyline { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); margin-top: 8px; }
.copyline__main { flex: 1; min-width: 0; }
.copyline__k { font-size: 11.5px; color: var(--satin-3); font-weight: 700; }
.steps { counter-reset: s; display: grid; gap: 10px; margin: 6px 0 14px; }
.steps li { list-style: none; counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 9px; display: grid; place-items: center; background: var(--velvet-3); color: var(--ribbon); font-weight: 800; font-size: 13px; }
.steps { padding: 0; }

/* ───────── уведомления ───────── */
.toasts { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: calc(100% - 32px); max-width: 420px; pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 14px; background: rgba(44, 31, 64, .97); box-shadow: 0 16px 40px -12px #000, inset 0 0 0 1px var(--line-2); font-weight: 600; font-size: 14px; animation: toastIn .35s var(--ease-out); }
.toast--error { box-shadow: 0 16px 40px -12px #000, inset 0 0 0 1px rgba(255, 92, 122, .5); }
.toast--ok { box-shadow: 0 16px 40px -12px #000, inset 0 0 0 1px rgba(91, 227, 166, .5); }
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } }

.empty { text-align: center; padding: 36px 16px; color: var(--satin-3); }
.empty b { display: block; color: var(--satin); font: 18px var(--font-display); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .15); border-top-color: var(--ribbon); animation: haloSpin .8s linear infinite; }
.center { display: grid; place-items: center; padding: 40px; }

/* ───────── админка ───────── */
.adm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.adm-card { padding: 12px; border-radius: 14px; background: var(--velvet-2); box-shadow: inset 0 0 0 1px var(--line); }
.adm-card b { display: block; font-size: 17px; font-weight: 800; }
.adm-card span { font-size: 12px; color: var(--satin-3); font-weight: 600; }
.adm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
