/* main.css - 最终12小时 V1.0 全局样式 */
/* 基础样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Microsoft YaHei", "SimHei", sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: #000;
  color: #fff;
}

/* 3D场景容器（核心渲染层） */
#scene-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

/* UI总容器（所有UI的父容器，保证层级） */
#ui-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none; /* 不阻挡3D场景的鼠标/键盘交互 */
}

/* ------------------------------ */
/* 左上角HUD样式（血条/压力值/玩家状态） */
/* ------------------------------ */
#hud-container {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 11;
}

/* 血条/压力值通用样式 */
.health-bar, .stress-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 300px;
}

.health-bar img, .stress-bar img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* 进度条容器 */
.health-bar > div, .stress-bar > div {
  width: 220px;
  height: 22px;
  background-color: #222;
  border: 2px solid #ffffffcc;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

/* 血条进度 */
#health-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #e73030, #ff6666);
  transition: width 0.3s ease;
}

/* 压力值进度（按状态变色） */
#stress-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #00ff00, #33cc33);
  transition: width 0.3s ease;
}
/* 压力值状态变色（后续JS控制） */
#stress-progress.stress-warning {
  background: linear-gradient(90deg, #ffcc00, #ff9900);
}
#stress-progress.stress-danger {
  background: linear-gradient(90deg, #ff0000, #cc0000);
}

/* 数值文本 */
#health-value, #stress-value {
  font-size: 18px;
  font-weight: bold;
  text-shadow: 0 0 4px #000;
  min-width: 60px;
  text-align: center;
}

/* 玩家状态文本 */
#player-states {
  font-size: 14px;
  line-height: 1.6;
  text-shadow: 0 0 3px #000;
  background-color: #00000080;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ffffff50;
}

/* ------------------------------ */
/* 顶部时间&倒计时UI样式 */
/* ------------------------------ */
#time-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 11;
  background-color: #00000080;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid #ffffff50;
  min-width: 350px;
}

#current-time {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 5px;
}

#remaining-time {
  font-size: 18px;
  color: #cccccc;
  margin-bottom: 10px;
}

/* 安全舱倒计时样式 */
#escape-pod-timer {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #ffffff50;
}

#escape-pod-timer > div:first-child {
  width: 300px;
  height: 12px;
  background-color: #222;
  border: 1px solid #ffff00;
  border-radius: 6px;
  margin: 0 auto 8px;
  overflow: hidden;
}

#escape-pod-progress {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ffff00, #ffff66);
  transition: width 0.1s linear;
}

#escape-pod-seconds {
  color: #ffff00;
  font-weight: bold;
}

/* 爆炸倒计时样式 */
#explosion-timer {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #ff4444;
}

#explosion-timer > div:first-child {
  font-size: 24px;
  color: #ff4444;
  font-weight: bold;
  text-shadow: 0 0 5px #ff0000;
}

#explosion-timer > div:last-child {
  font-size: 16px;
  color: #ff9999;
  margin-top: 5px;
}

/* 游戏提示文本 */
#game-tips {
  margin-top: 12px;
  font-size: 18px;
  color: #ffffff;
  min-height: 22px;
  text-shadow: 0 0 4px #000;
}

/* ------------------------------ */
/* 右上角地图UI样式 */
/* ------------------------------ */
#map-container {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 200px;
  height: 200px;
  border: 2px solid #ffffff80;
  border-radius: 8px;
  background-color: #00000090;
  pointer-events: auto; /* 允许点击交互 */
  z-index: 11;
  overflow: hidden;
  cursor: pointer;
}

/* 小地图Canvas */
#mini-map {
  width: 100%;
  height: 100%;
  display: block;
}

/* 全屏地图样式 */
#full-map {
  position: fixed;
  top: 0;
  right: 0;
  width: 60vw;
  height: 100vh;
  background-color: #000000e0;
  z-index: 20;
  pointer-events: auto;
}

#full-map-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 90%;
  border: 2px solid #ffffff;
  border-radius: 8px;
  background-color: #111;
}

/* 关闭地图按钮 */
#full-map button {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  background-color: #ff4444;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

#full-map button:hover {
  background-color: #ff6666;
}

/* ------------------------------ */
/* 开局选区块面板样式 */
/* ------------------------------ */
#spawn-select-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #000000e0;
  padding: 30px;
  border: 2px solid #ffffff;
  border-radius: 12px;
  z-index: 30;
  pointer-events: auto;
  min-width: 400px;
}

#spawn-select-container > div:first-child {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffffff;
}

#spawn-countdown {
  color: #ff4444;
  font-weight: bold;
}

/* 区块选择网格 */
#block-select-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  grid-gap: 10px;
  margin: 0 auto 20px;
  justify-content: center;
}

/* 区块按钮样式 */
.block-select-btn {
  width: 80px;
  height: 80px;
  background-color: #333;
  border: 2px solid #ffffff80;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.block-select-btn:hover {
  background-color: #444;
  border-color: #ffffff;
}

.block-select-btn.selected {
  background-color: #0066cc;
  border-color: #0099ff;
  box-shadow: 0 0 10px #0099ff;
}

/* 区块按钮内的地标文本 */
.block-select-btn .landmark {
  font-size: 10px;
  color: #cccccc;
}

/* 当前选择文本 */
#spawn-select-container > div:last-child {
  font-size: 18px;
  color: #ffffff;
  text-align: center;
}

#selected-block {
  color: #00ff00;
  font-weight: bold;
}

/* ------------------------------ */
/* 底部提示文本样式 */
/* ------------------------------ */
#tips-container {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 20px;
  text-shadow: 0 0 6px #000, 0 0 2px #000;
  text-align: center;
  z-index: 11;
  max-width: 80%;
  line-height: 1.5;
}

/* ------------------------------ */
/* 响应式适配（适配不同屏幕尺寸） */
/* ------------------------------ */
@media (max-width: 1200px) {
  #time-container {
    min-width: 300px;
    padding: 10px 20px;
  }
  #current-time {
    font-size: 20px;
  }
  #remaining-time {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  #hud-container {
    top: 10px;
    left: 10px;
    gap: 10px;
  }
  .health-bar, .stress-bar {
    min-width: 250px;
  }
  .health-bar > div, .stress-bar > div {
    width: 180px;
  }
  #map-container {
    width: 150px;
    height: 150px;
    top: 10px;
    right: 10px;
  }
  #spawn-select-container {
    min-width: 320px;
    padding: 20px;
  }
  #block-select-grid {
    grid-template-columns: repeat(4, 70px);
  }
  .block-select-btn {
    width: 70px;
    height: 70px;
  }
}

/* ------------------------------ */
/* 通用动画 */
/* ------------------------------ */
/* 屏幕晃动动画（安全舱投放时） */
@keyframes shake {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2px, -2px); }
  50% { transform: translate(2px, 2px); }
  75% { transform: translate(-2px, 2px); }
  100% { transform: translate(2px, -2px); }
}

.shake-scene {
  animation: shake 0.2s linear 5;
}

/* 提示文本闪烁动画 */
@keyframes blink {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

.blink-tip {
  animation: blink 1s linear infinite;
}