/* ==================== 科幻打字射击 - 全局样式 ==================== */

:root {
  --neon-cyan: #00f0ff;
  --neon-blue: #0080ff;
  --neon-magenta: #ff00ff;
  --neon-green: #00ff80;
  --neon-red: #ff2040;
  --neon-orange: #ff8040;
  --neon-yellow: #ffe040;
  --dark-bg: #020210;
  --panel-bg: rgba(5, 10, 30, 0.85);
  --panel-border: rgba(0, 240, 255, 0.3);
  --glow-cyan: 0 0 10px rgba(0, 240, 255, 0.6);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Courier New', 'Monaco', monospace;
  background: var(--dark-bg);
  color: #e0e8ff;
  user-select: none;
}

#game-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(ellipse at center bottom, #0a0a30 0%, #020208 100%);
}

#game-root.screen-shake {
  animation: screenShake 0.24s ease-out;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); }
  40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, 2px); }
  80% { transform: translate(4px, -2px); }
}

/* ==================== 背景 ==================== */
.bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* ==================== HUD 顶部状态栏 ==================== */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(2, 4, 20, 0.95) 0%, rgba(2, 4, 20, 0.5) 80%, transparent 100%);
  border-bottom: 1px solid rgba(0, 240, 255, 0.15);
  pointer-events: none;
}

.hud-section {
  display: flex;
  gap: 16px;
  align-items: center;
}

.hud-center {
  flex-direction: column;
  gap: 4px;
  text-align: center;
}

.hud-player-name {
  max-width: 180px;
  overflow: hidden;
  color: rgba(224, 232, 255, 0.48);
  font-size: 10px;
  letter-spacing: 2px;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 55px;
}

.hud-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: rgba(0, 240, 255, 0.5);
  text-transform: uppercase;
}

.hud-value {
  font-size: 20px;
  font-weight: bold;
  color: #e0e8ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
  font-variant-numeric: tabular-nums;
}

.wpm-val { color: var(--neon-cyan); }
.wpm-val.hot { color: var(--neon-yellow); text-shadow: 0 0 10px var(--neon-yellow); }
.acc-val.warn { color: var(--neon-red); }
.combo-val.hot { color: var(--neon-orange); text-shadow: 0 0 8px var(--neon-orange); }
.score-val { color: var(--neon-green); }

.hud-level {
  font-size: 16px;
  font-weight: bold;
  color: var(--neon-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.hud-remaining {
  font-size: 11px;
  color: rgba(224, 232, 255, 0.6);
}

.hud-health {
  font-size: 14px;
  letter-spacing: 2px;
}

.health-heart {
  display: inline-block;
  font-family: Arial, sans-serif;
  font-style: normal;
}

.health-heart.heart-full {
  color: var(--neon-red);
  text-shadow: 0 0 6px rgba(255, 32, 64, 0.6);
}

.health-heart.heart-empty {
  color: rgba(255, 32, 64, 0.28);
}

/* 迷你图表 */
.mini-chart {
  position: absolute;
  top: 52px;
  right: 16px;
  width: 200px;
  height: 40px;
  opacity: 0.8;
  pointer-events: none;
}

/* ==================== 游戏区域 ==================== */
.game-field {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  pointer-events: none;
}

.level-hint {
  position: absolute;
  top: 44%;
  left: 50%;
  z-index: 20;
  max-width: calc(100% - 32px);
  padding: 12px 24px;
  color: var(--neon-cyan);
  background: rgba(2, 4, 20, 0.48);
  border: 1px solid rgba(0, 240, 255, 0.42);
  border-radius: 6px;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.22);
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.75);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: levelHintFade 1.6s ease-out forwards;
}

@keyframes levelHintFade {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
  15%, 72% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.04); }
}

/* ==================== 玩家飞船 ==================== */
.player-ship {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 8;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4));
  transition: filter 0.08s;
  will-change: transform, filter;
}

.player-ship::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(0, 240, 255, 0.42);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.28), inset 0 0 12px rgba(0, 240, 255, 0.18);
  animation: playerShield 2.4s ease-in-out infinite;
  pointer-events: none;
}

.player-ship::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -15px;
  width: 34px;
  height: 30px;
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.58), transparent);
  filter: blur(4px);
  transform: translateX(-50%);
  animation: enginePulse 0.7s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes playerShield {
  0%, 100% { opacity: 0.45; transform: scale(0.94); }
  50% { opacity: 0.9; transform: scale(1.06); }
}

@keyframes enginePulse {
  from { opacity: 0.45; height: 18px; }
  to { opacity: 0.9; height: 34px; }
}

.player-ship.firing {
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.9));
}

.player-ship svg {
  width: 100%;
  height: 100%;
  animation: shipBob 2s ease-in-out infinite;
}

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

/* ==================== 敌机 ==================== */
.enemy {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: filter 0.15s;
}

.enemy-ship {
  width: 100%;
  height: auto;
  display: block;
  transform: rotate(180deg) rotate(var(--flight-tilt, 0deg));
  filter: drop-shadow(0 0 4px rgba(255, 60, 60, 0.3));
  transition: filter 0.15s, transform 0.18s ease-out;
  will-change: transform;
}

.enemy-ship svg {
  width: 100%;
  height: 100%;
  animation: enemyFloat 1.5s ease-in-out infinite;
}

.enemy[data-enemy-type="scout"] .enemy-ship svg { animation-duration: 1.05s; }
.enemy[data-enemy-type="fighter"] .enemy-ship svg { animation-duration: 1.35s; }
.enemy[data-enemy-type="bomber"] .enemy-ship svg { animation-duration: 2.1s; }
.enemy[data-enemy-type="elite"] .enemy-ship svg { animation-duration: 0.92s; }
.enemy[data-enemy-type="boss"] .enemy-ship svg { animation-duration: 2.8s; }

@keyframes enemyFloat {
  0%, 100% { transform: rotate(-2deg); }
  50% { transform: rotate(2deg); }
}

.enemy-type {
  position: absolute;
  top: -7px;
  right: -12px;
  padding: 2px 5px;
  color: rgba(224, 232, 255, 0.58);
  background: rgba(2, 4, 20, 0.72);
  border: 1px solid rgba(224, 232, 255, 0.18);
  border-radius: 3px;
  font-size: 8px;
  letter-spacing: 1px;
  opacity: 0.7;
  pointer-events: none;
  transform: scale(0.9);
  transform-origin: right center;
}

.enemy[data-enemy-type="scout"] .enemy-type { color: #ff8090; border-color: rgba(255, 64, 96, 0.4); }
.enemy[data-enemy-type="fighter"] .enemy-type { color: #ffb080; border-color: rgba(255, 128, 64, 0.4); }
.enemy[data-enemy-type="bomber"] .enemy-type { color: #d0a0ff; border-color: rgba(192, 96, 255, 0.4); }
.enemy[data-enemy-type="elite"] .enemy-type { color: #80ffb8; border-color: rgba(0, 255, 128, 0.4); }
.enemy[data-enemy-type="boss"] .enemy-type { color: var(--neon-yellow); border-color: rgba(255, 224, 64, 0.55); }

.enemy-progress {
  width: min(100%, 74px);
  height: 3px;
  margin-top: 4px;
  overflow: hidden;
  background: rgba(224, 232, 255, 0.12);
  border-radius: 3px;
  opacity: 0.7;
}

.enemy-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--neon-green), var(--neon-cyan));
  box-shadow: 0 0 7px var(--neon-cyan);
  transition: width 0.18s ease-out;
}

.enemy.targeted .enemy-type,
.enemy.targeted .enemy-progress {
  opacity: 1;
}

.enemy.targeted .enemy-ship {
  filter: drop-shadow(0 0 8px var(--neon-cyan));
}

.enemy.targeted::before {
  content: '🎯';
  position: absolute;
  top: -18px;
  font-size: 12px;
  z-index: 7;
  animation: lockPulse 0.6s ease-in-out infinite;
}

@keyframes lockPulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* 单词标签 */
.enemy-word {
  margin-top: 2px;
  padding: 3px 10px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 2px;
  border-radius: 4px;
  background: rgba(2, 4, 20, 0.8);
  border: 1px solid rgba(255, 60, 60, 0.4);
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  min-width: 40px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.enemy.targeted .enemy-word {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.enemy-word .typed {
  color: var(--neon-green);
  text-shadow: 0 0 6px var(--neon-green);
}

.enemy-word .pending {
  color: var(--neon-yellow);
  text-shadow: 0 0 6px var(--neon-yellow);
}

.enemy-word .remaining {
  color: #e0e8ff;
}

.enemy.targeted .enemy-word .remaining {
  color: var(--neon-cyan);
}

/* ==================== 子弹 ==================== */
.bullet {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 20px;
  z-index: 7;
  pointer-events: none;
  filter: drop-shadow(0 0 4px var(--neon-cyan));
}

.bullet svg {
  width: 100%;
  height: 100%;
  transform: rotate(var(--bullet-angle, 0rad));
  transform-origin: 50% 50%;
}

/* ==================== 爆炸特效 ==================== */
.explosion {
  position: absolute;
  pointer-events: none;
  z-index: 9;
  transform: translate(-50%, -50%);
}

.explosion-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  animation: flashFade 0.4s ease-out forwards;
}

@keyframes flashFade {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

.explosion-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  animation: particleFly 0.6s ease-out forwards;
}

@keyframes particleFly {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0); opacity: 0; }
}

/* ==================== 覆盖层 ==================== */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 4, 16, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.overlay.hidden {
  display: none;
}

/* ==================== 菜单 ==================== */
.menu-screen, .level-transition, .level-complete, .game-over-screen, .pause-screen, .leaderboard-screen {
  text-align: center;
  padding: 40px;
  max-width: 600px;
}

.game-title {
  font-size: 72px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--neon-cyan);
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.6), 0 0 40px rgba(0, 240, 255, 0.3);
  margin-bottom: 8px;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 20px rgba(0, 240, 255, 0.6), 0 0 40px rgba(0, 240, 255, 0.3); }
  50% { text-shadow: 0 0 30px rgba(0, 240, 255, 0.9), 0 0 60px rgba(0, 240, 255, 0.5); }
}

.title-accent {
  color: var(--neon-magenta);
  text-shadow: 0 0 20px rgba(255, 0, 255, 0.6);
}

.game-subtitle {
  font-size: 14px;
  letter-spacing: 4px;
  color: rgba(224, 232, 255, 0.5);
  margin-bottom: 30px;
}

.menu-info {
  text-align: left;
  display: inline-block;
  margin-bottom: 30px;
}

.call-sign-card {
  width: min(100%, 380px);
  margin: 0 auto 24px;
  padding: 14px 16px;
  text-align: left;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(255, 0, 255, 0.06));
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 8px;
  box-shadow: inset 0 0 22px rgba(0, 240, 255, 0.04), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.call-sign-label {
  margin-bottom: 8px;
  color: var(--neon-cyan);
  font-size: 11px;
  letter-spacing: 2px;
}

.call-sign-input-wrap {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 240, 255, 0.42);
}

.call-sign-prefix {
  padding-right: 10px;
  color: rgba(0, 240, 255, 0.52);
  font-size: 12px;
  letter-spacing: 1px;
}

.call-sign-input {
  width: 100%;
  padding: 5px 0 7px;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 18px;
  letter-spacing: 2px;
}

.call-sign-input:focus { text-shadow: 0 0 8px rgba(0, 240, 255, 0.45); }

.call-sign-hint {
  margin-top: 8px;
  color: rgba(224, 232, 255, 0.4);
  font-size: 10px;
  line-height: 1.5;
}

.menu-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
}

.info-row {
  padding: 6px 0;
  font-size: 14px;
  color: rgba(224, 232, 255, 0.7);
}

.info-row span {
  margin-right: 8px;
}

/* ==================== 按钮 ==================== */
.btn-start {
  display: inline-block;
  padding: 14px 48px;
  font-size: 18px;
  font-weight: bold;
  font-family: inherit;
  letter-spacing: 3px;
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 128, 255, 0.3), rgba(0, 240, 255, 0.3));
  border: 2px solid var(--neon-cyan);
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.3), inset 0 0 20px rgba(0, 240, 255, 0.1);
  margin: 8px;
}

.btn-start:hover {
  background: linear-gradient(135deg, rgba(0, 128, 255, 0.5), rgba(0, 240, 255, 0.5));
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.6), inset 0 0 30px rgba(0, 240, 255, 0.2);
  transform: scale(1.05);
}

.btn-start:active {
  transform: scale(0.98);
}

.btn-small {
  padding: 10px 32px;
  font-size: 15px;
}

.btn-secondary {
  display: inline-block;
  padding: 10px 32px;
  font-size: 14px;
  font-family: inherit;
  color: rgba(224, 232, 255, 0.6);
  background: transparent;
  border: 1px solid rgba(224, 232, 255, 0.2);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 8px;
}

.btn-secondary:hover {
  color: #fff;
  border-color: rgba(224, 232, 255, 0.5);
}

.menu-hint {
  margin-top: 20px;
  font-size: 11px;
  color: rgba(224, 232, 255, 0.3);
  letter-spacing: 1px;
}

/* ==================== 关卡过渡 ==================== */
.level-badge {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 900;
  color: var(--neon-cyan);
  border: 3px solid var(--neon-cyan);
  border-radius: 50%;
  text-shadow: 0 0 10px var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.3);
  animation: badgeAppear 0.5s ease-out;
}

@keyframes badgeAppear {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.level-title {
  font-size: 28px;
  color: #fff;
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.level-info {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.info-tag {
  padding: 6px 16px;
  font-size: 13px;
  color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}

/* ==================== 关卡完成 ==================== */
.complete-title {
  font-size: 32px;
  color: var(--neon-green);
  letter-spacing: 4px;
  margin-bottom: 20px;
  text-shadow: 0 0 15px rgba(0, 255, 128, 0.5);
}

.complete-title.victory {
  color: var(--neon-yellow);
  text-shadow: 0 0 15px rgba(255, 224, 64, 0.5);
}

.victory-msg {
  color: rgba(224, 232, 255, 0.6);
  margin-bottom: 20px;
}

.complete-stats {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  min-width: 80px;
}

.stat-val {
  font-size: 28px;
  font-weight: bold;
  color: var(--neon-cyan);
}

.stat-lbl {
  font-size: 11px;
  color: rgba(224, 232, 255, 0.5);
  margin-top: 4px;
  letter-spacing: 1px;
}

/* ==================== 游戏结束 ==================== */
.go-title {
  font-size: 36px;
  color: var(--neon-red);
  letter-spacing: 6px;
  margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(255, 32, 64, 0.5);
}

.go-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.submit-status {
  min-height: 18px;
  margin: -8px auto 10px;
  color: rgba(224, 232, 255, 0.46);
  font-size: 11px;
  letter-spacing: 0.5px;
}

.submit-status.pending { color: var(--neon-yellow); }
.submit-status.success { color: var(--neon-green); text-shadow: 0 0 8px rgba(0, 255, 128, 0.35); }
.submit-status.error { color: #ff9aa8; }

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  background: rgba(255, 32, 64, 0.05);
  border-bottom: 1px solid rgba(255, 32, 64, 0.15);
  font-size: 14px;
}

.stat-row .hl {
  color: var(--neon-cyan);
  font-weight: bold;
}

.stat-row .hl.big {
  color: var(--neon-yellow);
  font-size: 18px;
  text-shadow: 0 0 8px rgba(255, 224, 64, 0.5);
}

/* ==================== 暂停 ==================== */
.pause-screen h2 {
  font-size: 36px;
  color: var(--neon-cyan);
  letter-spacing: 6px;
  margin-bottom: 20px;
}

.pause-stats {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 24px;
  font-size: 14px;
  color: rgba(224, 232, 255, 0.6);
}

/* ==================== 排行榜 ==================== */
.leaderboard-screen {
  width: min(760px, calc(100vw - 24px));
  max-width: 760px;
  padding: 28px 24px 24px;
}

.screen-kicker {
  color: rgba(0, 240, 255, 0.55);
  font-size: 10px;
  letter-spacing: 3px;
}

.leaderboard-title {
  margin: 8px 0 4px;
  color: #fff;
  font-size: 32px;
  letter-spacing: 5px;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.48);
}

.leaderboard-subtitle {
  margin-bottom: 20px;
  color: rgba(224, 232, 255, 0.45);
  font-size: 12px;
}

.leaderboard-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.leader-tab, .leader-refresh {
  padding: 8px 14px;
  color: rgba(224, 232, 255, 0.55);
  background: rgba(224, 232, 255, 0.04);
  border: 1px solid rgba(224, 232, 255, 0.12);
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: all 0.2s;
}

.leader-tab:hover, .leader-refresh:hover { color: #fff; border-color: rgba(0, 240, 255, 0.55); }
.leader-tab.active { color: var(--neon-cyan); background: rgba(0, 240, 255, 0.1); border-color: var(--neon-cyan); box-shadow: 0 0 12px rgba(0, 240, 255, 0.18); }
.leader-refresh { margin-left: auto; padding: 8px 11px; color: var(--neon-cyan); font-size: 18px; line-height: 1; }

.leaderboard-date {
  margin-bottom: 8px;
  color: rgba(224, 232, 255, 0.32);
  font-size: 10px;
  letter-spacing: 0.8px;
  text-align: left;
}

.leaderboard-table {
  min-height: 220px;
  max-height: min(52vh, 460px);
  overflow: auto;
  padding: 6px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 6px;
}

.leader-head, .leader-row {
  display: grid;
  grid-template-columns: 58px minmax(130px, 1fr) 108px 72px 110px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  text-align: left;
}

.leader-head {
  min-height: 30px;
  color: rgba(0, 240, 255, 0.48);
  border-bottom: 1px solid rgba(0, 240, 255, 0.16);
  font-size: 10px;
  letter-spacing: 1px;
}

.leader-row {
  color: rgba(224, 232, 255, 0.76);
  border-bottom: 1px solid rgba(224, 232, 255, 0.06);
  font-size: 12px;
}

.leader-row:last-child { border-bottom: 0; }
.leader-row:hover { background: rgba(0, 240, 255, 0.05); }
.leader-rank { color: rgba(224, 232, 255, 0.4); font-weight: bold; text-align: center; }
.leader-name { overflow: hidden; color: #fff; font-weight: bold; text-overflow: ellipsis; white-space: nowrap; }
.leader-level, .leader-accuracy { color: rgba(224, 232, 255, 0.45); font-size: 10px; }
.leader-score { color: var(--neon-yellow); font-weight: bold; text-align: right; text-shadow: 0 0 8px rgba(255, 224, 64, 0.35); }
.podium-1 { background: linear-gradient(90deg, rgba(255, 224, 64, 0.13), transparent); }
.podium-1 .leader-rank { color: var(--neon-yellow); }
.podium-2 .leader-rank { color: #c5d6ea; }
.podium-3 .leader-rank { color: #d99b6f; }

.leader-empty {
  display: flex;
  min-height: 180px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: rgba(224, 232, 255, 0.44);
  font-size: 13px;
}

.leader-empty > span { color: var(--neon-cyan); font-size: 30px; }
.leader-empty small { max-width: 320px; color: rgba(224, 232, 255, 0.28); font-size: 10px; line-height: 1.5; }
.leader-error { color: #ffadb8; }
.leader-error > span { color: #ff6680; }
.loader-dot { width: 10px; height: 10px; border: 2px solid rgba(0, 240, 255, 0.3); border-top-color: var(--neon-cyan); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.leaderboard-actions { margin-top: 14px; }

/* ==================== BOSS 警报 ==================== */
.boss-alert {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 50;
  font-size: 32px;
  font-weight: bold;
  color: var(--neon-red);
  text-shadow: 0 0 20px var(--neon-red);
  letter-spacing: 6px;
  animation: bossAlert 0.5s ease-in-out infinite;
  pointer-events: none;
}

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

/* ==================== 屏幕特效 ==================== */
#game-root.flash::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(255, 32, 64, 0.15);
  z-index: 200;
  pointer-events: none;
  animation: flashAnim 0.15s ease-out;
}

@keyframes flashAnim {
  0% { opacity: 0.6; }
  100% { opacity: 0; }
}

#game-root.damaged::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(255, 0, 0, 0.3) 100%);
  z-index: 200;
  pointer-events: none;
  animation: damageAnim 0.3s ease-out;
}

@keyframes damageAnim {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .game-title { font-size: 48px; letter-spacing: 4px; }
  .hud-section { gap: 8px; }
  .hud-stat { min-width: 40px; }
  .hud-value { font-size: 16px; }
  .hud-label { font-size: 8px; }
  .hud-level { font-size: 13px; }
  .mini-chart { width: 120px; }
  .hud-top { padding: 8px; }
  .hud-section { gap: 5px; }
  .hud-player-name { max-width: 90px; }
  .call-sign-card { margin-bottom: 18px; }
  .menu-screen, .game-over-screen, .pause-screen { padding: 24px 16px; }
  .leaderboard-screen { padding: 22px 10px 18px; }
  .leaderboard-title { font-size: 25px; letter-spacing: 3px; }
  .leader-head, .leader-row { grid-template-columns: 38px minmax(90px, 1fr) 72px 52px 78px; gap: 5px; padding: 0 6px; }
  .leader-level, .leader-accuracy { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
