:root {
  --bg: #0a0a0a;
  --bg-panel: #111111;
  --bg-darker: #080808;
  --accent: #FFB000;
  --accent-dim: #cc8d00;
  --accent-glow: rgba(255, 176, 0, 0.3);
  --text: #FFB000;
  --text-dim: #886000;
  --border: #333;
  --error: #ff4444;
  --success: #44ff44;
}

.green-mode {
  --accent: #33FF33;
  --accent-dim: #22aa22;
  --accent-glow: rgba(51, 255, 51, 0.3);
  --text: #33FF33;
  --text-dim: #1a881a;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Fira Code', 'Share Tech Mono', monospace;
  overflow: hidden;
  height: 100vh;
}

/* CRT Scanline overlay */
.crt-effects .scanlines::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

.crt-effects .glow {
  text-shadow: 0 0 4px var(--accent-glow), 0 0 8px var(--accent-glow);
}

.crt-effects .glow-strong {
  text-shadow: 0 0 6px var(--accent-glow), 0 0 12px var(--accent-glow), 0 0 20px var(--accent-glow);
}

/* Flicker animation */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

.crt-effects .flicker {
  animation: flicker 4s infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darker);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* Editor textarea styling */
.code-editor {
  background: transparent;
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  border: none;
  outline: none;
  resize: none;
  width: 100%;
  height: 100%;
  padding: 0;
  tab-size: 8;
  white-space: pre;
  overflow-x: auto;
  overflow-y: auto;
  caret-color: var(--accent);
}

.code-editor::selection {
  background: var(--accent-glow);
}

/* Syntax highlight layer */
.syntax-layer {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
  pointer-events: none;
  tab-size: 8;
}

.syn-instr { color: #00d4ff; }
.syn-reg { color: #33ff88; }
.syn-label { color: #ffdd44; }
.syn-comment { color: #555; }
.syn-directive { color: #ff66cc; }
.syn-number { color: #ff8833; }
.syn-string { color: #ff8833; }
.syn-punct { color: #999; }
.syn-ws { color: transparent; }

/* Button styles */
.asm-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.asm-btn:hover {
  border-color: var(--accent);
  background: rgba(255,176,0,0.08);
  box-shadow: 0 0 8px var(--accent-glow);
}
.green-mode .asm-btn:hover {
  background: rgba(51,255,51,0.08);
}

.asm-btn-primary {
  border-color: var(--accent);
  background: rgba(255,176,0,0.15);
  font-weight: 600;
}
.green-mode .asm-btn-primary {
  background: rgba(51,255,51,0.15);
}
.asm-btn-primary:hover {
  background: rgba(255,176,0,0.3);
}
.green-mode .asm-btn-primary:hover {
  background: rgba(51,255,51,0.3);
}

/* Tab styling */
.tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--text-dim);
  font-family: 'Fira Code', monospace;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-btn.active {
  color: var(--text);
  border-color: var(--accent);
  border-bottom: 1px solid var(--bg-panel);
  position: relative;
  z-index: 1;
  margin-bottom: -1px;
}

/* Line number gutter */
.line-numbers {
  font-family: 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: right;
  padding-right: 8px;
  user-select: none;
  min-width: 35px;
}

.error-line {
  background: rgba(255,68,68,0.15);
}
.error-gutter {
  color: var(--error) !important;
}

/* Console */
.console-output {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #33ff33;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  max-width: 900px;
  max-height: 85vh;
  width: 95%;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 0 30px var(--accent-glow);
}

/* Dropdown */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  z-index: 100;
  min-width: 250px;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 8px 14px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-family: 'Fira Code', monospace;
  font-size: 12px;
  cursor: pointer;
}
.dropdown-item:hover {
  background: rgba(255,176,0,0.1);
}
.green-mode .dropdown-item:hover {
  background: rgba(51,255,51,0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .asm-btn { font-size: 11px; padding: 4px 8px; }
  .code-editor { font-size: 12px; }
  .syntax-layer { font-size: 12px; }
  .line-numbers { font-size: 12px; }
}