/* Games hub (trading-games.html): start row, sticky filter bar, card grid.
   Hub-only; the game players keep css/trading-game.css. Markup is generated by
   scripts/build-games-hub.js, behaviour in js/games-hub.js. */
/* colours come from the site tokens in css/variables.css (no hub-only palette) */
.gh {
  width: 100%; max-width: 1248px; min-width: 0; box-sizing: border-box; margin-left: auto; margin-right: auto;
  padding-top: 16px;
}
.gh-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.gh-ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.gh-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- hero: the firms-page hero on the page background (eyebrow, title, one line, stats) ---- */
/* Site vocabulary, not hub-only styling: values copied from css/companies.css (.companies-hero*),
   css/firm-guide.css (.fg-answer callout), css/problem.css (.tag-cloud box) and components .btn.
   Theme tokens only, so dark mode follows the site. 8px rhythm; radii 14 cards/boxes, 10 badges, 6 buttons. */
/* rhythm: the .companies-hero steps (eyebrow 12, title 16, lede 24, 32 under the stats) tightened
   just enough to keep the search bar inside the first 1440 x 900 viewport */
.gh-hero { padding: var(--space-10) 0 var(--space-5); text-align: center; }
.gh-hero__k { display: inline-block; margin: 0 0 var(--space-3); font-size: var(--text-xs); font-weight: var(--font-bold); line-height: 1.6; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.gh-hero__h { margin: 0; font-size: var(--text-4xl); line-height: 1.1; font-weight: var(--font-bold); color: var(--text-primary); }
/* subline + stat labels: exactly .companies-hero__lede / __stat-l (var(--text-muted), 17px / 1.55; 11px tracked) */
.gh-hero__p { max-width: 720px; margin: var(--space-3) auto 0; font-size: var(--text-lg); line-height: 1.55; font-weight: var(--font-normal); color: var(--text-muted); text-wrap: balance; }
.gh-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--space-4) var(--space-8); margin-top: var(--space-5); }
.gh-stat { display: flex; flex-direction: column; align-items: center; }
.gh-stat__n { font-size: var(--text-3xl); line-height: 1; font-weight: var(--font-bold); color: var(--text-primary); font-variant-numeric: tabular-nums; }
.gh-stat__l { display: block; margin-top: var(--space-1); font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.gh-stat--link { margin: -2px -6px; padding: 2px 6px; border-radius: var(--radius-md); color: inherit; text-decoration: none; transition: background var(--transition-fast); }
.gh-stat--link .gh-stat__n, .gh-stat--link .gh-stat__l { color: var(--accent); }
.gh-stat--link svg { width: 11px; height: 11px; margin-left: 4px; vertical-align: -1px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform var(--transition-fast); }
@media (hover: hover) {
  .gh-stat--link:hover { background: var(--accent-light); }
  .gh-stat--link:hover svg { transform: translateX(2px); }
}
.gh-stat--link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- top block: two looks, picked before paint by the inline <head> script ----
   new visitor (the default; also no JS and crawlers): a heading and two large lesson step cards own
   the first screen, the daily callout and the popular games wait.
   returning (html.gh-ret: both lessons done, a game opened from the hub, "Skip to the game" chosen,
   or a game record found by js/games-hub.js): the lessons shrink to one slim line of chips and the
   daily callout + "Next up" box share one row, so the game cards start inside the first screen.
   html.gh-lm / html.gh-lt = lesson make / take done (step states with no flash).
   Site vocabulary only: white cards, 1px borders, radius 14, site buttons, theme tokens. */
.gh-top { margin: 0 0 var(--space-4); }
html:not(.gh-ret) .gh-daily, html:not(.gh-ret) .gh-start { display: none; }

/* new visitor: heading (section-heading size, like "Market making") + one plain line */
.gh-learn__head { margin: 0 0 var(--space-4); }
.gh-learn__h { margin: 0; font-size: var(--text-2xl); line-height: 1.25; font-weight: var(--font-bold); color: var(--text-primary); text-wrap: balance; }
.gh-learn__ret { display: none; }
.gh-learn__p { margin: var(--space-1) 0 0; font-size: var(--text-base); line-height: 1.5; color: var(--text-secondary); }
.gh-learn__steps { container: gh-steps / inline-size; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
/* step card: the game card's art (same symbol, same slate + one blue accent) straight on a white card */
.gh-lesson { --ga-ink: var(--text-secondary); --ga-acc: var(--accent); --ga-acc-ink: #2f6bd4; --ga-soft: color-mix(in srgb, var(--text-secondary) 13%, transparent);
  position: relative; display: flex; flex-direction: column; min-width: 0; box-sizing: border-box; border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: var(--bg-card); color: inherit; text-decoration: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
[data-theme="dark"] .gh-lesson { --ga-acc-ink: #7aa9f8; border-color: var(--border-light); }
.gh-lesson:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gh-lesson__art { flex: none; display: grid; place-items: center; height: 104px; padding-top: var(--space-3); color: var(--ga-ink); }
.gh-lesson__body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-start; min-width: 0; padding: var(--space-2) var(--space-6) var(--space-6); }
.gh-lesson__k { display: flex; align-items: center; gap: 6px; margin: 0 0 var(--space-1); font-size: var(--text-xs); line-height: 1.6; font-weight: var(--font-bold); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.gh-lesson__chk { display: none; }
.gh-lesson__t { font-size: var(--text-2xl); line-height: 1.2; font-weight: var(--font-bold); color: var(--text-primary); }
.gh-lesson__d { margin-top: var(--space-1); font-size: var(--text-base); line-height: 1.5; color: var(--text-secondary); text-wrap: pretty; }
/* the button: site .btn, large; the next undone step = the solid primary (.btn--primary values), the
   other steps = the firm guide's secondary button (as before) */
.gh-lesson__go { justify-content: center; min-height: 44px; margin-top: var(--space-4); padding: 0 var(--space-6); box-sizing: border-box; font-size: var(--text-base); background: var(--bg-elevated); color: var(--text-bright); border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, var(--border-color)); box-shadow: none; white-space: nowrap; }
html:not(.gh-lm) .gh-lesson--make, html.gh-lm:not(.gh-lt) .gh-lesson--take { border-color: var(--accent); }
html:not(.gh-lm) .gh-lesson--make .gh-lesson__go, html.gh-lm:not(.gh-lt) .gh-lesson--take .gh-lesson__go { background: var(--accent); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(76, 139, 245, 0.25); }
/* done: green check + "Done ·" before the step label, the button says Replay */
html.gh-lm .gh-lesson--make .gh-lesson__chk, html.gh-lt .gh-lesson--take .gh-lesson__chk { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--color-easy-bg); color: var(--color-easy); font-size: 11px; letter-spacing: 0; }
html.gh-lm .gh-lesson--make .gh-lesson__chk::before, html.gh-lt .gh-lesson--take .gh-lesson__chk::before { content: '\2713'; }
html.gh-lm .gh-lesson--make .gh-lesson__k, html.gh-lt .gh-lesson--take .gh-lesson__k { color: var(--color-easy); }
html.gh-lm .gh-lesson--make .gh-lesson__step::before, html.gh-lt .gh-lesson--take .gh-lesson__step::before { content: 'Done \00B7  '; }
html.gh-lm .gh-lesson--make .gh-lesson__meta, html.gh-lt .gh-lesson--take .gh-lesson__meta { display: none; }
html.gh-lm .gh-lesson--make .gh-lesson__gol, html.gh-lt .gh-lesson--take .gh-lesson__gol { display: none; }
html.gh-lm .gh-lesson--make .gh-lesson__go::before, html.gh-lt .gh-lesson--take .gh-lesson__go::before { content: 'Replay'; }
@media (hover: hover) {
  .gh-lesson:hover { border-color: var(--accent-border); box-shadow: var(--shadow-md); }
  html:not(.gh-lm) .gh-lesson--make:hover, html.gh-lm:not(.gh-lt) .gh-lesson--take:hover { border-color: var(--accent); }
  .gh-lesson:hover .gh-lesson__go { border-color: var(--accent-primary); }
  html:not(.gh-lm) .gh-lesson--make:hover .gh-lesson__go, html.gh-lm:not(.gh-lt) .gh-lesson--take:hover .gh-lesson__go { background: var(--accent-hover); border-color: transparent; }
}
/* wide row (each card about 480px+): the art sits left of the text, the card is one calm block */
@container gh-steps (min-width: 940px) {
  .gh-lesson { flex-direction: row; align-items: center; }
  .gh-lesson__art { width: 240px; height: auto; padding: 0 0 0 var(--space-4); }
  .gh-lesson__body { padding: var(--space-6) var(--space-6) var(--space-6) var(--space-5); }
}

/* returning: one slim line, "LESSONS  [✓ Make a Market] [✓ Take the Edge]", chips still link to the
   lesson (replay); then the daily callout and the Next up box side by side */
html.gh-ret .gh-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.75fr); gap: var(--space-2) var(--space-4); }
html.gh-ret .gh-learn { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1) var(--space-3); min-width: 0; }
html.gh-ret .gh-learn__head { margin: 0; }
html.gh-ret .gh-learn__new, html.gh-ret .gh-learn__p { display: none; }
html.gh-ret .gh-learn__ret { display: inline; }
html.gh-ret .gh-learn__h { font-size: var(--text-xs); line-height: 1.4; font-weight: var(--font-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
html.gh-ret .gh-learn__steps { container-type: normal; display: flex; flex-wrap: wrap; gap: 0 var(--space-4); }
/* plain links, not pills (pills here read as filters, judge round): "✓ Make a Market · ✓ Take the Edge" */
html.gh-ret .gh-learn .gh-lesson { flex-direction: row; align-items: center; min-height: 30px; padding: 0 var(--space-1); border: 0; border-radius: var(--radius-md); background: none; box-shadow: none; }
html.gh-ret .gh-learn .gh-lesson + .gh-lesson::before { content: '\00B7'; position: absolute; left: calc(-1 * var(--space-2) - 2px); color: var(--text-muted); }
html.gh-ret .gh-lesson__art, html.gh-ret .gh-lesson__d, html.gh-ret .gh-lesson__go, html.gh-ret .gh-lesson__step { display: none; }
html.gh-ret .gh-lesson__body { flex-direction: row; align-items: center; gap: 6px; padding: 0; }
html.gh-ret .gh-lesson__k { margin: 0; }
html.gh-ret .gh-lesson__t { font-size: var(--text-sm); line-height: 1.3; font-weight: var(--font-semibold); color: var(--accent); }
html.gh-ret.gh-lm .gh-lesson--make .gh-lesson__t, html.gh-ret.gh-lt .gh-lesson--take .gh-lesson__t { color: var(--text-secondary); }
html.gh-ret .gh-lesson__t::after { content: ' \00B7  2 min'; font-weight: var(--font-normal); color: var(--text-muted); }
html.gh-ret.gh-lm .gh-lesson--make .gh-lesson__t::after, html.gh-ret.gh-lt .gh-lesson--take .gh-lesson__t::after { content: none; }
html.gh-ret .gh-lesson__chk { width: 16px; height: 16px; font-size: 10px; }
@media (hover: hover) {
  html.gh-ret .gh-learn .gh-lesson:hover { box-shadow: none; }
  html.gh-ret .gh-lesson:hover .gh-lesson__t { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
}
html.gh-ret .gh-daily { grid-column: 1; }
/* returning: a tighter hero so the first game cards start inside the first 1440 x 900 screen */
@media (min-width: 769px) {
  html.gh-ret .gh { padding-top: var(--space-2); }
  html.gh-ret .gh-hero { padding-top: var(--space-3); padding-bottom: var(--space-4); }
  html.gh-ret .gh-stats { margin-top: var(--space-3); }
  html.gh-ret .gh-top { margin-bottom: var(--space-3); }
}
/* the half-width daily callout keeps its one-line copy ("Sprint, 80 in 8 mini, one estimate.") */
@media (min-width: 1261px) {
  html.gh-ret .gh-daily__sl { display: none; }
  html.gh-ret .gh-daily__ss { display: inline; }
}
html.gh-ret .gh-start { grid-column: 2; }

/* daily challenge: the firm guide's "quick answer" callout (light-blue tint, blue border, blue eyebrow) */
.gh-daily { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: center; align-items: center; column-gap: var(--space-4); row-gap: 2px; min-width: 0; padding: var(--space-3) var(--space-5); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border-color)); border-radius: var(--radius-xl); background: color-mix(in srgb, var(--accent) 5%, var(--bg-card)); color: inherit; text-decoration: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
.gh-daily:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gh-daily > .gh-ic { display: none; }   /* the calendar icon is for the phone list row only */
.gh-daily__n, .gh-daily__s { grid-column: 1; }
.gh-daily__k { grid-column: 1 / -1; }
.gh-daily__k { margin-bottom: 2px; font-size: 12px; line-height: 1.3; font-weight: var(--font-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.gh-daily__n { font-size: var(--text-lg); line-height: 1.3; font-weight: var(--font-bold); color: var(--text-primary); }
.gh-daily__s { font-size: var(--text-sm); line-height: 1.45; color: var(--text-secondary); }
.gh-daily.is-done .gh-daily__s { color: var(--text-primary); font-weight: var(--font-semibold); }
.gh-daily__go { grid-column: 2; grid-row: 2 / span 2; justify-content: center; min-height: 36px; box-sizing: border-box; border: 1px solid transparent; white-space: nowrap; }
.gh-daily.is-done .gh-daily__go { background: var(--bg-elevated); color: var(--text-bright); border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, var(--border-color)); box-shadow: none; }
@media (hover: hover) {
  .gh-daily:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-color)); box-shadow: var(--shadow-md); }
  .gh-daily:hover .gh-daily__go { background: var(--accent-hover); box-shadow: 0 4px 16px rgba(76, 139, 245, 0.35); }
  .gh-daily.is-done:hover .gh-daily__go { background: var(--bg-elevated); border-color: var(--accent-primary); box-shadow: none; }
}
.gh-daily__gos, .gh-daily__ss { display: none; }
.gh-daily.is-done .gh-daily__gol, .gh-daily.is-done .gh-daily__gos { display: none; }
.gh-daily.is-done .gh-daily__go::before { content: 'Play again'; }
.gh-arr { margin-left: 6px; }
/* in the half-width returning row the callout keeps the short line and the short "Play" button */
.gh-daily__x { display: none; }
@media (min-width: 1261px) and (max-width: 1400px) {
  .gh-daily__gol { display: none; }
  .gh-daily__gos { display: inline; }
  .gh-daily { column-gap: var(--space-3); padding-left: var(--space-4); padding-right: var(--space-4); }
}

/* ---- Next up box: continue + games you have not played (the problems-page "TOPICS" box) ---- */
/* .tag-cloud values: one white box, 1px border, padding 12/16, the uppercase tracked grey label on its
   own line at the top (11px, 600, .08em), then a 2 x 2 grid of items (grey line icon, name, grey
   "5 min · Free" meta). Continue takes the first slot, tinted light blue; the others are games not
   played yet ("Try next", js/games-hub.js). */
.gh-start { margin: 0; padding: var(--space-3) var(--space-4) var(--space-2); border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: var(--bg-card); }
.gh-start__lbl { margin: 0 0 2px; font-size: var(--text-xs); line-height: 1.4; font-weight: var(--font-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.gh-start__back { display: none; }
.gh-start:has(#gh-continue:not([hidden])) .gh-start__new { display: none; }
.gh-start:has(#gh-continue:not([hidden])) .gh-start__back { display: inline; }
/* the -8px margin lines each item's icon up with the label's left edge (items keep an 8px hit padding) */
.gh-start__row { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-4); margin: 0 calc(-1 * var(--space-2)); }
.gh-tile { position: relative; display: flex; align-items: baseline; gap: 0 var(--space-2); min-width: 0; min-height: 36px; padding: var(--space-2); box-sizing: border-box; border-radius: var(--radius-md); color: inherit; text-decoration: none; transition: background var(--transition-fast); }
.gh-tile[hidden] { display: none; }
.gh-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.gh-tile .gh-ic { align-self: center; width: 16px; height: 16px; color: var(--text-muted); stroke-width: 1.8; }
.gh-tile__k { font-size: var(--text-xs); line-height: 1.3; font-weight: var(--font-semibold); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
.gh-tile--starter .gh-tile__k { display: none; }
.gh-tile__n { flex: none; max-width: 100%; font-size: var(--text-sm); line-height: 1.35; font-weight: var(--font-semibold); color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--transition-fast); }
.gh-tile__s { min-width: 0; font-size: 12px; line-height: 1.35; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gh-tile__date { font-weight: var(--font-semibold); letter-spacing: 0; text-transform: none; }
.gh-tile--cont { background: var(--accent-light); box-shadow: inset 0 0 0 1px var(--accent-border); }
.gh-tile--cont .gh-ic { color: var(--accent); }
.gh-tile--cont .gh-tile__main { display: contents; color: inherit; text-decoration: none; }
.gh-tile--cont .gh-tile__main::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.gh-tile--cont .gh-tile__n { flex: none; }
.gh-tile--cont .gh-tile__s { flex: 0 1 auto; }   /* a narrow cell cuts "Pick up where you left off", never the game name */
.gh-tile__more { display: none; }
.gh-tile__more a { color: var(--text-secondary); text-decoration: underline; text-underline-offset: 2px; }
@media (hover: hover) {
  .gh-tile:hover { background: var(--bg-card-hover); }
  .gh-tile:hover .gh-tile__n { color: var(--accent); }
  .gh-tile--cont:hover { background: var(--tag-blue-bg); }
  .gh-tile__more a:hover { color: var(--accent); }
}

@media (max-width: 1260px) {
  /* tablet and below: the returning row stacks (daily callout, then Next up, both full width);
     in a half-width cell Continue's "Your best ..." line wraps under the name instead of truncating */
  html.gh-ret .gh-top { grid-template-columns: minmax(0, 1fr); }
  html.gh-ret .gh-daily, html.gh-ret .gh-start { grid-column: 1; }
  .gh-daily__x { display: inline; }
  .gh-start { padding: var(--space-3) var(--space-4); }
  .gh-tile--cont { flex-wrap: wrap; }
  .gh-start__lbl { margin: 0 0 var(--space-1); }
}
@media (max-width: 768px) {
  /* phone (390 x 844): the firms phone hero (centered, the four stats in ONE row with short labels,
     .companies-hero__stats phone gap/size); new visitors then get the two lesson cards stacked (art,
     label, title, line, full-width 44px button); returning players get the lesson chips, the daily
     callout as one row (eyebrow + title, Play) and the Next up 2 x 2 box */
  .gh-hero { padding: var(--space-2) 0 var(--space-5); }
  .gh-hero__k { margin-bottom: 2px; }
  .gh-hero__h { font-size: var(--text-3xl); }
  .gh-hero__p { margin-top: var(--space-1); font-size: var(--text-base); line-height: 1.5; }
  /* four equal columns, each stat centred in its own quarter, so the numbers sit at even steps
     whatever the label widths (flex + gap spaced the long "OA GUIDES ->" label further out) */
  .gh-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin-top: var(--space-3); }
  .gh-stat { min-width: 0; }
  .gh-stat--link { justify-self: center; }
  .gh-stat__n { font-size: var(--text-2xl); }
  .gh-stat__x { display: none; }
  .gh-top { margin-bottom: var(--space-3); }
  .gh-learn__head { margin-bottom: var(--space-3); }
  .gh-learn__h { font-size: var(--text-xl); }
  .gh-learn__p { font-size: var(--text-sm); }
  .gh-learn__steps { grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
  .gh-lesson__art { height: 80px; padding-top: var(--space-2); }
  .gh-lesson__art .gh-art { height: 80px; }
  .gh-lesson__body { padding: 0 var(--space-4) var(--space-4); }
  .gh-lesson__t { font-size: var(--text-xl); }
  .gh-lesson__d { font-size: var(--text-sm); }
  .gh-lesson__go { align-self: stretch; margin-top: var(--space-3); }
  /* a done step folds to one row (check, title, Replay) so the next step moves up the screen */
  html.gh-lm:not(.gh-ret) .gh-lesson--make .gh-lesson__art, html.gh-lt:not(.gh-ret) .gh-lesson--take .gh-lesson__art,
  html.gh-lm:not(.gh-ret) .gh-lesson--make .gh-lesson__d, html.gh-lt:not(.gh-ret) .gh-lesson--take .gh-lesson__d { display: none; }
  html.gh-lm:not(.gh-ret) .gh-lesson--make .gh-lesson__body, html.gh-lt:not(.gh-ret) .gh-lesson--take .gh-lesson__body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--space-3); padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4); }
  html.gh-lm:not(.gh-ret) .gh-lesson--make .gh-lesson__k, html.gh-lt:not(.gh-ret) .gh-lesson--take .gh-lesson__k { grid-column: 1; margin: 0; }
  html.gh-lm:not(.gh-ret) .gh-lesson--make .gh-lesson__t, html.gh-lt:not(.gh-ret) .gh-lesson--take .gh-lesson__t { grid-column: 1; font-size: var(--text-lg); }
  html.gh-lm:not(.gh-ret) .gh-lesson--make .gh-lesson__go, html.gh-lt:not(.gh-ret) .gh-lesson--take .gh-lesson__go { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin: 0; padding: 0 var(--space-5); }
  /* ---- phone, returning (Oct 21 tidy, Alex: "still a bit messy"): a tighter hero (no subline,
     smaller stats), ONE quiet lesson line on the page gutter, then ONE white card holding a plain
     list (daily challenge, Continue, Try next): icon, title, one meta line, a Play button or a
     chevron. Blue is left to the eyebrow and the Play button. One spacing step (16px seen) between
     the hero, the lesson line, the card and the search bar. */
  html.gh-ret .gh-hero { padding-bottom: 0; }
  html.gh-ret .gh-hero__p { display: none; }
  html.gh-ret .gh-stats { margin-top: var(--space-3); }
  html.gh-ret .gh-stat__n { font-size: var(--text-xl); }
  html.gh-ret .gh-top { display: block; margin-bottom: var(--space-2); }
  /* lesson line: "Lessons:  Make a Market 2 min · Take the Edge 2 min" (checks once done, "2 min"
     only while undone). Each link is a 44px-tall target with 13px text, so the 12px gaps above and
     below it read as the same 16px step as the rest. If the second link wraps it starts at the
     gutter: its leading dot sits in the 12px gap left of it and is clipped there (overflow). */
  html.gh-ret .gh-learn { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; margin: 0 0 2px; overflow: hidden; }
  html.gh-ret .gh-learn__head, html.gh-ret .gh-learn__steps { display: contents; }
  html.gh-ret .gh-learn__h { font-size: var(--text-sm); line-height: 1.4; font-weight: var(--font-normal); letter-spacing: 0; text-transform: none; color: var(--text-muted); }
  html.gh-ret .gh-learn__ret::after { content: ':'; }
  html.gh-ret .gh-learn .gh-lesson { display: inline-flex; min-height: 44px; padding: 0; border-radius: 0; }
  html.gh-ret .gh-learn .gh-lesson + .gh-lesson::before { left: -6px; top: 50%; transform: translate(-50%, -50%); line-height: 1; font-size: var(--text-sm); }
  html.gh-ret .gh-lesson__body { gap: 5px; }
  /* the check holder only takes room once a lesson is done */
  html.gh-ret .gh-lesson__k { display: none; }
  html.gh-ret.gh-lm .gh-lesson--make .gh-lesson__k, html.gh-ret.gh-lt .gh-lesson--take .gh-lesson__k { display: flex; }
  html.gh-ret .gh-lesson__t { font-size: var(--text-sm); font-weight: var(--font-medium); color: var(--text-primary); }
  html.gh-ret.gh-lm .gh-lesson--make .gh-lesson__t, html.gh-ret.gh-lt .gh-lesson--take .gh-lesson__t { color: var(--text-secondary); }
  html.gh-ret .gh-lesson__t::after { display: inline-block; margin-left: 5px; content: '2 min'; font-weight: var(--font-normal); color: var(--text-muted); }
  html.gh-ret .gh-lesson__chk { width: 15px; height: 15px; font-size: 9px; }
  html.gh-ret .gh-lesson:focus-visible { outline-offset: -2px; }
  /* the card: the daily row is its top (rounded top, no bottom edge), the Next up rows its body
     (rounded bottom, no top edge), so the two blocks read as one white card with one row style */
  html.gh-ret .gh-daily, html.gh-ret .gh-tile { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; align-items: center; column-gap: var(--space-3); row-gap: 1px; min-height: 60px; padding: var(--space-2) var(--space-4); box-sizing: border-box; }
  html.gh-ret .gh-daily { border: 1px solid var(--border-color); border-bottom: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--bg-card); }
  html.gh-ret .gh-daily .gh-ic, html.gh-ret .gh-tile .gh-ic { display: block; grid-column: 1; grid-row: 1 / span 2; width: 20px; height: 20px; color: var(--text-muted); stroke-width: 1.8; }
  html.gh-ret .gh-daily__k, html.gh-ret .gh-tile__n { grid-column: 2; grid-row: 1; min-width: 0; margin: 0; font-size: var(--text-base); line-height: 1.35; font-weight: var(--font-semibold); letter-spacing: 0; text-transform: none; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.gh-ret .gh-daily__date { display: none; }
  html.gh-ret .gh-daily__n, html.gh-ret .gh-daily__s, html.gh-ret .gh-tile__s { grid-column: 2; grid-row: 2; min-width: 0; font-size: var(--text-sm); line-height: 1.35; font-weight: var(--font-normal); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html.gh-ret .gh-daily__s { display: none; }
  /* done today / streak: the status line takes the meta line's place */
  html.gh-ret .gh-daily.is-done .gh-daily__n, html.gh-ret .gh-daily.has-status .gh-daily__n { display: none; }
  html.gh-ret .gh-daily.is-done .gh-daily__s, html.gh-ret .gh-daily.has-status .gh-daily__s { display: block; font-weight: var(--font-normal); color: var(--text-secondary); white-space: normal; text-wrap: pretty; }
  html.gh-ret .gh-daily__sl, html.gh-ret .gh-daily__x { display: none; }
  html.gh-ret .gh-daily__ss { display: inline; }
  html.gh-ret .gh-daily__go { grid-column: 3; grid-row: 1 / span 2; min-height: 44px; padding: 0 var(--space-4); }
  html.gh-ret .gh-daily__gol { display: none; }
  html.gh-ret .gh-daily__gos { display: inline; }
  html.gh-ret .gh-daily.is-done .gh-daily__go::before { content: 'Replay'; }
  html.gh-ret .gh-start { margin: 0; padding: 0; overflow: hidden; border-top: 0; border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
  /* the rows say what they are (Continue, then games you have not played), so no extra label */
  html.gh-ret .gh-start__lbl { display: none; }
  html.gh-ret .gh-start__row { display: block; margin: 0; padding: 0; }
  /* 12px right inset: the chevron's drawn stroke then ends on the Play button's right edge */
  html.gh-ret .gh-tile { padding-right: var(--space-3); border-radius: 0; }
  html.gh-ret .gh-tile[hidden] { display: none; }
  /* three game rows at most on a phone (Continue + 2 picks, or 3 picks) so the game list starts sooner */
  html.gh-ret .gh-start__row:has(#gh-continue:not([hidden])) .gh-tile--starter:not([hidden]) ~ .gh-tile--starter:not([hidden]) ~ .gh-tile--starter:not([hidden]),
  html.gh-ret .gh-tile--starter:not([hidden]) ~ .gh-tile--starter:not([hidden]) ~ .gh-tile--starter:not([hidden]) ~ .gh-tile--starter:not([hidden]) { display: none; }
  /* hairline between rows, starting at the text column */
  html.gh-ret .gh-tile::before { content: ''; position: absolute; top: 0; right: 0; left: calc(var(--space-4) + 20px + var(--space-3)); height: 1px; background: var(--border-color); }
  /* right column: Continue gets a small grey "Continue" + chevron, the other rows a chevron */
  html.gh-ret .gh-tile--starter::after, html.gh-ret .gh-tile--cont .gh-tile__k::after { content: ''; flex: none; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center / 16px no-repeat; }
  html.gh-ret .gh-tile--starter::after { grid-column: 3; grid-row: 1 / span 2; color: var(--text-muted); }
  html.gh-ret .gh-tile--cont { background: none; box-shadow: none; }
  html.gh-ret .gh-tile--cont .gh-tile__k { grid-column: 3; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 2px; font-size: var(--text-sm); line-height: 1.35; font-weight: var(--font-medium); letter-spacing: 0; text-transform: none; color: var(--text-secondary); }
  html.gh-ret .gh-tile--cont .gh-tile__k::after { color: var(--text-muted); }
  html.gh-ret .gh-tile:focus-visible, html.gh-ret .gh-tile--cont:focus-within { outline-offset: -2px; }
  html.gh-ret .gh-tile--cont .gh-tile__main:focus-visible { outline: none; }
  html.gh-ret .gh-tile--cont:has(.gh-tile__main:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
  @media (hover: hover) {
    html.gh-ret .gh-daily:hover { border-color: var(--border-color); box-shadow: none; background: var(--bg-card-hover); }
    html.gh-ret .gh-tile:hover, html.gh-ret .gh-tile--cont:hover { background: var(--bg-card-hover); }
    html.gh-ret .gh-tile:hover .gh-tile__n { color: var(--text-primary); }
  }
  /* new visitors: the step eyebrows go grey (the solid button and the accent border already mark
     the next step); the OA guides stat is a plain stat with an arrow, not a blue one */
  .gh-lesson__k { color: var(--text-muted); }
  .gh-stat--link .gh-stat__n { color: var(--text-primary); }
  .gh-stat--link .gh-stat__l { color: var(--text-muted); }
}
@media (max-width: 374px) {
  /* equal stat columns are 82px at 360: tighter label tracking keeps OA TESTS and OA GUIDES apart */
  .gh-stat__l { letter-spacing: .04em; }
  .gh-lesson__body { padding-left: var(--space-3); padding-right: var(--space-3); }
  /* new visitors: the lesson heading keeps one line at 360 */
  .gh-learn__h { font-size: 1.125rem; }
  /* returning lesson line: slightly smaller text and gaps so "Lessons: Make a Market 2 min ·
     Take the Edge 2 min" still fits one line at 360 (it wraps cleanly below that) */
  html.gh-ret .gh-learn { column-gap: 10px; }
  html.gh-ret .gh-learn .gh-lesson + .gh-lesson::before { left: -5px; }
  html.gh-ret .gh-learn__h, html.gh-ret .gh-lesson__t { font-size: 12.5px; }
  html.gh-ret .gh-lesson__t::after { margin-left: 4px; }
}
@media (max-width: 340px) {
  .gh-stat__l { letter-spacing: .02em; font-size: .6875rem; }
  /* 320px: the lesson line drops "2 min" so both links keep one line */
  html.gh-ret .gh-lesson__t::after { content: none; }
}

/* ---- lesson dialog (js/games-hub.js): new visitors who open a market or betting game first ----
   the site modal (auth.css .auth-modal: white card, 1px border, radius 14, dim backdrop), smaller */
.gh-gate { width: min(420px, calc(100vw - 32px)); max-width: none; box-sizing: border-box; margin: auto; padding: var(--space-6); border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-lg); }
[data-theme="dark"] .gh-gate { border-color: var(--border-light); }
.gh-gate::backdrop { background: rgba(15, 23, 42, 0.5); }
.gh-gate__h { margin: 0 var(--space-8) var(--space-2) 0; font-size: var(--text-xl); line-height: 1.3; font-weight: var(--font-bold); color: var(--text-bright); }
.gh-gate__p { margin: 0 0 var(--space-5); font-size: var(--text-base); line-height: 1.5; color: var(--text-secondary); }
.gh-gate__acts { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.gh-gate__acts .btn { flex: 1 1 auto; justify-content: center; min-height: 44px; padding: 0 var(--space-5); font-size: var(--text-base); }
.gh-gate__skip { background: var(--bg-elevated); color: var(--text-bright); border: 1px solid color-mix(in srgb, var(--accent-primary) 35%, var(--border-color)); }
.gh-gate__x { position: absolute; top: var(--space-2); right: var(--space-2); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--radius-md); background: none; color: var(--text-muted); cursor: pointer; }
.gh-gate__x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gh-gate__x:focus-visible, .gh-gate__acts .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) {
  .gh-gate__x:hover { background: var(--bg-card-hover); color: var(--text-primary); }
  .gh-gate__skip:hover { border-color: var(--accent-primary); background: var(--bg-elevated); }
}
@media (max-width: 400px) { .gh-gate__acts .btn { flex-basis: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .gh-stat--link, .gh-stat--link svg, .gh-lesson, .gh-daily, .gh-tile, .gh-tile__n { transition: none; }
  .gh-stat--link:hover svg { transform: none; }
}

/* ---- sticky filter bar ---- */
/* site vocabulary: the search box and "/" key copy problems.html's omnibar; chips copy the
   learn/problems pills (white, hairline border, grey text, grey mono counts); every selected
   state is the site's light-blue fill + blue text (nav "Games", problems "All Problems"). */
.gh-bar { position: sticky; top: var(--nav-height, 64px); z-index: 40; margin: 0 -12px; padding: 12px 12px 10px; background: var(--bg-primary); border-bottom: 1px solid transparent; transition: border-color var(--transition-fast); }
.gh-bar.is-stuck { border-bottom-color: var(--border-color); }
html:not(.gh-js) .gh-bar, html:not(.gh-js) .gh-status { display: none; }
.gh-bar__row { display: flex; align-items: center; gap: 8px; }
.gh-search { position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center; }
.gh-search__ic { position: absolute; left: 12px; width: 15px; height: 15px; fill: none; stroke: var(--text-muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.gh-search input { width: 100%; height: 34px; box-sizing: border-box; padding: 8px 40px 8px 36px; border: 1px solid var(--border-color); border-radius: var(--radius-md); background: var(--bg-card); color: var(--text-primary); font-family: var(--font-sans); font-size: var(--text-sm); outline: none; transition: border-color var(--transition-fast); }
.gh-search input::placeholder { color: var(--text-muted); opacity: 1; }
.gh-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin: 0; background: var(--text-muted); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%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' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7L7 17'/%3E%3C/svg%3E") center / 14px no-repeat; cursor: pointer; }
@media (hover: hover) { .gh-search input::-webkit-search-cancel-button:hover { background: var(--text-secondary); } }
.gh-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.gh-kbd { position: absolute; right: 10px; padding: 1px 6px; border: 1px solid var(--border-color); border-radius: 4px; background: var(--bg-secondary); font-family: var(--font-mono); font-size: 11px; font-weight: 400; line-height: 1.3; color: var(--text-muted); pointer-events: none; }
.gh-search input:focus ~ .gh-kbd, .gh-search input:not(:placeholder-shown) ~ .gh-kbd { display: none; }
/* All / Free / Pro: the learn-page chip (rounded-full, hairline border, grey text; selected =
   blue border + light-blue fill + blue text), sitting in one pill group with the firm menu */
.gh-seg { display: inline-flex; flex: none; gap: 6px; }
.gh-acc { flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 34px; padding: 0 14px; box-sizing: border-box; border: 1px solid var(--border-light); border-radius: var(--radius-full); background: var(--bg-card); color: var(--text-secondary); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer; transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast); }
@media (hover: hover) { .gh-acc:hover { border-color: var(--accent-border); color: var(--text-primary); } }
.gh-acc[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--bg-card)); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.gh-firmsel { display: flex; align-items: center; }
.gh-firmsel select { height: 34px; width: 132px; padding: 0 30px 0 14px; border: 1px solid var(--border-light); border-radius: var(--radius-full); background-color: var(--bg-card); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; color: var(--text-secondary); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; -webkit-appearance: none; appearance: none; cursor: pointer; transition: border-color var(--transition-fast); }
@media (hover: hover) { .gh-firmsel select:hover { border-color: var(--accent-border); color: var(--text-primary); } }
.gh-firmsel select.is-on { border-color: var(--accent); background-color: color-mix(in srgb, var(--accent) 14%, var(--bg-card)); color: var(--accent); font-weight: 600; }
.gh-firmsel select:focus { outline: none; }
.gh-firmsel select:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.gh-bar__row2 { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.gh-chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 769px) {
  /* desktop: search | All Free Pro (Any firm) on one line, category chips below */
  .gh-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 6px; row-gap: 10px; }
  .gh-bar__row, .gh-bar__row2 { display: contents; }
  .gh-search { grid-column: 1; grid-row: 1; margin-right: 10px; }
  .gh-seg { grid-column: 2; grid-row: 1; }
  .gh-firmsel { grid-column: 3; grid-row: 1; }
  .gh-chips { grid-column: 1 / -1; grid-row: 2; }
  /* full-bleed background + hairline once pinned, like the nav's own bottom border.
     Spread box-shadows clipped to the row: they paint edge to edge but add no scroll width. */
  .gh-bar::before, .gh-bar::after { content: ''; position: absolute; z-index: -1; left: 0; right: 0; pointer-events: none; clip-path: inset(0 -100vmax); }
  .gh-bar::before { top: 0; bottom: 0; background: var(--bg-primary); box-shadow: 0 0 0 100vmax var(--bg-primary); }
  .gh-bar::after { bottom: -1px; height: 1px; background: var(--border-color); box-shadow: 0 0 0 100vmax var(--border-color); opacity: 0; transition: opacity var(--transition-fast); }
  .gh-bar.is-stuck { border-bottom-color: transparent; }
  .gh-bar.is-stuck::after { opacity: 1; }
}
.gh-chips::-webkit-scrollbar { display: none; }
.gh-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--border-light); border-radius: var(--radius-full); background: var(--bg-card); color: var(--text-secondary); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; cursor: pointer; white-space: nowrap; transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast); }
@media (hover: hover) { .gh-chip:hover { border-color: var(--accent-border); color: var(--text-primary); } }
.gh-chip[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 14%, var(--bg-card)); border-color: var(--accent); color: var(--accent); font-weight: 600; }
/* problems-sidebar category icon: 16px line icon in the label colour (blue when selected) */
.gh-chip__ic { width: 16px; height: 16px; margin-left: -2px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.gh-chip.is-zero { opacity: .5; }
.gh-n { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 400; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gh-chip[aria-pressed="true"] .gh-n { color: color-mix(in srgb, var(--accent) 80%, transparent); }
/* results header (.gh-status): the problems-page title pattern, between the bar and the grid.
   filtered:   Betting & probability   Clear filters        (bold title + blue text link)
               10 of 39 games · blurb ......................... legend   (grey line)
   unfiltered: 39 games ........................................ legend
   count line + legend = problems.html's "3480 of 3480 problems" (.problems-header__subtitle:
   var(--text-sm), var(--text-muted)) */
.gh-status { display: flex; flex-direction: column; gap: 2px; margin: 14px 0 16px; color: var(--text-secondary); }
.gh-flat { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 2px; min-width: 0; }
.gh-flat[hidden] { display: none; }
.gh-flat__h { min-width: 0; margin: 0; font-size: var(--text-2xl); line-height: 1.3; font-weight: 700; letter-spacing: -.02em; color: var(--text-primary); overflow-wrap: anywhere; }
.gh-status__sub { display: flex; flex-wrap: wrap; row-gap: 2px; align-items: center; min-width: 0; min-height: 24px; /* narrow desktop: the legend drops to its own line instead of cutting the blurb */ font-size: var(--text-sm); line-height: 1.6; color: var(--text-muted); }
#gh-count { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gh-flat__p { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gh-flat__p:not(:empty)::before { content: '\00b7'; margin: 0 8px; }
/* 0 results: the empty card below says it all; the count stays for screen readers */
.gh-status.is-zero { margin: 6px 0 0; }
.gh-status.is-zero #gh-count { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gh-status.is-zero .gh-status__sub { min-height: 0; }
.gh-status.is-zero .gh-legend { display: none; }
/* Clear filters: a plain blue text link, like the site's inline actions */
.gh-clear { position: relative; flex: none; display: inline-flex; align-items: center; padding: 0; border: 0; background: none; color: var(--accent); font-family: var(--font-sans); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; cursor: pointer; }
.gh-clear[hidden] { display: none; }
@media (hover: hover) { .gh-clear:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; } }
.gh-clear::after { content: ''; position: absolute; left: -8px; right: -8px; top: -14px; bottom: -14px; }
.gh-clear:focus-visible, .gh-try:focus-visible, .gh-empty__clear:focus-visible, .gh-chip:focus-visible, .gh-acc:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* badge legend: the cards' own Free / Free sample badges as samples (smaller, aria-hidden,
   no hover, default cursor, never a target) + a short muted explanation, so it reads as a key,
   not a filter: [Free] no login · [Free sample] Pro game, 1 free run */
/* phone-only home of Free / Pro + firm menu (JS moves them there at <= 768px) */
.gh-tools { display: none; }
.gh-legend { flex: none; margin-left: auto; padding-left: 16px; display: inline-flex; align-items: center; gap: 10px; font-size: .75rem; line-height: 18px; color: var(--text-muted); cursor: default; -webkit-user-select: none; user-select: none; }
.gh-legend__i { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.gh-legend__i + .gh-legend__i::before { content: '\00b7'; margin-right: 4px; color: var(--text-muted); }
.gh-legend .gh-badge { padding: 0 6px; font-size: 10.5px; line-height: 16px; pointer-events: none; }
html.gh-pro .gh-legend__i--sample { display: none; }
/* matched search terms: light blue, like the site's accent-light tint */
.gh-hl { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; margin: 0 -1px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.gh-meta .gh-firm--more.is-hit { background: color-mix(in srgb, var(--accent) 16%, transparent); color: inherit; border-radius: 3px; padding: 0 3px; margin: 0 -1px; }
[data-theme="dark"] .gh-hl, [data-theme="dark"] .gh-meta .gh-firm--more.is-hit { background: color-mix(in srgb, var(--accent) 28%, transparent); }
/* search: why a card matched when its name and description do not show the term
   (firm tag or hidden keyword), one muted line under the meta row: "Matches: Optiver" */
.gh-why { margin: -6px 0 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .75rem; line-height: 1.5; color: var(--text-muted); }
.gh-why b { font-weight: 600; color: var(--text-secondary); }
.gh-card--firm .gh-why { grid-column: 2 / -1; margin: 2px 0 0; }
/* cards and related tiles ease in after a filter change (never while typing) */
@keyframes gh-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .gh-card.gh-in, .gh-related.gh-in .gh-rel { animation: gh-in .16s ease-out; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-bar, .gh-bar::after, .gh-chip, .gh-clear, .gh-search input, .gh-acc, .gh-firmsel select, .gh-rel, .gh-rel__n { transition: none; }
}
@media (max-width: 768px) {
  /* phone: the problems-page toolbar: full-width search on its own row, then ONE sideways
     scrolling row of category chips only. Free / Pro and the firm menu are not in the pinned
     bar: JS moves them into the count row under it (#gh-tools, see .gh-status below), so the
     two filter families never share a scroller. Every pill is 44px tall like the problems-page
     topic pills (real 44px targets). Pinned height: 8 + 44 + 4 + 2 + 44 + 2 + 4 = 108px. */
  .gh-bar { margin: 0 -16px; padding: 8px 16px 4px; }
  .gh-bar .gh-seg, .gh-bar .gh-firmsel { display: none; }
  .gh-kbd { display: none; }
  .gh-search__ic { left: 14px; width: 16px; height: 16px; }
  .gh-search input { height: 44px; padding: 0 12px 0 40px; font-size: 16px; }
  .gh-bar__row2 { gap: 6px; margin: 4px -16px 0; padding: 2px 0 2px 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity; scroll-padding-left: 16px; overscroll-behavior-x: contain; }
  /* access chips: Free and Pro only (tapping the active one goes back to all, as on desktop) */
  .gh-acc { height: 44px; min-width: 44px; padding: 0 14px; font-size: .875rem; }
  .gh-acc[data-acc=""] { display: none; }
  .gh-firmsel { flex: none; }
  .gh-firmsel select { height: 44px; width: 72px; max-width: 136px; padding: 0 26px 0 12px; font-size: .875rem; background-position: right 10px center; }
  .gh-acc:focus-visible, .gh-firmsel select:focus-visible { outline-offset: 0; }
  .gh-bar__row2::-webkit-scrollbar { display: none; }
  /* edge fades only where chips are hidden. Right: a 56px fade that is fully clear
     4px before the edge, so the next chip visibly dissolves (more to swipe to) instead of
     reading as a clipped box. Left: chips snap to the 16px page gutter and the strip left of
     it is cleared (--gh-fl, widened by JS to swallow any sliver of the previous chip under
     28px), so the previous chip is either gone or clearly showing, never a clipped stub. */
  .gh-bar__row2.is-fr { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 56px), rgba(0,0,0,.22) calc(100% - 28px), transparent calc(100% - 4px)); mask-image: linear-gradient(90deg, #000 calc(100% - 56px), rgba(0,0,0,.22) calc(100% - 28px), transparent calc(100% - 4px)); }
  .gh-bar__row2.is-fl { -webkit-mask-image: linear-gradient(90deg, transparent var(--gh-fl, 10px), #000 calc(var(--gh-fl, 10px) + 6px)); mask-image: linear-gradient(90deg, transparent var(--gh-fl, 10px), #000 calc(var(--gh-fl, 10px) + 6px)); }
  .gh-bar__row2.is-fl.is-fr { -webkit-mask-image: linear-gradient(90deg, transparent var(--gh-fl, 10px), #000 calc(var(--gh-fl, 10px) + 6px), #000 calc(100% - 56px), rgba(0,0,0,.22) calc(100% - 28px), transparent calc(100% - 4px)); mask-image: linear-gradient(90deg, transparent var(--gh-fl, 10px), #000 calc(var(--gh-fl, 10px) + 6px), #000 calc(100% - 56px), rgba(0,0,0,.22) calc(100% - 28px), transparent calc(100% - 4px)); }
  .gh-chip:focus-visible { outline-offset: 0; }
  .gh-chips { flex-wrap: nowrap; padding-right: 16px; }
  .gh-chip { height: 44px; padding: 0 14px; font-size: .875rem; scroll-snap-align: start; scroll-snap-stop: normal; }
  /* 18-20px of air between the pinned bar and the result title (toResults pins the status
     box 8px under the bar; the 10px top padding is the rest) */
  .gh-status { gap: 2px; margin: 10px 0 12px; padding-top: 10px; }
  .gh-flat { column-gap: 12px; }
  .gh-flat__h { flex: 0 1 auto; font-size: 1.375rem; line-height: 1.3; }
  /* count row: "39 games" left, Free / Pro / Firm right (problems.html puts its sort menu next
     to its count line). Then the blurb, then (unfiltered) the badge legend. */
  .gh-status__sub { flex-wrap: wrap; column-gap: 8px; row-gap: 6px; min-height: 20px; font-size: .8125rem; }
  /* the count keeps the row with the controls by wrapping onto a second line ("25 of 39 games /
     + 8 OA guides"); only when fewer than ~96px are left (long firm name at 360) do the
     controls drop under it */
  #gh-count { flex: 1 1 96px; min-width: 0; white-space: normal; line-height: 1.45; }
  .gh-tools { order: 1; flex: none; display: flex; align-items: center; gap: 6px; margin-left: auto; }
  .gh-seg { gap: 6px; }
  .gh-flat__p { order: 2; flex-basis: 100%; white-space: normal; overflow: visible; }
  .gh-flat__p:empty { display: none; }
  .gh-flat__p:not(:empty)::before { content: none; }
  .gh-legend { order: 3; margin-left: 0; padding-left: 0; flex-basis: 100%; gap: 8px; font-size: var(--text-xs); }
  .gh-status.is-filtered .gh-legend { display: none; }
  .gh-status.is-zero .gh-status__sub { min-height: 0; }
  .gh-why { grid-column: 2 / -1; margin: 1px 0 0; line-height: 18px; }
}

/* ---- sections + grid ---- */
.gh-results { display: flex; flex-direction: column; }
.gh-sec { margin: 0 0 40px; }
.gh-sec[hidden] { display: none; }
/* section header: the problems-page title style (bold navy, grey line under it), no colour marks */
.gh-sec__head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; row-gap: 4px; margin: 0 0 16px; padding-top: 24px; border-top: 1px solid var(--border-color, rgba(0,0,0,.08)); }
.gh-sec__h { grid-column: 1; margin: 0; font-size: var(--text-2xl, 1.625rem); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--text-bright, #0f172a); }
/* the grey line under the title: problems.html's count line (.problems-header__subtitle: text-sm, text-muted) */
.gh-sec__p { grid-column: 1 / -1; grid-row: 2; margin: 0; font-size: var(--text-sm, .8125rem); line-height: 1.5; color: var(--text-muted, #94a3b8); }
.gh-sec__lesson { grid-column: 3; grid-row: 1; justify-self: end; font-size: var(--text-sm, .8125rem); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.gh-sec__lesson::after { content: ' \2192'; }
@media (hover: hover) { .gh-sec__lesson:hover { text-decoration: underline; } }
.gh-sec__lesson:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
html.gh-lesson-done .gh-sec__lesson:not(.gh-sec__all) { display: none; }
.gh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; align-items: stretch; }
@media (max-width: 768px) {
  .gh-sec { margin-bottom: 28px; }
  .gh-sec__head { grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; row-gap: 2px; margin-bottom: 12px; padding-top: 18px; }
  .gh-sec__h { font-size: var(--text-xl, 1.25rem); }
  .gh-sec__p { line-height: 1.45; }
  .gh-sec__lesson { grid-column: 1 / -1; grid-row: 3; justify-self: start; display: inline-block; margin: -4px 0 -8px; padding: 12px 0; line-height: 20px; font-size: .82rem; }
  .gh-grid { grid-template-columns: 1fr; gap: 8px; }
}
/* filtered: one flat grid of exactly the matching cards */
.gh-results.is-flat { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; align-items: stretch; margin-bottom: 26px; }
.gh-results.is-flat .gh-sec, .gh-results.is-flat .gh-grid, .gh-results.is-flat .gh-guides { display: contents; }
.gh-results.is-flat .gh-sec__head, .gh-results.is-flat .gh-guides__head { display: none; }
/* 1-3 results: related games fill the space under the short grid (site cards, grey tracked label) */
.gh-related { grid-column: 1 / -1; order: 1000; margin-top: 12px; }
.gh-related[hidden] { display: none; }
.gh-related__h { margin: 0 0 10px; font-size: var(--text-xs); font-weight: 600; line-height: 1.6; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.gh-related__row { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 12px; }
.gh-rel { display: grid; grid-template-columns: 32px minmax(0, 1fr); grid-template-areas: "ic n" "ic s" "ic a"; column-gap: 12px; row-gap: 2px; align-items: start; align-content: start; min-height: 44px; padding: 12px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-lg); background: var(--bg-card); color: inherit; text-decoration: none; transition: border-color var(--transition-fast), box-shadow var(--transition-fast); }
@media (hover: hover) { .gh-rel:hover { border-color: var(--accent-border); box-shadow: var(--shadow-sm); } .gh-rel:hover .gh-rel__n { color: var(--accent); } }
.gh-rel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gh-rel .gh-ic { grid-area: ic; align-self: start; margin-top: 1px; box-sizing: content-box; width: 18px; height: 18px; padding: 7px; border-radius: var(--radius-md); background: var(--h-bg, var(--bg-secondary)); color: var(--h-ink, var(--text-secondary)); }  /* category-tinted tile, like the phone card rows */
.gh-rel__n { grid-area: n; min-width: 0; overflow-wrap: anywhere; font-size: var(--text-base); line-height: 1.35; font-weight: 600; color: var(--text-primary); transition: color var(--transition-fast); }
.gh-rel__s { grid-area: s; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: var(--text-sm); line-height: 1.45; color: var(--text-secondary); }
.gh-rel__a { grid-area: a; justify-self: start; margin-top: 6px; }
/* 0 results: a plain site card: search icon, the query echoed, suggestions, Clear filters */
.gh-empty { grid-column: 1 / -1; order: 1001; display: flex; flex-direction: column; align-items: center; padding: 40px 20px 36px; text-align: center; color: var(--text-secondary); border: 1px solid var(--border-color); border-radius: var(--radius-xl); background: var(--bg-card); }
.gh-empty[hidden] { display: none; }
.gh-empty__ic { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: var(--radius-full); background: var(--bg-secondary); color: var(--text-muted); }
.gh-empty__ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.gh-empty__h { margin: 0 0 4px; font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); overflow-wrap: anywhere; }
.gh-empty__p { margin: 0 0 18px; font-size: var(--text-sm); color: var(--text-secondary); }
.gh-empty__try { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 14px; }
/* suggestions = site .btn--secondary.btn--sm, Clear filters = site .btn--primary */
.gh-try.btn { height: 32px; padding: 0 12px; font-size: var(--text-sm); font-weight: 500; }
.gh-try[data-try-q] { gap: 0; }
.gh-try[data-try-q]::before { content: '\201c'; }
.gh-try[data-try-q]::after { content: '\201d'; }
.gh-empty__clear.btn { height: 36px; padding: 0 18px; }
@media (max-width: 768px) {
  .gh-related__row { grid-template-columns: 1fr; gap: 8px; }
  .gh-rel:nth-child(n+4) { display: none; }
  /* phone: badge beside the name (like the card rows' right-aligned badge), one row shorter */
  .gh-rel { grid-template-columns: 32px minmax(0, 1fr) auto; grid-template-areas: "ic n a" "ic s s"; }
  .gh-rel__a { justify-self: end; margin: 1px 0 0 4px; }
  .gh-empty { padding: 28px 12px; }
  .gh-empty__try { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 340px; }
  .gh-try.btn { height: 44px; padding: 0 14px; justify-content: center; }
  .gh-empty__clear.btn { height: 44px; }
}

/* ---- card ---- */
/* game card: a sibling of the firm cards on companies.html (.company-card / .card--clickable): white, 1px
   var(--border-color), radius-lg, padding space-5, no resting shadow; hover = accent border + shadow-md + 2px
   lift, only on hover-capable pointers. The game's drawing straight on the white card, slate lines with the
   site blue as its ONLY accent (every card), the problems-page category pill, bold title, grey 2-line blurb, meta (time, difficulty
   dot + word, firm), then a footer like the firm cards' (access badge left, your record, blue "Play ->"). */
/* category hue (problems-page pill colours from the site tag tokens): --h-ink = pill text (AA on the
   tint), --h-bg = pill tint / phone icon tile. Six hues, used only in the pill and the phone tile; never
   in the art, on borders, bands or buttons. */
.gh-hue--mm   { --h: #14b8a6; --h-ink: #0f766e; --h-bg: var(--tag-teal-bg, rgba(45,212,191,.1)); }
.gh-hue--bet  { --h: var(--tag-blue, #4c8bf5); --h-ink: #2563eb; --h-bg: var(--tag-blue-bg, rgba(76,139,245,.1)); }
.gh-hue--math { --h: #8b5cf6; --h-ink: #6d28d9; --h-bg: var(--tag-purple-bg, rgba(167,139,250,.1)); }
.gh-hue--est  { --h: #f59e0b; --h-ink: #b45309; --h-bg: var(--color-medium-bg, rgba(245,183,49,.1)); }
.gh-hue--cog  { --h: #ec4899; --h-ink: #be185d; --h-bg: var(--tag-pink-bg, rgba(244,114,182,.1)); }
.gh-hue--oa   { --h: #64748b; --h-ink: #475569; --h-bg: rgba(100,116,139,.1); }
[data-theme="dark"] .gh-hue--mm   { --h: var(--tag-teal, #2dd4bf); --h-ink: var(--tag-teal, #2dd4bf); --h-bg: rgba(45,212,191,.12); }
[data-theme="dark"] .gh-hue--bet  { --h-ink: #7aa9f8; --h-bg: rgba(76,139,245,.14); }
[data-theme="dark"] .gh-hue--math { --h: var(--tag-purple, #a78bfa); --h-ink: var(--tag-purple, #a78bfa); --h-bg: rgba(167,139,250,.14); }
[data-theme="dark"] .gh-hue--est  { --h: var(--color-medium, #f5b731); --h-ink: var(--color-medium, #f5b731); --h-bg: rgba(245,183,49,.12); }
[data-theme="dark"] .gh-hue--cog  { --h: var(--tag-pink, #f472b6); --h-ink: var(--tag-pink, #f472b6); --h-bg: rgba(244,114,182,.12); }
[data-theme="dark"] .gh-hue--oa   { --h: #94a3b8; --h-ink: #cbd5e1; --h-bg: rgba(148,163,184,.14); }
.gh-card { --ga-ink: var(--text-secondary, #475569); --ga-acc: var(--accent, #4c8bf5); --ga-acc-ink: #2f6bd4; --ga-soft: color-mix(in srgb, var(--text-secondary, #475569) 13%, transparent); position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0 var(--space-5, 20px) 14px; border: 1px solid var(--border-color, rgba(0,0,0,.08)); border-radius: var(--radius-lg, 10px); background: var(--bg-card, #fff); overflow: hidden; transition: border-color .2s, box-shadow .2s, transform .2s; }
[data-theme="dark"] .gh-card { border-color: var(--border-light, rgba(255,255,255,.08)); }
.gh-card[hidden] { display: none; }
@media (hover: hover) {
  .gh-card:hover { border-color: var(--accent-border, rgba(76,139,245,.3)); box-shadow: var(--shadow-md, 0 4px 16px rgba(0,0,0,.08)); transform: translateY(-2px); }
}
.gh-card:has(.gh-card__link:focus-visible) { border-color: var(--accent); }
/* the drawing sits straight on the white card (no band, no rule under it), like the logo on a firm card:
   240x96 at 1:1 (the drawn part is ~80px tall, art text stays a true 10px+), a little top padding */
.gh-card__art { position: relative; display: grid; place-items: center; box-sizing: border-box; height: 104px; padding-top: 8px; margin: 0 calc(-1 * var(--space-5, 20px)) 2px; color: var(--ga-ink); }
.gh-art { position: relative; width: 240px; max-width: 100%; height: 96px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; font-family: var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }
.gh-card__art .gh-ic { display: none; }
/* Zap-N set: one shared drawing, the game's own icon (site blue) in the ring centre (8px pad + ring cy 48) */
.gh-card__art--ic .gh-ic { display: block; position: absolute; left: 50%; top: 56px; width: 28px; height: 28px; margin: -14px 0 0 -14px; color: var(--ga-acc); stroke-width: 1.7; }
/* category pill: problems-page .cat-pill (full radius, text-xs 500, tag tint + tag colour, line icon) */
.gh-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 2px 10px 2px 8px; border-radius: var(--radius-full, 999px); background: var(--h-bg, var(--accent-light)); color: var(--h-ink, var(--accent)); font-size: var(--text-xs, .6875rem); font-weight: 500; line-height: 1.5; white-space: nowrap; }
.gh-pill__ic { flex: none; width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* art parts (inside the ga-* symbols): slate lines + text, the site blue as the ONE accent, white boxes; text >= 10px */
[data-theme="dark"] .gh-card { --ga-acc-ink: #7aa9f8; }
.ga-a { fill: var(--ga-acc); stroke: var(--ga-acc); }
.ga-s { fill: var(--ga-soft); }
.ga-b { fill: var(--bg-card, #fff); }
.ga-k { stroke-width: 1; stroke-opacity: .55; }
.ga-kb { stroke: #fff; stroke-width: 1.8; }
.ga-r { fill: none; stroke: var(--ga-acc); stroke-width: 2; }
.ga-r--w { stroke-width: 3.2; }
.ga-p { fill: currentColor; stroke: none; }
.ga-pb { fill: #fff; stroke: none; }
.ga-t { fill: currentColor; stroke: none; font-size: 10px; font-weight: 600; }
.ga-ts { font-size: 10px; letter-spacing: .02em; fill-opacity: .8; }
/* word labels (BID, NET, TIMING...) in the site sans like its tracked labels; mono stays for numbers, quotes and formulas */
.ga-w { font-family: var(--font-sans); letter-spacing: .04em; }
.ga-tl { font-size: 12px; font-weight: 700; }
.ga-tx { font-size: 21px; font-weight: 700; }
.ga-m { text-anchor: middle; }
.ga-tb { fill: #fff; fill-opacity: 1; }
.ga-ta { fill: var(--ga-acc-ink); fill-opacity: 1; font-weight: 700; }
/* access badge, three site styles, sentence case: Free = green tint pill; Free sample = the firms page's
   "Free OA sample" pill (.company-oa-chip: accent-light fill, accent-border, blue text, full radius);
   Pro = the site .pro-badge (uppercase, radius 4, amber). Text is darkened slightly in light for AA. */
.gh-badge { display: inline-flex; align-items: center; flex: none; padding: 1px 9px; border: 1px solid transparent; border-radius: var(--radius-full, 999px); font-size: var(--text-xs, .6875rem); font-weight: 600; line-height: 1.5; white-space: nowrap; }
.gh-badge--free { color: #15803d; background: var(--color-easy-bg, rgba(34,197,94,.1)); border-color: rgba(34,197,94,.3); }
.gh-badge--sample { color: #2f6bd4; background: var(--accent-light, rgba(76,139,245,.06)); border-color: var(--accent-border, rgba(76,139,245,.3)); }
.gh-badge--pro { padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #b45309; background: linear-gradient(135deg, rgba(245,183,49,.18), rgba(245,158,11,.18)); border-color: rgba(245,183,49,.4); }
[data-theme="dark"] .gh-badge--free { color: #4ade80; border-color: rgba(34,197,94,.28); }
[data-theme="dark"] .gh-badge--sample { color: #7aa9f8; background: rgba(76,139,245,.1); }
[data-theme="dark"] .gh-badge--pro { color: #fbbf24; border-color: rgba(245,183,49,.25); }
html.gh-pro .gh-badge--sample { color: #15803d; background: var(--color-easy-bg, rgba(34,197,94,.1)); border-color: rgba(34,197,94,.3); }
[data-theme="dark"].gh-pro .gh-badge--sample { color: #4ade80; border-color: rgba(34,197,94,.28); }
.gh-card__name { margin: 2px 0 0; font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; color: var(--text-bright, #0f172a); }
.gh-card__link { color: inherit; text-decoration: none; }
.gh-card__link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.gh-card__link:focus-visible { outline: none; }
.gh-card__link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.gh-card__trains { margin: 0; min-height: 3em; font-size: var(--text-sm, .8125rem); line-height: 1.5; color: var(--text-secondary, #475569); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
/* meta: time, difficulty (problems-page dot + word), firm; always one line, the firm truncates first */
.gh-meta { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 2px 0 6px; overflow: hidden; white-space: nowrap; font-size: .75rem; color: var(--text-secondary, #475569); }
.gh-meta__t { flex: none; font-weight: 600; color: var(--text-primary, #1e293b); font-variant-numeric: tabular-nums; }
.gh-diff { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.gh-diff::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--d, var(--text-muted)); }
.gh-diff--b { --d: var(--color-easy, #22c55e); } .gh-diff--i { --d: var(--color-medium, #f5b731); } .gh-diff--a { --d: var(--color-hard, #f43f5e); }
.gh-firm { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 1px; margin: 0 -1px; font-weight: 500; color: var(--text-secondary, #475569); } /* 1px pad holds the search mark's 1px overhang */
.gh-firm::before { content: '\00b7'; margin-right: 10px; font-weight: 400; color: var(--text-muted, #94a3b8); }
.gh-firm--more { flex: none; margin-left: -5px; font-weight: 500; color: var(--text-secondary, #475569); }
.gh-firm--x { display: none; }
.gh-meta:has(.gh-firm--x .gh-hl):not(:has(.gh-firm:not(.gh-firm--x) .gh-hl)) .gh-firm:not(.gh-firm--x) { display: none; }
.gh-meta:not(:has(.gh-firm:not(.gh-firm--x) .gh-hl)) .gh-firm--x:has(.gh-hl) { display: block; }
.gh-meta:has(.gh-firm--x .gh-hl) .gh-firm--x:has(.gh-hl) ~ .gh-firm--x:has(.gh-hl) { display: none; }
/* footer (like the firm cards'): access badge, your record, then Play -> pinned right. The 2-min lesson
   lives in the lesson cards up top and the Market making header, not on every card. */
.gh-card__foot { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 4px; min-height: 32px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-color, rgba(0,0,0,.08)); }
/* your record: its own line at the top of the footer, so it is never clipped beside the badge */
.gh-rec { order: -1; flex: 1 0 100%; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: .75rem; color: var(--text-secondary, #475569); }
.gh-rec[hidden] { display: none; }
.gh-rec b { font-weight: 700; color: var(--text-bright, #0f172a); font-variant-numeric: tabular-nums; }
.gh-rec > span:not(.gh-rec__k):not(:last-child):has(> b) { display: none; } /* card shows best + runs; last stays on the game page */
.gh-rec__k { font-weight: 600; color: var(--text-secondary, #475569); }
/* "Play ->" = the firm cards' "View funnel ->" (.company-card__cta: text-sm, bold, accent, a plain space
   before the arrow, no hover change of its own: the card's border + shadow carry the hover) */
.gh-play { flex: none; margin-left: auto; display: inline-flex; align-items: center; min-height: 32px; color: var(--accent); font-size: var(--text-sm, .8125rem); font-weight: var(--font-bold, 700); white-space: nowrap; }
.gh-play .gh-arr { margin-left: .28em; }
.gh-card.is-played .gh-card__name::after { content: '\2713'; margin-left: 6px; font-size: .8rem; color: var(--color-easy, #22c55e); }
/* OA guides by firm: a compact list under the games, headed like the problems-page sidebar labels */
.gh-guides { margin-top: 24px; }
.gh-guides[hidden] { display: none; }
/* "OA GUIDES FOR 8 FIRMS" (grey tracked label) ...... "All 57 firms in the OA hub ->" (blue link, like .gh-sec__lesson) */
.gh-guides__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin: 0 0 10px; }
.gh-guides__h { margin: 0; font-size: var(--text-xs, .6875rem); font-weight: 600; line-height: 1.5; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted, #94a3b8); }
.gh-guides__all { font-size: var(--text-sm, .8125rem); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.gh-guides__all::after { content: ' \2192'; }
@media (hover: hover) { .gh-guides__all:hover { text-decoration: underline; } }
.gh-guides__all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
/* the sectioned list: the header link stands in for the "all firms" card (it still shows in search) */
.gh-results:not(.is-flat) .gh-card--all { display: none; }
.gh-grid--guides { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.gh-card--firm { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "mono name go" "mono trains go"; column-gap: 12px; row-gap: 1px; align-items: center; padding: 12px 16px 12px 12px; }
/* guide row: a small neutral document tile with the firm initials */
.gh-mono { grid-area: mono; position: relative; justify-self: center; display: flex; align-items: flex-end; justify-content: center; box-sizing: border-box; width: 28px; height: 34px; padding-bottom: 5px; border-radius: 3px; background: var(--bg-secondary, #f8fafc); box-shadow: inset 0 0 0 1.5px var(--border-light, rgba(0,0,0,.12)); clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); font-size: .625rem; font-weight: 700; line-height: 1; letter-spacing: .02em; color: var(--text-secondary, #475569); }
.gh-mono::before { content: ''; position: absolute; left: 6px; right: 11px; top: 7px; height: 4px; border-top: 1.5px solid var(--border-light, rgba(0,0,0,.12)); border-bottom: 1.5px solid var(--border-light, rgba(0,0,0,.12)); }
.gh-mono::after { content: ''; position: absolute; top: 0; right: 0; width: 9px; height: 9px; background: linear-gradient(225deg, transparent 50%, var(--border-light, rgba(0,0,0,.12)) 50%); }
.gh-card--firm .gh-card__art { display: none; }
.gh-card--firm .gh-card__name { grid-area: name; margin: 0; font-size: .9375rem; }
.gh-card--firm .gh-card__trains { grid-area: trains; min-height: 0; font-size: .8125rem; line-height: 1.45; }
.gh-card--firm .gh-play { grid-area: go; }
.gh-card--firm .gh-pill { display: none; }
@media (min-width: 769px) {
  /* filtered flat grid: a guide sits among game cards, so it stacks like one: guide drawing with the firm as a tag, same type sizes, same footer */
  .gh-results.is-flat .gh-card--firm:not([hidden]) { display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding: 0 var(--space-5, 20px) 14px; }
  .gh-results.is-flat .gh-card--firm .gh-pill { display: inline-flex; }
  .gh-results.is-flat .gh-card--firm .gh-card__art { display: grid; }
  .gh-results.is-flat .gh-card--firm .gh-mono { display: none; }
  .gh-results.is-flat .gh-card--firm .gh-card__name { margin: 2px 0 0; font-size: 1rem; }
  .gh-results.is-flat .gh-card--firm .gh-card__trains { min-height: 3em; font-size: var(--text-sm, .8125rem); -webkit-line-clamp: 2; }
  .gh-results.is-flat .gh-card--firm .gh-play { justify-content: flex-end; margin: auto 0 0; padding-top: 10px; border-top: 1px solid var(--border-color, rgba(0,0,0,.08)); }
}
.gh-guide__tag { position: absolute; left: 50%; top: 54px; transform: translate(-50%, -50%); box-sizing: border-box; width: max-content; max-width: 74px; padding: 2px 6px; border-radius: var(--radius-sm, 4px); background: color-mix(in srgb, var(--h, var(--accent)) 14%, var(--bg-card, #fff)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--h, var(--accent)) 30%, transparent); color: var(--h-ink, var(--accent)); font-size: 11px; font-weight: 600; line-height: 1.3; letter-spacing: .04em; text-align: center; text-transform: uppercase; white-space: normal; }  /* firm tag (neutral tint, like the category pill) centred inside the 80px document of ga-guide (y 6-86 of 96, +8px art padding); long names wrap to two lines */
.gh-card--all { border-style: dashed; border-color: var(--border-light, rgba(0,0,0,.12)); }
/* category pill only where cards of different categories mix (search, firm, Free/Pro: .is-mixed). The
   sectioned list (heading names the category) and a single-category filter (.is-cat) drop it; the art
   accent keeps the hue. Without the pill the title follows the drawing's own white space (no extra gap). */
.gh-results:not(.is-flat) .gh-card .gh-pill, .gh-results.is-cat .gh-card .gh-pill { display: none; }

@media (max-width: 768px) {
  .main.gh { padding-left: 16px; padding-right: 16px; padding-top: 14px; }
  /* phone: compact rows, the game's icon on a category-tinted tile left (tag tint + tag colour, so rows scan
     by category without the pill), text right, 2-line blurb, then ONE meta line with the badge at its end;
     whole row tappable */
  .gh-card { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-areas: "art name name" "art trains trains" "art meta badge"; column-gap: 11px; row-gap: 2px; align-items: center; padding: 12px 14px 12px 12px; }
  .gh-card:hover { transform: none; box-shadow: none; }
  .gh-card__art { grid-area: art; align-self: start; width: 40px; height: 40px; padding: 0; margin: 2px 0 0; border: 0; border-radius: var(--radius-lg, 10px); background: var(--h-bg, var(--bg-secondary)); }
  .gh-card__art .gh-art { display: none; }
  .gh-card__art .gh-ic, .gh-card__art--ic .gh-ic { display: block; position: static; width: 22px; height: 22px; margin: 0; color: var(--h-ink, var(--text-secondary)); stroke-width: 1.7; }
  .gh-pill { display: none; }
  .gh-card__name { grid-area: name; margin: 0; font-size: 1rem; line-height: 1.3; }
  .gh-card__trains { grid-area: trains; min-height: 0; font-size: .8125rem; line-height: 1.4; }
  /* phone meta: time, level, firm on one line; the firm truncates with an ellipsis, never wraps */
  .gh-meta { grid-area: meta; align-self: center; column-gap: 7px; margin: 3px 0 0; line-height: 20px; }
  .gh-diff { gap: 5px; }
  .gh-firm { flex: 0 1 auto; }
  .gh-firm::before { margin-right: 5px; } /* the "·" stays: with the firm in regular grey it would read as part of the level ("Medium Optiver") */
  .gh-firm--more { display: none; } /* phone: one firm; the rest are in its title and in search */
  .gh-card__foot { display: contents; }
  .gh-card__foot > .gh-badge { grid-area: badge; justify-self: end; align-self: center; margin: 3px 0 0 6px; padding: 0 6px; font-size: 10.5px; line-height: 18px; }
  .gh-card__foot > .gh-badge--pro { padding: 0 5px; font-size: 10px; line-height: 16px; }
  .gh-play { display: none; }
  .gh-rec { grid-column: 2 / -1; justify-self: start; max-width: 100%; margin-top: 4px; }
  .gh-card--firm { grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: "mono name go" "mono trains go"; min-height: 56px; padding: 10px 14px 10px 10px; }
  .gh-card--firm .gh-play { display: inline-flex; }
  .gh-guides__all { display: inline-block; margin: -12px 0; padding: 12px 0; line-height: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-card, .gh-tile { transition: none; }
  .gh-card:hover, .gh-tile:hover { transform: none; }
}
/* hub only: an opaque nav so cards never ghost through it above the sticky filter bar */
.nav, [data-theme="light"] .nav { background: var(--bg-primary, #fff); }

/* ---- phone polish (lead, after lap 8 critics) ----
   count row: the count keeps one full line, the blurb follows, and Free / Pro / Firm sit on
   their own row under it (no 2-3 line wrap of "24 of 39 games + 1 OA guide"). The Next up box
   (2 x 2 on phone) lives with the top block above. */
@media (max-width: 768px) {
  #gh-count { flex: 1 1 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .gh-tools { order: 3; margin-left: 0; }
  .gh-legend { order: 4; }
}
