:root {
  --speed: 350s;
  --track-line: 50000px;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  justify-content: center;
  background-color: #242424;
  font-family: "Arial", sans-serif;
  line-height: 1.4;
}

.btn {
  display: flex;
  color: #fff;
  font-size: 18px;
  text-transform: uppercase;
  padding: 0.6em 1em;
  border-radius: 50px;
  width: 100%;
  justify-content: center;
  align-items: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: 0.25s ease;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.btn--red {
  border: 2px solid #E1110D;
  background: linear-gradient(#D08584 0%, #AA0908 50%, #D50C08 100%);
}
.btn--green {
  border: 2px solid #85BB05;
  background: linear-gradient(#ACB67E 0%, #599504 50%, #6DD104 100%);
}
.btn:active {
  transform: scale(0.95);
}

.modal {
  position: fixed;
  z-index: 55;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  padding: 1rem;
  -webkit-backdrop-filter: blur(5px);
          backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: auto;
  transition: 0.35s ease;
}
.modal-frame {
  padding: 1rem;
  border-radius: 0.5rem;
  font-size: 22px;
  font-weight: 700;
  min-width: 150px;
  background-color: rgba(225, 17, 13, 0.2);
}
.modal-frame::before { content: var(--currency); margin-right: 0.5rem; }
.modal.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.modal-wrap {
  margin: 0 auto;
  position: relative;
  background-color: #fff;
  border-radius: 1rem;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.main {
  display: flex;
  position: relative;
  height: 100%;
  overflow: hidden;
}

.logo {
  max-width: 100px;
}

.game {
  --frame-width: 480px;
  position: fixed;
  top: 0;
  margin: 0 auto;
  max-width: var(--frame-width);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
}
.game.end .plane {
  left: -200px;
}
.game.end .game-footer {
  pointer-events: none;
}
.game.end .game-frame {
  animation-name: none;
}
.game-frame {
  position: absolute;
  height: 100%;
  width: var(--track-line);
  background-size: auto 100%;
  background-image: url(../img/bg.jpg);
  background-repeat: repeat-x;
  will-change: transform;
  display: flex;
  flex-direction: column;
  animation-iteration-count: 1;
  animation-duration: var(--speed);
  animation-fill-mode: both;
  animation-timing-function: linear;
  padding-left: 200px;
}
.game-frame span {
  flex: 1;
  display: flex;
  align-items: center;
}
.game-frame span:nth-child(1) {
  padding-left: 0;
}
.game-frame span:nth-child(2) {
  padding-left: calc(var(--frame-width) / 2);
}
.game-frame span:nth-child(3) .game-obj:first-child {
  margin-left: 0;
}
.game-obj {
  height: 100px;
  width: 100px;
  margin-left: 50vw;
  background-repeat: no-repeat;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, opacity 1s ease;
  transform-origin: center center;
  text-align: center;
  font-weight: 700;
  color: red;
  font-size: 45px;
  margin-left: 300px;
}
.game-obj:first-child {
  margin-left: 0;
}
.game-obj.hide:not(.tnt) {
  pointer-events: none;
  opacity: 0;
  transform: translate(calc(var(--frame-width) / 1.5), -90vh);
}
.game-obj.hide.tnt {
  animation: explosion 0.5s ease forwards;
}
.game-obj.tnt {
  background-size: 80%;
  background-image: url(../img/bmb.svg);
}
.game-obj.money {
  background-size: contain;
  background-image: url(../img/mny.png);
}
.game-obj.multiply::before {
  content: "X" attr(data-count);
}
.game-footer, .game-header {
  padding: 1rem 0.5rem;
  gap: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
}
.game-footer::after, .game-header::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: 100%;
  left: 0;
  height: 1px;
  border-top: 1px solid red;
  border-bottom: 1px solid red;
  background-color: #fff;
  box-shadow: 0 2px 5px red, 0 -2px 5px red;
}
.game-header::after {
  bottom: 0;
}
.game-footer::after {
  top: 0;
}
.game-score {
  display: flex;
  align-items: center;
  text-align: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background-image: linear-gradient(#9C9ACD 0%, #1110AD 50%, #2915CC 100%);
  border: 2px solid #1114DF;
  border-radius: 50px;
}
.game-score::before { content: var(--currency); margin-right: 0.5rem; }
.game-btn {
  display: flex;
  align-items: center;
  position: relative;
  font-size: 1rem;
  border-radius: 50px;
  color: #fff;
  font-weight: 700;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4), 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}
.game-btn i {
  height: 100%;
  aspect-ratio: 1;
  background-color: #fff;
  border-radius: 50px;
  border: 2px solid;
  background-repeat: no-repeat;
  background-size: 70%, auto;
  background-position: center;
}
.game-btn span {
  flex: 1;
  padding: 1rem;
  text-align: center;
}
.game-btn:active {
  transform: scale(0.95);
}
.game-btn--blue {
  background: linear-gradient(#D08584 0%, #AA0908 50%, #D50C08 100%);
}
.game-btn--red {
  border: 2px solid #E1110D;
  background: linear-gradient(#D08584 0%, #AA0908 50%, #D50C08 100%);
}
.game-btn--red i {
  border-color: #7B2727;
  background-image: url("data:image/svg+xml,%3Csvg width='64px' height='64px' viewBox='-4 -4 28.00 28.00' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23000000' transform='rotate(180)'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' stroke='%23CCCCCC' stroke-width='0.04'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M10 18V2m0 0l7 7m-7-7L3 9'%3E%3C/path%3E%3C/g%3E%3C/svg%3E"), radial-gradient(#E90200 0%, #CC0603 100%);
}
.game-btn--green {
  border: 2px solid #85BB05;
  background: linear-gradient(#ACB67E 0%, #599504 50%, #6DD104 100%);
}
.game-btn--green i {
  border-color: #486228;
  background-image: url("data:image/svg+xml,%3Csvg width='64px' height='64px' viewBox='-4 -4 28.00 28.00' xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%23000000'%3E%3Cg id='SVGRepo_bgCarrier' stroke-width='0'%3E%3C/g%3E%3Cg id='SVGRepo_tracerCarrier' stroke-linecap='round' stroke-linejoin='round' stroke='%23CCCCCC' stroke-width='0.04'%3E%3C/g%3E%3Cg id='SVGRepo_iconCarrier'%3E%3Cpath stroke='%23000000' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M10 18V2m0 0l7 7m-7-7L3 9'%3E%3C/path%3E%3C/g%3E%3C/svg%3E"), radial-gradient(#CAE500 0%, #83AF00 100%);
}

.plane {
  position: absolute;
  width: 80px;
  aspect-ratio: 2.5/1;
  z-index: 2;
  left: 10%;
  transform: translateY(-50%);
  will-change: transform;
  transition: top 1s ease, left 3s ease 1s;
}
.plane-elem {
  position: relative;
  height: 100%;
  width: 100%;
  background-image: url(../img/plane.png);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
.plane-elem::after {
  content: "";
  top: -15%;
  position: absolute;
  height: 150%;
  right: -10%;
  aspect-ratio: 0.15/1;
  background-image: url(../img/plane-blade.png);
  background-size: contain;
  background-repeat: no-repeat;
  animation: spin 0.4s linear infinite;
}
.plane.up {
  top: 15%;
}
.plane.middle {
  top: 50%;
}
.plane.down {
  top: 85%;
}

.plane-elem {
  animation-iteration-count: 1;
  animation-duration: 1s;
  animation-fill-mode: both;
  animation-timing-function: ease;
}

@keyframes spin {
  0% {
    transform: rotateX(0deg);
  }
  100% {
    transform: rotateX(360deg);
  }
}
@keyframes planeup {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes planedown {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(20deg);
  }
  100% {
    transform: rotate(0deg);
  }
}
@keyframes move {
  0% {
    transform: translate(0);
  }
  100% {
    transform: translate(calc(-1 * var(--track-line)));
  }
}
@keyframes explosion {
  0% {
    background-image: url(../img/bmb.svg);
  }
  100% {
    background-image: url(../img/bmb2.svg);
  }
}