/* Game pages (/games/ and /games/<game>). Builds on assets/css/styles.css: same tokens, type and
   buttons. Copied into next/games/ by games/build.py. */

.gp .nav__links a[href="/games/"] { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* ── top of the page: the home page's hero (colour band + app screenshot), with the games screenshot ── */
.hero--game {
  /* the colours of the left edge of app-games.webp, so the screenshot continues into the band */
  background: linear-gradient(180deg, #b97cbf 0%, #a071c1 25%, #956fbe 50%, #694abf 75%, #5b3fbf 100%);
}
.hero--game .ghero__h { font-size: clamp(38px, 5.2vw, 88px); max-width: 11em; }
.hero--game .hero__sub { max-width: 26em; }
.hero--game .cta { align-items: center; }
.crumbs { margin-bottom: clamp(14px, 1.6vw, 24px); font-size: 14.5px; font-weight: 700; color: rgba(255,255,255,.82); }
.crumbs a { color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.ghero__free { font-size: 15.5px; font-weight: 700; color: #fff; }

/* ── three numbers: one band, three equal columns, same treatment for each ── */
.gstats { background: var(--night); color: #fff; }
.gstats__in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gstats li { display: flex; flex-direction: column; gap: 10px; padding: clamp(28px, 3.4vw, 56px) clamp(18px, 2.6vw, 44px); min-width: 0; border-left: 1px solid var(--hair); }
.gstats li:first-child { border-left: 0; padding-left: 0; }
.gstats li:last-child { padding-right: 0; }
.gstats b { font-size: clamp(32px, 4.2vw, 68px); line-height: 1; font-weight: 800; font-stretch: 112%; letter-spacing: -.034em; color: var(--yellow); overflow-wrap: anywhere; }
.gstats span { font-size: clamp(15.5px, 1.25vw, 18.5px); line-height: 1.4; font-weight: 500; max-width: 19em; color: rgba(255,255,255,.86); }

/* ── numbers ── */
.gdata { padding: var(--sec) 0; background: var(--tint); }
.gdata__note { margin-top: 18px; max-width: 44em; font-size: clamp(16px, 1.2vw, 18px); color: var(--ink2); }
.gdata__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: clamp(28px, 3.4vw, 52px); }
.chart { background: #fff; border-radius: 26px; padding: clamp(22px, 2.6vw, 40px); min-width: 0; }
.chart--wide { margin-top: clamp(28px, 3.4vw, 52px); }
.chart figcaption h3 { font-size: clamp(21px, 1.9vw, 28px); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.chart figcaption p { margin-top: 6px; font-size: 15.5px; color: var(--ink2); }
.chart figcaption { margin-bottom: clamp(18px, 2vw, 28px); }

.bars { display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: minmax(96px, 11.5em) minmax(0, 1fr) 3.2em; align-items: center; gap: 14px; }
.bars__l { font-size: 16px; font-weight: 700; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; text-decoration: none; }
a.bars__l:hover { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; }
.bars__t { display: block; height: 22px; border-radius: 11px; background: rgba(0,0,0,.06); overflow: hidden; }
.bars__t i { display: block; height: 100%; border-radius: 11px; background: var(--night); }
.bars--pink .bars__t i { background: var(--pink); }
.bars__v { font-size: 16px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.bars--count li { grid-template-columns: minmax(110px, 13em) minmax(0, 1fr) 5.2em; }
.bars--count .bars__t { height: 28px; border-radius: 14px; }
.bars--count .bars__t i { border-radius: 14px; background: var(--pink); }

.gdata__where { margin-top: 18px; padding: clamp(18px, 2vw, 28px) clamp(22px, 2.6vw, 40px); border-radius: 26px; background: #fff; font-size: clamp(16px, 1.25vw, 18.5px); line-height: 1.5; }

/* ── ideas ── */
.gideas { padding: var(--sec) 0; }
.gideas__in { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 96px); align-items: start; }
.gideas .lede { margin-top: 18px; color: var(--ink2); }
.ideas { display: grid; gap: 14px; }
.ideas li { display: flex; gap: clamp(16px, 1.8vw, 26px); align-items: flex-start; padding: clamp(20px, 2.2vw, 32px); border: 1px solid var(--line); border-radius: 22px; }
.ideas__n { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--yellow); font-size: 19px; font-weight: 800; }
.ideas h3 { font-size: clamp(19px, 1.7vw, 25px); font-weight: 800; letter-spacing: -.018em; line-height: 1.2; }
.ideas p { margin-top: 8px; font-size: clamp(16.5px, 1.25vw, 18px); color: var(--ink2); max-width: 38em; }

/* ── how it works ── */
.gsteps { padding: var(--sec) 0; background: var(--night); color: #fff; }
.steps3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: clamp(26px, 3vw, 44px); counter-reset: step; }
.steps3 li { counter-increment: step; display: flex; flex-direction: column; gap: 10px; padding: clamp(20px, 2.2vw, 32px); border: 1px solid var(--hair); border-radius: 22px; min-width: 0; }
.steps3 li::before { content: counter(step); font-size: 15px; font-weight: 800; color: var(--yellow); }
.steps3 b { font-size: clamp(19px, 1.7vw, 25px); font-weight: 800; letter-spacing: -.018em; line-height: 1.2; }
.steps3 span { font-size: clamp(16px, 1.2vw, 17.5px); line-height: 1.5; color: rgba(255,255,255,.78); }

/* ── other games ── */
.gmore { padding: var(--sec) 0; background: var(--tint); }
.gmore--index { background: var(--bg); }
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: clamp(14px, 1.6vw, 24px); margin-top: clamp(22px, 2.6vw, 40px); }
.gcard { display: flex; flex-direction: column; gap: 4px; text-decoration: none; min-width: 0; }
/* the cover the app itself shows for the game */
.gcard__art { display: block; aspect-ratio: 3 / 4; margin-bottom: 10px; border-radius: 16px; overflow: hidden; background: rgba(0,0,0,.08); box-shadow: 0 10px 24px -14px rgba(18,14,36,.55); transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
.gcard__art img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gcard:hover .gcard__art, .gcard:focus-visible .gcard__art { transform: translateY(-6px); box-shadow: 0 22px 34px -16px rgba(18,14,36,.6); }
.gcard:hover .gcard__art img, .gcard:focus-visible .gcard__art img { transform: scale(1.045); }
.gcard b { font-size: clamp(16.5px, 1.3vw, 19px); font-weight: 800; letter-spacing: -.015em; line-height: 1.2; }
.gcard:hover b { text-decoration: underline; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.gcard > span:last-child { font-size: 14.5px; line-height: 1.35; color: var(--ink2); }

/* ── motion (games.js adds .gmotion; never with "reduce motion") ── */
.gmotion [data-rise] { opacity: 0; transform: translateY(20px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: calc(min(var(--i, 0), 8) * 55ms); }
.gmotion [data-rise].in { opacity: 1; transform: none; }
.gmotion .chart .bars__t i { transform: scaleX(0); transform-origin: left center; transition: transform .9s var(--ease); }
.gmotion .chart.in .bars__t i { transform: none; }
.gmotion .chart .bars li:nth-child(2) .bars__t i { transition-delay: .06s; }
.gmotion .chart .bars li:nth-child(3) .bars__t i { transition-delay: .12s; }
.gmotion .chart .bars li:nth-child(4) .bars__t i { transition-delay: .18s; }
.gmotion .chart .bars li:nth-child(5) .bars__t i { transition-delay: .24s; }
.gmotion .chart .bars li:nth-child(6) .bars__t i { transition-delay: .3s; }
.gmotion .chart .bars li:nth-child(7) .bars__t i { transition-delay: .36s; }
.gmotion .chart .bars li:nth-child(n+8) .bars__t i { transition-delay: .42s; }
.gstats b { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .gdata__grid, .steps3 { grid-template-columns: minmax(0, 1fr); }
  .gideas__in { grid-template-columns: minmax(0, 1fr); }
  .gp .nav__links { display: none; }
  /* the screenshot sits under the copy: the band runs into the colour of its top edge */
  .hero--game { background: linear-gradient(180deg, #5b3fbf 0%, #9a72c0 46%, #9a72c0 100%); }
  .gstats__in { grid-template-columns: minmax(0, 1fr); }
  .gstats li { padding: 22px 0; border-left: 0; border-top: 1px solid var(--hair); }
  .gstats li:first-child { border-top: 0; }
}
@media (max-width: 520px) {
  .bars li, .bars--count li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 6px; }
  .bars__t { grid-column: 1 / -1; grid-row: 2; }
  .ideas li { flex-direction: column; }
}
.gcards--row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.gcard b { margin-top: 0; }
.gmore__rest { margin-top: clamp(22px, 2.6vw, 40px); font-size: clamp(16px, 1.25vw, 18px); line-height: 1.6; color: var(--ink2); max-width: 60em; }
.gmore__rest b { color: var(--ink); }
.gmore__rest a { color: var(--ink); font-weight: 700; text-decoration-color: var(--pink); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gmore__rest a:hover { text-decoration-color: currentColor; }
/* on a phone the covers become one row to swipe through, so the page stays short */
@media (max-width: 900px) {
  .gcards--strip { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin-left: calc(-1 * var(--gut)); margin-right: calc(-1 * var(--gut)); padding: 6px var(--gut) 14px; scroll-padding: 0 var(--gut); scrollbar-width: none; }
  .gcards--strip::-webkit-scrollbar { display: none; }
  .gcards--strip .gcard { flex: 0 0 min(42vw, 180px); scroll-snap-align: start; }
  .gmotion .gcards--strip [data-rise] { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .gcard__art, .gcard__art img { transition: none; } }
