@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=JetBrains+Mono:wght@300;400;700&display=swap');

:root {
  --charcoal: #1a1a2e;
  --indigo: #16213e;
  --turquoise: #0f3460;
  --accent: #e94560;
  --cream: #eaeaea;
  --amber: #f5a623;
  --green: #39ff14;
  --dark-bg: #0d0d1a;
  --panel-bg: #12121f;
}

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

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

.pixel-font {
  font-family: 'Press Start 2P', cursive;
}

/* CRT Effect Overlay */
.crt-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 10;
}

.crt-scanlines {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 1px,
    rgba(0, 0, 0, 0.15) 1px,
    rgba(0, 0, 0, 0.15) 2px
  );
}

.crt-curvature {
  border-radius: 12px;
  box-shadow:
    inset 0 0 60px rgba(0,0,0,0.4),
    inset 0 0 10px rgba(0,0,0,0.3),
    0 0 30px rgba(15, 52, 96, 0.3);
  overflow: hidden;
}

.crt-glow {
  box-shadow:
    0 0 40px rgba(15, 52, 96, 0.4),
    0 0 80px rgba(15, 52, 96, 0.2),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* LED indicators */
@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.led-power {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green), 0 0 12px var(--green);
}

.led-activity {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
  animation: led-blink 0.3s infinite;
}

.led-off {
  background: #333;
  box-shadow: none;
  animation: none;
}

/* Console button styles */
.console-btn {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.1s;
  text-transform: uppercase;
  position: relative;
  box-shadow: 0 4px 0 rgba(0,0,0,0.5), 0 6px 10px rgba(0,0,0,0.3);
}

.console-btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 3px 6px rgba(0,0,0,0.3);
}

.console-btn-primary {
  background: var(--accent);
  color: white;
}

.console-btn-secondary {
  background: var(--turquoise);
  color: var(--cream);
}

.console-btn-dark {
  background: #2a2a3e;
  color: #888;
}

/* Boot animation */
@keyframes boot-glow {
  0% { opacity: 0; filter: blur(10px); }
  50% { opacity: 1; filter: blur(0px); }
  100% { opacity: 1; filter: blur(0px); }
}

@keyframes boot-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}

@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.boot-text {
  animation: boot-glow 1.5s ease-out forwards;
}

.boot-scan-line {
  position: absolute;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(15, 52, 96, 0.8), transparent);
  animation: boot-scan 2s linear infinite;
}

.pulse-text {
  animation: pulse-slow 1.5s infinite;
}

/* HuCard slot styling */
.hucard-slot {
  border: 3px solid #2a2a4e;
  background: linear-gradient(180deg, #0a0a18, #151528, #0a0a18);
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.8),
    inset 0 -2px 8px rgba(0,0,0,0.5),
    0 0 20px rgba(15, 52, 96, 0.2);
  border-radius: 8px;
}

/* Gamepad styles */
.dpad-btn {
  width: 40px;
  height: 40px;
  background: #1a1a2e;
  border: 2px solid #2a2a4e;
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.dpad-btn:active, .dpad-btn.pressed {
  background: var(--turquoise);
  color: white;
  border-color: #0f3460;
}

.action-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid;
  font-family: 'Press Start 2P', cursive;
  font-size: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: all 0.05s;
}

.action-btn:active, .action-btn.pressed {
  transform: scale(0.95);
}

/* Debug panel */
.debug-panel {
  background: #0a0a12;
  border: 1px solid #1a3a1a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--green);
}

.debug-amber {
  color: var(--amber);
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background: var(--turquoise); border-radius: 3px; }

/* Responsive canvas */
.emu-canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Console texture */
.console-texture {
  background: linear-gradient(180deg, #1e1e30, #1a1a2a, #161625);
  border-top: 2px solid #2a2a40;
  border-bottom: 2px solid #0a0a15;
}

.embossed-text {
  text-shadow: 0 1px 0 rgba(255,255,255,0.05), 0 -1px 0 rgba(0,0,0,0.5);
}

/* Footer scanline */
.footer-scanlines {
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.1) 2px,
      rgba(0, 0, 0, 0.1) 4px
    ),
    linear-gradient(180deg, var(--charcoal), var(--dark-bg));
}

/* Volume slider */
input[type="range"].retro-slider {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: #1a1a2e;
  border-radius: 3px;
  outline: none;
}

input[type="range"].retro-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--turquoise);
  border: 2px solid var(--cream);
  cursor: pointer;
}

/* Tab styles */
.tab-active {
  border-bottom: 2px solid var(--accent);
  color: var(--accent);
}

.tab-inactive {
  border-bottom: 2px solid transparent;
  color: #666;
}

/* Drop zone highlight */
.drop-highlight {
  border-color: var(--accent) !important;
  background: rgba(233, 69, 96, 0.05) !important;
  box-shadow: 0 0 30px rgba(233, 69, 96, 0.2) !important;
}

@keyframes frame-flash {
  0% { border-color: var(--turquoise); }
  50% { border-color: var(--accent); }
  100% { border-color: var(--turquoise); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .console-btn {
    font-size: 7px;
    padding: 6px 10px;
  }
}