.memory {
  position: absolute;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  top: 50%;
  left: 50%;
  width: 100%;
  max-width: 1400px;
  max-height: 100%;

  /* width: 640px; */
  /* height: 640px; */
  width: 100%;
  height: 100%;
  /* padding-left: 380px; */
  /* padding-right: 380px; */
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  perspective: 1000px;

  background: #060ab2;
  z-index: 5;
}

.memory-card {
  width: calc(25% - 20px);
  height: calc(33.333% - 20px);
  margin: 10px;
  position: relative;
  transform: scale(1);
  transform-style: preserve-3d;
  transition: transform 0.5s;
  border-radius: 20px;
  box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.3);
  background: #1c7ccc;
  align-items: center;
  display: flex;
  justify-content: center;
}

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

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

.front-face,
.back-face {
  width: 100%;
  height: 100%;
  padding: 20px;
  position: absolute;
  border-radius: 20px;
  backface-visibility: hidden;
}

.back-face {
  /* height: auto; */
  width: auto;
  padding-top: 57px;
  padding-bottom: 57px;
  display: flex;
  justify-content: center;
  max-height: fit-content;
}

.blue-background {
  background: #1c7ccc;
}

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

.memoryEnding {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: #abcdef;
  padding: 20px;
}
