/* ==================== 全局样式 ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* 废土配色方案 */
  --bg-dark: #1a1a1a;
  --bg-darker: #0d0d0d;
  --bg-card: #2a2a2a;
  
  --blood-red: #c41e3a;
  --blood-red-hover: #a01830;
  --blood-red-light: #ff4757;
  
  --iron-gray: #8c8c8c;
  --iron-gray-light: #b8b8b8;
  
  --warning-orange: #ff6b35;
  
  --text-primary: #ffffff;
  --text-secondary: #d0d0d0;
  --text-muted: #888888;
  
  --border-color: #4a4a4a;
  --border-red: #c41e3a;
  
  /* 字体 */
  --font-title: 'Anton', sans-serif;
  --font-body: 'Inter', sans-serif;
}

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* ==================== 屏幕切换 ==================== */
.screen {
  display: none;
  width: 100%;
  height: 100%;
}

.screen.active {
  display: block;
}

/* ==================== 主菜单 ==================== */
#menu-screen {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 50%, #2a1a1a 100%);
  position: relative;
  overflow-y: auto;
}

.menu-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 2rem;
  gap: 3rem;
}

/* 标题区域 */
.title-section {
  text-align: center;
  animation: titleShake 0.5s ease-in-out;
}

@keyframes titleShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.game-title {
  font-family: var(--font-title);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--blood-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-shadow: 
    4px 4px 0px #000000,
    0 0 20px rgba(196, 30, 58, 0.5);
  margin-bottom: 0.5rem;
}

.game-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

/* 内容区域 */
.content-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  width: 100%;
  max-width: 1200px;
}

/* 信息卡片 */
.info-card {
  background: var(--bg-card);
  border: 2px solid var(--border-red);
  padding: 2rem;
  box-shadow: 
    0 0 20px rgba(196, 30, 58, 0.2),
    inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-red);
  padding-bottom: 1rem;
}

.card-header .icon {
  font-size: 1.5rem;
}

.card-header h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  color: var(--blood-red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.card-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 信息区块 */
.info-section h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.info-section p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-section strong {
  color: var(--blood-red-light);
}

/* 武器列表 */
.weapon-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.weapon-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-darker);
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--blood-red);
}

.weapon-name {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--text-primary);
}

.weapon-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 控制说明 */
.controls-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.controls-section h3 {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-item kbd {
  background: var(--bg-darker);
  border: 2px solid var(--border-color);
  padding: 0.5rem 1rem;
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text-primary);
  min-width: 100px;
  text-align: center;
}

.control-item span {
  color: var(--text-secondary);
}

/* 提示框 */
.tip-box {
  background: var(--bg-darker);
  border: 2px solid var(--warning-orange);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.tip-icon {
  font-size: 1.25rem;
}

.tip-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* 开始按钮 */
.start-button-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
}

.start-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--blood-red);
  color: var(--text-primary);
  border: none;
  padding: 1.25rem 3rem;
  font-family: var(--font-title);
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 
    0 6px 0 var(--blood-red-hover),
    0 0 30px rgba(196, 30, 58, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 0 var(--blood-red-hover), 0 0 30px rgba(196, 30, 58, 0.4); }
  50% { box-shadow: 0 6px 0 var(--blood-red-hover), 0 0 50px rgba(196, 30, 58, 0.6); }
}

.start-button:hover {
  background: var(--blood-red-light);
  box-shadow: 
    0 4px 0 var(--blood-red-hover),
    0 0 40px rgba(196, 30, 58, 0.6);
  transform: translateY(2px);
}

.start-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--blood-red-hover);
}

.btn-icon {
  font-size: 1.75rem;
}

/* ==================== 游戏界面 ==================== */
#game-screen {
  position: relative;
  background: #000;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

/* HUD */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  padding: 1.5rem;
}

.hud-panel {
  position: absolute;
  pointer-events: none;
}

/* 血条 */
.health-panel {
  bottom: 1.5rem;
  left: 1.5rem;
}

.health-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(26, 26, 26, 0.9);
  padding: 0.75rem 1rem;
  border: 2px solid var(--border-red);
}

.health-label {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--blood-red);
  min-width: 40px;
}

.health-bar {
  width: 200px;
  height: 20px;
  background: var(--bg-darker);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.health-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blood-red), var(--blood-red-light));
  transition: width 0.3s ease;
}

.health-text {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--text-primary);
  min-width: 50px;
  text-align: right;
}

/* 弹药信息 */
.ammo-panel {
  bottom: 1.5rem;
  right: 1.5rem;
  text-align: right;
  background: rgba(26, 26, 26, 0.9);
  padding: 1rem 1.5rem;
  border: 2px solid var(--border-color);
}

.weapon-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--blood-red);
  margin-bottom: 0.25rem;
}

.ammo-display {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--text-primary);
}

.ammo-separator {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

/* 武器栏 */
.weapons-panel {
  bottom: 6rem;
  right: 1.5rem;
}

.weapon-slots {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.weapon-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(26, 26, 26, 0.8);
  border: 2px solid var(--border-color);
  opacity: 0.5;
  transition: all 0.2s ease;
}

.weapon-slot.active {
  opacity: 1;
  border-color: var(--blood-red);
  background: rgba(196, 30, 58, 0.2);
}

.weapon-slot-number {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text-muted);
  min-width: 20px;
}

.weapon-slot-name {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 击杀数 */
.kill-panel {
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(26, 26, 26, 0.9);
  padding: 0.75rem 1.25rem;
  border: 2px solid var(--blood-red);
}

.kill-label {
  font-family: var(--font-title);
  font-size: 1.25rem;
  color: var(--blood-red);
}

.kill-count {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* ==================== 游戏结束界面 ==================== */
.game-over-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.game-over-content {
  text-align: center;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.game-over-title {
  font-family: var(--font-title);
  font-size: 4rem;
  color: var(--blood-red);
  margin-bottom: 2rem;
  text-transform: uppercase;
  text-shadow: 0 0 30px rgba(196, 30, 58, 0.6);
}

.stats-display {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.stat-item {
  background: var(--bg-card);
  padding: 1.5rem 2rem;
  border: 2px solid var(--border-color);
}

.stat-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 2rem;
  color: var(--blood-red);
}

.restart-button {
  background: var(--blood-red);
  color: var(--text-primary);
  border: none;
  padding: 1rem 3rem;
  font-family: var(--font-title);
  font-size: 1.5rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 0 var(--blood-red-hover);
}

.restart-button:hover {
  background: var(--blood-red-light);
  transform: translateY(2px);
}

.restart-button:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--blood-red-hover);
}

/* ==================== 暂停菜单 ==================== */
.pause-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.pause-content {
  text-align: center;
  background: var(--bg-card);
  padding: 3rem 5rem;
  border: 2px solid var(--blood-red);
}

.pause-title {
  font-family: var(--font-title);
  font-size: 3rem;
  color: var(--blood-red);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.pause-hint {
  font-size: 1.25rem;
  color: var(--text-secondary);
}

/* ==================== 辅助类 ==================== */
.hidden {
  display: none !important;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .content-wrapper {
    grid-template-columns: 1fr;
  }
  
  .game-title {
    font-size: 2.5rem;
  }
  
  .info-card {
    padding: 1.5rem;
  }
  
  .health-bar {
    width: 150px;
  }
}
