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

body {
  background: radial-gradient(ellipse at 50% 40%, #2d1b69 0%, #1a0a3e 50%, #0d0520 100%);
  min-height: 100vh;
  color: #f0d080;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a0a3e; }
::-webkit-scrollbar-thumb { background: #d4a84366; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #d4a84399; }

.glass-panel {
  background: rgba(26, 10, 62, 0.65);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(240, 208, 128, 0.05);
}

.glass-panel-sm {
  background: rgba(26, 10, 62, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(212, 168, 67, 0.1);
  border-radius: 10px;
}

/* Brass Toggle Switch */
.brass-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  background: linear-gradient(145deg, #3a2a10, #5a4a20);
  border-radius: 14px;
  cursor: pointer;
  border: 1px solid #8a7030;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 1px 2px rgba(212,168,67,0.2);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.brass-toggle.active {
  background: linear-gradient(145deg, #5a4a20, #8a7030);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 1px 4px rgba(212,168,67,0.4);
}

.brass-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  background: linear-gradient(145deg, #f0d080, #d4a843);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.3);
}

.brass-toggle.active .brass-toggle-knob {
  transform: translateX(28px);
}

/* Gold Slider */
.gold-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #3a2a10, #5a4a20);
  border-radius: 3px;
  outline: none;
  border: 1px solid #8a703044;
}

.gold-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #f0d080, #d4a843);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 12px rgba(212,168,67,0.3);
  border: 1px solid #f0d08066;
}

.gold-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: linear-gradient(145deg, #f0d080, #d4a843);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 12px rgba(212,168,67,0.3);
  border: 1px solid #f0d08066;
}

/* Backlit Button */
.backlit-btn {
  position: relative;
  padding: 10px 24px;
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(26, 10, 62, 0.8), rgba(45, 27, 105, 0.6));
  color: #f0d080;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 13px;
}

.backlit-btn:hover {
  border-color: rgba(212, 168, 67, 0.6);
  box-shadow: 0 0 20px rgba(212, 168, 67, 0.2);
}

.backlit-btn.active, .backlit-btn:active {
  background: linear-gradient(145deg, rgba(212, 168, 67, 0.2), rgba(212, 168, 67, 0.1));
  box-shadow: 0 0 30px rgba(212, 168, 67, 0.3), inset 0 0 10px rgba(212, 168, 67, 0.1);
}

.backlit-btn.start-btn {
  border-color: rgba(100, 200, 100, 0.4);
  color: #a0f0a0;
  animation: pulse-glow 2.5s ease-in-out infinite;
}

.backlit-btn.start-btn.running {
  animation: none;
  box-shadow: 0 0 20px rgba(100, 200, 100, 0.3);
}

.backlit-btn.pause-btn {
  border-color: rgba(240, 180, 60, 0.4);
  color: #f0d080;
}

.backlit-btn.stop-btn {
  border-color: rgba(200, 80, 80, 0.3);
  color: #f08080;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(100, 200, 100, 0.15); }
  50% { box-shadow: 0 0 30px rgba(100, 200, 100, 0.35), 0 0 60px rgba(100, 200, 100, 0.1); }
}

@keyframes breathe {
  0%, 100% { transform: scale(0.98); }
  50% { transform: scale(1.02); }
}

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

.shimmer-text {
  background: linear-gradient(90deg, #d4a843 0%, #f0d080 25%, #ffffff 50%, #f0d080 75%, #d4a843 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

/* Segmented Control */
.seg-control {
  display: inline-flex;
  background: rgba(26, 10, 62, 0.6);
  border: 1px solid rgba(212, 168, 67, 0.15);
  border-radius: 8px;
  overflow: hidden;
}

.seg-btn {
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #8a7030;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all 0.3s ease;
  border-right: 1px solid rgba(212, 168, 67, 0.1);
  white-space: nowrap;
}

.seg-btn:last-child { border-right: none; }

.seg-btn.active {
  background: linear-gradient(145deg, rgba(212, 168, 67, 0.2), rgba(212, 168, 67, 0.1));
  color: #f0d080;
  box-shadow: inset 0 0 10px rgba(212, 168, 67, 0.1);
}

.seg-btn:hover:not(.active) {
  color: #d4a843;
  background: rgba(212, 168, 67, 0.05);
}

/* Custom select */
.gold-select {
  background: rgba(26, 10, 62, 0.7);
  border: 1px solid rgba(212, 168, 67, 0.2);
  color: #f0d080;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 15px;
  outline: none;
  width: 100%;
  cursor: pointer;
}

.gold-select option {
  background: #1a0a3e;
  color: #f0d080;
}

.gold-input {
  background: rgba(26, 10, 62, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.15);
  color: #f0d080;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.3s;
}

.gold-input:focus {
  border-color: rgba(212, 168, 67, 0.4);
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.1);
}

.gold-input::placeholder {
  color: #8a703066;
  font-style: italic;
}

.gold-textarea {
  background: rgba(26, 10, 62, 0.5);
  border: 1px solid rgba(212, 168, 67, 0.15);
  color: #f0d080;
  padding: 8px 12px;
  border-radius: 8px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 14px;
  outline: none;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.3s;
}

.gold-textarea:focus {
  border-color: rgba(212, 168, 67, 0.4);
}

.gold-textarea::placeholder {
  color: #8a703066;
  font-style: italic;
}

.lock-icon {
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0.5;
}

.lock-icon.locked {
  opacity: 1;
  filter: drop-shadow(0 0 4px rgba(212, 168, 67, 0.5));
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 5, 32, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.warning-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  background: rgba(240, 80, 80, 0.2);
  color: #f08080;
  border: 1px solid rgba(240, 80, 80, 0.3);
  margin-left: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
  .desktop-three-col { flex-direction: column !important; }
  .side-panel { max-width: 100% !important; width: 100% !important; }
}

@media (max-width: 768px) {
  .freq-display-bar { flex-wrap: wrap; font-size: 10px !important; }
}