* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  overflow: hidden;
  font-family: sans-serif;
}
#webGLApp {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Gear Toggle Button */
.gear-btn {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.25s ease;
  backdrop-filter: blur(10px);
  border-radius: 50%;
  pointer-events: auto;
}
.gear-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  transform: rotate(30deg);
}

/* Parameter Panel - RIGHT side */
.param-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 200;
  width: 320px;
  height: 100vh;
  background: rgba(10, 10, 18, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.param-panel.open {
  transform: translateX(0);
}

.param-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.param-panel-title-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.param-panel-title {
  color: #facc15;
  font-family: "Space Grotesk", monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.param-panel-subtitle {
  color: #facc15;
  font-family: "Space Grotesk", monospace;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.param-panel-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}
.panel-action-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
}
.panel-action-btn:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.param-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}
.param-panel-body::-webkit-scrollbar {
  width: 4px;
}
.param-panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.param-panel-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* Sections */
.param-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.param-section-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Inter", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s ease;
}
.param-section-toggle:hover {
  color: white;
}
.param-section-toggle .chevron {
  transition: transform 0.25s ease;
}
.param-section-toggle.collapsed .chevron {
  transform: rotate(-90deg);
}

.param-section-content {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}
.param-section-content.open {
  max-height: 600px;
  padding: 0 1.25rem 1rem;
}

/* Sliders */
.param-slider-group {
  margin-bottom: 0.85rem;
}
.param-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.param-slider-header label {
  color: rgba(255, 255, 255, 0.55);
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
}
.param-value {
  color: rgba(255, 255, 255, 0.8);
  font-family: "Inter", monospace;
  font-size: 0.7rem;
  font-weight: 500;
  min-width: 36px;
  text-align: right;
}

.param-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.param-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
}
.param-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.param-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Color Pickers in Panel */
.color-picker-group {
  margin-bottom: 0.6rem;
}
.color-picker-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.color-picker-input {
  width: 36px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  cursor: pointer;
  background: none;
  padding: 0;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
}
.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 3px;
}
.color-value-display {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: "Inter", monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: text;
  user-select: all;
  transition: all 0.2s ease;
}
.color-value-display:hover {
  border-color: rgba(255, 255, 255, 0.2);
}
.copy-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  color: rgba(255, 255, 255, 0.5);
  font-family: "Inter", sans-serif;
  font-size: 0.62rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}
.copy-btn.copied {
  background: rgba(76, 175, 80, 0.2);
  border-color: rgba(76, 175, 80, 0.4);
  color: rgba(76, 175, 80, 0.9);
}

/* Add / Remove Color */
.add-color-btn {
  width: 100%;
  padding: 0.5rem;
  margin-top: 0.5rem;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: rgba(255, 255, 255, 0.4);
  font-family: "Inter", sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.add-color-btn:hover {
  border-color: rgba(255, 255, 255, 0.3);
  color: rgba(255, 255, 255, 0.7);
}
.add-color-btn:disabled {
  opacity: 0.3;
  cursor: default;
}
.remove-color-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.remove-color-btn:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

/* Export / Import / Share */
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.export-btn {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 0.6rem;
  color: rgba(255, 255, 255, 0.6);
  font-family: "Inter", sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}
.export-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}
.share-url-btn {
  background: rgba(250, 204, 21, 0.08);
  border-color: rgba(250, 204, 21, 0.2);
  color: #facc15;
}
.share-url-btn:hover {
  background: rgba(250, 204, 21, 0.15);
  color: #fde047;
}
.json-preview {
  width: 100%;
  height: 120px;
  margin-top: 0.5rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: "Space Grotesk", monospace;
  font-size: 0.6rem;
  resize: none;
  outline: none;
}

/* Presets */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.preset-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}
.preset-btn.active {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
}
.preset-swatch {
  width: 100%;
  height: 28px;
  border-radius: 5px;
  display: block;
}
.preset-name {
  font-family: "Inter", sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

