/* ==========================================================================
   REXY P2P — Telegram WebApp marketplace
   ========================================================================== */

:root {
  --bg: #07080b;
  --bg-soft: #0b0d12;
  --panel: rgba(18, 21, 28, 0.86);
  --panel-solid: #12151c;
  --panel-2: #171b24;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f4f2;
  --muted: #8e94a3;
  --muted-2: #666d7c;
  --gold: #e8c47a;
  --gold-2: #b98a3c;
  --gold-soft: rgba(232, 196, 122, 0.12);
  --green: #56d7a4;
  --green-soft: rgba(86, 215, 164, 0.12);
  --red: #ff7a7a;
  --red-soft: rgba(255, 122, 122, 0.12);
  --blue: #7aa8ff;
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: #111; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ambient background */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.ambient-a {
  width: 420px; height: 420px; top: -170px; inset-inline-start: -120px;
  background: radial-gradient(circle, rgba(232, 196, 122, 0.28), transparent 68%);
}
.ambient-b {
  width: 380px; height: 380px; bottom: 2%; inset-inline-end: -160px;
  background: radial-gradient(circle, rgba(80, 140, 255, 0.16), transparent 70%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: calc(14px + var(--safe-top)) clamp(14px, 4vw, 30px) calc(108px + var(--safe-bottom));
}

/* top bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 4px 0 18px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 12px;
  color: #141006; font-weight: 900; font-size: 20px;
  background: linear-gradient(145deg, #f8dfa4, #c69545 62%, #8f6425);
  box-shadow: 0 8px 22px rgba(232, 196, 122, 0.22), inset 0 1px 0 rgba(255,255,255,.5);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-copy strong { font-size: 16px; letter-spacing: 0.14em; }
.brand-copy small { font-size: 8px; letter-spacing: 0.28em; color: var(--gold); margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted);
  display: grid; place-items: center; transition: .2s;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.lang-wrap { position: relative; }
.lang-select {
  height: 36px; max-width: 88px; padding: 0 24px 0 10px;
  border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.035); color: var(--text); font-size: 12px;
  appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 12px) 15px, calc(100% - 8px) 15px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
[dir="rtl"] .lang-select { padding: 0 10px 0 24px; background-position: 8px 15px, 12px 15px; }
.lang-select option { background: #16191f; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: linear-gradient(135deg, rgba(232,196,122,.22), rgba(232,196,122,.05));
  border: 1px solid rgba(232,196,122,.35); color: var(--gold);
  text-transform: uppercase;
}

/* hero */
.hero {
  position: relative; overflow: hidden;
  margin-bottom: 22px;
  padding: clamp(20px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    radial-gradient(120% 160% at 92% 0%, rgba(232,196,122,.13), transparent 44%),
    linear-gradient(160deg, rgba(28,31,39,.95), rgba(12,14,18,.96));
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 18px 18px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 70%);
}
.hero-glow {
  position: absolute; width: 280px; height: 280px;
  top: -150px; inset-inline-end: -40px; border-radius: 50%;
  background: radial-gradient(circle, rgba(232,196,122,.32), transparent 68%);
  filter: blur(35px); pointer-events: none;
}
.hero-top { position: relative; display: flex; justify-content: space-between; gap: 14px; z-index: 1; }
.eyebrow {
  margin: 0 0 10px; color: var(--gold); font-size: 9px; font-weight: 700;
  letter-spacing: .26em; text-transform: uppercase;
}
.hero h1 {
  margin: 0; font-size: clamp(27px, 6vw, 48px); line-height: 1.02;
  letter-spacing: -.035em; font-weight: 650;
}
.hero h1 span {
  background: linear-gradient(100deg, #f7e3b3, #d5a856 55%, #9c722f);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  position: relative; z-index: 1; max-width: 540px; margin: 14px 0 0;
  color: var(--muted); font-size: 13px; line-height: 1.55;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; height: 30px;
  padding: 0 12px; border-radius: 999px; flex: 0 0 auto;
  border: 1px solid rgba(86,215,164,.24); background: rgba(86,215,164,.07);
  color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: .08em;
}
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(86,215,164,.5); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(86,215,164,0); } 100% { box-shadow: 0 0 0 0 rgba(86,215,164,0); } }
.hero-stats {
  position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line);
}
.stat { min-width: 0; }
.stat > span { display: block; color: var(--muted-2); font-size: 9px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat strong { display: block; margin-top: 5px; font-size: clamp(17px, 3.2vw, 25px); font-weight: 650; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat em { font-style: normal; font-size: 10px; color: var(--gold); letter-spacing: .08em; }

/* tabs */
.tabs {
  display: flex; gap: 6px; margin: 20px 0 22px; padding: 5px;
  border: 1px solid var(--line); border-radius: 15px;
  background: rgba(15,17,22,.7); backdrop-filter: blur(12px);
}
.tab {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; border: 0; border-radius: 11px; background: transparent;
  color: var(--muted); font-size: 12px; font-weight: 600; transition: .2s;
}
.tab-ico { font-size: 13px; opacity: .8; }
.nav-icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; }
.tab.active { color: #171206; background: linear-gradient(145deg, #f2d99d, #cfa458); box-shadow: 0 6px 18px rgba(232,196,122,.18); }
.view { display: none; animation: fadeUp .32s ease both; }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; font-size: clamp(19px, 4vw, 26px); letter-spacing: -.02em; font-weight: 650; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.count-pill {
  flex: 0 0 auto; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.03);
  color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .06em;
}
.count-pill span:first-child { color: var(--gold); }

/* toolbar */
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.search-box { position: relative; min-width: 0; }
.search-box input {
  width: 100%; height: 42px; padding: 0 38px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(255,255,255,.035);
  color: var(--text); outline: none; transition: .2s; font-size: 12px;
}
.search-box input::placeholder { color: var(--muted-2); }
.search-box input:focus { border-color: rgba(232,196,122,.42); background: rgba(232,196,122,.04); }
.search-ico { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); color: var(--muted-2); font-size: 17px; }
.clear-search { position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border: 0; border-radius: 8px; background: rgba(255,255,255,.07); color: var(--muted); }
.control {
  height: 42px; padding: 0 28px 0 12px; border-radius: 12px;
  border: 1px solid var(--line); background-color: rgba(255,255,255,.035);
  color: var(--muted); font-size: 11px; outline: none; appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-2) 50%), linear-gradient(135deg, var(--muted-2) 50%, transparent 50%);
  background-position: calc(100% - 14px) 18px, calc(100% - 10px) 18px;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
[dir="rtl"] .control { padding: 0 12px 0 28px; background-position: 10px 18px, 14px 18px; }
.control option { background: #16191f; }

.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025);
  color: var(--muted); font-size: 10px; font-weight: 600; white-space: nowrap; transition: .18s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { color: #171206; border-color: transparent; background: linear-gradient(145deg, #f2d99d, #cfa458); }

/* gift grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gift-card {
  position: relative; display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(25,28,36,.92), rgba(14,16,21,.96));
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.gift-card:hover { transform: translateY(-3px); border-color: rgba(232,196,122,.28); box-shadow: 0 18px 44px rgba(0,0,0,.38); }
.gift-media {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%, rgba(232,196,122,.16), transparent 55%),
    linear-gradient(145deg, #20242d, #0e1015);
}
.gift-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s; }
.gift-card:hover .gift-media img { transform: scale(1.045); }
.gift-media img.img-fallback { opacity: 0; }
.gift-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 62%, rgba(8,9,12,.55)); pointer-events: none; }
.gift-status {
  position: absolute; z-index: 2; top: 9px; inset-inline-start: 9px;
  padding: 4px 8px; border-radius: 999px; font-size: 8px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12); background: rgba(8,9,12,.55); color: var(--muted);
}
.gift-status.owned { color: var(--green); border-color: rgba(86,215,164,.35); background: rgba(12,30,23,.7); }
.gift-status.sold { color: var(--red); border-color: rgba(255,122,122,.3); background: rgba(40,14,14,.7); }
.fav {
  position: absolute; z-index: 2; top: 8px; inset-inline-end: 8px;
  width: 28px; height: 28px; border-radius: 9px; border: 1px solid rgba(255,255,255,.14);
  background: rgba(8,9,12,.5); color: #fff; backdrop-filter: blur(8px);
  display: grid; place-items: center; font-size: 13px; transition: .18s;
}
.fav:hover { background: rgba(232,196,122,.2); color: var(--gold); }
.gift-body { display: flex; flex-direction: column; flex: 1; padding: 11px 12px 12px; }
.gift-title-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gift-name { margin: 0; font-size: 13px; font-weight: 650; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift-num { flex: 0 0 auto; color: var(--muted-2); font-size: 9px; font-weight: 600; }
.gift-collection { margin: 2px 0 0; color: var(--gold); font-size: 9px; font-weight: 600; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gift-traits { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.trait {
  max-width: 100%; padding: 3px 7px; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(255,255,255,.025);
  color: var(--muted); font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gift-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 11px; }
.price { line-height: 1; min-width: 0; }
.price strong { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.price span { margin-inline-start: 3px; color: var(--gold); font-size: 8px; font-weight: 700; letter-spacing: .1em; }
.buy-btn {
  flex: 0 0 auto; height: 30px; padding: 0 13px; border-radius: 9px; border: 0;
  background: linear-gradient(145deg, #f2d99d, #cfa458); color: #171206;
  font-size: 10px; font-weight: 800; letter-spacing: .04em; transition: .18s;
}
.buy-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.gift-card.is-sold .gift-media img { filter: grayscale(1) brightness(.55); }
.gift-card.is-sold .buy-btn, .gift-card.is-owned .buy-btn { background: rgba(255,255,255,.08); color: var(--muted); pointer-events: none; }
.gift-card.is-sold { opacity: .78; }

.skeleton-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.skeleton-card {
  aspect-ratio: 0.7; border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255,255,255,.025) 20%, rgba(255,255,255,.06) 40%, rgba(255,255,255,.025) 60%);
  background-size: 220% 100%; animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -120% 0; } }

/* empty */
.empty { text-align: center; padding: 46px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: rgba(255,255,255,.015); }
.empty.small { padding: 24px 14px; border: 0; background: transparent; }
.empty-ico { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(232,196,122,.06); color: var(--gold); font-size: 22px; }
.empty h3 { margin: 0 0 4px; font-size: 15px; }
.empty p { margin: 0 0 14px; color: var(--muted); font-size: 11px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 18px; border-radius: 11px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--text); font-size: 12px; font-weight: 650;
  transition: .18s; white-space: nowrap;
}
.btn:hover { border-color: var(--line-strong); background: rgba(255,255,255,.07); }
.btn:active { transform: scale(.985); }
.btn.primary { border: 0; background: linear-gradient(145deg, #f2d99d, #cfa458); color: #171206; font-weight: 800; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: rgba(255,255,255,.035); }
.btn.danger { border-color: rgba(255,122,122,.25); background: rgba(255,122,122,.08); color: var(--red); }
.btn.big { flex: 1; height: 48px; border-radius: 13px; font-size: 12px; }
.btn:disabled { opacity: .45; pointer-events: none; }
.link-btn { border: 0; background: transparent; color: var(--gold); font-size: 10px; font-weight: 700; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

/* balance */
.profile-panel { margin: 0 0 14px; }
.profile-identity { display: flex; align-items: center; gap: 12px; }
.profile-avatar { width: 48px; height: 48px; font-size: 18px; flex: 0 0 auto; }
.profile-identity-copy { min-width: 0; display: flex; flex-direction: column; }
.profile-identity-copy strong { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-identity-copy span { color: var(--muted); font-size: 11px; }
.profile-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 0; margin-top: 12px; border-top: 1px solid var(--line); }
.profile-meta small { display: block; color: var(--muted); font-size: 10px; }
.profile-meta strong { display: block; margin-top: 3px; font-size: 14px; }
.profile-language { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 13px; color: var(--muted); font-size: 11px; }
.profile-language .lang-select { max-width: none; width: 150px; }
.balance-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; margin-bottom: 14px; }
.balance-card {
  position: relative; overflow: hidden; padding: 14px;
  border: 1px solid var(--line); border-radius: 16px;
  background: linear-gradient(155deg, rgba(26,30,39,.9), rgba(14,16,21,.95));
}
.balance-card::after { content: ""; position: absolute; width: 90px; height: 90px; top: -40px; inset-inline-end: -30px; border-radius: 50%; background: radial-gradient(circle, rgba(232,196,122,.12), transparent 70%); }
.bc-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .13em; }
.bc-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; font-size: 11px; font-weight: 800; }
.bc-icon.gem { background: var(--gold-soft); color: var(--gold); }
.bc-icon.rub { background: rgba(122,168,255,.12); color: var(--blue); }
.bc-icon.usdt { background: rgba(86,215,164,.12); color: var(--green); }
.bc-icon.stars { background: rgba(255,196,90,.12); color: #ffc45a; }
.balance-card strong { display: block; margin-top: 9px; font-size: clamp(19px, 4vw, 26px); font-weight: 650; letter-spacing: -.02em; }
.balance-card small { color: var(--muted-2); font-size: 9px; }
.action-row { display: flex; gap: 7px; margin: 14px 0; }

.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(17,20,27,.72); padding: 16px; margin-top: 12px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.panel-head h3 { margin: 0; font-size: 13px; font-weight: 650; }
.details-list { display: grid; gap: 7px; }
.detail-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.detail-ico { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(232,196,122,.08); color: var(--gold); font-size: 13px; flex: 0 0 auto; }
.detail-row small { display: block; color: var(--muted-2); font-size: 8px; letter-spacing: .08em; text-transform: uppercase; }
.detail-row strong { display: block; margin-top: 1px; font-size: 11px; font-weight: 550; word-break: break-all; }
.info-panel { display: grid; gap: 8px; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; }
.info-row strong { color: var(--text); font-size: 11px; }
.info-row a { color: var(--gold); }

.history-list { display: grid; gap: 6px; }
.history-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.hi-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto; font-size: 11px; font-weight: 800; background: rgba(255,255,255,.05); color: var(--muted); }
.hi-icon.plus { background: var(--green-soft); color: var(--green); }
.hi-icon.minus { background: var(--red-soft); color: var(--red); }
.hi-main { min-width: 0; flex: 1; }
.hi-main strong { display: block; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-main small { display: block; color: var(--muted-2); font-size: 8px; margin-top: 1px; }
.hi-amount { text-align: end; flex: 0 0 auto; }
.hi-amount strong { display: block; font-size: 11px; font-weight: 700; }
.hi-amount small { display: block; font-size: 8px; color: var(--muted-2); margin-top: 2px; }
.hi-amount .plus { color: var(--green); }
.hi-amount .minus { color: var(--red); }

/* bottom nav */
.bottom-nav {
  position: fixed; z-index: 30; inset-inline: 0; bottom: 0;
  display: none; justify-content: space-around; align-items: center;
  padding: 7px 14px calc(7px + var(--safe-bottom));
  background: rgba(10, 12, 16, .9); border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.bn-item { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; color: var(--muted-2); font-size: 9px; min-width: 64px; padding: 4px; }
.bn-item .nav-icon { width: 21px; height: 21px; }
.bn-item.active { color: var(--gold); }

/* modal */
.modal-root { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.modal-root.open { pointer-events: auto; }
.modal-backdrop {
  position: absolute; inset: 0; background: rgba(4, 5, 7, .72);
  backdrop-filter: blur(8px); opacity: 0; transition: opacity .22s;
}
.modal-root.open .modal-backdrop { opacity: 1; }
.sheet {
  position: absolute; inset-inline: 0; bottom: 0; max-height: 92vh;
  display: flex; flex-direction: column;
  border-radius: 24px 24px 0 0; border: 1px solid var(--line-strong); border-bottom: 0;
  background: linear-gradient(165deg, #171a21, #0c0e12 70%);
  box-shadow: 0 -30px 80px rgba(0,0,0,.55);
  transform: translateY(102%); transition: transform .3s cubic-bezier(.2,.8,.2,1);
  overscroll-behavior: contain;
}
.modal-root.open .sheet { transform: none; }
.sheet::before { content: ""; width: 38px; height: 4px; border-radius: 99px; background: rgba(255,255,255,.16); margin: 10px auto 0; flex: 0 0 auto; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 18px 10px; }
.sheet-head h2 { margin: 0; font-size: 18px; letter-spacing: -.02em; font-weight: 650; }
.sheet-head p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.close-btn { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--muted); font-size: 17px; line-height: 1; }
.close-btn:hover { color: var(--text); }
.sheet-body { overflow-y: auto; padding: 4px 18px 18px; }
.sheet-actions { display: flex; gap: 8px; padding: 12px 18px calc(14px + var(--safe-bottom)); border-top: 1px solid var(--line); background: rgba(11,13,17,.85); }
.sheet-actions .btn { flex: 1; height: 46px; }

/* gift modal */
.gift-hero { display: grid; grid-template-columns: 132px 1fr; gap: 14px; align-items: center; }
.gift-hero-media { aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #14171d; }
.gift-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.gift-hero h3 { margin: 0 0 2px; font-size: 20px; letter-spacing: -.02em; }
.gift-hero .gift-hero-collection { margin: 0; color: var(--gold); font-size: 10px; font-weight: 600; }
.gift-price-line { display: flex; align-items: baseline; gap: 5px; margin-top: 12px; }
.gift-price-line strong { font-size: 27px; letter-spacing: -.03em; }
.gift-price-line span { color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .1em; }
.traits-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 18px; }
.trait-block { padding: 10px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.trait-block small { display: block; color: var(--muted-2); font-size: 7px; letter-spacing: .12em; text-transform: uppercase; }
.trait-block strong { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; word-break: break-word; }
.modal-note { margin: 14px 0 0; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.owned-banner { display: flex; gap: 9px; align-items: center; margin-top: 14px; padding: 10px; border-radius: 11px; border: 1px solid rgba(86,215,164,.22); background: var(--green-soft); color: var(--green); font-size: 10px; }

/* forms */
.field { margin-top: 13px; }
.field label { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.field input, .field select, .field textarea {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 11px;
  border: 1px solid var(--line); background: rgba(255,255,255,.035);
  color: var(--text); outline: none; font-size: 13px; transition: .18s;
}
.field textarea { height: 82px; padding: 11px 13px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: rgba(232,196,122,.45); background: rgba(232,196,122,.035); }
.field .hint { margin: 5px 0 0; color: var(--muted-2); font-size: 9px; }
.input-suffix { position: relative; }
.input-suffix input { padding-inline-end: 58px; }
.input-suffix span { position: absolute; inset-inline-end: 13px; top: 50%; transform: translateY(-50%); color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .08em; }

.currency-options { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 7px; margin-top: 6px; }
.cur-option {
  display: flex; align-items: center; gap: 8px; padding: 11px;
  border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.025); color: var(--text); text-align: start; transition: .18s;
}
.cur-option:hover { border-color: var(--line-strong); }
.cur-option.active { border-color: rgba(232,196,122,.5); background: rgba(232,196,122,.08); }
.cur-option.disabled { opacity: .45; }
.cur-option .co-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.05); color: var(--gold); font-size: 13px; font-weight: 800; }
.cur-option .co-copy { min-width: 0; }
.cur-option strong { display: block; font-size: 11px; }
.cur-option small { display: block; color: var(--muted-2); font-size: 8px; margin-top: 1px; }

.invoice { margin-top: 13px; padding: 13px; border-radius: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.invoice-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 10px; }
.invoice-row:last-child { border-bottom: 0; }
.invoice-row > span { color: var(--muted); flex: 0 0 auto; }
.invoice-row strong, .invoice-row code { text-align: end; font-size: 10px; font-weight: 600; word-break: break-all; }
.invoice-row code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--gold); }
.copy-btn { border: 0; background: transparent; color: var(--gold); font-size: 9px; font-weight: 700; padding: 0 0 0 6px; }
.invoice-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.hint-box { margin-top: 12px; padding: 10px 12px; border-radius: 11px; border: 1px solid rgba(232,196,122,.18); background: rgba(232,196,122,.05); color: var(--muted); font-size: 9px; line-height: 1.5; }
.hint-box.warn { border-color: rgba(255,196,90,.22); background: rgba(255,196,90,.05); }
.hint-box.danger { border-color: rgba(255,122,122,.22); background: rgba(255,122,122,.05); color: var(--red); }
.support-card { text-align: center; padding: 18px 10px 6px; }
.support-card .empty-ico { margin-bottom: 10px; }
.support-card h3 { margin: 0 0 5px; font-size: 15px; }
.support-card p { margin: 0 0 14px; color: var(--muted); font-size: 10px; line-height: 1.55; }

.withdraw-summary { display: grid; gap: 6px; margin-top: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.025); }
.ws-row { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; color: var(--muted); }
.ws-row strong { color: var(--text); font-weight: 600; text-align: end; word-break: break-all; }

/* toast */
.toast {
  position: fixed; z-index: 120; left: 50%; bottom: calc(92px + var(--safe-bottom));
  transform: translate(-50%, 16px); max-width: min(420px, calc(100vw - 28px));
  padding: 11px 16px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(20, 23, 30, .96); color: var(--text); font-size: 11px;
  box-shadow: 0 16px 40px rgba(0,0,0,.45); opacity: 0; pointer-events: none;
  transition: .24s; text-align: center; backdrop-filter: blur(12px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { border-color: rgba(86,215,164,.3); }
.toast.error { border-color: rgba(255,122,122,.3); }

/* boot */
.boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center;
  background: #07080b; transition: opacity .3s, visibility .3s;
}
.boot.hide { opacity: 0; visibility: hidden; }
.boot-logo {
  display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px;
  color: #141006; font-weight: 900; font-size: 30px;
  background: linear-gradient(145deg, #f8dfa4, #c69545 62%, #8f6425);
  box-shadow: 0 18px 50px rgba(232,196,122,.18);
}
.boot-bar { width: 118px; height: 3px; margin-top: 20px; border-radius: 99px; overflow: hidden; background: rgba(255,255,255,.08); }
.boot-bar span { display: block; width: 40%; height: 100%; border-radius: 99px; background: linear-gradient(90deg, transparent, var(--gold), transparent); animation: bootSlide 1.1s infinite; }
@keyframes bootSlide { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.boot p { margin: 10px 0 0; color: var(--muted-2); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }

/* responsive */
@media (min-width: 560px) {
  .grid, .skeleton-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .balance-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .sheet { inset-inline: 0; margin-inline: auto; width: min(520px, 100%); border-radius: 24px 24px 0 0; }
}
@media (min-width: 900px) {
  .grid, .skeleton-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { padding: 38px; }
  .toolbar { grid-template-columns: minmax(280px, 420px) auto; justify-content: start; }
  .tabs { width: fit-content; }
  .tab { padding: 0 26px; }
  .bottom-nav { display: none; }
  .app { padding-bottom: 40px; }
}
@media (max-width: 899px) {
  .bottom-nav { display: flex; }
  .tabs { display: none; }
  .app { padding-bottom: calc(96px + var(--safe-bottom)); }
}
@media (max-width: 380px) {
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stats .stat:first-child { grid-column: span 2; }
  .balance-card strong { font-size: 18px; }
  .gift-body { padding: 9px 10px 10px; }
  .gift-name { font-size: 12px; }
  .price strong { font-size: 14px; }
  .buy-btn { padding: 0 10px; }
  .btn.big { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
