/* Device layout: scene geometry stays independent of browser / VK chrome. */
html{height:100%;scrollbar-gutter:auto}
body{max-width:100%;overscroll-behavior:none}
body :is(button,a,input,select,textarea){touch-action:manipulation}
body :is(dialog,.folio-panel,.page-pane){min-width:0;max-width:100%}
body dialog{max-height:calc(100dvh - 16px);max-width:calc(100vw - 16px)}
body :is(.hub-header,.world-hud,.campaign-header,.arena-header,.tavern-header){padding-top:max(8px,env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
body :is(.hub-nav,.world-nav,.folio-tabs){min-width:0;flex-wrap:wrap;white-space:normal;overflow-x:visible}
body :is(.hub-nav,.world-nav,.folio-tabs) :is(a,button){overflow-wrap:anywhere}
.chamber .room-world .chest-hotspot{display:none}
.chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .mobile-chest{display:block;top:34%;right:20px;bottom:auto;z-index:5}
.chamber .hero-caption{overflow-wrap:normal!important}

/* Higher specificity than companion CSS, which is loaded by battle modules. */
body .responsive-combat :is(.combatant,.fighter){height:var(--combat-height)!important;width:calc(var(--combat-height)*2/3)!important;aspect-ratio:2/3;min-height:0!important;max-height:none!important;bottom:var(--combat-bottom)!important;transform:translateX(-50%)}
body .responsive-combat :is(.hero-combatant,.side-left,.fighter-hero){left:var(--combat-left)!important;right:auto!important}
body .responsive-combat :is(.enemy-combatant,.side-right,.fighter-enemy){left:var(--combat-right)!important;right:auto!important}
body .responsive-combat :is(.damage-number,.hit-number){font-size:var(--combat-number)!important;white-space:normal;max-width:160%;line-height:1.1}
body .responsive-combat .damage-number.critical{font-size:calc(var(--combat-number)*1.2)!important}
#campaign-root.in-battle{height:100dvh;display:flex;flex-direction:column;overflow:hidden}
#campaign-root.in-battle .campaign-header{flex:none;min-width:0}
#campaign-root.in-battle .campaign-battle{position:relative;flex:1;min-height:0;height:auto}
#campaign-root.in-battle .battle-health{top:70px;left:5%;right:5%;gap:12%;width:auto}
#campaign-root.in-battle .battle-heading{padding-top:8px}
#campaign-root.in-battle .battle-vs{top:105px}
#campaign-root.in-battle .battle-status{bottom:max(15px,env(safe-area-inset-bottom))}
#campaign-root.in-battle .battle-status small{display:none}
.world-weapons .collection-ledger{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px;align-content:start;overflow:hidden}
.world-weapons .weapon-rule{display:block;min-width:0;padding:4px 0}
.world-weapons .weapon-rule>.trophy-emblem{display:none}
.world-weapons .weapon-rule h2{font-size:22px;margin:3px 0}
.bounded-world .world-weapons .weapon-rule p{font-size:13px;line-height:1.3;margin:3px 0}
.world-weapons .collection-ledger>:is(.fine-print,.world-button){grid-column:1/-1;margin:0}
.bounded-world .world-weapons .fine-print{font-size:11px;line-height:1.3}
.bounded-hub .player-ledger{overflow-y:auto;min-height:0;overscroll-behavior:contain}
.bounded-arena .duel-banner{flex-direction:column}

@media(max-width:800px) and (orientation:portrait){
 .chamber .top-hud{inset:10px 10px auto;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:8px;height:96px}
 .chamber .hero-hud{gap:7px;min-width:0;align-items:start}
 .chamber .avatar{width:40px;height:40px;flex:none;margin-top:8px}
 .chamber .hero-vitals{width:auto;flex:1;min-width:0}
 .chamber .hero-vitals-info>strong{font-size:16px;line-height:1.15}
 .chamber .resource-bar{height:17px}.chamber .resource-bar span{font-size:10px;line-height:16px}
 .chamber .wallet{gap:6px;justify-content:end;align-items:start;padding-top:3px;min-width:0}
 .chamber .currency{gap:3px;min-width:0}.chamber .currency .coin{width:16px;height:16px;font-size:10px;flex:none}
 .chamber .currency strong{font-size:clamp(12px,3.8vw,22px);line-height:1.3;letter-spacing:-.5px}
 .chamber .currency small{font-size:8px}.chamber .utilities{position:absolute;right:0;top:58px;gap:2px;padding:0;margin:0}
 .chamber .utility{width:34px;height:34px}.chamber .utility svg{width:18px;height:18px}
 .chamber .room-title{top:79px;left:12px;transform:none;max-width:calc(100% - 160px);text-align:left}
 .chamber .room-title>span{display:none}.chamber .room-title h1{font-size:21px;margin:0;line-height:1.1}
 .chamber .main-nav{top:117px;left:8px;right:8px;bottom:auto;max-height:none;height:64px;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:2px}
 .chamber .main-nav .menu-button{min-width:0;min-height:60px;gap:2px;justify-content:center}
 .chamber .main-nav .menu-icon{width:42px;height:42px}.chamber .main-nav .menu-button>span{font-size:12px}
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button{top:191px;right:76px;min-height:60px;width:70px}
 .chamber .gift-button .menu-icon{width:39px;height:39px}.chamber .gift-button>span{font-size:12px}.chamber .gift-button .gift-state{font-size:8px}
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .mobile-chest{top:191px;right:12px;width:60px;height:60px;padding:3px}
 .chamber .mobile-chest svg{width:32px;height:32px}.chamber .mobile-chest span{font-size:12px;margin-top:2px}
 .chamber .lower-nav{left:8px;right:8px;bottom:max(36px,calc(env(safe-area-inset-bottom) + 30px));transform:none;width:auto;gap:0;display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
 .chamber .lower-nav .menu-button{min-width:0;min-height:62px;justify-content:center;gap:3px}.chamber .lower-nav .menu-icon{width:40px;height:40px}.chamber .lower-nav .menu-button>span{font-size:11px;letter-spacing:-.25px}
 .chamber .footer-links{left:8px;right:8px;bottom:max(5px,env(safe-area-inset-bottom));justify-content:space-between;gap:4px;font-size:10px}
 .chamber .room-quest-tracker{display:none}.chamber .room-trophy{right:auto;left:20px;top:195px;max-width:45px;max-height:50px}
 .chamber.room-party-ready .hero-caption{bottom:-29px}.chamber.room-party-ready .hero-caption strong{font-size:17px}.chamber.room-party-ready .hero-caption span{display:none}
 #campaign-root .campaign-header{height:90px;min-height:90px;display:grid;grid-template-columns:32px minmax(0,1fr) auto;gap:3px 8px;padding:7px 12px}
 #campaign-root .identity{grid-column:2;min-width:0}.campaign-header .identity strong{max-width:none;font-size:17px;white-space:normal}
 #campaign-root .wallet{grid-column:1/-1;justify-content:center;gap:8px;font-size:14px}
 #campaign-root.in-battle .battle-health{top:67px}.battle-health .vitals strong{font-size:18px;line-height:1.15}
 #campaign-root.in-battle .battle-status p{font-size:12px}.battle-companion>span{font-size:11px}
 body .bounded-world .guild-combatant-art{height:min(34vw,calc(55dvh - 150px))}
}

@media(max-height:440px) and (orientation:landscape){
 .chamber .top-hud{inset:6px 12px auto;gap:12px;height:54px}
 .chamber .hero-hud{gap:6px}.chamber .avatar{width:38px;height:38px}.chamber .hero-vitals{width:105px}.chamber .hero-vitals-info>strong{font-size:15px}
 .chamber .resource-bar{height:13px}.chamber .resource-bar span{font-size:9px;line-height:12px}.chamber .wallet{gap:8px;padding-top:2px}.chamber .currency strong{font-size:16px}.chamber .currency small{font-size:8px}.chamber .coin{width:17px;height:17px;font-size:11px}
 .chamber .utilities{position:absolute;top:0;right:0;gap:0;padding:0}.chamber .utility{width:30px;height:30px}.chamber .utility svg{width:16px;height:16px}
 .chamber .room-title{left:50%;top:62px}.chamber .room-title h1{font-size:19px;margin:0}.chamber .room-title>span{display:none}
 .chamber .main-nav{left:8px;top:68px;bottom:30px;width:58px;gap:0;max-height:none}.chamber .main-nav .menu-button{min-height:0;gap:0}.chamber .main-nav .menu-icon{width:28px;height:28px}.chamber .main-nav .menu-button>span{font-size:10px}
 .chamber .lower-nav{left:82px;right:72px;bottom:5px;transform:none;width:auto;display:flex;gap:3px;justify-content:space-between}.chamber .lower-nav .menu-icon{width:29px;height:29px}.chamber .lower-nav .menu-button{min-width:40px}.chamber .lower-nav .menu-button>span{font-size:10px}
 .chamber .footer-links,.chamber .room-quest-tracker{display:none}
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button{top:70px;right:10px}.chamber .gift-button .menu-icon{width:32px;height:32px}.chamber .gift-button>span{font-size:11px}.chamber .gift-button .gift-state{font-size:8px}
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .mobile-chest{right:12px;top:155px;padding:3px}.chamber .mobile-chest span{font-size:11px}
 .chamber .hero-stage{height:calc(100% - 125px);bottom:60px}.chamber.room-party-ready .hero-caption{bottom:-20px}.chamber.room-party-ready .hero-caption strong{font-size:13px}.chamber .hero-caption span{display:none}
 .chamber .room-trophy{display:none}
 #campaign-root.in-battle .campaign-header{height:52px;min-height:52px;padding-block:5px;gap:10px}.campaign-header .wallet{font-size:13px;gap:6px}.campaign-header .identity strong{font-size:15px}.campaign-header .identity small,.campaign-header .journal-link{display:none}
 #campaign-root.in-battle .battle-heading{display:block;padding:0}.battle-heading h1{font-size:21px!important;line-height:1.1;margin:2px}.battle-heading>span{display:none}
 #campaign-root.in-battle .battle-health{top:29px;left:6%;right:6%}.battle-health .vitals strong{font-size:14px}.battle-health .vitals small{display:none}.battle-health .health-track{height:17px}.battle-health .health-track span{font-size:10px;line-height:16px}
 #campaign-root.in-battle .battle-status{bottom:5px}.battle-status .crossed-blades,.battle-status p{display:none}.battle-status strong{font-size:17px!important}
 /* Short landscape canvases use columns, retaining actions in the viewport. */
 body.bounded-hub .hub-header{min-height:38px;height:38px;padding:4px 12px;gap:10px;font-size:14px}
 body.bounded-hub .hub-header .hub-brand{font-size:19px}.bounded-hub .hub-header strong{font-size:14px}
 body.bounded-hub .hub-nav{min-height:32px;padding:2px 12px;gap:4px 18px}.bounded-hub .hub-nav a{font-size:14px;min-height:28px;display:flex;align-items:center}
 body.bounded-hub .hub-heading{margin:3px 0}.bounded-hub .hub-heading h1{font-size:22px;line-height:1.1;margin:2px}.bounded-hub .hub-heading>p,.bounded-hub .hub-heading>span{display:none}
 body.bounded-hub #hub-content{padding-bottom:6px}
 body.bounded-hub .bag-tabs{margin:2px 0;padding:0}.bounded-hub .bag-tabs button{font-size:14px;min-height:28px;padding:3px 8px}
 body.bounded-hub .bag-filters{display:flex;gap:4px 8px;margin-bottom:4px;flex-wrap:wrap}
 body.bounded-hub .bag-filters label{display:flex;gap:4px;align-items:center;flex:1;font-size:10px}
 body.bounded-hub .bag-filters label:has([name=query]){min-width:110px}.bounded-hub .bag-filters label:has([name=query]) input{width:100%;min-width:0}
 body.bounded-hub .bag-filters :is(select,input:not([type=checkbox])){min-height:28px;height:28px;padding:2px 4px;font-size:11px}
 body.bounded-hub .bag-filters .check{flex:none;min-height:24px}
 body.bounded-hub .event-scene{grid-template-columns:30% minmax(0,1fr);gap:12px}.bounded-hub .event-conversation{padding:4px 0;gap:5px}
 body.bounded-hub .event-conversation h2{font-size:22px}.bounded-hub .event-conversation blockquote{font-size:14px}.bounded-hub .event-steps li{font-size:13px;padding:3px 0}
 body.bounded-hub .player-search{margin:2px 0}.bounded-hub .player-row{padding:4px 0;gap:6px}.bounded-hub .player-row strong{font-size:17px}.bounded-hub .player-actions{gap:4px}.bounded-hub .player-actions button{font-size:12px;padding:4px 8px}
 body.bounded-hub #preferences{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px 12px;align-content:start}
 body.bounded-hub #preferences>label{min-width:0;gap:2px;margin:0;font-size:12px}.bounded-hub #preferences .muted{display:none}
 body.bounded-hub #preferences input:not([type=checkbox]),.bounded-hub #preferences select{min-height:29px;padding:4px;font-size:12px;width:100%}
 body.bounded-hub #preferences button{min-height:32px;font-size:14px;padding:4px}.bounded-hub .settings-layout>.folio-tabs{margin-bottom:4px}
 body.bounded-world .world-hud{min-height:48px;height:48px;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:1fr 1fr;padding:3px 12px;gap:0 8px;font-size:13px}
 body.bounded-world .world-hud>a:nth-child(2){font-size:14px}.bounded-world .world-hud>span{font-size:13px}
 body.bounded-world .world-nav{grid-template-columns:repeat(7,minmax(0,1fr));gap:4px;padding:3px 8px}.bounded-world .world-nav a{font-size:12px;min-height:32px;line-height:1.05}
 body.bounded-world .world-heading{margin:3px 0}.bounded-world .world-heading h1{font-size:22px!important;margin:2px 0!important}.bounded-world .world-heading>p{display:none}
 body.bounded-world .world-pets .companions-layout{grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);grid-template-rows:1fr;gap:12px}
 body.bounded-world .world-pets .companion-stage{max-height:none;height:100%;width:100%;margin:0;align-self:stretch}
 body.bounded-world .world-pets .companion-training{min-width:0;align-self:center}.bounded-world .world-pets .companion-hint{display:none}
 body.bounded-world .world-pets .companion-training-actions{padding:4px 0}.bounded-world .world-pets .companion-training>.world-button{min-height:28px;padding:3px;font-size:14px}
 body.bounded-world .world-pets .companion-training h2{font-size:20px}.bounded-world .world-pets .companion-benefit{font-size:11px;margin:3px 0}
 body.bounded-world .world-pets .companion-choices button{min-height:30px}.bounded-world .world-pets .companion-choices strong{font-size:12px}
 body.bounded-world .world-parchment{padding:5px 10px}.bounded-world .empty-collection{padding:5px}.bounded-world .empty-collection h2{font-size:21px}.bounded-world .empty-collection p{font-size:14px}
 body.bounded-world .world-weapons .collection-ledger{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px 12px}.bounded-world .world-weapons .weapon-rule{padding:0}.bounded-world .world-weapons .weapon-rule h2{font-size:18px}.bounded-world .world-weapons .weapon-rule p{font-size:11px}.bounded-world .world-weapons .fine-print{display:none}
 body.bounded-world .world-trophies .trophy-gallery{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);grid-template-rows:minmax(0,1fr);gap:12px}
 body.bounded-world .world-trophies .trophy-showcase{grid-template-columns:40% minmax(0,1fr);gap:4px}.bounded-world .world-trophies .trophy-showcase>.world-button{grid-column:1/-1;min-height:30px;padding:3px;font-size:13px}
 body.bounded-world .world-trophies .trophy-collection{min-height:0;display:grid;grid-template-rows:repeat(5,minmax(0,1fr))}.bounded-world .world-trophies .trophy-choice{min-height:0;height:100%;grid-template-columns:30px minmax(0,1fr) 12px;padding:2px;gap:5px}.bounded-world .world-trophies .trophy-choice strong{font-size:14px}.bounded-world .world-trophies .trophy-choice small{display:none}.bounded-world .world-trophies .trophy-thumbnail{max-height:100%;height:100%}
 body.bounded-world .world-trophies .trophy-titles{margin:3px 0;padding:3px 0}.bounded-world .world-trophies .trophy-titles p{display:none}
 body.bounded-arena .arena-header{height:52px;min-height:52px;grid-template-columns:26px minmax(90px,1fr) auto;grid-template-rows:1fr;padding:4px 12px;gap:8px}
 body.bounded-arena .arena-header .arena-wallet{grid-column:3;grid-row:1;width:auto;font-size:11px}.bounded-arena .arena-header .arena-wallet b{font-size:11px}.bounded-arena .arena-header .portrait{width:32px;height:32px}.bounded-arena .arena-header .identity strong{font-size:15px}.bounded-arena .arena-header .identity small{display:none}
 body.bounded-arena .lobby{inset:54px 0 0;padding-bottom:5px}.bounded-arena .lobby-footer{display:none}.bounded-arena .lobby-layout>.folio-tabs{gap:2px 10px;margin:0}.bounded-arena .lobby-layout>.folio-tabs button{font-size:14px;min-height:30px;padding:3px}
 body.bounded-arena .duel-banner{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:32px minmax(0,1fr);gap:4px 12px;padding:5px 12px!important}
 body.bounded-arena .duel-banner .mode-tabs{grid-column:1/-1}.bounded-arena .duel-banner .mode-tabs button{min-height:30px;font-size:15px;padding:4px}
 body.bounded-arena .duel-banner .opponent-crest{margin:0;align-self:center}.bounded-arena .duel-banner .opponent-crest .portrait{width:38px;height:38px}
 body.bounded-arena .duel-banner #opponent-kicker,.bounded-arena .duel-banner .duel-hint,.bounded-arena .duel-banner .match-stage:empty{display:none}
 body.bounded-arena .duel-banner #opponent-name{font-size:19px;margin:3px}.bounded-arena .duel-banner #opponent-detail{font-size:11px;margin:0;line-height:1.3}
 body.bounded-arena .duel-banner #challenge{min-height:36px;font-size:18px;margin:0;width:100%}.bounded-arena .duel-banner .energy-cost-note{font-size:11px;line-height:1.2}
 body.bounded-arena .duel-banner>:is(.viewport-page-body,.viewport-page-footer){min-height:0;gap:4px;margin:0;justify-content:center;align-items:center;padding:0}
 body.bounded-journal .journal-header{height:42px;min-height:42px;padding:4px 12px}.bounded-journal .journal-layout{display:grid;grid-template-columns:130px minmax(0,1fr);gap:10px;padding:0 10px 5px}
 body.bounded-journal .journal-index{height:auto}.bounded-journal .quest-navigation{display:flex;flex-direction:column;gap:5px}.bounded-journal .quest-navigation select{min-height:32px;font-size:14px;width:100%}
 body.bounded-journal .quest-letter{padding:8px 12px;gap:4px}.bounded-journal .letter-heading h2{font-size:24px;margin:3px 0}.bounded-journal .quest-story{font-size:12px;line-height:1.3}.bounded-journal .quest-giver{font-size:11px}.bounded-journal .quest-objectives strong{font-size:14px}.bounded-journal .quest-objectives li{padding:2px 0}.bounded-journal .quest-objectives small{font-size:10px}.bounded-journal .quest-gold-note{display:none}.bounded-journal .quest-letter h3{font-size:10px}.bounded-journal .letter-button{font-size:14px;min-height:30px;padding:4px 8px}.bounded-journal .reward-line b{font-size:14px}.bounded-journal .quest-actions{padding:2px 0}
 body.bounded-yard #yard{padding:5px 12px}.bounded-yard .yard-heading{margin:3px 0}.bounded-yard .yard-heading h1{font-size:22px;margin:2px}.bounded-yard .yard-heading p,.bounded-yard .training-note{display:none}
 body.bounded-yard .loadout-strip{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:3px 0}.bounded-yard .loadout-slot{display:block;padding:4px 0}.bounded-yard .loadout-slot h2{font-size:17px}.bounded-yard .loadout-slot small{font-size:10px}.bounded-yard .loadout-gear{height:30px;margin:3px 0}.bounded-yard .loadout-gear .gear-art{height:30px;width:24px}.bounded-yard .loadout-slot button{min-height:28px;font-size:12px;padding:3px 6px}
 body.bounded-yard .training-controls{padding-top:4px;gap:6px}.bounded-yard .training-controls label{font-size:12px}.bounded-yard .training-controls select{min-height:28px;font-size:12px;padding:3px}.bounded-yard .training-controls button{min-height:30px;font-size:13px;padding:4px 8px}
 .character-sheet .statistics-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 16px;align-content:start}.character-sheet .character-identity{grid-column:1;grid-row:1}.character-sheet .character-experience{grid-column:1;grid-row:2}.character-sheet .character-section-link{grid-column:1;grid-row:3;display:flex;gap:6px}.character-sheet .character-resources{grid-column:1;grid-row:4}.character-sheet .character-combat{grid-column:1;grid-row:5}.character-sheet .attributes-heading{grid-column:2;grid-row:1}.character-sheet .attribute-allocation{grid-column:2;grid-row:2/5}.character-sheet .character-purse{grid-column:2;grid-row:5}.character-sheet .attribute-note{display:none}
 .training-dialog[data-tab="skills"][open]{height:calc(100dvh - 12px)}
 .training-dialog[data-tab] .training-scroll{grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:3px 12px}
 .training-dialog[data-tab] .training-row.skill-training{grid-template-columns:minmax(0,1fr) 108px;gap:6px;padding:3px}.training-dialog[data-tab] .training-skill-glyph{display:none}.training-dialog[data-tab] .training-copy h3{font-size:17px}.training-dialog[data-tab] .training-copy p{font-size:12px}
 body .training-dialog[data-tab="skills"] .skill-training{padding-block:2px}
 .training-dialog[data-tab="skills"] .skill-explanation>summary{min-height:24px;padding-block:3px}
 .training-dialog[data-tab=abilities] .training-scroll{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:1fr}
 .training-dialog[data-tab] .ability-training{display:flex;flex-direction:column;justify-content:center;gap:4px}.training-dialog[data-tab] .ability-training .ability-picture{display:none}.training-dialog[data-tab] .ability-training .training-actions{flex-direction:row;gap:4px;width:100%}.training-dialog[data-tab] .ability-training .training-actions button{flex:1;min-width:0}.training-dialog[data-tab] .ability-source{font-size:10px}.training-dialog[data-tab] .training-footer>p{display:none}
}
@media(max-height:440px) and (orientation:landscape){
 body.bounded-arena .duel-banner{grid-template-rows:30px 44px 28px 32px 28px minmax(0,1fr);gap:3px 12px;align-content:start}
 body.bounded-arena .duel-banner .opponent-crest{grid-column:1;grid-row:2;justify-self:center}.bounded-arena .duel-banner #opponent-name{grid-column:1;grid-row:3}.bounded-arena .duel-banner #opponent-detail{grid-column:1;grid-row:4}.bounded-arena .duel-banner #opponent-stats{grid-column:1;grid-row:5}
 body.bounded-arena .duel-banner #challenge{grid-column:2;grid-row:2}.bounded-arena .duel-banner .energy-cost-note{grid-column:2;grid-row:3}.bounded-arena .duel-banner [data-energy-open]{grid-column:2;grid-row:4}.bounded-arena .duel-banner #reroll{grid-column:2;grid-row:5}.bounded-arena .duel-banner #match-stage{grid-column:1/-1;grid-row:6}
 .character-sheet .statistics-content{grid-template-rows:32px 12px 26px 42px 30px;gap:3px 14px}.character-sheet .statistics-content>*{margin:0!important}.character-sheet .character-resources,.character-sheet .character-combat{padding:1px 0}.character-sheet .attribute-allocation{padding:2px 6px}.character-sheet .character-purse{padding:0;align-self:center}.character-sheet .character-section-link .parchment-button{min-height:26px}.character-sheet .wing-heading{min-height:30px}.character-sheet .wing-heading h2{font-size:20px}.character-sheet .wing-footer{min-height:32px;padding:2px}
 body.bounded-hub #preferences>label:first-child{grid-column:auto}.bounded-hub .settings-layout>.folio-tabs button{min-height:28px;padding:3px;font-size:14px}
 body.bounded-hub .event-scene{grid-template-columns:24% minmax(0,1fr)}.bounded-hub .event-conversation blockquote{font-size:13px;line-height:1.25}.bounded-hub .event-conversation>.etched-button{min-height:32px;padding:4px;font-size:14px}.bounded-hub .event-conversation .event-steps{padding:0}.bounded-hub .event-conversation .event-steps strong{font-size:11px}
 body.bounded-world .world-pets .world-heading{display:none}.bounded-world .world-pets .companion-training h2{margin:0!important;font-size:19px}.bounded-world .world-pets .companion-training-actions h3{margin:0 0 3px}.bounded-world .world-pets .companion-payment-options .world-button{min-height:34px;padding:2px}.bounded-world .world-pets .companion-training>.world-button{min-height:26px}
 body.bounded-world .world-weapons .weapon-rule p{font-size:11px;line-height:1.2}.bounded-world .world-weapons .collection-ledger{gap:3px 12px;align-content:stretch}.bounded-world .world-weapons .world-button{min-height:30px;padding:3px;font-size:14px}
}
@media(max-height:440px) and (orientation:landscape){
 body.bounded-journal .quest-story,body.bounded-journal .quest-giver{display:none}
 body.bounded-journal .letter-heading{padding-right:32px}.bounded-journal .quest-letter{gap:3px}.bounded-journal .quest-objectives{padding:2px 0}.bounded-journal .quest-objectives li{padding:2px 0}.bounded-journal .quest-actions{margin-top:auto!important}
 .character-sheet .attribute-allocation{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:3px 6px;align-content:start}
 .character-sheet .attribute-row{display:grid;grid-template-columns:1fr 32px;gap:2px;min-height:0}.character-sheet .attribute-row>span{grid-column:1/-1;min-width:0;font-size:11px}.character-sheet .attribute-row>b{font-size:17px}.character-sheet .attribute-plus{width:32px;height:32px;font-size:20px}.character-sheet .attribute-points{grid-column:1/-1;margin:0;padding:2px 0;font-size:11px}.character-sheet .attribute-points strong{font-size:15px}
 body.bounded-world .world-weapons .weapon-rule .ink-eyebrow{display:none}.bounded-world .world-weapons .collection-ledger{grid-template-rows:repeat(2,minmax(0,1fr)) 30px}.bounded-world .world-weapons .weapon-rule h2{font-size:17px;margin:1px 0}.bounded-world .world-weapons .weapon-rule p{font-size:11px;line-height:1.18}
}
@media(max-height:440px) and (orientation:landscape){
 body.bounded-journal .reward-line{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}.bounded-journal .reward-line>span{display:flex;flex-direction:column;gap:0}.bounded-journal .reward-line :is(i,.reward-coin,.reward-xp){display:none}.bounded-journal .reward-line b{font-size:13px}.bounded-journal .reward-line small{font-size:9px}.bounded-journal .quest-rewards{padding:2px 0}.bounded-journal .quest-actions{padding-top:2px}
}
@media(max-width:800px) and (orientation:portrait){
 .chamber.forge-open .hero-stage,.chamber.market-open .hero-stage{display:none}
 .chamber .forge-scene .forge-workspace{left:12px;right:12px}
}
@media(max-width:360px){
 body.bounded-arena .duel-banner .duel-hint{display:none}.bounded-arena .duel-banner #opponent-detail{font-size:11px;line-height:1.3}.bounded-arena .duel-banner .opponent-crest{margin:0!important}.bounded-arena .duel-banner #reroll{min-height:28px;padding:4px}
}
body .responsive-combat .damage{font-size:var(--combat-number)!important}
body .responsive-combat .damage.critical{font-size:calc(var(--combat-number)*1.2)!important}
.training-dialog .training-close{top:5px;right:5px;width:36px;height:36px}
@media(max-height:620px) and (orientation:portrait){
 body.bounded-journal .quest-story,body.bounded-journal .quest-gold-note{display:none}.bounded-journal .quest-giver{font-size:12px}.bounded-journal .quest-letter{gap:5px;padding:10px 12px}.bounded-journal .quest-objectives li{padding:4px 0}.bounded-journal .quest-actions{margin-top:auto!important}
}
.world-weapons .collection-ledger:has(>.folio-tabs){display:flex;flex-direction:column;gap:12px;align-content:stretch}
.world-weapons .collection-ledger>.folio-tabs{display:flex;flex-wrap:wrap;gap:5px 12px;width:100%;margin:0;flex:none}
.world-weapons .collection-ledger>.folio-tabs button{font-size:17px;min-height:36px;padding:5px 8px;flex:1}
.world-weapons .collection-ledger>.folio-panel{flex:1;min-height:0;margin:0;padding:4px 0}
.world-weapons .collection-ledger:has(>.folio-tabs) .weapon-rule h2{font-size:27px}
.world-weapons .collection-ledger:has(>.folio-tabs) .weapon-rule p{font-size:16px;line-height:1.4;max-width:640px}
.world-weapons .collection-ledger:has(>.folio-tabs) .fine-print{display:none}
@media(max-height:440px){.world-weapons .collection-ledger:has(>.folio-tabs){gap:4px}.world-weapons .collection-ledger>.folio-tabs button{font-size:14px;min-height:30px;padding:3px}.world-weapons .collection-ledger:has(>.folio-tabs) .weapon-rule h2{font-size:22px}.world-weapons .collection-ledger:has(>.folio-tabs) .weapon-rule p{font-size:14px;line-height:1.3}}
@media(max-height:440px) and (orientation:landscape){
 body.bounded-journal .quest-letter{padding:6px 10px;gap:2px}.bounded-journal .letter-heading h2{font-size:22px;margin:2px 0}.bounded-journal .quest-objectives strong{font-size:13px;line-height:1.15}.bounded-journal .objective-mark{width:24px;min-width:24px;height:24px;font-size:14px}.bounded-journal .quest-objectives li{gap:8px}
}
/* Long nicknames cannot dictate the width of either side of the arena HUD. */
body.bounded-arena .battle-hud{grid-template-columns:minmax(0,1fr) 55px minmax(0,1fr)}
.bounded-arena .combatant-vitals{min-width:0}
.bounded-arena .fighter-name strong{display:block;min-width:0;max-width:100%!important;white-space:normal!important;overflow-wrap:anywhere;line-height:1.15}
.bounded-arena .fighter-caption{display:none}
.character-sheet .statistics-content{overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin}
@media(pointer:coarse){
 .chamber button[data-store="buy"],.chamber button[data-store="wear"]{min-height:44px}
 .character-view .attribute-plus,.character-wing .attribute-plus{min-width:44px;min-height:44px;width:44px;height:44px;font-size:24px}
 .character-wing .attribute-row{grid-template-columns:minmax(0,1fr) auto 44px;min-height:48px}
}
@media(max-width:600px){body.bounded-arena .battle-hud{grid-template-columns:minmax(0,1fr) 45px minmax(0,1fr);gap:8px}.bounded-arena .fighter-name strong{font-size:15px}}
/* Keep touch targets inside their own layout space, including the footer. */
@media(max-width:800px) and (orientation:portrait){
 .chamber .footer-links .quiet-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;font-size:11px}
 .chamber .lower-nav{bottom:max(54px,calc(env(safe-area-inset-bottom) + 49px))}
 .chamber .energy-hud-control{height:44px;margin-bottom:0;border:0;background:none;box-shadow:none;transform:none}
 .chamber .energy-hud-control::before{content:"";position:absolute;inset:14px 0;border:1px solid #9f835470;background:#24120dcc;transform:skew(-10deg)}
 .chamber .energy-hud-control i{top:15px;bottom:15px;transform:skew(-10deg)}
 .chamber .energy-hud-control span{line-height:42px;font-size:11px}
 .chamber .energy-hud-control::after{top:12px}
 .chamber .utility{width:44px;height:44px}
 .chamber .top-hud{height:112px}
 .chamber .room-title{top:var(--home-heading-top,112px)}
 .chamber .main-nav{top:calc(var(--home-heading-top,112px) + 37px)}
 .chamber .room-shop-button{top:calc(var(--home-heading-top,112px) + 111px)}
 body .chamber .room-social-actions{top:calc(var(--home-heading-top,112px) + 111px);bottom:auto;left:8px;right:auto;width:min(165px,calc(100vw - 230px));flex-direction:column}
 .chamber .room-social-actions button{min-height:44px}
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button,
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .mobile-chest{top:calc(var(--home-heading-top,112px) + 111px)}
 .chamber .room-trophy{top:calc(var(--home-heading-top,112px) + 115px);left:calc(50% - 20px)}
}

/* Keep full control rectangles separate in compact viewports. */
@media(max-height:440px) and (orientation:landscape){
 body.bounded-hub .hub-header{height:auto}
 body .chamber .character-sheet .statistics-content{display:flex;flex-direction:column;gap:8px;overflow-y:auto}
 body .chamber .character-sheet .statistics-content>*{flex:none}
 body .chamber .character-sheet .attribute-allocation{display:block}
 body .chamber .character-sheet .attribute-row{display:grid;grid-template-columns:minmax(0,1fr) 22px 36px;min-height:40px;gap:4px}
 body .chamber .character-sheet .attribute-row>span{grid-column:auto}
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .mobile-chest{top:172px}
}
.bounded-world .world-pets .companions-layout{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
.bounded-world .world-pets .companion-training{align-self:safe center}
.bounded-world .world-pets>.premium-link{flex:none}
body.bounded-hub #preferences .volume-label{min-height:60px}


body.bounded-hub #preferences{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
body.bounded-hub #preferences>.etched-button{grid-column:1/-1;min-height:44px;justify-self:start;align-self:start}

/* Small portrait phones still need a readable hero and separate reward targets. */
@media(max-width:800px) and (orientation:portrait){
 body .chamber.room-party-ready:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .hero-caption{left:calc(50vw - var(--room-hero-left) + 50%);width:min(260px,calc(100vw - 32px));max-width:none;right:auto}
 .chamber .resource-bar span{white-space:nowrap}
 .chamber .room-shop-button{right:156px}
 .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button{right:82px}
}
@media(max-width:360px) and (orientation:portrait){
 .chamber .top-hud{grid-template-columns:minmax(0,1fr) 105px}
 .chamber .wallet{flex-direction:column;align-items:flex-end;gap:5px}
 .chamber .currency strong{font-size:13px;letter-spacing:0}
 .chamber .currency .currency-art{width:20px;height:20px}
 .chamber .currency small{font-size:7px}
 .chamber .energy-hud-control{min-width:0;max-width:calc(100vw - 248px)}
 .chamber .energy-hud-control::after{right:4px;transform:none}
 .chamber .energy-hud-control span{box-sizing:border-box;padding-right:22px}
}
@media(max-width:800px) and (max-height:640px) and (orientation:portrait){
 .chamber .gift-button .daily-gift-icon{width:39px;height:39px}
 .chamber .gift-button .gift-state{display:none}
}

/* Landscape browser toolbars can leave 250–540 CSS pixels of height. Keep
   the combat header compact throughout that range, including after rotation. */
@media(max-height:540px) and (orientation:landscape){
 .tavern-scene:has(.event-battle) .tavern-header{height:48px;min-height:48px;padding-block:2px}
 .tavern-scene:has(.event-battle) .tavern-stage{height:auto;flex:1;min-height:0;padding:0}
 .tavern-scene:has(.event-battle) .tavern-footer{display:none}
 .tavern-scene .event-battle .battle-hud{top:4px}
 .tavern-scene .event-battle .versus{font-size:18px;margin-top:28px}
 #campaign-root.in-battle .campaign-header{height:48px;min-height:48px;display:flex;flex-wrap:nowrap;align-items:center;gap:10px;padding-block:2px}
 #campaign-root.in-battle .campaign-header .city-return{flex:none;font-size:15px;gap:6px}
 #campaign-root.in-battle .campaign-header .city-medal{width:34px;height:34px}
 #campaign-root.in-battle .campaign-header .identity{min-width:0;flex:1;gap:7px}
 #campaign-root.in-battle .campaign-header .avatar{width:34px;height:34px;flex:none}
 #campaign-root.in-battle .campaign-header .identity>span:last-child{min-width:0}
 #campaign-root.in-battle .campaign-header .identity strong{font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #campaign-root.in-battle .campaign-header .identity small,#campaign-root.in-battle .journal-link{display:none}
 #campaign-root.in-battle .campaign-header .wallet{flex:none;width:auto;gap:8px;font-size:13px;margin-left:auto}
 #campaign-root.in-battle .campaign-header .campaign-sound{position:static;width:32px;height:32px;min-width:32px;padding:6px}
 #campaign-root.in-battle .battle-heading{display:block;padding:0}
 #campaign-root.in-battle .battle-heading h1{font-size:21px!important;line-height:1.1;margin:2px 16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #campaign-root.in-battle .battle-heading>span{display:none}
 #campaign-root.in-battle .battle-health{top:29px}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,96px);grid-template-rows:27px 20px;gap:3px 6px;align-items:center}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side .combat-health{grid-row:2;grid-column:1/-1;width:100%;height:20px;min-height:20px;margin:0}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side .combat-name{grid-row:1;grid-column:1;min-width:0}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side .combat-buffs{grid-row:1;grid-column:2;justify-self:end;max-width:100%;margin:0;padding:0;min-height:27px}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side:last-child{grid-template-columns:minmax(0,96px) minmax(0,1fr)}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side:last-child .combat-name{grid-column:2}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-hud-side:last-child .combat-buffs{grid-column:1;justify-self:start}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-name.combat-name{font-size:14px!important;line-height:1.15;margin:4px 0 2px}
 #campaign-root.in-battle .vitals>small{display:none}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-buffs{margin-top:2px;min-height:29px;padding-bottom:2px}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-buffs>button{height:27px;min-height:27px;width:29px;flex-basis:29px;padding:2px}
 :is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-buffs>button>i,:is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-buffs .painted-icon,:is(#campaign-root.in-battle,.tavern-scene:has(.event-battle)) .combat-buffs .pet-art{width:22px;height:22px}
 #campaign-root.in-battle .battle-vs{top:37px;font-size:18px}
 #campaign-root.in-battle .battle-companion>span{display:none}
}

/* The short room uses two narrow control rails. Reserve the centre for the
   complete painted party instead of letting secondary links shrink its stage. */
@media(max-height:440px) and (orientation:landscape){
 body .chamber:not(.city-view):not(.character-open) .top-hud{inset:6px 8px auto;height:54px;display:grid;grid-template-columns:153px minmax(0,1fr);gap:8px;align-items:start}
 body .chamber:not(.city-view):not(.character-open) .hero-hud{min-width:0;gap:6px}
 body .chamber:not(.city-view):not(.character-open) .hero-vitals{width:auto;min-width:0;flex:1}
 body .chamber:not(.city-view):not(.character-open) .hero-vitals-info>strong{white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;font-size:14px;line-height:16px}
 body .chamber:not(.city-view):not(.character-open) .energy-hud-control{height:22px;min-height:22px;margin:0}
 body .chamber:not(.city-view):not(.character-open) .energy-hud-control span{line-height:20px;white-space:nowrap}
 body .chamber:not(.city-view):not(.character-open) .wallet{min-width:0;justify-content:flex-start;gap:10px;padding:2px 118px 0 0}
 body .chamber:not(.city-view):not(.character-open) .currency{min-width:0;gap:3px}
 body .chamber:not(.city-view):not(.character-open) .currency-art{width:20px;height:20px;flex:none}
 body .chamber:not(.city-view):not(.character-open) .currency strong{font-size:clamp(12px,1.9vw,16px);white-space:nowrap;letter-spacing:0}
 body .chamber:not(.city-view):not(.character-open) .utilities{position:absolute;right:0;top:48px;gap:1px;padding:0}
 body .chamber:not(.city-view):not(.character-open) .utility{width:28px;height:28px}
 body .chamber:not(.city-view):not(.character-open) .utilities .game-exit-trigger{position:fixed;right:8px;top:6px;min-height:34px;padding:4px 8px;font-size:11px}
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .main-nav{left:6px;top:64px;bottom:auto;width:92px;height:88px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 4px}
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .main-nav .menu-button{min-width:0;min-height:44px}
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .lower-nav{left:108px;right:80px;bottom:4px;height:40px;align-items:center}
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .hero-stage{height:calc(100% - 88px)}
 html body .chamber.room-party-ready:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .hero-caption{left:calc(50vw - var(--room-hero-left) + 50%);right:auto;bottom:-20px;width:min(250px,calc(100vw - 210px));max-width:none;white-space:nowrap}
 html body .chamber.room-party-ready:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .hero-caption strong{white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;font-size:13px;line-height:16px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .room-social-actions{left:6px;right:auto;top:154px;bottom:auto;width:92px;max-width:92px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .room-social-menu>summary{min-height:30px;padding:2px;font-size:12px;gap:3px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .footer-links .community-gift-link{left:6px;top:186px;width:92px;min-height:30px;font-size:10px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .footer-links .room-honors-link{left:6px;top:218px;width:92px;min-height:30px;font-size:10px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .footer-links .room-honors-link[data-feature-hidden]{display:none!important}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open)>.chest-hotspot{inset:184px 8px auto auto;width:68px;height:68px;min-width:0;aspect-ratio:1}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .mobile-chest{top:184px;right:8px;width:68px;height:68px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .room-shop-button{top:84px;right:8px;width:64px;min-height:44px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button{top:130px;right:8px;width:64px;min-height:44px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button .daily-gift-icon{width:36px;height:36px}
 html body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .gift-button .gift-state{display:none}
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .room-title{top:52px;font-size:16px}
}
@media(max-height:310px) and (orientation:landscape){
 body .chamber:not(.city-view):not(.character-open):not(.forge-open):not(.market-open) .room-title{display:none}
}
/* A short landscape arena needs one compact HUD below its own return row.
   This also applies when native safe areas make the inner frame under 481px. */
@media(max-height:440px) and (orientation:landscape){
 body.bounded-arena .arena-world.in-battle .arena-header{display:block;height:44px;min-height:44px;padding:0 12px}
 body.bounded-arena .arena-world.in-battle .city-link{display:inline-flex;width:auto;min-height:44px;font-size:12px;gap:7px}
 body.bounded-arena .arena-world.in-battle .city-link span{display:inline}
 body.bounded-arena .arena-world.in-battle .battle-hud{top:44px}
 body.bounded-arena .arena-world.in-battle .combat-hud[data-combat-columns="3"]{grid-template-columns:minmax(0,1fr) 58px minmax(0,1fr)}
 body.bounded-arena .arena-world.in-battle .fighter-name{display:flex;align-items:baseline;gap:6px;margin-top:3px}
 body.bounded-arena .arena-world.in-battle .fighter-name strong{font-size:14px!important;line-height:18px;margin:0;flex:1}
 body.bounded-arena .arena-world.in-battle .fighter-name small{margin:0;flex:none;font-size:8px}
 body.bounded-arena .arena-world.in-battle .combat-health{height:18px;min-height:18px;margin-top:2px}
 body.bounded-arena .arena-world.in-battle .combat-health-value{font-size:12px!important}
 body.bounded-arena .arena-world.in-battle .combat-buffs{margin-top:2px}
}
@media(max-width:600px){body.bounded-arena .arena-world.in-battle .combat-hud[data-combat-columns="3"]{grid-template-columns:minmax(0,1fr) 58px minmax(0,1fr)}}
