@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ===== GAME MENU SECTION ===== */
.game-menu {
  font-family: 'Inter', sans-serif;
  max-width: 1000px;
  margin: 0 auto;
  padding: 48px 20px;
}

.game-menu__title {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #111;
  margin-bottom: 18px;
  /* Matches the "EXPLORE BY GENRE" label style in screenshot */
}

/* ===== GENRE GRID ===== */
.genre-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.genre-card {
  border: 1.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  min-height: 80px;
  transition: border-color 0.18s ease,
              background 0.18s ease,
              box-shadow 0.18s ease,
              transform 0.18s ease;
  animation: fadeUp 0.35s ease both;
  user-select: none;
}

@media (max-width: 320px) {
  .genre-card {
    padding: 1px;
  }
}

.genre-card:nth-child(1) { animation-delay: 0.04s; }
.genre-card:nth-child(2) { animation-delay: 0.08s; }
.genre-card:nth-child(3) { animation-delay: 0.12s; }
.genre-card:nth-child(4) { animation-delay: 0.16s; }
.genre-card:nth-child(5) { animation-delay: 0.20s; }
.genre-card:nth-child(6) { animation-delay: 0.24s; }

.genre-card:hover {
  border-color: #cfcfcf;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.genre-card.active {
  background: #111;
  border-color: #111;
  box-shadow: 0 4px 18px rgba(0,0,0,0.18);
}

.genre-card__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.genre-card__label {
  font-size: 0.92rem;
  font-weight: 700;
  color: #111;
  transition: color 0.18s ease;
  z-index: 1;
}

.genre-card.active .genre-card__label {
  color: #fff;
}

/* Controller / category image — right side, like ref screenshot */
.genre-card__img {
  position: absolute;
  right: -6px;
  bottom: -8px;
  height: 145%;
  width: auto;
  max-width: 58%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12));
  transition: transform 0.3s cubic-bezier(.34,1.56,.64,1), filter 0.2s ease;
}

.genre-card:hover .genre-card__img {
  transform: scale(1.08) rotate(-4deg);
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.18));
}

.genre-card.active .genre-card__img {
  filter: drop-shadow(0 4px 14px rgba(255,255,255,0.15)) brightness(1.1);
}

/* ===== GAMES PANEL — below full genre grid ===== */
.games-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.48s cubic-bezier(.77,0,.18,1),
              opacity 0.32s ease;
  margin-top: 0;
}

.games-panel.open {
  max-height: 900px;
  opacity: 1;
  margin-top: 24px;
}

/* Panel header — matches the "Racing" header from screenshot 2 */
.games-panel__header {
  background: #111;
  border-radius: 14px;
  padding: 22px 22px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 14px;
}

.games-panel__header-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.4));
}

/* fallback if no image */
.games-panel__header-emoji {
  font-size: 2.8rem;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.games-panel__text {}

.games-panel__title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 6px;
}

.games-panel__desc {
  font-size: 0.80rem;
  color: rgba(255,255,255,0.60);
  line-height: 1.55;
  max-width: 340px;
}

/* ===== GAMES GRID ===== */
.games-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px;
}
@media (max-width: 600px) {
  .games-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.game-card {
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 2/2;
  position: relative;
  cursor: pointer;
  background: #f3f4f6;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  transition: opacity 0.32s ease,
              transform 0.38s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.2s ease;
}

.games-panel.open .game-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.games-panel.open .game-card:nth-child(1) { transition-delay: 0.10s; }
.games-panel.open .game-card:nth-child(2) { transition-delay: 0.16s; }
.games-panel.open .game-card:nth-child(3) { transition-delay: 0.22s; }
.games-panel.open .game-card:nth-child(4) { transition-delay: 0.28s; }

.game-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 26px rgba(0,0,0,0.13);
}

/* Game cover image */
.game-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.game-card:hover .game-card__img {
  transform: scale(1.04);
}

.game-card__overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, transparent 100%);
  padding: 22px 12px 12px;
}

.game-card__name {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.80rem;
  color: #fff;
  line-height: 1.3;
}

/* ===== ANIMATION ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}