* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}
body {
  background-color: #fdbf00;
  transition: background 1s;
  overflow: hidden;
}

#card,
#console {
  width: 640px;
  height: 400px;
  position: absolute;
  margin: auto;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
}
.card {
  -webkit-perspective: 1200px;
  perspective: 1200px;
  transition: 1s;
  font-family: "Poppins", sans-serif;
}
.card:hover {
  transform: rotate(-5deg);
}
.card:hover .outside {
  transform: rotateY(-130deg);
}
.outside,
.inside {
  height: 100%;
  width: 50%;
  position: absolute;
  left: 50.1%;
}
.inside {
  background: linear-gradient(to right, #e7e7e7, #ffffff 30%);
  line-height: 3;
  padding: 0 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  left: 50%;
}
.outside {
  -webkit-transform-style: preserve-3d;
  transform-style: preserve-3d;
  z-index: 1;
  transform-origin: left;
  transition: 2s;
  cursor: pointer;
}
.front,
.back {
  height: 100%;
  width: 100%;
  position: absolute;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: rotateX(0deg);
}
.front {
  background-color: #ffffff;
}
.back {
  transform: rotateY(180deg);
  background: linear-gradient(to left, #e7e7e7, #ffffff 30%);
}
.cake {
  width: 100%;
  position: absolute;
  bottom: 30px;
}
.top-layer,
.middle-layer,
.bottom-layer {
  height: 80px;
  width: 240px;
  background-repeat: repeat;
  background-size: 60px 100px;
  background-position: 28px 0;
  background-image: linear-gradient(
      transparent 50px,
      #fedbab 50px,
      #fedbab 60px,
      transparent 60px
    ),
    radial-gradient(circle at 30px 5px, #994c10 30px, #fcbf29 31px);
  border-radius: 10px 10px 0 0;
  position: relative;
  margin: auto;
}
.middle-layer {
  transform: scale(0.85);
  top: 6px;
}
.top-layer {
  transform: scale(0.7);
  top: 26px;
}
.candle {
  height: 45px;
  width: 15px;
  background: repeating-linear-gradient(
    45deg,
    #fd3018 0,
    #fd3018 5px,
    #ffa89e 5px,
    #ffa89e 10px
  );
  position: absolute;
  margin: auto;
  left: 0;
  right: 0;
  bottom: 202px;
}
.candle:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  background-color: #ffa500;
  border-radius: 0 50% 50% 50%;
  bottom: 48px;
  transform: rotate(45deg);
  left: -1px;
}
.outside p {
  font-size: 23px;
  text-transform: uppercase;
  margin-top: 30px;
  text-align: center;
  letter-spacing: 6px;
  color: #000046;
}
#present {
  font-size: 120px;
  line-height: 120px;
  cursor: pointer;
  transition: scale ease 1s;
}

#present:hover {
  animation: shake 0.5s;
  animation-iteration-count: infinite;
}

.balloon {
  height: 60px;
  width: 55px;
  background-color: crimson;
  position: absolute;
  top: 40%;
  left: 10%;
  border-radius: 50%;
  animation: move 2s ease-in infinite;
}
.balloon:before {
  content: "";
  height: 60px;
  width: 6px;
  position: absolute;
  background-color: white;
  top: 93%;
  left: 40%;
}

#console {
  display: none;
  font-family: "Inconsolata", monospace;
  color: #00ff35;
  line-height: 1.5;
}

#consoleBody {
  margin: 15px 0;
}

.balloon:nth-child(2) {
  left: 20%;
  top: 40%;
  background-color: yellow;
  animation-duration: 3s;
}
.balloon:nth-child(3) {
  left: 30%;
  top: 40%;
  background-color: lightpink;
  animation-duration: 4s;
}

.balloon:nth-child(4) {
  left: 40%;
  top: 40%;
  background-color: crimson;
  animation-duration: 5s;
}

.balloon:nth-child(5) {
  left: 50%;
  top: 40%;
  background-color: gray;
  animation-duration: 6s;
}

.balloon:nth-child(6) {
  left: 60%;
  top: 40%;
  background-color: orange;
  animation-duration: 2s;
}
.balloon:nth-child(7) {
  left: 70%;
  top: 40%;
  background-color: yellow;
  animation-duration: 7s;
}

.balloon:nth-child(8) {
  left: 80%;
  top: 40%;
  background-color: blue;
  animation-duration: 3s;
}
.balloon:nth-child(9) {
  left: 90%;
  top: 40%;
  background-color: crimson;
  animation-duration: 4s;
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

@keyframes move {
  0% {
    top: 100%;
  }
  100% {
    top: 0%;
  }
}
