/* ============================================
   FLAPPY BIRD GAME STYLES
   ============================================
   This file contains all the CSS styling for the game.
   Customize these styles to change the game's appearance.
*/

/* ========== GLOBAL STYLES ========== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: "Pacifico", cursive;
  background: linear-gradient(135deg, #87ceeb 0%, #98d8e8 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* ========== GAME CONTAINER ========== */
.game-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== CANVAS STYLES ========== */
canvas {
  border: none;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
  /* Background is set dynamically via JavaScript based on current theme */
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: transform 0.1s ease;
}

canvas:hover {
  transform: scale(1.02);
}

canvas:active {
  transform: scale(0.98);
}

/* ========== UI ENHANCEMENTS ========== */
.game-container::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    transparent 0%,
    rgba(255, 255, 255, 0.1) 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.1) 75%,
    transparent 100%
  );
  border-radius: 17px;
  z-index: -1;
  animation: ui-shimmer 3s linear infinite;
  opacity: 0.5;
}

@keyframes ui-shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Game state indicators */
.game-state-prestart .game-container {
  animation: menu-pulse 2s ease-in-out infinite;
}

.game-state-running .game-container {
  animation: none;
}

.game-state-over .game-container {
  animation: game-over-shake 0.5s ease-in-out;
}

@keyframes menu-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

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

/* ========== RESPONSIVE DESIGN ========== */
@media (max-width: 768px) {
  .game-container {
    padding: 10px;
    margin: 10px;
  }

  canvas {
    max-width: 100%;
    height: auto;
  }
}

@media (max-width: 480px) {
  .game-container {
    padding: 5px;
    margin: 5px;
  }

  canvas {
    border-width: 2px;
    border-radius: 5px;
  }
}

/* ========== LOADING ANIMATION ========== */
@keyframes pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
  }
}

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

/* ========== NEON THEME STYLES ========== */
.theme-neon {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a0033 50%, #000 100%);
}

.theme-neon canvas {
  border: none;
  box-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 80px #00ffff,
    inset 0 0 20px rgba(0, 255, 255, 0.1);
  background: radial-gradient(circle at 20% 80%, #ff00ff22 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, #00ffff22 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, #ff000022 0%, transparent 50%),
    linear-gradient(135deg, #0a0a2a 0%, #2a0a2a 100%);
  animation: neon-pulse 2s ease-in-out infinite alternate;
}

.theme-neon .game-container {
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.3);
  box-shadow: 0 8px 32px rgba(0, 255, 255, 0.2),
    inset 0 0 20px rgba(0, 255, 255, 0.05);
}

@keyframes neon-pulse {
  0% {
    box-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff, 0 0 80px #00ffff,
      inset 0 0 20px rgba(0, 255, 255, 0.1);
  }
  100% {
    box-shadow: 0 0 30px #00ffff, 0 0 60px #00ffff, 0 0 120px #00ffff,
      inset 0 0 30px rgba(0, 255, 255, 0.2);
  }
}

@keyframes neon-flicker {
  0%,
  19%,
  21%,
  23%,
  25%,
  54%,
  56%,
  100% {
    opacity: 1;
  }
  20%,
  24%,
  55% {
    opacity: 0.4;
  }
}

.theme-neon canvas::before {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(45deg, #00ffff, #ff00ff, #ffff00, #00ffff);
  z-index: -1;
  border-radius: 15px;
  animation: neon-rotate 4s linear infinite;
  opacity: 0.3;
}

@keyframes neon-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Neon grid overlay effect */
.theme-neon canvas::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  pointer-events: none;
  animation: neon-grid 3s ease-in-out infinite;
}

@keyframes neon-grid {
  0%,
  100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.3;
  }
}

/* ========== PIXEL THEME STYLES ========== */
.theme-pixel canvas {
  border: none;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #000, 4px 4px 0 #666;
  background: repeating-linear-gradient(
    0deg,
    #87ceeb 0px,
    #87ceeb 2px,
    #98d8e8 2px,
    #98d8e8 4px
  );
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.theme-pixel .game-container {
  background: #c0c0c0;
  border: 3px outset #c0c0c0;
  box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 #808080,
    2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  canvas {
    transition: none;
  }

  canvas:hover {
    transform: none;
  }

  canvas:active {
    transform: none;
  }

  .loading {
    animation: none;
  }

  .theme-neon canvas {
    animation: none;
  }

  .theme-neon canvas::before {
    animation: none;
  }

  .theme-neon canvas::after {
    animation: none;
  }
}
