/* Games gallery (/games) and the home-page strip. Builds on ui.css + site.css tokens; no new fonts. */

/* ---------- hero ---------- */
.gx-hero { padding-bottom: clamp(18px, 2vw, 32px); }
.gx-hero .hero-bg { position: absolute; inset: calc(var(--nav-h) * -1) 0 -120px; z-index: -1; pointer-events: none; overflow: hidden;
  background: radial-gradient(760px 380px at 18% 20%, rgba(124,92,255,.22), transparent 70%), radial-gradient(700px 360px at 84% 10%, rgba(255,201,60,.14), transparent 70%); }
.gx-count { display: inline-flex; align-items: center; gap: 10px; margin: 22px auto 0; padding: 8px 16px 8px 12px; border-radius: 999px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line-strong); font: 600 14.5px/1.2 var(--font); color: var(--text-2); }
.gx-count b { font: 800 17px/1 var(--display); color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; min-width: 1ch; display: inline-block; text-align: right; }
.gx-count .live { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: gx-ping 2.2s ease-out infinite; flex: none; }
@keyframes gx-ping { 0% { box-shadow: 0 0 0 0 rgba(52,211,153,.55); } 70%, 100% { box-shadow: 0 0 0 9px rgba(52,211,153,0); } }

/* ---------- toolbar: genre chips + sort ---------- */
.gx-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px 24px; flex-wrap: wrap; margin: clamp(18px, 2.4vw, 34px) 0 22px; }
.gx-chips { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; }
.gx-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-1); color: var(--text-2); font: 600 14px/1 var(--font); cursor: pointer; transition: background .18s, border-color .18s, color .18s; }
.gx-chip:hover { border-color: var(--line-hover); color: var(--text); }
.gx-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #0a0b10; }
.gx-chip .n { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.gx-chip[aria-pressed="true"] .n { color: #4a5068; }
.gx-sort { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.gx-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-inset); border: 1px solid var(--line); }
.gx-seg button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font: 600 13.5px/1 var(--font); cursor: pointer; transition: background .18s, color .18s; }
.gx-seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
@media (max-width: 640px) {
  .gx-bar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; } /* grid, not a flex column: the nowrap chip row must not widen the page */
  .gx-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter) 6px; scrollbar-width: none; scroll-padding-inline: var(--gutter); }
  .gx-chips::-webkit-scrollbar { display: none; }
  .gx-chip { flex: none; min-height: 44px; }
  .gx-sort { justify-content: space-between; }
  .gx-seg button { min-height: 40px; }
}

/* ---------- grid + tiles ---------- */
.gt-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(16px, 1.6vw, 26px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
@media (min-width: 2200px) { .gt-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gt { position: relative; min-width: 0; perspective: 1100px; --accent: #ffc93c; }
.gt-card { position: relative; display: flex; flex-direction: column; height: 100%; border-radius: var(--rs-3); background: var(--surface-1); border: 1px solid var(--line);
  color: inherit; text-decoration: none; overflow: hidden; transform-style: preserve-3d; isolation: isolate;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--sc, 1));
  transition: transform .5s var(--ease-out), border-color .25s, box-shadow .35s var(--ease-out); will-change: transform; }
.gt.hot .gt-card { --sc: 1.025; border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  box-shadow: 0 26px 60px -26px color-mix(in srgb, var(--accent) 60%, transparent), 0 12px 30px -12px rgba(0,0,0,.6); transition: transform .14s linear, border-color .25s, box-shadow .35s var(--ease-out); }
.gt-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.gt-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #07080d; }
.gt-media img, .gt-media video { position: absolute; inset: -3%; width: 106%; height: 106%; max-width: none; object-fit: cover; display: block;
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0); transition: transform .5s var(--ease-out), opacity .35s; }
.gt.hot .gt-media img, .gt.hot .gt-media video { transition: transform .14s linear, opacity .35s; }
.gt-media video { opacity: 0; }
.gt-media video.on { opacity: 1; }
.gt-glare { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; mix-blend-mode: soft-light;
  background: radial-gradient(420px 260px at var(--gx, 50%) var(--gy, 0%), rgba(255,255,255,.55), transparent 60%); }
.gt.hot .gt-glare { opacity: 1; }
.gt-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 7% 7% 6%;
  background: radial-gradient(120% 90% at 0% 100%, color-mix(in srgb, var(--accent) 55%, transparent), transparent 60%), radial-gradient(90% 80% at 100% 0%, rgba(124,92,255,.35), transparent 60%), #10121a; }
.gt-fallback b { font: 800 clamp(26px, 2.2vw, 40px)/.95 var(--display); letter-spacing: -.04em; color: #fff; text-wrap: balance; text-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 45%, #000); }
.gt-tags { position: absolute; left: 12px; top: 12px; right: 12px; display: flex; flex-direction: row-reverse; gap: 6px; justify-content: space-between; align-items: flex-start; z-index: 2; pointer-events: none; }
.gt-rate { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px 5px 7px; border-radius: 8px; font: 700 11.5px/1 var(--font); letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: rgba(7,8,13,.72); border: 1px solid rgba(255,255,255,.14); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.gt-rate svg { flex: none; }
.gt-rate.everyone svg { color: var(--mint); } .gt-rate.teen svg { color: var(--gold); }
.gt-live { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; font: 700 11.5px/1 var(--font); color: #fff; background: rgba(7,8,13,.72); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; }
.gt-live i { width: 7px; height: 7px; border-radius: 50%; background: #ff5d5d; }
.gt.playing .gt-live { opacity: 1; transform: none; }
.gt-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; min-width: 0; }
.gt-body h3 { margin: 0; font: 700 clamp(18px, .35vw + 16px, 21px)/1.15 var(--display); letter-spacing: -.02em; color: var(--text); overflow-wrap: anywhere; }
.gt-meta { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); min-width: 0; }
.gt-meta .studio { color: var(--text-2); font-weight: 600; overflow-wrap: anywhere; }
.gt-genre { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 650; line-height: 1.35;
  color: color-mix(in srgb, var(--accent) 70%, #fff); background: color-mix(in srgb, var(--accent) 13%, var(--surface-1)); border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line)); }
.gt-desc { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gt-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); min-height: 42px; font-size: 13px; color: var(--muted); }
.gt-stats { display: flex; gap: 6px 14px; flex-wrap: wrap; margin: 0; min-width: 0; }
.gt-stats div { display: flex; align-items: baseline; gap: 5px; }
.gt-stats dt { order: 2; } .gt-stats dd { margin: 0; font: 700 14px/1 var(--display); color: var(--text); font-variant-numeric: tabular-nums; }
.gt-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); white-space: nowrap; transition: color .2s, gap .2s; }
.gt.hot .gt-go { color: color-mix(in srgb, var(--accent) 65%, #fff); gap: 9px; }
.gt-extra { display: flex; padding: 0 18px 16px; margin-top: -6px; }
.gt-extra a { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; font-size: 13.5px; font-weight: 650; color: var(--text-2); text-decoration: none; border-radius: 8px; }
.gt-extra a:hover { color: var(--text); }
.gt-extra a::before { content: ""; width: 18px; height: 18px; border-radius: 6px; background: var(--grad-gold); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 14px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E") center / 14px no-repeat; }
/* tiles share a row: put the extra link inside the card frame visually */
.gt.has-extra .gt-card { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom: 0; height: auto; flex: 1; }
.gt.has-extra { display: flex; flex-direction: column; }
.gt.has-extra .gt-extra { background: var(--surface-1); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--rs-3) var(--rs-3); padding-top: 12px; margin-top: 0; }

/* build-up: staggered entrance */
.gt-grid.build .gt { opacity: 0; transform: translateY(22px) scale(.97); }
.gt-grid.build .gt.in { opacity: 1; transform: none; transition: opacity .6s var(--ease-out), transform .7s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  .gt-grid.build .gt { opacity: 1; transform: none; }
  .gt-card, .gt-media img, .gt-media video { transition: none !important; transform: none !important; }
  .gx-count .live { animation: none; }
}
/* skeletons while loading */
.gt.sk .gt-card { pointer-events: none; }
.gt.sk .gt-media, .gt.sk .bar { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: gx-sheen 1.4s linear infinite; }
.gt.sk .bar { height: 14px; border-radius: 6px; }
@keyframes gx-sheen { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .gt.sk .gt-media, .gt.sk .bar { animation: none; } }

/* empty / error */
.gx-empty { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; gap: 10px; padding: clamp(40px, 6vw, 80px) 20px; border: 1px dashed var(--line-strong); border-radius: var(--rs-3); background: rgba(255,255,255,.015); }
.gx-empty img { width: 96px; height: 96px; object-fit: contain; }
.gx-empty h3 { margin: 6px 0 0; font-size: 20px; }
.gx-empty p { margin: 0; max-width: 44ch; }
.gx-empty .row { justify-content: center; margin-top: 8px; }

.gx-list { padding-bottom: calc(var(--sec) * .35); }
/* the last tile invites the next game */
.gt-yours .gt-card { border-style: dashed; border-color: var(--line-strong); background: radial-gradient(120% 80% at 50% 0%, rgba(255,201,60,.08), transparent 60%), rgba(255,255,255,.012); }
.gt-yours .gt-media { background: radial-gradient(60% 70% at 50% 60%, rgba(124,92,255,.22), transparent 70%); }
.gt-yours .gt-media img { inset: 12% 0 0; width: 100%; height: 88%; object-fit: contain; transform: none; filter: drop-shadow(0 18px 30px rgba(0,0,0,.5)); }
.gt-yours .gt-card:hover { border-color: rgba(255,201,60,.5); }
.gt-yours .gt-go { color: var(--gold); }
.gx-note { margin: 22px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 6px 18px; flex-wrap: wrap; }

/* ---------- home strip ---------- */
.gs-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px 30px; flex-wrap: wrap; margin-bottom: clamp(24px, 3vw, 40px); }
.gs-hd .sec-hd { margin-bottom: 0; }
.gs-hd .btn { flex: none; }
.games-strip .gt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .games-strip .gt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .games-strip .gt-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(84%, 340px); overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter) 10px; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .games-strip .gt-grid::-webkit-scrollbar { display: none; }
  .games-strip .gt { scroll-snap-align: start; }
  .gs-hd .btn { width: 100%; }
}
