:root {
  --bg-deep: #0a0e1a;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #1c2333;
  --bg-surface: #21283b;
  --border: #30363d;
  --border-focus: #00ff41;
  --green: #00ff41;
  --green-dim: #00cc33;
  --amber: #ffb000;
  --cyan: #00d4ff;
  --magenta: #ff6ec7;
  --red: #ff4444;
  --yellow: #ffd700;
  --white: #e6edf3;
  --gray: #8b949e;
  --gray-dim: #484f58;
}

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

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

#root {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-dim);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray);
}

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

.glow-green {
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.5), 0 0 20px rgba(0, 255, 65, 0.2);
}

.glow-border {
  box-shadow: 0 0 5px rgba(0, 255, 65, 0.15), inset 0 0 5px rgba(0, 255, 65, 0.05);
}

.btn-glow:hover {
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

@keyframes flashGreen {
  0% { background-color: rgba(0, 255, 65, 0.15); }
  100% { background-color: transparent; }
}

.flash-success {
  animation: flashGreen 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.25s ease-out;
}

.editor-container {
  position: relative;
  flex: 1;
  display: flex;
  overflow: hidden;
  background: var(--bg-primary);
}

.editor-textarea {
  background: transparent;
  color: transparent;
  caret-color: var(--green);
  border: none;
  outline: none;
  resize: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 20px;
  padding: 8px;
  padding-left: 8px;
  width: 100%;
  height: 100%;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 8;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
}

.editor-textarea::selection {
  background: rgba(0, 212, 255, 0.3);
  color: transparent;
}

.syntax-highlight-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 20px;
  white-space: pre;
  overflow-wrap: normal;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  color: var(--white);
}

.line-numbers {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 20px;
  color: var(--gray-dim);
  text-align: right;
  user-select: none;
  padding-right: 12px;
  padding-left: 8px;
  min-width: 44px;
  flex-shrink: 0;
}

.hex-dump {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 18px;
}

.listing-line {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 18px;
}

.console-output {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 18px;
}

.reference-panel {
  transition: transform 0.3s ease;
  width: 420px;
}

.reference-panel::-webkit-scrollbar {
  width: 4px;
}

@media (max-width: 768px) {
  .split-pane {
    flex-direction: column !important;
  }
}

.scanline {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 255, 65, 0.012) 2px,
    rgba(0, 255, 65, 0.012) 4px
  );
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.syn-label { color: #ffb000; font-weight: 700; }
.syn-mnemonic { color: #00d4ff; font-weight: 500; }
.syn-register { color: #e6edf3; }
.syn-number { color: #ff6ec7; }
.syn-string { color: #98c379; }
.syn-comment { color: #484f58; font-style: italic; }
.syn-directive { color: #c678dd; font-weight: 500; }
.syn-operator { color: #8b949e; }
.syn-paren { color: #8b949e; }
.syn-comma { color: #484f58; }

.error-line-bg {
  background: rgba(255, 68, 68, 0.08);
}

/* Chip ASCII art */
.chip-art {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  line-height: 10px;
  color: var(--green);
  opacity: 0.6;
  white-space: pre;
  letter-spacing: -0.5px;
}

/* Copy toast */
@keyframes toastIn {
  0% { opacity: 0; transform: translateY(10px); }
  20% { opacity: 1; transform: translateY(0); }
  80% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

.copy-toast {
  animation: toastIn 1.5s ease forwards;
}