* {
  margin: 0;
}

body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-image: linear-gradient(to top, #dfe9f3 0%, white 100%);
}
.icon-box {
  width: 100px;
  height: 100px;
  position: relative;
}

.box {
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
}

.icon {
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  position: absolute;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% auto;
  backface-visibility: hidden;
}

.icon-up {
  background-image: url('./img/icon-up.png');
}

.icon-back {
  background-image: url('./img/icon-back.png');
}
.icon-back.back {
  transform: rotateX(180deg);
}

.icon-box.toss {
  animation: up-down 1.5s ease-in-out both;
}
.icon-box.toss .box {
  animation: toss 0.6s linear infinite;
}


@keyframes up-down {
  from {
    transform: translateY(0);
  }
  40%,
  70%
   {
    transform: translateY(-240px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes toss {
  from {
    transform: rotateX(0deg);
  }

  to {
    transform: rotateX(1080deg);
  }
}

button {
  margin-top: 40px;
  width: 140px;
  height: 52px;
  border: 0;
  color: #fff;
  border-radius: 4px;
  font-size: 18px;
  background-color: #e67e22;
  cursor: pointer;
  box-shadow: 0 5px 0 0 #d35400;
  transition: all 0.15s linear;
}

button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 0 #d35400;
}

.result {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background-color: #e67e22;
  margin-bottom: 100px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transform: scale(0.1);
  transition: all 0.2s ease-in-out;
}

.result.show {
  opacity: 1;
  transform: scale(1);
}