/* Player v3.10.135 — compact browse grid + non-sticky search.
   Featured hero remains large. Game browse rails use dense cards:
   8 columns on desktop, 6 on tablet, 4 on phones. */

/* Search/filter belongs to the browse flow; it must scroll away normally. */
#gameLobby > #lobbyStickySearch,
#lobbyStickySearch {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 10 !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 10px !important;
  padding: 8px !important;
  transform: none !important;
}

@media (min-width: 861px) {
  #gameLobby > #lobbyStickySearch {
    grid-column: 2 !important;
  }

  #lobbyStickySearch .lobby-filter-tools {
    grid-template-columns: minmax(220px, 1fr) minmax(145px, 190px) auto !important;
    gap: 8px !important;
  }
}

/* Compact game browsing: fixed-density rows instead of horizontal 1fr rails.
   This prevents a single published game from stretching across the whole page. */
#gameLobby .compact-games-grid,
#gameLobby #categoriesSection .compact-games-grid,
#gameLobby #hotSection .compact-games-grid,
#gameLobby #newSection .compact-games-grid,
#gameLobby #mostPlayedSection .compact-games-grid {
  display: grid !important;
  grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  grid-auto-columns: unset !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  overflow: visible !important;
  padding: 2px 0 4px !important;
  scroll-snap-type: none !important;
}

#gameLobby .compact-game-card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  border-radius: 12px !important;
  scroll-snap-align: none !important;
}

#gameLobby .compact-game-media {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  min-height: 0 !important;
}

#gameLobby .compact-game-copy {
  min-width: 0 !important;
  padding: 6px 7px 7px !important;
}

#gameLobby .compact-game-copy strong {
  display: block !important;
  min-width: 0 !important;
  font-size: 11px !important;
  line-height: 1.15 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

#gameLobby .compact-game-copy span {
  display: block !important;
  margin-top: 3px !important;
  font-size: 8px !important;
  line-height: 1.15 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

/* Mid-size/tablet density. */
@media (min-width: 621px) and (max-width: 860px) {
  #gameLobby .compact-games-grid,
  #gameLobby #categoriesSection .compact-games-grid,
  #gameLobby #hotSection .compact-games-grid,
  #gameLobby #newSection .compact-games-grid,
  #gameLobby #mostPlayedSection .compact-games-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  #gameLobby > #lobbyStickySearch {
    order: 3 !important;
  }
}

/* Phone: exactly four browse tiles per row. */
@media (max-width: 620px) {
  #gameLobby .compact-games-grid,
  #gameLobby #categoriesSection .compact-games-grid,
  #gameLobby #hotSection .compact-games-grid,
  #gameLobby #newSection .compact-games-grid,
  #gameLobby #mostPlayedSection .compact-games-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    grid-auto-columns: unset !important;
    gap: 6px !important;
    overflow: visible !important;
    padding: 1px 0 3px !important;
  }

  #gameLobby .compact-game-card {
    border-radius: 9px !important;
  }

  #gameLobby .compact-game-copy {
    padding: 5px 4px 6px !important;
  }

  #gameLobby .compact-game-copy strong {
    font-size: 9px !important;
  }

  #gameLobby .compact-game-copy span {
    margin-top: 2px !important;
    font-size: 7px !important;
  }

  #lobbyStickySearch {
    padding: 6px !important;
    margin-bottom: 6px !important;
    border-radius: 11px !important;
  }

  #lobbyStickySearch .lobby-filter-tools {
    grid-template-columns: minmax(0, 1fr) 104px !important;
    gap: 5px !important;
  }

  #lobbyStickySearch .lobby-filter-count {
    display: none !important;
  }
}

/* Keep the featured quick-access hero intentionally large. */
#featuredGamesGrid.featured-games-grid,
#featuredGamesGrid .featured-game-card {
  /* no density override */
}
