body {
  font-family: Arial, sans-serif;
  background-color: #f4f4f4;
  margin: 0;
  padding: 20px;
}

h1 {
  text-align: center;
  color: #333;
}

.game-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 20px;
}

.game {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
  margin: 0 auto;
  perspective: 1000px;
}

.card {
  width: 150px;
  height: 200px;
  margin: 10px;
  cursor: pointer;
  perspective: 1000px;
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

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

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

.card-front {
  background-color: #4a90e2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card-back {
  background-color: #3343d7;
  transform: rotateY(180deg);
  padding: 10px;
  box-sizing: border-box;
}

.sound-card {
  background-color: #e4f0ff;
}

.image-card {
  background-color: #f0ffe4;
}

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

.card.matched .card-inner {
  transform: rotateY(180deg);
  box-shadow: 0 0 10px #a8e6a8, 0 0 20px #a8e6a8;
}

.sound-image {
  max-width: 90%;
  max-height: 120px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.card-type {
  position: absolute;
  bottom: 5px;
  right: 5px;
  font-size: 24px;
}

button {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  font-size: 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #0056b3;
}

/* Style for matched cards */
.matched {
  background-color: #a8e6a8;
  pointer-events: none;
}

.card-logo {
  width: 80%;
  max-height: 80%;
  object-fit: contain;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
