/* ===== 游戏视口 (16:9) ===== */
.game-viewport {
  width: 100vw;
  height: 56.25vw;       /* 16:9 */
  max-height: 100vh;
  max-width: 177.78vh;   /* 16:9 */
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  background: #000;
}

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

.bg-image {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity var(--transition-scene) ease-in-out;
  will-change: opacity;
}

/* ===== CG 全屏层 ===== */
.cg-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 10;
  background: #000;
}

.cg-image {
  width: 100%; height: 100%;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

/* ===== 角色立绘层 ===== */
.character-stage {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 5;
  pointer-events: none;
}

/* ===== 选项覆盖层 ===== */
.choice-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(92px, 14vh, 140px) 0 calc(var(--dialogue-box-height) + 24px);
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.choice-container {
  display: flex;
  flex-direction: column;
  gap: 17px;
  width: 68%;
  max-width: 820px;
  max-height: 100%;
  overflow-y: auto;
  padding: 2px 8px 8px;
}

/* ===== 全屏旁白层 ===== */
.narrator-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.8);
}

.narrator-text {
  color: var(--color-text);
  font-size: 31px;
  line-height: 1.8;
  text-align: center;
  max-width: 70%;
  letter-spacing: 2px;
}

/* ===== HUD ===== */
.game-hud {
  position: absolute;
  top: 12px; right: 16px;
  z-index: 25;
  display: flex;
  gap: 9px;
}

.hud-btn {
  padding: 7px 17px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-text-dim);
  border-radius: 4px;
  font-size: 18px;
  transition: all var(--transition-fast) ease;
}

.hud-btn:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.7);
}

.hud-btn.active {
  color: var(--color-accent);
  border: 1px solid var(--color-accent-glow);
}

/* ===== 加载画面 ===== */
.loading-screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a14;
}

.loading-content {
  text-align: center;
}

.loading-text {
  color: var(--color-text-dim);
  font-size: 22px;
  margin-bottom: 20px;
}

.loading-bar-container {
  width: 300px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.loading-bar {
  width: 0%;
  height: 100%;
  background: var(--color-accent);
  border-radius: 2px;
  transition: width 200ms ease;
}

/* ===== 屏幕通用 ===== */
.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.screen-header h2 {
  color: var(--color-text);
  font-size: 31px;
  font-weight: 400;
}

.close-btn {
  color: var(--color-text-dim);
  font-size: 28px;
  padding: 6px 12px;
  transition: color var(--transition-fast);
}

.close-btn:hover {
  color: var(--color-text);
}
