/* Gallery / Showroom Section */
.gallery {
  padding: var(--section-padding);
  position: relative;
  overflow: hidden;
}

.gallery__container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

/* ── Rarity Tiers ── */
.rarity-tier {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.rarity-tier__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.rarity-tier__badge {
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  border: 1px solid;
}

.rarity-tier__count {
  font-family: var(--font-pixel);
  font-size: 0.45rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

/* Common — grey/white */
.rarity-tier__badge--common {
  color: #b0b8c8;
  border-color: rgba(176, 184, 200, 0.3);
  background: rgba(176, 184, 200, 0.08);
  text-shadow: 0 0 10px rgba(176, 184, 200, 0.3);
}

/* Rare — blue */
.rarity-tier__badge--rare {
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.08);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.4);
}

/* Epic — purple */
.rarity-tier__badge--epic {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.08);
  text-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
}

/* Legendary — gold */
.rarity-tier__badge--legendary {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.08);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
  animation: legendaryShimmer 3s ease-in-out infinite;
}

@keyframes legendaryShimmer {
  0%, 100% { text-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
  50% { text-shadow: 0 0 20px rgba(251, 191, 36, 0.8), 0 0 40px rgba(251, 191, 36, 0.3); }
}

/* ── Cards grid ── */
.rarity-tier__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.gallery__card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  transition: all var(--transition-base);
  position: relative;
}

.gallery__card:hover {
  transform: translateY(-6px);
}

/* Hover glow per rarity */
.gallery__card--common:hover {
  border-color: rgba(176, 184, 200, 0.4);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(176, 184, 200, 0.1);
}

.gallery__card--rare:hover {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(34, 197, 94, 0.2);
}

.gallery__card--epic:hover {
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 20px rgba(168, 85, 247, 0.2);
}

.gallery__card--legendary:hover {
  border-color: rgba(251, 191, 36, 0.5);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3), 0 0 25px rgba(251, 191, 36, 0.25);
}

/* Placeholder — will be replaced with real NFT images */
.gallery__placeholder {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.gallery__placeholder::after {
  content: '?';
  font-family: var(--font-pixel);
  font-size: 2rem;
  opacity: 0.15;
}

.gallery__placeholder--common {
  background: linear-gradient(135deg, #1a1f30, #252b3d);
}

.gallery__placeholder--rare {
  background: linear-gradient(135deg, #0f1a33, #162040);
}

.gallery__placeholder--epic {
  background: linear-gradient(135deg, #1a0f2e, #25163d);
}

.gallery__placeholder--legendary {
  background: linear-gradient(135deg, #2a1f0a, #352810);
}

/* Card info */
.gallery__card-info {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gallery__card-name {
  font-family: var(--font-pixel);
  font-size: 0.5rem;
  color: var(--text-muted);
}

.gallery__card-rarity {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}

.gallery__card-rarity--common {
  color: #b0b8c8;
  background: rgba(176, 184, 200, 0.1);
}

.gallery__card-rarity--rare {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.gallery__card-rarity--epic {
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
}

.gallery__card-rarity--legendary {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

/* ── Showroom Modal ── */
.showroom {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.showroom.is-open {
  opacity: 1;
  visibility: visible;
}

.showroom__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
}

.showroom__content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 3rem;
  align-items: center;
  max-width: 900px;
  padding: 2rem;
}

.showroom__car {
  flex: 0 0 400px;
  perspective: 1000px;
}

.showroom__car img {
  width: 100%;
  image-rendering: pixelated;
  animation: turntable 8s ease-in-out infinite;
}

@keyframes turntable {
  0%, 100% { transform: rotateY(-5deg) scale(1); }
  50% { transform: rotateY(5deg) scale(1.02); }
}

.showroom__info {
  flex: 1;
}

.showroom__name {
  font-family: var(--font-pixel);
  font-size: 1rem;
  color: var(--neon-cyan);
  margin-bottom: 1.5rem;
}

.showroom__traits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.showroom__trait {
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.1);
  border-radius: 8px;
  padding: 0.75rem;
}

.showroom__trait-label {
  font-family: var(--font-pixel);
  font-size: 0.4rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.showroom__trait-value {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.showroom__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: all var(--transition-fast);
}

.showroom__close:hover {
  border-color: var(--neon-red);
  color: var(--neon-red);
  box-shadow: var(--glow-red);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .rarity-tier__cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .showroom__content {
    flex-direction: column;
    gap: 1.5rem;
  }

  .showroom__car {
    flex: none;
    max-width: 280px;
  }

  .showroom__traits {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .rarity-tier__cards {
    grid-template-columns: 1fr;
  }
}
