/* mosaic-reset: uiverse 컴포넌트 공통 전제 (box-sizing + 기본 sans-serif) */
*, *::before, *::after { box-sizing: border-box; }
:where(body) { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

:root {
  --glass-bg: rgba(10, 10, 10, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow-color: #00a2fa;
  --tick-base-height: 10px;
  --tick-inactive-color: #646464;
  --tick-active-color: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  background: #000;
  color: #fff;
  overflow: hidden;
  font-family: "Inter", system-ui, sans-serif;
}

#app {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.thermostat {
  position: relative;
  width: 1040px;
  height: 150px;
  border-radius: 999px;
  overflow: visible;
}

.thermostat-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: visible;
}

.thermostat-inner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.1);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.glass-noise {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0.08;
  mix-blend-mode: overlay;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.blur-circle {
  position: absolute;
  inset: -160px;
  border-radius: 50%;
  filter: blur(187px);
  opacity: 0.25;
  background: var(--glow-color);
  z-index: 0;
}

.track {
  position: absolute;
  top: 50%;
  left: 46px;
  right: 46px;
  transform: translateY(-50%);
  height: 42px;
  border-radius: 999px;
  background: radial-gradient(circle at 0% 50%,
      rgba(255, 255, 255, 0.35) 0,
      transparent 55%),
    radial-gradient(circle at 100% 50%,
      rgba(0, 0, 0, 1) 0,
      rgba(0, 0, 0, 0.9) 70%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.8));
  background-blend-mode: screen, normal, soft-light;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 1), 0 0 18px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.mercury {
  position: absolute;
  top: -45%;
  left: 0;
  height: 190%;
  width: 0%;
  background: var(--glow-color);
  filter: url(#turbulent-displace);
  mix-blend-mode: screen;
  box-shadow: 0 0 45px var(--glow-color), 0 0 90px var(--glow-color);
  transition: width 0.12s linear, box-shadow 0.3s ease, background 0.25s ease;
  opacity: 0.95;
}

.mercury::before,
.mercury::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  filter: blur(6px);
  background: radial-gradient(circle at 50% 50%,
      rgba(255, 255, 255, 0.3),
      transparent 90%);
  mix-blend-mode: color-dodge;
  opacity: 0.25;
  animation: pulseElectric 3s infinite ease-in-out alternate;
}

.mercury::after {
  filter: blur(16px);
  opacity: 0.18;
  animation-delay: 1.5s;
}

@keyframes pulseElectric {
  0% {
    opacity: 0.15;
    transform: scaleX(1);
  }

  100% {
    opacity: 0.35;
    transform: scaleX(1.05);
  }
}

.knob-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 46px;
  right: 46px;
  pointer-events: none;
}

.knob {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.7);
  backdrop-filter: blur(12px) saturate(260%) brightness(1.25);
  -webkit-backdrop-filter: blur(12px) saturate(260%) brightness(1.25);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 18px rgba(255, 255, 255, 0.15),
    0 8px 26px rgba(0, 0, 0, 0.9);
  cursor: grab;
  pointer-events: auto;
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.knob:active {
  transform: translate(-50%, -50%) scale(1.05);
}

.scale-container {
  position: absolute;
  left: 46px;
  right: 46px;
  top: -85px;
  height: 40px;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.scale-mark {
  position: relative;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 500;
  transition: all 0.12s ease;
}

.scale-mark .tick {
  width: 2px;
  height: var(--tick-base-height);
  background: var(--tick-inactive-color);
  border-radius: 2px;
  margin: 0 auto;
  transform: translateY(0);
}

.scale-mark .value {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
}

.scale-mark.active .value {
  opacity: 1;
  color: var(--glow-color);
  text-shadow: 0 0 12px var(--glow-color);
}

.scale-mark .label-below {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 5px);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0.9;
}

@media (max-width: 480px) {
  .thermostat {
    transform: scale(0.8);
  }
}
