.memory-card {
  width: 120px;
  height: 120px;
  perspective: 1000px;
}


.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform 0.5s;
  transform-style: preserve-3d;
}

.memory-card.flip .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  backface-visibility: hidden;
  border-radius: 8px;
  font-size: 2rem;
  font-weight: bold;
}

.card-front {
  background-color: #f5a623;
  color: rgb(0, 0, 0);
  transform: rotateY(180deg);
}

.card-back {
  background-color: #4a90e2;
  color: rgb(0, 0, 0);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(4, 120px);
  gap: 12px;
  justify-content: center;
}

.card {
  width: 120px;
  height: 120px;
}

.memory-card.matched .card-front {
  background-color: #2ecc71; /* 緑 */
  color: white;
}

#restart {
  margin: 16px auto;
  padding: 8px 16px;
  font-size: 1rem;
  cursor: pointer;
}
