:root {
  --bg: #140f0c;
  --bg2: #112419;
  --card: #1B3124;
  --card2: #233D2D;
  --line: rgba(214, 176, 112, 0.32);
  --gold: #96E7CC;
  --gold2: #48A686;
  --text: #f6ecdc;
  --muted: #8CB7A4;
  --red: #3EC456;
  --red2: #268C34;
  --paper: #CCF3E5;
  --ink: #142A1C;
  --ok: #728DAE;
  --hp: #45D15C;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  color-scheme: dark;
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(196, 84, 62, 0.2), transparent 55%),
    radial-gradient(800px 480px at 100% 100%, rgba(120, 86, 40, 0.28), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
#land {
  position: absolute; inset: 0; overflow: hidden;
}
@media (orientation: portrait) {
  #land {
    position: fixed;
    width: 100vh;
    width: 100dvh;
    height: 100vw;
    height: 100dvw;
    top: 0;
    left: 100vw;
    left: 100dvw;
    transform: rotate(90deg);
    transform-origin: 0 0;
  }
}
#app {
  height: 100%; position: relative; display: flex; flex-direction: column; min-height: 0;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
}
@media (orientation: portrait) {
  #app {
    padding-top: env(safe-area-inset-right);
    padding-right: env(safe-area-inset-bottom);
    padding-bottom: env(safe-area-inset-left);
    padding-left: env(safe-area-inset-top);
  }
}
#toast {
  position: fixed; top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none; width: min(560px, 92%);
}
#toast .msg {
  background: rgba(28, 18, 14, 0.94); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; font-size: 13px;
  box-shadow: var(--shadow);
}
.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 12px 10px; }
.topbar {
  flex: none; display: flex; align-items: center; gap: 8px;
  overflow-x: auto; padding: 0 0 8px;
}
#app > .topbar { padding: 8px 12px 0; }
.chip, .rankseal {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(49, 36, 27, 0.92); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 10px; font-size: 13px; color: var(--gold);
  white-space: nowrap;
}
.chip .mp-icon, .mini .mp-icon, .btn .mp-icon, .choice .mp-icon, .iconbtn .mp-icon { width: 16px; height: 16px; }
.rankseal { color: var(--text); font-family: "Songti SC", "STSong", "SimSun", serif; }
.rankseal .star { width: 14px; height: 14px; opacity: 0.28; }
.rankseal .star.on { opacity: 1; color: var(--gold); }
.spacer { flex: 1; }
.iconbtn, .btn, .choice, .slot, .uchip, .menu button, .origin, .road button {
  border: 0; color: inherit;
}
.iconbtn {
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line); color: var(--gold);
}
.iconbtn:active, .btn:active, .choice:active, .menu button:active, .origin:active, .road button:active, .uchip:active {
  transform: translateY(1px);
}
.body { flex: 1; min-height: 0; display: flex; gap: 10px; }
.panel {
  background: linear-gradient(180deg, rgba(61, 45, 35, 0.96), rgba(36, 25, 18, 0.96));
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow); min-height: 0; overflow: auto;
}
.side { width: 220px; flex: none; padding: 12px; }
.mid { flex: 1; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.menu { width: 176px; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: start; }
h1, h2, h3 { font-family: "Songti SC", "STSong", "SimSun", serif; margin: 0; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: 0.08em; }
h2 { font-size: 18px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }
.nick {
  width: 100%; margin-top: 8px; background: transparent; color: var(--text);
  border: 0; border-bottom: 1px solid var(--line); font-size: 16px; padding: 4px 0;
}
.attrs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; margin-top: 10px; }
.attrs span { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.attrs b { color: var(--text); font-weight: 600; }
.bars { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.bars i {
  display: block; height: 4px; border-radius: 4px; background: #2C4A39; position: relative; overflow: hidden;
}
.bars i em { position: absolute; inset: 0 auto 0 0; background: var(--gold2); }
.bars label { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.road { display: flex; gap: 6px; }
.road button {
  flex: 1; min-height: 64px; border-radius: 12px; padding: 6px;
  background: #172A1E; border: 1px solid var(--line); color: var(--muted); text-align: left;
}
.road button.now { background: linear-gradient(180deg, #2C6E35, #1B3D22); color: var(--text); border-color: rgba(232, 180, 120, 0.55); }
.road button.done { color: var(--gold); }
.road button b { display: block; font-size: 13px; }
.road button span { font-size: 11px; }
.chapter {
  flex: 1; border-radius: 14px; padding: 14px;
  background:
    linear-gradient(120deg, rgba(20, 12, 10, 0.2), rgba(20, 12, 10, 0.55)),
    linear-gradient(160deg, #2A6A3B, #142A1A 60%, #201B24);
  border: 1px solid var(--line); display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
}
.chapter .eyebrow { color: var(--gold); font-size: 12px; letter-spacing: 0.12em; }
.btn {
  min-height: 40px; border-radius: 12px; padding: 8px 14px;
  background: linear-gradient(180deg, #4ED467, #2C9A3A);
  color: #fff8f2; font-weight: 700; font-size: 14px;
  box-shadow: 0 3px 0 #1E6D27, 0 8px 16px rgba(0, 0, 0, 0.25);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.ghost {
  background: transparent; color: var(--gold); box-shadow: none;
  border: 1px solid var(--line);
}
.btn.small { min-height: 32px; font-size: 12px; padding: 4px 8px; box-shadow: none; }
.btn:disabled { opacity: 0.55; }
.menu button {
  min-height: 64px; border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: var(--shadow); font-size: 13px;
}
.menu button .mp-icon { width: 22px; height: 22px; color: var(--gold); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.splash, .origin-wrap {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px;
}
.splash h1 { font-size: 44px; color: var(--gold); text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); margin: 0; }
.splash .lead { color: var(--muted); letter-spacing: 0.2em; margin: 6px 0 0; }
.splash-actions {
  pointer-events: auto; display: flex; gap: 10px; align-items: center; margin-top: 16px;
}
.splash-actions .btn { min-width: 128px; min-height: 46px; }
.splash .fine {
  margin: 10px 0 0; font-size: 12px; letter-spacing: 0.04em; color: #f3e6d2;
  text-shadow: 0 1px 2px #000;
}
.origin-wrap { align-items: stretch; overflow: auto; }
.origin-wrap h1 { text-align: center; color: var(--gold); }
.origins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: min(1080px, 100%); margin-top: 12px; }
.origin {
  text-align: left; border-radius: 16px; padding: 14px; min-height: 180px;
  background: linear-gradient(180deg, #284A36, #162A1D);
  border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--text);
}
.origin .mp-icon { width: 28px; height: 28px; color: var(--gold); }
.origin b { display: block; margin: 8px 0 4px; font-size: 18px; font-family: "Songti SC", "STSong", serif; }
.origin p { margin: 0 0 6px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.story {
  flex: 1; min-height: 0; display: grid; grid-template-columns: 200px 1fr 280px; gap: 10px; padding: 0 12px 12px;
}
.portrait, .paper, .choicebox {
  border-radius: 16px; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 0;
}
.portrait {
  background: linear-gradient(180deg, #264C35, #0F2216);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 12px;
}
.portrait .seal {
  width: 92px; height: 92px; border-radius: 50%;
  border: 2px solid var(--gold); display: flex; align-items: center; justify-content: center;
  color: var(--gold); font-family: "Songti SC", "STSong", serif; font-size: 28px;
  box-shadow: inset 0 0 0 4px rgba(231, 203, 150, 0.25);
}
.portrait.camp { background: linear-gradient(180deg, #283D34, #1b140f); }
.portrait.dust { background: linear-gradient(180deg, #326A4B, #142A1C); }
.portrait.river { background: linear-gradient(180deg, #56244F, #221420); }
.portrait.night { background: linear-gradient(180deg, #44242F, #201418); }
.portrait.fire { background: linear-gradient(180deg, #247A35, #0E2A12); }
.portrait.court { background: linear-gradient(180deg, #284A3B, #1c160f); }
.paper {
  background: var(--paper); color: var(--ink); padding: 16px 18px; overflow: auto;
  display: flex; flex-direction: column;
}
.paper .who { color: #328A4C; font-size: 13px; letter-spacing: 0.08em; }
.paper #line { font-size: 18px; line-height: 1.7; margin: 10px 0; min-height: 4.8em; font-family: "Songti SC", "STSong", serif; }
.paper .hint { margin-top: auto; color: #588D72; font-size: 12px; }
.choicebox { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: auto; background: rgba(28, 20, 16, 0.72); }
.choice {
  text-align: left; border-radius: 12px; padding: 10px 12px; min-height: 44px;
  background: #223A2A; border: 1px solid var(--line); color: var(--text); font-size: 14px; line-height: 1.4;
}
.choice em {
  display: inline-block; margin-right: 6px; font-style: normal; font-size: 11px;
  color: #0E2A12; background: var(--gold); border-radius: 999px; padding: 1px 6px;
}
.prep, .battle {
  flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 12px 10px; gap: 8px;
}
.prep-body, .battle-body { flex: 1; min-height: 0; display: flex; gap: 8px; }
.field {
  flex: 1; min-width: 0; display: grid;
  grid-template-columns: 1fr 1fr 0.9fr 18px 0.9fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr; gap: 6px;
}
.cell {
  border-radius: 12px; border: 1px dashed rgba(214, 176, 112, 0.28);
  background: rgba(20, 14, 10, 0.35); position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
.cell.unit {
  border-style: solid; border-color: var(--line);
  background: linear-gradient(180deg, #284A35, #162A1D);
  flex-direction: column; align-items: stretch; padding: 6px 8px; gap: 3px;
}
.cell b { font-size: 12px; }
.cell .sub { font-size: 10px; color: var(--muted); }
.hp { height: 6px; border-radius: 6px; background: #284A31; overflow: hidden; }
.hp i { display: block; height: 100%; background: linear-gradient(90deg, #2EA33D, #5AE0A3); width: 100%; }
.hpnum { font-size: 10px; color: var(--muted); }
.cell.dead { opacity: 0.4; filter: grayscale(0.6); }
.cell.hit { animation: shake 0.28s linear; }
.cell.pick { outline: 2px solid var(--gold); }
.vs { grid-column: 4; grid-row: 1 / span 3; display: flex; align-items: center; justify-content: center; color: var(--gold2); font-family: "Songti SC", serif; }
.t-sword { box-shadow: inset 3px 0 0 #3EC456; }
.t-spear { box-shadow: inset 3px 0 0 #83D4B5; }
.t-archer { box-shadow: inset 3px 0 0 #728DAE; }
.t-horse { box-shadow: inset 3px 0 0 #4AD08C; }
.t-siege { box-shadow: inset 3px 0 0 #A87F92; }
.p-front { grid-column: 3; grid-row: 2; }
.p-mid1 { grid-column: 2; grid-row: 1; }
.p-mid2 { grid-column: 2; grid-row: 3; }
.p-back1 { grid-column: 1; grid-row: 1; }
.p-back2 { grid-column: 1; grid-row: 3; }
.e-front { grid-column: 5; grid-row: 2; }
.e-mid1 { grid-column: 6; grid-row: 1; }
.e-mid2 { grid-column: 6; grid-row: 3; }
.e-back1 { grid-column: 7; grid-row: 1; }
.e-back2 { grid-column: 7; grid-row: 3; }
.sidebox { width: 168px; flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.sidebox .panel, .log {
  padding: 8px; overflow: auto;
}
.log { flex: 1; background: rgba(20, 14, 10, 0.55); border-radius: 12px; border: 1px solid var(--line); }
.log p { margin: 0 0 4px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.tac {
  text-align: left; border-radius: 10px; padding: 6px 8px; min-height: 36px;
  background: #223A2A; border: 1px solid var(--line); color: var(--text); font-size: 12px;
}
.tac.on { border-color: var(--gold); color: var(--gold); }
.tac:disabled { opacity: 0.4; }
.bench { display: flex; gap: 6px; overflow-x: auto; flex: none; }
.uchip {
  border-radius: 12px; padding: 6px 8px; min-width: 86px; background: var(--card);
  border: 1px solid var(--line); color: var(--text); font-size: 12px;
}
.uchip.on { border-color: var(--gold); }
.timebar { height: 6px; border-radius: 6px; background: #243A2C; overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--gold); }
.float {
  position: absolute; left: 50%; top: 2px; transform: translateX(-50%);
  color: #ffe1a8; font-weight: 700; font-size: 13px; pointer-events: none;
  animation: up 0.6s ease forwards;
}
.float.bad { color: #ffb1a4; }
@keyframes up { to { transform: translate(-50%, -18px); opacity: 0; } }
@keyframes shake {
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
.mask {
  position: absolute; inset: 0; background: rgba(10, 7, 5, 0.72);
  display: flex; align-items: center; justify-content: center; z-index: 46; padding: 16px;
}
.sheet {
  width: min(460px, 100%); background: linear-gradient(180deg, #284A36, #162A1D);
  border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow);
}
.sheet h2 { color: var(--gold); margin-bottom: 6px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.cardline {
  display: flex; gap: 8px; align-items: center; justify-content: space-between;
  background: rgba(20, 14, 10, 0.35); border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.cardline b { font-size: 14px; }
.qual-普通 { color: #d9cbb8; }
.qual-精良 { color: #728DAE; }
.qual-稀有 { color: #D47EAF; }
.qual-传说 { color: var(--gold); }
.talents { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; min-height: 0; }
.tree { padding: 8px; overflow: auto; }
.tree h3 { color: var(--gold); margin-bottom: 6px; }
.node {
  width: 100%; text-align: left; margin-bottom: 6px; border-radius: 10px; padding: 6px 8px;
  background: #172A1E; border: 1px solid var(--line); color: var(--text);
}
.node.on { border-color: var(--gold); background: #204A35; }
.node:disabled { opacity: 0.45; }
.rankrow { display: flex; justify-content: space-between; gap: 8px; padding: 7px 2px; border-bottom: 1px solid rgba(214, 176, 112, 0.14); font-size: 13px; }
.rankrow.me { color: var(--gold); }
.opp {
  padding: 12px; border-radius: 14px; background: rgba(20, 14, 10, 0.35); border: 1px solid var(--line);
}
.drag-ghost {
  position: fixed; z-index: 30; pointer-events: none; padding: 6px 8px; border-radius: 10px;
  background: #284A35; border: 1px solid var(--gold); color: var(--text); font-size: 12px;
}
button { touch-action: manipulation; }
button.press { transform: scale(0.96); filter: brightness(1.12); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: #162A1D; color: var(--gold);
}
.avatar .mp-icon { width: 18px; height: 18px; }
.avatar.linen { background: #406B54; }
.avatar.leather { background: #286A3F; }
.avatar.iron { background: #5C4D55; color: #e6e1d6; }
.avatar.officer { background: #287A31; }
.avatar.general { background: linear-gradient(160deg, #96E7CC, #268C34); color: #0E2A12; }
.strip {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 12px 6px; overflow-x: auto;
}
.strip .ab { font-size: 12px; color: var(--muted); display: inline-flex; gap: 3px; white-space: nowrap; }
.strip .ab b { color: var(--text); font-weight: 700; }
.fbs { display: inline-flex; gap: 4px; margin-left: auto; }
.fb {
  width: 46px; height: 14px; border-radius: 7px; background: #243A2C; position: relative; overflow: hidden;
}
.fb em { position: absolute; inset: 0 auto 0 0; }
.fb i { position: relative; font-style: normal; font-size: 10px; line-height: 14px; padding-left: 4px; color: #fff8ee; }
.fb-wei em { background: #865D6D; }
.fb-shu em { background: #556D8F; }
.fb-wu em { background: #3AA84A; }
.fb-qun em { background: #45B08C; }
.choice { display: flex; align-items: center; gap: 8px; position: relative; }
.cico {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  background: rgba(231, 203, 150, 0.12); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.choice.picked { border-color: var(--gold); background: #284A35; }
.portrait { position: relative; overflow: hidden; background-size: 150% 150%; animation: ken 14s ease-in-out infinite alternate; }
.portrait::before {
  content: ""; position: absolute; inset: -20%;
  background: radial-gradient(circle at 50% 30%, rgba(243, 228, 204, 0.16), transparent 46%);
  animation: drift 9s ease-in-out infinite alternate; pointer-events: none;
}
.seal { position: relative; z-index: 1; }
.seal .breath { animation: breath 3.4s ease-in-out infinite; display: flex; }
.seal .mp-icon { width: 36px; height: 36px; }
.portrait.cam-in .seal { animation: cam 0.65s ease; }
.mood-angry { border-color: #68E07C; color: #ffc7bb; }
.mood-sad { border-color: #B88EA3; color: #d5e2ee; }
.mood-glad { border-color: #96E7CC; color: #ffe7bf; }
.mood-ask { border-color: #849BBA; color: #e4f0d4; }
.map { position: relative; }
.map .track {
  position: absolute; left: 6%; right: 6%; top: 16px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, rgba(231, 203, 150, 0.2), var(--gold2), rgba(231, 203, 150, 0.2));
}
.road button { position: relative; z-index: 1; }
.road button.now { animation: pulse 1.8s ease-in-out infinite; }
.scene {
  position: relative; flex: 1; min-height: 210px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  background: #1C3A28;
}
.gate {
  position: absolute; right: 8%; top: 10%; width: 34%; height: 52%;
  background: linear-gradient(#567D6B, #283A31);
  clip-path: polygon(0 100%, 0 34%, 16% 34%, 16% 10%, 84% 10%, 84% 34%, 100% 34%, 100% 100%);
  box-shadow: inset 0 -20px 0 rgba(0, 0, 0, 0.25);
}
.gate::after {
  content: ""; position: absolute; left: 38%; right: 38%; top: 42%; bottom: 0;
  background: #1a140f; border-radius: 40px 40px 0 0;
}
.tower {
  position: absolute; left: 8%; top: 8%; width: 46px; height: 58%;
  background: linear-gradient(#466D59, #1F2E26);
  clip-path: polygon(10% 100%, 10% 22%, 0 22%, 50% 0, 100% 22%, 90% 22%, 90% 100%);
}
.banner {
  position: absolute; left: 22%; top: 12%; width: 28px; height: 72px;
  background: #268C34; color: #f6ecdc; display: flex; align-items: center; justify-content: center;
  font-family: "Songti SC", "STSong", serif; transform-origin: top center;
  animation: sway 3.6s ease-in-out infinite; box-shadow: 0 8px 12px rgba(0, 0, 0, 0.25);
}
.banner.shu { background: #463F6B; }
.banner.wu { background: #268C34; }
.banner.wei { background: #663E4C; }
.banner.qun { background: #308A64; }
.herofig {
  position: absolute; left: 30%; bottom: 22%; width: 64px; text-align: center; z-index: 2;
}
.herofig .cape {
  height: 46px; border-radius: 16px 16px 8px 8px; margin: 0 auto;
  display: flex; align-items: flex-end; justify-content: center;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.18);
}
.herofig .cape .mp-icon { width: 26px; height: 26px; margin-bottom: 4px; }
.herofig.linen .cape { background: #92CBB9; color: #183A27; }
.herofig.leather .cape { background: #348A55; color: #f6ecdc; }
.herofig.iron .cape { background: #667079; color: #f4f1ea; }
.herofig.officer .cape { background: #2C9A3A; color: #f6ecdc; }
.herofig.general .cape { background: linear-gradient(#A4F0D8, #268C34); color: #0E2A12; }
.herofig span { display: block; font-size: 11px; color: #fff8ee; text-shadow: 0 1px 2px #000; }
.dust i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 244, 220, 0.55); animation: dust 8s linear infinite;
}
.scene .copy {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 28px 12px 10px;
  background: linear-gradient(180deg, transparent, rgba(16, 10, 8, 0.82));
}
.warband { display: flex; align-items: center; gap: 8px; flex: none; }
.warline { flex: 1; height: 8px; border-radius: 8px; background: #243A2C; overflow: hidden; }
.warline.foeside { transform: scaleX(-1); }
.warline i { display: block; height: 100%; width: 0; transition: width 0.25s ease; }
.warline .mine { background: linear-gradient(90deg, #556D8F, #96E7CC); }
.warline .foe { background: linear-gradient(90deg, #268C34, #90E7A1); }
#warlabel { font-size: 12px; color: var(--gold); white-space: nowrap; }
.field { position: relative; }
.field::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.28;
  background-image: radial-gradient(rgba(243, 228, 204, 0.7) 0.6px, transparent 0.7px);
  background-size: 22px 22px; animation: dustmove 16s linear infinite;
}
.cell.lunge { animation: lungeR 0.28s ease; z-index: 2; }
.e-front.lunge, .e-mid1.lunge, .e-mid2.lunge, .e-back1.lunge, .e-back2.lunge { animation-name: lungeL; }
.cell.crit { box-shadow: 0 0 0 2px #96E7CC, inset 3px 0 0 #96E7CC; }
.cell.dying { animation: die 0.45s ease forwards; }
.cell.focus { outline: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(231, 203, 150, 0.35); }
.deadseal {
  position: absolute; right: 4px; top: 2px; z-index: 2;
  border: 2px solid #68E07C; color: #ffc7bb; border-radius: 4px;
  font-family: "Songti SC", "STSong", serif; font-size: 12px; padding: 0 3px;
  transform: rotate(-14deg); animation: pop 0.25s ease;
}
.float { text-shadow: 0 1px 0 #0E2A12; }
.float.crit { font-size: 18px; color: #ffe08a; }
.float.good { color: #B4D4EC; }
#app { position: relative; }
#app.hitstop::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: rgba(255, 228, 196, 0.1);
}
.orb {
  position: absolute; z-index: 7; width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0;
  background: radial-gradient(circle at 35% 30%, #fff8e4, #5AE7B3 42%, #228A4D 78%);
  box-shadow: 0 0 12px rgba(231, 203, 150, 0.9);
  animation: bob 0.7s ease-in-out infinite alternate;
}
.orb.got { animation: none; transform: scale(0.2); opacity: 0; transition: 0.22s ease; }
.veil { position: fixed; inset: 0; z-index: 58; }
.curtain {
  position: fixed; inset: 0; z-index: 60; background: #100c09; pointer-events: auto;
  transform: scaleX(0); transform-origin: left center; animation: wipeIn 0.2s ease forwards;
}
.curtain.out { transform-origin: right center; animation: wipeOut 0.26s ease forwards; }
.titlecard {
  position: fixed; inset: 0; z-index: 48; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: rgba(10, 7, 5, 0.55); animation: cardlife 1.15s ease forwards;
}
.titlecard b { font-family: "Songti SC", "STSong", serif; font-size: 40px; letter-spacing: 0.22em; color: var(--gold); }
.titlecard span { color: var(--muted); letter-spacing: 0.16em; }
.roundstamp {
  position: fixed; left: 50%; top: 40%; z-index: 47; pointer-events: none;
  font-family: "Songti SC", "STSong", serif; font-size: 36px; color: var(--gold);
  border: 3px solid var(--gold); border-radius: 8px; padding: 2px 12px;
  background: rgba(20, 12, 8, 0.5); animation: stamp 0.7s ease forwards;
}
.cutin {
  position: fixed; left: 0; right: 0; top: 36%; z-index: 47; pointer-events: none;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 0; color: #fff8f2; letter-spacing: 0.2em;
  font-family: "Songti SC", "STSong", serif; font-size: 28px;
  background: linear-gradient(90deg, transparent, rgba(122, 42, 32, 0.94), transparent);
  animation: cut 0.72s ease forwards;
}
.cutin.foe { background: linear-gradient(90deg, transparent, rgba(36, 44, 58, 0.94), transparent); }
.cutin .mp-icon { width: 26px; height: 26px; }
.rankup {
  position: fixed; inset: 0; z-index: 62; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(10, 7, 5, 0.5);
}
.rankup h2 { color: var(--gold); letter-spacing: 0.16em; }
.sparks { position: relative; width: 8px; height: 8px; }
.sparks i {
  position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #96E7CC;
  animation: spark 0.8s ease-out forwards;
}
.sheet.slam { animation: slam 0.34s cubic-bezier(.2, 1.35, .36, 1); }
.resultseal {
  width: 92px; height: 92px; margin: 0 auto 8px; border-radius: 50%;
  border: 3px solid var(--gold); color: var(--gold);
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-family: "Songti SC", "STSong", serif; font-size: 18px; line-height: 1.2;
  transform: rotate(-8deg); animation: pop 0.35s cubic-bezier(.2, 1.4, .3, 1);
}
.resultseal.lose { border-color: #68E07C; color: #ffc7bb; }
.resultseal.close { border-color: #83D4B5; color: #ffe1b0; }
.unitcard { cursor: grab; }
.unitcard.over { outline: 1px dashed var(--gold); }
@keyframes up {
  0% { transform: translate(-50%, 8px) scale(0.7); opacity: 0; }
  25% { opacity: 1; transform: translate(-50%, 0) scale(1.12); }
  100% { transform: translate(-50%, -24px) scale(1); opacity: 0; }
}
@keyframes shake {
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
@keyframes ken { from { background-position: 20% 30%; } to { background-position: 80% 70%; } }
@keyframes drift { from { transform: translate3d(-2%, 0, 0); } to { transform: translate3d(3%, -2%, 0); } }
@keyframes breath { 50% { transform: translateY(-3px) scale(1.04); } }
@keyframes cam { from { transform: scale(1.16) translateY(6px); } to { transform: none; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(231, 203, 150, 0.28); } }
@keyframes sway { 50% { transform: rotate(3deg); } }
@keyframes dust { from { transform: translateY(20px); opacity: 0; } 20% { opacity: 1; } to { transform: translateY(-80px); opacity: 0; } }
@keyframes dustmove { to { background-position: 44px -28px; } }
@keyframes lungeR { 40% { transform: translateX(12px) scale(1.05); } }
@keyframes lungeL { 40% { transform: translateX(-12px) scale(1.05); } }
@keyframes die { to { opacity: 0.35; filter: grayscale(1); transform: scale(0.92) rotate(-3deg); } }
@keyframes bob { to { transform: translateY(-7px) scale(1.08); } }
@keyframes wipeIn { to { transform: scaleX(1); } }
@keyframes wipeOut { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes cardlife { 0% { opacity: 0; } 18% { opacity: 1; } 72% { opacity: 1; } 100% { opacity: 0; } }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-18deg) scale(1.7); }
  35% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -62%) rotate(-8deg) scale(1); }
}
@keyframes cut {
  0% { opacity: 0; transform: translateX(-28px); }
  22% { opacity: 1; transform: none; }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateX(24px); }
}
@keyframes spark { to { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes slam { from { transform: scale(1.2) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pop { from { transform: rotate(-16deg) scale(1.4); opacity: 0; } to { transform: rotate(-8deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .portrait, .portrait::before, .seal .breath, .banner, .dust i, .road button.now, .orb, .field::before {
    animation: none !important;
  }
}
@media (max-width: 860px) {
  .side { width: 180px; }
  .menu { width: 148px; }
  .story { grid-template-columns: 150px 1fr 220px; }
  h1 { font-size: 24px; }
}

.playfield {
  flex: 1; min-height: 0; position: relative; overflow: hidden;
  background: #1c140f;
}
.playfield::after {
  content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 46%, rgba(16, 8, 6, 0.38) 100%);
}
.world { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.world .sky { position: absolute; inset: 0 0 40% 0; background: linear-gradient(180deg, #E07EB4, #AEF3D8 72%, #94E4C3); }
.world .cloud { position: absolute; height: 12px; border-radius: 20px; background: rgba(255, 255, 255, 0.62); }
.world .cloud.c1 { width: 78px; top: 12%; left: 22%; }
.world .cloud.c2 { width: 48px; top: 18%; left: 52%; }
.world .cloud::after, .world .cloud::before {
  content: ""; position: absolute; background: rgba(255, 255, 255, 0.62); border-radius: 50%;
}
.world .cloud::before { width: 22px; height: 22px; left: 12px; top: -12px; }
.world .cloud::after { width: 16px; height: 16px; left: 32px; top: -8px; }
.world .hill {
  position: absolute; left: -8%; right: -8%; top: 28%; height: 20%;
  background: radial-gradient(70% 100% at 30% 100%, rgba(126, 150, 92, 0.85), transparent 72%),
    radial-gradient(60% 100% at 78% 100%, rgba(196, 122, 64, 0.55), transparent 70%);
}
.world .treeline {
  position: absolute; left: 0; right: 0; top: 24%; height: 22%;
  background:
    radial-gradient(circle at 6% 80%, #28C45D 0 14px, transparent 15px),
    radial-gradient(circle at 12% 58%, #4AE0A3 0 20px, transparent 21px),
    radial-gradient(circle at 18% 78%, #28A84A 0 12px, transparent 13px),
    radial-gradient(circle at 86% 62%, #3AD08C 0 22px, transparent 23px),
    radial-gradient(circle at 94% 80%, #28C45D 0 14px, transparent 15px);
}
.world .wall {
  position: absolute; right: 1%; top: 16%; width: 44%; height: 34%;
  background: linear-gradient(#A6D2C1, #4A6D5C);
  clip-path: polygon(0 100%, 0 42%, 5% 42%, 5% 16%, 16% 16%, 16% 38%, 42% 30%, 54% 10%, 72% 10%, 72% 32%, 100% 36%, 100% 100%);
  box-shadow: inset 0 -18px 0 rgba(0, 0, 0, 0.18);
}
.world .keep {
  position: absolute; right: 18%; top: 30%; width: 64px; height: 20%;
  background: #16110e; border-radius: 36px 36px 0 0;
  box-shadow: 0 0 0 6px #628D78;
}
.world .watch {
  position: absolute; left: 11%; top: 14%; width: 52px; height: 40%;
  background: linear-gradient(#608D73, #243A2E);
  clip-path: polygon(16% 100%, 16% 24%, 0 24%, 50% 0, 100% 24%, 84% 24%, 84% 100%);
}
.world .watch::after {
  content: ""; position: absolute; left: 28%; right: 28%; top: 36%; height: 14%;
  background: #1a140f; box-shadow: 0 18px 0 #1a140f;
}
.world .hut {
  position: absolute; left: 0; top: 30%; width: 108px; height: 24%;
  background: linear-gradient(#427A5C, #243D2E);
  clip-path: polygon(8% 100%, 0 48%, 50% 8%, 100% 48%, 92% 100%);
}
.world .flag {
  position: absolute; left: 20%; top: 16%; width: 28px; height: 70px; z-index: 1;
  background: #249A30; color: #f6ecdc;
  display: flex; justify-content: center; padding-top: 6px;
  transform-origin: top center; animation: sway 3.6s ease-in-out infinite;
  box-shadow: 3px 8px 0 rgba(0, 0, 0, 0.15);
}
.world .flag b { font-family: "Songti SC", "STSong", serif; font-size: 16px; font-weight: 600; }
.world .flag.wei { background: #249A30; }
.world .flag.shu { background: #463F6B; }
.world .flag.wu { background: #268C34; }
.world .flag.qun { background: #308A64; }
.world .dirt {
  position: absolute; left: 0; right: 0; bottom: 0; height: 48%;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(232, 206, 160, 0.45), transparent 60%),
    linear-gradient(180deg, #7AD2B1, #448D69 42%, #326A4D);
}
.world .dirt::after {
  content: ""; position: absolute; left: 22%; right: 16%; top: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(244, 226, 190, 0.35), transparent);
}
.world .fence {
  position: absolute; left: 0; bottom: 7%; width: 15%; height: 26px; z-index: 1;
  border-top: 4px solid #306B4B; border-bottom: 4px solid #306B4B;
  background: repeating-linear-gradient(90deg, #1F4A33 0 4px, transparent 4px 14px);
}
.world .barrel {
  position: absolute; left: 5%; bottom: 6%; width: 18px; height: 24px; z-index: 1;
  border-radius: 3px;
  background: linear-gradient(90deg, #1C5A33, #52C48C 46%, #164A29);
  box-shadow: inset 0 5px 0 rgba(231, 196, 154, 0.75), inset 0 -5px 0 rgba(231, 196, 154, 0.5);
}
.world .firepit { display: none; position: absolute; left: 46%; bottom: 18%; width: 26px; height: 16px; z-index: 1; }
.world.bg-camp .firepit { display: block; }
.world .firepit::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: #245C3C; border-radius: 2px;
}
.world .firepit::after {
  content: ""; position: absolute; left: 4px; bottom: 5px; width: 18px; height: 18px;
  background: radial-gradient(circle at 50% 80%, #ffe7a8, #30E073 42%, transparent 72%);
  animation: flame 0.45s ease-in-out infinite alternate;
}
.world .mote {
  position: absolute; top: 8%; left: 18%; width: 7px; height: 4px; border-radius: 40%;
  background: #3AE07D; opacity: 0.85; animation: leaf 8s linear infinite;
}
.world .mote.m2 { left: 40%; animation-delay: -3s; background: #96E7CC; }
.world .mote.m3 { left: 68%; animation-delay: -5s; background: #28C45D; }
.world.bg-camp .sky { background: linear-gradient(180deg, #7AF2B2, #48C46C 50%, #306A41); }
.world.bg-night .sky { background: linear-gradient(180deg, #2E141A, #503A34 68%, #385A47); }
.world.bg-night .dirt { background: linear-gradient(180deg, #384A40, #16241C); }
.world.bg-night .cloud { opacity: 0.22; }
.world.bg-fire .sky { background: linear-gradient(180deg, #60F0A2, #3EC456 58%, #286A35); }
.world.bg-fire .dirt { background: linear-gradient(180deg, #48A86A, #245A31 50%, #142A18); }
.world.bg-river .sky { background: linear-gradient(180deg, #D88EC3, #d7e7ea 60%, #B0E7D4); }
.world.bg-river .dirt { background: linear-gradient(180deg, #6AC4A2 0 32%, #7C2F6E 34%, #561C49 100%); }
.world.bg-court .wall { width: 72%; left: 14%; right: auto; }
.world.bg-court .sky { background: linear-gradient(180deg, #A6D9C8, #9AC4B5 70%, #68B08A); }
.splash-field > .splash {
  position: absolute; inset: 0; z-index: 5; pointer-events: none;
  justify-content: center; padding-top: 0;
  background: linear-gradient(180deg, rgba(12, 8, 6, 0.55), rgba(12, 8, 6, 0.12) 42%, rgba(12, 8, 6, 0.55));
}
.playfield > .origin-wrap {
  position: relative; z-index: 4; height: 100%;
  background: linear-gradient(180deg, rgba(16, 10, 8, 0.18), rgba(16, 10, 8, 0.72));
}
.scene { background: #346A4F; }
.scene .herofig { bottom: 34%; z-index: 2; }
.scene .campmates {
  position: absolute; z-index: 2; left: 8%; bottom: 30%;
  display: flex; gap: 4px; pointer-events: none;
}
.scene .campmates .fig { transform: scale(0.72); transform-origin: center bottom; }
.field.stage-field {
  display: block; position: absolute; inset: 0; z-index: 4;
  background: none; grid-template-columns: none;
}
.field.stage-field::before { display: none; }
.stage-field .vs { display: none; }
.stage-field .cell {
  position: absolute; width: 84px; height: 112px;
  background: none; border: 0; box-shadow: none; overflow: visible;
  display: block; padding: 0;
}
.stage-field .cell.unit { cursor: pointer; }
.stage-field .slot-empty { background: none; border: 0; }
.stage-field .slot-empty::after {
  content: ""; position: absolute; left: 50%; bottom: 16px; width: 48px; height: 16px;
  margin-left: -24px; border-radius: 50%;
  border: 1px dashed rgba(231, 203, 150, 0.75);
  background: rgba(231, 203, 150, 0.14);
}
.stage-field .hp {
  position: absolute; top: 2px; left: 50%; width: 50px; height: 7px; margin-left: -25px;
  border-radius: 4px; background: rgba(28, 16, 12, 0.78);
  border: 1px solid rgba(0, 0, 0, 0.45); overflow: hidden; z-index: 5;
}
.stage-field .p-front .hp i, .stage-field .p-mid1 .hp i, .stage-field .p-mid2 .hp i,
.stage-field .p-back1 .hp i, .stage-field .p-back2 .hp i {
  background: linear-gradient(90deg, #324E8A, #8AC4E5);
}
.stage-field .e-front .hp i, .stage-field .e-mid1 .hp i, .stage-field .e-mid2 .hp i,
.stage-field .e-back1 .hp i, .stage-field .e-back2 .hp i {
  background: linear-gradient(90deg, #28A335, #5CEF6F);
}
.stage-field .hpnum {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0, 0, 0, 0); border: 0;
}
.stage-field .cell b {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  white-space: nowrap; font-size: 11px; font-weight: 700; color: #fff8ee;
  text-shadow: 0 1px 2px #000, 0 0 4px #000;
}
.stage-field .p-back1 { left: 3%; bottom: 42%; }
.stage-field .p-back2 { left: 8%; bottom: 32%; }
.stage-field .p-mid1 { left: 14%; bottom: 52%; }
.stage-field .p-mid2 { left: 18%; bottom: 36%; }
.stage-field .p-front { left: 30%; bottom: 40%; }
.stage-field .e-front { right: 28%; bottom: 42%; }
.stage-field .e-mid1 { right: 16%; bottom: 54%; }
.stage-field .e-mid2 { right: 20%; bottom: 40%; }
.stage-field .e-back1 { right: 6%; bottom: 50%; }
.stage-field .e-back2 { right: 10%; bottom: 38%; }
.warfield .p-back1 { left: 3%; bottom: max(46%, 132px); }
.warfield .p-back2 { left: 8%; bottom: max(32%, 124px); }
.warfield .p-mid1 { left: 15%; bottom: max(54%, 158px); }
.warfield .p-mid2 { left: 19%; bottom: max(34%, 120px); }
.warfield .p-front { left: 29%; bottom: max(40%, 140px); }
.warfield .e-front { right: 29%; bottom: max(40%, 140px); }
.warfield .e-mid1 { right: 17%; bottom: max(54%, 158px); }
.warfield .e-mid2 { right: 21%; bottom: max(34%, 120px); }
.warfield .e-back1 { right: 5%; bottom: max(48%, 146px); }
.warfield .e-back2 { right: 9%; bottom: max(32%, 124px); }
.talkfield .p-front { left: 24%; bottom: 30%; }
.talkfield .p-mid1 { left: 6%; bottom: 46%; }
.talkfield .p-mid2 { left: 12%; bottom: 22%; }
.talkfield .p-back1 { left: 1%; bottom: 36%; }
.talkfield .p-back2 { left: 5%; bottom: 16%; }
.talkfield .e-front { right: 34%; bottom: 44%; }
.talkfield .e-mid1 { right: 24%; bottom: 56%; }
.talkfield .e-mid2 { right: 30%; bottom: 50%; }
.talkfield .e-back1 { right: 16%; bottom: 52%; }
.talkfield .e-back2 { right: 20%; bottom: 40%; }
.formfield .e-front { right: 46%; }
.formfield .e-mid1 { right: 40%; }
.formfield .e-mid2 { right: 42%; }
.formfield .e-back1 { right: 36%; }
.formfield .e-back2 { right: 38%; }
.stage-field .p-front .fig { transform: scale(1.16); transform-origin: 50% 100%; }
.stage-field .e-front .fig { transform: scale(1.12) scaleX(-1); transform-origin: 50% 100%; }
.stage-field .cell.lunge { z-index: 8; }
.stage-field .unit.focus::before {
  content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px;
  background: #3AE24E; transform: rotate(45deg); box-shadow: 0 0 0 2px rgba(255, 248, 240, 0.85); z-index: 6;
}
.stage-field .unit.pick { outline: none; }
.stage-field .unit.pick::after {
  content: ""; position: absolute; left: 50%; bottom: 14px; width: 48px; height: 16px; margin-left: -24px;
  border-radius: 50%; border: 2px solid var(--gold); box-shadow: 0 0 10px rgba(231, 203, 150, 0.85);
}
.fig {
  width: 52px; height: 74px; margin: 14px auto 0; position: relative;
  filter: drop-shadow(0 8px 2px rgba(0, 0, 0, 0.35));
  animation: idle 2.8s ease-in-out infinite;
}
.fig::before {
  content: ""; position: absolute; left: 8px; right: 8px; bottom: 2px; height: 8px;
  background: rgba(0, 0, 0, 0.28); border-radius: 50%;
}
.fig .hd {
  position: absolute; z-index: 4; left: 17px; top: 0; width: 16px; height: 16px; border-radius: 50%;
  background: #A4EFC9; box-shadow: 0 0 0 1px rgba(60, 36, 24, 0.35);
}
.fig .hd::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: -3px; height: 7px;
  background: #0F2416; border-radius: 6px 6px 2px 2px;
}
.fig .bd {
  position: absolute; z-index: 3; left: 12px; top: 16px; width: 26px; height: 24px;
  border-radius: 8px 8px 5px 5px; background: #407A54;
}
.fig .lg {
  position: absolute; z-index: 2; left: 15px; top: 38px; width: 7px; height: 20px;
  border-radius: 3px; background: #223E2C; box-shadow: 12px 0 0 #223E2C;
}
.fig .cp { display: none; position: absolute; z-index: 1; left: 8px; top: 18px; width: 32px; height: 34px; border-radius: 12px 12px 16px 16px; }
.fig .wp, .fig .sh { position: absolute; z-index: 5; }
.fig.face-l { transform: scaleX(-1); }
.fig.cape-linen .cp { display: block; background: #92CBB9; }
.fig.cape-leather .cp { display: block; background: #348A55; }
.fig.cape-iron .cp { display: block; background: #B08A9F; }
.fig.cape-officer .cp { display: block; background: #2C9A3A; }
.fig.cape-general .cp { display: block; background: linear-gradient(#A4F0D8, #268C34); }
.ft-sword .bd { background: linear-gradient(#4E8D6B, #305C41); }
.ft-sword .sh {
  left: -2px; top: 18px; width: 12px; height: 16px; border-radius: 2px 6px 6px 2px;
  background: #348D63; box-shadow: inset 0 0 0 2px #96E7CC;
}
.ft-sword .wp {
  right: -4px; top: 6px; width: 3px; height: 30px; border-radius: 2px;
  background: linear-gradient(#e7ebef, #8d939b); transform: rotate(16deg);
}
.ft-spear .bd { background: #3E6E5B; }
.ft-spear .wp { right: -8px; top: -10px; width: 3px; height: 62px; background: #74C4A6; border-radius: 2px; }
.ft-spear .wp::after {
  content: ""; position: absolute; top: -7px; left: -3px;
  border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 8px solid #e4e8ee;
}
.ft-archer .bd { background: linear-gradient(#3EC456, #f3e6d4 72%); }
.ft-archer .hd::after { height: 9px; border-radius: 40% 40% 20% 20%; }
.ft-archer .wp {
  right: -2px; top: 12px; width: 16px; height: 22px;
  border: 2px solid #A8E7D4; border-left-color: transparent; border-radius: 0 14px 14px 0; background: transparent;
}
.ft-horse { width: 74px; height: 68px; }
.ft-horse .bd { left: 8px; top: 24px; width: 44px; height: 16px; border-radius: 10px 16px 8px 8px; background: #306B47; }
.ft-horse .lg { left: 12px; top: 38px; height: 14px; box-shadow: 12px 0 0 #223E2C, 26px 0 0 #223E2C, 38px 0 0 #223E2C; }
.ft-horse .hd { left: 44px; top: 8px; }
.ft-horse .wp { right: 2px; top: 2px; width: 3px; height: 28px; background: #e4e8ee; transform: rotate(-18deg); }
.ft-siege { width: 72px; }
.ft-siege .bd { left: 2px; top: 30px; width: 52px; height: 14px; border-radius: 3px; background: #365C47; }
.ft-siege .lg { left: 8px; top: 42px; width: 10px; height: 10px; border-radius: 50%; background: #0F2418; box-shadow: 30px 0 0 #0F2418; }
.ft-siege .hd { left: 22px; top: 8px; }
.ft-siege .wp { left: 18px; top: 2px; width: 18px; height: 8px; background: #487A63; border-radius: 2px; }
.stage-field .seal {
  position: absolute; left: -2px; top: 10px; z-index: 6;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--gold); background: rgba(20, 12, 8, 0.62);
  display: flex; align-items: center; justify-content: center;
  box-shadow: none; font-size: 12px;
}
.stage-field .seal .mp-icon { width: 14px; height: 14px; }
.stage-field .seal .breath { animation: breath 3.2s ease-in-out infinite; display: flex; }
.phud {
  position: absolute; z-index: 7; top: 8px; left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  display: flex; justify-content: space-between; align-items: flex-start; pointer-events: none;
}
.phud-l, .phud-r { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.phud .avatar { width: 46px; height: 46px; }
.phud .avatar .mp-icon { width: 26px; height: 26px; }
.phud-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.phud-meta b { font-size: 14px; text-shadow: 0 1px 2px #000; }
.phud-meta span { font-size: 11px; color: #f3e6d2; text-shadow: 0 1px 2px #000; }
.gbar {
  width: 118px; height: 8px; border-radius: 6px; overflow: hidden;
  background: rgba(28, 16, 12, 0.72); border: 1px solid rgba(0, 0, 0, 0.35);
}
.gbar i { display: block; height: 100%; background: linear-gradient(90deg, #324E8A, #8AC4E5); }
.iconbtn.round {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(24, 16, 12, 0.72); border: 1px solid rgba(231, 203, 150, 0.45);
}
.countchip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(24, 16, 12, 0.72); border: 1px solid rgba(231, 203, 150, 0.4);
  color: var(--gold); border-radius: 999px; padding: 6px 10px; font-size: 13px;
}
.countchip .mp-icon { width: 16px; height: 16px; }
.playfield .strip {
  position: absolute; z-index: 7; top: 58px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 52%; pointer-events: none;
  background: rgba(16, 10, 8, 0.55); border: 1px solid rgba(231, 203, 150, 0.22);
  border-radius: 999px; padding: 3px 10px;
}
.playfield .warband {
  position: absolute; z-index: 6; top: 86px; left: 50%; transform: translateX(-50%);
  width: min(420px, 42%); pointer-events: none;
  background: rgba(16, 10, 8, 0.4); border-radius: 999px; padding: 4px 8px;
}
.dlg {
  position: absolute; z-index: 6; right: 16px; bottom: 14px; width: min(340px, 40%);
  display: flex; flex-direction: column; gap: 8px; max-height: 70%;
}
.dlg .choicebox { background: transparent; border: 0; box-shadow: none; padding: 0; overflow: auto; }
.bubble {
  background: #f7f1e6; color: #182C21; border-radius: 16px; padding: 10px 14px 8px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28); position: relative;
}
.bubble::after {
  content: ""; position: absolute; left: 28px; bottom: -8px;
  border-width: 8px 8px 0 0; border-style: solid; border-color: #f7f1e6 transparent transparent transparent;
}
.bubble .who { color: #328A4C; font-size: 12px; letter-spacing: 0.06em; }
.bubble #line {
  margin: 4px 0; min-height: 2.6em; font-size: 16px; line-height: 1.55;
  font-family: "Songti SC", "STSong", "SimSun", serif;
}
.bubble .hint { font-size: 11px; color: #588D72; }
.dlg .choice {
  background: linear-gradient(180deg, #f6e6c4, #7AE2C2);
  color: #143A27; border: 1px solid #5AC9A3; border-radius: 999px;
  box-shadow: 0 3px 0 #3DA67E; min-height: 46px; padding: 6px 14px 6px 8px;
}
.dlg .choice::after {
  content: ""; width: 8px; height: 8px; margin-left: auto; flex: none;
  border-right: 2px solid #286A4B; border-bottom: 2px solid #286A4B; transform: rotate(-45deg);
}
.dlg .cico { background: rgba(90, 48, 22, 0.1); color: #226A3B; border-radius: 50%; }
.dlg .choice em { background: #268C34; color: #fff8f2; }
.dlg .choice.picked { filter: brightness(1.06); }
.dlg .btn {
  border-radius: 999px; min-height: 46px;
  background: linear-gradient(180deg, #f6e6c4, #7AE2C2); color: #143A27;
  box-shadow: 0 3px 0 #3DA67E;
}
.glass {
  position: absolute; z-index: 6; top: 86px; right: 12px; bottom: 10px;
  width: min(230px, 34%); display: flex; flex-direction: column; gap: 8px; min-height: 0;
}
.glass .panel { padding: 10px; overflow: auto; }
.glass .taclist { display: flex; flex-direction: column; gap: 6px; flex: 1; min-height: 0; }
.playfield .bench {
  position: absolute; z-index: 6; left: 12px; bottom: 10px;
  right: calc(min(230px, 34%) + 22px); padding-bottom: 2px;
}
.playfield .log {
  position: absolute; z-index: 6; left: 12px; top: 62px; bottom: auto; flex: none;
  width: min(240px, 34%); max-height: 58px; pointer-events: none;
  background: rgba(16, 10, 8, 0.62);
}
.skilldock {
  position: absolute; z-index: 8; left: 10px; right: 10px; bottom: 8px; width: auto;
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end;
  gap: 4px 8px; padding: 6px 8px 8px;
  background: rgba(16, 10, 8, 0.82); border: 1px solid rgba(231, 203, 150, 0.28); border-radius: 14px;
}
.skilldock .timebar { flex: 1; min-width: 72px; width: auto; }
.skilldock .muted { width: 100%; margin: 0; text-align: right; }
.dockmeta { width: auto; text-align: right; font-size: 12px; color: var(--gold); text-shadow: 0 1px 2px #000; }
.skills { display: flex; flex-wrap: wrap; gap: 8px 8px; justify-content: flex-end; padding-bottom: 12px; }
.skill {
  width: 58px; height: 58px; border-radius: 50%; border: 2px solid #96E7CC; padding: 0;
  background: radial-gradient(circle at 40% 32%, #386A4B, #0F2416 72%);
  color: #f6e7c8; position: relative;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35), inset 0 0 0 3px rgba(231, 203, 150, 0.18);
}
.skill .mp-icon { width: 26px; height: 26px; }
.skill em {
  position: absolute; right: -2px; top: -2px; min-width: 16px; padding: 0 4px;
  background: #3EC456; color: #fff; border-radius: 999px; font-style: normal; font-size: 10px; line-height: 16px;
}
.skill span {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%);
  font-size: 10px; white-space: nowrap; color: #fff8ee; text-shadow: 0 1px 2px #000;
}
.skill.go {
  background: radial-gradient(circle at 40% 32%, #A8F0D8, #4AC498 48%, #226A3B);
  color: #0E2A12;
}
.skill.dim { filter: grayscale(0.45); opacity: 0.72; }
#portrait.cam-in .world, #portrait.cam-in .stage-field { animation: camScene 0.7s ease; }
@keyframes idle { 50% { margin-top: 17px; } }
@keyframes leaf { from { transform: translateY(-20px) rotate(0deg); opacity: 0; } 12% { opacity: 0.9; } to { transform: translateY(280px) rotate(70deg); opacity: 0; } }
@keyframes flame { to { transform: scaleY(1.18) translateY(-2px); } }
@keyframes camScene { from { transform: scale(1.07); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .fig, .world .flag, .world .mote, .world .firepit::after, #portrait.cam-in .world, #portrait.cam-in .stage-field { animation: none; }
}

.avatar { overflow: hidden; padding: 0; }
.avatar .face, .origin .face, .herofig .face, .fig.painted .face, .uchip .face, .btn .face {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 14%;
}
.avatar.lg { width: 54px; height: 70px; border-radius: 12px; }
.whoplayer { display: inline-flex; align-items: center; gap: 6px; }
.bubble .who { display: flex; align-items: center; gap: 8px; }
.origin .face {
  width: 100%; height: 112px; border-radius: 12px;
  border: 1px solid rgba(231, 203, 150, 0.4); margin-bottom: 8px;
}
.uchip { display: inline-flex; align-items: center; gap: 6px; }
.uchip .face, .btn .face {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
}
.herofig { width: 96px; }
.herofig .stand { background: none; box-shadow: none; height: auto; }
.herofig .face {
  width: 88px; height: 116px; margin: 0 auto; border-radius: 14px;
  border: 1px solid rgba(231, 203, 150, 0.65);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.45);
}
.fig.painted {
  width: 72px; height: 90px; margin: 8px auto 0; animation: none;
  filter: drop-shadow(0 10px 6px rgba(0, 0, 0, 0.45));
}
.fig.painted::before { display: none; }
.fig.painted .face {
  border-radius: 14px 14px 10px 10px;
  border: 1px solid rgba(231, 203, 150, 0.55);
  background: #223A2A;
}
.fig.painted.foe .face { border-color: rgba(196, 72, 56, 0.85); }
.stage-field .p-front .fig.painted { transform: scale(1.12); transform-origin: 50% 100%; }
.stage-field .e-front .fig.painted,
.stage-field .e-mid1 .fig.painted,
.stage-field .e-mid2 .fig.painted,
.stage-field .e-back1 .fig.painted,
.stage-field .e-back2 .fig.painted { transform: scale(1.02) scaleX(-1); transform-origin: 50% 100%; }
.stage-field .e-front .fig.painted { transform: scale(1.08) scaleX(-1); transform-origin: 50% 100%; }
.scene .campmates .fig.painted { transform: scale(0.86); transform-origin: center bottom; }
.world.plate {
  background-color: #102418;
  background-size: cover;
  background-position: center 40%;
}
.world.plate-battle { background-image: url("images/gen/bg_battle.jpg"); }
.world.plate-camp { background-image: url("images/gen/bg_camp.jpg"); }
.world.plate-city { background-image: url("images/gen/bg_city.jpg"); }
.world.plate-river { background-image: url("images/gen/bg_river.jpg"); }
.world.plate-court { background-image: url("images/gen/bg_court.jpg"); }
.world.plate-dust { background-image: url("images/gen/bg_dust.jpg"); }
.world.plate > .sky,
.world.plate > .cloud,
.world.plate > .hill,
.world.plate > .treeline,
.world.plate > .wall,
.world.plate > .keep,
.world.plate > .watch,
.world.plate > .hut,
.world.plate > .dirt,
.world.plate > .fence,
.world.plate > .barrel,
.world.plate > .firepit,
.world.plate > .mote,
.world.plate > .flag { display: none; }
.hall {
  position: relative; overflow: hidden; border-radius: 16px;
  background-color: #1a120e; background-size: cover; background-position: center;
}
.hall::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(14, 9, 7, 0.78), rgba(14, 9, 7, 0.62));
}
.hall > * { position: relative; z-index: 1; }
.hall-battle { background-image: url("images/gen/bg_battle.jpg"); }
.hall-camp { background-image: url("images/gen/bg_camp.jpg"); }
.hall-city { background-image: url("images/gen/bg_city.jpg"); }
.hall-river { background-image: url("images/gen/bg_river.jpg"); }
.hall-court { background-image: url("images/gen/bg_court.jpg"); }
.hall-dust { background-image: url("images/gen/bg_dust.jpg"); }
