* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.game-container {
  max-width: 600px;
  width: 100%;
}

.game-header {
  text-align: center;
  margin-bottom: 20px;
  color: white;
}

.game-header h1 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 1rem;
  background: rgba(255,255,255,0.1);
  padding: 10px 20px;
  border-radius: 10px;
}

.level-info {
  text-align: center;
  color: #c8f7c5;
  font-size: 1.1rem;
  margin-bottom: 15px;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  perspective: 1000px;
}

.card {
  aspect-ratio: 1;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
}

.card.flipped {
  transform: rotateY(180deg);
}

.card.matched {
  animation: matchPulse 0.5s ease;
}

@keyframes matchPulse {
  0%, 100% { transform: rotateY(180deg) scale(1); }
  50% { transform: rotateY(180deg) scale(1.1); }
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2.5rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-front {
  background: linear-gradient(145deg, #4a7c59, #3d6b4a);
  color: white;
}

.card-back {
  background: white;
  transform: rotateY(180deg);
}

.card.matched .card-back {
  background: #c8f7c5;
}

.level-complete, .game-complete {
  text-align: center;
  background: white;
  padding: 25px;
  border-radius: 15px;
  margin-top: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.level-complete h2, .game-complete h2 {
  color: #2d5a3f;
  font-size: 1.5rem;
  margin-bottom: 15px;
}

.level-complete p, .game-complete p {
  color: #555;
  margin: 8px 0;
  font-size: 1rem;
}

.level-complete .reward {
  font-weight: bold;
  color: #4a7c59;
  font-size: 1.2rem;
  margin: 15px 0;
}

#nextLevelBtn {
  margin-top: 15px;
  padding: 12px 30px;
  font-size: 1rem;
  background: #4a7c59;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}

#nextLevelBtn:hover {
  background: #3d6b4a;
  transform: scale(1.05);
}
