html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ffd23f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.hs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100%, 300px);
}

.hs__scene {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 150px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #d6e4eb 0%, #e8f6fb 100%);
}

.hs__skynight {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, #1d2340 0%, #3a2f55 100%);
  animation-name: hsCycle;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.hs__star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff7e6;
}

.hs__star--a {
  left: 12%;
  top: 14%;
}

.hs__star--b {
  left: 30%;
  top: 8%;
}

.hs__star--c {
  left: 22%;
  top: 26%;
}

.hs__moon {
  position: absolute;
  left: 78%;
  top: 10%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff7e6;
  box-shadow: inset -4px 0 0 rgba(23, 20, 26, 0.18);
}

.hs__sun {
  position: absolute;
  left: 8%;
  top: 12%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffd23f 0 55%, rgba(255, 210, 63, 0) 78%);
  animation-name: hsSun;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.hs__cloud {
  position: absolute;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
}

.hs__cloud--a {
  left: 58%;
  top: 18%;
  width: 34px;
}

.hs__cloud--b {
  left: 44%;
  top: 30%;
  width: 22px;
}

.hs__ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 16px;
  background: #3f7a52;
}

.hs__house {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 150px;
  height: 112px;
  margin-left: -75px;
}

.hs__roof {
  position: absolute;
  left: -4px;
  right: -4px;
  top: 18px;
  height: 30px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: repeating-linear-gradient(48deg, #c68c8c 0 8px, #b76e6e 8px 16px);
}

.hs__gable {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 46px;
  height: 34px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #c8b190;
}

.hs__chimney {
  position: absolute;
  right: 26px;
  top: 0;
  width: 12px;
  height: 36px;
  border-radius: 4px 4px 0 0;
  background: repeating-linear-gradient(0deg, #ff4d1f 0 6px, #a46651 6px 12px);
}

.hs__smoke {
  position: absolute;
  right: 28px;
  top: -8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 247, 230, 0.8);
  animation-name: hsSmoke;
  animation-duration: 2s;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
  animation-fill-mode: both;
}

.hs__smoke--2 {
  animation-delay: 660ms;
}

.hs__smoke--3 {
  animation-delay: 1320ms;
}

.hs__wall {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 80px;
  bottom: 0;
  border-radius: 0 0 4px 4px;
  background: #d2c0a5;
}

.hs__win {
  position: absolute;
  border: 3px solid #fff7e6;
  box-sizing: border-box;
  border-radius: 4px;
  background: #bfe3f2;
  transition: background 600ms ease-out, box-shadow 600ms ease-out;
}

.hs__win--round {
  left: 50%;
  top: 58px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 50%;
}

.hs__win--l {
  left: 18px;
  top: 88px;
  width: 20px;
  height: 16px;
}

.hs__win--r {
  right: 18px;
  top: 88px;
  width: 20px;
  height: 16px;
}

.hs.is-night .hs__win {
  background: #ffd23f;
  box-shadow: 0 0 12px rgba(255, 210, 63, 0.8);
}

.hs__door {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 18px;
  height: 20px;
  margin-left: -9px;
  border-radius: 4px 4px 0 0;
  background: #7c5a3e;
}

.hs__step {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 4px;
  margin-left: -14px;
  border-radius: 4px;
  background: #c98d54;
}

.hs__bush {
  position: absolute;
  bottom: 0;
  width: 22px;
  height: 14px;
  border-radius: 999px;
  background: #2f5a3c;
}

.hs__bush--l {
  left: -16px;
}

.hs__bush--r {
  right: -16px;
}

.hs__btn {
  box-sizing: border-box;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: #0a4fe8;
  color: #fff7e6;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
}

@keyframes hsCycle {
  0%, 30% {
    opacity: 0;
  }
  52%, 78% {
    opacity: 1;
  }
  90%, 100% {
    opacity: 0;
  }
}
@keyframes hsSun {
  0%, 26% {
    transform: translateY(0);
    opacity: 1;
  }
  40%, 82% {
    transform: translateY(22px);
    opacity: 0;
  }
  92%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes hsSmoke {
  0% {
    transform: translateY(0) scale(0.6);
    opacity: 0;
  }
  22% {
    opacity: 0.85;
  }
  86%, 100% {
    transform: translateY(-30px) scale(1.5);
    opacity: 0;
  }
}
.hs:not(.is-demo) .hs__skynight,
.hs:not(.is-demo) .hs__sun {
  animation-name: none;
}

.hs:not(.is-demo) .hs__skynight {
  transition: opacity 600ms ease-out;
}

.hs:not(.is-demo) .hs__sun {
  transition: transform 600ms ease-out, opacity 600ms ease-out;
}

.hs.is-night .hs__skynight {
  opacity: 1;
}

.hs:not(.is-demo).is-night .hs__sun {
  transform: translateY(22px);
  opacity: 0;
}

@media (max-width: 340px) {
  .hs__scene {
    height: 118px;
  }
  .hs__house {
    transform-origin: bottom center;
    transform: scale(0.82);
  }
  .hs__btn {
    padding: 4px 12px;
    font-size: 11px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hs__skynight, .hs__sun, .hs__smoke {
    animation-name: none !important;
  }
  .hs:not(.is-demo) .hs__skynight,
  .hs:not(.is-demo) .hs__sun,
  .hs__win {
    transition: none !important;
  }
}
