/*
 * V268 — FINAL Android/Samsung/tablet native-scroll cascade.
 *
 * V266 established the correct intent, but several game-specific mobile
 * stylesheets are loaded later and could restore overflow/touch rules that
 * consume a one-finger vertical drag.  This file is deliberately linked after
 * every game stylesheet.  The companion JS marks non-iOS touch devices, so
 * the already-stable iPhone/iPad path is left untouched.
 */

@media (pointer: coarse), (any-pointer: coarse) {
  html.wos-one-finger-v268 {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: auto !important;
    touch-action: pan-y pinch-zoom !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html.wos-one-finger-v268 body {
    width: 100%;
    max-width: 100%;
    min-height: 100%;
    touch-action: pan-y pinch-zoom !important;
    -webkit-overflow-scrolling: touch;
  }

  /*
   * Keep one authoritative root scroller on ordinary screens.  Explicit
   * modal/result/keyboard locks remain excluded and keep their own overflow.
   * `overflow-y: visible` on body lets documentElement stay the Android root
   * scroller instead of creating a second nested body scroller.
   */
  html.wos-one-finger-v268:not(.word-language-pending) body:not(.wos-page-locked):not(.wos-modal-open):not(.word-ranked-profile-open):not(.kk-ranked-profile-open-v274):not(.wos-keyboard-open):not(.wos-mobile-keyboard-open):not(.wos-player-answer-active):not(.ha-v209-keyboard):not(.kk-result-open):not(.how-to-open):not(.ha-modal-open):not(.legalOpenV181):not(.preseason-open):not(.wos-week-modal-open) {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    overscroll-behavior-x: none !important;
    overscroll-behavior-y: auto !important;
  }

  /*
   * These are layout shells, not gesture surfaces.  A drag that begins on a
   * card, empty board area, ranked panel or page background must remain a
   * normal vertical page pan on Android/Samsung browsers.
   */
  html.wos-one-finger-v268 body:not(.wos-keyboard-open):not(.wos-mobile-keyboard-open):not(.ha-v209-keyboard) :where(
    #root,
    #app,
    main,
    .page,
    .app,
    .site-shell,
    .app-shell,
    .game-shell,
    .sh-shell,
    .wrap,
    .hero,
    .card,
    .panel,
    .game-main,
    .multi-game,
    .game-card,
    .round-arena,
    .round-content,
    .board-wrap,
    .wr-shell,
    .wr-body,
    .ranked-shell,
    .ranked-panel
  ) {
    touch-action: pan-y pinch-zoom !important;
  }

  /* Horizontal rails still swipe sideways, while a vertical intention that
     starts on the rail is allowed to continue as page scrolling. */
  html.wos-one-finger-v268 body:not([data-wos-scroll-axis-lock]) :where(
    .scoreline,
    .scoreboard,
    .attempt-history,
    .tabs,
    .players,
    .ranked-team-grid
  ) {
    touch-action: pan-x pan-y pinch-zoom !important;
  }

  /* Preserve crisp taps and input focus without turning whole cards into
     gesture blockers. */
  html.wos-one-finger-v268 :where(input, textarea, select, button, a, [role="button"]) {
    touch-action: manipulation !important;
  }

  /* Native momentum for every intentionally scrollable inner panel. */
  html.wos-one-finger-v268 :where(
    .wos-scroll,
    .search-menu,
    .player-suggestions,
    .modal-card,
    .ranked-profile-modal,
    .wr-modal,
    .used,
    .eventfeed
  ) {
    -webkit-overflow-scrolling: touch;
  }
}
