/* Run information first; optional progress never displaces the replay action. */
#shell #death .results-dialog{display:flex;flex-direction:column;width:min(820px,100%);max-height:100%;overflow:hidden}
#shell #death .results-heading{flex:none;min-width:0}
#shell #death .results-content{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:2px}
#shell #death .result-summary{display:flex;flex-direction:column;flex:none;overflow:visible}
#shell #death .results-table{font-size:1rem;line-height:1.4}
#shell #death .results-table :is(th,td){padding:7px 5px}
#shell #death .results-table tbody tr:first-child{color:#fff1b7;background:#ffffff0a}
#shell #death .results-table tbody tr:first-child td{font-size:1.3em;font-weight:700}
#shell #death .result-progress-details{display:block;flex:none;border:1px solid var(--ui-line);border-radius:10px;background:#193246}
#shell #death .result-progress-details>summary{display:list-item;list-style-position:inside;padding:12px;min-height:44px;box-sizing:border-box;cursor:pointer;font-size:.9rem;line-height:1.4;color:#edf5fa}
#shell #death .result-progress-content{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:10px}
#shell #death .result-progress-details:not([open])>.result-progress-content{display:none}
#shell #death .result-progress-content :is(.result-quests,.result-season){overflow:visible;grid-area:auto}
#shell #death .result-progress-content :is(p,.quest-card strong){font-size:.85rem;line-height:1.4}
#shell #death .result-progress-content :is(.quest-card span,.season-medal span){font-size:.75rem;line-height:1.4}
#shell #death .result-actions{display:flex;flex-wrap:wrap;flex:none;align-items:center;gap:8px;position:static;margin:0;padding:10px 0 0}
#shell #death .result-actions button{min-height:44px;min-width:0;flex:1 1 auto;width:auto;white-space:normal;line-height:1.3;font-size:.9rem;padding:10px 12px}
#shell #death #restart{order:-1;flex:2 1 auto}
#shell #death #revive-note{flex:1 0 100%;order:-2;max-width:none;font-size:.8rem}
#shell #death #death-exit{order:5}
#shell #hud .leaderboard{background:#102a3cee;border-color:#9bb8c7;max-width:230px;width:clamp(170px,19vw,230px)}
#shell #hud .leaderboard[data-size=compact],#shell #hud .leaderboard[data-size=own]{width:180px}
#shell #hud .leaderboard h2{min-height:36px;display:flex;align-items:center;font-size:.75rem;line-height:1.3;margin:0 40px 4px 4px}
#shell #hud .leaderboard li{min-height:22px;font-size:.8rem;line-height:1.3;padding:3px;grid-template-columns:22px minmax(0,1fr) auto;gap:5px}
#shell #hud .leaderboard .rank{width:22px;min-width:22px}
#shell #hud .leaderboard .own{border-left:3px solid #fff1b7;padding-left:0;background:#e4f3f5;color:#123145;font-weight:700}
#shell #hud .leaderboard .who{min-width:0}
#shell :is(#rooms-status,#daily-status){padding:12px;border:1px solid var(--ui-line);border-radius:10px;font-size:.9rem;line-height:1.5;background:#193246;color:#e1edf3}
#shell :is(#rooms-status,#daily-status)[data-state=error]{border-left:4px solid #f0b3ab;background:#432d3a}
#shell :is(#rooms-status,#daily-status)[data-state=empty]{border-left:4px solid #c6ddba}
#shell :is(#rooms-play,#daily-play){min-height:44px;font-size:.9rem;margin:0 0 12px;padding:10px 16px}
#shell .daily-leaders li{min-height:44px;grid-template-columns:36px minmax(0,1fr) auto;gap:10px;font-size:.9rem;line-height:1.4}
#shell .daily-leaders li strong{min-width:0;overflow-wrap:anywhere}
#shell .daily-leaders li.own{border-left:3px solid #fff1b7}
#shell.high-contrast #hud .leaderboard{background:#071725;border-color:#fff}
#shell.high-contrast :is(#rooms-status,#daily-status){border-color:#fff;color:#fff}
@media(orientation:landscape) and (max-height:650px){
 #shell #death .results-dialog{padding:12px;gap:8px}
 #shell #death .results-heading{padding-bottom:6px;gap:10px}
 #shell #death .results-heading h2{font-size:1.2rem}
 #shell #death .results-heading .results-title{min-width:0}
 #shell #death .result-summary{padding:10px}
 #shell #death .result-actions{padding-top:8px}
 #shell #death .result-actions button{padding:8px;font-size:.8rem}
 #shell #death #revive-note{display:none}
 #shell #hud .leaderboard[data-size=full] ol{max-height:calc(45vh - 60px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;pointer-events:auto}
}
@media(max-width:600px){
 #shell #death .result-progress-content{grid-template-columns:minmax(0,1fr)}
 #shell #death .results-heading .ruby-wallet{display:none}
}
#shell #hud #menu-button{width:44px;height:44px;min-width:44px;min-height:44px}

#shell #death .results-heading{display:flex;align-items:center;justify-content:center}
#shell #death .results-heading .results-title{flex:1;min-width:0}
#shell #death .results-heading .ruby-wallet{flex:0 1 auto}
#shell #death .results-heading .result-rank-badge{display:none}
@media(orientation:landscape) and (max-height:650px){
 #shell #death .result-actions{flex-wrap:nowrap}
 #shell #death .result-actions button{flex:1 1 0;overflow-wrap:normal}
 #shell #death #restart{flex:1.4 1 0}
}

@media(orientation:landscape) and (max-height:650px){
 #shell:is([data-text-size=large],[data-text-size=extra]) #death .result-actions{display:grid;grid-template-columns:1fr 1fr;gap:6px}
 #shell:is([data-text-size=large],[data-text-size=extra]) #death .result-actions button{width:100%;padding:6px;min-height:44px;line-height:1.25}
 #shell:is([data-text-size=large],[data-text-size=extra]) #death .result-progress-content{grid-template-columns:minmax(0,1fr)}
}

/* Keep match reminders out of the arena while retaining controller hooks. */
#shell #hud :is(#boost-meter,.signal-controls,#gate-status,#menu-button){display:none!important}
#shell #hud #skill-controls{gap:6px}
#shell #hud #skill-controls .skill-button{
 width:48px;height:48px;min-width:48px;min-height:48px;
 padding:3px;gap:1px;border-radius:10px
}
#shell #hud #skill-controls .skill-button svg{width:20px;height:20px}
#shell #hud #skill-controls .skill-button small{
 max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
#shell #hud #skill-controls .skill-time{
 max-width:100%;overflow:hidden;text-overflow:ellipsis
}
#shell[data-interface-scale=large]:not([data-game-mode=tiny]) #hud #skill-controls .skill-button{
 width:56px;height:56px;min-width:56px;min-height:56px
}
#shell[data-interface-scale=large]:not([data-game-mode=tiny]) #hud #skill-controls .skill-button svg{width:24px;height:24px}
