/* Global Dugout - phones. Loaded last. Names start with mb so nothing clashes. */

/* before the site has picked a page, don't flash the default (MLB / NCAA) tabs; show anyway after 4s if a script failed */
@keyframes mbshow{to{visibility:visible}}
body:not([data-league]) header.top .lgsw,body:not([data-league]) header.top .topnav,body:not([data-league]) header.top label.season,body:not([data-league]) main{visibility:hidden;animation:mbshow 0s 4s forwards}

@media (max-width:760px){
  /* header: logo + language/theme on one line, leagues under it, then search, then the section tabs */
  header.top .wrap{column-gap:14px}
  header.top .brand{order:0}
  header.top .gdprefs,body[data-league] header.top .gdprefs{order:0;margin-left:auto;min-height:44px}
  header.top .lgsw{order:1;flex-basis:100%;min-height:44px;gap:22px}
  header.top .search{order:2;margin:0 0 8px}
  header.top label.season{order:6;margin-left:auto}
  header.top .wrap::before{order:3}
  /* the header slides away while scrolling down and comes back when scrolling up (mobile.js) */
  header.top{transition:transform .22s ease}
  body.mbhide header.top{transform:translateY(-100%)}
  body.mbhide aside.card{top:0!important}
  aside.card{transition:top .22s ease}
  /* profile bar: one line of buttons, no team label (the team is on the card right below) */
  .cardbar .crumb{display:none}
  .cardbar .btn{white-space:nowrap}
  /* section tabs scroll sideways: fade the right edge while there is more to see */
  header.top .topnav.mbmore{-webkit-mask-image:linear-gradient(90deg,#000 82%,transparent);mask-image:linear-gradient(90deg,#000 82%,transparent)}
  /* leader tables: rank + player stay pinned while the stats scroll sideways; long team names are cut */
  .pldtbl th:nth-child(1),.pldtbl td:nth-child(1){position:sticky;left:0;z-index:2;background:var(--panel);min-width:30px}
  .pldtbl th:nth-child(2),.pldtbl td:nth-child(2){position:sticky;left:30px;z-index:2;background:var(--panel);box-shadow:6px 0 6px -6px rgba(0,0,0,.25)}
  .pldtbl td:nth-child(3){max-width:150px;overflow:hidden;text-overflow:ellipsis}
  .pldtbl td:nth-child(2) a{white-space:nowrap}
}

/* player profile header on phones: name gets the room, switch and buttons on their own rows */
@media (max-width:560px){
  .cardbar > div{flex-wrap:nowrap!important;gap:6px!important;overflow:visible!important}
  .cardbar > div > :is(button,a){flex:1 1 0;min-width:0;justify-content:center;text-align:center;margin:0!important;padding:8px 4px!important;font-size:13px!important;white-space:nowrap}
  .cardbar > div > :not(button):not(a){display:none!important}
  .cardtop{flex-direction:column;align-items:stretch;gap:12px}
  .cardtop > .seg{align-self:flex-start}
  .cardid{gap:14px;align-items:center}
  .cardid .headshot{width:76px!important;height:auto!important;flex:none}
  .cardid > div{min-width:0;flex:1}
  .cardid .jersey{font-size:26px!important;line-height:1!important;margin-bottom:2px}
  .cardid h2{font-size:26px!important;line-height:1.12!important;word-break:normal;overflow-wrap:anywhere}
  .cardid .meta{font-size:13px}
}

/* MLB/MiLB team header on phones: name gets the full row, team switcher arrows sit beside it, "Compare all teams" goes below */
@media (max-width:640px){
  #proView .orghead{flex-wrap:wrap;gap:8px 12px}
  #proView .orghead > :first-child{flex:none;width:44px;height:auto;max-height:44px}
  #proView .orghead > div{flex:1 1 0;min-width:0}
  #proView .orghead h2{font-size:24px;line-height:1.15}
  #proView .orghead .tsw{gap:6px}
  #proView .orghead .tswstep button{min-width:30px;min-height:28px}
  #proView .orghead .lblink{order:3;flex-basis:100%;margin-left:0;font-size:13px}
}

/* NCAA standings conference cards on phones: "16 teams · #1 conference" goes under the name instead of colliding with it */
@media (max-width:640px){
  .confcard h2{flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:2px 10px}
  .confcard h2 .cn{flex:none;max-width:100%}
  .confcard h2 small{flex-basis:100%;width:auto;margin-left:0;text-align:left}
}
