/*
 * HAWK-EYE League mobile hardening.
 * Desktop/fine-pointer League UI intentionally remains unchanged.
 */

/*
 * The portrait head-to-head ledger is mobile-only. Keep it out of the
 * desktop layout unless the portrait/coarse-pointer media query below
 * explicitly enables it.
 */
.league-h2h-portrait {
  display: none;
}

@media (max-width: 767px), (hover: none) and (pointer: coarse) {
  /* Keep League controls dense while preserving thumb-sized actions. */
  main select,
  main button {
    scroll-margin-bottom: calc(7rem + var(--bbo-safe-bottom));
  }

  /* Compact RobotPlate cosmetics must retain their authored proportions. */
  main .league-mobile-plate {
    width: min(176px, 100%) !important;
    max-width: 176px !important;
    height: auto !important;
    aspect-ratio: 6 / 1;
  }

  main .league-mobile-plate > img {
    object-fit: contain !important;
  }

  /* Round schedule rows are primary touch targets. */
  main .league-round-fight {
    min-height: 52px;
  }

  /* Compact mobile modes keep the portrait ledger hidden unless the device is actually portrait. */
  .league-h2h-portrait {
    display: none;
  }

  .league-h2h-ledger-row {
    min-height: 56px;
  }
}

@media (orientation: portrait) and (hover: none) and (pointer: coarse) {
  .league-h2h-portrait {
    display: block !important;
  }

  .league-h2h-matrix {
    display: none !important;
  }
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
  .league-h2h-portrait {
    display: none !important;
  }

  .league-h2h-matrix {
    display: block !important;
  }

  /* The matrix is intentionally spatial; allow controlled horizontal travel on narrow landscape phones. */
  .league-h2h-matrix-scroll {
    overflow-x: auto !important;
    overflow-y: visible !important;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .league-h2h-matrix-scroll > table {
    min-width: 760px;
  }
}
