@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }
body, html { overflow: hidden; height: 100%; cursor: none; user-select: none; }
canvas { display: block; }

#reset {
  position: absolute; top: 18px; left: 18px;
  background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.32); font: 400 11px 'DM Mono', monospace;
  padding: 5px 14px; border-radius: 6px;
  cursor: pointer; transition: all .2s; letter-spacing: 0.02em;
}
#reset:hover { background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.5); }

#link {
  position: absolute; bottom: 12px; right: 16px;
  color: rgba(0,0,0,0.12); font: 400 9px 'DM Mono', monospace;
  text-decoration: none; transition: color .2s; letter-spacing: 0.03em;
}
#link:hover { color: rgba(0,0,0,0.3); }

#panel {
  position: absolute; top: 14px; right: 14px;
  width: 200px;
}

#toggle {
  width: 100%; padding: 8px 14px;
  background: rgba(0,0,0,0.05); border: 1px solid rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.4); font: 500 11px 'DM Mono', monospace;
  border-radius: 8px; cursor: pointer;
  transition: all .2s; text-align: left; letter-spacing: 0.03em;
}
#toggle:hover { background: rgba(0,0,0,0.08); color: rgba(0,0,0,0.55); }
#toggle.active { border-radius: 8px 8px 0 0; border-bottom-color: transparent; }

#controls {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0,0,0,0.06); border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
  padding: 0 16px;
}
#controls.open { max-height: 320px; opacity: 1; padding: 14px 16px 18px; }

#controls label {
  display: flex; flex-direction: column; gap: 5px;
  margin-bottom: 14px;
}
#controls label:last-child { margin-bottom: 0; }

#controls span {
  font: 400 10px 'DM Mono', monospace;
  color: rgba(0,0,0,0.35); letter-spacing: 0.05em;
  text-transform: uppercase;
}

#controls input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px;
  background: rgba(0,0,0,0.07); border-radius: 2px;
  outline: none; cursor: pointer;
}
#controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1.5px solid rgba(0,0,0,0.18);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: border-color .15s, box-shadow .15s;
}
#controls input[type="range"]::-webkit-slider-thumb:hover {
  border-color: rgba(0,0,0,0.3);
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
}
#controls input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1.5px solid rgba(0,0,0,0.18);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
#controls input[type="range"]::-moz-range-track {
  height: 4px; background: rgba(0,0,0,0.07); border-radius: 2px; border: none;
}