:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0f1520;
  --bg-panel: #111827;
  --bg-header: #161d2e;
  --green: #00ff41;
  --green-dim: #00cc33;
  --green-dark: rgba(0, 255, 65, 0.08);
  --amber: #ffb000;
  --amber-dim: #cc8d00;
  --cyan: #00e5ff;
  --magenta: #ff6ec7;
  --red: #ff3333;
  --border: rgba(0, 255, 65, 0.15);
  --border-bright: rgba(0, 255, 65, 0.3);
  --text: #c8d6e5;
  --text-dim: #5a6a7e;
  --text-bright: #e8f0fe;
}

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

body {
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  background: var(--bg-primary);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#root {
  min-height: 100vh;
}

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

/* CRT Scanline effect */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 1px,
    rgba(0,0,0,0.03) 1px,
    rgba(0,0,0,0.03) 2px
  );
  z-index: 9999;
}

/* Glow effect for panels */
.panel-glow {
  box-shadow: inset 0 0 30px rgba(0, 255, 65, 0.02), 0 0 1px rgba(0, 255, 65, 0.1);
}

/* Code editor */
.code-editor {
  background: #080c14;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  border: none;
  color: var(--green);
  caret-color: var(--green);
  tab-size: 8;
}

.code-editor::placeholder {
  color: var(--text-dim);
}

.code-editor:focus {
  outline: none;
}

/* Line highlighting */
.line-highlight {
  background: rgba(0, 255, 65, 0.08) !important;
}

.line-breakpoint {
  background: rgba(255, 51, 51, 0.15) !important;
}

/* Register flash animation */
@keyframes regFlash {
  0% { background-color: rgba(255, 176, 0, 0.3); }
  100% { background-color: transparent; }
}

.reg-flash {
  animation: regFlash 0.6s ease-out;
}

/* Flag indicators */
.flag-set {
  background: var(--green);
  color: #000;
  font-weight: 700;
}

.flag-clear {
  background: rgba(90, 106, 126, 0.3);
  color: var(--text-dim);
}

/* Toolbar buttons */
.tool-btn {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--green);
  padding: 4px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.tool-btn:hover {
  background: rgba(0, 255, 65, 0.1);
  border-color: var(--green);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.2);
}

.tool-btn:active {
  background: rgba(0, 255, 65, 0.2);
}

.tool-btn.danger {
  border-color: rgba(255, 51, 51, 0.3);
  color: var(--red);
}

.tool-btn.danger:hover {
  background: rgba(255, 51, 51, 0.1);
  border-color: var(--red);
}

/* Status badges */
.status-running { color: var(--green); }
.status-halted { color: var(--text-dim); }
.status-paused { color: var(--amber); }
.status-error { color: var(--red); }

/* Memory hex view */
.mem-read { background: rgba(0, 100, 255, 0.2); }
.mem-write { background: rgba(255, 51, 51, 0.2); }

/* Panel headers */
.panel-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  user-select: none;
}

/* Input styles */
.emu-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 2px 6px;
  outline: none;
}

.emu-input:focus {
  border-color: var(--green);
}

.emu-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--green);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 4px 8px;
  outline: none;
  cursor: pointer;
}

/* Speed slider */
input[type="range"] {
  -webkit-appearance: none;
  background: transparent;
  width: 80px;
}

input[type="range"]::-webkit-slider-track {
  height: 3px;
  background: var(--border-bright);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--green);
  border-radius: 50%;
  margin-top: -5px;
  cursor: pointer;
}

/* Console output */
.console-output {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Responsive */
@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column !important;
  }
  .left-panel, .right-panel {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Breakpoint dot */
.bp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  display: inline-block;
  box-shadow: 0 0 4px var(--red);
}

/* Syntax highlight colors in the line rendering */
.syn-mnemonic { color: var(--green); font-weight: 600; }
.syn-register { color: var(--cyan); }
.syn-number { color: var(--amber); }
.syn-comment { color: var(--text-dim); font-style: italic; }
.syn-label { color: var(--magenta); }
.syn-directive { color: #ff9966; }
.syn-string { color: #98c379; }
.syn-comma { color: var(--text-dim); }