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

body {
  background: #0d0d1a;
  color: #c0c0c0;
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
}

/* CRT Monitor Effect */
.crt-monitor {
  position: relative;
  background: #111;
  border-radius: 18px;
  padding: 20px;
  box-shadow:
    0 0 0 4px #222,
    0 0 0 8px #1a1a1a,
    0 0 0 12px #333,
    inset 0 0 60px rgba(0,0,0,0.5),
    0 8px 40px rgba(0,0,0,0.8);
}

.crt-screen {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #000;
}

.crt-screen canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

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

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

/* Monitor brand label */
.monitor-label {
  text-align: center;
  margin-top: 8px;
  color: #555;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
}

/* LED indicators */
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.1);
}

.led-green { background: #33FF33; box-shadow: 0 0 6px #33FF33; }
.led-yellow { background: #FFD700; box-shadow: 0 0 6px #FFD700; }
.led-red { background: #FF3333; box-shadow: 0 0 6px #FF3333; }
.led-gray { background: #444; }
.led-amber { background: #FFB000; box-shadow: 0 0 6px #FFB000; }

@keyframes blink-led {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.led-blink {
  animation: blink-led 0.5s ease-in-out infinite;
}

/* Retro button styles */
.retro-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 6px 14px;
  border: 2px solid #555;
  background: linear-gradient(180deg, #4a4a4a, #2a2a2a);
  color: #ddd;
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 2px 4px rgba(0,0,0,0.5);
  transition: all 0.05s;
  user-select: none;
}

.retro-btn:hover {
  background: linear-gradient(180deg, #5a5a5a, #3a3a3a);
}

.retro-btn:active {
  background: linear-gradient(180deg, #2a2a2a, #4a4a4a);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.5),
    0 0 0 rgba(0,0,0,0);
  transform: translateY(1px);
}

.retro-btn-primary {
  border-color: #0530AD;
  background: linear-gradient(180deg, #0840cf, #0530AD);
  color: white;
}

.retro-btn-primary:hover {
  background: linear-gradient(180deg, #0950df, #0640bd);
}

.retro-btn-danger {
  border-color: #8b0000;
  background: linear-gradient(180deg, #cc2222, #8b0000);
  color: white;
}

/* Panel styling */
.panel {
  background: #12122a;
  border: 1px solid #2a2a4c;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

.panel-header {
  background: linear-gradient(180deg, #1e1e3a, #161630);
  border-bottom: 1px solid #2a2a4c;
  padding: 6px 10px;
  font-size: 11px;
  color: #8888aa;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  user-select: none;
}

/* Register display */
.reg-value {
  font-family: 'IBM Plex Mono', monospace;
  color: #FFB000;
  font-size: 13px;
}

.reg-label {
  color: #6666aa;
  font-size: 10px;
  text-transform: uppercase;
}

/* Flag indicators */
.flag-bit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #333;
  border-radius: 2px;
  font-size: 9px;
  margin: 1px;
  transition: all 0.15s;
}

.flag-set {
  background: #0a3d0a;
  border-color: #33FF33;
  color: #33FF33;
  box-shadow: 0 0 4px rgba(51, 255, 51, 0.3);
}

.flag-clear {
  background: #1a1a1a;
  color: #444;
}

/* Floppy drive */
.floppy-slot {
  background: #1a1a1a;
  border: 2px solid #333;
  border-radius: 2px;
  height: 12px;
  margin: 4px 0;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* Hex viewer */
.hex-viewer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
  overflow-y: auto;
  max-height: 200px;
}

.hex-offset { color: #6666aa; }
.hex-byte { color: #FFB000; }
.hex-ascii { color: #33FF33; }
.hex-changed { color: #FF3333; background: rgba(255,0,0,0.1); }

/* Disassembly */
.disasm-current {
  background: rgba(5, 48, 173, 0.3);
  border-left: 2px solid #0530AD;
}

.disasm-line {
  font-size: 11px;
  padding: 1px 4px;
  border-left: 2px solid transparent;
}

/* Speed slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #222;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0530AD;
  cursor: pointer;
  border: 2px solid #4070ff;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #0d0d1a; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* Tab buttons */
.tab-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  background: #1a1a2e;
  border: 1px solid #2a2a4c;
  color: #666;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tab-btn.active {
  background: #0530AD;
  border-color: #0530AD;
  color: white;
}

/* Instruction log */
.instruction-log {
  font-size: 10px;
  line-height: 1.3;
  max-height: 150px;
  overflow-y: auto;
}

@keyframes floppy-read {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.floppy-reading {
  animation: floppy-read 0.15s ease-in-out infinite;
}