/* Route-level accessibility foundations.
 *
 * Loaded last so keyboard focus and minimum target sizing cannot be erased by
 * route-specific styles. Keep the 24px floor aligned with WCAG 2.2 SC 2.5.8.
 */

#app-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* API-backed profiles replace the legacy visible header with the hero card,
 * but the route still needs its H1 in the accessibility tree. */
.stats-header-semantic-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10000;
  min-height: 44px;
  padding: 10px 16px;
  display: inline-flex;
  align-items: center;
  color: var(--bg);
  background: var(--accent);
  border: 2px solid var(--bg);
  border-radius: var(--radius);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(calc(-100% - 20px));
  transition: transform 120ms ease-out;
}

.skip-link:focus {
  transform: translateY(0);
}

:is(
  a[href],
  button,
  input,
  select,
  textarea,
  [role="button"],
  [role="tab"],
  [role="menuitem"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 3px !important;
}

:is(
  button,
  select,
  input:not([type="hidden"]),
  [role="button"],
  [role="tab"],
  [role="menuitem"]
) {
  min-width: 24px;
  min-height: 24px;
}

:is(
  .site-nav-link,
  .account-popover-action,
  .card-view-all,
  .library-link,
  .stats-activity-link,
  .gallery-back,
  .lb-play-btn,
  .activity-game-launch,
  .privacy-container a,
  .tos-container a,
  .cs-container a,
  .ack-container a
) {
  min-height: 24px;
}

@media (pointer: coarse), (max-width: 640px) {
  :is(
    .site-header button,
    .site-header .site-nav-link,
    .site-header-dropdown .site-nav-link,
    .page-header button,
    .rooms-filter-tab,
    .gallery-filter-chip,
    .replays-browse-mode-btn,
    .friends-tab,
    .activity-tab,
    .lb-pagination button,
    .top100-tab
  ) {
    min-width: 44px;
    min-height: 44px;
  }
}
