/* Container for the game entries */
.game-container {
  display: grid;
  grid-template-columns: repeat(8, 1fr); /* 8 columns on desktop */
  gap: 10px; /* Space between grid items */
  padding: 20px;
}

.game-entry {
  text-align: center;
}

.game-entry img {
  width: 100%;
  /*Ensureimagesfitwithintheirgridcells*/height: auto;
  transition: transform 0.5s ease;
  -webkit-transition: transform 0.5s ease;
  -moz-transition: transform 0.5s ease;
  -ms-transition: transform 0.5s ease;
  -o-transition: transform 0.5s ease;
  border: 2px solid #ffa500; /* Thin orange border */
}

.game-entry img:hover {
  transform: scale(1.1); /* Zoom effect on hover */
}

/* Responsive grid for smaller screens */
@media only screen and (max-width: 768px) {
  .game-container {
      grid-template-columns: repeat(3, 1fr); /* 3 columns on tablets and small screens */
  }
}

@media only screen and (max-width: 480px) {
  .game-container {
      grid-template-columns: repeat(2, 1fr); /* 2 columns on very small screens */
  }
}

/* Modal styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto; /* Ensure the modal can scroll */
  background-color: rgba(0, 0, 0, 0.8);
  padding-top: 50px; /* Space from the top */
}

/* Modal content styling for desktop */
.modal-content {
  background-color: #1e1e1e;
  color: white;
  margin: auto;
  padding: 20px;
  border-radius: 8px;
  width: 80%;
  max-width: 1000px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  display: flex;
  gap: 20px;
  align-items: flex-start;
  max-height: 80vh;
  overflow-y: auto;
  position: relative; /* Needed for absolute positioning of nav buttons */
}

.modal-content img {
  width: 40%;
  height: auto;
  border-radius: 8px;
}

.modal-text {
  width: 60%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
}

.name {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 10px;
  color: #f39c12;
}

.modal-content p {
  font-size: 0.9em;
  line-height: 1.4;
  margin-bottom: 10px;
}

.modal-content strong {
  color: #f39c12;
}

/* Style for the navigation buttons */
.modal-nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  border: none;
  padding: 30px;
  cursor: pointer;
  font-size: 1.5em;
  border-radius: 50%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  z-index: 2;
   /* Ensure buttons are above other content */:;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
}

#prevButton {
  left: 10px; /* Adjust this value as needed */
}

#nextButton {
  right: 10px; /* Adjust this value as needed */
}

/* Hide buttons on small screens */
@media only screen and (max-width: 768px) {
  .modal-nav-button {
    padding: 10px;
  }
}

/* Close button styling */
.close {
  color: white;
  font-size: 1.6em;
  font-weight: bold;
  cursor: pointer;
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 2; /* Ensure close button is above other content */
}

.close:hover,
.close:focus {
  color: #f39c12;
  text-decoration: none;
}

/* Responsive adjustments for mobile view */
@media only screen and (max-width: 768px) {
  .modal-content {
    flex-direction: column; /* Stack image and content vertically on mobile */
    width: 90%;
    padding: 15px;
  }

  .modal-content img {
    width: 100%; /* Full width for mobile */
    margin-bottom: 15px; /* Space between image and text */
  }

  .modal-text {
    width: 100%;
  }

  .name {
    font-size: 1.3em;
  }

  .modal-content p {
    font-size: 0.85em;
  }

  .close {
    top: 10px;
    right: 10px;
    font-size: 2em;
  }
}
