html,
body {
  margin: 0;
  padding: 0;
  background-color: black;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
}

#wrapper {
  overflow: hidden;
  /* width: 800px;
  height: 600px; */
  width: 100dvw;
  height: 100dvh;
  position: relative;
  margin: 0 auto;
}

#moon {
  position: absolute;
  left: 100px;
  top: 50px;
  background-image: url("./img/moon.png");
  background-size: cover;
  animation: moon-move 600s linear infinite;
  aspect-ratio: 1 / 1;
  width: calc(96 / 600 * 100dvh);
}

@keyframes moon-move {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(100dvw + 240px));
  }
}

.tree {
  position: absolute;
  bottom: 0;
  background-image: url("./img/tree.png");
  background-size: cover;
  width: calc(294 / 600 * 100dvh * 226 / 294);
  aspect-ratio: 226 / 294;
}

#santa {
  position: absolute;
  z-index: 99;
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: nowrap;
  left: 0px;
}

#sled {
  /* width: 226px;
  height: 50px; */
  aspect-ratio: 226 / 50;
  width: calc(226 / 800 * 100dvh);
  background: url("./img/santa_a.png") no-repeat 0px 1px;
  background-size: contain;
}

.sled_alt {
  background-image: url("./img/santa_b.png") !important;
}

#message {
  display: none;
  position: relative;
  color: #00ff00;
  background-color: red;
  height: calc(23 / 600 * 100dvh);
  padding: 0 16px;
  font-weight: bold;
  font-style: italic;
  font-size: calc(18 / 600 * 100dvh);
  align-items: center;
  align-self: center;
  white-space: nowrap;
  flex-shrink: 0;
}

#rope {
  display: none;
  width: 22px;
  height: calc(23 / 600 * 100dvh);
  background: url("./img/rope.png") no-repeat -22px;
  image-rendering: pixelated;
  align-self: center;
}

#santa.reverse {
  flex-direction: row;
}
#santa.reverse #sled,
#santa.reverse #rope {
  transform: scaleX(-1);
}

#santa.showMessage #rope,
#santa.showMessage #message {
  display: flex;
}

.snow {
  position: absolute;
  aspect-ratio: 1;
  height: calc(2 / 600 * 100dvh);
  background-color: white;
  image-rendering: pixelated;
  top: -5px; /* start above screen */
  left: 50%;
  animation: fall 3s linear infinite;
  z-index: 100;
}

.snow-md,
.snow-lg {
  aspect-ratio: 1 /1;
  height: calc(3 / 600 * 100dvh);
  background: linear-gradient(black, black) top left,
    linear-gradient(black, black) top right,
    linear-gradient(black, black) bottom left,
    linear-gradient(black, black) bottom right, white;

  background-size: calc(1 / 600 * 100dvh) calc(1 / 600 * 100dvh);
  background-repeat: no-repeat;
}

.snow-lg {
  aspect-ratio: 1 / 1;
  height: calc(4 / 600 * 100dvh);
}

@keyframes fall {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(110dvh);
  }
}

#ground {
  position: absolute;
  bottom: 0;
  background-color: #5f5f5f;
  width: 100dvw;
  height: 20dvh;
}
