:root {
  --bg:      #120513;
  --surface: #10101c;
  --border:  rgba(255,255,255,0.08);
  --accent:  #c45cfc;
  --accent2: #fc5cf8;
  --text:    #eeeef8;
  --muted:   rgba(238,238,248,0.4);
  --card-bg: rgba(255,255,255,0.05);
  --glow:    rgba(196,92,252,0.3);
  --nav-h:   76px;
  --lg-blur:        32px;
  --lg-saturation:  2.8;
  --lg-brightness:  1.18;
  --lg-border-light: rgba(255,255,255,0.45);
  --lg-border-dark:  rgba(255,255,255,0.07);
  --lg-surface:      rgba(255,255,255,0.09);
  --lg-surface-2:    rgba(255,255,255,0.13);
  --lg-highlight:    rgba(255,255,255,0.28);
  --lg-shadow-inset: rgba(0,0,0,0.18);
  --lg-radius-sm:    14px;
  --lg-radius-md:    20px;
  --lg-radius-lg:    28px;
  --section-bg: rgba(255,255,255,0.05);
  --pill-bg: rgba(255,255,255,0.08);
  --pill-bg-strong: rgba(255,255,255,0.12);
  --accent-strong: #fc5cf8;
  --accent-contrast: #ffffff;
  --header-bg: rgba(16,16,28,0.72);
  --bottom-bar-bg: rgba(16,16,28,0.76);
  --subtitle: rgba(238,238,248,0.6);
  --link: #8db9ff;
  --destructive: #f87171;
  --lgl-bg: rgba(255,255,255,0.08);
  --lgl-border: rgba(255,255,255,0.28);
  --lgl-highlight: rgba(255,255,255,0.55);
  --lgl-shadow: rgba(0,0,0,0.35);
  --lgl-blur: 28px;
  --lgl-saturation: 3;
  --safe-top: 0px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-height: 100dvh;
}
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }

.liquid-glass,
.section,
.navbar__glass,
.topbar__left,
.ton-badge,
.logo-pill,
.nft-card,
.inv-cell--filled,
.friends-stat-card,
.friends-link-box__value,
.friends-card,
.market-search-input,
.market-sort-btn,
.market-chip,
.leaderboard-item,
.sheet-panel,
.lucky-sheet,
.inv-modal-sheet,
.promo-input {
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.08) 40%,
    rgba(255,255,255,0.04) 70%,
    rgba(0,0,0,0.04) 100%
  );
  backdrop-filter: blur(var(--lgl-blur)) saturate(var(--lgl-saturation)) brightness(var(--lg-brightness));
  -webkit-backdrop-filter: blur(var(--lgl-blur)) saturate(var(--lgl-saturation)) brightness(var(--lg-brightness));
  border: 1px solid rgba(255,255,255,0.28);
  border-bottom-color: rgba(255,255,255,0.08);
  border-right-color: rgba(255,255,255,0.12);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    inset 1px 0 0 rgba(255,255,255,0.18),
    0 8px 32px rgba(0,0,0,0.28),
    0 2px 8px rgba(0,0,0,0.14);
}

.section::before,
.nft-card::before,
.inv-cell--filled::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44%;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.06) 60%,
    transparent 100%
  );
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.section::after {
  content: '';
  position: absolute;
  bottom: 0; left: 5%; right: 5%;
  height: 28%;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(196,92,252,0.14) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.noise {
  pointer-events: none;
  position: fixed; inset: 0; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 160px;
  opacity: .45;
}
.loader {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  background: var(--bg);
  z-index: 200;
  transition: opacity .4s ease;
}
.loader__ring {
  width: 40px; height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.loader__label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .12em;
  text-transform: uppercase;
}
@keyframes spin { to { transform: rotate(360deg); } }
.error-screen {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px; padding: 32px;
  text-align: center;
}
.error-icon { font-size: 44px; }
.error-icon i { color: var(--accent); }
.error-screen p { color: var(--muted); font-size: 14px; line-height: 1.6; }
.error-screen button {
  margin-top: 8px; padding: 10px 28px;
  border: 1px solid var(--accent); border-radius: 999px;
  background: transparent; color: var(--accent);
  font-family: 'Syne', sans-serif; font-size: 13px;
  cursor: pointer; transition: background .2s, color .2s;
}
.error-screen button:hover { background: var(--accent); color: #fff; }
.app {
  position: fixed; inset: 0;
  height: var(--app-height);
  display: flex; flex-direction: column;
  background:
    radial-gradient(ellipse 90% 50% at 15% 0%,  rgba(196,92,252,0.22) 0%, transparent 65%),
    radial-gradient(ellipse 70% 40% at 85% 100%, rgba(252,92,248,0.14) 0%, transparent 60%),
    var(--bg);
}

.topbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding-top: calc(var(--safe-top, 0px) + 30px);
  padding-bottom: 10px;
  padding-left: 16px;
  padding-right: 16px;
  z-index: 100;
  background: linear-gradient(180deg, color-mix(in srgb, var(--header-bg) 82%, transparent 18%) 0%, transparent 100%);
}
.topbar__left {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
}
.ton-badge {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ton-badge:active { transform: scale(.97); }

.ping-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: blink 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.4} }
.topbar__ping {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
  white-space: nowrap;
}

.logo-pill {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  padding: 7px 20px;
  border-radius: 999px;
  background: linear-gradient(
    135deg,
    rgba(196,92,252,0.32) 0%,
    rgba(255,255,255,0.16) 40%,
    rgba(196,92,252,0.12) 100%
  );
  backdrop-filter: blur(28px) saturate(3) brightness(1.22);
  -webkit-backdrop-filter: blur(28px) saturate(3) brightness(1.22);
  border: 1px solid rgba(196,92,252,0.60);
  border-bottom-color: rgba(196,92,252,0.22);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.50),
    inset 0 -1px 0 rgba(0,0,0,0.14),
    0 0 28px rgba(196,92,252,0.28),
    0 4px 16px rgba(0,0,0,0.22);
}
.topbar__logo {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .28em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fc5cf8 45%, #c45cfc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}
.ton-icon {
  width: 15px; height: 15px;
  color: #4DB8FF;
  flex-shrink: 0; display: block;
}
#ton-amount {
  font-weight: 700; color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}
.ton-label {
  color: rgba(238,238,248,0.5);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.pages { flex: 1; position: relative; overflow: hidden; min-height: 0; }
.page {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  pointer-events: none;
  transition:
    opacity .32s cubic-bezier(.4,0,.2,1),
    transform .32s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}
.page.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.page.exiting { opacity: 0; transform: translateY(-10px) scale(1.015); pointer-events: none; }

.page-scroll-inner {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  padding: 0 20px;
}
.page-scroll-inner::-webkit-scrollbar { display: none; }
.bottom-spacer { height: calc(var(--nav-h) + var(--safe-bottom, 0px) + 20px); }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.avatar-section {
  display: flex; flex-direction: column;
  align-items: center;
  padding: 28px 0 24px; gap: 10px;
  animation: riseIn .6s cubic-bezier(.22,1,.36,1) both;
}
.profile-head-row {
  display: grid;
  grid-template-columns: 48px auto 48px;
  align-items: center;
  gap: 14px;
}
.leaderboard-trigger {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, color .18s ease;
  background: linear-gradient(145deg, rgba(255,255,255,0.18) 0%, rgba(196,92,252,0.14) 100%);
  backdrop-filter: blur(20px) saturate(2.5);
  -webkit-backdrop-filter: blur(20px) saturate(2.5);
  border: 1px solid rgba(255,255,255,0.32);
  border-bottom-color: rgba(255,255,255,0.10);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.42),
    inset 0 -1px 0 rgba(0,0,0,0.14),
    0 8px 20px rgba(0,0,0,0.20);
}
.leaderboard-trigger i { font-size: 18px; }
.leaderboard-trigger:active { transform: scale(.94); }
.leaderboard-trigger:hover { border-color: rgba(196,92,252,0.50); color: #fff; }

.avatar-wrap { position: relative; width: 110px; height: 110px; }
.avatar-ring {
  position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(var(--accent), var(--accent2), var(--accent));
  animation: rotateBorder 5s linear infinite, ringPulse 10s ease-in-out infinite;
  z-index: 0;
}
@keyframes rotateBorder { to { transform: rotate(360deg); } }
@keyframes ringPulse {
  0%   { transform: rotate(0deg)   scale(1)    scaleX(1); }
  25%  { transform: rotate(90deg)  scale(1.06) scaleX(0.91); }
  50%  { transform: rotate(180deg) scale(0.94) scaleX(1.1); }
  75%  { transform: rotate(270deg) scale(1.05) scale(0.93); }
  100% { transform: rotate(360deg) scale(1)    scaleX(1); }
}
.avatar {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--bg);
  background: #1a1a2e;
}
.avatar-glow {
  position: absolute; inset: -10px; border-radius: 50%;
  background: var(--glow); filter: blur(20px); z-index: -1;
  animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100% { transform: scale(1);    filter: blur(18px); opacity: .5; }
  50%     { transform: scale(0.92); filter: blur(16px); opacity: .6; }
}
.profile-name { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; text-align: center; }
.profile-username { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--link); }

.section {
  margin-bottom: 16px;
  animation: riseIn .6s .15s cubic-bezier(.22,1,.36,1) both;
  border-radius: var(--lg-radius-md);
  padding: 14px;
  position: relative;
}

.section__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; position: relative; z-index: 1;
}
.section__title { font-size: 15px; font-weight: 700; letter-spacing: .02em; }
.section__add {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(196,92,252,0.15);
  border: 1px solid rgba(196,92,252,0.3);
  color: var(--accent);
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .2s, transform .15s;
}
.section__add:active { transform: scale(.9); }

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  position: relative; z-index: 1;
}
.inv-cell {
  aspect-ratio: 1 / 1;
  border-radius: var(--lg-radius-sm);
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.10);
  backdrop-filter: blur(16px) saturate(2);
  -webkit-backdrop-filter: blur(16px) saturate(2);
  position: relative;
}
.inv-cell--filled {
  position: relative; overflow: hidden; cursor: pointer;
  aspect-ratio: 1 / 1; border-radius: var(--lg-radius-sm);
  display: flex; flex-direction: column; align-items: stretch;
  transition: transform .15s, box-shadow .2s;
}
.inv-cell--filled:active { transform: scale(.96); }
.inv-cell--filled::after {
  content: '';
  position: absolute; bottom: 0; left: 10%; right: 10%; height: 30%;
  border-radius: 0 0 18px 18px;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(196,92,252,0.22) 0%, transparent 70%);
  pointer-events: none; z-index: 5;
}
.inv-cell-model {
  font-family: 'JetBrains Mono', monospace;
  font-size: 8px; color: var(--accent);
  letter-spacing: .08em; opacity: .75; margin-bottom: 1px; line-height: 1;
}
.inv-cell-name {
  font-size: 10px; font-weight: 800; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  letter-spacing: -.01em; line-height: 1.1;
}
.inv-cell-header {
  padding: 6px 6px 2px; flex-shrink: 0;
  text-align: center; z-index: 2;
}
.inv-cell-img {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 4px 8px; min-height: 0; overflow: hidden; margin-top: -10px;
}
.inv-cell-img img {
  max-width: 80%; max-height: 80%;
  width: auto; height: auto; object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  border-radius: 8px;
  display: block;
  transition: opacity .15s ease;
}
.inv-cell-placeholder { opacity: 0.12; }

.inv-lottie-layer {
  position: absolute;
  inset: 0;
  border-radius: var(--lg-radius-sm);
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
  overflow: hidden;
}
.inv-cell--filled:hover .inv-lottie-layer { opacity: 1; }
.inv-cell--filled:hover .inv-cell-img img { opacity: 0; }

.promo-row { display: flex; gap: 8px; align-items: center; position: relative; z-index: 1; width: 100%; }
.promo-input {
  flex: 1; height: 40px;
  border-radius: 12px; padding: 0 14px;
  color: var(--text); font-family: 'JetBrains Mono', monospace; font-size: 13px;
  outline: none; transition: border-color .2s, background .2s;
}
.promo-input::placeholder { color: var(--muted); }
.promo-input:focus {
  border-color: rgba(196,92,252,0.65);
  background: rgba(196,92,252,0.08);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.14),
    0 0 0 2px rgba(196,92,252,0.18);
}
.promo-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; min-width: 40px; width: 40px; padding: 0;
  background: linear-gradient(135deg, rgba(196,92,252,0.32) 0%, rgba(252,92,248,0.22) 100%);
  backdrop-filter: blur(20px) saturate(2.5); -webkit-backdrop-filter: blur(20px) saturate(2.5);
  border: 1px solid rgba(196,92,252,0.50);
  border-bottom-color: rgba(196,92,252,0.18);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 4px 16px rgba(196,92,252,0.22);
  border-radius: 12px; color: var(--accent);
  font-family: 'Syne', sans-serif; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .15s;
}
.promo-btn:active { transform: scale(.97); background: rgba(196,92,252,0.42); }
.promo-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px; padding: 40px; text-align: center;
}
.empty-state__icon { font-size: 48px; opacity: .6; }
.empty-state__title { font-size: 22px; font-weight: 700; }
.empty-state__sub { font-size: 13px; color: var(--muted); line-height: 1.5; }

.friends-hero { margin-top: 12px; }
.friends-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(196,92,252,0.25) 0%, rgba(252,92,248,0.14) 100%);
  backdrop-filter: blur(20px) saturate(2.5);
  -webkit-backdrop-filter: blur(20px) saturate(2.5);
  border: 1px solid rgba(196,92,252,0.40);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.28), 0 0 16px rgba(196,92,252,0.18);
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: .08em;
}
.friends-hero__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  position: relative;
  z-index: 1;
}
.friends-stat-card {
  padding: 14px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.friends-stat-card__label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  position: relative; z-index: 1;
}
.friends-stat-card__value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  position: relative; z-index: 1;
}
.friends-hero__sub,
.friends-note {
  position: relative;
  z-index: 1;
  color: var(--subtitle);
  font-size: 13px;
  line-height: 1.5;
}
.friends-code-row {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.friends-code-input { text-transform: uppercase; }
.friends-link-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.friends-link-box__value {
  padding: 14px;
  border-radius: 14px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.friends-copy-btn,
.friends-code-row .promo-btn { justify-content: center; }
.friends-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.friends-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.friends-card__avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
}
.friends-card__name { font-size: 15px; font-weight: 800; color: var(--text); }
.friends-card__meta,
.friends-card__joined { margin-top: 2px; font-size: 12px; color: var(--subtitle); }
.friends-card__income { text-align: right; }
.friends-card__income-label {
  display: block; margin-bottom: 4px;
  color: var(--muted); font-size: 11px;
  text-transform: uppercase; letter-spacing: .08em;
}
.friends-card__income-value {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.friends-card__income-value i { color: #4DB8FF; }

.market-inner {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none; padding: 12px 16px 0;
  -webkit-overflow-scrolling: touch;
}
.market-inner::-webkit-scrollbar { display: none; }

@keyframes mktSlideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.market-search-bar {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 12px;
  animation: mktSlideDown .4s cubic-bezier(.22,1,.36,1) both;
}
.market-search-wrap { flex: 1; position: relative; }
.market-search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%); color: var(--muted); pointer-events: none;
}
.market-search-input {
  width: 100%; height: 42px;
  border-radius: 14px;
  padding: 0 14px 0 36px; color: var(--text);
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  outline: none; transition: border-color .2s, background .2s;
}
.market-search-input::placeholder { color: var(--muted); }
.market-search-input:focus {
  border-color: rgba(196,92,252,0.60);
  background: linear-gradient(135deg, rgba(196,92,252,0.10) 0%, rgba(255,255,255,0.06) 100%);
}
.market-sort-btn {
  display: flex; align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border-radius: 14px; color: var(--muted); cursor: pointer; flex-shrink: 0;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
}
.market-sort-btn.active-asc,
.market-sort-btn.active-desc {
  border-color: rgba(196,92,252,0.60); color: var(--accent);
  background: linear-gradient(135deg, rgba(196,92,252,0.22) 0%, rgba(196,92,252,0.08) 100%);
}
.market-sort-btn:active { transform: scale(.93); }
.market-chips {
  display: flex; gap: 6px; margin-bottom: 14px;
  overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  animation: mktSlideDown .4s .06s cubic-bezier(.22,1,.36,1) both;
}
.market-chips::-webkit-scrollbar { display: none; }
.market-chip {
  padding: 6px 14px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em;
  font-family: 'Syne', sans-serif;
  color: var(--muted); cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s, transform .15s;
}
.market-chip.active {
  background: linear-gradient(135deg, rgba(196,92,252,0.32) 0%, rgba(252,92,248,0.18) 100%);
  border-color: rgba(196,92,252,0.55);
  color: var(--accent);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.28), 0 0 18px rgba(196,92,252,0.22), 0 2px 8px rgba(0,0,0,0.12);
}
.market-chip:active { transform: scale(.95); }
.market-section-label {
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; padding-left: 2px;
  animation: mktSlideDown .4s .1s cubic-bezier(.22,1,.36,1) both;
}
.market-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; padding-bottom: 8px;
}

@keyframes nftCardPop {
  from { opacity: 0; transform: translateY(22px) scale(.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}
.nft-card {
  border-radius: var(--lg-radius-md); overflow: hidden; cursor: pointer;
  transition: border-color .25s, transform .2s, box-shadow .25s;
  animation: nftCardPop var(--anim-delay, .1s) cubic-bezier(.22,1,.36,1) both;
  position: relative;
}
.nft-card:active { transform: scale(.97); }
.nft-img {
  width: 100%; aspect-ratio: 1;
  background: rgba(255,255,255,0.03);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.nft-img-inner {
  width: 68%; height: 68%;
  border-radius: 14px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}
.nft-img-inner img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 14px;
  transition: opacity .15s ease;
}
.nft-lottie-layer {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
  overflow: hidden;
}
.nft-card:hover .nft-lottie-layer { opacity: 1; }
.nft-card:hover .nft-img-inner img { opacity: 0; }
.nft-placeholder-icon { opacity: .18; }
.nft-info { padding: 10px 12px 12px; position: relative; z-index: 1; }
.nft-model {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--accent); letter-spacing: .08em; margin-bottom: 3px; opacity: .75;
}
.nft-name {
  font-size: 14px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 8px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.nft-price {
  display: flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: rgba(238,238,248,0.55); margin-bottom: 10px;
}
.nft-price-icon { width: 12px; height: 12px; color: #4DB8FF; flex-shrink: 0; }
.nft-price-val { color: #fff; font-size: 13px; font-weight: 500; }
.nft-actions { display: flex; gap: 6px; }
.btn-lucky {
  flex: 1; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(252,92,248,0.20) 0%, rgba(252,92,248,0.08) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(252,92,248,0.38);
  border-bottom-color: rgba(252,92,248,0.12);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.22), 0 2px 8px rgba(252,92,248,0.12);
  color: #fc8dfa;
  font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .2s, transform .15s;
}
.btn-lucky:active { transform: scale(.95); background: rgba(252,92,248,0.30); }
.btn-buy {
  flex: 1; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(196,92,252,0.36) 0%, rgba(252,92,248,0.24) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(196,92,252,0.55);
  border-bottom-color: rgba(196,92,252,0.18);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 4px 16px rgba(196,92,252,0.22);
  color: #fff;
  font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: background .2s, transform .15s;
}
.btn-buy:active { transform: scale(.95); }

.navbar {
  position: relative; min-height: calc(var(--nav-h) + var(--safe-bottom, 0px)); flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 12px max(10px, var(--safe-bottom, 0px));
  z-index: 100; isolation: isolate;
}
.navbar__glass {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.14) 0%,
    rgba(255,255,255,0.07) 30%,
    rgba(10,6,22,0.30) 100%
  );
  backdrop-filter: blur(40px) saturate(3) brightness(1.12);
  -webkit-backdrop-filter: blur(40px) saturate(3) brightness(1.12);
  border-top: 1px solid rgba(255,255,255,0.28);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.32),
    inset 0 -1px 0 rgba(0,0,0,0.08),
    0 -8px 40px rgba(0,0,0,0.30);
  z-index: -1;
}
.navbar::before {
  content: '';
  position: absolute; top: 0; left: var(--glow-x, 50%);
  width: 80px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,92,252,0.95), transparent);
  transform: translateX(-50%);
  border-radius: 999px;
  transition: left .3s cubic-bezier(.4,0,.2,1);
  z-index: 1;
}
.nav-btn {
  position: relative; z-index: 2; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 10px 4px 6px;
  background: transparent; border: none; cursor: pointer;
  color: var(--muted); transition: color .2s;
}
.nav-btn__icon {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 36px; border-radius: 12px;
  transition: background .2s, transform .15s;
}
.nav-btn__label { font-family: 'Syne', sans-serif; font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.nav-btn:active .nav-btn__icon { transform: scale(.9); }
.nav-btn.active { color: var(--text); }
.nav-btn.active .nav-btn__icon {
  background: linear-gradient(135deg, rgba(196,92,252,0.32) 0%, rgba(252,92,248,0.18) 100%);
  backdrop-filter: blur(20px) saturate(2.5); -webkit-backdrop-filter: blur(20px) saturate(2.5);
  border: 1px solid rgba(196,92,252,0.45);
  border-bottom-color: rgba(196,92,252,0.15);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.30),
    0 0 22px rgba(196,92,252,0.32),
    0 2px 8px rgba(0,0,0,0.18);
}
.nav-btn.active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px rgba(196,92,252,.65));
}
@keyframes luckyOverlayIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes luckyOverlayOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes luckySheetIn    { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes luckySheetOut   { from { transform: translateY(0); } to { transform: translateY(100%); } }

.lucky-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 3, 18, 0.72);
  z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(12px) saturate(2);
  -webkit-backdrop-filter: blur(12px) saturate(2);
  animation: luckyOverlayIn .3s ease both;
}
.lucky-overlay.hidden { display: none !important; }
.lucky-overlay.closing { animation: luckyOverlayOut .25s ease forwards; }

.lucky-sheet {
  width: 100%; max-width: 480px;
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255,255,255,0.30);
  border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom, 24px);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.42),
    0 -15px 60px rgba(0,0,0,0.65);
  position: relative; overflow: hidden;
  transform: none;
  animation: luckySheetIn .42s cubic-bezier(.22,1,.36,1) both;
  background: linear-gradient(
    170deg,
    rgba(255,255,255,0.18) 0%,
    rgba(196,92,252,0.14) 22%,
    rgba(255,255,255,0.07) 55%,
    rgba(18,5,25,0.96) 100%
  );
  backdrop-filter: blur(52px) saturate(3) brightness(1.18);
  -webkit-backdrop-filter: blur(52px) saturate(3) brightness(1.18);
}
.lucky-sheet.closing { animation: luckySheetOut .32s cubic-bezier(.4,0,1,1) both; }
.lucky-sheet::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 38%;
  background: linear-gradient(180deg, rgba(255,255,255,0.20) 0%, transparent 100%);
  border-radius: 28px 28px 0 0; pointer-events: none; z-index: 0;
}
.lucky-sheet::after {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-size: 160px; pointer-events: none; z-index: 0;
}
.lucky-glow-top {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 160px;
  background: radial-gradient(ellipse, rgba(196,92,252,0.40) 0%, transparent 70%);
  pointer-events: none; z-index: 1;
}
.lucky-handle {
  width: 40px; height: 5px;
  background: rgba(255,255,255,0.32);
  border-radius: 999px;
  margin: 14px auto 18px;
  position: relative; z-index: 1;
}
.lucky-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.08) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.32);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.30), 0 2px 8px rgba(0,0,0,0.20);
  color: rgba(238,238,248,0.60);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10;
  transition: background .2s, color .2s;
}
.lucky-close:hover { background: rgba(255,255,255,0.26); color: #fff; }
.lucky-cards-row {
  position: relative;
  margin: 0 0 16px;
  overflow: hidden;
  z-index: 1;
}

.lucky-reel-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  height: 176px;
  background: rgba(0,0,0,0.40);
  box-shadow:
    inset 0 8px 28px rgba(0,0,0,0.55),
    inset 0 -4px 12px rgba(0,0,0,0.35),
    0 1px 0 rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.12);
  mask-image: linear-gradient(90deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
}

.lucky-reel-viewport--static {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lucky-reel-track {
  display: flex;
  gap: 8px;
  padding: 12px 8px;
  width: max-content;
  position: absolute;
  top: 0; left: 0;
  will-change: transform;
  transform: translate3d(0,0,0);
  transition: transform 7s cubic-bezier(0.15, 0, 0.15, 1);
}

.lucky-reel-track--static {
  position: relative;
  top: auto; left: auto;
  padding: 12px 16px;
}
.lucky-reel-card {
  flex-shrink: 0;
  width: 124px;
  height: 152px;
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  overflow: hidden;
  position: relative;
  cursor: default;
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.09) 0%,
    rgba(255,255,255,0.04) 45%,
    rgba(20,8,35,0.65) 100%
  );
  backdrop-filter: blur(18px) saturate(1.4) brightness(0.85);
  -webkit-backdrop-filter: blur(18px) saturate(1.4) brightness(0.85);
  border: 1px solid rgba(255,255,255,0.13);
  border-bottom-color: rgba(255,255,255,0.07);
  border-right-color: rgba(255,255,255,0.09);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.22);
  contain: layout paint;
  transform: translateZ(0);
  transition: border-color .3s, box-shadow .3s, filter .3s, opacity .3s, transform .3s;
}

.lucky-reel-card::before,
.lucky-reel-card::after {
  display: none !important;
}

.lucky-reel-card--winner {
  background: linear-gradient(145deg,
    rgba(196,92,252,0.25) 0%,
    rgba(255,255,255,0.12) 35%,
    rgba(196,92,252,0.10) 70%,
    rgba(0,0,0,0.04) 100%
  );
  border: 1.5px solid rgba(196,92,252,0.70);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.32),
    inset 0 -1px 0 rgba(0,0,0,0.12);
}

.lucky-reel-card--rx {
  align-items: center;
  justify-content: center;
}

.lucky-reel-card--rx-side {
  opacity: 0.55;
  filter: saturate(0.6) brightness(0.82);
  transform: scale(0.88);
}

.lucky-reel-card--center-lost::after {
  display: none !important;
}

.lucky-reel-card.is-win {
  z-index: 12;
  transform: scale(1.08) translateZ(0);
  border-color: rgba(255,255,255,0.13);
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.09) 0%,
    rgba(255,255,255,0.04) 45%,
    rgba(20,8,35,0.65) 100%
  );
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.22);
  animation: none;
}
.lucky-reel-card.is-win::after {
  display: none !important;
}
.lucky-reel-card.is-lose {
  border-color: rgba(255,255,255,0.13);
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.09) 0%,
    rgba(255,255,255,0.04) 45%,
    rgba(20,8,35,0.65) 100%
  );
  filter: none;
  opacity: 1;
}
@keyframes luckyWinPulse {
  0%,100% { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.30), inset 0 0 18px rgba(252,92,248,.18), 0 0 28px rgba(196,92,252,.48), 0 0 0 1.5px rgba(196,92,252,.34), 0 4px 16px rgba(0,0,0,.30); }
  50% { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.38), inset 0 0 24px rgba(252,92,248,.28), 0 0 54px rgba(196,92,252,.82), 0 0 22px rgba(77,184,255,.22), 0 0 0 2px rgba(196,92,252,.54), 0 6px 20px rgba(0,0,0,.34); }
}
@keyframes luckyWinShimmer {
  to { transform: translateX(130%); }
}

.lucky-reel-img {
  width: 100%; flex: 1; min-height: 0;
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.04); padding: 10px;
}
.lucky-reel-img img {
  width: 80%; height: 80%;
  object-fit: cover; border-radius: 10px; display: block;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}
.lucky-reel-img svg { opacity: .2; }
.lucky-reel-info { padding: 5px 8px 8px; flex-shrink: 0; position: relative; z-index: 2; }
.lucky-reel-model {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: .08em;
  color: rgba(196,92,252,.80); line-height: 1; margin-bottom: 2px;
}
.lucky-reel-name {
  font-size: 11px; font-weight: 800; color: #fff; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px;
}
.lucky-reel-price {
  display: flex; align-items: center; gap: 3px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; color: #fff;
}
.lucky-reel-price svg { width: 10px; height: 10px; color: #4DB8FF; flex-shrink: 0; }

.lucky-rx-wrap {
  position: relative; width: 64px; height: 64px;
  display: flex; align-items: center; justify-content: center;
}
.lucky-rx-glow {
  position: absolute; inset: -14px; border-radius: 50%;
  background: radial-gradient(circle, rgba(196,92,252,.45) 0%, transparent 70%);
  animation: rxGlowPulse 2.4s ease-in-out infinite;
}
@keyframes rxGlowPulse {
  0%,100% { transform: scale(1);    opacity: .5; }
  50%     { transform: scale(1.15); opacity: .7; }
}
.lucky-rx-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: rgba(196,92,252,.90);
  border-right-color: rgba(196,92,252,.30);
  animation: rxSpin 2s linear infinite;
}
@keyframes rxSpin { to { transform: rotate(360deg); } }
.lucky-rx-circle {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(18,5,19,.9);
  border: 2px solid rgba(196,92,252,.60);
  display: grid; place-items: center;
  position: relative; z-index: 2;
}
.lucky-rx-label {
  font-family: 'JetBrains Mono', monospace;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; text-align: center;
  font-size: 13px; font-weight: 700; letter-spacing: .06em; padding-left: .06em;
  color: rgba(196,92,252,.95); text-shadow: 0 0 10px rgba(196,92,252,.70);
}

.lucky-roulette-pointer {
  position: absolute; top: 0; bottom: 0; left: 50%;
  transform: translateX(-50%); width: 140px;
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, transparent 40%, transparent 60%, rgba(196,92,252,0.05) 100%);
  border: 2px solid rgba(196,92,252,.88);
  border-radius: 16px; pointer-events: none; z-index: 10;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 0 20px rgba(196,92,252,.35);
}
.lucky-roulette-pointer::before,
.lucky-roulette-pointer::after {
  content: ''; position: absolute; left: 50%; transform: translateX(-50%); width: 0; height: 0;
}
.lucky-roulette-pointer::before {
  top: -10px;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-top: 10px solid rgba(196,92,252,.92);
  filter: drop-shadow(0 0 4px rgba(196,92,252,.7));
}
.lucky-roulette-pointer::after {
  bottom: -10px;
  border-left: 8px solid transparent; border-right: 8px solid transparent;
  border-bottom: 10px solid rgba(196,92,252,.92);
  filter: drop-shadow(0 0 4px rgba(196,92,252,.7));
}
.lucky-roulette-fade-l,
.lucky-roulette-fade-r {
  position: absolute; top: 0; bottom: 0; width: 60px;
  pointer-events: none; z-index: 5;
}
.lucky-roulette-fade-l { left: 0; background: linear-gradient(90deg, rgba(14,5,20,.90) 0%, transparent 100%); }
.lucky-roulette-fade-r { right: 0; background: linear-gradient(-90deg, rgba(14,5,20,.90) 0%, transparent 100%); }

.lucky-price-heading {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 22px; font-weight: 800; color: #fff; letter-spacing: -.02em;
  margin: 0 20px 6px; position: relative; z-index: 1;
}
.lucky-ton-inline {
  width: 22px; height: 22px; color: #4DB8FF;
  display: inline-flex; align-items: center; flex-shrink: 0;
}
.lucky-ton-inline svg { width: 100%; height: 100%; }
.lucky-balance {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: rgba(238,238,248,.35); margin-bottom: 18px;
  position: relative; z-index: 1;
}
.lucky-ton-sm { width: 14px; height: 14px; color: rgba(238,238,248,.35); display: inline-flex; align-items: center; }
.lucky-ton-sm svg { width: 100%; height: 100%; }
.lucky-divider { height: 1px; background: rgba(255,255,255,.10); margin: 0 20px 18px; position: relative; z-index: 1; }
.lucky-row { position: relative; z-index: 1; margin-bottom: 10px; }
.lucky-row--between { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.lucky-label { font-size: 15px; font-weight: 700; color: #eeeef8; }
.lucky-pct { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 500; color: #c45cfc; }
.lucky-slider-wrap { padding: 0 20px; margin-bottom: 18px; position: relative; z-index: 1; }
.lucky-slider-wrap input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 5px; border-radius: 999px;
  background: rgba(255,255,255,.14); outline: none; cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.20), inset 0 -1px 0 rgba(0,0,0,.12);
}
.lucky-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.55) 0%, rgba(196,92,252,.9) 50%, rgba(252,92,248,.8) 100%);
  border: 2px solid rgba(255,255,255,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 0 14px rgba(196,92,252,.55), 0 2px 8px rgba(0,0,0,.30);
  cursor: pointer;
}
.lucky-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(135deg, #c45cfc, #fc5cf8);
  border: 2px solid rgba(255,255,255,.42);
  box-shadow: 0 0 14px rgba(196,92,252,.55), 0 2px 8px rgba(0,0,0,.30); cursor: pointer;
}
.lucky-toggle {
  width: 48px; height: 26px; border-radius: 13px;
  background: linear-gradient(135deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.07) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,.24);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.10);
  position: relative; cursor: pointer; flex-shrink: 0;
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.lucky-toggle.on {
  background: linear-gradient(90deg, rgba(196,92,252,.82), rgba(252,92,248,.72));
  border-color: rgba(196,92,252,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.32), 0 0 18px rgba(196,92,252,.32), inset 0 -1px 0 rgba(0,0,0,.10);
}
.lucky-toggle-thumb {
  width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.95) 0%, rgba(230,230,240,.9) 100%);
  position: absolute; top: 2px; left: 2px;
  transition: left .25s cubic-bezier(.22,1,.36,1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 1px 6px rgba(0,0,0,.35);
}
.lucky-toggle.on .lucky-toggle-thumb { left: 24px; }
.lucky-buttons { display: flex; gap: 10px; padding: 0 16px; margin-bottom: 14px; position: relative; z-index: 1; }
.lucky-btn-demo {
  flex: 1; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.07) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.24);
  border-bottom-color: rgba(255,255,255,.08);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.28), inset 0 -1px 0 rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.18);
  color: #eeeef8; font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background .2s, transform .15s;
}
.lucky-btn-demo:active { transform: scale(.97); background: rgba(255,255,255,.20); }
.lucky-btn-try {
  flex: 2; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(196,92,252,.88) 0%, rgba(252,92,248,.78) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,.30);
  border-bottom-color: rgba(196,92,252,.24);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.42), inset 0 -1px 0 rgba(0,0,0,.14), 0 4px 28px rgba(196,92,252,.42), 0 2px 10px rgba(0,0,0,.22);
  color: #fff; font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s, box-shadow .2s; white-space: nowrap;
}
.lucky-btn-try:active { transform: scale(.97); box-shadow: 0 2px 14px rgba(196,92,252,.26), inset 0 1px 0 rgba(255,255,255,.30); }
.lucky-btn-try:disabled { opacity: .5; cursor: not-allowed; }
.lucky-btn-try-ton { display: flex; align-items: center; gap: 4px; opacity: .92; }
.lucky-btn-try-ton svg { width: 14px; height: 14px; flex-shrink: 0; }


.promo-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0; transition: opacity .3s ease, transform .3s ease;
  z-index: 600; padding: 10px 20px; border-radius: 999px;
  font-size: 13px; font-weight: 700; font-family: 'Nunito', sans-serif;
  white-space: nowrap; pointer-events: none;
  backdrop-filter: blur(28px) saturate(2.5); -webkit-backdrop-filter: blur(28px) saturate(2.5);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.24), 0 4px 24px rgba(0,0,0,0.35);
}
.promo-toast--visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.promo-toast--success {
  background: linear-gradient(135deg, rgba(34,197,94,0.22) 0%, rgba(34,197,94,0.12) 100%);
  border: 1px solid rgba(34,197,94,0.42); color: #4ade80;
}
.promo-toast--error {
  background: linear-gradient(135deg, rgba(239,68,68,0.20) 0%, rgba(239,68,68,0.10) 100%);
  border: 1px solid rgba(239,68,68,0.38); color: #f87171;
}
.promo-toast--info {
  background: linear-gradient(135deg, rgba(77,184,255,0.22) 0%, rgba(77,184,255,0.10) 100%);
  border: 1px solid rgba(77,184,255,0.36); color: #7dd3fc;
}
@keyframes promoSpin { to { transform: rotate(360deg); } }
.promo-spin { animation: promoSpin .7s linear infinite; display: block; }

.sheet-overlay {
  position: fixed; inset: 0; z-index: 650;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
  background: rgba(8,3,18,0.58);
  backdrop-filter: blur(12px) saturate(2);
  -webkit-backdrop-filter: blur(12px) saturate(2);
  opacity: 0; pointer-events: none; transition: opacity .24s ease;
}
.sheet-overlay--visible { opacity: 1; pointer-events: auto; }
.sheet-panel {
  position: relative; width: 100%;
  max-width: 520px; max-height: min(86vh, 760px);
  overflow: hidden auto;
  padding: 14px 18px calc(env(safe-area-inset-bottom, 16px) + 18px);
  border: 1px solid rgba(255,255,255,0.28);
  border-bottom: none; border-radius: 30px 30px 0 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.18) 0%, rgba(196,92,252,0.10) 28%, rgba(16,16,28,0.88) 100%);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.38), 0 -16px 48px rgba(0,0,0,0.34);
  backdrop-filter: blur(40px) saturate(3);
  -webkit-backdrop-filter: blur(40px) saturate(3);
  transform: translateY(100%); transition: transform .3s cubic-bezier(.22,1,.36,1);
}
.sheet-overlay--visible .sheet-panel { transform: translateY(0); }
.sheet-panel--closing { transform: translateY(100%) !important; }
.sheet-panel__glow {
  position: absolute; top: -40px; left: 50%; width: 280px; height: 160px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(196,92,252,0.30) 0%, transparent 72%);
  pointer-events: none;
}
.sheet-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.28); border-radius: 50%;
  background: rgba(255,255,255,0.12); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 2;
}
.sheet-handle {
  width: 40px; height: 4px; margin: 0 auto 20px;
  border-radius: 999px; background: rgba(255,255,255,0.22);
}
.sheet-heading { position: relative; z-index: 1; padding-right: 42px; margin-bottom: 18px; }
.sheet-title { font-size: 24px; font-weight: 800; line-height: 1.08; }
.sheet-subtitle { margin-top: 8px; color: var(--subtitle); font-size: 13px; line-height: 1.5; }

.ton-connect-card,
.ton-wallet-card,
.leaderboard-item,
.ton-deposit-form {
  position: relative; z-index: 1;
  border: 1px solid rgba(255,255,255,0.20);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.06) 100%);
  backdrop-filter: blur(20px) saturate(2.5);
  -webkit-backdrop-filter: blur(20px) saturate(2.5);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.22), inset 0 -1px 0 rgba(0,0,0,0.10);
}
.ton-connect-card {
  display: grid; grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px; align-items: center; padding: 16px; margin-bottom: 14px;
}
.ton-connect-card__icon {
  width: 52px; height: 52px; border-radius: 16px;
  background: linear-gradient(145deg, rgba(196,92,252,0.25) 0%, rgba(77,184,255,0.16) 100%);
  color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.ton-connect-card__title, .ton-wallet-card__value { font-size: 16px; font-weight: 800; }
.ton-connect-card__sub, .ton-wallet-card__label { margin-top: 4px; color: var(--subtitle); font-size: 12px; line-height: 1.45; }
.ton-wallet-card, .ton-deposit-form { padding: 16px; }
.ton-wallet-card { margin-bottom: 12px; }
.ton-wallet-card__value { margin-top: 8px; font-family: 'JetBrains Mono', monospace; }
.ton-deposit-form__label { display: block; margin-bottom: 10px; font-size: 12px; color: var(--subtitle); letter-spacing: .06em; text-transform: uppercase; }
.ton-deposit-input-wrap { position: relative; }
.ton-deposit-input { padding-right: 60px; }
.ton-deposit-input__suffix {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted);
}
.ton-modal-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.ton-modal__action { width: 100%; justify-content: center; }
.ton-link-btn {
  width: 100%; height: 40px;
  border: 1px solid rgba(255,255,255,0.20); border-radius: 12px;
  background: rgba(255,255,255,0.08); color: var(--subtitle);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
}

.leaderboard-tabs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px; position: relative; z-index: 1;
}
.leaderboard-tab {
  height: 42px;
  border: 1px solid rgba(255,255,255,0.18); border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  cursor: pointer; transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.leaderboard-tab.active {
  border-color: rgba(196,92,252,0.50);
  background: linear-gradient(135deg, rgba(196,92,252,0.24) 0%, rgba(252,92,248,0.12) 100%);
  color: var(--text);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.26), 0 0 16px rgba(196,92,252,0.18);
}
.leaderboard-panel__body { margin-top: 14px; }
.leaderboard-status { min-height: 18px; color: var(--subtitle); font-size: 12px; }
.leaderboard-list-wrap { position: relative; min-height: 260px; }
.leaderboard-list {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 10px;
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
.leaderboard-list.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.leaderboard-item {
  display: grid; grid-template-columns: 28px 48px minmax(0, 1fr) auto;
  gap: 12px; align-items: center; padding: 12px 14px;
}
.leaderboard-item__place { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.leaderboard-item__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
}
.leaderboard-item__avatar--fallback {
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--text);
}
.leaderboard-item__name { font-size: 15px; font-weight: 800; }
.leaderboard-item__meta { margin-top: 3px; color: var(--subtitle); font-size: 12px; }
.leaderboard-item__amount { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; }
.leaderboard-empty {
  height: 100%; min-height: 220px;
  border: 1px dashed rgba(255,255,255,0.16); border-radius: 20px;
  color: var(--subtitle); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
}

.inv-modal-overlay {
  position: fixed; inset: 0; background: rgba(6,2,16,0.72); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity .25s ease;
  backdrop-filter: blur(12px) saturate(2); -webkit-backdrop-filter: blur(12px) saturate(2);
}
.inv-modal-overlay--visible { opacity: 1; }
.inv-modal-sheet {
  width: 100%; max-width: 480px;
  border-radius: 28px 28px 0 0;
  border: 1px solid rgba(255,255,255,0.28);
  border-bottom: none;
  padding-bottom: env(safe-area-inset-bottom, 20px);
  position: relative; overflow: hidden;
  animation: invSheetIn .38s cubic-bezier(.22,1,.36,1) both;
  background: linear-gradient(168deg,
    rgba(255,255,255,0.18) 0%,
    rgba(196,92,252,0.12) 25%,
    rgba(255,255,255,0.07) 55%,
    rgba(13,6,25,0.90) 100%
  );
  backdrop-filter: blur(52px) saturate(3) brightness(1.20);
  -webkit-backdrop-filter: blur(52px) saturate(3) brightness(1.20);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.38),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 -8px 48px rgba(0,0,0,0.38);
}
@keyframes invSheetIn  { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes invSheetOut { from { transform: translateY(0); } to { transform: translateY(100%); } }
.inv-modal-sheet--closing { animation: invSheetOut .26s cubic-bezier(.4,0,1,1) both !important; }
.inv-modal-sheet::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 36%;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, transparent 100%);
  border-radius: 28px 28px 0 0; pointer-events: none; z-index: 0;
}
.inv-modal-glow {
  position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
  width: 300px; height: 160px;
  background: radial-gradient(ellipse, rgba(196,92,252,0.36) 0%, transparent 70%);
  pointer-events: none; z-index: 0;
}
.inv-modal-glow--red { background: radial-gradient(ellipse, rgba(239,68,68,0.30) 0%, transparent 70%); }
.inv-modal-handle {
  width: 36px; height: 4px; background: rgba(255,255,255,0.22); border-radius: 2px;
  margin: 12px auto 18px; position: relative; z-index: 1;
}
.inv-modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.20) 0%, rgba(255,255,255,0.08) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.32);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.28), 0 2px 8px rgba(0,0,0,0.20);
  color: rgba(238,238,248,0.60);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; z-index: 10; transition: background .2s, color .2s;
}
.inv-modal-close:hover { background: rgba(255,255,255,0.26); color: var(--text); }
.inv-modal-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px 18px; position: relative; z-index: 1;
}
.inv-modal-img-wrap { position: relative; width: 90px; height: 90px; flex-shrink: 0; }
.inv-modal-img-ring {
  position: absolute; inset: -3px; border-radius: 22px;
  background: conic-gradient(var(--accent), var(--accent2), var(--accent));
  z-index: 0; opacity: 0.60;
}
.inv-modal-img-inner {
  position: relative; z-index: 1; width: 100%; height: 100%;
  border-radius: 18px; overflow: hidden;
  background: rgba(255,255,255,0.10); border: 2px solid var(--bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .2s ease;
}
.inv-modal-img-inner img { width: 100%; height: 100%; object-fit: cover; }
.inv-modal-img-glow {
  position: absolute; inset: -8px; border-radius: 24px;
  background: var(--glow); filter: blur(16px); z-index: -1;
  animation: glowPulse 3s ease-in-out infinite;
}
.inv-modal-lottie-layer {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  overflow: hidden;
  z-index: 2;
}
.inv-modal-hero-info { flex: 1; min-width: 0; }
.inv-modal-model { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--accent); letter-spacing: .1em; opacity: .75; margin-bottom: 4px; }
.inv-modal-name { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
.inv-modal-price-row { display: flex; align-items: center; gap: 5px; font-family: 'JetBrains Mono', monospace; }
.inv-modal-price-val { font-size: 18px; font-weight: 700; color: #fff; }
.inv-modal-price-label { font-size: 12px; color: var(--muted); }
.inv-modal-divider { height: 1px; background: rgba(255,255,255,0.10); margin: 0 20px 16px; position: relative; z-index: 1; }
.inv-modal-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; }
.inv-modal-row--total { border-top: 1px solid rgba(255,255,255,0.09); margin-top: 6px; padding-top: 10px; }
.inv-modal-row-label { font-size: 13px; color: var(--muted); }
.inv-modal-row-val { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 600; color: var(--text); }
.inv-modal-row-val--red { color: #f87171; }
.inv-modal-row-val--green { color: #4ade80; font-size: 15px; font-weight: 700; }
.inv-modal-buttons { display: flex; gap: 10px; padding: 0 16px 4px; position: relative; z-index: 1; }
.inv-modal-btn-sell {
  flex: 1; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(239,68,68,0.22) 0%, rgba(239,68,68,0.10) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(239,68,68,0.38); border-bottom-color: rgba(239,68,68,0.14);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.18), 0 4px 16px rgba(239,68,68,0.14);
  color: #f87171; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .2s, transform .15s;
}
.inv-modal-btn-sell:hover { background: rgba(239,68,68,0.30); }
.inv-modal-btn-sell:active { transform: scale(.97); }
.inv-modal-btn-list {
  flex: 1.4; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(196,92,252,0.38) 0%, rgba(252,92,248,0.26) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(196,92,252,0.58); border-bottom-color: rgba(196,92,252,0.20);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.30), inset 0 -1px 0 rgba(0,0,0,0.12), 0 4px 22px rgba(196,92,252,0.28);
  color: #fff; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: background .2s, transform .15s;
}
.inv-modal-btn-list:hover { background: linear-gradient(135deg, rgba(196,92,252,0.48), rgba(252,92,248,0.36)); }
.inv-modal-btn-list:active { transform: scale(.97); }
.inv-modal-btn-list--listed {
  background: linear-gradient(135deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.04) 100%);
  border-color: rgba(255,255,255,0.18); color: var(--muted); box-shadow: none;
}
.inv-modal-btn-list:disabled, .inv-modal-btn-sell:disabled { opacity: 0.5; cursor: not-allowed; }

.inv-sell-confirm-overlay { z-index: 600; }
.inv-confirm-sheet { padding-bottom: env(safe-area-inset-bottom, 20px); }
.inv-confirm-title { font-size: 22px; font-weight: 800; text-align: center; letter-spacing: -.02em; margin-bottom: 10px; position: relative; z-index: 1; }
.inv-confirm-sub { text-align: center; font-size: 14px; color: var(--muted); line-height: 1.6; padding: 0 24px; margin-bottom: 18px; position: relative; z-index: 1; }
.inv-confirm-breakdown {
  margin: 0 20px 16px;
  background: linear-gradient(135deg, rgba(239,68,68,0.12) 0%, rgba(239,68,68,0.06) 100%);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(239,68,68,0.22); border-bottom-color: rgba(239,68,68,0.08);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.14);
  border-radius: 16px; padding: 12px 14px; position: relative; z-index: 1;
}
.inv-confirm-buttons { display: flex; gap: 10px; padding: 0 16px 4px; position: relative; z-index: 1; }
.inv-confirm-btn-no {
  flex: 1; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.20);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.20), 0 2px 8px rgba(0,0,0,0.12);
  color: var(--muted); font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background .2s, transform .15s;
}
.inv-confirm-btn-no:active { transform: scale(.97); background: rgba(255,255,255,0.18); }
.inv-confirm-btn-yes {
  flex: 1.4; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(239,68,68,0.88) 0%, rgba(220,38,38,0.82) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.22); border-bottom-color: rgba(220,38,38,0.22);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.32), inset 0 -1px 0 rgba(0,0,0,0.12), 0 4px 22px rgba(239,68,68,0.32);
  color: #fff; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .15s, box-shadow .2s;
}
.inv-confirm-btn-yes:active { transform: scale(.97); }
.inv-confirm-btn-yes:disabled { opacity: 0.5; cursor: not-allowed; }

.inv-list-overlay { z-index: 600; }
.inv-withdraw-methods { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 0 16px 14px; position: relative; z-index: 1; }
.inv-withdraw-method {
  min-height: 64px; border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.20);
  background: linear-gradient(135deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0.06) 100%);
  backdrop-filter: blur(20px) saturate(2.5); -webkit-backdrop-filter: blur(20px) saturate(2.5);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.22), 0 6px 18px rgba(0,0,0,0.18);
  color: var(--text); display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center; gap: 4px; padding: 14px 16px;
  cursor: pointer; transition: transform .16s ease, border-color .2s ease, background .2s ease;
}
.inv-withdraw-method:hover { transform: translateY(-1px); }
.inv-withdraw-method:disabled { opacity: .6; cursor: progress; }
.inv-withdraw-method--ton { border-color: color-mix(in srgb, #4DB8FF 50%, rgba(255,255,255,0.15) 50%); }
.inv-withdraw-method--stars { border-color: color-mix(in srgb, var(--accent) 60%, rgba(255,255,255,0.15) 40%); }
.inv-withdraw-method__title { font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.inv-withdraw-method__meta { color: var(--subtitle); font-size: 12px; line-height: 1.4; }
.inv-list-header { padding: 0 20px 16px; position: relative; z-index: 1; }
.inv-list-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; color: var(--text); }
.inv-list-sub { font-size: 13px; color: var(--muted); font-family: 'JetBrains Mono', monospace; }
.inv-list-field-wrap { padding: 0 20px; margin-bottom: 16px; position: relative; z-index: 1; }
.inv-list-field-label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.inv-list-input-row {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.05) 100%);
  backdrop-filter: blur(24px) saturate(2.5); -webkit-backdrop-filter: blur(24px) saturate(2.5);
  border: 1px solid rgba(196,92,252,0.44); border-bottom-color: rgba(196,92,252,0.16);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.22), inset 0 -1px 0 rgba(0,0,0,0.10);
  border-radius: 14px; padding: 0 14px; height: 50px; transition: border-color .2s, background .2s;
}
.inv-list-input-row:focus-within {
  border-color: rgba(196,92,252,0.72);
  background: linear-gradient(135deg, rgba(196,92,252,0.12) 0%, rgba(255,255,255,0.06) 100%);
}
.inv-list-input-row svg { flex-shrink: 0; color: #4DB8FF; }
.inv-list-price-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: 'JetBrains Mono', monospace;
  font-size: 18px; font-weight: 700; min-width: 0;
}
.inv-list-price-input::placeholder { color: var(--muted); }
.inv-list-price-input::-webkit-outer-spin-button,
.inv-list-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inv-list-price-input[type=number] { -moz-appearance: textfield; }
.inv-list-input-suffix { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--muted); flex-shrink: 0; }
.inv-list-calc { margin-top: 8px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.inv-list-calc #inv-list-net { color: #4ade80; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
.inv-list-btn-submit {
  flex: 1.4; height: 52px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(196,92,252,0.88) 0%, rgba(252,92,248,0.78) 100%);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.28); border-bottom-color: rgba(196,92,252,0.22);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.40), inset 0 -1px 0 rgba(0,0,0,0.12), 0 4px 24px rgba(196,92,252,0.38);
  color: #fff; font-family: 'Syne', sans-serif; font-size: 14px; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
  transition: transform .15s, box-shadow .2s;
}
.inv-list-btn-submit:active { transform: scale(.97); }
.inv-list-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }
.inv-listed-badge {
  position: absolute; top: 6px; right: 6px;
  background: linear-gradient(135deg, rgba(196,92,252,0.90), rgba(252,92,248,0.75));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.26);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.28), 0 2px 8px rgba(196,92,252,0.38);
  border-radius: 999px; padding: 2px 7px;
  font-size: 8px; font-weight: 800; letter-spacing: .06em;
  color: #fff; z-index: 6; text-transform: uppercase;
}

html.theme-light body, html.theme-light .loader { background: var(--bg); }
html.theme-light { color-scheme: light; }
html.theme-light .app {
  background:
    radial-gradient(ellipse 90% 50% at 15% 0%, rgba(29,109,242,0.12) 0%, transparent 65%),
    radial-gradient(ellipse 70% 40% at 85% 100%, rgba(16,185,129,0.08) 0%, transparent 60%),
    var(--bg);
}
html.theme-light .section,
html.theme-light .friends-stat-card,
html.theme-light .friends-link-box__value,
html.theme-light .friends-card,
html.theme-light .promo-input,
html.theme-light .market-search-input,
html.theme-light .market-sort-btn,
html.theme-light .market-chip,
html.theme-light .nft-card,
html.theme-light .inv-cell,
html.theme-light .inv-cell--filled {
  background: linear-gradient(145deg, rgba(255,255,255,0.94) 0%, rgba(244,248,255,0.86) 100%);
  border-color: rgba(196,92,252,0.18);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.90), inset 0 -1px 0 rgba(28,39,61,0.06), 0 8px 24px rgba(48,74,122,0.10);
}
html.theme-light .navbar__glass {
  background: linear-gradient(180deg, rgba(255,255,255,0.86) 0%, rgba(240,246,255,0.92) 100%);
  border-top-color: rgba(196,92,252,0.22);
}
html.theme-light .topbar__left, html.theme-light .ton-badge {
  background: linear-gradient(135deg, rgba(255,255,255,0.88) 0%, rgba(244,248,255,0.80) 100%);
  border-color: rgba(196,92,252,0.22);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,0.90), 0 4px 12px rgba(48,74,122,0.08);
}
html.theme-light .promo-btn, html.theme-light .friends-level-badge, html.theme-light .nav-btn.active .nav-btn__icon {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, #ffffff 82%) 0%, color-mix(in srgb, var(--accent-strong) 14%, #ffffff 86%) 100%);
  border-color: color-mix(in srgb, var(--accent) 35%, #ffffff 65%);
}
html.theme-light .promo-btn, html.theme-light .promo-btn i, html.theme-light .friends-level-badge { color: var(--accent); }
html.theme-light .profile-username, html.theme-light .topbar__logo,
html.theme-light .friends-level-badge, html.theme-light .market-chip.active { color: var(--accent); -webkit-text-fill-color: currentColor; }
html.theme-light .lucky-overlay, html.theme-light .inv-modal-overlay { background: rgba(233,240,252,0.75); }
html.theme-light .error-screen button { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, #ffffff 45%); }
html.theme-light .error-screen button:hover { background: var(--accent); color: var(--accent-contrast); }
html.theme-light .navbar::before { background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 78%, #ffffff 22%), transparent); }
.levels-list {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  z-index: 1;
}
.level-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: border-color .2s;
}
.level-item--active {
  background: rgba(196,92,252,0.10);
  border-color: rgba(196,92,252,0.40);
  box-shadow: 0 0 18px rgba(196,92,252,0.12);
}
.level-item--done {
  opacity: 0.6;
}
.level-item__left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.level-item__badge {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  font-family: 'JetBrains Mono', monospace;
  background: linear-gradient(135deg, rgba(196,92,252,0.28) 0%, rgba(252,92,248,0.18) 100%);
  border: 1px solid rgba(196,92,252,0.40);
  color: var(--accent);
}
.level-item--active .level-item__badge {
  background: linear-gradient(135deg, rgba(196,92,252,0.55) 0%, rgba(252,92,248,0.40) 100%);
  border-color: rgba(196,92,252,0.70);
  color: #fff;
}
.level-item__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.level-item__sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.level-item__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.level-item__check {
  color: #22c55e;
  font-size: 16px;
}
.level-item__locked {
  color: var(--muted);
  font-size: 14px;
}
.level-item__progress-wrap {
  width: 72px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.10);
  overflow: hidden;
}
.level-item__progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .4s ease;
}
.level-item__progress-txt {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--muted);
  white-space: nowrap;
}

#page-earn {
  display: flex;
  flex-direction: column;
}
.earn-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
  scrollbar-width: none;
}
.earn-inner::-webkit-scrollbar { display: none; }

.earn-hero {
  position: relative;
  margin: 14px 0 14px;
  border-radius: 24px;
  padding: 22px 20px 18px;
  background: linear-gradient(
    135deg,
    rgba(196,92,252,0.22) 0%,
    rgba(255,255,255,0.10) 40%,
    rgba(252,92,248,0.10) 100%
  );
  backdrop-filter: blur(28px) saturate(3) brightness(1.18);
  -webkit-backdrop-filter: blur(28px) saturate(3) brightness(1.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-bottom-color: rgba(255,255,255,0.08);
  box-shadow:
    inset 0 1.5px 0 rgba(255,255,255,0.45),
    inset 0 -1px 0 rgba(0,0,0,0.18),
    0 8px 32px rgba(0,0,0,0.28),
    0 0 60px rgba(196,92,252,0.12);
}
.earn-hero__glow {
  position: absolute;
  top: -40px; right: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,92,252,0.30) 0%, transparent 70%);
  pointer-events: none;
}
.earn-hero__content {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.earn-hero__icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(196,92,252,0.40) 0%, rgba(252,92,248,0.25) 100%);
  border: 1px solid rgba(196,92,252,0.45);
  box-shadow: 0 0 22px rgba(196,92,252,0.30), inset 0 1px 0 rgba(255,255,255,0.30);
  color: #fff;
}
.earn-hero__title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}
.earn-hero__sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.earn-hero__stats {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding: 12px 0;
  border: 1px solid rgba(255,255,255,0.08);
}
.earn-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.earn-stat__val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  background: linear-gradient(90deg, #fc5cf8, #c45cfc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.earn-stat__label {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  letter-spacing: .03em;
}
.earn-stat__divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.10);
  flex-shrink: 0;
}

.earn-filter-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.earn-filter-row::-webkit-scrollbar { display: none; }
.earn-chip {
  flex-shrink: 0;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  -webkit-tap-highlight-color: transparent;
}
.earn-chip.active {
  background: linear-gradient(135deg, rgba(196,92,252,0.35) 0%, rgba(252,92,248,0.22) 100%);
  border-color: rgba(196,92,252,0.50);
  color: var(--text);
  box-shadow: 0 0 16px rgba(196,92,252,0.20);
}

.earn-tasks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 4px;
}

.earn-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 13px;
}
.earn-loading__ring {
  width: 28px; height: 28px;
  border: 2px solid rgba(255,255,255,0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.earn-task-card {
  position: relative;
  border-radius: 18px;
  padding: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.13) 0%,
    rgba(255,255,255,0.06) 50%,
    rgba(0,0,0,0.02) 100%
  );
  backdrop-filter: blur(20px) saturate(2.5);
  -webkit-backdrop-filter: blur(20px) saturate(2.5);
  border: 1px solid rgba(255,255,255,0.20);
  border-bottom-color: rgba(255,255,255,0.06);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.35),
    0 4px 18px rgba(0,0,0,0.20);
}
.earn-task-card:active { transform: scale(.98); }
.earn-task-card.completed {
  opacity: 0.55;
  pointer-events: none;
}
.earn-task-card__icon {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(196,92,252,0.28) 0%, rgba(252,92,248,0.16) 100%);
  border: 1px solid rgba(196,92,252,0.30);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22);
  color: var(--accent);
}
.earn-task-card.completed .earn-task-card__icon {
  background: linear-gradient(135deg, rgba(34,197,94,0.22) 0%, rgba(34,197,94,0.10) 100%);
  border-color: rgba(34,197,94,0.30);
  color: #22c55e;
}
.earn-task-card__body {
  flex: 1; min-width: 0;
}
.earn-task-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.earn-task-card__desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.earn-task-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.earn-task-card__reward {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, rgba(196,92,252,0.38) 0%, rgba(252,92,248,0.22) 100%);
  border: 1px solid rgba(196,92,252,0.35);
  padding: 5px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.earn-task-card__reward--nft {
  background: linear-gradient(135deg, rgba(251,191,36,0.28) 0%, rgba(245,158,11,0.16) 100%);
  border-color: rgba(251,191,36,0.35);
  color: #fbbf24;
}
.earn-task-card.completed .earn-task-card__reward {
  background: rgba(34,197,94,0.16);
  border-color: rgba(34,197,94,0.28);
  color: #22c55e;
}
.earn-reward-ton-icon {
  width: 12px; height: 12px;
  color: #4DB8FF;
}
.earn-task-card__badge {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: .03em;
}
.earn-task-card__badge--premium {
  color: #fbbf24;
  display: flex; align-items: center; gap: 3px;
}

.earn-task-card__actions {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
}
.earn-task-card__btn-link {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 5px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(77,184,255,0.20) 0%, rgba(77,184,255,0.08) 100%);
  border: 1px solid rgba(77,184,255,0.36);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  color: #4DB8FF;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, background .2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.earn-task-card__btn-link::after { content: 'Открыть'; }
.earn-task-card__btn-link:active { transform: scale(.96); background: rgba(77,184,255,0.30); }
.earn-task-card.completed .earn-task-card__btn-link { opacity: 0.4; pointer-events: none; }

.earn-task-card__btn-app-open {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 6px;
  padding: 5px 13px 5px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(196,92,252,0.22) 0%, rgba(252,92,248,0.10) 100%);
  border: 1px solid rgba(196,92,252,0.38);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 2px 8px rgba(196,92,252,0.10);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s, background .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  letter-spacing: .01em;
}
.earn-task-card__btn-app-open:active { transform: scale(.96); background: rgba(196,92,252,0.32); }
.earn-task-card__btn-app-open:disabled {
  opacity: 0.65;
  pointer-events: none;
  cursor: default;
}
.earn-task-card.completed .earn-task-card__btn-app-open { display: none; }

.earn-task-card__btn-check {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(196,92,252,0.30) 0%, rgba(252,92,248,0.18) 100%);
  border: 1px solid rgba(196,92,252,0.44);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20), 0 2px 8px rgba(196,92,252,0.16);
  color: var(--accent);
  cursor: pointer;
  transition: transform .15s, background .2s, color .15s;
  -webkit-tap-highlight-color: transparent;
}
.earn-task-card__btn-check:active { transform: scale(.9); }
.earn-task-card.completed .earn-task-card__btn-check {
  background: linear-gradient(135deg, rgba(34,197,94,0.26) 0%, rgba(34,197,94,0.12) 100%);
  border-color: rgba(34,197,94,0.40);
  color: #22c55e;
  pointer-events: none;
}

.earn-task-reward-nft {
  position: relative;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid rgba(251,191,36,0.38);
  background: rgba(251,191,36,0.10);
  cursor: default;
}
.earn-task-reward-nft img {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: 10px;
  transition: opacity .15s ease;
  display: block;
}
.earn-task-reward-nft__lottie {
  position: absolute; inset: 0;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
  overflow: hidden;
}
.earn-task-reward-nft:hover img { opacity: 0; }
.earn-task-reward-nft:hover .earn-task-reward-nft__lottie { opacity: 1; }

.earn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 16px;
  gap: 10px;
}
.earn-empty__icon {
  font-size: 40px;
  color: var(--muted);
  margin-bottom: 4px;
}
.earn-empty__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.earn-empty__sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.earn-toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(34,197,94,0.90) 0%, rgba(16,185,129,0.80) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all .3s cubic-bezier(.22,1,.36,1);
  z-index: 500;
  box-shadow: 0 8px 28px rgba(34,197,94,0.35);
}
.earn-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (min-width: 900px) {
  body {
    background:
      radial-gradient(circle at top left,    color-mix(in srgb, var(--accent) 22%, transparent 78%), transparent 36%),
      radial-gradient(circle at bottom right, color-mix(in srgb, var(--accent-strong) 18%, transparent 82%), transparent 30%),
      var(--bg);
  }
  .app {
    position: relative;
    width: min(1320px, calc(100vw - 48px));
    height: min(940px, calc(100vh - 40px));
    margin: 20px auto;
    border-radius: 36px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow:
      0 0 0 1px rgba(196,92,252,0.08),
      0 32px 100px rgba(0,0,0,0.55),
      0 8px 30px rgba(0,0,0,0.30);
    display: grid;
    grid-template-columns: 72px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "sidebar topbar"
      "sidebar pages";
  }
  .app > .noise { border-radius: 36px; }
  .navbar {
    position: relative;
    left: auto; right: auto; bottom: auto;
    transform: none;
    width: 72px;
    height: 100%;
    flex-shrink: 0;
    order: -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 24px 6px;

    grid-area: sidebar;
    border-radius: 0;
    border-right: 1px solid rgba(255,255,255,0.10);
  }

  .navbar__glass {
    border-top: none;
    border-right: 1px solid rgba(255,255,255,0.20);
    border-radius: 0;
    background: linear-gradient(
      90deg,
      rgba(255,255,255,0.10) 0%,
      rgba(255,255,255,0.05) 40%,
      rgba(10,6,22,0.18) 100%
    );
  }
  .navbar::before {
    top: var(--glow-x, 50%);
    left: 0;
    width: 2px;
    height: 44px;
    background: linear-gradient(180deg, transparent, rgba(196,92,252,0.95), transparent);
    transform: translateY(-50%);
    transition: top .3s cubic-bezier(.4,0,.2,1);
  }

  .nav-btn {
    flex: 0 0 auto;
    width: 56px;
    flex-direction: column;
    padding: 8px 4px;
    border-radius: 14px;
  }

  .nav-btn__icon {
    width: 38px;
    height: 34px;
    border-radius: 12px;
  }

  .nav-btn__label {
    font-size: 8px;
    letter-spacing: .03em;
  }
  .topbar { grid-area: topbar; padding-left: 32px; padding-right: 32px; padding-top: 22px; padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,0.07); }
  .pages  { grid-area: pages;  padding-bottom: 0; }
  .noise  { position: fixed; }
  .topbar__left {
    max-width: 200px;
  }

  .ton-badge {
    max-width: 180px;
  }
  .page-scroll-inner {
    padding-left: 36px;
    padding-right: 36px;
    padding-top: 8px;
  }
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(0, 1fr);
    grid-template-rows: auto;
    gap: 0 24px;
    align-content: start;
    align-items: start;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
  }
  .avatar-section {
    grid-column: 1;
    grid-row: 1 / 10;
    position: sticky;
    top: 16px;
    padding-top: 20px;
    padding-bottom: 20px;
    align-self: start;
  }
  .avatar-wrap { width: 120px; height: 120px; }
  .profile-name { font-size: 26px; }
    grid-column: 2;
    margin-top: 0;
    margin-bottom: 14px;
  }
    margin-top: 20px;
  }
  .inventory-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0 24px;
    align-content: start;
    align-items: start;
    max-width: 1100px;
  }
  .friends-hero {
    grid-column: 1 / -1;
    margin-top: 20px;
  }
    grid-column: 1;
  }
    grid-column: 2;
    grid-row: 2 / 5;
  }

  .friends-card { padding: 14px 16px; }
  .friends-list { gap: 10px; }
  .friends-hero__stats { gap: 12px; }
  .market-inner {
    padding-left: 32px;
    padding-right: 32px;
    max-width: 1100px;
    margin: 0 auto;
    padding-top: 16px;
  }
  .market-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
  .nft-card:hover {
    transform: translateY(-3px) scale(1.015);
    box-shadow:
      inset 0 1.5px 0 rgba(255,255,255,0.50),
      inset 0 -1px 0 rgba(0,0,0,0.18),
      0 12px 40px rgba(0,0,0,0.40),
      0 0 0 1px rgba(196,92,252,0.28),
      0 0 30px rgba(196,92,252,0.18);
  }
  
  .sheet-overlay {
    align-items: center;
    justify-content: center;
    padding: 32px;
  }

  .sheet-panel {
    max-width: 680px;
    width: 100%;
    max-height: min(88vh, 860px);
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.26);
    transform: translateY(20px) scale(.97);
  }

  .sheet-overlay--visible .sheet-panel {
    transform: translateY(0) scale(1);
  }
  .leaderboard-panel { max-width: 760px; }
  .ton-modal         { max-width: 520px; }
  .lucky-overlay,
  .inv-modal-overlay {
    align-items: center;
    justify-content: center;
    padding: 32px;
  }

  .lucky-sheet {
    max-width: 680px;
    width: 100%;
    border-radius: 30px;
    border: 1px solid rgba(255,255,255,0.26);
    padding-bottom: 28px;
    transform: none;
    animation: luckySheetInDesktop .36s cubic-bezier(.22,1,.36,1) both;
  }

  @keyframes luckySheetInDesktop {
    from { opacity: 0; transform: scale(.95) translateY(16px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);    }
  }

  .inv-modal-sheet {
    max-width: 680px;
    width: 100%;
    border-radius: 28px;
    border: 1px solid rgba(255,255,255,0.24);
    padding-bottom: 28px;
  }

  .inv-modal-overlay--visible .inv-modal-sheet {
    animation: luckySheetInDesktop .32s cubic-bezier(.22,1,.36,1) both;
  }
  .lucky-handle,
  .inv-modal-handle { display: none; }
  .lucky-buttons,
  .inv-modal-buttons,
  .inv-confirm-buttons {
    padding-left: 28px;
    padding-right: 28px;
  }
  .inv-withdraw-methods {
    grid-template-columns: 1fr 1fr;
    padding: 0 28px;
  }
  .nav-btn:hover:not(.active) {
    color: var(--text);
  }

  .nav-btn:hover:not(.active) .nav-btn__icon {
    background: rgba(255,255,255,0.07);
  }

  .leaderboard-trigger:hover {
    transform: scale(1.08);
  }

  .inv-cell--filled:hover {
    transform: scale(1.03);
    box-shadow:
      inset 0 1.5px 0 rgba(255,255,255,0.50),
      0 8px 28px rgba(0,0,0,0.35),
      0 0 0 1px rgba(196,92,252,0.30),
      0 0 22px rgba(196,92,252,0.14);
  }

  .btn-lucky:hover {
    background: rgba(252,92,248,0.28);
    border-color: rgba(252,92,248,0.55);
  }

  .btn-buy:hover {
    background: linear-gradient(135deg, rgba(196,92,252,0.52) 0%, rgba(252,92,248,0.38) 100%);
  }

  .promo-btn:hover {
    background: linear-gradient(135deg, rgba(196,92,252,0.48) 0%, rgba(252,92,248,0.34) 100%);
    color: #fff;
  }

  .ton-badge:hover {
    box-shadow:
      inset 0 1.5px 0 rgba(255,255,255,0.50),
      0 0 0 1.5px rgba(196,92,252,0.40),
      0 4px 20px rgba(196,92,252,0.22);
  }
  .leaderboard-panel__body {
    max-height: min(55vh, 560px);
    overflow-y: auto;
  }
  .page-scroll-inner::-webkit-scrollbar,
  .market-inner::-webkit-scrollbar,
  .leaderboard-panel__body::-webkit-scrollbar {
    display: block;
    width: 4px;
  }

  .page-scroll-inner::-webkit-scrollbar-track,
  .market-inner::-webkit-scrollbar-track,
  .leaderboard-panel__body::-webkit-scrollbar-track {
    background: transparent;
  }

  .page-scroll-inner::-webkit-scrollbar-thumb,
  .market-inner::-webkit-scrollbar-thumb,
  .leaderboard-panel__body::-webkit-scrollbar-thumb {
    background: rgba(196,92,252,0.30);
    border-radius: 999px;
  }

  .page-scroll-inner::-webkit-scrollbar-thumb:hover,
  .market-inner::-webkit-scrollbar-thumb:hover,
  .leaderboard-panel__body::-webkit-scrollbar-thumb:hover {
    background: rgba(196,92,252,0.55);
  }
  .page-scroll-inner,
  .market-inner {
    scrollbar-width: thin;
    scrollbar-color: rgba(196,92,252,0.30) transparent;
  }
  
  .earn-inner {
    padding-left: 36px;
    padding-right: 36px;
    padding-top: 16px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(196,92,252,0.30) transparent;
  }
  .earn-inner::-webkit-scrollbar { display: block; width: 4px; }
  .earn-inner::-webkit-scrollbar-track { background: transparent; }
  .earn-inner::-webkit-scrollbar-thumb { background: rgba(196,92,252,0.30); border-radius: 999px; }

  #page-earn {
    overflow-y: auto;
    align-items: center;
  }


  .earn-hero {
    margin-top: 20px;
  }

  .earn-tasks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .earn-task-card:hover:not(.completed) {
    transform: translateY(-2px) scale(1.005);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.40),
      0 8px 28px rgba(0,0,0,0.28),
      0 0 0 1px rgba(196,92,252,0.22),
      0 0 22px rgba(196,92,252,0.12);
  }}

.profile-admin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(216, 119, 234, .28);
  border-radius: 16px;
  background: rgba(165, 64, 190, .12);
  color: var(--text, #f8edf9);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
