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

.wrapper {
  height: 100vh;
  display: flex;
  background-color: #060ab2;
}

.memory-game {
  width: 650px;
  height: 650px;
  margin: auto;
  display: flex;
  /* 
  "flex-direction: row;" and "flex-wrap: wrap;" сombine in "flex-flow: row wrap;"
  */
  flex-flow: row wrap;
  perspective: 1000px;
}

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

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

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

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

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

.game-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 25px;
  color: white;
  background: rgb(6 10 178 / 95%);
}

.game-screen button {
  padding: 15px 30px;
  border: 0;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
}

.game-screen button:hover {
  background-color: #d9d9d9;
}

.hidden {
  display: none;
}
