:root {
  --bg-color: #050505;
  --text-main: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.5);
  --surface-color: rgba(20, 20, 20, 0.6);
  --surface-border: rgba(255, 255, 255, 0.1);
  --accent-color: #3b82f6;
  /* Modern Blue */
  --accent-hover: #2563eb;
  --font-family: 'Inter', sans-serif;
  --transition-speed: 0.3s;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-color);
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  font-family: var(--font-family);
  color: var(--text-main);
}

#ui {
  position: absolute;
  top: 30px;
  left: 30px;
  z-index: 10;
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--surface-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  width: 340px;
  transition: opacity var(--transition-speed);
}

h1 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin: 0 0 20px 0;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
  align-items: flex-start;
}

h1::before {
  content: '';
  display: block;
  width: 4px;
  height: 14px;
  background: var(--accent-color);
  border-radius: 2px;
  margin-top: 3px;
  /* Align with text top */
}

.control-group {
  margin-bottom: 24px;
}

.label {
  font-size: 12px;
  font-weight: 500;
  margin-bottom: 10px;
  display: block;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* Range Slider */
input[type=range] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--accent-color);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Toggle Buttons */
.toggle-row {
  display: flex;
  gap: 8px;
}

.icon-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-family);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.icon-btn.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--accent-color);
  color: white;
}

/* Button Group */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* Secondary Button */
.secondary-btn {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: white;
}

.secondary-btn:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.02);
}

canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
}