/* DASM Beta device-specific finishing layer — R6.26
   Loaded after styles.css so real-device portrait/landscape corrections win over legacy/service-worker styling. */

/* iPad/tablet portrait */
@media (min-width:761px) and (max-width:1100px) and (orientation:portrait){
  html body .brand-banner .brand-orbit{
    position:absolute!important;right:10px!important;left:auto!important;top:50%!important;
    width:124px!important;height:124px!important;margin:0!important;
    transform:translateY(-50%)!important;
  }
  html body .brand-banner .brand-orbit .brand-ball,
  html body .brand-banner .brand-ball{
    position:absolute!important;left:50%!important;top:50%!important;right:auto!important;
    width:108px!important;height:108px!important;margin:0!important;
    transform:translate(-50%,-50%)!important;object-fit:contain!important;
  }

  body:not(:has(#view-live)) .tabs.secondary-collapsed{
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 40px!important;
    grid-template-rows:auto!important;
    column-gap:6px!important;row-gap:0!important;
    height:auto!important;min-height:0!important;
  }
  body:not(:has(#view-live)) .tabs.secondary-collapsed .primary-wrap{
    grid-column:1!important;grid-row:1!important;
    width:100%!important;padding-right:7px!important;
  }
  body:not(:has(#view-live)) .tabs.secondary-collapsed #secondaryNav{display:none!important}
  body:not(:has(#view-live)) .tabs.secondary-collapsed #secondaryNavMinimise{
    display:grid!important;place-items:center!important;
    position:static!important;transform:none!important;
    grid-column:2!important;grid-row:1!important;
    align-self:center!important;justify-self:stretch!important;
    width:40px!important;height:38px!important;min-width:40px!important;
    margin:0!important;z-index:30!important;
  }

  /* Teams portrait: all controls on one continuous bar, no second row. */
  html body #view-teams .page-head{margin-bottom:6px!important}
  html body #view-teams .teams-toolbar{
    display:grid!important;
    grid-template-columns:180px 190px minmax(0,1fr)!important;
    grid-template-rows:42px!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;height:42px!important;min-height:42px!important;
    margin:0 0 8px!important;padding:0!important;
  }
  html body #view-teams .teams-mode-toggle{
    grid-column:1!important;grid-row:1!important;
    width:100%!important;max-width:none!important;margin:0!important;
  }
  html body #view-teams .teams-club-filter{
    grid-column:2!important;grid-row:1!important;
    width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;
  }
  html body #view-teams .teams-club-filter>span{display:none!important}
  html body #view-teams .teams-club-filter .club-picker,
  html body #view-teams .teams-club-filter .club-picker-button{
    width:100%!important;min-width:0!important;max-width:none!important;height:40px!important;min-height:40px!important;
  }
  html body #view-teams .team-actions{
    grid-column:3!important;grid-row:1!important;
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    align-items:center!important;justify-self:stretch!important;
    gap:6px!important;width:100%!important;max-width:none!important;margin:0!important;
  }
  html body #view-teams .team-actions .button,
  html body #view-teams .team-actions .button.small{
    width:100%!important;min-width:0!important;max-width:none!important;
    min-height:40px!important;height:40px!important;
    padding:6px 7px!important;white-space:nowrap!important;line-height:1!important;
  }

  /* Portrait table width balance: show every full team name without reducing type. */
  html body #view-table .season-table .col-pos{width:68px!important}
  html body #view-table .season-table .col-team{width:234px!important}
  html body #view-table .season-table .col-points{width:62px!important}
  html body #view-table .season-table .col-manager{width:130px!important}
  html body #view-table .season-table col:not([class]){width:62.5px!important}
  html body #view-table .season-table td.rank{padding-left:8px!important;padding-right:5px!important}
  html body #view-table .season-table td.rank .rank-with-trend{
    display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;
    gap:3px!important;width:54px!important;max-width:54px!important;
  }
  html body #view-table .season-table td.rank .rank-trend{
    width:20px!important;height:20px!important;min-width:20px!important;min-height:20px!important;
    flex:0 0 20px!important;
  }
  html body #view-table .season-table .team-cell{padding-left:4px!important}
}

/* Phone/mobile landscape: treat it as mobile, not as a small tablet. */
@media (min-width:761px) and (max-width:932px) and (orientation:landscape) and (max-height:500px){
  /* Table: give Pos enough room for rank + movement so it cannot run into the team logo. */
  html body #view-table .season-table .col-pos{width:72px!important}
  html body #view-table .season-table td.rank{padding-left:8px!important;padding-right:4px!important}
  html body #view-table .season-table td.rank .rank-with-trend{
    display:inline-flex!important;align-items:center!important;justify-content:flex-start!important;
    gap:3px!important;width:58px!important;max-width:58px!important;
  }
  html body #view-table .season-table td.rank .rank-trend{
    width:22px!important;height:22px!important;min-width:22px!important;min-height:22px!important;
    flex:0 0 22px!important;
  }
  html body #view-table .season-table .team-cell{padding-left:4px!important}

  /* Teams: one landscape toolbar row, immediately under the header. */
  html body #view-teams .page-head{margin-bottom:6px!important}
  html body #view-teams .teams-toolbar{
    display:grid!important;
    grid-template-columns:160px 145px minmax(0,1fr)!important;
    grid-template-rows:42px!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;height:42px!important;min-height:42px!important;
    margin:0 0 8px!important;padding:0!important;
  }
  html body #view-teams .teams-mode-toggle{
    grid-column:1!important;grid-row:1!important;
    width:160px!important;margin:0!important;
  }
  html body #view-teams .teams-club-filter{
    grid-column:2!important;grid-row:1!important;
    width:145px!important;min-width:0!important;margin:0!important;
  }
  html body #view-teams .teams-club-filter>span{display:none!important}
  html body #view-teams .teams-club-filter .club-picker,
  html body #view-teams .teams-club-filter .club-picker-button{
    width:145px!important;min-width:0!important;height:40px!important;min-height:40px!important;
  }
  html body #view-teams .team-actions{
    grid-column:3!important;grid-row:1!important;
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    align-items:center!important;gap:6px!important;
    width:100%!important;margin:0!important;
  }
  html body #view-teams .team-actions .button,
  html body #view-teams .team-actions .button.small{
    width:100%!important;min-width:0!important;min-height:40px!important;height:40px!important;
    padding:6px 7px!important;white-space:nowrap!important;line-height:1!important;
  }
}

/* All wider landscape layouts: keep every Teams control on one continuous bar. */
@media (min-width:761px) and (max-width:1366px) and (orientation:landscape){
  html body #view-teams .page-head{margin-bottom:6px!important}
  html body #view-teams .teams-toolbar{
    display:grid!important;
    grid-template-columns:minmax(150px,180px) minmax(145px,190px) minmax(0,1fr)!important;
    grid-template-rows:42px!important;
    align-items:center!important;
    gap:8px!important;
    width:100%!important;height:42px!important;min-height:42px!important;
    margin:0 0 8px!important;padding:0!important;
  }
  html body #view-teams .teams-mode-toggle{
    grid-column:1!important;grid-row:1!important;
    width:100%!important;max-width:none!important;margin:0!important;
  }
  html body #view-teams .teams-club-filter{
    grid-column:2!important;grid-row:1!important;
    width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;
  }
  html body #view-teams .teams-club-filter>span{display:none!important}
  html body #view-teams .teams-club-filter .club-picker,
  html body #view-teams .teams-club-filter .club-picker-button{
    width:100%!important;min-width:0!important;max-width:none!important;height:40px!important;min-height:40px!important;
  }
  html body #view-teams .team-actions{
    grid-column:3!important;grid-row:1!important;
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    align-items:center!important;justify-self:stretch!important;
    gap:6px!important;width:100%!important;max-width:none!important;margin:0!important;
  }
  html body #view-teams .team-actions .button,
  html body #view-teams .team-actions .button.small{
    width:100%!important;min-width:0!important;max-width:none!important;
    min-height:40px!important;height:40px!important;
    padding:6px 7px!important;white-space:nowrap!important;line-height:1!important;
  }
}
