:root {
  --bg: #131314;
  --card: #262629;
  --card-2: #343438;
  --border: rgba(255, 255, 255, 0.08);
  --text: #ffffff;
  --text-secondary: #8c8c93;
  --text-muted: #7d7d85;
  --text-light: #e5e5ea;
  --accent-orange: #ffa800;
  --accent-blue: #3069ff;
  --accent-green: #4bb34b;
  --accent-purple: #9d4bff;
}

* { box-sizing: border-box; }

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-screen[hidden] { display: none; }

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: loading-spin 0.7s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }
img[hidden] { display: none; }

.ui-icon { filter: brightness(0) invert(1); }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.brand-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 16px 10px;
}
.brand-mark { width: 24px; height: 24px; }
.brand-word { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }

.content {
  flex: 1;
  padding: 4px 16px 0;
}

.hero {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  border-radius: 24px;
  overflow: hidden;
  background: radial-gradient(120% 120% at 30% 20%, #b45cff 0%, #7a1fd6 45%, #5b17a8 100%);
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-lottie {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-lottie svg { display: block; }
.hero-image-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(20, 15, 30, 0.35);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 2;
}
.hero-btn img { width: 18px; height: 18px; }
.hero-btn--top-left { top: 16px; left: 16px; }
.hero-actions {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: 2;
}
.hero-actions .hero-btn { position: static; }

.title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.gift-title { font-size: 28px; font-weight: 800; margin: 0; letter-spacing: -0.02em; }

.collection-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0;
}
.collection-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--card-2);
  object-fit: cover;
}
.collection-name { font-size: 16px; font-weight: 600; }
.verified-badge { width: 16px; height: 16px; filter: invert(30%) sepia(90%) saturate(3000%) hue-rotate(215deg); }
.chevron { width: 18px; height: 18px; opacity: 0.5; }
.chevron--big { width: 20px; height: 20px; opacity: 0.4; }

.price-section { margin-top: 18px; }
.price-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.price-value {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 800;
}
.price-value img { width: 24px; height: 24px; }
.price-token-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.price-usd { font-size: 16px; font-weight: 600; color: var(--text-secondary); }
.price-usd:not(:empty)::before { content: "≈ "; }

.offer-btn {
  width: 100%;
  margin-top: 14px;
  padding: 18px;
  border-radius: 16px;
  background: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
}
.offer-btn img { width: 20px; height: 20px; }
.offer-btn--buy { background: var(--accent-blue); }

.telegram-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}
.telegram-link img { width: 16px; height: 16px; }

.tabs {
  display: flex;
  gap: 22px;
  margin-top: 26px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab {
  padding-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.tab--active {
  color: var(--text);
  border-bottom: 2px solid var(--text);
}

.est-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  font-size: 16px;
}
.est-label { font-weight: 700; margin-right: 2px; }
.ton-icon { width: 18px; height: 18px; }
.est-value { color: var(--text); font-weight: 700; }
.est-usd { color: var(--text-secondary); font-weight: 600; }
.est-usd:not(:empty)::before { content: "≈ "; }
.est-help img { width: 16px; height: 16px; opacity: 0.5; }

.section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 24px 0 12px;
}

.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.attr-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
}
.attr-type {
  color: var(--accent-blue);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.attr-value { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.attr-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.attr-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  color: #fff;
}
.attr-count {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.attr-count img { width: 14px; height: 14px; opacity: 0.6; }

.description {
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-light);
  margin: 0;
}

.owner-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}
.owner-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b9d, #6b5bff);
}
.fee-badge {
  background: var(--card-2);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 6px;
}
.owner-label { font-size: 13px; color: var(--text-secondary); }
.owner-address { font-size: 15px; font-weight: 700; }

.other-card {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.other-row {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.other-row:last-child { border-bottom: none; }
.other-row--split { display: flex; gap: 0; }
.other-row--split > div { flex: 1; }
.other-row--split > div:first-child {
  border-right: 1px solid var(--border);
  padding-right: 16px;
}
.other-row--split > div:last-child {
  padding-left: 16px;
}
.other-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 4px; }
.other-value {
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.copy-icon { width: 14px; height: 14px; opacity: 0.6; }

.bottom-spacer { height: 96px; }

.bottom-nav {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  background: rgba(19, 19, 20, 0.72);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  flex: 1;
  padding: 4px;
}
.nav-item img { width: 24px; height: 24px; opacity: 0.55; }
.nav-item span { font-size: 11px; font-weight: 600; }
.nav-item--active { color: var(--text); }
.nav-item--active img { opacity: 1; }

@media (prefers-color-scheme: light) {
  :root {
    --bg: #131314;
    --text: #ffffff;
  }
}

#myItemsView {
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 70vh;
}

#myItemsView[hidden] {
  display: none;
}

.my-items-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  width: 100%;
  box-sizing: border-box;
  margin: auto;
}

.empty-state-img {
  width: 200px;
  height: auto;
  margin-bottom: 24px;
}

.ghost-img {
  width: 220px;
  margin-bottom: 16px;
}

.my-items-state h2 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 16px 0;
  line-height: 1.2;
}

.my-items-state p {
  font-size: 15px;
  color: #a1a1aa;
  margin: 0 0 24px 0;
  line-height: 1.4;
  max-width: 280px;
}

.connect-wallet-btn {
  background: #3b82f6;
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 16px 32px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
}

[hidden] {
  display: none;
}

.nft-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

.profile-view {
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.profile-user {
  display: flex;
  align-items: center;
  background: #1c1c1e;
  padding: 8px 16px;
  border-radius: 99px;
  gap: 8px;
  cursor: pointer;
}

.profile-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff7e5f, #feb47b);
}

.profile-user span {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.profile-user img.chevron {
  width: 12px;
  height: 12px;
  filter: invert(1);
}

.menu-btn {
  background: #1c1c1e;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-btn img {
  filter: invert(1);
}

.balance-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.balance-card {
  flex: 1;
  background: transparent;
  border: 1px solid #2c2c2e;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.balance-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ton-icon-wrap {
  background: transparent;
}

.ton-icon-wrap img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.gems-icon-wrap {
  background: transparent;
}

.gems-icon-wrap img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.balance-info {
  display: flex;
  flex-direction: column;
}

.balance-amount {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.balance-dot {
  color: #8e8e93;
}

.balance-usd {
  font-size: 13px;
  color: #8e8e93;
  font-weight: 500;
}

.balance-denom {
  font-size: 12px;
  color: #8e8e93;
  font-weight: 500;
  margin-top: 2px;
}

.info-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  filter: invert(0.5);
  cursor: pointer;
}

.profile-tabs-scroll {
  overflow-x: auto;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.profile-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.profile-tabs {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid #2c2c2e;
  padding-bottom: 8px;
  width: max-content;
}

.profile-tab {
  font-size: 15px;
  font-weight: 600;
  color: #8e8e93;
  cursor: pointer;
  padding: 4px 8px;
  position: relative;
}

.profile-tab--active {
  color: #fff;
}

.profile-tab--active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  height: 2px;
  background: #fff;
}

.controls-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  width: 100%;
}

.controls-row-1 {
  display: flex;
  gap: 8px;
  width: 100%;
}

.controls-row-2 {
  display: flex;
  gap: 8px;
  width: 100%;
}

.search-wrap {
  flex: 1;
  background: #1c1c1e;
  border-radius: 14px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 10px;
}

.search-icon {
  width: 18px;
  height: 18px;
  color: #8e8e93;
}

.search-wrap input {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  outline: none;
  width: 100%;
}

.control-btn {
  background: #1c1c1e;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #8e8e93;
  flex-shrink: 0;
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

.filter-toggle-btn {
  width: 44px;
  height: 44px;
}

.dropdown-btn {
  flex: 1;
  background: #1c1c1e;
  border-radius: 14px;
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.dropdown-btn svg {
  width: 16px;
  height: 16px;
  color: #fff;
}

.nft-card-raw {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #1c1c1e;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.nft-card-raw:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.nft-card-raw .nft-lottie,
.nft-card-raw .nft-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

