/* Alpha 0.5: persistent HUD, full-height world and one contextual drawer. */
html,body{height:100%;overflow:hidden}main{width:100%;max-width:none;height:100dvh;padding:0;display:grid;grid-template-rows:68px minmax(0,1fr) 76px;gap:0;background:#14241e}header{grid-row:1;margin:0;padding:8px 20px;border-bottom:1px solid #a6a07755;gap:16px;background:#1a2b24;z-index:12;box-shadow:0 3px 12px #0003}.brand{width:25px;height:32px}.wordmark h1{font-size:18px;letter-spacing:1px;white-space:nowrap}.wordmark h1 span{font-size:9px}header #era-name{font:15px Georgia;color:#bec8a9;margin:0;white-space:nowrap}header .resources{margin-left:auto;gap:24px}header .resource{min-width:70px;gap:8px}header .resource strong{font:700 24px 'Segoe UI',sans-serif;white-space:nowrap}header .resource small{font-size:9px;letter-spacing:1.3px;color:#bdc9b0}header .resource-icon,header .army-resource{display:none}header .resource progress{height:2px}header .header-actions{margin-left:0}#session-label{display:none}.command,#era-rail,.night-panel,.controls,main>footer{display:none}.field{grid-row:2;border:0;border-radius:0;box-shadow:none;width:100%;height:100%!important;min-height:0!important}.field-label{display:none}.field-top{top:12px;left:auto;right:18px;transform:none;text-align:right}.field-top small{display:none}#phase-strip{position:absolute;top:14px;left:18px;padding:9px 12px;background:#1b302bd9;border:1px solid #bac79533;border-radius:4px;pointer-events:none}#night-title{font:13px Georgia;color:#d5dfbf;margin:0 0 6px}#night-progress{height:2px}.field-caption{display:none}.camera{bottom:39px;gap:4px}.map-navigation{bottom:6px;left:16px;right:16px;padding:0 10px}.map-navigation input{height:20px}.camera button{font-size:11px;padding:6px 14px}#notice{top:23%;font-size:clamp(16px,2vw,23px)}#base-warning{position:absolute;left:18px;top:78px;background:#6b3028;color:#ffe0b3;border-color:#d18c64;z-index:2}#base-warning[hidden]{display:none}#battle-dock{grid-row:3;display:grid;grid-template-columns:repeat(3,minmax(70px,.8fr)) minmax(110px,1fr) minmax(130px,1.2fr) minmax(125px,1.1fr);align-items:stretch;gap:8px;padding:10px 18px;background:#1a2b24;border-top:1px solid #a6a07755;z-index:12}#battle-dock>button{margin:0;min-height:0!important;height:auto;min-width:0;padding:8px;font-size:12px;border-radius:5px}#battle-dock>button[aria-expanded=true]{border-color:#dec385;background:#56684b}#dock-queue{display:inline-block;color:#e6d39c;margin-left:6px}#dock-queue:empty{display:none}#battle-dock #special{grid-template-columns:24px 1fr;gap:3px}#special .ability-icon{font-size:25px}#battle-dock #special b{font-size:17px}#battle-dock #special small{display:none}#battle-dock #special em{font-size:8px}#battle-dock #special progress{height:2px}#battle-dock #evolve{font-size:10px}#battle-dock #begin-night{font-size:11px}#battle-dock #begin-night:disabled{font-size:10px}.battle-drawer{position:fixed;z-index:11;left:auto;right:16px;top:80px;bottom:88px;width:min(830px,calc(100% - 32px));overflow:auto;overscroll-behavior:contain;background:#1e322b;box-shadow:0 12px 65px #000a;border:1px solid #b8a37577;border-radius:8px;padding:18px;margin:0}.battle-drawer[hidden]{display:none!important}.drawer-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:18px}.drawer-heading h2{font:26px Georgia;margin:0;color:#e1cd9d}.drawer-heading button{font-size:24px;min-height:44px;min-width:44px}.drawer-help{font-size:13px;color:#b8c4a7;line-height:1.7}#troop-drawer{top:auto;left:16px;right:16px;width:auto;max-height:calc(100dvh - 170px)}#troop-drawer .unit-grid{grid-template-columns:repeat(4,minmax(0,1fr))}#troop-drawer .unit{grid-template-columns:90px 1fr}#troop-drawer .unit canvas{width:90px;height:100px}#troop-drawer .unit b{font-size:18px}#troop-drawer .card-top{padding:8px 10px}#troop-drawer .card-cost{font-size:13px;padding:10px}#troop-drawer #night-detail{font-size:11px;line-height:1.5;color:#a6b499;margin-bottom:0}#troop-drawer .queue-line{padding:10px}#troop-drawer .queue-copy{font-size:12px}#troop-drawer .queue-line button{font-size:11px}.detail-toggle{font-size:12px}#champion-drawer{width:min(430px,calc(100% - 32px));top:auto}#hero-strip{display:grid;grid-template-columns:110px 1fr;gap:18px;padding:10px 0}#hero-strip>canvas{width:110px;height:125px}#hero-strip .hero-info small{display:block;font-size:10px;line-height:1.5}#hero-strip .hero-info h3{font-size:24px;margin:5px 0 10px}#hero-strip .hero-info span{font-size:11px;max-width:none}#hero-strip .hero-actions{display:grid;grid-template-columns:1fr;width:100%;grid-column:1/-1;gap:10px}#hero-strip .hero-actions button{font-size:13px;min-height:44px}#hero-strip .hero-actions>small{display:block;text-align:left;font-size:12px;line-height:1.6;letter-spacing:0}.armory-heading{top:-18px;background:#1e322b}.armory-heading h2{font-size:24px}.menu-art{background:radial-gradient(ellipse at 15% 35%,#b9a46155,transparent 50%),repeating-linear-gradient(135deg,#71876511 0 2px,transparent 2px 35px),linear-gradient(120deg,#29463b,#12221d)}.menu-art:after{content:'THE NEXT CHAPTER';letter-spacing:4px}#test-session{position:absolute;left:50%;top:68px;transform:translateX(-50%);font:700 10px system-ui;background:#c68a48;color:#19291f;padding:4px 10px;z-index:12}#test-session[hidden]{display:none}#dev-tools{margin-top:12px;border-top:1px solid #9b915b66}#dev-tools summary{font-size:12px;color:#d9bb82}.dev-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.dev-grid label{display:grid!important;gap:5px!important;margin:4px 0!important}.dev-grid button{font-size:11px;min-height:40px}.dev-grid input{width:100%;padding:8px;color:#ece8d1;background:#21352c;border:1px solid #8d946a}.dev-grid select{width:100%}#dev-status{font-size:11px;line-height:1.5;color:#a9cdab}#audition-status{font-size:11px}.audio-audition{margin:10px 0;border-top:1px solid #71836b55;padding-top:8px}#audition{width:100%;font-size:12px}
@media(max-width:1000px){header{gap:10px;padding:8px 14px}.wordmark h1{font-size:15px}header #era-name{font-size:13px}header .resources{gap:14px}header .resource strong{font-size:21px}#troop-drawer .unit{grid-template-columns:65px 1fr}#troop-drawer .unit canvas{width:65px;height:85px}#troop-drawer .unit b{font-size:15px}}
@media(max-width:760px){main{grid-template-rows:64px minmax(0,1fr) 112px}header{padding:8px 10px;gap:8px}.brand,.wordmark{display:none}header #era-name{font-size:14px}header .resources{gap:12px}header .resource{min-width:52px}header .resource strong{font-size:18px}header .header-actions{gap:5px}#pause span,#pause kbd{display:none}#battle-dock{grid-template-columns:repeat(3,1fr);grid-template-rows:1fr 1fr;gap:5px;padding:6px 10px}#battle-dock>button{padding:5px;font-size:11px}#battle-dock #special b{font-size:15px}.map-navigation{left:8px;right:8px}.map-navigation label{font-size:0}#phase-strip{left:10px;top:10px;max-width:75%;padding:7px 9px}#night-title{font-size:11px}.battle-drawer{top:74px;bottom:122px;right:10px;width:calc(100% - 20px);padding:14px}#troop-drawer{left:10px;right:10px;max-height:calc(100dvh - 200px)}#troop-drawer .unit-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#troop-drawer .unit{grid-template-columns:55px 1fr}#troop-drawer .unit canvas{width:55px;height:67px}#troop-drawer .unit b{font-size:13px}.drawer-heading{margin-bottom:10px}.drawer-heading h2{font-size:22px}#test-session{top:64px;font-size:8px}.armory-heading{top:-14px}.armory-heading h2{font-size:20px}.armory-heading>strong{font-size:16px}#base-warning{top:65px;font-size:11px}.camera button{min-height:32px!important}.hero-actions{max-width:none}}
@media(max-width:390px){header #era-name{max-width:60px;white-space:normal;font-size:12px}header .resources{gap:8px}header .resource strong{font-size:16px}header .resource small{font-size:8px}#mute,#pause{padding:7px 10px}#hero-strip{grid-template-columns:85px 1fr}#hero-strip>canvas{width:85px}#hero-strip .hero-info h3{font-size:21px}}
@media(max-height:500px) and (min-width:761px){main{grid-template-rows:52px minmax(0,1fr) 62px}.battle-drawer{top:60px;bottom:68px}#test-session{top:52px}#troop-drawer{max-height:calc(100dvh - 140px)}#troop-drawer .unit canvas{height:55px}.drawer-heading{margin-bottom:8px}}
#game-speed{flex-shrink:0;min-width:62px;padding:10px 8px;font-size:12px;color:#e6d291;background:#304d3f;border-color:#96ab7866}header .wordmark h1{font-size:15px}header #era-name{font-size:12px}@media(max-width:900px){header .brand,header .wordmark{display:none}header #era-name{font-size:14px}}@media(max-width:480px){header{gap:5px;padding:7px 8px}#game-speed{min-width:49px;font-size:10px;padding:10px 5px}header .resource{min-width:44px}header .resource strong{font-size:16px}header .resources{gap:7px}header #era-name{max-width:57px;white-space:normal;font-size:11px}header .resource small{font-size:7px}#mute,#pause{padding:7px 8px}}
#dev-tools{width:min(720px,calc(100% - 24px));padding:24px;max-height:calc(100dvh - 32px);margin:auto;background:#192e27}#dev-tools>p{font-size:12px;line-height:1.6;color:#bec9ac}#dev-tools h2{font:27px Georgia;margin:0}#dev-tools .dev-grid button{min-height:44px}#dev-tools .dev-grid label{font-size:12px}#open-dev{font-size:11px;padding:8px;min-width:36px}#dev-tools .drawer-heading{position:sticky;top:-24px;background:#192e27;padding:10px 0;z-index:1}header{gap:8px}@media(max-width:480px){header #era-name{display:none}#dev-tools{padding:15px}#dev-tools .drawer-heading{top:-15px}}
#settings-button{width:100%;margin:4px 0 12px;padding:12px;background:#344b3b;border-color:#9eaa7966;font-size:12px}#preferences-dialog{width:min(500px,calc(100% - 24px));padding:24px}#preferences-dialog h2{font:25px Georgia;margin:0}#preferences-dialog .settings-body label{font-size:13px}#menu-actions button.exit-action{background:linear-gradient(#75483c,#512f2c);border-color:#bf7965;color:#ffe1cf}#menu-actions button.exit-action:hover{background:#82483b}
body[data-menu-scene=difficulty] .menu-mark{display:none}body[data-menu-scene=difficulty] #menu-actions{position:relative;gap:12px;padding-top:38px}#menu-actions button.menu-back{position:absolute;top:0;left:0;width:auto;padding:5px 8px;background:transparent;border-color:transparent;color:#c0c9b0;font-size:12px}#menu-actions button.difficulty-card{text-align:left;display:grid;gap:6px;padding:18px 20px;border-left:4px solid #82ac8c}#menu-actions button.difficulty-card b{font:23px Georgia}#menu-actions button.difficulty-card span{font-size:11px;opacity:.85}#menu-actions button.difficulty-card:nth-child(2){border-left-color:#ddaa5c}#menu-actions button.difficulty-card:nth-child(3){border-left-color:#d87665}#settings-button[hidden]{display:none}
header .resource>div{position:relative;height:44px;display:grid;grid-template-rows:12px 28px;gap:2px;align-items:start}header .resource small{line-height:12px;margin:0}header .resource strong{line-height:28px;margin:0}header .resource progress{position:absolute;bottom:-3px;left:0;margin:0}#camera-center{display:grid;place-items:center;min-width:42px}#camera-center[aria-pressed=true]{border-color:#e4c58a;background:#52674a}@media(max-width:480px){header .resource>div{height:38px;grid-template-rows:10px 24px}header .resource small{line-height:10px}header .resource strong{line-height:24px}}
#troop-drawer .unit{grid-template-columns:1fr}#troop-drawer .unit canvas{grid-column:1;grid-row:2;width:100%;height:105px}#troop-drawer .unit .card-info{grid-column:1;grid-row:3;text-align:center;padding:4px 8px 10px}#troop-drawer .unit .card-cost{grid-row:4}#troop-drawer .unit .card-top{grid-row:1}@media(max-width:760px){#troop-drawer .unit canvas{width:100%;height:88px}#troop-drawer .unit b{font-size:14px}#troop-drawer .unit .card-info{padding:1px 6px 6px}}
body[data-menu-scene=difficulty] .menu-content{margin-left:0;padding:28px 35px}body[data-menu-scene=difficulty] #menu-title{font-size:38px;margin:12px 0}body[data-menu-scene=difficulty] #menu-description{max-width:550px}body[data-menu-scene=difficulty] #menu-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));padding-top:40px;margin-bottom:10px}body[data-menu-scene=difficulty] #menu-actions .difficulty-card{padding:20px 14px;min-height:125px}body[data-menu-scene=difficulty] .menu-art:after{display:none}@media(max-width:600px){body[data-menu-scene=difficulty] .menu-content{padding:24px}body[data-menu-scene=difficulty] #menu-title{font-size:31px}body[data-menu-scene=difficulty] #menu-actions{grid-template-columns:1fr}body[data-menu-scene=difficulty] #menu-actions .difficulty-card{min-height:75px;padding:14px}}

/* Recruitment values remain visible, including unaffordable units. */
#troop-drawer .unit em{display:block;font-size:10px}#troop-drawer .unit .unit-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px 12px;text-align:left;font-size:11px;word-spacing:normal;color:#bacab5;margin-top:5px}#troop-drawer .unit-stats>span{display:flex;justify-content:space-between;gap:5px}#troop-drawer .unit-stats strong{font:600 11px system-ui;color:#f0dfbc}#troop-drawer .unit:disabled .card-info{opacity:1}@media(max-width:480px){#troop-drawer .unit .unit-stats{font-size:10px;gap:5px 8px}#troop-drawer .unit-stats strong{font-size:10px}}
/* Distinct commands and a compact recruitment workspace. */
#open-troops{background:linear-gradient(#3b6954,#284939);border-color:#83ba8e;color:#d7efca}
#open-armory{background:linear-gradient(#725b34,#4c3d28);border-color:#c9a15c;color:#ffe3ad}
#open-fortress{background:linear-gradient(#405c78,#2b3c54);border-color:#7caccf;color:#d2e9ff}
#armory[data-group=fortress]{border-color:#7caccf}#armory-tabs[hidden]{display:none}
.troop-champion{margin-top:16px;border:1px solid #b193c177;border-radius:6px;padding:12px;background:#342e43}
.troop-champion summary{cursor:pointer;color:#e0c1ed;font:20px Georgia}.troop-champion summary span{font:11px system-ui;float:right;padding-top:6px}
#champion-upgrades{margin-top:12px;background:#594466;border-color:#b193c1}
#champion-drawer.troop-champion{width:100%}#champion-drawer #hero-strip{grid-template-columns:100px 1fr}
.troop-card{min-width:0;border:1px solid #89764766;border-radius:5px;background:#22362c;overflow:hidden}.troop-card .unit{width:100%;height:auto;border:0;border-radius:0}
#troop-drawer .troop-portrait{grid-row:2;grid-column:1;position:relative;display:block;height:100px;overflow:hidden}
#troop-drawer .troop-portrait canvas{height:100%;width:100%}.recruit-fill{position:absolute;left:0;bottom:0;top:0;background:#a5dfc044;border-right:2px solid #d2f3bf;pointer-events:none;width:0}.unit:not(.training) .recruit-fill{display:none}
.recruit-state{position:absolute;bottom:0;left:0;right:0;text-align:center;font:600 10px system-ui;background:#102b22cc;color:#e5f4d2;padding:5px;pointer-events:none}.recruit-state:empty{display:none}
.expand-stats{border:0;border-top:1px solid #a6a37733;border-radius:0;width:100%;font-size:11px;padding:8px;background:#2a4035;color:#c8d7ba}.damage-note{display:none;font-size:10px;color:#c1cbb9;line-height:1.5;margin:8px 10px}
#troop-drawer .troop-card:not(.expanded) .advanced-stat{display:none}.troop-card.expanded .damage-note{display:block}
#troop-drawer .troop-card .unit-stats{grid-template-columns:1fr}#troop-drawer .troop-card.expanded .unit-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
#confirm-difficulty{grid-column:1/-1;min-height:48px;margin-top:5px;font-size:20px;background:#406448;border-color:#b7d38c}#confirm-difficulty.ready{animation:battle-ready 1.8s ease-in-out infinite}
#menu-actions .difficulty-card[data-level=normal]{background:#284b3c;border-color:#7bb78d;color:#dcf0d2}#menu-actions .difficulty-card[data-level=hard]{background:#57452a;border-color:#d2a052;color:#ffe1a2}#menu-actions .difficulty-card[data-level=impossible]{background:#542f32;border-color:#cc7974;color:#ffd4c7}
#menu-actions .difficulty-card[aria-pressed=true]{outline:2px solid #fff0c1;outline-offset:3px;box-shadow:0 0 20px #ffe4a333}
@keyframes battle-ready{50%{box-shadow:0 0 22px #b1df7c66;filter:brightness(1.15)}}
.reduced-motion #confirm-difficulty.ready{animation:none;box-shadow:0 0 10px #b1df7c66}@media(prefers-reduced-motion:reduce){#confirm-difficulty.ready{animation:none}}
@media(max-width:760px){#troop-drawer .troop-portrait{height:80px}.troop-champion summary{font-size:18px}.troop-champion summary span{float:none;display:block}#battle-dock #open-fortress{font-size:10px}}
/* Separate navigation from magnification. */
.map-navigation{right:190px}.zoom-control{position:absolute;right:16px;bottom:6px;display:flex;align-items:center;gap:8px;padding:4px 9px;height:28px;background:#14251ee8;border:1px solid #ad9a6855;border-radius:4px;color:#d5dfc2;font:11px system-ui}.zoom-control input{width:94px;min-width:0}.map-navigation{height:28px}
@media(max-width:760px){.map-navigation{left:8px;right:153px}.zoom-control{right:8px;font-size:10px;gap:5px;padding:4px 6px}.zoom-control input{width:80px}}
.drawer-heading button,#close-armory{font-size:12px;white-space:nowrap;padding:8px 12px;min-width:70px}#begin-night.ready{animation:battle-ready 1.8s ease-in-out infinite}.reduced-motion #begin-night.ready{animation:none;box-shadow:0 0 14px #dfc38988}@media(prefers-reduced-motion:reduce){#begin-night.ready{animation:none}}
#fortress-hit{position:absolute;background:transparent;border:0;box-shadow:none;border-radius:8px;padding:0;z-index:1;touch-action:manipulation}#fortress-hit:focus-visible{outline:2px solid #aecde5}#fortress-hit:hover{background:#b9ddf409;filter:none}#fortress-hit[hidden]{display:none}.camera,.zoom-control,.map-navigation{z-index:2}
/* Mobile walkthrough: field resources, top progression, and three bottom commands. */
main{grid-template-rows:64px minmax(0,1fr) 66px}header{gap:10px;padding:8px 14px}header #begin-night{margin:0;min-width:110px;max-width:180px;min-height:40px;padding:7px 10px;font-size:12px}header #evolve{margin:0 0 0 auto;width:auto;max-width:220px;min-height:40px;padding:7px 12px;font-size:12px}header .header-actions{margin-left:0}header .brand,header .wordmark{display:none}
#battle-dock{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:1fr;padding:9px 14px;gap:9px}#battle-dock>button{font-size:13px}
#phase-strip{left:50%;right:auto;transform:translateX(-50%);top:8px;max-width:calc(100% - 130px);width:300px;text-align:center;padding:8px 12px;display:grid;gap:5px}#night-title{margin:0;font-size:12px}#phase-strip .resources{display:flex;justify-content:center;gap:28px;margin:0}#phase-strip .resource{min-width:0;gap:0}#phase-strip .resource>div{display:flex;flex-direction:column;gap:2px}#phase-strip .resource-icon,#phase-strip .army-resource{display:none}#phase-strip .resource small{font-size:9px;line-height:12px;letter-spacing:.8px}#phase-strip .resource strong{font:700 22px/24px system-ui}#phase-strip .resource em{display:none}#phase-strip .resource progress{height:2px;margin:0}
.camera{left:auto;right:16px;transform:none;bottom:42px;align-items:center;gap:5px}.camera #special{--special-charge:0deg;display:grid;place-items:center;grid-template-columns:1fr;width:44px;height:44px;min-height:44px;padding:4px;border-radius:50%;border:0;background:conic-gradient(#f0c875 var(--special-charge),#425348 0);box-shadow:0 2px 9px #0006;margin-left:6px}.camera #special .ability-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:#203a2e;font-size:24px;line-height:1}.camera #special>span:nth-child(2),.camera #special progress{display:none}.camera #special:disabled{opacity:.85;filter:none}.camera #special.ready{box-shadow:0 0 15px #ebc57088}
#pause-tools{position:absolute;right:18px;top:12px;display:flex;gap:8px;z-index:2}#pause-tools[hidden]{display:none}#pause-tools #mute{font-size:21px;min-width:40px;padding:6px}#pause-tools #open-dev{font-size:12px;padding:7px 10px}#menu:has(#pause-tools:not([hidden])) .menu-content{padding-top:65px}
.battle-drawer{bottom:76px}#troop-drawer{max-height:calc(100dvh - 154px)}#test-session{top:64px}
@media(max-width:760px){main{grid-template-rows:58px minmax(0,1fr) 62px}header{gap:6px;padding:6px 8px}header #era-name{display:none}header #game-speed{min-width:45px;font-size:10px;padding:8px 5px}header #begin-night{min-width:0;max-width:125px;flex:1;min-height:40px;font-size:10px;padding:5px 7px}header #evolve{min-width:0;flex:1;max-width:155px;font-size:10px;padding:5px 7px}header #pause{min-width:35px;padding:8px}#battle-dock{padding:7px 8px;gap:6px}#battle-dock>button{font-size:12px}#battle-dock #open-fortress{font-size:11px}.battle-drawer{top:66px;bottom:72px}#troop-drawer{max-height:calc(100dvh - 138px)}#phase-strip{max-width:calc(100% - 108px);width:270px;padding:6px 9px;gap:4px}#night-title{font-size:10px}#phase-strip .resources{gap:22px}#phase-strip .resource strong{font-size:19px;line-height:21px}#phase-strip .resource small{font-size:8px;line-height:10px}.camera{right:8px;bottom:42px}.camera button{padding:6px 11px}#test-session{top:58px}#base-warning{top:100px}.field-top{right:8px;top:10px}.field-top span{font-size:13px}}
/* Final mobile alignment from the walkthrough. */
@media(max-width:760px){header #begin-night,header #evolve{flex:1 1 0;min-width:0;max-width:none;width:0;margin:0;height:40px}header #game-speed,header #pause{flex:0 0 45px;width:45px;min-width:45px;height:40px;padding:6px 5px;display:grid;place-items:center}header .header-actions{flex:0 0 45px;width:45px}#phase-strip{background:#1b302bad}}
/* Slow, continuous breathing glow with identical endpoints and no brightness jump. */
@keyframes polished-ready{0%,100%{box-shadow:0 0 0 1px #e4cf9226,0 0 4px #d9c17b0d;filter:brightness(1)}50%{box-shadow:0 0 0 1px #e4cf9280,0 0 18px #d9c17b50;filter:brightness(1.075)}}
#begin-night.ready,#confirm-difficulty.ready{animation:polished-ready 3.6s cubic-bezier(.45,0,.55,1) infinite;will-change:auto}
.reduced-motion #begin-night.ready,.reduced-motion #confirm-difficulty.ready{animation:none;filter:none;box-shadow:0 0 0 1px #e4cf9266,0 0 8px #d9c17b26}
@media(prefers-reduced-motion:reduce){#begin-night.ready,#confirm-difficulty.ready{animation:none;filter:none;box-shadow:0 0 0 1px #e4cf9266,0 0 8px #d9c17b26}}
/* Dedicated recruitment action, separated from inspection. */
.troop-card{display:flex;flex-direction:column}.troop-card .unit{flex:none}.troop-card .unit:hover{transform:none!important;box-shadow:none!important}.troop-card .expand-stats{margin:2px 8px 6px;width:calc(100% - 16px);min-height:32px;padding:6px 8px;background:transparent;border:1px solid #94aa8b33;border-radius:5px;font-size:10px;letter-spacing:.25px;color:#b9cbb4;box-shadow:none}.troop-card .expand-stats:hover{background:#385040;border-color:#a4b89188}.train-unit{display:flex;justify-content:space-between;align-items:center;gap:6px;margin:0 8px 8px;margin-top:auto;width:calc(100% - 16px);min-height:42px;padding:9px 10px;background:linear-gradient(#516b48,#354b33);border:1px solid #b9c68a88;border-radius:5px;color:#f0e2b6;font-size:12px;font-weight:600}.train-unit>span:last-child{font-size:10px;font-weight:400}.train-unit:disabled{background:#2b3b30;color:#95a28d;border-color:#74866b44;opacity:.75}
@keyframes back-glow{0%,100%{box-shadow:inset 0 1px #f0aaa00a,0 0 3px #b94a3910}50%{box-shadow:inset 0 1px #f0aaa018,0 0 12px #b94a3945}}
.drawer-heading [data-close],#close-armory,#close-dev,#close-preferences,#menu-actions button.menu-back{background:linear-gradient(#692e31,#461f26);border:1px solid #a45a5b88;color:#f3ceca;border-radius:5px;animation:back-glow 3.8s ease-in-out infinite}
.reduced-motion .drawer-heading [data-close],.reduced-motion #close-armory,.reduced-motion #close-dev,.reduced-motion #close-preferences,.reduced-motion #menu-actions button.menu-back{animation:none}
@media(prefers-reduced-motion:reduce){.drawer-heading [data-close],#close-armory,#close-dev,#close-preferences,#menu-actions button.menu-back{animation:none}}
.game-icon{width:20px;height:20px;display:inline-block;flex-shrink:0;vertical-align:middle}#battle-dock>button{display:flex;justify-content:center;align-items:center;gap:6px}#game-speed{display:flex!important;gap:3px!important}#game-speed .game-icon{width:12px;height:15px}#pause .game-icon{width:18px;height:18px}.camera #special .game-icon{width:26px;height:26px}.troop-champion summary .game-icon{color:#dbc0ed}.upgrade-top .game-icon{width:24px;height:24px}
@keyframes night-red{0%,100%{box-shadow:0 0 3px #b8473710;border-color:#a95c5060}50%{box-shadow:0 0 13px #b8473755;border-color:#d28b7488}}
header #begin-night.in-progress{background:linear-gradient(#6b3433,#46262a);color:#f5cbc3;animation:night-red 3.6s ease-in-out infinite}
.reduced-motion header #begin-night.in-progress{animation:none}@media(prefers-reduced-motion:reduce){header #begin-night.in-progress{animation:none}}
/* Compact Back control above the difficulty heading. */
body[data-menu-scene=difficulty] .menu-content{position:relative;padding-top:58px}
body[data-menu-scene=difficulty] #menu-actions{position:static;padding-top:0}
body[data-menu-scene=difficulty] #menu-actions button.menu-back{top:14px;left:24px;width:auto;min-width:54px;min-height:28px!important;padding:5px 9px;font-size:10px;line-height:16px}
#menu-tagline{font-size:11px;line-height:1.6;letter-spacing:1.4px;margin:8px 0 20px;color:#d0bd8c}body:not([data-menu-scene=title]) #menu-tagline{display:none}body[data-menu-scene=title] #menu-title{margin-top:0;margin-bottom:10px}
/* A clear primary action and quieter preferences on the opening menu. */
body[data-menu-scene=title] #menu-actions>button{min-height:58px;font-size:22px;padding:15px 20px}
body[data-menu-scene=title] #settings-button{display:block;width:auto;margin:14px auto 0;padding:6px 10px;min-height:32px;background:transparent;border-color:transparent;box-shadow:none;font-size:11px;color:#b9c4ad}
body[data-menu-scene=title] #settings-button:hover{color:#ebd7a7;text-decoration:underline;text-underline-offset:4px}
body[data-menu-scene=title] #menu-description{font-size:13px;line-height:1.75;max-width:440px}
#preferences-dialog .drawer-heading{display:flex;align-items:center;gap:12px}
#preferences-dialog .drawer-heading h2{min-width:0;font-size:23px}
#preferences-dialog #close-preferences{flex:none;margin-left:auto;min-width:52px;min-height:32px!important;padding:5px 8px;font-size:10px;line-height:20px}
#preferences-dialog .copyright-credit{display:flex;flex-wrap:wrap;align-items:center;gap:10px;font-size:11px;color:#b9c4ad}
#preferences-dialog .copyright-credit span{font-size:10px;opacity:.75;white-space:nowrap}
@keyframes campaign-red{0%,100%{box-shadow:0 0 4px #bc403020;border-color:#ac625c;filter:brightness(1)}50%{box-shadow:0 0 22px #d04c4659;border-color:#df9383;filter:brightness(1.08)}}
body[data-menu-scene=title] #menu-actions>button{background:linear-gradient(#793a39,#50282d);color:#ffe2d5;border-color:#ac625c;animation:campaign-red 3.6s cubic-bezier(.45,0,.55,1) infinite}
body.reduced-motion[data-menu-scene=title] #menu-actions>button{animation:none}
@media(prefers-reduced-motion:reduce){body[data-menu-scene=title] #menu-actions>button{animation:none}}

/* Reversible mobile compact menus, September 8. */
#compact-tabs,#fortress-preview,.drawer-gold{display:none}
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 .battle-drawer,#troop-drawer{top:66px;bottom:72px;left:8px;right:8px;width:auto;max-height:none;padding:10px;scroll-padding-top:62px}
 .battle-drawer .drawer-heading,.battle-drawer .armory-heading{position:sticky;top:-10px;z-index:3;background:#1e322b;margin:0 0 10px;padding:9px 0;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
 .battle-drawer .drawer-heading h2,.battle-drawer .armory-heading h2{font-size:18px}
 .battle-drawer .armory-heading .eyebrow{display:none}
 .battle-drawer .drawer-gold,#armory-gold{display:block;margin-left:auto;font:600 12px system-ui;color:#edcc87;white-space:nowrap}
 .battle-drawer .drawer-heading button,#close-armory{min-width:54px;min-height:40px!important;padding:7px 9px;font-size:11px}
 #troop-drawer .unit-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #troop-drawer .recruitment>.section-heading{display:none}
 #troop-drawer .unit{grid-template-columns:52px minmax(0,1fr)}
 #troop-drawer .card-top{padding:5px 7px;font-size:8px;letter-spacing:.3px}
 #troop-drawer .card-top kbd{display:none}
 #troop-drawer .troop-portrait{height:78px;align-self:center}
 #troop-drawer .troop-portrait canvas{width:100%;height:100%;object-fit:contain}
 #troop-drawer .card-info{padding:4px;gap:4px}
 #troop-drawer .unit b{font-size:14px;line-height:1.15;overflow-wrap:anywhere}
 #troop-drawer .unit em{display:none}
 #troop-drawer .unit-stats{display:grid!important;font-size:10px;gap:3px;word-spacing:0}
 #troop-drawer .unit-stats>span{display:flex;justify-content:space-between;gap:3px}
 #troop-drawer .troop-card:not(.expanded) .advanced-stat{display:none}
 #troop-drawer .troop-card.expanded .unit-stats{grid-template-columns:1fr}
 #troop-drawer .expand-stats{min-height:32px!important;margin:3px 6px;width:calc(100% - 12px);padding:5px;font-size:10px}
 #troop-drawer .train-unit{min-height:44px!important;margin:3px 6px 6px;width:calc(100% - 12px);padding:8px;font-size:12px}
 #troop-drawer .recruit-state{font-size:8px;padding:3px}
 #troop-drawer .queue-line{padding:6px;gap:6px;margin-top:8px}
 #troop-drawer .queue-copy{min-width:0;font-size:10px}
 #troop-drawer #queue{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:220px}
 #troop-drawer .queue-line button{min-height:40px!important;font-size:10px}
 #troop-drawer #night-detail{display:none}
 #champion-drawer{margin-top:8px;padding-top:8px}
 #champion-drawer summary{font-size:15px;min-height:40px}
 #champion-drawer summary span{display:inline;font-size:10px;margin-left:8px}
 #compact-tabs{display:flex;gap:6px;margin:0 0 10px}
 #compact-tabs:empty{display:none}
 #compact-tabs button{flex:1;min-width:0;min-height:42px!important;padding:8px 5px;font-size:12px}
 #compact-tabs button[aria-pressed=true]{background:#576047;border-color:#d7b675;color:#fff0c9}
 #armory-note{font-size:10px;line-height:1.45;margin:8px 0}
 #upgrade-grid{display:grid;grid-template-columns:1fr;gap:8px}
 #armory[data-group=army] .upgrade-card,#armory[data-group=fortress] .upgrade-card{display:none}
 #armory[data-section=weapons] .upgrade-card[data-section=weapons],#armory[data-section=armor] .upgrade-card[data-section=armor],#armory[data-section=ammunition] .upgrade-card[data-section=ammunition],#armory[data-section=structure] .upgrade-card[data-section=structure],#armory[data-section=walls] .upgrade-card[data-section=walls],#armory[data-section=tower] .upgrade-card[data-section=tower],#armory[data-group=hero] .upgrade-card{display:grid;grid-template-columns:62px minmax(0,1fr);gap:4px 9px;padding:9px}
 .upgrade-card .upgrade-top{grid-column:2;grid-row:1;font-size:9px}
 .upgrade-card .upgrade-top>span{display:none}
 .upgrade-card .upgrade-art{grid-column:1;grid-row:1/5;align-self:center;margin:0;width:62px;height:70px;object-fit:cover;aspect-ratio:auto}
 .upgrade-card h3{grid-column:2;margin:0;font-size:15px}
 .upgrade-card p{grid-column:2;margin:0;font-size:10px;line-height:1.45}
 .upgrade-card .upgrade-meter{grid-column:2;font-size:10px;margin:2px 0}
 .upgrade-card button{grid-column:1/-1;min-height:44px!important;font-size:12px;margin:4px 0 0}
 .upgrade-card em{grid-column:1/-1;font-size:10px;line-height:1.4}
 #armory:not([data-section=ammunition]) #ammo-section{display:none}
 #ammo-types{display:grid;grid-template-columns:1fr 1fr;gap:5px}
 #ammo-types button,#ammo-toggle{min-height:40px!important;font-size:11px;padding:7px}
 #ammo-description{font-size:10px;line-height:1.45}
 #fortress-preview:not([hidden]){display:flex;align-items:center;gap:12px;padding:7px;background:#14271f;border:1px solid #71837055;border-radius:6px}
 #fortress-preview canvas{width:96px;height:70px;object-fit:contain}
 #fortress-preview>div{flex:1;min-width:0;font-size:11px}
 #fortress-slots{display:flex;gap:4px;margin-top:7px}
 #fortress-slots button{flex:1;min-width:0;padding:5px 3px;min-height:40px!important;font-size:9px;border-style:dashed}
 #fortress-slots .installed{border-style:solid;border-color:#95b685;color:#d3e9bb}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 main{grid-template-rows:52px minmax(0,1fr) 54px}
 header{padding:4px 12px;gap:8px}header #era-name{display:none}
 #battle-dock{padding:5px 12px}#battle-dock>button{font-size:11px}
 .battle-drawer,#troop-drawer{top:58px;bottom:60px;left:auto;right:8px;width:min(390px,48vw);max-height:none}
 body:has(.battle-drawer:not([hidden])) .field{width:calc(100% - min(406px,50vw))}
 #phase-strip{width:220px;max-width:calc(100% - 76px);padding:5px 7px}
 #phase-strip .resource strong{font-size:16px;line-height:18px}#night-title{font-size:9px}
 .field-top{right:6px;top:8px}.field-top span{font-size:11px}
 .camera{right:6px;bottom:37px}.camera button{padding:5px 8px}
 .map-navigation{left:6px;right:139px}.zoom-control{right:6px;font-size:9px}.zoom-control input{width:64px}
 #notice{max-width:85%;font-size:15px}
 #test-session{top:52px}
}
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #troop-drawer .unit .card-info{grid-column:2;grid-row:2;text-align:left;padding:4px;gap:4px}
 #troop-drawer .unit .unit-stats{gap:3px;margin-top:2px;font-size:10px}
 #troop-drawer .unit em{display:none}
 #troop-drawer .unit .card-top{grid-column:1/-1;grid-row:1}
}
/* Defeat actions: clear replay choice and red return to menu. */
body[data-result=lost] #menu-actions>button{font-size:20px;min-height:48px}
body[data-result=lost] #menu-actions>button:last-child{background:linear-gradient(#793a39,#50282d);border-color:#ac625c;color:#ffe2d5}
/* Enlarge recruitment art inside the existing compact portrait window. */
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #troop-drawer .troop-portrait canvas{transform:scale(1.7);transform-origin:50% 50%}
}
/* Landscape-only HUD: central resources and an unobstructed full-map view. */
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 main{grid-template-rows:42px minmax(0,1fr) 48px}
 header{position:relative;padding:3px 10px;gap:6px}
 header #game-speed,header #pause{width:35px;min-width:35px;height:32px;min-height:32px!important;padding:5px;font-size:10px}
 header .header-actions{width:35px;flex:0 0 35px}
 header #begin-night,header #evolve{flex:0 1 136px;width:136px;min-width:0;max-width:136px;height:32px;min-height:32px!important;padding:4px 6px;font-size:10px}
 header #begin-night{margin-right:auto}header #evolve{margin-left:auto}
 #phase-strip{position:fixed;z-index:13;top:2px;left:50%;width:260px;max-width:calc(100vw - 380px);height:38px;padding:2px 8px;background:transparent;border:0;gap:1px;grid-template-columns:1fr;align-content:center;pointer-events:none}
 #phase-strip #night-title{font-size:9px;line-height:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #phase-strip #night-progress{display:none}
 #phase-strip .resources{gap:18px}
 #phase-strip .resource>div{flex-direction:row;align-items:baseline;gap:5px}
 #phase-strip .resource small{font-size:8px;line-height:12px}#phase-strip .resource strong{font-size:14px;line-height:15px}
 #phase-strip .resource progress{display:none}
 .map-navigation,.zoom-control,.camera #camera-left,.camera #camera-right,.camera #camera-center{display:none}
 .camera{right:8px;bottom:8px}
 .camera #special{width:40px;height:40px;min-height:40px}
 .camera #special .ability-icon{width:32px;height:32px}
 #battle-dock{padding:4px 10px}
 .battle-drawer,#troop-drawer{top:48px;bottom:54px}
 #test-session{top:42px}
}
/* Per-mount turret selection. */
#turret-picker{padding:10px;background:#192d26;border:1px solid #8b9b7955;border-radius:6px;margin:10px 0}
#turret-picker[hidden]{display:none}
#turret-picker h3{font:18px Georgia;margin:0 0 6px;color:#ead3a6}
#turret-picker p{font-size:11px;line-height:1.5;margin:5px 0 10px;color:#bac7b0}
#turret-choices{display:grid;gap:7px}
#turret-choices button{display:grid;gap:5px;text-align:left;min-height:64px;padding:10px}
#turret-choices b{font-size:13px}#turret-choices span{font-size:11px}#turret-choices strong{font-size:11px;color:#e4c684}
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #armory:not([data-section=tower]) #turret-picker{display:none}
 #armory[data-section=tower] .upgrade-card[data-upgrade=turret]{display:none}
}
/* Canvas gestures belong to the game; menu panels retain native scrolling. */
#battle{touch-action:none}
.battle-drawer{touch-action:pan-y}
/* Reachable pause controls in both phone orientations. */
#pause-back{font-size:12px;min-height:40px;padding:7px 10px;background:linear-gradient(#692e31,#461f26);border-color:#a45a5b88;color:#f3ceca}
#menu{max-height:calc(100dvh - 20px);overflow-y:auto;overscroll-behavior:contain}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #menu{width:min(700px,calc(100vw - 24px));max-height:calc(100dvh - 16px);margin:auto}
 #menu .menu-art{display:none}
 #menu .menu-content{margin-left:0;padding:14px 22px}
 #menu:has(#pause-tools:not([hidden])) .menu-content{padding-top:8px}
 #pause-tools{position:sticky;top:0;right:auto;justify-content:flex-end;align-items:center;gap:7px;padding:5px 0;background:#1b2d24}
 #pause-tools #pause-back{margin-right:auto}
 #menu .menu-content>h2{font-size:27px;margin:8px 0}
 #menu-description{font-size:11px;line-height:1.45;max-width:520px}
 #menu:has(#pause-tools:not([hidden])) #menu-actions{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:12px 0}
 #menu:has(#pause-tools:not([hidden])) #menu-actions button{min-height:44px;padding:8px;font-size:12px}
 #menu #settings-button{margin:5px auto;padding:7px;min-height:34px;width:auto;font-size:11px}
}
/* Give recruitment portraits more room beside right-aligned information. */
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #troop-drawer .unit{grid-template-columns:68px minmax(0,1fr)}
 #troop-drawer .unit .card-info{padding:4px 5px 4px 0;text-align:right}
 #troop-drawer .unit .unit-stats{text-align:right;gap:4px}
 #troop-drawer .unit-stats>span{justify-content:flex-end;gap:5px;flex-wrap:wrap}
 #troop-drawer .troop-portrait{height:96px}
 #troop-drawer .troop-portrait canvas{transform:scale(1.85)}
}
/* Make selection and ammunition purchase read as one section. */
#ammo-section .ammo-heading{flex-wrap:wrap;gap:8px}
#ammo-section .ammo-heading>span{display:block;width:100%;font:18px Georgia;color:#ead3a6;letter-spacing:0}
#ammo-types button[aria-pressed=true]{border-color:#dfc68c;background:#526147;box-shadow:inset 0 0 0 1px #dfc68c55}
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #armory[data-section=ammunition] #ammo-section{margin-bottom:0;padding:10px;border:1px solid #8b9b7955;border-bottom:0;border-radius:6px 6px 0 0;background:#192d26}
 #armory[data-section=ammunition] #upgrade-grid{gap:0}
 #armory[data-section=ammunition] .upgrade-card[data-upgrade=ammunition]{border-radius:0 0 6px 6px;border-top:0;background:#192d26}
 #armory[data-section=ammunition] .upgrade-art{display:none}
 #armory[data-section=ammunition] .upgrade-card{grid-template-columns:1fr}
 #armory[data-section=ammunition] .upgrade-card>*{grid-column:1!important}
}
/* Illustrated defenses and explicit wall strengths. */
#turret-choices button,#wall-choices button{grid-template-columns:85px minmax(0,1fr);align-items:center}
#turret-choices canvas,#wall-choices canvas{grid-column:1;grid-row:1/4;width:85px;height:65px;object-fit:contain;border-radius:4px}
#turret-choices button>b,#turret-choices button>span,#turret-choices button>strong,#wall-choices button>b,#wall-choices button>span,#wall-choices button>strong{grid-column:2}
#wall-picker{padding:10px;background:#192d26;border:1px solid #8b9b7955;border-radius:6px;margin:10px 0}
#wall-picker[hidden]{display:none}#wall-picker h3{font:18px Georgia;margin:0 0 6px;color:#ead3a6}#wall-picker p{font-size:11px;line-height:1.5;color:#bac7b0}
#wall-choices{display:grid;gap:7px}#wall-choices button{display:grid;gap:5px;text-align:left;padding:10px;min-height:80px}
#wall-choices b{font-size:13px}#wall-choices span,#wall-choices strong{font-size:11px}
#wall-choices strong{color:#e4c684}
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #armory:not([data-section=walls]) #wall-picker{display:none}
 #armory[data-section=walls] .upgrade-card[data-upgrade=wall]{display:none}
}
/* Slightly fuller portraits, with calmer stat spacing. */
@media(max-width:760px),(pointer:coarse),(max-height:500px) and (max-width:1100px){
 #troop-drawer .troop-portrait canvas{transform:scale(2.05)}
 #troop-drawer .unit-stats strong{min-width:25px;font-variant-numeric:tabular-nums}
}
/* Ammunition purchase uses the full panel, without an empty art column. */
#armory[data-section=ammunition] #upgrade-grid .upgrade-card[data-upgrade=ammunition]{display:flex;flex-direction:column;align-items:stretch;grid-template-columns:none;width:100%;min-width:0;padding:12px;gap:8px}
#armory[data-section=ammunition] #upgrade-grid .upgrade-card[data-upgrade=ammunition] .upgrade-art{display:none}
#armory[data-section=ammunition] #upgrade-grid .upgrade-card[data-upgrade=ammunition]>button{width:100%;min-height:48px;white-space:normal;text-align:center;padding:12px;font-size:13px}
#armory[data-section=ammunition] #upgrade-grid .upgrade-card[data-upgrade=ammunition]>h3{font-size:17px;margin:0}
#armory[data-section=ammunition] #upgrade-grid .upgrade-card[data-upgrade=ammunition]>p{font-size:11px;line-height:1.5;margin:0}
/* Cost and affordability share an orderly row with separate emphasis. */
#wall-choices button>.purchase-row,#turret-choices button>.purchase-row{grid-column:1/-1;display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:5px 12px;border-top:1px solid #95a38433;padding-top:9px;margin-top:3px;font:600 11px/1.5 system-ui;font-variant-numeric:tabular-nums;color:#edcf91}
#wall-choices .purchase-status,#turret-choices .purchase-status{font-size:10px;font-weight:400;color:#9ccead;text-align:right}
#wall-choices button:disabled .purchase-status,#turret-choices button:disabled .purchase-status{color:#ed9d86}
/* Separate ammunition ownership, equipment, and use. */
#ammo-types{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.ammo-card{min-width:0;padding:12px;background:#20372c;border:1px solid #84927566;border-radius:6px}
.ammo-card.equipped{border-color:#ddc187;box-shadow:inset 3px 0 #ddc187}
.ammo-card-heading{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap}
.ammo-card h3{font:17px Georgia;color:#ead3a6;margin:0}
.ammo-stock{font:11px system-ui;color:#b6c6ad;white-space:nowrap;font-variant-numeric:tabular-nums}
.ammo-card p{font-size:11px;line-height:1.5;color:#c3cdb7;margin:8px 0}
.ammo-card-actions{display:grid;grid-template-columns:minmax(0,1fr) 80px;gap:7px}
#ammo-types .ammo-card-actions button{min-height:44px!important;padding:8px;font-size:12px;white-space:normal}
#ammo-types{grid-auto-rows:1fr}
.ammo-card{display:flex;flex-direction:column}
.ammo-card>p{flex:1}
.ammo-card .ammo-card-heading{min-height:44px;align-content:center}
.ammo-card .ammo-purchase-status{min-height:1.5em;margin-top:5px}
#ammo-types .equip-ammo[aria-pressed=true]{background:#526147;border-color:#dfc68c}
.ammo-purchase-status{display:block;color:#ed9d86;font:10px/1.5 system-ui;margin-top:6px}
.ammo-purchase-status:empty{display:none}
#ammo-description{font-size:11px;line-height:1.5}
@media(max-width:760px),(pointer:coarse),(max-height:600px) and (max-width:1100px){
 #ammo-types{grid-template-columns:1fr;gap:8px}
 #armory[data-section=ammunition] #ammo-section{border:0;background:transparent;padding:0}
 .ammo-card{padding:10px}
 #ammo-toggle{width:100%;min-height:44px!important}
}
/* Original illustrated armor research tiers. */
#armor-picker{padding:10px;background:#192d26;border:1px solid #8b9b7955;border-radius:6px;margin:10px 0}
#armor-picker[hidden]{display:none}#armor-picker h3{font:18px Georgia;margin:0 0 6px;color:#ead3a6}#armor-picker p{font-size:11px;line-height:1.5;color:#bac7b0}
#armor-choices{display:grid;gap:8px}#armor-choices button{display:grid;grid-template-columns:85px minmax(0,1fr);gap:7px;align-items:center;text-align:left;padding:10px}
#armor-choices canvas{grid-column:1;grid-row:1/3;width:85px;height:75px;object-fit:contain}
#armor-choices b{font:15px Georgia;color:#ead3a6}#armor-choices button>span{grid-column:2;font:11px/1.5 system-ui}
#armor-choices .purchase-row{grid-column:1/-1;display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:5px 12px;border-top:1px solid #95a38433;padding-top:9px;font:600 11px/1.5 system-ui;font-variant-numeric:tabular-nums;color:#edcf91}
#armor-choices .purchase-status{font-size:10px;font-weight:400;color:#9ccead}#armor-choices button:disabled .purchase-status{color:#ed9d86}
@media(max-width:760px),(pointer:coarse),(max-height:600px) and (max-width:1100px){#armory:not([data-section=armor]) #armor-picker{display:none}}
.ammo-card h3{display:flex;align-items:center;gap:8px;font-size:19px}
.ammo-card h3 .game-icon{width:27px;height:27px;color:#d8bf88}
.ammo-stock{font-size:15px;font-weight:600;color:#e7d7af}
.ammo-card[data-ammo=lightning] .game-icon{color:#9ad9f5}.ammo-card[data-ammo=incendiary] .game-icon{color:#efac71}.ammo-card[data-ammo=explosive] .game-icon{color:#e99580}
#armory[data-section=ammunition] #armory-note{display:none}
#ammo-section .ammo-heading>span{display:flex;align-items:baseline;flex-wrap:wrap;gap:5px 12px}
.ammo-use-hint{font:11px/1.4 system-ui;color:#edcf91;letter-spacing:0}
/* Touch polish and full-screen landscape menus. */
#phase-strip{background:#1b302b65!important}
#settings-button{display:flex!important;align-items:center;justify-content:center;gap:7px}#settings-button[hidden]{display:none!important}
#evolve{position:relative;isolation:isolate;overflow:hidden;display:flex;flex-direction:column;justify-content:center;gap:2px}
#evolve:before{content:'';position:absolute;inset:0 auto 0 0;width:var(--evolve-progress,0%);background:#c5d5a844;z-index:-1;transition:width .4s ease}
header #evolve>b{font-size:18px;line-height:20px}header #evolve>small{font-size:8px;line-height:10px;font-weight:400}
@keyframes signal-ready{0%,100%{box-shadow:0 0 5px #efcf7355;filter:brightness(1)}50%{box-shadow:0 0 24px #efcf73aa,inset 0 0 12px #fff3c033;filter:brightness(1.17)}}
#begin-night.ready,#evolve.evolve-ready{animation:signal-ready 2.8s cubic-bezier(.45,0,.55,1) infinite}
#evolve.evolve-ready{border-color:#efd88c;color:#fff3c5}
#pause-back,#close-preferences,#close-dev,#close-armory,.drawer-heading [data-close],#menu-actions .menu-back{animation:back-glow 3.8s ease-in-out infinite}
@keyframes speed-feedback{0%,100%{box-shadow:0 0 1px #dfce9233}40%{box-shadow:0 0 18px #dfce92aa;filter:brightness(1.3)}}
.speed-feedback{animation:speed-feedback var(--speed-pulse-duration,1.2s) ease-in-out infinite}
#speed-menu{position:fixed;top:52px;left:8px;z-index:50;display:grid;gap:5px;padding:8px;background:#22382f;border:1px solid #bda575;border-radius:6px;box-shadow:0 8px 25px #0009}
#speed-menu[hidden]{display:none}#speed-menu button{min-width:65px;min-height:40px}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .battle-drawer,#troop-drawer{left:8px;right:8px;width:auto;top:48px;bottom:54px}
 body:has(.battle-drawer:not([hidden])) .field{width:100%}
 #troop-drawer .unit-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
 #upgrade-grid,#armor-choices,#wall-choices,#turret-choices,#ammo-types{grid-template-columns:repeat(3,minmax(0,1fr))}
 #ammo-types{grid-template-columns:repeat(2,minmax(0,1fr))}
 #armor-choices button,#wall-choices button,#turret-choices button{grid-template-columns:62px minmax(0,1fr)}
 #armor-choices canvas,#wall-choices canvas,#turret-choices canvas{width:62px;height:65px}
 .battle-drawer .drawer-heading,.battle-drawer .armory-heading{margin-bottom:5px;padding:4px 0}
 #armory-note,#armor-picker>p,#wall-picker>p,#turret-picker>p{font-size:10px;line-height:1.3;margin:5px 0}
 #fortress-preview:not([hidden]){float:right;width:270px;margin:0 0 5px 12px}
 #armor-picker,#wall-picker,#turret-picker{clear:both}
 #phase-strip{background:transparent!important}
}
.reduced-motion #begin-night.ready,.reduced-motion #evolve.evolve-ready,.reduced-motion .speed-feedback,.reduced-motion #pause-back{animation:none}
@media(prefers-reduced-motion:reduce){#begin-night.ready,#evolve.evolve-ready,.speed-feedback,#pause-back{animation:none}}
.return-action{animation:back-glow 3.8s ease-in-out infinite}
.reduced-motion .return-action{animation:none}@media(prefers-reduced-motion:reduce){.return-action{animation:none}}
html[dir=rtl] .ammo-card,html[dir=rtl] .upgrade-card,html[dir=rtl] #armor-choices button,html[dir=rtl] #wall-choices button,html[dir=rtl] #turret-choices button{text-align:right}
html[dir=rtl] .purchase-row{direction:rtl}
html[dir=rtl] header,html[dir=rtl] .camera,html[dir=rtl] .map-navigation{direction:ltr}
html[dir=rtl] #phase-strip,html[dir=rtl] #evolve{direction:rtl}
#language{min-height:44px;width:100%;max-width:100%}
#recruit-champion{min-height:44px;width:100%;margin:8px 0}
/* Opening menu has an icon-only Settings shortcut; other menus retain their label. */
body[data-menu-scene=title] #settings-button{margin:14px auto 0 0;width:46px;height:46px;padding:9px;border:1px solid #a7b18a66;background:#263e3299;border-radius:8px}
body[data-menu-scene=title] #settings-button>span{display:none}
body[data-menu-scene=title] #settings-button .game-icon{width:28px;height:28px}
#quick-language{display:none;position:absolute;top:12px;left:18px;z-index:4;width:42px;height:42px;padding:8px;background:#294335;border:1px solid #9cae8588;border-radius:50%}
#menu:has(#pause-tools:not([hidden])) #quick-language{display:grid;place-items:center}
#quick-language .game-icon{width:25px;height:25px}
#menu:has(#pause-tools:not([hidden])) #pause-tools{left:72px}
#language-dialog{width:min(440px,calc(100vw - 24px));padding:20px;max-height:calc(100dvh - 24px);overflow:auto;background:#1e322b}
#language-dialog h2{font:24px Georgia;margin:0}#quick-language-select{width:100%;min-height:48px;font:16px system-ui;padding:10px}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){#menu:has(#pause-tools:not([hidden])) #pause-tools{left:auto;margin-left:48px}#quick-language{top:12px;left:15px}}
/* Reversible cinematic title, original live artwork. */
body[data-menu-scene=title] #menu{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;border-radius:0;background:#11231f}
body[data-menu-scene=title] #menu .menu-art{display:block;position:absolute;inset:0;width:100%;height:100%;opacity:1;background:none}
body[data-menu-scene=title] #menu .menu-art:after{display:none}
#title-scene{width:100%;height:100%;display:block}
body[data-menu-scene=title] #menu .menu-content{height:100%;min-height:500px;margin:0;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:45px 28px 90px;background:radial-gradient(ellipse at center,#10221d77,transparent 75%)}
body[data-menu-scene=title] #menu-title{font:700 clamp(44px,9vw,92px)/.95 Georgia,serif;text-transform:uppercase;letter-spacing:3px;max-width:620px;color:#f0d6a1;text-shadow:0 2px #7d623d,0 4px #493e29,0 12px 35px #0009;margin:0 0 20px;padding:10px 0;border-top:1px solid #c7a46d88;border-bottom:1px solid #c7a46d88}
body[data-menu-scene=title] #menu-tagline{font-size:11px;letter-spacing:2px;color:#e4c58e;margin:8px 0 20px}
body[data-menu-scene=title] #menu-description{max-width:390px;color:#dfdfc7;text-shadow:0 2px 6px #000}
body[data-menu-scene=title] #menu-actions{width:min(340px,100%);margin:26px 0 0}
body[data-menu-scene=title] #settings-button{position:absolute;right:20px;bottom:20px;left:auto;margin:0;width:48px;height:48px;background:#19372bc9}
#menu-actions #confirm-difficulty{font:700 23px Georgia;min-height:58px;margin-top:14px;border-width:2px}
#menu-actions #confirm-difficulty.ready{background:linear-gradient(#667b4b,#354f33);border-color:#f0d78e;box-shadow:0 0 20px #e8c77566}
/* Stable hit targets: inner icons never intercept taps. */
#mute .game-icon,#mute .game-icon *{pointer-events:none}
#pause-tools #open-dev{display:none!important}
#pause-tools{left:72px!important;right:18px;display:grid;grid-template-columns:1fr 44px;gap:8px}
#pause-tools #pause-back{justify-self:center;margin:0!important}
#pause-tools #mute{grid-column:2;justify-self:end;width:44px;height:42px;min-height:42px;padding:8px;touch-action:manipulation}
#secret-dev{display:inline;font:inherit;color:inherit;padding:0!important;margin:0;border:0;background:none;box-shadow:none;min-width:0;min-height:0;line-height:inherit;vertical-align:baseline}
#secret-dev:hover{filter:none}#secret-dev:active{transform:none}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .battle-drawer,#troop-drawer{padding:7px;scroll-padding-top:48px}
 .battle-drawer .drawer-heading,.battle-drawer .armory-heading{top:-7px;padding:3px 0;margin-bottom:4px}
 #compact-tabs{margin-bottom:5px}#compact-tabs button{min-height:36px!important;padding:5px}
 #champion-drawer{margin-top:4px;padding-top:4px}#champion-drawer summary{min-height:30px;font-size:14px}#champion-drawer summary span{font-size:9px}
 #champion-drawer #hero-strip{grid-template-columns:65px 1fr;gap:7px;padding:5px 0}
 #champion-drawer #hero-strip>canvas{width:65px;height:65px}#hero-strip .hero-info h3{font-size:18px;margin:2px 0 5px}
 #hero-strip .hero-actions{grid-template-columns:1fr 1fr;gap:5px}#hero-strip .hero-actions>small{grid-column:1/-1;font-size:10px}
 #armor-picker,#wall-picker,#turret-picker,.ammo-card{padding:7px;margin-top:5px}
 #armor-choices,#wall-choices,#turret-choices,#ammo-types{gap:6px}
 #menu:has(#pause-tools:not([hidden])) #pause-tools{position:relative;left:auto!important;right:auto;margin-left:48px;grid-template-columns:1fr 44px}
 body[data-menu-scene=title] #menu .menu-content{min-height:0;padding:20px 75px 30px}
 body[data-menu-scene=title] #menu-title{font-size:48px;margin-bottom:5px;padding:5px 0}
 body[data-menu-scene=title] #menu-tagline{margin:5px 0 10px;font-size:10px}
 body[data-menu-scene=title] #menu-description{font-size:11px;max-width:420px}
 body[data-menu-scene=title] #menu-actions{margin-top:12px;width:300px}
 body[data-menu-scene=title] #menu-actions>button{min-height:48px;font-size:20px;padding:10px}
}
/* Difficulty confirmation hierarchy. */
#menu-actions #confirm-difficulty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-height:74px;padding:12px}
#confirm-difficulty b{font:700 30px/1.1 Georgia}
#confirm-difficulty small{font:12px/1.3 system-ui;letter-spacing:.7px;min-height:1.3em}
#menu-actions #confirm-difficulty{position:relative;height:84px;min-height:84px;box-sizing:border-box;border-radius:8px;background:linear-gradient(140deg,#52614d,#2c3e30);box-shadow:inset 0 1px #ffffff33,inset 0 -8px 18px #0002,0 4px 12px #0004}
#confirm-difficulty::before{content:'';position:absolute;inset:5px;border:1px solid #e4d2a333;border-radius:4px;pointer-events:none}
#confirm-difficulty .battle-heading{display:flex;align-items:center;justify-content:center;gap:10px;transform:translateY(0);transition:transform .2s ease}
#confirm-difficulty .battle-heading .game-icon{width:25px;height:25px}
#confirm-difficulty.ready .battle-heading{transform:translateY(-10px)}
#confirm-difficulty small{position:absolute;top:calc(50% + 14px);left:12px;right:12px;text-align:center}
#menu-actions #confirm-difficulty:disabled{background:linear-gradient(140deg,#535954,#363c38);border-color:#82877b;color:#aeb4aa;filter:grayscale(.65);opacity:.7;box-shadow:inset 0 1px #ffffff1a;cursor:not-allowed}
#graphics-settings{margin:18px 0 10px;padding:10px 12px;border:1px solid #87968066;border-radius:8px;min-width:0}
#graphics-settings legend{font:600 15px Georgia;color:#e5c990;padding:0 7px}
#graphics-settings select{max-width:60%;min-width:0;font:12px system-ui}
#preferences-dialog #graphics-settings .color-mode-note{font:11px/1.4 system-ui;color:#bdcdbd;margin:4px 0 10px}
.color-mode-preview{display:flex;flex-wrap:wrap;gap:10px 20px;font:11px system-ui}.color-mode-preview>span{display:flex;align-items:center;gap:7px}
.color-mode-preview i{display:inline-block;width:10px;height:10px;border:1px solid #071311}.friendly-marker{border-radius:50%;background:var(--friendly-color)}.enemy-marker{background:var(--enemy-color);transform:rotate(45deg)}
body[data-color-mode]:not([data-color-mode=off]) .side-title,body[data-color-mode]:not([data-color-mode=off]) #home-hp{color:var(--friendly-color)}
body[data-color-mode]:not([data-color-mode=off]) .field-label.right .side-title,body[data-color-mode]:not([data-color-mode=off]) #enemy-hp{color:var(--enemy-color)}
#battle-reveal{position:fixed;inset:0;z-index:1000;overflow:hidden;pointer-events:all}
.reveal-door{position:absolute;inset:0;display:grid;place-items:center;background:radial-gradient(ellipse at center,#26372e,#091511 80%);will-change:transform}
.reveal-door img{width:min(72vw,66dvh,440px);height:auto;filter:url(#remove-black-matte)}
.reveal-door.left{clip-path:inset(0 50% 0 0);animation:reveal-left 1.1s cubic-bezier(.65,0,.2,1) both}
.reveal-door.right{clip-path:inset(0 0 0 50%);animation:reveal-right 1.1s cubic-bezier(.65,0,.2,1) both}
@keyframes reveal-left{0%,15%{transform:translateX(0)}100%{transform:translateX(-52%)}}
@keyframes reveal-right{0%,15%{transform:translateX(0)}100%{transform:translateX(52%)}}
@media(prefers-reduced-motion:reduce){#battle-reveal{display:none}#confirm-difficulty .battle-heading{transition:none}}
.reduced-motion #confirm-difficulty .battle-heading{transition:none}
/* The hidden developer letter looks and behaves like surrounding text. */
#secret-dev,#secret-dev:hover,#secret-dev:active,#secret-dev:focus{cursor:default;color:inherit;border:0!important;outline:none;box-shadow:none!important;background:transparent!important;filter:none!important;transform:none!important;text-decoration:none;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:transparent}
#menu-title:has(#secret-dev){user-select:none;-webkit-user-select:none}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .battle-drawer *{min-width:0}
 .battle-drawer h2,.battle-drawer h3,.battle-drawer b,.battle-drawer p,.battle-drawer small,.battle-drawer em,.battle-drawer button{overflow-wrap:anywhere}
 .battle-drawer .upgrade-card,.battle-drawer .ammo-card,#armor-choices button,#wall-choices button,#turret-choices button{min-width:0;max-width:100%}
 .purchase-row{flex-wrap:wrap!important;gap:4px 8px!important}
 .purchase-row>span{min-width:0;white-space:normal}
 #armor-choices b,#wall-choices b,#turret-choices b{font-size:12px;line-height:1.3}
 #armor-choices button>span,#wall-choices button>span,#turret-choices button>span{font-size:10px;line-height:1.4}
 #hero-strip .hero-info{min-width:0}#hero-strip .hero-info h3{font-size:16px}#champion-drawer summary span{white-space:normal}
 #troop-drawer .unit{grid-template-columns:58px minmax(0,1fr)}#troop-drawer .unit b{font-size:12px}
 #ammo-types .ammo-card-actions{grid-template-columns:minmax(0,1fr) 72px}
 .ammo-card-heading{flex-wrap:wrap}.ammo-card h3{font-size:16px}.ammo-stock{font-size:12px}
 #menu-actions #confirm-difficulty{min-height:66px}
}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .upgrade-card .upgrade-top{display:flex;flex-wrap:wrap;gap:3px}
 .upgrade-card .upgrade-top small,.upgrade-card .upgrade-meter,.upgrade-card em,.upgrade-card button{white-space:normal!important;overflow-wrap:anywhere;max-width:100%}
 .upgrade-card .upgrade-art{max-width:100%}
 #upgrade-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Battlefield start control and shared-art training queue. */
.field>#begin-night{position:absolute;left:8px;bottom:42px;z-index:3;min-height:44px;max-width:160px;margin:0;padding:8px 14px;font:700 12px system-ui;border:1px solid #bfac7866;border-radius:8px;background:linear-gradient(#3e6048,#243f31);color:#f1e8c9}
.field>#begin-night:disabled{opacity:1;filter:none;color:#c3cbb9}
.field>#begin-night.in-progress{background:linear-gradient(#6b3433,#46262a);color:#f5cbc3;animation:night-red 3.6s ease-in-out infinite}
#current-night{flex:1 1 0;min-width:0;max-width:180px;color:#dce3ce;font:600 12px system-ui;letter-spacing:.4px;text-align:center}
#queue-icons{display:flex;gap:5px;min-width:0;margin:4px 0}
.queued-troop{position:relative;display:block;flex:0 1 52px;width:52px;height:40px;overflow:hidden;border:1px solid #829b8055;border-radius:5px;background:#172d26}
.queued-troop canvas{width:100%;height:100%;object-fit:cover;transform:scale(1.5);transform-origin:50% 90%}
.queued-troop small{position:absolute;top:1px;left:2px;font:700 9px system-ui;color:#f6e6b6;text-shadow:0 1px 3px #000}
.queued-troop:first-child{border-color:#d9c887}
.queued-troop:first-child i{position:absolute;inset:auto auto 0 0;height:100%;width:var(--training,0%);background:#9ad8b72b;border-right:1px solid #b8dfaa99;pointer-events:none}
#troop-drawer .queue-copy{flex:1;min-width:0}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .field>#begin-night{bottom:8px;min-height:36px;padding:6px 12px;font-size:11px}
 #current-night{flex:0 1 100px;width:100px;margin-right:auto;font-size:10px}
 .queued-troop{height:32px;flex-basis:44px}
}
@media(max-width:380px) and (orientation:portrait){.field>#begin-night{font-size:10px;max-width:123px;padding:7px 8px}.camera button{padding:6px 7px}}
.reduced-motion .field>#begin-night.in-progress{animation:none}
@media(prefers-reduced-motion:reduce){.field>#begin-night.in-progress{animation:none}}
/* Reference-inspired emblem; the live landscape remains behind the title menu. */
#title-emblem,#title-copyright{display:none}
body[data-menu-scene=title] #title-emblem{display:block;flex-shrink:0;width:min(350px,86vw,43dvh);height:auto;aspect-ratio:1;object-fit:contain;mix-blend-mode:screen;margin:0 auto 10px}
body.title-logo-ready[data-menu-scene=title] #menu-title{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0!important}
body[data-menu-scene=title] #title-copyright{display:block;position:absolute;bottom:20px;left:50%;transform:translateX(-50%);margin:0;font:11px system-ui;color:#d6c8a5;text-shadow:0 2px 5px #000;white-space:nowrap}
body[data-menu-scene=title] #menu .menu-content{padding-top:24px;padding-bottom:76px}
body[data-menu-scene=title] #menu-tagline{margin:4px 0 12px}
body[data-menu-scene=title] #menu-actions{margin-top:18px}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 body[data-menu-scene=title] #menu .menu-content{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,1fr);grid-template-rows:auto auto auto;align-content:center;align-items:center;justify-items:center;column-gap:24px;row-gap:8px;padding:18px 65px 60px}
 body[data-menu-scene=title] #title-emblem{grid-column:1;grid-row:1/4;width:min(100%,70dvh);margin:0}
 body[data-menu-scene=title] #menu-tagline,body[data-menu-scene=title] #menu-description,body[data-menu-scene=title] #menu-actions{grid-column:2;margin:0;width:100%;max-width:330px;text-align:center}
 body[data-menu-scene=title] #menu-tagline{grid-row:1;letter-spacing:1px;align-self:end}
 body[data-menu-scene=title] #menu-description{grid-row:2;line-height:1.5}
 body[data-menu-scene=title] #menu-actions{grid-row:3;align-self:start}
}
/* Softly blend the full crest, with a darker backdrop to preserve its contrast. */
body[data-menu-scene=title] #title-emblem{mix-blend-mode:screen;filter:contrast(1.06) saturate(1.18);clip-path:none;mask-image:none;-webkit-mask-image:none}
body[data-menu-scene=title] #menu .menu-content{padding-top:0;padding-bottom:126px;background:linear-gradient(180deg,#020708cc 0%,#06100c99 48%,#10221d22 78%)}
body[data-menu-scene=title] #menu-tagline{font:600 clamp(17px,4.6vw,22px)/1.3 Georgia,serif;letter-spacing:.7px;text-transform:none;color:#f0d6a1;margin:4px 0 14px;text-shadow:0 2px 8px #000}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 body[data-menu-scene=title] #menu .menu-content{padding-top:0;padding-bottom:92px}
 body[data-menu-scene=title] #menu-tagline{font-size:18px;line-height:1.25;margin:0}
}
@media(orientation:portrait) and (max-height:700px){
 body[data-menu-scene=title] #menu .menu-content{padding-top:4px;padding-bottom:82px}
 body[data-menu-scene=title] #title-emblem{width:min(78vw,34dvh)}
 body[data-menu-scene=title] #menu-tagline{font-size:17px}
}
#current-night{display:flex;flex-direction:column;justify-content:center;gap:3px;line-height:1.15;overflow:hidden}
#current-night .current-era{font-size:11px;font-weight:700;color:#e8cd99;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
#current-night .current-night-number{font-size:11px;color:#c5d1bc}
header #era-name{display:none}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){#current-night{gap:2px}#current-night .current-era{font-size:10px}#current-night .current-night-number{font-size:9px}}

#defeat-skull{display:block;width:110px;height:110px;object-fit:contain;mix-blend-mode:screen;margin:0 auto 12px;flex-shrink:0}#defeat-skull[hidden]{display:none}@media(orientation:landscape) and (max-height:600px){#defeat-skull{width:64px;height:64px;margin:0 auto 5px}body[data-result=lost] #menu-title{margin:4px 0}body[data-result=lost] #result-stats{margin-top:8px;padding:6px 0}body[data-result=lost] #menu-actions{margin:10px 0}}
/* Explicit alpha replaces backdrop-dependent screen blending on mobile browsers. */
body[data-menu-scene=title] #title-emblem,#defeat-skull{mix-blend-mode:normal;filter:url(#remove-black-matte)}
body[data-menu-scene=title] #menu .menu-content{background:transparent}
#victory-emblem{display:block;width:130px;height:130px;object-fit:contain;filter:url(#remove-black-matte);margin:0 auto 10px;flex-shrink:0}
#victory-emblem[hidden]{display:none}
body[data-result=won] #menu-actions>button{font-size:20px;min-height:48px}
body[data-result=won] #menu-actions>button:last-child{background:linear-gradient(#793a39,#50282d);border-color:#ac625c;color:#ffe2d5}
#live-tutorial{position:fixed;top:62px;left:8px;right:8px;z-index:80;box-sizing:border-box;padding:9px 12px;background:#14251ff5;border:1px solid #ddbf79;border-radius:8px;box-shadow:0 5px 20px #0007;color:#f1dfb4}
#live-tutorial[hidden]{display:none}#live-tutorial>div{display:flex;justify-content:space-between;align-items:center;gap:8px}#live-tutorial small{font:600 9px system-ui;letter-spacing:.5px}#live-tutorial strong{font:700 15px Georgia}#live-tutorial p{font:12px/1.35 system-ui;margin:5px 0 0;color:#dde3d5}#live-tutorial button{padding:4px 9px;font:11px system-ui}#lesson-next{margin-top:8px}
.tutorial-active .battle-drawer{top:210px!important}.tutorial-active #troop-drawer{max-height:calc(100dvh - 285px)}
.tutorial-target:not(canvas){outline:3px solid #ffe39c!important;outline-offset:2px!important;box-shadow:0 0 18px #eccc7b77!important}
@media(orientation:landscape) and (max-height:600px){#live-tutorial{top:44px;padding:6px 10px}#live-tutorial strong{font-size:13px}#live-tutorial p{font-size:11px;margin-top:2px}.tutorial-active .battle-drawer{top:143px!important}.tutorial-active #troop-drawer{max-height:calc(100dvh - 195px)}}
#tutorial-open{display:none;position:absolute;top:16px;right:24px;padding:8px 13px;border:1px solid #bda56e88;border-radius:7px;background:linear-gradient(#35463c,#233229);color:#eeddb5;font:600 12px system-ui;z-index:4}
body[data-menu-scene=difficulty] #tutorial-open{display:block}
#menu-actions .difficulty-card{position:relative;overflow:hidden;border-radius:8px;box-shadow:inset 0 1px #ffffff30,inset 0 -8px 18px #0002,0 5px 14px #0004;transition:box-shadow .2s,border-color .2s,transform .2s}
#menu-actions .difficulty-card::before{content:'';position:absolute;inset:5px;border:1px solid #dfd2b222;border-radius:4px;pointer-events:none;background:linear-gradient(115deg,#fff1,transparent 40%,#0001)}
#menu-actions .difficulty-card b{letter-spacing:.3px;text-shadow:0 2px 3px #0006}
#menu-actions .difficulty-card span{line-height:1.45;color:inherit;opacity:.8}
#menu-actions .difficulty-card b,#menu-actions .difficulty-card span{position:relative;z-index:1}
#menu-actions .difficulty-card[data-level=normal]{background:radial-gradient(ellipse at 20% 0%,#5c866047,transparent 70%),linear-gradient(145deg,#304f40,#172e27);border-color:#819d82}
#menu-actions .difficulty-card[data-level=easy]{background:radial-gradient(ellipse at 20% 0%,#85c3cf33,transparent 70%),linear-gradient(145deg,#315965,#1b343d);border-color:#82b6bd;color:#dcf2ec}
#menu-actions button.difficulty-card[data-level=easy]{border-left-color:#82b6bd}
#menu-actions button.difficulty-card[data-level=easy]{background:radial-gradient(ellipse at 20% 0%,#b8e2ff33,transparent 70%),linear-gradient(145deg,#487dad,#29496c);border-color:#a0d2f1;color:#edf7ff}
#menu-actions button.difficulty-card[data-level=normal]{border-left-color:#819d82}
#menu-actions button.difficulty-card[data-level=hard]{border-left-color:#b99963}
#menu-actions button.difficulty-card[data-level=impossible]{border-left-color:#8d655a}
#menu-actions .difficulty-card[data-level=hard]{background:radial-gradient(ellipse at 20% 0%,#cdab6533,transparent 70%),linear-gradient(145deg,#654c30,#30291f);border-color:#b99963}
#menu-actions .difficulty-card[data-level=hard]::before{border-color:#d4b58133;background:linear-gradient(118deg,#fff1,transparent 38%,#0002);box-shadow:inset 0 0 14px #1c160e55}
#menu-actions .difficulty-card[data-level=hard]::after{content:'';position:absolute;inset:0;pointer-events:none;opacity:.5;background:linear-gradient(162deg,transparent 12%,#d5b78155 12.5%,transparent 13.1%),linear-gradient(157deg,transparent 15%,#17130f88 15.5%,transparent 16.4%),linear-gradient(145deg,transparent 82%,#c19e6744 82.5%,transparent 83%),linear-gradient(174deg,transparent 93%,#1a171388 94%,transparent 95%);border:1px solid #301f1044;border-radius:7px;box-shadow:inset 2px 0 #dec18d22,inset -3px -2px #1e190c66}
#menu-actions .difficulty-card[data-level=impossible]{background:radial-gradient(ellipse at 100% 0%,#731b2588,transparent 60%),linear-gradient(145deg,#382a29,#171b1b);border-color:#8d655a;color:#efc9bc;box-shadow:inset 0 0 25px #080909aa,inset 0 1px #da918733,0 5px 14px #0005}
#menu-actions .difficulty-card[data-level=impossible]::before{border-color:#b08f6644;border-style:dashed;opacity:.65}
#menu-actions .difficulty-card[data-level=impossible]::after{content:'';position:absolute;inset:0;background:url('data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20384%20192%22%20preserveAspectRatio%3D%22none%22%3E%0A%20%3Cdefs%3E%3Cfilter%20id%3D%22grain%22%3E%3CfeTurbulence%20type%3D%22fractalNoise%22%20baseFrequency%3D%22.65%22%20numOctaves%3D%223%22%20seed%3D%2217%22%2F%3E%3CfeColorMatrix%20type%3D%22saturate%22%20values%3D%220%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%0A%20%3Crect%20width%3D%22384%22%20height%3D%22192%22%20filter%3D%22url(%23grain)%22%20opacity%3D%22.1%22%2F%3E%0A%20%3Cg%20fill%3D%22%2364151e%22%20opacity%3D%22.8%22%3E%3Cpath%20d%3D%22M310%200h74v20l-16-5-8%2012-13-11-10%209-3-13-11%205-4-9-12%206z%22%2F%3E%3Cpath%20d%3D%22M337%208l-2%2051%203%2010%203-12%202-43zM366%2013l-3%2073%203%2011%202-18%202-65zM352%2020l-2%2023%204%204%201-28z%22%2F%3E%3Cpath%20d%3D%22M0%20159l15%206%209-5%208%2011%2014%203-3%2010%2018%208H0z%22%2F%3E%3Cpath%20d%3D%22M16%20142l4%202%201%207-5%202-3-5zM43%20164l5-2%204%205-2%205-6-1zM320%2040l3%202-1%207-4-2z%22%2F%3E%3C%2Fg%3E%0A%20%3Cg%20fill%3D%22none%22%20stroke-linecap%3D%22round%22%3E%3Cpath%20d%3D%22M18%2024l32-10m-24%2015l14-6M285%20137l58-42m-52%2048l24-18M212%20179l45-12M115%2012l28-8M8%2095l17-8%22%20stroke%3D%22%23c6ab83%22%20opacity%3D%22.28%22%2F%3E%0A%20%3Cpath%20d%3D%22M279%20139l69-45m-65%2051l24-18M19%2026l32-10M210%20182l51-13%22%20stroke%3D%22%23090d0d%22%20stroke-width%3D%222%22%20opacity%3D%22.65%22%2F%3E%0A%20%3Cpath%20d%3D%22M68%200l-4%2013%207%207-8%2011m6-13l12%203M384%20119l-16-5-9%208-13-2m17-2l-4-13M153%20192l8-13-5-9%22%20stroke%3D%22%23080b0b%22%20stroke-width%3D%222%22%20opacity%3D%22.8%22%2F%3E%0A%20%3Cpath%20d%3D%22M0%2039l3%202v25l-3%204M384%20150l-4%206%202%2020M92%200l15%203%2012-3M199%20192l17-3%2012%203%22%20stroke%3D%22%23d0ae87%22%20opacity%3D%22.35%22%20stroke-width%3D%222%22%2F%3E%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A') center/100% 100% no-repeat;pointer-events:none;opacity:.9}
#menu-actions .difficulty-card[aria-pressed=true]{outline:1px solid #f8d898;outline-offset:3px;border-color:#edcf93;box-shadow:inset 0 1px #fff4,0 0 0 1px #ebcd9455,0 0 17px #e9c98733}
#menu-actions .difficulty-card:focus:not(:focus-visible){outline:none}
#menu-actions .difficulty-card[aria-pressed=true]:focus:not(:focus-visible){outline:1px solid #f8d898}
#menu-actions .difficulty-card:focus-visible{outline:2px dashed #fff0c1;outline-offset:4px}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #fortress-preview:not([hidden]){float:none;width:auto;margin:6px 0;box-sizing:border-box;justify-content:flex-start}
 #fortress-preview>div{flex:0 1 240px}
 #fortress-preview canvas{width:80px;height:54px}
 #armory[data-group=fortress] #upgrade-grid{clear:both;width:100%;grid-template-columns:repeat(3,minmax(0,1fr))}
 #armory[data-group=fortress] .upgrade-card{grid-template-columns:minmax(0,1fr)!important}
 #armory[data-group=fortress] .upgrade-card>*{grid-column:1!important;grid-row:auto!important;overflow-wrap:normal;word-break:normal}
 #armory[data-group=fortress] .upgrade-card .upgrade-art{width:100%;height:68px;object-fit:contain;justify-self:center}
 #armory[data-group=fortress] .upgrade-card h3{font-size:14px;line-height:1.3}
 #armory[data-group=fortress] .upgrade-card .upgrade-top{min-height:16px}
 #turret-choices button,#wall-choices button{grid-template-columns:minmax(0,1fr);align-content:start}
 #turret-choices button>*,#wall-choices button>*{grid-column:1!important;grid-row:auto!important;overflow-wrap:normal;word-break:normal}
 #turret-choices canvas,#wall-choices canvas{justify-self:center;width:100%;height:70px;object-fit:contain}
 #turret-choices button>b,#wall-choices button>b{min-height:32px}
 #turret-choices .purchase-row,#wall-choices .purchase-row{display:grid;grid-template-columns:1fr;text-align:left;gap:3px!important}
 #turret-choices .purchase-status,#wall-choices .purchase-status{text-align:left}
}
body[data-menu-scene=difficulty] #menu-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:600px) and (orientation:portrait){body[data-menu-scene=difficulty] #menu-actions{grid-template-columns:1fr}}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){body[data-menu-scene=difficulty] #menu-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}body[data-menu-scene=difficulty] #menu-actions .difficulty-card{min-height:66px;padding:9px 13px;gap:3px}body[data-menu-scene=difficulty] #menu-actions .difficulty-card b{font-size:20px}}
@media(orientation:portrait) and (max-height:700px){body[data-menu-scene=difficulty] #menu-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}body[data-menu-scene=difficulty] #menu-actions .difficulty-card{min-height:95px;padding:10px}body[data-menu-scene=difficulty] #menu-actions .difficulty-card b{font-size:20px}}
#tutorial{width:min(900px,calc(100vw - 24px));max-width:none;max-height:calc(100dvh - 24px);padding:18px;box-sizing:border-box;background:linear-gradient(145deg,#26392f,#14251f);border:1px solid #b79c6488;color:#e6ddc4;border-radius:12px;overflow:auto}
#tutorial::backdrop{background:#030a08e8}
.tutorial-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}.tutorial-heading>span{font:600 10px system-ui;letter-spacing:1px;color:#bda976}
.tutorial-stage{position:relative}.tutorial-stage canvas{display:block;width:100%;height:220px;border-radius:8px;background:#203a32}
#tutorial-resources{position:absolute;top:4px;left:8px;right:8px;margin:0;font:11px system-ui;color:#fff2cb;text-shadow:0 1px 4px #000}
.tutorial-copy h2{font-size:27px;margin:8px 0}.tutorial-copy p{font:13px/1.5 system-ui;color:#d0d8c8;margin:10px 0}.tutorial-copy>small{display:block;margin-top:12px;color:#d6b974;font:11px system-ui}
#tutorial-status{min-height:36px;color:#e5c58e;font-size:12px}
#tutorial-action{width:100%;padding:12px;background:linear-gradient(#dec48a,#ab864e);color:#252b22;font-weight:700;font-size:14px}
.tutorial-copy nav{display:flex;justify-content:space-between;gap:10px;margin-top:12px}.tutorial-copy nav button,.tutorial-heading button{padding:8px 12px;font-size:12px}
@media(orientation:landscape) and (max-height:600px){#tutorial{width:calc(100vw - 16px);max-height:calc(100dvh - 16px);padding:12px;grid-template-columns:1fr 1fr;gap:12px}#tutorial[open]{display:grid}.tutorial-heading{grid-column:1/-1;margin:0}.tutorial-stage canvas{height:240px}.tutorial-copy h2{font-size:21px;margin:5px 0}.tutorial-copy p{font-size:11px;margin:6px 0}.tutorial-copy>small{margin:0}.tutorial-copy nav{margin-top:7px}#tutorial-action{padding:9px}#tutorial-status{min-height:28px}#tutorial-open{top:10px;right:18px;padding:6px 10px}}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #victory-emblem{width:70px;height:70px;margin:0 auto 5px}
 body[data-result=won] #menu-title{margin:4px 0}
 body[data-result=won] #result-stats{margin-top:8px;padding:6px 0}
 body[data-result=won] #menu-actions{margin:10px 0}
}
/* September mobile control polish: shared materials, independent sound switches. */
#confirm-difficulty.ready .battle-heading{transform:none}
.reveal-door.left,.reveal-door.right{animation-duration:1.65s}
#battle-reveal[data-difficulty=impossible] .reveal-door{animation-duration:2.05s;background:repeating-linear-gradient(133deg,transparent 0 71px,#b2a28d17 72px,transparent 74px),radial-gradient(ellipse at 30% 30%,#751b2599,transparent 40%),radial-gradient(ellipse at center,#302322,#07090a 80%)}
#battle-reveal[data-difficulty=impossible] .reveal-door:after{content:'';position:absolute;inset:0;background:repeating-linear-gradient(17deg,transparent 0 110px,#0008 112px,transparent 116px);box-shadow:inset 0 0 100px #000;pointer-events:none}
#battle-reveal[data-difficulty=impossible] img{filter:url(#remove-black-matte) sepia(.25) contrast(1.18)}
#battle-reveal.era-reveal{pointer-events:none}
#battle-reveal.era-reveal>strong{position:absolute;top:74%;left:8%;right:8%;text-align:center;font:700 clamp(20px,4vw,36px) Georgia;color:#f8e2ab;text-shadow:0 2px 9px #000}
#menu:has(#pause-tools:not([hidden])) #quick-language{display:none}
body[data-menu-scene=title] #quick-language{display:grid;place-items:center;top:auto;left:18px;bottom:18px;width:44px;height:44px;z-index:5}
#pause-tools{left:18px!important}
#pause-tools #pause-back{display:flex;align-items:center;justify-content:center;gap:8px}
#pause-back .game-icon{width:16px;height:16px}
#pause-tools button,#quick-language,header #game-speed,header #pause,#evolve,.camera button,#begin-night,#battle-dock>button,.zoom-control{border-radius:7px;box-shadow:inset 0 1px #f9edc53d,inset 0 -5px 12px #0003,0 2px 5px #0004}
#pause-tools #mute,#quick-language{background-color:#293e35;color:#ebd7a2}
#pause-tools button:hover,.camera button:hover,#battle-dock>button:hover{filter:brightness(1.12)}
#pause-tools button:active,.camera button:active,#battle-dock>button:active{box-shadow:inset 0 2px 7px #0005}
.audio-setting{display:grid!important;grid-template-columns:1fr 62px;gap:9px!important;align-items:center}
.audio-setting input[type=range]{grid-column:1/-1;width:100%!important;max-width:none!important}
.audio-toggle{min-height:34px;padding:5px 12px;font:600 13px system-ui;border-radius:18px;background:#37433c;border-color:#8c978a;color:#c8cec4}
.audio-toggle[aria-checked=true]{background:linear-gradient(#40664e,#284532);border-color:#a8c79c;color:#edffe3;box-shadow:inset 0 1px #fff3}
.audio-setting input:disabled{opacity:.35}
.queued-troop canvas{object-fit:contain;transform:none}
.troop-card .unit{position:relative;isolation:isolate;overflow:hidden;border-radius:7px;background:linear-gradient(135deg,#30453a,#192e26);border-color:#9cac8655}
.troop-card .unit>.recruit-fill{position:absolute;inset:0 auto 0 0;height:100%;z-index:-1;background:linear-gradient(90deg,#97c9a91a,#b8d99e42);border-right:1px solid #e0ebbd99;pointer-events:none;transition:width .15s linear}
.troop-card .train-unit{border:1px solid #a4bd8c88;border-radius:6px;background:linear-gradient(145deg,#47634a,#283f30);box-shadow:inset 0 1px #fff3,inset 0 -4px 10px #0002;font-family:system-ui;letter-spacing:.2px}
.troop-card .train-unit:disabled{filter:saturate(.4);opacity:.55}
.troop-card .train-unit>span:first-child{font-weight:700}.troop-card .train-unit>span:last-child{font-variant-numeric:tabular-nums;color:#e8d9a8}
#evolve>.game-icon{position:absolute;left:7px;top:50%;width:15px;height:18px;transform:translateY(-50%)}
#evolve.evolve-ready{padding-inline:25px;animation:signal-ready 2.4s ease-in-out infinite}
@keyframes active-night-glow{0%,100%{box-shadow:inset 0 1px #ffffff22,0 0 3px #a5292933;filter:brightness(1)}50%{box-shadow:inset 0 1px #ffffff44,0 0 12px #c9484855;filter:brightness(1.13)}}
.field>#begin-night.in-progress{animation:active-night-glow 3s ease-in-out infinite}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 #menu:has(#pause-tools:not([hidden])) #pause-tools{margin-left:0;left:auto!important}
 .field-top{right:50%;transform:translateX(50%);top:3px;font-size:9px}
 body[data-menu-scene=title] #quick-language{bottom:14px;left:14px}
}
.reduced-motion .field>#begin-night.in-progress,.reduced-motion #evolve.evolve-ready{animation:none}
@media(prefers-reduced-motion:reduce){.field>#begin-night.in-progress,#evolve.evolve-ready{animation:none}}
.troop-card{position:relative;isolation:isolate}
.troop-card>.recruit-fill{position:absolute;inset:0 auto 0 0;height:100%;z-index:2;background:linear-gradient(90deg,#97c9a910,#b8d99e29);border-right:1px solid #e0ebbd99;pointer-events:none;transition:width .15s linear}
.troop-card:not(:has(.unit.training))>.recruit-fill{display:none}
#battle-reveal[data-difficulty=impossible] .reveal-door.left{clip-path:polygon(0 0,50% 0,49.8% 20%,50.3% 30%,49.6% 45%,50.2% 70%,50% 100%,0 100%)}
#battle-reveal[data-difficulty=impossible] .reveal-door.right{clip-path:polygon(50% 0,100% 0,100% 100%,50% 100%,50.2% 70%,49.6% 45%,50.3% 30%,49.8% 20%)}
/* Preserve each command's color beneath the polished metal edges. */
#battle-dock #open-troops{background:linear-gradient(145deg,#397d69,#245447);border-color:#80c5aa;color:#e2fff0}
#battle-dock #open-armory{background:linear-gradient(145deg,#896432,#553c22);border-color:#d2ab66;color:#fff0c9}
#battle-dock #open-fortress{background:linear-gradient(145deg,#426b90,#2a4563);border-color:#88b7db;color:#e1f2ff}
#battle-dock>button[aria-expanded=true]{box-shadow:inset 0 1px #fff7,inset 0 0 16px #ffffff18,0 0 8px #dec38544;border-color:#f0d99f}
header #game-speed{background:linear-gradient(145deg,#46776b,#284b43);border-color:#84b6a2;color:#e4ffe9}
header #pause{background:linear-gradient(145deg,#506480,#303e57);border-color:#9aaecb;color:#ecf4ff}
header #evolve{background:linear-gradient(145deg,#6c547c,#42364f);border-color:#aa92bd;color:#f3e6ff}
header #evolve.evolve-ready{background:linear-gradient(145deg,#aa833e,#6a4a24);border-color:#f0d58c;color:#fff4cc}
header #evolve:disabled{opacity:.8}
.troop-card .train-unit:not(:disabled){background:linear-gradient(145deg,#527f48,#315833);border-color:#acd190;color:#f0ffe3}
/* Keep the landscape clock above scenery and clear of the developer badge. */
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){
 .field>.field-top{display:flex;align-items:center;justify-content:center;left:50%;right:auto;top:7px;transform:translateX(-50%);width:max-content;z-index:3;padding:3px 8px;border-radius:5px;background:#14241f99;text-align:center}
 .field-top #battle-clock{display:block;font:12px/16px system-ui;font-variant-numeric:tabular-nums;color:#fff0cc}
 header #game-speed{justify-content:center;align-items:center;padding:3px;line-height:1}
 header #game-speed>span{display:block;line-height:1;text-align:center}
 #speed-menu button{display:flex;align-items:center;justify-content:center;text-align:center}
 #test-session{top:76px}
}
#turret-sale{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:8px 0 12px;padding:8px 10px;border:1px solid #a7906966;border-radius:6px;background:#14241f77}
#turret-sale[hidden]{display:none}#turret-sale>span{font:11px/1.4 system-ui;color:#ddc99e;min-width:0}
#sell-turret{flex-shrink:0;min-height:36px;padding:7px 10px;font:600 12px system-ui;background:linear-gradient(#7c4340,#4c2a2c);border-color:#c48b73;color:#ffe4c4;border-radius:5px}
#sell-turret:disabled{opacity:.55}
/* Three clear title actions; the Settings gear stays in its bottom-right corner. */
body[data-menu-scene=title] #menu-actions{display:grid;grid-template-columns:1fr;gap:9px;width:min(300px,100%);margin-top:12px}
body[data-menu-scene=title] #menu-actions>button{min-height:48px;padding:10px 16px;border-radius:7px;box-shadow:inset 0 1px #fff3,inset 0 -6px 15px #0003,0 3px 10px #0004;font-size:21px}
body[data-menu-scene=title] #load-game{background:linear-gradient(145deg,#416a70,#29474c);border-color:#91b9b8;color:#e7f7e9;animation:none}
body[data-menu-scene=title] #multiplayer{display:flex;align-items:center;justify-content:center;gap:10px;background:linear-gradient(145deg,#555267,#323441);border-color:#9290a677;color:#c7c5d5;animation:none;opacity:.8}
#multiplayer small{font:11px system-ui;letter-spacing:.4px;color:#b4b1c1}
#save-dialog{width:min(700px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:20px;background:linear-gradient(145deg,#24392f,#16271f);color:#e7ddbb;border:1px solid #a38d61;border-radius:10px}
#save-dialog::backdrop{background:#08110dbb;backdrop-filter:blur(4px)}
#save-dialog .drawer-heading{margin-bottom:10px}#save-dialog .drawer-heading h2{font-size:25px}#save-dialog #close-saves{font:600 12px system-ui;padding:8px 14px;background:linear-gradient(#713b3a,#47272d);border-color:#a66b5c}
.save-help{font:12px/1.5 system-ui;color:#b9c7b6;margin:8px 0 16px}#save-slots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.save-slot{min-width:0;padding:13px;border:1px solid #a59b7055;border-radius:7px;background:linear-gradient(145deg,#36504366,#152c24aa);box-shadow:inset 0 1px #fff1}
.save-slot h3{font:600 19px Georgia;margin:0 0 7px;color:#ead5a2}.save-slot p{font:12px/1.4 system-ui;margin:4px 0;overflow-wrap:anywhere}.save-slot small{display:block;font:10px/1.4 system-ui;color:#aebba8;min-height:28px}
.save-slot-actions{display:flex;gap:7px;margin-top:9px}.save-slot-actions button{flex:1;min-width:0;min-height:38px;padding:7px;font:600 12px system-ui;background:linear-gradient(#486f56,#2a4738);border-color:#9db48b;color:#f0e8c8;border-radius:5px}.save-slot-actions button:disabled{opacity:.4}
.save-file-actions{display:flex;gap:10px;margin-top:15px}.save-file-actions button{flex:1;font:12px system-ui;min-height:40px;background:linear-gradient(#46646c,#2a424c);border-color:#89a5ac;border-radius:5px}.save-file-actions [hidden]{display:none}
#save-status{font:12px/1.4 system-ui;color:#f1d18e;min-height:18px}
@media(orientation:portrait) and (max-width:600px){body[data-menu-scene=title] #menu .menu-content{padding-bottom:74px}body[data-menu-scene=title] #title-emblem{max-height:35dvh;object-fit:contain}#save-dialog{padding:15px}#save-slots{gap:8px}.save-slot{padding:10px}}
@media(orientation:landscape) and (max-height:600px) and (max-width:1100px){body[data-menu-scene=title] #menu-actions{gap:6px}body[data-menu-scene=title] #menu-actions>button{min-height:39px;padding:7px 12px;font-size:18px}#multiplayer small{font-size:10px}#save-dialog{padding:12px 16px}.save-help{margin:4px 0 10px}.save-slot{padding:9px}#save-dialog .drawer-heading h2{font-size:22px}}

body[data-menu-scene=title] #multiplayer{text-align:center;justify-content:center;opacity:1;color:#e5dff5;background:linear-gradient(145deg,#5c5276,#343247)}
