/**
 * 太空射击游戏样式
 * 深色太空主题，霓虹效果
 */

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

body {
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, #0a0a1a 0%, #1a1a3a 100%);
  color: #ffffff;
  min-height: 100vh;
  overflow: hidden;
}

.game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 10px;
}

/* 游戏头部 */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin-bottom: 10px;
  padding: 10px 15px;
  background: rgba(20, 20, 50, 0.8);
  border-radius: 10px;
  border: 1px solid rgba(100, 150, 255, 0.3);
  flex-wrap: wrap;
  gap: 10px;
}

.score-panel {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.score-item {
  text-align: center;
}

.score-label {
  font-size: 11px;
  color: #8888aa;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 20px;
  font-weight: bold;
  color: #00ffff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.score-item.high-score .score-value {
  color: #ffcc00;
  text-shadow: 0 0 10px rgba(255, 204, 0, 0.5);
}

.control-buttons {
  display: flex;
  gap: 8px;
}

.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  background: linear-gradient(135deg, #4444aa, #6666cc);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #5555bb, #7777dd);
}

.btn-home {
  background: linear-gradient(135deg, #44aa66, #66cc88);
  color: white;
}

.btn-home:hover {
  background: linear-gradient(135deg, #55bb77, #77dd99);
}

.btn-bomb {
  background: linear-gradient(135deg, #aa4444, #cc6666);
  color: white;
}

.btn-bomb:hover {
  background: linear-gradient(135deg, #bb5555, #dd7777);
}

/* 画布容器 */
.canvas-wrapper {
  position: relative;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 4/3;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 100, 255, 0.3),
              0 0 60px rgba(0, 100, 255, 0.1);
  border: 2px solid rgba(100, 150, 255, 0.4);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #0a0a1a 0%, #1a1a3a 50%, #0a0a2a 100%);
}

/* 游戏覆盖层 */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 30, 0.9);
  z-index: 10;
  text-align: center;
  padding: 20px;
}

.game-overlay.hidden {
  display: none;
}

.overlay-title {
  font-size: 48px;
  font-weight: bold;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #00ffff, #0088ff, #8800ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
}

.overlay-subtitle {
  font-size: 18px;
  color: #aaaaaa;
  margin-bottom: 30px;
}

.overlay-score {
  font-size: 32px;
  color: #ffcc00;
  margin-bottom: 20px;
  text-shadow: 0 0 15px rgba(255, 204, 0, 0.5);
}

.overlay-btn {
  padding: 15px 40px;
  font-size: 20px;
  font-weight: bold;
  background: linear-gradient(135deg, #00aaff, #0066ff);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 5px 20px rgba(0, 100, 255, 0.4);
}

.overlay-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 100, 255, 0.6);
}

.overlay-controls {
  margin-top: 30px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  max-width: 500px;
}

.overlay-controls h3 {
  color: #00ffff;
  margin-bottom: 15px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  text-align: left;
  font-size: 14px;
  color: #cccccc;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.control-key {
  background: rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: monospace;
  color: #00ffff;
}

/* 暂停指示器 */
.pause-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 36px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  z-index: 5;
  display: none;
  background: rgba(0, 0, 0, 0.7);
  padding: 20px 40px;
  border-radius: 10px;
}

.pause-indicator.visible {
  display: block;
}

/* Boss 血条 */
.boss-health-bar {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  z-index: 5;
}

.boss-health-label {
  text-align: center;
  font-size: 14px;
  font-weight: bold;
  color: #ff4444;
  margin-bottom: 5px;
  text-shadow: 0 0 10px rgba(255, 68, 68, 0.8);
}

.boss-health-track {
  width: 100%;
  height: 20px;
  background: rgba(50, 0, 0, 0.8);
  border-radius: 10px;
  border: 2px solid #ff4444;
  overflow: hidden;
}

.boss-health-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff0000, #ff6600, #ff0000);
  transition: width 0.3s;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.6);
}

/* 移动端控制 */
.mobile-controls {
  margin-top: 15px;
  text-align: center;
}

.mobile-hint {
  font-size: 14px;
  color: #8888aa;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  display: inline-block;
}

/* 响应式设计 */
@media (max-width: 850px) {
  .game-header {
    flex-direction: column;
    align-items: center;
  }
  
  .score-panel {
    justify-content: center;
  }
  
  .control-buttons {
    order: -1;
    margin-bottom: 10px;
  }
}

@media (max-width: 600px) {
  .overlay-title {
    font-size: 32px;
  }
  
  .overlay-score {
    font-size: 24px;
  }
  
  .overlay-btn {
    padding: 12px 30px;
    font-size: 16px;
  }
  
  .control-grid {
    grid-template-columns: 1fr;
  }
  
  .score-value {
    font-size: 16px;
  }
  
  .score-label {
    font-size: 10px;
  }
}

/* 动画效果 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 255, 0.5); }
  50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.8); }
}

.pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

.glow {
  animation: glow 2s ease-in-out infinite;
}
