/* Shared screen fit: loaded last in both the game and its private admin. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-padding-top:16px}
img{max-width:100%}
:where(main,.panel,.heading,.panel-title,.grid,.cards,.split,.stats,.person-budget,.person-cards,.ranked-target-grid,.detail-columns,.detail-facts)>*{min-width:0}
:where(h1,h2,h3,h4,p,label,.player-name-link,.person-budget strong,.detail-facts strong){overflow-wrap:anywhere}
:where(.heading,.panel-title,.person-tabs,.tabs,.actions,.saved-career,.unlock-banner){gap:12px;flex-wrap:wrap}
:where(.actions button,.actions a,.person-tabs button,.tabs button){max-width:100%;white-space:normal}
:where(input,select,textarea){max-width:100%;min-width:0}
:where(.table-wrap,.admin-table-wrap){max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
:where(button,a,input,select,textarea):focus-visible{outline:2px solid #e6c589;outline-offset:3px}
/* An actual centered drawing avoids glyph/font and inherited padding offsets. */
.mail-close,.draft-close{position:relative}
:is(.mail-close,.draft-close,.dialog-x,.lol-close,.detail-close){display:inline-grid;place-items:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;padding:0!important;margin:0;font-size:0!important;line-height:1;letter-spacing:0;box-sizing:border-box;align-self:center;overflow:hidden;isolation:isolate}
:is(.mail-close,.draft-close,.dialog-x,.lol-close,.detail-close)::before,
:is(.mail-close,.draft-close,.dialog-x,.lol-close,.detail-close)::after{content:"";position:absolute;left:50%;top:50%;width:21px;height:2px;border-radius:2px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}
:is(.mail-close,.draft-close,.dialog-x,.lol-close,.detail-close)::after{transform:translate(-50%,-50%) rotate(-45deg)}
:is(.mail-close,.draft-close,.dialog-x,.lol-close,.detail-close):hover{transform:none}
.draft-close{align-self:flex-start}
/* Keep every modal reachable on short screens and with mobile browser chrome. */
dialog{max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
dialog.mail-dialog{width:min(1120px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:hidden}
.mail-shell{max-height:calc(100dvh - 26px);min-height:0}
.mail-heading,.mail-toolbar,.mail-footnote{flex-shrink:0}
.mail-heading{gap:16px;min-height:80px}
.mail-heading>div{min-width:0}
.mail-heading h2{flex-wrap:wrap;margin:0;line-height:1.4}
.mail-count{white-space:nowrap}
.mail-columns{flex:1 1 auto;min-height:0;grid-template-columns:minmax(0,39fr) minmax(0,61fr)}
.mail-list,.mail-reader{min-width:0;min-height:0;overscroll-behavior:contain}
.mail-row-meta>span{min-width:0;overflow-wrap:anywhere}
.mail-row-meta>time,.mail-row-meta>small{flex-shrink:0}
.mail-row .rift-icon,.mail-row .team-logo,.mail-sender-logo{flex-shrink:0}
.mail-footnote{font-size:11px;line-height:1.5;padding:10px 14px;overflow-wrap:anywhere}
.mail-reader-empty{height:auto;min-height:240px;gap:12px}
.mail-reader-empty h3{font-size:clamp(19px,2.2vw,24px);margin:0}
.mail-reader-empty p{max-width:48ch;margin:0}
.mail-reader-empty>span:last-child{margin-top:8px}
/* Titles and illustrations preserve their hierarchy without forcing wide columns. */
.dossier-heading{padding-right:52px}
.dossier-heading h2{font-size:clamp(24px,3.4vw,42px)}
.dossier-portrait{flex-shrink:0}
.detail-hero{padding-right:48px}
.detail-hero>div{min-width:0}
.detail-hero>img,.detail-hero>b,.mastery-row img,.recent-match img{flex-shrink:0}
.gear-visual img,.trophy-card>img,.trophy-art-card>img,.setup-slots img{object-fit:contain}
.champ-card,.person-card,.player-card,.rank-tile{min-width:0}
.streaming-panel .person-budget strong{font-size:clamp(18px,2vw,28px)}
@media(max-width:800px){
 .shell>header{height:auto;min-height:64px;gap:10px 18px;padding:14px 18px;align-items:center;flex-wrap:wrap}
 #breadcrumb,#date{min-width:0;line-height:1.6;overflow-wrap:anywhere}
 #cloud-account{gap:8px}
 .heading h1{font-size:clamp(24px,5vw,32px);line-height:1.25}
 .ranked-target{white-space:normal}
 .admin-title,.admin-header{flex-wrap:wrap}
 .admin-title h1{font-size:clamp(30px,6vw,44px)}
}
@media(max-width:650px){
 dialog:not(.mail-dialog){max-width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 #dialog:not(.mail-dialog):not(.creation-draft):not(.live-match-dialog):not(.dossier-dialog):not(.competition-dialog):not(.promotion){padding:22px 18px}
 #dialog h2{font-size:clamp(23px,6vw,32px);line-height:1.25}
 dialog.mail-dialog{width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}
 .mail-shell{max-height:calc(100dvh - 18px)}
 .mail-heading{padding:14px!important;min-height:72px;gap:10px}
 .mail-heading h2{font-size:18px!important;gap:7px}
 .mail-toolbar{padding:10px 12px;gap:8px}
 .mail-filters{gap:6px}
 .mail-filters button{min-height:40px;padding:8px 11px;font-size:12px}
 .mail-toolbar>.text-button{white-space:normal;font-size:12px;min-height:40px}
 .mail-columns{display:block;height:min(560px,60dvh);min-height:0;overflow:auto}
 .mail-list{max-height:180px;max-height:clamp(100px,24dvh,200px)}
 .mail-row{padding:12px;min-height:80px}
 .mail-row small{font-size:11px}
 .mail-row-meta{font-size:12px}
 .mail-reader{padding:22px 16px;min-height:0;overflow:visible}
 .mail-reader-empty{min-height:200px}
 .mail-reader-empty>.rift-icon{--icon-size:64px}
 .mail-body{font-size:14px;line-height:1.8}
 .mail-reader-empty p{font-size:14px}
 .mail-footnote{font-size:10px;padding:8px 12px}
 .person-tabs button{flex:1 1 120px;padding:12px;min-height:44px}
 .person-tabs small{display:inline-block}
 .panel-title{align-items:flex-start}
 .text-button{white-space:normal}
 .tabs{flex-wrap:wrap}
 .actions>button,.actions>a{min-height:44px}
 input,select,textarea{font-size:16px}
 .draft-catalog input,.catalog-controls input,.catalog-controls select,.starter-select select,.admin-toolbar input,.chart-title select{font-size:16px}
 .dossier-shell,.competition-result,.trophy-gallery{padding:20px 14px}
 .dossier-heading{gap:12px;flex-wrap:wrap}
 .dossier-heading .dossier-overall{margin-left:0}
 .detail-hero{gap:12px;flex-wrap:wrap;padding-top:28px;padding-right:0}
 .detail-hero h2{font-size:26px}
 .detail-hero>b{margin-left:0}
 .admin-stats{grid-template-columns:repeat(3,minmax(0,1fr))}
 .admin-stats span{font-size:11px;overflow-wrap:anywhere}
 .admin-stats b{font-size:clamp(23px,6vw,30px)}
 .admin-empty{padding:24px 12px}
 .detail-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
 .recent-match{flex-wrap:wrap}
 .recent-match>span{flex:1 1 130px;overflow-wrap:anywhere}
 .live-phase{max-width:calc(100% - 16px);white-space:normal;text-align:center;font-size:9px}
 .live-map-key{gap:8px;max-width:calc(100% - 12px);font-size:9px}
 .live-roster-row small{white-space:normal;overflow-wrap:anywhere}
}
@media(max-width:380px){
 .role-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .hero-copy .actions{gap:8px}
 .hero-copy .actions>button{width:100%}
 .rank-current{flex-wrap:wrap;gap:16px}
 .rank-large{width:150px;height:150px}
 .person-budget{gap:8px}
 .person-budget strong{font-size:19px}
 .mail-filters button{padding:8px 9px}
 .mail-heading .rift-icon{--icon-size:26px}
 .setup-slots{grid-template-columns:repeat(2,minmax(0,1fr))}
 .admin-brand{letter-spacing:1px}
}
@media(max-height:500px) and (orientation:landscape){
 .mail-heading{min-height:58px;padding:8px 14px!important}
 .mail-toolbar{padding:6px 12px}
 .mail-columns{height:50dvh}
 .mail-footnote{padding:4px 12px}
}

/* Compact career views */
.compact-attribute-row{grid-template-columns:minmax(100px,1.35fr) minmax(38px,.8fr) 35px;cursor:default}.compact-attribute-row:hover{background:transparent}
.solo-hero{padding:16px;min-height:0;gap:16px}.solo-hero h2{font-size:22px;margin:4px 0}.solo-hero p{font-size:12px;margin:6px 0}.solo-hero .actions{margin-top:10px}.solo-hero .solo-crown{width:56px;height:56px}.solo-leader{padding:10px;min-width:0}.solo-leader strong{font-size:18px}
.economy-kpis{gap:10px;margin:14px 0}.economy-kpis article{padding:12px;min-height:0}.economy-kpis strong{font-size:22px;margin:6px 0}.economy-kpis small{font-size:10px}.economy-kpis span{font-size:11px}.economy-totals{margin:12px 0}.competition-tabs{flex-wrap:wrap}
.competition-earned .trophy-card{display:flex;align-items:center;gap:14px;text-align:left;padding:12px;min-height:0}.competition-earned .trophy-card img{width:64px;height:76px;object-fit:contain;margin:0}.competition-earned .trophy-card h3{font-size:15px;margin:4px 0}.competition-starts article{display:flex;justify-content:space-between;gap:12px;padding:12px 0;border-bottom:1px solid #293d4b;font-size:13px}.competition-starts article span{color:var(--muted);white-space:nowrap}.competition-starts button{margin-top:14px}.calendar-milestone{display:block;color:#dfc47e;font-size:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.transfer-tabs{margin:12px 0 18px}
@media(max-width:640px){.economy-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.solo-hero{display:flex;flex-direction:column;align-items:stretch}.solo-leader{display:flex;justify-content:flex-start}.competition-starts article{flex-direction:column;gap:4px}.competition-earned .trophy-shelf{grid-template-columns:1fr}.calendar-legend{flex-wrap:wrap}}

/* Focused home and compact amateur circuit */
.heritage-dashboard .dashboard-grid{grid-template-columns:minmax(0,1fr)}
.ranked-day-complete{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;margin:16px 0;border-color:#b79a5f;background:#15262d}.ranked-day-complete h2{font-size:18px;margin:0 0 6px}.ranked-day-complete p{font-size:13px;margin:0;color:var(--muted)}.ranked-day-complete button{flex-shrink:0}
.career-day-panel{flex-wrap:wrap}.career-day-panel .career-day-copy{flex:1 1 340px;min-width:0}.career-day-panel.day-locked{border-color:#52636c;background:#10232e}.career-day-panel .actions{flex-wrap:wrap;flex-shrink:0;gap:8px;margin:0}.career-day-panel .actions button{min-height:44px;white-space:normal}.career-day-checklist{display:flex;flex-wrap:wrap;gap:8px 18px;list-style:none;padding:0;margin:14px 0 0;font-size:12px;line-height:1.5}.career-day-checklist li{display:flex;flex-wrap:wrap;gap:5px 7px;align-items:center;color:#b6c7d2}.career-day-checklist strong{font-weight:600;color:#e0e9ef}.career-day-checklist .done>span{color:#82dccc}.career-day-checklist .todo>span{color:#e2bf82}.career-day-panel .career-day-fixture{margin-top:9px;color:#d9c396;font-size:12px}.career-day-panel.day-ready{border-color:#b79a5f}
body[data-screen=amateur] .amateur-grid{gap:12px;margin:14px 0;grid-template-columns:repeat(auto-fit,minmax(min(230px,100%),1fr))}body[data-screen=amateur] .panel{padding:14px;min-height:0}body[data-screen=amateur] h2{font-size:19px;margin:8px 0}body[data-screen=amateur] h3{font-size:16px;margin:6px 0}body[data-screen=amateur] .panel p{font-size:12px;line-height:1.5;margin:7px 0}body[data-screen=amateur] .amateur-number{font-size:28px;margin:8px 0}body[data-screen=amateur] .amateur-cup{width:64px;height:82px;background:transparent}body[data-screen=amateur] .amateur-level{display:grid;grid-template-columns:64px minmax(0,1fr);gap:4px 12px;align-items:center}body[data-screen=amateur] .amateur-level .amateur-cup{grid-row:1/4}body[data-screen=amateur] .amateur-level small{font-size:10px}body[data-screen=amateur] .amateur-invite{grid-template-columns:64px minmax(0,1fr);gap:14px;margin:12px 0}body[data-screen=amateur] .amateur-invite .actions{margin-top:10px}body[data-screen=amateur] .amateur-history{padding:8px 0;font-size:12px}
@media(max-width:650px){.ranked-day-complete{flex-direction:column;align-items:stretch}.ranked-day-complete button{width:100%}body[data-screen=amateur] .amateur-invite{grid-template-columns:minmax(0,1fr)}body[data-screen=amateur] .amateur-invite>.amateur-cup{margin:0}body[data-screen=amateur] .amateur-grid{grid-template-columns:1fr}}

.aside-bottom[hidden]{display:none!important}

.match-report-actions{position:sticky;top:0;z-index:5;display:flex;justify-content:flex-end;padding:8px 0;background:#091521}.match-report-actions button{margin:0;min-height:44px;padding:10px 16px;font-size:13px}
.match-report .ranked-result{padding:12px 14px;margin:10px 0}.ranked-result-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}.ranked-result-heading h3{font-size:13px;margin:0}.ranked-result-heading>strong{font-size:12px;color:#b7f276;white-space:nowrap}.ranked-result .ranked-gains{gap:8px}.ranked-result .ranked-gains>div{display:grid;grid-template-columns:1fr auto;gap:3px 8px;padding:8px 10px;font-size:12px;min-width:0}.ranked-result .ranked-gains>div>strong{grid-column:1/-1;font-size:12px}.ranked-result .ranked-gains>div>span{color:var(--muted)}.ranked-result-detail{margin-top:8px;font-size:11px;color:var(--muted)}.ranked-result-detail summary{cursor:pointer;padding:4px 0}.ranked-result-detail p{margin:5px 0;font-size:11px;line-height:1.4}
@media(max-width:650px){.match-report-actions button{width:100%}.match-report .ranked-result{padding:10px}.ranked-result-heading{align-items:flex-start}.ranked-result-heading h3{font-size:12px}.ranked-result .ranked-gains{grid-template-columns:1fr;gap:4px}.ranked-result .ranked-gains>div{grid-template-columns:minmax(0,1fr) auto auto;align-items:center;padding:7px 8px;gap:6px}.ranked-result .ranked-gains>div>strong{grid-column:auto}.ranked-result .ranked-gains>div>span,.ranked-result .ranked-gains>div>b{white-space:nowrap}}

.mail-reader .mail-body-short{font-size:14px;line-height:1.55;margin:12px 0;white-space:pre-line}.mail-reader .mail-key-facts{margin:10px 0;padding:12px 14px 12px 30px;border-left:2px solid #b79a5f;background:#10232e;font-size:13px;line-height:1.5}.mail-key-facts li+li{margin-top:6px}.mail-full-message{font-size:12px;color:var(--muted);margin:12px 0}.mail-full-message summary{cursor:pointer;padding:6px 0}.mail-full-message .mail-body{font-size:13px;line-height:1.5}.mail-reader>h3{font-size:21px;line-height:1.25}.mail-reader>.primary{margin-top:12px}

@media(max-width:650px){.career-day-panel .career-day-copy{flex-basis:auto}.career-day-panel .actions{width:100%}}
