/* Homepage only: three on phones, five on larger screens, with a native RTL swipe on smaller screens. */
#home :is(#live-list,#match-list):has(>.match){
 grid-template-columns:none;
 grid-auto-flow:column;
 --home-rail-card-width:calc((100% - 36px)/3);
 grid-auto-columns:var(--home-rail-card-width);
 align-items:stretch;
 overflow-x:auto;
 overflow-y:hidden;
 scroll-snap-type:x mandatory;
 overscroll-behavior-x:contain;
 overflow-anchor:none;
 scrollbar-width:thin;
 scrollbar-color:var(--border) transparent;
 padding-block:4px 8px;
}
#home :is(#live-list,#match-list):has(>:is(.match,.home-rail-more):nth-child(4)){--home-rail-card-width:calc((100% - 76px)/3)}
#home :is(#live-list,#match-list)>.match{min-width:0;scroll-snap-align:start;scroll-snap-stop:normal}
@media(max-width:1100px){
 #home :is(#live-list,#match-list):has(>.match){--home-rail-card-width:calc((100% - 18px)/2)}
 #home :is(#live-list,#match-list):has(>:is(.match,.home-rail-more):nth-child(3)){--home-rail-card-width:calc((100% - 58px)/2)}
}
@media(max-width:700px){
 #home :is(#live-list,#match-list):has(>.match){--home-rail-card-width:100%;--home-match-slots:3}
 #home :is(#live-list,#match-list):has(>:is(.match,.home-rail-more):nth-child(2)){--home-rail-card-width:calc(100% - 40px)}
}

/* Match cards share a row height without fixing or clipping their content. */
#home :is(#live-list,#match-list)>.match{display:flex;flex-direction:column}
#home :is(#live-list,#match-list)>.match>*{flex-shrink:0}
/* Flex margins do not collapse; retain the original spacing below the header. */
#home :is(#live-list,#match-list)>.match>.pt-timing{margin-top:0}
#home :is(#live-list,#match-list)>.match>.match-court-top{margin-bottom:6px}
#home :is(#live-list,#match-list)>.match:has(>.card-watch-bottom)>.mc-body{margin-bottom:12px}
#home :is(#live-list,#match-list)>.match>.card-watch-bottom{margin-top:auto}

/* The next action is a compact last slide, directly after the match previews. */
#home #match-list:has(>.home-rail-more){grid-template-columns:repeat(var(--home-match-slots,5),var(--home-rail-card-width)) 160px}
#home #match-list>.home-rail-more{
 display:flex;
 flex-direction:column;
 align-items:center;
 justify-content:center;
 align-self:center;
 min-height:144px;
 gap:8px;
 min-width:0;
 padding:24px 16px;
 border:1px solid var(--border);
 border-radius:var(--radius-card,16px);
 background:var(--surface);
 color:var(--accent);
 text-align:center;
 text-decoration:none;
 scroll-snap-align:start;
}
#home #match-list>.home-rail-more strong{font-size:22px;line-height:1.4}
#home #match-list>.home-rail-more>span{font-size:15px;line-height:1.6;color:var(--muted)}
#home #match-list>.home-rail-more:hover{border-color:var(--ring)}
#home #match-list>.home-rail-more:focus-visible{outline:2px solid var(--ring);outline-offset:-4px}
