/* Reset and global settings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  }
  
  img {
    max-width: 100%;
  }
  
  /* Header */
  .page-header {
    background-color: #111;
    padding: 20px;
  }
  
  .page-header h1 {
    color: #e60000;
    text-align: center;
    font-size: 2rem;
  }
  
  /* Main layout */
  .preview {
    max-width: 1400px;
    margin: 80px auto 40px;
  }
  
  .preview video {
    width: 100%;
    border-radius: 20px;
    border: 3px solid #017cc9;
    background-color: #000;
  }
  
  .screenshots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 40px;
  }
  
  .screenshot {
    max-width: 300px;
    border-radius: 20px;
    overflow: hidden;
    border: 3px solid #b60101;
  }
  
  .screenshot img {
    border-radius: 15px;
    object-fit: cover;
    width: 100%;
    height: 100%;
  }
  
  /* Game wrapper */
  .game-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .webgl {
    width: 100%;
    height: 600px;
    display: block;
    border-radius: 10px;
    outline: none;
  }
  
/* HUD 通用样式 */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: bold;
  z-index: 10;
}

/* 统一样式框 */
.hud-box {
  background: rgba(0, 0, 0, 0.5);
  color: #00ffcc;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 1.2rem;
  box-shadow: 0 0 10px #00ffcc;
  backdrop-filter: blur(4px);
  position: absolute;
  user-select: none;
}

/* 具体位置样式 */
.top-left {
  top: 20px;
  left: 20px;
}

.top-right {
  top: 20px;
  right: 20px;
}

.bottom-right {
  bottom: 20px;
  right: 20px;
}

.top-center {
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}
.hud #message.show {
  opacity: 1;
  transform: translateX(-50%) scale(1.05);
}

.hud #message {
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 128, 255, 0.85);
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 20px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

#reloadBarContainer {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 14px;
  background: rgba(255,255,255,0.2);
  border: 1px solid #aaa;
  border-radius: 7px;
  overflow: hidden;
  display: none;
}

#reloadBar {
  width: 0%;
  height: 100%;
  background: linear-gradient(to right, #ff8000, #ffcc00);
  transition: width 0.1s linear;
}

#startScreen {
      position: absolute;
      width: 80%;  /* 只占游戏窗口的80%宽度 */
      height: 50%; /* 高度为50% */
      background: rgba(0, 0, 0, 0.95);
      color: white;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      z-index: 9999;
      border-radius: 12px; /* 添加圆角效果 */
      text-align: center;
      opacity: 1;
      transition: opacity 1s ease;
    }

.start-screen h2 {
  margin-bottom: 15px;
}

.start-screen p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 20px;
}

#startButton {
  background: #4caf50;
  color: white;
  font-size: 18px;
  padding: 10px 30px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.3s;
}

#startButton:hover {
  background: #45a049;
}

#gameOverScreen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#gameOverScreen.show {
  opacity: 1;
  pointer-events: auto;
}

.gameOverContent {
  text-align: center;
}

#gameOverScreen h1 {
  font-size: 48px;
  margin-bottom: 20px;
}

#gameOverScreen p {
  font-size: 24px;
  margin-bottom: 30px;
}

#restartButton {
  padding: 10px 25px;
  font-size: 20px;
  background: #ff6600;
  border: none;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
}

#restartButton:hover {
  background: #ff3300;
}
.popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px;
  border-radius: 10px;
  display: none; /* 初始时隐藏 */
  font-size: 20px;
}
.page-footer p {
  background-color: black;
  color: white;
  padding: 100px;
  text-align: center;
}