:root {
  --bg-deep: #0f0f23;
  --bg-panel: #1a1a2e;
  --bg-darker: #0a0a1a;
  --cyan: #00fff7;
  --green: #39ff14;
  --magenta: #ff00ff;
  --red: #ff3333;
  --orange: #ff8c00;
  --blue: #4488ff;
  --white-dim: #aabbcc;
  --text: #e0e0e0;
  --border: #2a2a4e;
}

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

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

.pixel-font {
  font-family: 'Press Start 2P', monospace;
}

.scanlines {
  position: relative;
}
.scanlines::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 1;
}

.crt-glow {
  box-shadow: 0 0 20px rgba(0,255,247,0.1), inset 0 0 60px rgba(0,0,0,0.3);
}

.panel {
  background: var(--bg-panel);
  border: 2px solid var(--border);
  border-radius: 4px;
  position: relative;
}
.panel::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px; right: -1px; bottom: -1px;
  border-radius: 5px;
  background: linear-gradient(135deg, rgba(0,255,247,0.1), transparent, rgba(255,0,255,0.05));
  z-index: -1;
}

.pixel-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 8px 16px;
  border: 3px solid;
  border-color: #555 #222 #222 #555;
  background: #333;
  color: var(--text);
  cursor: pointer;
  transition: all 0.05s;
  text-transform: uppercase;
  image-rendering: pixelated;
}
.pixel-btn:hover {
  background: #444;
}
.pixel-btn:active {
  border-color: #222 #555 #555 #222;
  transform: translateY(1px);
}
.pixel-btn.active {
  background: var(--cyan);
  color: #000;
  border-color: #00cccc #006666 #006666 #00cccc;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.1s;
}
.led.active {
  box-shadow: 0 0 6px currentColor, 0 0 12px currentColor;
}

.cartridge-slot {
  background: linear-gradient(180deg, #111 0%, #1a1a1a 10%, #0d0d0d 90%, #000 100%);
  border: 3px solid #333;
  border-top: 5px solid #444;
  border-bottom: 5px solid #222;
  position: relative;
}
.cartridge-slot::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 4px;
  background: linear-gradient(90deg, transparent, #555, transparent);
}

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

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes nes-boot {
  0% { opacity: 0; }
  20% { opacity: 1; background: #000; }
  40% { background: #ff0000; }
  60% { background: #0000ff; }
  80% { background: #000; }
  100% { opacity: 1; background: transparent; }
}

.bounce-bars {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
}
.bounce-bars span {
  display: block;
  width: 3px;
  background: var(--green);
  animation: bounce-bar 0.6s ease-in-out infinite;
}
.bounce-bars span:nth-child(2) { animation-delay: 0.1s; }
.bounce-bars span:nth-child(3) { animation-delay: 0.2s; }
.bounce-bars span:nth-child(4) { animation-delay: 0.3s; }

@keyframes bounce-bar {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #333;
  border-radius: 0;
  outline: none;
  border: 1px solid #555;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 18px;
  background: #666;
  border: 2px solid;
  border-color: #999 #333 #333 #999;
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 18px;
  background: #666;
  border: 2px solid;
  border-color: #999 #333 #333 #999;
  cursor: pointer;
  border-radius: 0;
}

.viz-canvas {
  background: #000;
  border: 2px solid #333;
  image-rendering: pixelated;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-darker); }
::-webkit-scrollbar-thumb { background: #333; border: 1px solid #555; }

.track-list-item {
  padding: 6px 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.1s;
  font-size: 11px;
}
.track-list-item:hover {
  background: rgba(0,255,247,0.05);
  border-color: rgba(0,255,247,0.2);
}
.track-list-item.active {
  background: rgba(0,255,247,0.1);
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0,255,247,0.1);
}