/* UtopiaGM: home desk-floors board — exactly 5 lanes, 3+2 premium fill.
 * Cause: rail is repeat(6,1fr) with 6 cards; child 4/5 span 3; child 6 orphans → ugly gap.
 * Fix: hide 6th+, force row1 = three span-2, row2 = two span-3.
 * Append after HomeBelowFold CSS. Do not Vite-rebuild to ship. */

@media (width >= 901px) {
  .home-sitelink-rail {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: clamp(0.85rem, 1.6vw, 1.15rem) !important;
    align-items: stretch !important;
  }

  .home-sitelink-lane,
  .home-sitelink-lane--featured,
  .home-sitelink-lane:nth-child(4),
  .home-sitelink-lane:nth-child(5),
  .home-sitelink-lane:nth-child(6) {
    grid-column: auto !important;
  }

  .home-sitelink-lane:nth-child(1),
  .home-sitelink-lane:nth-child(2),
  .home-sitelink-lane:nth-child(3) {
    grid-column: span 2 !important;
    min-height: 14.75rem !important;
  }

  .home-sitelink-lane:nth-child(4),
  .home-sitelink-lane:nth-child(5) {
    grid-column: span 3 !important;
    min-height: 12.75rem !important;
  }

  /* Hard cap — never show auto-dumped 6th+ games on this board */
  .home-sitelink-lane:nth-child(n + 6) {
    display: none !important;
  }

  .home-sitelink-lane:nth-child(1) .home-sitelink-lane__body,
  .home-sitelink-lane:nth-child(2) .home-sitelink-lane__body,
  .home-sitelink-lane:nth-child(3) .home-sitelink-lane__body {
    max-width: 62% !important;
  }

  .home-sitelink-lane:nth-child(4) .home-sitelink-lane__body,
  .home-sitelink-lane:nth-child(5) .home-sitelink-lane__body {
    max-width: 55% !important;
  }
}

@media (width <= 900px) {
  .home-sitelink-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .home-sitelink-lane,
  .home-sitelink-lane:nth-child(4),
  .home-sitelink-lane:nth-child(5),
  .home-sitelink-lane--featured {
    grid-column: span 1 !important;
    min-height: 11.5rem !important;
  }

  .home-sitelink-lane:nth-child(5) {
    grid-column: 1 / -1 !important;
    min-height: 10.75rem !important;
  }

  .home-sitelink-lane:nth-child(n + 6) {
    display: none !important;
  }
}
