
:root {
  --bg-dark: #0f1519;
  --panel-dark: rgba(18, 26, 32, 0.92);
  --gold-accent: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.4);
  --jade-primary: #10b981;
  --jade-glow: rgba(16, 185, 129, 0.45);
  --border-bronze: rgba(175, 140, 90, 0.4);
  font-family: 'Noto Serif SC', 'Songti SC', 'STSong', 'PingFang SC', serif;
  color: #e5e7eb;
  background: var(--bg-dark);
  user-select: none;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #090e12;
}

#app {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ====================================================
   沙盘全屏主界面容器 (960x544 等比缩放适配)
   ==================================================== */
.sand-table-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 177.77vh; /* 16:9 */
  max-height: 56.25vw;
  aspect-ratio: 960 / 544;
  background: #17292f;
  box-shadow: 0 0 80px rgba(0,0,0,0.9), inset 0 0 0 6px #1a1612;
  overflow: hidden;
}

.sand-table-viewport::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  box-shadow: inset 0 0 105px 28px rgba(2, 8, 10, .55), inset 0 0 0 5px rgba(124, 98, 64, .24);
}

.phase-hint {
  position: absolute;
  left: 25px;
  bottom: 22px;
  z-index: 11;
  width: 230px;
  min-height: 100px;
  padding: 12px 14px;
  color: #eadfca;
  background: linear-gradient(125deg, rgba(12, 25, 27, .94), rgba(21, 37, 38, .88));
  border: 1px solid rgba(180, 148, 91, .65);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
  box-shadow: 0 7px 24px rgba(0, 0, 0, .45);
}
.phase-hint-top, .phase-hint-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phase-hint-top strong { color: #f0d396; font-size: 15px; letter-spacing: 2px; }
.phase-hint-top span { color: #adcac5; font-size: 11px; }
.phase-hint p { font-size: 11px; line-height: 1.5; min-height: 34px; margin: 8px 0; color: #d4d6cc; }
.phase-hint-compact { display: none; }
.phase-hint-foot { border-top: 1px solid rgba(206, 180, 123, .25); padding-top: 7px; font-size: 11px; }
.phase-hint-foot b { color: #f3d883; font-size: 13px; }
.phase-hint-foot button { border: 1px solid #83c6b4; background: #155c5b; color: #fff7e4; padding: 3px 8px; cursor: pointer; font: inherit; }
.phase-hint-foot button:hover { background: #218479; }

/* 地图 Canvas 层 */
.map-center-container {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.sand-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ====================================================
   顶部 HUD 导航栏 (完全匹配视频 003/010 顶部样式)
   ==================================================== */
.game-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: linear-gradient(180deg, rgba(14, 21, 26, 0.95) 0%, rgba(14, 21, 26, 0.8) 75%, transparent 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-res-group, .top-right-group {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-res-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.top-res-pill .res-icon {
  font-size: 16px;
}

.top-res-pill .res-val {
  color: #fde047;
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: 800;
  background: rgba(15, 23, 28, 0.85);
  border-radius: 4px;
  padding: 1px 6px;
  min-width: 20px;
  text-align: center;
  margin-left: 2px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* 顶部导航按键群与回合表盘 */
.top-nav-cluster {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.top-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(22, 33, 40, 0.4);
  border: 1px solid rgba(180, 160, 120, 0.2);
  color: #e2e8f0;
  padding: 4px 10px;
  width: 74px;
  height: 28px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}

.top-nav-btn:hover {
  background: rgba(250, 204, 21, 0.18);
  border-color: #facc15;
  color: #fef08a;
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
}

/* 经典圆形回合表盘 */
.round-dial-medallion {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #475569 0%, #1e293b 70%, #0f172a 100%);
  border: 2px solid #94a3b8;
  box-shadow: 0 0 14px rgba(0,0,0,0.8), inset 0 0 8px rgba(255,255,255,0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 8px;
  cursor: pointer;
}

.round-dial-label {
  font-size: 8px;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-top: -2px;
}

.round-dial-num {
  font-family: Georgia, 'Noto Serif SC', serif;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px #000;
  line-height: 1.1;
}

.round-dial-weather {
  font-size: 12px;
  color: #facc15;
}

/* ====================================================
   左侧势力卡片队列 (完全匹配视频 003 左侧面板)
   ==================================================== */
.left-player-roster {
  position: absolute;
  top: 58px;
  left: 32px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.player-token-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 145px;
  height: 56px;
  padding: 0;
}

.player-avatar-ring {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  background: transparent;
  flex-shrink: 0;
  transition: all 0.3s;
}

.player-token-card.active-turn .player-avatar-ring {
  border-color: var(--ring-color);
  box-shadow: 0 0 16px var(--ring-color);
  animation: pulse-glow 2s infinite ease-in-out;
}

.player-avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 233, 184, .45);
}

.player-info-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(15, 23, 28, 0.8);
  border-radius: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.08);
}

.player-status-tag {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.player-status-tag.status-playing {
  color: #4ade80;
  text-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
  animation: pulse-glow 2s infinite ease-in-out;
}

.player-stats-triad {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #e2e8f0;
  font-family: Georgia, serif;
}

.player-stats-triad span {
  display: flex;
  align-items: center;
  gap: 2px;
}

.stat-icon {
  font-style: normal;
  font-size: 10px;
  opacity: 0.85;
}

.player-bottom-accent {
  position: absolute;
  bottom: -4px;
  left: 10px;
  right: 0;
  height: 2.5px;
  border-radius: 2px;
  opacity: 0.75;
}

/* ====================================================
   底部主帅台座与操作栏 (完全匹配视频 003 底部)
   ==================================================== */
.bottom-commander-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  z-index: 10;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.commander-pedestal-wrap {
  position: relative;
  width: 180px;
  height: 75px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.commander-bust-container {
  position: absolute;
  bottom: 20px;
  width: 170px;
  height: 165px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.9));
  mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 65%, transparent 100%);
}

.commander-bust-figure {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 半圆形阶段弧线 */
.commander-arc-gauge {
  position: absolute;
  bottom: 10px;
  width: 100px;
  height: 50px;
  border-top-left-radius: 65px;
  border-top-right-radius: 65px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-bottom: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.arc-phase-pill {
  position: absolute;
  top: -12px;
  background: rgba(18, 30, 36, 0.95);
  border: 1px solid #facc15;
  border-radius: 12px;
  padding: 2px 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
}

.arc-phase-pill .arc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #facc15;
}

.arc-phase-pill .arc-text {
  font-size: 11px;
  font-weight: 700;
  color: #fef08a;
  letter-spacing: 1px;
}

.pedestal-badge {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(15, 23, 28, 0.85);
  border: 1.5px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 10px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #f8fafc;
}

.badge-left {
  left: -2px;
  bottom: 60px;
}

.badge-right {
  right: -2px;
  bottom: 60px;
}

.badge-val {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 11px;
  color: #fde047;
}

/* 底部操作按钮坞 (兑换征召 / 下一阶段 / 卡牌征召，完全贴合底轨原生按键槽) */
.action-dock-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: transparent;
  border: none;
  box-shadow: none;
  margin-bottom: 0;
  pointer-events: auto;
  gap: 5px;
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  height: 50px;
}

.dock-btn {
  background: transparent;
  border: none;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
}

.dock-btn-side {
  color: #cbd5e1;
  font-size: 13px;
  width: 120px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid transparent;
  border-radius: 6px;
  background: rgba(15, 23, 28, 0.2);
  margin-bottom: 4px;
}

.dock-btn-side:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: rgba(45, 212, 191, 0.8);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.7);
  transform: translateY(-1px);
}

.dock-btn-main {
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  width: 138px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(19, 78, 74, 0.2);
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.dock-btn-main:hover {
  background: rgba(13, 148, 136, 0.4);
  border-color: #2dd4bf;
  box-shadow: 0 0 22px rgba(45, 212, 191, 0.9);
  transform: translateY(-1px) scale(1.02);
}

/* ====================================================
   大气书法阶段横幅 (完全匹配视频 003 谋略阶段/驻防阶段)
   ==================================================== */
.calligraphy-banner-layer {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.45) 0%, transparent 70%);
  animation: banner-fade 1.9s forwards ease-in-out;
}

.calligraphy-banner-box {
  text-align: center;
  background: linear-gradient(90deg, transparent 0%, rgba(15, 23, 28, 0.95) 25%, rgba(15, 23, 28, 0.95) 75%, transparent 100%);
  padding: 24px 100px;
  border-top: 1px solid rgba(250, 204, 21, 0.4);
  border-bottom: 1px solid rgba(250, 204, 21, 0.4);
}

.calligraphy-main-text {
  font-family: 'Ma Shan Zheng', 'Noto Serif SC', serif;
  font-size: 54px;
  color: #fef08a;
  letter-spacing: 12px;
  text-shadow: 0 0 25px rgba(250, 204, 21, 0.7), 0 5px 12px rgba(0,0,0,0.9);
}

.calligraphy-sub-text {
  margin-top: 8px;
  font-size: 14px;
  color: #cbd5e1;
  letter-spacing: 2px;
}

@keyframes banner-fade {
  0% { opacity: 0; transform: scale(0.92); }
  20% { opacity: 1; transform: scale(1); }
  75% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05); }
}

/* ====================================================
   电影感对决战斗层 (完全匹配视频 005/007/012 战斗画面)
   ==================================================== */
.battle-stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(10, 15, 20, 0.88);
  backdrop-filter: blur(4px);
  overflow: hidden;
}

.battle-back-btn {
  position: absolute;
  top: 24px;
  left: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
}

.battle-back-btn:hover {
  background: #334155;
  border-color: #38bdf8;
}

/* 双方武将半身像与名牌 (左右分立，完全对应视频 005 对决站位) */
.battle-general-side {
  position: absolute;
  bottom: 0;
  width: 280px;
  height: 85%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  z-index: 10;
}

.attacker-side {
  left: 30px;
}

.defender-side {
  right: 30px;
}

.battle-bust-wrap {
  position: relative;
  width: 280px;
  height: 360px;
  filter: drop-shadow(0 15px 30px rgba(0,0,0,0.95));
  mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent 100%);
}

.battle-bust-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.battle-nametag {
  margin-top: -24px;
  margin-bottom: 30px;
  background: #1e3a5f;
  border: 1.5px solid #93c5fd;
  color: #ffffff;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 16px;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.8);
  z-index: 25;
}

.attacker-nametag {
  background: #1e3a8a;
  border-color: #60a5fa;
  clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%);
}

.defender-nametag {
  background: #0f766e;
  border-color: #2dd4bf;
  clip-path: polygon(8% 0, 100% 0, 100% 100%, 8% 100%, 0 50%);
}

/* 技能标签栈 */
.battle-skills-stack {
  position: absolute;
  left: 20px;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 35;
}

.battle-skill-pill {
  background: linear-gradient(90deg, #0284c7 0%, rgba(2, 132, 199, 0.4) 100%);
  border: 1px solid #38bdf8;
  padding: 6px 14px;
  color: #f0f9ff;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5);
  font-size: 13px;
  display: flex;
  gap: 8px;
  animation: slide-in-left 0.4s ease-out;
}

.skill-hero {
  font-weight: 700;
  color: #bae6fd;
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 中心 3D 骰子对抗区 (正居中央) */
.battle-center-arena {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 20;
}

.battle-locations-label {
  font-size: 18px;
  color: #f1f5f9;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.7);
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
}

.attack-arrow-symbol {
  color: #38bdf8;
}

.dice-roll-arena {
  display: flex;
  align-items: center;
  gap: 24px;
}

.dice-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dice-group-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 600;
}

.dice-row {
  display: flex;
  gap: 12px;
}

.dice-3d {
  width: 58px;
  height: 58px;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.8));
}

.dice-face {
  width: 100%;
  height: 100%;
  border: 3px solid #784b25;
  border-radius: 12px;
  background: #e8cca4;
  color: #262626;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-sizing: border-box;
}
.dice-value { font-size: 30px; font-weight: 900; }
.dice-bonus {
  position: absolute;
  bottom: -19px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #0f766e;
  border-radius: 4px;
  padding: 1px 3px;
}

.roll-anim {
  animation: dice-tumble 1s ease-out forwards;
}

.roll-delay-1 { animation-delay: 0.1s; }
.roll-delay-2 { animation-delay: 0.2s; }

@keyframes dice-tumble {
  0% { transform: scale(0.6) rotate(-220deg); opacity: 0.5; }
  60% { transform: scale(1.15) rotate(15deg); }
  85% { transform: scale(0.95) rotate(-5deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.battle-vs-badge {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 900;
  color: #e2e8f0;
  text-shadow: 0 0 15px rgba(255,255,255,0.4);
}

/* 战损与兵力动画 */
.battle-combat-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.soldier-clash-box {
  position: relative;
  width: 160px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.damage-fly {
  position: absolute;
  left: 65%;
  font-size: 24px;
  font-weight: 900;
  color: #ef4444;
  text-shadow: 0 0 8px rgba(239, 68, 68, 0.8);
  opacity: 0;
}

.damage-fly.fly-anim {
  animation: float-up 1.2s 0.7s forwards ease-out;
}

@keyframes float-up {
  0% { opacity: 0; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-15px); }
  100% { opacity: 0; transform: translateY(-35px); }
}

.battle-verdict {
  font-size: 15px;
  font-weight: 700;
  color: #fde047;
}

.battle-bottom-deck {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-between;
  width: 70%;
}

.deck-cards-left, .deck-cards-right {
  display: flex;
  gap: 8px;
}

.mini-card-token {
  width: 38px;
  height: 52px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.4);
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.6);
}

.mini-card-token img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ====================================================
   兑换士兵弹窗（参考视频中的纸卷与青铜配色）
   ==================================================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.convert-scroll-card {
  position: relative;
  width: 560px;
  background: linear-gradient(180deg, #dce4e8 0%, #edf2f5 100%);
  border-radius: 6px;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.85);
  padding: 24px 36px 30px;
  text-align: center;
  color: #1e293b;
}

.convert-title-tab {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  background: #000000;
  color: #ffffff;
  font-family: 'Noto Serif SC', serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 4px;
  padding: 6px 38px 4px 42px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
}

.convert-header-sub {
  font-size: 15px;
  color: #1e293b;
  font-weight: 600;
  margin-top: 14px;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.convert-exchange-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  margin-bottom: 22px;
}

.convert-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.convert-big-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.convert-num {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
}

.convert-arrow-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.convert-stepper-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 18px auto 14px;
}

.step-btn {
  width: 44px;
  height: 36px;
  background: #3b6fa0;
  color: #ffffff;
  border: none;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.step-btn:hover {
  background: #2b5784;
}

.step-display {
  width: 114px;
  height: 36px;
  background: #ffffff;
  border: 1px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.convert-ratio-hint {
  font-size: 13px;
  color: #334155;
  font-weight: 600;
  margin-bottom: 18px;
}

.convert-confirm-btn {
  background: #174d53;
  border: 1.5px solid #38bdf8;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  padding: 6px 60px;
  border-radius: 24px;
  cursor: pointer;
  letter-spacing: 8px;
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.35), 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.convert-confirm-btn:hover:not(:disabled) {
  background: #1c5d64;
  box-shadow: 0 0 16px #38bdf8;
}

.convert-confirm-btn:disabled {
  background: #174d53;
  color: #cbd5e1;
  border-color: rgba(56, 189, 248, 0.4);
  cursor: default;
}

.modal-close-x {
  position: absolute;
  top: -36px;
  right: -24px;
  background: transparent;
  border: none;
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  cursor: pointer;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s;
}

.modal-close-x:hover {
  transform: scale(1.15);
}

/* ====================================================
   名将全屏界面（参考视频中的将牌册）
   ==================================================== */
.generals-fullscreen-view {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #e6e0d2 url('./assets/generals_bg.jpg') center/cover no-repeat;
  overflow: hidden;
}
.generals-content {
  position: absolute;
  inset: 5% 8%;
  overflow: auto;
  padding: 25px 34px;
  color: #253338;
  background: linear-gradient(145deg, rgba(248,246,239,.97), rgba(225,222,209,.98));
  border: 2px solid #9d8d72;
  border-radius: 3px;
  box-shadow: 0 14px 50px rgba(0,0,0,.5), inset 0 0 0 6px rgba(255,255,255,.45);
  box-sizing: border-box;
}
.generals-content h2 { font-size: 31px; margin: 12px 0 6px; letter-spacing: 5px; border-bottom: 1px solid #b9ab91; padding-bottom: 12px; }
.generals-content > p { color: #566265; }
.generals-return { background: transparent; border: 0; color: #426267; cursor: pointer; font-size: 15px; }
.generals-valid-cards { display: flex; gap: 24px; flex-wrap: wrap; margin: 34px 0 22px; }
.generals-valid-card { display: flex; gap: 16px; width: min(420px, 100%); min-height: 204px; padding: 13px; background: #fcfaf4; color: #17262b; border: 1px solid #bda981; border-radius: 4px; box-shadow: 0 8px 20px rgba(63,57,45,.13); box-sizing: border-box; }
.generals-valid-card img { width: 120px; max-width: 38%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 4px; }
.generals-seal-art { width: 120px; max-width: 38%; aspect-ratio: 3 / 4; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #e9d7ad; background: radial-gradient(circle at 48% 35%, #47615c, #152c30 72%); border: 5px double #b99b68; box-shadow: inset 0 0 25px #06171d; }
.generals-seal-art span { border: 1px solid #c8ac73; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; }
.generals-seal-art strong { font-size: 23px; letter-spacing: 3px; }
.generals-seal-art small { color: #baa884; letter-spacing: 3px; }
.generals-valid-info { flex: 1; }
.generals-valid-info h3 { margin: 4px 0 12px; color: #1c383d; border-bottom: 1px solid #d4c6a6; padding-bottom: 7px; }
.generals-valid-info p { line-height: 1.6; }
.generals-valid-info strong { display: inline-block; margin-top: 14px; color: #1e766a; }
.generals-valid-info button { padding: 8px 12px; background: #0f766e; color: white; border: 0; border-radius: 4px; cursor: pointer; }
.generals-valid-info button:disabled { opacity: .5; cursor: default; }
.generals-art-note { color: #6f6a58 !important; border-top: 1px solid #b9ab91; padding-top: 14px; font-size: 13px; }
.result-backdrop { z-index: 70; }
.result-dialog { text-align: center; }

/* 顶部返回热区 (精准覆盖 [< 名将]) */
.generals-back-hotspot {
  position: absolute;
  left: 0;
  top: 0;
  width: 15%;
  height: 10%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 20;
}

.generals-back-hotspot:hover {
  background: rgba(56, 189, 248, 0.12);
  border-radius: 0 0 8px 0;
}

/* 左侧：武将大卡展示与特技 */
.generals-left-showcase {
  position: absolute;
  left: 1.25%;
  top: 22.06%;
  width: 15.94%;
  height: 75%;
  pointer-events: none;
}

.showcase-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 62.7%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
}

.showcase-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-meta-info {
  position: absolute;
  bottom: 6%;
  left: 0;
  width: 100%;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  pointer-events: auto;
}

.showcase-stars-row {
  color: #eab308;
  font-size: 13px;
  letter-spacing: 2px;
  margin-bottom: 2px;
}

.showcase-skill-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}

.showcase-skill-desc {
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
}

.showcase-equip-btn {
  margin-top: 6px;
  width: 100%;
  padding: 5px 0;
  background: #0f766e;
  color: #ffffff;
  font-weight: 800;
  font-size: 12px;
  border: 1px solid #2dd4bf;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.15s;
}

.showcase-equip-btn:hover {
  background: #0d9488;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
}

.showcase-equip-btn.active {
  background: #991b1b;
  border-color: #ef4444;
}

/* 右侧上方：4 个激活槽位热区 */
.generals-slots-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.general-slot-hotspot {
  position: absolute;
  top: 14.34%;
  width: 14.38%;
  height: 38.97%;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  box-sizing: border-box;
}

.general-slot-hotspot.slot-0 { left: 22.81%; }
.general-slot-hotspot.slot-1 { left: 39.27%; }
.general-slot-hotspot.slot-2 { left: 55.73%; }
.general-slot-hotspot.slot-3 { left: 72.19%; }

.general-slot-hotspot:hover {
  border: 2px dashed #0284c7;
  background: rgba(2, 132, 199, 0.08);
}

.general-slot-hotspot.slotted {
  border: 2px solid #2dd4bf;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.slot-hero-card {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.slot-hero-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 2px 0;
}

.slot-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  color: #fff;
  border: none;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 右侧下方：名将卡池交互热区 */
.generals-pool-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.roster-card-hotspot {
  position: absolute;
  top: 61.40%;
  width: 10.83%;
  height: 30.51%;
  pointer-events: auto;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-sizing: border-box;
}

.roster-card-hotspot.roster-0 { left: 22.71%; }
.roster-card-hotspot.roster-1 { left: 35.73%; }
.roster-card-hotspot.roster-2 { left: 48.75%; }

.roster-card-hotspot:hover,
.roster-card-hotspot.selected {
  outline: 2.5px solid #0284c7;
  box-shadow: 0 0 20px rgba(2, 132, 199, 0.7);
  transform: translateY(-6px);
}

.roster-slotted-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #0284c7;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  z-index: 5;
}

/* ====================================================
   资源奖励弹窗
   ==================================================== */
.reward-glow-card {
  position: relative;
  width: 320px;
  background: rgba(15, 23, 28, 0.95);
  border: 1.5px solid #2dd4bf;
  border-radius: 8px;
  box-shadow: 0 0 35px rgba(45, 212, 191, 0.5);
  padding: 28px;
  text-align: center;
  color: #ffffff;
}

.reward-title {
  font-size: 18px;
  font-weight: 800;
  color: #99f6e4;
  letter-spacing: 2px;
}

.reward-icon-glow {
  font-size: 64px;
  margin: 18px 0;
  text-shadow: 0 0 20px #2dd4bf;
}

.reward-amount {
  font-size: 22px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 1px;
}

.reward-subtitle {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
  margin-bottom: 20px;
}

.reward-claim-btn {
  background: #0f766e;
  border: 1px solid #2dd4bf;
  color: #ffffff;
  padding: 8px 36px;
  border-radius: 20px;
  font-weight: 700;
  cursor: pointer;
}

/* ====================================================
   规则与设置通用弹窗
   ==================================================== */
.info-scroll-dialog {
  position: relative;
  width: 520px;
  background: rgba(18, 26, 32, 0.96);
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: 8px;
  padding: 30px;
  color: #f1f5f9;
}

.info-scroll-dialog h2 {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  color: #fef08a;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
}

.info-dialog-body {
  font-size: 13px;
  line-height: 1.8;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.setting-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.setting-toggle-btn, .setting-action-btn {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255,255,255,0.25);
  color: #ffffff;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
}
.restart-confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.restart-confirm-actions button { padding: 9px 16px; border: 1px solid #9f8a61; background: #203236; color: #f3e6c9; cursor: pointer; }
.restart-confirm-actions button:last-child { background: #744340; border-color: #bb8171; }

/* ====================================================
   开局势力选择界面（参考视频构图）
   ==================================================== */
.landing-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  max-width: 177.77vh;
  max-height: 56.25vw;
  aspect-ratio: 960 / 544;
  background: #000 url('./assets/landing_bg_nowatermark.png') center/cover no-repeat;
  box-shadow: 0 0 60px rgba(0,0,0,0.85);
  overflow: hidden;
}

.landing-intro {
  position: absolute;
  z-index: 3;
  left: 20%;
  top: 34%;
  width: 26%;
  color: #1d2425;
  text-align: center;
  text-shadow: 0 1px 1px rgba(255,255,255,.65);
  pointer-events: none;
}
.landing-intro span { font-size: clamp(10px, 1.15vw, 18px); letter-spacing: .25em; }
.landing-intro h1 { margin: 8px 0; font-size: clamp(24px, 3.1vw, 46px); letter-spacing: .2em; font-weight: 800; }
.landing-intro p { font-size: clamp(11px, 1.15vw, 17px); }
.landing-intro small { display: block; margin-top: 22px; font-size: clamp(9px, .9vw, 13px); color: #36585b; }
.landing-card-slot { border: 0; background: transparent; padding: 0; }
.landing-card-slot:focus-visible, .landing-confirm-hotspot:focus-visible { outline: 3px solid #facc15; outline-offset: 3px; }

@media (max-width: 900px) and (orientation: landscape) {
  .game-topbar { height: 38px; padding: 0 8px; }
  .top-nav-cluster { gap: 4px; }
  .top-nav-btn { width: 30px; height: 25px; font-size: 0; padding: 2px; }
  .top-nav-btn .nav-icon { font-size: 15px; }
  .top-res-group, .top-right-group { gap: 5px; }
  .top-res-pill { font-size: 10px; gap: 2px; }
  .top-res-pill .res-label { display: none; }
  .top-res-pill .res-val { font-size: 11px; padding: 0 3px; }
  .top-res-pill .res-icon { font-size: 11px; }
  .round-dial-medallion { width: 34px; height: 34px; margin: 0 2px; }
  .round-dial-num { font-size: 12px; }
  .round-dial-weather { display: none; }
  .left-player-roster { top: 39px; left: 5px; gap: 2px; transform: scale(.52); transform-origin: left top; }
  .phase-hint { left: 5px; bottom: 5px; transform: scale(.52); transform-origin: left bottom; }
  .bottom-commander-dock { transform: scale(.5); transform-origin: center bottom; }
}

@media (orientation: portrait) {
  #app::after { content: '请横屏游玩 · 转动设备后继续战局'; position: fixed; left: 14px; right: 14px; bottom: 20px; z-index: 100; text-align: center; padding: 12px; color: #f1deb0; background: #14282c; border: 1px solid #ac9169; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.landing-interactive-area {
  position: absolute;
  inset: 0;
}

.landing-card-slot {
  position: absolute;
  top: 25.5%;
  height: 22.8%;
  width: 7.3%;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  box-sizing: border-box;
}

.landing-card-slot:hover {
  background: rgba(250, 204, 21, 0.15);
  box-shadow: 0 0 12px rgba(250, 204, 21, 0.4);
}

.landing-card-slot.active-pick {
  border: 2px solid #facc15;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.8), inset 0 0 8px rgba(250, 204, 21, 0.3);
}

.landing-card-slot.active-pick .card-pick-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #facc15;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
}
.landing-card-slot.active-pick .card-pick-indicator::after {
  content: '✓';
}

.slot-wei { left: 51.5%; }
.slot-wu  { left: 59.2%; }
.slot-shu { left: 66.9%; }
.slot-random { left: 74.7%; }

.landing-confirm-hotspot {
  position: absolute;
  left: 69.8%;
  top: 71.3%;
  width: 9.8%;
  height: 4.8%;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  display: block;
  transition: all 0.2s ease-in-out;
}

.landing-confirm-hotspot:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: rgba(45, 212, 191, 0.85);
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.7);
  transform: scale(1.03);
}

/* Toast 提示浮窗 */
.game-toast-bubble {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fde047;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  z-index: 45;
  pointer-events: none;
  animation: toast-pop 0.3s ease-out;
}

@keyframes toast-pop {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 4px #4ade80); }
  50% { opacity: 0.75; filter: drop-shadow(0 0 12px #4ade80); }
}

/* 美术版：画作承载战场，界面只保留军令所需的信息。 */
:root { --war-gold: #c3a879; --war-ink: #101715; --war-paper: #efe6d0; }
.sand-table-viewport { background: var(--war-ink); }
.sand-table-viewport::after { box-shadow: inset 0 0 42px rgba(8, 10, 9, .6), inset 0 0 0 2px rgba(195, 168, 121, .24); }
.game-topbar {
  height: 56px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(10, 17, 17, .96), rgba(10, 17, 17, .82));
  border-bottom: 1px solid rgba(195, 168, 121, .55);
  backdrop-filter: blur(8px);
}
.top-res-pill { color: #dfd4bd; font-size: 12px; gap: 5px; }
.top-res-pill .res-icon, .top-nav-btn .nav-icon {
  width: 22px; height: 22px; border: 1px solid rgba(195, 168, 121, .55);
  border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--war-gold); font-size: 10px; font-style: normal;
}
.top-res-pill .res-val { background: transparent; border: 0; color: #f2dfad; font-size: 15px; padding: 0; }
.top-nav-btn { background: transparent; border: 0; border-bottom: 1px solid rgba(195,168,121,.27); border-radius: 0; color: #e8dec8; width: 75px; height: 32px; }
.top-nav-btn:hover { color: #f5e4bd; border-color: var(--war-gold); background: rgba(195,168,121,.1); box-shadow: none; }
.round-dial-medallion { background: radial-gradient(circle at 38% 25%, #6b5b42, #16211f 72%); border: 2px solid var(--war-gold); box-shadow: 0 4px 14px #060b0a, inset 0 0 0 3px #25302b; }
.round-dial-num { color: #f2dfad; }
.round-dial-weather { color: #d4bd88; }
.left-player-roster { top: 66px; left: 18px; gap: 8px; }
.player-token-card { width: 178px; height: 59px; padding: 4px 10px 4px 4px; background: linear-gradient(90deg, rgba(9,19,19,.95), rgba(9,19,19,.55)); border: 1px solid rgba(195,168,121,.28); border-radius: 36px 5px 5px 36px; }
.player-avatar-ring { border-color: var(--ring-color); overflow: hidden; box-shadow: 0 0 0 2px rgba(9,17,16,.8); }
.player-token-card.active-turn .player-avatar-ring { box-shadow: 0 0 0 2px var(--war-gold); animation: none; }
.player-avatar-img { object-position: center 20%; background: #182620; }
.player-info-meta { background: transparent; border: 0; }
.player-status-tag.status-playing { color: #e6d2a4; text-shadow: none; animation: none; }
.player-stats-triad { gap: 7px; color: #d7d9cd; font-size: 11px; }
.stat-icon { color: #d4bc8c; }
.player-bottom-accent { display: none; }
.phase-hint { width: 222px; border-color: rgba(195,168,121,.7); background: linear-gradient(135deg, rgba(10,20,20,.95), rgba(21,32,30,.89)); clip-path: none; }
.phase-hint-top strong { color: #e4d2a4; }
.phase-hint-foot button { background: #675537; border-color: #c5ab76; color: #f5e8ce; }
.phase-hint-foot button:hover { background: #846b43; }
.bottom-commander-dock { height: 105px; background: linear-gradient(0deg, rgba(7,10,10,.91), rgba(7,10,10,.55) 43%, transparent); }
.commander-pedestal-wrap { position: absolute; right: 16px; bottom: 0; height: 93px; width: 190px; }
.commander-bust-container { bottom: 30px; width: 175px; height: 175px; filter: drop-shadow(0 10px 14px #030706); }
.commander-bust-figure { object-fit: contain; object-position: center bottom; }
.commander-arc-gauge { border-color: rgba(195,168,121,.65); }
.arc-phase-pill { background: #18221f; border-color: var(--war-gold); box-shadow: 0 3px 8px #050807; }
.arc-phase-pill .arc-dot { background: var(--war-gold); }
.arc-phase-pill .arc-text { color: #ead7aa; }
.pedestal-badge { background: #1b2420; border-color: #9c8355; }
.badge-val { color: #e9d6a7; }
.action-dock-bar { bottom: 7px; gap: 8px; }
.dock-btn-side { color: #e5d9c1; background: linear-gradient(#26302a, #141f1d); border: 1px solid #776a4d; border-radius: 3px; }
.dock-btn-main { color: #1c2522; background: linear-gradient(#e6d3a3, #ad8b54); border: 1px solid #e9d6a9; border-radius: 3px; }
.dock-btn-side:hover, .dock-btn-main:hover { box-shadow: none; transform: translateY(-2px); border-color: #f0d59f; }
.dock-btn-main:hover { background: linear-gradient(#f4e3b5, #c59b59); }
.battle-stage-overlay { background: linear-gradient(90deg, rgba(8,14,15,.9), rgba(8,14,15,.72), rgba(8,14,15,.9)), url('./assets/generated/war-table-relief.webp') center/cover; backdrop-filter: none; }
.battle-nametag, .attacker-nametag, .defender-nametag { background: #1b2b29; border-color: #aa946a; clip-path: none; border-radius: 2px; }
.battle-locations-label { border-radius: 3px; border-color: rgba(195,168,121,.6); background: rgba(13,22,22,.9); }
.attack-arrow-symbol { color: #dac698; }
.battle-vs-badge { color: #e7d3aa; text-shadow: 0 3px 8px #0b100d; }
.calligraphy-banner-box { border-color: rgba(195,168,121,.65); }
.calligraphy-main-text { color: #f0dfb7; text-shadow: 0 3px 14px #080d0c; }

.landing-stage { background: #101715 url('./assets/generated/war-table-relief.webp') center/cover no-repeat; }
.landing-stage::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,13,13,.91), rgba(7,13,13,.52) 46%, rgba(7,13,13,.77)), linear-gradient(0deg, rgba(4,8,8,.9), transparent 36%); }
.landing-header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; height: 68px; margin: 0 55px; color: #d8cbaa; font-size: 12px; letter-spacing: 3px; border-bottom: 1px solid rgba(195,168,121,.42); }
.landing-brand { font-size: 22px; font-weight: 800; letter-spacing: 5px; color: #f0deba; }
.landing-content { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: center; gap: 34px; height: calc(100% - 68px); padding: 0 55px 32px; }
.landing-copy { color: #efe6d0; }
.landing-eyebrow { color: #cdb484; font-size: 12px; letter-spacing: 4px; }
.landing-copy h1 { font-size: clamp(40px, 4.1vw, 64px); letter-spacing: 3px; line-height: 1.15; margin: 18px 0; font-weight: 800; text-shadow: 0 5px 20px #050907; }
.landing-copy h1 em { font-style: normal; color: #dec492; }
.landing-copy > p { max-width: 310px; font-size: 14px; line-height: 1.8; color: #d0cfbf; }
.landing-selection { display: flex; flex-direction: column; gap: 4px; border-left: 2px solid #c3a879; padding-left: 12px; margin: 24px 0 19px; font-size: 11px; color: #b4b9ab; }
.landing-selection strong { font-size: 18px; color: #f0e2c4; }
.landing-selection small { color: #c3bcaa; font-size: 11px; }
.landing-confirm { border: 1px solid #e8d4a3; background: linear-gradient(#e9d7ac, #aa8750); color: #1d2924; font-family: inherit; font-size: 16px; font-weight: 700; padding: 10px 22px; min-width: 164px; cursor: pointer; letter-spacing: 2px; box-shadow: 0 5px 18px #020504; }
.landing-confirm span { font-size: 20px; padding-left: 10px; }
.landing-confirm:hover { filter: brightness(1.12); transform: translateY(-2px); }
.landing-factions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; align-items: end; }
.faction-choice { position: relative; height: 290px; padding: 0; overflow: hidden; cursor: pointer; border: 1px solid rgba(196,176,128,.56); background: linear-gradient(140deg, #3a3d31, #101b1a 70%); box-shadow: 0 12px 20px rgba(0,0,0,.45); }
.faction-wei { background: linear-gradient(140deg, #4b3533, #14191a 72%); }
.faction-shu { background: linear-gradient(140deg, #324b3c, #131e1a 72%); }
.faction-wu { background: linear-gradient(140deg, #32475a, #141c21 72%); }
.faction-choice::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,8,8,.92), transparent 43%); pointer-events: none; }
.faction-choice img { width: 120%; height: 88%; margin-left: -10%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 8px 14px #070d0c); transition: transform .2s ease; }
.faction-choice:hover img { transform: scale(1.04); }
.faction-choice.active-pick { border: 2px solid #ecd7a6; box-shadow: 0 0 0 2px rgba(195,168,121,.34), 0 14px 25px #060b0a; transform: translateY(-8px); }
.faction-choice-meta { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 10px; display: flex; align-items: baseline; justify-content: space-between; color: #f3e7cd; }
.faction-choice-meta b { font-size: 20px; letter-spacing: 2px; }
.faction-choice-meta small { font-size: 12px; color: #d8c6a3; }
.random-choice { grid-column: 1 / -1; justify-self: end; padding: 7px 14px; color: #e5d6b6; background: rgba(15,25,23,.82); border: 1px solid #806d49; cursor: pointer; font: inherit; letter-spacing: 1px; }
.random-choice.active-pick { background: #665239; border-color: #d8be89; }
.landing-confirm:focus-visible, .faction-choice:focus-visible, .random-choice:focus-visible { outline: 2px solid #f2d99e; outline-offset: 3px; }

.generals-fullscreen-view { background: linear-gradient(rgba(8,15,15,.75), rgba(8,15,15,.9)), url('./assets/generated/war-table-relief.webp') center/cover no-repeat; }
.generals-content { color: #e8ddc5; background: linear-gradient(150deg, rgba(15,28,26,.97), rgba(18,24,22,.96)); border: 1px solid #a99061; box-shadow: 0 20px 55px #030808, inset 0 0 0 4px rgba(180,153,100,.13); }
.generals-content h2 { color: #f1dfb7; border-bottom-color: rgba(195,168,121,.45); }
.generals-content > p { color: #b9b9a7; }
.generals-return { color: #d8c69e; }
.generals-valid-card { background: linear-gradient(145deg, #263a33, #111e1c); color: #e9dfca; border-color: rgba(195,168,121,.66); box-shadow: 0 9px 22px #07100e; }
.generals-valid-card img { background: #283a2f; object-fit: contain; object-position: center bottom; }
.generals-valid-info h3 { color: #efdcaf; border-bottom-color: rgba(195,168,121,.46); }
.generals-valid-info strong { color: #8bccab; }
.generals-valid-info button { background: linear-gradient(#e6d3a3, #aa8851); color: #1b2622; border: 1px solid #e9d6a9; font-weight: 700; }
.generals-valid-info button:disabled { opacity: .52; }
.generals-art-note { color: #aeb6a9 !important; border-top-color: rgba(195,168,121,.38); }

@media (max-width: 900px) and (orientation: landscape) {
  .game-topbar { height: 38px; padding: 0 8px; }
  .top-nav-btn { width: 30px; }
  .left-player-roster { top: 40px; left: 5px; transform: scale(.52); }
  .phase-hint { transform: scale(.52); }
  .bottom-commander-dock { transform: scale(.5); }
  .landing-header { height: 46px; margin: 0 26px; font-size: 9px; }
  .landing-brand { font-size: 15px; letter-spacing: 3px; }
  .landing-content { height: calc(100% - 46px); gap: 12px; padding: 0 26px 12px; }
  .landing-copy h1 { font-size: 31px; margin: 10px 0; }
  .landing-copy > p { font-size: 10px; }
  .landing-eyebrow { font-size: 9px; letter-spacing: 2px; }
  .landing-selection { margin: 12px 0; }
  .landing-selection strong { font-size: 12px; }
  .landing-selection small { font-size: 9px; }
  .landing-confirm { font-size: 11px; min-width: 110px; padding: 6px 10px; }
  .faction-choice { height: 175px; }
  .faction-choice-meta b { font-size: 13px; }
  .faction-choice-meta small { font-size: 9px; }
  .random-choice { font-size: 9px; padding: 5px 9px; }
  .generals-content { inset: 3% 9%; padding: 10px 18px; }
  .generals-content h2 { font-size: 19px; margin: 4px 0; padding-bottom: 4px; }
  .generals-content > p { margin: 4px 0; font-size: 10px; }
  .generals-return { font-size: 11px; }
  .generals-valid-cards { gap: 8px; margin: 9px 0; flex-wrap: nowrap; }
  .generals-valid-card { width: calc(50% - 4px); min-height: 150px; padding: 7px; gap: 8px; }
  .generals-valid-card img, .generals-seal-art { width: 80px; height: 126px; }
  .generals-valid-info h3 { font-size: 12px; margin: 0 0 5px; padding-bottom: 4px; }
  .generals-valid-info p { font-size: 10px; margin: 0; }
  .generals-valid-info strong { margin-top: 6px; font-size: 10px; }
  .generals-valid-info button { font-size: 10px; padding: 5px; margin-top: 5px; }
  .generals-art-note { font-size: 9px; padding-top: 6px; }
}

/* 战局可读性：让操作层贴住沙盘边缘，窄屏保留实际触控尺寸。 */
body::before {
  content: '';
  position: fixed;
  inset: -32px;
  z-index: 0;
  pointer-events: none;
  background: url('./assets/generated/war-table-relief.webp') center/cover no-repeat;
  filter: blur(28px) brightness(.22) saturate(.65);
}
#app { position: relative; z-index: 1; }
.game-topbar { height: 58px; }
.top-res-group, .top-right-group { gap: 19px; }
.top-res-pill { font-size: 13px; }
.top-res-pill .res-val { font-size: 16px; font-variant-numeric: tabular-nums; }
.top-nav-btn { height: 36px; font-size: 13px; white-space: nowrap; }
.top-nav-btn .nav-icon { width: 23px; height: 23px; font-size: 11px; }
.round-dial-medallion { width: 60px; height: 60px; }
.left-player-roster { top: 69px; gap: 9px; }
.player-token-card { width: 184px; height: 62px; }
.player-status-tag { font-size: 12px; }
.player-stats-triad { font-size: 12px; }
.phase-hint { width: 246px; min-height: 126px; padding: 13px 14px; }
.phase-hint-top strong { font-size: 16px; }
.phase-hint-top span { font-size: 12px; }
.phase-hint p { font-size: 12px; line-height: 1.55; min-height: 42px; }
.phase-hint-foot { font-size: 12px; }
.phase-hint-foot b { font-size: 15px; }
.phase-hint-foot button { min-height: 28px; padding: 3px 10px; }
.dock-btn-side { width: 128px; height: 42px; font-size: 14px; }
.dock-btn-main { width: 150px; height: 46px; font-size: 16px; }
.dock-btn:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.dock-btn:disabled:hover { box-shadow: none; border-color: #776a4d; background: linear-gradient(#26302a, #141f1d); }
.top-nav-btn:focus-visible, .dock-btn:focus-visible, .phase-hint button:focus-visible,
.generals-return:focus-visible, .generals-valid-info button:focus-visible,
.battle-back-btn:focus-visible { outline: 2px solid #f2d99e; outline-offset: 3px; }
::selection { color: #17221f; background: #dfc591; }

@media (max-width: 900px) and (orientation: landscape) {
  .game-topbar { height: 42px; }
  .top-res-group, .top-right-group { gap: 7px; }
  .top-res-pill .res-val { font-size: 12px; }
  .top-nav-btn { width: 38px; height: 34px; font-size: 0; }
  .top-nav-btn .nav-icon { width: 25px; height: 25px; font-size: 12px; }
  .round-dial-medallion { width: 38px; height: 38px; }
  .left-player-roster { top: 44px; left: 0; gap: 6px; transform: scale(.58); }
  .phase-hint { left: 5px; bottom: 3px; width: 166px; height: 54px; min-height: 0; padding: 3px 8px; transform: none; }
  .phase-hint-top strong { font-size: 11px; letter-spacing: 0; }
  .phase-hint-top span { display: none; }
  .phase-hint p { position: absolute; width: 1px; height: 1px; min-height: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .phase-hint-compact { display: block; margin: 1px 0; color: #d4d6cc; font-size: 9px; line-height: 1.2; white-space: nowrap; }
  .phase-hint-foot { font-size: 9px; padding-top: 0; border-top: 0; }
  .phase-hint-foot b { font-size: 11px; }
  .phase-hint-foot button { min-height: 23px; padding: 0 5px; }
  .bottom-commander-dock { height: 44px; transform: none; }
  .commander-pedestal-wrap { display: none; }
  .action-dock-bar { height: 43px; bottom: 0; gap: 4px; }
  .dock-btn-side { width: 94px; height: 33px; font-size: 11px; margin-bottom: 2px; }
  .dock-btn-main { width: 112px; height: 38px; font-size: 12px; margin-bottom: 1px; }
}

/* 军令弹窗：补给、规则、设置与战果使用同一种材质和控件。 */
.modal-backdrop { background: rgba(5, 10, 9, .79); backdrop-filter: blur(4px); }
.info-scroll-dialog, .convert-scroll-card, .reward-glow-card {
  color: #efe5ce;
  background: linear-gradient(145deg, rgba(25, 40, 35, .98), rgba(12, 23, 21, .98));
  border: 1px solid #aa9164;
  border-radius: 4px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, .68), inset 0 0 0 4px rgba(196, 166, 111, .08);
}
.info-scroll-dialog { width: min(600px, calc(100% - 40px)); max-height: calc(100% - 36px); overflow: auto; padding: 28px 34px; }
.info-scroll-dialog h2 { color: #f0ddb5; border-bottom-color: rgba(195, 168, 121, .45); font-size: 24px; padding-right: 38px; }
.info-dialog-body { color: #dfd9c9; font-size: 14px; line-height: 1.75; gap: 13px; }
.info-dialog-body b { color: #f0ddb5; }
.modal-close-x { top: 9px; right: 10px; width: 38px; height: 38px; color: #d8c499; font-size: 23px; line-height: 1; text-shadow: none; }
.modal-close-x:hover { color: #fff0c9; transform: none; }
.convert-confirm-btn, .reward-claim-btn {
  min-height: 42px; padding: 8px 26px; border: 1px solid #e3c98f; border-radius: 3px;
  background: linear-gradient(#e5d2a3, #a98954); color: #1a2621;
  box-shadow: 0 5px 12px rgba(0,0,0,.25); font-family: inherit; font-size: 15px; font-weight: 700; letter-spacing: 2px;
}
.convert-confirm-btn:hover:not(:disabled), .reward-claim-btn:hover { background: linear-gradient(#f0dfb4, #bd995d); box-shadow: 0 6px 14px rgba(0,0,0,.3); }
.convert-confirm-btn:disabled { background: #3e453b; color: #9fa696; border-color: #626b5b; opacity: .7; box-shadow: none; }
.convert-scroll-card { width: min(560px, calc(100% - 40px)); padding: 30px 30px 24px; }
.convert-title-tab { position: static; transform: none; padding: 0 0 14px; margin-bottom: 16px; background: transparent; color: #f0ddb5; box-shadow: none; border-radius: 0; border-bottom: 1px solid rgba(195,168,121,.45); font-size: 24px; }
.convert-header-sub { color: #d5d3c4; font-size: 14px; font-weight: 400; margin: 0 0 18px; }
.convert-exchange-body { gap: 44px; margin-bottom: 16px; }
.convert-big-icon { width: 42px; height: 42px; border: 1px solid #bda474; border-radius: 50%; color: #ebd7aa; font-size: 20px; }
.convert-num { color: #f2e2bc; font-variant-numeric: tabular-nums; }
.convert-arrow-col { color: #cfb582; }
.convert-stepper-row { gap: 4px; margin: 12px auto; }
.step-btn { width: 43px; height: 39px; background: #34433a; border: 1px solid #8c7c5b; color: #f0e2c3; border-radius: 2px; }
.step-btn.step-edge { width: 58px; font-size: 12px; }
.step-btn:hover { background: #536047; }
.step-display { height: 39px; width: 92px; background: #111f1b; border: 1px solid #8c7c5b; color: #f3e3bd; }
.convert-ratio-hint { color: #c8c1ac; margin-bottom: 14px; }
.reward-glow-card { width: min(350px, calc(100% - 40px)); padding: 28px 24px 24px; }
.reward-title { color: #e9d4a5; }
.reward-icon-glow { display: grid; place-items: center; width: 92px; height: 92px; margin: 18px auto; color: #f1dda9; font-size: 52px; border: 1px solid #af925f; border-radius: 50%; text-shadow: none; background: radial-gradient(circle, #435044, #1b2a24 70%); }
.reward-amount { color: #f4e7ca; }
.reward-subtitle { color: #bfc5b9; }
.setting-item-row { border-bottom-color: rgba(195,168,121,.25); gap: 16px; }
.setting-toggle-btn, .setting-action-btn { min-height: 38px; color: #f1e2bf; background: #26362f; border-color: #8c7c5b; }
.setting-toggle-btn:hover, .setting-action-btn:hover { background: #40523f; }
.info-scroll-dialog button:focus-visible, .convert-scroll-card button:focus-visible, .reward-glow-card button:focus-visible { outline: 2px solid #f2d99e; outline-offset: 2px; }

@media (max-width: 900px) and (orientation: landscape) {
  .info-scroll-dialog, .convert-scroll-card, .reward-glow-card { max-height: calc(100% - 20px); overflow: auto; padding: 14px 18px; }
  .info-scroll-dialog h2, .convert-title-tab { font-size: 18px; margin-bottom: 9px; padding-bottom: 8px; }
  .info-dialog-body { font-size: 11px; line-height: 1.55; gap: 7px; margin-bottom: 10px; }
  .convert-header-sub { font-size: 11px; margin-bottom: 8px; }
  .convert-exchange-body { gap: 28px; margin-bottom: 6px; }
  .convert-big-icon { width: 28px; height: 28px; font-size: 14px; }
  .convert-col { gap: 3px; }
  .convert-num { font-size: 17px; }
  .convert-stepper-row { margin: 7px auto; }
  .convert-ratio-hint { margin-bottom: 6px; }
  .modal-close-x { top: 5px; right: 6px; }
}
