.fromdev-game-container {
  margin: 0;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background-color: transparent;
}

.game-container {
  width: 90%;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.score-timer {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 1.2rem;
  color: #333;
}

.grid {
  display: grid;
  gap: 20px;
  width: 100%;
  height: 80vh; /* Maximize height of grid */
  max-width: 1000px;
}

.grid.small {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
}

.grid.large {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, 1fr);
}

.card {
  perspective: 1000px;
  width: 100%;
  height: 100%;
  position: relative;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
  transform: rotateY(180deg); /* Initially hide all cards */
}

.card.flipped .card-inner {
  transform: rotateY(0deg); /* Flip to reveal front */
}

.card .front, .card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card .front {
  background: white;
  color: #333;
  font-size: 4rem;
}

.card .back {
  background: linear-gradient(45deg, #ffd3b6, #fdfd96);
  transform: rotateY(180deg);
}

.restart {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: #333;
  margin-top: 10px;
  transition: transform 0.2s;
}

.restart:hover {
  transform: scale(1.1);
}

/* Media Queries */
@media (min-width: 768px) {
  .grid {
    height: 80vh; /* Ensure grid still takes up most of the screen height */
  }
  .grid.large {
    grid-template-columns: repeat(6, 1fr); /* For larger screens, more cards */
    grid-template-rows: repeat(6, 1fr);
  }
}

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