html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
  touch-action: manipulation;
}

*,
*:before,
*:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
  -webkit-tap-highlight-color: transparent;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

*::-moz-selection {
  background: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

*::selection {
  background: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  font-size: 22px;
  line-height: 1.6;
  color: #222;
  font-family: sans-serif;
  overflow: hidden;
}

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

#wrapper {
  width: 100%;
  height: 100%;
}

#world {
  width: 100%;
  height: 100%;
  background: skyblue;
  overflow: hidden;
  position: relative;
  -webkit-transition: background-color 500ms ease-in-out;
  -moz-transition: background-color 500ms ease-in-out;
  -o-transition: background-color 500ms ease-in-out;
  -ms-transition: background-color 500ms ease-in-out;
  transition: background-color 500ms ease-in-out;
}

#world.rain {
  background: #5f7598;
}

#world.night {
  background: #414d61;
}

.night .enemy {
  filter: grayscale(40%) brightness(50%);
}

.night {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
}

.night_overlay {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 2;
}

#ground {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 40px;
  background: url(./images/ground.png);
  background-size: cover;
  z-index: 1;
}

.night #ground {
  filter: grayscale(40%) brightness(60%);
}

.night #castle::before {
  box-shadow: 0 65px 15px -2px rgba(74, 67, 58, 0.4);
}

.rain #ground {
  filter: grayscale(40%);
}

.snow #ground {
  filter: grayscale(40%) brightness(140%);
}

#hidden {
  display: none;
}

#rotate {
  position: absolute;
  z-index: 99999;
  width: 100%;
  height: 100%;
  padding: 0 40px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  grid-template-columns: 1fr;
  grid-row-gap: 0;
  align-content: center;
  text-align: center;
  display: none;
}

#title_screen,
#level_screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  opacity: 1;
  -webkit-transition: opacity 500ms ease-in-out;
  -moz-transition: opacity 500ms ease-in-out;
  -o-transition: opacity 500ms ease-in-out;
  -ms-transition: opacity 500ms ease-in-out;
  transition: opacity 500ms ease-in-out;
}

#information {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 99;
  opacity: 1;
  font-size: 18px;
  padding: 40px;
  -webkit-transition: opacity 500ms ease-in-out;
  -moz-transition: opacity 500ms ease-in-out;
  -o-transition: opacity 500ms ease-in-out;
  -ms-transition: opacity 500ms ease-in-out;
  transition: opacity 500ms ease-in-out;
  display: none;
  align-content: center;
  text-align: center;
  color: #fff;
  margin-top: 30px;
  grid-template-rows: 50px 40px 30px;
}

.levelStartText {
  font-size: 0.8em;
}

.you_lose {
  font-size: 100px;
  position: absolute;
  z-index: 99999999;
  width: 100%;
  text-align: center;
  top: 80px;
}

.weather {
  z-index: 2;
  opacity: 1;
  -webkit-transition: opacity 500ms ease-in-out;
  -moz-transition: opacity 500ms ease-in-out;
  -o-transition: opacity 500ms ease-in-out;
  -ms-transition: opacity 500ms ease-in-out;
  transition: opacity 500ms ease-in-out;
}

#title_screen.fadeOut,
#information.fadeOut,
.weather.fadeOut,
#level_screen {
  opacity: 0;
  -webkit-transition: opacity 500ms ease-in-out;
  -moz-transition: opacity 500ms ease-in-out;
  -o-transition: opacity 500ms ease-in-out;
  -ms-transition: opacity 500ms ease-in-out;
  transition: opacity 500ms ease-in-out;
}

#level_screen {
  background: rgba(0, 0, 0, 0.8);
  z-index: 9999;
  opacity: 1;
  color: #fff;
  text-align: center;
  display: none;
}

#level_screen h3 {
  font-weight: 400;
}

.level_screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  height: calc(100% - 150px);
  font-size: 18px;
  grid-gap: 20px;
  width: 90%;
  margin-left: 5%;
}

.level_screen > * {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.4);
}

.level_screen span {
  display: block;
  color: gold;
}

#buy_archer {
  display: none;
}

.disabled {
  opacity: 0.4;
}

#gold {
  position: absolute;
  left: 5%;
  top: 5%;
  color: gold;
}

#continue {
  color: skyblue;
  text-align: center;
  margin-top: 1%;
}

.title_screen {
  width: 100%;
  padding: 80px;
  position: relative;
  text-align: center;
}

h1 {
  font-size: 40px;
  color: lightgoldenrodyellow;
  padding: 0;
  margin: 0;
  letter-spacing: 7px;
  text-shadow: 0 2px 0 #fff, 0 4px 0 #d2d2d2, 0 6px 0 #afafaf, 0 8px 0 #c7c7c7;
}

#title_screen h2 {
  color: #444;
  font-weight: 400;
  margin: 8px 0 0;
  padding: 0;
  font-size: 18px;
}

#title_screen h2 a {
  color: #222;
  text-decoration: none;
}

#start_game {
  color: #222;
  margin-top: 22px;
}

#castle_health {
  position: absolute;
  top: 5%;
  right: 5%;
  color: #fff;
  display: none;
  z-index: 9999;
}

.weather {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

/* Rain */
.rain .enemy {
  filter: grayscale(40%) brightness(80%);
}

.rain {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
}

.rain_overlay {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.36);
  z-index: 2;
}

.drop {
  position: absolute;
  bottom: 100%;
  width: 15px;
  height: 120px;
  pointer-events: none;
  animation: drop 0.5s linear infinite;
}

@keyframes drop {
  0% {
    transform: translateY(0vh);
  }
  75% {
    transform: translateY(calc(100vh + 60px));
  }
  100% {
    transform: translateY(calc(100vh + 60px));
  }
}

.stem {
  width: 1px;
  height: 60%;
  margin-left: 7px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0.75)
  );
  animation: stem 0.5s linear infinite;
}

@keyframes stem {
  0% {
    opacity: 1;
  }
  65% {
    opacity: 1;
  }
  75% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.splat {
  width: 15px;
  height: 10px;
  border-top: 2px dotted rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  opacity: 1;
  transform: scale(0);
  animation: splat 0.5s linear infinite;
}

@keyframes splat {
  0% {
    opacity: 1;
    transform: scale(0);
  }
  80% {
    opacity: 1;
    transform: scale(0);
  }
  90% {
    opacity: 0.5;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.5);
  }
}

/* Snow */

.snow .weather {
  pointer-events: none;
  background: none;
  background-image: url("./images/snow1.png"), url("./images/snow2.png"),
    url("./images/snow3.png");
  height: 4700px;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 0;
  -webkit-animation: snow 10s linear infinite;
  -moz-animation: snow 10s linear infinite;
  -ms-animation: snow 10s linear infinite;
  animation: snow 10s linear infinite;
  z-index: 2;
}

.snow .enemy {
  filter: grayscale(40%);
}

.snow_overlay {
  position: absolute;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.1);
  z-index: 2;
}

@keyframes snow {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px;
  }
  50% {
    background-position: 500px 500px, 100px 200px, -100px 150px;
  }
  100% {
    background-position: 500px 1000px, 200px 400px, -100px 300px;
  }
}
@-moz-keyframes snow {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px;
  }
  50% {
    background-position: 500px 500px, 100px 200px, -100px 150px;
  }
  100% {
    background-position: 400px 1000px, 200px 400px, 100px 300px;
  }
}
@-webkit-keyframes snow {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px;
  }
  50% {
    background-position: 500px 500px, 100px 200px, -100px 150px;
  }
  100% {
    background-position: 500px 1000px, 200px 400px, -100px 300px;
  }
}
@-ms-keyframes snow {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px;
  }
  50% {
    background-position: 500px 500px, 100px 200px, -100px 150px;
  }
  100% {
    background-position: 500px 1000px, 200px 400px, -100px 300px;
  }
}

/* Clouds */

.cloud {
  background: #eee;
  background: -moz-linear-gradient(top, #eee 5%, #f1f1f1 100%);
  background: -webkit-gradient(
    linear,
    left top,
    left bottom,
    color-stop(5%, #eee),
    color-stop(100%, #f1f1f1)
  );
  background: -webkit-linear-gradient(top, #eee 5%, #f1f1f1 100%);
  background: -o-linear-gradient(top, #eee 5%, #f1f1f1 100%);
  background: -ms-linear-gradient(top, #eee 5%, #f1f1f1 100%);
  background: linear-gradient(top, #eee 5%, #f1f1f1 100%);
  filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eee', endColorstr='#f1f1f1',GradientType=0 );

  -webkit-border-radius: 100px;
  -moz-border-radius: 100px;
  border-radius: 100px;

  -webkit-box-shadow: 0 8px 5px rgba(0, 0, 0, 0.1);
  -moz-box-shadow: 0 8px 5px rgba(0, 0, 0, 0.1);
  box-shadow: 0 8px 5px rgba(0, 0, 0, 0.1);

  height: 120px;
  position: absolute;
  width: 350px;
}

.cloud:after,
.cloud:before {
  background: #eee;
  content: "";
  position: absolute;
  z-index: -1;
}

.cloud:after {
  -webkit-border-radius: 100px;
  -moz-border-radius: 100px;
  border-radius: 100px;

  height: 100px;
  left: 50px;
  top: -50px;
  width: 100px;
}

.cloud:before {
  -webkit-border-radius: 200px;
  -moz-border-radius: 200px;
  border-radius: 200px;

  width: 180px;
  height: 180px;
  right: 50px;
  top: -90px;
}

.x1 {
  -webkit-animation: animateCloud 120s linear infinite;
  -moz-animation: animateCloud 120s linear infinite;
  animation: animateCloud 120s linear infinite;
  -webkit-transform: scale(0.32);
  -moz-transform: scale(0.32);
  transform: scale(0.32);
  top: 60px;
}

.x2 {
  -webkit-animation: animateCloud 80s linear infinite;
  -moz-animation: animateCloud 80s linear infinite;
  animation: animateCloud 80s linear infinite;
  top: 80px;
  -webkit-transform: scale(0.22);
  -moz-transform: scale(0.22);
  transform: scale(0.22);
}

.x3 {
  -webkit-animation: animateCloud 40s linear infinite;
  -moz-animation: animateCloud 40s linear infinite;
  animation: animateCloud 40s linear infinite;
  bottom: 90px;
  left: 550px;
  -webkit-transform: scale(0.28);
  -moz-transform: scale(0.28);
  transform: scale(0.28);
}

@-webkit-keyframes animateCloud {
  0% {
    margin-left: -440px;
  }
  100% {
    margin-left: 100%;
  }
}

@-moz-keyframes animateCloud {
  0% {
    margin-left: -440px;
  }
  100% {
    margin-left: 100%;
  }
}

@keyframes animateCloud {
  0% {
    margin-left: -440px;
  }
  100% {
    margin-left: 100%;
  }
}

/* Arrow */
.arrow {
  position: absolute;
  z-index: 99;
  width: 2px;
  height: 10px;
  background: #222;
  opacity: 1;
  -webkit-transition: opacity 400ms ease-in-out;
  -moz-transition: opacity 400ms ease-in-out;
  -o-transition: opacity 400ms ease-in-out;
  -ms-transition: opacity 400ms ease-in-out;
  transition: opacity 400ms ease-in-out;
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  -ms-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
}

/* enemies */
.enemy {
  font-size: 26px;
  height: 42px;
  line-height: 1;
  position: absolute;
  z-index: 92;
  cursor: pointer;
  opacity: 1;
  -webkit-transition: opacity 400ms ease-in-out;
  -moz-transition: opacity 400ms ease-in-out;
  -o-transition: opacity 400ms ease-in-out;
  -ms-transition: opacity 400ms ease-in-out;
  transition: opacity 400ms ease-in-out;
  height: 35px;
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  -ms-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  padding: 5px;
}

.enemyFlying::before {
  content: "";
  position: absolute;
  background: whitesmoke;
  width: 17px;
  height: 2px;
  top: 15px;
  left: -10px;
  -webkit-transform-origin: top right;
  -moz-transform-origin: top right;
  -o-transform-origin: top right;
  transform-origin: top right;
  -webkit-transition: all 0.4s ease-in-out;
  -moz-transition: all 0.4s ease-in-out;
  transition: all 0.4s ease-in-out;

  animation: flapL 1s infinite;
}

.enemyFlying::after {
  content: "";
  position: absolute;
  background: whitesmoke;
  width: 17px;
  height: 2px;
  top: 15px;
  right: -10px;
  -webkit-transform-origin: top left;
  -moz-transform-origin: top left;
  -o-transform-origin: top left;
  transform-origin: top left;
  -webkit-transition: all 0.4s ease-in-out;
  -moz-transition: all 0.4s ease-in-out;
  transition: all 0.4s ease-in-out;
  animation: flapR 1s infinite;
}

@keyframes flapL {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  50% {
    -webkit-transform: rotate(50deg);
    -moz-transform: rotate(50deg);
    -o-transform: rotate(50deg);
    transform: rotate(50deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
}

@-webkit-keyframes flapL {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  50% {
    -webkit-transform: rotate(50deg);
    -moz-transform: rotate(50deg);
    -o-transform: rotate(50deg);
    transform: rotate(50deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
}

@keyframes flapR {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  50% {
    -webkit-transform: rotate(-50deg);
    -moz-transform: rotate(-50deg);
    -o-transform: rotate(-50deg);
    transform: rotate(-50deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
}

@-webkit-keyframes flapR {
  0% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  50% {
    -webkit-transform: rotate(-50deg);
    -moz-transform: rotate(-50deg);
    -o-transform: rotate(-50deg);
    transform: rotate(-50deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
    -moz-transform: rotate(0deg);
    -o-transform: rotate(0deg);
    transform: rotate(0deg);
  }
}

.dead {
  opacity: 0;
}

/* Castle */
.castle {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 440px;
  height: 440px;
  position: absolute;
  bottom: -78px;
  right: -196px;
  z-index: 1;
  transform: scale(0.5);
  box-shadow: #222;
}

.castle::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 81px;
  box-shadow: 0 65px 15px -2px rgba(8, 8, 9, 0.4);
  bottom: 12px;
  left: 18px;
  border-bottom-left-radius: 50%;
}

.rain .castle:before {
  height: 81px;
  box-shadow: 0 65px 15px -2px #304311;
}

.castle > div {
  position: absolute;
}
.castle .left-tower,
.castle .main-tower,
.castle .left-tower-roof,
.castle .back {
  background-color: lightgray;
}
.castle .left-tower-roof {
  background-color: grey;
}
.castle .back {
  height: 130px;
  bottom: 0px;
  left: 20px;
  width: 400px;
}
.castle .left-tower {
  width: 120px;
  height: 200px;
  bottom: 0px;
  left: 20px;
}
.castle .main-tower {
  width: 120px;
  height: 300px;
  bottom: 0px;
  left: 160px;
}
.castle .main-tower-roof {
  width: 0px;
  height: 0px;
  bottom: 300px;
  left: 140px;
  border-style: solid;
  border-color: transparent transparent grey transparent;
  border-width: 0px 80px 70px 80px;
}
.castle .left-tower-roof {
  bottom: 180px;
  left: 10px;
  height: 20px;
  width: 140px;
}
.castle .roof-cap {
  bottom: 200px;
  height: 15px;
  width: 30px;
  background-color: grey;
}
.castle .roof-cap.lt-roof-cap-1 {
  left: 10px;
}
.castle .roof-cap.lt-roof-cap-2 {
  left: 65px;
}
.castle .roof-cap.lt-roof-cap-3 {
  left: 120px;
}
.castle .window {
  height: 35px;
  width: 25px;
  background-color: #82948e;
}
.castle .window.w1 {
  bottom: 130px;
  left: 35px;
}
.castle .window.w2 {
  bottom: 60px;
  left: 100px;
}
.castle .window.w3 {
  bottom: 150px;
  left: 180px;
}
.castle .window.w4 {
  bottom: 180px;
  left: 235px;
}
.castle .window.w5 {
  bottom: 120px;
  left: 235px;
}
.castle .window.w6 {
  bottom: 80px;
  left: 315px;
}
.castle .enterance {
  background-color: #74a997;
  bottom: 0px;
  left: 190px;
  width: 60px;
  height: 70px;
  border-radius: 20px 20px 0 0;
}
.castle .main-window {
  background-color: #74a997;
  bottom: 240px;
  left: 195px;
  width: 50px;
  height: 40px;
  border-radius: 20px;
}
