.games-section {
  position: relative;
  padding: 100px 40px;
  overflow: hidden;
}

.games-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.games-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--bg-alt);
  z-index: 0;
}

.games-inner {
  position: relative;
  z-index: 1;
}

.games-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  max-width: 1600px;
  margin: 0 auto;
}

.games-split .games-grid {
  justify-self: end;
}

.games-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 1600px;
  margin: 0 auto;
}

.games-text h2,
.games-text-center h2 {
  font-weight: 700;
  font-size: 42px;
  margin-bottom: 24px;
}

.games-text p,
.games-text-center p {
  font-weight: 400;
  font-size: 24px;
  margin-bottom: 32px;
  line-height: 1.4;
}

.games-text-center {
  text-align: center;
  margin-bottom: 64px;
}

.games-grid {
  display: grid;
  gap: 16px;
}

.games-grid-6 {
  grid-template-columns: repeat(3, minmax(0, 200px));
}

.games-grid-10 {
  grid-template-columns: repeat(5, minmax(0, 200px));
}

.game-card {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: none;
  padding: 0;
  background: none;
  transition: transform 0.3s;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.3),
    0 1px 3px 1px rgba(0, 0, 0, 0.15);
}

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

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.games-btn-center {
  margin-top: 48px;
}

.game-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.game-modal.active {
  display: flex;
}

.game-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.game-modal-content {
  position: relative;
  width: 90%;
  max-width: 1000px;
  height: 80vh;
  background: var(--bg-dark);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.game-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}

.game-modal-title {
  padding: 16px 24px;
  font-size: 20px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-modal-iframe {
  flex: 1;
  width: 100%;
  border: none;
}

@media (max-width: 1600px) {
  .games-split {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .games-split .games-grid {
    justify-self: center;
  }
}

@media (max-width: 768px) {
  .games-split {
    gap: 2rem;
  }
  .games-section {
    padding: 60px 20px;
  }

  .games-text h2,
  .games-text-center h2 {
    font-size: 28px;
  }

  .games-text p,
  .games-text-center p {
    font-size: 16px;
  }

  .games-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }

  .games-grid-10 {
    grid-template-columns: repeat(2, 1fr);
  }

  .game-modal-content {
    width: 95%;
    height: 70vh;
  }
}
