/* ===================================================
   星际战机 (Galaxy Striker) - 样式表
   赛博朋克/深空霓虹街机风格
   =================================================== */

:root {
  --primary-cyan: #00f0ff;
  --neon-blue: #0066ff;
  --neon-pink: #ff0055;
  --neon-purple: #9d00ff;
  --neon-yellow: #ffe600;
  --neon-green: #00ff66;
  --bg-dark: #000000;
  --bg-card: rgba(10, 12, 20, 0.92);
  --border-glow: rgba(0, 240, 255, 0.4);
  --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000000;
  font-family: var(--font-family);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 游戏最外层容器（纯黑无光斑干扰） */
#game-wrapper {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 520px;
  max-height: 920px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000000;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.1), 0 0 80px rgba(0, 0, 0, 1);
  border-radius: 12px;
  overflow: hidden;
}

@media (min-width: 521px) and (min-height: 850px) {
  #game-wrapper {
    border: 1px solid rgba(0, 240, 255, 0.25);
    height: 94vh;
  }
}

/* 核心画布 */
#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background-color: transparent;
  cursor: crosshair;
}

/* 顶部与全局 HUD 覆盖层 */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
  z-index: 10;
}

/* 顶部状态栏 */
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

.hud-player-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 血量与护盾条 */
.bar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.bar-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  width: 24px;
}

.bar-label.hp { color: #ff3366; }
.bar-label.shield { color: var(--primary-cyan); }

.meter-track {
  width: 120px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  width: 100%;
  border-radius: 4px;
  transition: width 0.25s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.meter-fill.hp {
  background: linear-gradient(90deg, #ff0055, #ff5500);
  box-shadow: 0 0 8px #ff0055;
}

.meter-fill.shield {
  background: linear-gradient(90deg, #0066ff, #00f0ff);
  box-shadow: 0 0 8px #00f0ff;
}

/* 分数与连击 */
.hud-score-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.score-title {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 700;
}

.score-value {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 10px var(--primary-cyan);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.combo-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--neon-yellow);
  text-shadow: 0 0 6px rgba(255, 230, 0, 0.6);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s, transform 0.2s;
}

.combo-badge.active {
  opacity: 1;
  transform: scale(1);
}

/* 右上角控制按钮组 */
.hud-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  pointer-events: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--primary-cyan);
  transform: scale(1.08);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* 底部操作与技能栏 */
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.hud-weapons {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
}

.weapon-level {
  font-size: 11px;
  font-weight: 800;
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
  letter-spacing: 1px;
}

.weapon-level.max {
  color: #ffe600;
  text-shadow: 0 0 8px #ffaa00, 0 0 16px #ff0055;
  animation: maxGlow 1s infinite alternate;
}

@keyframes maxGlow {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.06); filter: brightness(1.3); }
}

/* 关卡徽章指示器 */
.stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--primary-cyan);
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 0 6px var(--primary-cyan);
  backdrop-filter: blur(4px);
  margin-bottom: 4px;
}

/* 关卡过关与入场大型通告横幅 */
#stage-banner {
  position: absolute;
  top: 38%;
  left: 0;
  width: 100%;
  padding: 20px 0;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.25) 20%, rgba(0, 240, 255, 0.25) 80%, transparent);
  border-top: 1px solid rgba(0, 240, 255, 0.6);
  border-bottom: 1px solid rgba(0, 240, 255, 0.6);
  text-align: center;
  display: none;
  pointer-events: none;
  backdrop-filter: blur(4px);
  z-index: 25;
}

#stage-banner.active {
  display: block;
  animation: bannerPop 2.8s ease forwards;
}

#stage-banner h2 {
  font-size: 28px;
  letter-spacing: 5px;
  color: #fff;
  font-weight: 900;
  text-shadow: 0 0 15px var(--primary-cyan), 0 0 30px #0066ff;
  text-transform: uppercase;
}

#stage-banner p {
  font-size: 13px;
  letter-spacing: 3px;
  color: var(--neon-yellow);
  font-weight: 700;
  margin-top: 6px;
  text-shadow: 0 0 8px rgba(255, 230, 0, 0.8);
}

@keyframes bannerPop {
  0% { opacity: 0; transform: scale(0.9); }
  15% { opacity: 1; transform: scale(1); }
  80% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* 大招必杀技能按钮 */
.bomb-btn-wrapper {
  pointer-events: auto;
  position: relative;
}

.bomb-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: radial-gradient(circle, #ff0055 0%, #770022 100%);
  border: 2px solid #ff99bb;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(255, 0, 85, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.4);
  transition: transform 0.1s, box-shadow 0.2s;
  outline: none;
}

.bomb-btn:active {
  transform: scale(0.92);
}

.bomb-btn:disabled {
  opacity: 0.4;
  filter: grayscale(0.8);
  cursor: not-allowed;
}

.bomb-btn span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
}

.bomb-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--neon-yellow);
  color: #000;
  font-size: 11px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px var(--neon-yellow);
}

/* BOSS 血条 */
#boss-hud {
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: 85%;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 12;
}

#boss-hud.visible {
  display: flex;
  animation: fadeInDown 0.4s ease forwards;
}

.boss-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ff3366;
  text-shadow: 0 0 10px #ff0055;
}

.boss-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 51, 102, 0.6);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 10px rgba(255, 0, 85, 0.3);
}

.boss-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff0055, #ffaa00);
  box-shadow: 0 0 10px #ff0055;
  transition: width 0.15s ease;
}

/* 警报浮层 (BOSS WARNING) */
#boss-warning {
  position: absolute;
  top: 35%;
  left: 0;
  width: 100%;
  padding: 16px 0;
  background: rgba(255, 0, 55, 0.25);
  border-top: 2px solid #ff0055;
  border-bottom: 2px solid #ff0055;
  text-align: center;
  display: none;
  pointer-events: none;
  backdrop-filter: blur(2px);
  z-index: 20;
}

#boss-warning.active {
  display: block;
  animation: warningFlash 0.5s infinite alternate;
}

#boss-warning h2 {
  font-size: 26px;
  letter-spacing: 6px;
  color: #ff0055;
  font-weight: 900;
  text-shadow: 0 0 15px #ff0055, 0 0 30px #ff0055;
}

#boss-warning p {
  font-size: 12px;
  letter-spacing: 3px;
  color: #fff;
  opacity: 0.9;
  margin-top: 4px;
}

/* 模态弹窗与菜单层（开始、暂停、游戏结束） */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 17, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 240, 255, 0.2);
  text-align: center;
  animation: scaleUp 0.3s ease forwards;
}

.game-logo {
  margin-bottom: 20px;
}

.game-logo h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 3px;
  background: linear-gradient(135deg, #00f0ff 0%, #9d00ff 50%, #ff0055 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.game-logo .sub {
  font-size: 12px;
  color: var(--primary-cyan);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 4px;
  opacity: 0.85;
}

/* 主操作按钮 */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #050711;
  background: linear-gradient(90deg, #00f0ff, #00b4d8);
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
  transition: all 0.25s ease;
  outline: none;
  margin-top: 14px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(0, 240, 255, 0.8);
}

.btn-secondary {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  margin-top: 10px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

/* 属性统计榜单 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 18px 0;
  text-align: left;
}

.stat-item {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 2px;
}

.stat-num {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.high-score-badge {
  display: inline-block;
  background: rgba(255, 230, 0, 0.15);
  border: 1px solid rgba(255, 230, 0, 0.4);
  color: var(--neon-yellow);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
}

/* 操作说明面板 */
.tips-panel {
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: 10px;
  margin-top: 16px;
  text-align: left;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.tips-panel span.key {
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 11px;
}

/* 动效关键帧 */
@keyframes warningFlash {
  0% { background: rgba(255, 0, 55, 0.15); }
  100% { background: rgba(255, 0, 55, 0.4); }
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
