/* Dedicated touch layout for the manager planner. The desktop editor contains
   intentionally compact controls; on phones those controls need their own
   scale and spacing instead of being rendered as a miniature desktop board. */
@media (max-width: 820px) {
  .manager-screen {
    width: auto;
    min-width: 0;
  }

  .manager-commandbar {
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
  }

  .manager-commandbar > div:first-child {
    gap: 3px;
  }

  .manager-commandbar p {
    font-size: .72rem !important;
  }

  .manager-commandbar h2 {
    font-size: 1.35rem !important;
  }

  .manager-commandbar > div:first-child > span {
    display: none;
  }

  .manager-commandbar button {
    min-height: 44px;
    padding-inline: 12px;
    font-size: .76rem !important;
  }

  .manager-workspace {
    gap: 8px;
    min-width: 0;
    margin-inline: 0;
    padding-bottom: 18px;
  }

  .manager-workspace-bar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 13px;
  }

  .manager-workspace-bar > button:first-child {
    grid-column: 1;
    grid-row: 1;
    min-height: 42px;
    justify-self: start;
    align-self: start;
  }

  .manager-workspace-bar > div {
    display: none;
  }

  .manager-workspace-bar > .is-save {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    min-height: 42px;
    justify-self: end;
    font-size: .74rem !important;
  }

  .manager-workspace-bar p,
  .lineup-editor-head p,
  .lineup-player-pool header p {
    font-size: .7rem !important;
  }

  .manager-workspace-bar h2 {
    overflow: hidden;
    font-size: 1.15rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .manager-workspace-bar > div > span {
    display: block;
    overflow: hidden;
    font-size: .68rem !important;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .manager-planner-layout {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    min-width: 0;
  }

  .planner-event-list {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }

  .planner-main,
  .planner-tabs,
  .lineup-editor {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .planner-event-list > header {
    min-width: 108px;
    padding: 13px 12px;
  }

  .planner-event-list > header span {
    font-size: .62rem !important;
  }

  .planner-event-list > header b {
    font-size: .9rem !important;
  }

  .planner-event-list > button {
    min-width: min(74vw, 290px);
    min-height: 76px;
    gap: 11px;
    padding: 11px 12px;
    scroll-snap-align: start;
  }

  .planner-event-list time {
    width: 48px;
    height: 50px;
    font-size: .62rem !important;
  }

  .planner-event-list time b {
    font-size: 1.25rem !important;
  }

  .planner-event-list button > span b {
    font-size: .82rem !important;
  }

  .planner-event-list button > span small {
    font-size: .68rem !important;
  }

  .planner-event-list em {
    font-size: .67rem !important;
  }

  .planner-tabs {
    gap: 24px;
    min-height: 54px;
    padding-inline: 14px;
  }

  .planner-tabs button {
    min-height: 54px;
    font-size: .82rem !important;
  }

  .lineup-editor {
    padding: 14px 12px 12px;
  }

  .lineup-editor-head {
    gap: 12px;
    margin-bottom: 12px;
  }

  .lineup-editor-head h3 {
    font-size: 1.05rem !important;
  }

  .lineup-editor-head > div:first-child > span,
  .lineup-complete {
    font-size: .7rem !important;
  }

  .lineup-editor-head button {
    min-height: 40px;
    padding-inline: 13px;
    font-size: .72rem !important;
  }

  .lineup-workbench {
    gap: 12px;
  }

  .lineup-pitch {
    min-height: 570px;
  }

  .lineup-slot {
    width: 88px;
    min-height: 82px;
    grid-template-columns: 1fr;
    grid-template-rows: 19px 44px 19px;
    justify-items: center;
    touch-action: none;
  }

  .lineup-slot small {
    grid-column: 1;
    width: auto;
    min-width: 32px;
    padding: 2px 6px;
    font-size: .62rem !important;
    text-align: center;
  }

  .lineup-slot > span {
    width: 44px;
    height: 44px;
    font-size: .64rem !important;
  }

  .lineup-slot > b {
    width: 88px;
    max-width: 88px;
    padding: 3px 5px;
    font-size: .62rem !important;
    line-height: 1.2;
    text-align: center;
  }

  .lineup-player-pool {
    min-height: 0;
    padding: 14px 12px;
  }

  .lineup-player-pool h3 {
    font-size: 1rem !important;
  }

  .lineup-player-pool header > span,
  .pool-hint {
    font-size: .7rem !important;
  }

  .pool-hint {
    margin: 10px 0;
    padding: 10px;
  }

  .pool-player-list > button {
    min-height: 58px;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    padding: 8px 10px;
  }

  .pool-player-list > button > span {
    width: 42px;
    height: 42px;
    font-size: .68rem !important;
  }

  .pool-player-list b {
    font-size: .82rem !important;
  }

  .pool-player-list small {
    font-size: .68rem !important;
  }

  .pool-player-list em {
    font-size: 1rem !important;
  }

  .pool-dropzone {
    min-height: 78px;
    margin-top: 12px;
    padding: 10px;
    font-size: .68rem !important;
  }

  .remove-selected {
    min-height: 44px;
    margin-top: 8px;
    font-size: .74rem !important;
  }
}

@media (max-width: 430px) {
  .manager-workspace-bar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .manager-workspace-bar > .is-save {
    grid-column: 2;
  }

  .lineup-pitch {
    min-height: 560px;
  }

  .lineup-slot {
    width: 84px;
  }

  .lineup-slot > b {
    width: 84px;
    max-width: 84px;
    font-size: .59rem !important;
  }
}
