:root {
  --bg-deep: #0a0a0f;
  --bg-card: rgba(14, 14, 24, 0.75);
  --cyan: #00e5ff;
  --green: #39ff14;
  --amber: #ffab00;
  --red: #ff3d3d;
  --border: rgba(0, 229, 255, 0.15);
  --text-primary: #e0e8f0;
  --text-muted: #6b7a8d;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
}

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

body {
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(0, 229, 255, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(100, 0, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.008) 2px,
    rgba(0, 229, 255, 0.008) 4px
  );
}

.scanlines {
  position: relative;
}

.scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 229, 255, 0.015) 1px,
    rgba(0, 229, 255, 0.015) 2px
  );
  border-radius: inherit;
}

.glow-cyan {
  text-shadow: 0 0 10px rgba(0, 229, 255, 0.6), 0 0 30px rgba(0, 229, 255, 0.2);
}

.mono { font-family: var(--font-mono); }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(0, 229, 255, 0.12);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
  border: none;
  cursor: pointer;
}

.play-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  color: var(--cyan);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.play-btn:hover {
  background: rgba(0, 229, 255, 0.18);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.3);
}

.play-btn.active {
  background: rgba(0, 229, 255, 0.15);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
  animation: pulse-ring 2s ease-in-out infinite;
}

.play-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4), 0 0 20px rgba(0, 229, 255, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(0, 229, 255, 0), 0 0 20px rgba(0, 229, 255, 0.3); }
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.pulse-dot {
  animation: pulse-dot 1s ease-in-out infinite;
}

.pill-btn {
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.pill-btn:hover {
  border-color: rgba(0, 229, 255, 0.4);
  color: var(--text-primary);
}

.pill-btn.active {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.12);
  color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

.pill-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.mod-card {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(14, 14, 24, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mod-card:hover {
  border-color: rgba(0, 229, 255, 0.3);
}

.mod-card.active {
  border-color: var(--cyan);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.canvas-container {
  background: #050508;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 229, 255, 0.08);
}

.canvas-container canvas {
  display: block;
  width: 100%;
}

.safety-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  padding: 16px;
}

.safety-modal {
  max-width: 520px;
  width: 100%;
  background: #0e0e18;
  border: 1px solid rgba(255, 171, 0, 0.4);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
}

.sweep-btn {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: linear-gradient(90deg, rgba(0,229,255,0.05), rgba(57,255,20,0.05));
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.sweep-btn:hover:not(:disabled) {
  background: linear-gradient(90deg, rgba(0,229,255,0.12), rgba(57,255,20,0.12));
  border-color: var(--cyan);
}

.sweep-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.drawing-toolbar button {
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.drawing-toolbar button:hover,
.drawing-toolbar button.active {
  border-color: var(--cyan);
  color: var(--cyan);
}

.freq-zone-bar {
  height: 8px;
  border-radius: 4px;
  display: flex;
  overflow: hidden;
  position: relative;
}

.freq-zone-bar > div:not([style*="position: absolute"]) { height: 100%; }

.label-sm {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.value-readout {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cyan);
  background: rgba(0, 229, 255, 0.06);
  border: 1px solid rgba(0, 229, 255, 0.15);
  border-radius: 6px;
  padding: 3px 8px;
  min-width: 60px;
  text-align: center;
}

input.value-readout {
  outline: none;
  width: 70px;
}

input.value-readout:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.2);
}

/* Dashboard layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 16px;
  padding: 16px;
  align-content: start;
}

@media (min-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: minmax(300px, 1fr) minmax(380px, 1.3fr);
    padding: 16px 24px;
  }
}

@media (max-width: 1023px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 767px) {
  .play-btn { width: 52px; height: 52px; font-size: 20px; }
  .glass-card { padding: 12px; }
  .safety-modal { padding: 24px 16px; }
  .header-bar {
    padding: 12px 12px !important;
  }
  .dashboard-grid {
    padding: 8px !important;
    gap: 10px !important;
  }
  .pill-btn {
    padding: 6px 10px;
    font-size: 11px;
  }
  .footer-bar {
    padding: 12px !important;
  }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 229, 255, 0.2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 229, 255, 0.4); }