#inventory-screen.screen.active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 0 !important;
  --inventory-selection-space: 0px;
}

#inventory-screen .inventory-layout.redesign-inventory-layout {
  display: grid;
  gap: 14px;
  align-content: start;
  padding-top: 78px;
  padding-bottom: calc(var(--inventory-selection-space) + var(--nav-h) + 18px + var(--safe-bottom));
}

#inventory-screen .compact-inventory-hero,
#inventory-screen .compact-inventory-card {
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(78, 129, 232, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(10, 21, 52, 0.96), rgba(6, 13, 33, 0.985));
  border: 1px solid rgba(108, 143, 220, 0.14);
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 0 1px rgba(108, 143, 220, 0.03);
}

#inventory-screen .compact-inventory-hero {
  width: 100%;
  padding: 14px;
}

#inventory-screen .compact-inventory-balance-card {
  display: grid;
  gap: 12px;
}

#inventory-screen #giftInventorySummary {
  min-height: 40px;
  width: max-content;
  max-width: 100%;
  padding: 0 14px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(11, 23, 58, 0.96), rgba(7, 15, 37, 0.98));
  border: 1px solid rgba(103, 137, 214, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  color: #f4f7ff;
  font-size: 18px;
  font-weight: 1000;
  white-space: nowrap;
}

#inventory-screen .compact-inventory-actions {
  display: flex;
  width: 100%;
}

#inventory-screen .compact-inventory-actions .ton-btn {
  min-height: 48px;
  width: 100%;
  border-radius: 16px;
  font-weight: 900;
}

#inventory-screen .compact-inventory-card {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 12px;
  padding-bottom: 12px;
}

#inventory-screen #giftWithdrawNotice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

#inventory-screen #giftWithdrawNotice.hidden {
  display: none !important;
}

#inventory-screen .inventory-withdraw-item {
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#inventory-screen .inventory-withdraw-title {
  color: #f4f7ff;
  font-size: 15px;
  font-weight: 900;
}

#inventory-screen .inventory-withdraw-text,
#inventory-screen .inventory-gift-timer {
  margin-top: 4px;
  color: rgba(225, 236, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

#inventory-screen .inventory-card {
  min-height: 320px;
  margin-bottom: 12px;
}

#inventory-screen .inventory-empty-state {
  min-height: 220px;
  padding: 18px 14px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  background:
    radial-gradient(circle at top right, rgba(78, 129, 232, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(10, 21, 52, 0.72), rgba(6, 13, 33, 0.86));
  border: 1px solid rgba(108, 143, 220, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#inventory-screen .inventory-empty-title {
  color: #f4f7ff;
  font-size: 28px;
  font-weight: 1000;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

#inventory-screen .inventory-empty-state .list-meta {
  max-width: 320px;
  margin: 0 auto;
  color: rgba(225, 236, 255, 0.68);
  line-height: 1.42;
}

#inventory-screen #giftInventory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  padding-bottom: 0;
}

#inventory-screen #giftInventory.hidden {
  display: none !important;
}

#inventory-screen .inventory-gift-card.inventory-gift-tile {
  min-width: 0;
  cursor: pointer;
}

#inventory-screen .inventory-gift-card.inventory-gift-tile.is-active {
  border-radius: 18px;
}

#inventory-screen .inventory-gift-main {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#inventory-screen .inventory-gift-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(95, 146, 255, 0.12), transparent 56%),
    linear-gradient(180deg, rgba(11, 23, 58, 0.96), rgba(7, 15, 37, 0.98));
  border: 1px solid rgba(103, 137, 214, 0.14);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#inventory-screen .inventory-gift-card.inventory-gift-tile.is-active .inventory-gift-visual {
  border-color: rgba(255, 194, 91, 0.54);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 194, 91, 0.14) inset,
    0 0 26px rgba(214, 160, 34, 0.10);
}

#inventory-screen .inventory-gift-image,
#inventory-screen .inventory-gift-fallback {
  width: 100%;
  height: 100%;
  border-radius: 18px;
}

#inventory-screen .inventory-gift-image {
  object-fit: cover;
  display: block;
}

#inventory-screen .inventory-gift-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  color: #f4f7ff;
  font-size: 22px;
  font-weight: 1000;
}

#inventory-screen .inventory-gift-title {
  min-height: 30px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  color: rgba(242, 247, 255, 0.94);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#inventory-screen .inventory-gift-price-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-height: 26px;
  max-width: calc(100% - 12px);
  padding: 5px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 43, 38, 0.90);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  backdrop-filter: blur(8px);
}

#inventory-screen .inventory-selection-bar {
  position: static;
  z-index: auto;
  margin: 0;
  width: 100%;
  max-width: 100%;
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(10, 24, 58, 0.98), rgba(6, 14, 36, 0.995));
  border: 1px solid rgba(255, 214, 102, 0.18);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#inventory-screen .inventory-selection-bar.hidden {
  display: none !important;
}

#inventory-screen .inventory-selection-summary {
  color: rgba(239, 244, 255, 0.88);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

#inventory-screen .inventory-selection-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

#inventory-screen .inventory-selection-btn {
  min-height: 46px;
  padding: 0 16px;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
}

#inventory-screen .inventory-selection-sell-btn {
  background: linear-gradient(135deg, #f0c15d, #d9931d) !important;
  color: #221302 !important;
}

@media (max-width: 640px) {
  #inventory-screen.screen.active {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    touch-action: pan-y !important;
    min-height: 0 !important;
  }

  #inventory-screen .inventory-layout.redesign-inventory-layout {
    padding-top: 86px;
    gap: 12px;
  }

  #inventory-screen .compact-inventory-hero,
  #inventory-screen .compact-inventory-card {
    padding: 12px;
    border-radius: 22px;
  }

  #inventory-screen .compact-inventory-balance-card {
    flex-direction: column;
    align-items: stretch;
  }

  #inventory-screen #giftWithdrawNotice {
    grid-template-columns: 1fr;
  }

  #inventory-screen #giftInventory {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  #inventory-screen .inventory-card {
    min-height: 280px;
  }

  #inventory-screen .inventory-empty-state {
    min-height: 196px;
    padding: 16px 12px;
    border-radius: 20px;
  }

  #inventory-screen .inventory-empty-title {
    font-size: 24px;
  }

  #inventory-screen .inventory-gift-visual {
    border-radius: 16px;
  }

  #inventory-screen .inventory-gift-image,
  #inventory-screen .inventory-gift-fallback {
    border-radius: 16px;
  }

  #inventory-screen .inventory-selection-bar {
    border-radius: 18px;
  }
}
