* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #2a2a4e #0a0a14;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #0a0a14; }
::-webkit-scrollbar-thumb { background: #2a2a4e; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5e; }

body { overflow-x: hidden; }

.crt-overlay {
  position: relative;
}
.crt-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 255, 65, 0.02) 0px,
    rgba(0, 255, 65, 0.02) 1px,
    transparent 1px,
    transparent 3px
  );
  z-index: 1;
}

.glow-green {
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.6), 0 0 30px rgba(0, 255, 65, 0.3);
}

.glow-cyan {
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.6), 0 0 30px rgba(0, 212, 255, 0.3);
}

.glow-box-green {
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.3), inset 0 0 4px rgba(0, 255, 65, 0.1);
}

.glow-box-cyan {
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3), inset 0 0 4px rgba(0, 212, 255, 0.1);
}

.glow-box-magenta {
  box-shadow: 0 0 8px rgba(255, 0, 255, 0.3), inset 0 0 4px rgba(255, 0, 255, 0.1);
}

@keyframes pulse-wasm {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(0, 212, 255, 0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 12px rgba(0, 212, 255, 0.8); }
}

.wasm-badge-pulse {
  animation: pulse-wasm 2s ease-in-out infinite;
}

@keyframes spin-loader {
  to { transform: rotate(360deg); }
}

.spin-loader {
  animation: spin-loader 0.8s linear infinite;
}

.memory-cell {
  transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.memory-cell:hover {
  transform: scale(1.15);
  z-index: 10;
}

.memory-cell-active {
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.8), 0 0 24px rgba(0, 212, 255, 0.4);
}

.memory-cell-modified {
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.code-editor-area {
  tab-size: 4;
  resize: none;
  caret-color: #00ff41;
}

.code-editor-area::selection {
  background: rgba(0, 212, 255, 0.3);
}

.speed-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #2a2a4e;
  border-radius: 2px;
  outline: none;
}
.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #00d4ff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}
.speed-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #00d4ff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

.tooltip-cell {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 1px solid #00d4ff;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.panel-border {
  border: 1px solid #1e1e3a;
}

.panel-border-green {
  border: 1px solid rgba(0, 255, 65, 0.2);
}

.panel-border-cyan {
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.panel-border-magenta {
  border: 1px solid rgba(255, 0, 255, 0.2);
}

@keyframes flash-cell {
  0% { background-color: rgba(0, 255, 65, 0.6); }
  100% { background-color: transparent; }
}