.games {
  background-color: #1B068C;
  padding: 120px 0 100px;
}

.page-template-template-games .games {
  background-color: #150E54;
}

.games__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.games__title {
  font-family: "Rubik", sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 3.5vw, 42px);
  color: var(--gold);
  text-transform: uppercase;
  text-align: center;
  line-height: 1.15;
}

.games__subtitle {
  font-family: "Roboto", sans-serif;
  font-size: 22px;
  color: var(--white);
  text-align: center;
  margin-top: -24px;
}

.games__grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  width: 100%;
}

.games__card {
  background-color: var(--medium-navy);
  border: 2px solid var(--gold);
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.games__card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(252, 224, 70, 0.25);
}

.games__card-img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}

.games__card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.games__card:hover .games__card-img img {
  transform: scale(1.05);
}

.games__card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(27, 6, 140, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: 14px;
}

.games__card:hover .games__card-overlay {
  opacity: 1;
}

.games__card-overlay span {
  font-family: "Rubik", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.games__card-name {
  font-family: "Roboto", sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--white);
  text-align: center;
  line-height: 1.3;
}

.games__card-stars {
  display: flex;
  gap: 3px;
}

.games__card-stars svg {
  width: 14px;
  height: 14px;
}

.games__card--hidden {
  display: none;
}

.games__toggle {
  font-size: 20px;
  padding: 14px 40px;
}

.game-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.game-modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.game-modal__content {
  position: relative;
  z-index: 1;
  width: 95vw;
  max-width: 1100px;
  height: 85vh;
  background: var(--deep-navy);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
}

.game-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.game-modal__close:hover {
  background: rgba(252, 224, 70, 0.2);
}

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

@media (max-width: 1200px) {
  .games__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .games {
    padding: 80px 0 70px;
  }

  .games__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .games__subtitle {
    font-size: 16px;
    margin-top: -16px;
  }

  .game-modal__content {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    border: none;
  }
}

@media (max-width: 480px) {
  .games__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
