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

body {
  background: #050510;
  color: #00ff88;
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(180deg, #1a0a2e 0%, #0a0515 100%);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2a1a4e;
  box-shadow: 0 4px 20px rgba(138, 43, 226, 0.2);
}

.title {
  font-family: 'VT323', monospace;
  font-size: 2.5rem;
  color: #00ffaa;
  text-shadow: 
    0 0 10px #00ffaa,
    0 0 20px #00ffaa,
    0 0 40px #00ff88;
  letter-spacing: 4px;
}

.header-leds {
  display: flex;
  gap: 8px;
}

.header-led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1a1a2e;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.5);
  transition: all 0.1s;
}

.header-led.active {
  box-shadow: 
    0 0 8px currentColor,
    0 0 16px currentColor,
    inset 0 0 4px rgba(255,255,255,0.3);
}

/* Main */
.main {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Oscilloscope */
.oscilloscope {
  background: #0a0a15;
  border-radius: 12px;
  padding: 1rem;
  border: 3px solid #1a1a3e;
  box-shadow: 
    inset 0 0 30px rgba(0,0,0,0.5),
    0 0 20px rgba(0, 255, 136, 0.1);
}

.scope-bezel {
  background: linear-gradient(145deg, #2a2a3e, #1a1a2e);
  border-radius: 8px;
  padding: 8px;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.5),
    0 2px 4px rgba(0,0,0,0.3);
}

.scope-screen {
  position: relative;
  background: #050510;
  border-radius: 4px;
  overflow: hidden;
}

.scope-canvas {
  width: 100%;
  height: auto;
  display: block;
}

.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
}

.scope-controls {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

/* LED Display */
.led-display {
  background: #0a0a12;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid #2a2a3e;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.led-label {
  font-size: 0.6rem;
  color: #666;
  margin-bottom: 2px;
}

.led-value {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: #ff6b6b;
  text-shadow: 0 0 8px #ff6b6b;
}

/* Master Controls */
.master-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 1rem;
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border-radius: 12px;
  border: 2px solid #2a2a4e;
}

.play-button {
  font-family: 'VT323', monospace;
  font-size: 1.5rem;
  padding: 1rem 2rem;
  background: linear-gradient(180deg, #2a4a3e, #1a3a2e);
  border: 3px solid #00ff88;
  border-radius: 8px;
  color: #00ff88;
  cursor: pointer;
  transition: all 0.2s;
  text-shadow: 0 0 10px #00ff88;
  box-shadow: 
    0 0 20px rgba(0, 255, 136, 0.2),
    inset 0 2px 4px rgba(255,255,255,0.1);
}

.play-button:hover {
  background: linear-gradient(180deg, #3a5a4e, #2a4a3e);
  box-shadow: 
    0 0 30px rgba(0, 255, 136, 0.4),
    inset 0 2px 4px rgba(255,255,255,0.1);
}

.play-button.playing {
  background: linear-gradient(180deg, #4a2a2a, #3a1a1a);
  border-color: #ff6b6b;
  color: #ff6b6b;
  text-shadow: 0 0 10px #ff6b6b;
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.2);
}

.help-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1a1a2e;
  border: 2px solid #4a4a6e;
  color: #8888aa;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.help-button:hover {
  border-color: #00ff88;
  color: #00ff88;
}

/* Knob */
.knob-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.knob {
  position: relative;
  background: linear-gradient(145deg, #3a3a4e, #1a1a2e);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 
    0 4px 8px rgba(0,0,0,0.5),
    inset 0 2px 4px rgba(255,255,255,0.1);
}

.knob-inner {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: linear-gradient(145deg, #2a2a3e, #1a1a2e);
  border-radius: 50%;
  display: flex;
  justify-content: center;
}

.knob-indicator {
  width: 3px;
  height: 40%;
  background: #00ff88;
  border-radius: 2px;
  margin-top: 4px;
  box-shadow: 0 0 8px #00ff88;
}

.knob-label {
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
}

/* Power Switch */
.power-switch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.switch-track {
  width: 30px;
  height: 16px;
  background: #1a1a2e;
  border-radius: 8px;
  padding: 2px;
  transition: all 0.2s;
  border: 1px solid #2a2a4e;
}

.power-switch.on .switch-track {
  background: var(--switch-color, #00ff88);
  box-shadow: 0 0 10px var(--switch-color, #00ff88);
}

.switch-thumb {
  width: 12px;
  height: 12px;
  background: #eee;
  border-radius: 50%;
  transition: transform 0.2s;
}

.power-switch.on .switch-thumb {
  transform: translateX(14px);
}

.switch-led {
  width: 6px;
  height: 6px;
  background: #2a2a3e;
  border-radius: 50%;
  transition: all 0.2s;
}

.switch-led.active {
  background: var(--switch-color, #00ff88);
  box-shadow: 0 0 8px var(--switch-color, #00ff88);
}

/* Channels Panel */
.channels-panel {
  background: linear-gradient(180deg, #12121e 0%, #0a0a15 100%);
  border-radius: 12px;
  padding: 1rem;
  border: 2px solid #1a1a3e;
}

.panel-label {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: #666;
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
}

/* Channel Strip */
.channel-strip {
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 2px solid #2a2a4e;
  border-radius: 8px;
  padding: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.channel-strip.selected {
  border-color: var(--channel-color);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}

.channel-strip.active {
  background: linear-gradient(180deg, #1a2a2e 0%, #0f1a1a 100%);
}

.channel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.channel-num {
  font-family: 'VT323', monospace;
  font-size: 0.9rem;
  color: var(--channel-color);
}

.channel-controls {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
}

.channel-wave-name {
  font-size: 0.6rem;
  text-align: center;
  color: #666;
  margin-top: 0.5rem;
}

.channel-activity {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a2a3e;
}

.channel-activity.pulse {
  background: var(--channel-color);
  animation: pulse 0.5s ease-in-out infinite;
  box-shadow: 0 0 8px var(--channel-color);
}

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

/* Waveform Editor */
.waveform-editor {
  background: linear-gradient(180deg, #12121e 0%, #0a0a15 100%);
  border-radius: 12px;
  padding: 1rem;
  border: 2px solid #1a1a3e;
}

.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.editor-title {
  font-family: 'VT323', monospace;
  font-size: 1rem;
  color: #666;
  letter-spacing: 2px;
}

.preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.preset-btn {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  padding: 0.25rem 0.5rem;
  background: #1a1a2e;
  border: 1px solid #2a2a4e;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  border-color: #00ff88;
  color: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.editor-canvas {
  width: 100%;
  height: auto;
  border-radius: 4px;
  cursor: crosshair;
}

/* Footer */
.footer {
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #0a0510;
  border-top: 1px solid #1a1a3e;
  font-size: 0.8rem;
  color: #666;
}

.footer a {
  color: #00ff88;
  text-decoration: none;
  transition: text-shadow 0.2s;
}

.footer a:hover {
  text-shadow: 0 0 10px #00ff88;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 1rem;
}

.modal {
  background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
  border: 2px solid #2a2a4e;
  border-radius: 12px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  color: #ccc;
}

.modal h2 {
  font-family: 'VT323', monospace;
  font-size: 1.8rem;
  color: #00ff88;
  margin-bottom: 1rem;
}

.modal h3 {
  font-size: 1rem;
  color: #00ffaa;
  margin: 1rem 0 0.5rem;
}

.modal p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.modal ul {
  padding-left: 1.5rem;
  font-size: 0.85rem;
}

.modal li {
  margin-bottom: 0.25rem;
}

.modal-close {
  font-family: 'VT323', monospace;
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  background: linear-gradient(180deg, #2a4a3e, #1a3a2e);
  border: 2px solid #00ff88;
  border-radius: 6px;
  color: #00ff88;
  cursor: pointer;
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .title {
    font-size: 1.5rem;
    letter-spacing: 2px;
  }

  .header {
    padding: 0.75rem 1rem;
  }

  .main {
    padding: 0.5rem;
  }

  .master-controls {
    gap: 1rem;
    padding: 0.75rem;
  }

  .play-button {
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
  }

  .channels-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .channel-strip {
    padding: 0.5rem;
  }

  .channel-controls {
    flex-direction: column;
    align-items: center;
  }

  .preset-buttons {
    width: 100%;
    justify-content: center;
  }

  .footer {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .channels-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .editor-header {
    flex-direction: column;
    align-items: flex-start;
  }
}