body {
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  background-color: #f0f0f0;
}

h1 {
  margin: 20px 0 10px;
  font-size: 2rem;
  text-align: center;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  margin-bottom: 20px;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 420px;
  margin-bottom: 20px;
}

.card {
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.card.flipped,
.card.matched {
  background-color: #4CAF50;
  transform: rotateY(180deg);
}

.card.matched {
  pointer-events: none;
}

.win-message {
  display: none;
  font-size: 1rem;
  background: #4CAF50;
  padding: 20px;
  color: white;
  border-radius: 10px;
  animation: pop 0.5s ease forwards;
  text-align: center;
  max-width: 90%;
}

@keyframes pop {
  from {
    transform: scale(0.5);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ✅ Responsive Breakpoints */
@media (min-width: 600px) {
  h1 {
    font-size: 2.5rem;
  }

  .card {
    font-size: 2.2rem;
  }

  .game-board {
    max-width: 500px;
  }
}

@media (min-width: 768px) {
  .game-board {
    grid-template-columns: repeat(4, 120px);
    gap: 15px;
  }

  .card {
    font-size: 2.5rem;
  }

  .win-message {
    font-size: 1.2rem;
  }
}

@media (min-width: 1024px) {
  .game-board {
    grid-template-columns: repeat(4, 140px);
    gap: 20px;
  }

  .card {
    font-size: 2.8rem;
  }

  .win-message {
    font-size: 1.3rem;
  }
}
