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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow: hidden;
  background: #1a1a1a;
}

#canvas-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

canvas {
  display: block;
}

/* Loading Overlay */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

#loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  margin-bottom: 2rem;
  text-transform: uppercase;
}

.loading-bar-container {
  width: 300px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 3px;
  transition: width 0.1s ease;
}

.loading-percent {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin-top: 1rem;
  font-family: monospace;
}

/* Control Panel */
#control-panel {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
}

.settings-btn {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.settings-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.settings-btn svg {
  width: 24px;
  height: 24px;
  fill: rgba(255, 255, 255, 0.8);
}

/* Slide Panel */
#slide-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100%;
  background: rgba(30, 30, 30, 0.95);
  backdrop-filter: blur(20px);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 99;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 2rem;
  overflow-y: auto;
}

#slide-panel.open {
  right: 0;
}

.panel-title {
  color: #fff;
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  display: block;
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slider {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
  outline: none;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #6366f1;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.slider-value {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  min-width: 3rem;
  text-align: right;
  font-family: monospace;
}

.toggle-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle {
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 13px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s ease;
}

.toggle.active {
  background: #6366f1;
}

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s ease;
}

.toggle.active::after {
  transform: translateX(22px);
}

.btn {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn:active {
  transform: scale(0.98);
}

/* Bottom Controls */
#bottom-controls {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 100;
}

.bottom-btn {
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.bottom-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.bottom-btn.active {
  background: rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.5);
}

.bottom-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Overlay backdrop */
#panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 98;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#panel-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}
