:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #0d1321;
  --bg-panel: #111827;
  --green: #00ff41;
  --green-dim: #00aa2a;
  --green-dark: #003d10;
  --amber: #ffb000;
  --amber-dim: #cc8d00;
  --red: #ff3333;
  --text: #c0c8d8;
  --text-dim: #6b7a90;
  --border: #1e2a3a;
}

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

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

/* CRT Scanline overlay */
.crt-overlay {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  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
  );
}

/* Vignette effect */
.vignette {
  pointer-events: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9998;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.6) 100%);
}

/* Noise background texture */
.noise-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

/* Panel styling */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.03),
    0 4px 20px rgba(0,0,0,0.4);
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,65,0.15), transparent);
}

/* Mode toggle buttons */
.mode-btn {
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  padding: 12px 32px;
  border: 2px solid var(--border);
  background: linear-gradient(180deg, #1a2234 0%, #0f1724 100%);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 2px 4px rgba(0,0,0,0.3),
    0 4px 0 #080c14;
  position: relative;
  user-select: none;
  letter-spacing: 2px;
}

.mode-btn:active {
  transform: translateY(2px);
  box-shadow: 
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 0px 0 #080c14;
}

.mode-btn.active-green {
  border-color: var(--green);
  color: var(--green);
  box-shadow: 
    inset 0 1px 0 rgba(0,255,65,0.1),
    0 0 15px rgba(0,255,65,0.2),
    0 4px 0 #080c14;
  text-shadow: 0 0 10px rgba(0,255,65,0.5);
}

.mode-btn.active-amber {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 
    inset 0 1px 0 rgba(255,176,0,0.1),
    0 0 15px rgba(255,176,0,0.2),
    0 4px 0 #080c14;
  text-shadow: 0 0 10px rgba(255,176,0,0.5);
}

/* Action buttons */
.btn-primary {
  font-family: 'Share Tech Mono', monospace;
  padding: 12px 24px;
  border: 2px solid var(--green);
  background: linear-gradient(180deg, rgba(0,255,65,0.15) 0%, rgba(0,255,65,0.05) 100%);
  color: var(--green);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  text-shadow: 0 0 8px rgba(0,255,65,0.4);
  letter-spacing: 1px;
}

.btn-primary:hover {
  background: linear-gradient(180deg, rgba(0,255,65,0.25) 0%, rgba(0,255,65,0.1) 100%);
  box-shadow: 0 0 20px rgba(0,255,65,0.15);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  font-family: 'Share Tech Mono', monospace;
  padding: 10px 20px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1a2234 0%, #0f1724 100%);
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--amber);
  color: var(--amber);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Amber variant */
.btn-amber {
  border-color: var(--amber);
  color: var(--amber);
  background: linear-gradient(180deg, rgba(255,176,0,0.15) 0%, rgba(255,176,0,0.05) 100%);
  text-shadow: 0 0 8px rgba(255,176,0,0.4);
}

.btn-amber:hover {
  background: linear-gradient(180deg, rgba(255,176,0,0.25) 0%, rgba(255,176,0,0.1) 100%);
  box-shadow: 0 0 20px rgba(255,176,0,0.15);
}

/* Pulsing glow animation */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(0,255,65,0.2); }
  50% { box-shadow: 0 0 25px rgba(0,255,65,0.4), 0 0 50px rgba(0,255,65,0.1); }
}

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

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

.blink {
  animation: blink 1.5s ease-in-out infinite;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--green-dim);
  border-radius: 8px;
  background: rgba(0,255,65,0.02);
  transition: all 0.2s ease;
  cursor: pointer;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--green);
  background: rgba(0,255,65,0.06);
  box-shadow: inset 0 0 30px rgba(0,255,65,0.05);
}

/* LCD readout */
.lcd-readout {
  background: #0a1a0a;
  border: 1px solid #1a3a1a;
  border-radius: 4px;
  padding: 12px;
  font-family: 'Share Tech Mono', monospace;
  color: var(--green-dim);
  font-size: 0.8rem;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}

/* VU Meter */
.vu-meter-track {
  height: 20px;
  background: #0a0e17;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.vu-meter-fill {
  height: 100%;
  transition: width 0.1s linear;
  background: linear-gradient(90deg, 
    var(--green) 0%, 
    var(--green) 60%, 
    var(--amber) 75%, 
    var(--red) 95%
  );
  box-shadow: 0 0 8px rgba(0,255,65,0.3);
}

/* Canvas CRT effect */
.crt-screen {
  border-radius: 4px;
  box-shadow: 
    inset 0 0 30px rgba(0,0,0,0.4),
    0 0 1px rgba(0,255,65,0.2);
  image-rendering: pixelated;
}

/* Oscilloscope canvas */
.oscilloscope {
  background: #050a05;
  border: 1px solid #1a2a1a;
  border-radius: 4px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.6);
}

/* Slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #1a2234;
  border-radius: 3px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0,255,65,0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(0,255,65,0.4);
}

/* Select styling */
select {
  font-family: 'Share Tech Mono', monospace;
  background: #0f1724;
  color: var(--green);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
}

select:focus {
  border-color: var(--green-dim);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Header scanline animation */
@keyframes headerScan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

.header-scanline {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0,255,65,0.04) 45%,
    rgba(0,255,65,0.08) 50%,
    rgba(0,255,65,0.04) 55%,
    transparent 100%
  );
  animation: headerScan 4s linear infinite;
  pointer-events: none;
}

/* Trivia ticker */
@keyframes ticker {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.ticker-text {
  animation: ticker 25s linear infinite;
  white-space: nowrap;
}

/* Preset image cards */
.preset-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--bg-secondary);
}

.preset-card:hover {
  border-color: var(--green-dim);
  box-shadow: 0 0 10px rgba(0,255,65,0.1);
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
  .mode-btn {
    padding: 10px 20px;
    font-size: 1rem;
  }
}