/* Hub pages (homepage and leaderboards, <body class="hub">).
   No fixed sidebar: links sit in the top bar on wide screens and the menu is a drawer at every width.
   Content is centred and capped so big screens get bigger art, not wider gaps.
   Ads are small fixed boxes sized by --ad-w / --ad-h (read by ads.js) and never sit above the first games. */

body.hub { --wrap: 1320px; --hgap: 16px; }
body.hub .main, body.hub.side-mini .main { margin-inline: auto; padding: calc(var(--top) + 18px) 24px 0; }
.hx, .lbx { max-width: var(--wrap); margin-inline: auto; }

/* Top bar links (hub pages only, wide screens) */
.top-nav { display: none; }
@media (min-width: 1000px) {
  body.hub .top-nav { display: flex; gap: 2px; margin-left: 6px; }
  body.hub .top-nav a {
    display: flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 99px;
    color: var(--muted); font-weight: 800; font-size: 14.5px; white-space: nowrap;
  }
  body.hub .top-nav a:hover { background: var(--panel); color: var(--text); }
  body.hub .top-nav a[aria-current] { background: var(--card); color: var(--text); }
  body.hub .search { max-width: 340px; margin-left: auto; }
}
body.hub .top-cta { display: none; }

/* The sidebar is a drawer everywhere on hub pages */
body.hub .sidebar, body.hub.side-mini .sidebar { width: min(280px, 84vw); translate: -100% 0; transition: translate .2s ease; }
body.hub.side-open .sidebar { translate: 0 0; }
body.hub .nav-link { justify-content: flex-start; padding: 0 12px; gap: 14px; }
body.hub .nav-label, body.hub .nav-n, body.hub .nav-hot, body.hub .nav-title, body.hub .side-foot { display: revert; }
body.hub .nav-label { display: block; }
body.hub .nav-title + .nav-link { margin-top: 0; }

/* ---------- Shared bits ---------- */
.hx-eye {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--mint); font-size: 12.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(111, 230, 198, .6); }
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: live-pulse 2s ease-out infinite; }
  @keyframes live-pulse { 70% { box-shadow: 0 0 0 8px rgba(111, 230, 198, 0); } 100% { box-shadow: 0 0 0 0 rgba(111, 230, 198, 0); } }
}
.hx-h2 { font-size: 20px; font-weight: 900; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }

/* ---------- Homepage head ---------- */
.hx-head { display: flex; align-items: baseline; gap: 6px 18px; flex-wrap: wrap; margin: 4px 0 14px; }
.hx-head h1 { font-size: clamp(22px, 2.6vw, 30px); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; order: -1; }

/* ---------- Bento: the five newest games ---------- */
.bento {
  display: grid; gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 24px;
}
.bt { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--card); isolation: isolate; }
.bt .thumb { border-radius: 0; aspect-ratio: 16 / 10; }
.bt .thumb img { width: 100%; height: 100%; object-fit: cover; }
.bt-big { grid-column: span 2; grid-row: span 2; }
.bt-big .thumb { position: absolute; inset: 0; aspect-ratio: auto; }
.bt-cap {
  position: absolute; inset: auto 0 0 0; z-index: 2; pointer-events: none;
  display: grid; gap: 3px; padding: 26px 12px 10px;
  background: linear-gradient(to top, rgba(14, 8, 15, .92) 10%, rgba(14, 8, 15, .55) 55%, transparent);
}
.bt-kick { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.bt-kick i { font-style: normal; color: var(--dim); }
.bt-new { color: var(--on-brand); background: var(--amber); padding: 1px 7px; border-radius: 99px; letter-spacing: .04em; }
.bt-t { font-size: 15.5px; font-weight: 900; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-big .bt-cap { padding: 60px 22px 20px; gap: 6px; }
.bt-big .bt-kick { font-size: 12.5px; }
.bt-big .bt-t { font-size: clamp(24px, 2.6vw, 36px); letter-spacing: -.02em; white-space: normal; }
.bt-line { color: var(--muted); font-size: 15px; line-height: 1.4; max-width: 46ch; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bt-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.bt-go {
  display: inline-flex; align-items: center; height: 42px; padding: 0 20px; border-radius: 99px;
  background: var(--brand); color: var(--on-brand); font-weight: 900; font-size: 15px;
  box-shadow: 0 6px 20px rgba(255, 95, 162, .35);
}
.bt-go::before { content: ""; width: 0; height: 0; margin-right: 9px; border-style: solid; border-width: 6px 0 6px 10px; border-color: transparent transparent transparent currentColor; }
.bt .tile-stats { font-style: normal; color: var(--muted); font-size: 13px; font-weight: 800; }
.bt:hover .bt-go { background: var(--brand-2); }
.bt::after { content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); pointer-events: none; transition: box-shadow .15s; }
.bt:hover::after, .bt:focus-visible::after { box-shadow: inset 0 0 0 2px var(--brand-2); }

/* ---------- Game wall ---------- */
.wall { margin-bottom: 40px; scroll-margin-top: calc(var(--top) + 12px); }
.wall-bar {
  position: sticky; top: var(--top); z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 0 -24px 14px; padding: 10px 24px;
  background: rgba(21, 15, 23, .92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.wall-sort { display: flex; padding: 3px; border-radius: 99px; background: var(--panel); }
.wall-sort button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 99px; background: none;
  color: var(--muted); font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; white-space: nowrap;
}
.wall-sort button[hidden] { display: none; }
.wall-sort button[aria-pressed="true"] { background: var(--text); color: var(--on-brand); }
.wall-cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1 1 0; }
.wall-cats::-webkit-scrollbar { display: none; }
.wall-cats a {
  flex: none; display: inline-flex; align-items: center; height: 34px; padding: 0 13px; border-radius: 99px;
  box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); font-weight: 800; font-size: 14px; white-space: nowrap;
}
.wall-cats a:hover { color: var(--text); box-shadow: inset 0 0 0 1.5px var(--dim); }
.wall-cats a[aria-current] { background: var(--brand); color: var(--on-brand); box-shadow: none; }
.wall-cats a small { margin-left: 6px; font-size: 12px; opacity: .7; }
.fy-moods { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.fy-moods[hidden] { display: none; }
.fy-moods button {
  height: 32px; padding: 0 12px; border: 0; border-radius: 99px; background: var(--panel);
  color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 800; cursor: pointer;
}
.fy-moods button[aria-pressed="true"] { background: rgba(111, 230, 198, .16); color: var(--mint); box-shadow: inset 0 0 0 1.5px rgba(111, 230, 198, .5); }

.wall-grid { display: grid; gap: 22px var(--hgap); grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gc { min-width: 0; }
.gc .thumb { border-radius: var(--r-lg); }
.gc .thumb img { width: 100%; height: 100%; object-fit: cover; transition: scale .25s ease; }
.gc:hover .thumb img { scale: 1.04; }
.gc .thumb::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); pointer-events: none; transition: box-shadow .15s; }
.gc:hover .thumb::after, .gc:focus-visible .thumb::after { box-shadow: inset 0 0 0 2px var(--brand-2); }
.gc-meta { display: grid; gap: 2px; padding: 9px 2px 0; }
.gc-t { font-size: 16px; font-weight: 900; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-s { display: flex; justify-content: space-between; gap: 8px; color: var(--dim); font-size: 13px; font-weight: 700; }
.gc-s > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-s em { font-style: normal; white-space: nowrap; color: var(--muted); }
.gc[hidden] { display: none; }
.wall-grid .ad-slot { margin: 0; align-self: center; justify-self: center; }
.empty { padding: 40px 0; text-align: center; color: var(--muted); font-weight: 700; }
.empty[hidden] { display: none; }

/* Filtering (search, category or ?s=): only the wall stays */
body.hub.filtering .bento, body.hub.filtering .band, body.hub.filtering .hx-potm, body.hub.filtering .hx-head,
body.hub.filtering .wall-grid .ad-slot { display: none; }

/* ---------- Band: the most played games, one small ad ---------- */
.band { display: grid; gap: var(--hgap); grid-template-columns: minmax(0, 1fr) 300px; align-items: stretch; margin-bottom: 28px; }
.band:not(:has(> .ad-slot:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
.band-card[hidden] { display: none; }
.band-card { border-radius: var(--r-lg); background: var(--panel); padding: 20px; min-width: 0; }
.band > .ad-slot { margin: 0; align-self: start; }


.charts { display: grid; gap: 14px; align-content: start; }
.charts-list { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.ch-card { display: grid; gap: 6px; min-width: 0; }
.ch-cover { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--card); }
.ch-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.ch-card:hover .ch-cover img { transform: scale(1.05); }
.ch-cover::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.ch-n {
  position: absolute; left: 8px; bottom: -4px; z-index: 1; font-size: clamp(34px, 3.4vw, 48px); font-weight: 900; line-height: 1;
  color: var(--text); -webkit-text-stroke: 1.5px rgba(0, 0, 0, .5); text-shadow: 0 2px 10px rgba(0, 0, 0, .6); font-variant-numeric: tabular-nums;
}
.charts-list li:first-child .ch-n { color: var(--amber); }
.ch-t { font-weight: 800; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-p { color: var(--muted); font-weight: 800; font-size: 12.5px; font-variant-numeric: tabular-nums; margin-top: -4px; }

/* Under the newest games: the streak strip (shell.js), then the Player of the month card (potm.js) */
body.hub .streak { margin: 0 0 var(--hgap); }
body.hub .hx-potm { margin: 0 0 28px; }
body.hub.filtering .streak { display: none; }

/* ---------- About strip ---------- */
.about-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 40px; align-items: center; padding: 22px 0; border-top: 1px solid var(--line); }
.about-strip p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin-top: 6px; max-width: 80ch; }
.about-links { display: flex; flex-wrap: wrap; gap: 6px; max-width: 520px; }
.about-links a { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 13px; border-radius: 99px; background: var(--panel); color: var(--muted); font-weight: 800; font-size: 13.5px; }
.about-links a:hover { color: var(--text); background: var(--card); }

/* ---------- Ad spots (fixed size, labelled, fold away when empty) ---------- */
body.hub .ad-slot { --ad-w: 320px; --ad-h: 100px; max-width: 100%; }
body.hub .ad-slot::before { margin-bottom: 6px; }
body.hub .ad-box { width: var(--ad-w); height: var(--ad-h); max-width: 100%; margin-inline: auto; overflow: hidden; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.ad-banner { margin: 0 auto 36px; }
.ad-rect { --ad-w: 300px; --ad-h: 250px; }
body.hub .ad-slot.ad-rect { --ad-w: 300px; --ad-h: 250px; }
.ad-grid { grid-column: 1 / -1; }
@media (min-width: 760px) {
  .ad-grid { grid-column: auto; }
  body.hub .ad-slot.ad-grid { --ad-w: 300px; --ad-h: 250px; }
}
@media (min-width: 1000px) { body.hub .ad-slot.ad-banner { --ad-w: 728px; --ad-h: 90px; } }

/* ---------- Leaderboards: the Arena ---------- */
.lb-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px 24px; margin: 4px 0 16px; }
.lb-head h1 { font-size: clamp(26px, 3vw, 38px); font-weight: 900; letter-spacing: -.02em; line-height: 1.05; margin-top: 4px; }
.lb-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }
.lb-reset { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 99px; background: var(--panel); color: var(--muted); font-weight: 800; font-size: 13.5px; }
.lb-reset b { color: var(--amber); font-variant-numeric: tabular-nums; display: inline-block; min-width: 6ch; }
/* The prize card fills in from /assets/potm.js: hold its space so the boards don't jump */
#potm:empty { display: block; min-height: 318px; border-radius: var(--r-lg); background: var(--panel); }
.lb-board { min-height: 460px; }
.lb-layout { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; margin: 18px 0 36px; }
.lb-rail { position: sticky; top: calc(var(--top) + 16px); display: grid; gap: var(--hgap); }
.lb-rail .gl { margin: 0; padding: 16px 14px 12px; }
.lb-rail .gl-head { flex-direction: column; align-items: stretch; gap: 10px; }
.lb-rail .gl-side { width: 100%; justify-content: space-between; }
.lb-rail .gl-body { grid-template-columns: minmax(0, 1fr); }
.lb-rail .ad-slot { margin: 0 auto; }

.lb-pick { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 6px 6px 10px; margin: -6px -6px 4px; scroll-snap-type: x proximity; }
.lb-pick::-webkit-scrollbar { display: none; }
.lb-chip {
  flex: none; scroll-snap-align: start; display: grid; gap: 6px; width: 132px; padding: 0; border: 0; background: none;
  color: var(--muted); font: inherit; text-align: left; cursor: pointer;
}
.lb-chip img { width: 132px; height: 82px; border-radius: 10px; object-fit: cover; background: var(--card); opacity: .7; transition: opacity .15s; }
.lb-chip span { font-size: 13px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-chip:hover img { opacity: 1; }
.lb-chip[aria-pressed="true"] { color: var(--text); }
.lb-chip[aria-pressed="true"] img { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand); }

.lb-stage { display: grid; gap: 18px; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: start; padding: 18px; border-radius: var(--r-lg); background: var(--panel); }
.lb-cover { display: grid; gap: 10px; }
.lb-cover .thumb { border-radius: 12px; }
.lb-cover .thumb img { width: 100%; height: 100%; object-fit: cover; }
.lb-cover b { font-size: 20px; font-weight: 900; line-height: 1.2; }
.lb-cover p { color: var(--muted); font-size: 14px; line-height: 1.45; }
.lb-cover .bt-go { justify-self: start; height: 40px; font-size: 14.5px; }
.lb-board .gl { margin: 0; padding: 0; background: none; }
.lb-board > div[hidden] { display: none; }
.lb-mid { margin: 24px auto 0; }

/* ---------- Breakpoints ---------- */
/* Big or zoomed-out screens: a wider column and a fifth tile per row, still centred */
@media (min-width: 1760px) {
  body.hub { --wrap: 1600px; }
  .wall-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .lb-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .lb-stage { grid-template-columns: minmax(0, 1fr); }
  .lb-cover { grid-template-columns: 220px minmax(0, 1fr); align-items: center; column-gap: 16px; }
  .lb-cover .thumb { grid-row: span 3; }
}
@media (max-width: 1000px) {
  .band { grid-template-columns: minmax(0, 1fr); }
  .band > .ad-slot { justify-self: center; }
  .wall-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bt-big { grid-column: 1 / -1; grid-row: auto; }
  .bt-big .thumb { position: relative; aspect-ratio: 21 / 9; }
  .bt:not(.bt-big) .bt-kick { display: none; }
  .about-strip { grid-template-columns: minmax(0, 1fr); }
  .lb-layout { grid-template-columns: minmax(0, 1fr); }
  .lb-rail { position: static; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
}
@media (max-width: 760px) {
  body.hub .main, body.hub.side-mini .main { padding: calc(var(--top) + 12px) 16px 0; }
  .wall-bar { margin: 0 -16px 12px; padding: 8px 16px; }
  .wall-cats { flex-basis: 100%; order: 3; margin-inline: -16px; padding-inline: 16px; }
  .wall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
  .gc .thumb { border-radius: 10px; }
  .gc-t { font-size: 14.5px; }
  .gc-s { font-size: 12px; flex-direction: column; gap: 0; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 28px; }
  .bt-big .thumb { aspect-ratio: 16 / 10; }
  .bt:not(.bt-big) .bt-kick { display: flex; }
  .bt-big .bt-cap { position: static; padding: 12px 14px 14px; background: var(--panel); pointer-events: auto; }
  .bt-line { font-size: 13.5px; }
  .bt-go { height: 38px; padding: 0 16px; font-size: 14px; }
  .bt-t { font-size: 14px; }
  .bt-cap { padding: 22px 10px 8px; }
  .band { grid-template-columns: minmax(0, 1fr); }
  .band > .ad-slot { justify-self: center; }
  .band-card { padding: 16px; }
  .charts-list { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .charts-list li { scroll-snap-align: start; }
  .about-strip { grid-template-columns: minmax(0, 1fr); }
  .lb-rail { grid-template-columns: minmax(0, 1fr); }
  .lb-stage { padding: 14px; }
  .lb-cover { grid-template-columns: 120px minmax(0, 1fr); }
  .lb-cover .thumb { grid-row: span 2; }
  .lb-cover p { display: none; }
  .lb-chip { width: 108px; }
  .lb-chip img { width: 108px; height: 68px; }
  #potm:empty { min-height: 540px; }
}
@media (max-width: 420px) {
  .wall-sort button { padding: 0 11px; font-size: 13.5px; }
  .bt:not(.bt-big) .bt-kick { display: none !important; }
  .lb-cover .bt-go { height: 36px; padding: 0 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .gc .thumb img, body.hub .sidebar { transition: none; }
  .gc:hover .thumb img { scale: none; }
}
/* Your row on the narrow rail: no games count */
.lb-rail .gl-you { grid-template-columns: auto 34px minmax(0, 1fr) auto; }
.lb-rail .gl-you .gl-g { display: none; }

/* Coming soon posters on the homepage (built games being finished): two wide cards, stacked on phones. */
.soon-row { margin-bottom: 36px; }
.soon-row .hx-h2 { margin-bottom: 14px; }
.soon-row .hx-h2 .ic { color: var(--amber); }
body.hub.filtering .soon-row { display: none; }
.posters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.poster { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--card); aspect-ratio: 16 / 10; isolation: isolate; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; transition: transform .5s ease; }
.poster::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(21,15,23,0) 30%, rgba(21,15,23,.78) 62%, rgba(21,15,23,.96) 100%); }
.poster:hover img { transform: scale(1.04); }
.poster-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 20px; text-shadow: 0 1px 8px rgba(0,0,0,.6); }
.poster-soon { display: inline-block; text-shadow: none; padding: 3px 10px; border-radius: 6px; background: var(--amber); color: var(--on-brand); font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.poster-txt em { margin-left: 8px; font-style: normal; font-size: 13px; font-weight: 800; color: var(--mint); }
.poster-txt h3 { margin: 8px 0 4px; font-size: clamp(22px, 2.4vw, 32px); font-weight: 900; line-height: 1.05; }
.poster-txt p { margin: 0; max-width: 46ch; font-size: 14px; color: var(--muted); line-height: 1.4; }
@media (max-width: 760px) {
  .posters { grid-template-columns: 1fr; gap: 12px; }
  .poster-txt { padding: 14px 16px; }
  .poster-txt p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .poster img { transition: none; } .poster:hover img { transform: none; } }

/* Coming soon card at the end of the wall: same size as the games, dimmed art, amber tag. */
.gc-soon .thumb img { filter: saturate(.8) brightness(.8); }
.soon-tag { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 3px 9px; border-radius: 6px; background: var(--amber); color: var(--on-brand); font-size: 11px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
