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

body {
  background: #050505;
  color: #33ff33;
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
}

@keyframes warmup {
  0% { opacity: 0; filter: brightness(0) blur(10px); }
  30% { opacity: 0.3; filter: brightness(0.3) blur(5px); }
  60% { opacity: 0.7; filter: brightness(0.7) blur(2px); }
  100% { opacity: 1; filter: brightness(1) blur(0); }
}

@keyframes scanline-move {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes phosphor-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.97; }
  25% { opacity: 0.99; }
  75% { opacity: 0.98; }
}

.crt-container {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 
    0 0 60px rgba(51, 255, 51, 0.15),
    0 0 120px rgba(51, 255, 51, 0.05),
    inset 0 0 80px rgba(0,0,0,0.8);
}

.crt-container.amber {
  box-shadow: 
    0 0 60px rgba(255, 170, 0, 0.15),
    0 0 120px rgba(255, 170, 0, 0.05),
    inset 0 0 80px rgba(0,0,0,0.8);
}

.crt-screen {
  position: relative;
  background: #0a0a0a;
  padding: 20px;
  animation: warmup 2s ease-out, phosphor-flicker 0.1s infinite;
}

.crt-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.crt-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
  z-index: 3;
}

.scanline-bar {
  position: absolute;
  width: 100%;
  height: 8px;
  background: linear-gradient(to bottom, transparent, rgba(51,255,51,0.03), transparent);
  animation: scanline-move 8s linear infinite;
  pointer-events: none;
  z-index: 4;
}

.amber .scanline-bar {
  background: linear-gradient(to bottom, transparent, rgba(255,170,0,0.03), transparent);
}

.screen-text {
  font-family: 'Share Tech Mono', monospace;
  white-space: pre;
  line-height: 1.3;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 8px currentColor;
}

.panel {
  background: linear-gradient(145deg, #1a1a1a, #111);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 4px 12px rgba(0,0,0,0.5);
}

.panel-header {
  border-bottom: 1px solid #2a2a2a;
  background: linear-gradient(180deg, #222, #1a1a1a);
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.btn {
  background: linear-gradient(180deg, #2a2a2a, #1a1a1a);
  border: 1px solid #3a3a3a;
  color: #33ff33;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.15s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.btn:hover {
  background: linear-gradient(180deg, #333, #222);
  border-color: #33ff33;
  box-shadow: 0 0 10px rgba(51,255,51,0.2);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.btn-danger {
  color: #ff4444;
}
.btn-danger:hover { border-color: #ff4444; box-shadow: 0 0 10px rgba(255,68,68,0.2); }

.btn-amber { color: #ffaa00; }
.btn-amber:hover { border-color: #ffaa00; }

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 4px currentColor;
}

.led-on { background: #33ff33; color: #33ff33; }
.led-off { background: #333; color: #333; }
.led-red { background: #ff4444; color: #ff4444; }

.rom-slot {
  background: #111;
  border: 1px dashed #333;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 10px;
  transition: all 0.3s;
}

.rom-slot.loaded {
  border-color: #33ff33;
  border-style: solid;
  background: rgba(51,255,51,0.05);
}

.drop-zone {
  border: 2px dashed #333;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: #33ff33;
  background: rgba(51,255,51,0.05);
}

.hex-dump {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.register-display {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #333;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #33ff33;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(51,255,51,0.4);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

.bezel {
  background: linear-gradient(145deg, #1e1e1e, #0e0e0e);
  border: 2px solid #2a2a2a;
  border-radius: 24px;
  padding: 16px;
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.memory-region {
  height: 12px;
  border-radius: 2px;
  transition: all 0.3s;
}