:root {
  --glass-bg: rgba(10, 10, 10, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glow-color: #00a2fa;
}

/* Global reset */
* {
  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 body */
.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-ui {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Main body */
.thermostat {
  position: relative;
  width: 150px;
  height: 520px;
  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;
}

/* Texture */
.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");
}

/* Track */
.track {
  position: absolute;
  top: 46px;
  bottom: 46px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.35) 0, transparent 55%),
    radial-gradient(circle at 50% 100%, rgba(0,0,0,1) 0, rgba(0,0,0,0.9) 70%),
    linear-gradient(180deg, 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;
}

/* Electric plasma fill */
.mercury {
  position: absolute;
  bottom: 0;
  left: -45%;
  width: 190%;
  height: 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: height 0.12s linear, box-shadow 0.3s ease, background 0.25s ease;
  opacity: 0.95;
}

/* Flowing current over plasma */
.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: scaleY(1); }
  100% { opacity: 0.35; transform: scaleY(1.05); }
}

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

.knob {
  position: absolute;
  left: 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 and marks */
.scale-container {
  position: absolute;
  top: 46px;
  bottom: 46px;
  left: -90px;
  width: 80px;
  pointer-events: none;
}

.scale-mark {
  position: absolute;
  right: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.35);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transform-origin: right center;
  transition: all 0.1s ease;
}

.tick {
  height: 2px;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Temperature readout */
.temp-readout {
  text-align: center;
}

.temp-value {
  font-size: 5.2rem;
  font-weight: 700;
  text-shadow: 0 0 48px var(--glow-color);
  color: var(--glow-color);
}

.temp-label {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.34em;
  opacity: 0.7;
  margin-top: 10px;
}

.status-text {
  margin-top: 8px;
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--glow-color);
  opacity: 0.95;
}

/* More Prominent Snow Particles - full canvas */
.particles-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* Responsive tweak */
@media (max-width: 480px){
  .thermostat { transform: scale(0.9);}
}

#app { z-index: 10; position: relative; }
.thermostat-ui, .thermostat { z-index: 10; position: relative; }
.particles-container { z-index: 1; } /* snow stays behind */