html,body{overflow:hidden;overscroll-behavior:none}
button{transition:background-color .12s,border-color .12s,transform .12s}
button:active{transform:translateY(1px)}button:hover{border-color:#a5bbb8}
.command-screen{--scene:url("素材/terrain/view0.webp");position:fixed;inset:0;margin:auto;width:min(890px,94vw);height:min(510px,88dvh);max-width:none;max-height:none;overflow:hidden;box-sizing:border-box;border:1px solid #6e8486;border-radius:10px;color:#f6f2e7;padding:clamp(16px,3.2vw,44px);background:linear-gradient(90deg,#0c1d27fa 0%,#12232bea 40%,#16252d70 68%,#16252d12 100%),var(--scene) center/cover;box-shadow:0 16px 80px #061014af}
.command-screen[open]{display:flex;flex-direction:column;align-items:flex-start;justify-content:center}
.command-screen::backdrop{background:#09151dae;backdrop-filter:blur(3px)}
.command-screen h2{font-size:clamp(24px,3.8vw,48px);line-height:1.1;letter-spacing:.06em;color:#ffedcf}
.command-screen h2:focus{outline:none}.command-screen #detail{margin:9px 0 16px;color:#c0cfd1}
.command-screen #actions{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;width:min(440px,100%);gap:8px}
.nav-choice{display:flex;align-items:center;justify-content:space-between;gap:8px;border-radius:3px;text-align:left;background:#132a33dc;border-left:3px solid #537173;min-height:46px}
.nav-choice strong{font-size:18px}.nav-choice small{letter-spacing:0;color:#c0cfcf}.command-screen .active{border-color:#c58d4c;background:#473b2c;color:#ffe7be}
.nav-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.nav-row button{min-height:36px}
.command-screen .world-spec,.command-screen .mission-meta{padding:10px 12px;background:#10252bd9;border-left:2px solid #75aca9;margin:0}
.world-spec p{margin:0 0 5px}.world-spec small{letter-spacing:0}
.level-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.archive-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px}.record{display:flex;align-items:center;gap:6px;background:#12252ce6;padding:4px;border:1px solid #485b60}.record img{width:50px;height:46px;object-fit:contain}.record strong{font-size:13px}.record small{font-size:10px;letter-spacing:0}
.command-screen #actions:empty::after{content:"";width:70%;height:3px;background:linear-gradient(90deg,#4a6268,#ffc27b,#4a6268);background-size:200%;animation:uplink 1s infinite linear}@keyframes uplink{to{background-position:-200%}}
@media(orientation:portrait){.command-screen{width:96vw;height:min(575px,92dvh);background:linear-gradient(0deg,#10232afc 15%,#14232ddd 68%,#12232b35),var(--scene) center/cover}.command-screen[open]{justify-content:flex-end}.card{min-height:42px}.card strong{font-size:13px}}
@media(max-height:500px){.command-screen{height:96dvh;padding:12px 22px}.command-screen h2{font-size:23px}.command-screen #detail{margin:4px 0 7px;font-size:12px}.command-screen #actions{gap:5px}.nav-choice,.nav-row button,.level-grid button{min-height:30px;padding:4px 10px}.record img{height:35px;width:38px}.nav-choice strong{font-size:15px}}
@media(prefers-reduced-motion:reduce){*,*::after{animation:none!important;transition:none!important}}


footer{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 18px;align-items:center}
.deploy-controls{display:grid;gap:6px}
.deploy-actions,.card-pages{display:flex;align-items:center;justify-content:space-between;gap:8px}
.deploy-controls button{min-width:44px;min-height:44px;padding:4px 10px}
#start{min-width:108px;min-height:48px;font-size:17px}
.card-pages{font-size:14px}
.card-pages button{font-size:21px;line-height:1}
#salvage[aria-pressed=true]{border-color:#ffbc70;background:#634329}
@media(orientation:landscape) and (max-height:520px){
 footer{gap:2px 9px}.deploy-controls{gap:4px}#cards{gap:4px}.card{min-height:46px}
}
@media(orientation:portrait){
 footer{display:flex;gap:8px}.deploy-controls{order:-1;display:flex;flex-direction:row-reverse;align-items:center;justify-content:space-between}
 .deploy-actions,.card-pages{gap:5px}.card-pages{align-self:center}
 #start{min-width:94px}.deploy-controls button{padding:4px 7px}
}

#timeline{height:5px;position:relative;background:linear-gradient(to right,#6fdfcb var(--done),#425056 var(--done));border-radius:2px}#timeline i{position:absolute;top:-2px;width:3px;height:8px;background:#ffba68}
.intel,.kit-grid button{display:flex;align-items:center;gap:4px}.intel{background:#13272de8;padding:4px;justify-content:space-between}.intel strong,.intel small,.kit-summary{font-size:12px}.intel span{text-align:center}.intel img{width:34px;height:25px;object-fit:contain}.intel small{display:block}.kit-summary{margin:0;min-height:2em}.kit-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.kit-grid button{padding:5px;flex-wrap:wrap;font-size:12px}.kit-grid img{width:32px;height:29px;object-fit:contain}.kit-grid small{color:#83dedb}.command-screen button:disabled{opacity:.48}.command-screen .nav-row button{min-width:40px}#fieldbar button{pointer-events:auto}.meter.energy{display:grid;grid-template-columns:auto auto;align-items:center;column-gap:4px}.energy img{grid-row:span 2;width:clamp(16px,2vw,26px)}.crystal-flight{position:fixed;left:0;top:0;width:clamp(15px,2vw,27px);pointer-events:none;z-index:5;filter:drop-shadow(0 1px 3px #00859b);will-change:transform}

/* Deployment and preparation use fixed icon, label and price slots. */
.brief-screen.command-screen[open]{width:min(1040px,97vw);height:min(650px,95dvh);padding:clamp(12px,2.2vw,28px);justify-content:flex-start;background:linear-gradient(100deg,#10222af8,#10222aeb 60%,#10222abc),var(--scene) center/cover}
.brief-screen.command-screen h2{font-size:clamp(22px,3vw,34px)}
.brief-screen.command-screen #actions{width:100%;flex:1;min-height:0;gap:8px}
.brief-screen.command-screen #detail{margin:4px 0 10px}
.enemy-roster{display:flex;align-items:center;gap:3px 9px;flex-wrap:wrap;padding:5px 8px;background:#14282eda}
.enemy-roster strong,.roster-status{font-size:13px}.enemy-roster span{display:flex;align-items:center;gap:3px}.enemy-roster img{width:26px;height:23px;object-fit:contain}.enemy-roster small{font-size:11px;letter-spacing:0}
.command-screen .roster-status{margin:0;line-height:20px;color:#cce5dc}
.roster-grid{display:grid;grid-template-columns:repeat(var(--cols,6),minmax(0,1fr));grid-auto-rows:minmax(44px,56px);align-content:start;flex:1;min-height:0;gap:4px;overflow:auto}
.roster-grid button{position:relative;min-width:0;display:grid;grid-template-columns:30px minmax(0,1fr);grid-template-rows:1fr 1fr;column-gap:4px;padding:3px 5px;background:#20343be8;text-align:left}
.roster-grid img{grid-row:span 2;width:30px;height:32px;align-self:center;object-fit:contain}.roster-grid span,.roster-grid small{line-height:1.15;letter-spacing:0}.roster-grid span{align-self:end;font-size:12px;white-space:nowrap}.roster-grid small{font-size:11px;color:#8feada}
.roster-grid button[aria-pressed=true] small:after{content:' ✓';color:#ffd18a}
.roster-grid.compact{grid-auto-rows:44px}
.roster-grid.compact button{grid-template-columns:1fr auto;grid-template-rows:21px 16px;gap:0;padding:2px}
.roster-grid.compact img{grid-row:1;width:22px;height:20px}.roster-grid.compact small{grid-column:2;grid-row:1;align-self:center;font-size:10px}.roster-grid.compact span{grid-row:2;grid-column:span 2;align-self:center;text-align:center;font-size:10px}.roster-grid.compact button[aria-pressed=true] small:after{content:''}
#cards{grid-template-columns:repeat(6,minmax(0,1fr))}
.deploy-controls{align-self:center}
@media(orientation:portrait){footer{display:grid;grid-template-columns:minmax(0,1fr)}#cards{width:100%;grid-template-columns:repeat(3,minmax(0,1fr))}.deploy-controls{justify-content:flex-end}.enemy-roster{gap:2px 5px}.enemy-roster img{width:18px;height:17px}}
@media(orientation:landscape) and (max-width:1000px){.card{grid-template-columns:26px minmax(0,1fr);padding:3px;gap:2px}.card img{width:26px}.card strong{font-size:11px}.deploy-actions{flex-direction:column;gap:3px}.deploy-actions button,#start{min-width:72px;min-height:32px;font-size:13px}}
@media(max-height:500px){.brief-screen.command-screen[open]{padding:7px 14px;height:98dvh}.brief-screen.command-screen #actions{gap:4px}.brief-screen.command-screen h2{font-size:21px}.brief-screen.command-screen #detail{margin:0 0 3px}.enemy-roster{gap:1px 6px;padding:2px 4px}.enemy-roster img{width:16px;height:15px}.enemy-roster small{font-size:10px}}

@media(max-width:350px) and (orientation:portrait){
 .brief-screen.command-screen[open]{width:100vw;height:100dvh;padding:6px}
 .brief-screen.command-screen #actions{gap:4px}
 .brief-screen.command-screen #detail{margin:0 0 4px}
 .enemy-roster{padding:2px;gap:1px 4px}.enemy-roster small{font-size:10px}
 .roster-grid.compact{row-gap:3px}.roster-grid.compact span{letter-spacing:-.45px}
}

main{grid-template-rows:auto minmax(0,1fr) auto auto}
#adFooter{background:#101a20;text-align:center;border-top:1px solid #42565f;padding:2px 0 max(2px,env(safe-area-inset-bottom));width:100%}
#adFooter[hidden]{display:none}#adLabel{font:10px/12px system-ui;color:#a7b5ba}
#bannerSlot{width:min(970px,100%);height:50px;margin:auto}
#energyAd{color:#a9f9ed;border-color:#43887e}#energyAd:disabled{opacity:.65}
html[lang=en] .nav-choice small{letter-spacing:0}
html[lang=en] .roster-grid span{overflow:hidden;text-overflow:ellipsis}
html[lang=en] .card strong,html[lang=en] .card small{overflow-wrap:anywhere}
html[lang=en] .card{min-width:0}
html[lang=en] header{gap:clamp(6px,2vw,26px)}
@media(max-width:620px){header{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) repeat(2,auto);gap:4px}.brand{display:none}#energyAd{grid-column:1/4;grid-row:2;width:100%;padding:3px}#debug{grid-column:4;grid-row:1/3}#menu{grid-column:5;grid-row:1/3}.meter{min-width:0}}
@media(orientation:landscape) and (max-height:520px){header .brand{display:none}header{justify-content:space-between}#bannerSlot{height:50px}.card small{display:none}}

html[lang=en] .brand small{display:none}
@media(min-width:621px) and (max-width:900px){html[lang=en] header .brand{display:none}html[lang=en] header{justify-content:space-between}#energyAd{font-size:12px}}

/* AdSense can set height:auto!important on the slot's ancestors. Definite
   viewport bounds keep the flexible battlefield row alive across rotation. */
main{position:fixed;inset:0;min-height:100%;max-height:100%;min-height:100dvh;max-height:100dvh}
#field{height:auto;min-height:0}
#bannerSlot{width:320px;height:50px;max-width:100%}
@media(min-width:1024px) and (min-height:600px){#bannerSlot{width:728px;height:90px}}
#debug[hidden]{display:none}
@media(max-width:620px){header:has(#debug[hidden]){grid-template-columns:repeat(3,minmax(0,1fr)) auto}header:has(#debug[hidden]) #menu{grid-column:4}}
