:root {
  --bg-dark: #0d0d0d;
  --bg-panel: #1a1a1a;
  --panel-blue: #2e4a6b;
  --panel-blue-light: #3a5a7c;
  --led-on: #ff2200;
  --led-off: #330808;
  --led-glow: rgba(255, 34, 0, 0.6);
  --amber: #ffaa00;
  --amber-dim: #a67000;
  --chrome: #b8b8b8;
  --paper: #f5f0e0;
  --ink: #2a2a2a;
  --green-feed: #8fbc8f;
}

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

body {
  background: var(--bg-dark);
  color: #ccc;
  font-family: 'IBM Plex Mono', monospace;
  overflow-x: hidden;
}

/* Brushed metal texture */
.brushed-metal {
  background: linear-gradient(135deg, #2e4a6b 0%, #3a5a7c 25%, #2e4a6b 50%, #3a5a7c 75%, #2e4a6b 100%);
  background-size: 4px 4px;
  position: relative;
}

.brushed-metal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 1px,
    rgba(255,255,255,0.03) 1px,
    rgba(255,255,255,0.03) 2px
  );
  pointer-events: none;
}

/* LED styles */
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--led-off);
  transition: all 0.05s ease;
  flex-shrink: 0;
}

.led.on {
  background: var(--led-on);
  box-shadow: 0 0 6px 2px var(--led-glow), 0 0 12px 4px rgba(255,34,0,0.3);
}

/* Toggle switch */
.toggle-switch {
  width: 16px;
  height: 36px;
  background: linear-gradient(180deg, #666 0%, #999 20%, #ddd 40%, #bbb 60%, #888 100%);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  border: 1px solid #555;
  transition: transform 0.1s ease;
  flex-shrink: 0;
}

.toggle-switch.up {
  transform: perspective(100px) rotateX(15deg);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.4);
}

.toggle-switch.down {
  transform: perspective(100px) rotateX(-15deg);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.toggle-switch:hover {
  filter: brightness(1.1);
}

/* Control button (momentary) */
.ctrl-switch {
  width: 16px;
  height: 36px;
  background: linear-gradient(180deg, #777 0%, #aaa 30%, #ccc 50%, #aaa 70%, #777 100%);
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid #555;
  flex-shrink: 0;
  transition: transform 0.05s ease;
}

.ctrl-switch:active {
  transform: scale(0.95);
  filter: brightness(0.9);
}

/* Teletype paper */
.teletype-paper {
  background-color: var(--paper);
  background-image: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 19px,
      rgba(0,0,0,0.03) 19px,
      rgba(0,0,0,0.03) 20px
    );
  color: var(--ink);
  font-family: 'Share Tech Mono', 'Courier New', monospace;
  font-size: 14px;
  line-height: 20px;
}

.tractor-feed {
  background: repeating-linear-gradient(
    0deg,
    var(--green-feed) 0px,
    var(--green-feed) 4px,
    transparent 4px,
    transparent 16px
  );
  width: 20px;
  flex-shrink: 0;
  opacity: 0.4;
}

/* Memory viewer */
.mem-row {
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  line-height: 18px;
  white-space: pre;
}

.mem-row.highlight {
  background: rgba(255, 170, 0, 0.15);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #666; }

/* Blinking cursor */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

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

/* Status dot */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.running { background: #0f0; box-shadow: 0 0 6px #0f0; }
.status-dot.halted { background: #f00; box-shadow: 0 0 6px #f00; }
.status-dot.paused { background: #ff0; box-shadow: 0 0 6px #ff0; }

/* Panel label style */
.panel-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ddd;
  text-align: center;
}

.section-title {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--amber);
}

/* File drop zone */
.drop-zone {
  border: 2px dashed #555;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.drop-zone.dragover {
  border-color: var(--amber);
  background: rgba(255, 170, 0, 0.05);
}

/* Hex input */
.hex-input {
  background: #222;
  border: 1px solid #444;
  color: var(--amber);
  font-family: 'Share Tech Mono', monospace;
  padding: 4px 8px;
  border-radius: 3px;
  width: 80px;
  text-align: center;
}

.hex-input:focus {
  outline: none;
  border-color: var(--amber);
}

/* Button styles */
.retro-btn {
  background: linear-gradient(180deg, #555 0%, #333 100%);
  border: 1px solid #666;
  color: #ddd;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 3px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.1s ease;
}

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

.retro-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

.retro-btn.primary {
  border-color: var(--amber);
  color: var(--amber);
}

/* Tooltip */
[data-tooltip] {
  position: relative;
}

[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 10px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
}

@media (max-width: 768px) {
  .led { width: 7px; height: 7px; }
  .toggle-switch { width: 12px; height: 28px; }
  .ctrl-switch { width: 12px; height: 28px; }
  .panel-label { font-size: 6px; }
  .teletype-paper { font-size: 12px; line-height: 18px; }
}