/* Scheme XVI only: low light, heavy cloth and antique brass. */
body[data-theme=tapestry]{--bg:#151918;--ink:#dfd6bd;--accent:#b49b69;--line:#c4ad7730;--paper:#222a26;background:radial-gradient(ellipse at 50% 30%,#6b61402b,transparent 65%),repeating-linear-gradient(90deg,#ffffff02 0 1px,transparent 1px 5px),#151918}
[data-theme=tapestry] .variant-nav{background:#111514aa;color:#91968a}
[data-theme=tapestry] header{max-width:1300px;margin:auto;padding:25px 6% 15px}
[data-theme=tapestry] header>span{color:#b1a07f;letter-spacing:3px}
[data-theme=tapestry] .brand{color:#d3c8a8}
.tapestry-main{max-width:1260px;padding:0 6%;position:relative}
.tapestry-title{margin:24px 0 36px}
.tapestry-title .eyebrow{color:#a59164;font-size:9px;letter-spacing:3px;margin-bottom:13px}
.tapestry-title h1{color:#e0d4b5;font-size:clamp(30px,3.2vw,46px);letter-spacing:4px;text-shadow:0 2px 12px #0009}
.tapestry-title p{color:#a2a394;opacity:1;font-size:12px;letter-spacing:2px}
.hanging-rod{position:relative;height:11px;margin:0 -10px;border:1px solid #17170e;border-radius:8px;background:linear-gradient(#75694a,#3c3526 40%,#211f18 65%,#564c34);box-shadow:0 3px 0 #0009,0 4px 5px #0007}
.hanging-rod:before,.hanging-rod:after{content:'';position:absolute;top:-3px;width:19px;height:17px;border-radius:50%;border:1px solid #82704b;background:radial-gradient(circle at 30% 25%,#a58e59,#30291d 70%);box-shadow:0 4px 8px #0008}
.hanging-rod:before{left:-9px}.hanging-rod:after{right:-9px}
.woven-panels{gap:28px;padding:0 19px;filter:none;align-items:start}
.woven-panel{--dye:#344a3d;--thread:#b6a271;isolation:isolate;min-height:475px;padding:25px 19px 70px;border:0;color:#e3d3ad;background-color:var(--dye);background-image:linear-gradient(90deg,#0007,transparent 13%,#ffffff0a 22%,#0003 38%,transparent 51%,#ffffff0a 62%,#0004 83%,#0008),url('../assets/banner-weave-detail-v1.webp');background-blend-mode:normal,multiply;background-size:100% 100%,100% 100%;clip-path:polygon(0 0,100% 0,100% 91%,50% 100%,0 91%);box-shadow:inset 0 14px 16px #000a,inset 5px 0 6px #0006,inset -5px 0 6px #0006;text-shadow:0 2px 2px #000b;transition:filter .25s}
.woven-panel:hover{filter:brightness(1.04)}
.woven-tool{--dye:#633630;min-height:520px}.woven-world{--dye:#2f4154}
.woven-panel:before{content:'';position:absolute;z-index:-1;inset:0 10px 38px;border-inline:4px double #b69c6255;border-bottom:2px dashed #b69c6233;pointer-events:none;background:linear-gradient(90deg,#c0a5720a,transparent 8%,transparent 92%,#c0a5720a)}
.woven-panel:after{content:'';position:absolute;left:25px;right:25px;top:14px;height:10px;border-block:1px dashed #d1bb844d;box-shadow:0 2px 1px #0005;pointer-events:none}
.panel-number{font-size:12px;letter-spacing:2px;color:#c9b783;margin-top:11px;text-shadow:1px 1px #0c150e,-1px -1px #d1b77d22}
.woven-panel>.medieval-icon{width:65px;height:65px;color:#d2b981;margin:23px auto 17px;stroke-dasharray:1.7 .55;filter:drop-shadow(1px 2px 0 #101511) drop-shadow(-.5px -.5px 0 #f4dda052)}
.woven-panel h2{font-size:34px;letter-spacing:7px;color:#e4d4ae;text-shadow:1px 2px 1px #1119,-.5px -.5px 0 #f7e0aa44}
.stitch-rule{color:#b8a073;font-size:11px;margin:20px 0;opacity:.8}
.woven-panel p{font-size:12px;color:#d2c8ae;opacity:1;line-height:2.1}
.woven-action{margin-top:23px;border:1px solid #c3aa6c55;padding:12px 15px;background:#0b120f40;color:#e6d7b4;font-size:13px;gap:17px;box-shadow:inset 0 0 0 2px #0001;transition:background .2s,border-color .2s}
.woven-action:hover{background:#c2a56718;border-color:#cfb87e;filter:none}
.woven-sub{font-size:11px;color:#ceb98c;margin-top:18px;text-decoration:underline;text-underline-offset:5px;text-decoration-color:#b49b6955}
.woven-land,.woven-stars{display:none}
.woven-embroidery{display:block;width:100px;height:43px;margin:23px auto 0;color:#b8a779;opacity:.6;filter:drop-shadow(0 1px 0 #000)}
.tapestry-colophon{color:#8c927f;margin:27px 0 32px;font-size:11px;letter-spacing:3px}
.weaver-notes{display:grid;grid-template-columns:1fr 1fr;gap:50px;max-width:1050px;margin:0 auto 38px;padding:25px 0 0;border-top:1px solid var(--line)}
.weaver-notes article{display:flex;gap:18px;align-items:start}.weaver-notes .medieval-icon{width:27px;height:27px;flex-shrink:0;color:#a58e5d}.weaver-notes h2{font-size:19px;color:#cfc3a5;margin-bottom:9px}.weaver-notes p{font-size:11px;line-height:1.9;color:#969e8e;opacity:1}.weaver-notes .plain{font-size:12px;color:#b8a374;padding:9px 0 5px;gap:20px;margin-top:3px}
[data-theme=tapestry] footer{background:#10151370;color:#a0a58f;opacity:1;font-size:9px}
[data-theme=tapestry] dialog{background:linear-gradient(110deg,#293029,#1c2420);color:#ded4bb;box-shadow:-20px 0 80px #0008}
[data-theme=tapestry] dialog p{opacity:1;color:#aeb5a3}
[data-theme=tapestry] dialog .primary{background:#b6a174;color:#172019}
@media(max-width:950px){.woven-panels{gap:17px;padding-inline:12px}.woven-panel{padding-inline:12px}.woven-panel h2{font-size:30px}.woven-action{font-size:12px;padding:11px;gap:8px}.weaver-notes{gap:25px}.tapestry-title h1{letter-spacing:2px}}
@media(max-width:620px){[data-theme=tapestry] header{padding:23px 7% 10px}.tapestry-main{padding:0 8%}.tapestry-title{margin:21px 0 28px}.tapestry-title h1{font-size:29px;line-height:1.6;letter-spacing:1px}.tapestry-title .eyebrow{font-size:7px;letter-spacing:2px}.tapestry-title p{font-size:11px;letter-spacing:1px;line-height:2}.woven-panels{gap:24px;padding:0 9px}.woven-panel,.woven-tool{min-height:430px;padding:24px 25px 65px;background-size:100% 100%,100% 100%}.woven-panel>.medieval-icon{width:57px;height:57px;margin:20px auto 13px}.woven-panel h2{font-size:32px}.stitch-rule{margin:15px 0}.woven-action{font-size:14px;padding:12px 20px;margin-top:20px}.woven-embroidery{height:30px;margin-top:18px}.woven-sub{margin-top:16px}.tapestry-colophon{line-height:2;letter-spacing:1px;margin:25px 0}.weaver-notes{grid-template-columns:1fr;gap:25px;padding-top:23px;margin-bottom:28px}.weaver-notes h2{font-size:20px}.weaver-notes p{font-size:12px}.weaver-notes .plain{font-size:13px}}

/* User reference: red, blue and yellow cloth, with the original worn silhouette. */
.woven-panel{--dye:#a84c3c;--thread:#d8bd86;background:var(--dye);background-image:none;clip-path:none;mask:none;box-shadow:inset 0 2px 0 #17150f80;min-height:510px;padding-bottom:90px}
.woven-map{--dye:#a84c3c}.woven-tool{--dye:#3b7198;min-height:540px}.woven-world{--dye:#d3ab37}
.woven-panel:before{inset:0;z-index:-1;border:0;background:url('../assets/banner-user-reference.png') center/100% 100% no-repeat;filter:grayscale(1) brightness(1.6);mix-blend-mode:multiply;opacity:.96}
.woven-panel:after{inset:13px 13px 65px;height:auto;border:0;border-inline:1px dashed #e0c79929;box-shadow:none}
.woven-panel>.medieval-icon{stroke-dasharray:none;filter:drop-shadow(0 1px 1px #0007);color:#e4d2a2}
.woven-world,.woven-world p{color:#30280e;text-shadow:0 1px 0 #eedb7540}
.woven-world h2{color:#30280e;text-shadow:0 1px 0 #eedb7580}
.woven-world .panel-number,.woven-world .stitch-rule,.woven-world>.medieval-icon,.woven-world .woven-embroidery{color:#4c3a10;filter:none;text-shadow:none}
.woven-world .woven-action{color:#f0dfad;background:#3c3217b3;border-color:#33290e77;text-shadow:none}
.woven-world .woven-action:hover{background:#30250de0}
.woven-world:after{border-color:#45351140}
@media(max-width:620px){.woven-panel,.woven-tool{min-height:455px;padding-bottom:80px}}

/* High-resolution weave uses only the cloth interior; silhouette remains the supplied flag. */
.woven-panel:before{background-image:url('../assets/banner-weave-detail-v1.webp');background-size:140% 116%;background-position:center top;filter:grayscale(1) brightness(1.55)}
.woven-map{--dye:#9d4738}.woven-tool{--dye:#356483}.woven-world{--dye:#bda037}



/* Direct generated-image artwork; no polygon redraw, enlarged icon or texture crop. */
.fabric-mask-defs{position:absolute;width:0;height:0;overflow:hidden;pointer-events:none}
.woven-panel{clip-path:none;mask:none;background:none;box-shadow:none;text-shadow:0 1px 0 #0008;overflow:visible}
.woven-panel:before,.woven-panel:after{display:none}
.woven-source-art{position:absolute;z-index:-1;top:0;left:-13.1241%;width:126.5335%;height:100%;object-fit:fill;pointer-events:none;filter:url(#fabric-ochre-alpha);max-width:none}
.woven-map .woven-source-art{filter:url(#fabric-map-alpha) hue-rotate(322deg) saturate(.72) brightness(.88)}
.woven-tool .woven-source-art{filter:url(#fabric-ochre-alpha) hue-rotate(157deg) saturate(.63) brightness(.82)}
.woven-world .woven-source-art{filter:url(#fabric-world-alpha)}
.woven-panel h2{text-shadow:0 1px 0 #0008}
.woven-panel>.medieval-icon{filter:none}
.woven-world,.woven-world p,.woven-world h2{color:#efe0b0;text-shadow:0 1px 2px #261d00}
.woven-world .panel-number,.woven-world .stitch-rule,.woven-world>.medieval-icon,.woven-world .woven-embroidery{color:#efdc9f}

/* Dim the complete banner slightly; reveal its colour on hover or keyboard focus. */
.woven-panel{filter:brightness(.82);transition:filter .28s ease-out;transform:none}
.woven-panel:hover,.woven-panel:focus-within{filter:brightness(1.04);transform:none}


/* Opaque timber and bronze artwork, with the black backdrop clipped in SVG. */
.hanging-rod{height:clamp(25px,4.6vw,52px);margin:-15px clamp(-90px,-5vw,-40px) -15px;border:0;border-radius:0;background:none;box-shadow:none;z-index:2;pointer-events:none;mix-blend-mode:normal}
.hanging-rod:before,.hanging-rod:after{display:none}
.rod-parts{position:absolute;inset:12px 0 auto;display:flex;align-items:center;height:36px}
.rod-end{display:block;flex:0 0 39px;width:39px;height:36px;overflow:hidden}
.rod-shaft{display:block;flex:1 1 auto;width:0;height:18px;overflow:hidden;margin-inline:-1px}
.hanging-rod svg svg{overflow:hidden}
.woven-panels{padding-inline:7%}
@media(max-width:620px){.hanging-rod{margin-inline:-12px;margin-bottom:-7px}}
@media(max-width:620px){.rod-parts{top:0;height:30px}.rod-end{flex-basis:32.4px;width:32.4px;height:30px}.rod-shaft{height:15px}}

/* A fixed oblique camera and articulated miniatures, confined below the banner hems. */
.battlefield{position:relative;margin:2px -4% 8px;isolation:isolate}
.battle-shell{display:grid;grid-template-columns:180px minmax(0,1fr) 180px;align-items:center;gap:6px}
.battle-stage{height:360px;position:relative;pointer-events:none;background:radial-gradient(ellipse at 20% 64%,#954a3620,transparent 42%),radial-gradient(ellipse at 80% 64%,#4767881a,transparent 42%)}
.battle-stage canvas{display:block;width:100%;height:100%}
.battle-stage canvas{position:relative;z-index:1}
.battle-meter-grid{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:hidden}
.battle-meter-grid line{vector-effect:non-scaling-stroke;stroke-width:1}
.battle-meter-grid .meter-minor{stroke:#acb7a7;stroke-opacity:.15}
.battle-meter-grid .meter-major{stroke:#cfbd8f;stroke-opacity:.38}
.battle-meter-grid .meter-origin{stroke:#dfbd75;stroke-opacity:.65}
.battle-meter-grid .meter-boundary{fill:none;stroke:#deb976;stroke-width:1.5;stroke-dasharray:7 4;vector-effect:non-scaling-stroke}
.battle-meter-grid text{fill:#d6ccae;font:10px monospace;paint-order:stroke;stroke:#17201a;stroke-width:3px;stroke-linejoin:round}
.battle-ruler{position:relative;z-index:7;margin:12px auto;padding:10px 13px;width:max-content;max-width:calc(100% - 24px);background:#141b17f2;border:1px solid #88754d80;border-radius:5px;color:#dbcfaf;font:12px/1.6 sans-serif;pointer-events:auto;text-align:left}
.battlefield[data-battle-layout=surround] .battle-ruler{position:fixed;right:18px;top:15px;margin:0}
.battle-ruler button{display:block;margin:0 0 6px;padding:3px 9px;border:1px solid #aa9161;background:#2b3025;color:#ead6aa;font:inherit;cursor:pointer}
.battle-ruler button:focus-visible{outline:2px solid #eac98b;outline-offset:3px}
.battle-ruler strong,.battle-ruler span,.battle-ruler small{display:block}
.battle-ruler strong{font-size:14px}.battle-ruler small{margin-top:4px;color:#aeb39e;font-size:10px}
.battle-command-input{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:20;max-width:calc(100vw - 32px);width:max-content;padding:9px 14px;border:1px solid #74684c;background:#111813f2;color:#c5b993;border-radius:5px;text-align:center;font:13px/1.6 sans-serif;box-shadow:0 8px 32px #0006}
.battle-command-input[data-active=true]{border-color:#d0b778;box-shadow:0 0 16px #bc9c4920;color:#ebd59e}
.battle-command-input strong,.battle-command-input span,.battle-command-input small{display:block}
.battle-command-input small:empty{display:none}
.battle-command-input small{color:#b9c6b2;font-size:11px}
@media(max-width:899px){.battle-command-input{bottom:8px;font-size:11px;padding:7px 10px}}
.command-status{display:flex;align-items:center;justify-content:center;gap:20px;margin-bottom:5px}
.battle-command-input button,.battle-order-menu button{font:inherit;color:inherit;cursor:pointer;border:1px solid #88724955;background:#26302790;border-radius:3px;padding:5px 9px;transition:background .15s,border-color .15s}
.battle-command-input button:hover,.battle-order-menu button:hover{background:#69542d55;border-color:#cfac63}
.battle-command-input button:focus-visible,.battle-order-menu button:focus-visible{outline:2px solid #e7cc85;outline-offset:2px}
.battle-command-input [data-command-audio]{font-size:11px;padding:1px 7px}
.command-groups,.command-keys{display:flex;justify-content:center;gap:5px;flex-wrap:wrap}
.battle-command-input [data-command-help]{font-size:11px;color:#a9ac97;margin:4px 0}
.battle-command-input .command-groups small{display:inline;color:#b7b7a1;font-size:11px}
.command-groups button[aria-pressed=true]{border-color:#dcbd77;color:#fff0be;background:#80652c45;box-shadow:inset 0 -2px #d7ba75}
.command-keys button{font-size:12px;padding:3px 8px;background:transparent}
.battle-command-input kbd,.battle-order-menu kbd{font:11px/1.3 monospace;color:#dec387;border:1px solid #8b764d88;border-radius:2px;padding:1px 3px;margin-right:3px}
.battle-command-input[data-active=false] .command-groups,.battle-command-input[data-active=false] .command-keys,.battle-command-input[data-active=false] [data-command-audio]{display:none}
.battle-command-toast{position:fixed;top:clamp(84px,14vh,150px);left:50%;transform:translate(-50%,-8px);z-index:32;max-width:calc(100vw - 180px);padding:12px 24px;color:#ffebaf;background:linear-gradient(90deg,#141b15e8,#26271ef5,#141b15e8);border-block:1px solid #bfa16b88;box-shadow:0 9px 32px #0005;text-shadow:0 1px 3px #000;font:16px/1.7 sans-serif;letter-spacing:1px;text-align:center;pointer-events:none;opacity:0;transition:opacity .16s,transform .16s}
.battle-command-toast[data-visible=true]{opacity:1;transform:translate(-50%,0)}
.battle-order-menu{position:fixed;top:clamp(150px,23vh,220px);left:50%;transform:translateX(-50%);z-index:31;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:420px;max-width:calc(100vw - 36px);padding:14px;background:#111813f5;border:1px solid #8d784e;color:#e3cf9e;box-shadow:0 15px 48px #0008;font:14px/1.5 sans-serif;border-radius:4px}
.battle-order-menu[hidden]{display:none}
.battle-order-menu strong,.battle-order-menu>small{grid-column:1/-1;text-align:center}
.battle-order-menu strong{padding-bottom:7px;border-bottom:1px solid #7e694744;font-weight:normal;letter-spacing:2px}
.battle-order-menu button{text-align:left;display:flex;align-items:center;gap:7px;min-height:37px}
.battle-order-menu>small{font-size:11px;color:#a4a68f;margin-top:4px}
.battle-order-cursor{position:fixed;z-index:35;pointer-events:none;display:grid;grid-template-columns:28px auto;align-items:center;column-gap:7px;color:#eda878;filter:drop-shadow(0 2px 2px #000);font:12px/1.5 sans-serif}
.battle-order-cursor[hidden]{display:none}
.battle-order-cursor[data-team="1"]{color:#86d5e6}
.battle-order-cursor svg{width:26px;height:34px;grid-row:1/3}
.battle-order-cursor[data-mode="follow"]{grid-template-columns:32px auto;grid-template-rows:20px 20px}
.battle-order-cursor[data-mode="follow"] svg{width:32px;height:40px;align-self:start}
.battle-order-cursor span{color:#f2dfb0;text-shadow:0 1px 3px #000}
.battle-order-cursor small{font-size:10px;color:#a6ad92;text-shadow:0 1px 3px #000}
@media(max-width:899px){.battle-command-toast{font-size:13px;max-width:calc(100vw - 24px);padding:8px 12px;top:78px}.battle-order-menu{top:145px}.command-groups{gap:3px}.command-groups button{padding:4px 6px}.battle-command-input{max-width:calc(100vw - 16px)}}
.battle-carry-overlay{position:fixed;z-index:80;pointer-events:none;display:block}
.battle-carry-overlay[hidden]{display:none!important}
.battle-pickup-hint{position:fixed;bottom:22px;left:50%;transform:translateX(-50%);z-index:81;pointer-events:none;font:12px/1.7 SimSun,serif;color:#ead5a1;letter-spacing:1px;padding:8px 15px;background:#18201ded;border:1px solid #b69c6555;border-radius:3px}
.battle-pickup-hint:empty{display:none}
html.battle-soldier-hover,html.battle-soldier-hover body{cursor:grab}
html.battle-carrying,html.battle-carrying body{cursor:grabbing}
html.battle-follow-cursor,html.battle-follow-cursor body,html.battle-follow-cursor body *{cursor:none}
.battle-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 2%;font-size:10px;letter-spacing:1px;position:relative;z-index:1;color:#84836d}
.battle-red{color:#b66f5b}.battle-blue{color:#789db8}
.battle-meta button{border:0;background:none;color:#909380;font:inherit;letter-spacing:2px;padding:9px 16px;cursor:pointer;opacity:.65}
.battle-meta button:hover,.battle-meta button:focus-visible{opacity:1;color:#d8c79e}
.battle-meta button:focus-visible{outline:1px solid #b69c65;outline-offset:2px}
.battle-army{text-align:center;position:relative;z-index:2;padding-top:8px}
.battle-army h3{font-size:16px;font-weight:400;letter-spacing:3px;margin:0 0 10px}
.battle-army h3 small{display:block;font-size:9px;letter-spacing:2px;margin-bottom:7px;opacity:.75}
.battle-add-ten{display:block;width:56px;min-height:32px;margin:0 auto 8px;padding:4px 8px;border:1px solid currentColor;border-radius:4px;background:#17211bef;color:inherit;font:600 16px/1.3 system-ui;cursor:pointer;pointer-events:auto}
.battle-add-ten:hover{background:#2b382b}
.battle-add-ten:active{transform:translateY(1px)}
.battle-add-ten:focus-visible{outline:2px solid #eed697;outline-offset:3px}
.battle-flags{display:grid;grid-template-columns:repeat(3,1fr);gap:8px 1px}
.faction-banner{border:1px solid transparent;background:none;color:#9e9782;cursor:pointer;min-width:0;padding:3px 0 5px;border-radius:3px;font:inherit;transition:border-color .2s,background-color .2s}
.faction-banner img{display:block;width:46px;height:auto;margin:0 auto;opacity:.62;filter:brightness(.8);transition:opacity .2s,filter .2s}
.faction-banner span{display:block;font-size:9px;letter-spacing:0;margin-top:4px;white-space:nowrap}
.faction-banner:hover img,.faction-banner:focus-visible img,.faction-banner[aria-pressed=true] img{opacity:1;filter:brightness(1.05)}
.faction-banner[aria-pressed=true]{border-color:transparent;background:none;color:#ead29a;box-shadow:none}
.battle-red{--flag-glow:#e59a63}.battle-blue{--flag-glow:#7cc7f0}
.faction-banner[aria-pressed=true] img{opacity:1;filter:brightness(1.3) saturate(1.15) drop-shadow(0 0 4px var(--flag-glow,#dfbb77)) drop-shadow(0 0 10px var(--flag-glow,#dfbb77))}
.faction-banner:focus-visible{outline:none}
.faction-banner:focus-visible img{opacity:1;filter:brightness(1.4) drop-shadow(0 0 3px #fff0c7) drop-shadow(0 0 8px var(--flag-glow,#dfbb77))}
.faction-banner:focus-visible span{text-decoration:underline;text-underline-offset:3px}
.battle-army p{font-size:9px;line-height:1.9;letter-spacing:0;color:#9a947f;margin:12px 0 0}
.battle-army .battle-army-note{margin-top:2px;color:#777b6f}
.battle-army-tactics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:8px 0 5px;pointer-events:auto}
.battle-army-tactics button{padding:6px 2px;border:1px solid #a78d544d;border-radius:3px;background:#17211bd9;color:#b8b7a1;font:inherit;font-size:11px;cursor:pointer}
.battle-army-tactics button[aria-pressed=true]{background:#61522ce6;border-color:#c3a56b;color:#fff0c6}
.battle-army-tactics button:focus-visible{outline:2px solid #eed697;outline-offset:2px}
.battle-lord-status{color:#d6bd80;font-size:10px;line-height:1.5;margin-bottom:8px}
.battle-lord-label{position:absolute;z-index:4;transform:translate(-50%,-100%);pointer-events:none;white-space:nowrap;background:#181e18d9;border:1px solid #c498626b;color:#ffce98;border-radius:3px;padding:2px 5px;font:10px/1.5 sans-serif}
.battle-lord-label[data-team="1"]{color:#a2e2ff;border-color:#87bccc6b}
.battle-rosters{margin:12px 2% 0;border-top:1px solid #9b85582a;padding:10px 0;color:#a09a85;font-size:11px}
.battle-rosters summary{cursor:pointer;width:fit-content;margin:auto;letter-spacing:2px}
.battle-roster-columns{display:grid;grid-template-columns:1fr 1fr;gap:32px;padding:8px 14px}
.battle-roster-columns h4{font-size:13px;font-weight:400;letter-spacing:2px;color:#c3ab78}
.battle-roster-columns ul{list-style:none;margin:0;padding:0}
.battle-roster-columns li{padding:8px 0;border-bottom:1px solid #a18c5920;line-height:1.8}
.battle-roster-columns a{color:#c4b99a;text-decoration:none}
.battle-roster-columns a:hover{text-decoration:underline}
.battle-roster-columns li span{display:block;font-size:10px;color:#8a8978}
.battle-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
/* Desktop: the full viewport battlefield remains behind the hanging cloth. */
.battlefield[data-battle-layout=surround]{isolation:auto;margin-inline:0}
.battlefield[data-battle-layout=surround] .battle-shell{display:block;height:160px}
.battlefield[data-battle-layout=surround] .battle-stage{position:fixed;left:0;top:0;z-index:1;background:none;pointer-events:none}
.battlefield[data-battle-layout=surround] .battle-army{position:absolute;top:calc(-1 * var(--battle-lift) + 8px);width:70px;padding:0;z-index:5}
.battlefield[data-battle-layout=surround] .battle-meta{z-index:5}
.battlefield[data-battle-layout=surround] .battle-red{left:calc(var(--battle-left) + 10px)}
.battlefield[data-battle-layout=surround] .battle-blue{right:calc(var(--battle-right) + 10px)}
.battlefield[data-battle-layout=surround] .battle-flags{grid-template-columns:1fr;gap:2px}
.battlefield[data-battle-layout=surround] .faction-banner{padding:2px 0 4px}
.battlefield[data-battle-layout=surround] .faction-banner img{width:40px}
.battlefield[data-battle-layout=surround] .faction-banner span{margin-top:1px;font-size:9px}
.battlefield[data-battle-layout=surround] .battle-army h3{margin-bottom:5px}
.battlefield[data-battle-layout=surround] .battle-army h3 small{font-size:9px;letter-spacing:1px;margin:0}
.battlefield[data-battle-layout=surround] .battle-army h3>span,.battlefield[data-battle-layout=surround] .battle-army p{display:none}
@media(min-width:900px){.woven-panels{position:relative;z-index:2}}
@media(max-width:800px){.battle-shell{grid-template-columns:150px minmax(0,1fr) 150px}.faction-banner img{width:40px}.faction-banner span{font-size:8px}}
@media(max-width:620px){
 .battlefield{margin-inline:-4%}.battle-shell{grid-template-columns:1fr 1fr;gap:0 20px}
 .battle-army{grid-row:1}.battle-stage{grid-row:2;grid-column:1/-1;height:330px}
 .battle-army h3{font-size:14px}.battle-flags{gap:3px}.faction-banner img{width:38px}
 .battle-meta{font-size:9px;padding-inline:2%;flex-wrap:wrap;justify-content:center;gap:4px 12px}
 .battle-meta span:last-child{flex-basis:100%;text-align:center}.battle-roster-columns{grid-template-columns:1fr;gap:6px;padding-inline:4px}
}

/* One continuous roll position drives the cloth edge, roll and compact entrances. */
@property --banner-roll{syntax:'<number>';inherits:true;initial-value:0}
.woven-panels{--banner-roll:0;transition:--banner-roll 1.35s cubic-bezier(.45,0,.18,1)}
.woven-hang{position:relative;min-width:0;pointer-events:none}
.woven-hang>.woven-panel{pointer-events:auto;clip-path:inset(0 -18% calc(var(--banner-roll) * 100%) -18%)}
.woven-panels[data-roll-state=rolled] .woven-panel{visibility:hidden;pointer-events:none}
.woven-panels[data-roll-state=moving] .woven-panel{pointer-events:none}
.hanging-rod{z-index:3;mix-blend-mode:normal}
.rod-parts{transition:filter .25s ease}
.rod-toggle{position:absolute;inset:0 -4px;width:calc(100% + 8px);height:100%;border:0;border-radius:12px;padding:0;background:transparent;cursor:pointer;pointer-events:auto;touch-action:manipulation}
.hanging-rod:has(.rod-toggle:hover) .rod-parts,.hanging-rod:has(.rod-toggle:focus-visible) .rod-parts{filter:brightness(1.18)}
.rod-toggle:focus-visible{outline:1px solid #d4b36a;outline-offset:1px}
.rod-surprise-hint{position:absolute;right:0;top:-14px;display:flex;align-items:flex-start;width:126px;height:40px;opacity:.5;color:#eee6d1;font:400 13px/1.5 KaiTi,STKaiti,serif;letter-spacing:1px;white-space:nowrap;text-shadow:0 1px 3px #0009}
.rod-surprise-hint svg{display:block;flex:none;width:36px;height:34px;margin-top:4px}
.rod-surprise-hint>span{margin-left:-5px}
body[data-home-layout=wide] .rod-surprise-hint{right:-114px}
.cloth-roll{position:absolute;left:-1%;width:102%;height:calc(8px + var(--banner-roll) * 46px);top:calc((1 - var(--banner-roll)) * 96% + var(--banner-roll) * 30px);transform:translateY(-50%);opacity:clamp(0,calc(var(--banner-roll) * 18),1);pointer-events:none;filter:brightness(.82);transition:filter .25s ease;isolation:isolate}
.roll-surface{position:absolute;inset:0;overflow:hidden;border-radius:48% / 18%;background:#584019;box-shadow:0 8px 12px #0006;z-index:-1}
.roll-surface img{position:absolute;width:140%;height:auto;max-width:none;left:-20%;top:-90%;filter:url(#fabric-ochre-alpha);pointer-events:none}
.roll-resources .roll-surface{filter:hue-rotate(322deg) saturate(.72) brightness(.88)}
.roll-tavern .roll-surface{filter:hue-rotate(157deg) saturate(.63) brightness(.82)}
.roll-surface:after{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(90deg,#160e08bb,transparent 4%,transparent 95%,#160e08bb),linear-gradient(0deg,#080500dd 0%,#15100566 20%,transparent 48%,#ac804412 65%,#100b05aa 94%);box-shadow:inset 0 2px 3px #100b05aa,inset 3px 0 2px #60471e55,inset -4px 0 3px #06040099}
.roll-links{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:8px;opacity:clamp(0,calc((var(--banner-roll) - .78) * 4.55),1)}
.roll-links button{border:0;background:transparent;color:#f0ddb0;font:inherit;font-size:13px;letter-spacing:2px;display:flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;min-height:44px;padding:0 8px;text-shadow:0 1px 3px #000;white-space:nowrap}
.roll-links .medieval-icon{width:25px;height:25px;flex:none}
.roll-links .roll-guide{font-size:10px;letter-spacing:1px;border-left:1px solid #d7bd7844;padding-left:10px}
.woven-panels[data-roll-state=rolled] .roll-links{pointer-events:auto}
.cloth-roll:has(button:hover),.cloth-roll:focus-within{filter:brightness(1.12)}
.roll-links button:focus-visible{outline:1px solid #ead5a0;outline-offset:0;border-radius:5px}

@media(max-width:899px){.roll-links button{font-size:11px;letter-spacing:1px;gap:5px;padding-inline:4px}.roll-links .medieval-icon{width:20px;height:20px}.roll-links{gap:2px}}

/* First-screen composition: a small masthead, a short introduction, then the flags. */
[data-theme=tapestry] header.tapestry-header{position:absolute;left:28px;top:22px;z-index:3;width:auto;max-width:none;margin:0;padding:0;gap:0}
.tapestry-header .brand{font-size:14px;letter-spacing:2px;gap:8px;color:#a99b7e}
.tapestry-header .brand .medieval-icon{width:23px;height:23px}
.tapestry-title{margin:20px 0 24px}
/* Move the entrance composition together without shifting the side controls. */
.tapestry-main>.tapestry-title,.tapestry-main>.hanging-rod,.tapestry-main>.woven-panels{position:relative;top:50px}
.tapestry-title h1{font-size:38px;line-height:1.35;letter-spacing:3px;margin-bottom:8px}
.tapestry-title p{font-size:11px;line-height:2;letter-spacing:2px;color:#999b87}
[data-theme=tapestry] .variant-nav{margin-top:30px;opacity:.8}
@media(min-width:900px){.tapestry-main{max-width:min(1260px,calc(100svh * 1.34))}}
@media(min-width:900px) and (max-height:900px){
 .tapestry-title{margin:12px 0 14px}
 .tapestry-title h1{font-size:32px;line-height:1.35;margin-bottom:6px}
 .woven-panel{min-height:clamp(350px,calc(100svh - 360px),510px);padding:20px 12px 46px}
 .woven-tool{min-height:clamp(376px,calc(100svh - 334px),536px)}
 .panel-number{font-size:11px;margin-top:2px}
 .woven-panel>.medieval-icon{width:48px;height:48px;margin:12px auto 10px}
 .woven-panel h2{font-size:28px;line-height:1.3;letter-spacing:6px}
 .stitch-rule{margin:10px 0}
 .woven-panel p{font-size:11px;line-height:1.9}
 .woven-action{margin-top:14px;padding:10px 12px;font-size:12px;gap:12px}
 .woven-sub{margin:8px auto 0;font-size:10px;line-height:1.5}
 .woven-embroidery{display:none}
}
@media(min-width:900px) and (max-height:740px){
 .tapestry-title{margin:10px 0 12px}
 .tapestry-title h1{font-size:30px}
 .woven-panel{padding:16px 12px 38px}
 .panel-number{margin-top:0}
 .woven-panel>.medieval-icon{width:44px;height:44px;margin:10px auto}
 .stitch-rule{display:none}
 .woven-panel p{margin-top:12px}
}
@media(max-width:899px){
 [data-theme=tapestry] header.tapestry-header{position:static;margin:0;padding:14px 6% 8px}
 .tapestry-title{margin:8px 0 22px}
 .tapestry-title h1{font-size:28px;line-height:1.4;letter-spacing:1px}
 .tapestry-title p{font-size:10px;letter-spacing:1px}
}
/* Expanded world is opt-in; the tapestry homepage retains its original layout. */
.battle-camera-controls{position:fixed;left:18px;top:18px;z-index:12;padding:10px 12px;background:#172019ec;border:1px solid #9b855456;border-radius:5px;color:#e3d4ad;font:12px/1.7 sans-serif;pointer-events:auto;text-align:left;box-shadow:0 5px 20px #0004}
.battle-camera-controls>span{display:block;margin-bottom:6px;color:#b9bfa9}.battle-camera-controls>div{display:flex;gap:5px;align-items:center}.battle-camera-controls button{color:#ead4a1;background:#303b2d;border:1px solid #8f805455;border-radius:3px;padding:4px 8px;cursor:pointer;font:inherit}.battle-camera-controls button:hover{background:#4a5035}.battle-camera-controls output{min-width:42px;text-align:center}.battle-camera-controls>button{margin-top:7px}.battle-camera-controls button:focus-visible{outline:2px solid #e8c888;outline-offset:2px}
.battle-camera-dragging,.battle-camera-dragging *{cursor:grabbing!important;user-select:none!important}
body.battle-world-open{overflow:hidden}
.battle-world-open .tapestry-header,.battle-world-open .tapestry-title,.battle-world-open .hanging-rod,.battle-world-open .woven-panels,.battle-world-open .tapestry-colophon,.battle-world-open .weaver-notes,.battle-world-open footer{display:none!important}
.battle-world-open .battlefield{position:relative;inset:auto;margin:0;z-index:auto;pointer-events:none}
.battle-world-open .battle-stage{position:fixed!important;inset:0;z-index:1;height:100vh!important}
.battle-world-open .battle-army{position:fixed!important;top:50%!important;transform:translateY(-50%);z-index:5;max-height:65vh;overflow-y:auto;scrollbar-width:thin;pointer-events:auto}
.battle-world-open .battle-red{left:10px!important}.battle-world-open .battle-blue{right:10px!important}
.battle-world-open .battle-meta{position:fixed;top:18px;left:50%;transform:translateX(-50%);width:auto;padding:4px 12px;background:#172019cc;border:1px solid #9b855440;border-radius:3px;pointer-events:auto}
.battle-world-open .battle-rosters{display:none}
.battle-world-open .battle-ruler{position:fixed;top:18px;right:18px;z-index:6}
.battle-world-open .battle-meter-grid{z-index:2}.battle-meter-grid polyline{vector-effect:non-scaling-stroke;stroke-width:1}
@media(max-width:700px){.battle-camera-controls{top:8px;left:8px;max-width:calc(100vw - 150px);font-size:10px;padding:7px}.battle-camera-controls>div{flex-wrap:wrap}.battle-world-open .battle-ruler{right:8px;top:8px;padding:6px;max-width:130px}.battle-world-open .battle-meta{top:auto;bottom:120px}.battle-world-open .battle-army{max-height:55vh}}
.woven-world{cursor:pointer}
/* Only terrain shaders reveal; this foreground cloth stays over the live battle. */
.world-flag-overlay{position:fixed;inset:0;z-index:500;pointer-events:none;opacity:1;will-change:opacity}
.world-flag-overlay *{pointer-events:none!important}
.battle-world-open .battle-camera-controls{top:76px}
.battle-camera-controls>.battle-lighting-controls{margin-top:7px;gap:8px}
.battle-camera-controls .battle-day-night{white-space:nowrap;font-variant-numeric:tabular-nums;color:#b9bfa9}
.battle-camera-controls select{color:#ead4a1;background:#303b2d;border:1px solid #8f805455;border-radius:3px;padding:4px;font:inherit;cursor:pointer}
.battle-camera-controls select:focus-visible{outline:2px solid #e8c888;outline-offset:2px}
@media(max-width:700px){.battle-world-open .battle-camera-controls{top:64px}}
/* Retracted faction flags meet the viewport edge on both sides. */
html:has(body[data-theme=tapestry]){scrollbar-gutter:auto;overflow-x:clip}

/* Keep the entrance free of the corner brand and development controls. */
[data-theme=tapestry] header.tapestry-header,

/* Soldier command UI belongs to the world, including after clicks on the entrance. */
[data-theme=tapestry]:not(.battle-world-open) .battle-direct-hud,
[data-theme=tapestry]:not(.battle-world-open) .battle-command-input,
[data-theme=tapestry]:not(.battle-world-open) .battle-order-menu,
[data-theme=tapestry]:not(.battle-world-open) .battle-command-toast,
[data-theme=tapestry]:not(.battle-world-open) .battle-order-cursor{display:none!important}

/* The entrance ends with the banners and battlefield, without lower-page copy. */
[data-theme=tapestry] .battle-meta,
[data-theme=tapestry] .battle-rosters,
[data-theme=tapestry] .battle-announcement,
[data-theme=tapestry] .tapestry-colophon,
[data-theme=tapestry] .weaver-notes,
[data-theme=tapestry] #app > footer{display:none!important}

/* Keep the textured backdrop continuous when the entrance content is shorter than the viewport. */
body[data-theme=tapestry]{min-height:100svh;display:flow-root;background-repeat:no-repeat,repeat;background-attachment:fixed}

/* The cloth itself is the navigation target. */
.woven-panel .woven-entry{position:absolute;inset:0;z-index:4;display:block;width:100%;height:100%;padding:0;border:0;background:transparent;cursor:pointer}
.woven-panel .woven-entry:focus-visible{outline:2px solid #d6bc7d;outline-offset:5px}

/* Match the desktop battlefield's final transparent surface before its async mount. */
@media(min-width:900px){[data-theme=tapestry] .battle-stage{background:none}}

/* Cloth, aged brass and engraved lettering shared by the entrance and world HUD. */
.woven-cloth{position:absolute;z-index:-1;pointer-events:none}
.woven-panel[data-cloth-ready=true]>.woven-source-art{visibility:hidden}
.woven-panels{--side-banner-height:510px}
.woven-panels .woven-panel{min-height:var(--side-banner-height)}
.woven-panels .woven-tool{min-height:calc(var(--side-banner-height) + 44px)}
@media(min-width:900px) and (max-height:900px){.woven-panels{--side-banner-height:clamp(350px,calc(100svh - 360px),510px)}}
@media(max-width:620px){.woven-panels{--side-banner-height:455px}}
body[data-theme=tapestry]{--inscription:"KaiTi","STKaiti","Noto Serif SC",serif;--hud-type:"Microsoft YaHei","PingFang SC",sans-serif;--hud-gold:#c5ab77;--hud-text:#d6cbb2;--hud-edge:#99805280;--hud-surface:linear-gradient(#24251de8,#111711f2),repeating-linear-gradient(90deg,#a99b6912 0 1px,#121912 1px 4px)}
[data-theme=tapestry] .tapestry-title h1{font-family:var(--inscription);font-weight:600;font-size:36px;letter-spacing:2px;color:#d4c29a;text-shadow:0 2px 3px #000b}
[data-theme=tapestry] .tapestry-title p{font-family:var(--hud-type);font-size:11px;letter-spacing:3px;color:#99927d}
[data-theme=tapestry] .woven-panel h2{font-family:var(--inscription);font-size:38px;font-weight:700;letter-spacing:3px;color:#ead5a0;text-shadow:0 2px 2px #251a10b3,0 -1px #fff0c52b;line-height:1.4}
[data-theme=tapestry] .woven-panel p{font-family:var(--hud-type);font-size:12px;line-height:2.2;letter-spacing:.5px;color:#e0ceb0;text-shadow:0 1px 3px #1a100cc9}
[data-theme=tapestry] .panel-number{font-family:Georgia,serif;color:#d7b978;letter-spacing:3px;opacity:.8}
[data-theme=tapestry] .stitch-rule{color:#cfb273;opacity:.65}
[data-theme=tapestry] .roll-links{font-family:var(--inscription)}
[data-theme=tapestry] .roll-links button{font-family:inherit;font-weight:700;font-size:16px}
[data-theme=tapestry] :is(.battle-camera-controls,.battle-command-input,.battle-order-menu,.battle-direct-hud,.battle-pickup-hint){background:var(--hud-surface);background-size:auto,420px;border:1px solid var(--hud-edge);border-radius:2px;color:var(--hud-text);box-shadow:inset 0 0 0 3px #090d0b,inset 0 0 0 4px #9b805526,0 6px 18px #0005;font-family:var(--hud-type);font-size:12px;line-height:1.8;text-shadow:0 1px 2px #000}
[data-theme=tapestry] .battle-camera-controls{padding:12px 15px}
[data-theme=tapestry] .battle-camera-controls>span{font-size:10px;letter-spacing:.5px;color:#a49b86;border-bottom:1px solid #9b805533;padding-bottom:7px;margin-bottom:8px}
[data-theme=tapestry] :is(.battle-camera-controls,.battle-command-input,.battle-order-menu) :is(button,select){border:1px solid #92764e6b;border-radius:1px;background:linear-gradient(#4241368a,#262a239c);color:#d9c59d;box-shadow:inset 0 1px #e4c48c17,0 1px 2px #0005;font-family:var(--hud-type);font-size:11px;transition:background .15s,border-color .15s}
[data-theme=tapestry] .battle-camera-controls select option{background:#20251e;color:#e0ceb0}
[data-theme=tapestry] :is(.battle-camera-controls,.battle-command-input,.battle-order-menu) button:hover{border-color:#c2a16a;background:linear-gradient(#665536b3,#3e3828b3);color:#f3dfb0}
[data-theme=tapestry] :is(.battle-camera-controls,.battle-command-input,.battle-order-menu) :is(button,select):focus-visible{outline:2px solid #d6b575;outline-offset:3px}
[data-theme=tapestry] :is(.battle-command-input,.battle-order-menu,.battle-direct-hud) strong{font-family:var(--inscription);font-weight:700;font-size:17px;letter-spacing:1px;color:#ddc18a}
[data-theme=tapestry] .battle-command-input{padding:12px 21px}
[data-theme=tapestry] .battle-command-input :is(span,small){color:#aaa28d}
[data-theme=tapestry] .battle-direct-hud:not([data-active=true]){padding:4px 11px;border-inline:0;box-shadow:none;background:linear-gradient(90deg,#131a15dd,#131a1570,transparent);opacity:1}
[data-theme=tapestry] .battle-direct-hud:not([data-active=true]) strong{font-size:13px;letter-spacing:.5px;font-weight:400}
[data-theme=tapestry] .command-groups button[aria-pressed=true]{color:#f0d6a1;border-color:#bda16a;background:#66523280;box-shadow:inset 0 -2px #c8aa70}
[data-theme=tapestry] :is(.battle-command-input,.battle-order-menu) kbd{border-color:#88714980;background:#0c100dc2;color:#c7ac79;font:11px Georgia,serif;padding:2px 5px}
[data-theme=tapestry] .battle-command-toast{font-family:var(--inscription);font-size:19px;color:#e1c591;border-color:#b2945c80;background:linear-gradient(90deg,transparent,#171b15f2 15%,#171b15f2 85%,transparent);box-shadow:none}
[data-theme=tapestry] .battle-add-ten{font:600 17px/1.4 Georgia,serif;min-height:30px;border-radius:1px;border-color:#a9915b80;background:linear-gradient(#3b3b2c80,#1c221bd9);box-shadow:inset 0 0 0 2px #141a15,0 2px 5px #0004}
[data-theme=tapestry] .battle-army h3{font-family:var(--hud-type);font-size:9px;letter-spacing:1px}
[data-theme=tapestry] .faction-banner span{font-family:var(--hud-type);color:#b7ab8b;text-shadow:0 1px 2px #000}
[data-theme=tapestry] .reward-balance{color:#c8ae78;font-size:18px}
[data-theme=tapestry] .reward-ring{background:transparent;box-shadow:none}
[data-theme=tapestry] .reward-ring .ring-fill{stroke:#af925b}
@media(min-width:900px) and (max-height:900px){[data-theme=tapestry] .tapestry-title h1{font-size:30px}[data-theme=tapestry] .woven-panel h2{font-size:32px}[data-theme=tapestry] .woven-panel p{font-size:11px}}
@media(max-width:700px){[data-theme=tapestry] .tapestry-title h1{font-size:28px}[data-theme=tapestry] .woven-panel h2{font-size:32px}[data-theme=tapestry] .battle-camera-controls{padding:9px;font-size:10px}[data-theme=tapestry] .battle-command-input{padding:9px 12px}[data-theme=tapestry] .battle-camera-controls>span{font-size:9px}[data-theme=tapestry] .battle-command-input strong{font-size:15px}}

/* Native Bannerlord typography: simkai uses regular weight, with ivory text and dark edging. */
body[data-theme=tapestry]{--inscription:"KaiTi","STKaiti",serif;--hud-type:"KaiTi","STKaiti",serif;font-synthesis:none}
[data-theme=tapestry] .tapestry-title h1{font-weight:400;letter-spacing:1px;color:#e8dfc8;text-shadow:0 1px 2px #000b}
[data-theme=tapestry] .tapestry-title p{letter-spacing:1px;font-size:12px;color:#ada692}
[data-theme=tapestry] .woven-panel h2{font-weight:400;letter-spacing:2px;color:#faf4de;text-shadow:0 1px 2px #000,1px 0 1px #0008,-1px 0 1px #0008}
[data-theme=tapestry] .woven-panel p{font-size:13px;letter-spacing:0;color:#e1d8c2;line-height:2;text-shadow:0 1px 2px #000b}
[data-theme=tapestry] .roll-links button{font-weight:400;color:#f0e6ce}
[data-theme=tapestry] :is(.battle-command-input,.battle-order-menu,.battle-direct-hud) strong{font-weight:400;letter-spacing:0;color:#faf4de}
[data-theme=tapestry] :is(.battle-camera-controls,.battle-command-input,.battle-order-menu) :is(button,select){font-size:13px;color:#e7ddc5}
[data-theme=tapestry] .battle-command-toast{font-weight:400;letter-spacing:0;color:#faf4de}
[data-theme=tapestry] .battle-camera-controls>span{font-size:12px;letter-spacing:0}
[data-theme=tapestry] .faction-banner span{font-size:11px;color:#d1c7b0}
@media(min-width:900px) and (max-height:900px){[data-theme=tapestry] .woven-panel p{font-size:12px}}
@media(max-width:700px){[data-theme=tapestry] .battle-camera-controls>span{font-size:10px}[data-theme=tapestry] :is(.battle-camera-controls,.battle-command-input,.battle-order-menu) :is(button,select){font-size:11px}}

[data-theme=tapestry] :is(.tapestry-title h1,.woven-panel h2){text-shadow:1px 2px 3px #090704,0 1px 1px #000}
[data-theme=tapestry] .woven-panel p{font-size:16px;line-height:1.9;color:#faf4de;opacity:1;text-shadow:0 1px 0 #090704}

[data-theme=tapestry] .woven-panel p{font-size:18px;line-height:1.85}
[data-theme=tapestry] .woven-panel>.medieval-icon{width:72px;height:72px;margin-top:28px;object-fit:contain}
[data-theme=tapestry] .woven-embroidery{display:block;width:138px;height:38px;margin:22px auto 0;opacity:.8}

/* Crisp screen-space lettering above the animated fabric. */
[data-theme=tapestry] .woven-panel>:is(h2,p,.medieval-icon,.woven-embroidery,.stitch-rule){position:relative;pointer-events:none}
[data-theme=tapestry] .woven-panel>:is(h2,p){color:#fff4db;text-shadow:0 1px 0 #22160b,1px 0 0 #22160b,-1px 0 0 #22160b}
[data-theme=tapestry] .woven-panel>.medieval-icon{color:#ffe2a3;stroke-width:2.8;opacity:1;filter:drop-shadow(0 2px 1px #201508)}
[data-theme=tapestry] .woven-embroidery{color:#f1ce89;stroke-width:1.7;opacity:1;filter:drop-shadow(0 1px 0 #201508)}
[data-theme=tapestry] .stitch-rule{color:#e6c685;opacity:.9}

/* Glow follows the transparent cloth silhouette, including the torn hem. */
[data-theme=tapestry] .woven-hang{filter:drop-shadow(0 0 0 transparent);transition:filter .22s ease-out}
[data-theme=tapestry] .woven-hang:has(>.woven-panel:is(:hover,:focus-within)){filter:drop-shadow(0 0 5px #ffe4a8c9) drop-shadow(0 0 17px #dbb66b80)}
[data-theme=tapestry] .woven-panel .woven-entry:focus-visible{outline:none}

/* Edge drawers: chosen nations stay open, other flags peek out on hover. */
[data-theme=tapestry] .battlefield[data-battle-layout=surround] .battle-army{position:fixed!important;top:50%!important;transform:translateY(-50%);width:70px;overflow:visible!important;max-height:none}
[data-theme=tapestry] .battlefield[data-battle-layout=surround] .battle-red{left:0!important;right:auto!important;--flag-peek:-36px}
[data-theme=tapestry] .battlefield[data-battle-layout=surround] .battle-blue{right:0!important;left:auto!important;--flag-peek:36px}
[data-theme=tapestry] .battle-flags{gap:7px!important}
[data-theme=tapestry] .faction-banner{transform:translateX(var(--flag-peek)) scale(.76);transition:transform .32s cubic-bezier(.2,.75,.25,1),border-color .25s,background-color .25s;transform-origin:center;border:1px solid transparent;border-radius:2px}
[data-theme=tapestry] .faction-banner:is(:hover,:focus-visible,[aria-pressed=true]){transform:translateX(0) scale(1)}
[data-theme=tapestry] .faction-banner[aria-pressed=true]{border-color:#dfc28c;background:#c6a76812;box-shadow:inset 0 0 0 2px #10171180}
[data-theme=tapestry] .faction-banner span{opacity:0;transition:opacity .2s}
[data-theme=tapestry] .faction-banner:is(:hover,:focus-visible,[aria-pressed=true]) span{opacity:1}
[data-theme=tapestry] .battle-command-input[data-active=false]{display:none!important}
/* A compact arc revolves around the currently displayed nation. */
[data-theme=tapestry] .battle-flags{position:relative;display:block!important;height:300px;width:70px;margin-top:8px}
[data-theme=tapestry] .battle-flags .faction-banner{position:absolute;top:110px;left:0;width:70px;transform:translate(var(--wheel-x,0px),var(--wheel-y,0px)) scale(var(--wheel-scale,.68));transition:transform .48s cubic-bezier(.22,.75,.25,1),filter .25s,border-color .2s;background:none;box-shadow:none;border-color:transparent}
[data-theme=tapestry] .battle-flags .faction-banner[data-player-selected=true]{border-color:#e4c98e;background:#c6a76812;box-shadow:inset 0 0 0 2px #10171180}
[data-theme=tapestry] .battle-flags .faction-banner span{opacity:0}
[data-theme=tapestry] .battle-flags .faction-banner[aria-pressed=true] span{opacity:1}
[data-theme=tapestry] .battle-flags .faction-banner:not([aria-pressed=true]) img{opacity:.8;filter:brightness(.9)}
[data-theme=tapestry] .battle-flags .faction-banner:not([aria-pressed=true]):hover img{opacity:1;filter:brightness(1.15)}
/* Native order cards, arranged along the top of the viewport. */
[data-theme=tapestry] .battle-order-menu{top:12px;bottom:auto;width:max-content;max-width:calc(100vw - 32px);padding:0;display:flex;gap:8px;background:none;border:0;box-shadow:none;overflow-x:auto;overflow-y:hidden}
[data-theme=tapestry] .battle-order-menu[hidden]{display:none}
[data-theme=tapestry] .battle-order-menu>strong,[data-theme=tapestry] .battle-order-menu>small{display:none}
[data-theme=tapestry] .battle-order-menu button{position:relative;display:flex;flex-direction:column;justify-content:flex-end;gap:0;flex:0 0 104px;width:104px;height:96px;padding:6px 3px;border:1px solid #9f937480;border-radius:3px;background:#302f29 url('../assets/order-ui/card.png') center/100% 100%;box-shadow:0 2px 5px #0008;color:#faf4de;text-align:center;font-size:13px;line-height:1.3}
[data-theme=tapestry] .battle-order-menu button:hover{background:#51442e url('../assets/order-ui/card.png') center/100% 100%;border-color:#f0cb78;box-shadow:inset 0 0 0 1px #e4b760,0 0 8px #e9b55b55}
[data-theme=tapestry] .battle-order-menu button img{width:60px;height:60px;object-fit:contain;margin:auto;filter:drop-shadow(0 1px 1px #000)}
[data-theme=tapestry] .battle-order-menu button kbd{position:absolute;right:4px;top:3px;margin:0;background:#151713;color:#f4e8ce;border-color:#b5a17b;padding:1px 4px;z-index:1}
[data-theme=tapestry] .battle-order-menu button span{display:block;white-space:nowrap;font-size:13px}
@media(max-width:900px){[data-theme=tapestry] .battle-order-menu{gap:4px;max-width:calc(100vw - 16px)}[data-theme=tapestry] .battle-order-menu button{flex-basis:84px;width:84px}[data-theme=tapestry] .battle-order-menu button span{font-size:11px}}
.faction-tooltip{position:fixed;z-index:100;pointer-events:none;box-sizing:border-box;min-width:84px;padding:8px 12px;border:0;background:linear-gradient(90deg,#161812dc,#161812f5 20%,#161812f5 80%,#161812dc);color:#faf4de;font:14px/1.4 KaiTi,STKaiti,serif;text-align:center;white-space:nowrap;text-shadow:0 1px 1px #000}
.faction-tooltip::before,.faction-tooltip::after{content:"";position:absolute;left:0;right:0;height:5px;background:url('../assets/faction-tooltip-rule.png') center/100% 100% no-repeat}
.faction-tooltip::before{top:0}.faction-tooltip::after{bottom:0}
.faction-tooltip[hidden]{display:none}
/* Faction controls belong to the entered world, not the home-page backdrop. */
body:not(.battle-world-open) [data-battle-army],
body:not(.battle-world-open) .faction-tooltip{display:none!important}

.battle-add-roles{display:none;position:fixed;top:8px;left:150px;z-index:45;gap:7px;pointer-events:auto}
.battle-add-roles[data-team="1"]{left:auto;right:150px}
.battle-world-open .battle-add-roles{display:flex}
.battle-add-roles button{min-width:48px;height:30px;padding:3px 9px;color:#dec996;background:#20251ddd;border:1px solid #9d885c;font:16px KaiTi,serif;cursor:pointer;text-shadow:0 1px 2px #000}
.battle-add-roles button:hover{background:#645438;box-shadow:0 0 8px #c9a86966}
.battle-add-roles button:focus-visible{outline:2px solid #ead399;outline-offset:2px}
@media(max-width:1000px){.battle-add-roles{left:12px;top:44px}.battle-add-roles[data-team="1"]{right:12px}.battle-add-roles button{min-width:36px;padding:3px 5px;font-size:14px}}



.battle-fullscreen-hint{position:fixed;left:50%;top:65px;transform:translateX(-50%);z-index:240;padding:10px 20px;background:#171e18e8;border:1px solid #ac935c;color:#e0ce9f;font:16px/1.5 KaiTi,serif;pointer-events:none}
.battle-add-roles button:disabled{opacity:.5;cursor:wait}

/* Mirror army reinforcement controls around the centre of the battlefield. */
.battle-add-roles{left:clamp(180px,13vw,250px)}
.battle-add-roles[data-team="1"]{left:auto;right:clamp(180px,13vw,250px);flex-direction:row-reverse}
.battle-add-roles button{width:50px;min-width:50px;padding-inline:4px}
.battle-add-roles button[data-add-role="mounted"]{width:80px;min-width:80px}
@media(max-width:1500px){.battle-add-roles{top:44px;left:220px}.battle-add-roles[data-team="1"]{right:220px}}
@media(max-width:1000px){.battle-add-roles{left:24px}.battle-add-roles[data-team="1"]{right:24px}.battle-add-roles button{width:36px;min-width:36px}.battle-add-roles button[data-add-role="mounted"]{width:66px;min-width:66px}}

[data-theme=tapestry] .battle-camera-controls{display:flex;align-items:center;gap:16px;white-space:nowrap;padding:10px 12px}
[data-theme=tapestry] .battle-camera-controls>.battle-day-night{margin:0;padding:0;border:0;font-size:13px;letter-spacing:0}
[data-theme=tapestry] .battle-camera-controls>.battle-distance-label{display:flex;align-items:center;gap:6px;margin:0}

body.battle-world-open .battle-direct-hud:not([data-active="true"]){display:none!important}
[data-theme=tapestry].battle-world-open .battle-camera-controls{top:24px}
.battle-basic-help{position:fixed;left:18px;top:102px;z-index:44;padding:12px 14px;color:#c9c1a6;background:linear-gradient(110deg,#172018d9,#141b15b8);border:1px solid #9d885c66;font:600 14px/1.75 "Microsoft YaHei","PingFang SC",sans-serif;pointer-events:none}
.battle-basic-help strong{display:block;color:#e4d2a3;font-size:15px;font-weight:700;margin-bottom:7px;letter-spacing:2px}
.battle-basic-help p{margin:4px 0}

body.battle-world-open .battle-direct-hud[data-active="true"]{top:400px}
@media(max-width:700px){.battle-basic-help{left:10px;top:140px;font-size:12px;padding:8px 10px}[data-theme=tapestry].battle-world-open .battle-camera-controls{top:80px}}

.battle-help-toggle{display:flex;align-items:center;gap:10px;padding:0;border:0;background:none;color:inherit;font:inherit;cursor:pointer;pointer-events:auto}
.battle-help-toggle strong{margin:0}
.battle-help-arrow{width:0;height:0;border-left:4px solid transparent;border-right:4px solid transparent;border-top:5px solid #d6be86;transition:transform .15s}
.battle-help-toggle[aria-expanded="false"] .battle-help-arrow{transform:rotate(-90deg)}
.battle-help-toggle:focus-visible{outline:1px solid #d6be86;outline-offset:5px}
#battle-help-content{margin-top:7px}

/* Keep the camera row centred and below the reinforcement row. */
[data-theme=tapestry].battle-world-open .battle-camera-controls{top:52px;display:flex;align-items:center;justify-content:center;gap:14px;padding:10px 12px;text-align:center}
[data-theme=tapestry] .battle-camera-controls>button{margin:0;min-height:32px;display:flex;align-items:center;justify-content:center;line-height:1.4}
[data-theme=tapestry] .battle-camera-controls>.battle-distance-label,[data-theme=tapestry] .battle-camera-controls>.battle-day-night{height:32px;display:flex;align-items:center;justify-content:center;margin:0;padding:0;line-height:1.4}
.battle-basic-help{top:120px}
@media(max-width:1500px){[data-theme=tapestry].battle-world-open .battle-camera-controls{top:88px}.battle-basic-help{top:156px}}

/* Match the camera information to the return button without a wide output cell. */
[data-theme=tapestry] .battle-camera-controls>.battle-distance-label,
[data-theme=tapestry] .battle-camera-controls>.battle-day-night{font-size:15px;color:#e3d4ad}
[data-theme=tapestry] .battle-camera-controls>.battle-distance-label{gap:5px}
[data-theme=tapestry] .battle-camera-controls output{min-width:0;width:auto;font:inherit;text-align:left}
html.world-entering :is(.battle-camera-controls,.battle-basic-help,.battle-minimap,.battle-add-roles,.battle-army,.steam-account){pointer-events:none!important}

.woven-map h2{line-height:1.35!important;font-size:clamp(22px,2.2vw,34px)!important}

/* Anchor ornaments beneath the copy; the longer middle flag lowers its ornament. */
[data-theme=tapestry] .woven-panel>.woven-embroidery{position:absolute;top:auto;bottom:92px;left:50%;transform:translateX(-50%);margin:0}
[data-theme=tapestry] .woven-panel h2{min-height:88px;display:flex;flex-direction:column;justify-content:center;margin-top:0;margin-bottom:0}
@media(max-width:620px){[data-theme=tapestry] .woven-panel>.woven-embroidery{bottom:60px}[data-theme=tapestry] .woven-panel h2{min-height:76px}}
@media(min-width:900px) and (max-height:900px){
 [data-theme=tapestry] .woven-panel>.medieval-icon{width:52px;height:52px;margin:14px auto 10px}
 [data-theme=tapestry] .woven-panel h2{min-height:74px;font-size:28px;letter-spacing:3px}
 [data-theme=tapestry] .woven-map h2{font-size:26px!important}
 [data-theme=tapestry] .woven-panel p{font-size:14px;line-height:1.8;margin-top:8px}
 [data-theme=tapestry] .woven-panel>.stitch-rule{margin:10px 0}
 [data-theme=tapestry] .woven-panel>.woven-embroidery{bottom:56px}
}

/* Larger entrance emblems share the original vertical slot with the headings. */
[data-theme=tapestry] .woven-panel>.homepage-emblem{width:96px;height:96px;margin:16px auto 5px}
@media(max-width:620px){[data-theme=tapestry] .woven-panel>.homepage-emblem{margin-bottom:1px}}
@media(min-width:900px) and (max-height:900px){[data-theme=tapestry] .woven-panel>.homepage-emblem{width:70px;height:70px;margin:5px auto 1px}}

body[data-theme=tapestry] #home-development-notice{position:fixed;inset:0;margin:auto;width:560px;max-width:calc(100vw - 40px);height:fit-content;max-height:calc(100dvh - 40px);box-sizing:border-box;padding:30px 32px 24px;border:1px solid #ad925a;border-radius:5px;background:linear-gradient(135deg,#2d372b,#1d2822);color:#ead7ad;text-align:center;box-shadow:0 15px 60px #0009}
#home-development-notice::backdrop{background:#070c09a6}
body[data-theme=tapestry] #home-development-notice:focus{outline:none}
body[data-theme=tapestry] #home-development-notice h2{margin:0 0 18px;font:24px/1.5 KaiTi,STKaiti,serif;letter-spacing:1px;color:#ecd19b}
body[data-theme=tapestry] #home-development-notice p{margin:0 0 26px;font:14px/1.9 "Microsoft YaHei",sans-serif;color:#d3ccb7;opacity:1}
body[data-theme=tapestry] #home-development-notice button{min-width:116px;padding:8px 26px;border:1px solid #c1a366;border-radius:2px;background:#75633c;color:#fff0c4;font:16px/1.5 KaiTi,serif;cursor:pointer}
#home-development-notice button:hover{background:#8a7447}#home-development-notice button:focus-visible{outline:2px solid #e7cd8b;outline-offset:4px}
@media(max-width:560px){body[data-theme=tapestry] #home-development-notice{padding:24px 20px}body[data-theme=tapestry] #home-development-notice h2{font-size:21px}}

body[data-theme=tapestry] #home-development-notice{width:700px;max-width:calc(100vw - 40px)}
body[data-theme=tapestry] #home-development-notice h2{font-size:23px}
body[data-theme=tapestry] #home-development-notice p{max-width:none;font:18px/1.7 KaiTi,STKaiti,serif;text-align:center;text-wrap:balance}
@media(max-width:560px){body[data-theme=tapestry] #home-development-notice h2{font-size:21px}body[data-theme=tapestry] #home-development-notice p{font-size:16px}}

/* The three banner captions share one size; explicit breaks keep their two lines. */
[data-theme=tapestry] .woven-panel p{font-size:clamp(10px,.89vw,17px);white-space:nowrap}
@media(max-width:620px){[data-theme=tapestry] .woven-panel p{font-size:17px}}

/* Resource actions report failures in the live battlefield, above its canvas. */
body[data-theme=tapestry].battle-world-open .battle-announcement[data-visible="true"]{display:block!important;position:fixed;top:auto;bottom:26vh;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 48px);height:auto;overflow:visible;clip-path:none;padding:12px 20px;box-sizing:border-box;z-index:120;color:#f0ddb2;background:#20251ef2;border:1px solid #b19a63;border-radius:3px;font:16px/1.6 KaiTi,serif;text-align:center;pointer-events:none}
