/* GFM mobile landscape scrolling layer (single-player + online mode). */
html.gfm-mobile-landscape,
html.gfm-mobile-landscape body {
  width: 100%;
  min-height: 100%;
  overscroll-behavior: none;
}

html.gfm-mobile-landscape body {
  touch-action: pan-y pinch-zoom !important;
}

html.gfm-mobile-landscape .gfm-mobile-scroll-surface {
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior-y: contain !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y pinch-zoom !important;
  scrollbar-gutter: stable;
}

html.gfm-mobile-landscape .gfm-mobile-fit-media {
  display: block;
  max-width: 100% !important;
  max-height: calc(100dvh - 72px) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

@media (orientation: landscape) and (max-height: 760px) {
  html.gfm-mobile-landscape #gameScreen,
  html.gfm-mobile-landscape #teamSelectionScreen,
  html.gfm-mobile-landscape #managerCreationScreen,
  html.gfm-mobile-landscape #leagueSelectionScreen,
  html.gfm-mobile-landscape #globalLobbyScreen,
  html.gfm-mobile-landscape #main-content-area,
  html.gfm-mobile-landscape .main-content {
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y pinch-zoom !important;
  }

  html.gfm-mobile-landscape :is(
    #liveMatchModal,
    #gfm61Live,
    #gfm61Pre,
    #gfm61TopResultsModal,
    #gfmChatPanel,
    #gfmDmDock,
    #gfmDmPanel,
    #gfmOmChatModal,
    #gfmOmChatBox,
    #gfmMediaCenter,
    .modal,
    .modal-content,
    .gfm61-results-modal,
    .gfm-fmm-mobile-modal,
    .gfm-fmm-data-modal,
    .lm3-sheet
  ) {
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y pinch-zoom !important;
  }

  html.gfm-mobile-landscape #liveMatchModal.lm3-root.open,
  html.gfm-mobile-landscape #gfm61Live,
  html.gfm-mobile-landscape #gfm61Pre,
  html.gfm-mobile-landscape #gfm61TopResultsModal.gfm61-results-modal {
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }

  html.gfm-mobile-landscape #liveMatchModal :is(.lm3, .lm3-body, .lm3-center, .lm3-pane, .lm3-ov),
  html.gfm-mobile-landscape #gfm61Live :is(.gfm-fmm-shell, .gfm-fmm-main, .gfm-fmm-dashboard),
  html.gfm-mobile-landscape #gfm61MobileContent,
  html.gfm-mobile-landscape #gfm61DataContent,
  html.gfm-mobile-landscape .gfm61-results-sheet,
  html.gfm-mobile-landscape .gfm-fmm-mobile-sheet,
  html.gfm-mobile-landscape .gfm-fmm-data-sheet {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html.gfm-mobile-landscape #gfmChatPanel.is-open,
  html.gfm-mobile-landscape #gfmDmPanel.is-open,
  html.gfm-mobile-landscape #gfmOmChatBox {
    max-height: calc(100dvh - 12px) !important;
    overflow-y: auto !important;
  }

  html.gfm-mobile-landscape :is(
    #gfmChatLog,
    #gfmDmBody,
    #gfmOmChatMessages,
    #gfmOnlineManagersForceBody,
    #gfmOnlineManagersListOnlyBody
  ) {
    overflow-y: auto !important;
    overscroll-behavior-y: contain !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y pinch-zoom !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.gfm-mobile-landscape .gfm-mobile-scroll-surface {
    scroll-behavior: auto !important;
  }
}
