/* Paper menu over a silent, low-resolution newsreel. */
#menu-film{position:fixed;inset:0;width:100%;height:100%;object-fit:cover;filter:grayscale(.82) sepia(.32) blur(1.4px);opacity:.64;pointer-events:none}body:not(.playing){background:#dce1d4}body:not(.playing) #app{background:linear-gradient(90deg,#e5e7dbb8,#e9e8dca8)}body:not(.playing) #battlefield{display:none}body.playing #menu-film,body.playing #menu-navigation,body.playing #menu-trail{display:none!important}body:not(.playing) .masthead{background:#eeeee1df}body:not(.playing) .intro{min-height:175px}body:not(.playing) .intro p{color:#3d5145}#menu-navigation{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin:0 0 36px;max-width:1250px}.menu-card{display:flex;flex-direction:column;align-items:center;text-align:center;border:1px solid #b7c3ad;background:#f3f0e5f5;border-radius:9px;padding:16px 14px 22px;min-width:0;box-shadow:0 8px 30px #243b2920;color:var(--ink)}.menu-card:hover{background:#fffdf1;transform:translateY(-4px);border-color:#6a8268}.menu-card strong{font:25px Georgia,serif}.menu-card-note{font-size:12px;line-height:1.6;color:#596b5a;margin:10px 0 17px;min-height:38px}.menu-card b{font-size:10px;letter-spacing:.6px;color:#985b34;margin-top:auto}.menu-squad{height:138px;display:flex;justify-content:center;align-items:center;width:100%;overflow:hidden}.menu-squad img{width:88px;height:105px;object-fit:contain;filter:drop-shadow(2px 6px 2px #233c3328)}.squad-4 img{width:28%;margin:0 -3%;height:102px}.squad-9{display:grid;grid-template-columns:repeat(5,1fr);gap:0;height:138px;padding:4px 0}.squad-9 img{width:100%;height:67px;object-fit:contain}.lesson-art{position:relative;height:138px;width:100%;display:block}.lesson-art .menu-squad{width:65%;margin-left:0}.lesson-art svg{position:absolute;width:100px;height:80px;bottom:1px;right:5%}#menu-trail{display:flex;align-items:center;gap:18px;margin-bottom:20px;background:#f3f0e5e8;padding:12px;border-radius:6px;max-width:1150px}#menu-trail h2{font:23px Georgia,serif;margin:0}#menu-back{padding:9px 15px;background:#e3e8d9;color:var(--ink);border:1px solid #b9c6ad;border-radius:4px}body[data-menu="home"] #menu-trail,body[data-menu="home"] .setup-panel,body[data-menu="home"] #online-panel,body[data-menu="home"] .field-guide{display:none!important}body:not([data-menu="home"]) #menu-navigation{display:none}body:not([data-menu="online"]) #online-panel{display:none!important}body[data-menu="online"] .setup-panel,body[data-menu="online"] .field-guide{display:none!important}#start-tutorial{display:none!important}body:not(.playing) .setup-panel{background:#f3f0e5f7}body:not(.playing) #online-panel{background:#f3f0e5f7}#studio-splash{position:fixed;inset:0;z-index:10000;background:rgba(255,255,255,.68);display:grid;place-items:center;animation:studio-reveal 3.6s ease-in-out forwards}.studio-logo-frame{box-sizing:border-box;width:min(280px,58vw);padding:0;border:0;border-radius:50%;background:#fff;opacity:0;animation:studio-logo 3.5s ease-in-out forwards}#studio-splash img{display:block;width:100%;height:auto;aspect-ratio:1254/1254;border-radius:50%;image-rendering:auto}#skip-studio{position:absolute;bottom:30px;right:30px;background:none;border:0;color:#788078;font-size:12px}body.studio-intro{overflow:hidden}body.studio-intro #app,body.studio-intro #version-tag{visibility:hidden}@keyframes studio-logo{0%{opacity:0}28%,70%{opacity:1}100%{opacity:0}}@media(max-width:1050px){#menu-navigation{grid-template-columns:repeat(2,1fr);max-width:820px}.menu-card{min-height:270px}}@media(max-width:550px){#menu-navigation{gap:10px}.menu-card{padding:12px 8px;min-height:255px}.menu-card strong{font-size:20px}.menu-card-note{font-size:11px}.menu-squad img{max-width:80px}#menu-trail{align-items:flex-start;flex-direction:column}}@media(prefers-reduced-motion:reduce){.studio-logo-frame{animation:none;opacity:1}.menu-card:hover{transform:none}}

body:not(.studio-intro):not(.playing) #app{animation:menu-arrive .5s ease-out}@keyframes menu-arrive{from{opacity:0}to{opacity:1}}@media(prefers-reduced-motion:reduce){body:not(.studio-intro):not(.playing) #app{animation:none}}

/* Menu cards remain alive above their expanded setup panels. */
body:not(.playing) #menu-navigation{display:grid!important;margin-bottom:20px}
.menu-card{position:relative}.menu-card[aria-pressed="true"]{border-color:#9c7846;box-shadow:0 0 0 2px #b9a06a55,0 8px 25px #243b2920;background:#fff8e5}
.menu-action-canvas{position:absolute;top:16px;left:8px;width:calc(100% - 16px);height:138px;object-fit:contain;pointer-events:none}
.menu-card.animating>.menu-squad,.menu-card.animating>.lesson-art{visibility:hidden}
#menu-tutorial{display:none;background:#f5f2e8f5;border:1px solid #fff;border-radius:8px;padding:24px;max-width:920px;margin:16px 0 30px}
#menu-tutorial h3{font:26px Georgia;margin:0 0 12px}#menu-tutorial p{font-size:14px;line-height:1.7;color:#61705d;max-width:650px}#menu-tutorial button{max-width:360px}
body[data-menu="tutorial"] #menu-tutorial{display:block}body[data-menu="tutorial"] .setup-panel,body[data-menu="tutorial"] .field-guide{display:none!important}

body.playing #menu-tutorial{display:none!important}

#menu-quote{max-width:1250px;text-wrap:balance;padding-bottom:24px}.menu-footer{display:grid;grid-template-columns:1fr 1fr 1fr;gap:16px}.menu-footer span:nth-child(2){text-align:center}.menu-footer span:last-child{text-align:right}@media(max-width:550px){.menu-footer{grid-template-columns:1fr}.menu-footer span,.menu-footer span:nth-child(2),.menu-footer span:last-child{text-align:center}}

/* Compact online setup: keep entry actions together instead of a full-width create button. */
body[data-menu="online"] #menu-trail{margin-bottom:10px;padding:8px 12px}
body:not(.playing) #online-panel{max-width:1250px;padding:16px 20px;margin-bottom:16px;color:#263e34}
#online-panel .online-title{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 16px;margin-bottom:12px}
#online-panel .online-title>.eyebrow{display:none}
#online-panel .online-title h2{font-size:24px;margin:0}
#online-panel .online-title p{margin:0;font-size:12px;color:#596b5a}
#online-entry{display:grid;grid-template-columns:minmax(160px,1fr) auto minmax(120px,.6fr) auto;gap:12px;align-items:end}
#online-entry .primary-button{width:auto;white-space:nowrap}
#online-entry input{width:100%;min-width:0}#online-panel label{min-width:0}
#online-panel #online-status{min-height:0;margin:10px 0 0;color:#785025}
#online-panel #online-status:empty{display:none}
#online-panel #online-browser{margin-top:12px}
@media(max-width:680px){#online-entry{grid-template-columns:minmax(0,1fr) auto}body:not(.playing) #online-panel{padding:14px}}

#wordmark-soldiers{width:90px;height:56px;flex-shrink:0;object-fit:contain;filter:drop-shadow(0 2px 2px #20362d26)}#menu-studio-logo{position:fixed;bottom:12px;left:14px;width:74px;height:74px;border-radius:50%;z-index:120;object-fit:contain;pointer-events:none;box-shadow:0 2px 10px #0003}body.playing #menu-studio-logo,body.studio-intro #menu-studio-logo{display:none}@media(max-width:550px){#wordmark-soldiers{width:64px;height:40px}#menu-studio-logo{width:58px;height:58px}}

/* The same newsreel runs beneath the intro and menu; fade only its white veil. */
@keyframes studio-reveal{0%,78%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){#studio-splash{animation:none}}

.game-wordmark{display:block;line-height:1.2;letter-spacing:2px;font-size:clamp(13px,1.7vw,22px)}.game-wordmark .edition{margin:5px 0 0;font-size:8px;letter-spacing:1.3px}@media(max-width:650px){.game-wordmark{max-width:175px}}

/* Compact in-match toolbar; menu branding keeps its larger size. */
body.playing .masthead,body.playing.wide-match .masthead{bottom:5px;padding:5px 8px;gap:10px;max-width:calc(100% - 16px)}
body.playing .game-wordmark{font-size:12px;letter-spacing:1px;max-width:none}body.playing #wordmark-soldiers{width:46px;height:30px}
body.playing .header-actions{gap:5px}body.playing .masthead .icon-button{font-size:10px;padding:6px 8px}
body.playing .masthead #upgrades,body.playing.wide-match .masthead #upgrades{font-size:12px;padding:7px 10px;box-shadow:none}
@media(max-width:900px){body.playing .game-wordmark{display:none}body.playing .masthead{gap:5px}body.playing #wordmark-soldiers{width:34px;height:24px}}

.hud-phase-focus{margin-top:14px}.focus-label{display:block;font-size:10px;font-weight:800;letter-spacing:1.4px;color:#677565}.hud-phase-focus h3{font-size:21px;margin:5px 0}.hud-phase-focus canvas{display:block;width:100%;height:auto;max-height:155px;object-fit:contain}.focus-number{font-size:34px;font-weight:800;line-height:1.15;margin-top:10px;color:#23483a}.hud-phase-focus p{font-size:12px;margin:5px 0;line-height:1.5}.focus-yield{white-space:pre-line;font-size:14px;line-height:1.75;border-top:1px solid #b7c5ac;margin-top:14px;padding-top:10px}
body.playing #players-hud .hud-player:not([data-phase="fire"]):not([data-phase="report"]) .hud-stats{display:none}body.playing #players-hud .hud-player:not([data-phase="fire"]) .hud-supply{display:none}body.playing #players-hud .hud-player[data-phase="artillery"] .focus-number{font-size:27px}.hud-player[data-phase="fire"] .hud-phase-focus h3{font-size:18px}

.hud-modifiers{margin-top:12px;border-top:1px solid #a6b79c;padding-top:9px}.hud-modifiers summary{cursor:pointer;font-weight:800;font-size:13px;color:#2e5444;padding:5px 0}.hud-modifiers[open]{background:#edf0e5;border-radius:5px;padding:8px}.modifier-row{display:grid;gap:4px;padding:9px 0;border-bottom:1px solid #ccd3c1}.modifier-row b{font-size:12px;color:#294c3c}.modifier-row span{font-size:11px;line-height:1.55;color:#52634f}.hud-modifiers>div{max-height:320px;overflow-y:auto}

/* Two-line game identity, matching the supplied wordmark reference. */
.game-wordmark{display:flex;flex-direction:column;align-items:center;gap:5px;max-width:none;color:#173c35;line-height:1;font-weight:900}
.wordmark-title{display:block;white-space:nowrap;font-size:clamp(18px,2.3vw,32px);letter-spacing:.12em}
.wordmark-online{display:block;font-size:clamp(9px,1vw,13px);letter-spacing:.65em;padding-left:.65em;font-weight:800}
body:not(.playing) .wordmark{gap:18px}
body.playing .game-wordmark{gap:3px}body.playing .wordmark-title{font-size:12px;letter-spacing:.1em}body.playing .wordmark-online{font-size:7px;letter-spacing:.5em;padding-left:.5em}
@media(max-width:650px){body:not(.playing) .wordmark{gap:8px}.wordmark-title{font-size:17px;letter-spacing:.08em}.wordmark-online{font-size:8px;letter-spacing:.5em;padding-left:.5em}}
@media(max-width:900px){body.playing .game-wordmark{display:none}}
/* Upgrade symbols match the selection cards; colours indicate gameplay benefit, not numeric sign. */
.hud-modifiers .modifier-row{display:flex;align-items:flex-start;gap:8px}.hud-modifiers .modifier-row>div{min-width:0;flex:1}.hud-modifiers .modifier-icon{width:34px;height:34px;object-fit:contain;flex:0 0 34px}.hud-modifiers .modifier-row b,.hud-modifiers .modifier-row span{display:block}.hud-modifiers .modifier-effect{font-style:normal;font-weight:700}.hud-modifiers .modifier-effect.positive{color:#246d35}.hud-modifiers .modifier-effect.negative{color:#b43a30}.hud-modifiers .modifier-effect.neutral{color:inherit}

/* Menu footer identity stays together, away from the header actions. */
#version-tag{display:grid;grid-template-columns:auto auto;align-items:center;gap:4px 12px}
#version-tag .version-value{grid-column:1/-1;text-align:right}
#version-tag .early-beta{font:900 17px/1.2 'Segoe UI',sans-serif;letter-spacing:.05em;margin:0}
#version-tag #open-changelog{margin:0}
/* One aligned header and consistent cards for phone/tablet menus. */
@media(max-width:1000px){
body:not(.playing) .masthead{grid-template-columns:minmax(0,1fr);padding:16px max(12px,env(safe-area-inset-right));gap:12px}
body:not(.playing) .masthead .wordmark{justify-self:center;max-width:100%}
body:not(.playing) .masthead #account-presence,body:not(.playing) .masthead>#players-online{grid-column:1;grid-row:2;justify-self:center;flex-wrap:wrap;max-width:100%}
body:not(.playing) .masthead .header-actions{grid-column:1;grid-row:3;justify-self:stretch;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
body:not(.playing) .masthead .header-actions .icon-button,body:not(.playing) .masthead #upgrades{min-width:0;min-height:44px;padding:7px 4px;font-size:12px;white-space:normal;box-shadow:none;border-radius:7px}
body:not(.playing) #lobby{padding:20px max(12px,env(safe-area-inset-right)) 120px;max-width:100%;box-sizing:border-box}
body:not(.playing) .intro{min-height:0;padding:0;margin:0 0 20px}
body:not(.playing) #menu-quote{font-size:clamp(25px,4vw,36px);line-height:1.15;padding:0;margin:0 auto;text-align:center}
body:not(.playing) #menu-navigation{width:100%;max-width:none;gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
body:not(.playing) .menu-card{padding:12px 10px 16px;min-height:0;gap:6px}
body:not(.playing) .menu-card strong{font-size:21px;line-height:1.15}
body:not(.playing) .menu-card-note{font-size:12px;line-height:1.45;margin:4px 0 8px;min-height:35px}
body:not(.playing) .menu-card>.menu-squad,body:not(.playing) .menu-card>.lesson-art{height:104px}
body:not(.playing) .menu-action-canvas{top:12px;left:10px;width:calc(100% - 20px);height:104px}
body:not(.playing) .lesson-art .menu-squad{height:104px}
body:not(.playing) .lesson-art svg{width:70px;height:60px}
body:not(.playing) #menu-trail{flex-direction:row;align-items:center;gap:12px}
body:not(.playing) #menu-trail h2{font-size:20px}
body:not(.playing) .setup-panel,body:not(.playing) #online-panel{width:100%;max-width:100%;box-sizing:border-box}
body:not(.playing) .menu-footer{font-size:10px;gap:8px;margin-top:22px}
#version-tag{bottom:max(8px,env(safe-area-inset-bottom));right:max(8px,env(safe-area-inset-right));padding:6px 9px;gap:3px 8px}
#version-tag .early-beta{font-size:14px}#version-tag #open-changelog{font-size:13px;padding:7px 9px;min-height:36px}
#menu-studio-logo{left:max(8px,env(safe-area-inset-left));bottom:max(8px,env(safe-area-inset-bottom));width:48px;height:48px}
}
@media(max-width:420px){body:not(.playing) .masthead .header-actions{grid-template-columns:repeat(3,minmax(0,1fr))}body:not(.playing) .menu-card strong{font-size:18px}body:not(.playing) #account-identity{flex-wrap:wrap;justify-content:center}body:not(.playing) #menu-trail{flex-wrap:wrap}}
@media(max-height:500px) and (min-width:600px) and (max-width:1000px){body:not(.playing) .masthead{grid-template-columns:1fr 1fr;padding:10px 16px;gap:8px}body:not(.playing) .masthead .wordmark{justify-self:start}body:not(.playing) .masthead #account-presence{grid-column:2;grid-row:1;justify-self:end}body:not(.playing) .masthead .header-actions{grid-row:2;grid-column:1/-1}body:not(.playing) #menu-navigation{grid-template-columns:repeat(4,minmax(0,1fr))}body:not(.playing) .menu-card strong{font-size:18px}}

@media(max-width:1000px){body:not(.playing) #menu-quote{letter-spacing:normal}body:not(.playing) .squad-9 img{height:48px}body:not(.playing) .squad-9{padding:2px 0}}

/* Fixed menu build details above; global chat occupies the opposite corner. */
body:not(.playing) #version-tag{top:max(8px,env(safe-area-inset-top));bottom:auto;right:max(8px,env(safe-area-inset-right))}
body:not(.playing) .masthead{padding-top:100px}
#global-chat{position:fixed;z-index:130;right:max(10px,env(safe-area-inset-right));bottom:max(10px,env(safe-area-inset-bottom));font:14px/1.4 'Segoe UI',sans-serif;color:#243e35}
#chat-toggle{float:right;min-height:42px;padding:8px 16px;border:1px solid #a99a68;border-radius:9px;background:#f3efdf;color:#243e35;font-weight:700;box-shadow:0 3px 14px #0003}
#chat-panel{clear:both;width:min(340px,calc(100vw - 20px));height:min(370px,65dvh);margin-bottom:8px;background:#f5f1e8f7;border:1px solid #a99a68;border-radius:12px;box-shadow:0 8px 30px #0004;display:flex;flex-direction:column;overflow:hidden}#chat-panel[hidden]{display:none}#chat-panel header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;border-bottom:1px solid #c4c9b8}#chat-close{font-size:24px;min-width:40px;background:transparent;border:0;color:inherit}#chat-messages{flex:1;min-height:0;overflow:auto;padding:8px 12px;overscroll-behavior:contain}#chat-messages p{margin:0 0 9px;overflow-wrap:anywhere}#chat-messages b{color:#7a5929}#chat-status{margin:0;padding:3px 12px;font-size:12px;color:#756243}#chat-form{display:flex;gap:6px;padding:8px;border-top:1px solid #c4c9b8}#chat-input{min-width:0;flex:1;font-size:16px;padding:9px;border:1px solid #acb7a5;border-radius:6px}#chat-form button{border:0;border-radius:6px;background:#294f40;color:#fff;padding:8px 12px}body.studio-intro #global-chat{display:none}
@media(pointer:coarse){body.playing #global-chat{bottom:max(58px,env(safe-area-inset-bottom))}}

#chat-messages time{font-size:12px;color:#667467;font-variant-numeric:tabular-nums;white-space:nowrap}

/* Distinguish chat metadata from message content without relying on colour alone. */
#chat-messages time{color:#70796f;font-size:12px;font-weight:400}#chat-messages b{color:#28716c;font-weight:700}#chat-messages p>span{color:#202e29;font-weight:400}

#chat-panel header strong{flex:1}#chat-expand{display:grid;place-items:center;min-width:38px;min-height:38px;margin-right:4px;border:1px solid #abb7a2;border-radius:6px;background:#e7ebdd;color:#294f40;font-size:24px;cursor:pointer}#chat-expand:hover{background:#d8e1cb}#chat-expand:focus-visible{outline:2px solid #28716c;outline-offset:2px}#global-chat.expanded #chat-panel{width:min(620px,calc(100vw - 20px));height:min(620px,78dvh)}

#chat-toggle{display:flex;align-items:center;gap:9px}#chat-arrow{font-size:18px;line-height:1}#chat-unread{border-radius:9px;background:#a34f25;color:#fff;font-size:10px;padding:2px 6px}#chat-unread[hidden]{display:none}#global-chat.has-unread #chat-toggle{border-color:#bd8628;box-shadow:0 0 0 3px #edbd5b99,0 3px 14px #0003;background:#fff2ca}

/* Compact build information shares the toolbar row instead of reserving a header strip. */
body:not(.playing) .masthead{padding-top:20px}
body:not(.playing) .header-actions #version-tag{position:static;display:grid;flex:0 0 auto;grid-template-columns:auto auto;gap:2px 7px;padding:5px 7px;align-self:center;border-radius:6px;max-width:100%;z-index:auto}
body:not(.playing) .header-actions #version-tag .version-value{font-size:8px;line-height:1.2}
body:not(.playing) .header-actions #version-tag .early-beta{font-size:12px;letter-spacing:.02em}
body:not(.playing) .header-actions #version-tag #open-changelog{font-size:11px;line-height:1.2;padding:5px 7px;min-height:0}
@media(max-width:1000px){body:not(.playing) .masthead{padding-top:12px}body:not(.playing) .masthead .header-actions{grid-template-columns:repeat(3,minmax(0,1fr))}body:not(.playing) .header-actions #version-tag{min-width:0;justify-self:stretch;gap:2px 4px}body:not(.playing) .header-actions #version-tag .version-value{white-space:normal;text-align:center;font-size:7px}body:not(.playing) .header-actions #version-tag .early-beta{font-size:10px}body:not(.playing) .header-actions #version-tag #open-changelog{font-size:10px;padding:4px}}

@media(min-width:1001px){body:not(.playing) .masthead{grid-template-columns:auto auto minmax(0,1fr)}body:not(.playing) .header-actions{gap:6px}body:not(.playing) .header-actions .icon-button{padding:8px;font-size:11px}body:not(.playing) .header-actions #upgrades{padding:8px 10px;font-size:13px}}
/* Keep the presence/account group at the actual horizontal centre of the menu. */
@media(min-width:1001px){
body:not(.playing) .masthead{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
body:not(.playing) .masthead .wordmark{justify-self:start;min-width:0}
body:not(.playing) .masthead #account-presence,body:not(.playing) .masthead>#players-online{grid-column:2;grid-row:1;justify-self:center}
body:not(.playing) .masthead #account-presence{flex-direction:column;gap:4px}
body:not(.playing) .masthead .header-actions{grid-column:3;grid-row:1;justify-self:end;justify-content:flex-end;min-width:0}
}
@media(max-width:1000px){
body:not(.playing) .masthead #account-presence,body:not(.playing) .masthead>#players-online{justify-self:center;justify-content:center;text-align:center}
}
@media(max-height:500px) and (min-width:600px) and (max-width:1000px){
body:not(.playing) .masthead #account-presence{grid-column:1/-1;grid-row:2;justify-self:center}
body:not(.playing) .masthead .header-actions{grid-row:3}
}
