:root {
  --ibm-blue: #0043CE;
  --cga-black: #000000;
  --cga-blue: #0000AA;
  --cga-green: #00AA00;
  --cga-cyan: #00AAAA;
  --cga-red: #AA0000;
  --cga-magenta: #AA00AA;
  --cga-brown: #AA5500;
  --cga-light-gray: #AAAAAA;
  --cga-dark-gray: #555555;
  --cga-light-blue: #5555FF;
  --cga-light-green: #55FF55;
  --cga-light-cyan: #55FFFF;
  --cga-light-red: #FF5555;
  --cga-light-magenta: #FF55FF;
  --cga-yellow: #FFFF55;
  --cga-white: #FFFFFF;
  --bezel-dark: #1a1a2e;
  --bezel-mid: #16213e;
  --panel-bg: #0a0a18;
  --border-color: #2a2a4e;
  --text-green: #33ff33;
  --text-amber: #ffb000;
  --text-dim: #446644;
}

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

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

.press-start { font-family: 'Press Start 2P', cursive; }

.crt-monitor {
  position: relative;
  background: #1a1a1a;
  border-radius: 18px;
  padding: 20px;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.8),
    0 0 20px rgba(0,0,0,0.5),
    0 4px 20px rgba(0,0,0,0.6);
}

.crt-screen {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.4);
}

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

.crt-screen.scanlines::after {
  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.curvature::before {
  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;
}

.led-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s;
}

.led-on { box-shadow: 0 0 6px 2px currentColor; }
.led-off { opacity: 0.3; }

.register-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-color);
  font-size: 12px;
  line-height: 1.6;
}

.register-changed {
  animation: flashYellow 0.5s ease-out;
}

@keyframes flashYellow {
  0% { color: #ffff00; background: rgba(255,255,0,0.15); }
  100% { color: var(--text-green); background: transparent; }
}

.flag-active { color: var(--text-green); text-shadow: 0 0 4px var(--text-green); }
.flag-inactive { color: #334433; }

.bevel-outset {
  border: 2px solid;
  border-color: #555 #222 #222 #555;
}

.bevel-inset {
  border: 2px solid;
  border-color: #222 #555 #555 #222;
}

.rocker-switch {
  width: 48px; height: 24px;
  background: #333;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  border: 1px solid #555;
}

.rocker-switch .toggle {
  width: 22px; height: 20px;
  background: linear-gradient(180deg, #888, #555);
  border-radius: 3px;
  position: absolute;
  top: 1px;
  transition: left 0.15s;
  border: 1px solid #666;
}

.rocker-switch.on .toggle { left: 24px; }
.rocker-switch.off .toggle { left: 1px; }

.btn-retro {
  background: linear-gradient(180deg, #555, #333);
  border: 2px solid;
  border-color: #777 #222 #222 #777;
  color: #ccc;
  padding: 4px 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
}

.btn-retro:hover { background: linear-gradient(180deg, #666, #444); }
.btn-retro:active {
  border-color: #222 #777 #777 #222;
  background: linear-gradient(180deg, #333, #444);
}

.btn-red {
  background: linear-gradient(180deg, #aa3333, #772222);
  border-color: #cc4444 #551111 #551111 #cc4444;
}

.floppy-slot {
  background: #222;
  border: 2px solid #444;
  border-radius: 2px;
  height: 12px;
  width: 120px;
  position: relative;
  overflow: hidden;
}

.floppy-slot .slit {
  position: absolute;
  top: 3px; left: 10px; right: 10px;
  height: 6px;
  background: #111;
  border-radius: 1px;
}

.disasm-current {
  background: rgba(0,67,206,0.3);
  border-left: 3px solid var(--ibm-blue);
}

.disasm-breakpoint {
  background: rgba(170,0,0,0.2);
  border-left: 3px solid var(--cga-red);
}

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

.hex-view .addr { color: var(--cga-cyan); }
.hex-view .byte { color: var(--text-green); }
.hex-view .byte-video { color: var(--cga-yellow); }
.hex-view .byte-bios { color: var(--cga-light-magenta); }
.hex-view .ascii { color: #888; }

.tab-btn {
  padding: 4px 10px;
  font-size: 10px;
  background: #1a1a2e;
  border: 1px solid var(--border-color);
  color: #888;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
}

.tab-btn.active {
  background: #0a0a18;
  color: var(--text-green);
  border-bottom: 1px solid #0a0a18;
}

.log-panel {
  font-size: 10px;
  color: #888;
  background: #050510;
}

.log-panel .log-int { color: var(--cga-light-cyan); }
.log-panel .log-io { color: var(--cga-yellow); }
.log-panel .log-disk { color: var(--cga-light-green); }
.log-panel .log-error { color: var(--cga-light-red); }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0a0a18; }
::-webkit-scrollbar-thumb { background: #2a2a4e; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a5e; }

@keyframes blink { 0%,49% { opacity: 1; } 50%,100% { opacity: 0; } }
.cursor-blink { animation: blink 1s step-end infinite; }

@keyframes diskActivity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}
.disk-active { animation: diskActivity 0.15s infinite; }