/* The games page (/games): every game the site shows, a card each (backend/lib/home.js renderGamesPage). A computer: a
   grid, a landscape game's card twice as wide. A phone: a feed, one game per screen, snapping (the user, 2026-10-23: «que
   cuando la vea desde el teléfono pase los juegos como si estuviera viendo un feed de instagram»): upright, the home's own
   feed (#gp-feed: slides.css + feed.css; the user, 2026-10-24: «quiero que en mobile la sección de games se despliegue
   igual como se ven los juegos en el home»); on its side, these cards, their words at the left of the clip. */

/* ---------- the top: title, count, lead, style filters ---------- */
.gp-intro { display: grid; gap: 12px; padding-top: 8px; padding-bottom: 28px; }
.gp-title { display: flex; align-items: center; gap: 14px; }
.gp-title h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 56px; line-height: 64px; }
.gp-lead { margin: 0; max-width: 640px; color: var(--tx-mid); font-size: 18px; line-height: 27px; }
.gp-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.gp-chip { min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: transparent; color: var(--ivory);
  font: inherit; font-weight: 600; cursor: pointer; }
.gp-chip:hover { border-color: var(--ivory); }
.gp-chip[aria-pressed="true"] { background: var(--c, var(--lime)); border-color: var(--c, var(--lime)); color: var(--night); }
.gp-chip:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.gp-swipe { display: none; }

/* ---------- the cards ---------- */
.gp-wrap { padding-bottom: 72px; }
.gp-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.gp-empty { color: var(--tx-mid); }
.gp-card { display: flex; flex-direction: column; min-width: 0; border-radius: 24px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); }
.gp-card[hidden] { display: none; }
/* a landscape card is as tall as what it holds, not the portrait clips beside it, so its Play sits under its text (the
   user, 2026-10-23, «acorta esa distancia») */
.gp-card.is-land { grid-column: span 2; align-self: start; }
/* packed (games.js packGrid): the rows are 4 px and each card spans as many as it is tall, the gaps inside its span, and a
   later card fills a hole an earlier one left, so upright and landscape cards fit together with no holes (the user,
   2026-10-28: «el grid debe ser inteligente para agruparlo y no dejar huecos») */
.gp-list.is-packed { grid-auto-rows: 4px; grid-auto-flow: row dense; row-gap: 0; }
.gp-list.is-packed .gp-card { align-self: start; }
.gp-media { position: relative; height: 460px; background: #000; overflow: hidden; --clip-fit: contain; }   /* (its loading cover's picture, whole like the clip: site.css .clip-cover) */
/* the whole play shows: the clip contained, over its own poster blurred («reescálalo para que se vea todo el gameplay») */
.gp-media::before { content: ''; position: absolute; inset: -24px; background: var(--poster, none) center / cover; filter: blur(22px) brightness(0.5); }
.gp-media video, .gp-media > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; display: block; }
/* (a picture fills its box: the user, 2026-11-25, «las imágenes siempre rellenen los containers»; a clip stays whole) */
.gp-media > img:not(.gp-mascot) { object-fit: cover; }
.gp-media .gp-mascot { object-fit: contain; padding: 25%; background: var(--violet-deep); }
/* each clip in its own shape, so no bars show («haz la caja menos alta para que no se vean las franjas negras») */
.gp-card.is-land .gp-media { height: auto; aspect-ratio: 16 / 9; }
.gp-card.is-port .gp-media { height: auto; aspect-ratio: 9 / 16; }
.gp-card.soon .gp-media > img { filter: saturate(0.6) brightness(0.8); }
.gp-info { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px 20px 22px; flex: 1; }
.gp-head { display: flex; align-items: center; gap: 12px; max-width: 100%; color: var(--ivory); text-decoration: none; }
.gp-head:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; border-radius: 14px; }
.gp-icon { width: 48px; height: 48px; border-radius: 14px; flex: none; }
.gp-id { display: grid; gap: 2px; min-width: 0; }
.gp-name { font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 30px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.gp-tag { margin: 0; color: var(--tx-mid); font-size: 15px; line-height: 22px; }
.gp-pf { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gp-pf li { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; font-size: 13px; line-height: 18px; background: rgba(250, 247, 242, 0.07); }
.gp-pf svg { width: 18px; height: 18px; }
.gp-play { margin-top: auto; }

@media (max-width: 1023px) {
  .gp-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gp-media { height: 420px; }
}

/* ---------- a phone (upright, or on its side): the top ---------- */
@media (max-width: 767px), (orientation: landscape) and (max-height: 500px) {
  .gp-intro { gap: 0; padding-top: 0; padding-bottom: 10px; }   /* (the title, the hint and the first game close together: «recorta esos espacios») */
  /* the feed starts at once: no count, no lead, no style filters (the user, 2026-10-23, of the top of the page on a phone:
     «quita todo eso») */
  .gp-title .tag-chip, .gp-lead, .gp-filters, .gp-intro .gp-mine-line { display: none; }   /* (the line of what you have played too: the feed keeps its top short) */
  .gp-title h1 { font-size: 40px; line-height: 46px; }
  .gp-lead { font-size: 16px; line-height: 24px; }
  .gp-swipe { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--tx-mid); }
  .gp-swipe-ico { color: var(--lime); animation: gp-nudge 3.2s ease-in-out 1s 4; }
}

/* ---------- an upright phone: the home's own feed of games (the user, 2026-10-24: «quiero que en mobile la sección de
   games se despliegue igual como se ven los juegos en el home»): #gp-feed, the home's slides (backend/lib/home.js
   gameSlide; slides.css, and feed.css, which games.html loads for this same media), on a panel as the home's, in place of
   the cards; everywhere else the cards and no feed ---------- */
.gp-feed { display: none; }
@media (max-width: 767px) and (orientation: portrait), (max-width: 767px) and (min-height: 501px) {
  .gp-wrap:has(.gp-feed) .gp-list { display: none; }   /* (no games: the list's empty words stay) */
  .gp-feed { display: block; padding: 12px; border-radius: 28px; background: var(--bg-1); }
  /* the first game hops up now and then, a hint to swipe (the user, 2026-10-24: «crea ese efecto que es como un brinquito del
     slide para darle un hint al usuario que debe hacer swipe»): four times after a second, then it rests */
  .gp-feed .hg-slide:first-child { animation: gp-hop 3.2s ease-in-out 1s 4; }
}
@keyframes gp-hop { 0%, 64%, 100% { transform: translateY(0); } 72% { transform: translateY(-26px); } 80% { transform: translateY(0); } 86% { transform: translateY(-9px); } 92% { transform: translateY(0); } }
@keyframes gp-nudge { 0%, 64%, 100% { transform: translateY(0); } 72% { transform: translateY(-5px); } 80% { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .gp-feed .hg-slide:first-child, .gp-swipe-ico { animation: none; } }
/* a game coming soon in the feed: its picture dimmed, its label where Play goes */
.gp-feed .soon .hg-clip > img { filter: saturate(0.6) brightness(0.8); }
.gp-feed .hg-soon { grid-area: play; justify-self: start; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px;
  background: var(--night); color: var(--ivory); font-size: 14px; font-weight: 700; line-height: 18px; }

/* ---------- a phone on its side, as a landscape game leaves it (the user, 2026-10-23, after Beatflip's way out: «games en
   mobile se debe ver como un listado de juegos estilo instagram»): the cards as a feed, one game per screen, snapping ---------- */
@media (orientation: landscape) and (max-height: 500px) {
  html:has(.gp-main) { scroll-snap-type: y mandatory; }
  .gp-body .site-top { scroll-snap-align: start; }
  .gp-body .site-foot { scroll-snap-align: end; }
  .gp-wrap.wrap { padding: 0; }
  .gp-list { display: block; }
  .gp-card { position: relative; height: calc(100svh - var(--tabs-room, 0px)); border: 0; border-radius: 0; background: #000; scroll-snap-align: start; scroll-snap-stop: always; }
  .gp-media, .gp-card.is-land .gp-media, .gp-card.is-port .gp-media { position: absolute; inset: 0; height: auto; aspect-ratio: auto; }
  /* the words on top, over a shade that fades into the play; Play at the bottom; the clip's buttons bottom right */
  .gp-info { position: absolute; inset: 0; z-index: 2; gap: 8px; padding: calc(16px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
    background: linear-gradient(rgba(10, 10, 16, 0.88), rgba(10, 10, 16, 0.6) 150px, rgba(10, 10, 16, 0) 260px); pointer-events: none; }
  .gp-info > * { pointer-events: auto; }
  .gp-name { font-size: 22px; line-height: 28px; }
  .gp-tag { font-size: 14px; line-height: 20px; color: rgba(250, 247, 242, 0.85); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .gp-pf { display: none; }
  .gp-play { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
  .gp-card .vid-ctl { top: auto; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); }
  /* the Friends button up top, beside the account chip, and the clip's buttons down by Play (the user, 2026-10-23, arrows on
     a shot of the feed): the header and the words at the top make room for it */
  html body.gp-body .pab-ov .ov-btn.br { bottom: auto; top: calc(16px + env(safe-area-inset-top)); right: 16px; }   /* (over site.css's place above a tab bar) */
  .gp-body .site-top { padding-right: 76px; }
  .gp-info > .gp-head, .gp-info > .gp-tag { max-width: calc(100% - 56px); }
}
/* (a small one with the tab bar: site.css, up to 600 px: the home indicator's room is the bar's, Play and the clip's buttons
   sit right over it) */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 600px) {
  html.has-tabs .gp-info { padding-bottom: 18px; }
  html.has-tabs .gp-card .vid-ctl { bottom: 22px; }
}
/* on its side, the words down the left over a shade, the play on the right */
@media (orientation: landscape) and (max-height: 500px) {
  .gp-info { padding: calc(14px + env(safe-area-inset-top)) max(52%, calc(100% - 400px)) calc(16px + env(safe-area-inset-bottom)) max(16px, calc(env(safe-area-inset-left) + 8px));
    background: linear-gradient(90deg, rgba(10, 10, 16, 0.9), rgba(10, 10, 16, 0.62) 38%, rgba(10, 10, 16, 0) 62%); }
  .gp-tag { -webkit-line-clamp: 3; }
  .gp-media video, .gp-media > img { object-position: 82% center !important; }   /* (over the page's own focus: the words hold the left, the clip the middle of the rest) */
  .gp-card .vid-ctl, html body.gp-body .pab-ov .ov-btn.br { right: max(16px, calc(env(safe-area-inset-right) + 8px)); }
}
@media (orientation: landscape) and (max-height: 500px) and (prefers-reduced-motion: reduce) {
  html:has(.gp-main) { scroll-snap-type: y proximity; }
}
/* the clip opens the game as its Play does (games.js) */
.gp-media.is-play { cursor: pointer; }

/* ---------- the topic pages (/rhythm-games, /party-games…: backend/lib/home.js renderTopic) ----------
   Under the games: the topic's words, its FAQ, the guides that hang from it and the other topics, in a reading column
   (the guides' type: community.css › .guide). */
.tp-more { max-width: 760px; padding-top: 24px; padding-bottom: 72px; }
.tp-more h2 { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 32px; margin: 44px 0 12px; }
.tp-more h2 a { color: inherit; text-decoration: none; }
.tp-more p, .tp-more dd { color: var(--tx-mid); font-size: 17px; line-height: 27px; }
.tp-more p + p { margin-top: 12px; }
.tp-faq dt { color: var(--tx-hi); font-weight: 700; font-size: 17px; margin-top: 16px; }
.tp-faq dd { margin: 4px 0 0; }
.tp-guides ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.tp-guides li a { display: block; height: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; color: var(--tx-hi);
  font-size: 15px; line-height: 21px; text-decoration: none; }
.tp-guides li a:hover { border-color: var(--lime); color: var(--lime); }
.tp-guides a:focus-visible, .tp-more h2 a:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.tp-others ul { padding: 0; }
@media (max-width: 600px) { .tp-more h2 { font-size: 22px; line-height: 28px; margin-top: 36px; } }
/* a phone: unlike /games, a topic page keeps its lead under the title (it says what the page is about) */
@media (max-width: 767px), (orientation: landscape) and (max-height: 500px) { .tp-body .gp-lead { display: block; margin: 4px 0 10px; } }

/* a topic page's Play under its lead: its first game, one tap away (lib/home.js renderTopic) */
.tp-play { margin: 16px 0 0; }
/* a party topic (renderTopic "cta": "party"): Start a party with Got a code? beside it, then how a party goes in steps */
.tp-party { display: flex; align-items: center; gap: 8px 20px; flex-wrap: wrap; }
.tp-party .btn-cta { border: 0; font: inherit; font-weight: 700; font-size: 17px; cursor: pointer; }
.tp-party-code { min-height: 48px; padding: 0 4px; border: 0; background: none; color: var(--ivory); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.tp-party-code:focus-visible, .tp-party .btn-cta:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.tp-steps { list-style: none; margin: 24px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.tp-steps li { display: grid; gap: 8px; align-content: start; padding: 20px; border-radius: 24px; background: var(--bg-2); }
.tp-steps b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--lime); color: var(--night); font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.tp-steps li:nth-child(2) b { background: var(--violet); }
.tp-steps li:nth-child(3) b { background: var(--ivory); }
.tp-steps h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 26px; }
.tp-steps p { margin: 0; color: var(--tx-mid); font-size: 15px; line-height: 22px; }
@media (max-width: 767px) {
  .tp-steps { gap: 8px; margin-top: 16px; }
  .tp-steps li { grid-template-columns: 32px 1fr; column-gap: 12px; row-gap: 4px; padding: 14px 16px; border-radius: 20px; }
  .tp-steps b { grid-row: span 2; width: 32px; height: 32px; font-size: 15px; }
  .tp-steps h2 { font-size: 17px; line-height: 22px; align-self: center; }
  .tp-steps p { font-size: 14px; line-height: 20px; }
}
@media (max-width: 767px), (orientation: landscape) and (max-height: 500px) { .tp-play { margin: 0 0 12px; } .tp-play .btn-cta { display: flex; width: 100%; justify-content: center; } }

/* what this player has done (mine.js): a game's stars beside its name, «New for you» on the ones not played yet, and a
   line over the list. Only once they have played something. */
.gp-mine { display: inline-flex; align-items: center; gap: 4px; justify-self: start; padding: 2px 10px 2px 8px; border-radius: 999px; font-size: 14px; font-weight: 700; line-height: 22px;
  color: var(--lime, #D2FF4D); background: color-mix(in srgb, var(--lime, #D2FF4D) 14%, transparent); }
.gp-mine.is-new { padding: 2px 10px; color: var(--violet, #A47BFF); background: color-mix(in srgb, var(--violet, #A47BFF) 16%, transparent); }
.gp-mine-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--tx-mid); font-size: 16px; line-height: 24px; }
.gp-mine-line a { color: var(--lime, #D2FF4D); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; min-height: 48px; display: inline-flex; align-items: center; }
.gp-mine-line a:focus-visible { outline: 3px solid var(--lime, #D2FF4D); outline-offset: 2px; border-radius: 6px; }
/* «New for you» over the game's video, top-left (mine.js): a solid violet sticker that reads on any picture */
.gp-media .gp-mine.is-new.is-over { position: absolute; top: 14px; left: 14px; z-index: 3; padding: 6px 14px; color: var(--night, #13131B); background: var(--violet, #A47BFF);
  box-shadow: 0 0 0 2px var(--night, #13131B), 3px 4px 0 2px var(--lime, #D2FF4D); font-size: 14px; }

/* the games page's live bits (the user, 2026-11-26: «mete ese contenido en un pill, pon el avatar a la izquierda y sube los usuarios
   conectados»): «n playing now» at the end of the title's row; the latest take a pill — the player's avatar on the left, the line and
   how long ago beside it — on a phone too */
.gp-title { justify-content: space-between; }
.gp-title .live-count { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(250, 247, 242, .08);
  font-size: 14px; font-weight: 700; white-space: nowrap; }
.gp-title .live-count[hidden] { display: none; }
.gp-intro .live-now:not(:has(.live-row)) { display: none; }
.gp-intro .live-now { justify-content: flex-start; }
.gp-intro .live-line { flex: 0 1 auto; }
.gp-intro .live-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; align-items: center; justify-content: start; width: fit-content; max-width: 100%;
  padding: 8px 20px 8px 10px; border-radius: 999px; background: rgba(250, 247, 242, .08); border: 1px solid rgba(250, 247, 242, .1); text-align: left; }
.gp-intro .live-who { grid-row: 1 / span 2; width: 44px; height: 44px; display: grid; place-items: center; }
.gp-intro .live-words { order: 0; flex: none; white-space: normal; text-align: left; font-size: 14px; line-height: 18px; }
.gp-intro .live-row small { order: 0; flex: none; text-align: left; font-size: 12px; line-height: 16px; }
@media (max-width: 599px) { .gp-intro .live-now { justify-content: center; } .gp-intro .live-row { margin-inline: auto; } }

/* a card's Play with its Share to the right (home.js gameCard) */
.gp-acts { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.gp-acts .gp-play { flex: 1 1 auto; min-width: 0; margin-top: 0; }
.gp-acts .gp-share { flex: none; }
/* (Play now on one line beside Share: its words start at the left, as the Challenges' dares do) */
.gp-acts .gp-play { padding-left: 22px; gap: 10px; justify-content: space-between; }
.gp-acts .gp-play > span:not(.btn-play-ico) { white-space: nowrap; }
/* the swipe hint in a pill over the first game's video, centred (games.js moves it there; the user, 2026-11-27) */
.gp-feed .hg-slide > .gp-swipe { display: inline-flex; justify-self: center; align-items: center; gap: 8px; margin: 0; padding: 8px 16px; border-radius: 999px;
  background: var(--bg-3, #2A2A3A); color: var(--tx-hi, #FAF7F2); font-size: 14px; font-weight: 600; line-height: 20px; }
.gp-feed .hg-slide.has-swipe.is-port { grid-template-rows: auto minmax(0, 1fr) auto; }
