* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background: #1a1a1a;
  color: white;
  overflow: hidden;
}

/* Start Menu Styles */
#startMenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  text-align: center;
  padding: 20px;
}

#startMenu h1 {
  font-size: 4rem;
  color: #ffcc00;
  text-shadow: 0 0 15px #ff0080, 0 0 25px #ff0080;
  margin-bottom: 30px;
  animation: glow 2s infinite alternate;
}

#startMenu h2 {
  font-size: 2.5rem;
  color: #00ffcc;
  margin-bottom: 20px;
  text-shadow: 0 0 10px #00ffcc;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 30px;
  max-width: 400px;
  width: 100%;
}

.menu-btn {
  padding: 18px 30px;
  font-size: 1.4rem;
  background: linear-gradient(45deg, #ff0080, #ff8c00);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  letter-spacing: 1px;
  width: 100%;
}

.menu-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 25px #ff0080;
}

.menu-btn:nth-child(2) {
  background: linear-gradient(45deg, #00b09b, #96c93d);
}

.menu-btn:nth-child(2):hover {
  box-shadow: 0 0 25px #96c93d;
}

.menu-btn:nth-child(3) {
  background: linear-gradient(45deg, #4a00e0, #8e2de2);
}

.menu-btn:nth-child(3):hover {
  box-shadow: 0 0 25px #8e2de2;
}

.menu-btn:nth-child(4) {
  background: linear-gradient(45deg, #ff416c, #ff4b2b);
}

.menu-btn:nth-child(4):hover {
  box-shadow: 0 0 25px #ff416c;
}

/* Instructions Page */
#instructionsPage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #0f0c29, #302b63);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2001;
  padding: 20px;
  overflow-y: auto;
}

.instructions-container {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 40px;
  max-width: 800px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.instructions-container h2 {
  font-size: 3rem;
  color: #ffcc00;
  text-align: center;
  margin-bottom: 30px;
  text-shadow: 0 0 10px #ff0080;
}

.instructions-list {
  font-size: 1.3rem;
  line-height: 1.8;
  margin-bottom: 30px;
}

.instructions-list li {
  margin-bottom: 15px;
  padding-left: 10px;
}

.instructions-list strong {
  color: #00ffcc;
}

.back-to-menu {
  padding: 15px 40px;
  font-size: 1.2rem;
  background: linear-gradient(45deg, #ff0080, #ff8c00);
  color: white;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 20px;
  transition: all 0.3s;
  font-weight: bold;
}

.back-to-menu:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px #ff0080;
}

/* Game Container */
#gameContainer {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: none;
  justify-content: center;
  align-items: center;
  background: #1a1a1a;
}

#uiContainer {
  position: fixed;
  top: 10px;
  right: 10px;
  left: auto;
  transform: none;
  background: rgba(0,0,0,0.9);
  padding: 10px 20px;
  border-radius: 10px;
  z-index: 1000;
  pointer-events: none;
  min-width: 150px;
  text-align: left;
}

#gameCanvas {
  background: #2a2a2a;
  border: 3px solid #444;
  max-width: calc(100vw - 200px);
  max-height: calc(100vh - 20px);
  cursor: pointer;
}

#levelCounter, #scoreCounter, #livesCounter {
  font-size: 18px;
  margin: 5px 0;
  color: white;
}

.heart {
  color: #ff6b6b;
}

.hidden {
  display: none !important;
}

/* Game Over Screens */
#gameOverScreen, #levelCompleteScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

#gameOverScreen h1, #levelCompleteScreen h1 {
  font-size: 48px;
  color: #e74c3c;
  margin-bottom: 20px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

#gameOverScreen p, #levelCompleteScreen p {
  font-size: 24px;
  margin-bottom: 30px;
  color: white;
}

.btn {
  padding: 12px 30px;
  font-size: 16px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  margin: 10px;
  transition: all 0.3s;
}

.btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

/* Animations */
@keyframes glow {
  from { text-shadow: 0 0 10px #ff0080, 0 0 20px #ff0080; }
  to { text-shadow: 0 0 20px #ff0080, 0 0 30px #ff0080, 0 0 40px #ff0080; }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
  body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
  }
  
  #gameContainer {
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
  }
  
  #gameCanvas {
    width: auto !important;
    height: auto !important;
    max-width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border: 2px solid #444;
  }
  
  #uiContainer {
    top: 5px;
    right: 5px;
    padding: 8px 15px;
    font-size: 14px;
    min-width: 150px;
  }
  
  #levelCounter, #scoreCounter, #livesCounter {
    font-size: 14px;
    margin: 3px 0;
  }
  
  #startMenu h1 {
    font-size: 2.8rem;
  }
  
  #startMenu h2 {
    font-size: 2rem;
  }
  
  .menu-btn {
    padding: 15px 20px;
    font-size: 1.2rem;
  }
  
  .instructions-container {
    padding: 20px;
    max-width: 95%;
    max-height: 90vh;
  }
  
  .instructions-container h2 {
    font-size: 2.2rem;
  }
  
  .instructions-list {
    font-size: 1.1rem;
  }
  
  #gameOverScreen h1, #levelCompleteScreen h1 {
    font-size: 36px;
  }
  
  #gameOverScreen p, #levelCompleteScreen p {
    font-size: 20px;
  }
  
  .btn {
    padding: 15px 25px;
    font-size: 16px;
    margin: 8px;
  }
}

@media (max-width: 480px) {
  #startMenu h1 {
    font-size: 2.2rem;
  }
  
  #startMenu h2 {
    font-size: 1.6rem;
  }
  
  .menu-btn {
    padding: 12px 18px;
    font-size: 1.1rem;
  }
  
  .instructions-container {
    padding: 15px;
  }
  
  .instructions-container h2 {
    font-size: 1.8rem;
  }
  
  .instructions-list {
    font-size: 1rem;
  }
  
  #uiContainer {
    font-size: 12px;
    padding: 6px 12px;
    min-width: 120px;
    top: 3px;
    right: 3px;
  }
  
  #gameCanvas {
    max-width: calc(100vw - 10px);
    max-height: calc(100vh - 10px);
    border: 2px solid #444;
  }
  
  #levelCounter, #scoreCounter, #livesCounter {
    font-size: 12px;
  }
}

/* Prevent zoom on mobile */
@media (max-width: 768px) {
  input, select, textarea, button {
    font-size: 16px !important;
  }
}
