body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #fc1e8a;
  user-select: none;
}

.container {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 60px;
  gap: 30px;
  background: linear-gradient(
    325deg,
    #03001e 0%,
    #7303c0 30%,
    #ec38bc 50%,
    #7303c0 70%,
    #03001e 100%
  );
  border-radius: 20px;
  box-shadow: 0 0 50px 16px rgba(20,20,20,50%);
}

h2 {
  font-size: 3em;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.reset {
  padding: 20px 25px;
  margin-top: 10px;
  width: 100%;
  color: #000;
  background-color: #fff;
  box-shadow: 0 0 20px 5px rgba(20,20,20,50%);
  border: none;
  border-radius: 20px;
  font-size: 1.5em;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  font-weight: 600;
}

.reset:focus {
  color: #ec38bc;
  background-color: #262809;
}

.game {
  width: 430px;
  height: 430px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  transform-style: preserve-3d;
  perspective: 500px;
}

.item {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #fff;
  font-size: 3em;
  transform: rotateY(180deg);
  transition: 0.25s;
  border-radius: 10px;
  box-shadow: 0 0 7px 1px rgba(20,20,20,50%);
}

.item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}


.item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #202020;
  transition: 0.25s;
  transform: rotateY(0deg);
  backface-visibility: hidden;
  border-radius: 10px;
}

.item.boxOpen {
  transform: rotateY(0deg);
}

.boxOpen::after,
.boxMatch::after {
  transform: rotateY(180deg);
}

.win {
  display: none;
  text-align: center;
  width: 500px;
  height: 400px;
  padding: 60px;
  background-color: #fff;
  box-shadow: 0 0 40px 10px rgba(20,20,20,50%);
  border-radius: 40px;
}

h1 {
  padding: 10px;
}

@media screen and (max-width: 420px) {
  .container {
    width: 350px;
    height: 655px;
    
  }
  .game {
    width: 350px;
    padding: 20px;
  }
  .item, .item img {
    width: 70px;
    height: 70px;
  }
  .win {
    width: 350px;
    height: 500px;
  }
  h2 {
    font-size: 1.6rem;
  }
}

