/* Games page: the catalog on the left (search, categories, filters and games are ONE block), a tabbed panel on the right with favorites,
   collections and charts. Scoped to body.games-page. */
body.games-page .container.gm-page { width: 100%; max-width: 1560px; margin: 0 auto; padding: 28px clamp(16px, 2.4vw, 40px) 72px; box-sizing: border-box; }
body.games-page .game-section { animation: none !important; }
.gm-page svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- title */
.gm-title { margin-bottom: 20px; }
.gm-title h1 { margin: 0; font-size: clamp(26px, 2.6vw, 36px); font-weight: 780; letter-spacing: -.03em; line-height: 1.08; }
.gm-title h1 span { background: linear-gradient(100deg, #7cc4ff, #4aa8ff 55%, #8f9bff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gm-title p { margin: 8px 0 0; min-height: 21px; color: #8d9ab0; font-size: 14.5px; transition: opacity .38s ease, transform .38s ease; }
.gm-title p.is-out { opacity: 0; transform: translateY(4px); }

/* ---------------------------------------------------------------- layout */
.gm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.gm-main { min-width: 0; }
.gm-side { position: sticky; top: 16px; display: flex; flex-direction: column; height: calc(100vh - 32px); max-height: 900px; min-height: 420px; overflow: hidden; border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: var(--r-lg, 14px); background: var(--surface-1, rgba(14,19,29,.82)); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }

/* ---------------------------------------------------------------- search + categories + toolbar (one block) */
.gm-controls { margin-bottom: 20px; }
.gm-search-box { position: relative; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 10px 0 20px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 14px; background: rgba(10, 15, 24, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 14px 40px -18px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.05); transition: border-color .2s ease, box-shadow .25s ease; }
.gm-search-box:focus-within { border-color: rgba(96,175,255,.75); box-shadow: 0 0 0 4px rgba(64,162,250,.16), 0 14px 40px -18px rgba(64,162,250,.5); }
.gm-search-ico { width: 20px; height: 20px; flex: 0 0 20px; color: #7f9bc2; }
.gm-search-box:focus-within .gm-search-ico { color: #8ccaff; }
#gmSearch { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; color: #f2f6fc; font: 500 16px/1 Inter, sans-serif; outline: none; }
#gmSearch::placeholder { color: #6f7f97; }
#gmSearch::-webkit-search-cancel-button { display: none; }
.gm-kbd { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 6px; color: #7f8da4; font: 600 12px/1 Inter, sans-serif; }
.gm-search-box:focus-within .gm-kbd { display: none; }
.gm-search-clear { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.08); color: #cdd7e6; font-size: 18px; line-height: 1; cursor: pointer; }
.gm-search-clear:hover { background: rgba(255,255,255,.16); }
.gm-search-clear[hidden] { display: none; }
.gm-random { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid rgba(120,190,255,.35); border-radius: 10px; background: linear-gradient(135deg, rgba(47,127,224,.9), rgba(58,155,240,.9)); color: #fff; font: 650 13px/1 Inter, sans-serif; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(58,155,240,.9); transition: filter .18s ease, transform .18s ease; }
.gm-random:hover { filter: brightness(1.1); }
.gm-random:active { transform: scale(.97); }
.gm-random svg { width: 16px; height: 16px; }

.gm-chips { display: flex; gap: 8px; margin-top: 14px; padding: 2px 2px 6px; overflow-x: auto; scrollbar-width: none !important; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.gm-chips::-webkit-scrollbar { display: none; }
.gm-chip { position: relative; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 15px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 999px; background: rgba(255,255,255,.04); color: #b4c1d6; font: 600 13px/1 Inter, sans-serif; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease; }
.gm-chip:hover { background: rgba(255,255,255,.09); color: #fff; }
.gm-chip:active { transform: scale(.96); }
.gm-chip.is-on { border-color: #6bb8ff; background: linear-gradient(135deg, #2c7be0, #3d9cf4); color: #fff; box-shadow: 0 8px 22px -8px rgba(64,162,250,.9), inset 0 0 0 1px rgba(255,255,255,.18); }
.gm-chip.is-on::before { content: ''; width: 12px; height: 12px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }

/* the old filter panel became a slim toolbar: result count + active filters on the left, sort and "Filters" on the right */
body.games-page .filter-panel.library-toolbar { margin: 8px 0 0; padding: 12px 0 0; border: 0; border-top: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.lt-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.lt-left { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; min-width: 0; }
.lt-left .results-count { margin: 0; color: #cdd7e6; font-size: 14px; font-weight: 600; white-space: nowrap; }
.lt-active { display: flex; flex-wrap: wrap; gap: 8px; }
.lt-active:empty { display: none; }
.lt-pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 13px; border: 1px solid rgba(120,190,255,.5); border-radius: 999px; background: rgba(64,162,250,.2); color: #fff; font: 600 12.5px/1 Inter, sans-serif; cursor: pointer; transition: background .18s ease; }
.lt-pill:hover { background: rgba(239,68,68,.25); border-color: rgba(248,113,113,.6); }
.lt-pill svg { width: 12px; height: 12px; stroke-width: 2.4; }
.lt-right { display: flex; align-items: center; gap: 10px; }
.lt-field { display: flex; align-items: center; gap: 10px; color: #8d9ab0; font-size: 13px; font-weight: 600; }
body.games-page .lt-select { min-width: 170px; height: 40px; min-height: 40px; padding: 0 12px; }
.lt-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 8px; background: rgba(255,255,255,.05); color: #dbe5f3; font: 650 13px/1 Inter, sans-serif; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.lt-btn svg { width: 16px; height: 16px; }
.lt-btn:hover, .lt-btn.is-on { background: rgba(64,162,250,.18); border-color: rgba(120,190,255,.5); color: #fff; }
body.games-page .library-toolbar .filter-main-row { display: none; }
body.games-page .library-toolbar .library-advanced-search > summary { display: none; }
body.games-page .library-toolbar .library-advanced-search { margin: 0; }
body.games-page .library-toolbar .library-advanced-search[open] { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line, rgba(255,255,255,.07)); }
body.games-page .filter-control { min-height: 42px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 8px; background-color: rgba(255,255,255,.04); color: #e8eef8; box-shadow: none; transition: border-color .18s ease, background-color .18s ease, box-shadow .18s ease; }
body.games-page .filter-control:hover { border-color: rgba(255,255,255,.22); }
body.games-page .filter-control:focus { border-color: rgba(96,175,255,.7); background-color: rgba(64,162,250,.07); box-shadow: 0 0 0 3px rgba(64,162,250,.18); }
body.games-page .btn-reset-filters { border-radius: 8px; }

/* ---------------------------------------------------------------- trending strip: small cards */
.gm-strip { margin: 0 0 22px; }
.gm-strip-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.gm-strip-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.gm-strip-head span { color: #7f8da4; font-size: 12px; }
.gm-strip-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 12px; }
.gm-strip-card { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: inherit; text-decoration: none; }
.gm-strip-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 10px; background: #0c121c; transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .2s ease; }
.gm-strip-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gm-strip-art i { position: absolute; left: 6px; top: 6px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; background: rgba(6,9,15,.72); backdrop-filter: blur(6px); color: #ffd166; font: 700 12px/1 Inter, sans-serif; font-style: normal; }
.gm-strip-card:nth-child(n+4) .gm-strip-art i { color: #cdd7e6; }
.gm-strip-card:hover .gm-strip-art { transform: translateY(-3px); border-color: rgba(96,175,255,.5); }
.gm-strip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: #e6edf7; }
.gm-strip-meta { display: flex; align-items: center; gap: 6px; color: #8d9ab0; font-size: 11.5px; }
.gm-strip-meta b { width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.9); }
body.gm-searching .gm-strip { display: none; }

/* ---------------------------------------------------------------- game tiles */
body.games-page .all-games-grid { gap: 16px; }
body.games-page .game-card-custom { border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 12px; background: var(--surface-1, rgba(14,19,29,.82)); box-shadow: none; backdrop-filter: blur(10px); transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .25s ease; }
body.games-page .game-card-custom:hover { transform: translateY(-4px); border-color: rgba(96,175,255,.5); box-shadow: 0 16px 34px -14px rgba(0,0,0,.8), 0 0 0 1px rgba(96,175,255,.12); }
body.games-page .game-card-img-box { border-bottom: 0; background: #0c121c; }
body.games-page .game-card-content { gap: 6px; padding: 10px 12px 12px; justify-content: flex-start; }
body.games-page .game-card-title { font-size: 13.5px; font-weight: 600; color: #eaf0f8; letter-spacing: 0; }
body.games-page .game-card-stats { font-size: 12px; color: #8d9ab0; }
body.games-page .game-card-playing { color: #9bf0c8; font-weight: 600; }
body.games-page .game-card-playing::before { background-color: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.9); }
body.games-page .game-card-likes { color: #b8c4d8; font-weight: 600; }
body.games-page #noGamesMessage { border-radius: 12px; }
body.games-page .games-load-more { border-radius: 8px; }

/* ---------------------------------------------------------------- right panel */
.gm-side-tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.07)); flex: 0 0 auto; }
.gm-side-tab { position: relative; flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 8px; border: 0; border-radius: 10px 10px 0 0; background: transparent; color: #8d9ab0; font: 650 13px/1 Inter, sans-serif; cursor: pointer; transition: color .18s ease, background .18s ease; }
.gm-side-tab svg { width: 16px; height: 16px; }
.gm-side-tab:hover { color: #e6edf7; background: rgba(255,255,255,.04); }
.gm-side-tab::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #4aa8ff, #8f9bff); box-shadow: 0 0 12px rgba(74,168,255,.7); transform: scaleX(0); transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.gm-side-tab.is-on { color: #fff; }
.gm-side-tab.is-on::after { transform: scaleX(1); }
.gm-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: rgba(255,255,255,.1); color: #cdd7e6; font-size: 11px; font-weight: 700; }
.gm-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 14px; overflow-y: auto; scrollbar-gutter: stable; }
.gm-pane[hidden] { display: none; }
.gm-pane .container { width: 100%; max-width: none; margin: 0; padding: 0; background: none; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.gm-empty { margin: 0; color: #8d9ab0; font-size: 13px; }
.gm-empty-state { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; border: 1px dashed var(--line-strong, rgba(255,255,255,.13)); border-radius: 12px; background: rgba(255,255,255,.025); }
.gm-empty-state strong { font-size: 14px; font-weight: 650; }
.gm-empty-state span { color: #8d9ab0; font-size: 13px; line-height: 1.5; }
.gm-btn { display: inline-flex; align-items: center; height: 36px; margin-top: 6px; padding: 0 16px; border: 1px solid rgba(120,190,255,.4); border-radius: 8px; background: linear-gradient(135deg, #2f7fe0, #3a9bf0); color: #fff; font-size: 13px; font-weight: 650; text-decoration: none; }
.gm-pane-filter { display: flex; align-items: center; gap: 10px; height: 40px; margin-bottom: 12px; padding: 0 12px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 10px; background: rgba(255,255,255,.04); color: #7f9bc2; flex: 0 0 auto; }
.gm-pane-filter svg { width: 16px; height: 16px; }
.gm-pane-filter input { flex: 1; min-width: 0; height: 100%; border: 0 !important; background: transparent !important; box-shadow: none !important; color: #f2f6fc; font: 500 14px/1 Inter, sans-serif; outline: none; }

/* favorites */
.gm-fav-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; align-content: start; }
.gm-fav-item { position: relative; display: flex; flex-direction: column; gap: 7px; min-width: 0; color: inherit; text-decoration: none; }
.gm-fav-item[hidden] { display: none; }
.gm-fav-art { display: block; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 14px; background: #0c121c; transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .25s ease; }
.gm-fav-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gm-fav-item:hover .gm-fav-art { transform: translateY(-3px); border-color: rgba(96,175,255,.55); box-shadow: 0 14px 28px -12px rgba(0,0,0,.8); }
.gm-fav-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: #dbe5f3; text-align: center; }
.gm-fav-remove { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(8,12,20,.82); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; opacity: 0; transform: scale(.8); transition: opacity .18s ease, transform .18s ease, background .18s ease; }
.gm-fav-item:hover .gm-fav-remove { opacity: 1; transform: scale(1); }
.gm-fav-remove:hover { background: #ef4444; }

/* collections: a list of compact rows (it scrolls inside the panel, so any number fits) */
.gm-pane .collection-flash { margin-bottom: 10px; border-radius: 10px; }
.gm-pane .collection-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; background: none; border: 0; box-shadow: none; flex: 0 0 auto; }
.gm-pane .collection-toolbar > input[type="search"] { flex: 1 1 100%; min-height: 40px; }
.gm-pane .collection-toolbar-controls { display: flex; flex: 1 1 100%; gap: 8px; align-items: center; }
.gm-pane .collection-toolbar-controls select { flex: 1; min-height: 40px; }
.gm-pane .collection-toolbar .btn { height: 40px; padding: 0 14px; border-radius: 8px; white-space: nowrap; }
.gm-pane .collection-max-notice { color: #8d9ab0; font-size: 12px; white-space: nowrap; }
.gm-pane .collections-grid { display: flex !important; flex-direction: column; gap: 8px; }
.gm-col-card { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 12px; background: rgba(255,255,255,.03); cursor: pointer; transition: transform .2s cubic-bezier(.2,.8,.2,1), border-color .2s ease, background .2s ease; }
.gm-col-card:hover { transform: translateX(2px); border-color: rgba(96,175,255,.5); background: rgba(64,162,250,.07); }
.gm-col-cover { position: relative; display: grid; flex: 0 0 66px; width: 66px; height: 66px; gap: 2px; overflow: hidden; border-radius: 10px; background: #0c121c; }
.gm-col-cover img { width: 100%; height: 100%; min-height: 0; object-fit: cover; }
.gm-col-cover.count-1 { grid-template-columns: 1fr; }
.gm-col-cover.count-2 { grid-template-columns: 1fr 1fr; }
.gm-col-cover.count-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gm-col-cover.count-3 img:first-child { grid-row: 1 / span 2; }
.gm-col-cover.count-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.gm-col-blank { display: grid; place-items: center; color: #6f7f97; font-size: 11px; }
.gm-col-pill { display: none; }
.gm-col-body { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; padding: 0; }
.gm-col-title { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; letter-spacing: -.01em; }
.gm-col-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gm-col-by { display: flex; align-items: center; gap: 6px; min-width: 0; color: #9aa9c0; font-size: 12px; }
.gm-col-by img { width: 18px; height: 18px; flex: 0 0 18px; object-fit: cover; border-radius: 50%; background: #101722; }
.gm-col-by span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-col-save { margin: 0; }
.gm-col-card .collection-save-toggle { height: 26px; padding: 0 10px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 8px; background: rgba(255,255,255,.05); color: #dbe5f3; font: 650 11.5px/1 Inter, sans-serif; white-space: nowrap; cursor: pointer; transition: background .18s ease; }
.gm-col-card .collection-save-toggle:hover { background: rgba(255,255,255,.1); }
.gm-col-card .collection-save-toggle.is-saved { border-color: rgba(120,190,255,.5); background: rgba(64,162,250,.2); color: #fff; }
.gm-col-card .collection-saved-count { color: #8d9ab0; font-size: 12px; font-weight: 600; white-space: nowrap; }

/* charts */
.gm-chart-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.gm-chart-row { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: inherit; transition: background .18s ease; }
.gm-chart-row:hover { background: rgba(255,255,255,.06); }
.gm-chart-row b { width: 20px; color: #8d9ab0; font-size: 13px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }
.gm-chart-list li:nth-child(1) b { color: #ffd166; }
.gm-chart-list li:nth-child(2) b { color: #cfd8e6; }
.gm-chart-list li:nth-child(3) b { color: #e6a06a; }
.gm-chart-row img { width: 42px; height: 42px; flex: 0 0 42px; object-fit: cover; border-radius: 9px; background: #101722; }
.gm-chart-text { display: flex; flex: 1; flex-direction: column; min-width: 0; gap: 2px; }
.gm-chart-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
.gm-chart-text small { display: flex; align-items: center; gap: 6px; color: #8d9ab0; font-size: 12px; }
.gm-chart-text i { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px rgba(52,211,153,.9); }
.gm-chart-row em { color: #8d9ab0; font-size: 12px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- collection drawer */
html.gm-lock, html.gm-lock body { overflow: hidden !important; }
.gm-drawer { position: fixed; inset: 0; z-index: 3000; visibility: hidden; }
.gm-drawer.is-open { visibility: visible; }
.gm-drawer[hidden] { display: none; }
.gm-drawer-backdrop { position: absolute; inset: 0; background: rgba(3,6,12,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .3s ease; }
.gm-drawer.is-open .gm-drawer-backdrop { opacity: 1; }
.gm-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; width: min(620px, 100vw); border-left: 1px solid var(--line-strong, rgba(255,255,255,.13)); background: #0a0f18; box-shadow: -30px 0 80px rgba(0,0,0,.6); transform: translateX(100%); transition: transform .34s cubic-bezier(.2,.9,.25,1); }
.gm-drawer.is-open .gm-drawer-panel { transform: translateX(0); }
.gm-drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line, rgba(255,255,255,.07)); flex: 0 0 auto; }
.gm-drawer-head h2 { margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.gm-drawer-open { display: inline-flex; align-items: center; gap: 6px; color: #8ccaff; font-size: 12.5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.gm-drawer-open svg, .gm-drawer-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gm-drawer-open:hover { text-decoration: underline; }
.gm-drawer-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 10px; background: rgba(255,255,255,.05); color: #dbe5f3; cursor: pointer; transition: background .18s ease; }
.gm-drawer-close:hover { background: rgba(239,68,68,.25); }
.gm-drawer-body { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.gm-drawer-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #0a0f18; }
.gm-drawer-loading { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; background: #0a0f18; }
.gm-drawer-loading i { width: 9px; height: 9px; border-radius: 50%; background: #4aa8ff; animation: gm-dot 1s ease-in-out infinite; }
.gm-drawer-loading i:nth-child(2) { animation-delay: .15s; }
.gm-drawer-loading i:nth-child(3) { animation-delay: .3s; }
@keyframes gm-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.7); } 40% { opacity: 1; transform: scale(1); } }

/* phones / narrow windows: the panel becomes a sheet behind a button */
.gm-side-fab, .gm-side-scrim { display: none; }
@media (max-width: 1100px) {
    .gm-layout { grid-template-columns: minmax(0, 1fr); }
    .gm-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 2500; height: 78vh; max-height: none; border-radius: 18px 18px 0 0; transform: translateY(105%); transition: transform .34s cubic-bezier(.2,.9,.25,1); box-shadow: 0 -30px 80px rgba(0,0,0,.6); background: #0a0f18; }
    body.gm-side-open .gm-side { transform: translateY(0); }
    .gm-side-scrim { position: fixed; inset: 0; z-index: 2400; display: block; background: rgba(3,6,12,.6); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
    body.gm-side-open .gm-side-scrim { opacity: 1; pointer-events: auto; }
    .gm-side-fab { position: fixed; right: 16px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 2300; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border: 1px solid rgba(120,190,255,.45); border-radius: 999px; background: linear-gradient(135deg, #2f7fe0, #3a9bf0); color: #fff; font: 700 13px/1 Inter, sans-serif; cursor: pointer; box-shadow: 0 14px 30px -10px rgba(58,155,240,.9); }
    .gm-side-fab svg { width: 18px; height: 18px; }
    body.gm-side-open .gm-side-fab { opacity: 0; pointer-events: none; }
    .gm-fav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1101px) and (max-width: 1360px) { .gm-layout { grid-template-columns: minmax(0, 1fr) 340px; } .gm-fav-grid { gap: 14px 10px; } }
@media (max-width: 760px) {
    .gm-random span { display: none; }
    .gm-random { padding: 0 12px; }
    .gm-strip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .gm-strip-card:nth-child(n+5) { display: none; }
    .lt-field span { display: none; }
    body.games-page .lt-select { min-width: 140px; }
    .gm-drawer-panel { width: 100vw; }
}
@media (max-width: 650px) {
    body.games-page .container.gm-page { padding: 16px 14px 40px; }
    .gm-search-box { height: 52px; padding-left: 14px; }
    .gm-kbd { display: none; }
    body.games-page .all-games-grid { gap: 12px; }
    .gm-side-fab { bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .gm-side, .gm-drawer-panel, .gm-drawer-backdrop, .gm-title p { transition: none !important; } }

/* ================================================================ round 4 */
/* filter bar: Categories, Sort and Filters are buttons with pop-up panels; the count sits on the right */
.gm-controls { margin-bottom: 18px; }
.gm-filterbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin-top: 14px; }
.gm-fb-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-fb-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 10px; background: rgba(255,255,255,.04); color: #d3deee; font: 600 13px/1 Inter, sans-serif; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.gm-fb-btn svg { width: 16px; height: 16px; flex: 0 0 16px; }
.gm-fb-btn .gm-fb-chev { width: 14px; height: 14px; flex-basis: 14px; opacity: .6; transition: transform .2s ease; }
.gm-fb-btn[aria-expanded="true"] .gm-fb-chev { transform: rotate(180deg); }
.gm-fb-btn:hover, .gm-fb-btn[aria-expanded="true"], .gm-fb-btn.is-on { background: rgba(64,162,250,.16); border-color: rgba(120,190,255,.5); color: #fff; }
.gm-fb-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #3d9cf4; color: #fff; font-size: 11px; font-weight: 700; }
.gm-fb-badge[hidden] { display: none; }
.gm-filterbar .results-count { margin: 0 2px 0 auto; color: #6f7f97; font-size: 12px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.gm-pop { position: relative; }
.gm-pop-panel { position: absolute; top: calc(100% + 8px); left: 0; z-index: 80; width: min(420px, 86vw); padding: 14px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 14px; background: rgba(12, 17, 27, .97); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 24px 60px -12px rgba(0,0,0,.8); animation: gm-pop-in .16s ease; }
.gm-pop-panel[hidden] { display: none; }
@keyframes gm-pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.gm-pop-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.gm-pop-head strong { font-size: 13px; font-weight: 700; color: #e6edf7; }
.gm-pop-head button { border: 0; background: none; color: #8ccaff; font: 600 12px/1 Inter, sans-serif; cursor: pointer; }
.gm-pop-head button:hover { text-decoration: underline; }
.gm-cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; overscroll-behavior: contain; }
.gm-cat-opt { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: rgba(255,255,255,.04); color: #c3cfe0; font: 600 13px/1.2 Inter, sans-serif; text-align: left; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.gm-cat-opt i { flex: 0 0 18px; width: 18px; height: 18px; border: 1.5px solid rgba(255,255,255,.28); border-radius: 5px; transition: background .15s ease, border-color .15s ease; }
.gm-cat-opt:hover { background: rgba(255,255,255,.09); }
.gm-cat-opt.is-on { border-color: rgba(120,190,255,.55); background: rgba(64,162,250,.22); color: #fff; }
.gm-cat-opt.is-on i { border-color: #5db1ff; background: #3d9cf4 no-repeat center / 12px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.gm-sort-panel { width: 240px; }
.gm-sort-list { display: flex; flex-direction: column; gap: 2px; }
.gm-sort-opt { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: #c3cfe0; font: 600 13px/1 Inter, sans-serif; text-align: left; cursor: pointer; }
.gm-sort-opt:hover { background: rgba(255,255,255,.07); }
.gm-sort-opt.is-on { background: rgba(64,162,250,.2); color: #fff; }
.gm-sort-opt.is-on::after { content: ''; width: 14px; height: 14px; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238ccaff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.lt-active { margin-top: 12px; }
body.games-page .gm-library .library-advanced-search, body.games-page .library-advanced-search { margin: 0; }
body.games-page .library-advanced-search[open] { margin-top: 14px; padding: 14px; border: 1px solid var(--line, rgba(255,255,255,.07)); border-radius: 12px; background: rgba(255,255,255,.03); }
body.games-page .library-advanced-search > summary { display: none; }

/* the right panel scrolls inside itself and never hands the scroll over to the page */
.gm-pane, .gm-side { overscroll-behavior: contain; }

/* favorites: just the pictures */
.gm-fav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gm-fav-art { border-radius: 12px; }

/* collections: icon-only save with the number next to it */
.gm-save { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 8px; background: rgba(255,255,255,.05); color: #b4c1d6; font: 650 12px/1 Inter, sans-serif; cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease; }
.gm-save svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill .18s ease; }
.gm-save strong { font-weight: 650; font-variant-numeric: tabular-nums; }
.gm-save:hover { background: rgba(255,255,255,.1); color: #fff; }
.gm-save.is-saved { border-color: rgba(120,190,255,.55); background: rgba(64,162,250,.22); color: #8ccaff; }
.gm-save.is-saved svg { fill: currentColor; }
.gm-save.is-own { cursor: default; background: transparent; border-color: transparent; color: #8d9ab0; padding: 0 4px; }
.gm-save.is-own:hover { background: transparent; color: #8d9ab0; }
.gm-col-card .collection-save-button { margin: 0; }
.gm-col-cover { flex-basis: 56px; width: 56px; height: 56px; }
.gm-col-title { font-size: 13.5px; }

/* collection panel: no header; a tab on its left edge hides it */
.gm-drawer-panel { overflow: visible; }
.gm-drawer-body { border-radius: 0; }
.gm-drawer-handle { position: absolute; left: -34px; top: 50%; z-index: 2; display: grid; place-items: center; width: 34px; height: 76px; padding: 0; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-right: 0; border-radius: 14px 0 0 14px; background: #0a0f18; color: #8ccaff; cursor: pointer; box-shadow: -10px 0 30px rgba(0,0,0,.45); transform: translateY(-50%); transition: background .18s ease, color .18s ease, width .18s ease, left .18s ease; }
.gm-drawer-handle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.gm-drawer-handle:hover { left: -38px; width: 38px; background: #12203a; color: #fff; }
.gm-drawer-handle:hover svg { transform: translateX(2px); }
@media (max-width: 760px) { .gm-drawer-handle { left: 0; top: 14px; width: 40px; height: 40px; border: 0; border-radius: 0 0 12px 0; transform: none; background: rgba(10,15,24,.92); } .gm-drawer-handle svg { transform: rotate(180deg); } .gm-drawer-handle:hover { left: 0; width: 40px; } .gm-fav-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .gm-pop-panel { width: min(360px, 92vw); } }

#filterSort[hidden] { display: none !important; }

/* ================================================================ round 5 */
/* search, categories, sort, filters and the count are ONE card */
.gm-controls { padding: 0; border: 0; border-radius: 0; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.gm-controls .gm-search { margin: 0; }
.gm-controls .gm-search-box { height: 52px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 12px; background: rgba(10, 15, 24, .72); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.gm-controls .gm-search-box:focus-within { border-color: rgba(96,175,255,.7); background: rgba(64,162,250,.07); box-shadow: 0 0 0 3px rgba(64,162,250,.15); }
.gm-controls .gm-filterbar { margin: 10px 0 0; padding: 0; border: 0; gap: 8px 16px; }
.gm-controls .library-toolbar { margin: 0 !important; padding: 0 !important; }
.gm-controls .lt-active { margin: 12px 2px 0; }
.gm-controls .library-advanced-search[open] { margin: 14px 0 0; }
.gm-fb-btn { height: 38px; padding: 0 14px; border-radius: 10px; background: rgba(10, 15, 24, .72); border-color: var(--line-strong, rgba(255,255,255,.13)); }
.gm-fb-left { gap: 6px; }
.gm-fb-btn svg:first-child { opacity: .8; }
.gm-fb-btn:hover, .gm-fb-btn[aria-expanded="true"], .gm-fb-btn.is-on { border-color: rgba(120,190,255,.45); }
.gm-pop-panel { top: calc(100% + 10px); }

/* favorites: a bit bigger again */
.gm-fav-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gm-fav-art { border-radius: 14px; }
@media (max-width: 760px) { .gm-fav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* round 6 */
/* the controls card sits above the game tiles, so pop-ups open over them */
.gm-controls { position: relative; z-index: 30; }
.gm-pop-panel { transform-origin: 18px -8px; animation: gm-pop-open .24s cubic-bezier(.2,.9,.3,1) both; }
.gm-pop-panel.is-closing { animation: gm-pop-close .15s ease-in both; pointer-events: none; }
@keyframes gm-pop-open { from { opacity: 0; transform: translateY(-10px) scale(.94); clip-path: inset(0 0 100% 0 round 14px); } to { opacity: 1; transform: none; clip-path: inset(0 0 0 0 round 14px); } }
@keyframes gm-pop-close { to { opacity: 0; transform: translateY(-6px) scale(.97); } }
.gm-cat-opt, .gm-sort-opt { animation: gm-opt-in .26s cubic-bezier(.2,.9,.3,1) both; animation-delay: calc(var(--i, 0) * 22ms + 40ms); }
@keyframes gm-opt-in { from { opacity: 0; transform: translateY(6px); } }
.gm-pop-panel.is-closing .gm-cat-opt, .gm-pop-panel.is-closing .gm-sort-opt { animation: none; }
@media (prefers-reduced-motion: reduce) { .gm-pop-panel, .gm-cat-opt, .gm-sort-opt { animation: none !important; } }

/* closing the collection panel: it slides out and the backdrop fades (visibility is switched off only after the motion) */
.gm-drawer { transition: visibility 0s linear .4s; }
.gm-drawer.is-open { transition-delay: 0s; }
.gm-drawer:not(.is-open) .gm-drawer-panel { transition: transform .34s cubic-bezier(.55, 0, .75, .2), opacity .34s ease-in; opacity: .6; }
.gm-drawer:not(.is-open) .gm-drawer-backdrop { transition: opacity .34s ease-in; }
.gm-drawer.is-open .gm-drawer-panel { opacity: 1; }
.gm-drawer:not(.is-open) .gm-drawer-handle { opacity: 0; transition: opacity .12s ease; }
@media (prefers-reduced-motion: reduce) { .gm-drawer { transition: none; } .gm-drawer:not(.is-open) .gm-drawer-panel, .gm-drawer:not(.is-open) .gm-drawer-backdrop { transition: none; } }

/* round 8: the library uses the home tile (styles/game-tiles.css) */
body.games-page .all-games-grid .hg-card { height: 100%; }

/* ================================================================ narrow screens
   The old second search row is not used on this page (it is hidden on a wide screen too); phones used to bring it back. */
body.games-page .library-toolbar .filter-main-row { display: none !important; }

@media (max-width: 650px) {
    /* the side sheet (charts, collections, favourites) opens above the bottom menu instead of covering it */
    .gm-side { bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 1050; height: min(70vh, calc(100dvh - 74px - env(safe-area-inset-bottom) - 84px)); transform: translateY(calc(100% + 90px)); border-radius: 18px 18px 0 0; }
    body.gm-side-open .gm-side { transform: translateY(0); }
    .gm-side-scrim { z-index: 1040; }
    .gm-side-fab { z-index: 1045; }
    .gm-side-tabs, .gm-side [role="tablist"] { overflow-x: auto; scrollbar-width: none !important; }
    .gm-side [role="tablist"]::-webkit-scrollbar { display: none; }

    .gm-title { margin-bottom: 14px; }
    .gm-title p { margin-top: 6px; min-height: 0; font-size: 13.5px; }
    .gm-controls { padding: 0; }
    .gm-search-box { height: 48px; }

    /* filter buttons: Categories and Filters side by side, the sort under them, the count last */
    .gm-filterbar { flex-direction: column; align-items: stretch; gap: 8px; margin-top: 10px; padding-top: 0; }
    .gm-fb-left { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
    .gm-fb-left > .gm-pop:first-child { grid-column: 1; grid-row: 1; }
    .gm-fb-left > #gmAdvancedToggle { grid-column: 2; grid-row: 1; }
    .gm-fb-left > #gmSortPop { grid-column: 1 / -1; grid-row: 2; }
    .gm-fb-left .gm-fb-btn { width: 100%; justify-content: flex-start; min-width: 0; }
    .gm-fb-left .gm-fb-btn > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .gm-fb-left .gm-fb-chev { margin-left: auto; }
    .gm-filterbar .results-count { margin: 0 2px; font-size: 12px; text-align: left; }
    .gm-pop-panel { width: calc(100vw - 52px); max-width: none; }
    .gm-cat-grid { max-height: 260px; }

    /* the "Filters" ranges: two columns of numbers become one column, the pairs stay together */
    .ranges-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
    .range-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
    .range-inputs input { min-width: 0; width: 100%; }
}
/* the sheet is pinned by its bottom edge; the "top" of the desktop (sticky) version must not stay, or the closed sheet peeks out above the menu */
@media (max-width: 1100px) { .gm-side { top: auto; } }

/* narrow screens: the heading on one line, the subtitle on its own line under it (the global header rules had put them side by side) */
@media (max-width: 760px) {
    header.gm-title { display: block !important; width: auto !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    .gm-title h1 { white-space: nowrap; }
    .gm-title p { display: block; margin: 6px 0 0; }
}

.gm-filterbar .results-count b { color: #4aa8ff; font-weight: 700; }

/* ================================================================ one filter panel (sort + categories + ranges + random game)
   Wide screens: it drops out of the search bar. Phones: a bottom sheet above the menu, like the charts panel. */
.gm-search { position: relative; }
.gm-filter-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 1px solid rgba(120,190,255,.35); border-radius: 10px; background: linear-gradient(135deg, rgba(47,127,224,.9), rgba(58,155,240,.9)); color: #fff; font: 650 13px/1 Inter, sans-serif; cursor: pointer; box-shadow: 0 8px 20px -10px rgba(58,155,240,.9); transition: filter .18s ease, transform .18s ease; }
.gm-filter-btn:hover { filter: brightness(1.1); }
.gm-filter-btn:active { transform: scale(.97); }
.gm-filter-btn svg { width: 17px; height: 17px; flex: 0 0 17px; }
.gm-filter-btn[aria-expanded="true"] { filter: brightness(1.12); box-shadow: 0 0 0 3px rgba(64,162,250,.25), 0 8px 20px -10px rgba(58,155,240,.9); }
.gm-filter-btn .gm-fb-badge { min-width: 19px; height: 19px; padding: 0 5px; background: #fff; color: #1d5fb8; font-size: 11px; }

.gm-fscrim { display: none; }
.gm-fpanel { position: absolute; top: calc(100% + 10px); left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; max-height: min(74vh, 660px); border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 16px; background: rgba(11, 16, 26, .98); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); box-shadow: 0 30px 70px -18px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.05); transform-origin: calc(100% - 60px) -10px; opacity: 0; transform: translateY(-10px) scale(.985); pointer-events: none; transition: opacity .22s ease, transform .3s cubic-bezier(.2,.9,.3,1); }
.gm-fpanel[hidden] { display: none; }
.gm-fpanel.is-open { opacity: 1; transform: none; pointer-events: auto; }
.gm-fp-grab { display: none; }
.gm-fp-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px 12px 20px; flex: 0 0 auto; }
.gm-fp-head strong { flex: 1; font-size: 15px; font-weight: 720; letter-spacing: -.01em; color: #f2f6fc; }
.gm-fp-reset { border: 0; background: none; color: #8ccaff; font: 600 12.5px/1 Inter, sans-serif; cursor: pointer; }
.gm-fp-reset:hover { text-decoration: underline; }
.gm-fp-x { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.07); color: #cdd7e6; cursor: pointer; }
.gm-fp-x:hover { background: rgba(255,255,255,.14); }
.gm-fp-x svg { width: 14px; height: 14px; }
.gm-fp-body { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px 28px; padding: 4px 20px 18px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.gm-fp-sec { min-width: 0; }
.gm-fp-sec:first-child { grid-column: 1 / -1; }
.gm-fp-sec h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; color: #7f8da4; font: 700 11px/1 Inter, sans-serif; letter-spacing: .09em; text-transform: uppercase; }
.gm-fp-sec h4 button { border: 0; background: none; color: #8ccaff; font: 600 12px/1 Inter, sans-serif; letter-spacing: 0; text-transform: none; cursor: pointer; }
.gm-fp-sec h4 button:hover { text-decoration: underline; }
.gm-fpanel .gm-sort-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.gm-fpanel .gm-sort-opt { justify-content: center; height: 34px; padding: 0 14px; border-radius: 999px; background: rgba(255,255,255,.05); font-size: 12.5px; }
.gm-fpanel .gm-sort-opt.is-on { background: linear-gradient(135deg, #2c7be0, #3d9cf4); color: #fff; box-shadow: 0 6px 16px -8px rgba(64,162,250,.9); }
.gm-fpanel .gm-sort-opt.is-on::after { display: none; }
.gm-fpanel .gm-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; }
.gm-fpanel .library-advanced-search, .gm-fpanel .library-advanced-search[open] { margin: 0 !important; padding: 0 !important; border: 0 !important; background: none !important; }
.gm-fpanel .ranges-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding: 0 !important; background: none; border: 0; }
.gm-fpanel .range-group { padding: 0; border: 0; background: none; box-shadow: none; }
.gm-fpanel .range-label { display: block; margin-bottom: 6px; color: #aab7cc; font-size: 12.5px; font-weight: 600; }
.gm-fpanel .range-inputs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
.gm-fpanel .range-inputs input { min-width: 0; width: 100%; min-height: 38px; }
.gm-fp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 14px 20px; border-top: 1px solid var(--line, rgba(255,255,255,.07)); flex: 0 0 auto; }
.gm-fp-random, .gm-fp-done { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px; font: 650 13px/1 Inter, sans-serif; cursor: pointer; transition: background .18s ease, filter .18s ease, transform .18s ease; }
.gm-fp-random { border: 1px solid var(--line-strong, rgba(255,255,255,.13)); background: rgba(255,255,255,.05); color: #dbe5f3; }
.gm-fp-random:hover { background: rgba(64,162,250,.16); border-color: rgba(120,190,255,.5); color: #fff; }
.gm-fp-random svg { width: 16px; height: 16px; }
.gm-fp-done { min-width: 96px; border: 1px solid rgba(120,190,255,.35); background: linear-gradient(135deg, #2f7fe0, #3a9bf0); color: #fff; }
.gm-fp-done:hover { filter: brightness(1.1); }
.gm-fp-done:active, .gm-fp-random:active { transform: scale(.97); }
.gm-filterbar { justify-content: flex-start; }
.gm-filterbar .results-count { margin: 0 2px; }
.gm-controls .gm-filterbar { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .gm-fpanel, .gm-fscrim { transition: none !important; } }

@media (max-width: 650px) {
    .gm-filter-btn { height: 38px; padding: 0 12px; }
    .gm-filter-btn > span:first-of-type { display: none; }
    .gm-fscrim { display: block; position: fixed; inset: 0; z-index: 1040; background: rgba(3,6,12,.6); opacity: 0; transition: opacity .3s ease; }
    .gm-fscrim[hidden] { display: none; }
    .gm-fscrim.is-open { opacity: 1; }
    .gm-fpanel { position: fixed; top: auto; left: 0; right: 0; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 1050; max-height: min(74vh, calc(100dvh - 74px - env(safe-area-inset-bottom) - 84px)); border-width: 1px 0 0; border-radius: 18px 18px 0 0; background: #0a0f18; box-shadow: 0 -30px 80px rgba(0,0,0,.6); transform-origin: 50% 100%; opacity: 1; transform: translateY(calc(100% + 90px)); transition: transform .34s cubic-bezier(.2,.9,.25,1); }
    .gm-fpanel.is-open { transform: translateY(0); }
    .gm-fp-grab { display: block; width: 38px; height: 4px; margin: 8px auto 0; border-radius: 3px; background: rgba(255,255,255,.2); flex: 0 0 auto; }
    .gm-fp-head { padding: 10px 14px 8px 16px; }
    .gm-fp-body { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 4px 16px 16px; }
    .gm-fpanel .range-inputs { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
    .gm-fp-foot { padding: 10px 14px; }
    .gm-fp-done { flex: 1; }
    .gm-fp-random { padding: 0 14px; }
}
body.gm-fp-open .gm-side-fab { opacity: 0; pointer-events: none; }

/* the phone button that opens charts / collections / favourites: a compact glass tile, not a pill */
@media (max-width: 1100px) {
    .gm-side-fab { gap: 8px; height: 42px; padding: 0 16px 0 13px; border: 1px solid rgba(120,190,255,.32); border-radius: 12px; background: rgba(12, 18, 30, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #e6f0ff; font: 650 13px/1 Inter, sans-serif; letter-spacing: .01em; box-shadow: 0 12px 28px -12px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.06); transition: border-color .18s ease, background .18s ease, transform .18s ease; }
    .gm-side-fab svg { width: 16px; height: 16px; color: #6fb6ff; }
    .gm-side-fab:hover { border-color: rgba(120,190,255,.6); background: rgba(18, 28, 46, .95); }
    .gm-side-fab:active { transform: scale(.96); }
}

.gm-fp-select { position: relative; }
.gm-fp-select select { appearance: none; -webkit-appearance: none; width: 100%; height: 44px; padding: 0 42px 0 14px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 10px; background: rgba(255,255,255,.05); color: #f2f6fc; font: 600 14px/1 Inter, sans-serif; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.gm-fp-select select:hover { border-color: rgba(255,255,255,.24); }
.gm-fp-select select:focus { outline: none; border-color: rgba(96,175,255,.7); background: rgba(64,162,250,.07); box-shadow: 0 0 0 3px rgba(64,162,250,.18); }
.gm-fp-select select option { background: #0f1624; color: #e8eef8; }
.gm-fp-select svg { position: absolute; right: 14px; top: 50%; width: 16px; height: 16px; margin-top: -8px; color: #8ccaff; pointer-events: none; }
@media (min-width: 651px) { .gm-fp-select { max-width: 320px; } }

/* sort: a custom select that unfolds inside the panel */
.gm-cs { position: relative; }
.gm-cs-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; max-width: 340px; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong, rgba(255,255,255,.13)); border-radius: 10px; background: rgba(255,255,255,.05); color: #f2f6fc; font: 600 14px/1 Inter, sans-serif; text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease, box-shadow .18s ease; }
.gm-cs-btn:hover { border-color: rgba(255,255,255,.24); }
.gm-cs.is-open .gm-cs-btn, .gm-cs-btn:focus-visible { outline: none; border-color: rgba(96,175,255,.7); background: rgba(64,162,250,.08); box-shadow: 0 0 0 3px rgba(64,162,250,.16); }
.gm-cs-btn svg { width: 16px; height: 16px; flex: 0 0 16px; color: #8ccaff; transition: transform .3s cubic-bezier(.2,.9,.3,1); }
.gm-cs.is-open .gm-cs-btn svg { transform: rotate(180deg); }
.gm-cs-wrap { display: grid; grid-template-rows: 0fr; max-width: 340px; transition: grid-template-rows .32s cubic-bezier(.2,.9,.3,1); }
.gm-cs.is-open .gm-cs-wrap { grid-template-rows: 1fr; }
.gm-cs-list { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; margin-top: 0; padding: 0 6px; border: 1px solid transparent; border-radius: 12px; background: rgba(8, 12, 20, .9); opacity: 0; transition: opacity .22s ease, margin-top .32s ease, padding .32s ease, border-color .2s ease; }
.gm-cs.is-open .gm-cs-list { margin-top: 8px; padding: 6px; border-color: var(--line-strong, rgba(255,255,255,.13)); opacity: 1; }
.gm-cs-list .gm-sort-opt, .gm-fpanel .gm-cs-list .gm-sort-opt { justify-content: space-between; height: 38px; padding: 0 12px; border-radius: 8px; background: transparent; box-shadow: none; font-size: 13.5px; color: #c3cfe0; transform: translateY(-6px); opacity: 0; transition: background .15s ease, transform .3s cubic-bezier(.2,.9,.3,1), opacity .25s ease; animation: none; }
.gm-cs.is-open .gm-sort-opt { transform: none; opacity: 1; }
.gm-cs.is-open .gm-sort-opt:nth-child(2) { transition-delay: 0s, .03s, .03s; } .gm-cs.is-open .gm-sort-opt:nth-child(3) { transition-delay: 0s, .06s, .06s; } .gm-cs.is-open .gm-sort-opt:nth-child(4) { transition-delay: 0s, .09s, .09s; } .gm-cs.is-open .gm-sort-opt:nth-child(5) { transition-delay: 0s, .12s, .12s; } .gm-cs.is-open .gm-sort-opt:nth-child(6) { transition-delay: 0s, .15s, .15s; } .gm-cs.is-open .gm-sort-opt:nth-child(7) { transition-delay: 0s, .18s, .18s; } .gm-cs.is-open .gm-sort-opt:nth-child(8) { transition-delay: 0s, .21s, .21s; }
.gm-fpanel .gm-cs-list .gm-sort-opt:hover { background: rgba(255,255,255,.07); }
.gm-fpanel .gm-cs-list .gm-sort-opt.is-on { background: rgba(64,162,250,.2); color: #fff; box-shadow: none; }
.gm-fpanel .gm-cs-list .gm-sort-opt.is-on::after { display: block; }
@media (prefers-reduced-motion: reduce) { .gm-cs-wrap, .gm-cs-list, .gm-cs-list .gm-sort-opt, .gm-cs-btn svg { transition: none !important; } }

/* wide panel: categories on the left, ranges and then "Sort by" on the right */
@media (min-width: 651px) {
    .gm-fp-sec:first-child { grid-column: 2; grid-row: 2; }
    .gm-fp-sec:nth-child(2) { grid-column: 1; grid-row: 1 / span 2; }
    .gm-fp-sec:nth-child(3) { grid-column: 2; grid-row: 1; }
    .gm-fp-body { align-items: start; }
    .gm-fpanel .gm-cs-btn, .gm-cs-wrap { max-width: none; }
}
@media (min-width: 651px) { .gm-fp-body { align-content: start; grid-template-rows: auto 1fr; } }

/* wide panel: the sort list drops DOWN over the panel (no layout change, nothing moves up) */
@media (min-width: 651px) {
    .gm-fp-body { overflow: visible; }
    .gm-fpanel { max-height: none; }
    .gm-cs-wrap { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; display: block; max-width: none; pointer-events: none; }
    .gm-cs.is-open .gm-cs-wrap { pointer-events: auto; }
    .gm-cs-list { margin-top: 0 !important; padding: 6px !important; border-color: var(--line-strong, rgba(255,255,255,.13)) !important; background: #0b101a; box-shadow: 0 22px 50px -14px rgba(0,0,0,.9); opacity: 1; clip-path: inset(0 0 100% 0 round 12px); visibility: hidden; transition: clip-path .32s cubic-bezier(.2,.9,.3,1), visibility 0s linear .32s; }
    .gm-cs.is-open .gm-cs-list { clip-path: inset(0 0 0 0 round 12px); visibility: visible; transition-delay: 0s; }
    .gm-cs-list .gm-sort-opt, .gm-fpanel .gm-cs-list .gm-sort-opt { transform: none !important; opacity: 1 !important; transition: background .15s ease; }
}

/* phones: no tagline (the search bar sits right under the title) and no game icon on the tiles */
@media (max-width: 650px) {
    .gm-title { margin-bottom: 12px; }
    .gm-title p { display: none; }
    body.games-page .all-games-grid .hg-icon { display: none; }
    body.games-page .all-games-grid .hg-info { padding-left: 12px; }
}

/* round: a shorter panel - categories are compact chips, tighter spacing, no grab bar */
.gm-fp-grab { display: none !important; }
.gm-fpanel .gm-cat-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.gm-fpanel .gm-cat-opt { min-height: 32px; padding: 0 12px 0 9px; gap: 8px; border-radius: 999px; font-size: 12.5px; }
.gm-fpanel .gm-cat-opt i { flex: 0 0 14px; width: 14px; height: 14px; border-radius: 4px; }
.gm-fp-head { padding: 12px 14px 8px 18px; }
.gm-fp-body { gap: 14px 24px; padding: 2px 18px 14px; }
.gm-fp-sec h4 { margin-bottom: 8px; }
.gm-fp-foot { padding: 10px 14px 12px 18px; }
.gm-fp-random, .gm-fp-done { height: 36px; }
.gm-fpanel .range-inputs input { min-height: 34px; }
.gm-fpanel .ranges-grid { gap: 8px 10px; }
.gm-fpanel .range-label { margin-bottom: 4px; }
.gm-cs-btn { height: 38px; }
@media (max-width: 650px) {
    .gm-fpanel { max-height: min(52vh, calc(100dvh - 74px - env(safe-area-inset-bottom) - 100px)); }
    .gm-fp-head { padding-top: 14px; }
}

/* phones: the filter sheet and the charts sheet have exactly the same height */
@media (max-width: 650px) {
    .gm-fpanel { height: min(52vh, calc(100dvh - 74px - env(safe-area-inset-bottom) - 100px)); max-height: none; }
    .gm-fp-body { flex: 1; min-height: 0; overflow-y: auto; }
    .gm-side { height: min(52vh, calc(100dvh - 74px - env(safe-area-inset-bottom) - 100px)); }
}

@media (min-width: 651px) and (max-width: 1100px) { .gm-side { height: min(52vh, 520px); } }

/* floating button (the same one on Games and Users) */
body .gm-side-fab { height: 48px; gap: 10px; padding: 0 20px 0 8px; border: 1px solid rgba(170, 205, 255, .42); border-radius: 999px; background: linear-gradient(135deg, #2f86e8 0%, #5a67e8 100%); box-shadow: 0 14px 32px -10px rgba(72, 120, 240, .85), 0 4px 12px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .22); color: #fff; font: 750 14px/1 Inter, sans-serif; letter-spacing: .01em; backdrop-filter: none; -webkit-backdrop-filter: none; transition: transform .18s ease, filter .18s ease, box-shadow .18s ease, opacity .2s ease; }
body .gm-side-fab svg { box-sizing: border-box; width: 32px; height: 32px; padding: 8px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: #fff; }
body .gm-side-fab:hover { border-color: rgba(210, 228, 255, .75); background: linear-gradient(135deg, #3a92f4 0%, #6674f2 100%); filter: brightness(1.05); transform: translateY(-2px); }
body .gm-side-fab:active { transform: scale(.96); }

/* see-through search bar and side panel (below 1100px the panel slides over the games, so there it stays solid) */
.gm-search-box:not(:focus-within), .gm-controls .gm-search-box:not(:focus-within) { background: rgb(10 15 24 / 60%); }
@media (min-width: 1101px) { .gm-side { background: rgb(14 19 29 / 60%); } }
