html, body { 
  margin: 0; 
  height: 100%; 
  overflow: hidden; 
  background: #111; 
  font-family: 'Arial', sans-serif; 
}

/* Main Menu Styles */
#mainMenu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.5s ease-out;
}

#mainMenu.hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-title {
  font-size: 4rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px #00ffff;
  margin-bottom: 2rem;
  text-align: center;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px #00ffff, 0 0 30px #00ffff, 0 0 40px #00ffff; }
  to { text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff, 0 0 30px #00ffff; }
}

.menu-subtitle {
  font-size: 1.2rem;
  color: #aaa;
  margin-bottom: 3rem;
  text-align: center;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.menu-button {
  padding: 15px 40px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(45deg, #ff6b6b, #ee5a24);
  border: none;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.menu-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  background: linear-gradient(45deg, #ff5252, #d63031);
}

.menu-button:active {
  transform: translateY(-1px);
}

.menu-button.secondary {
  background: linear-gradient(45deg, #74b9ff, #0984e3);
}

.menu-button.secondary:hover {
  background: linear-gradient(45deg, #0984e3, #74b9ff);
}

/* Instructions Modal */
#instructionsModal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

.instructions-content {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  padding: 2rem;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
}

.instructions-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.instructions-title {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  margin: 0;
}

.close-button {
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.close-button:hover {
  background: #c0392b;
}

.instructions-section {
  margin-bottom: 1.5rem;
}

.instructions-section h3 {
  color: #3498db;
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #3498db;
  padding-bottom: 0.3rem;
}

.instructions-section ul {
  color: #ecf0f1;
  line-height: 1.6;
  margin: 0;
  padding-left: 1.2rem;
}

.instructions-section li {
  margin-bottom: 0.5rem;
}

.instructions-section p {
  color: #bdc3c7;
  line-height: 1.6;
  margin: 0.5rem 0;
}

.key {
  background: #34495e;
  color: #ecf0f1;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-weight: bold;
  border: 1px solid #7f8c8d;
}

/* Game UI Styles */
#gameUI {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

#info { 
  position: absolute; 
  top: 8px; 
  left: 8px; 
  color: #ddd; 
  font-family: monospace; 
  font-size: 12px;
  pointer-events: none;
}

#gameStats {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #fff;
  font-family: monospace;
  font-size: 14px;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px;
  border-radius: 5px;
}

/* Game Over Screen */
#gameOverScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

.game-over-title {
  font-size: 3rem;
  font-weight: bold;
  color: #ff4757;
  text-shadow: 0 0 20px #ff4757;
  margin-bottom: 1rem;
  text-align: center;
}

.game-over-stats {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 2rem;
  text-align: center;
}

/* Win Screen */
#winScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1001;
}

.win-title {
  font-size: 3rem;
  font-weight: bold;
  color: #00ff00;
  text-shadow: 0 0 20px #00ff00;
  margin-bottom: 1rem;
  text-align: center;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { text-shadow: 0 0 20px #00ff00, 0 0 30px #00ff00, 0 0 40px #00ff00; }
  to { text-shadow: 0 0 10px #00ff00, 0 0 20px #00ff00, 0 0 30px #00ff00; }
}

.win-stats {
  font-size: 1.2rem;
  color: #fff;
  margin-bottom: 2rem;
  text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  .menu-title {
    font-size: 2.5rem;
  }
  
  .instructions-content {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .instructions-title {
    font-size: 1.5rem;
  }
  
  .game-over-title {
    font-size: 2rem;
  }
}
