* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Arial", sans-serif;
}

body {
  background-color: #f7f9fc;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.container {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

h1 {
  color: #e74c3c;
  margin-bottom: 1rem;
  font-size: 2.5rem;
}

.instructions {
  margin-bottom: 2rem;
  font-size: 1.2rem;
  color: #555;
}

.stats {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: bold;
}

.game-container {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

#game-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  max-width: 600px;
  width: 100%;
}

.card {
  height: 120px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s;
  cursor: pointer;
  border-radius: 10px;
}

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

.card-front {
  background-color: #e74c3c;
  transform: rotateY(180deg);
}

.card-back {
  background-color: #3498db;
  color: white;
  font-size: 1.5rem;
}

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

.card.matched .card-front {
  background-color: #2ecc71;
}

.chinese-word {
  font-size: 2rem;
  font-weight: bold;
  color: white;
}

.fruit-image {
  width: 80%;
  height: 80%;
  object-fit: contain;
}

button {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #c0392b;
}

#start-game {
  padding: 1rem 2rem;
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

#result {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  z-index: 100;
}

#result h2 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

#result p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.hide {
  display: none !important;
}

@media (max-width: 600px) {
  #game-board {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    height: 100px;
  }

  .chinese-word {
    font-size: 1.5rem;
  }
}
