:root{color-scheme:light;--ink:#20382d;--muted:#586758;--cream:#f4efdc;--line:#c5c6ab;--gold:#ccb378;--pine:#153a31;--serif:"Songti SC","STSong","Noto Serif CJK SC","SimSun",serif;font:15px/1.4 -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:#142c26}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
body{background:radial-gradient(ellipse at 22% 0,#345346 0,transparent 54%),linear-gradient(125deg,#162e26,#11251f 70%,#253c31)}
button,a{-webkit-tap-highlight-color:transparent}
button{font:inherit;color:inherit;cursor:pointer}
button:focus-visible,a:focus-visible{outline:3px solid #d89732;outline-offset:3px}
button{touch-action:manipulation}
button:disabled{cursor:default;opacity:.52}
button[hidden],[hidden]{display:none!important}
svg{width:21px;height:21px;display:block;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.icon-bank,.sr{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}
.game{width:min(100%,1190px);height:100vh;height:100dvh;min-height:370px;max-height:1080px;margin:0 auto;display:flex;flex-direction:column;padding:0 clamp(14px,3vw,44px) 22px}
.mast,.brand,.mast-tools,.battle-header,.campaign-info,.score,.command,.sheet-head,.actions{display:flex;align-items:center}
.mast{justify-content:space-between;color:#f8efd3;flex:none;height:74px}
.brand{gap:11px}.brand h1{margin:0;font:700 25px/1 var(--serif);letter-spacing:.11em}
.back,.icon-btn{display:grid;place-content:center;width:44px;height:44px;border:0;border-radius:8px;background:transparent;color:inherit;text-decoration:none}
.back{width:36px;margin-left:-5px}.mast-tools{gap:3px;color:#d6dfca}.seal{background:#994935;color:#f4dbb2;box-shadow:inset 0 0 0 2px #a35843,inset 0 0 0 3px #d49a73;display:grid;place-content:center;width:28px;height:35px;writing-mode:vertical-rl;font:700 13px/1 var(--serif);letter-spacing:1px;border-radius:3px;transform:rotate(-3deg)}
.table{background:var(--cream);border-radius:13px;flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;box-shadow:0 12px 45px #051a1385,0 0 0 1px #e6d9a35c}
.battle-header{justify-content:space-between;padding:0 25px;min-height:65px;gap:8px;background:linear-gradient(90deg,#f5efdc,#ebe8cf);box-shadow:inset 0 -1px #bcc29e}
.campaign-info{gap:17px;min-width:0}.campaign-info h2{margin:0;font:700 clamp(20px,2.5vw,29px)/1.22 var(--serif);letter-spacing:.065em}
#campaign{display:flex;align-items:center;gap:8px;white-space:nowrap;min-height:44px;border:0;padding:0 2px;background:transparent;font-size:14px;font-weight:650;color:#4c6150}
.chevron{width:6px;height:6px;transform:rotate(45deg) translateY(-2px);border:solid currentColor;border-width:0 1.5px 1.5px 0}
.score{gap:13px;flex:none;font-size:12px;color:#42564a}
.score span{display:flex;align-items:center;gap:5px;white-space:nowrap}
.score i,.key{width:9px;height:9px;border-radius:2px 5px 1px 1px;background:var(--side);display:inline-block}
.score b{font-size:18px;font-variant-numeric:tabular-nums;color:var(--ink)}
[data-owner="blue"]{--side:#277491}[data-owner="red"]{--side:#b9523d}[data-owner="gold"]{--side:#ab7719}
.field{position:relative;isolation:isolate;flex:1;min-height:0;background:#b4c48a;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none}
#board,#city-buttons{position:absolute;inset:0;width:100%;height:100%}
#city-buttons{pointer-events:none}
.city{position:absolute;width:45px;height:46px;margin:0;transform:translate(-50%,-50%);padding:0;background:transparent;border:0;border-radius:10px;pointer-events:auto}
.city:focus:not(:focus-visible){outline:none}.city:focus-visible{outline:3px dashed #ffef95;outline-offset:2px}
.announcement,.resume{position:absolute;z-index:2;left:50%;transform:translateX(-50%);color:#fff3c8;box-shadow:0 3px 15px #17372430}
.announcement{top:12px;background:#18382de8;padding:7px 17px;border:1px solid #e2c77e;border-radius:4px;pointer-events:none;font-weight:650;letter-spacing:.05em;white-space:nowrap}
.resume{top:44%;display:flex;gap:8px;align-items:center;background:#173a30;border:1px solid #f3d697;border-radius:7px;padding:12px 22px;font-weight:700}
.field:has(.resume:not([hidden]))::after{content:"";position:absolute;inset:0;background:#18332850;pointer-events:none}
.command{min-height:75px;gap:13px;padding:10px 21px 10px 25px;background:#f4efdc;box-shadow:inset 0 1px #abb58d}
.order-mark{background:#e4e5ce;width:39px;height:39px;border-radius:50%;display:grid;place-content:center;color:#356952;flex:none}
.order{flex:1;min-width:0}.order p{margin:0}.order p:first-child{font-weight:700;font-size:15px}.order p+p{margin-top:3px;color:#52604f;font-size:13px;line-height:1.35}
.clock{font:600 14px ui-monospace,SFMono-Regular,Menlo,monospace;color:#52604f;letter-spacing:.02em}
.text-btn,.command .icon-btn{border:1px solid #b9c1a6;background:#eeeedb}
.text-btn{border-radius:6px;min-height:42px;padding:0 10px;font-weight:650;font-size:13px}
dialog{border:1px solid #bba879;border-radius:12px;background:#f5f0df;color:var(--ink);width:min(calc(100% - 30px),445px);padding:0;max-height:88dvh;box-shadow:0 25px 75px #081e1a55}
dialog::backdrop{background:#10271ed1}
.sheet-inner{padding:22px 24px 25px}.sheet-head{justify-content:space-between;gap:8px;margin-bottom:12px}.sheet-head h2{margin:0;font:700 25px/1.2 var(--serif);letter-spacing:.05em}
.sheet-head button{margin:-6px -8px -6px 0}.sheet-copy{color:#4b5f50;margin:0 0 17px;line-height:1.7}
.tabs{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;background:#e1e2ce;padding:3px;border-radius:7px;margin-bottom:16px}
.tabs button{border:0;background:transparent;min-height:41px;border-radius:5px;font-weight:650}
.tabs button[aria-pressed="true"]{color:#f9f0d7;background:var(--pine)}
.map-list{display:grid;gap:7px}.map-item{border:1px solid #c3c6ad;border-radius:6px;background:#faf6e8;width:100%;text-align:left;display:flex;align-items:center;justify-content:space-between;gap:9px;padding:12px 14px}
.map-item strong,.map-item small{display:block}.map-item strong{font:700 19px/1.35 var(--serif)}.map-item small{color:#526656;margin-top:3px}.map-item i{font-style:normal;font-weight:650;font-size:12px;color:#46624e;white-space:nowrap}
.steps{padding-left:20px;line-height:1.65}.steps li+li{margin-top:7px}.steps b{color:#244e3d}
.actions{gap:9px;margin-top:18px;flex-wrap:wrap}.actions button{background:#eeedd7;border:1px solid #acb599;border-radius:6px;min-height:44px;padding:0 16px;font-weight:650}.actions .primary{background:var(--pine);color:#f6efd6;border-color:var(--pine)}
.result-stats{display:flex;gap:25px;border-block:1px solid var(--line);padding:13px 0;color:var(--muted)}.result-stats strong{display:block;color:var(--ink);font-size:22px}
@media(hover:hover){.mast .icon-btn:hover,.back:hover{background:#e5f1d51a}.map-item:not(:disabled):hover,.text-btn:hover,.command .icon-btn:hover{background:#dfe5cb}#campaign:hover{color:#103e2d}}
@media(max-width:650px){
 .game{padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px);max-height:none}
 .mast{height:51px;padding:0 10px}.brand{gap:8px}.brand h1{font-size:20px}.seal{width:21px;height:28px;font-size:10px}.back{width:32px}.mast-tools{gap:0}
 .table{border-radius:0;box-shadow:none}.battle-header{padding:0 14px;min-height:54px}.campaign-info{gap:10px}.campaign-info h2{font-size:20px;letter-spacing:.035em}#campaign{font-size:13px;gap:5px}
 .score{gap:8px;font-size:11px}.score span{gap:3px}.score b{font-size:15px}.score i{width:7px;height:8px}
 .command{min-height:67px;padding:8px 11px;gap:8px}.order-mark{width:30px;height:30px}.order-mark svg{width:16px}
 .order p:first-child{font-size:14px}.order p+p{font-size:12px;margin-top:1px}.clock{font-size:12px}.sheet-inner{padding:18px}.city{width:42px;height:43px}
}
@media(max-width:365px){.score{gap:5px}.score .faction-label{display:none}.command .order-mark{display:none}}
@media(max-height:550px) and (min-width:651px){.game{padding-bottom:0;min-height:280px}.mast{height:43px}.table{border-radius:0}.battle-header{min-height:42px}.campaign-info h2{font-size:20px}.command{min-height:42px;padding-block:2px}.order-mark{width:28px;height:28px}.order{display:flex;align-items:baseline;gap:12px}}
@media(max-height:550px) and (max-width:650px){.game{min-height:295px}.mast{height:42px}.battle-header{min-height:43px}.command{min-height:44px;padding-block:1px}}

/* Chapter navigation and the live field share the same ink and parchment palette. */
.battle-header{min-height:77px;background:linear-gradient(110deg,#f9f3dd,#ece9d3)}
#campaign{border:1px solid #bbbea1;border-radius:7px;padding:0 12px;gap:7px;min-height:41px;background:#f0efda;color:#304e3a}
#campaign svg{width:17px;height:17px}
.battle-caption{min-width:0}.battle-caption h2{line-height:1.18}
#stage-position{display:block;color:#645e43;font-size:12px;font-weight:650;letter-spacing:.05em;margin-bottom:4px}
.objective-bar{display:flex;align-items:center;gap:8px;min-height:31px;flex:none;background:#e3e5c9;color:#354d35;border-block:1px solid #bcc4a4;padding:3px 25px;font-size:13px}
.objective-bar svg{width:15px;height:15px;color:#826538;flex:none}.objective-bar p{margin:0;flex:1}.objective-bar span{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px;font-weight:650;color:#3d563f}
.command{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto auto;grid-template-rows:minmax(40px,auto) 33px;gap:2px 13px;min-height:90px;padding:6px 21px 4px 25px}
.order-mark{grid-column:1;grid-row:1}.order{grid-column:2;grid-row:1}.clock{grid-column:3;grid-row:1}#stop{grid-column:4;grid-row:1}#pause{grid-column:5;grid-row:1}
.command:has(#stop[hidden]){grid-template-columns:auto minmax(0,1fr) auto 0 auto;column-gap:7px}
.command-lower{grid-row:2;grid-column:1/-1;align-self:stretch;display:flex;align-items:center;border-top:1px solid #d9d9be}
.line-key,#reserve,#reserve>span,.line-key span{display:flex;align-items:center}
.line-key{gap:19px;font-size:12px;color:#566449}.line-key span{gap:5px}
.line-key i{display:inline-block;position:relative;width:21px;height:0}.line-key .attack-line{border-top:2px solid #995a43}.attack-line:after{content:"";position:absolute;right:-1px;top:-4px;transform:rotate(45deg);width:5px;height:5px;border:solid #995a43;border-width:1.5px 1.5px 0 0}
.line-key .supply-line{border-top:2px dashed #387b83}.line-key .target-key{width:9px;height:9px;border:2px solid #927535;transform:rotate(45deg);margin:0 4px 0 2px}
#reserve{height:100%;gap:5px;color:#42523f;font-size:13px}#reserve>span{gap:5px;margin-right:5px}#reserve svg{width:16px;height:16px}#reserve button{padding:0 12px;min-height:30px;border:1px solid transparent;border-radius:5px;background:transparent;color:#364d3c;font-size:13px;font-weight:650}#reserve button[aria-pressed=true]{background:#dce5ce;border-color:#98ae91}
dialog:has(.chapter-hero){width:min(calc(100% - 24px),600px)}.sheet-inner:has(.chapter-hero){padding-top:16px}
.chapter-hero{background:#1b3730 linear-gradient(105deg,#142e25 8%,#3a553c 85%);background-image:linear-gradient(90deg,#0d271de8 0%,#0c291bba 28%,#0f241b20 75%),url('./chapter-scroll.webp');background-size:cover;background-position:center 55%;color:#fff3cf;border:1px solid #8c8756;border-radius:8px;padding:14px 15px;margin-bottom:6px}
.chapter-top{display:flex;align-items:center;gap:8px}.chapter-top label{font-size:12px;color:#eee4b9}.chapter-top select{appearance:auto;color:#f8f0d8;color-scheme:dark;cursor:pointer;background:#1b382ded;font:650 16px var(--serif);border:1px solid #98a08190;border-radius:4px;padding:5px 7px;max-width:80%;min-height:37px}
.chapter-totals{margin:7px 0 0;color:#ecedd8;font-size:12px;letter-spacing:.02em}
.chapter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.stage-item{display:grid;grid-template-columns:32px minmax(0,1fr) auto;align-items:center;gap:7px;width:100%;min-height:55px;text-align:left;padding:7px 8px;border:1px solid #cac8aa;background:#faf6e8;border-radius:6px}
.stage-item[aria-current=true]{background:#e0e9d5;border-color:#789374}.stage-item.completed .stage-number{color:#2b6750;background:#e0e7d3}
.stage-number{display:grid;place-content:center;width:31px;height:33px;border-right:1px solid #d4d1b6;color:#685d3b;font:650 14px ui-monospace,monospace;background:#efecd7;border-radius:3px 0 0 3px}
.stage-item strong,.stage-item small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-item strong{font:700 16px/1.4 var(--serif);color:#264636}.stage-item small{font-size:11px;color:#59664e;margin-top:2px}
.stage-marker{font-style:normal;color:#52775b;font-size:12px;font-weight:bold}
.pager{display:flex;justify-content:space-between;align-items:center;gap:10px;margin:9px 0 5px;color:#56664e;font-size:12px}.pager button{padding:6px 12px;min-height:36px;border:1px solid #c9cbb2;border-radius:5px;background:#eeeedb;font-weight:650;color:#36513f}
.route-list{display:grid;gap:6px}.route-list button{min-height:44px;padding:7px 12px;text-align:left;border:1px solid #bdc3a4;border-radius:6px;background:#eeeedb;font-weight:650}.result-record{color:#456247;font-weight:650;margin:10px 0}
@media(hover:hover){.stage-item:hover,#campaign:hover{background:#e4e9d0}.tabs button:not([aria-pressed=true]):hover,#reserve button:not([aria-pressed=true]):hover{background:#e2e7cd}}
@media(max-width:650px){
 .battle-header{min-height:60px}.campaign-info{gap:11px}#stage-position{font-size:10px;margin-bottom:2px}#campaign{min-height:38px;padding:0 7px;gap:5px}#campaign svg{width:16px;height:16px}
 .objective-bar{min-height:27px;padding:3px 13px;font-size:12px;gap:6px}.objective-bar span{font-size:11px}
 .command{min-height:85px;grid-template-rows:minmax(39px,auto) 35px;padding:5px 11px 2px;gap:1px 6px}.command:has(#stop[hidden]){column-gap:4px}
 #stop{min-height:38px;padding:0 8px}#pause{width:41px;height:39px}.command .order p+p{font-size:11px}
 #reserve button{min-height:32px}.line-key{gap:14px;font-size:11px}
 .sheet-inner:has(.chapter-hero){padding:15px 13px}.sheet-head:has(+ #sheet-content .chapter-hero){margin-bottom:8px}.chapter-hero{padding:10px 11px}.stage-item{gap:4px;padding:6px 4px;grid-template-columns:27px minmax(0,1fr) auto}.stage-number{width:26px;font-size:12px}.stage-item strong{font-size:15px}.chapter-grid{gap:5px}
}
@media(max-width:365px){.campaign-info{gap:7px}.command,.command:has(#stop[hidden]){grid-template-columns:0 minmax(0,1fr) auto auto auto}.command:has(#stop[hidden]){grid-template-columns:0 minmax(0,1fr) auto 0 auto}.stage-item strong{font-size:14px}.stage-item{min-height:49px}.score .faction-label{display:inline}}
@media(max-height:550px) and (min-width:600px){
 .battle-header{min-height:40px}.battle-caption{display:flex;align-items:baseline;gap:9px}.objective-bar{min-height:22px}.command{display:flex;min-height:43px}.command-lower{border:0}.line-key{display:none}
 .command-lower:has(#reserve[hidden]){display:none}#campaign{min-height:34px}.table{flex:1}
}
.command-lower .announcement{position:static;transform:none;border:none;border-left:3px solid #ae6741;background:#f1e4c9;color:#753d2c;border-radius:0 3px 3px 0;box-shadow:none;font-size:12px;font-weight:650;padding:3px 9px;overflow:hidden;text-overflow:ellipsis;letter-spacing:.02em}
.command-lower .announcement[data-tone=success]{background:#e1ead5;color:#355a42;border-color:#68916c}
.command-lower:has(.announcement:not([hidden])) .line-key,.command-lower:has(#reserve:not([hidden])) .announcement{display:none}
@media(max-width:365px){#stage-position{max-width:116px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.battle-caption h2{font-size:17px}.score{gap:5px}.score i{display:none}}
