:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #050609;
  color: #f5f7fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 20% 10%, rgba(40, 98, 124, 0.28), transparent 34%),
    linear-gradient(135deg, #050609 0%, #12171c 48%, #08090d 100%);
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 480px;
  overflow: hidden;
  background: #050609;
}

#camera,
.scene-grade,
.droplet-layer,
#debug {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#camera {
  object-fit: cover;
  transform: scaleX(-1);
  filter: contrast(1.08) brightness(0.82) saturate(0.9);
}

.scene-grade {
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0), rgba(0, 7, 13, 0.2) 74%),
    linear-gradient(180deg, rgba(4, 16, 28, 0.12), rgba(2, 8, 14, 0.2));
  mix-blend-mode: multiply;
}

.droplet-layer,
#debug {
  pointer-events: none;
}

.droplet-layer {
  mix-blend-mode: normal;
}

.droplet-background {
  filter: blur(0.9px);
  opacity: 0.96;
}

.droplet-midground {
  filter: blur(0.2px);
  opacity: 1;
}

.droplet-foreground {
  filter: blur(0.08px);
}

.hud {
  position: absolute;
  top: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: min(680px, 70vw);
}

.status span {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(8, 12, 16, 0.58);
  color: rgba(245, 247, 251, 0.9);
  font-size: 14px;
  line-height: 18px;
  backdrop-filter: blur(14px);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: auto;
}

button {
  min-width: 104px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: rgba(237, 241, 246, 0.92);
  color: #0b0f14;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.freeze-signal {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  padding: 9px 14px;
  border: 1px solid rgba(190, 229, 255, 0.36);
  border-radius: 6px;
  background: rgba(5, 8, 12, 0.64);
  color: rgba(228, 247, 255, 0.96);
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 760;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(122, 209, 255, 0.72);
  backdrop-filter: blur(16px);
}

@media (max-width: 640px) {
  .stage {
    min-height: 100svh;
  }

  .hud {
    top: 12px;
    left: 12px;
    right: 12px;
    flex-direction: column;
  }

  .status {
    max-width: 100%;
  }

  .controls {
    justify-content: flex-start;
  }

  button {
    min-width: 96px;
  }
}
