/* public/style.css */

html, body {
  margin: 0;
  padding: 0;
  background: #000;
  overflow: hidden;
  font-family: 'Lato', sans-serif;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
}

/* Cursor confinement fallback for browsers without pointer lock support */
.game-active canvas {
  cursor: crosshair !important;
}

/* Hide default cursor when custom cursor is active */
.game-active.cursor-locked canvas {
  cursor: none !important;
}

/* Ensure custom cursor is always on top */
#customCursor {
  pointer-events: none !important;
  z-index: 10000 !important;
}

#logoContainer {
  position: relative;
  width: 100%;
  text-align: center;
  z-index: 5;
  margin-bottom: 20px;
  flex-shrink: 0;
}

#gameLogo {
  width: auto;
  height: 175px;
  max-width: 80%;
  filter: drop-shadow(0 0 2.25px #4ecdc4) drop-shadow(0 0 3.375px #45b7d1) drop-shadow(0 0 4.5px #96ceb4);
}

.astroLink {
  color: #9f9fff;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.astroLink:hover {
  color: #c3c3ff;
  text-shadow: 0 0 4px #c3c3ff;
}

/* Astrozaar logo hover animation */
#gameLogo {
  transition: filter 0.3s ease;
}

#gameLogo:hover {
  animation: logoGlowPulse 2s infinite;
}

@keyframes logoGlowPulse {
  0% {
    filter: drop-shadow(0 0 2.25px #4ecdc4) drop-shadow(0 0 3.375px #45b7d1) drop-shadow(0 0 4.5px #96ceb4);
  }
  50% {
    filter: drop-shadow(0 0 4px #4ecdc4) drop-shadow(0 0 6px #45b7d1) drop-shadow(0 0 8px #96ceb4);
  }
  100% {
    filter: drop-shadow(0 0 2.25px #4ecdc4) drop-shadow(0 0 3.375px #45b7d1) drop-shadow(0 0 4.5px #96ceb4);
  }
}

#shipSelector {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  font-weight: 600;
  box-sizing: border-box;
}

/* 
 * ⚠️ SHIP LAYOUT WARNING ⚠️
 * DO NOT MODIFY SHIP-RELATED CSS UNLESS EXPLICITLY REQUESTED!
 * The user has specifically requested that ships not be messed with.
 * This includes: #shipChoices, #shipScrollContainer, ship grid layout, etc.
 * Only change ship styling if the user specifically asks for it.
 */
#shipChoices {
  display: grid;
  grid-template-columns: repeat(7, 60px);
  gap: 12px;
  justify-content: center;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 0;
  overflow: visible;
  max-width: 100%;
}

#shipChoices img {
  width: 48px;
  height: 48px;
  border: 2px solid white;
  border-radius: 5px;
  box-sizing: border-box;
  cursor: pointer;
  direction: ltr;
  transition: transform 0.2s cubic-bezier(0.4, 0.2, 0.2, 1), box-shadow 0.2s;
  z-index: 1;
}
@keyframes ship-wiggle {
  0%   { transform: scale(2.1) rotate(-2deg) translateY(0px); }
  20%  { transform: scale(2.1) rotate(2deg) translateY(-2px); }
  40%  { transform: scale(2.1) rotate(-1deg) translateY(2px); }
  60%  { transform: scale(2.1) rotate(1deg) translateY(-1px); }
  80%  { transform: scale(2.1) rotate(-2deg) translateY(1px); }
  100% { transform: scale(2.1) rotate(-2deg) translateY(0px); }
}
#shipChoices img:hover {
  /* Only highlight border/shadow, no transform or animation here */
  z-index: 2;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.25);
}
.ship-choice-container {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  border: 2px solid white;
  border-radius: 8px;
  margin: 0;
  padding: 0;
  transition: border-color 0.2s, transform 0.2s cubic-bezier(0.4, 0.2, 0.2, 1);
  transform-origin: center center;
  background-color: rgba(0,0,0,0.5);
}

.ship-choice-container.selected {
  border: 2px solid lime;
}

.ship-choice-container::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  background:
    radial-gradient(circle at 8% 5%, rgba(255,255,255,0.8) 0px, transparent 1px),
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.7) 0px, transparent 0.75px),
    radial-gradient(circle at 35% 35%, rgba(255,255,255,0.9) 0px, transparent 1.25px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.6) 0px, transparent 0.9px),
    radial-gradient(circle at 65% 65%, rgba(255,255,255,0.8) 0px, transparent 1.1px),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.7) 0px, transparent 0.85px),
    radial-gradient(circle at 92% 95%, rgba(255,255,255,0.6) 0px, transparent 0.65px),
    radial-gradient(circle at 10% 90%, rgba(255,255,255,0.8) 0px, transparent 1px),
    radial-gradient(circle at 90% 10%, rgba(255,255,255,0.7) 0px, transparent 0.85px),
    radial-gradient(circle at 50% 10%, rgba(255,255,255,0.8) 0px, transparent 1px),
    radial-gradient(circle at 10% 50%, rgba(255,255,255,0.7) 0px, transparent 0.75px),
    radial-gradient(circle at 90% 50%, rgba(255,255,255,0.7) 0px, transparent 0.75px),
    #111;
  background-size: 60px 60px;
  background-repeat: repeat-x;
  animation: star-dots-smooth-move 1.2s linear infinite;
}

@keyframes star-dots-smooth-move {
  0% { background-position: 0 0; }
  100% { background-position: -60px 0; }
}

.ship-choice-container:hover::before {
  opacity: 1;
}

.ship-choice-container:hover {
  transform: scale(1.8);
  z-index: 2;
}

.ship-choice-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
  border: none;
  display: block;
  transition: none;
}

#startBtn {
  width: 100px;
  height: 100px;
  cursor: pointer;
  user-select: none;
  image-rendering: auto;
  filter: drop-shadow(0 0 8px rgba(0, 255, 255, 0.6));
  transition: transform 0.1s ease, filter 0.3s ease;
}


@keyframes rocketShake {
  0% { transform: translate(0px, 0px) rotate(0deg); }
  10% { transform: translate(-1px, 1px) rotate(-0.5deg); }
  20% { transform: translate(-2px, 0px) rotate(0.5deg); }
  30% { transform: translate(2px, 1px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(-0.5deg); }
  50% { transform: translate(-1px, 1px) rotate(0.5deg); }
  60% { transform: translate(1px, -2px) rotate(0deg); }
  70% { transform: translate(-2px, 1px) rotate(0.5deg); }
  80% { transform: translate(2px, -1px) rotate(-0.5deg); }
  90% { transform: translate(-1px, 2px) rotate(0deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

#startBtn:hover {
  animation: rocketShake 0.15s infinite;
}

#nameInput {
  font-family: 'Lato', sans-serif;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0 !important;
}

/* 
 * ⚠️ SHIP CONTAINER WARNING ⚠️
 * DO NOT MODIFY SHIP CONTAINER UNLESS EXPLICITLY REQUESTED!
 * The user has specifically requested that ships not be messed with.
 * This container controls the ship selection area width and layout.
 * Only change if the user specifically asks for it.
 */
#shipScrollContainer {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 400px;
  padding: 40px 20px;
  box-sizing: border-box;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.3);
}

#shipScrollContainer::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

#shipScrollContainer::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: content-box;
}

#shipScrollContainer {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.4) transparent;
}

/* Death overlay styles - using inline styles instead */

/* ASMR Mode styles */
#logoContainer,
#nameInput,
#startBtn,
#shipScrollContainer,
#shipNameHeader,
#shipSelectHeader,
#powerupLegend,
#playerCount,
#leaderboard {
  transition: opacity 1s ease !important;
}

.asmr-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 1s ease !important;
}

#asmrModeBtn {
  position: relative !important;
  padding: 10px 15px !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: rgba(255, 255, 255, 1.0) !important;
  border: 2px solid rgba(128, 128, 128, 0.5) !important;
  border-radius: 5px !important;
  cursor: pointer !important;
  font-family: 'Lato', sans-serif !important;
  font-size: 14px !important;
  transition: all 0.3s ease !important;
}

#hamburgerBtn {
  position: relative !important;
  padding: 10px 15px !important;
  background: rgba(0, 0, 0, 0.7) !important;
  color: white !important;
  border: 2px solid rgba(128, 128, 128, 0.5) !important;
  border-radius: 5px !important;
  cursor: pointer !important;
  font-family: 'Lato', sans-serif !important;
  font-size: 14px !important;
  transition: opacity 1s ease !important;
  z-index: 10000 !important;
}

#hamburgerBtn:hover {
  background: rgba(128, 128, 128, 0.2) !important;
  border-color: rgba(128, 128, 128, 0.5) !important;
  box-shadow: 0 0 8px rgba(128, 128, 128, 0.4) !important;
}

/* Hamburger menu button hover effects */
#leaderboardBtn:hover,
#helpBtn:hover,
#settingsBtn:hover,
#infoBtn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s ease !important;
}

/* Leaderboard modal button hover effects */
#saveLeaderboardBtn:hover,
#backToMenuFromLeaderboard:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s ease !important;
}

/* Help modal button hover effects */
#backToMenuFromHelp:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s ease !important;
}

/* Settings modal button hover effects */
#saveSettings:hover,
#resetSettings:hover,
#backToMenu:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s ease !important;
}

/* Info modal button hover effects */
#backToMenuFromInfo:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
  transform: translateY(-2px) !important;
  transition: all 0.3s ease !important;
}

#asmrModeBtn.asmr-active {
  color: rgba(255, 255, 255, 0.5) !important;
}

#asmrModeBtn:hover {
  background: rgba(128, 128, 128, 0.2) !important;
  border-color: rgba(128, 128, 128, 0.5) !important;
  box-shadow: 0 0 8px rgba(128, 128, 128, 0.4) !important;
}

/* Leaderboard styles */
#leaderboard {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(0, 255, 0, 0.5);
  border-radius: 5px;
  padding: 10px;
  color: white;
  font-family: 'Lato', sans-serif;
  font-size: 12px;
  z-index: 1000;
  min-width: 200px;
}

#leaderboardTitle {
  color: #00ff00;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
}

#leaderboardCategory {
  color: white;
  font-weight: bold;
  margin-bottom: 5px;
  text-align: center;
  font-size: 11px;
}

#leaderboardContent {
  color: white;
  font-size: 10px;
  line-height: 1.2;
}

.leaderboard-position {
  font-weight: bold;
  color: white;
}

.leaderboard-name {
  color: white;
}

.pink-selected {
  border: 2px solid #ff69b4 !important;
}

/* Powerup blink animation for minimap legend */
@keyframes powerupBlink {
  0%, 50% { background-color: #00ccff; }
  51%, 100% { background-color: white; }
}

/* Responsive design for smaller screens */
@media (max-height: 700px) {
  #shipSelector {
    justify-content: flex-start;
    padding-top: 10px;
  }
  
  #logoContainer {
    margin-bottom: 10px;
  }
  
  #gameLogo {
    height: 120px;
  }
  
  #shipScrollContainer {
    max-height: 300px;
    padding: 30px 15px;
  }
  
  #shipNameHeader,
  #shipSelectHeader {
    margin: 10px 0;
    font-size: 1.2em;
  }
}

@media (max-height: 600px) {
  #shipSelector {
    justify-content: flex-start;
    padding-top: 5px;
  }
  
  #logoContainer {
    margin-bottom: 5px;
  }
  
  #gameLogo {
    height: 100px;
  }
  
  #shipScrollContainer {
    max-height: 250px;
    padding: 25px 10px;
  }
  
  #shipNameHeader,
  #shipSelectHeader {
    margin: 5px 0;
    font-size: 1.1em;
  }
}

@media (max-width: 600px) {
  #shipChoices {
    grid-template-columns: repeat(auto-fit, 50px);
    gap: 8px;
  }
  
  .ship-choice-container {
    width: 50px;
    height: 50px;
  }
  
  #shipScrollContainer {
    max-width: 100%;
    padding: 25px 10px;
  }
  
  /* Mobile modal width overrides */
  #hamburgerContent {
    min-width: 300px !important;
    max-width: 400px !important;
    width: 85vw !important;
  }
  
  /* Sub-menu modals need to be wider on mobile */
  #leaderboardContent,
  #settingsContent,
  #infoContent,
  #helpContent {
    min-width: 300px !important;
    max-width: 400px !important;
    width: 85vw !important;
  }
}

/* Additional mobile-specific rules for very small screens */
@media (max-width: 480px) {
  #leaderboardContent,
  #settingsContent,
  #infoContent,
  #helpContent {
    min-width: 280px !important;
    max-width: 350px !important;
    width: 90vw !important;
    padding: 15px !important;
  }
}

/* Starfield Animation */
@keyframes twinkle {
  0%, 100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}
