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

/* CRT screen curvature effect */
.crt-screen {
  border-radius: 8px;
  box-shadow:
    inset 0 0 60px rgba(0, 255, 0, 0.03),
    inset 0 0 4px rgba(0, 255, 0, 0.05),
    0 0 8px rgba(0, 0, 0, 0.5);
}

/* Phosphor glow text */
.phosphor-glow {
  text-shadow:
    0 0 5px rgba(51, 255, 51, 0.5),
    0 0 10px rgba(51, 255, 51, 0.3),
    0 0 20px rgba(51, 255, 51, 0.15);
}

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

.amber-glow {
  text-shadow:
    0 0 5px rgba(255, 170, 0, 0.5),
    0 0 10px rgba(255, 170, 0, 0.3);
}

.magenta-glow {
  text-shadow:
    0 0 5px rgba(255, 51, 255, 0.5),
    0 0 10px rgba(255, 51, 255, 0.3);
}

.orange-glow {
  text-shadow:
    0 0 5px rgba(255, 136, 51, 0.5),
    0 0 10px rgba(255, 136, 51, 0.3);
}

/* Compile button pulse */
@keyframes compilePulse {
  0% { box-shadow: 0 0 5px rgba(51, 255, 51, 0.3); }
  50% { box-shadow: 0 0 25px rgba(51, 255, 51, 0.6), 0 0 50px rgba(51, 255, 51, 0.2); }
  100% { box-shadow: 0 0 5px rgba(51, 255, 51, 0.3); }
}

.compile-pulse {
  animation: compilePulse 0.6s ease-out;
}

/* Flickering cursor */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.cursor-blink {
  animation: blink 1s step-end infinite;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #1a3a1a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #2a5a2a; }

textarea { tab-size: 2; }

.sidebar-visible { transform: translateX(0); }

.console-drawer {
  transition: max-height 0.3s ease-out;
  overflow: hidden;
}

/* Z80 chip animation */
@keyframes chipFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.chip-float {
  animation: chipFloat 3s ease-in-out infinite;
}

/* Background grid pattern */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(51, 255, 51, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(51, 255, 51, 0.015) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

#root {
  position: relative;
  z-index: 1;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2333ff33' viewBox='0 0 16 16'%3E%3Cpath d='M8 12L2 6h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* String data highlight in hex dump */
.string-data-bg {
  background: rgba(255, 136, 51, 0.08);
  border-left: 2px solid rgba(255, 136, 51, 0.3);
}

/* String inspector row hover */
.string-row:hover {
  background: rgba(255, 170, 0, 0.1);
}