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


  .memory-game {
    width: 80%;
    margin: auto;
    display: flex;
    flex-wrap: wrap;
    perspective: 1000px;
  }

  .memory-card {
    width: calc(25% - 1rem);
    height: calc(33.333% - 1rem);
    margin: 5px;
    position: relative;
    transform: scale(1);
    transform-style: preserve-3d;
    transition: transform .5s;
  }

  .memory-card:active {
    transform: scale(0.97);
    transition: transform .2s;
  }

  .memory-card.flip {
    transform: rotateY(180deg);
  }

  .front-face,
  .back-face {
    width: 100%;
    height: 100%;
    padding: 20px;
    position: absolute;
    border-radius: 5px;
    background: #ccc;
    backface-visibility: hidden;
    top: 0;
    left: 0;
  }

  .front-face {
    transform: rotateY(180deg);
    position: relative;
  }
