/* games.gonglogic.com — the games on itch.io (GamesPageController).

   Built from the family's tokens (static/family/tokens.css) and components (.gl-btn, .gl-chip): paper,
   ink and lines are theirs, and the one colour of the site's own is its --accent, arcade raspberry,
   set on body[data-site="games"] there. Everything here is prefixed gx- so nothing leaks. */

.gx { padding: var(--s-6) 0 var(--s-12); color: var(--ink); }
.gx a { color: var(--accent-ink); }
.gx a:hover { color: var(--ink); }
.gx .gl-btn { text-decoration: none; }
.gx-h2 { margin: 0 0 var(--s-3); font-family: var(--font-text); font-size: var(--fs-5); line-height: 1.2; }
.gx-h3 { margin: var(--s-6) 0 var(--s-2); font-family: var(--font-ui); font-size: var(--fs-3); }

/* ── The front page: a card per game, cover beside the words on a wide screen. */
.gx-cards { display: grid; gap: var(--s-6); margin: 0; padding: 0; list-style: none; }
.gx-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-4) var(--s-8);
    padding: var(--s-4);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-m);
}
@media (min-width: 48rem) {
    .gx-card { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; padding: var(--s-5); }
}
.gx-card__art img { display: block; width: 100%; height: auto; aspect-ratio: 63 / 50; object-fit: cover; border-radius: var(--radius-s); background: var(--surface-2); }
.gx-card__name { margin: 0; font-family: var(--font-text); font-size: var(--fs-5); line-height: 1.15; }
.gx .gx-card__name a { color: var(--ink); text-decoration: none; }
.gx .gx-card__name a:hover { text-decoration: underline; }
.gx-card__pitch { margin: var(--s-2) 0 0; font-size: var(--fs-3); color: var(--ink-2); }
.gx-card__price { margin: var(--s-3) 0 0; font-weight: 600; }
.gx-card__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.gx-facts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 0; padding: 0; list-style: none; }
.gx-facts .gx-facts__dev { border-color: var(--accent); color: var(--accent-ink); }

/* ── Game music: the one way across to audio.gonglogic.com. */
.gx-music { margin-top: var(--s-10); padding: var(--s-6); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--paper-2); }
.gx-music__title { margin: 0 0 var(--s-2); font-family: var(--font-text); font-size: var(--fs-4); }
.gx-music p { margin: var(--s-2) 0 0; max-width: 60ch; color: var(--ink-2); }

/* ── A game's page: the cover (or the Play box) beside its facts and the itch button. */
.gx-game__top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
@media (min-width: 56rem) {
    .gx-game__top { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; }
}
.gx-game__cover { display: block; width: 100%; height: auto; border-radius: var(--radius-m); background: var(--surface-2); }
.gx-dl { display: grid; gap: var(--s-3); margin: 0; }
.gx-dl > div { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: var(--s-3); align-items: baseline; }
.gx-dl dt { font-size: var(--fs-1); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.gx-dl dd { margin: 0; }
.gx-dl .gx-facts { margin: 0; }
.gx-game__music { margin: var(--s-4) 0 0; }

/* The Play box: the poster and a button; games.js puts the iframe in its place on a press. Its box is
   the frame's own shape (--gx-ratio), so nothing moves when the game arrives. */
.gx-play {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    width: 100%;
    max-width: 40rem;
    aspect-ratio: var(--gx-ratio, 1);
    overflow: hidden;
    border-radius: var(--radius-m);
    background: #1c1d23;
}
.gx-play__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(0.55); }
.gx-play__btn, .gx-play__note { position: relative; }
.gx-play__note { margin: 0; font-size: var(--fs-1); color: #ecebe8; }
.gx-play iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.gx-play--video { max-width: 48rem; }
.gx-play--video .gl-btn { background: var(--surface); }

/* ── Screenshots: a row that scrolls sideways on its own, never the page. */
.gx-shots { margin: var(--s-8) 0 0; }
.gx-shots__list { display: flex; gap: var(--s-3); margin: 0; padding: 0 0 var(--s-2); list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.gx-shots__list li { flex: none; scroll-snap-align: start; }
.gx-shots__list img { display: block; width: auto; height: clamp(12rem, 40vw, 20rem); max-width: 85vw; object-fit: contain; border-radius: var(--radius-s); background: var(--surface-2); }

/* ── The description, quoted from itch.io, at reading width. */
.gx-game__body { display: grid; gap: var(--s-10); margin-top: var(--s-10); }
.gx-about { max-width: 46rem; }
.gx-about p { margin: 0 0 var(--s-3); line-height: 1.6; }
.gx-about__list { margin: 0 0 var(--s-3); padding-left: 1.2rem; }
.gx-about__list li { margin: var(--s-2) 0; line-height: 1.55; }
.gx-about__src { font-size: var(--fs-1); color: var(--muted); }

/* ── More games, under a game's page. */
.gx-more { margin: 0 0 var(--s-12); }
.gx-more__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: var(--s-3); margin: 0; padding: 0; list-style: none; }
.gx-more__card { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); color: var(--ink); text-decoration: none; }
.gx-more__card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); color: var(--ink); text-decoration: none; }
.gx-more__card img { flex: none; width: 96px; height: 76px; object-fit: cover; border-radius: var(--radius-s); }
.gx-more__text { display: grid; gap: 2px; min-width: 0; }
.gx-more__name { font-weight: 600; }
.gx-more__pitch { font-size: var(--fs-1); color: var(--muted); }
.gx-more__all { margin: var(--s-4) 0 0; }
.gx-more__all a { color: var(--accent-ink); }
