
.home-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Adjusted for better responsiveness with max-width */
  gap: 18px;
}

.game-card-display {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column; /* Ensure vertical alignment of content if more is added */
  align-items: flex-start; /* Align content to start */
  justify-content: flex-end; /* Push title to the bottom */
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  padding: 0;
  max-width: 500px; /* Maximum width for the card */
  width: 100%; /* Allow it to shrink */
  aspect-ratio: 3 / 4; /* Vertical aspect ratio (e.g., portrait) */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-left: auto; /* Center the cards within their grid cells */
  margin-right: auto;
}

.game-card-display:hover {
  transform: translateY(-2px);
  border-color: rgba(182, 89, 255, 0.42);
  background: linear-gradient(180deg, rgba(182, 89, 255, 0.16), rgba(255, 255, 255, 0.04));
}

.game-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  display: flex; /* Use flex to help center image */
  align-items: center; /* Center image vertically */
  justify-content: center; /* Center image horizontally */
}

.game-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center; /* Ensure image is centered */
  display: block;
  transition: transform 0.3s ease;
}

.game-card-display:hover .game-image-wrapper img {
  transform: scale(1.05);
}

.game-image-wrapper h3 {
  position: absolute;
  bottom: 15px;
  left: 15px;
  margin: 0;
  color: var(--text);
  background-color: rgba(0, 0, 0, 0.6);
  padding: 5px 10px;
  border-radius: 5px;
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  z-index: 1;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
}

@media (max-width: 1200px) { /* Adjust grid for medium-large screens */
  .home-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 980px) {
  .home-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* Adjusted for 2 cards on smaller screens */
  }
}

@media (max-width: 720px) {
  .home-grid-4 {
    grid-template-columns: 1fr; /* Single column on very small screens */
  }

  .game-card-display {
    max-width: unset; /* Remove max-width on mobile to allow full width */
  }
}
