/**
 * @module DivergentCityUI
 * @description Enhanced cyberpunk UI for DIVERGENT.CITY
 * Features: Modern glassmorphism, smooth animations, responsive design
 */

/* ============================================
   BASE STYLES & RESET
   ============================================ */
   
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #060910;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  color: #e2e8ff;
  line-height: 1.5;
}

/* Subtle scan line effect overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.05) 0px,
    transparent 1px,
    transparent 2px,
    rgba(0, 0, 0, 0.05) 3px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
  animation: scanline 8s linear infinite;
}

@keyframes scanline {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(4px);
  }
}

/* ============================================
   CANVAS WRAPPER
   ============================================ */

#wrap {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, #0a0f1a 0%, #060910 100%);
  overflow: hidden;
  z-index: 0;
}

#wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(123, 163, 255, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255, 64, 201, 0.02) 0%, transparent 50%);
  animation: ambientShift 20s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes ambientShift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(10px, 10px) scale(1.05);
  }
}

canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 100px rgba(123, 163, 255, 0.1),
    0 0 200px rgba(58, 106, 255, 0.05);
  border-radius: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: box-shadow 0.3s ease;
}

canvas:hover {
  box-shadow: 
    0 12px 48px rgba(0, 0, 0, 0.5),
    0 0 120px rgba(123, 163, 255, 0.15),
    0 0 240px rgba(58, 106, 255, 0.08);
}

/* ============================================
   PERFORMANCE STATS HUD
   ============================================ */

#stats-hud {
  position: fixed;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.stat-item {
  background: rgba(6, 9, 16, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(58, 106, 255, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: slideInFromTop 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #7ba3ff;
  font-weight: 600;
}

.stat-value {
  font-size: 18px;
  font-weight: 700;
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.4);
  font-variant-numeric: tabular-nums;
}

/* ============================================
   TOGGLE BUTTONS
   ============================================ */

#toggle, #fullscreen {
  position: fixed;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(10, 15, 25, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(123, 163, 255, 0.3);
  color: #e2e8ff;
  font-size: 20px;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#toggle {
  left: 12px;
  top: 12px;
  animation: slideInFromLeft 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

#fullscreen {
  left: 12px;
  top: 66px;
  animation: slideInFromLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#toggle:hover, #fullscreen:hover {
  background: rgba(58, 106, 255, 0.2);
  border-color: rgba(123, 163, 255, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 106, 255, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#toggle:active, #fullscreen:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.toggle-icon, .fullscreen-icon {
  animation: none;
}

#toggle:hover .toggle-icon {
  animation: spin 1s ease-in-out;
}

/* ============================================
   MAIN SETTINGS PANEL
   ============================================ */

#panel {
  position: fixed;
  left: 0;
  top: 0;
  height: 100%;
  max-height: 100vh;
  width: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 500;
  background: linear-gradient(180deg, 
    rgba(10, 15, 25, 0.92) 0%, 
    rgba(6, 9, 16, 0.95) 100%);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border-right: 1px solid rgba(123, 163, 255, 0.2);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.5),
              inset -1px 0 0 rgba(255, 255, 255, 0.05);
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  color: #e2e8ff;
  font-size: 13px;
}

#panel.open {
  pointer-events: auto;
  width: 360px;
  padding: 20px;
  opacity: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Panel Scrollbar */
#panel::-webkit-scrollbar {
  width: 10px;
}

#panel::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin: 4px 0;
}

#panel::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, 
    rgba(123, 163, 255, 0.4) 0%, 
    rgba(58, 106, 255, 0.6) 100%);
  border-radius: 10px;
  border: 2px solid rgba(0, 0, 0, 0.3);
}

#panel::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, 
    rgba(123, 163, 255, 0.6) 0%, 
    rgba(58, 106, 255, 0.8) 100%);
}

/* ============================================
   PANEL HEADER
   ============================================ */

.panel-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(123, 163, 255, 0.2);
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-title {
  margin: 0 0 4px 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #7ba3ff 0%, #3a6aff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-icon {
  font-size: 24px;
  filter: drop-shadow(0 0 8px rgba(123, 163, 255, 0.6));
}

.panel-subtitle {
  margin: 0;
  font-size: 11px;
  color: #7ba3ff;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* ============================================
   PANEL SECTIONS
   ============================================ */

.panel-section {
  margin-bottom: 28px;
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-title {
  margin: 0 0 12px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9bb3ff;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-icon {
  font-size: 14px;
  opacity: 0.9;
}

/* ============================================
   PRESET BUTTONS
   ============================================ */

.presets {
  background: linear-gradient(135deg, 
    rgba(58, 106, 255, 0.08) 0%, 
    rgba(123, 163, 255, 0.05) 100%);
  border: 1px solid rgba(123, 163, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(15, 22, 36, 0.6);
  border: 1px solid rgba(123, 163, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: #e2e8ff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.preset-btn:hover {
  background: rgba(58, 106, 255, 0.15);
  border-color: rgba(123, 163, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(58, 106, 255, 0.3);
}

.preset-btn:active {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(58, 106, 255, 0.2);
}

.preset-btn.active {
  background: linear-gradient(135deg, 
    rgba(58, 106, 255, 0.3) 0%, 
    rgba(123, 163, 255, 0.2) 100%);
  border-color: rgba(123, 163, 255, 0.8);
  box-shadow: 0 4px 16px rgba(58, 106, 255, 0.5),
              inset 0 0 20px rgba(58, 106, 255, 0.2);
}

.preset-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.preset-label {
  font-size: 10px;
  opacity: 0.9;
}

/* ============================================
   CONTROL GROUPS
   ============================================ */

.ctrl {
  margin-bottom: 18px;
}

/* Labels */
label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: #b5c8ff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.ctrl:hover label {
  color: #d0dcff;
}

.value-display {
  color: #00ff88;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
  min-width: 48px;
  text-align: right;
}

.weather-emoji,
.mode-indicator,
.palette-preview {
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

/* ============================================
   SELECT INPUTS
   ============================================ */

.enhanced-select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(15, 22, 36, 0.6);
  color: #e2e8ff;
  border: 1px solid rgba(123, 163, 255, 0.2);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.enhanced-select:hover {
  background: rgba(15, 22, 36, 0.8);
  border-color: rgba(123, 163, 255, 0.4);
  box-shadow: 0 0 12px rgba(58, 106, 255, 0.2),
              inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.enhanced-select:focus {
  outline: none;
  border-color: rgba(123, 163, 255, 0.8);
  box-shadow: 0 0 20px rgba(58, 106, 255, 0.4),
              inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RANGE SLIDERS
   ============================================ */

.enhanced-slider, .gradient-slider {
  width: 100%;
  height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, 
    rgba(58, 106, 255, 0.3) 0%, 
    rgba(123, 163, 255, 0.6) 100%);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.enhanced-slider:hover, .gradient-slider:hover {
  box-shadow: 0 0 12px rgba(58, 106, 255, 0.4),
              inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Slider Thumb */
.enhanced-slider::-webkit-slider-thumb,
.gradient-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  appearance: none;
  -webkit-appearance: none;
  background: linear-gradient(135deg, #ffffff 0%, #e2e8ff 100%);
  border-radius: 50%;
  border: 2px solid #3a6aff;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4),
              0 0 0 2px rgba(58, 106, 255, 0.2);
  transition: all 0.2s;
}

.enhanced-slider::-webkit-slider-thumb:hover,
.gradient-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(58, 106, 255, 0.6),
              0 0 0 4px rgba(58, 106, 255, 0.3);
}

.enhanced-slider::-webkit-slider-thumb:active,
.gradient-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5),
              0 0 0 3px rgba(58, 106, 255, 0.4);
}

/* Time Slider Special Gradient */
.time-slider {
  background: linear-gradient(90deg,
    #02040a 0%,
    #0b0f24 10%,
    #6a4bd9 18%,
    #ffb85c 24%,
    #97d4ff 35%,
    #5a9aff 60%,
    #ffb85c 76%,
    #8031b3 82%,
    #0d1022 100%
  ) !important;
  height: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4),
              inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

/* Slider Ticks */
.slider-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 9px;
  color: #7ba3ff;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

/* Sync Real Time Toggle */
.sync-toggle {
  width: 100%;
  margin-top: 10px;
  padding: 8px 12px;
  background: rgba(15, 22, 36, 0.6);
  border: 1px solid rgba(123, 163, 255, 0.2);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-toggle:hover {
  background: rgba(58, 106, 255, 0.08);
  border-color: rgba(123, 163, 255, 0.4);
}

.sync-toggle .toggle-label {
  font-size: 11px;
  font-weight: 600;
}

/* ============================================
   TOGGLE CHECKBOXES (Custom)
   ============================================ */

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(15, 22, 36, 0.4);
  border: 1px solid rgba(123, 163, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
}

.toggle-item:hover {
  background: rgba(15, 22, 36, 0.6);
  border-color: rgba(123, 163, 255, 0.3);
  transform: translateX(2px);
}

.toggle-item input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-checkbox {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(123, 163, 255, 0.2);
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle-checkbox::after {
  content: '';
  position: absolute;
  left: 2px;
  top: 2px;
  width: 14px;
  height: 14px;
  background: #e2e8ff;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-item input[type="checkbox"]:checked + .toggle-checkbox {
  background: linear-gradient(90deg, #3a6aff 0%, #5a9aff 100%);
  border-color: #5a9aff;
  box-shadow: 0 0 12px rgba(58, 106, 255, 0.5);
}

.toggle-item input[type="checkbox"]:checked + .toggle-checkbox::after {
  left: 18px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.toggle-label {
  font-size: 11px;
  color: #b5c8ff;
  font-weight: 500;
  flex-grow: 1;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  width: 100%;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn.primary {
  background: linear-gradient(135deg, #3a6aff 0%, #5a9aff 100%);
  color: #ffffff;
  border: 1px solid rgba(123, 163, 255, 0.4);
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #4a7aff 0%, #6aa9ff 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 106, 255, 0.5);
}

.action-btn.secondary {
  background: rgba(15, 22, 36, 0.6);
  color: #e2e8ff;
  border: 1px solid rgba(123, 163, 255, 0.2);
}

.action-btn.secondary:hover {
  background: rgba(58, 106, 255, 0.15);
  border-color: rgba(123, 163, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(58, 106, 255, 0.3);
}

.action-btn:active {
  transform: translateY(0);
}

.btn-icon {
  font-size: 16px;
}

/* ============================================
   HELP SECTION
   ============================================ */

.help {
  margin-top: 16px;
}

.help-details {
  background: rgba(15, 22, 36, 0.4);
  border: 1px solid rgba(123, 163, 255, 0.15);
  border-radius: 10px;
  overflow: hidden;
}

.help-summary {
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9bb3ff;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  transition: all 0.3s;
}

.help-summary:hover {
  background: rgba(58, 106, 255, 0.1);
  color: #b5c8ff;
}

.help-summary::-webkit-details-marker {
  display: none;
}

.help-content {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #b5c8ff;
}

kbd {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(123, 163, 255, 0.2);
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  color: #7ba3ff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ============================================
   PANEL FOOTER
   ============================================ */

.panel-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.footer-text {
  margin: 0 0 4px 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  background: linear-gradient(135deg, #7ba3ff 0%, #3a6aff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-subtext {
  margin: 0;
  font-size: 10px;
  color: #7ba3ff;
  opacity: 0.7;
  letter-spacing: 0.5px;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes slideInFromTop {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

@keyframes neonPulse {
  0%, 100% {
    filter: drop-shadow(0 0 2px currentColor) brightness(1);
  }
  50% {
    filter: drop-shadow(0 0 8px currentColor) brightness(1.3);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* ============================================
   EXPERIMENTAL UI ENHANCEMENTS
   ============================================ */

/* Neon glow effect on focused inputs */
input[type="range"]:focus,
select:focus {
  outline: none;
  border-color: rgba(123, 163, 255, 0.8);
  box-shadow: 0 0 0 3px rgba(123, 163, 255, 0.2),
              0 0 20px rgba(123, 163, 255, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Enhanced preset button with shimmer effect */
.preset-btn {
  position: relative;
  overflow: hidden;
}

.preset-btn::before {
  content: '';

/* ============================================
   LOADING STATE
   ============================================ */

#wrap::after {
  content: 'INITIALIZING CITY\u2026';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7ba3ff;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: pulse 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}

#wrap.loaded::after {
  display: none;
}

/* ============================================
   ACCESSIBILITY: REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  body::after {
    animation: none;
    display: none;
  }
  #wrap::before {
    animation: none;
  }
}

/* ============================================
   LIGHT MODE PANEL ADJUSTMENTS
   ============================================ */

@media (prefers-color-scheme: light) {
  #panel {
    background: linear-gradient(180deg,
      rgba(240, 244, 255, 0.96) 0%,
      rgba(230, 235, 250, 0.98) 100%);
    color: #1a2040;
    border-right-color: rgba(58, 106, 255, 0.3);
  }
  #panel .panel-subtitle,
  #panel .section-title,
  #panel .toggle-label,
  #panel label,
  #panel .slider-ticks,
  #panel .shortcut-item span,
  #panel .footer-subtext {
    color: #4a5580;
  }
  #panel .value-display {
    color: #0a8a4a;
    text-shadow: none;
  }
  #panel .enhanced-select {
    background: rgba(255, 255, 255, 0.8);
    color: #1a2040;
    border-color: rgba(58, 106, 255, 0.3);
  }
  #panel .toggle-item {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(58, 106, 255, 0.2);
  }
  #panel .action-btn.secondary {
    background: rgba(255, 255, 255, 0.6);
    color: #1a2040;
  }
  #panel .presets {
    background: linear-gradient(135deg,
      rgba(58, 106, 255, 0.06) 0%,
      rgba(123, 163, 255, 0.04) 100%);
  }
  #panel .preset-btn {
    background: rgba(255, 255, 255, 0.6);
    color: #1a2040;
  }
}

/* ============================================
   TOUCH-FRIENDLY TARGETS
   ============================================ */

@media (pointer: coarse) {
  .toggle-item {
    min-height: 44px;
    padding: 12px 14px;
  }
  .preset-btn {
    min-height: 44px;
    padding: 16px 8px;
  }
  .action-btn {
    min-height: 44px;
  }
  .enhanced-select {
    min-height: 44px;
    padding: 12px 14px;
  }
  .enhanced-slider::-webkit-slider-thumb,
  .gradient-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
  }
  .help-summary {
    min-height: 44px;
    padding: 14px;
  }
  kbd {
    padding: 6px 12px;
    font-size: 12px;
  }
}
  position: absolute;
  top: 0;
  left: -200%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.1) 50%, 
    transparent 100%);
  transition: left 0.5s ease;
}

.preset-btn:hover::before {
  left: 200%;
}

/* Ambient glow effect for panel */
#panel::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, 
    rgba(123, 163, 255, 0.1) 0%, 
    rgba(58, 106, 255, 0.05) 50%,
    rgba(255, 64, 201, 0.1) 100%);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

#panel:hover::before {
  opacity: 1;
}

/* Micro-interaction: scale on active */
button:active,
.preset-btn:active,
.action-btn:active {
  transform: scale(0.98);
}

/* Enhanced section titles with glow */
.section-title {
  position: relative;
  text-shadow: 0 0 20px rgba(123, 163, 255, 0.3);
}

.section-icon {
  animation: neonPulse 3s ease-in-out infinite;
}

/* Value display with enhanced glow */
.value-display {
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5),
               0 0 20px rgba(0, 255, 136, 0.3);
}

/* Enhanced slider with glow trail */
input[type="range"]::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(123, 163, 255, 0.2),
              0 0 20px rgba(123, 163, 255, 0.6),
              0 4px 12px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(123, 163, 255, 0.3),
              0 0 30px rgba(123, 163, 255, 0.8),
              0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Checkbox toggle with neon effect */
.toggle-checkbox::before {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease;
}

input[type="checkbox"]:checked + .toggle-checkbox::before {
  box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.4),
              0 0 15px rgba(0, 255, 136, 0.6);
}

/* Panel edge glow */
#panel {
  box-shadow: 
    -4px 0 40px rgba(123, 163, 255, 0.15),
    -4px 0 80px rgba(58, 106, 255, 0.1),
    0 0 100px rgba(255, 64, 201, 0.05),
    inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

/* Enhanced stat values with pulsing glow */
.stat-value {
  animation: neonPulse 2s ease-in-out infinite;
}

/* Smooth color transitions on all interactive elements */
button,
.preset-btn,
.action-btn,
input,
select,
.toggle-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  #panel.open {
    width: 100%;
  }
  
  .preset-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .toggle-grid {
    grid-template-columns: 1fr;
  }
}
