/* Battle HUD: information at the edges, expanded controls only on request. */
#game[data-screen=battle]>.hud-top{top:0;left:0;right:0;width:100%;max-width:none;padding:max(6px,env(safe-area-inset-top)) 10px 7px;background:linear-gradient(#102c40ec,#153847c9 82%,transparent);pointer-events:none}
#game[data-screen=battle] .hud-top .heading{display:flex;align-items:center;gap:7px;padding-inline-end:36px;min-height:30px;margin:0}
#game[data-screen=battle] .hud-top .mission-meta{display:flex;align-items:center;gap:7px;min-width:0;flex:1;white-space:nowrap}
#game[data-screen=battle] .hud-top .mission-meta #stage-label{font-size:11px;line-height:1.4;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:0;max-width:180px;overflow-wrap:normal}
#game[data-screen=battle] .hud-top .mission-meta>span{font-size:10px;line-height:1.4;white-space:nowrap}#game[data-screen=battle] .hud-top .mission-meta>small{display:none}
#game[data-screen=battle] .battle-wallet-resource{pointer-events:auto;display:block}#game[data-screen=battle] .battle-wallet-resource .wallet{height:32px;min-height:32px;min-width:73px;width:73px;padding:5px 10px;gap:3px}#game[data-screen=battle] .battle-wallet-resource .wallet .ui-art{width:21px;height:21px}#game[data-screen=battle] .battle-wallet-resource .wallet #coins{font-size:16px}#game[data-screen=battle] .battle-wallet-resource>.resource-caption{display:none}
#game[data-screen=battle] .base-health{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:2px 10px;margin-top:3px;max-width:none}#game[data-screen=battle] .base-health>.base-row{grid-column:1;grid-row:1;font-size:9px;line-height:1.2;margin:0}#game[data-screen=battle] .base-health>.health-track{grid-column:1;grid-row:2;height:4px;margin:0}#game[data-screen=battle] .base-health>.base-row.enemy,#game[data-screen=battle] .base-health>.health-track.enemy{grid-column:2}
.battle-intelligence{position:absolute;left:9px;top:max(7px,env(safe-area-inset-top));z-index:6;pointer-events:auto}.battle-intelligence>summary,.battle-toolbox>summary{display:flex;align-items:center;justify-content:center;list-style:none;cursor:pointer;width:32px;height:32px;padding:4px;border:1px solid #b6a16999;border-radius:9px;background:linear-gradient(#254d61,#102d40);box-shadow:0 2px #071b2b}.battle-intelligence>summary::-webkit-details-marker,.battle-toolbox>summary::-webkit-details-marker{display:none}.battle-intelligence>summary img,.battle-toolbox>summary img{width:24px;height:24px;object-fit:contain}.intelligence-content{position:absolute;left:0;top:39px;width:min(300px,calc(100vw - 20px));padding:9px;border:1px solid #baa669;border-radius:13px;background:#123246f5;box-shadow:0 5px #051a2cc7}.intelligence-content .power-strip{margin:0;gap:5px}.intelligence-content>p{font-size:10px;color:#afcbd2;margin:7px 2px 0;line-height:1.5}
#game[data-screen=battle]>.view-tools{display:flex;flex-direction:row;align-items:center;gap:5px;left:10px;right:auto;top:calc(var(--hud-bottom) + 4px);grid-template-columns:none;max-width:none;pointer-events:auto}
#game[data-screen=battle] .view-tools>.icon-button,#game[data-screen=battle] .view-tools>.battle-toolbox>summary{width:36px;height:36px;min-width:36px;min-height:36px;padding:4px;border-radius:10px;box-sizing:border-box}#game[data-screen=battle] .view-tools>.icon-button .ui-art{width:28px;height:28px}.view-tools .battle-speed{font:800 15px/1 Arial,sans-serif;color:#ffedb1;background:linear-gradient(#31596b,#15364b);border:1px solid #b7a36e}.view-tools .battle-speed[aria-pressed=true]{background:linear-gradient(#ba923a,#775923);border-color:#ffe299}
.battle-toolbox{position:relative}.toolbox-content{position:absolute;top:43px;left:0;width:153px;display:grid;grid-template-columns:repeat(3,43px);gap:6px;padding:7px;border:1px solid #aa975f;border-radius:13px;background:#112e43f5;box-shadow:0 4px #051c2b;box-sizing:content-box}#game[data-screen=battle] .toolbox-content .icon-button{width:43px;height:43px;min-width:43px;min-height:43px}
#game[data-screen=battle]>#castle-energy{display:none}#game[data-screen=battle]>.build-entry{display:none}
#game[data-screen=battle]>.hud-top{position:absolute;inset:0 0 auto;width:100%;max-width:none;min-height:62px;display:grid;grid-template-columns:minmax(200px,1fr) minmax(230px,.7fr);align-items:center;gap:18px;padding:8px 16px 9px 226px;box-sizing:border-box;border-bottom:1px solid #c1a36899;background:linear-gradient(180deg,#163b4df7,#102c40eb);box-shadow:0 3px 0 #041a2866}
#game[data-screen=battle] .hud-top .heading{padding:0;min-height:35px;gap:12px}#game[data-screen=battle] .hud-top .mission-meta{gap:12px}#game[data-screen=battle] .hud-top .mission-meta #stage-label{max-width:270px;font-size:13px}#game[data-screen=battle] .hud-top .mission-meta>span{font-size:11px}#game[data-screen=battle] .hud-top .base-health{margin:0;gap:3px 12px;width:100%;max-width:480px;justify-self:end}#game[data-screen=battle] .hud-top .base-row{font-size:11px;line-height:1.3}#game[data-screen=battle] .hud-top .health-track{height:5px}
#game[data-screen=battle]>.view-tools{position:absolute;top:12px;left:12px;right:auto;display:flex;flex-direction:row;gap:5px;padding:0;max-width:none;background:transparent;border:0;box-shadow:none;z-index:13}#game[data-screen=battle]>.hud-top>.battle-intelligence{position:absolute;left:177px;top:14px;z-index:14}#game[data-screen=battle] .battle-intelligence>summary{width:32px;height:32px;box-sizing:border-box}#game[data-screen=battle] .intelligence-content{left:0;top:45px}#game[data-screen=battle] .toolbox-content{top:45px}
@media(max-width:1000px) and (min-width:741px){#game[data-screen=battle]>.hud-top{grid-template-columns:minmax(170px,1fr) minmax(185px,.8fr);padding-left:216px;gap:12px}#game[data-screen=battle] .hud-top .mission-meta{gap:6px;flex-wrap:wrap}#game[data-screen=battle] .hud-top .mission-meta #stage-label{max-width:160px;font-size:12px}#game[data-screen=battle] .hud-top .mission-meta>span{font-size:10px}#game[data-screen=battle]>.hud-bottom{gap:5px 7px;padding-inline:10px}#game[data-screen=battle] .hud-bottom .deployment-strip{gap:5px}#game[data-screen=battle] .deployment-strip>#build-entry{min-width:65px;font-size:11px;padding-inline:7px}#game[data-screen=battle] .deployment-strip>#deployment-picker{font-size:12px;padding-inline:7px}#game[data-screen=battle] .combat-action .combat-action-label{font-size:12px}}
@media(max-width:740px){#game[data-screen=battle]>.hud-top{display:block;inset:0 0 auto;min-height:76px;padding:max(6px,env(safe-area-inset-top)) 10px 8px;max-width:none;width:100%;gap:0}#game[data-screen=battle] .hud-top .heading{min-height:33px;padding-left:190px;gap:5px}#game[data-screen=battle] .hud-top .mission-meta{min-width:0;gap:0}#game[data-screen=battle] .hud-top .mission-meta #stage-label{font-size:11px;max-width:180px}#game[data-screen=battle] .hud-top .mission-meta>span{position:absolute;right:10px;top:46px;font-size:10px;line-height:1.3}#game[data-screen=battle] .battle-wallet-resource .wallet{width:65px;min-width:65px;height:31px;min-height:31px;padding:5px 7px}#game[data-screen=battle] .battle-wallet-resource .wallet #coins{font-size:15px}#game[data-screen=battle] .battle-wallet-resource .wallet .ui-art{width:20px;height:20px}#game[data-screen=battle] .hud-top .base-health{width:auto;max-width:none;margin:4px 82px 0 0;gap:2px 8px}#game[data-screen=battle] .hud-top .base-row{font-size:10px;line-height:1.3}#game[data-screen=battle] .hud-top .health-track{height:4px}
#game[data-screen=battle]>.view-tools{top:8px;left:8px;gap:4px}#game[data-screen=battle] .view-tools>.icon-button,#game[data-screen=battle] .view-tools>.battle-toolbox>summary{width:32px;height:32px;min-width:32px;min-height:32px;padding:3px}#game[data-screen=battle] .view-tools>.icon-button .ui-art{width:25px;height:25px}#game[data-screen=battle]>.hud-top>.battle-intelligence{left:155px;top:8px}#game[data-screen=battle] .battle-intelligence>summary{width:32px;height:32px}#game[data-screen=battle] .intelligence-content{top:68px;left:-145px;width:min(300px,calc(100vw - 20px));box-sizing:border-box}#game[data-screen=battle] .toolbox-content{top:68px;left:-108px}
}
@media(max-width:350px){#game[data-screen=battle] .hud-top .heading{padding-left:184px}#game[data-screen=battle] .battle-wallet-resource .wallet{width:58px;min-width:58px;padding-inline:4px}#game[data-screen=battle] .hud-top .mission-meta #stage-label{font-size:10px}#game[data-screen=battle] .combat-action .combat-action-label{font-size:11px}#game[data-screen=battle] .combat-action .action-art{width:18px;height:18px}#game[data-screen=battle] .combat-action .combat-cost{width:31px;min-width:31px}#game[data-screen=battle] .combat-cost img{width:12px;height:12px}#game[data-screen=battle] .combat-cost b{font-size:9px}}
#game[data-screen=battle]>.view-tools{direction:ltr}.toolbox-content{direction:rtl}
#game[data-screen=battle]>.hud-top,#game[data-screen=battle]>.hud-bottom{border-radius:0}
#game[data-screen=battle]>#current-build{display:none}
@media(max-width:740px){#game[data-screen=battle] .hud-top .base-health{width:calc(100% - 82px);justify-self:stretch}}

/* Wave text and the two health bars occupy separate cells. */
#game[data-screen=battle]>.hud-top{
 grid-template-columns:minmax(0,1fr) auto minmax(156px,.8fr);grid-template-rows:auto;gap:9px;
}
#game[data-screen=battle] .hud-top .heading{grid-area:1/1;min-width:0}
#game[data-screen=battle] .hud-top .base-health{grid-area:1/3;width:100%;min-width:0;margin:0}
#game[data-screen=battle] .hud-top .mission-wave{
 grid-area:1/2;color:#f1eed7;font-size:11px;line-height:1.3;white-space:nowrap;
}
@media(max-width:740px){
 #game[data-screen=battle]>.hud-top{
  display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;
  gap:4px 12px;min-height:0;
 }
 #game[data-screen=battle] .hud-top .heading{grid-area:1/1/2/-1}
 #game[data-screen=battle] .hud-top .base-health{grid-area:2/2}
 #game[data-screen=battle] .hud-top .mission-wave{grid-area:2/1;font-size:10px}
}

/* Receipts use the actual transaction stats, not a paragraph to decipher. */
#upgrade-receipt{width:min(480px,calc(100vw - 24px));max-width:480px;box-sizing:border-box;gap:12px;padding:14px;align-items:center}
#upgrade-receipt>img{width:80px;height:80px;flex:none;object-fit:contain}
#upgrade-receipt>div{flex:1;min-width:0}
#upgrade-receipt strong#receipt-title{display:block;font-size:22px;line-height:1.35}
#upgrade-receipt p{font-size:16px;line-height:1.4}
#upgrade-receipt p[hidden]{display:none}
#upgrade-receipt small{display:block;font-size:14px;margin-top:9px;color:#ffdf8d}
#receipt-stats{display:flex;gap:10px;margin-top:10px}
#receipt-stats:empty{display:none}
.receipt-stat{flex:1;padding:7px 10px;background:#0c2a3d;border:1px solid #61878b;border-radius:9px;text-align:center}
.receipt-stat>span{display:block;font-size:15px;color:#d6e9e5}
.receipt-stat>div{display:flex;align-items:center;justify-content:center;gap:8px;font:800 25px/1.3 Arial,sans-serif;font-variant-numeric:tabular-nums}
.receipt-stat b{color:#bacbd0;font-size:20px}.receipt-stat strong{color:#e0ffb4;font-size:27px}.receipt-stat>div>span{font-size:20px;color:#f3d482}
#receipt-close{width:36px;height:36px;min-height:36px}
@media(max-width:740px){
 #upgrade-receipt{padding:12px;gap:8px}#upgrade-receipt>img{width:62px;height:72px}#upgrade-receipt strong#receipt-title{font-size:20px}#receipt-stats{gap:6px}.receipt-stat{padding:6px}.receipt-stat>div{gap:5px}.receipt-stat strong{font-size:25px}#upgrade-receipt small{font-size:13px}
}
@media(max-height:550px) and (min-width:480px){
 #upgrade-receipt{top:8px;padding:10px}#upgrade-receipt>img{width:64px;height:64px}#receipt-stats{margin-top:5px}#upgrade-receipt small{margin-top:5px}
}

/* Home: original illustration, a single play action, and individual side emblems. */
#home-screen .home-command{display:contents;position:static;transform:none}
#home-screen :is(.home-title>p,.title-rule,.home-route,.home-version,.home-play-context,.selected-mission>img,#home-mode,#home-detail){display:none}
#home-screen .home-shade{background:linear-gradient(90deg,#071c3566,transparent 40%),linear-gradient(0deg,#081e36a6,transparent 42%)}
#home-screen .home-top{display:flex;justify-content:flex-start;gap:24px;top:18px;left:24px;right:24px;width:auto;max-width:none}
#home-screen .home-resource{display:flex;align-items:center;gap:5px}
#home-screen .home-resource-caption{display:none}
#home-screen :is(.home-treasury,.home-progress){display:flex;align-items:center;gap:7px;width:auto;min-width:0;height:50px;min-height:50px;padding:0;background:none;border:0;border-radius:0;box-shadow:none}
#home-screen :is(.home-treasury,.home-progress)>img{width:42px;height:42px;object-fit:contain}
#home-screen :is(.home-treasury,.home-progress)>b{font:800 26px/1 Arial,sans-serif;color:#ffecad;text-shadow:0 2px 4px #061a30}
#home-screen #home-settings{margin-inline-start:auto;width:52px;height:52px;background:none;border:0;box-shadow:none}
#home-screen #home-settings img{width:44px;height:44px}
#home-screen .home-title{top:17%;right:7%;left:auto;width:340px;text-align:center}
#home-screen .home-title h1{font-size:66px}
#home-screen .home-title h1 span{font-size:86px}
#home-screen .home-links{position:absolute;left:24px;right:auto;top:50%;bottom:auto;transform:translateY(-50%);display:flex;flex-direction:column;gap:16px;margin:0;width:88px;padding:0;background:none;border:0}
#home-screen .home-links button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-height:78px;padding:0;background:none;border:0;border-radius:0;box-shadow:none;color:#fff0bc;font-size:15px;text-shadow:0 2px 3px #06172f}
#home-screen .home-links img{width:60px;height:60px;object-fit:contain;filter:drop-shadow(0 4px 3px #061b32aa)}
#home-screen .selected-mission{position:absolute;right:7%;left:auto;bottom:158px;width:340px;padding:0;margin:0;display:flex;align-items:center;justify-content:center;gap:12px;border:0;border-radius:0;background:none;box-shadow:none}
#home-screen .selected-mission h2{font-size:25px;text-shadow:0 2px 4px #071b2e}
#home-screen .mission-medal{width:40px;height:48px}
#home-screen #home-play{position:absolute;right:7%;left:auto;bottom:54px;width:340px;min-height:82px;padding:10px 22px;display:flex;justify-content:center;align-items:center;gap:12px;font-size:27px}
#home-screen #home-play>img{width:52px;height:52px}
#home-screen #home-play>span{font-size:27px;white-space:nowrap}
@media(max-width:600px){
 #home-screen .home-top{left:12px;right:12px;top:12px;gap:20px}
 #home-screen .home-title{right:12px;left:82px;width:auto;top:16%}
 #home-screen .home-title h1{font-size:48px}#home-screen .home-title h1 span{font-size:64px}
 #home-screen .home-links{left:8px;top:48%;width:64px;gap:16px}
 #home-screen .home-links button{min-height:66px;font-size:12px}
 #home-screen .home-links img{width:50px;height:50px}
 #home-screen .selected-mission{right:12px;left:82px;width:auto;bottom:136px;gap:6px}
 #home-screen .selected-mission h2{font-size:21px}
 #home-screen #home-play{right:12px;left:82px;width:auto;bottom:36px;min-height:78px;padding:8px;font-size:23px;gap:8px}
 #home-screen #home-play>span{font-size:23px}#home-screen #home-play>img{width:44px;height:44px}
}
@media(max-height:550px) and (min-width:480px){
 #home-screen .home-top{top:8px;left:12px;right:12px;gap:20px}
 #home-screen :is(.home-treasury,.home-progress){height:40px;min-height:40px}
 #home-screen :is(.home-treasury,.home-progress)>img{width:32px;height:32px}
 #home-screen :is(.home-treasury,.home-progress)>b{font-size:23px}
 #home-screen #home-settings{width:42px;height:42px}#home-screen #home-settings img{width:38px;height:38px}
 #home-screen .home-title{top:23%;right:24px;left:auto;width:240px}
 #home-screen .home-title h1{font-size:34px}#home-screen .home-title h1 span{font-size:44px}
 #home-screen .home-links{left:10px;top:66px;bottom:10px;transform:none;gap:4px;justify-content:space-evenly;width:66px}
 #home-screen .home-links button{min-height:46px;font-size:11px;gap:1px}
 #home-screen .home-links img{width:36px;height:36px}
 #home-screen .selected-mission{right:24px;left:auto;bottom:100px;width:240px;gap:6px}
 #home-screen .selected-mission h2{font-size:20px}
 #home-screen .mission-medal{width:32px;height:38px}
 #home-screen #home-play{right:24px;left:auto;bottom:22px;width:240px;min-height:64px;padding:8px 12px}
 #home-screen #home-play>span{font-size:22px}#home-screen #home-play>img{width:42px;height:42px}
}
/* Compact command controls. Variable width is reserved for long, isolated actions. */
#game{
 --command-face:#214255;
 --command-rim:#496678;
 --command-shade:#0d2533;
 --command-ink:#f9f4df;
 --command-primary:#ddbc69;
 --command-primary-ink:#211d13;
 --command-tile:52px;
}
#game :is(.plate-button,.primary-button,.game-action,#home-play)::before,
#game :is(.plate-button,.primary-button,.game-action,#home-play)::after{content:none}
#game button:focus-visible,#game summary:focus-visible{outline:2px solid #fae6a9;outline-offset:2px}
#game button:disabled{cursor:default}

#game[data-screen=battle]>.hud-top{border:0;box-shadow:none;background:linear-gradient(#402337d9,transparent)}
#game[data-screen=battle] .battle-wallet-resource .wallet{background:none;border:0;box-shadow:none}
#home-screen{transition:none}
#game>#current-build{display:none}

#game[data-screen=battle]>.hud-bottom{
 position:fixed;display:grid;inset:auto 0 0;transform:none;margin:0;width:100%;max-width:none;height:auto;min-height:0;box-sizing:border-box;
 padding:0 max(8px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px,env(safe-area-inset-left));
 grid-template-columns:minmax(0,1fr);gap:3px;justify-items:center;background:none;border:0;box-shadow:none;overflow:visible;pointer-events:none;
}
#game[data-screen=battle] .hud-bottom .battle-info{
 position:static;inset:auto;transform:none;display:flex;align-items:center;grid-area:auto;margin:0;gap:9px;
 width:max-content;max-width:100%;font-size:11px;color:#f4f1de;text-shadow:0 1px 4px #071b2a;
 pointer-events:none;
}
#game[data-screen=battle] .hud-bottom .combat-context{display:none}
#deployment-summary{white-space:nowrap;color:#fff0be;font-size:12px}
#boost-context{font-size:11px;color:#ead18a}
.field-status{
 display:flex;justify-content:space-between;align-items:center;width:min(100%,294px);
 gap:5px;min-height:19px;color:#fcf4d4;text-shadow:0 1px 4px #071b2a;font-size:12px;
}
.deployment-energy-badge{display:flex;align-items:center;gap:4px;color:#d7ece4;font:800 13px/1 Arial,sans-serif;white-space:nowrap}
.field-status .deployment-energy-badge{position:static;font-size:13px;height:18px}
.field-status .deployment-energy-badge img{width:14px;height:16px}
.field-actions{
 display:grid;grid-template-columns:repeat(5,var(--command-tile));gap:5px;
 align-items:start;justify-content:center;pointer-events:none;
}
#game[data-screen=battle] .field-actions .combat-action{
 position:static;display:grid;justify-items:center;grid-area:auto;width:auto;height:auto;gap:2px;pointer-events:none;
}
#game .field-actions :is(.combat-action>button,#deployment-picker,#build-entry),
#deployment-panel .deployment-roles button,
#deployment-panel :is(#apply-deployment,#close-deployment),
#game .planning-actions>button,
#game .quick-weapon{
 position:relative;inset:auto;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;
 flex:none;box-sizing:border-box;width:var(--command-tile);height:var(--command-tile);min-width:0;min-height:0;
 margin:0;padding:3px;background:var(--command-face);border:1px solid var(--command-rim);
 border-radius:5px;box-shadow:inset 0 -2px var(--command-shade);color:var(--command-ink);
 font:800 12px/1 'Baloo Game',sans-serif;text-shadow:none;white-space:nowrap;pointer-events:auto;
}
#game .field-actions :is(.combat-action>button,#deployment-picker,#build-entry)>img,
#deployment-panel .deployment-roles button>img,
#deployment-panel :is(#apply-deployment,#close-deployment)>img,
#game .planning-actions>button>img,#game .quick-weapon>img{
 display:block;position:static;width:29px;height:29px;margin:0;transform:none;object-fit:contain;
 filter:drop-shadow(0 1px 1px #081d2a80);
}
#game .field-actions .combat-action-label{font-size:12px;line-height:1}
#game .field-actions .deploy-button:not(:disabled),
#game #deployment-panel #apply-deployment,#game .planning-actions>#planning-start{
 background:var(--command-primary);border-color:#f3da94;box-shadow:inset 0 -2px #98743b;color:var(--command-primary-ink);
}
#game[data-screen=battle] .field-actions .combat-cost{
 display:flex;align-items:center;justify-content:center;direction:ltr;
 position:static;margin:0;padding:0 4px;min-width:0;width:auto;height:17px;gap:2px;
 background:#102b39;border:0;border-radius:3px;color:#fff3ca;font-size:12px;
}
#game .field-actions .combat-cost.complete img{display:none}
#game .field-actions .combat-cost b{font:800 12px/1 Arial,sans-serif}
#game .field-actions .combat-cost img{width:14px;height:14px}
#game .field-actions button:disabled{opacity:.55;filter:saturate(.55)}
#game[data-mode=planning]>.hud-bottom,
#game[data-mode=quick-build]>.hud-bottom,
#game[data-mode=building]>.hud-bottom,
#game[data-mode=moving]>.hud-bottom{visibility:hidden}
#game:has(>#deployment-panel:not([hidden]))>:is(.hud-bottom,.planning-bar){display:none}

#game>#deployment-panel{
 position:fixed;inset:auto 0 0;box-sizing:border-box;width:100%;margin:0;
 padding:0 max(4px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left));
 z-index:15;pointer-events:none;
}
#game>#deployment-panel[hidden],#game>.planning-bar[hidden]{display:none}
#deployment-panel .formation-surface{
 display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:3px;
}
#deployment-panel .deployment-roles{display:contents}
#game #deployment-panel .formation-surface button{width:100%;height:56px;min-height:44px}
#game #deployment-panel .deployment-roles button img{object-view-box:inset(8% 16% 8% 10%);width:32px;height:32px}
#deployment-panel .selection-check{display:none;position:absolute;width:11px;height:11px;top:2px;right:2px;background:#f1d188;border-radius:50%}
#deployment-panel [aria-pressed=true]>.selection-check{display:block}
#deployment-panel .selection-check::after{content:'';position:absolute;width:5px;height:3px;left:2px;top:2px;border-left:2px solid #213d42;border-bottom:2px solid #213d42;transform:rotate(-45deg)}
#game #deployment-panel #formation-cycle{
 position:relative;display:grid;align-content:start;justify-items:center;box-sizing:border-box;
 padding:4px 0 0;pointer-events:auto;
 --tile-light:#906487;--tile-mid:#74405f;--tile-dark:#4e304d;--tile-line:#b88caa;--tile-rim:#e1b9cb;--tile-edge:#402439;
}
#deployment-panel .formation-cycle-arrow{
 position:absolute;inset:3px 3px auto auto;color:#e4ead4;font:800 12px/1 Arial,sans-serif;pointer-events:none;
}
#deployment-panel .formation-count-medallion{
 display:grid;place-items:center;width:26px;height:26px;border-radius:50%;box-sizing:border-box;
 border:1px solid #96c3d1;background:radial-gradient(circle at 35% 20%,#426a7d,#192e42 80%);
 box-shadow:inset 0 1px #ffffff35,0 2px 2px #101c2a9c;color:#fffae6;font:800 17px/1 Arial,sans-serif;
}
#deployment-panel #formation-cycle>.formation-count-medallion{
 border-color:#fce3a1;background:radial-gradient(circle at 35% 20%,#f8d687,#ba8033 80%);
 color:#342410;text-shadow:none;
}
#deployment-panel .formation-size-cost{
 position:absolute;display:flex;justify-content:center;align-items:center;gap:2px;inset:auto 0 4px;pointer-events:none;
 color:#d5ebe7;font:800 10px/1 Arial,sans-serif;
}
#deployment-panel .formation-size-cost img{width:10px;height:11px}
.formation-accessible{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
#deployment-panel .formation-size-cost.unaffordable{color:#ffbf96}
#game #deployment-panel #close-deployment img{width:22px;height:22px}
#deployment-panel button:focus-visible{outline-offset:1px}

#game>.planning-bar{
 width:min(100% - 16px,294px);inset:auto 0 env(safe-area-inset-bottom);margin:0 auto;transform:none;
 display:grid;grid-template-columns:auto;box-sizing:border-box;gap:4px;padding:5px 8px;justify-items:center;border:0;
 background:#102b3be8;border-radius:6px 6px 0 0;box-shadow:none;
}
#game .planning-bar .planning-prepared{display:flex;align-items:center;gap:5px}
#game .planning-prepared>img{width:23px;height:23px}
#game #planning-formation-summary{font-size:13px}
#game .planning-actions{display:grid;grid-template-columns:repeat(3,var(--command-tile));gap:5px}

#game .quick-build{width:min(100% - 16px,292px)}
#game .quick-weapons{grid-template-columns:repeat(4,var(--command-tile));justify-content:center;gap:5px}
#game .quick-close,#game .quick-all{background:var(--command-face);border:1px solid var(--command-rim);border-radius:5px;text-shadow:none}
#game .quick-weapon>span{line-height:1;font-size:11px;min-width:0;padding:0}
#game .quick-option .price-badge{height:19px;min-height:19px;border-radius:4px;padding:0 5px}
#game .quick-option .price-badge img{width:14px;height:14px}
#game .quick-option .price-badge b{font-size:12px}
#game :is(#placement-dock,#tower-dock){width:min(280px,100% - 18px);grid-template-columns:58px minmax(0,1fr)}
#game :is(#placement-art,#tower-art){width:58px;height:58px}
#game :is(#placement-dock,#tower-dock) .plate-button{min-width:0;min-height:44px;padding:4px 7px;font-size:13px}
#game :is(#placement-dock,#tower-dock) .plate-button img{width:23px;height:23px}
#game #move-cancel{min-width:58px;height:44px;font-size:13px;padding:4px 6px}
#game #move-cancel .ui-art{width:16px;height:16px}
#game :is(.field-actions,#deployment-panel,.planning-actions,.quick-build) button:active:not(:disabled){filter:brightness(.83)}

@media (max-height:550px) and (min-width:640px){
 #game>.planning-bar{margin-inline:0 auto}
 #game[data-screen=battle]>.hud-bottom{justify-items:start}
}
@media(prefers-reduced-motion:reduce){
 #deployment-panel,#deployment-panel button{animation:none;transition:none;scroll-behavior:auto}
}

/* Each tile has a lit face, a bevel and a load-bearing edge. */
#game{
 --tile-light:#4d819a;
 --tile-mid:#2b546b;
 --tile-dark:#173348;
 --tile-edge:#102638;
 --tile-line:#71a0af;
 --tile-rim:#b8d8da;
}
#game :is(.plate-button,.primary-button,.game-action,.panel-close,.command-tab,.icon-button,.shop-tab,.upgrade-action,.nav-back,.quick-close,.quick-all,.world-browse-arrow,.building-upgrade,.reward-button,.secondary-button,#home-play),
#game #overlay #primary,
#game #overlay .secondary-button,
#game[data-screen=battle] .field-actions :is(.combat-action>button,#deployment-picker,#build-entry),
#game :is(.formation-surface,.planning-actions) button,
#game :is(.battle-toolbox,.battle-intelligence)>summary,
#game :is(.shop-weapon,.stage-node,.home-links button,#home-settings,#home-play,.quick-weapon){
 background:var(--tile-pattern,none),radial-gradient(ellipse at 22% 0%,#ffffff36,transparent 63%),
  linear-gradient(153deg,var(--tile-light),var(--tile-mid) 52%,var(--tile-dark));
 background-size:108px 42px,100% 100%,100% 100%;
 background-position:center;
 background-repeat:repeat,no-repeat,no-repeat;
 border:1px solid var(--tile-line);
 border-bottom:3px solid var(--tile-edge);
 border-radius:6px;
 box-shadow:inset 0 1px 0 var(--tile-rim),inset 1px 0 #ffffff19,inset -1px 0 #0b172d54,0 2px 3px #09152272;
 color:var(--tile-ink,#fff5df);
 text-shadow:0 1px 1px #071727;
 transition:filter .12s ease,transform .12s ease,border-color .12s ease;
}
#game :is(.gold,.primary-button,#home-play,#planning-start,#apply-deployment,#deploy:not(:disabled)){
 --tile-light:#ffdb83;--tile-mid:#c78b35;--tile-dark:#935c23;--tile-line:#ffda8a;--tile-rim:#fff4c4;--tile-edge:#553414;
}
#game :is(.red,.danger,#placement-cancel,#close-deployment,#move-cancel){
 --tile-light:#b36958;--tile-mid:#89483d;--tile-dark:#5f3030;--tile-line:#c08167;--tile-rim:#edb49d;--tile-edge:#3e2024;
}
#game :is(.field-actions,.formation-surface,.planning-actions,.quick-build) button[aria-pressed=true],
#game :is(.command-tab,.shop-tab).selected{
 --tile-light:#679a77;--tile-mid:#3e6c62;--tile-dark:#2b494c;--tile-line:#e7c477;--tile-rim:#ffe8ae;--tile-edge:#302c24;
}
#game #deployment-panel .deployment-roles button[aria-pressed=true],
#game #deployment-panel #apply-deployment,
#game #deployment-panel #close-deployment,
#game .planning-actions>#planning-start,
#game .field-actions #deploy:not(:disabled){
 background-image:var(--tile-pattern,none),radial-gradient(ellipse at 25% 0%,#ffffff42,transparent 65%),linear-gradient(153deg,var(--tile-light),var(--tile-mid) 54%,var(--tile-dark));
 border-color:var(--tile-line);border-bottom-color:var(--tile-edge);
 color:#fff5df;box-shadow:inset 0 1px var(--tile-rim),inset 1px 0 #ffffff22,0 2px 3px #09152272;
}
#game :is(button,summary):active:not(:disabled){filter:brightness(.86)}
#game button:active:not(:disabled)>img{translate:0 1px}
/* A sheer woven motif brings texture to the faces without filling the rail gaps. */
#game[data-screen=battle] :is(.hud-bottom,.view-tools,.battle-intelligence,#deployment-panel,.planning-bar,.quick-build,.placement-dock,.tower-dock,.move-tools){
 --tile-pattern:url('assets/ui/field-weave.png');
 --tile-light:#ad7394;--tile-mid:#80506f;--tile-dark:#58354f;--tile-edge:#442339;
 --tile-line:#c49ab0;--tile-rim:#f1c4cc;--tile-ink:#fff4e1;
}
#game[data-screen=battle] :is(.field-actions,.formation-surface,.planning-actions,.quick-build) button[aria-pressed=true]{
 --tile-light:#aa7067;--tile-mid:#8b504e;--tile-dark:#65323c;--tile-edge:#482333;
 --tile-line:#ffd292;--tile-rim:#ffe3a3;
}
#game[data-screen=battle] :is(.planning-bar,.quick-build){
 background:var(--tile-pattern),radial-gradient(ellipse at 30% 15%,#ac668976,transparent 72%),
  linear-gradient(160deg,#5d314ffc,#3f243bef 72%);
 background-size:144px 56px,100% 100%,100% 100%;
 box-shadow:inset 0 1px #c498b183;
}
#game .quick-build{padding:5px 6px;border:1px solid #a57493;border-radius:6px;box-shadow:inset 0 1px #d9acc1,0 3px 5px #2c142980}
#game .field-actions{gap:3px}
@media(prefers-reduced-motion:reduce){
 #game :is(button,summary){transition:none}
 #game button:active:not(:disabled)>img{translate:none}
}

/* Command pages share the field's woven material, with bronze relief on the page rail. */
#game :is(#command-page,#home-screen,#overlay){
 --tile-pattern:url('assets/ui/field-weave.png');
 --tile-light:#9b647f;
 --tile-mid:#69405c;
 --tile-dark:#47283e;
 --tile-edge:#29162a;
 --tile-line:#b6859c;
 --tile-rim:#e9b9ce;
 --tile-ink:#fff4e1;
 --command-relief:url('assets/ui/command-relief.webp');
 --command-panel:radial-gradient(ellipse at 72% 4%,#bc806a36,transparent 70%),linear-gradient(152deg,#61394f,#3a243a 82%);
 --command-seam:#a6748b;
}
#game #command-page{
 background:radial-gradient(ellipse at 64% 20%,#9755686b,transparent 62%),
  var(--tile-pattern) center / 162px 63px repeat,linear-gradient(155deg,#493147,#241c30 76%);
}
#game #command-page :is(.command-header,.command-nav){
 background:var(--command-panel);
 border-color:#db9fa16b;
}
#game #command-page .command-header{
 background:linear-gradient(#492b4555,#492b4555),
  var(--command-relief) left 16px center / 76px auto no-repeat,var(--command-panel);
 box-shadow:0 6px 14px #22142363;
}
#game #command-page :is(#page-kicker,.wallet-caption,.resource-caption){
 color:#f3d5cf;
}
#game #command-page .command-nav button{color:#efdbdf}
#game #command-page .command-nav button.selected{color:#ffe1a0}
#game #command-page .command-nav button::before{
 background:radial-gradient(circle at 32% 15%,#aa748c,#4c2d47 70%);
 border-color:#b6839e;
 border-bottom-color:#2c1a2b;
 box-shadow:inset 0 0 0 3px #2a17284a;
}
#game #command-page .command-nav button.selected::before{
 border-color:#f2c987;
 background:radial-gradient(circle at 34% 14%,#bc826a,#744653 70%);
}
#game #command-page :is(.page-wallet-resource .page-wallet,.treasury-wallet){
 background:linear-gradient(150deg,#55334b,#322337);
 border:1px solid #ab7b8b;
 border-radius:8px;
 box-shadow:inset 0 1px #cb929873;
}
#game #command-page .treasury-wallet{
 background:linear-gradient(150deg,#6b4f39,#3d2e30);
 border-color:#bd9469;
}
#game #command-page :is(.shop-weapon,.base-tower,.upgrade-card,.castle-progression,.supply-card,.page-explanation){
 background:var(--tile-pattern) center / 130px 50px repeat,var(--command-panel);
 border:1px solid var(--command-seam);
 border-bottom:3px solid #301c31;
 border-radius:10px;
 box-shadow:inset 0 1px #efb8b36b,0 3px 6px #1d122364;
}
#game #command-page .shop-weapon{padding:8px 6px}
#game #command-page .page-explanation{padding-inline:12px;color:#f0d5d7}
#game #command-page .page-explanation summary{justify-content:space-between;color:inherit}
#game #command-page .page-explanation summary::after{
 content:'';width:7px;height:7px;margin-inline-end:4px;
 border-inline-end:2px solid currentColor;border-block-end:2px solid currentColor;rotate:45deg;
}
#game #command-page .page-explanation[open] summary::after{rotate:225deg}
#game #command-page .shop-tab.selected{border-color:#ffd995}
#game #command-page .game-action:has(.action-label:only-child){justify-content:center}
#game #command-page .world-action-row .game-action{
 background:radial-gradient(ellipse at 22% 0%,#ffffff30,transparent 65%),linear-gradient(153deg,var(--tile-light),var(--tile-dark));
 border:1px solid var(--tile-line);
 border-bottom:3px solid var(--tile-edge);
 padding-inline:22px;
}
#game #command-page .atlas-world>img{border-radius:12px;filter:drop-shadow(0 9px 14px #1d1428a6)}
#game #command-page .atlas-world>div{
 background:var(--command-panel);
 border-top:1px solid #db9fa16b;
 border-radius:0 0 12px 12px;
}
#game #command-page .weapon-turntable{
 background:var(--command-relief) center 62% / min(45%,190px) auto no-repeat,
  radial-gradient(ellipse at 50% 60%,#dfa4783b,transparent 66%);
}
#game #home-screen .selected-mission{
 background:var(--tile-pattern) center / 130px 50px repeat,var(--command-panel);
 border-color:var(--command-seam);
}
#game #overlay[data-state=result]{
 background:radial-gradient(ellipse at 50% 43%,#6b3a4b57,#251725ec);
}
#game #overlay[data-state=result] .result-details[open]{
 inset-block-end:auto;
 max-height:calc(100% - 112px);
 background:var(--tile-pattern) center / 130px 50px repeat,var(--command-panel);
 border-color:var(--command-seam);
 color:#fff4e1;
 box-shadow:0 12px 32px #241326b3;
}
#game #overlay .result-details[open] :is(dt,summary){color:#f3dad6}
#game #overlay .result-details[open] summary{
 -webkit-tap-highlight-color:transparent;
 background:#582e49;
 border:1px solid var(--command-seam);
 border-radius:6px;
}
#game #overlay .result-details[open] dd{color:#ffe8aa}

@media (max-width:600px) and (orientation:portrait){
 #game #command-page{
  grid-template-columns:minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr) auto;
 }
 #game #command-page .command-header{background-size:auto,60px auto,auto;background-position:center,left 8px center,center}
 #game #command-page .page-content{grid-column:1;padding-bottom:16px;scrollbar-gutter:auto}
 #game #command-page .command-nav{
  grid-column:1;grid-row:3;height:auto;flex-direction:row;justify-content:space-evenly;gap:0;
  padding:5px 8px max(5px,env(safe-area-inset-bottom));border-top:1px solid #db9fa16b;
 }
 #game #command-page .command-nav button{width:84px;min-height:53px;font-size:12px}
 #game #command-page .command-nav button img{width:35px;height:35px;margin-bottom:3px}
 #game #command-page .command-nav button::before{width:36px;height:36px}
 #game #command-page .world-atlas{width:calc(100% - 76px);margin-inline:38px}
 #game #command-page .atlas-world{gap:0}
 #game #command-page .world-browse-arrow{width:38px}
}
