/* Homepage and collection templates share the existing site chrome. */
.portal-main{min-width:0}
.portal-main h1{scroll-margin-top:20px}
.portal-page ul{list-style:none;margin:0;padding:0}
.portal-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
.portal-heading h2{display:flex;align-items:center;gap:9px;margin:0;color:#333;font-size:20px;line-height:30px;font-weight:600}
.portal-heading>a{display:flex;align-items:center;min-height:36px;font-size:13px;line-height:24px;color:var(--link)}
.section-rule{border-bottom:1px solid var(--line);padding-bottom:12px}
.home-main{padding-top:20px}
.home-page .portal-heading{margin-bottom:14px}
.home-page .portal-heading>a{min-height:44px}
.hot-grid{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:14px}
.hot-grid>li,.home-app-grid>li{min-width:0}
.hot-grid:focus-visible{outline-offset:3px}
.hot-app{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;height:100%;text-align:center;padding:4px 0}
.hot-app>img{width:80px;height:80px;object-fit:contain;border-radius:16px}
.hot-app>span{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13px;line-height:21px;min-height:42px;max-width:100%;overflow-wrap:anywhere}
.hot-app:hover,.home-app:hover{color:#1c70c9}
.mobile-scroll-hint{display:none}
.home-discovery{border-block:1px solid var(--line);padding-block:10px;margin:20px 0 24px}
.discovery-row{display:flex;align-items:flex-start;gap:16px}
.discovery-row h2{flex-shrink:0;margin:8px 0;font-size:13px;line-height:24px;font-weight:500;background:#fff3ed;color:#a3482a;padding:0 10px;border-radius:3px}
.discovery-tags h2{background:#edf5ff;color:#246aab}
.discovery-row>div{display:flex;align-items:center;flex-wrap:wrap;column-gap:20px;min-width:0}
.discovery-row a{display:flex;align-items:center;min-height:40px;font-size:14px;color:#4f5965}
.discovery-row a:hover,.discovery-row a:focus-visible{color:#1c70c9;text-decoration:underline}
.discovery-row a:focus-visible{outline-offset:-2px}
.home-apps{scroll-margin-top:20px}
.home-app-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 16px}
.home-app{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:12px;min-width:0;height:100%;min-height:100px;padding:13px;border:1px solid var(--line);border-radius:4px;text-align:left;transition:background-color .16s,border-color .16s}
.home-app:hover,.home-app:focus-visible{border-color:#a1c6e8;background:#f8fbff}
.hot-app:active,.home-app:active{background:#edf5ff}
.home-app>img{display:block;width:64px;height:64px;object-fit:contain;border-radius:13px}
.home-app-content{display:flex;flex-direction:column;gap:4px;min-width:0}
.home-app-content>span:first-child{display:block;font-size:15px;font-weight:600;line-height:23px;overflow-wrap:anywhere}
.home-app-meta{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
.home-app-rating{display:flex;align-items:center;gap:5px;color:#986315;font-size:13px;font-weight:500;line-height:20px;white-space:nowrap}
.home-app-rating::before{content:"";display:inline-block;flex:0 0 14px;width:14px;height:14px;background:url("../assets/star-yellow.svg") center/contain no-repeat}
.home-app-rating.is-unrated{color:var(--muted)}
.home-app-rating.is-unrated::before{background-image:url("../assets/star-gray.svg")}
.home-app-size{color:var(--muted);font-size:12px;line-height:19px;white-space:nowrap;font-variant-numeric:tabular-nums}
.home-app-toggle{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;margin-top:12px;padding:10px 16px;border:1px solid var(--line);border-radius:4px;background:#fff;color:var(--link);font:inherit;font-size:14px;line-height:22px;cursor:pointer}
.home-app-toggle:hover,.home-app-toggle:focus-visible{background:#f8fbff;border-color:#a1c6e8}
.home-app-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
.portal-page .site-footer{margin-top:40px}
.collections-main{padding-top:24px}
.collections-toolbar{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:18px;margin-bottom:18px;border-bottom:1px solid var(--line);scroll-margin-top:16px}
.collections-toolbar h1{font-size:22px;line-height:32px;color:#333;margin:0;font-weight:600}
.collections-heading>p{font-size:14px;line-height:24px;color:var(--muted);margin:4px 0 0}
.collection-filters{display:flex;flex-wrap:wrap;gap:8px}
.collection-filters a{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px 18px;border:1px solid var(--line);font-size:14px;line-height:24px;border-radius:3px;white-space:nowrap}
.collection-filters a[aria-current]{background:#2474c8;border-color:#2474c8;color:#fff}
.collection-filters a:hover{border-color:#a1c6e8;background:#eef6fd;color:#185a98}
.collection-filters a[aria-current]:hover{background:#1d65b0;color:#fff}
.collection-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;scroll-margin-top:20px}
.collection-grid>li{min-width:0}
.collection-card{height:100%;border:1px solid var(--line);background:#fff;transition:box-shadow .18s,border-color .18s}
.collection-card:hover,.collection-card:focus-within{border-color:#a1c6e8;box-shadow:0 3px 14px #273f5c0c}
.collection-card>a{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;height:100%;padding:12px}
.collection-card h2,.home-collections .collection-card h3{width:100%;font-size:16px;line-height:24px;margin:0;color:#333;font-weight:600;overflow-wrap:anywhere;text-wrap:balance;text-align:center}
.collection-card>a:hover h2,.collection-card>a:focus-visible h2{color:#1c70c9}
.collection-card>a:active{background:#f5f9fe}
.collection-card img{display:block;width:100%;max-width:252px;height:auto;aspect-ratio:600/285;object-fit:cover}
.collection-main .breadcrumb{padding-inline:0;margin-bottom:16px}
.collection-main .breadcrumb>[aria-current]{flex-basis:auto;padding-left:0}
.collection-hero{display:grid;grid-template-columns:280px minmax(0,1fr);gap:24px;padding:18px;border:1px solid var(--line);background:#fff;align-items:center}
.collection-cover{display:block;width:100%;height:auto;aspect-ratio:600/285;object-fit:cover}
.collection-intro{display:flex;flex-direction:column;min-width:0}
.collection-intro h1{font-size:24px;line-height:34px;font-weight:600;color:#333;margin:0 0 10px}
.collection-intro>p{font-size:14px;line-height:25px;color:#56606b;margin:0}
.collection-intro-toggle{display:none;align-self:flex-start;align-items:center;gap:5px;min-height:44px;padding:0 4px;border:0;background:transparent;color:#2474c8;font:inherit;font-size:13px;cursor:pointer}
.collection-intro-toggle:hover{text-decoration:underline}
.collection-intro-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
.collection-summary{display:flex;flex-wrap:wrap;gap:8px 22px;font-size:12px;line-height:22px;color:var(--muted);margin-top:12px}
.collection-summary strong{color:#d04431;font-weight:600}
.collection-games{margin-top:24px}
.collection-game-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
.collection-game-grid>li{min-width:0}
.collection-game{position:relative;display:block;height:100%;min-width:0;border:1px solid var(--line);padding:16px 18px;transition:background-color .16s,border-color .16s}
.collection-game:hover{background:#f9fcff;border-color:#c5d9ec}
.collection-game-main{display:block;color:inherit}
.collection-game-main::after{content:"";position:absolute;inset:0}
.collection-game-main:focus-visible{outline:none}
.collection-game-main:focus-visible::after{outline:3px solid #2474c8;outline-offset:3px}
.collection-game-main:hover h3{color:#2474c8}
.collection-game h3{font-size:16px;line-height:24px;color:#333;font-weight:600;margin:0 0 8px;overflow-wrap:anywhere}
.collection-game-icon{float:right;display:block;width:72px;height:72px;object-fit:contain;border-radius:14px;margin:0 0 10px 12px}
.collection-game-meta{display:flex;gap:10px;flex-wrap:wrap;font-size:12px;line-height:22px;color:var(--muted);margin:0}
.collection-game-meta>span+span{padding-left:10px;border-left:1px solid var(--line)}
.star-rating.collection-stars{--star-size:14px;display:block;width:max-content;max-width:100%;margin:10px 0}
.collection-game-tags{position:relative;z-index:1;display:flex;gap:5px;flex-wrap:wrap;min-height:24px}
.collection-game-tags>a{display:inline-flex;align-items:center;min-height:24px;font-size:12px;line-height:20px;padding:0 5px;background:#eef6fd;color:#246aab}
.collection-game-tags>a:hover,.collection-game-tags>a:focus-visible{background:#dcecff;color:#185a98;text-decoration:underline}
.collection-game-tags>a:active{background:#cfe4f9;color:#134f88}
.collection-game-description{clear:both;font-size:13px;line-height:22px;color:#56606b;margin:10px 0 0;overflow-wrap:break-word}
.collection-related{border:1px solid var(--line);padding:20px;margin-top:32px}
.collection-related .portal-heading>a{min-height:44px;padding-inline:4px}
.collection-page-actions{display:contents}
:is(.topics-page,.home-page) .collection-page-actions:not(:has(.back-to-top:not([hidden]))){display:none}
.related-collection-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:22px 20px}
.related-collection-grid>li{min-width:0}
.related-collection-grid a{display:block;text-align:center}
.related-collection-grid img{display:block;width:100%;height:auto;aspect-ratio:600/285;object-fit:cover}
.related-collection-grid span{display:block;font-size:13px;line-height:22px;margin-top:7px;overflow-wrap:anywhere}
/* Use a separate action row when the viewport has no room beside the content. */
@media(max-width:1340px){
 .collection-page-actions{display:flex;justify-content:flex-end;min-height:44px;margin-top:16px}
 .collection-page-actions .back-to-top{position:static;width:auto;min-width:88px;height:44px;padding:0 12px;border:1px solid var(--line);box-shadow:none;font-size:13px;line-height:22px}
 .collection-page-actions .back-to-top br{display:none}
}
@media(max-width:1100px){
 .hot-grid{grid-template-columns:repeat(6,minmax(0,1fr));gap:16px}
 .collection-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
 .collection-hero{grid-template-columns:250px minmax(0,1fr);gap:20px}
 .collection-intro h1{font-size:22px;line-height:32px}
 .collection-game-grid{gap:18px}
 .collection-game{padding:14px}
}
@media(max-width:900px){
 .collection-grid{gap:16px}
 .collection-hero{grid-template-columns:210px minmax(0,1fr);padding:16px}
 .collection-game-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
 .related-collection-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}
 .collections-toolbar{flex-wrap:wrap;gap:14px}
}
@media(max-width:1100px){
 .home-app-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
}
@media(max-width:820px){
 .home-app-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:600px){
 .home-main,.collections-main{padding-top:18px}
 .portal-heading{gap:10px;margin-bottom:14px}
 .portal-heading h2{font-size:18px;line-height:28px}

 .hot-grid{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 28px)/3.25);gap:12px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:4px;padding:4px 4px 8px!important;scrollbar-width:thin}
 .hot-app{scroll-snap-align:start}
 .hot-app:focus-visible{outline-offset:-2px}
 .hot-app>img{width:76px;height:76px}
 .mobile-scroll-hint{display:block;color:var(--muted);font-size:12px;line-height:20px;text-align:right;margin:4px 0 0}
 .home-discovery{margin:16px 0 20px;padding-block:6px}
 .discovery-row{gap:10px}
 .discovery-row h2{margin-block:10px;font-size:13px;padding:0 7px}
 .discovery-row>div{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;column-gap:18px;scrollbar-width:thin}
 .discovery-row a{min-height:44px;white-space:nowrap;font-size:13px}
 .home-app-grid{grid-template-columns:minmax(0,1fr);gap:10px}
 .home-app{padding:12px}
 .portal-page .site-footer{margin-top:28px}
 .collections-toolbar{display:block;padding-bottom:12px;margin-bottom:14px}
 .collections-toolbar h1{font-size:21px;line-height:30px}
 .collections-heading>p{font-size:13px;line-height:22px;margin:4px 0 10px}
 .collection-filters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
 .collection-filters a{padding:8px 3px;font-size:14px}
 .collection-main .breadcrumb{margin-bottom:12px}
 .collection-hero{grid-template-columns:104px minmax(0,1fr);gap:8px 14px;padding:14px}
 .collection-intro{display:contents}
 .collection-intro h1{font-size:20px;line-height:28px;margin:0;text-wrap:balance}
 .collection-intro>p{grid-column:1/-1;font-size:13px;line-height:24px;margin-top:4px}
 .collection-intro>p.is-collapsed{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
 .collection-intro-toggle{display:inline-flex;grid-column:1/-1;justify-self:start}
 .collection-summary{grid-column:1/-1;margin-top:0;gap:6px 15px}
 .collection-games{margin-top:18px}
 .collection-game-grid{grid-template-columns:minmax(0,1fr);gap:12px}
 .collection-game-icon{width:76px;height:76px}
 .collection-game-tags{gap:8px;min-height:32px}
 .collection-game-tags>a{min-height:32px;font-size:13px;padding-inline:8px}
 .collection-game-description{font-size:14px;line-height:24px}
 .collection-related{margin-top:24px;padding:14px}
 .related-collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px 12px}
 .related-collection-grid span{text-wrap:balance}
}
@media(max-width:700px){
 .collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .collection-card>a{gap:8px;padding:10px}
 .collection-card h2{font-size:14px;line-height:22px}
}
@media(max-width:350px){
 .hot-app>img{width:68px;height:68px}
 .collection-summary{gap:5px 12px}
}

/* Discovery and editorial modules use HTML content and native links. */
.home-feed{display:grid;grid-template-columns:minmax(0,1fr) 284px;gap:18px;align-items:start;margin-bottom:28px;scroll-margin-top:20px}
.home-feed-main{display:grid;gap:12px;min-width:0}
.home-feed-section,.home-editors{min-width:0;border:1px solid var(--line);padding:14px;background:#fff}
.home-feed-section h2,.home-editors h2{margin:0 0 14px;font-size:17px;line-height:26px;font-weight:500;color:#414141}
.home-page .feed-grid{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:12px;list-style:none;margin:0;padding:0}
.feed-grid>li{min-width:0}
.feed-grid:focus-visible{outline-offset:4px}
.feed-tile{display:flex;flex-direction:column;align-items:flex-start;gap:6px;height:100%;min-width:0;font-size:13px;line-height:20px}
.feed-icon{position:relative;display:block;width:100%;max-width:80px;aspect-ratio:1;margin-bottom:1px}
.feed-icon>img{display:block;width:100%;height:100%;object-fit:contain;border-radius:15px}
.feed-name{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:40px;max-width:100%;overflow-wrap:anywhere}

.feed-tile:hover .feed-name,.editor-item:hover .editor-name{color:#1c70c9}
.feed-rank{position:absolute;z-index:1;left:5px;top:0;display:flex;align-items:center;justify-content:center;min-width:18px;height:22px;padding:0 4px;color:#fff;font-size:12px;font-weight:600;border-radius:0 0 3px 3px;background:#bf5534}
.feed-rank-1{background:#c23d3d}.feed-rank-2{background:#a95715}.feed-rank-3{background:#896515}
.editor-list{display:grid;gap:0}
.editor-list>li+li{border-top:1px solid #f0f2f5}
.editor-item{display:grid;grid-template-columns:48px minmax(0,1fr);align-items:center;gap:6px 12px;min-height:72px;padding:10px 0}
.editor-icon{width:48px;height:48px;object-fit:contain;border-radius:10px}
.editor-content{display:flex;flex-direction:column;gap:4px;min-width:0}
.editor-name{display:block;font-size:14px;line-height:22px;min-width:0;overflow-wrap:anywhere}
.editor-description{grid-column:1/-1;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;font-size:12px;line-height:19px;color:var(--muted)}
.editor-updated{display:block;color:var(--muted);font-size:12px;line-height:18px;white-space:nowrap;font-variant-numeric:tabular-nums}
.home-collections{margin-top:28px;scroll-margin-top:20px}
.home-collections .collection-card>a:hover h3,.home-collections .collection-card>a:focus-visible h3{color:#1c70c9}
@media(max-width:1100px){
 .home-feed{grid-template-columns:minmax(0,1fr)}
 .home-page .feed-grid{gap:10px}
 .editor-list{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px}
 .editor-list>li:nth-child(2){border-top:0}
}
@media(max-width:600px){
 .home-feed{gap:14px;margin-bottom:24px}
 .home-feed-section,.home-editors{padding:12px}
 .home-feed-section h2,.home-editors h2{margin-bottom:12px}
 .home-page .feed-grid{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:calc((100% - 22px)/3.25);gap:10px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scroll-padding-inline:2px;padding:3px 2px 8px;scrollbar-width:thin}
 .feed-tile{scroll-snap-align:start}
 .feed-tile:focus-visible{outline-offset:-2px}
 .feed-icon{max-width:72px}
 .home-editors{padding:14px}
 .editor-list{grid-template-columns:minmax(0,1fr);gap:0}
 .editor-list>li:nth-child(2){border-top:1px solid #f0f2f5}
 .editor-name{font-size:15px;line-height:23px}
 .home-collections{margin-top:24px}
 .home-collections .collection-card h3{font-size:14px;line-height:22px}
}
@media(max-width:350px){
 .home-page .feed-grid{grid-auto-columns:calc((100% - 20px)/2.75)}
}
