@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
  --beige: #f5e6ca;
  --amber: #ffb347;
  --neon-green: #39ff14;
  --dark-bg: #0d0d1a;
  --panel-bg: #1a1a2e;
  --panel-border: #2a2a4a;
}

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

body {
  font-family: 'VT323', monospace;
  background: var(--dark-bg);
}

.font-retro { font-family: 'Press Start 2P', monospace; }
.font-vt { font-family: 'VT323', monospace; }

/* Tricolor stripe */
.tricolor {
  height: 4px;
  background: linear-gradient(to right, #002395 33.33%, #fff 33.33%, #fff 66.66%, #ED2939 66.66%);
}

/* CRT bezel */
.crt-bezel {
  background: linear-gradient(145deg, #e8d5b5, #c4a882);
  border-radius: 20px;
  padding: 20px;
  box-shadow:
    0 0 0 3px #8b7355,
    0 0 0 6px #6b5a40,
    0 8px 32px rgba(0,0,0,0.6),
    inset 0 2px 4px rgba(255,255,255,0.3);
}

/* CRT screen effects */
.crt-screen {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.crt-screen.crt-effects::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.15) 2px,
    rgba(0,0,0,0.15) 4px
  );
  pointer-events: none;
  z-index: 2;
}

.crt-screen.crt-effects::before {
  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;
}

/* Power LED */
.led {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s;
}
.led-off { background: #444; box-shadow: none; }
.led-on { background: #39ff14; box-shadow: 0 0 8px #39ff14, 0 0 16px #39ff14; }
.led-error { background: #ff3939; box-shadow: 0 0 8px #ff3939, 0 0 16px #ff3939; }

/* Power button */
.power-btn {
  background: radial-gradient(circle at 35% 35%, #ff4444, #cc0000, #880000);
  border: 3px solid #660000;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4), inset 0 1px 2px rgba(255,255,255,0.3);
}
.power-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 1px 2px rgba(255,255,255,0.3), 0 0 20px rgba(255,68,68,0.3);
}
.power-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4), inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Key styling */
.mo5-key {
  font-family: 'VT323', monospace;
  font-size: 14px;
  min-width: 36px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #555;
  background: linear-gradient(180deg, #4a4a5a, #3a3a4a);
  color: #ddd;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.mo5-key:hover { background: linear-gradient(180deg, #5a5a6a, #4a4a5a); }
.mo5-key:active, .mo5-key.pressed {
  background: linear-gradient(180deg, #6a6a7a, #5a5a6a);
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.mo5-key.special-orange {
  background: linear-gradient(180deg, #e07020, #c06010);
  color: #fff;
  border-color: #a05010;
}
.mo5-key.special-blue {
  background: linear-gradient(180deg, #3060c0, #2050a0);
  color: #fff;
  border-color: #1040a0;
}

/* ROM drop zone */
.rom-dropzone {
  border: 2px dashed #4a4a6a;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}
.rom-dropzone:hover, .rom-dropzone.drag-over {
  border-color: var(--amber);
  background: rgba(255,179,71,0.05);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #1a1a2e; }
::-webkit-scrollbar-thumb { background: #3a3a5a; border-radius: 3px; }

/* Pulse animation for LED */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 8px #39ff14, 0 0 16px #39ff14; }
  50% { box-shadow: 0 0 4px #39ff14, 0 0 8px #39ff14; }
}
.led-on { animation: pulse-green 2s ease-in-out infinite; }

/* Waveform canvas */
.waveform-canvas {
  border: 1px solid #2a4a2a;
  border-radius: 4px;
  background: #0a1a0a;
}

/* Debug panel */
.debug-label {
  color: var(--amber);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  letter-spacing: 1px;
}

/* Memory region colors */
.mem-video { background: rgba(59, 130, 246, 0.15); }
.mem-sysram { background: rgba(34, 197, 94, 0.15); }
.mem-userram { background: rgba(234, 179, 8, 0.15); }
.mem-io { background: rgba(239, 68, 68, 0.15); }
.mem-rom { background: rgba(168, 85, 247, 0.15); }

/* Responsive */
@media (max-width: 768px) {
  .crt-bezel { padding: 10px; border-radius: 12px; }
  .mo5-key { min-width: 28px; height: 28px; font-size: 11px; }
}

/* Static noise animation */
@keyframes static-noise {
  0% { opacity: 0.03; }
  50% { opacity: 0.06; }
  100% { opacity: 0.03; }
}