/* ===== 预加载器样式 ===== */
#preLoader2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 1000;
  background-color: rgba(0, 0, 0, 0.7);
}

/* ===== 游戏容器基础样式 ===== */
#gameContainer {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 1001;
  /* background: white; */
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 横版游戏容器 - 16:9比例 ===== */
#gameContainer.game-container-horizontal {
  width: 95vw !important;
  height: calc(75vw * 9 / 16);
  max-width: 75vw;
  max-height: 90vh;
  min-height: 300px;
  padding: 0;
}

/* ===== 竖版游戏容器 - 9:16比例 ===== */
#gameContainer.game-container-vertical {
  width: calc(90vh * 9 / 16);
  height: 90vh;
  max-width: 500px;
  max-height: 90vh;
  min-width: 200px;
  padding: 0;
}

/* ===== 游戏框架基础样式 ===== */
#gameFrame {
  border: none;
  overflow: hidden;
  border-radius: 8px;
  object-fit: contain;
}

/* ===== 横版游戏框架 - 16:9比例 ===== */
#gameFrame.game-16-9 {
  aspect-ratio: 16 / 9;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* ===== 竖版游戏框架 - 9:16比例 ===== */
#gameFrame.game-9-16 {
  aspect-ratio: 9 / 16;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* ===== 关闭按钮样式 ===== */
#closeBtn {
  position: absolute;
  top: -20px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

#closeBtn:hover {
  background: rgba(0, 0, 0, 0.9);
}

/* ===== 媒体查询：移动端适配 ===== */
@media (max-width: 768px) {
  #gameContainer.game-container-horizontal {
    width: 80vw;
    height: calc(80vw * 9 / 16);
    max-width: 80vw;
    max-height: 80vh;
    min-height: 200px;
    padding: 0;
    box-sizing: border-box;
  }
  
  #gameContainer.game-container-vertical {
    width: calc(80vh * 9 / 16);
    height: 80vh;
    max-width: 80vw;
    max-height: 80vh;
    min-width: 150px;
    padding: 0;
    box-sizing: border-box;
  }
  
  #gameFrame.game-16-9 {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
  }
  
  #gameFrame.game-9-16 {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
  }
  
  #closeBtn {
    top: -20px;
    right: -5px;
    width: 25px;
    height: 25px;
    font-size: 16px;
  }
  
  #gameName {
    font-size: 18px;
  }
}

/* ===== 媒体查询：超小屏幕适配 ===== */
@media (max-width: 480px) {
  #gameContainer.game-container-horizontal {
    width: 95vw;
    height: calc(95vw * 9 / 16);
    max-width: 95vw;
    max-height: 85vh;
    min-height: 150px;
    padding: 0;
  }
  
  #gameContainer.game-container-vertical {
    width: calc(85vh * 9 / 16);
    height: 85vh;
    max-width: 95vw;
    max-height: 85vh;
    min-width: 120px;
    padding: 0;
  }
  
  #closeBtn {
    top: -20px;
    right: -5px;
    width: 20px;
    height: 20px;
    font-size: 14px;
  }
  
  #gameName {
    font-size: 16px;
  }
}

/* ===== 媒体查询：中等屏幕适配 ===== */
@media (min-width: 769px) and (max-width: 1400px) {
  #gameContainer {
    width: 800px;
    height: 510px;
  }
  
  #closeBtn {
    top: -20px;
    right: -5px;
  }
}

/* ===== 媒体查询：大屏幕适配 ===== */
@media (min-width: 2000px) {
  #gameContainer {
    width: 1200px !important;
  }
}

