:root {
  --lcd-bg: #9EBC4F;
  --lcd-bg-off: #8a9a6a;
  --lcd-pixel: #2a3a10;
  --body-dark: #1a1a1a;
  --body-mid: #2d2d2d;
  --body-light: #3a3a3a;
  --accent-amber: #FF8C00;
  --accent-green: #00cc44;
  --accent-red: #ff3333;
  --text-primary: #e0e0e0;
  --text-dim: #888;
}

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

body {
  background: #0d0d0d;
  color: var(--text-primary);
  font-family: 'Share Tech Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(158,188,79,0.05) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(255,140,0,0.03) 0%, transparent 40%);
  pointer-events: none;
  z-index: 0;
}

#root { position: relative; z-index: 1; }

.font-vt323 { font-family: 'VT323', monospace; }
.font-mono { font-family: 'Share Tech Mono', monospace; }

.device-body {
  background: linear-gradient(135deg, #3a3a3a 0%, #252525 40%, #1e1e1e 60%, #2a2a2a 100%);
  border-radius: 16px;
  border: 2px solid #444;
  box-shadow: 
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 60px rgba(0,0,0,0.4);
  position: relative;
}

.device-body::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 14px;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.02) 2px,
    rgba(0,0,0,0.02) 4px
  );
  pointer-events: none;
}

.lcd-recess {
  background: #1a1a1a;
  border-radius: 6px;
  padding: 6px;
  box-shadow: 
    inset 0 2px 8px rgba(0,0,0,0.8),
    inset 0 0 2px rgba(0,0,0,0.5);
  border: 1px solid #111;
}

.lcd-screen {
  background: var(--lcd-bg);
  border-radius: 3px;
  image-rendering: pixelated;
  box-shadow: 0 0 15px rgba(158,188,79,0.15);
}

.lcd-screen-off {
  background: var(--lcd-bg-off);
  box-shadow: none;
}

.key-btn {
  background: linear-gradient(180deg, #555 0%, #3a3a3a 40%, #333 100%);
  border: 1px solid #222;
  border-radius: 4px;
  color: #ddd;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  padding: 6px 4px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 3px 0 #1a1a1a, 0 4px 6px rgba(0,0,0,0.4);
  transition: all 0.08s ease;
  text-align: center;
  min-width: 32px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key-btn:active, .key-btn.pressed {
  background: linear-gradient(180deg, #3a3a3a 0%, #333 40%, #2a2a2a 100%);
  box-shadow: 0 1px 0 #1a1a1a, 0 1px 3px rgba(0,0,0,0.4);
  transform: translateY(2px);
}

.key-btn.special {
  background: linear-gradient(180deg, #6a4a00 0%, #4a3500 40%, #3a2a00 100%);
  color: #ffcc66;
  border-color: #5a4000;
}

.key-btn.special:active, .key-btn.special.pressed {
  background: linear-gradient(180deg, #4a3500 0%, #3a2a00 40%, #2a2000 100%);
}

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

.power-led.running {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green), 0 0 12px rgba(0,204,68,0.3);
}

.power-led.halted {
  background: var(--accent-red);
  box-shadow: 0 0 6px var(--accent-red);
}

.power-led.off {
  background: #333;
  box-shadow: none;
}

.control-btn {
  background: linear-gradient(180deg, #444 0%, #333 100%);
  border: 1px solid #555;
  border-radius: 6px;
  color: #ddd;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.control-btn:hover {
  background: linear-gradient(180deg, #555 0%, #444 100%);
  border-color: #666;
}

.control-btn:active {
  transform: translateY(1px);
}

.control-btn.run { border-color: #00cc44; color: #00cc44; }
.control-btn.run:hover { background: rgba(0,204,68,0.15); }
.control-btn.pause { border-color: #ffaa00; color: #ffaa00; }
.control-btn.pause:hover { background: rgba(255,170,0,0.15); }
.control-btn.reset { border-color: #ff4444; color: #ff4444; }
.control-btn.reset:hover { background: rgba(255,68,68,0.15); }

.upload-zone {
  border: 2px dashed #555;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  background: rgba(255,255,255,0.02);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-amber);
  background: rgba(255,140,0,0.05);
}

.panel {
  background: rgba(30,30,30,0.9);
  border: 1px solid #333;
  border-radius: 8px;
  overflow: hidden;
}

.panel-header {
  background: rgba(50,50,50,0.8);
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  font-size: 13px;
  color: var(--accent-amber);
}

.panel-header:hover { background: rgba(60,60,60,0.8); }

.console-log {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: #44cc44;
  padding: 8px;
  overflow-y: auto;
  max-height: 200px;
  line-height: 1.5;
}

.register-val {
  font-family: 'Share Tech Mono', monospace;
  background: rgba(0,0,0,0.3);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #333;
  display: inline-block;
  min-width: 50px;
  text-align: right;
}

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

@keyframes flash-register {
  0% { background: rgba(255,140,0,0.4); }
  100% { background: rgba(0,0,0,0.3); }
}

.hex-dump {
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre;
}

.io-led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid #444;
  transition: all 0.15s;
}

.io-led.on { background: var(--accent-amber); box-shadow: 0 0 4px var(--accent-amber); }
.io-led.off { background: #2a2a2a; }

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

.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: #1a1a1a; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: #555; }

@media (max-width: 768px) {
  .key-btn { font-size: 9px; min-width: 26px; min-height: 24px; padding: 4px 2px; }
}