/* Shared portal rail and homepage presentation. Game pages keep portal.css. */
html[data-portal-theme="dark"] {
  --home-bg: #101827;
  --home-side: #121e30;
  --home-surface: #19263b;
  --home-raised: #213149;
  --home-text: #f4f7fc;
  --home-muted: #a9b7ca;
  --home-line: #2c3d55;
  --home-accent: #6ecad5;
  --home-accent-soft: #143e50;
  --home-hero: #162b42;
  --home-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
html[data-portal-theme="light"] {
  --home-bg: #f4f7f9;
  --home-side: #edf2f5;
  --home-surface: #fff;
  --home-raised: #eaf1f4;
  --home-text: #182337;
  --home-muted: #627184;
  --home-nav-muted: #506075;
  --home-line: #e2e9ee;
  --home-accent: #087f92;
  --home-accent-soft: #e0f3f4;
  --home-hero: #172a42;
  --home-shadow: 0 10px 28px rgba(29, 50, 70, .07);
}
body.home-page { background: var(--home-bg); color: var(--home-text); }
.home-page.portal-wrap, .home-page .portal-wrap { color: var(--home-text); }
.home-page a { color: var(--home-accent); }
.home-page :focus-visible { outline: 3px solid #efa840; outline-offset: 3px; }
.home-shell { display: grid; grid-template-columns: 225px minmax(0, 1fr); max-width: 1600px; min-height: 100vh; margin: auto; }

/* Left rail follows the reference's compact navigation and search. */
.home-page .home-sidebar { background: var(--home-side); border-right: 1px solid var(--home-line); border-bottom: 0; padding: 25px 15px; display: flex; flex-direction: column; gap: 23px; }
.home-brand-row { display: flex; align-items: center; justify-content: space-between; }
.home-page .portal-logo { display: inline-flex; align-items: center; gap: 10px; font-size: 1.12rem; line-height: 1.04; color: var(--home-text) !important; letter-spacing: -.035em; }
.home-logo-mark { display: block; width: 37px; height: 37px; flex: none; }
.home-logo-mark img { display: block; width: 100%; height: 100%; }
.home-logo-accent { color: var(--home-accent); }
.home-page .portal-logo small { display: block; margin-top: 4px; font-size: .55rem; letter-spacing: .16em; font-weight: 800; color: var(--home-muted); }
.home-page .portal-search { width: 100%; flex: none; }
.home-page .portal-search input { background: var(--home-raised); color: var(--home-text); border-color: var(--home-line); border-radius: 10px; padding: 10px 12px 10px 35px; font-size: .88rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%238b9aad' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 11px center; }
.home-page .portal-search input::placeholder { color: var(--home-muted); }
.home-page .portal-results { background: var(--home-surface); border-color: var(--home-line); box-shadow: var(--home-shadow); }
.home-page .portal-results a { color: var(--home-text); }
.home-page .portal-results a:hover, .home-page .portal-results a:focus { background: var(--home-raised); }
.home-page .portal-results small, .home-page .portal-results .none { color: var(--home-muted); }
.home-nav-label { margin: 0 11px 8px; color: var(--home-muted); font-size: .66rem; letter-spacing: .14em; font-weight: 800; }
.home-page .portal-nav { display: flex; flex-direction: column; gap: 3px; margin-bottom: 21px; }
.home-page .portal-nav li { width: 100%; }
.home-page .portal-nav a { display: flex; align-items: center; gap: 11px; width: 100%; border: 0; border-radius: 10px; padding: 9px 11px; color: var(--home-nav-muted, var(--home-muted)); font-size: .9rem; font-weight: 650; }
.home-page .portal-nav a .home-nav-icon { display: block; flex: none; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.home-page .portal-nav a:hover { background: var(--home-raised); color: var(--home-text); }
.home-page .portal-nav a[aria-current="page"] { background: var(--home-accent-soft); color: var(--home-accent); }
.home-sidebar-foot { margin-top: auto; background: var(--home-raised); border: 1px solid var(--home-line); border-radius: 14px; padding: 15px; font-size: .86rem; }
.home-sidebar-foot strong { color: var(--home-text); }
.home-sidebar-foot p { color: var(--home-muted); margin: 5px 0 10px; line-height: 1.45; }
.home-sidebar-foot a { font-weight: 750; text-decoration: none; }

.home-page .portal-main { max-width: none; width: 100%; min-width: 0; padding: 0 30px 36px; }
.home-topbar { min-height: 75px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--home-line); }
.home-topbar-note { color: var(--home-muted); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.home-online-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #36b892; vertical-align: 1px; }
.home-topbar-actions { display: flex; align-items: center; gap: 16px; }
.home-directory-link { font-size: .85rem; font-weight: 700; text-decoration: none; }
.home-theme-toggle { cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 12px; border: 1px solid var(--home-line); border-radius: 9px; background: var(--home-surface); color: var(--home-text); font: inherit; font-size: .82rem; font-weight: 700; }
.home-theme-toggle:hover { background: var(--home-raised); }
.home-theme-icon { font-size: 1.15rem; line-height: 1; }
.home-page .portal-hero { position: relative; isolation: isolate; overflow: hidden; margin: 24px 0 29px; padding: 25px 32px 24px; border-radius: 16px; background: var(--home-hero); box-shadow: var(--home-shadow); color: #fff; }
.home-page .portal-hero::before { content: ""; position: absolute; z-index: -1; right: -75px; top: -125px; width: 390px; height: 390px; border: 1px solid rgba(117, 222, 225, .16); border-radius: 50%; box-shadow: 0 0 0 48px rgba(117, 222, 225, .04), 0 0 0 95px rgba(117, 222, 225, .025); }
.home-page .portal-hero::after { content: "✦  ◇  ♠"; position: absolute; right: 50px; top: 24px; color: rgba(113, 212, 222, .5); font-size: clamp(2.5rem, 6vw, 5.5rem); letter-spacing: .16em; transform: rotate(-12deg); pointer-events: none; }
.home-page .portal-hero h1 { max-width: 720px; margin-bottom: 9px; font-size: clamp(1.65rem, 2.7vw, 2.6rem); line-height: 1.12; letter-spacing: -.035em; }
.home-page .portal-hero p { max-width: 660px; margin: 0 0 11px; color: #cbd9e8; font-size: .96rem; }
.home-page .portal-hero p:last-child { margin: 15px 0 0; }
.home-page .portal-btn { background: #65d3dc; color: #09293d !important; border-radius: 9px; padding: 9px 15px; font-size: .86rem; }
.home-page .portal-btn:hover { background: #9ce8ec; }
.home-page .portal-section { margin: 31px 0 36px; }
.home-page .portal-section h2 { color: var(--home-text); font-size: 1.37rem; line-height: 1.25; letter-spacing: -.025em; margin: 0 0 13px; }
.home-page .portal-section > h2::before { content: ""; display: inline-block; width: 5px; height: 19px; margin-right: 10px; border-radius: 4px; background: var(--home-accent); vertical-align: -3px; }
.home-page .portal-section p, .home-page .portal-section li { color: var(--home-muted); }
.home-page .portal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.home-page .portal-card { min-width: 0; border: 1px solid var(--home-line); border-radius: 13px; background: var(--home-surface); box-shadow: var(--home-shadow); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.home-page .portal-card:hover { transform: translateY(-3px); border-color: var(--home-accent); box-shadow: 0 16px 28px rgba(0, 0, 0, .13); }
.home-page .portal-card a.thumb { background: var(--home-raised); }
.home-page .portal-card img { aspect-ratio: 4 / 3; object-fit: cover; }
.home-page .portal-card .body { gap: 4px; padding: 11px 12px 12px; }
.home-page .portal-card h3 { line-height: 1.2; font-size: .96rem; }
.home-page .portal-card h3 a { color: var(--home-text); }
.home-page .portal-card p { color: var(--home-muted); font-size: .8rem; line-height: 1.4; }
.home-page .portal-card .tagline { order: -1; color: var(--home-accent); font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.home-page .portal-cats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.home-page .portal-cat { border: 1px solid var(--home-line); border-radius: 13px; padding: 16px; background: var(--home-surface); box-shadow: var(--home-shadow); }
.home-page .portal-cat h3 { margin: 0 0 8px; font-size: 1rem; line-height: 1.2; }
.home-page .portal-cat h3 a { color: var(--home-text); }
.home-page .portal-cat p { color: var(--home-muted); font-size: .8rem; line-height: 1.45; }
.home-page .portal-cat .count { display: inline-block; padding: 3px 8px; border-radius: 5px; background: var(--home-accent-soft); color: var(--home-accent); font-weight: 800; }
.home-page .portal-cat p:last-child { border-top: 1px solid var(--home-line); padding-top: 9px; margin-bottom: 0; }
.home-page .portal-clear { color: var(--home-accent); }
.home-page #about { border: 1px solid var(--home-line); border-radius: 14px; background: var(--home-surface); padding: 19px 22px; }
.home-page #about p { margin: 0; max-width: 900px; line-height: 1.65; }
.home-page .portal-footer { background: var(--home-side); border-top: 1px solid var(--home-line); color: var(--home-muted); }
.home-page .portal-footer-in { max-width: 1550px; }
.home-page .portal-footer strong { color: var(--home-text); }
.home-page .portal-footer a { color: var(--home-muted); }
.home-page .portal-footer a:hover { color: var(--home-accent); }
.home-page .portal-note { color: var(--home-muted); }

@media (max-width: 1200px) {
  .home-page .portal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-page .portal-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  .home-shell { display: block; }
  .home-page .home-sidebar { padding: 13px 19px 0; gap: 12px; border-right: 0; border-bottom: 1px solid var(--home-line); }
  .home-page .portal-logo { font-size: 1.06rem; }
  .home-page .portal-search { max-width: none; order: 0; }
  .home-page .home-sidebar nav { order: 0; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .home-page .home-sidebar nav::-webkit-scrollbar { display: none; }
  .home-nav-label, .home-sidebar-foot { display: none; }
  .home-page .portal-nav { display: inline-flex; flex: none; flex-direction: row; flex-wrap: nowrap; width: max-content; gap: 5px; margin: 0 10px 0 0; vertical-align: top; }
  .home-page .portal-nav li { width: auto; }
  .home-page .portal-nav a { width: auto; white-space: nowrap; padding: 7px 10px; font-size: .82rem; }
  .home-page .portal-nav a .home-nav-icon { width: 17px; height: 17px; }
  .home-page .portal-main { padding: 0 19px 24px; }
  .home-topbar { min-height: 55px; }
  .home-page .portal-hero { margin-top: 16px; }
}
@media (max-width: 600px) {
  .home-page .home-sidebar { padding: 11px 13px 0; }
  .home-page .portal-search input { padding-top: 8px; padding-bottom: 8px; }
  .home-page .portal-main { padding: 0 13px 20px; }
  .home-topbar { min-height: 53px; }
  .home-topbar-note { font-size: .6rem; }
  .home-topbar-actions { gap: 7px; }
  .home-directory-link { display: none; }
  .home-theme-toggle { min-height: 34px; padding: 5px 8px; font-size: .76rem; }
  .home-page .portal-hero { padding: 20px; margin-bottom: 24px; }
  .home-page .portal-hero::after { right: -30px; top: 8px; font-size: 3.5rem; opacity: .3; }
  .home-page .portal-hero p { font-size: .86rem; }
  .home-page .portal-section { margin: 24px 0 30px; }
  .home-page .portal-section h2 { font-size: 1.17rem; }
  .home-page .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .home-page .portal-card .body { padding: 9px; }
  .home-page .portal-card h3 { font-size: .85rem; }
  .home-page .portal-card p { font-size: .74rem; }
  .home-page .portal-card .tagline { font-size: .61rem; }
  .home-page .portal-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .home-page .portal-cat { padding: 12px; }
}
@media (max-width: 370px) {
  .home-theme-label { display: none; }
  .home-page .portal-grid { gap: 7px; }
  .home-page .portal-card .body { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .home-page .portal-card { transition: none; }
  .home-page .portal-card:hover { transform: none; }
}

/* Directory, categories and information pages use the same rail and theme. */
.site-subpage .site-content { min-width:0; }
.site-subpage .portal-crumbs { max-width:none; padding:15px 30px 0; color:var(--home-muted); font-size:.82rem; }
.site-subpage .portal-crumbs a { color:var(--home-accent); }
.site-subpage .portal-crumbs li + li::before { color:var(--home-muted); }
.site-subpage .portal-main { padding-bottom:50px; }
.site-subpage .home-topbar { margin-bottom:26px; }
.site-subpage .portal-main > h1 { margin:0 0 10px; color:var(--home-text); font-size:clamp(1.8rem,3vw,2.7rem); line-height:1.12; letter-spacing:-.035em; }
.site-subpage .portal-main > h1 + p { max-width:850px; margin:0 0 20px; color:var(--home-muted); font-size:1rem; line-height:1.65; }
.site-subpage .portal-main > h2 { color:var(--home-text); margin:26px 0 9px; font-size:1.27rem; }
.site-subpage .portal-main > p { max-width:850px; color:var(--home-muted); line-height:1.7; }
.site-subpage .portal-main > ul:not(.portal-grid) { color:var(--home-muted); line-height:1.7; }
.site-subpage .portal-main > ul:not(.portal-grid) a { color:var(--home-accent); }
.site-subpage .portal-main .portal-section { margin-top:27px; }
.site-subpage .portal-main .portal-section > p { max-width:900px; line-height:1.7; }
.site-subpage .portal-main .portal-section:not(:has(.portal-grid)):not(:has(.portal-cats)) { border:1px solid var(--home-line); border-radius:14px; padding:19px 22px; background:var(--home-surface); }
.site-subpage .portal-main .portal-section h3 { color:var(--home-text); }
.site-subpage .portal-main .portal-section a { color:var(--home-accent); }
.site-subpage .portal-main .portal-section .portal-card h3 a { color:var(--home-text); }
.site-subpage .portal-main .portal-filters { gap:8px; margin:13px 0; }
.site-subpage .portal-main .portal-filters button,.site-subpage .portal-main .portal-filters select,.site-subpage .portal-main .portal-filters input { background:var(--home-surface); border:1px solid var(--home-line); color:var(--home-text); border-radius:9px; min-height:38px; }
.site-subpage .portal-main .portal-filters button { cursor:pointer; }
.site-subpage .portal-main .portal-filters button:hover { border-color:var(--home-accent); }
.site-subpage .portal-main .portal-filters button[aria-pressed="true"] { background:var(--home-accent-soft); border-color:var(--home-accent); color:var(--home-accent); }
.site-subpage .portal-main .portal-filters label { display:inline-flex; align-items:center; gap:7px; color:var(--home-muted); font-size:.85rem; font-weight:700; }
.site-subpage #portal-count { color:var(--home-muted); font-size:.85rem; font-weight:700; }
.site-subpage #portal-none { color:var(--home-muted); }
.site-subpage .portal-cat .count { color:var(--home-accent); }
.site-subpage .portal-btn { color:#fff !important; background:var(--home-accent); }
.site-subpage .portal-main > p a { color:var(--home-accent); }
@media (max-width:850px) {
  .site-subpage .portal-crumbs { padding:12px 19px 0; }
  .site-subpage .home-topbar { margin-bottom:20px; }
}
@media (max-width:600px) {
  .site-subpage .portal-crumbs { padding:10px 13px 0; }
  .site-subpage .portal-main > h1 { font-size:1.75rem; }
  .site-subpage .portal-main .portal-section:not(:has(.portal-grid)):not(:has(.portal-cats)) { padding:15px; }
}

/* The discovery layout is confined to the homepage. Listings keep their own grid. */
body.home-page:not(.site-subpage) .home-sidebar { gap: 17px; }
body.home-page:not(.site-subpage) .portal-nav { margin-bottom: 13px; }
body.home-page:not(.site-subpage) .home-nav-label { margin-bottom: 5px; letter-spacing: .09em; }
body.home-page:not(.site-subpage) .portal-nav a { min-height: 39px; padding-block: 7px; }
body.home-page:not(.site-subpage) .portal-nav a:hover { background: var(--home-surface); }
body.home-page:not(.site-subpage) .portal-nav a[aria-current="page"] { background: var(--home-surface); box-shadow: inset 3px 0 var(--home-accent); }
body.home-page:not(.site-subpage) .portal-search input { background-color: var(--home-surface); }
body.home-page:not(.site-subpage) .home-sidebar-foot { padding: 12px 10px 0; border: 0; border-top: 1px solid var(--home-line); border-radius: 0; background: transparent; }
body.home-page:not(.site-subpage) .home-sidebar-foot strong { font-size: .84rem; }
body.home-page:not(.site-subpage) .home-sidebar-foot p { font-size: .8rem; }

body.home-page:not(.site-subpage) .portal-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr); align-items: center; min-height: 184px; margin: 16px 0 20px; padding: 16px 28px; background: #e4f4f1; color: #143145; box-shadow: none; }
body.home-page:not(.site-subpage) .portal-hero::before,
body.home-page:not(.site-subpage) .portal-hero::after { content: none; }
body.home-page:not(.site-subpage) .hero-copy { position: relative; z-index: 2; }
body.home-page:not(.site-subpage) .portal-hero h1 { max-width: 620px; margin: 0 0 9px; font-size: clamp(1.7rem, 2.3vw, 2.25rem); line-height: 1.11; }
body.home-page:not(.site-subpage) .portal-hero p { max-width: 590px; margin: 0; color: #496576; font-size: .9rem; line-height: 1.5; }
body.home-page:not(.site-subpage) .portal-hero p:last-child { margin-top: 12px; }
body.home-page:not(.site-subpage) .portal-btn { padding: 9px 15px; background: #087f92; color: #fff !important; }
body.home-page:not(.site-subpage) .portal-btn:hover { background: #066b7d; }
body.home-page:not(.site-subpage) .hero-art { position: relative; align-self: stretch; min-height: 150px; }
body.home-page:not(.site-subpage) .hero-art img { position: absolute; display: block; width: 48%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border: 4px solid #fff; border-radius: 12px; box-shadow: 0 8px 20px rgba(13, 60, 70, .17); }
body.home-page:not(.site-subpage) .hero-art img:first-child { width: 61%; right: 0; top: 4%; transform: rotate(4deg); }
body.home-page:not(.site-subpage) .hero-art img:nth-child(2) { left: 3%; top: -8%; transform: rotate(-7deg); }
body.home-page:not(.site-subpage) .hero-art img:nth-child(3) { left: 0; bottom: -10%; transform: rotate(5deg); }
html[data-portal-theme="dark"] body.home-page:not(.site-subpage) .portal-hero { background: #193749; color: #f4f7fc; }
html[data-portal-theme="dark"] body.home-page:not(.site-subpage) .portal-hero p { color: #c2d5db; }
html[data-portal-theme="dark"] body.home-page:not(.site-subpage) .hero-art img { border-color: #2c5060; }

body.home-page:not(.site-subpage) .portal-section { margin: 22px 0 28px; }
body.home-page:not(.site-subpage) .portal-section h2 { margin-bottom: 12px; }
body.home-page:not(.site-subpage) .portal-grid { gap: 12px; }
body.home-page:not(.site-subpage) #featured .portal-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
body.home-page:not(.site-subpage) #popular .portal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
body.home-page:not(.site-subpage) #more .portal-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body.home-page:not(.site-subpage) .portal-card { border-radius: 12px; box-shadow: 0 3px 12px rgba(20, 42, 56, .055); }
body.home-page:not(.site-subpage) .portal-card:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(20, 42, 56, .12); }
body.home-page:not(.site-subpage) .portal-card .body { padding: 9px 10px 11px; gap: 3px; }
body.home-page:not(.site-subpage) .portal-card h3 { font-size: .88rem; line-height: 1.25; }
body.home-page:not(.site-subpage) .portal-card .tagline { font-size: .6rem; letter-spacing: .055em; }
body.home-page:not(.site-subpage) .portal-card p:not(.tagline) { display: none; }
body.home-page:not(.site-subpage) #featured .portal-card p:not(.tagline) { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: .74rem; line-height: 1.35; }
body.home-page:not(.site-subpage) #popular .portal-card { flex-direction: row; min-height: 108px; }
body.home-page:not(.site-subpage) #popular .portal-card .thumb { flex: none; width: 42%; }
body.home-page:not(.site-subpage) #popular .portal-card img { height: 100%; aspect-ratio: auto; }
body.home-page:not(.site-subpage) #popular .portal-card .body { justify-content: center; }

body.home-page:not(.site-subpage) .portal-cats { gap: 11px; }
body.home-page:not(.site-subpage) .portal-cat { padding: 12px; box-shadow: none; }
body.home-page:not(.site-subpage) .portal-cat-image { display: block; height: 77px; margin-bottom: 11px; overflow: hidden; border-radius: 9px; background: var(--home-raised); }
body.home-page:not(.site-subpage) .portal-cat-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
body.home-page:not(.site-subpage) .portal-cat h3 { margin-bottom: 5px; font-size: .91rem; }
body.home-page:not(.site-subpage) .portal-cat p { font-size: .75rem; }

body.home-page:not(.site-subpage) #portal-recent .portal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.home-page:not(.site-subpage) #portal-recent .portal-card { flex-direction: row; min-height: 93px; }
body.home-page:not(.site-subpage) #portal-recent .portal-card .thumb { flex: none; width: 105px; }
body.home-page:not(.site-subpage) #portal-recent .portal-card img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
body.home-page:not(.site-subpage) #portal-recent .portal-card .body { justify-content: center; }
body.home-page:not(.site-subpage) #portal-recent .portal-card p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

@media (max-width: 1320px) {
  body.home-page:not(.site-subpage) #featured .portal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1050px) {
  body.home-page:not(.site-subpage) .portal-hero { grid-template-columns: minmax(0, 1fr) 280px; }
  body.home-page:not(.site-subpage) #popular .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-page:not(.site-subpage) #more .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-page:not(.site-subpage) #portal-recent .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
  body.home-page:not(.site-subpage) .home-sidebar { gap: 12px; }
  body.home-page:not(.site-subpage) .portal-hero { grid-template-columns: minmax(0, 1fr) 34%; }
  body.home-page:not(.site-subpage) #more .portal-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  body.home-page:not(.site-subpage) #popular .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-page:not(.site-subpage) #popular .portal-card { flex-direction: column; }
  body.home-page:not(.site-subpage) #popular .portal-card .thumb { width: 100%; }
  body.home-page:not(.site-subpage) #popular .portal-card img { height: auto; aspect-ratio: 4 / 3; }
  body.home-page:not(.site-subpage) #more .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-page:not(.site-subpage) #portal-recent .portal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body.home-page:not(.site-subpage) .home-sidebar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px 10px; padding-bottom: 8px; }
  body.home-page:not(.site-subpage) .home-sidebar nav { grid-column: 1 / -1; width: 100%; }
  body.home-page:not(.site-subpage) .portal-search { min-width: 0; }
  body.home-page:not(.site-subpage) .portal-results { left: auto; right: 0; width: min(300px, calc(100vw - 26px)); min-width: 0; }
  body.home-page:not(.site-subpage) .portal-nav a { min-height: 38px; }
  body.home-page:not(.site-subpage) .home-topbar { min-height: 41px; }
  body.home-page:not(.site-subpage) .home-topbar-note { display: none; }
  body.home-page:not(.site-subpage) .home-topbar-actions { margin-left: auto; }
  body.home-page:not(.site-subpage) .portal-hero { display: block; min-height: 0; padding: 15px 17px; margin: 10px 0 18px; }
  body.home-page:not(.site-subpage) .portal-hero h1 { max-width: 340px; font-size: 1.47rem; }
  body.home-page:not(.site-subpage) .portal-hero p { max-width: 330px; font-size: .82rem; }
  body.home-page:not(.site-subpage) .hero-art { position: absolute; inset: 0; min-height: 0; pointer-events: none; }
  body.home-page:not(.site-subpage) .hero-art img { display: none; }
  body.home-page:not(.site-subpage) .hero-art img:first-child { display: block; width: 94px; right: 15px; top: auto; bottom: 10px; transform: rotate(5deg); }
  body.home-page:not(.site-subpage) .portal-hero .hero-copy > p:last-child { max-width: calc(100% - 102px); }
  body.home-page:not(.site-subpage) #featured .portal-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-page:not(.site-subpage) .portal-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.home-page:not(.site-subpage) .portal-card .body { padding: 8px 9px 10px; }
  body.home-page:not(.site-subpage) .portal-card h3 { font-size: .84rem; }
  body.home-page:not(.site-subpage) .portal-cat-image { height: 60px; }
}
@media (max-width: 370px) {
  body.home-page:not(.site-subpage) .home-logo-mark { width: 32px; height: 32px; }
  body.home-page:not(.site-subpage) .portal-logo { gap: 7px; font-size: .96rem; }
  body.home-page:not(.site-subpage) .hero-art img:first-child { width: 76px; right: 10px; }
  body.home-page:not(.site-subpage) .portal-hero .hero-copy > p:last-child { max-width: calc(100% - 78px); }
}

/* Homepage: horizontal navigation and a complete, scan-friendly game list. */
body.home-page:not(.site-subpage) .home-shell { display: block; max-width: 1440px; min-height: 0; }
body.home-page:not(.site-subpage) .home-header { display: block; padding: 0 30px; background: var(--home-surface); border-bottom: 1px solid var(--home-line); }
body.home-page:not(.site-subpage) .home-header-main { display: flex; align-items: center; gap: 24px; min-height: 76px; }
body.home-page:not(.site-subpage) .portal-logo { flex: none; text-decoration: none; }
body.home-page:not(.site-subpage) .portal-search { width: min(360px, 100%); margin-left: auto; }
body.home-page:not(.site-subpage) .home-header-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; padding: 0 0 11px; }
body.home-page:not(.site-subpage) .home-header-nav::-webkit-scrollbar { display: none; }
body.home-page:not(.site-subpage) .home-header-nav a { flex: none; padding: 8px 13px; border-radius: 9px; color: var(--home-muted); font-size: .88rem; font-weight: 700; text-decoration: none; }
body.home-page:not(.site-subpage) .home-header-nav a:hover,
body.home-page:not(.site-subpage) .home-header-nav a[aria-current="page"] { background: var(--home-accent-soft); color: var(--home-accent); }
body.home-page:not(.site-subpage) .portal-main { max-width: 1440px; padding: 0 30px 36px; }
body.home-page:not(.site-subpage) .portal-hero { margin-top: 24px; }
body.home-page:not(.site-subpage) .home-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
body.home-page:not(.site-subpage) .home-section-heading h2 { margin-bottom: 3px; }
body.home-page:not(.site-subpage) .home-section-heading p { margin: 0; font-size: .88rem; }
body.home-page:not(.site-subpage) .home-game-count { flex: none; color: var(--home-muted); font-size: .82rem; font-weight: 700; }
body.home-page:not(.site-subpage) .home-game-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
body.home-page:not(.site-subpage) .home-game-list li { min-width: 0; }
body.home-page:not(.site-subpage) .home-game-list a { display: flex; align-items: center; gap: 11px; min-height: 72px; padding: 7px; border: 1px solid var(--home-line); border-radius: 11px; background: var(--home-surface); color: var(--home-text); text-decoration: none; }
body.home-page:not(.site-subpage) .home-game-list a:hover { border-color: var(--home-accent); box-shadow: var(--home-shadow); }
body.home-page:not(.site-subpage) .home-game-list img { flex: none; width: 72px; height: 54px; border-radius: 7px; object-fit: cover; }
body.home-page:not(.site-subpage) .home-game-list span { min-width: 0; }
body.home-page:not(.site-subpage) .home-game-list strong { display: block; line-height: 1.25; font-size: .84rem; }
body.home-page:not(.site-subpage) .home-game-list small { display: block; margin-top: 4px; color: var(--home-muted); font-size: .7rem; }
@media (max-width: 1100px) {
  body.home-page:not(.site-subpage) .home-game-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body.home-page:not(.site-subpage) .home-header { padding: 0 19px; }
  body.home-page:not(.site-subpage) .home-header-main { flex-wrap: wrap; gap: 10px; padding: 13px 0 10px; }
  body.home-page:not(.site-subpage) .portal-search { order: 3; width: 100%; margin-left: 0; }
  body.home-page:not(.site-subpage) .home-theme-toggle { margin-left: auto; }
  body.home-page:not(.site-subpage) .home-header-nav { padding-bottom: 9px; }
  body.home-page:not(.site-subpage) .portal-main { padding: 0 19px 28px; }
  body.home-page:not(.site-subpage) .home-game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body.home-page:not(.site-subpage) .home-header { padding: 0 13px; }
  body.home-page:not(.site-subpage) .portal-main { padding: 0 13px 24px; }
  body.home-page:not(.site-subpage) .home-game-list { gap: 7px; }
  body.home-page:not(.site-subpage) .home-game-list a { gap: 7px; min-height: 64px; padding: 5px; }
  body.home-page:not(.site-subpage) .home-game-list img { width: 52px; height: 48px; }
  body.home-page:not(.site-subpage) .home-game-list strong { font-size: .76rem; }
  body.home-page:not(.site-subpage) .home-game-list small { font-size: .65rem; }
}
@media (max-width: 390px) {
  body.home-page:not(.site-subpage) .home-game-list { grid-template-columns: 1fr; }
}
