.game-card.minecraft {
  background-image: url("../images/games/minecraft.png");
}

.game-card.nes {
  background-image: url("../images/gba.png");
}

/* Games page */
#searchBar {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  border-radius: 10px;
  border: none;
  margin-bottom: 2rem;
  margin-top: 2rem;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.games-grid {
  display: flex;
  flex-wrap: wrap;
  grid-template-columns: repeat(auto-fit, minmax(260px, auto));
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
  justify-content: center;
}

.game-card {
  position: relative; /* add this */
  background: rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  aspect-ratio: 2 / 1;
  overflow: hidden; /* ensures overlay doesn't spill out */
  padding: 1rem 1rem 2rem; /* extra bottom padding for text */
  display: flex;
  flex-direction: column;
  justify-content: center; /* center text vertically */
  max-width: 506px;
}

.game-card h3 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.game-card p {
  font-size: 1.25rem;
  line-height: 1.4rem;
  margin-bottom: 0.5rem;
}

.game-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  z-index: 0;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-card * {
  position: relative;
  z-index: 1;
}

.status-indicator {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: bold;
  z-index: 2; /* above overlay */
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: gray; /* default color */
}

.status-indicator.online .status-dot {
  background: #4caf50; /* green */
}

.status-indicator.offline .status-dot {
  background: #f44336; /* red */
}

.play-btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 111, 0, 0.9);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.3s;
}

.play-btn:hover {
  background: rgba(255, 87, 34, 1);
}

/* Responsive */
@media (max-width: 768px) {
  .game-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  .game-card p {
    font-size: 0.75rem;
    line-height: 1.4rem;
    margin-bottom: 0.5rem;
  }

  .status-indicator {
    font-size: 0.5rem;
  }

  .play-btn {
    font-size: 0.75rem;
  }

  .subtitle {
    padding: 0.25rem;
  }
}
