:root {
  --bg: #0d0d0d;
  --board: #8B7355;
  --board-dark: #6b5a42;
  --led-on: #ff0000;
  --led-off: #2a0000;
  --led-glow: 0 0 8px #ff0000, 0 0 20px rgba(255,0,0,0.4);
  --key-bg: #1a1a1a;
  --key-hover: #2a2a2a;
  --key-text: #e0e0e0;
  --gold: #c4a35a;
  --green: #00ff41;
  --amber: #ffb000;
  --mono: 'IBM Plex Mono', 'Courier New', monospace;
  --display: 'Oswald', sans-serif;
}

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

body {
  background: var(--bg);
  font-family: var(--mono);
  color: #ccc;
  min-height: 100vh;
  overflow-x: hidden;
}

.kim-key {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--key-bg);
  color: var(--key-text);
  border: 1px solid #333;
  border-bottom: 3px solid #111;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.08s;
  min-width: 48px;
  height: 44px;
  padding: 0 6px;
  -webkit-tap-highlight-color: transparent;
}

.kim-key:hover {
  background: var(--key-hover);
  border-color: #555;
}

.kim-key:active, .kim-key.pressed {
  transform: translateY(2px);
  border-bottom-width: 1px;
  background: #111;
}

.kim-key.func-key {
  background: #2a1a0a;
  border-color: #5a3a1a;
  color: var(--gold);
}

.kim-key.func-key:hover {
  background: #3a2a1a;
}

.kim-key.go-key {
  background: #1a2a0a;
  border-color: #3a5a1a;
  color: #6f6;
}

.kim-key.go-key:hover {
  background: #2a3a1a;
}

.kim-key.rs-key {
  background: #2a0a0a;
  border-color: #5a1a1a;
  color: #f66;
}

.kim-key.rs-key:hover {
  background: #3a1a1a;
}

.pcb-board {
  background: 
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.15) 0%, transparent 50%),
    linear-gradient(135deg, #8B7355 0%, #7a6548 50%, #8B7355 100%);
  position: relative;
  overflow: hidden;
}

.pcb-board::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 8px, rgba(180,140,80,0.08) 8px, rgba(180,140,80,0.08) 9px),
    repeating-linear-gradient(90deg, transparent, transparent 12px, rgba(180,140,80,0.06) 12px, rgba(180,140,80,0.06) 13px);
  pointer-events: none;
}

.power-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 1px solid #333;
  transition: all 0.3s;
}

.power-led.on {
  background: #00ff41;
  box-shadow: 0 0 6px #00ff41, 0 0 15px rgba(0,255,65,0.4);
}

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

.crt-overlay {
  pointer-events: none;
  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
  );
  z-index: 2;
}

@keyframes powerOn {
  0% { opacity: 0; transform: scale(0.98); }
  50% { opacity: 0.5; }
  100% { opacity: 1; transform: scale(1); }
}

.power-on-anim {
  animation: powerOn 0.5s ease-out;
}

.toggle-switch {
  width: 48px;
  height: 24px;
  background: #222;
  border-radius: 12px;
  border: 2px solid #444;
  position: relative;
  cursor: pointer;
  transition: all 0.3s;
  flex-shrink: 0;
}

.toggle-switch.on {
  background: #1a3a1a;
  border-color: #2a5a2a;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #666;
  border-radius: 50%;
  top: 1px;
  left: 1px;
  transition: all 0.3s;
}

.toggle-switch.on::after {
  left: 25px;
  background: #0f0;
  box-shadow: 0 0 6px #0f0;
}

@keyframes flicker {
  0% { opacity: 1; }
  25% { opacity: 0.2; }
  50% { opacity: 0.8; }
  75% { opacity: 0.1; }
  100% { opacity: 1; }
}

.flickering {
  animation: flicker 0.4s ease-in-out;
}