/* 《打进大金陵·共享小天堂》—— Reigns 式卡片 · 沉稳厚重 · 移动端竖屏优先 */
:root {
  --ink: #2b1d16;
  --ink-soft: #4a3527;
  --paper: #efe6d4;
  --paper-deep: #e4d7bd;
  --accent: #8c2f1f;
  --accent-deep: #6e2417;
  --gold: #a9863f;
  --line: #c8b58c;
  --danger: #c0392b;
  --shadow: rgba(43, 29, 22, 0.3);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: radial-gradient(120% 80% at 50% 0%, #3a2820 0%, #271a13 60%, #1d130d 100%);
  color: var(--ink);
  font-family: "Songti SC", "SimSun", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  -webkit-text-size-adjust: 100%;
}
body {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* ── 顶栏 ── */
.topbar {
  width: 100%; max-width: 640px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 14px 18px 8px;
}
.brand h1 { margin: 0; font-size: 1.34rem; letter-spacing: 2px; color: var(--paper); text-shadow: 0 1px 0 #000; }
.brand h1 .sep { color: var(--gold); margin: 0 2px; }
.subtitle { margin: 3px 0 0; font-size: 0.74rem; letter-spacing: 1px; color: var(--gold); opacity: 0.9; }
.char-btn {
  flex: 0 0 auto; background: transparent; color: var(--paper); border: 1px solid var(--gold);
  border-radius: 4px; padding: 9px 12px; font-size: 0.84rem; font-family: inherit; cursor: pointer; white-space: nowrap;
}
.char-btn:active { background: rgba(169, 134, 63, 0.2); }

/* ── 进军地图(江面 + 节点 + 大军旗标)── */
.map { position: relative; width: 100%; max-width: 640px; height: 46px; padding: 0 30px; margin: 2px 0 4px; }
.river {
  position: absolute; left: 30px; right: 30px; top: 13px; height: 4px;
  background: rgba(120, 160, 200, 0.22); border-radius: 2px; overflow: hidden;
}
.river-prog {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, rgba(169,134,63,0.5), var(--gold));
  transition: width 0.6s ease;
}
.mnode { position: absolute; top: 6px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.mdot { width: 11px; height: 11px; border-radius: 50%; background: rgba(239, 230, 212, 0.22); border: 1px solid rgba(169, 134, 63, 0.5); }
.mname { font-size: 0.64rem; color: rgba(239, 230, 212, 0.4); white-space: nowrap; }
.mnode.past .mdot { background: var(--gold); }
.mnode.past .mname { color: rgba(169, 134, 63, 0.85); }
.mnode.here .mdot { background: var(--accent); border-color: var(--paper); }
.mnode.here .mname { color: var(--paper); font-weight: bold; }
.army {
  position: absolute; top: -7px; transform: translateX(-50%); width: 22px; height: 22px;
  color: var(--accent); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  transition: left 0.6s ease; animation: bob 1.6s ease-in-out infinite;
}
.army svg { width: 100%; height: 100%; }
@keyframes bob { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }

/* ── 数值条(安全/危险区着色 + 当前值标记)── */
.stats { width: 100%; max-width: 640px; display: flex; gap: 10px; padding: 4px 18px 6px; }
.stat {
  position: relative; flex: 1 1 0; min-width: 0;
  background: rgba(20, 13, 9, 0.4); border: 1px solid rgba(169, 134, 63, 0.35);
  border-radius: 6px; padding: 7px 9px 8px;
}
.stat-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.stat-label { font-size: 0.78rem; color: var(--gold); letter-spacing: 1px; display: flex; align-items: center; }
.stat-icon {
  display: inline-block; width: 16px; height: 16px; line-height: 16px; text-align: center;
  border: 1px solid var(--gold); border-radius: 3px; font-size: 0.66rem; margin-right: 3px; color: var(--paper);
}
.stat-val { font-size: 0.96rem; color: var(--paper); font-weight: bold; }
.stat-bar { position: relative; height: 9px; border-radius: 4px; overflow: hidden; }
/* 危险区(红)/安全区(绿)着色:仅过低危险 vs 两头危险 */
.stat-bar.zone-low {
  background: linear-gradient(90deg, rgba(192,57,43,0.6) 0 20%, rgba(106,142,79,0.32) 20% 100%);
}
.stat-bar.zone-both {
  background: linear-gradient(90deg, rgba(192,57,43,0.6) 0 20%, rgba(106,142,79,0.32) 20% 80%, rgba(192,57,43,0.6) 80% 100%);
}
.stat-fill { position: absolute; left: 0; top: 0; height: 100%; background: rgba(239, 230, 212, 0.3); transition: width 0.45s ease; }
.stat-marker { position: absolute; top: -1px; width: 3px; height: 11px; margin-left: -1px; background: var(--paper); box-shadow: 0 0 2px #000; transition: left 0.45s ease; }
.stat.danger { border-color: var(--danger); animation: pulse 1s ease-in-out infinite; }
.stat.danger .stat-val { color: #ff8a7a; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); } 50% { box-shadow: 0 0 0 3px rgba(192,57,43,0.4); } }
.stat-delta {
  position: absolute; right: 8px; top: 4px; font-size: 0.92rem; font-weight: bold;
  animation: floatUp 1.1s ease-out forwards; pointer-events: none;
}
.stat-delta.up { color: #59c06a; }
.stat-delta.down { color: #ff6f5e; }
@keyframes floatUp { 0% { opacity: 0; transform: translateY(8px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }

/* ── 危险警示 ── */
.warn {
  width: 100%; max-width: 640px; display: none; padding: 6px 18px 0;
  color: #ff8a7a; font-size: 0.84rem; letter-spacing: 1px; text-align: center;
}

/* ── 卡片舞台 ── */
.stage { width: 100%; max-width: 640px; flex: 1 1 auto; padding: 10px 18px 24px; }
.card {
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px var(--shadow);
  padding: 22px 20px 22px; min-height: 200px; display: flex; flex-direction: column;
  opacity: 0; transform: translateY(10px); transition: opacity 0.28s ease, transform 0.28s ease;
}
.card.show { opacity: 1; transform: translateY(0); }

/* 卡片:来报者 + 情境 */
.who {
  align-self: flex-start; font-size: 0.8rem; color: var(--paper);
  background: var(--accent-deep); padding: 4px 12px; border-radius: 12px; margin-bottom: 14px; letter-spacing: 1px;
}
.ctext { margin: 0 0 6px; font-size: 1.18rem; line-height: 1.85; color: var(--ink); text-align: justify; flex: 1 1 auto; }

.card .title {
  margin: 0 0 12px; font-size: 1.4rem; letter-spacing: 1px; color: var(--ink);
  border-left: 4px solid var(--accent); padding-left: 12px;
}
.lines .para { margin: 0 0 12px; font-size: 1.02rem; line-height: 1.8; color: var(--ink-soft); text-align: justify; }

/* 选项按钮:卡片二选一(左/右),其余单按钮 */
.opts { display: flex; gap: 12px; margin-top: 8px; }
.opt {
  font-family: inherit; font-size: 1.04rem; line-height: 1.45; color: var(--paper);
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
  border: 1px solid var(--accent-deep); border-radius: 8px; padding: 15px 14px; cursor: pointer;
  box-shadow: 0 2px 6px var(--shadow); transition: transform 0.08s ease, filter 0.15s ease; min-height: 56px;
}
.opt:active { transform: scale(0.98); filter: brightness(0.95); }
.opts .opt { flex: 1 1 0; text-align: center; }
.opt.continue, .opt.restart {
  display: block; width: 100%; margin-top: 16px; text-align: center;
  background: linear-gradient(180deg, var(--ink-soft) 0%, var(--ink) 100%); border-color: var(--ink);
}
.opt.restart {
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%); border-color: var(--accent-deep);
  font-size: 1.1rem; letter-spacing: 2px;
}

/* 顶部按钮组 */
.topbtns { display: flex; gap: 8px; flex: 0 0 auto; }

/* 卡片场景图标 */
.art-svg {
  display: block; width: 56px; height: 56px; margin: 0 auto 10px; color: var(--accent-deep);
  border: 1px solid var(--line); border-radius: 50%; padding: 8px;
  background: radial-gradient(circle, rgba(169,134,63,0.12), transparent 70%);
}
.art-svg svg { width: 100%; height: 100%; display: block; }

/* “算账”提示行 */
.ledger {
  margin: 4px 0 10px; padding: 8px 12px; border-radius: 6px;
  background: rgba(140, 47, 31, 0.08); border-left: 3px solid var(--gold);
  font-size: 0.96rem; color: var(--accent-deep); letter-spacing: 0.5px;
}
.ledger.calc { font-weight: bold; }

/* 选项后果预告 */
.opt { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.opt-label { display: block; }
.fxprev { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.fxchip {
  font-size: 0.72rem; padding: 1px 6px; border-radius: 10px;
  background: rgba(0,0,0,0.18); border: 1px solid rgba(239,230,212,0.35); letter-spacing: 1px;
}
.fxchip.up { color: #bfe6c2; }
.fxchip.down { color: #ffc9c0; }

/* 破城动效:震动 + 闪光 */
.boom { animation: shake 0.5s ease; }
.boom-big { animation: shake 0.7s ease; }
@keyframes shake {
  0%,100% { transform: translate(0,0); } 10% { transform: translate(-4px,2px); }
  25% { transform: translate(5px,-3px); } 40% { transform: translate(-5px,3px); }
  55% { transform: translate(4px,-2px); } 70% { transform: translate(-3px,2px); } 85% { transform: translate(2px,-1px); }
}
.boom .flash {
  position: absolute; inset: 0; border-radius: 10px; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255,180,90,0.85), rgba(192,57,43,0.4) 40%, transparent 70%);
  animation: flashout 0.7s ease-out forwards;
}
.boom-big .flash { animation-duration: 0.95s; }
@keyframes flashout { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.boom { position: relative; }
.boom .art-svg { color: var(--accent); animation: pulse 0.6s ease 2; }

/* 玩法须知:三数值说明 */
.intro-stats { margin: 12px 0; }
.intro-stat { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.intro-stat:last-child { border-bottom: none; }
.is-label { font-weight: bold; color: var(--accent-deep); flex: 0 0 auto; }
.is-hint { font-size: 0.9rem; color: var(--ink-soft); }

/* 史实卡 / 结算 / 结局 配色 */
.kind-fact { background: linear-gradient(180deg, #f3ead9 0%, #ecdfc4 100%); }
.kind-fact .title { border-left-color: var(--gold); }
.kind-outcome .title { border-left-color: var(--accent); }
.end-win .title { border-left-color: var(--accent-deep); }
.end-lose { background: linear-gradient(180deg, #efe0d8 0%, #e6cfc4 100%); }
.end-lose .title {
  border-left: none; color: var(--paper); background: var(--danger);
  padding: 8px 14px; border-radius: 6px; text-align: center;
}
/* 计分 + 评级头衔 */
.scorebox {
  margin: 6px 0 14px; padding: 14px 16px; border-radius: 8px;
  background: rgba(43, 29, 22, 0.06); border: 1px solid var(--line); text-align: center;
}
.scorebox.record { border-color: var(--gold); background: rgba(169, 134, 63, 0.12); }
.sc-title { font-size: 1.3rem; letter-spacing: 4px; color: var(--accent-deep); margin-bottom: 10px; }
.sc-row { display: flex; justify-content: center; gap: 28px; }
.sc-cur, .sc-best { display: flex; flex-direction: column; align-items: center; }
.sc-num { font-size: 1.9rem; font-weight: bold; color: var(--ink); line-height: 1.1; }
.sc-best .sc-num { color: var(--ink-soft); }
.sc-lab { font-size: 0.72rem; color: var(--gold); letter-spacing: 1px; margin-top: 2px; }
.sc-record { margin-top: 10px; font-size: 1rem; color: var(--accent); font-weight: bold; letter-spacing: 2px; animation: pulse 1s ease-in-out infinite; }

.note {
  margin-top: 14px; padding: 12px 14px; border: 1px dashed var(--accent);
  border-radius: 6px; background: rgba(140, 47, 31, 0.06);
}
.note .para { font-size: 0.86rem; line-height: 1.7; color: var(--accent-deep); margin: 0 0 8px; }
.note .para:last-child { margin-bottom: 0; }

/* ── 页脚 ── */
.foot { width: 100%; max-width: 640px; padding: 4px 18px 20px; }
.foot p { margin: 0; font-size: 0.72rem; line-height: 1.6; color: rgba(239, 230, 212, 0.45); text-align: center; }

/* ── 人物小传弹窗 ── */
.modal {
  position: fixed; inset: 0; display: none; align-items: flex-start; justify-content: center;
  background: rgba(20, 13, 9, 0.72); padding: 24px 14px; z-index: 50; overflow-y: auto;
}
.modal.open { display: flex; }
.modal-box {
  width: 100%; max-width: 600px; background: linear-gradient(180deg, var(--paper) 0%, var(--paper-deep) 100%);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}
.modal-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: linear-gradient(180deg, var(--ink) 0%, var(--ink-soft) 100%); border-radius: 8px 8px 0 0;
}
.modal-head h2 { margin: 0; font-size: 1.05rem; letter-spacing: 1px; color: var(--paper); }
.modal-close {
  background: transparent; border: 1px solid rgba(239, 230, 212, 0.5); color: var(--paper);
  width: 34px; height: 34px; border-radius: 4px; font-size: 1rem; cursor: pointer;
}
.modal-body { padding: 6px 16px 18px; }
.bio { padding: 16px 0; border-bottom: 1px dashed var(--line); }
.bio:last-child { border-bottom: none; }
.bio-name { margin: 0; font-size: 1.18rem; color: var(--accent-deep); letter-spacing: 1px; }
.bio-role { margin: 4px 0 10px; font-size: 0.8rem; color: var(--gold); letter-spacing: 0.5px; }
.bio-p { margin: 0 0 8px; font-size: 0.96rem; line-height: 1.78; color: var(--ink-soft); text-align: justify; }

/* ── 窄屏微调 ── */
@media (max-width: 380px) {
  .brand h1 { font-size: 1.16rem; }
  .char-btn { padding: 8px 10px; font-size: 0.78rem; }
  .mname { font-size: 0.6rem; }
  .ctext { font-size: 1.08rem; }
  .opt { font-size: 0.98rem; padding: 14px 10px; }
}
