/* ═══════════════════════════════════════════════════════════════════════════
   Gift Arenda — Mini App

   Ikonkalar: Solar (480 Design), CC BY 4.0.

   Tamoyillar:
     • Har bir holat ko'rinadi: yuklanish (skeleton), bo'sh, xato.
     • Layout sakrashi yo'q — rasm joyi oldindan band qilingan.
     • Animatsiyalar faqat transform/opacity ustida — 60 fps.
     • Telegram mavzusiga ergashadi, lekin o'z identifikatsiyasini saqlaydi.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg:        #0A0910;
  --surface:   #15131E;
  --surface-2: #1D1929;
  --raised:    #262034;
  --line:      rgba(255, 255, 255, .075);
  --line-2:    rgba(255, 255, 255, .15);

  --text:      #F3F1F8;
  --text-dim:  #9A93AC;
  --text-mute: #665E7A;

  --ton:       #3AA3F5;
  --ton-deep:  #1F76C4;
  --ton-wash:  rgba(58, 163, 245, .13);
  --gold:      #F7B733;
  --gold-wash: rgba(247, 183, 51, .13);
  --mint:      #3ECF9A;
  --mint-wash: rgba(62, 207, 154, .13);
  --ember:     #F2603C;
  --ember-wash:rgba(242, 96, 60, .13);

  --shadow:    0 16px 40px rgba(0, 0, 0, .5);
  --shadow-sm: 0 5px 16px rgba(0, 0, 0, .34);

  --r-xl: 26px;
  --r-lg: 20px;
  --r:    15px;
  --r-sm: 11px;

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar: 66px;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:        #F3F2F7;
    --surface:   #FFFFFF;
    --surface-2: #FFFFFF;
    --raised:    #EFECF5;
    --line:      rgba(18, 12, 38, .095);
    --line-2:    rgba(18, 12, 38, .2);

    --text:      #14101E;
    --text-dim:  #5E5776;
    --text-mute: #8B839E;

    --ton-wash:  rgba(58, 163, 245, .14);
    --gold-wash: rgba(193, 132, 28, .15);
    --mint-wash: rgba(30, 155, 110, .14);
    --ember-wash:rgba(220, 74, 42, .13);

    --shadow:    0 16px 36px rgba(36, 24, 64, .13);
    --shadow-sm: 0 4px 13px rgba(36, 24, 64, .08);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body { min-height: 100vh; min-height: 100dvh; }

button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--ton); outline-offset: 2px; border-radius: 6px; }

.num, .balance-value, .wallet-sum, .tile-price, .card-value b, .sum-row span:last-child {
  font-variant-numeric: tabular-nums;
}

/* Ikonkalar — bitta sinf, o'lchamni joyi belgilaydi */
.ico {
  width: 20px; height: 20px;
  flex: none;
  fill: currentColor;
  display: block;
}
.ico-lg { width: 26px; height: 26px; }
.ico-sm { width: 16px; height: 16px; }

/* ─────────────────────────── Splash ─────────────────────────── */

.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 15px;
  background: var(--bg);
  transition: opacity .35s var(--ease), visibility .35s;
}
.splash.is-done { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-mark { width: 58px; height: 58px; color: var(--ton); animation: bob 2.4s ease-in-out infinite; }
.splash-mark svg { width: 100%; height: 100%; }
@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }

.splash-name { font-size: 17px; font-weight: 650; letter-spacing: -.2px; }

.splash-bar { width: 126px; height: 3px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.splash-bar i {
  display: block; width: 40%; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--ton-deep), var(--ton));
  animation: slide 1.1s var(--ease) infinite;
}
@keyframes slide { 0% { transform: translateX(-100%) } 100% { transform: translateX(330%) } }

/* ─────────────────────────── Kirish to'sig'i ─────────────────────────── */

.gate {
  position: fixed; inset: 0; z-index: 90;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px;
  padding: 32px;
  background: var(--bg);
  text-align: center;
}
.gate-ico { width: 52px; height: 52px; color: var(--gold); fill: currentColor; }
.gate h2 { font-size: 19px; font-weight: 700; letter-spacing: -.3px; text-wrap: balance; }
.gate p {
  font-size: 14px; color: var(--text-dim); max-width: 34ch; line-height: 1.55;
  /* Xato matni ko'p qatorli bo'lishi mumkin — qatorlar saqlanadi va
     uzun manzillar/stack qatorlari ekrandan chiqib ketmaydi. */
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 42vh;
  overflow-y: auto;
}
.gate .btn { max-width: 260px; margin-top: 6px; }

/* ─────────────────────────── Topbar ─────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--safe-top) + 11px) 16px 11px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}

.topbar-user { display: flex; align-items: center; gap: 10px; min-width: 0; }

.avatar {
  width: 36px; height: 36px; flex: none;
  border-radius: 12px;
  background: linear-gradient(140deg, var(--ton), var(--ton-deep));
  background-size: cover; background-position: center;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: #fff;
}

.topbar-meta { display: flex; flex-direction: column; min-width: 0; }
.topbar-hello { font-size: 11px; color: var(--text-mute); line-height: 1.25; }
.topbar-name {
  font-size: 14.5px; font-weight: 650; line-height: 1.3; letter-spacing: -.2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw;
}

.balance-pill {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--ton) 22%, transparent),
    color-mix(in srgb, var(--ton) 9%, transparent));
  border: 1px solid color-mix(in srgb, var(--ton) 32%, transparent);
  transition: transform .15s var(--ease), border-color .18s;
}
.balance-pill:active { transform: scale(.95); border-color: var(--ton); }
.balance-pill .ico { color: var(--ton); }
.balance-value { font-size: 15px; font-weight: 720; color: var(--text); letter-spacing: -.2px; }
.balance-unit  { font-size: 10.5px; color: var(--text-dim); align-self: flex-end; padding-bottom: 2px; }

/* Balans o'zgarganda qisqa urg'u — foydalanuvchi to'lovni sezadi */
.balance-pill.is-bumped { animation: bump .5s var(--ease); }
@keyframes bump {
  0%, 100% { transform: none }
  35%      { transform: scale(1.1) }
}

/* ─────────────────────────── Ekranlar ─────────────────────────── */

.screen {
  display: none;
  padding: 0 16px calc(var(--tabbar) + var(--safe-bottom) + 22px);
  animation: rise .28s var(--ease);
}
.screen.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: none } }

.hero { padding: 20px 2px 15px; }
.hero h1 { font-size: 25px; font-weight: 760; letter-spacing: -.7px; text-wrap: balance; }
.hero p  { margin-top: 5px; font-size: 13.5px; color: var(--text-dim); max-width: 34ch; }

/* ─────────────────────────── Market banneri ───────────────────────────
   Sarlavha o'rniga to'liq banner: TON gradienti, kolleksiya belgisi va
   jonli raqamlar (katalogda nechta gift bor, eng arzoni qancha). */

.banner-hero {
  position: relative;
  margin: 16px 0 14px;
  padding: 20px 20px 18px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 88% 0%, rgba(255, 255, 255, .13), transparent 55%),
    linear-gradient(145deg, var(--ton-deep) 0%, #1A4F86 48%, #14243E 100%);
  border: 1px solid color-mix(in srgb, var(--ton) 30%, transparent);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.banner-glow {
  position: absolute;
  right: -60px; top: -70px;
  width: 210px; height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(120, 200, 255, .3), transparent 66%);
  pointer-events: none;
}

.banner-mark {
  position: absolute;
  right: -18px; bottom: -26px;
  width: 138px; height: 138px;
  color: rgba(255, 255, 255, .11);
  pointer-events: none;
}

.banner-body { position: relative; }

.banner-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 10px; font-weight: 700;
  letter-spacing: .7px;
}

.banner-hero h1 {
  margin-top: 10px;
  font-size: 27px; font-weight: 780; letter-spacing: -.9px; color: #fff;
}
.banner-hero p {
  margin-top: 5px;
  font-size: 13px; color: rgba(255, 255, 255, .78);
  max-width: 30ch; line-height: 1.45;
}

.banner-stats {
  display: flex; align-items: center; gap: 10px;
  margin-top: 15px;
  font-size: 11.5px; color: rgba(255, 255, 255, .68);
}
.banner-stats b {
  color: #fff; font-size: 14px; font-weight: 720;
  font-variant-numeric: tabular-nums;
  margin-right: 3px;
}
.banner-stats i {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 255, 255, .32);
  flex: none;
}

/* ─────────────────────────── Giftlarim sarlavhasi ─────────────────────────── */

.mine-head { padding: 18px 0 14px; }
.mine-head-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mine-head-top h1 { font-size: 25px; font-weight: 760; letter-spacing: -.7px; }

.icon-btn {
  width: 36px; height: 36px; flex: none;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  color: var(--text-dim);
  transition: transform .15s var(--ease), color .18s;
}
.icon-btn:active { transform: scale(.92); color: var(--ton); }
.icon-btn.is-busy .ico { animation: spin 1s linear infinite; }

.mine-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-top: 14px;
}
.mine-stat {
  padding: 11px 12px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
}
.mine-stat-value {
  display: block;
  font-size: 19px; font-weight: 740; letter-spacing: -.4px;
  font-variant-numeric: tabular-nums;
}
.mine-stat-label {
  display: block; margin-top: 2px;
  font-size: 10.5px; color: var(--text-mute); line-height: 1.3;
}

/* ─────────────────────────── Toolbar ─────────────────────────── */

.toolbar { display: flex; gap: 8px; margin-bottom: 9px; }

.chip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 560;
  white-space: nowrap;
  transition: background .18s, transform .15s var(--ease);
}
.chip:active { transform: scale(.97); background: var(--surface-2); }
.chip .ico { color: var(--text-dim); }
.chip-wide { flex: 1; min-width: 0; }
.chip-wide > span {
  flex: 1; min-width: 0; text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-chev { color: var(--text-mute); }

/* ─────────────────────────── Qidiruv ─────────────────────────── */

.search {
  display: flex; align-items: center; gap: 9px;
  height: 44px;
  padding: 0 13px;
  margin-bottom: 13px;
  border-radius: var(--r);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .18s;
}
.search:focus-within { border-color: color-mix(in srgb, var(--ton) 45%, transparent); }
.search > .ico { color: var(--text-mute); }
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  font-size: 14.5px;
}
.search input::placeholder { color: var(--text-mute); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { color: var(--text-mute); display: grid; place-items: center; }

/* ─────────────────────────── Banner ─────────────────────────── */

.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px;
  margin-bottom: 12px;
  border-radius: var(--r);
  background: var(--gold-wash);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  font-size: 12.5px;
  color: var(--gold);
  line-height: 1.45;
}
.banner .ico { color: var(--gold); }

/* ─────────────────────────── Gift to'ri ─────────────────────────── */

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

.tile {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform .16s var(--ease), border-color .18s;
  /* Ekrandan tashqaridagi kartochkalar chizilmaydi — minglab element
     bo'lganda ham aylantirish silliq qoladi. `contain-intrinsic-size`
     ularning balandligini oldindan bildiradi, shuning uchun aylantirish
     paneli sakramaydi. */
  content-visibility: auto;
  contain-intrinsic-size: auto 232px;
}
.tile:active { transform: scale(.965); border-color: var(--line-2); }

.tile-media {
  position: relative;
  aspect-ratio: 1 / 1;              /* rasm kelguncha joy band — sakrash yo'q */
  background:
    radial-gradient(118% 88% at 50% 0%, var(--ton-wash), transparent 62%),
    var(--surface-2);
  display: grid; place-items: center;
  overflow: hidden;
}
.tile-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s var(--ease);
}
.tile-media img.is-loaded { opacity: 1; }
.tile-media .fallback { position: absolute; font-size: 30px; opacity: .32; }

.tile-days {
  position: absolute; left: 8px; bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(6, 5, 11, .62);
  backdrop-filter: blur(6px);
  font-size: 10.5px; font-weight: 600; color: #F0EDF7;
  letter-spacing: .1px;
}

.tile-body { padding: 10px 11px 12px; }
.tile-name { font-size: 13px; font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-col  { margin-top: 1px; font-size: 10.5px; color: var(--text-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-price { margin-top: 7px; font-size: 14.5px; font-weight: 720; color: var(--ton); }
.tile-price span { font-size: 11px; font-weight: 500; color: var(--text-mute); }

/* Skeleton */
.tile.is-skeleton { pointer-events: none; }
.tile.is-skeleton .tile-media,
.tile.is-skeleton .sk {
  background: linear-gradient(100deg, var(--surface-2) 30%, var(--raised) 50%, var(--surface-2) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
}
.tile.is-skeleton .sk { border-radius: 6px; height: 11px; margin-top: 8px; }
.tile.is-skeleton .sk.w60 { width: 60%; }
@keyframes shimmer { from { background-position: 180% 0 } to { background-position: -40% 0 } }

.sentinel { height: 1px; }

/* ─────────────────────────── Bo'sh holat ─────────────────────────── */

.empty {
  grid-column: 1 / -1;
  padding: 52px 24px;
  text-align: center;
  color: var(--text-dim);
}
.empty .ico-lg { width: 54px; height: 54px; margin: 0 auto 12px; color: var(--text-mute); fill: currentColor; opacity: .8; }
.empty b { display: block; color: var(--text); font-size: 15.5px; margin-bottom: 4px; }
.empty span { font-size: 13px; }

/* ─────────────────────────── Detal ─────────────────────────── */

.detail-hero { padding: 18px 0 14px; text-align: center; }

.detail-img {
  width: 150px; height: 150px; margin: 0 auto 15px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(118% 88% at 50% 0%, var(--ton-wash), transparent 62%),
    var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-img .fallback { font-size: 46px; opacity: .38; }

.tag {
  display: inline-block;
  padding: 3px 11px; margin-bottom: 8px;
  border-radius: 999px;
  background: var(--ton-wash);
  color: var(--ton);
  font-size: 10.5px; font-weight: 680;
  letter-spacing: .55px; text-transform: uppercase;
}

.detail-hero h2 { font-size: 21px; font-weight: 720; letter-spacing: -.5px; text-wrap: balance; }
.detail-rate {
  margin-top: 7px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; color: var(--text-dim);
}
.detail-rate .ico { color: var(--gold); }
.detail-rate b { font-size: 17px; color: var(--text); font-weight: 700; }

/* ─────────────────────────── Karta ─────────────────────────── */

.card {
  padding: 16px;
  margin-bottom: 11px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-dim); }
.card-title .ico { color: var(--text-mute); }
.card-value { font-size: 13.5px; color: var(--text-dim); }
.card-value b { font-size: 19px; font-weight: 720; color: var(--text); }

/* ─────────────────────────── Slider ─────────────────────────── */

.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 5px;
  border-radius: 5px;
  background: var(--raised);
  outline: none;
  margin: 4px 0;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 25px; height: 25px;
  border-radius: 50%;
  background: #fff;
  border: 5px solid var(--ton);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
  transition: transform .12s var(--ease);
}
.slider::-webkit-slider-thumb:active { transform: scale(1.14); }
.slider::-moz-range-thumb {
  width: 25px; height: 25px; border-radius: 50%;
  background: #fff; border: 5px solid var(--ton);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}

.slider-legend {
  display: flex; justify-content: space-between;
  margin-top: 7px;
  font-size: 11.5px; color: var(--text-mute);
}

.quick { display: flex; gap: 7px; margin-top: 13px; }
.quick-day {
  flex: 1; min-width: 0;
  padding: 8px 0;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid transparent;
  font-size: 12.5px; font-weight: 620; color: var(--text-dim);
  transition: all .16s var(--ease);
}
.quick-day.is-active {
  background: var(--ton-wash);
  border-color: color-mix(in srgb, var(--ton) 42%, transparent);
  color: var(--ton);
}
.quick-day:active { transform: scale(.95); }

/* ─────────────────────────── Summa ─────────────────────────── */

.sum-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0;
  font-size: 13.5px; color: var(--text-dim);
}
.sum-row span:last-child { color: var(--text); }
.sum-total {
  margin-top: 5px; padding-top: 13px;
  border-top: 1px solid var(--line);
  font-size: 15px; font-weight: 620; color: var(--text);
}
.sum-total span:last-child { font-size: 19px; font-weight: 760; color: var(--ton); }

.hint { margin-top: 11px; font-size: 12.5px; color: var(--text-mute); line-height: 1.45; }
.hint.is-warn  { color: var(--gold); }
.hint.is-error { color: var(--ember); }

/* ─────────────────────────── Tugmalar ─────────────────────────── */

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  height: 50px;
  border-radius: var(--r);
  font-size: 15.5px; font-weight: 660;
  letter-spacing: -.1px;
  text-decoration: none;
  transition: transform .14s var(--ease), opacity .18s, background .18s;
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .42; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--ton-deep), var(--ton));
  color: #fff;
  box-shadow: 0 7px 22px color-mix(in srgb, var(--ton) 30%, transparent);
}
.btn-line {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  margin-bottom: 11px;
}

.btn .spin {
  width: 17px; height: 17px;
  border: 2px solid rgba(255, 255, 255, .3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

.sticky {
  position: sticky;
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 10px);
  z-index: 20;
  padding-top: 6px;
}
.sticky-row { display: flex; gap: 8px; }
.sticky-row .btn-primary { flex: 1; }
.btn-icon { width: auto; flex: none; padding: 0 16px; margin: 0; }

/* ─────────────────────────── Video qo'llanma ─────────────────────────── */

.video-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line);
  overflow: hidden;
  display: grid; place-items: center;
}
.video-frame video,
.video-frame iframe { width: 100%; height: 100%; border: 0; object-fit: cover; display: block; }
.video-frame .video-empty {
  padding: 22px; text-align: center;
  font-size: 13px; color: var(--text-mute); line-height: 1.5;
}
.video-note {
  margin: 12px 0 14px;
  font-size: 12.5px; color: var(--text-dim); line-height: 1.55;
}
.video-note code {
  padding: 1px 5px; border-radius: 5px;
  background: var(--raised); color: var(--ton);
}

/* ─────────────────────────── Mening giftlarim ─────────────────────────── */

.mine-list { display: flex; flex-direction: column; gap: 11px; }

.mine-card {
  padding: 13px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}

.mine-top { display: flex; gap: 12px; align-items: center; }

.mine-img {
  width: 58px; height: 58px; flex: none;
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
  display: grid; place-items: center;
}
.mine-img img { width: 100%; height: 100%; object-fit: cover; }
.mine-img .fallback { font-size: 24px; opacity: .38; }

.mine-info { flex: 1; min-width: 0; }
.mine-name { font-size: 14.5px; font-weight: 660; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine-col  { font-size: 11.5px; color: var(--text-mute); margin-top: 1px; }

.status {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 620;
}
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status.is-active  { background: var(--mint-wash);  color: var(--mint); }
.status.is-pending { background: var(--gold-wash);  color: var(--gold); }
.status.is-paying  { background: var(--ton-wash);   color: var(--ton); }
.status.is-failed  { background: var(--ember-wash); color: var(--ember); }
.status.is-paying i { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3 } }

.mine-progress { height: 3px; margin-top: 11px; border-radius: 3px; background: var(--raised); overflow: hidden; }
.mine-progress i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--ton-deep), var(--ton));
  transition: width .4s var(--ease);
}

/* Har ikkala amal: "Profilga ulash" VA "Uzaytirish" */
.mine-actions { display: flex; gap: 8px; margin-top: 12px; }
.mine-actions .btn { flex: 1; height: 41px; border-radius: 12px; font-size: 13.5px; margin: 0; }
.mine-actions .btn .ico { width: 17px; height: 17px; }

.mine-error {
  margin-top: 10px; padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--ember-wash);
  font-size: 12px; line-height: 1.5; color: var(--ember);
}
.mine-error b { font-weight: 640; }

/* ─────────────────────────── Balans ─────────────────────────── */

.wallet {
  position: relative;
  margin-top: 22px;
  padding: 28px 22px 26px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(112% 128% at 84% 4%, rgba(255, 255, 255, .14), transparent 56%),
    linear-gradient(142deg, var(--ton-deep), #133C64 62%, var(--surface) 100%);
  border: 1px solid color-mix(in srgb, var(--ton) 24%, transparent);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
}
.wallet-ico {
  width: 46px; height: 46px;
  margin: 0 auto 13px;
  color: rgba(255, 255, 255, .9);
  fill: currentColor;
}
.wallet-label { font-size: 12.5px; color: rgba(255, 255, 255, .72); }
.wallet-sum {
  margin-top: 6px;
  font-size: 35px; font-weight: 780; letter-spacing: -1.2px; color: #fff;
}
.wallet-sum i { font-size: 15px; font-weight: 500; font-style: normal; opacity: .66; }

.topup { margin-top: 18px; }
.topup p {
  margin: 14px auto 0;
  max-width: 32ch;
  font-size: 12.5px; color: var(--text-mute); line-height: 1.55;
  text-align: center;
}
.topup b { color: var(--text); font-weight: 620; }

/* ─────────────────────────── Maydon ─────────────────────────── */

.field-label {
  display: block;
  font-size: 11px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.field {
  display: flex; align-items: center;
  height: 46px;
  padding-left: 13px;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid transparent;
  transition: border-color .18s;
}
.field:focus-within { border-color: color-mix(in srgb, var(--ton) 45%, transparent); }
.field input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 14px; }
.field input::placeholder { color: var(--text-mute); }
.field-btn {
  display: flex; align-items: center; gap: 6px;
  height: 100%; padding: 0 14px;
  border-left: 1px solid var(--line);
  font-size: 13px; font-weight: 620; color: var(--ton);
}

/* ─────────────────────────── Qadamlar ─────────────────────────── */

.steps { display: flex; flex-direction: column; gap: 14px; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step i {
  width: 24px; height: 24px; flex: none;
  border-radius: 50%;
  background: var(--ton-wash);
  color: var(--ton);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 720; font-style: normal;
}
.step span { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; padding-top: 2px; }
.step b { color: var(--text); font-weight: 620; }
.step code { padding: 1px 5px; border-radius: 5px; background: var(--raised); color: var(--ton); }

/* ─────────────────────────── Tabbar ─────────────────────────── */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex;
  height: calc(var(--tabbar) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
}

.tab {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-mute);
  font-size: 10.5px; font-weight: 560;
  transition: color .18s;
}
.tab .ico { width: 23px; height: 23px; transition: transform .18s var(--ease); }
.tab .tab-on  { display: none; }
.tab.is-active { color: var(--ton); }
.tab.is-active .tab-off { display: none; }
.tab.is-active .tab-on  { display: block; transform: translateY(-1px); }
.tab:active .ico { transform: scale(.9); }

.tab-dot {
  position: absolute; top: 9px; left: 50%; margin-left: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 2px var(--bg);
}

/* ─────────────────────────── Varaq ─────────────────────────── */

.sheet-bg {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(4, 3, 8, .58);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden;
  transition: opacity .26s var(--ease), visibility .26s;
  display: flex; align-items: flex-end;
}
.sheet-bg.is-open { opacity: 1; visibility: visible; }

.sheet {
  width: 100%;
  max-height: 76vh;
  padding: 10px 16px calc(20px + var(--safe-bottom));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface);
  border-top: 1px solid var(--line-2);
  transform: translateY(100%);
  transition: transform .3s var(--ease);
  display: flex; flex-direction: column;
}
.sheet-bg.is-open .sheet { transform: none; }

.sheet-grab { width: 38px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: var(--line-2); }
.sheet h3 { font-size: 17.5px; font-weight: 720; letter-spacing: -.35px; margin-bottom: 12px; }
.sheet-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.sheet-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 7px;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid transparent;
  font-size: 14px; text-align: left;
  transition: all .16s var(--ease);
}
.sheet-item:active { transform: scale(.98); }
.sheet-item.is-active {
  background: var(--ton-wash);
  border-color: color-mix(in srgb, var(--ton) 38%, transparent);
  color: var(--ton);
  font-weight: 620;
}
.sheet-item em { font-style: normal; font-size: 12px; color: var(--text-mute); flex: none; font-variant-numeric: tabular-nums; }
.sheet-item.is-active em { color: var(--ton); }
.sheet-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─────────────────────────── Toast ─────────────────────────── */

.toast {
  position: fixed; z-index: 80;
  left: 16px; right: 16px;
  bottom: calc(var(--tabbar) + var(--safe-bottom) + 16px);
  padding: 13px 16px;
  border-radius: var(--r);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13.5px; font-weight: 550;
  text-align: center;
  opacity: 0; transform: translateY(14px);
  visibility: hidden;
  transition: all .28s var(--ease);
}
.toast.is-open { opacity: 1; transform: none; visibility: visible; }
.toast.is-error   { border-color: color-mix(in srgb, var(--ember) 48%, transparent); color: var(--ember); }
.toast.is-success { border-color: color-mix(in srgb, var(--mint) 48%, transparent);  color: var(--mint); }

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

/* --------------------------- To'plamlar --------------------------- */

.bundle-promo {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--gold) 13%, var(--surface)), var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  text-align: left;
  transition: transform .16s var(--ease);
}
.bundle-promo:active { transform: scale(.985); }
.bundle-promo-ico {
  display: grid; place-items: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 13px;
  background: var(--gold-wash);
  color: var(--gold);
}
.bundle-promo-text { flex: 1; min-width: 0; display: block; }
.bundle-promo-text b { display: block; font-size: 14px; font-weight: 680; }
.bundle-promo-text i {
  display: block; margin-top: 1px;
  font-style: normal; font-size: 11.5px; color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bundle-promo > .ico { color: var(--text-mute); flex: none; }

.bundle-hero {
  position: relative;
  margin: 16px 0 14px;
  padding: 20px 20px 18px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(120% 140% at 88% 0%, rgba(255, 255, 255, .12), transparent 55%),
    linear-gradient(145deg, #6C4BB6 0%, #4A3585 48%, #221B3C 100%);
  border: 1px solid rgba(160, 130, 240, .3);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.bundle-hero .banner-glow {
  background: radial-gradient(circle, rgba(214, 180, 255, .32), transparent 66%);
}
.bundle-hero .banner-tag {
  display: inline-flex; align-items: center; gap: 5px;
}
.bundle-hero h1 {
  margin-top: 10px;
  font-size: 24px; font-weight: 780; letter-spacing: -.7px; color: #fff;
}
.bundle-hero p {
  margin-top: 6px;
  font-size: 12.5px; color: rgba(255, 255, 255, .78);
  max-width: 34ch; line-height: 1.5;
}
.bundle-hero p b { color: #fff; font-weight: 700; }

.kinds {
  display: flex; gap: 7px;
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Tanlangan chip qirg'oqqa yopishib, yarmi kesilib qolmasin. */
  scroll-padding-inline: 8px;
  padding: 2px;
  margin-inline: -2px;
}
.kinds::-webkit-scrollbar { display: none; }
.kinds .chip { flex: none; white-space: nowrap; }
.kinds .chip.is-active {
  background: var(--ton-wash);
  border-color: color-mix(in srgb, var(--ton) 42%, transparent);
  color: var(--ton);
}
.kinds .chip.is-active .ico { color: var(--ton); }

.bundle-list { display: flex; flex-direction: column; gap: 11px; }

.bcard {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
  contain-intrinsic-size: auto 96px;
  content-visibility: auto;
  transition: transform .16s var(--ease), border-color .16s var(--ease);
}
.bcard:active { transform: scale(.985); border-color: var(--line-2); }
.bcard-backdrop { border-color: color-mix(in srgb, #A082F0 24%, transparent); }

.bcard-mosaic {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  width: 74px; height: 74px; flex: none;
  padding: 2px;
  border-radius: var(--r);
  background: var(--surface-2);
  overflow: hidden;
}
.bcard-cell {
  position: relative;
  display: grid; place-items: center;
  border-radius: 7px;
  background: var(--raised);
  overflow: hidden;
}
.bcard-cell img {
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .3s var(--ease);
}
.bcard-cell img.is-loaded { opacity: 1; }
.bcard-cell .fallback { font-size: 15px; opacity: .3; }
.bcard-count {
  position: absolute; right: 3px; bottom: 3px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  backdrop-filter: blur(6px);
  font-size: 9.5px; font-weight: 640; color: #fff;
}

.bcard-body { flex: 1; min-width: 0; }
.bcard-kind {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 620; color: var(--text-mute);
  text-transform: uppercase; letter-spacing: .4px;
}
.bcard-kind .ico { width: 13px; height: 13px; }
.bcard-backdrop .bcard-kind { color: #B79BF5; }
.bcard-name {
  margin-top: 3px;
  font-size: 14.5px; font-weight: 680; line-height: 1.3;
  /* "Neon Blue · Palm Beach · Eagle" bir qatorga sig'maydi —
     kesib tashlagandan ko'ra ikki qatorga tushgani ma'qul. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.bcard-col {
  font-size: 11px; color: var(--text-mute);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bcard-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-top: 7px;
}
.bcard-sizes { font-size: 11px; color: var(--text-dim); }
.bcard-price {
  font-size: 14px; font-weight: 720; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.bcard-price i { font-style: normal; font-size: 10.5px; font-weight: 500; color: var(--text-mute); }
.bcard-chev { color: var(--text-mute); flex: none; }

.bcard.is-skeleton { pointer-events: none; }
.bcard.is-skeleton .bcard-mosaic,
.bcard.is-skeleton .bcard-body span {
  background: var(--raised);
  animation: pulse 1.4s ease-in-out infinite;
}
.bcard.is-skeleton .bcard-body { display: flex; flex-direction: column; gap: 8px; }
.bcard.is-skeleton .bcard-body span { height: 12px; border-radius: 6px; }
.bcard.is-skeleton .bcard-body span:last-child { width: 55%; }

/* --------------------------- To'plam detali --------------------------- */

.bundle-top { padding: 18px 0 14px; }
.bundle-top h2 {
  margin-top: 8px;
  font-size: 25px; font-weight: 760; letter-spacing: -.7px;
}
.bundle-top p { margin-top: 3px; font-size: 12.5px; color: var(--text-mute); }

.size-chip {
  flex: 1; min-width: 0;
  padding: 9px 0;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 660; color: var(--text-dim);
  transition: all .16s var(--ease);
}
.size-chip.is-active {
  background: var(--gold-wash);
  border-color: color-mix(in srgb, var(--gold) 44%, transparent);
  color: var(--gold);
}
.size-chip:active { transform: scale(.95); }

.bundle-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  margin-top: 14px;
}
.bgift {
  aspect-ratio: 1;
  padding: 0;
  border-radius: var(--r-sm);
  background: var(--raised);
  border: 1px solid transparent;
  opacity: .3;
  filter: grayscale(1);
  transition: opacity .2s var(--ease), filter .2s var(--ease), border-color .2s var(--ease);
}
.bgift.is-in {
  opacity: 1;
  filter: none;
  border-color: color-mix(in srgb, var(--gold) 34%, transparent);
}
.bgift:active { transform: scale(.94); }
.bgift-media {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 100%;
  border-radius: inherit;
  overflow: hidden;
}
.bgift-media img {
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .3s var(--ease);
}
.bgift-media img.is-loaded { opacity: 1; }
.bgift-media .fallback { font-size: 16px; opacity: .35; }

.bundle-sum .sum-total { margin-top: 10px; padding-top: 12px; font-size: 16px; }
.bundle-sum .sum-total span:last-child {
  font-size: 21px; font-weight: 780; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.bundle-note {
  font-size: 11.5px; line-height: 1.55; color: var(--text-mute);
}

/* Yopishqoq tugma ostidagi izoh berkilib qolmasligi uchun joy qoldiramiz. */
.bundle-sum { margin-bottom: 62px; }

.mine-bundle {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 5px;
  padding: 2px 7px 2px 5px;
  border-radius: 999px;
  background: var(--gold-wash);
  font-size: 10.5px; font-weight: 600; color: var(--gold);
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mine-bundle .ico { width: 12px; height: 12px; flex: none; }

.traits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.trait {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--text);
}
.trait i {
  font-style: normal; font-size: 10px; font-weight: 620;
  color: var(--text-mute); text-transform: uppercase; letter-spacing: .4px;
}
