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

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 38% 32%, #c9b9ae 0%, #b19f93 52%, #978579 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #2b211a;
  user-select: none;
  -webkit-user-select: none;
}

#scene-container {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

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

.controls-hud {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(250, 245, 239, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(110, 88, 72, 0.18);
  box-shadow: 0 4px 16px rgba(42, 30, 20, 0.14);
  z-index: 10;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.control-label {
  min-width: 34px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #3d2e23;
}

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

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

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

.control-item input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #d4892a;
  border: 2px solid #fff8ef;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

@media (max-width: 520px) {
  .controls-hud {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 11px;
  }

  .control-label {
    min-width: auto;
    font-size: 11px;
  }

  .control-item input[type="range"] {
    width: 78px;
  }
}
