* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: sans-serif;
}

body {
  display: flex;
  width: 100%;
  height: 100vh;
  background-color: #6563ff;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.container {
  width: 30%;
  display: flex;
  align-items: center;
  flex-direction: column;
  background-color: rgb(230, 229, 229);
  border-radius: 4px;
  padding: 0 0 10px;
}

.container .wrapper {
  width: 100%;
  height: 400px;
  border-radius: inherit;
  display: grid;
  grid-template: repeat(4, 1fr) / repeat(4, 1fr);
  row-gap: 10px;
  column-gap: 10px;
  padding: 10px;
}

.container .wrapper .box {
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: #6563ff;
  border-radius: inherit;
  cursor: pointer;
  font-weight: 600;
}

.box img {
  width: 30px;
  display: none;
}

.box.active {
  animation: rotate;
  animation-duration: 1s;
  animation-fill-mode: forwards;
  animation-iteration-count: 1;
}

.box.active span {
  display: none;
}

.box.active img {
  display: block;
}

.box.matched {
  pointer-events: none;
}

@keyframes rotate {
  100% {
    transform: rotateY(-180deg);
  }
}

.box.shake {
  animation-name: shake;
  animation-duration: 1s;
  animation-iteration-count: 1;
}

.box.deactive {
  animation: rotateReverse;
  animation-duration: 1s;
  animation-iteration-count: 1;
  animation-delay: 2s;
}

.box.deactive img {
  display: none;
}

.info {
  width: 95%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  background-color: #fff;
}

.info h1 {
  font-size: 18px;
  color: #333;
  display: flex;
  align-items: center;
}

button {
  width: 120px;
  height: 50px;
  background-color: transparent;
  color: #6563ff;
  font-size: 20px;
  border: 1px solid #6563ff;
  outline: none;
  border-radius: 4px;
  cursor: pointer;
}

@keyframes shake {
  0% {
    transform: translateX(-5px);
  }

  10% {
    transform: translateX(5px);
  }

  25% {
    transform: translateX(-5px);
  }

  40% {
    transform: translateX(5px);
  }

  50% {
    transform: translateX(-5px);
  }

  60% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }

  100% {
    transform: translateX(0px);
  }
}

@keyframes rotateReverse {
  100% {
    transform: rotateY(180deg);
  }
}

@media (max-width: 1000px) {
  .container {
    width: 60%;
  }
}

@media (max-width: 450px) {
  .container {
    width: 95%;
  }
}

.load-screen {
  width: 100%;
  height: 100vh;
  background-color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  background-color: rgb(142, 244, 244);
}

.load-screen img {
  width: 100%;
  object-fit: contain;
  object-position: center;
  height: 100vh;
}
