:root {
  --dex-red: #DC0A2D;
  --dex-red-dark: #9B0620;
  --dex-steel: #2C2C2C;
  --dex-screen: #C4CFA0;
  --dex-screen-light: #D4DFB0;
  --dex-blue: #3B82F6;
  --dex-cream: #F0F0E8;
}

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

body {
  background: #0a0e17;
  font-family: 'VT323', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

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

/* Scanline overlay */
.scanlines {
  position: relative;
  overflow: hidden;
}
.scanlines::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.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  pointer-events: none;
  z-index: 2;
}

/* Screen glow effect */
.screen-glow {
  box-shadow:
    inset 0 0 30px rgba(196, 207, 160, 0.3),
    inset 0 0 60px rgba(196, 207, 160, 0.1),
    0 0 15px rgba(196, 207, 160, 0.1);
}

/* Pokédex shell */
.dex-shell {
  background: linear-gradient(145deg, #e01030, #DC0A2D 30%, #b00820 70%, #9B0620);
  border: 3px solid #6a0416;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -2px 0 rgba(0,0,0,0.3),
    0 8px 32px rgba(0,0,0,0.6),
    0 2px 8px rgba(0,0,0,0.4);
}

/* Type colors */
.type-normal { background: #A8A878; }
.type-fire { background: #F08030; }
.type-water { background: #6890F0; }
.type-electric { background: #F8D030; color: #333; }
.type-grass { background: #78C850; }
.type-ice { background: #98D8D8; color: #333; }
.type-fighting { background: #C03028; }
.type-poison { background: #A040A0; }
.type-ground { background: #E0C068; color: #333; }
.type-flying { background: #A890F0; }
.type-psychic { background: #F85888; }
.type-bug { background: #A8B820; }
.type-rock { background: #B8A038; }
.type-ghost { background: #705898; }
.type-dragon { background: #7038F8; }
.type-dark { background: #705848; }
.type-steel { background: #B8B8D0; color: #333; }
.type-fairy { background: #EE99AC; color: #333; }

.type-badge {
  padding: 2px 8px;
  border-radius: 4px;
  color: white;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
  font-family: 'Press Start 2P', cursive;
  font-size: 8px;
}

/* Sprite rendering */
.sprite-render {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* Animations */
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-2deg); }
  75% { transform: translateX(4px) rotate(2deg); }
}

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

@keyframes sparkle {
  0%, 100% { filter: brightness(1) hue-rotate(0deg); }
  25% { filter: brightness(1.5) hue-rotate(60deg); }
  50% { filter: brightness(2) hue-rotate(120deg); }
  75% { filter: brightness(1.5) hue-rotate(180deg); }
}

@keyframes statFill {
  from { width: 0%; }
  to { width: var(--fill-width); }
}

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

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 0 15px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.3); }
}

@keyframes soundWave {
  0% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
  100% { transform: scaleY(0.3); }
}

.animate-bounce-sprite { animation: bounce 0.6s ease-in-out; }
.animate-shake-sprite { animation: shake 0.4s ease-in-out; }
.animate-sparkle { animation: sparkle 2s ease-in-out infinite; }
.animate-spin-slow { animation: spin 3s linear infinite; }
.animate-pulse-glow { animation: pulseGlow 2s ease-in-out infinite; }

/* LED text effect */
.led-text {
  color: #ff3c3c;
  text-shadow: 0 0 5px #ff3c3c, 0 0 10px #ff3c3c, 0 0 20px #ff0000;
}

/* D-pad button style */
.dpad-btn {
  background: linear-gradient(145deg, #3a3a3a, #2a2a2a);
  border: 2px solid #1a1a1a;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 2px 4px rgba(0,0,0,0.4);
  transition: all 0.1s;
}
.dpad-btn:active {
  transform: translateY(1px);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

/* Speaker button */
.speaker-btn {
  background: linear-gradient(145deg, #444, #333);
  border: 3px solid #222;
  border-radius: 50%;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.1),
    0 3px 6px rgba(0,0,0,0.4);
}
.speaker-btn:hover {
  background: linear-gradient(145deg, #555, #444);
}
.speaker-btn:active {
  transform: scale(0.95);
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar { width: 8px; }
.custom-scrollbar::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: #DC0A2D; border-radius: 4px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: #ff1a3a; }

/* Stat bar animation */
.stat-bar-fill {
  animation: statFill 0.8s ease-out forwards;
  width: var(--fill-width);
}

/* Entry animation */
.entry-animate {
  animation: fadeSlideIn 0.3s ease-out forwards;
}

/* Favorites drawer */
.drawer-overlay {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

/* Responsive */
@media (max-width: 768px) {
  .dex-shell {
    border-radius: 12px;
    margin: 8px;
  }
}

/* Hinge line decoration */
.hinge-line {
  background: linear-gradient(to right, transparent, #6a0416, #9B0620, #6a0416, transparent);
  height: 3px;
}

/* Blue indicator light */
.indicator-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #7df9ff, #3B82F6, #1e40af);
  box-shadow: 0 0 8px #3B82F6, 0 0 16px rgba(59,130,246,0.4);
  border: 1px solid rgba(255,255,255,0.3);
}

/* Sound wave bars */
.sound-bar {
  display: inline-block;
  width: 3px;
  height: 12px;
  background: #3B82F6;
  margin: 0 1px;
  border-radius: 2px;
}
.sound-bar.playing {
  animation: soundWave 0.4s ease-in-out infinite;
}