:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #21303d;
  --muted: #637484;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(33, 48, 61, 0.14);
}

* { box-sizing: border-box; }

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

body {
  background: linear-gradient(#85d7ff 0%, #d8f3ff 48%, #fff 100%);
  color: var(--ink);
}

#snowCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  pointer-events: none;
}

.debug-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 3;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 31, 41, 0.72);
  color: #f7fbff;
  font: 600 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  pointer-events: none;
}

.panel {
  position: fixed;
  z-index: 2;
  left: clamp(16px, 4vw, 40px);
  bottom: clamp(16px, 4vw, 40px);
  width: min(440px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 80px rgba(18, 50, 70, 0.18);
}

header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-toggle {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
}

.panel.is-collapsed {
  width: auto;
}

.panel.is-collapsed header {
  margin-bottom: 0;
}

.panel.is-collapsed .controls {
  display: none;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3.7rem);
  line-height: 0.92;
  letter-spacing: -0.08em;
}

.lede {
  max-width: 34rem;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.controls {
  display: grid;
  gap: 16px;
}

.range-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  gap: 12px;
  align-items: center;
  font-weight: 700;
}

.range-row output {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

input[type="range"] {
  width: 100%;
  min-height: 34px;
  cursor: grab;
  accent-color: var(--ink);
  touch-action: pan-x;
}

input[type="range"]:active { cursor: grabbing; }

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

legend {
  padding: 0 8px;
  font-weight: 800;
}

fieldset label {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

@media (max-width: 560px) {
  .panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 18px;
    border-radius: 22px;
  }

  .lede { font-size: 0.92rem; }
}
