/* One scale for splash, menus, dialogs, cinematics, HUD and transitions. */
body{zoom:var(--interface-scale,1)}
#app{min-height:100dvh}
/* Growing teams must scroll instead of crushing portraits and their labels. */
.squad-title{flex-shrink:0}
.squad-list{grid-template-rows:repeat(var(--rows,8),minmax(64px,1fr));overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;padding:2px}
.scene-relics{max-height:min(28dvh,240px);overflow-y:auto;overflow-x:hidden;flex-shrink:0;scrollbar-width:thin}
@media(max-height:550px) and (orientation:landscape){.squad-list{grid-template-rows:repeat(var(--rows,8),minmax(40px,1fr))}}
@media(max-height:300px) and (orientation:landscape){.squad-list{grid-template-rows:repeat(var(--rows,8),minmax(32px,1fr))}}

/* Fit the merchant return action inside the existing camp footer. */
.scene-inventory .camp-merchant{height:32px;min-height:32px;padding:0 9px;font-size:13px;line-height:14px}

/* Every machine choice uses one footprint; ability text never drives its size. */
.unit-choices .reward-visual{height:clamp(44px,14vh,100px);flex:0 0 auto;min-height:0}
.unit-choices .reward-visual .machine-art{height:100%;max-height:100%;min-height:0;margin:0 auto}
.unit-choices .unit-role{font-size:11px;line-height:1.1;text-align:center;flex-shrink:0}
.unit-choices .reward-card:has(.unit-details-button)>p{display:block;-webkit-line-clamp:unset;flex:1 1 auto;min-height:0;overflow-y:auto;scrollbar-width:thin}

@media(max-height:350px) and (orientation:landscape){
 .unit-choices .reward-card{gap:1px;padding:3px}
 .unit-choices .reward-card h2{font-size:11px;line-height:1.1}
 .unit-choices .reward-visual{height:28px}
 .unit-choices .unit-role{font-size:9px;line-height:10px}
 .unit-choices .reward-card .unit-stats{font-size:8px;line-height:10px;gap:3px}
 .unit-choices .reward-card .unit-details-button{min-height:16px;line-height:14px;font-size:10px}
 .scene-modal:has(.unit-choices) .choice-pager button{height:24px;min-height:24px;border-width:4px;border-image-width:4px;padding:0;line-height:14px}
}

@media(max-height:300px) and (orientation:landscape){
 .unit-choices .reward-card{display:grid;grid-template-columns:30px minmax(0,1fr) 55px;grid-template-rows:auto auto minmax(22px,1fr) auto auto;grid-template-areas:'name name name' 'role role role' 'art description description' 'stats stats details' 'buy buy buy';gap:1px;padding:2px}
 .unit-choices .reward-card h2{grid-area:name;font-size:10px;line-height:11px}
 .unit-choices .unit-role{grid-area:role;font-size:9px;line-height:10px}
 .unit-choices .reward-visual{grid-area:art;height:24px;width:100%;align-self:center}
 .unit-choices .reward-card .unit-stats{grid-area:stats;min-width:0}
 .unit-choices .reward-card .unit-details-button{grid-area:details;font-size:9px;line-height:11px;min-height:16px}
 .unit-choices .reward-card:has(.unit-details-button)>p{grid-area:description;height:100%;text-align:left}
 .unit-choices .reward-card>button[data-action=reward]{grid-area:buy;height:24px;min-height:24px;border-width:4px;border-image-width:4px;padding:0;line-height:14px}
}

/* Keep the result actions reachable while the complete combat report scrolls. */
.scene-modal.result-modal{overflow:hidden;min-height:0;max-height:100%}
.result-modal .result-summary,.result-modal .modal-actions{flex-shrink:0}
.battle-report-scroll{min-height:0;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y;flex:1 1 auto}
.battle-report-scroll .battle-report{flex:none}
.battle-report-scroll thead{position:sticky;top:0;z-index:1}
.report-summon{display:block;font-size:.8em;font-weight:400;opacity:.75}

/* Size roster values to their actual text column, including ranged DPS. */
.squad-unit>div:nth-child(2){container-type:inline-size}
.squad-unit .unit-stats{font-size:clamp(6px,7cqw,10px);line-height:1.15;gap:4px;padding:1px 0}
.squad-unit .unit-stats>span{white-space:nowrap;flex-shrink:0}

/* Public settings: a visible return action and the two retained panels. */
#app[data-screen=options] .options-return{color:#b52e25}
#app[data-screen=options] .options-box:nth-child(2){display:block}

.battle-report .report-sort{appearance:none;background:none;border:0;border-image:none;box-shadow:none;color:inherit;font:inherit;white-space:nowrap;padding:6px 4px;min-height:32px;cursor:pointer;width:100%}
.battle-report .report-sort:hover{background:#51372812}
.battle-report .report-sort:focus-visible{outline:2px solid #2b827e;outline-offset:-2px}
.battle-report .report-sort span{font-size:.75em;display:inline-block;min-width:1em}
.battle-report th[aria-sort=descending],.battle-report th[aria-sort=ascending]{color:#247c78}

/* Single unobtrusive line in the free space between round and controls. */
.nuclear-hud{position:absolute;left:35%;top:12px;transform:translateX(-50%);z-index:3;color:#513728;font-size:15px;font-weight:700;white-space:nowrap;pointer-events:none;text-shadow:0 1px 2px #fff6df,1px 0 2px #fff6df,-1px 0 2px #fff6df}
.nuclear-hud[hidden]{display:none}
@media(max-height:550px),(max-width:650px){.nuclear-hud{top:12px;font-size:12px}}

.squad-influences{display:flex;flex-wrap:wrap;gap:2px;max-width:100%;margin-top:2px}
.squad-influences .squad-command-note{margin-left:0;flex:none}

.squad-list:has(.squad-influences){grid-template-rows:none;grid-auto-rows:max-content;align-content:start}
.squad-list:has(.squad-influences) .squad-unit{min-height:64px}
.squad-list:has(.squad-influences) .unit-portrait-button{height:54px;align-self:center}
@media(max-height:550px){.squad-list:has(.squad-influences) .squad-unit{min-height:44px}.squad-list:has(.squad-influences) .unit-portrait-button{height:34px}}

/* The scroll region fills the space left by the title and relic inventory.
   Content-sized rows reserve badges/return labels equally in Gecko and Chromium. */
.squad-panel .squad-list{height:auto;min-height:0;flex:1 1 0;grid-template-rows:none;grid-auto-rows:max-content;align-content:start}
.squad-panel .squad-unit{min-height:64px}
.squad-panel .squad-unit>div{min-width:0}
.squad-panel .squad-unit strong{display:block;overflow-wrap:anywhere}
.squad-panel .unit-portrait-button{height:54px;align-self:center}
.squad-return{font-size:.8em;line-height:1.2;color:#755743}
@media(max-height:550px){.squad-panel .squad-unit{min-height:44px}.squad-panel .unit-portrait-button{height:34px}}
