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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #c7b8ae 0%, #b1a096 60%, #9b8a80 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

#scene-container {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  touch-action: none;
  cursor: grab;
}

#scene-container:active {
  cursor: grabbing;
}

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

.controls-panel {
  position: fixed;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 13px;
  background: rgba(34, 28, 24, 0.56);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 242, 224, 0.18);
  box-shadow: 0 6px 20px rgba(24, 18, 14, 0.22);
  color: #f7efe6;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.control-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: 56px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #f7efe6;
  flex-shrink: 0;
}

.control-icon {
  width: 14px;
  height: 14px;
  color: #f6c473;
  flex-shrink: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 112px;
  height: 22px;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 244, 230, 0.28);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #f8d493;
  border: 2px solid #fffaf2;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover,
input[type="range"]:active::-webkit-slider-thumb {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 244, 230, 0.28);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f8d493;
  border: 2px solid #fffaf2;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
}

@media (max-width: 520px) {
  .controls-panel {
    left: 50%;
    transform: translateX(-50%);
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  .control-row {
    gap: 6px;
  }

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

  input[type="range"] {
    width: 78px;
  }
}
