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

body {
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #1a6b1a; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #33ff33; }

.glow-green {
  text-shadow: 0 0 10px #33ff3366, 0 0 20px #33ff3333, 0 0 40px #33ff3322;
}

.glow-amber {
  text-shadow: 0 0 8px #ffaa0066, 0 0 16px #ffaa0033;
}

.crt-screen {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(51, 255, 51, 0.15), inset 0 0 60px rgba(0,0,0,0.5);
}

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

.key-btn {
  background: linear-gradient(180deg, #d4c5a9 0%, #b8a88c 100%);
  color: #222;
  border: 1px solid #8a7a5e;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  min-width: 28px;
  text-align: center;
  transition: all 0.05s ease;
  box-shadow: 0 2px 0 #6b5d42, 0 3px 3px rgba(0,0,0,0.3);
  user-select: none;
}

.key-btn:active, .key-btn.pressed {
  transform: translateY(2px);
  box-shadow: 0 0 0 #6b5d42, 0 1px 1px rgba(0,0,0,0.3);
  background: linear-gradient(180deg, #b8a88c 0%, #a0926e 100%);
}

.key-btn.modifier {
  background: linear-gradient(180deg, #8a7a5e 0%, #6b5d42 100%);
  color: #e0d8c8;
  border-color: #554a36;
  box-shadow: 0 2px 0 #3d3425, 0 3px 3px rgba(0,0,0,0.3);
}

.key-btn.modifier:active, .key-btn.modifier.pressed {
  background: linear-gradient(180deg, #6b5d42 0%, #554a36 100%);
  transform: translateY(2px);
  box-shadow: 0 0 0 #3d3425, 0 1px 1px rgba(0,0,0,0.3);
}

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

.led-on {
  background: #33ff33;
  box-shadow: 0 0 4px #33ff33, 0 0 8px #33ff3366;
}

.led-off {
  background: #1a3a1a;
}

.led-red {
  background: #ff3333;
  box-shadow: 0 0 4px #ff3333, 0 0 8px #ff333366;
}

.led-amber {
  background: #ffaa00;
  box-shadow: 0 0 4px #ffaa00, 0 0 8px #ffaa0066;
}

.panel {
  border: 1px solid #1a6b1a;
  background: #0d0d0d;
  border-radius: 4px;
}

.panel-header {
  background: #111;
  border-bottom: 1px solid #1a6b1a;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #33ff33;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hex-row {
  font-size: 11px;
  line-height: 1.6;
  white-space: pre;
}

.hex-byte { transition: background 0.3s ease; }
.hex-byte.flash { background: #ffaa0044; }
.hex-byte.breakpoint { color: #ff3333; }

.mem-segment {
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 3px 6px;
  border-radius: 2px;
  font-size: 10px;
}

.mem-segment:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(2px);
}

.badge {
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.ctrl-btn {
  background: #1a1a1a;
  border: 1px solid #1a6b1a;
  color: #33ff33;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.1s ease;
}

.ctrl-btn:hover { background: #1a6b1a33; border-color: #33ff33; }
.ctrl-btn:active { background: #1a6b1a66; transform: scale(0.97); }
.ctrl-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.console-input {
  background: #080808;
  border: 1px solid #1a6b1a;
  color: #33ff33;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 3px;
  outline: none;
  width: 100%;
}

.console-input:focus { border-color: #33ff33; box-shadow: 0 0 8px #33ff3333; }

@keyframes pulse-amber {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.pulse-amber { animation: pulse-amber 1.5s ease-in-out infinite; }

@keyframes power-on {
  0% { transform: scaleY(0.003) scaleX(0.5); filter: brightness(3); }
  30% { transform: scaleY(0.003) scaleX(1); filter: brightness(3); }
  50% { transform: scaleY(1) scaleX(1); filter: brightness(1.5); }
  100% { transform: scaleY(1) scaleX(1); filter: brightness(1); }
}

.power-on-anim { animation: power-on 0.6s ease-out forwards; }

@media (max-width: 1199px) {
  .desktop-3col { flex-direction: column !important; }
  .desktop-3col > div { width: 100% !important; max-width: 100% !important; }
}

@media (max-width: 767px) {
  .key-btn { font-size: 8px; padding: 3px 4px; min-width: 22px; }
}

input[type="range"] {
  -webkit-appearance: none;
  background: #1a1a1a;
  border: 1px solid #1a6b1a;
  border-radius: 3px;
  height: 6px;
  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 #33ff3366;
}