/* Content may scroll within a named region; it must not resize its neighbours. */
:root{--control-h:34px;--control-line:18px}
.arcade-top>*{min-width:0;flex-shrink:0}.arcade-top .top-spacer{flex:1}
#game-picker>summary{width:146px;justify-content:flex-start;box-sizing:border-box}
#current-game-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
header.arcade-top .top-dropdown>summary{height:30px;min-height:30px;line-height:18px}
.game-menu .game-tab{height:40px;min-height:40px}.game-menu .game-tab strong{white-space:nowrap}
:is(.sub-button,.r-btn,.r-banish,.m-actions button,.s-actions button,.bird-actions button,.n-toolbar button,.n-actions button,.t-actions button,.p-actions button,.f-controls button){box-sizing:border-box;height:var(--control-h);min-height:var(--control-h);line-height:var(--control-line);white-space:nowrap;padding-top:0;padding-bottom:0;flex-shrink:0;font-variant-numeric:tabular-nums}
:is(.m-actions,.s-actions,.bird-actions,.n-actions,.t-actions,.p-actions){display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:center}
:is(.m-actions,.s-actions,.bird-actions,.n-actions,.t-actions,.p-actions)>button{width:100%;min-width:0;padding-left:6px;padding-right:6px}
:is(.game-heading,.b-head,.m-head,.s-head,.bird-head,.n-head,.t-head,.p-head,.f-head){min-width:0;min-height:48px}
:is(.m-head,.s-head,.bird-head,.n-head,.p-head) select{width:48%;height:34px;min-height:34px;min-width:0;text-overflow:ellipsis}
:is(.stats,.b-stats,.m-stats,.s-stats,.bird-stats,.t-stats,.p-stats,.f-hud)>*{flex:1;min-width:0;font-variant-numeric:tabular-nums}
:is(#m-status,#s-status,#bird-status,#n-status,#t-status,#p-status,#f-status){height:3.2em;min-height:3.2em;max-height:3.2em;overflow:auto;overflow-wrap:anywhere;scrollbar-width:thin}
/* HUD budgets remain constant as numbers, mode and equipment change. */
#rogue-panel .r-combat-top{height:72px;min-height:72px;grid-template-columns:minmax(0,1fr) 100px minmax(0,1fr);align-items:start}
.r-status-block{position:relative;height:52px;display:block;min-width:0;max-width:240px;line-height:15px}
.r-status-name{display:block;height:15px;white-space:nowrap}
#r-health-label{display:block;height:15px;font-variant-numeric:tabular-nums}
.r-health-track{height:3px;margin:2px 0 3px}
#r-gold-stat{display:block;height:14px;line-height:14px;white-space:nowrap;font-variant-numeric:tabular-nums}
#r-gold-stat[hidden]{display:block!important;visibility:hidden}
.r-clock-block{padding-top:3px;min-width:0}.r-clock-block>*{white-space:nowrap}#r-time{width:8ch;text-align:center;height:16px;line-height:16px}#r-round{height:16px;line-height:16px}
.r-stats-block{min-width:0;gap:8px}.r-stats-block>div:first-child{flex:0 0 66px;min-width:0;line-height:16px;gap:2px;white-space:nowrap}
.r-hud-actions{flex-direction:row;flex-wrap:nowrap;gap:4px;flex-shrink:0}.r-combat-top .r-btn{height:30px;min-height:30px;width:34px;padding:0}
#rogue-panel .r-bottom{height:94px;min-height:94px;box-sizing:border-box;justify-content:flex-start;gap:6px}
#rogue-panel #r-message{height:16px;min-height:16px;max-height:16px;line-height:16px;margin:0}
.r-equipment-bar{height:34px;min-height:34px;align-items:center}
#rogue-panel #r-build{display:flex;flex-wrap:nowrap;gap:16px;height:34px;max-width:100%}
.r-slot-group{flex-shrink:0}.r-slot-label{width:55px;max-width:none;white-space:nowrap;text-align:left}.r-slot-row{flex-wrap:nowrap}
.r-xp-row{height:16px;min-height:16px;line-height:16px}#r-xp-label{width:120px;font-variant-numeric:tabular-nums}
/* Launch controls and operation copy keep their positions across modes. */
#r-screen .r-launch-grid{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
#r-screen .r-launch-grid>div{min-width:0}
#r-screen .r-launch .r-copy:not(.r-launch-foot){height:36px;overflow:auto;line-height:18px}
#r-screen .r-stage-detail{height:120px;min-height:120px;max-height:120px;overflow:auto;line-height:20px;scrollbar-width:thin;margin-bottom:10px;overflow-wrap:anywhere}
#r-screen .r-launch .r-btn,#r-screen .r-launch .r-starter{height:34px;min-height:34px;line-height:18px;box-sizing:border-box}
#r-screen .r-launch .r-starter{padding:0 8px;text-overflow:ellipsis}
#r-screen .r-launch .r-start{height:38px;min-height:38px}
.r-threats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.r-threats .r-btn{width:100%;padding:0 4px}
/* Explicit rows avoid a single verbose choice stretching the entire grid. */
#rogue-panel .r-cards{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:none;grid-auto-rows:auto;gap:10px;align-items:start}
#rogue-panel .r-choice-slot{display:flex;flex-direction:column;grid-row:auto;gap:8px;min-width:0}
#rogue-panel .r-card,#rogue-panel .r-choice-slot .r-card{display:grid;grid-row:auto;grid-template-rows:88px 36px 44px 20px 92px 116px;row-gap:6px;height:442px;min-height:442px;padding:0 12px 12px;box-sizing:border-box;align-items:start;align-content:start}
#rogue-panel .r-card>*{min-width:0;min-height:0;margin-top:0;margin-bottom:0;box-sizing:border-box}
#rogue-panel .r-card-top{height:88px}
#rogue-panel .r-ability-category{height:36px;line-height:18px;overflow:auto}
#rogue-panel .r-card b{height:44px;line-height:22px;overflow:auto;overflow-wrap:anywhere}
#rogue-panel .r-upgrade-level{height:20px;line-height:20px;white-space:nowrap}
#rogue-panel .r-ability-description{height:92px;line-height:20px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#rogue-panel .r-synergy-hint{height:116px;line-height:18px;padding-top:6px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#rogue-panel .r-banish{height:34px;min-height:34px;width:100%}
.r-upgrade-tools{height:34px;min-height:34px;align-items:center;font-variant-numeric:tabular-nums}.r-upgrade-tools .r-btn{width:130px}
/* Relics reserve the same rows even when unowned, maxed or read-only. */
.r-vault-grid{align-items:start}
.r-vault-card{display:grid;grid-template-rows:30px 24px 18px 54px 20px 64px 36px;gap:6px;height:310px;box-sizing:border-box;padding:12px}
.r-vault-card>*{min-width:0;margin:0!important;min-height:0!important}
.r-vault-card-head{grid-row:1;flex-wrap:nowrap;height:30px}.r-vault-tier{line-height:15px}.r-vault-mark{flex-shrink:0}
.r-vault-card h4{grid-row:2;height:24px;line-height:24px;overflow:auto}
.r-vault-rank{grid-row:3;line-height:18px;white-space:nowrap}
.r-vault-effect{grid-row:4;height:54px;line-height:18px;font-size:13px;overflow:auto;scrollbar-width:thin}
.r-vault-card>.r-copy{grid-row:5;height:20px;line-height:20px!important;white-space:nowrap}
.r-vault-next{grid-row:6;height:64px;line-height:18px;overflow:auto;padding-top:7px;scrollbar-width:thin}
.r-vault-card .r-vault-actions{grid-row:7;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;align-self:end}
.r-vault-card .r-btn{width:100%;padding:0 4px;height:36px;min-height:36px;font-size:12px}
.r-vault-actions:not(.r-vault-card .r-vault-actions){display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr)}
.r-vault-status{height:40px;line-height:20px;overflow:auto;font-size:13px}
.r-vault-result{grid-template-rows:18px 40px 36px}.r-vault-result strong{line-height:20px;overflow:auto}
@media(max-width:700px){
 #game-picker>summary{width:132px}.arcade-top{gap:5px!important;padding-left:6px!important;padding-right:6px!important}
 #rogue-panel .r-combat-top,.arcade-immersive #rogue-panel .r-combat-top{height:72px;min-height:72px;padding:7px 8px;gap:4px;grid-template-columns:minmax(0,1fr) 64px minmax(0,1.25fr)}
 .r-stats-block,.arcade-immersive .r-stats-block{display:grid;grid-template-rows:16px 30px;justify-items:end;gap:4px}
 .r-stats-block>div:first-child{display:flex;gap:6px;font-size:10px;line-height:16px;white-space:nowrap}
 .r-hud-actions,.arcade-immersive .r-hud-actions{flex-direction:row;gap:3px}.r-combat-top .r-btn{width:30px}
 #rogue-panel .r-bottom{height:102px;min-height:102px;padding:6px 8px;gap:4px}
 .r-equipment-bar{height:54px;min-height:54px}
 #rogue-panel #r-build{height:54px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;width:100%}
 .r-slot-group{display:flex;flex-direction:column;align-items:flex-start;gap:3px;min-width:0}.r-slot-label{width:100%;height:14px;line-height:14px;white-space:nowrap}.r-slot-row{gap:3px;width:100%}.r-slot{width:min(30px,calc((100% - 12px)/5));height:auto;aspect-ratio:1}.r-slot img{width:85%;height:85%;aspect-ratio:1}
 #r-screen .r-launch-grid{grid-template-columns:minmax(0,1fr)}#r-screen .r-stage-detail{height:120px}
 #rogue-panel .r-cards{grid-template-columns:minmax(0,1fr);max-width:440px;gap:14px}
 #rogue-panel .r-card,#rogue-panel .r-choice-slot .r-card{grid-template-rows:76px 18px 24px 18px 60px 78px;height:316px;min-height:316px;row-gap:5px;padding:0 12px 12px}
 #rogue-panel .r-card-top{height:76px;padding-top:22px!important}#rogue-panel .r-ability-art{width:46px;height:46px}
 #rogue-panel .r-ability-category{height:18px;line-height:18px;white-space:nowrap}#rogue-panel .r-card b{height:24px;line-height:24px;font-size:16px}#rogue-panel .r-upgrade-level{height:18px;line-height:18px}#rogue-panel .r-ability-description{height:60px}#rogue-panel .r-synergy-hint{height:78px}
 .r-upgrade-tools{width:100%;max-width:440px;justify-content:space-between;gap:6px;font-size:11px}.r-upgrade-tools .r-btn{width:108px}
 :is(.m-actions,.s-actions,.bird-actions,.n-actions,.t-actions,.p-actions){grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr))}
 #r-screen:has(.r-launch),#r-screen:has(.r-cards),#r-screen:has(.r-vault),#r-screen:has(.r-adventure),#r-screen:has(.r-tree-screen){top:calc(var(--top-height) + 4px)}
 .arcade-immersive #r-screen:has(.r-launch),.arcade-immersive #r-screen:has(.r-cards),.arcade-immersive #r-screen:has(.r-vault),.arcade-immersive #r-screen:has(.r-adventure),.arcade-immersive #r-screen:has(.r-tree-screen){top:72px}
}
@media(max-height:500px) and (min-width:701px){#rogue-panel .r-combat-top{height:64px;min-height:64px;padding:4px 10px}#rogue-panel .r-bottom{height:60px;min-height:60px;padding:4px 10px;gap:2px}}

#r-screen>.r-menu-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:min(600px,100%);gap:8px}
#r-screen>.r-menu-actions button{height:38px;min-height:38px;min-width:0;padding:0 6px;font-size:12px;white-space:nowrap;line-height:18px}
@media(max-width:360px){#r-screen>.r-menu-actions{grid-template-columns:minmax(0,1fr)}}
.r-vault-card img.r-vault-mark{width:28px;height:28px;object-fit:contain;border:1px solid #ffd180;border-radius:3px}
.r-slot.signature{border-color:#ffc969;box-shadow:inset 0 0 8px #ffb83e35}.r-slot.signature:after{content:'◆';position:absolute;top:-5px;right:-3px;font-size:9px;color:#ffcf79}.r-slot.resonant{box-shadow:0 0 9px #ffdc8b88,inset 0 0 8px #ffb83e35}.r-slot.resonant small{color:#ffe4a1}
@media(max-width:440px){.r-vault>.r-vault-actions{grid-auto-flow:row!important;grid-template-columns:repeat(2,minmax(0,1fr))}}
