@layer shell{
  @media (min-width:1920px){
    :root{--pl-shell-rail:240px}
    .pl39-ui .content{padding-inline:30px}
  }
  @media (min-width:2560px){
    :root{--pl-shell-rail:264px}
    .pl39-ui .content{padding-inline:max(34px,calc((100vw - 2200px)/2))}
  }
  @media (min-width:900px) and (max-width:1366px){
    :root{--pl-shell-rail:188px}
    .pl39-ui .topbar{padding-inline:18px}
    .pl39-ui .content{padding:15px 17px 20px}
    .pl39-ui .sidebar .nav button{padding-inline:14px;font-size:11px}
    .pl39-statusbar span:first-child{display:none}
  }
}

@layer screens{
  @media (max-width:1450px){
    .pl39-player-hero{grid-template-columns:minmax(380px,1.08fr) minmax(310px,.82fr) minmax(190px,.5fr)}
    .pl39-player-hero .pl39-identity{grid-template-columns:112px minmax(0,1fr) auto;gap:16px}
    .pl39-player-hero .pl39-avatar{width:112px;height:176px}
    .pl39-player-hero .pl39-identity h2{font-size:42px}
    .pl39-career-totals{padding:18px}.pl39-career-totals .pl39-metric{padding:14px}
  }
  @media (max-width:1199px){
    .pl39-overview-hero,.pl39-player-hero,.pl39-league-hero,.pl39-calendar-hero,.pl39-career-hero{grid-template-columns:1fr}
    .pl39-overview-match,.pl39-next-summary{border-left:0;border-top:1px solid var(--pl-line)}
    .pl39-overview-hero{min-height:0}.pl39-overview-player,.pl39-overview-match{min-height:310px}
    .pl39-player-hero{background:transparent;gap:10px}.pl39-player-hero>section{min-height:220px}
    .pl39-career-totals{grid-template-columns:repeat(5,1fr)}
    .pl39-sim-launcher{grid-template-columns:repeat(2,1fr)}
    #page-player .attribute-groups{grid-template-columns:repeat(2,1fr)}
  }
  @media (max-width:899px){
    body.pl39-ui{overflow:auto;padding-bottom:76px}
    .pl39-ui .app-shell{width:100%;min-height:100dvh;height:auto;display:block;padding:0}
    .pl39-ui .topbar{position:sticky;z-index:8500;top:0;min-height:68px;height:68px;padding:8px 12px;border-width:0 0 1px;border-radius:0;background:rgba(3,11,18,.96);backdrop-filter:blur(16px)}
    .pl39-ui .brand-mark{width:44px;height:44px}.pl39-ui .brand h1{font-size:16px}.pl39-ui .brand p{font-size:8px}.pl39-statusbar{display:none}
    .pl39-ui .top-actions{margin-left:auto;max-width:48vw;overflow-x:auto;flex-wrap:nowrap}.pl39-ui .top-actions .btn{width:auto;min-width:max-content;flex:0 0 auto}
    .pl39-ui .career-layout{display:block;min-height:0}.pl39-ui .sidebar{position:static;min-height:0;padding:0;border:0;background:none;box-shadow:none}.pl39-ui .sidebar>:not(.nav){display:none}
    .pl39-ui .nav{position:fixed;z-index:8800;left:max(7px,env(safe-area-inset-left));right:max(7px,env(safe-area-inset-right));bottom:max(7px,env(safe-area-inset-bottom));display:grid;grid-template-columns:repeat(5,1fr);gap:3px;padding:5px;border:1px solid var(--pl-line-strong);border-radius:12px;background:rgba(3,10,16,.97);box-shadow:0 20px 55px rgba(0,0,0,.68)}
    .pl39-ui .nav button{min-width:0;min-height:54px;display:grid;place-items:center;gap:1px;padding:5px 2px;font-size:9px;text-align:center;border-radius:8px}.pl39-ui .nav button::before{display:block;width:auto;margin:0;font-size:17px}.pl39-ui .nav button.active{box-shadow:inset 0 -2px 0 var(--pl-prestige);background:rgba(217,174,82,.1);color:var(--pl-prestige-hi)}
    .pl39-ui .content{overflow:visible;padding:11px 10px 22px}
    .pl39-footer{display:none}
    #page-home.active,#page-league.active,#page-calendar.active,#page-career.active{display:grid;grid-template-columns:1fr}
    #page-home>*:not(.pl39-overview-hero),#page-league>*,#page-calendar>*,#page-career>*{grid-column:1!important;grid-row:auto!important}
    .pl39-overview-player,.pl39-overview-match{padding:19px;min-height:0}.pl39-overview-match{min-height:230px}
    .pl39-player-hero>section{padding:19px}.pl39-calendar-date{padding:20px}.pl39-calendar-date h2{font-size:41px}.pl39-career-totals{grid-template-columns:repeat(3,1fr)}
    #page-player .attribute-groups{grid-template-columns:1fr 1fr}
    #page-career .pl3-career-command{grid-template-columns:1fr 1fr}
    .pl39-ui :is(.modal-card,.modal.card){max-width:calc(100vw - 16px);max-height:calc(100dvh - 18px);overflow:auto}
  }
  @media (max-width:599px){
    .pl39-identity{grid-template-columns:82px minmax(0,1fr);align-items:start;gap:13px}.pl39-avatar{width:82px;height:112px}.pl39-avatar-figure{top:15px;scale:.66}.pl39-avatar-initials{font-size:10px}.pl39-identity-copy{min-width:0}.pl39-identity h2{font-size:32px;overflow-wrap:anywhere}.pl39-overall{grid-column:1/-1;width:64px;height:64px;margin-left:auto;font-size:31px}
    .pl39-overview-match{padding:14px}.pl39-player-progress{grid-template-columns:1fr}.pl39-progress-ring{width:100px;height:100px}.pl39-career-totals{grid-template-columns:1fr 1fr;padding:10px}.pl39-career-totals .pl39-metric{min-height:84px;padding:12px}.pl39-sim-launcher{grid-template-columns:1fr}.pl39-sim-launcher button{min-height:82px}
    #page-player .attribute-groups{grid-template-columns:1fr}.pl39-player-hero .pl39-identity,.pl39-career-identity .pl39-identity{grid-template-columns:82px minmax(0,1fr)}.pl39-player-hero .pl39-avatar,.pl39-career-identity .pl39-avatar{width:82px;height:112px}.pl39-player-hero .pl39-identity h2,.pl39-career-identity .pl39-identity h2{font-size:31px}
    .pl39-ui .stats-grid,.pl39-ui .two-col,.pl39-ui .dashboard-grid{grid-template-columns:1fr}.pl39-ui .result-stats{grid-template-columns:1fr 1fr}.pl39-ui .table-wrap{max-width:100%;overflow-x:auto}.pl39-ui table{min-width:620px}
    .pl39-ui .modal-actions{position:sticky;bottom:calc(68px + env(safe-area-inset-bottom));z-index:8;padding:9px;background:rgba(4,12,20,.97)}
    .pl39-footer-context{display:none}
  }
  @media (max-width:359px){
    .pl39-ui .content{padding-inline:6px}.pl39-ui .nav{left:4px;right:4px}.pl39-ui .nav button{font-size:8px}.pl39-ui .brand h1{font-size:14px}.pl39-ui .brand-mark{width:40px;height:40px}.pl39-identity h2{font-size:28px}.pl39-calendar-date h2{font-size:34px}
  }
}
