* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0a0a1a; color: #f0e6d3; font-family: 'JetBrains Mono', monospace; overflow-x: hidden; }

.rainbow-bar {
  height: 4px;
  background: linear-gradient(90deg, #ff3333 0%, #ff8c00 25%, #ffff00 50%, #39ff14 75%, #3366ff 100%);
}

.crt-bezel {
  border: 8px solid #2a2a2a;
  border-radius: 16px;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.8),
    0 0 20px rgba(0,0,0,0.6),
    0 0 60px rgba(57,255,20,0.05);
  background: #111;
  position: relative;
  overflow: hidden;
}

.crt-bezel::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.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.drop-zone {
  border: 2px dashed #ffb347;
  border-radius: 12px;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: #39ff14;
  box-shadow: 0 0 20px rgba(57,255,20,0.2);
  background: rgba(57,255,20,0.03);
}

.retro-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 8px 14px;
  border: 2px solid #ffb347;
  background: linear-gradient(180deg, #2a2a4a, #1a1a3a);
  color: #ffb347;
  border-radius: 4px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s;
  box-shadow: 0 3px 0 #111, 0 4px 8px rgba(0,0,0,0.4);
  position: relative;
  top: 0;
}
.retro-btn:hover {
  background: linear-gradient(180deg, #3a3a5a, #2a2a4a);
  color: #fff;
  border-color: #fff;
}
.retro-btn:active {
  top: 2px;
  box-shadow: 0 1px 0 #111, 0 2px 4px rgba(0,0,0,0.4);
}
.retro-btn.active {
  border-color: #39ff14;
  color: #39ff14;
  box-shadow: 0 3px 0 #111, 0 0 12px rgba(57,255,20,0.3);
}
.retro-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.toggle-switch {
  width: 48px; height: 24px;
  background: #1a1a3a;
  border: 2px solid #555;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}
.toggle-switch.on { border-color: #39ff14; background: #1a2a1a; }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #666;
  top: 2px; left: 2px;
  transition: all 0.2s;
}
.toggle-switch.on::after {
  left: 26px;
  background: #39ff14;
}

.reg-highlight {
  animation: regFlash 0.5s ease-out;
}
@keyframes regFlash {
  0% { background: rgba(57,255,20,0.4); }
  100% { background: transparent; }
}

.crt-power-on {
  animation: crtOn 0.8s ease-out;
}
@keyframes crtOn {
  0% { transform: scaleY(0.005); opacity: 0.8; filter: brightness(4); }
  40% { transform: scaleY(0.005); opacity: 1; filter: brightness(2); }
  50% { transform: scaleY(1); filter: brightness(1.5); }
  100% { transform: scaleY(1); filter: brightness(1); }
}

.debug-panel {
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ffb347 #1a1a3a;
}
.debug-panel::-webkit-scrollbar { width: 6px; }
.debug-panel::-webkit-scrollbar-track { background: #1a1a3a; }
.debug-panel::-webkit-scrollbar-thumb { background: #ffb347; border-radius: 3px; }

#emu-display {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.hex-dump { font-size: 10px; line-height: 1.4; }

@media (max-width: 768px) {
  .retro-btn { font-size: 8px; padding: 6px 10px; }
}