/* Content */
.content {
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.site-footer {
  padding: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--md-on-surface-variant);
}

.site-footer a {
  color: inherit;
  text-decoration: underline;
}

.site-footer a:hover {
  color: var(--md-on-surface);
}

.site-footer-sep {
  margin: 0 8px;
}

.site-footer-approved {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--md-outline);
}

.status {
  color: var(--md-on-surface-variant);
  font-size: 13px;
  margin-bottom: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.card {
  background: var(--md-surface-container-low);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--md-elevation-1);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.card {
  cursor: pointer;
}

.card-sale {
  outline: 2px solid #e53935;
  outline-offset: -2px;
}

.card:hover {
  box-shadow: var(--md-elevation-2);
  transform: translateY(-2px);
}

.card.hidden {
  display: none;
}

.payment-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 20px;
}

.payment-banner-success {
  background: var(--md-success);
  color: #0d2b0d;
}

.payment-banner-fail {
  background: #e53935;
  color: #ffffff;
}

.badge-rarity.rarity-common {
  background: #3a3a3a;
  color: #e0e0e0;
}

.badge-rarity.rarity-uncommon {
  background: #2196f3;
  color: #ffffff;
}

.badge-rarity.rarity-rare {
  background: #9c27b0;
  color: #ffffff;
}

.badge-rarity.rarity-epic {
  background: #e53935;
  color: #ffffff;
}

.badge-rarity.rarity-legendary {
  background: #ffc107;
  color: #2b2100;
}

.badge-rarity.rarity-mythic {
  background: #e91e63;
  color: #ffffff;
}

/* A soft glow behind the item's picture, tinted by rarity — rises from the
   bottom edge of the icon area, same colors as the rarity badge above. The
   plain background moved here from profile.css's shared .card-icon rule (kept
   as the fallback for the transaction-history icons profile.css still owns). */
.card-icon-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}

.card-icon-wrap .card-icon {
  display: block;
  position: relative;
  z-index: 1;
  background: transparent;
}

.card-icon-glow {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--md-surface-container-high);
  pointer-events: none;
}

.card-icon-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--rarity-glow, transparent) 0%, transparent 75%);
}

.card[data-rarity="Common"] .card-icon-glow {
  --rarity-glow: rgba(160, 160, 160, 0.5);
}

.card[data-rarity="Uncommon"] .card-icon-glow {
  --rarity-glow: rgba(33, 150, 243, 0.55);
}

.card[data-rarity="Rare"] .card-icon-glow {
  --rarity-glow: rgba(156, 39, 176, 0.55);
}

.card[data-rarity="Epic"] .card-icon-glow {
  --rarity-glow: rgba(229, 57, 53, 0.55);
}

.card[data-rarity="Legendary"] .card-icon-glow {
  --rarity-glow: rgba(255, 193, 7, 0.6);
}

.card[data-rarity="Mythic"] .card-icon-glow {
  --rarity-glow: rgba(233, 30, 99, 0.65);
}

/* The top rarity tier gets a light pulse — everything else stays still. */
@keyframes mythic-glow-pulse {
  0%,
  100% {
    opacity: 0.7;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.12);
  }
}

.card[data-rarity="Mythic"] .card-icon-glow::after {
  transform-origin: bottom;
  animation: mythic-glow-pulse 2.4s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .card[data-rarity="Mythic"] .card-icon-glow::after {
    animation: none;
  }
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--md-primary);
}

.card-price-was {
  font-size: 12px;
  font-weight: 400;
  color: var(--md-on-surface-variant);
  text-decoration: line-through;
}

.card-price-sale {
  color: #e53935;
}

.card-add-btn {
  appearance: none;
  cursor: pointer;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--md-primary);
  color: var(--md-on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-add-btn svg {
  width: 18px;
  height: 18px;
}

.card-add-btn:hover {
  filter: brightness(1.08);
}

.card-add-wrap {
  position: relative;
  flex-shrink: 0;
}

.card-add-qty {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--md-on-primary);
  color: var(--md-primary);
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
}

.card-add-qty:empty {
  display: none;
}

.fly-to-cart {
  position: fixed;
  z-index: 30;
  border-radius: 50%;
  object-fit: cover;
  background: var(--md-surface-container-high);
  pointer-events: none;
}

@keyframes cart-fab-bump {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.cart-fab-bump {
  animation: cart-fab-bump 0.26s ease;
}

@media (max-width: 720px) {
  .topbar {
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 12px;
  }

  .topbar-title,
  .account-pill {
    flex-shrink: 0;
  }

  .cart-fab {
    right: 16px;
    bottom: 16px;
  }

  .support-fab {
    left: 16px;
    bottom: 16px;
  }

  .brand-fog {
    font-size: 20px;
  }

  .brand-shop {
    font-size: 13px;
    padding: 2px 8px;
  }

  .search-field {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    padding: 0 10px;
    gap: 6px;
  }

  .search-field input {
    min-width: 0;
  }

  .content {
    padding: 16px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .card {
    padding: 10px;
  }

  .card-icon {
    aspect-ratio: 2 / 1;
  }
}
