/* Category Games Section */
.category-games-section {
  padding: 2rem 0;
  background-color: #f5f0ff;
  border-radius: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.category-games-buttons {
  display: flex;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0 1rem;
}

.game-category-btn {
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fce7ec;
  color: #333;
}

.game-category-btn.active {
  background-color: #ff4d79;
  color: white;
}

.game-category-btn:hover:not(.active) {
  background-color: #ffd0dc;
}

/* Games Grid */
.category-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 0 1rem;
  position: relative;
  min-height: 200px;
}

.category-games-grid.loading {
  opacity: 0.6;
}

.category-games-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.category-game-card {
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  background-color: white;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.category-game-card.hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.category-game-thumbnail {
  width: 100%;
  height: 0;
  padding-bottom: 100%; /* 1:1 Aspect Ratio */
  position: relative;
  overflow: hidden;
}

.category-game-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-game-card.hover .category-game-thumbnail img {
  transform: scale(1.05);
}

.category-game-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 2rem;
  color: #ff4d79;
  font-weight: 600;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .category-games-buttons {
    justify-content: center;
    flex-wrap: wrap;
  }

  .category-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .category-games-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .game-category-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
}
