:root {
  --bg-primary: #0f0f1a;
  --bg-panel: #1a1a2e;
  --bg-accent: #16213e;
  --bg-terminal: #0d0d0d;
  --text-primary: #e0e0e0;
  --text-muted: #8888aa;
  --accent-berry: #e94560;
  --accent-green: #00ff41;
  --accent-amber: #ffb800;
  --accent-gold: #ffd700;
  --font-mono: 'Fira Code', monospace;
  --font-sans: 'IBM Plex Sans', sans-serif;
}

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

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: #333355; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444477; }

/* Terminal scanlines */
.terminal-scanlines {
  position: relative;
}
.terminal-scanlines::after {
  content: '';
  position: absolute;
  inset: 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: 1;
}

/* Terminal text glow */
.terminal-glow-green {
  text-shadow: 0 0 4px rgba(0,255,65,0.4), 0 0 10px rgba(0,255,65,0.15);
}
.terminal-glow-amber {
  text-shadow: 0 0 4px rgba(255,184,0,0.4), 0 0 10px rgba(255,184,0,0.15);
}

/* Blinking cursor */
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.cursor-blink {
  animation: blink 1s step-end infinite;
}

/* Pulse animation for running status */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 4px rgba(0,255,65,0.4); }
  50% { box-shadow: 0 0 12px rgba(0,255,65,0.8), 0 0 20px rgba(0,255,65,0.3); }
}
.status-running {
  animation: pulse-glow 1.5s ease-in-out infinite;
}

/* Register flash */
@keyframes flash-gold {
  0% { background-color: rgba(255,215,0,0.4); }
  100% { background-color: transparent; }
}
.reg-flash {
  animation: flash-gold 0.6s ease-out;
}

/* Upload zone */
.upload-zone {
  border: 2px dashed #333355;
  transition: all 0.2s ease;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent-berry);
  box-shadow: 0 0 15px rgba(233,69,96,0.15);
  background: rgba(233,69,96,0.05);
}
.upload-zone.loaded {
  border-color: var(--accent-green);
  border-style: solid;
}

/* Checkmark animation */
@keyframes checkmark-pop {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
.checkmark-anim {
  animation: checkmark-pop 0.4s ease-out;
}

/* Button press */
.btn-press:active {
  transform: scale(0.95);
}

/* Tab active indicator */
.tab-active {
  border-bottom: 2px solid var(--accent-berry);
  color: var(--accent-berry);
}

/* Hex editor */
.hex-cell {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 3px;
  cursor: pointer;
}
.hex-cell:hover {
  background: rgba(233,69,96,0.2);
}
.hex-mmio {
  color: var(--accent-amber);
}

/* Mobile drawer */
@media (max-width: 1024px) {
  .control-panel {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    width: 85%;
    max-width: 400px;
    z-index: 50;
    transition: left 0.3s ease;
    overflow-y: auto;
  }
  .control-panel.open {
    left: 0;
  }
  .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 49;
  }
}