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

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

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

.th__device {
  position: relative;
  width: 152px;
  height: 152px;
  border-radius: 50%;
  overflow: hidden;
  background: #23262c;
  box-shadow: 0 0 0 6px #17191e;
}

.th__window {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 12px;
  height: 62px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, #c97e5a 0%, #ebe1d6 100%);
}

.th__sunwrap {
  position: absolute;
  left: 50%;
  top: 24px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  animation-name: thSunSway;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.th__sun {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle, #f5e6a8 0 58%, rgba(245, 230, 168, 0) 82%);
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.th__mount {
  position: absolute;
  bottom: 14px;
  width: 46px;
  height: 30px;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: #5b6067;
}

.th__mount--l {
  left: -6px;
}

.th__mount--r {
  right: -6px;
  height: 24px;
  background: #43474d;
}

.th__lake {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  background: linear-gradient(180deg, #6d94a8 0%, #52798c 100%);
}

.th__refl {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 9px;
  margin-left: -12px;
  border-radius: 50%;
  background: rgba(245, 230, 168, 0.62);
  animation-name: thShimmer;
  animation-duration: 2s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.th[data-mode=snow] .th__sun {
  transform: translateY(16px);
  opacity: 0.45;
}

.th[data-mode=sun] .th__sun {
  transform: translateY(-8px);
  opacity: 1;
}

.th[data-mode=cloud] .th__sun {
  transform: translateY(4px);
  opacity: 0.7;
}

.th[data-mode=flame] .th__sun {
  transform: translateY(0);
  opacity: 0.85;
}

.th__panel {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  height: 56px;
  border-radius: 16px;
  background: #fff7e6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
  box-sizing: border-box;
}

.th__rowtop {
  display: flex;
  align-items: center;
  gap: 8px;
}

.th__dial {
  position: relative;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #23262c;
  transition: transform 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.th[data-mode=snow] .th__dial {
  transform: rotate(0deg);
}

.th[data-mode=sun] .th__dial {
  transform: rotate(90deg);
}

.th[data-mode=cloud] .th__dial {
  transform: rotate(180deg);
}

.th[data-mode=flame] .th__dial {
  transform: rotate(270deg);
}

.th__dialmark {
  position: absolute;
  left: 50%;
  top: 2px;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  border-radius: 999px;
  background: #3ddc97;
}

.th__temp {
  margin-left: auto;
  padding: 0 8px;
  height: 18px;
  line-height: 18px;
  border-radius: 4px;
  background: #231f28;
  color: #3ddc97;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
}

.th__modes {
  display: flex;
  gap: 4px;
  justify-content: space-between;
}

.th__mode {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(23, 20, 26, 0.08);
  color: #6f7680;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 300ms cubic-bezier(0.2, 0.8, 0.2, 1), background 300ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.th__mode svg {
  width: 15px;
  height: 15px;
  display: block;
}

.th__mode[aria-pressed=true] {
  color: #3ddc97;
  background: rgba(77, 216, 230, 0.16);
}

.th__hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 247, 230, 0.72);
}

@keyframes thSunSway {
  from {
    transform: translateY(0) scale(1);
  }
  to {
    transform: translateY(9px) scale(1.08);
  }
}
@keyframes thShimmer {
  from {
    transform: scaleX(1);
    opacity: 0.4;
  }
  to {
    transform: scaleX(1.8);
    opacity: 1;
  }
}
.th:not(.is-demo) .th__sunwrap {
  animation-name: none;
}

@media (max-width: 340px) {
  .th__device {
    width: 124px;
    height: 124px;
    box-shadow: 0 0 0 4px #17191e;
  }
  .th__window {
    top: 10px;
    height: 50px;
  }
  .th__panel {
    height: 46px;
  }
  .th__dial {
    width: 28px;
    height: 28px;
  }
  .th__hint {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .th__sunwrap, .th__refl {
    animation-name: none !important;
  }
  .th__sun, .th__dial, .th__mode {
    transition: none !important;
  }
}
