/* Games Page Specific Styles */

body {
  margin: 0;
  font-family: 'Lexend', 'Poppins', sans-serif;
  background: var(--cloud);
  color: var(--text);
}

.custom-container {
  width: 1176px;
  margin: 0 auto;
}

.games-section {
  padding: 80px 0;
  background: var(--bright-yellow);
}

.games-section h1 {
  font-family: 'Lexend';
  font-weight: 700;
  font-size: 40px;
  color: var(--title);
  text-align: center;
  margin-bottom: 50px;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 378px);
  gap: 22px;
  /* width: 1178px;
  height: 917.57px;
  left: 372.95px;
  position: relative; */
  justify-content: center;
  justify-items: start;
}

.games-grid .game-card:nth-child(4) {
  grid-column: 2;
  transform: translateX(-200px);
}

.games-grid .game-card:nth-child(5) {
  grid-column: 3;
  transform: translateX(-200px);
}

.game-card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--card-shadow);
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 378px;
  height: 447.79px;
}

.game-card img {
  width: 328px;
  height: 212px;
  opacity: 1;
  object-fit: cover;
  border-radius: 15px;
}

.game-card h3 {
  font-family: 'Lexend';
  font-weight: 700;
  font-size: 23px;
  line-height: 29.95px;
  width: 328px;
  height: 29px;
  text-align: center;
  color: var(--title);
  margin: 0;
}

.game-card p {
  font-family: 'Lexend';
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  width: 328px;
  height: 24px;
  text-align: center;
  vertical-align: middle;
  color: #5A5A5A;
  margin: 0;
  position: relative;
}

.game-card p::after {
  content: '';
  position: absolute;
  top: calc(100% + 20px);
  left: 50%;
  transform: translateX(-50%);
  width: 327px;
  height: 1px;
  background: repeating-linear-gradient(to right, #0091F9 0, #0091F9 3px, transparent 3px, transparent 6px);
}

.download-btn {
  background: url('https://kidsmusicgames.com/wp-content/uploads/2025/12/dowload-button.png') center/cover no-repeat;
  background-color: transparent;
  border: none;
  color: #FFFFFF;
  font-family: 'Lexend';
  font-weight: 500;
  font-size: 20px;
  line-height: 20px;
  text-align: center;
  vertical-align: middle;
  width: 178px;
  height: 60.79px;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 0;
  position: relative;
  z-index: 1;
}

.download-btn:hover {
  opacity: 0.85;
}

.site-footer {
  margin-top: 0;
}

/* Responsive Media Queries for Games Page */

/* Large Desktop (max-width: 1200px) */
@media (max-width: 1200px) {
  .custom-container {
    width: calc(100% - 40px);
    max-width: 1000px;
    padding: 0 20px;
  }

  .games-grid {
    width: 100%;
    max-width: 100%;
    left: auto;
    position: relative;
    margin: 0 auto;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    height: auto;
    justify-items: stretch;
  }

  .games-grid .game-card:nth-child(4),
  .games-grid .game-card:nth-child(5) {
    transform: none;
  }

  .game-card {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
    box-sizing: border-box;
  }

  .game-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 328 / 212;
  }

  .game-card h3,
  .game-card p {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .game-card p::after {
    width: 100%;
    max-width: 100%;
  }
}

/* Tablet (max-width: 1024px) */
@media (max-width: 1024px) {
  .custom-container {
    width: calc(100% - 40px);
    max-width: 100%;
    padding: 0 20px;
  }

  .games-section {
    padding: 60px 0;
  }

  .games-section h1 {
    font-size: 36px;
    margin-bottom: 40px;
  }

  .games-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    justify-items: stretch;
  }

  /* Center the 3rd card (Musical Riddles) - spans both columns but centered */
  .games-grid .game-card:nth-child(3) {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 450px;
    width: 100%;
    margin: 0 auto;
  }

  /* Cards 4 and 5 in the next row */
  .games-grid .game-card:nth-child(4) {
    grid-column: 1;
    transform: none;
  }

  .games-grid .game-card:nth-child(5) {
    grid-column: 2;
    transform: none;
  }

  .game-card {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
    padding: 18px;
    box-sizing: border-box;
  }

  .game-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 328 / 212;
  }

  .game-card h3 {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 21px;
    line-height: 28px;
    margin: 0;
  }

  .game-card p {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 16px;
    line-height: 24px;
  }

  .game-card p::after {
    width: 100%;
    max-width: 100%;
  }

  .download-btn {
    width: 160px;
    height: 55px;
    font-size: 18px;
  }
}

/* Mobile and Small Tablet (max-width: 767px) */
@media screen and (max-width: 767px) {
  .custom-container {
    width: calc(100% - 30px);
    max-width: 100%;
    padding: 0 15px;
  }

  .games-section {
    padding: 50px 0;
  }

  .games-section h1 {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .games-grid {
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
  }

  .games-grid .game-card:nth-child(4),
  .games-grid .game-card:nth-child(5) {
    grid-column: 1;
    transform: none;
  }

  .game-card {
    width: 100%;
    max-width: 400px;
    height: auto;
    min-height: auto;
    padding: 20px;
    box-sizing: border-box;
  }

  .game-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 250px;
    aspect-ratio: 328 / 212;
    object-fit: cover;
  }

  .game-card h3 {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 20px;
    line-height: 26px;
    margin: 0;
  }

  .game-card p {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 15px;
    line-height: 22px;
  }

  .game-card p::after {
    width: 100%;
    max-width: 100%;
  }

  .download-btn {
    width: 150px;
    height: 50px;
    font-size: 17px;
  }
}

/* Small Mobile (max-width: 575px) */
@media (max-width: 575px) {
  .custom-container {
    width: calc(100% - 20px);
    max-width: 100%;
    padding: 0 10px;
  }

  .games-section {
    padding: 40px 0;
  }

  .games-section h1 {
    font-size: 24px;
    margin-bottom: 24px;
  }

  .games-grid {
    width: 100%;
    max-width: 100%;
    gap: 16px;
  }

  .game-card {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: auto;
    padding: 16px;
    gap: 12px;
    box-sizing: border-box;
  }

  .game-card img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 200px;
    aspect-ratio: 328 / 212;
    object-fit: cover;
  }

  .game-card h3 {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 18px;
    line-height: 24px;
    margin: 0;
  }

  .game-card p {
    width: 100%;
    max-width: 100%;
    height: auto;
    font-size: 14px;
    line-height: 20px;
  }

  .game-card p::after {
    width: 100%;
    max-width: 100%;
  }

  .download-btn {
    width: 140px;
    height: 45px;
    font-size: 16px;
    margin-top: 16px;
  }
}