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

:root {
  --bg-dark: #0d0d1a;
  --bg-panel: #1a1a2e;
  --bg-input: #0a0a14;
  --cyan: #00fff5;
  --magenta: #ff00ff;
  --green: #00ff41;
  --amber: #ffb000;
  --red: #ff3333;
  --white: #e0e0e0;
  --border-glow: 0 0 8px rgba(0, 255, 245, 0.4);
}

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

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

#scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  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
  );
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

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

@keyframes pixelFadeIn {
  0% { opacity: 0; transform: scale(0.8); filter: blur(4px) brightness(2); }
  50% { opacity: 0.7; filter: blur(1px) brightness(1.3); }
  100% { opacity: 1; transform: scale(1); filter: blur(0) brightness(1); }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 5px rgba(0,255,245,0.3), 0 0 10px rgba(0,255,245,0.1); }
  50% { box-shadow: 0 0 15px rgba(0,255,245,0.6), 0 0 30px rgba(0,255,245,0.2); }
}

@keyframes rainbow {
  0% { color: #ff0000; text-shadow: 0 0 10px #ff0000; }
  16% { color: #ff8800; text-shadow: 0 0 10px #ff8800; }
  33% { color: #ffff00; text-shadow: 0 0 10px #ffff00; }
  50% { color: #00ff41; text-shadow: 0 0 10px #00ff41; }
  66% { color: #00fff5; text-shadow: 0 0 10px #00fff5; }
  83% { color: #ff00ff; text-shadow: 0 0 10px #ff00ff; }
  100% { color: #ff0000; text-shadow: 0 0 10px #ff0000; }
}

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

.vt-font {
  font-family: 'VT323', monospace;
}

.crt-flicker {
  animation: flicker 5s infinite;
}

.pixel-fade {
  animation: pixelFadeIn 0.8s ease-out forwards;
}

.slide-up {
  animation: slideUp 0.4s ease-out forwards;
}

.shake {
  animation: shake 0.5s ease-in-out;
}

.glow-border {
  border: 2px solid var(--cyan);
  box-shadow: var(--border-glow);
  animation: glow-pulse 3s ease-in-out infinite;
}

.retro-window {
  border: 3px solid #888;
  border-top-color: #ddd;
  border-left-color: #ddd;
  background: #c0c0c0;
}

.retro-window-titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: white;
  padding: 3px 6px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.retro-window-body {
  background: #0a0a14;
  border: 2px inset #888;
  margin: 4px;
}

.retro-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 8px 16px;
  border: 3px solid #888;
  border-top-color: #ddd;
  border-left-color: #ddd;
  border-bottom-color: #333;
  border-right-color: #333;
  background: #c0c0c0;
  color: #000;
  cursor: pointer;
  text-transform: uppercase;
}

.retro-btn:active {
  border-top-color: #333;
  border-left-color: #333;
  border-bottom-color: #ddd;
  border-right-color: #ddd;
}

.retro-btn:hover {
  background: #d0d0d0;
}

.dos-input {
  background: var(--bg-input);
  color: var(--green);
  border: 2px solid var(--green);
  font-family: 'VT323', monospace;
  font-size: 32px;
  padding: 8px 12px;
  outline: none;
  caret-color: var(--green);
  box-shadow: 0 0 10px rgba(0, 255, 65, 0.2), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.dos-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 255, 245, 0.3), inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.streak-fire {
  animation: rainbow 2s linear infinite;
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.thumbnail {
  border: 2px solid #444;
  cursor: pointer;
  transition: all 0.2s;
  image-rendering: pixelated;
}

.thumbnail:hover {
  border-color: var(--cyan);
  box-shadow: 0 0 10px rgba(0, 255, 245, 0.5);
  transform: scale(1.05);
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: #444;
  border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Error dialog textarea */
.error-param-input {
  font-family: 'VT323', monospace;
  font-size: 16px;
  background: #1a1a2e;
  color: var(--green);
  border: 1px solid #444;
  padding: 4px 8px;
  width: 100%;
  outline: none;
}
.error-param-input:focus {
  border-color: var(--cyan);
}