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

:root {
  --dec-purple: #5c2d50;
  --dec-purple-light: #7a3d6a;
  --dec-purple-dark: #3a1a32;
  --panel-bg: #2a2a2a;
  --panel-dark: #1e1e1e;
  --charcoal: #1a1a1a;
  --led-amber: #ffaa00;
  --led-green: #00ff44;
  --led-red: #ff3333;
  --term-green: #33ff33;
  --term-amber: #ffaa00;
  --text-light: #cccccc;
  --text-dim: #888888;
  --screw-color: #555;
}

body {
  background: var(--charcoal);
  font-family: 'IBM Plex Mono', 'Courier New', monospace;
  color: var(--text-light);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* LED glow effects */
.led-on-amber {
  background: var(--led-amber);
  box-shadow: 0 0 6px var(--led-amber), 0 0 12px rgba(255,170,0,0.4);
}
.led-on-green {
  background: var(--led-green);
  box-shadow: 0 0 6px var(--led-green), 0 0 12px rgba(0,255,68,0.4);
}
.led-on-red {
  background: var(--led-red);
  box-shadow: 0 0 6px var(--led-red), 0 0 12px rgba(255,51,51,0.4);
}
.led-off {
  background: #333;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

/* Toggle switch */
.switch-container {
  width: 20px;
  height: 40px;
  background: linear-gradient(180deg, #444, #222);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  border: 1px solid #555;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}
.switch-handle {
  width: 16px;
  height: 18px;
  background: linear-gradient(180deg, #ddd, #999);
  border-radius: 2px;
  position: absolute;
  transition: top 0.1s ease;
  border: 1px solid #777;
}
.switch-handle.up { top: 1px; }
.switch-handle.down { top: 20px; }

/* Control buttons */
.ctrl-btn {
  background: linear-gradient(180deg, #666, #333);
  border: 2px solid #555;
  border-radius: 4px;
  color: #ddd;
  padding: 6px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.05s ease;
  user-select: none;
  white-space: nowrap;
}
.ctrl-btn:active {
  background: linear-gradient(180deg, #444, #222);
  border-color: #444;
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

/* CRT Terminal */
.crt-screen {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}
.crt-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.15) 0px,
    rgba(0,0,0,0.15) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 2;
}
.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: 3;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.98; }
  75% { opacity: 0.995; }
}

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

@keyframes spin-disk {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-reel {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.disk-spinning {
  animation: spin-disk 0.8s linear infinite;
}

.reel-spinning {
  animation: spin-reel 1.2s linear infinite;
}

.reel-fast {
  animation: spin-reel 0.3s linear infinite;
}

/* Screw decoration */
.screw {
  width: 12px;
  height: 12px;
  background: radial-gradient(circle at 40% 40%, #777, #333);
  border-radius: 50%;
  border: 1px solid #555;
  position: relative;
}
.screw::after {
  content: '';
  position: absolute;
  top: 5px; left: 2px;
  width: 8px; height: 1px;
  background: #222;
}

/* Panel styling */
.equipment-panel {
  background: linear-gradient(180deg, #2e2e2e, #252525);
  border: 2px solid #444;
  border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 4px 12px rgba(0,0,0,0.5);
}

/* Front panel */
.front-panel {
  background: linear-gradient(180deg, var(--dec-purple), var(--dec-purple-dark));
  border: 3px solid #444;
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 6px 20px rgba(0,0,0,0.6);
  position: relative;
}

/* Power toggle */
.power-toggle {
  width: 40px;
  height: 22px;
  background: #333;
  border-radius: 11px;
  cursor: pointer;
  position: relative;
  border: 2px solid #555;
  transition: background 0.3s;
}
.power-toggle.on { background: #2a5a2a; border-color: #4a8a4a; }
.power-toggle-knob {
  width: 16px;
  height: 16px;
  background: linear-gradient(180deg, #ddd, #999);
  border-radius: 50%;
  position: absolute;
  top: 1px;
  transition: left 0.2s ease;
}

/* DB25 connector */
.db25 {
  width: 100px;
  height: 30px;
  background: linear-gradient(180deg, #888, #666);
  border-radius: 3px 3px 8px 8px;
  border: 2px solid #555;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
}
.db25-pin {
  width: 3px;
  height: 3px;
  background: #c0a030;
  border-radius: 50%;
}

/* Accuracy badge */
.vibes-badge {
  position: fixed;
  bottom: 60px;
  right: 10px;
  background: rgba(92,45,80,0.8);
  color: #ffaa00;
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 10px;
  font-family: 'IBM Plex Mono', monospace;
  z-index: 100;
  backdrop-filter: blur(4px);
}

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

/* Responsive */
@media (max-width: 768px) {
  .switch-container { width: 16px; height: 32px; }
  .switch-handle { width: 12px; height: 14px; }
  .switch-handle.down { top: 16px; }
  .ctrl-btn { padding: 4px 6px; font-size: 8px; }
}