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

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e8ba3 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
}

#game-container {
  width: 100%;
  max-width: 800px;
  height: 600px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
}

#ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#ui-overlay > * {
  pointer-events: auto;
}

#score-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 200px;
}

.stat-display {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 16px;
  font-weight: bold;
}

.stat-icon {
  font-size: 20px;
}

.stat-label {
  color: #FFD700;
}

#energy-bar {
  flex: 1;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

#energy-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
  transition: width 0.3s ease, background 0.3s ease;
  border-radius: 8px;
}

#energy-fill.low {
  background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
}

#energy-fill.critical {
  background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
  animation: pulse 0.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

#instructions {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 15px 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  color: white;
  font-size: 14px;
  text-align: right;
}

#instructions p {
  margin: 5px 0;
}

#start-screen,
#game-over-screen {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 40px 50px;
  border-radius: 20px;
  text-align: center;
  color: white;
  backdrop-filter: blur(20px);
  border: 3px solid rgba(255, 215, 0, 0.5);
  animation: slideIn 0.5s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(-50%, -60%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

#start-screen h1 {
  font-size: 3em;
  margin-bottom: 10px;
  color: #FFD700;
  text-shadow: 0 0 20px #FFD700;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.subtitle {
  font-size: 1.2em;
  color: #87CEEB;
  margin-bottom: 30px;
}

.game-btn {
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  font-size: 1.3em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
  font-weight: bold;
}

.game-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 30px rgba(255, 107, 107, 0.6);
}

.game-btn:active {
  transform: translateY(-1px) scale(1.02);
}

.tips {
  margin-top: 30px;
  text-align: left;
  background: rgba(255, 255, 255, 0.1);
  padding: 20px;
  border-radius: 10px;
  font-size: 0.9em;
}

.tips p:first-child {
  color: #FFD700;
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.tips p {
  margin: 5px 0;
}

#game-over-screen h2 {
  font-size: 2.5em;
  color: #FF6B6B;
  margin-bottom: 20px;
  text-shadow: 0 0 20px #FF6B6B;
}

#game-over-screen p {
  font-size: 1.3em;
  margin: 10px 0;
}

#game-over-screen span {
  color: #FFD700;
  font-weight: bold;
}

.hidden {
  display: none !important;
}

@media (max-width: 768px) {
  #game-container {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  
  #score-panel {
    top: 10px;
    left: 10px;
    padding: 10px 15px;
    min-width: 150px;
  }
  
  .stat-display {
    font-size: 14px;
  }
  
  #instructions {
    top: 10px;
    right: 10px;
    padding: 10px 15px;
    font-size: 12px;
  }
  
  #start-screen,
  #game-over-screen {
    padding: 30px 20px;
    width: 90%;
  }
  
  #start-screen h1 {
    font-size: 2em;
  }
}
