:root {
  --bg: #0a0a0a;
  --card: #161616;
  --card2: #202020;
  --card3: #2b2b2b;
  --line: rgba(255, 255, 255, .07);
  --text: #f5f5f5;
  --muted: #989898;
  --up: #34d399;
  --down: #f4675c;
  --accent: #ffffff;
  --violet: #d4d4d4;
  --brand: linear-gradient(180deg, #ffffff 0%, #cfcfcf 100%);
  --safe-top: calc(env(safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + var(--tg-safe-area-inset-top, 0px));
  --safe-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--tg-safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  font-size: 16px;
  line-height: 1.3;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
input { font: inherit; color: inherit; }
svg { display: block; }
b { font-weight: 650; }

#app { max-width: 520px; margin: 0 auto; padding: calc(var(--safe-top) + 14px) 16px calc(120px + var(--safe-bottom)); }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 46px; }
.round {
  width: 44px; height: 44px; border-radius: 50%; background: var(--card2);
  display: grid; place-items: center; overflow: hidden; color: var(--text);
}
.round img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ini { font-weight: 700; font-size: 17px; background: linear-gradient(160deg, #f5f5f5, #9a9a9a); width: 100%; height: 100%; display: grid; place-items: center; color: #0a0a0a; }
.demo-pill {
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted);
  padding: 5px 11px; border-radius: 99px; background: var(--card2);
}

/* ---------- balance ---------- */
.balance { text-align: center; padding: 26px 0 20px; }
.balance .lbl { font-size: 15px; font-weight: 600; color: #d0d0d0; }
.balance .amt { font-size: 52px; font-weight: 750; letter-spacing: -.02em; margin-top: 6px; }
.balance .amt small { font-size: 32px; color: #b3b3b3; font-weight: 700; }
.balance .amt .cur { font-size: 30px; color: #9a9a9a; margin-left: 4px; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.action {
  background: var(--card); border-radius: 20px; padding: 16px 4px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: #cacaca; transition: transform .12s, background .12s;
}
.action:active { transform: scale(.96); background: var(--card2); }
.action .ico { color: #adadad; }

/* ---------- cards ---------- */
.card { background: var(--card); border-radius: 24px; margin-bottom: 12px; overflow: hidden; }
.pad { padding: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 6px 10px; font-size: 17px; font-weight: 700; color: #c2c2c2; }
.section-title span { font-size: 14px; font-weight: 500; color: var(--muted); }
.row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; width: 100%; }
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-size: 17px; font-weight: 600; }
.row .s { font-size: 14px; color: var(--muted); margin-top: 3px; }
.row .end { text-align: right; font-weight: 600; font-size: 17px; }
.row .end .s { font-weight: 500; }
.row > .chev { color: #5d5d5d; flex: none; }
.row:active { background: rgba(255, 255, 255, .03); }
.up { color: var(--up); } .down { color: var(--down); }

.coin {
  flex: none; display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 70%);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .18);
}
.coin svg { width: 60%; height: 60%; }
.tile-ico { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--card3); color: #d7d7d7; }

/* ---------- promo ---------- */
.promo {
  position: relative; border-radius: 24px; padding: 18px 16px; margin-bottom: 12px; overflow: hidden; width: 100%;
  background: linear-gradient(125deg, #2a2a2a 0%, #444444 52%, #1c1c1c 100%);
  min-height: 92px;
}
.promo h3 { margin: 0 0 6px; font-size: 18px; max-width: 62%; line-height: 1.2; }
.promo p { margin: 0; font-size: 14px; opacity: .92; }
.promo .gem { position: absolute; right: 10px; bottom: -8px; width: 112px; height: 112px; opacity: .95; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }
.promo .x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 255, 255, .28); display: grid; place-items: center; }

.hero-card { padding: 18px 16px 14px; }
.hero-card h4 { margin: 0 0 8px; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.hero-card p { margin: 0 0 14px; color: #cacaca; line-height: 1.35; }
.btn-row { display: flex; gap: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 650; font-size: 17px;
  background: var(--card3); color: var(--text); text-align: center; transition: transform .12s, opacity .12s;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: #f5f5f5; color: #0a0a0a; }
.btn.white { background: #f5f5f5; color: #111; }
.btn.ghost { background: var(--card2); }
.btn.sm { min-height: 40px; font-size: 15px; border-radius: 13px; padding: 0 16px; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.btn.danger { background: rgba(244, 103, 92, .14); color: var(--down); }

/* ---------- tab bar (liquid glass) ---------- */
#nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-bottom));
  width: min(calc(100% - 28px), 440px); height: 72px; z-index: 20; padding: 4px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(38, 38, 38, .62); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 999px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .4s cubic-bezier(.3, 1.4, .5, 1), box-shadow .3s;
  animation: navIn .7s cubic-bezier(.2, 1.2, .3, 1) both .1s;
}
#nav.dragging { transform: translateX(-50%) scale(1.025); box-shadow: 0 20px 50px rgba(0, 0, 0, .65), inset 0 1px 0 rgba(255, 255, 255, .12); }
@keyframes navIn { from { transform: translate(-50%, 90px) scale(.9); opacity: 0; } }
#nav .ind { will-change: transform; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 4); transform: translateX(var(--x, 0px)); transition: transform .5s cubic-bezier(.3, 1.35, .5, 1); pointer-events: none; }
#nav.dragging .ind { transition: transform .09s linear; }
#nav .ind i {
  position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -1px 0 rgba(0, 0, 0, .2);
  transition: transform .42s cubic-bezier(.3, 1.6, .5, 1), background .25s, box-shadow .25s;
}
#nav.dragging .ind i {
  transform: scale(1.22, 1.16); background: rgba(255, 255, 255, .24);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .5), inset 0 1.5px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(255, 255, 255, .12);
}
#nav button {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; color: #9d9d9d; text-align: center; transition: color .25s;
}
#nav button .ni { display: grid; place-items: center; width: 28px; height: 28px; transition: transform .45s cubic-bezier(.3, 1.8, .5, 1); }
#nav button.on, #nav button.hot { color: #fff; }
#nav button.hot .ni { transform: scale(1.18); }
#nav button.pop .ni { animation: navPop .55s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes navPop { 0% { transform: scale(1); } 35% { transform: scale(1.3) translateY(-3px); } 100% { transform: scale(1); } }

/* ---------- trade ---------- */
.search {
  display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 20px; padding: 0 16px; height: 52px; color: var(--muted);
}
.search input { flex: 1; background: none; border: 0; outline: 0; font-size: 17px; min-width: 0; }
.search input::placeholder { color: #868686; }
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 16px 8px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; text-align: center; }
.pick small { font-size: 13px; font-weight: 600; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: #3f3f3f; color: #dbdbdb; margin-left: 6px; vertical-align: middle; letter-spacing: .03em; }
.heat { position: relative; width: 100%; aspect-ratio: 1 / 1.02; border-radius: 22px; overflow: hidden; background: #111; }
.heat div {
  position: absolute; border: 1.5px solid var(--bg); border-radius: 9px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; font-weight: 700; overflow: hidden; line-height: 1.15; cursor: pointer;
}
.heat div small { font-size: .78em; font-weight: 600; opacity: .95; }
.hint { color: var(--muted); font-size: 14px; margin: 10px 6px 0; line-height: 1.35; }
.themes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; padding: 16px 8px; }
.stock { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; text-align: center; position: relative; }
.stock .mult { position: absolute; top: -6px; left: 6px; font-size: 11px; background: #3f3f3f; color: #fff; padding: 1px 5px; border-radius: 7px; }
.stock small { font-size: 13px; font-weight: 600; }
.products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 16px 8px; }
.product { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 650; color: #d7d7d7; text-align: center; }
.product .tile-ico { width: 56px; height: 56px; background: #323232; }

/* ---------- earn ---------- */
.page-hero { text-align: center; padding: 10px 10px 18px; }
.page-hero .big { font-size: 70px; line-height: 1; margin-bottom: 8px; }
.page-hero h1 { font-size: 28px; margin: 4px 0 8px; }
.page-hero p { margin: 0; color: #d0d0d0; font-size: 17px; line-height: 1.35; }
.page-hero a, .link { color: var(--muted); font-size: 16px; cursor: pointer; }
.seg { display: flex; gap: 6px; justify-content: center; margin: 12px 0 16px; }
.seg button { padding: 8px 16px; border-radius: 99px; font-weight: 650; font-size: 15px; color: var(--muted); }
.seg button.on { background: var(--card2); color: #fff; }
.earn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.earn-card { position: relative; background: var(--card); border-radius: 24px; padding: 20px 10px 18px; text-align: center; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.earn-card .n { font-size: 16px; color: #dcdcdc; margin-top: 4px; }
.earn-card .a { font-size: 18px; font-weight: 750; }
.earn-card .ribbon {
  position: absolute; top: 12px; right: -30px; width: 100px; transform: rotate(40deg);
  background: #f2f2f2; color: #111; font-size: 11px; font-weight: 800; padding: 2px 0; text-align: center; letter-spacing: .04em;
}
.earn-card .stk { font-size: 12.5px; color: var(--up); font-weight: 600; }

/* ---------- bonuses ---------- */
.bonus-hero { text-align: center; padding: 8px 0 18px; }
.bonus-hero .lbl { color: #d9d9d9; font-size: 15px; }
.bonus-hero .cnt { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 46px; font-weight: 800; margin: 6px 0; }
.bonus-page { margin: -14px -16px 0; padding: calc(var(--safe-top) + 24px) 16px 0; background: linear-gradient(180deg, #3a3a3a 0%, #262626 14%, #0a0a0a 44%); }
.season { padding: 16px; }
.season .until { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.season h3 { margin: 0 0 8px; font-size: 21px; }
.season p { margin: 0 0 14px; color: #d0d0d0; font-size: 15px; line-height: 1.35; }
.progress { display: flex; align-items: center; gap: 12px; background: var(--card2); border-radius: 99px; padding: 4px; font-size: 14px; font-weight: 600; color: var(--muted); }
.progress .fill { min-width: 62px; padding: 8px 12px; border-radius: 99px; background: #f2f2f2; color: #111; display: flex; gap: 6px; align-items: center; }
.progress .goal { margin-left: auto; padding-right: 12px; display: flex; gap: 6px; align-items: center; }
.leader-link { display: flex; align-items: center; gap: 8px; margin: 14px 4px 2px; color: #dddddd; font-weight: 600; font-size: 15px; }
.faces { display: flex; margin-right: 10px; } .faces span { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--card); margin-right: -7px; font-size: 8.5px; letter-spacing: -.02em; display: grid; place-items: center; font-weight: 700; color: #fff; }
.cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.case { position: relative; background: var(--card); border-radius: 20px; padding: 16px 8px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-size: 14px; font-weight: 650; min-height: 168px; justify-content: space-between; }
.case .gift { font-size: 54px; line-height: 1; height: 64px; display: grid; place-items: center; }
.case .cost { display: flex; gap: 5px; align-items: center; background: var(--card3); padding: 6px 12px; border-radius: 99px; color: #cacaca; font-size: 14px; }
.case .lim { position: absolute; top: 8px; left: -24px; transform: rotate(-38deg); background: #f4675c; color: #fff; font-size: 10px; padding: 2px 26px; font-weight: 800; }
details { border-top: 1px solid var(--line); }
details:first-child { border-top: 0; }
summary { list-style: none; padding: 17px 16px; font-size: 17px; display: flex; justify-content: space-between; gap: 14px; align-items: center; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; width: 9px; height: 9px; border: solid #6f6f6f; border-width: 0 2px 2px 0; transform: rotate(-45deg); flex: none; transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details p { margin: 0; padding: 0 16px 17px; color: #c2c2c2; font-size: 15px; line-height: 1.4; }
.done-tag { font-size: 13px; color: #d9d9d9; font-weight: 650; background: var(--card3); padding: 4px 10px; border-radius: 99px; }

/* ---------- sheets ---------- */
#sheets { position: relative; z-index: 50; }
.sheet-wrap { position: fixed; inset: 0; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); animation: sfade .22s ease both; }
.sheet {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100% - var(--safe-top) - 10px); overflow-y: auto; overscroll-behavior: contain;
  background: #121212; border-radius: 28px 28px 0 0; padding: 8px 16px calc(24px + var(--safe-bottom));
  animation: sup .28s cubic-bezier(.2, .9, .3, 1) both; box-shadow: 0 -12px 40px rgba(0, 0, 0, .5);
}
.sheet-wrap.full .sheet { min-height: calc(100% - var(--safe-top) - 10px); }
.sheet-wrap.out .sheet { animation: sdown .2s ease both; }
.sheet-wrap.out .scrim { animation: sfadeout .2s ease both; }
@keyframes sup { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sdown { to { transform: translateY(100%); } }
@keyframes sfade { from { opacity: 0; } }
@keyframes sfadeout { to { opacity: 0; } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: #404040; margin: 4px auto 14px; }
.sheet .close { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; color: #c1c1c1; z-index: 2; }
.sh-title { text-align: center; font-size: 26px; line-height: 1.15; font-weight: 750; margin: 10px 30px 16px; }
.sh-sub { text-align: center; color: var(--muted); margin: -6px 10px 18px; font-size: 15px; line-height: 1.35; }
.sh-label { font-size: 14px; font-weight: 650; color: #b1b1b1; margin: 20px 6px 8px; }

.feature { display: flex; gap: 14px; padding: 10px 4px; }
.feature .fi { color: #a3a3a3; flex: none; margin-top: 2px; }
.feature b { display: block; margin-bottom: 3px; }
.feature span { color: #c2c2c2; font-size: 15px; line-height: 1.35; }

.field { background: var(--card); border-radius: 18px; padding: 12px 16px; margin-bottom: 10px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field input { width: 100%; background: none; border: 0; outline: 0; font-size: 19px; font-weight: 600; padding: 4px 0; }
.field input::placeholder { color: #666666; font-weight: 500; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { padding: 9px 15px; border-radius: 99px; background: var(--card2); font-weight: 650; font-size: 15px; color: #cacaca; display: flex; align-items: center; gap: 8px; }
.chip.on { background: #fff; color: #111; }
.note { color: var(--muted); font-size: 13.5px; line-height: 1.4; margin: 12px 6px; }
.note.warn { color: #cfcfcf; }

.swap-box { position: relative; }
.swap-side { background: var(--card); border-radius: 24px; padding: 16px; margin-bottom: 4px; }
.swap-side .head { display: flex; justify-content: space-between; align-items: center; font-size: 15px; font-weight: 600; color: #dcdcdc; margin-bottom: 10px; gap: 8px; }
.swap-side .head .l { display: flex; align-items: center; gap: 8px; }
.swap-side .head .r { color: var(--muted); font-size: 14px; text-align: right; }
.swap-side .line { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.swap-side input { background: none; border: 0; outline: 0; font-size: 40px; font-weight: 750; width: 100%; min-width: 0; padding: 0; }
.swap-side input::placeholder { color: #fff; opacity: .95; }
.swap-side input[readonly] { color: #fff; }
.pick-asset { display: flex; align-items: center; gap: 6px; font-size: 26px; font-weight: 750; color: #b5b5b5; flex: none; }
.flip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; background: var(--card3); border: 4px solid #121212; display: grid; place-items: center; z-index: 2; }
.rate { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 0; }
.mx { color: var(--accent); font-weight: 700; cursor: pointer; }

.kv { display: flex; justify-content: space-between; padding: 12px 4px; font-size: 16px; }
.kv + .kv { border-top: 1px solid var(--line); }
.kv span:first-child { color: var(--muted); }

.hero-sheet { margin: -8px -16px 16px; padding: 44px 20px 22px; text-align: center; background: linear-gradient(180deg, #3a3a3a 0%, #121212 100%); border-radius: 28px 28px 0 0; }
.hero-sheet .gift { font-size: 76px; line-height: 1; }
.hero-sheet h2 { font-size: 30px; margin: 14px 0 8px; line-height: 1.1; }
.hero-sheet p { margin: 0; color: #dbdbdb; font-size: 16px; line-height: 1.35; }
.steps { padding: 6px 16px; }
.step { display: flex; align-items: center; gap: 14px; padding: 12px 0; position: relative; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--card3); display: grid; place-items: center; font-weight: 700; flex: none; }
.step .s { color: var(--muted); font-size: 14px; }

.price-big { font-size: 38px; font-weight: 780; letter-spacing: -.01em; }
.chart { width: 100%; height: 160px; margin: 8px 0 4px; }
.asset-head { display: flex; align-items: center; gap: 12px; margin: 6px 40px 6px 4px; }
.asset-head .n { font-size: 20px; font-weight: 700; }
.asset-head .c { color: var(--muted); font-size: 14px; }
.ranges { display: flex; gap: 6px; justify-content: center; margin: 4px 0 14px; }
.ranges button { padding: 6px 14px; border-radius: 99px; font-size: 14px; font-weight: 650; color: var(--muted); }
.ranges button.on { background: var(--card2); color: #fff; }
.toggle { width: 50px; height: 30px; border-radius: 99px; background: #404040; position: relative; transition: background .2s; flex: none; }
.toggle::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), background .2s; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.toggle.on { background: #f2f2f2; }
.toggle.on::after { transform: translateX(20px); background: #111; }
.prof { text-align: center; margin: 4px 0 22px; }
.prof .round { width: 88px; height: 88px; margin: 0 auto 12px; font-size: 28px; }
.prof h2 { margin: 0 0 4px; font-size: 26px; }
.prof p { margin: 0; color: var(--muted); }
.si { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.legal { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 4px 6px; }
.tx-ico { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--card3); display: grid; place-items: center; color: #d7d7d7; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; line-height: 1.4; }
.rank { width: 26px; text-align: center; font-weight: 700; color: var(--muted); flex: none; }
.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
.qr { width: 168px; height: 168px; margin: 8px auto 12px; background: #fff; border-radius: 16px; padding: 10px; }
.addr { background: var(--card); border-radius: 16px; padding: 14px 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; word-break: break-all; color: #e0e0e0; }

#toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translate(-50%, 20px); z-index: 100;
  background: rgba(242, 242, 242, .96); color: #111; padding: 12px 18px; border-radius: 16px; font-weight: 600; font-size: 15px; max-width: min(90%, 420px);
  text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- scrollbars off ---------- */
html { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
* { scrollbar-width: none; }

/* ---------- stickers (TGS / Lottie) ---------- */
.stk { display: inline-block; flex: none; position: relative; line-height: 0; }
.stk svg { width: 100% !important; height: 100% !important; }
.action .stk { margin: -2px 0; }
.float { animation: floaty 3.2s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }

/* ---------- motion ---------- */
.screen > * { animation: rise .55s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
.screen.still > *, .body.still > * { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }
.body > * { animation: rise .45s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(var(--i, 0) * 38ms + 60ms); }
.card .row, .earn-card, .case, .pick, .stock, .product { transition: transform .25s cubic-bezier(.3, 1.5, .5, 1), background .2s; }
.earn-card:active, .case:active, .pick:active, .stock:active, .product:active { transform: scale(.94); }
.action { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1), background .2s; }
.action:active { transform: scale(.92); }
.action:active .ico svg { animation: nudge .5s ease; }
@keyframes nudge { 30% { transform: translateY(-4px) scale(1.12); } 100% { transform: none; } }
.btn { transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), opacity .2s, filter .2s; }
.btn:active { transform: scale(.96); filter: brightness(.92); }
.round { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.round:active { transform: scale(.9); }
.chip { transition: background .25s, color .25s, transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.chip:active { transform: scale(.92); }
.chip.on { animation: chipPop .4s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes chipPop { 40% { transform: scale(1.1); } }
.promo { transition: transform .3s cubic-bezier(.3, 1.5, .5, 1); }
.promo:active { transform: scale(.98); }
.promo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .13) 50%, transparent 65%); transform: translateX(-120%); animation: shine 4.5s ease-in-out infinite 1.2s; pointer-events: none; }
@keyframes shine { 0% { transform: translateX(-120%); } 30%, 100% { transform: translateX(120%); } }
.progress .fill { animation: grow .9s cubic-bezier(.2, .9, .3, 1) both .25s; transform-origin: left; }
@keyframes grow { from { clip-path: inset(0 100% 0 0 round 99px); } to { clip-path: inset(0 0 0 0 round 99px); } }
.bar-fill { transform-origin: left; animation: barGrow 1s cubic-bezier(.2, .9, .3, 1) both .3s; }
@keyframes barGrow { from { transform: scaleX(0); } }
.heat div { animation: tilePop .5s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--k, 0) * 22ms); }
@keyframes tilePop { from { opacity: 0; transform: scale(.6); } }
.heat div:active { filter: brightness(1.25); }
.pop { animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both; }
.sheet .close { transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.sheet .close:active { transform: scale(.85) rotate(90deg); }
.toggle:active::after { width: 30px; }
.toggle.on:active::after { transform: translateX(14px); }
.demo-pill { animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { background: var(--card3); } }
.sheet.drag { transition: none !important; }
.sheet.snap { transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

.tile-ico.st { background: transparent; }
.action .ico { height: 36px; display: grid; place-items: center; }
.page-hero .big { height: 122px; display: grid; place-items: center; margin-bottom: 4px; }
.si { background: #2c2c2c; }
.sheet.dragged { animation: none; }
.empty .stk { margin: 0 auto 4px; }
.promo .gem { right: 46px; bottom: -6px; width: 104px; height: 104px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .35)); }

/* ================= SimpleCards: 3D-карта ================= */
.vcard { --rx: 0deg; --ry: 0deg; --flip: 0deg; --mx: 50%; --my: 30%;
  display: block; width: 100%; aspect-ratio: 1.586; margin-bottom: 14px; perspective: 1100px; position: relative; text-align: left; cursor: pointer; }
.vcard.flipped { --flip: 180deg; }
.vc-inner { position: absolute; inset: 0; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; border-radius: 24px;
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip)));
  transition: transform .75s cubic-bezier(.25, .9, .3, 1); will-change: transform; }
.vcard { isolation: isolate; }
.vcard::after { content: ""; position: absolute; z-index: -1; left: 6%; right: 6%; top: 10%; bottom: -3%; border-radius: 24px; box-shadow: 0 16px 24px -10px rgba(0, 0, 0, .75); pointer-events: none; }
.vcard.tilting .vc-inner { transition: transform .12s ease-out; }
.vcard:active .vc-inner { scale: .985; transition: transform .75s cubic-bezier(.25, .9, .3, 1), scale .12s; }
.vc-face { position: absolute; inset: 0; border-radius: 24px; padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(0); color: #f5f5f5; border: 1px solid rgba(255, 255, 255, .1); }
.vc-back { transform: rotateY(180deg); padding: 0 0 18px; justify-content: flex-start; gap: 14px; }
.vc-sheen { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; opacity: .35;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 55%); }
.vc-top { display: flex; justify-content: space-between; align-items: center; }
.vc-tag { font-size: 12.5px; font-weight: 650; letter-spacing: .02em; opacity: .75; }
.vc-visa { font-weight: 850; font-style: italic; font-size: 24px; letter-spacing: .02em; }
.vc-mc { display: inline-flex; align-items: center; } .vc-mc i { display: block; width: 26px; height: 26px; border-radius: 50%; background: #eb001b; }
.vc-mc i + i { background: #f79e1b; margin-left: -10px; opacity: .92; }
.vc-chip { width: 38px; height: 28px; border-radius: 7px; background: linear-gradient(135deg, #e6d6a1, #b79b55); opacity: .9; }
.vc-num { font-size: 20px; font-weight: 600; letter-spacing: .12em; font-variant-numeric: tabular-nums; }
.vc-bot { display: flex; justify-content: space-between; align-items: flex-end; }
.vc-l { display: block; font-size: 11.5px; opacity: .65; font-weight: 600; margin-bottom: 2px; }
.vc-bal { font-size: 22px; font-weight: 750; }
.vc-exp { font-size: 14px; font-weight: 650; opacity: .85; }
.vc-frz { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700;
  background: rgba(10, 10, 10, .62); color: #fff; border-radius: inherit; }

.vc-strip { height: 44px; background: #050505; margin-top: 22px; }
.vc-bk { display: flex; flex-direction: column; gap: 12px; padding: 0 20px; }
.bk-row { display: block; } .bk-row.two { display: flex; gap: 28px; }
.bk-row b { font-size: 19px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.bk-num { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 650; letter-spacing: .1em; font-variant-numeric: tabular-nums; color: inherit; }
.bk-hint { font-size: 12px; opacity: .55; }
.card3d { padding: 6px 0 4px; }
.card3d .vcard { margin-bottom: 6px; }

/* оборот карты в списке перед открытием шторки */
@keyframes vc-spin { from { transform: rotateY(0) scale(1); } 50% { transform: rotateY(180deg) scale(1.04); } to { transform: rotateY(360deg) scale(1); } }

@media (prefers-reduced-motion: reduce) { .vc-inner { transition: none !important; } .vcard.spin .vc-inner { animation: none; } }


/* ===== SimpleCards v2 ===== */
/* дизайны карт */
.d-dark .vc-face { background: linear-gradient(145deg, #3b3b3b 0%, #161616 55%, #0d0d0d 100%); }
.d-silver .vc-face { background: linear-gradient(145deg, #fafafa 0%, #cfcfcf 60%, #a9a9a9 100%); color: #0a0a0a; border-color: rgba(0, 0, 0, .1); }
.d-silver .vc-chip { background: linear-gradient(135deg, #8a8a8a, #5a5a5a); }
.d-silver .vc-strip { background: #1a1a1a; }
.d-violet .vc-face { background: linear-gradient(145deg, #7c5cff 0%, #3b2a9e 55%, #1a1147 100%); }
.d-ocean .vc-face { background: linear-gradient(145deg, #22d3ee 0%, #2563eb 55%, #0b1f5c 100%); }
.d-cat .vc-front { background: linear-gradient(180deg, rgba(0, 0, 0, .38) 0%, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, .6) 100%), url(designs/cat.webp) 72% 40% / cover; color: #fff; }
.d-cat .vc-back { background: #121212; }
.d-cat .vc-sheen { opacity: .22; }

/* кармашек с картами на главной */
.wallet .bk { display: none; }
.wallet.open .bk { display: grid; transform: scaleX(-1); }
.wallet.open .av { display: none; }
.bal-total { max-height: 150px; overflow: hidden; transition: max-height .5s cubic-bezier(.2, .8, .2, 1), opacity .3s; }
.wallet.open .bal-total { max-height: 0; opacity: 0; }
.stagebox { container-type: inline-size; margin: 0 -16px; }
.stage { position: relative; height: 39cqw; overflow: hidden; cursor: pointer; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.wallet.open .stage { height: 54cqw; cursor: default; }
.rail { display: flex; gap: 3cqw; height: 100%; padding: 2cqw 12cqw 0; overflow-x: hidden; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-y; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.wallet.open .rail { overflow-x: auto; touch-action: pan-x pan-y; }
.wc { flex: 0 0 76cqw; scroll-snap-align: center; transform: translateY(2cqw) scale(1); opacity: 0; transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .4s; }
.wallet:not(.open) .wc.on { opacity: 1; transform: translateY(1cqw); }
.wallet.open .wc { opacity: .55; transform: scale(.92); }
.wallet.open .wc.on { opacity: 1; transform: none; }
.wc .vcard { margin: 0; }
.addcard .vc-face { align-items: center; justify-content: center; gap: 8px; background: transparent; border: 2px dashed rgba(255, 255, 255, .25); color: #bdbdbd; font-weight: 650; }
.pocket { position: absolute; left: 0; right: 0; bottom: 0; height: 13cqw; pointer-events: none; z-index: 2;
  background: linear-gradient(180deg, #131313, #0a0a0a 60%); border-radius: 12cqw 12cqw 0 0 / 5cqw 5cqw 0 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 -10px 24px rgba(0, 0, 0, .55);
  transition: transform .55s cubic-bezier(.2, .8, .2, 1), opacity .35s; }
.wallet.open .pocket { transform: translateY(105%); opacity: 0; }
.cardinfo { max-height: 0; opacity: 0; overflow: hidden; text-align: center; transition: max-height .5s cubic-bezier(.2, .8, .2, 1), opacity .4s .1s; }
.wallet.open .cardinfo { max-height: 150px; opacity: 1; }
.cardinfo .cn { font-size: 18px; font-weight: 650; padding-top: 14px; }
.cardinfo .cn span { color: var(--muted); font-weight: 500; }
.cardinfo .cb { font-size: 44px; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; }
.cardinfo .cs { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.wallet:not(.open) .acts-open, .wallet.open .acts-closed, .wallet.noc .acts-open { display: none; }
.wallet.open .acts-open { animation: fade .35s ease; }

/* выбор дизайна */
.dsg { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; margin-top: 6px; }
.dsg-i { text-align: center; font-weight: 650; font-size: 14px; color: #cacaca; }
.dsg-i .vcard { margin-bottom: 8px; pointer-events: none; }
.dsg-i .vc-num { font-size: 12px; } .dsg-i .vc-bal { font-size: 14px; } .dsg-i .vc-face { padding: 10px 12px; }
.dsg-i .vc-visa { font-size: 15px; } .dsg-i .vc-mc i { width: 16px; height: 16px; } .dsg-i .vc-chip { width: 26px; height: 19px; }
.dsg-i .vc-tag, .dsg-i .vc-l, .dsg-i .vc-exp { font-size: 9px; }
.dsg-i.on { color: #fff; }
.dsg-i.on .vc-inner { outline: 2px solid #fff; outline-offset: 2px; }

/* эффект-подтверждение со стикером */
.celebrate { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 40; animation: celPop .4s cubic-bezier(.2, 1.4, .4, 1); }
.celebrate.out { opacity: 0; transition: opacity .4s; }
@keyframes celPop { from { transform: scale(.5); opacity: 0; } }

.sheet.drag { will-change: transform; }
.sheet { overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; }

/* пока стикер грузится — мягкая заглушка вместо пустоты */
.stk:not(:has(svg)):not(:has(canvas))::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: rgba(255, 255, 255, .07); }

/* кармашек с картами не «выплывает» по частям: появляется сразу вместе с экраном */
.screen > .wallet { animation: none !important; }

/* ===== переходы между вкладками: только короткое проявление, без сдвигов и «выплывания» блоков по очереди ===== */
.screen { animation: fadeOnly .18s ease-out; }
@keyframes fadeOnly { from { opacity: 0; } }
.screen > * { animation: none !important; }

/* ===== кармашек: на iOS 3D-карта рисуется поверх соседних слоёв игнорируя z-index — обрезаем саму карусель по линии кармашка ===== */
.rail { position: relative; isolation: isolate; clip-path: inset(0 0 13cqw 0); transition: clip-path .6s cubic-bezier(.2, .8, .2, 1); }
.wallet.open .rail { clip-path: inset(0 0 0 0); }
.pocket { z-index: 5; transform: translate3d(0, 0, 0); will-change: transform; }
.wallet.open .pocket { transform: translate3d(0, 105%, 0); opacity: 0; }

/* кнопки действий ближе к кармашку: низ кармашка и область под ним стали ниже, видимая часть карты прежняя */
.stage { height: 35cqw; }
.pocket { height: 9cqw; }
.rail { clip-path: inset(0 0 9cqw 0); }
.wallet.open .rail { clip-path: inset(0 0 0 0); }

/* заморозка: плашка всегда в разметке, показывается классом — мгновенно, без перерисовки */
.vc-frz { opacity: 0; pointer-events: none; transition: opacity .22s ease; }
.vcard.frozen .vc-frz { opacity: 1; }
/* реквизиты на обороте, пока грузятся */
.sk { opacity: .45; animation: skp 1s ease-in-out infinite alternate; }
@keyframes skp { to { opacity: .8; } }
/* индикатор ожидания оплаты */
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .15); border-top-color: #fff; animation: spinr .8s linear infinite; flex: none; }
@keyframes spinr { to { transform: rotate(360deg); } }

/* чёрная полоска у карт: обратная сторона (с магнитной лентой) могла просвечивать по краю лицевой на iOS — пока карта не перевёрнута, она скрыта */
.vc-back { visibility: hidden; transition: visibility 0s .8s; }
.vcard.flipped .vc-back { visibility: visible; transition-delay: 0s; }
