/* «Инвентарь» in the profile sheet, and "У вас в инвентаре" on the item card. */
.inventory-box {
  margin-bottom: 20px;
}

.inv-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: none;
}

.inv-chips::-webkit-scrollbar {
  display: none;
}

.inv-chips .chip {
  flex-shrink: 0;
  white-space: nowrap;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.inv-tile {
  appearance: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 6px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  color: inherit;
  text-align: center;
  background: linear-gradient(to top, var(--inv-glow, transparent) 0%, transparent 70%), var(--md-surface-container-highest);
}

button.inv-tile {
  cursor: pointer;
  transition: filter 0.15s ease;
}

button.inv-tile:hover {
  filter: brightness(1.1);
}

.inv-tile[data-rarity="Common"] { --inv-glow: rgba(160, 160, 160, 0.35); }
.inv-tile[data-rarity="Uncommon"] { --inv-glow: rgba(33, 150, 243, 0.4); }
.inv-tile[data-rarity="Rare"] { --inv-glow: rgba(156, 39, 176, 0.4); }
.inv-tile[data-rarity="Epic"] { --inv-glow: rgba(229, 57, 53, 0.4); }
.inv-tile[data-rarity="Legendary"] { --inv-glow: rgba(255, 193, 7, 0.45); }
.inv-tile[data-rarity="Mythic"] { --inv-glow: rgba(233, 30, 99, 0.5); }

.inv-icon {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.inv-count {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: var(--md-primary);
  color: var(--md-on-primary);
}

.inv-name {
  width: 100%;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-owned {
  font-size: 13px;
  font-weight: 500;
  color: var(--md-success);
  margin: -6px 0 12px;
}

.sheet-owned-none {
  color: var(--md-on-surface-variant);
  font-weight: 400;
}
