/* CK 10-20: no vertical scrolling on non-day screens. Layout, not hidden content; tests/no-vertical-scroll.test.cjs measures every screen at 1440x900, 1280x720, 844x390, 390x844. */
/* select (title / survivor choice), phones */
body.mobile-ui:not([data-mode="night"]) #screen-select.screen{display:flex;flex-direction:column;overflow:hidden;height:100dvh;padding:max(6px,env(safe-area-inset-top)) 10px max(6px,env(safe-area-inset-bottom))}
body.mobile-ui #screen-select .screen-head{flex:none;flex-wrap:nowrap;align-items:center;gap:6px}
body.mobile-ui #screen-select .logo{font-size:15px;white-space:nowrap}
body.mobile-ui #screen-select .logo-sub{display:none}
body.mobile-ui #screen-select .head-actions{flex:1;min-width:0;justify-content:flex-end;flex-wrap:nowrap;gap:4px}
body.mobile-ui #screen-select .head-actions .btn,body.mobile-ui #screen-select .ui-language{min-width:0;min-height:40px;padding:4px 7px;font-size:12px;white-space:nowrap}
body.mobile-ui #screen-select .enemy-rig-option{display:none}
body.mobile-ui #screen-select .select-intro{flex:none;padding:0 4px}
body.mobile-ui #screen-select .select-intro .eyebrow,body.mobile-ui #screen-select .select-intro .lead{display:none}
body.mobile-ui #screen-select .select-intro .screen-title{font-size:18px;margin:2px 0}
body.mobile-ui #screen-select .first-night-entry{flex:none;flex-wrap:wrap;gap:6px;margin:4px 4px}
body.mobile-ui #screen-select #btn-first-night{min-height:44px;font-size:15px}
body.mobile-ui #screen-select .first-night-entry span{display:none}
body.mobile-ui #screen-select .select-footer{flex:none;margin:2px 4px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
body.mobile-ui #screen-select #btn-coop{margin:2px 4px;min-height:36px;padding:4px 10px;align-self:flex-start}
body.mobile-ui #screen-select .card-list{flex:1;min-height:0;margin:4px 0 0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;overflow:hidden}
body.mobile-ui #screen-select .card{min-height:0!important;height:auto!important;overflow:hidden}
@media (orientation:portrait){body.mobile-ui #screen-select .card-list{grid-template-columns:1fr;grid-template-rows:repeat(5,minmax(0,1fr))}body.mobile-ui #screen-select .card{flex-direction:row!important}body.mobile-ui #screen-select .card canvas{width:72px!important;height:auto!important;align-self:stretch}body.mobile-ui #screen-select .card-text{padding:4px 6px!important;min-width:0}body.mobile-ui #screen-select .card-name{font-size:14px!important}body.mobile-ui #screen-select .card-desc{font-size:11px!important;line-height:1.3!important}body.mobile-ui #screen-select .card-uniq{font-size:10px!important;line-height:1.25!important;margin-top:2px!important;padding-top:2px!important}body.mobile-ui #screen-select .card::after{display:none}}
@media (orientation:landscape){body.mobile-ui #screen-select .card canvas{height:48px!important}body.mobile-ui #screen-select .card-text{padding:4px 5px!important}body.mobile-ui #screen-select .card-name{font-size:12px!important}body.mobile-ui #screen-select .card-desc{font-size:9px!important;line-height:1.25!important}body.mobile-ui #screen-select .card-uniq{font-size:8px!important;line-height:1.2!important;margin-top:2px!important;padding-top:2px!important}body.mobile-ui #screen-select .card::after{display:none}}
body.mobile-ui #screen-select .card-desc,body.mobile-ui #screen-select .card-uniq li{white-space:normal!important;overflow-wrap:anywhere}
@media (orientation:portrait){body.mobile-ui #screen-select .screen-head{flex-wrap:wrap}body.mobile-ui #screen-select .head-actions{flex:1 1 100%;justify-content:flex-start}}
@media (orientation:landscape){body.mobile-ui:not([data-mode="night"]) #screen-select.screen{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-rows:auto auto minmax(0,1fr);align-items:center;column-gap:8px}
body.mobile-ui #screen-select .screen-head,body.mobile-ui #screen-select .card-list{grid-column:1/-1}
body.mobile-ui #screen-select .select-intro{grid-column:1;grid-row:2}
body.mobile-ui #screen-select .first-night-entry{grid-column:2;grid-row:2}
body.mobile-ui #screen-select .select-footer{grid-column:3;grid-row:2;justify-content:flex-end}
body.mobile-ui #screen-select #btn-coop{grid-column:4;grid-row:2;align-self:center}
body.mobile-ui #screen-select .card-list{grid-row:3;align-self:stretch}}
body.mobile-ui #screen-select .card-text{flex:1 1 0!important;min-width:0;overflow:hidden}
@media (orientation:portrait){body.mobile-ui:not([data-mode="night"]) #screen-select.screen{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto minmax(0,1fr);align-items:center;column-gap:8px}
body.mobile-ui #screen-select .screen-head,body.mobile-ui #screen-select .card-list{grid-column:1/-1}
body.mobile-ui #screen-select .select-intro{grid-column:1;grid-row:2}
body.mobile-ui #screen-select .first-night-entry{grid-column:2;grid-row:2;margin:0}
body.mobile-ui #screen-select .select-footer{grid-column:1;grid-row:3}
body.mobile-ui #screen-select #btn-coop{grid-column:2;grid-row:3}
body.mobile-ui #screen-select .card-list{grid-row:4;align-self:stretch;margin-left:0;margin-right:0;padding:0}
body.mobile-ui #screen-select .select-footer .btn{min-height:36px;padding:4px 8px;font-size:12px}
body.mobile-ui #screen-select .select-footer{font-size:10px}}
/* brief (equipment check) */
body.mobile-ui:not([data-mode="night"]) #screen-brief.screen{display:flex;flex-direction:column;overflow:hidden;height:100dvh;padding:max(6px,env(safe-area-inset-top)) 10px max(6px,env(safe-area-inset-bottom))}
body.mobile-ui #screen-brief .screen-head{flex:none;gap:6px}
body.mobile-ui #screen-brief .brief-grid{flex:1;min-height:0;height:auto;margin:4px 0 0;padding:0}
body.mobile-ui #screen-brief .deployment-help{font-size:10px;line-height:1.35}
@media (orientation:landscape){
body.mobile-ui #screen-brief .screen-head{flex-wrap:nowrap;align-items:center}
body.mobile-ui #screen-brief .screen-title{font-size:18px;margin:0}
body.mobile-ui #screen-brief .head-actions .btn,body.mobile-ui #screen-brief .ui-language{min-height:36px;padding:3px 8px;font-size:12px}
body.mobile-ui #screen-brief .enemy-rig-option{display:none}
body.mobile-ui #screen-brief .brief-grid{display:grid;grid-template-columns:104px minmax(0,1fr) auto;grid-template-rows:minmax(0,1fr) auto;gap:4px 10px}
body.mobile-ui #screen-brief .brief-main{display:contents}
body.mobile-ui #screen-brief .brief-who{grid-column:1;grid-row:1;display:block;padding:5px;min-height:0;overflow:hidden}
body.mobile-ui #screen-brief .brief-who .eyebrow{display:none}
body.mobile-ui #screen-brief .brief-who canvas{width:62px;height:70px;margin:0 auto}
body.mobile-ui #screen-brief .brief-name{font-size:14px;margin:2px 0}
body.mobile-ui #screen-brief .brief-desc{font-size:9px;line-height:1.3}
body.mobile-ui #screen-brief #deployment-options{grid-column:2/4;grid-row:1;min-height:0}
body.mobile-ui #screen-brief .choice-heading{margin:0 0 3px}
body.mobile-ui #screen-brief .choice-heading h3{font-size:12px}
body.mobile-ui #screen-brief .choice-heading span{font-size:9px}
body.mobile-ui #screen-brief .loadout-cards{gap:5px}
body.mobile-ui #screen-brief .loadout-card{height:102px;padding:4px 6px}
body.mobile-ui #screen-brief .loadout-card canvas{height:30px}
body.mobile-ui #screen-brief .loadout-card strong{font-size:11px}
body.mobile-ui #screen-brief .loadout-card>span{font-size:9px}
body.mobile-ui #screen-brief .deployment-lower{margin-top:4px;gap:3px}
body.mobile-ui #screen-brief .option-cards{gap:5px}
body.mobile-ui #screen-brief .option-card,body.mobile-ui #screen-brief .option-card[data-map-type]{min-height:0;padding:3px 8px}
body.mobile-ui #screen-brief .option-card[data-map-type]{padding-top:26px;height:56px}
body.mobile-ui #screen-brief .option-card[data-map-type]::before{height:22px}
body.mobile-ui #screen-brief .option-card strong{font-size:11px}
body.mobile-ui #screen-brief .option-card small{font-size:9px;line-height:1.2}
body.mobile-ui #screen-brief .deployment-seed{grid-column:2;grid-row:2;margin:0;gap:6px;flex-wrap:nowrap;align-items:center}
body.mobile-ui #screen-brief .deployment-seed input{min-height:36px;width:100px;font-size:14px}
body.mobile-ui #screen-brief .deployment-seed .btn{min-height:36px;padding:3px 8px;font-size:11px;white-space:nowrap}
body.mobile-ui #screen-brief .deployment-seed span{font-size:9px;line-height:1.2}
body.mobile-ui #screen-brief #brief-mastery{grid-column:1;grid-row:2;align-self:end}
body.mobile-ui #screen-brief .deployment-help{display:none}
body.mobile-ui #screen-brief .deployment-actions{grid-column:3;grid-row:2;position:static;display:flex;gap:6px;margin:0;padding:0;background:none;border:0}
body.mobile-ui #screen-brief .deployment-actions .btn{min-height:40px;padding:3px 10px;font-size:12px}
}
@media (orientation:portrait){
body.mobile-ui #screen-brief .screen-head{flex-wrap:wrap}
body.mobile-ui #screen-brief .screen-title{font-size:18px;margin:0}
body.mobile-ui #screen-brief .head-actions .btn,body.mobile-ui #screen-brief .ui-language{min-height:38px;padding:3px 8px;font-size:12px}
body.mobile-ui #screen-brief .enemy-rig-option{display:none}
body.mobile-ui #screen-brief .brief-grid{display:flex;flex-direction:column;gap:6px;justify-content:space-between}
body.mobile-ui #screen-brief .brief-main{display:flex;flex-direction:column;gap:6px;min-height:0}
body.mobile-ui #screen-brief .brief-who{padding:6px;grid-template-columns:70px 1fr}
body.mobile-ui #screen-brief .brief-who canvas{width:70px;height:78px;grid-row:1/4}
body.mobile-ui #screen-brief .brief-name{font-size:16px;margin:0}
body.mobile-ui #screen-brief .brief-desc{font-size:10px;line-height:1.3}
/* The armory loadout (持ち込み, 2 slots) and the keyboard help share this column: slots lay out icon-left so a filled slot needs 36px, and the desktop key help is hidden like in landscape. */
body.mobile-ui #screen-brief .deployment-help{display:none}
body.mobile-ui #screen-brief .armory-loadout{height:46px;box-sizing:border-box;flex-direction:row;align-items:stretch;gap:6px;padding:3px 5px}
body.mobile-ui #screen-brief .armory-loadout .armory-loadout-label{flex-direction:column;justify-content:center;gap:0;width:44px}
body.mobile-ui #screen-brief .armory-loadout .armory-slot{min-height:0;height:100%;grid-template-columns:44px minmax(0,1fr);grid-template-rows:minmax(0,1fr) 3px;gap:0 4px;padding:2px 4px;text-align:left}
body.mobile-ui #screen-brief .armory-loadout .armory-slot .nw-weapon-icon{grid-row:1;width:44px;height:24px}
body.mobile-ui #screen-brief .armory-loadout .armory-slot-name{grid-column:2;grid-row:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.mobile-ui #screen-brief .armory-loadout .armory-slot .armory-dura{grid-row:2}
body.mobile-ui #screen-brief .choice-heading{margin:0 0 3px}
body.mobile-ui #screen-brief .choice-heading h3{font-size:12px}
body.mobile-ui #screen-brief .loadout-cards{grid-template-columns:1fr 1fr;gap:5px}
body.mobile-ui #screen-brief .loadout-card{height:102px;padding:4px 6px}
body.mobile-ui #screen-brief .loadout-card canvas{height:30px}
body.mobile-ui #screen-brief .deployment-lower{margin-top:4px;gap:5px}
body.mobile-ui #screen-brief .option-cards{gap:5px}
body.mobile-ui #screen-brief .option-card,body.mobile-ui #screen-brief .option-card[data-map-type]{min-height:0;padding:3px 6px}
body.mobile-ui #screen-brief .option-card[data-map-type]{padding-top:28px;height:62px}
body.mobile-ui #screen-brief .option-card[data-map-type]::before{height:24px}
body.mobile-ui #screen-brief .option-card strong{font-size:11px}
body.mobile-ui #screen-brief .option-card small{font-size:9px;line-height:1.2}
body.mobile-ui #screen-brief .deployment-seed{margin:0;gap:6px;flex-wrap:wrap}
body.mobile-ui #screen-brief .deployment-seed input{min-height:38px;width:110px}
body.mobile-ui #screen-brief .deployment-actions{position:static;margin:0;padding:0}
}
body.mobile-ui #screen-brief #brief-mastery details[open]{position:fixed;left:8px;right:8px;bottom:8px;z-index:20;max-height:calc(100dvh - 16px);overflow:hidden;background:#142c38;border:1px solid #66817e;border-radius:8px;padding:8px}
body:not(.mobile-ui) #brief-mastery{overflow:visible}
body:not(.mobile-ui) #brief-mastery details[open]{position:absolute;left:0;right:0;bottom:0;z-index:5;background:#142c38;border:1px solid #66817e;border-radius:6px;padding:8px}
/* pause */
body .pause-box{position:relative;width:min(760px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:hidden;columns:2;column-gap:22px;column-fill:balance;text-align:left}
body .pause-box>*{break-inside:avoid}
body .pause-box .pause-title,body .pause-box .pause-sub{text-align:center}
body .pause-box .pause-controls{margin:0 0 8px;padding:8px 10px}
body .pause-box .pause-controls dl{gap:5px 14px}
body .pause-box #btn-resume{width:100%;margin:4px 0 8px}
body .pause-box .pause-settings{margin:0 0 8px}
/* Pause settings: five equal 40px buttons in a 3 + 2 grid (Motion, Replay, Sound / Music, Volume) instead of a ragged flex row. */
body .pause-box .pause-settings{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px;justify-content:stretch;align-items:stretch}
body .pause-box .pause-settings>*:nth-child(-n+3){grid-column:span 2}
body .pause-box .pause-settings>*:nth-child(n+4){grid-column:span 3}
/* With the codex button (CK 10-24) there are six: 3 + 3 keeps the same two rows instead of adding a third. */
body .pause-box .pause-settings:has(>:nth-child(6))>*{grid-column:span 2}
body .pause-box .pause-settings .btn,body .pause-box .pause-settings .volume-control>.btn{width:100%;min-height:40px;min-width:0;padding:6px 8px;font-size:13px;line-height:1.2;white-space:nowrap}
body .pause-box details[open]{position:absolute;inset:0;z-index:3;margin:0;padding:10px 16px;background:var(--panel,#132a35);overflow:hidden;columns:1}
body .pause-box select.ui-language{margin-top:6px}
body .pause-box .enemy-guide[open]{margin:0;border:0}
body .pause-box .enemy-guide[open] .enemy-guide-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:2px}
body .pause-box .enemy-guide[open] article{gap:5px;padding:3px 5px;min-width:0}
body .pause-box .enemy-guide[open] .enemy-guide-art{width:52px;height:52px;margin:0;background-size:156px 104px}
body .pause-box .enemy-guide[open] strong{font-size:11px}
body .pause-box .enemy-guide[open] p{font-size:10px;line-height:1.35;margin:2px 0}
/* result */
body #screen-result.screen.result,body.mobile-ui #screen-result.screen.result{overflow:hidden;display:grid;align-content:center;justify-items:center;gap:4px 18px;padding:10px 20px;grid-template-columns:minmax(0,1fr);text-align:center}
body #screen-result.result::before{margin:0;padding:0;font-size:10px;letter-spacing:.3em}
body #screen-result .result-title{margin:0;font-size:34px;line-height:1.1}
body #screen-result .lead,body #screen-result .result-mastery,body #screen-result .wave-obstacle{margin:0;font-size:13px;line-height:1.4}
body #screen-result .result-stats{margin:2px 0;padding:6px 16px;font-size:14px;display:grid;grid-template-columns:max-content max-content;gap:1px 18px;justify-content:center}
body #screen-result .result-stats dt{margin:0}
body #screen-result .result-stats dt,body #screen-result .result-stats dd{margin:0}
body #screen-result .battle-statistics{max-width:none;width:100%;margin:2px 0;font-size:11px}
body #screen-result .battle-statistics h3{font-size:11px;margin:0 0 3px}
body #screen-result .battle-statistics table{border-spacing:0}
body #screen-result .battle-statistics th,body #screen-result .battle-statistics td{padding:0 4px;line-height:1.35;font-size:10.5px}
body #screen-result .result-portrait{display:block!important}
body #screen-result .btn-row{margin:4px 0 0}
body #screen-result .btn-row .btn,body.mobile-ui #screen-result .btn-row .btn{min-height:40px;padding:4px 14px;font-size:14px}
/* Defeat: retrying is the primary (gold) button, the way back to the survivor list is secondary. */
body #screen-result.lose .btn-row button.btn:not(.btn-primary){background:linear-gradient(135deg,#f4d39b,#dfae6d);border-color:#ffdc9f;color:#1b2a34;box-shadow:0 3px 12px #d9a75920}
body #screen-result.lose .btn-row button.btn.btn-primary{background:linear-gradient(165deg,#2b4550,#192e3a);border-color:#66817e;color:var(--nw-paper);box-shadow:0 2px 0 #081724}
@media (orientation:landscape){
body #screen-result.screen.result,body.mobile-ui #screen-result.screen.result{grid-template-columns:150px minmax(0,1fr) minmax(0,1.35fr);grid-template-rows:auto auto auto auto auto minmax(0,auto) auto;justify-items:stretch;text-align:left;align-content:center;padding:10px 20px}
body #screen-result.result::before{grid-column:2;grid-row:1}
body #screen-result .result-title{grid-column:2;grid-row:2}
body #screen-result #result-sub{grid-column:2;grid-row:3}
body #screen-result .result-mastery{grid-column:2;grid-row:4}
body #screen-result .result-stats{grid-column:2;grid-row:5;justify-content:start}
body #screen-result #result-obstacle{grid-column:2;grid-row:6}
body #screen-result .battle-statistics{grid-column:3;grid-row:1/7;align-self:center}
body #screen-result .result-portrait{grid-column:1;grid-row:1/7;position:static!important;transform:none!important;width:140px!important;height:199px!important;margin:0!important;align-self:center}
body #screen-result .btn-row{grid-column:2/-1;grid-row:7;justify-content:flex-start}
}
@media (orientation:portrait){
body #screen-result .result-portrait{width:90px!important;height:128px!important;position:static!important;transform:none!important;margin:0 auto!important;order:-1}
}
/* warehouse panel (night) */
body .wh-panel{left:8px;right:8px;top:36px;bottom:auto;width:auto;max-width:none;max-height:calc(100% - 44px);overflow:hidden;padding:6px 10px 8px}
body.mobile-ui .wh-panel{position:fixed;left:8px;right:8px;top:max(6px,env(safe-area-inset-top));bottom:auto;max-height:calc(100dvh - 12px);padding:6px 10px}
body .wh-panel .wh-head{flex:none;flex-wrap:nowrap;gap:8px}
body .wh-panel .wh-note{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:clip;color:#e9e3c4;background:#102a33;border-color:#4c6e66}
body .wh-panel .wh-body{overflow:visible;flex:1 1 auto;min-height:0}
body #wh-panel .hs.hs-stack{grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:6px 14px;align-items:start}
body #wh-panel .hs-col{min-width:0}
body #wh-panel .hs-list{grid-auto-flow:column;grid-template-rows:repeat(6,auto);grid-auto-columns:100%;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
/* Weapon rows: key | text block (name + rarity + tags, then stats and reason, wrapping) | buttons in their own right-hand column. Nothing is absolutely positioned or truncated. */
body #wh-panel .hs .slot-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:0 8px;padding:4px 8px;min-height:44px}
body #wh-panel .hs .slot-row.empty{grid-template-columns:auto minmax(0,1fr);min-height:44px}
body #wh-panel .hs .slot-body{display:flex;flex-wrap:wrap;align-items:center;gap:1px 8px;min-width:0}
body #wh-panel .hs .slot-head{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:2px 6px;min-width:0}
body #wh-panel .hs .slot-name{display:flex;align-items:center;gap:5px;max-width:none;min-width:0;flex:0 1 auto;flex-wrap:wrap;white-space:nowrap;overflow:visible;font-size:13px}
body #wh-panel .hs .slot-name .nw-weapon-icon{width:30px;height:18px;flex:none}
body #wh-panel .hs .slot-name .weapon-rarity{margin:0;flex:none}
body #wh-panel .hs .tag,body #wh-panel .hs .slot-flag{flex:none;font-size:10.5px;padding:0 5px}
body #wh-panel .hs .slot-stats,body #wh-panel .hs .slot-reason{display:block;flex:0 1 auto;min-width:0;font-size:11.5px;line-height:1.25;white-space:normal;overflow:visible;text-overflow:clip;overflow-wrap:anywhere}
body #wh-panel .hs .slot-body:has(.slot-reason) .slot-stats{display:block}
body #wh-panel .hs .slot-btns{display:flex;flex-wrap:nowrap;gap:5px;align-items:center;grid-column:3}
body.mobile-ui #wh-panel .hs .slot-row{grid-template-columns:auto minmax(0,1fr) auto;padding:3px 6px;gap:0 6px}
body.mobile-ui #wh-panel .hs .slot-row.empty{grid-template-columns:auto minmax(0,1fr)}
body.mobile-ui #wh-panel .hs .slot-name{font-size:12px;gap:4px}
body.mobile-ui #wh-panel .hs .slot-name{flex-wrap:wrap}
@media (max-height:500px){body.mobile-ui #wh-panel{max-width:min(760px,calc(100vw - 16px))}body.mobile-ui #wh-panel .hs.hs-stack{grid-template-columns:minmax(0,1.1fr) minmax(0,1.2fr)}body.mobile-ui #wh-panel .hs-col+.hs-col .slot-row:not(.empty){grid-template-columns:minmax(0,1fr) auto}body.mobile-ui #wh-panel .hs-col+.hs-col .slot-row .slot-key{display:none}body.mobile-ui #wh-panel .hs-list{grid-template-rows:repeat(5,auto)}body.mobile-ui #wh-panel .hs .slot-head{display:contents}body.mobile-ui #wh-panel .hs .slot-btns{gap:3px}body.mobile-ui #wh-panel .hs .slot-btns .btn{min-width:40px;padding:2px 3px;font-size:11px}body.mobile-ui #wh-panel .hs .slot-body{gap:1px 5px}body.mobile-ui #wh-panel .hs .slot-row{gap:0 4px}}
@media (max-height:500px){body.mobile-ui #wh-panel .hs .slot-name .nw-weapon-icon{display:none}}
body.mobile-ui #wh-panel .hs .slot-name .weapon-rarity,body.mobile-ui #wh-panel .hs .tag,body.mobile-ui #wh-panel .hs .slot-flag{font-size:10px;padding:0 4px}
body.mobile-ui #wh-panel .hs .slot-stats,body.mobile-ui #wh-panel .hs .slot-reason{font-size:10.5px}
body.mobile-ui #wh-panel .hs .slot-btns .btn,body.mobile-ui #wh-panel .slot-row .btn{min-height:40px;min-width:44px;padding:2px 8px;font-size:12px}
body.mobile-ui #wh-panel .wh-head .btn,body.mobile-ui #wh-panel #btn-wh-close{min-height:40px;min-width:44px}
body.wh-open .nw-cutin-layer{z-index:1}
/* UIUX P13-01/06: the panel runs down to the bottom edge, so the hotbar peeked out under it; the hand column shows the same slots. Close button keeps 40px on every pointer. */
body.wh-open #hud-inv{visibility:hidden}
body:not(.mobile-ui) #wh-panel .hs.hs-stack{grid-template-columns:minmax(0,1fr) minmax(0,1.35fr)}
body #wh-panel #btn-wh-close{min-width:40px}
body.wh-open #wh-panel{z-index:70}
/* Co-op uses the dedicated scaled shell. Its portrait picker and live weapon/storage tracks are fitted in deferred coop-lobby.css. */
/* Training choice on landscape phones (CK no-scroll rule, integration 10-22): the screen is a column that never scrolls. The cards take the height
   that is left and their art gives way first, so a three-line description or the co-op vote line cannot push the details row or footer down. */
@media (orientation:landscape) and (max-height:500px){
 body.mobile-ui #screen-training.screen{display:flex;flex-direction:column;overflow:hidden}
 body.mobile-ui #screen-training .training-head,body.mobile-ui #screen-training .training-footer{flex:none}
 body.mobile-ui #screen-training .perk-cards{flex:1 1 0;min-height:0;align-items:stretch;grid-template-rows:minmax(0,1fr)}
 body.mobile-ui #screen-training .perk-option{min-height:0}
 body.mobile-ui #screen-training .perk-option .perk-card{flex:1 1 0;min-height:0;overflow-x:visible;overflow-y:clip}
 body.mobile-ui #screen-training .perk-card canvas{flex:0 1 40px;min-height:0}
 body.mobile-ui #screen-training .perk-card p{min-height:0}
}

/* UIUX pass 01 (10-23): phone title screen as one grid. Header = logo + language, then one even row of controls; the secondary actions (practice, intro story, co-op, records) share one equal-height row; cards use the remaining height without clipping. */
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select.screen{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:auto auto auto auto auto minmax(0,1fr);gap:6px;align-content:start;align-items:center;padding:max(8px,env(safe-area-inset-top)) 12px max(8px,env(safe-area-inset-bottom))}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .screen-head{grid-column:1/-1;grid-row:1;display:flex;flex-wrap:wrap;align-items:center;gap:6px;min-height:0}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .logo{order:-2;flex:1 1 calc(100% - 120px);font-size:16px;margin:0}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions{display:contents}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions>.btn,body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions>.volume-control{flex:1 1 calc(20% - 5px);min-width:0}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .volume-control>.btn{width:100%}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions .btn{min-height:44px;padding:2px 4px;font-size:11px;line-height:1.15;white-space:normal;text-align:center}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .ui-language{order:-1;flex:0 0 112px;min-height:44px;max-width:none;font-size:13px}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-intro{grid-column:1/-1;grid-row:2;padding:0 2px}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-intro .screen-title{font-size:19px;margin:0;line-height:1.2}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .first-night-entry{grid-column:1/-1;grid-row:3;display:flex;flex-wrap:wrap;gap:6px;margin:0}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .first-night-entry>.btn-primary{flex:1 1 150px;min-height:48px;font-size:15px}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .first-night-entry>.btn-small{flex:0 0 auto;min-height:44px;padding:4px 12px;font-size:13px}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer{display:contents}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer .btn,body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-coop{grid-row:4;min-height:44px;margin:0;padding:4px 6px;font-size:12px;line-height:1.15;white-space:normal;text-align:center;position:static;height:auto;align-self:stretch}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-play-tutorial{grid-column:1}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-story-replay{grid-column:2}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-coop{grid-column:3}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer>span{grid-row:5;grid-column:1/3;font-size:11px;line-height:1.3;color:#b0c5cf}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer>a{grid-row:5;grid-column:3;justify-self:end;display:inline-flex;align-items:center;min-height:40px;padding:0 10px;font-size:12px;color:#edc585;border:1px solid #edc58555;border-radius:8px;text-decoration:none}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-list{grid-column:1/-1;grid-row:6;margin:0;padding:0;align-self:stretch}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card{position:relative;padding:0;overflow:hidden}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-name{font-size:15px!important;line-height:1.2;margin:0}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq{margin-top:3px!important;padding-top:3px!important;line-height:1.25!important}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq li{margin:0;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq li:nth-child(n+2){display:none}
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .mastery-badge{display:block;margin-top:2px;font-size:10.5px;line-height:1.2}
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card{flex-direction:row!important;align-items:stretch}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card canvas{flex:none;width:76px!important;height:auto!important;align-self:stretch;object-fit:cover}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-text{padding:6px 34px 6px 8px!important;align-self:center}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{font-size:11.5px!important;line-height:1.3!important;-webkit-line-clamp:3}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card::after,html[lang=en] body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card::after{display:grid;place-items:center;content:'›';position:absolute;right:6px;top:50%;width:26px;height:26px;margin:-13px 0 0;padding:0 0 3px;border:1px solid #edc58566;border-radius:50%;background:#edc58520;color:#edc585;font-size:20px;line-height:1}
}
@media (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select.screen{grid-template-columns:minmax(0,1fr) auto auto auto auto;grid-template-rows:auto auto auto minmax(0,1fr);row-gap:4px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .logo{flex:1 1 auto}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions>.btn,body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions>.volume-control{flex:0 0 auto}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .head-actions .btn{min-height:40px;padding:2px 10px;font-size:12px;white-space:nowrap}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .ui-language{order:0;flex:0 0 auto;min-height:40px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-intro{grid-column:1;grid-row:2}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .first-night-entry{grid-column:2/-1;grid-row:2;flex-wrap:nowrap}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .first-night-entry>.btn-primary{flex:0 0 auto;min-height:44px;padding:4px 16px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .first-night-entry>.btn-small{min-height:44px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer .btn,body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-coop{grid-row:3;min-height:40px;padding:2px 12px;white-space:nowrap}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-play-tutorial{grid-column:3}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-story-replay{grid-column:4}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select #btn-coop{grid-column:5}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer>span{grid-row:3;grid-column:1;font-size:11px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer>a{grid-row:3;grid-column:2;justify-self:end;padding:0 10px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-list{grid-row:4}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card{flex-direction:column;gap:0}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card canvas{flex:1 1 0;height:auto!important;min-height:56px;max-height:150px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-text{flex:0 0 auto!important;padding:2px 7px!important}
 /* Keep the level, stats and skill together; their old margins pushed the soldier's footer out at 844px. */
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card .card-text>:is(.mastery-badge,.card-growth-stats,.card-skill){margin-top:0}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{font-size:10.5px!important;line-height:1.3!important;-webkit-line-clamp:3}
 html[lang=en] body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{-webkit-line-clamp:4}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq{font-size:10px!important}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq li{white-space:normal!important;overflow:visible;text-overflow:clip}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card::after,html[lang=en] body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card::after{display:block;position:static;flex:none;padding:2px 7px;font-size:11px}
}

/* UIUX pass 01 (10-23): desktop title. Equal-height cards whose CTA stays inside the card, and one aligned footer row (step caption, records, practice, intro story, co-op). */
body:not(.mobile-ui):not(.coop-selecting) #screen-select .card{height:auto;min-height:292px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .card canvas{height:108px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .card-text{padding:7px 10px 4px;min-height:0}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .card-desc{font-size:9.5px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .card::after{padding:6px 10px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .first-night-entry{margin:8px 4px 8px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .select-footer{left:25px;right:175px;bottom:8px;align-items:center;gap:8px;font-size:10px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .select-footer>span{flex:1 1 auto;font-size:10px}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .select-footer>a,body:not(.mobile-ui):not(.coop-selecting) #screen-select .select-footer .btn,body:not(.mobile-ui):not(.coop-selecting) #screen-select #btn-coop{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-height:30px;padding:0 12px;font-size:11px;line-height:1;white-space:nowrap}
body:not(.mobile-ui):not(.coop-selecting) #screen-select .select-footer>a{border:1.5px solid #edc58555;border-radius:8px;color:#edc585;text-decoration:none}
body:not(.mobile-ui):not(.coop-selecting) #screen-select #btn-coop{top:auto;bottom:8px;right:25px;width:142px}

/* UIUX pass 01 (10-23): loadout screen. Desktop: the eyebrow gets its own line, weapon cards keep padding under their text. Landscape phone: 40px controls, the seed row stays on one line, the bring-along slots are 56px wide. */
body:not(.mobile-ui) #screen-brief .brief-who .eyebrow{display:block;margin:0 0 6px}
body:not(.mobile-ui) .brief-main .loadout-card{padding-bottom:9px}
body:not(.mobile-ui) .brief-main .loadout-card canvas{height:46px}
body:not(.mobile-ui) .loadout-card strong .weapon-rarity{margin-left:6px}
@media (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-grid{grid-template-columns:132px minmax(0,1fr) auto}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions .btn,body.mobile-ui:not([data-mode="night"]) #screen-brief .ui-language,body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions .volume-control>.btn{min-height:40px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card,body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{min-height:40px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{height:66px;padding-bottom:5px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card{height:92px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed{flex-wrap:nowrap}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed label{flex:none;white-space:nowrap}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed input{flex:none;min-height:40px;width:110px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed .btn{flex:none;min-height:40px;padding:3px 12px;white-space:nowrap}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed span{display:none}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card>span,body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card small{font-size:10px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-desc{font-size:10px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-who .armory-loadout{flex-direction:column;align-items:stretch;gap:3px;height:auto;padding:3px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-who .armory-loadout-label{flex-direction:row;justify-content:space-between;width:auto;font-size:10px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-who .armory-slots{display:grid;grid-template-columns:1fr 1fr;gap:4px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-who .armory-slot{min-width:0;min-height:40px;width:auto;padding:2px;grid-template-columns:minmax(0,1fr);gap:0}
}
body.mobile-ui:not([data-mode="night"]) #screen-brief #brief-goal{min-height:40px}
/* UIUX pass 01 (10-23): portrait loadout header = title + language, one even row of 44px controls, then the goal strip; "Bring along" stays on one line; the deploy button outweighs the back button. */
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .screen-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .screen-title{order:-2;flex:1 1 calc(100% - 120px);margin:0}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions{display:contents}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions>.btn,body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions>.volume-control{flex:1 1 calc(20% - 5px);min-width:0}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .volume-control>.btn{width:100%}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions .btn{min-height:44px;padding:2px 4px;font-size:11px;line-height:1.15;white-space:normal;text-align:center}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .ui-language{order:-1;flex:0 0 112px;min-height:44px;max-width:none;font-size:13px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief #brief-goal{order:99;flex:1 1 100%;max-width:none;min-width:0;height:44px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .armory-loadout .armory-loadout-label{width:78px;white-space:nowrap}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .btn-row{grid-template-columns:1fr 2fr}
}
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief #brief-goal{height:40px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed span{display:none}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card{height:92px;padding-bottom:8px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card canvas{height:26px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{min-height:74px;padding-bottom:3px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card{min-height:40px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .armory-loadout .armory-slot{min-height:40px}
}
body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-seed input{min-height:40px}
/* UIUX pass 01 (10-23): survivor cards answer a press before the screen change (the change itself already fades through ui-flow.js). */
body #screen-select .card:active{transform:translateY(1px) scale(.985);transition-duration:.08s}
body.reduced-motion #screen-select .card:active{transform:none}
@media(prefers-reduced-motion:reduce){body:not([data-motion=standard]) #screen-select .card:active{transform:none}}
/* UIUX pass 02 (10-23): training choice. Desktop: three equal-height cards, readable effect text, CTA and details row on shared baselines. */
body:not(.mobile-ui) #screen-training .perk-cards{overflow:visible;align-items:stretch;grid-auto-rows:1fr}
body:not(.mobile-ui) #screen-training .perk-option{display:flex;flex-direction:column;min-height:0}
body:not(.mobile-ui) #screen-training .perk-option .perk-card{flex:1 1 auto;min-height:265px}
body:not(.mobile-ui) #screen-training .perk-card canvas{flex:none;height:clamp(64px,8vh,88px);min-height:0;object-fit:cover}
body:not(.mobile-ui) #screen-training .perk-card p{flex:0 0 auto;font-size:clamp(14px,1.1vw,16px);line-height:1.5}
body:not(.mobile-ui) #screen-training .perk-card .perk-label{font-size:10px}
body:not(.mobile-ui) #screen-training .perk-pick{margin-top:auto;font-size:13px}
body:not(.mobile-ui) #screen-training .perk-details summary{font-size:13px;min-height:40px}
/* The reveal banner sits in the card's rarity-label band (top edge), never over the title or the effect text. */
body .perk-card .perk-reveal-banner{top:6px;left:6px;right:6px;padding:4px 8px;font-size:14px;border-radius:5px;animation-name:perk-banner-top}
body.mobile-ui .perk-card .perk-reveal-banner{top:4px;left:4px;right:4px;padding:2px 6px;font-size:12px}
@keyframes perk-banner-top{0%{transform:scaleX(.2);opacity:0}15%{transform:scaleX(1);opacity:1}55%{transform:scaleX(1);opacity:1}100%{transform:scaleX(1);opacity:0}}
/* Landscape phone: art beside the text so the card height is used and the art can be read. */
@media (orientation:landscape) and (max-height:500px){
 body.mobile-ui:not(.is-coop) #screen-training .training-head>p:last-child{font-size:11px}
 body.mobile-ui:not(.is-coop) #screen-training .training-head .eyebrow{font-size:10px}
 body.mobile-ui:not(.is-coop) #screen-training .training-footer{font-size:11px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-option .perk-card{display:grid;grid-template-columns:88px minmax(0,1fr);grid-template-rows:auto auto minmax(0,1fr) auto;gap:0 8px;align-content:stretch}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card .perk-rarity{grid-column:1/-1;grid-row:1}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card canvas{grid-column:1;grid-row:2/4;width:88px;height:88px;flex:none;align-self:start;object-fit:cover;border-radius:4px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card h3{grid-column:2;grid-row:2;margin:2px 0 3px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card p{grid-column:2;grid-row:3;margin:0;font-size:13px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card .perk-pick{grid-column:1/-1;grid-row:4;align-self:end;font-size:12px;padding:4px 0 0;min-height:0}
}
#screen-training .perk-card[data-rarity=C]{border-width:2px}
/* UIUX pass 08 (10-23): desktop co-op lobby. The survivor cards end above the absolute "Bring along" stash (top = screen - 12 - 72), so a smaller portrait gives the English text room. */
/* UIUX P10-05: desktop screens have room; loadout codes/hint, night toolbar and weapon slot stats were 6.5-9px */
body:not(.mobile-ui) .loadout-card .choice-code{font-size:9.5px;line-height:1.05}
body:not(.mobile-ui) .choice-heading span{font-size:11px}
body:not(.mobile-ui) #hud-top .btn{font-size:11px;padding:3px 9px}
body:not(.mobile-ui) #hud-inv .slot-stats{font-size:10.5px}
body:not(.mobile-ui) #hud-inv .slot-top .tag{font-size:9px}
/* UIUX pass 12 (10-23): P12-07 pause summaries were 32px high (guide) vs 44px (advanced); both are thumb targets */
body .pause-box details>summary{display:flex;align-items:center;min-height:40px;box-sizing:border-box}
/* UIUX P12-01: at 667px wide the 2-column flow pushed settings into a third column outside the box. A grid keeps controls on the right and everything else stacked on the left. 844 too: the skill row (10dae17f) pushed settings off-screen */
@media (max-width:900px) and (max-height:420px){
 body .pause-box{display:grid;columns:auto;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);grid-auto-rows:min-content;column-gap:14px;row-gap:2px;align-content:start;padding:6px 14px}
 body .pause-box>*{grid-column:1;min-width:0;margin-top:0;margin-bottom:0}
 body .pause-box .pause-controls{grid-column:2;grid-row:1/span 7;align-self:start}
 body .pause-box .pause-title{font-size:20px;line-height:1.1}
 body .pause-box #btn-resume{margin:0;min-height:40px;padding:4px 8px}
 body .pause-box .pause-settings{gap:4px}
 body .pause-box #btn-end-run{grid-column:2;grid-row:6;min-height:40px;margin:0;padding:4px 8px}
 body .pause-box select.ui-language{margin-top:0;min-height:40px}
}
/* UIUX P12-03: at 667px wide the hand/storage rows wrapped to 3-4 lines (88px) and 4 hand weapons did not fit. Same 2-line row as 844: rarity as its letter, the lock tag already says "cannot store" */
@media (max-width:720px) and (max-height:420px){
 body.mobile-ui #wh-panel .hs.hs-stack{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:4px 10px}
 body.mobile-ui #wh-panel .hs-list{grid-template-rows:repeat(4,auto)}
 body.mobile-ui #wh-panel .hs .slot-note{display:none}
 body.mobile-ui #wh-panel .hs .slot-name .weapon-rarity{font-size:0;padding:0 5px}
 body.mobile-ui #wh-panel .hs .slot-name .weapon-rarity::before{content:attr(data-rarity);font-size:10px;line-height:1.4}
 body.mobile-ui #wh-panel .hs .slot-row{min-height:0;padding:2px 5px}
 body.mobile-ui #wh-panel .hs .slot-btns .btn{min-width:40px;padding:2px 5px;font-size:11px}
 body.mobile-ui #wh-panel .hs .slot-btns{gap:3px}
}
/* Clipping 10-23: English hand rows at 667x375 were 86px (long names on two lines, the model name, the Disposable tag, stats on two lines)
   and the 4th was under the panel edge. The name runs inline with its rarity letter, the model name and the Disposable / Repairable tag step
   aside (the stats say "shots left"; the Signature lock tag stays), the two buttons take two-line labels. Japanese rows already fit */
@media (max-width:720px) and (max-height:420px){
 :root[lang="en"] body.mobile-ui #wh-panel .hs-col:first-child .slot-name{display:block;white-space:normal}
 :root[lang="en"] body.mobile-ui #wh-panel .hs-col:first-child .slot-name .weapon-reference,:root[lang="en"] body.mobile-ui #wh-panel .hs-col:first-child .tag:not(.tag-unique){display:none}
 :root[lang="en"] body.mobile-ui #wh-panel .hs-col:first-child .slot-name .weapon-rarity{display:inline-block;margin-left:4px;vertical-align:1px}
 :root[lang="en"] body.mobile-ui #wh-panel .hs-col:first-child .slot-btns .btn{white-space:normal;line-height:1.1;max-width:58px}
}
/* UIUX P12-04: 667x375 survivor cards were 241px tall in a 213px area (CTA cut, descriptions cut mid-sentence). The weapon-type and mastery lines are repeated on the brief screen */
@media (max-width:720px) and (max-height:420px) and (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq,body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card .mastery-badge{display:none}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;line-clamp:4;overflow:hidden}
}
/* UIUX P12-05: at 667x375 the loadout needed 266px in a 249px row, so Deploy/Back sat on the Nightmare card and weapon descriptions were cut. Tighter cards, a fixed-height footer row, goal strip reduced to its label */
@media (max-width:720px) and (max-height:420px) and (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card{height:78px;padding:3px 5px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card canvas{height:22px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card .choice-code{display:none}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card strong{margin-top:2px;margin-bottom:1px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card>span{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;line-height:1.2}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{height:54px;padding-top:14px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .goal-strip .goal-text{display:none}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-grid{grid-template-rows:minmax(0,1fr) 44px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .btn-row{padding:0;border:0;background:none;gap:6px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .btn-row .btn{min-height:44px;height:44px;padding-top:0;padding-bottom:0}
}
/* Starter weapon choices carry longer per-character status text than the generic four-card loadout.
   Let only these cards grow to contain their copy; do not clamp or cut the flavor/status wording. */
body:not(.mobile-ui) #screen-brief .starter-choice-cards .loadout-card{height:auto;min-height:108px;box-sizing:border-box;overflow-wrap:anywhere}
body:not(.mobile-ui) #screen-brief .starter-choice-cards .loadout-card>span{display:block;white-space:normal;overflow-wrap:anywhere}
body #screen-brief .starter-flavor{min-width:0;max-width:100%;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere}
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card{height:auto;min-height:92px;box-sizing:border-box;overflow-wrap:anywhere}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card>span{display:block;white-space:normal;overflow:visible;overflow-wrap:anywhere;-webkit-line-clamp:unset;line-clamp:unset}
}
/* Give character-specific starter art a usable preview area without changing normal inventory cards. */
body:not(.mobile-ui) #screen-brief .starter-choice-cards .loadout-card canvas{height:58px}
body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card canvas{height:48px}
/* UIUX P12-05: the mastery sheet leaves the Deploy/Back footer row visible on short landscape phones (844 too) */
@media (max-height:420px) and (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]) #screen-brief #brief-mastery details[open]{bottom:56px;max-height:calc(100dvh - 64px)}
}
/* UIUX P12-06: at 667px wide the 150px portrait + max-content stats table left the middle column 188px, so the stats ran under the mastery card. Narrower portrait, tighter table, min-width:0 */
@media (max-width:720px) and (max-height:420px) and (orientation:landscape){
 body #screen-result.screen.result,body.mobile-ui #screen-result.screen.result{grid-template-columns:104px minmax(0,1fr) minmax(0,1.1fr);column-gap:12px;padding:8px 14px}
 body #screen-result .result-portrait{width:100px!important;height:142px!important}
 body #screen-result .result-stats{min-width:0;padding:5px 10px;gap:1px 10px;font-size:13px}
 body #screen-result .result-title{font-size:30px}
 body #screen-result #result-sub,body #screen-result .result-mastery,body #screen-result .wave-obstacle{min-width:0}
}
/* UIUX P12-08: co-op lobby starting-weapon cards (28-35px) and bring-along slots (38px) are the main ready-flow choices; 40px minimum on phones */
body.mobile-ui.coop-selecting #coop-shell #coop-weapons .loadout-card{min-height:40px;box-sizing:border-box}
body.mobile-ui.coop-selecting #coop-shell #coop-weapons .armory-loadout{min-height:52px;height:auto}
/* UIUX P13-05: the replays chip stays on one line on portrait phones (the step text beside it may wrap). */
@media (orientation:portrait){body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .select-footer>a{white-space:nowrap}}
/* UIUX pass 14 (10-23): P14-01 the Lookout cell pushed the night top bar past its width; labels collided and buttons wrapped */
body #hud-top{gap:4px 12px}
body #hud-top .hud-cell{flex:0 0 auto}
body #hud-top .hud-bar-cell{flex:1 1 90px;min-width:60px}
body #hud-top .hud-bar-cell .bar{min-width:36px}
body #hud-top .hud-buttons{flex:none}
body #hud-top .btn{white-space:nowrap;height:30px;min-height:30px;box-sizing:border-box}
body #hud-top .volume-control>.btn{height:30px}
body #hud-lookout{margin-right:0;gap:4px}
body #hud-lookout .hud-lookout-lane{margin-right:0;display:inline-flex}
body #hud-lookout .hud-lookout-lane>span{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body #hud-lookout .hud-lookout-lane:not(:last-child)::after{content:"/";margin:0 3px;color:#bad0d9}
/* UIUX P14-04: the mastery toggle row split "Mastery / Lv.1" and "Upgrade 0 / PT" across lines inside its narrow box; keep each phrase whole and wrap between them */
#brief-mastery .mastery-title{flex-wrap:wrap;align-items:center;column-gap:8px;row-gap:0}
#brief-mastery .mastery-title>strong,#brief-mastery .mastery-title>span{white-space:nowrap}
#brief-mastery .mastery-title::before{flex:none;margin-right:2px;font-size:12px;line-height:1;width:10px;text-align:center}
/* UIUX P14-05: Signature/Disposable tags and the slot stats line in the warehouse were 4.2-4.4:1 (small text needs 4.5) */
body #wh-panel .tag-unique{color:#2b6455}
body #wh-panel .tag-repairable{color:#74541f}
body #wh-panel .tag-disposable{color:#86405a}
body #wh-panel .hs .slot-stats{color:#c9dccf}
/* UIUX P14-06: pause menu summaries read as plain text and the language select floated centred; give them the settings buttons' look and the column's width */
body .pause-box details>summary{justify-content:space-between;gap:8px;padding:0 12px;border:1px solid #4d6f78;border-radius:6px;cursor:pointer;list-style:none}
body .pause-box details>summary::-webkit-details-marker{display:none}
body .pause-box details>summary::after{content:"";flex:none;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg) translateY(-2px);transition:transform .15s}
body .pause-box details[open]>summary::after{transform:rotate(-135deg)}
body .pause-box .ui-language{width:100%;max-width:none;min-height:40px;margin:8px 0}
/* UIUX P14-07: desktop perk cards: the pick line is an outlined 40px button, and the per-card WAVE eyebrow (it repeats the page eyebrow) is gone */
body:not(.mobile-ui) #screen-training .perk-card .perk-label{display:none}
body:not(.mobile-ui) #screen-training .perk-pick{display:flex;align-self:stretch;align-items:center;justify-content:center;box-sizing:border-box;min-height:40px;margin-top:auto;padding:0 12px;border:1px solid #c9a56a;border-radius:6px;background:#c9a56a1f;font-size:13px;font-weight:700}
/* Rel-1023: the guide lists 14 threats. At landscape-phone height a 3-column grid needs 5 rows and spills below the fold; 4 columns with smaller art needs 4. */
@media (max-height:420px) and (min-width:700px){
 body .pause-box .enemy-guide[open] .enemy-guide-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 body .pause-box .enemy-guide[open] article{gap:4px;padding:3px 4px}
 body .pause-box .enemy-guide[open] .enemy-guide-art{width:36px;height:36px;background-size:108px 72px}
 body .pause-box .enemy-guide[open] p{font-size:10px;line-height:1.3}
}
/* Rel-1023: destination cards now carry "family · loot" copy, which wraps to two lines (Ironworks). Trim the strip above the text so the desktop loadout still fits its 451px frame without scrolling. */
body:not(.mobile-ui) .option-card[data-map-type]{padding-top:29px}
body:not(.mobile-ui) .option-card[data-map-type]::before{height:24px}
body:not(.mobile-ui) .option-card[data-map-type] small{line-height:1.2;margin-top:1px}
/* Rel-1023: on phones the two-to-three line destination copy was clipped by a fixed card height; the card now grows to its text and the map strip and line heights are trimmed to pay for it. */
body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{padding:20px 6px 4px;height:auto;min-height:0;overflow:visible}
body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]::before{height:16px}
body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type] strong{line-height:1.15}
body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type] small{line-height:1.15;margin-top:1px;font-size:9.5px}
/* UIUX polish (10-23): desktop solo training CTAs are pinned to the card bottom, so a 3-line description (which overflows the zoomed card by under a pixel) cannot push its CTA below the others. */
body:not(.mobile-ui):not(.is-coop) #screen-training .perk-card{padding-bottom:58px}
body:not(.mobile-ui):not(.is-coop) #screen-training .perk-pick{position:absolute;left:10px;right:10px;bottom:10px;margin:0}
/* Clipping pass (CK 10-23 「表示が見切れてしまう」), night: */
/* the 5th storage row of a 14-item storage ran 34px past the warehouse panel on 390-460px tall phones in English: four rows per page there */
@media (max-height:460px){body.mobile-ui #wh-panel .hs-list{grid-template-rows:repeat(4,auto)}}
/* the grenade counter peeked half out from under the open warehouse panel */
body.wh-open #hud-grenade{visibility:hidden}
/* Storage already blocks firing; its inactive button must not peek below a shorter panel. */
body.wh-open .touch-fire{visibility:hidden}
/* the volume mixer opened in the narrow left column of the 667x375 pause grid (labels one letter per line, rows past the screen): it takes the whole box */
@media (max-width:900px) and (max-height:420px){body .pause-box:has(.volume-panel.is-mix:not([hidden])){grid-template-columns:minmax(0,1fr)}}
/* the first-night hint was centred with left:50% + translate, so it wrapped at half the screen and sat on the "Vault the barricade" prompt beside the player: on phones it starts right of the barricade and keeps one line */
body.mobile-ui .first-night-hint{top:84px;left:88px;max-width:min(300px,calc(100vw - 200px))}
/* Clipping pass, title: at 667x375 English survivor descriptions were cut at 4 lines while "Select & prepare" took two lines; the footer keeps one line and the description shows whole */
@media (max-width:720px) and (max-height:420px) and (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card::after{white-space:nowrap;letter-spacing:.02em}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{display:block;-webkit-line-clamp:unset;line-clamp:none;overflow:visible}
}
/* Clipping pass, perk cards at 667x375: beside an 88px picture the text column was 100px wide and the longest English skill (Sabotage) ran over Learn This Skill. Small picture beside the title, effect text across the card */
@media (orientation:landscape) and (max-height:500px) and (max-width:720px){
 /* At 667px the translated shotgun name missed the hotbar's text box by two pixels. */
 body.mobile-ui #hud-inv .slot-top{gap:0}
 /* The controls spanning all three header rows squeezed the title into a narrow column and stole the cards' description height. */
 body.mobile-ui:not(.is-coop) #screen-training .training-head .head-actions{grid-row:1}
 body.mobile-ui:not(.is-coop) #screen-training .training-head>.eyebrow{grid-column:1;grid-row:1;align-self:center}
 body.mobile-ui:not(.is-coop) #screen-training .training-head>h2{grid-column:1/-1;grid-row:2}
 body.mobile-ui:not(.is-coop) #screen-training .training-head>p:not(.eyebrow){grid-column:1/-1;grid-row:3}
 body.mobile-ui:not(.is-coop) #screen-training .perk-option .perk-card{grid-template-columns:56px minmax(0,1fr)}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card canvas{grid-row:2;width:56px;height:56px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card h3{align-self:center}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card p{grid-column:1/-1;margin-top:4px;font-size:12px;line-height:1.4}
}
/* Clipping pass, co-op lobby: desktop weapon descriptions were ellipsized ("Close-range crowd cont..."), they wrap instead */
body:not(.mobile-ui) #coop-weapons .loadout-card>span{white-space:normal;text-overflow:clip}
/* portrait: the English toolbar was 10px wider than the screen (language select cut), and the lifted selected card was cut by the list's top edge */
/* Clipping pass, night: the warehouse storage list pages six rows; English rows (a model name on its own line) are taller, and the 6th row was cut by the panel below 960px of height */
@media (max-height:960px){body:not(.mobile-ui) #wh-panel .hs-list{grid-template-rows:repeat(5,auto)}}
@media (max-height:800px){body:not(.mobile-ui) #wh-panel .hs-list{grid-template-rows:repeat(4,auto)}}
/* Warehouse comparison: inline in the paged storage list it ran 160px under the panel at 667x375 en with Swap selected. It takes its column's place
   (the hand column stays, so "Swap with this" is still one tap away) and closes with its own button (app.js renderWarehouse). */
/* Enemy guide (14 threats): laid over the pause box at the box's own height it lost its last row on desktops and most cards at 667x375.
   It takes the box for itself (in flow, so the box grows to it); on short landscape phones the cards page sideways, exactly three columns to a view. */
body .pause-box:has(>.enemy-guide[open]){display:block;columns:1;padding:10px 14px}
body .pause-box:has(>.enemy-guide[open])>:not(.enemy-guide){display:none}
body .pause-box .enemy-guide[open]{position:static;padding:0}
@media (max-height:500px){body .pause-box .enemy-guide[open] .enemy-guide-grid{gap:4px;grid-auto-flow:column;grid-template-columns:none;grid-template-rows:repeat(3,auto);grid-auto-columns:calc((100% - 8px)/3);overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:thin}
 body .pause-box .enemy-guide[open] article{scroll-snap-align:start;gap:4px;padding:3px 4px}
 body .pause-box .enemy-guide[open] .enemy-guide-art{width:36px;height:36px;background-size:108px 72px}
 body .pause-box .enemy-guide[open] p{font-size:10px;line-height:1.3}}
/* Warehouse comparison, English (clipping scan 10-24): with Swap selected the hand buttons read "Swap With This", so the hand bodies narrowed,
   names dropped under their icons and the 4th hand row went under the panel edge (11px at 1440, the whole row at 844x390); the badges in
   the comparison heading ran out of their columns beside the floated Close button. While comparing, desktop stacks the two hand buttons and
   phones give them two-line labels (both widen the body; every row keeps its text); Close sits on its own line above the heading
   (no longer floated beside it) and the heading's badges may wrap inside their column. */
/* Five starter slots must fit the same preparation screen as map and difficulty. */
body:not(.mobile-ui) #screen-brief .starter-choice-cards .loadout-card{min-height:96px;padding:5px 6px}
body:not(.mobile-ui) #screen-brief .starter-choice-cards .loadout-card canvas{height:38px}
@media (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards{grid-template-columns:repeat(5,minmax(0,1fr))}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card{height:auto;min-height:0;padding:4px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card canvas{height:34px}
}
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards{grid-template-columns:repeat(5,minmax(0,1fr))}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card{min-height:0;padding:4px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card canvas{height:34px}
}
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-grid,body.mobile-ui:not([data-mode="night"]) #screen-brief .brief-main{gap:4px}
}
body:not(.mobile-ui) #screen-brief:not([hidden]){display:flex;flex-direction:column;box-sizing:border-box}
body:not(.mobile-ui) #screen-brief .screen-head{flex:none}
body:not(.mobile-ui) #screen-brief .brief-grid{flex:1;min-height:0;height:auto}
body:not(.mobile-ui) #screen-brief .brief-main{height:auto;min-height:0;display:flex;flex-direction:column}
body:not(.mobile-ui) #screen-brief .deployment-actions{margin-top:auto}
body[data-mode="brief"] .version-label{display:none}
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .weapon-rarity{font-size:0;padding:0 4px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .weapon-rarity::before{content:attr(data-rarity);font-size:9px;line-height:1.4}
 body.mobile-ui #screen-training .training-head{display:flex;flex-wrap:wrap;gap:4px}
 body.mobile-ui #screen-training .training-head .head-actions{width:100%;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:4px}
 body.mobile-ui #screen-training .training-head .head-actions .btn{flex:none;min-width:max-content}
}
@media (orientation:portrait){
 body.mobile-ui #screen-training .training-head .head-actions{position:static;flex:0 0 100%;max-width:100%;min-width:0;box-sizing:border-box}
}
/* Leave the co-op bring-along controls clear of the longer survivor biographies. The card grows to its content (a fixed 240px
   painted the skill line over the footer, CK 10-28); the portrait is what gives way, not the text. */
/* A selected storage weapon adds its comparison; keep all five visible rows inside the night panel. */
@media(min-height:961px){body:not(.mobile-ui) #wh-panel .hs-list:has(>.slot-row.selected){grid-template-rows:repeat(5,max-content)}}

/* Keep long localized model names readable in compact headers. */
body.mobile-ui #day-panel.supply-mode #day-title{white-space:normal;text-overflow:clip;overflow:visible;line-height:1.2}
body:not(.mobile-ui).coop-selecting #coop-weapons .starter-choice-cards{grid-template-columns:repeat(5,minmax(0,1fr))}
@media(orientation:portrait){
 body.mobile-ui #screen-training .training-head .head-actions{flex-wrap:wrap!important;height:auto}
}
html[lang="en"] body .touch-actions button[data-touch="grenade"]{font-size:9px}
@media(orientation:landscape){
 body.mobile-ui.wh-open #wh-panel{left:136px;right:8px;width:auto;max-width:calc(100vw - 144px)}
 body.mobile-ui .campaign-night-progress{top:148px;max-width:230px}
}

@media(orientation:landscape) and (max-height:500px){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card canvas{height:20px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card strong{margin:2px 0;font-size:10px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-flavor{font-size:10px;line-height:1.2;margin:2px 0}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-fixed{font-size:9px;line-height:1.2;margin:1px 0}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-lower{gap:1px;margin-top:1px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .choice-heading{margin:0 0 1px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card p{font-size:12px;line-height:1.3}
 body.mobile-ui.wh-open #wh-panel{top:38px;max-height:calc(100dvh - 42px)}
}

/* Five starter choices leave less vertical room on the smallest landscape phone.
   Keep map/difficulty choices at touch size and reserve the footer row; the full
   card descriptions remain available through each option's title attribute. */
@media (max-width:720px) and (max-height:420px) and (orientation:landscape){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-lower{gap:0;margin-top:1px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .deployment-group .choice-heading{margin:0;line-height:1}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card,body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{display:flex;flex-direction:column;justify-content:center;box-sizing:border-box;height:40px;min-height:40px;padding:2px 6px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{padding-top:2px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]::before{display:none}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card strong{font-size:10px;line-height:1.1}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card small{font-size:8px;line-height:1.05;text-align:center;white-space:normal;overflow-wrap:anywhere}
}

@media(orientation:landscape) and (max-height:500px){body.mobile-ui:not([data-mode="night"]) #screen-brief .choice-heading h3{line-height:1}}

@media(orientation:landscape) and (max-height:500px){
 body.mobile-ui.wh-open .touch-pause{left:84px!important;top:38px!important}
 body.mobile-ui #wh-panel .weapon-reference{display:none}
 body.mobile-ui #wh-panel .hs .slot-name{display:block;white-space:normal}
 body.mobile-ui #wh-panel .hs .slot-name .weapon-rarity{display:inline-block;margin-left:4px}
 body.mobile-ui #wh-panel .hs .slot-row{min-height:44px}
 /* Four hand rows and their heading exceeded the panel during comparison; spare spacing gives way before text or controls. */
 body.mobile-ui #wh-panel .hs>.hs-col:first-child{gap:1px}
 body.mobile-ui #wh-panel .hs>.hs-col:first-child>.slot-row{padding-top:1px;padding-bottom:1px}
}

body:not(.mobile-ui).coop-selecting #coop-weapons .loadout-card{grid-template-columns:44px minmax(0,1fr);gap:1px 4px}
body:not(.mobile-ui).coop-selecting #coop-weapons .loadout-card canvas{width:44px;height:24px}
#coop-weapons .loadout-card strong{min-width:0;overflow-wrap:anywhere}
#coop-weapons .loadout-card strong .weapon-rarity{font-size:0;padding:0 3px;line-height:1.2}
#coop-weapons .loadout-card strong .weapon-rarity::before{content:attr(data-rarity);font-size:10px}
@media(orientation:landscape) and (max-height:500px){
 body.mobile-ui #wh-panel .hs .slot-body{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1px 3px}
 body.mobile-ui #wh-panel .hs .slot-name{grid-column:1/-1;font-size:11px}
 body.mobile-ui #wh-panel .hs .slot-stats{grid-column:1;grid-row:2;font-size:9px;white-space:normal}
 body.mobile-ui #wh-panel .hs .tag{grid-column:2;grid-row:2;font-size:10px;padding:0 2px}
 body.mobile-ui #wh-panel .hs-list{grid-template-rows:repeat(3,auto)}
}
@media(orientation:landscape) and (max-width:720px){
 body.mobile-ui #screen-result .result-armory{width:100%;font-size:9px}
 body.mobile-ui #screen-result .armory-dropped-names{font-size:9px;line-height:1.15}
 body.mobile-ui #screen-result .armory-result-icons{gap:2px}
 body.mobile-ui #screen-result .armory-dropped{margin-top:1px}
}

@media(orientation:landscape) and (max-width:720px){
 body.mobile-ui #screen-result .armory-dropped-names{display:inline}
 body.mobile-ui #screen-result .armory-dropped{display:inline}
 body.mobile-ui #screen-result .armory-result-heading{font-size:9px;line-height:1.1}
 body.mobile-ui #screen-result .armory-result-icons{margin:1px 0}
}

@media(orientation:landscape) and (max-width:720px) and (max-height:500px){
 body.mobile-ui #wh-panel .hs-list:has(>.slot-row.selected){grid-template-rows:repeat(2,auto)}

}
/* Survivor biographies and their CTA must fit the whole card at both phone orientations. */
@media(orientation:landscape) and (max-height:500px){
 body.mobile-ui:not([data-mode="night"]) #screen-brief #brief-goal{contain:none;flex:0 0 auto;min-width:0;width:auto;max-width:none}
}
@media(orientation:landscape) and (max-width:720px) and (max-height:420px){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card canvas{min-height:40px}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-text{padding:2px 7px!important}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card::after{padding:2px 7px}
}
@media(orientation:portrait){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-text{padding:4px 34px 4px 8px!important}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{font-size:11px!important;line-height:1.25!important}
}
/* Phones in a co-op lobby: the lobby panel leaves ~73px for the card text, so the biography gives way to name, stats and the Q skill (CK 10-28: the skill/HP lines left the card). */
/* English biographies run four lines on a phone in landscape: 9px of the card (Hunter, Cheerleader) overflowed under the footer, so tighten the line box and the stat gap. */
@media (orientation:landscape){html[lang=en] body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{font-size:10px!important;line-height:1.2!important}html[lang=en] body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-growth-stats{margin-top:1px}}
/* Phone title cards (10-29 browser check at 390x844 / 360x780, en and ja): the growth lines added on 10-26 made the portrait card text ~130px in a
   83-106px card; the centred column was cut at both edges, the survivor name at the top. Portrait keeps name, biography and weapon: level, HP/stat
   and the Q skill are in the card's Status popup. `safe` keeps any future overflow off the name. The Status pill keeps its 26px look but gets a
   40px touch box (transparent border); in portrait it sits on the top of the portrait art (hat, not face) instead of over the text column. */
body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-status{min-width:40px;min-height:40px;border:7px solid transparent;border-radius:20px;background-clip:padding-box;box-shadow:inset 0 0 0 1px #f1d5aa;top:0;right:0}
@media(orientation:portrait){
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-text{align-self:safe center;padding-top:2px!important;padding-bottom:2px!important}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-name{line-height:1.1}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select :is(.mastery-badge,.card-growth-stats,.card-skill){display:none}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-uniq{margin-top:2px!important;padding-top:2px!important}
 body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-status{top:0;right:auto;bottom:auto;left:0;width:78px;padding:2px 3px;font-size:10px}
}
/* Phone landscape, ja: the tune1031 mastery clause made the soldier biography five lines at 10.5px (軍人 ended in an ellipsis and its footer left the card), so ja takes the en line box and stat gap above, and four lines. */
@media(orientation:landscape){body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-desc{font-size:10px!important;line-height:1.2!important;-webkit-line-clamp:4}body.mobile-ui:not([data-mode="night"]):not(.coop-selecting) #screen-select .card-growth-stats{margin-top:1px}}
/* Loadout on a portrait phone (10-30): in English, 戻る/出撃 sat under the fold of a 390x844 phone (824..872) and a 360x780 phone also lost the
   growth row. The five ~70px starter cards wrapped long English names ("Pistol-caliber Carbine") to three or four 17px lines, and the growth
   panel kept its desktop spacing. Card names get a smaller line box and the closed growth panel loses its padding; the summary stays 44px. */
@media (orientation:portrait){
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card canvas{height:28px}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card strong{margin:3px 0 2px;font-size:11px;line-height:1.2}
 body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-flavor{margin:3px 0}
}
/* The same closed panel in a landscape phone shares the bottom grid row with 戻る/出撃: its 28px of spacing made that row 73px tall, the
   row above lost the height, and in English the difficulty cards ran under the two buttons at 844x390. */
body.mobile-ui:not([data-mode="night"]) #screen-brief #brief-mastery details:not([open]){margin-top:0;padding-top:0;padding-bottom:0}
/* Short or narrow portrait phones (360x780): in English the loadout ran 58px under the fold (Deploy 790..838). The header
   rows drop to 40px with 4px gaps, the weapon art shrinks, the locked-weapon XP lines stay on one line, and the destination
   cards lose their 16px map strip (the name and copy stay). 390x844 and landscape keep their layout. */
@media (orientation:portrait) and (max-height:800px),(orientation:portrait) and (max-width:379px){
  body.mobile-ui:not([data-mode="night"]) #screen-brief .screen-head{gap:4px}
  body.mobile-ui:not([data-mode="night"]) #screen-brief .ui-language,body.mobile-ui:not([data-mode="night"]) #screen-brief .head-actions .btn{min-height:40px}
  body.mobile-ui:not([data-mode="night"]) #screen-brief .starter-choice-cards .loadout-card canvas{height:20px}
  body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card>span{white-space:nowrap;font-size:9px;letter-spacing:-.2px}
  body.mobile-ui:not([data-mode="night"]) #screen-brief .loadout-card .choice-code{white-space:nowrap;letter-spacing:-.2px}
  body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]{padding-top:4px}
  body.mobile-ui:not([data-mode="night"]) #screen-brief .option-card[data-map-type]::before{display:none}
}

/* T-028 F3: the settings of the training screen open on click, like the day screen (one corner, one panel). */
/* T-028b (CK 11-19): training cards are compact and balanced. The card is as tall as its art, name and one effect line (it was a tall box two thirds empty with small grey text), the three sit in the middle of the space under the heading, and hover or keyboard focus lifts and lights the whole card because the whole card is the button. The WAVE eyebrow is gone from the screen (its element stays hidden so the wave label is still readable by code). Co-op keeps its own sizes: its cards carry vote marks. */
body #screen-training #training-wave{display:none}
body:not(.is-coop) #screen-training .training-head h2{margin-bottom:0}
body:not(.is-coop) #screen-training .perk-cards{flex:1 1 0;min-height:0;margin-top:0;padding:10px 6px;overflow:visible;align-content:center;align-items:stretch;grid-auto-rows:auto;grid-template-rows:none}
body:not(.is-coop) #screen-training .perk-option{display:flex;flex-direction:column;min-height:0}
body:not(.is-coop) #screen-training .perk-option .perk-card{flex:1 1 auto;display:flex;flex-direction:column;min-height:0;height:auto;padding:14px 14px 16px;gap:12px;overflow:visible;transition:transform .15s ease,filter .15s ease,box-shadow .15s ease,border-color .15s ease}
body:not(.is-coop) #screen-training .perk-card .perk-rarity{margin:0;padding:6px 10px}
body:not(.is-coop) #screen-training .perk-card .perk-rarity-word{font-size:clamp(17px,1.5vw,21px)}
body:not(.is-coop) #screen-training .perk-card .perk-rarity-stars{font-size:clamp(14px,1.2vw,17px)}
body:not(.is-coop) #screen-training .perk-card canvas{flex:none;width:100%;height:clamp(110px,24vh,190px);min-height:0;border-radius:6px;object-fit:cover}
body:not(.is-coop) #screen-training .perk-card p{flex:0 0 auto;margin:0;font-size:clamp(16px,1.35vw,20px);line-height:1.5;color:#f6f3e6;font-weight:600;text-align:center;text-wrap:balance;word-break:auto-phrase}
body:not(.is-coop) #screen-training .perk-card:hover,body:not(.is-coop) #screen-training .perk-card:focus-visible{transform:translateY(-6px);filter:brightness(1.14);border-color:#f0ce92;box-shadow:0 0 0 2px #f0ce92,0 0 26px #f0ce9266,0 14px 28px #040f18bb;outline:none}
body.reduced-motion:not(.is-coop) #screen-training .perk-card:hover,body.reduced-motion:not(.is-coop) #screen-training .perk-card:focus-visible{transform:none}
@media(prefers-reduced-motion:reduce){body:not(.is-coop) #screen-training .perk-card{transition:none}body:not(.is-coop) #screen-training .perk-card:hover,body:not(.is-coop) #screen-training .perk-card:focus-visible{transform:none}}
body.mobile-ui:not(.is-coop) #screen-training .perk-cards{display:flex;flex-direction:column;justify-content:center;gap:14px;padding:6px 2px}
body.mobile-ui:not(.is-coop) #screen-training .perk-option{flex:0 0 auto}
body.mobile-ui:not(.is-coop) #screen-training .perk-option .perk-card{flex:0 0 auto;display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-rows:auto auto;gap:10px 12px;padding:12px;align-content:start;align-items:center}
body.mobile-ui:not(.is-coop) #screen-training .perk-card .perk-rarity{grid-column:1/-1;grid-row:1;padding:5px 9px}
body.mobile-ui:not(.is-coop) #screen-training .perk-card .perk-rarity-word{font-size:17px}
body.mobile-ui:not(.is-coop) #screen-training .perk-card .perk-rarity-stars{font-size:13px}
body.mobile-ui:not(.is-coop) #screen-training .perk-card canvas{grid-column:1;grid-row:2;width:104px;height:104px}
body.mobile-ui:not(.is-coop) #screen-training .perk-card p{grid-column:2;grid-row:2;margin:0;font-size:17px;line-height:1.4;text-align:left}
@media(orientation:landscape) and (max-height:500px){
 body.mobile-ui:not(.is-coop) #screen-training .perk-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-content:center;align-items:stretch;gap:10px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-option .perk-card{display:flex;flex:1 1 auto;flex-direction:column;gap:8px;padding:10px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card .perk-rarity-word{font-size:15px}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card canvas{width:100%;height:clamp(70px,24vh,100px)}
 body.mobile-ui:not(.is-coop) #screen-training .perk-card p{font-size:15px;text-align:center;word-break:auto-phrase}
}
body.mobile-ui:not(.is-coop) #screen-training .training-head h2{padding-right:84px;font-size:20px;line-height:1.3;text-align:left}
/* One settings button and one settings panel on every screen (CK 2026-11-18 F3, D9, L4). */
.settings-btn{min-height:40px;min-width:56px;white-space:nowrap;cursor:pointer}
.settings-corner{position:absolute;top:8px;right:12px;z-index:60}
body.mobile-ui .settings-corner{top:calc(8px + env(safe-area-inset-top));right:calc(12px + env(safe-area-inset-right))}
body #screen-training .training-head .settings-training{position:absolute;right:24px;top:14px;z-index:35;margin:0}
body.mobile-ui #screen-training .training-head .settings-training{right:12px;top:calc(8px + env(safe-area-inset-top))}
body #hud-top .settings-hud{height:30px;min-height:30px}
body.mobile-ui[data-mode="day"] #day-panel .day-settings.settings-btn{min-width:44px;padding:2px}
.settings-panel{position:absolute;right:12px;top:52px;z-index:70;box-sizing:border-box;width:min(400px,calc(100% - 24px));max-height:calc(100% - 64px);overflow-y:auto;overscroll-behavior:contain;padding:12px;display:grid;gap:10px;background:linear-gradient(145deg,#2a414e,#122635);color:#e4edee;border:1px solid #8ba0a6;border-radius:10px;box-shadow:0 12px 40px #000a;font-size:14px;text-align:left}
.settings-panel[hidden]{display:none}
body.mobile-ui .settings-panel{top:calc(52px + env(safe-area-inset-top));right:calc(12px + env(safe-area-inset-right))}
.settings-panel .settings-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.settings-panel .enemy-rig-option{display:flex;flex-wrap:wrap}
.settings-panel .btn,.settings-panel .ui-language{min-height:32px;font-size:13px}
.settings-panel .ui-language{max-width:none;width:100%}
@media(pointer:coarse){.settings-panel .btn,.settings-panel .ui-language{min-height:40px}}
.settings-panel .volume-control{display:block;position:static}
.settings-panel .volume-control .volume-panel,.settings-panel .volume-control .volume-panel.is-mix{--mix-track:#3f5a66;--mix-fill:#e3b972;--mix-thumb:#f1d7a1;position:static;inset:auto;transform:none;width:auto;max-width:none;z-index:auto;display:grid;grid-template-columns:1fr;background:#15303c99;color:#dfe9e4;border:1px solid #5d7b86;border-radius:8px;box-shadow:none;padding:6px 12px}
.settings-panel .volume-control .volume-panel[hidden]{display:grid}
.settings-panel .volume-panel.is-mix .mix-mute{border-color:#7b98a0}
.settings-panel .volume-panel.is-mix .mix-mute[aria-pressed="true"]{background:#8a6a2b;border-color:#c9a45a;color:#fff}
.settings-panel .volume-panel.is-mix .mix-done{display:none}
.settings-panel{gap:6px;padding:8px}
.settings-panel .volume-panel.is-mix .mix-row{min-height:30px}
.settings-panel .volume-panel.is-mix .mix-row input[type=range]{height:30px}
.settings-panel .volume-panel.is-mix .mix-mute{min-height:30px;padding:2px 6px}
@media(pointer:coarse){.settings-panel .volume-panel.is-mix .mix-row{min-height:40px}.settings-panel .volume-panel.is-mix .mix-row input[type=range]{height:40px}.settings-panel .volume-panel.is-mix .mix-mute{min-height:40px}}
/* CK 2026-11-18 (T-032, pause at 844x390): the open panel covered half of the Resume button. While the panel is open inside the pause
   dialog the pause box steps out of sight; closing the panel (設定 again, Escape or a tap outside) brings it back. */
.pause-overlay:has(>#settings-panel:not([hidden]))>.pause-box{visibility:hidden}
/* Redo: the Records row used to share row 1 with the motion row and sat on top of it. */
/* T-028b: on a short landscape screen the one-column panel was taller than the viewport and scrolled; two columns keep it whole. */
/* The panel stays right of the Resume button's centre (pause box left column), so Resume is clickable while the mixer is open; the top row wraps instead of overlapping. */
/* Every landscape size, not only short ones: at 1440x900 the one-column panel was 12px taller than its box and scrolled (full run 2026-11-19). */
@media(orientation:landscape){.settings-panel{width:min(600px,calc(100% - 24px))}.settings-panel{grid-template-columns:minmax(0,.8fr) minmax(0,2fr);align-items:start;gap:4px 6px;padding:6px}.settings-panel>.settings-row,.settings-panel .enemy-rig-option{flex-wrap:wrap;gap:6px}.settings-panel .btn{white-space:nowrap}.settings-panel .enemy-rig-status{display:none}.settings-panel,body.mobile-ui .settings-panel{top:calc(64px + env(safe-area-inset-top))}.settings-panel>.ui-language{grid-column:1;grid-row:1}.settings-panel>.settings-row{grid-column:2;grid-row:1}.settings-panel>.volume-control{grid-column:1 / -1;grid-row:3}.settings-panel>.settings-row:nth-of-type(1){grid-row:1 / span 2}.settings-panel>.settings-row:nth-of-type(2){grid-column:1;grid-row:2}.settings-panel .volume-control .volume-panel.is-mix{grid-template-columns:1fr 1fr;gap:0 16px;padding:2px 12px}}
