:root {
  --bg-deep: #060a14;
  --bg-primary: #0a0e1a;
  --bg-secondary: #0f1526;
  --bg-tertiary: #141c30;
  --bg-card: #111827;
  --cyan: #00ffd5;
  --green: #39ff14;
  --orange: #ff9f1c;
  --red: #ff3b5c;
  --purple: #b388ff;
  --yellow: #ffe156;
  --text: #e0e7ff;
  --text-dim: #7a86a8;
  --border: rgba(0,255,213,0.12);
  --border-bright: rgba(0,255,213,0.3);
}

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

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

/* Scanline overlay */
body::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.03) 2px,
    rgba(0,0,0,0.03) 4px
  );
}

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

.glow-text {
  text-shadow: 0 0 10px rgba(0,255,213,0.5), 0 0 20px rgba(0,255,213,0.3);
}

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

.glow-red {
  text-shadow: 0 0 10px rgba(255,59,92,0.5);
}

.glow-orange {
  text-shadow: 0 0 10px rgba(255,159,28,0.5);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes flash-register {
  0% { background: rgba(0,255,213,0.4); box-shadow: 0 0 15px rgba(0,255,213,0.5); }
  100% { background: transparent; box-shadow: none; }
}

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

@keyframes spin-berry {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.animate-pulse-slow {
  animation: pulse 2s ease-in-out infinite;
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

.animate-spin-berry {
  animation: spin-berry 4s ease-in-out infinite;
}

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

.code-line-highlight {
  background: rgba(0,255,213,0.08) !important;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.code-line-breakpoint {
  position: relative;
}

.code-line-breakpoint::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.btn-cpu {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-cpu:hover {
  border-color: var(--border-bright);
  background: rgba(0,255,213,0.05);
}

.btn-cpu:active {
  transform: scale(0.97);
}

.btn-run {
  border-color: rgba(57,255,20,0.3);
  color: var(--green);
}
.btn-run:hover {
  background: rgba(57,255,20,0.1);
  border-color: rgba(57,255,20,0.5);
}

.btn-stop {
  border-color: rgba(255,59,92,0.3);
  color: var(--red);
}
.btn-stop:hover {
  background: rgba(255,59,92,0.1);
  border-color: rgba(255,59,92,0.5);
}

.register-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 5px;
  font-size: 10px;
  transition: all 0.2s;
  min-width: 0;
}

.register-card:hover {
  border-color: var(--border-bright);
}

.status-badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
}

.panel {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.panel-header {
  background: var(--bg-secondary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--cyan);
}

textarea.code-editor {
  background: transparent;
  color: var(--text);
  border: none;
  outline: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  width: 100%;
  tab-size: 4;
}

.hex-dump {
  font-size: 11px;
  line-height: 1.5;
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  animation: confetti-fall 3s linear forwards;
  z-index: 10000;
  pointer-events: none;
}

.toast-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-tertiary);
  border: 1px solid var(--cyan);
  border-radius: 8px;
  padding: 12px 20px;
  z-index: 10001;
  box-shadow: 0 0 20px rgba(0,255,213,0.2);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }
}