:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-panel: #0d0d0d;
  --border: #1a3a1a;
  --text-primary: #00ff41;
  --text-dim: #007a20;
  --text-bright: #33ff66;
  --accent: #00ff41;
  --accent-dim: #004010;
  --error: #ff3333;
  --warning: #ffb000;
  --info: #3399ff;
}

.theme-amber {
  --text-primary: #ffb000;
  --text-dim: #7a5500;
  --text-bright: #ffc933;
  --accent: #ffb000;
  --accent-dim: #3a2800;
  --border: #3a2a0a;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  height: 100vh;
}

#root {
  height: 100vh;
  overflow: hidden;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-primary); }

.scanline-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.08) 2px,
    rgba(0,0,0,0.08) 4px
  );
}

.crt-glow {
  box-shadow: 0 0 20px rgba(0,255,65,0.05), inset 0 0 30px rgba(0,255,65,0.02);
  border-radius: 4px;
}

.theme-amber .crt-glow {
  box-shadow: 0 0 20px rgba(255,176,0,0.05), inset 0 0 30px rgba(255,176,0,0.02);
}

@keyframes glow-flash {
  0% { background-color: transparent; }
  20% { background-color: rgba(0,255,65,0.3); }
  100% { background-color: transparent; }
}

.theme-amber .reg-flash {
  animation-name: glow-flash-amber;
}

@keyframes glow-flash-amber {
  0% { background-color: transparent; }
  20% { background-color: rgba(255,176,0,0.3); }
  100% { background-color: transparent; }
}

.reg-flash {
  animation: glow-flash 0.8s ease-out;
}

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

.cursor-blink {
  animation: blink 1s step-end infinite;
}

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

.status-pulse {
  animation: pulse 2s ease-in-out infinite;
}

.led-active {
  animation: pulse 0.3s ease-in-out;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.btn-retro {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
  box-shadow: 0 2px 0 var(--accent-dim);
  position: relative;
  top: 0;
}

.btn-retro:hover {
  background: var(--accent-dim);
  border-color: var(--text-primary);
  box-shadow: 0 0 8px rgba(0,255,65,0.2), 0 2px 0 var(--accent-dim);
}

.theme-amber .btn-retro:hover {
  box-shadow: 0 0 8px rgba(255,176,0,0.2), 0 2px 0 var(--accent-dim);
}

.btn-retro:active {
  top: 2px;
  box-shadow: none;
}

.btn-retro.active {
  background: var(--accent-dim);
  border-color: var(--text-primary);
}

.terminal-output {
  background: #000;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.4;
  padding: 8px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.hex-view {
  font-size: 11px;
  line-height: 1.5;
}

.mmio-clint { background: rgba(51,153,255,0.1); }
.mmio-uart { background: rgba(0,255,65,0.1); }

input[type="text"], input[type="number"], select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 2px;
  outline: none;
}

input[type="text"]:focus, select:focus {
  border-color: var(--text-primary);
}

input[type="range"] {
  -webkit-appearance: none;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  height: 6px;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--text-primary);
  border-radius: 50%;
  cursor: pointer;
}

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: 4px;
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--text-primary);
  background: var(--accent-dim);
}

.tooltip {
  position: relative;
}

.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: var(--text-primary);
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 100;
  border: 1px solid var(--border);
}

.tab-active {
  border-bottom: 2px solid var(--text-primary);
  color: var(--text-primary) !important;
}

@media (max-width: 1024px) {
  .desktop-layout { display: none !important; }
  .mobile-layout { display: flex !important; }
}

@media (min-width: 1025px) {
  .desktop-layout { display: flex !important; }
  .mobile-layout { display: none !important; }
}