/* ==============================================================================
   歧途与权衡：大历史暗面录 - 真正纯正沉浸式独立游戏客户端 UI (零滚动·全屏沉浸)
   ============================================================================== */

:root {
  --bg-main: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.85);
  --border-gold: rgba(212, 175, 55, 0.35);
  --gold-glow: #f59e0b;
  --text-gold: #fde047;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --crimson: #dc2626;
  --crimson-glow: #ef4444;
  --blue-glow: #38bdf8;
  --green-glow: #34d399;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 30%, #172033 0%, #070a10 100%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 游戏全屏主视口 */
#game-app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* 1. 顶部游戏 HUD (高度固定 64px) */
.game-hud {
  height: 64px;
  background: rgba(11, 15, 25, 0.92);
  border-bottom: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  backdrop-filter: blur(10px);
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
}

.hud-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c2d12, #991b1b);
  border: 2px solid var(--gold-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--text-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.hud-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hud-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-name {
  font-size: 1.05rem;
  font-weight: bold;
  color: #ffffff;
  letter-spacing: 1px;
}

.hud-badge {
  background: linear-gradient(90deg, #b45309, #d97706);
  color: #fff;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.hud-post {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* 核心能量条组 */
.hud-bars-group {
  display: flex;
  gap: 14px;
  align-items: center;
}

.stat-bar-unit {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 80px;
}

.stat-bar-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: #cbd5e1;
}

.stat-bar-track {
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fill-feat { background: linear-gradient(90deg, #2563eb, #38bdf8); }
.fill-trust { background: linear-gradient(90deg, #d97706, #fde047); }
.fill-conscience { background: linear-gradient(90deg, #059669, #34d399); }
.fill-guilt { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.fill-health { background: linear-gradient(90deg, #7e22ce, #c084fc); }

.hud-assets {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
}

.asset-pill {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 4px 10px;
  border-radius: 6px;
}

/* 2. 中央游戏主舞台 (零滚动核心区) */
.game-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  position: relative;
  overflow: hidden;
}

/* 案卷游戏大卡牌 */
.dossier-game-card {
  width: 100%;
  max-width: 880px;
  max-height: calc(100vh - 150px);
  background: var(--bg-card);
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(212, 175, 55, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
  animation: cardFadeIn 0.3s ease;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.card-header-bar {
  background: linear-gradient(90deg, #881337 0%, #991b1b 50%, #881337 100%);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #b45309;
}

.dossier-seal-badge {
  font-size: 0.78rem;
  background: rgba(0,0,0,0.4);
  color: #fef08a;
  padding: 2px 10px;
  border-radius: 4px;
  letter-spacing: 1px;
}

.dossier-code {
  font-size: 0.75rem;
  color: #fecdd3;
  letter-spacing: 1px;
}

.card-content-body {
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.card-title {
  font-size: 1.25rem;
  color: #fde047;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-tag {
  background: #b45309;
  color: #fff;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: normal;
}

.card-narrative {
  font-size: 0.95rem;
  color: #f1f5f9;
  line-height: 1.6;
  background: rgba(15, 23, 42, 0.6);
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 4px solid var(--gold-glow);
  text-indent: 2em;
}

/* 决策卡牌按钮区 */
.card-choices-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.choice-action-card {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #3b82f6;
  border-radius: 8px;
  padding: 12px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.choice-action-card:hover {
  border-color: var(--text-gold);
  background: linear-gradient(180deg, #1e3a8a 0%, #172554 100%);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.choice-action-card:active {
  transform: scale(0.99);
}

.choice-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.choice-letter {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.choice-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.4;
}

.choice-impact-pills {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  font-size: 0.72rem;
}

.impact-pill {
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
}

/* 3. 底部游戏功能坞 (Game Dock, 固定高度 64px) */
.game-dock {
  height: 64px;
  background: rgba(11, 15, 25, 0.95);
  border-top: 2px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.6);
}

.dock-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.dock-btn:hover {
  background: rgba(180, 83, 9, 0.3);
  border-color: var(--text-gold);
  color: #fff;
  transform: translateY(-2px);
}

.dock-btn.active {
  background: linear-gradient(180deg, #b45309 0%, #78350f 100%);
  border-color: var(--text-gold);
  color: var(--text-gold);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* 4. 浮动模态抽屉/弹窗 (全屏不改变尺寸) */
.game-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.game-modal-box {
  width: 90%;
  max-width: 760px;
  max-height: 85vh;
  background: #0f172a;
  border: 2px solid var(--border-gold);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 50px rgba(0,0,0,0.9);
  overflow: hidden;
  animation: modalScale 0.25s ease;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header-bar {
  padding: 12px 20px;
  background: #1e293b;
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  color: var(--text-gold);
  font-size: 1.1rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover { color: #fff; }

.modal-scroll-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 红色印章动态飞入动画 */
.stamp-animation {
  position: absolute;
  right: 40px;
  top: 30px;
  width: 110px;
  height: 110px;
  border: 3px solid #ef4444;
  border-radius: 50%;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  letter-spacing: 2px;
  transform: rotate(-15deg) scale(2);
  opacity: 0;
  pointer-events: none;
  animation: stampDrop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes stampDrop {
  to { transform: rotate(-15deg) scale(1); opacity: 0.85; }
}

/* 现代游戏词条与分层展开系统样式 */
.lexicon-link {
  color: #38bdf8;
  border-bottom: 1.5px dashed #38bdf8;
  cursor: pointer;
  padding: 0 3px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}

.lexicon-link:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fde047;
  border-bottom-color: #fde047;
  border-radius: 3px;
}

/* 案卷深度折叠抽屉按钮 */
.unfold-toggle-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px dashed rgba(212, 175, 55, 0.4);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin: 4px 0 8px 0;
}

.unfold-toggle-bar:hover {
  background: rgba(180, 83, 9, 0.25);
  border-color: var(--text-gold);
}

.unfold-drawer {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #b45309;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: drawerSlide 0.25s ease-out;
}

@keyframes drawerSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.dossier-subhead {
  color: #f59e0b;
  font-size: 0.82rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dossier-list-item {
  font-size: 0.8rem;
  color: #cbd5e1;
  padding-left: 12px;
  position: relative;
  line-height: 1.5;
}

.dossier-list-item::before {
  content: "•";
  position: absolute;
  left: 0;
  color: #38bdf8;
}

/* 词条弹出气泡卡片 (Popup Card) */
.lexicon-popover {
  position: fixed;
  background: #0f172a;
  border: 1.5px solid var(--text-gold);
  border-radius: 8px;
  padding: 12px 16px;
  max-width: 320px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  z-index: 1000;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #f1f5f9;
  animation: popIn 0.2s ease;
}

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