:root{--sky-top:#9ec8e4;--sky-bottom:#e4d8c4;--ink:#1c2430;--hint-bg:#fff8ece6;--brand:#8b2e24;--accent:#c9a227;color:var(--ink);font-family:Nunito,Trebuchet MS,Segoe UI,sans-serif}*{box-sizing:border-box;margin:0;padding:0}html,body,#app{background:linear-gradient(180deg, var(--sky-top), var(--sky-bottom));touch-action:none;width:100%;height:100%;overflow:hidden}#game{outline:none;width:100%;height:100%;display:block}#hint{background:var(--hint-bg);border:2px solid var(--ink);pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:5;border-radius:.85rem;flex-direction:column;gap:.15rem;max-width:min(22rem,100vw - 2rem);padding:.65rem .9rem;display:flex;position:fixed;bottom:1.1rem;left:1.1rem}#hint .brand{letter-spacing:.02em;color:var(--brand);font-size:.95rem;font-weight:800}#hint .keys{opacity:.9;font-size:.82rem}#hint .status{color:var(--brand);min-height:1em;font-size:.78rem;font-weight:700}.battle-badge{z-index:7;color:#fff8ec;border:2px solid var(--ink);letter-spacing:.08em;pointer-events:none;background:#8b2e24eb;border-radius:.75rem;padding:.4rem 1.1rem;font-size:.95rem;font-weight:800;position:fixed;top:1rem;left:50%;transform:translate(-50%);box-shadow:0 3px #0000001f}.battle-badge[hidden]{display:none}.army-cmd-hud{z-index:7;border:2px solid var(--ink);color:var(--ink);pointer-events:none;text-align:center;background:#fff8eceb;border-radius:.7rem;flex-direction:column;gap:.15rem;max-width:min(28rem,100vw - 2rem);padding:.45rem .9rem;font-size:.78rem;font-weight:700;display:flex;position:fixed;top:3.4rem;left:50%;transform:translate(-50%);box-shadow:0 3px #00000014}.army-cmd-hud[hidden]{display:none}.angry-panel{z-index:7;border:2px solid var(--ink);pointer-events:none;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background:#fff8ece6;border-radius:.75rem;align-items:center;gap:.45rem;min-width:9.5rem;padding:.4rem .65rem;display:flex;position:fixed;top:1rem;right:1.1rem}.angry-label{color:#a32a18;font-size:.72rem;font-weight:800}.angry-track{background:#1c24301f;border:1px solid #1c243040;border-radius:999px;flex:1;height:.55rem;overflow:hidden}.angry-fill{border-radius:inherit;background:linear-gradient(90deg,#e85a2a,#ff3b1a 55%,#ffd24a);width:0%;height:100%;transition:width .15s ease-out}.angry-panel.ready .angry-fill{animation:.55s ease-in-out infinite alternate angry-pulse}.angry-ready{color:#a32a18;white-space:nowrap;font-size:.68rem;font-weight:800}.angry-ready[hidden]{display:none}@keyframes angry-pulse{0%{filter:brightness()}to{filter:brightness(1.35)}}#speech-layer{pointer-events:none;z-index:6;position:fixed;inset:0;overflow:hidden}.speech-bubble{border:2px solid var(--ink);max-width:11rem;color:var(--ink);white-space:normal;background:#fffcf5f0;border-radius:.65rem;padding:.35rem .55rem;font-size:.78rem;font-weight:700;line-height:1.25;position:absolute;top:0;left:0;box-shadow:0 2px #00000014}#touch-ui{z-index:8;pointer-events:none;display:none;position:fixed;inset:0}.dpad{pointer-events:none;width:10.2rem;height:10.2rem;position:absolute;bottom:5.5rem;left:.85rem}.dpad .pad{pointer-events:auto;color:#1c2430d9;-webkit-backdrop-filter:blur(3px);background:#fff8ec6b;border:2px solid #1c24308c;border-radius:.7rem;place-items:center;width:2.7rem;height:2.7rem;padding:0;font-size:.85rem;font-weight:800;display:grid;position:absolute}.dpad .pad svg,.actions .act svg{fill:currentColor;pointer-events:none;width:1.35rem;height:1.35rem;display:block}.dpad .pad:active{background:#fff8ecb8}.hex-pad .pad-center{pointer-events:none;opacity:.55;border-style:dashed}#pad-nw{top:.15rem;left:1.35rem}#pad-ne{top:.15rem;right:1.35rem}#pad-w{top:3.55rem;left:.1rem}.hex-pad .pad-center{top:3.55rem;left:3.7rem}#pad-e{top:3.55rem;right:.1rem}#pad-sw{bottom:.15rem;left:1.35rem}#pad-se{bottom:.15rem;right:1.35rem}.actions{pointer-events:none;grid-template-columns:1fr 1fr;gap:.55rem;max-width:7.2rem;display:grid;position:absolute;bottom:5.5rem;right:.85rem}.actions .act{pointer-events:auto;color:#1c2430e6;-webkit-backdrop-filter:blur(3px);background:#fff8ec6b;border:2px solid #1c24308c;border-radius:999px;place-items:center;width:3.2rem;height:3.2rem;padding:0;display:grid}.actions .act:active{background:#fff8ecbf}.actions .atk{background:#e8785a73}.actions .blk{background:#78a0d273}.actions .mount{background:#b48c5073}@media (width<=900px),(pointer:coarse){#touch-ui{display:block}#hint{max-width:calc(100vw - 1.3rem);inset:.65rem auto auto .65rem}#hint .keys{font-size:.72rem}}@media (width<=640px){#hint{padding:.5rem .7rem}}.mode-toggle{z-index:20;border:2px solid var(--ink);color:var(--brand);cursor:pointer;background:#fff8ecf0;border-radius:.75rem;padding:.45rem .9rem;font-family:inherit;font-size:.9rem;font-weight:800;position:fixed;top:1rem;left:1.1rem;box-shadow:0 3px #0000001a}.mode-toggle:active{transform:translateY(1px);box-shadow:0 2px #0000001a}.court-hud{z-index:18;background:radial-gradient(at 20% 10%,#c9a2272e,#0000 45%),radial-gradient(at 80% 90%,#8b2e2438,#0000 50%),linear-gradient(165deg,#2a3340 0%,#1a222c 45%,#3a2a22 100%);place-items:center;padding:1rem;display:grid;position:fixed;inset:0;overflow:auto}.court-hud[hidden]{display:none!important}.court-panel{border:2px solid var(--ink);width:min(56rem,100%);color:var(--ink);background:linear-gradient(#fff8ec 0%,#f0e4d0 100%);border-radius:1rem;flex-direction:column;gap:.85rem;padding:1.1rem 1.25rem 1.25rem;display:flex;box-shadow:0 12px 40px #00000059}.admin-body{grid-template-columns:minmax(14rem,1.05fr) minmax(16rem,1.15fr);align-items:start;gap:.85rem;display:grid}.admin-side{flex-direction:column;gap:.7rem;min-width:0;display:flex}.court-orders{margin-top:-.2rem}.orders-bar{background:#ffffff8c;border:2px solid #1c243033;border-radius:.65rem;flex-wrap:wrap;align-items:baseline;gap:.5rem .85rem;padding:.45rem .65rem;display:flex}.orders-bar.empty{background:#ffdcd2b3;border-color:#a32a18}.orders-label{opacity:.75;font-size:.75rem;font-weight:800}.orders-val{color:var(--brand);font-size:1.05rem;font-weight:900}.orders-hint{opacity:.8;margin-left:auto;font-size:.75rem;font-weight:700}.nmap-wrap{background:linear-gradient(#ffffff8c,#f0e4d059),repeating-linear-gradient(-18deg,#0000,#0000 10px,#1c243008 10px 11px);border:2px solid #1c243033;border-radius:.75rem;padding:.55rem .6rem .45rem}.nmap-title{opacity:.85;margin-bottom:.3rem;font-size:.78rem;font-weight:800}.nmap-svg{aspect-ratio:1/.92;border-radius:.45rem;width:100%;display:block}.nmap-sea{fill:url(#nmap-land);stroke:#1c243040;stroke-width:.6px}.nmap-china{fill:#78965a59;stroke:#1c243059;stroke-width:.5px}.nmap-edge{stroke:#1c243047;stroke-width:.45px}.nmap-node circle,.nmap-node polygon{fill:#fff8ec;stroke:var(--ink);stroke-width:.45px}.nmap-node text{fill:var(--ink);pointer-events:none;font-size:3.2px;font-weight:800}.nmap-node.active circle,.nmap-node.active polygon{fill:#c9a227;stroke:#6b4e0a}.nmap-node.war circle,.nmap-node.war polygon{fill:#8b2e24;stroke:#3a1210}.nmap-node.warfield circle,.nmap-node.warfield polygon{stroke-width:.7px}.nmap-node.foe circle,.nmap-node.foe polygon{fill:#d8c8b8;stroke:#5a4030}.nmap-node.ally circle,.nmap-node.ally polygon{fill:#c8d8e8}.nmap-legend{opacity:.8;flex-wrap:wrap;gap:.55rem;margin-top:.35rem;font-size:.68rem;font-weight:700;display:flex}.nmap-legend .leg{border:1.5px solid var(--ink);vertical-align:-.05rem;border-radius:50%;width:.55rem;height:.55rem;margin-right:.2rem;display:inline-block}.nmap-legend .leg.active{background:#c9a227}.nmap-legend .leg.war{background:#8b2e24}.nmap-legend .leg.warfield{background:#fff8ec;border-radius:.1rem}.nmap-legend .leg.foe{background:#d8c8b8}.off-job{opacity:.75;font-size:.62rem;font-weight:700}button.linkish,.linkish{font:inherit;color:inherit;cursor:pointer;text-underline-offset:.12em;background:0 0;border:none;padding:0;font-weight:900;text-decoration:underline}.gen-pill.linkish{border:1.5px solid var(--ink);background:#8b3a2a1f;border-radius:.45rem;padding:.2rem .55rem;text-decoration:none}.gen-pill.linkish:hover,button.linkish:hover{color:var(--brand)}.profile-modal,.army-setup-modal{z-index:40;place-items:center;padding:1rem;display:grid;position:fixed;inset:0}.profile-modal[hidden],.army-setup-modal[hidden]{display:none!important}.profile-backdrop,.army-setup-backdrop{background:#14182073;position:absolute;inset:0}.profile-card,.army-setup-card{z-index:1;border:2.5px solid var(--ink);background:#fff8ec;border-radius:.85rem;width:min(28rem,94vw);max-height:min(88vh,40rem);padding:1.1rem 1.2rem 1.2rem;position:relative;overflow:auto;box-shadow:0 12px 40px #00000038}.army-setup-card{width:min(36rem,96vw)}.profile-x{cursor:pointer;background:0 0;border:none;font-size:1.4rem;line-height:1;position:absolute;top:.45rem;right:.55rem}.profile-body{grid-template-columns:96px 1fr;align-items:start;gap:.9rem;display:grid}.profile-portrait{border:2px solid var(--ink);object-fit:cover;background:#f3e7d3;border-radius:.65rem;width:96px;height:96px}.profile-portrait.placeholder{background:hsl(var(--ph,30) 35% 72%);place-items:center;font-size:2rem;font-weight:900;display:grid}.profile-meta h2{color:var(--brand);margin:0 0 .2rem;font-size:1.25rem;font-weight:900}.profile-title{opacity:.8;margin-bottom:.4rem;font-size:.82rem;font-weight:800}.profile-bio{margin-bottom:.55rem;font-size:.82rem;line-height:1.4}.profile-attrs{grid-template-columns:repeat(2,minmax(0,1fr));gap:.35rem .75rem;margin:0 0 .55rem;display:grid}.profile-attrs div{border-bottom:1px dashed #1c243033;justify-content:space-between;gap:.5rem;padding:.2rem .35rem;font-size:.78rem;font-weight:700;display:flex}.profile-attrs dt{opacity:.7}.profile-attrs dd{margin:0;font-weight:900}.profile-skills-h{margin:.2rem 0 .3rem;font-size:.78rem;font-weight:800}.profile-skills{flex-direction:column;gap:.25rem;margin:0;padding:0;list-style:none;display:flex}.profile-skills li{background:#ffffff73;border:1.5px solid #1c243033;border-radius:.4rem;flex-direction:column;gap:.05rem;padding:.3rem .4rem;font-size:.75rem;display:flex}.profile-skills span{opacity:.7}.profile-hint{opacity:.75;margin-top:.35rem;font-size:.72rem}.army-setup-head h2{color:var(--brand);margin:0 0 .2rem;font-size:1.15rem;font-weight:900}.army-setup-sub{opacity:.8;margin-bottom:.55rem;font-size:.8rem;font-weight:700}.army-setup-lead{margin-bottom:.65rem;font-size:.82rem;line-height:1.4}.army-rows{flex-direction:column;gap:.45rem;margin-bottom:.75rem;display:flex}.army-row{background:#ffffff80;border:1.5px solid #1c243038;border-radius:.55rem;grid-template-columns:1.4fr auto 1.2fr;align-items:center;gap:.35rem .65rem;padding:.45rem .55rem;display:grid}.army-include{flex-wrap:wrap;align-items:baseline;gap:.25rem .45rem;font-size:.82rem;font-weight:800;display:flex}.army-title{opacity:.7;font-size:.7rem;font-weight:700}.army-cmd{white-space:nowrap;font-size:.72rem;font-weight:800}.army-str{flex-wrap:wrap;grid-column:1/-1;align-items:center;gap:.25rem;font-size:.72rem;font-weight:700;display:flex}.army-str input[type=number]{width:5.5rem;font:inherit;border:1.5px solid var(--ink);border-radius:.35rem;padding:.2rem .35rem;font-weight:800}.army-cap{opacity:.7}.army-stats{opacity:.7;grid-column:1/-1;font-size:.68rem}.army-enemy h3{margin-bottom:.25rem;font-size:.78rem}.army-enemy ul{flex-wrap:wrap;gap:.35rem;font-size:.75rem;list-style:none;display:flex}.army-enemy li{background:#8b2e2414;border:1.5px solid #8b2e2473;border-radius:.35rem;padding:.2rem .45rem;font-weight:700}.army-setup-foot{justify-content:flex-end;gap:.45rem;margin-top:.75rem;display:flex}.army-setup-status{color:#8b2e24;min-height:1.1em;margin-top:.4rem;font-size:.78rem;font-weight:800}@media (width<=640px){.profile-body{text-align:center;grid-template-columns:1fr;justify-items:center}.army-row{grid-template-columns:1fr}}.court-war{background:#ffe6dcbf;border:2px solid #8b2e24;border-radius:.7rem;padding:.65rem .7rem}.war-banner{letter-spacing:.06em;color:#fff8ec;background:#8b2e24;border-radius:.35rem;margin-bottom:.35rem;padding:.15rem .45rem;font-size:.68rem;font-weight:900;display:inline-block}.war-banner.soft{background:#8b2e24bf}.action-list{flex-direction:column;gap:.4rem;max-height:18rem;display:flex;overflow:auto}.cmd-item{width:100%}.cmd-top{flex-wrap:wrap;align-items:center;gap:.35rem;width:100%;display:flex}.cmd-cost{opacity:.7;margin-left:auto;font-size:.68rem;font-weight:800}.cmd-war{color:#fff8ec;background:#8b2e24;border-radius:.3rem;padding:.05rem .35rem;font-size:.62rem;font-weight:900}.cmd-desc{opacity:.72;font-size:.7rem;font-weight:600;line-height:1.35}.cmd-lead{opacity:.75;margin-bottom:.4rem;font-size:.72rem}.cmd-lead code{font-size:.65rem}.cmd-empty{opacity:.75;padding:.35rem 0;font-size:.8rem;font-weight:700}.court-header{border-bottom:2px solid #1c243026;justify-content:space-between;align-items:baseline;gap:1rem;padding-bottom:.55rem;display:flex}.court-title{color:var(--brand);letter-spacing:.04em;font-size:1.35rem;font-weight:900}.court-sub{opacity:.75;margin-top:.1rem;font-size:.75rem;display:block}.court-date{white-space:nowrap;font-size:.85rem;font-weight:700}.court-resources{grid-template-columns:repeat(4,1fr);gap:.45rem;display:grid}.res-chip{text-align:center;background:#ffffff8c;border:2px solid #1c243033;border-radius:.65rem;padding:.4rem .5rem}.res-chip.warn{background:#ffdcd2b3;border-color:#a32a18}.res-label{opacity:.75;font-size:.68rem;font-weight:700;display:block}.res-val{font-size:1.15rem;font-weight:900}.gen-row{flex-wrap:wrap;align-items:center;gap:.35rem;display:flex}.gen-label{margin-right:.25rem;font-size:.75rem;font-weight:800}.gen-pill{border:1.5px solid var(--ink);background:#8b3a2a1f;border-radius:.45rem;padding:.2rem .55rem;font-size:.78rem;font-weight:700}.court-officials{padding:.35rem 0}.off-head{align-items:baseline;gap:.5rem;margin-bottom:.35rem;display:flex}.off-label{font-size:.75rem;font-weight:800}.off-free{opacity:.7;font-size:.68rem;font-weight:700}.off-list{flex-wrap:wrap;gap:.35rem;display:flex}.off-pill{border:1.5px solid var(--ink);border-radius:.45rem;flex-direction:column;gap:.08rem;min-width:6.5rem;padding:.3rem .5rem;font-size:.72rem;font-weight:700;display:flex}.off-pill.free{background:#d2e6c88c}.off-pill.busy{background:#e6d2b4a6}.off-name{font-weight:900}.off-task{opacity:.8;font-weight:600}.off-months{opacity:.75;font-size:.65rem}.court-memorials,.court-assign{background:#fff8ecb8;border:2px solid #1c24302e;border-radius:.7rem;padding:.55rem .65rem}.court-assign{background:#ffecbecc;border-color:#6b4e0a}.mem-banner{letter-spacing:.06em;color:#fff8ec;background:#3d4a2e;border-radius:.35rem;margin-bottom:.35rem;padding:.15rem .45rem;font-size:.68rem;font-weight:900;display:inline-block}.mem-from{opacity:.75;margin-bottom:.35rem;font-size:.75rem;font-weight:700}.mem-tag,.cmd-off{color:#fff8ec;background:#3d4a2e;border-radius:.3rem;padding:.05rem .35rem;font-size:.62rem;font-weight:900}.mem-item{width:100%}.court-node h2,.court-event h2{color:var(--brand);margin-bottom:.35rem;font-size:1.1rem;font-weight:900}.court-node p,.event-body{margin-bottom:.65rem;font-size:.88rem;line-height:1.45}.choice-row,.action-grid{flex-wrap:wrap;gap:.45rem;display:flex}.action-grid{grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));display:grid}.court-actions h3,.court-log h3{opacity:.8;margin-bottom:.4rem;font-size:.8rem;font-weight:800}.court-btn{border:2px solid var(--ink);cursor:pointer;color:var(--ink);background:#fff8ec;border-radius:.6rem;padding:.45rem .75rem;font-family:inherit;font-size:.82rem;font-weight:800}.court-btn.primary{background:var(--brand);color:#fff8ec}.court-btn.secondary{background:#ffffff80;font-size:.75rem}.court-btn.action{text-align:left;flex-direction:column;align-items:flex-start;gap:.15rem;display:flex}.action-cat{text-transform:uppercase;opacity:.65;font-size:.65rem;font-weight:700}.action-title{font-size:.85rem}.court-btn:active{transform:translateY(1px)}.court-log ul{opacity:.85;max-height:5.5rem;font-size:.75rem;line-height:1.4;list-style:none;overflow:auto}.court-footer{border-top:2px solid #1c24301f;flex-wrap:wrap;align-items:center;gap:.4rem;padding-top:.65rem;display:flex}.court-save{opacity:.65;margin-left:auto;font-size:.68rem}.court-save code{font-size:.62rem}.court-status{min-height:1.1em;color:var(--brand);font-size:.8rem;font-weight:700}@media (width<=860px){.admin-body{grid-template-columns:1fr}.action-list{max-height:12rem}}@media (width<=640px){.court-resources{grid-template-columns:repeat(2,1fr)}.mode-toggle{top:auto;bottom:1rem;left:50%;transform:translate(-50%)}.court-hud{place-items:start center;padding-top:.5rem}.orders-hint{width:100%;margin-left:0}}
