*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 38% 36%, #cab8aa 0%, #b5a395 48%, #98867a 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2f2620;
  -webkit-user-select: none;
  user-select: none;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

#scene:active {
  cursor: grabbing;
}

.hud {
  position: fixed;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom, 14px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(248, 241, 233, 0.72);
  border: 1px solid rgba(110, 88, 70, 0.22);
  box-shadow: 0 6px 22px rgba(45, 32, 22, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-width: calc(100vw - 24px);
  z-index: 10;
}

.control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.control label {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #3d3128;
  white-space: nowrap;
  cursor: pointer;
}

.control input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 112px;
  height: 5px;
  border-radius: 999px;
  background: rgba(94, 74, 58, 0.24);
  outline: none;
  cursor: pointer;
  margin: 0;
}

.control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d9822b;
  border: 2px solid #fff8ef;
  box-shadow: 0 1px 4px rgba(40, 26, 14, 0.35);
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.control input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
  background: #e89135;
}

.control input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #d9822b;
  border: 2px solid #fff8ef;
  box-shadow: 0 1px 4px rgba(40, 26, 14, 0.35);
  cursor: pointer;
}

@media (max-width: 480px) {
  .hud {
    gap: 12px;
    padding: 7px 12px;
    bottom: max(10px, env(safe-area-inset-bottom, 10px));
  }

  .control {
    gap: 6px;
  }

  .control label {
    font-size: 12px;
  }

  .control input[type="range"] {
    width: 82px;
  }
}
