@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

body {
  margin: 0;
  padding: 0;
  background-color: #0c0c14;
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  overflow: hidden;
  touch-action: none; /* Verhindert Browser-Zoom bei Doppeltipp */
}

#game-container {
  position: relative;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  min-height: 100vh;
  width: 100%;
}

#canvas {
  display: block;
  margin: 0 auto;
  border: 2px solid #30cfd0;
  box-shadow: 0 0 20px rgba(48, 207, 208, 0.5);
  background-color: #0c0c14;
  transition: all 0.3s ease;
  max-width: 100%;
  height: auto;
}

.game-ui {
  position: absolute;
  width: 100%;
  padding: 10px;
  box-sizing: border-box;
  z-index: 50;
  pointer-events: none; /* UI blockiert keine Klicks */
}

.score-display {
  font-size: 24px;
  color: #30cfd0;
  text-shadow: 0 0 5px rgba(48, 207, 208, 0.7);
  padding: 10px;
}

.lives-display {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
}

.life-icon {
  width: 20px;
  height: 20px;
  margin-left: 5px;
  fill: #30cfd0;
}

.game-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 32px;
  color: #30cfd0;
  text-shadow: 0 0 10px rgba(48, 207, 208, 0.7);
  background: rgba(12, 12, 20, 0.8);
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #30cfd0;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.game-over {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-size: 48px;
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(255, 107, 107, 0.7);
  background: rgba(12, 12, 20, 0.8);
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #ff6b6b;
  z-index: 100;
}

.restart-button {
  background: rgba(48, 207, 208, 0.3);
  border: 2px solid #30cfd0;
  color: white;
  padding: 10px 20px;
  border-radius: 5px;
  font-family: 'Orbitron', sans-serif;
  margin-top: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto; /* Button kann geklickt werden */
}

.restart-button:hover, .restart-button:focus {
  background: rgba(48, 207, 208, 0.5);
  transform: scale(1.05);
}

/* Mobile Controls Styling verbessert */
#mobile-controls {
  display: none;
}

/* Ladebildschirm */
.loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #0c0c14;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.5s ease;
}

.loading-message {
  font-size: 24px;
  color: #30cfd0;
  margin-bottom: 20px;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(48, 207, 208, 0.3);
  border-top: 5px solid #30cfd0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsives Design verbessert */
@media (max-width: 1024px) {
  #mobile-controls {
    display: flex;
  }
  
  .score-display {
    font-size: 18px;
  }
  
  .level-indicator {
    font-size: 14px;
  }
  
  #canvas {
    border-width: 1px;
  }
  
  .game-message, .game-over {
    font-size: 24px;
    padding: 15px;
  }
}

/* Sehr kleine Bildschirme (Smartphones) */
@media (max-width: 480px) {
  .score-display {
    font-size: 14px;
  }
  
  .level-indicator {
    font-size: 12px;
    padding: 3px 10px;
  }
  
  #joystick {
    width: 100px !important;
    height: 100px !important;
  }
  
  #stick {
    width: 34px !important;
    height: 34px !important;
  }
  
  #fire, #up {
    width: 70px !important;
    height: 70px !important;
    font-size: 12px !important;
  }
}

/* Animationen */
@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Level-Anzeige */
.level-indicator {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(48, 207, 208, 0.3);
  border: 1px solid #30cfd0;
  border-radius: 15px;
  padding: 5px 15px;
  font-size: 16px;
}

/* Debug-Log für Entwicklung */
#debug-log {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 10px;
  max-height: 200px;
  overflow: auto;
  z-index: 9999;
  font-family: monospace;
  font-size: 12px;
  max-width: 100%;
  box-sizing: border-box;
}
