/* A location owns its navigation; room controls belong only to the room. */
body .chamber:is(.city-view,.forge-open,.market-open) :is(.main-nav,.lower-nav,.footer-links,.gift-button){display:none!important}
body .chamber:is(.forge-open,.market-open) .room-title{display:none!important}
body .chamber .hero-hud .avatar{width:76px;height:76px;flex:none}
@media(max-width:1100px){body .chamber .hero-hud .avatar{width:66px;height:66px}}
@media(max-width:800px) and (orientation:portrait){body .chamber .hero-hud .avatar{width:58px;height:58px;margin-top:3px}body .chamber .hero-hud{gap:9px}}
@media(max-height:440px) and (orientation:landscape){body .chamber .hero-hud .avatar{width:48px;height:48px}}
@media(max-width:600px){body .chamber.city-view .city-place-marker small{display:none}.chamber.city-view .city-map{padding-bottom:116px}.chamber.city-view .city-return{bottom:12px;min-height:36px;display:grid;place-items:center}}

/* Select the item's level, rather than scrolling through hundreds of tiers. */
.forge-scene .forge-filter-bar{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:5px;flex:none}
.forge-scene .forge-filters{gap:6px;min-width:0;margin:0;flex:1;flex-wrap:nowrap}
.forge-scene .forge-filters button{font-size:10px;min-height:30px;padding:3px 0;white-space:nowrap}
.forge-tier{display:flex;align-items:center;gap:4px;font:11px var(--sans);white-space:nowrap;color:#e7d6b5}
.forge-tier select{min-width:48px;min-height:30px;padding:3px;background:#101a20;color:#f3dfb4;border:1px solid #9a7d4c;font:inherit}
body .chamber .forge-scene .forge-workspace .forge-shelves{container-type:size;--shelf-cols:3;--shelf-rows:1;display:grid;grid-template-columns:repeat(var(--shelf-cols),minmax(0,1fr));grid-template-rows:repeat(var(--shelf-rows),minmax(110px,1fr))!important;grid-auto-rows:unset!important;gap:6px;align-content:stretch;overflow-y:auto!important;overflow-x:hidden!important;min-height:0;padding:0}
body .forge-scene .forge-shelves .forge-stock-item{min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:0;overflow:hidden}
body .forge-scene .forge-shelves .forge-item-picture{width:min(100%,76px,max(22px,calc((100cqh - (var(--shelf-rows) - 1)*6px)/var(--shelf-rows) - 39px)));height:auto;flex:none;aspect-ratio:1;margin:0}
body .forge-scene .forge-shelves .forge-item-picture small{font-size:9px;line-height:1.1}
body .forge-scene .forge-shelves .forge-item-cost{margin:0;gap:0 3px;line-height:1.2;min-height:0}
body .forge-scene .forge-shelves .forge-price-part{font-size:10px;line-height:1.2}
body .forge-scene .forge-shelves .forge-coin{width:13px;height:13px;font-size:9px}
body .forge-scene .forge-shelves .forge-item-state{font-size:8px;line-height:1.1;margin:0}
body .forge-scene .forge-shelves .forge-item-state{display:none}
body .forge-scene .forge-shelves .forge-item-cost{flex-shrink:0}
body .forge-scene .forge-shelves .forge-item-picture{width:min(100%,76px,max(28px,calc((100cqh - (var(--shelf-rows) - 1)*6px)/var(--shelf-rows) - 30px)))}
.forge-scene .forge-cabinet-footer{display:none}
body .chamber .forge-scene .forge-workspace:not(:has(.forge-inspection:not([hidden]))){grid-template-columns:minmax(0,1fr)}
@media(min-width:801px) and (min-height:441px){body .chamber .forge-scene .forge-workspace:not(:has(.forge-inspection:not([hidden]))) .forge-shelves{--shelf-cols:5}}
body .chamber .forge-scene .forge-cabinet{--frame-crest:46px 30px;padding-top:33px;padding-inline:24px;padding-bottom:23px}
body .chamber .forge-scene .forge-inspection{padding:34px 25px 24px;--frame-crest:46px 30px}
body .forge-scene .forge-inspection-close{top:20px;right:20px;color:#ecd4a4}
@media(max-width:800px) and (orientation:portrait){body .chamber .forge-scene .forge-workspace{left:12px;right:12px;top:116px;bottom:48px}body .chamber .forge-scene .forge-cabinet{padding:16px 12px 12px}.forge-scene .forge-cabinet-heading>span{display:none}.forge-scene .forge-cabinet-heading h2{font-size:27px;margin:2px 0}.forge-scene .weapon-categories{gap:3px;padding:2px 0 6px}.forge-scene .weapon-categories button{font-size:12px;min-height:28px;padding:3px}.forge-scene .forge-return,.forge-scene .forge-city{min-height:38px;bottom:5px;padding:4px}.forge-scene .forge-city .menu-icon{display:none}}
@media(max-height:440px) and (orientation:landscape){body .chamber .forge-scene .forge-workspace{left:26%;right:2%;top:65px;bottom:34px;grid-template-columns:1fr}.forge-scene .forge-cabinet{padding:7px 12px}.forge-scene .forge-cabinet-heading{display:none}.forge-scene .weapon-categories,.forge-scene .market-categories{padding:0 0 2px;gap:3px}.forge-scene .weapon-categories button,.forge-scene .market-categories button{font-size:11px;min-height:24px}.forge-scene .forge-filter-bar{margin:0}.forge-scene .forge-filters button,.forge-tier select{min-height:24px}body .chamber .forge-scene .forge-workspace .forge-shelves{--shelf-cols:5;gap:4px}body .forge-scene .forge-shelves .forge-item-picture{width:min(100%,54px,max(18px,calc((100cqh - (var(--shelf-rows) - 1)*4px)/var(--shelf-rows) - 22px)))}body .forge-scene .forge-shelves .forge-item-state{display:none}body .forge-scene .forge-shelves .forge-price-part{font-size:8px}.forge-scene .forge-return,.forge-scene .forge-city{bottom:2px;min-height:30px;font-size:14px}.forge-scene .forge-city .menu-icon{display:none}}

/* A short selection gets a compact display, rather than an empty full shelf. */
body .chamber .forge-scene[data-stock-density=focused] .forge-cabinet{height:min(100%,560px);max-width:620px;align-self:center;justify-self:center}
body .chamber .forge-scene[data-stock-density=focused] .forge-workspace .forge-shelves{--shelf-cols:3;grid-template-rows:minmax(0,1fr)!important;gap:12px;overflow:visible!important}
body .chamber .forge-scene[data-stock-density=focused] .forge-workspace .forge-shelves[data-items="1"]{--shelf-cols:1}
body .chamber .forge-scene[data-stock-density=focused] .forge-workspace .forge-shelves[data-items="2"]{--shelf-cols:2}
body .chamber .forge-scene[data-stock-density=focused] .forge-workspace .forge-shelves[data-items="3"]{--shelf-cols:3}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-stock-item{align-self:stretch;gap:8px;padding:12px 4px}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-picture{width:min(100%,180px,max(44px,calc(100cqh - 88px)))}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-picture small{right:6px;bottom:5px;font-size:12px}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-price-part{font-size:15px;line-height:1.3}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-cost{min-height:40px;align-content:center}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-price-plus{display:none}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-coin{width:17px;height:17px;font-size:11px}
body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-state{display:block;font-size:11px;line-height:1.3}
@media(max-width:800px) and (orientation:portrait){
 body .chamber .forge-scene[data-stock-density=focused] .forge-cabinet{height:min(100%,520px)}
 body .chamber .forge-scene[data-stock-density=focused] .forge-workspace .forge-shelves{gap:8px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-stock-item{padding:8px 0;gap:6px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-price-part{font-size:12px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-cost{min-height:32px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-state{font-size:10px}
}
@media(max-height:440px) and (orientation:landscape){
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-stock-item{padding:4px 0;gap:3px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-picture{width:min(100%,110px,max(32px,calc(100cqh - 48px)))}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-price-part{font-size:10px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-cost{min-height:26px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-item-state{font-size:9px}
 body .chamber .forge-scene[data-stock-density=focused] .forge-shelves .forge-coin{width:12px;height:12px;font-size:8px}
}

/* Compact result windows leave the battlefield visible around their frame. */
@media(max-width:800px) and (orientation:portrait){
 .forge-scene .weapon-categories,.forge-scene .market-categories{flex-wrap:nowrap;gap:2px}
 .forge-scene .weapon-categories button,.forge-scene .market-categories button{font-size:10.5px;padding:2px;white-space:nowrap}
 body .forge-scene .forge-shelves .forge-item-state{display:none}
 body .forge-scene .forge-shelves .forge-item-picture{width:min(100%,76px,max(28px,calc((100cqh - (var(--shelf-rows) - 1)*6px)/var(--shelf-rows) - 28px)))}
 body .forge-scene .forge-shelves .forge-item-picture small{right:2px;bottom:1px;font-size:8px}
 body .forge-scene .forge-shelves .forge-item-cost.mixed{flex-direction:column;gap:1px;margin:0}
 body .forge-scene .forge-shelves .forge-price-plus{display:none}
}
@media(max-height:440px) and (orientation:landscape){body .forge-scene .forge-shelves .forge-item-picture{width:min(100%,54px,max(28px,calc((100cqh - (var(--shelf-rows) - 1)*4px)/var(--shelf-rows) - 22px)))}body .forge-scene .forge-shelves .forge-item-picture small{right:2px;bottom:1px;font-size:8px}body .forge-scene .forge-shelves .forge-item-cost.mixed{flex-direction:row}.forge-scene .forge-shelves .forge-price-plus{display:none}}
body dialog.result-dialog[open]{width:min(420px,calc(100vw - 24px));height:fit-content;min-height:0;max-height:calc(100dvh - 24px);padding:27px 28px 24px;gap:4px;--frame-corner:40px;--frame-rail:27px}
body .result-dialog .result-crest{display:none}
body dialog.result-dialog[open]{padding-top:43px;--frame-crest:50px 35px}
body .result-dialog .result-subtitle,body .result-dialog .result-note{display:none}
body .result-dialog h2{font-size:34px;line-height:1.1;margin:2px 0}
body .result-dialog .result-crest{width:25px;height:25px;margin:0 auto}
body .result-dialog .damage-summary{padding:7px 0;font-size:13px}
body .result-dialog .damage-summary strong{font-size:23px}
body .result-dialog .damage-summary small{font-size:8px}
body .result-dialog .victory-loot{margin:5px 0;padding-bottom:5px;gap:6px 16px}
body .result-dialog .victory-loot strong{font-size:20px}
body .result-dialog .reward-item strong{font-size:14px}
body .result-dialog .reward-icon{width:28px;height:28px;font-size:18px}
body .result-dialog .victory-materials>small{display:none}
body .result-dialog .result-xp{font-size:11px}
body .result-dialog .claim-button{min-height:40px;font-size:19px;margin:7px 0 0}
body .result-dialog .reward-quest-link{display:none}
body.bounded-arena .lobby-layout>.duel-banner{flex:0 0 auto;height:fit-content;max-height:100%;width:min(440px,100%);align-self:center;padding:30px 28px 26px;gap:6px;min-height:0}
body.bounded-arena .lobby-layout>.duel-banner{padding-top:42px;--frame-crest:50px 35px}
body.bounded-arena .duel-banner :is(#opponent-detail,.duel-hint,.energy-cost-note,#opponent-kicker){display:none}
body.bounded-arena .duel-banner .opponent-crest{width:62px;margin:6px 0 8px!important}
body.bounded-arena .duel-banner .portrait.opponent{width:62px;height:62px}
body.bounded-arena .duel-banner #opponent-name{font-size:27px;margin:2px 0!important}
body.bounded-arena .duel-banner #challenge{min-height:44px;font-size:22px;width:100%}
body.bounded-arena .duel-banner #match-stage{font-size:10px!important;line-height:1.3!important;margin-top:3px!important}
body.bounded-arena .duel-banner #match-stage{display:none}
body.bounded-arena .duel-banner .mode-tabs{margin-bottom:6px!important}
body.bounded-arena .duel-banner .mode-tabs button{font-size:18px}
body.bounded-arena .duel-banner .energy-inline-action,body.bounded-arena .duel-banner #reroll{min-height:34px;font-size:12px}
body.bounded-arena .duel-banner .energy-inline-action{min-height:28px;font-size:12px}
body.bounded-arena .battle-result{background:#050b12a6;backdrop-filter:blur(3px);padding:12px}
.battle-result-window{position:relative;width:min(400px,100%);box-sizing:border-box;padding:40px 32px 32px;text-align:center;color:#f5e4bf}
body.bounded-arena .battle-result-window h2{font-size:clamp(30px,7vw,44px);line-height:1.1;margin:7px 0 12px}
body.bounded-arena .battle-result-window p{font-size:13px;line-height:1.5;margin:0 0 18px}
body.bounded-arena .battle-result-window .gold-button{min-width:0;width:100%;min-height:44px;font-size:20px;margin:0}
@media(max-width:600px){body.bounded-arena .lobby-layout>.folio-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 8px}body.bounded-arena .lobby-layout>.folio-tabs button{font-size:15px;min-height:34px;padding:5px 2px}.bounded-arena .arena-heading{display:none}body.bounded-arena .lobby{padding-top:5px}body.bounded-arena .portrait.own{width:48px;height:48px}body.bounded-arena .lobby-layout>.duel-banner{margin-top:9px;padding:28px 25px 24px}body dialog.result-dialog[open]{padding:25px 24px 20px}}
@media(max-height:440px){body dialog.result-dialog[open]{width:min(550px,calc(100vw - 20px));padding:21px 26px 18px;display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:5px 18px}body .result-dialog :is(.result-crest,.result-subtitle,.result-xp){display:none}body .result-dialog>.eyebrow{grid-column:1/-1}body .result-dialog h2{font-size:28px}body .result-dialog .damage-summary{grid-column:1;grid-row:3/5;padding:4px 0}body .result-dialog .victory-loot{grid-column:2;grid-row:2/4;margin:0}body .result-dialog .victory-materials{grid-column:2;grid-row:4;margin:0}body .result-dialog .claim-button{grid-column:1/-1;margin:3px 0 0}body.bounded-arena .lobby-layout>.duel-banner{padding:18px 26px 16px;display:grid;grid-template-columns:62px 1fr;gap:3px 12px}body.bounded-arena .duel-banner .mode-tabs{grid-column:1/-1}body.bounded-arena .duel-banner .opponent-crest{grid-row:2/4;margin:0!important}body.bounded-arena .duel-banner #opponent-name{grid-column:2;font-size:21px}body.bounded-arena .duel-banner #opponent-stats{grid-column:2;font-size:9px}body.bounded-arena .duel-banner #challenge{grid-column:1/-1;min-height:36px;font-size:18px}body.bounded-arena .duel-banner .energy-inline-action,body.bounded-arena .duel-banner #reroll{min-height:24px;padding:2px}body.bounded-arena .duel-banner #match-stage{display:none}.battle-result-window{padding:26px 30px 24px}body.bounded-arena .battle-result-window p{margin-bottom:12px}}
@media(max-width:800px) and (orientation:portrait){body .chamber .forge-scene .forge-cabinet{padding:32px 22px 22px}body.bounded-arena .lobby-layout>.duel-banner{padding-top:40px}body dialog.result-dialog[open]{padding-top:41px}}
@media(max-width:360px) and (orientation:portrait){body .chamber .forge-scene .forge-cabinet{padding-inline:20px}body .forge-scene .forge-shelves .forge-item-cost.mixed{flex-direction:row;gap:1px 3px}body .forge-scene .forge-shelves .mixed .forge-price-part{font-size:8px;gap:2px}body .forge-scene .forge-shelves .mixed .forge-coin{width:10px;height:10px;font-size:7px}.forge-scene .forge-filters{gap:4px}.forge-scene .forge-filters button{font-size:9px}}
@media(max-height:440px) and (orientation:landscape){body .chamber .forge-scene .forge-cabinet{padding:23px 22px 20px;--frame-crest:36px 24px;--frame-corner:26px;--frame-rail:18px}body .chamber .forge-scene .forge-inspection{padding:23px 24px 18px;--frame-crest:36px 24px}body.bounded-arena .lobby-layout>.duel-banner{padding:28px 26px 22px;--frame-crest:40px 28px;grid-template-rows:28px 28px 22px 36px 24px}body dialog.result-dialog[open]{padding-top:32px;--frame-crest:40px 28px}}
@media(max-height:440px) and (orientation:landscape){body .forge-scene .forge-shelves .mixed .forge-price-part{font-size:7.5px;gap:1px}body .forge-scene .forge-shelves .mixed .forge-coin{width:9px;height:9px;font-size:7px}body.bounded-arena .duel-banner .energy-inline-action{min-height:22px;padding:2px}}
@media(max-height:440px) and (orientation:landscape){
 body .forge-scene .forge-shelves .forge-stock-item{gap:1px}
 body .forge-scene .forge-shelves .forge-coin{width:10px;height:10px;font-size:7px}
 body .forge-scene .forge-shelves .forge-price-part{line-height:10px}
 body .chamber .forge-scene .forge-city{top:auto;left:auto;right:12px;bottom:2px;width:auto;height:30px;min-height:30px;display:flex;align-items:center}
}
@media(max-height:440px) and (orientation:landscape){
 body .chamber .forge-scene .forge-inspection{display:grid;grid-template-columns:minmax(0,1fr) 130px;grid-template-rows:12px minmax(0,1fr) auto;gap:5px 12px}
 body .forge-scene .forge-inspection-quality{grid-column:1/-1;font-size:8px;margin:0 25px 0 0}
 body .forge-scene .forge-inspection-identity{grid-column:1;grid-row:2;min-height:0;gap:7px;align-self:start}
 body .forge-scene .forge-inspection h3{font-size:19px}.forge-scene .forge-inspection-art{width:42px!important;height:42px!important}
 body .forge-scene .inspection-panels{display:block!important;grid-column:1;grid-row:3;min-height:0;align-self:end}
 body .forge-scene .inspection-panel{display:block;height:auto}
 body .forge-scene .inspection-panel:nth-child(2),body .forge-scene .forge-technique,body .forge-scene .forge-technique-link{display:none!important}
 body .forge-scene .forge-weapon-stat{display:flex!important;flex-wrap:wrap;padding:0;margin:0;gap:5px 9px}.forge-scene .forge-weapon-stat>div{display:flex;align-items:baseline;gap:5px}.forge-scene .forge-weapon-stat dt{font-size:10px}.forge-scene .forge-weapon-stat dd{font-size:18px}
 body .forge-scene .inspection-checkout{grid-column:2;grid-row:2/4;gap:4px;margin:0;align-self:center}.forge-scene .forge-buy{min-height:32px;padding:4px;font-size:15px}.forge-scene .forge-buy-price{font-size:11px}.forge-scene .forge-goal-button{min-height:24px;padding:3px;font-size:10px}.forge-scene .forge-bag-link{font-size:11px}.forge-scene .forge-buy-note{display:none}
}
/* Reset every placement from the previous landscape layout as a single grid. */
@media(max-height:440px) and (orientation:landscape){
 body.bounded-arena .lobby-layout>.duel-banner{display:grid;grid-template-columns:140px minmax(0,1fr);grid-template-rows:24px 24px 12px 34px 22px;grid-template-areas:'modes modes' 'portrait name' 'portrait stats' 'attack attack' 'energy reroll';gap:3px 10px;padding:28px 26px 24px!important;max-height:none}
 body.bounded-arena .duel-banner .mode-tabs{grid-area:modes;margin:0!important;gap:20px}body.bounded-arena .duel-banner .mode-tabs button{min-height:24px;padding:2px;font-size:15px}
 body.bounded-arena .duel-banner .opponent-crest{grid-area:portrait;align-self:center;justify-self:center;width:40px;height:40px;margin:0!important}
 body.bounded-arena .duel-banner .portrait.opponent{width:40px;height:40px}.bounded-arena .duel-banner .opponent-level{width:20px;height:20px;font-size:11px;bottom:-3px;right:-2px}
 body.bounded-arena .duel-banner #opponent-name{grid-area:name;font-size:19px;line-height:1.1;margin:0!important;align-self:center}
 body.bounded-arena .duel-banner #opponent-stats{grid-area:stats;font-size:8px;line-height:1.1;margin:0}
 body.bounded-arena .duel-banner #challenge{grid-area:attack;min-height:34px;height:34px;padding:3px;margin:0;font-size:18px}
 body.bounded-arena .duel-banner .energy-inline-action{grid-area:energy;min-height:22px;padding:2px;margin:0;font-size:10px;line-height:1.1;white-space:nowrap}
 body.bounded-arena .duel-banner #reroll{grid-area:reroll;min-height:22px;padding:2px;margin:0;font-size:10px;line-height:1.1;white-space:nowrap}
}

/* A long panel scrolls below navigation instead of centring over the wallet. */
body.bounded-arena .lobby-layout{justify-content:flex-start;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
