:root {
  --term-green: #33FF33;
  --term-green-dim: #1a8a1a;
  --term-amber: #FFB000;
  --term-amber-dim: #7a5500;
  --term-white: #e0e0e0;
  --term-blue: #5599ff;
  --bezel-dark: #1a1a1e;
  --bezel-mid: #2a2a2e;
  --bezel-light: #3a3a3e;
}

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

body {
  font-family: 'IBM Plex Mono', monospace;
  height: 100vh;
  background: #0a0a0c;
}

@font-face {
  font-family: 'CPMFont';
  src: local('IBM Plex Mono');
}

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

.crt-screen.amber { background: #0f0a00; }
.crt-screen.white-theme { background: #0a0a0f; }
.crt-screen.blue-theme { background: #f0f0ff; }

.crt-screen::before {
  content: '';
  position: absolute;
  inset: 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.no-effects::before { display: none; }
.crt-screen.no-effects::after { display: none; }
.crt-screen.no-effects .crt-glow { text-shadow: none !important; }

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

.crt-glow-green {
  color: var(--term-green);
  text-shadow: 0 0 5px rgba(51, 255, 51, 0.5), 0 0 10px rgba(51, 255, 51, 0.2);
}

.crt-glow-amber {
  color: var(--term-amber);
  text-shadow: 0 0 5px rgba(255, 176, 0, 0.5), 0 0 10px rgba(255, 176, 0, 0.2);
}

.crt-glow-white {
  color: var(--term-white);
  text-shadow: 0 0 3px rgba(224, 224, 224, 0.3);
}

.crt-glow-blue {
  color: #1a1a2e;
  text-shadow: none;
}

.bezel {
  background: linear-gradient(145deg, #2a2a2e, #1a1a1e);
  border: 2px solid #3a3a3e;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 4px 20px rgba(0,0,0,0.5);
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0,0,0,0.3);
}

.led-green { background: #33ff33; box-shadow: 0 0 4px #33ff33; }
.led-red { background: #ff3333; box-shadow: 0 0 4px #ff3333; }
.led-yellow { background: #ffbb33; box-shadow: 0 0 4px #ffbb33; }
.led-off { background: #333; box-shadow: none; }

.retro-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 10px;
  background: linear-gradient(180deg, #4a4a4e 0%, #2a2a2e 100%);
  border: 1px solid #5a5a5e;
  border-bottom: 2px solid #1a1a1e;
  color: #ccc;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: all 0.1s;
  white-space: nowrap;
}

.retro-btn:hover {
  background: linear-gradient(180deg, #5a5a5e 0%, #3a3a3e 100%);
  color: #fff;
}

.retro-btn:active {
  border-bottom: 1px solid #1a1a1e;
  transform: translateY(1px);
}

.retro-btn.active {
  background: linear-gradient(180deg, #2a4a2a 0%, #1a3a1a 100%);
  border-color: #33ff33;
  color: #33ff33;
}

.panel-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #888;
  padding: 6px 10px;
  background: linear-gradient(180deg, #252528 0%, #1a1a1e 100%);
  border-bottom: 1px solid #333;
}

.hex-view {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.hex-byte { padding: 0 1px; cursor: pointer; border-radius: 1px; }
.hex-byte:hover { background: rgba(255,255,255,0.1); }

.reg-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  font-weight: 700;
}

.reg-changed {
  animation: regFlash 0.5s ease-out;
}

@keyframes regFlash {
  0% { background: rgba(255, 255, 0, 0.4); }
  100% { background: transparent; }
}

@keyframes diskBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.disk-active { animation: diskBlink 0.15s ease-in-out infinite; }

.terminal-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  animation: blink 1s step-end infinite;
}

.terminal-cursor.green { background: var(--term-green); }
.terminal-cursor.amber { background: var(--term-amber); }
.terminal-cursor.white-theme { background: var(--term-white); }
.terminal-cursor.blue-theme { background: #1a1a2e; }

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

.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-track { background: #1a1a1e; }
.scroll-thin::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 3px; }
.scroll-thin::-webkit-scrollbar-thumb:hover { background: #5a5a5e; }

.tab-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 12px;
  background: #1a1a1e;
  border: 1px solid #333;
  border-bottom: none;
  color: #666;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
}

.tab-btn.active {
  background: #252528;
  color: #aaa;
  border-color: #444;
}

.drop-zone {
  border: 2px dashed #444;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

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

.mmu-bar {
  width: 24px;
  border-radius: 2px;
  overflow: hidden;
  border: 1px solid #555;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
}

.crt-flicker { animation: flicker 5s infinite; }

.floppy-icon {
  width: 40px;
  height: 42px;
  background: linear-gradient(180deg, #2a2a2e 0%, #1a1a1e 100%);
  border: 1px solid #555;
  border-radius: 2px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.floppy-icon::before {
  content: '';
  width: 20px;
  height: 8px;
  background: #555;
  border-radius: 0 0 2px 2px;
  position: absolute;
  top: 0;
}

.floppy-icon::after {
  content: '';
  width: 14px;
  height: 14px;
  background: #111;
  border-radius: 50%;
  position: absolute;
  bottom: 6px;
  border: 1px solid #444;
}

.bdos-log-entry {
  font-size: 10px;
  padding: 1px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

@media (max-width: 768px) {
  .desktop-only { display: none !important; }
}

@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}