* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', sans-serif;
}

body {
  background: #0f172a;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.game-container {
  text-align: center;
}

.stats {
  margin: 15px 0;
  font-size: 1.2em;
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  grid-gap: 15px;
  justify-content: center;
}

.card {
  width: 80px;
  height: 80px;
  background: #1e293b;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  cursor: pointer;
  transform: rotateY(0deg);
  transition: transform 0.4s;
  perspective: 1000px;
  position: relative;
}

.card.flipped {
  background: #38bdf8;
}

.card .front,
.card .back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card .back {
  transform: rotateY(180deg);
}

.card.flipped .front {
  transform: rotateY(180deg);
}

.card.flipped .back {
  transform: rotateY(0deg);
}

#restart {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 1em;
  background: #38bdf8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s ease;
}

#restart:hover {
  background: #0ea5e9;
}

#win-popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #1e293b;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  z-index: 10;
}

#win-popup.hidden {
  display: none;
}
