:root {
  --phosphor: #33ff33;
  --phosphor-dim: #1a8c1a;
  --phosphor-glow: rgba(51, 255, 51, 0.3);
  --bg: #0a0a0a;
  --panel-bg: #111111;
  --border: #222;
}

body.amber {
  --phosphor: #ffb000;
  --phosphor-dim: #8c6000;
  --phosphor-glow: rgba(255, 176, 0, 0.3);
}

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

body {
  background: var(--bg);
  color: var(--phosphor);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  overflow-x: hidden;
  min-height: 100vh;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.97; }
  83% { opacity: 0.99; }
}

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

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

@keyframes powerDown {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  50% { transform: scaleY(0.01) scaleX(1.2); opacity: 0.8; filter: brightness(2); }
  100% { transform: scale(0); opacity: 0; filter: brightness(0); }
}

@keyframes bootGlow {
  0% { text-shadow: 0 0 2px var(--phosphor); }
  50% { text-shadow: 0 0 8px var(--phosphor), 0 0 15px var(--phosphor-glow); }
  100% { text-shadow: 0 0 2px var(--phosphor); }
}

.crt-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 
    0 0 20px var(--phosphor-glow),
    inset 0 0 60px rgba(0,0,0,0.5),
    0 0 100px rgba(0,0,0,0.8);
  animation: flicker 0.15s infinite;
}

.crt-container::before {
  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: 10;
}

.crt-container::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: 11;
}

.terminal-text {
  font-family: 'Share Tech Mono', 'IBM Plex Mono', monospace;
  font-size: 15px;
  line-height: 1.35;
  color: var(--phosphor);
  text-shadow: 0 0 3px var(--phosphor-glow);
  white-space: pre-wrap;
  word-break: break-all;
}

.cursor-blink {
  animation: blink 1s step-end infinite;
  color: var(--phosphor);
  text-shadow: 0 0 6px var(--phosphor);
}

.nameplate {
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 40%, #1a1a1a 100%);
  border-bottom: 2px solid #444;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 8px rgba(0,0,0,0.5);
}

.nameplate-text {
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: #ccc;
  text-shadow: 0 -1px 0 #000, 0 1px 0 rgba(255,255,255,0.1);
}

.power-switch {
  width: 48px; height: 24px;
  border-radius: 12px;
  background: #333;
  border: 2px solid #555;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.power-switch.on {
  background: #1a4a1a;
  border-color: var(--phosphor-dim);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 0 8px var(--phosphor-glow);
}

.power-switch .knob {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #888 0%, #555 100%);
  position: absolute;
  top: 1px; left: 1px;
  transition: all 0.3s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.power-switch.on .knob {
  left: 25px;
  background: linear-gradient(180deg, var(--phosphor) 0%, var(--phosphor-dim) 100%);
  box-shadow: 0 0 6px var(--phosphor-glow);
}

.tab-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 4px 10px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #666;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: #222;
  color: var(--phosphor);
  border-color: var(--phosphor-dim);
  text-shadow: 0 0 4px var(--phosphor-glow);
}

.disk-led {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #333;
  display: inline-block;
  transition: all 0.1s;
}

.disk-led.active {
  background: var(--phosphor);
  box-shadow: 0 0 6px var(--phosphor), 0 0 12px var(--phosphor-glow);
}

.register-flash {
  animation: bootGlow 0.5s ease-out;
}

.control-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  padding: 6px 14px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 3px;
}

.control-btn:hover {
  background: #252525;
  color: var(--phosphor);
  border-color: var(--phosphor-dim);
}

.control-btn:active {
  transform: scale(0.97);
}

.file-btn {
  position: relative;
  overflow: hidden;
}

.file-btn input[type="file"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}

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

.memory-region-vector { color: #ff6b35; }
.memory-region-tpa { color: #33ff33; }
.memory-region-bdos { color: #4a9eff; }
.memory-region-bios { color: #c77dff; }

.log-bios { color: #00d4ff; }
.log-bdos { color: #ff6bff; }
.log-disk { color: #ffd700; }

@media (max-width: 1024px) {
  .main-layout {
    flex-direction: column !important;
  }
  .terminal-panel, .inspector-panel {
    width: 100% !important;
  }
  .inspector-panel {
    max-height: 300px;
  }
}

@media (max-width: 640px) {
  .terminal-text {
    font-size: 11px;
    line-height: 1.2;
  }
  .nameplate-text {
    font-size: 12px;
    letter-spacing: 1px;
  }
}