/* 3D Pacman Game Styles */

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

body {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  overflow: hidden;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* HUD Styles */
#hud {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

#hud > div:first-child {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(251, 191, 36, 0.3);
}

/* Strong text shadow for yellow score text */
#score,
#high-score {
  text-shadow: 
    2px 2px 0 #000,
    -2px -2px 0 #000,
    2px -2px 0 #000,
    -2px 2px 0 #000,
    0 0 10px #000,
    0 0 20px rgba(251, 191, 36, 0.5);
}

/* Improve readability of camera mode text */
#camera-mode {
  text-shadow: 
    1px 1px 0 #000,
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    0 0 8px #000;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 8px;
  border-radius: 6px;
}

/* Retro glow effect for text */
.glow-text {
  text-shadow: 0 0 5px currentColor, 0 0 10px currentColor, 0 0 20px currentColor;
}

/* Overlay animations */
#start-screen h1 {
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%,
  100% {
    text-shadow: 0 0 10px #fbbf24, 0 0 20px #fbbf24, 0 0 30px #fbbf24;
  }
  50% {
    text-shadow: 0 0 20px #fbbf24, 0 0 40px #fbbf24, 0 0 60px #fbbf24;
  }
}

/* Button styles */
button {
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4);
}

button:hover {
  box-shadow: 0 6px 25px rgba(251, 191, 36, 0.6);
}

/* Lives display */
#lives span {
  filter: drop-shadow(0 0 5px #fbbf24);
}

/* Control hints */
#controls-help {
  backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 12px;
  border-radius: 8px;
}

/* Screen transitions */
.screen-overlay {
  transition: opacity 0.3s ease-in-out;
}

.screen-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  #hud {
    padding: 8px;
    padding-left: 8px;
    flex-direction: column;
    gap: 8px;
  }

  #hud .text-2xl {
    font-size: 1rem;
  }

  #hud .text-sm {
    font-size: 0.7rem;
  }

  #hud .text-xs {
    font-size: 0.6rem;
  }

  #controls-help {
    display: none;
  }

  #start-screen h1 {
    font-size: 1.5rem;
    padding: 0 16px;
    text-align: center;
  }

  #start-screen button {
    padding: 12px 24px;
    font-size: 1rem;
  }

  /* Smaller lives icons on mobile */
  #lives span {
    font-size: 1.2rem !important;
  }

  /* Make camera mode display more compact */
  #camera-mode {
    display: block;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Adjust minimap size for mobile */
  #minimap {
    width: 100px !important;
    height: 100px !important;
  }

  /* Game over/win screens */
  #game-over-screen h2,
  #win-screen h2 {
    font-size: 2rem;
  }

  #game-over-screen p,
  #win-screen p {
    font-size: 1.2rem;
  }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 375px) {
  #hud .text-2xl {
    font-size: 0.875rem;
  }

  #start-screen h1 {
    font-size: 1.25rem;
  }

  .touch-dpad {
    grid-template-columns: 50px 50px 50px !important;
    grid-template-rows: 50px 50px 50px !important;
  }

  .touch-btn,
  .touch-action-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 20px !important;
  }
}

/* Loading indicator */
.loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.5rem;
}

.loading::after {
  content: '';
  animation: loading-dots 1.5s infinite;
}

@keyframes loading-dots {
  0% {
    content: '.';
  }
  33% {
    content: '..';
  }
  66% {
    content: '...';
  }
}

/* Ghost scared animation */
@keyframes ghost-scared {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

.ghost-scared {
  animation: ghost-scared 0.3s ease-in-out infinite;
}

/* Dot collection effect */
@keyframes dot-collect {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

/* Power pill pulsing */
@keyframes power-pill-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}
