/*
 * Games section (assets/games.css): rules for #gamesSection and the games windows only. Colours, radii and
 * fonts come from the page's :root tokens; shared pieces (chips, cards, filters, pagination) keep the page's classes.
 * The band, panels and rows have their own g- classes, so the film phone rules never reach them.
 */

/* Search band */
#gamesSection .g-band{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:14px;margin-bottom:14px}
#gamesSection .g-filter-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px}
#gamesSection .g-filter-extra{display:contents}
#gamesSection .chip[hidden]{display:none}
#gamesSection .chip span[dir="ltr"]{unicode-bidi:isolate}
#gamesSection .g-panel{margin-top:10px}
#gamesSection .g-panel[hidden]{display:none}
#gamesSection .g-panel>.prefs-note{margin:0 2px 8px}

/* Platforms panel: one block per family, two columns on wide screens */
#gamesSection .g-pgroups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 22px}
#gamesSection .g-pgroup-toggle{display:inline-flex;align-items:center;gap:7px;padding:0;border:0;background:none;color:var(--ink-2);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
#gamesSection .g-pgroup-toggle::before{content:"";flex:0 0 14px;width:14px;height:14px;border:1.5px solid var(--line-2);border-radius:4px;background:#fff center/10px no-repeat;box-sizing:border-box}
#gamesSection .g-pgroup-toggle:hover{color:var(--accent)}
#gamesSection .g-pgroup-toggle:hover::before{border-color:var(--accent)}
#gamesSection .g-pgroup-toggle[aria-pressed="true"]{color:var(--accent-hover)}
#gamesSection .g-pgroup-toggle[aria-pressed="true"]::before{border-color:var(--accent);background-color:var(--accent);background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5.2' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
#gamesSection .g-pgroup-toggle[aria-pressed="mixed"]::before{border-color:var(--accent);background-image:linear-gradient(var(--accent),var(--accent));background-size:7px 2px}
#gamesSection .g-more{height:32px;padding:0 11px;border:1px dashed var(--line-2);border-radius:16px;background:#fff;color:var(--accent);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
#gamesSection .g-more:hover{border-color:var(--accent)}

/* The line of choices: platforms first (not dimmed by a name search), then preferences and exclusions */
#gamesSection .active-pref.g-plat{border-color:transparent;background:transparent;color:var(--ink)}
#gamesSection .active-pref.g-plat:has(>.g-brand){height:28px;padding:0;border:0}
#gamesSection .g-active.g-ignored .active-pref.is-pref{opacity:.55}

/* Results ([hidden] wins over the shared display rules of these blocks) */
#gamesSection .results-alerts[hidden],#gamesSection .pagination[hidden]{display:none}
#gamesSection .g-row,#gamesSection .g-columns{display:grid;grid-template-columns:28px 54px minmax(0,1fr) 60px 196px 150px 156px 148px 54px;grid-template-areas:"rank cover main year rating plat price history act";gap:0 14px;padding:12px 16px;border-bottom:1px solid var(--line)}
#gamesSection .g-row{align-items:center}
#gamesSection .g-row:last-child{border-bottom:0}
#gamesSection .g-row:hover{background:#fff}
#gamesSection .g-columns{padding:8px 16px;font-size:12px;font-weight:600;color:var(--ink-3)}
#gamesSection .g-c-main{grid-area:main}
#gamesSection .g-c-year{grid-area:year;text-align:center}
#gamesSection .g-c-rating{grid-area:rating}
#gamesSection .g-c-plat{grid-area:plat}
#gamesSection .g-rank{grid-area:rank;color:var(--ink-3);font-size:13px;font-variant-numeric:tabular-nums;text-align:center}
#gamesSection .g-cover{grid-area:cover}
#gamesSection .poster[data-open-game],#gamesSection .poster-none[data-open-game]{cursor:pointer}
#gamesSection .poster[data-open-game]:hover{border-color:var(--ink-3)}
#gamesSection .g-main{grid-area:main;min-width:0}
#gamesSection .g-dev{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#gamesSection .g-year{grid-area:year;min-width:0;text-align:center;font-size:14.5px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
#gamesSection .g-year.is-missing{color:var(--ink-3);font-weight:400}
#gamesSection .g-rating{grid-area:rating;min-width:0}
#gamesSection .g-score small{direction:rtl;font-size:10.5px}
#gamesSection .g-ratings{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;margin-top:6px;max-width:196px;text-align:center}
#gamesSection .g-plat{grid-area:plat;min-width:0}
#gamesSection .g-pchips{display:flex;flex-wrap:wrap;gap:4px}
#gamesSection .g-pchip,#gameDetailsPanel .g-pchip{display:inline-grid;place-items:center;width:28px;height:28px;border:0;border-radius:6px;background:transparent}
#gamesSection .g-pchip-text,#gameDetailsPanel .g-pchip-text{width:auto;height:auto;min-height:28px;max-width:100%;padding:2px 4px;text-align:center}
#gamesSection .g-pchip[hidden]{display:none}
#gamesSection a.g-pchip,#gameDetailsPanel a.g-pchip{color:inherit;text-decoration:none}
#gamesSection a.g-pchip:hover,#gameDetailsPanel a.g-pchip:hover{outline:1px solid var(--ink-3)}
#gamesSection a.g-pchip:focus-visible,#gameDetailsPanel a.g-pchip:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.g-brand{display:inline-grid;place-items:center;width:28px;height:28px;flex:0 0 28px;vertical-align:middle;color:var(--ink)}
.g-brand svg{display:block;width:24px;height:24px;fill:currentColor}
.g-brand.is-unavailable{color:var(--ink-3);font-size:13px}
.g-platform-name,#gameDetailsPanel .g-platform-name{font-size:11px;line-height:1.2;overflow-wrap:anywhere}
#gamesSection .g-platforms-card .chip,#gameKeyshopPanel .g-ks-group .chip:has(>.g-brand){background:transparent;border:0}
#gamesSection .g-platforms-card .chip:has(input:checked),#gameKeyshopPanel .g-ks-group .chip:has(input:checked):has(>.g-brand){box-shadow:inset 0 0 0 1px var(--accent)}
#gamesSection .g-platforms-card .chip:has(>.g-platform-name),#gamesSection .active-pref.g-plat:has(>.g-platform-name){height:auto;min-height:28px;padding:4px 7px;max-width:100%;white-space:normal}
#gamesSection .chip:has(>.g-brand),#gameKeyshopPanel .g-ks-group .chip:has(>.g-brand){width:28px;height:28px;justify-content:center;padding:0}
#gameDetailsPanel .g-platform-date{background:transparent;border-color:transparent}
#gameDetailsPanel .g-platform-date .g-brand{display:inline-grid}
#gamesSection .g-pmore{height:22px;padding:0 7px;border:1px dashed var(--line-2);border-radius:5px;background:#fff;color:var(--accent);font:inherit;font-size:11.5px;font-weight:600;cursor:pointer}
#gamesSection .g-pmore:hover{border-color:var(--accent)}
#gamesSection .g-attribution{margin:0;padding:8px 16px 12px;border-top:1px solid var(--line);font-size:12px;color:var(--ink-3)}
#gamesSection .g-attribution[hidden]{display:none}

/* «الأسعار»: the cheapest official price per device family, in its own currency, with its discount */
#gamesSection .g-c-price{grid-area:price}
#gamesSection .g-c-steam-history,#gamesSection .g-steam-history{grid-area:history;min-width:0}
#gamesSection .g-steam-history{font-size:12px;line-height:1.4}
#gamesSection .g-steam-history-values{display:grid;align-content:center;min-height:34px}
#gamesSection .g-steam-history-values:empty{display:none}
#gamesSection .g-steam-history-price{display:flex;align-items:baseline;gap:6px}
#gamesSection .g-steam-history-direction{flex:0 0 1em;text-align:center;font-size:14px;line-height:1}
#gamesSection .g-steam-history-price .g-amt{font-weight:600}
#gamesSection .g-steam-history a{display:inline-block;margin-top:3px;color:var(--accent);text-underline-offset:2px}
#gamesSection .g-steam-history-values:empty+a{margin-top:0}
#gamesSection .g-price{grid-area:price;min-width:0}
#gamesSection .g-prices{display:grid;gap:4px}
#gamesSection .g-pr{display:flex;align-items:baseline;flex-wrap:wrap;gap:1px 6px;min-width:0;font-size:12.5px;line-height:1.35}
#gamesSection .g-pr-logos{display:inline-flex;align-items:center;gap:4px;flex:0 0 auto}
#gamesSection .g-pr-logos:empty{display:none}
#gamesSection .g-pr-val{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:2px 5px;min-width:0}
#gamesSection .g-pr-away{font-size:10.5px;color:var(--ink-3)}
#gamesSection .g-prices-status:not(:empty)::before{content:"·";margin-inline:7px;color:var(--ink-3)}
#gamesSection #gLastUpdated:empty+.g-prices-status::before{content:none}
#gamesSection .g-amt,#gameDetailsPanel .g-amt{font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
#gamesSection .g-cut,#gameDetailsPanel .g-cut{display:inline-flex;align-items:center;height:18px;padding:0 5px;border-radius:4px;background:var(--like-soft);color:var(--like);font-size:11px;font-weight:700;white-space:nowrap}
#gamesSection .g-price-failed,#gameDetailsPanel .g-price-failed{font-size:12px;color:var(--warn)}

/* Keep the download column visible while links are checked and when there are no matches. */
#gamesSection .g-c-download{grid-area:act;text-align:center}
#gamesSection .g-act{grid-area:act;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
#gamesSection .g-act .cell-label{display:none}
#gamesSection .g-dl-slot{display:grid;place-items:center;width:28px;height:28px}
#gamesSection .g-act .download-link,#gameDetailsPanel .g-dl-entry .download-link,#gameDownloadsPanel .magnet-open{width:28px;height:28px;padding:0}
#gamesSection .g-ks-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink-2);cursor:pointer}
#gamesSection .g-ks-btn svg{width:17px;height:17px}
#gamesSection .g-ks-btn:hover{border-color:var(--accent);color:var(--accent)}
#gamesSection .g-ks-btn:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#gameDetailsPanel .g-ks-entry,#gameDetailsPanel .g-dl-entry{display:inline-flex;margin-top:12px;margin-inline-end:8px;vertical-align:top}
#gameDetailsPanel .g-dl-entry[data-state="empty"]{display:none}
#gameDetailsPanel .g-ks-open-btn{height:34px;font-size:13px}
#gameDetailsPanel .g-ks-open-btn svg{width:16px;height:16px;flex:0 0 auto}
#gameKeyshopPanel .g-ks-filters{display:grid;gap:8px;margin-bottom:12px}
#gameKeyshopPanel .g-ks-group,#gameDownloadsPanel .g-ks-group{min-width:0;margin:0;padding:0;border:0}
#gameKeyshopPanel .g-ks-group legend,#gameDownloadsPanel .g-ks-group legend{margin-bottom:4px;padding:0;font-size:12px;font-weight:600;color:var(--ink-3)}
#gameKeyshopPanel .g-ks-group .checks,#gameDownloadsPanel .g-ks-group .checks{display:flex;flex-wrap:wrap;gap:6px}
#gameKeyshopPanel .g-ks-group .chip,#gameDownloadsPanel .g-ks-group .chip{height:30px;padding:0 11px;font-size:12.5px}
#gameKeyshopPanel .g-ks-when{margin:0 0 6px;font-size:12px;color:var(--ink-3);font-variant-numeric:tabular-nums}
#gameKeyshopPanel .g-ks-when:empty{display:none}
#gameKeyshopPanel .g-ks-table{width:100%;border-collapse:collapse;font-size:13px}
#gameKeyshopPanel .g-ks-table thead th{padding:0 8px 6px;border-bottom:1px solid var(--line);font-size:12px;font-weight:600;color:var(--ink-3);text-align:start}
#gameKeyshopPanel .g-ks-table tbody tr+tr{border-top:1px solid var(--line)}
#gameKeyshopPanel .g-ks-table tbody th,#gameKeyshopPanel .g-ks-table td{padding:9px 8px;text-align:start;vertical-align:middle}
#gameKeyshopPanel .g-ks-merchant{display:block;font-weight:600;color:var(--ink);overflow-wrap:anywhere;text-align:right}
#gameKeyshopPanel .g-ks-sub{display:block;margin-top:2px;font-size:11.5px;font-weight:500;color:var(--ink-3);overflow-wrap:anywhere;text-align:right}
#gameKeyshopPanel .g-ks-where span{display:block;color:var(--ink-2);overflow-wrap:anywhere;text-align:right}
#gameKeyshopPanel .g-amt{font-size:13.5px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
#gameKeyshopPanel .g-reg{color:var(--ink-3)}
#gameKeyshopPanel .g-reg .g-amt{font-size:12.5px;font-weight:500;color:var(--ink-3)}
#gameKeyshopPanel .g-ks-sar{display:block;margin-top:2px;font-size:11.5px;color:var(--ink-2)}
#gameKeyshopPanel .g-cut{display:inline-flex;align-items:center;height:18px;padding:0 5px;border-radius:4px;background:var(--like-soft);color:var(--like);font-size:11px;font-weight:700;white-space:nowrap}
#gameKeyshopPanel .g-ks-codebox{display:inline-flex;align-items:center;flex-wrap:wrap;gap:4px 6px;max-width:100%}
#gameKeyshopPanel .g-ks-codev{min-width:0;max-width:100%;overflow-wrap:anywhere;padding:2px 6px;border:1px dashed var(--line-2);border-radius:5px;background:var(--surface-2);color:var(--ink);font:600 12.5px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;user-select:all}
#gameKeyshopPanel .g-ks-copy,#gameDownloadsPanel .g-ks-copy{height:26px;padding:0 9px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink-2);font:inherit;font-size:12px;font-weight:600;cursor:pointer}
#gameKeyshopPanel .g-ks-copy:hover,#gameDownloadsPanel .g-ks-copy:hover{border-color:var(--accent);color:var(--accent)}
#gameKeyshopPanel .g-ks-copy.is-done,#gameDownloadsPanel .g-ks-copy.is-done{border-color:var(--like);background:var(--like-soft);color:var(--like)}
#gameKeyshopPanel .g-ks-copy.is-failed,#gameDownloadsPanel .g-ks-copy.is-failed{border-color:var(--danger);color:var(--danger)}
#gameKeyshopPanel .g-ks-copy-field,#gameDownloadsPanel .g-ks-copy-field{position:fixed;top:0;left:-9999px;width:1px;height:1px;opacity:0}
#gameKeyshopPanel .g-ks-open{width:1%;text-align:end;white-space:nowrap}
#gameKeyshopPanel .g-store-open{display:inline-flex;align-items:center;height:30px;padding:0 12px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;color:var(--ink);font-size:12.5px;font-weight:600;text-decoration:none}
#gameKeyshopPanel .g-store-open:hover{border-color:var(--accent);color:var(--accent)}
#gameKeyshopPanel .g-store-open:focus-visible,#gameKeyshopPanel .g-ks-copy:focus-visible,#gameDownloadsPanel .g-ks-copy:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#gameKeyshopPanel .g-ks-state,#gameDownloadsPanel .g-ks-state{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:10px;padding:36px 16px;color:var(--danger);font-size:14px}
/* The release cards, download buttons and pager use the film modal styles. */
#gameDownloadsPanel .g-dl-sorts{margin-bottom:12px}
#gameDownloadsPanel .torrent-open,#gameDownloadsPanel .g-ks-copy{height:28px}
#gameDownloadsPanel .g-dl-partial{margin-bottom:12px}

/* Details window */
#gameDetailsPanel .g-overview{white-space:pre-line;text-align:start}
#gameDetailsPanel .g-rtiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:6px}
#gameDetailsPanel .g-rtile{min-width:0;background:var(--surface-2);border:1px solid var(--line);border-radius:8px;padding:6px 10px}
#gameDetailsPanel .g-rtile span{display:block;font-size:11.5px;color:var(--ink-3)}
#gameDetailsPanel .g-rtile strong{display:block;font-size:18px;font-weight:700;line-height:1.35;color:var(--ink);font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#gameDetailsPanel .g-rtile small{display:block;font-size:11.5px;color:var(--ink-2)}
#gameDetailsPanel .g-rtile.is-main{background:var(--gold);border-color:var(--gold)}
#gameDetailsPanel .g-rtile.is-main span,#gameDetailsPanel .g-rtile.is-main small,#gameDetailsPanel .g-rtile.is-main strong{color:var(--gold-ink)}
#gameDetailsPanel .cast-character{direction:ltr}

/* «روابط الشراء»: a table by device family and store, with the official price, its discount and «فتح» */
#gameDetailsPanel .g-buy-title{display:flex;align-items:center;gap:10px}
#gameDetailsPanel .g-buy-when{margin-inline-start:auto;font-size:12px;font-weight:500;color:var(--ink-3);font-variant-numeric:tabular-nums}
#gameDetailsPanel .g-buy-edit{flex:0 0 auto;height:28px;padding:0 10px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink-2);font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
#gameDetailsPanel .g-buy-when:empty+.g-buy-edit{margin-inline-start:auto}
#gameDetailsPanel .g-buy-edit:hover{border-color:var(--accent);color:var(--accent)}
#gameDetailsPanel .g-buy-table{width:100%;border-collapse:collapse;font-size:13px}
#gameDetailsPanel .g-buy-table thead th{padding:0 8px 6px;font-size:12px;font-weight:600;color:var(--ink-3);text-align:start}
#gameDetailsPanel .g-buy-table tbody tr+tr,#gameDetailsPanel .g-buy-table tbody+tbody{border-top:1px solid var(--line)}
#gameDetailsPanel .g-buy-table tbody th,#gameDetailsPanel .g-buy-table td{padding:7px 8px;text-align:start;vertical-align:middle}
#gameDetailsPanel .g-buy-table tbody th{font-weight:600;color:var(--ink)}
#gameDetailsPanel .g-bt-price .g-amt{font-size:13.5px}
#gameDetailsPanel .g-reg{color:var(--ink-3)}
#gameDetailsPanel .g-reg .g-amt{font-weight:500;color:var(--ink-3)}
#gameDetailsPanel .g-end{display:block;margin-top:3px;font-size:11.5px;color:var(--ink-2);white-space:nowrap}
#gameDetailsPanel .g-bt-open{width:1%;text-align:end;white-space:nowrap}
#gameDetailsPanel .g-store-open{display:inline-flex;align-items:center;height:30px;padding:0 12px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;color:var(--ink);font-size:12.5px;font-weight:600;text-decoration:none}
#gameDetailsPanel .g-store-open:hover{border-color:var(--accent);color:var(--accent)}
#gameDetailsPanel .g-store-open:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#gameDetailsPanel .g-store-name{display:inline-flex;align-items:center;gap:5px;margin-inline-end:6px;vertical-align:middle}
#gameDetailsPanel .g-store-kind{display:inline-flex;margin-inline-end:6px;color:var(--ink-3);vertical-align:middle}
#gameDetailsPanel .g-store-kind svg{width:13px;height:13px}
#gameDetailsPanel .g-store-region{font-size:11px;font-weight:600;color:var(--ink-3);white-space:nowrap}
#gameDetailsPanel .g-buy-empty{margin:0;font-size:13px;color:var(--ink-3)}

/* Manual buy links of a game */
#gameLinksPanel .g-links-list{display:grid;gap:10px}
#gameLinksPanel .g-link-row{display:grid;grid-template-columns:150px minmax(0,1fr);align-items:center;gap:8px;font-size:13.5px;font-weight:600;color:var(--ink)}
#gameLinksPanel input{width:100%;height:38px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;padding:0 10px;font-size:13px;color:var(--ink);text-align:left}
#gameLinksPanel input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#gameLinksPanel input[aria-invalid="true"]{border-color:var(--danger);box-shadow:0 0 0 3px var(--danger-soft)}

/* «متاجر الألعاب»: the placeholder chips stay at the top while the rows scroll */
#gameStoresPanel .g-tokens{position:sticky;top:-16px;z-index:2;display:flex;flex-wrap:wrap;gap:4px;margin:-16px 0 12px;padding:16px 0 10px;border-bottom:1px solid var(--line);background:var(--surface)}
#gameStoresPanel .g-token{height:26px;padding:0 7px;border:1px solid var(--line);border-radius:6px;background:var(--surface-2);color:var(--ink-2);font:12px/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;cursor:pointer}
#gameStoresPanel .g-token:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
#gameStoresPanel .g-token:disabled{opacity:.45;cursor:default}
#gameStoresPanel .g-store-opts{margin:0 0 12px}
#gameStoresPanel .g-check{margin:0 0 12px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius);background:#fff}
#gameStoresPanel .g-check[hidden]{display:none}
#gameStoresPanel .g-check-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:6px 18px;margin:0;padding:0;list-style:none}
#gameStoresPanel .g-check-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px;min-width:0;font-size:13px}
#gameStoresPanel .g-check-name{min-width:0;font-weight:600;color:var(--ink)}
#gameStoresPanel .g-store-list{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
#gameStoresPanel .g-store-row{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius);background:#fff}
#gameStoresPanel .g-store-row.is-off{background:var(--surface-2)}
#gameStoresPanel .g-store-row.is-off .g-store-label{color:var(--ink-3)}
#gameStoresPanel .g-store-row.is-invalid{border-color:var(--danger);box-shadow:0 0 0 3px var(--danger-soft)}
#gameStoresPanel .g-store-head{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
#gameStoresPanel .g-store-on{flex:0 0 auto;width:18px;height:18px;margin:0;accent-color:var(--accent);cursor:pointer}
#gameStoresPanel .g-store-label{flex:1 1 180px;min-width:0;height:36px;padding:0 10px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;font:inherit;font-size:14px;font-weight:600;color:var(--ink)}
#gameStoresPanel select{height:36px;padding:0 8px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;font:inherit;font-size:13px;color:var(--ink)}
#gameStoresPanel .g-store-tools{display:inline-flex;gap:4px;margin-inline-start:auto}
#gameStoresPanel .g-icon-btn{min-width:32px;height:32px;padding:0 8px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--ink-2);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
#gameStoresPanel .g-icon-btn:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
#gameStoresPanel .g-icon-btn.danger:hover:not(:disabled){border-color:var(--danger);color:var(--danger)}
#gameStoresPanel .g-icon-btn:disabled{opacity:.4;cursor:default}
#gameStoresPanel .g-store-fams{display:flex;flex-wrap:wrap;gap:6px}
#gameStoresPanel .g-store-fams .chip{height:28px;padding:0 10px;font-size:12.5px}
#gameStoresPanel .g-store-urls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#gameStoresPanel .g-store-url{display:grid;gap:3px;min-width:0}
#gameStoresPanel .g-store-url span{font-size:12px;font-weight:600;color:var(--ink-3)}
#gameStoresPanel .g-store-url input{width:100%;height:36px;padding:0 10px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;font:12.5px ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--ink);text-align:left}
#gameStoresPanel input:focus,#gameStoresPanel select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#gameStoresPanel .g-store-on:focus-visible{outline:2px solid var(--accent);outline-offset:2px;box-shadow:none}
#gameStoresPanel .g-store-verify{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px}
#gameStoresPanel .g-store-verify .source-verify{height:32px;padding:0 12px}
#gameStoresPanel .source-check-status{overflow-wrap:anywhere}

/* «منطقة الأسعار» */
#gameRegionPanel .g-region-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 14px}
#gameRegionPanel .g-field{display:grid;gap:5px;min-width:0;font-size:13px;font-weight:600;color:var(--ink-2)}
#gameRegionPanel select{width:100%;height:40px;padding:0 10px;border:1px solid var(--line-2);border-radius:var(--radius-sm);background:#fff;font:inherit;font-size:14px;color:var(--ink)}
#gameRegionPanel select:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}

/* Tablet: keep the price history next to the prices as the header folds into each game. */
@media(max-width:1190px){
    #gamesSection .g-columns{display:none}
    #gamesSection .g-row{grid-template-columns:24px 54px minmax(0,1fr) 64px 140px 146px 54px;grid-template-areas:"rank cover main year rating rating rating" "rank cover plat plat price history act";row-gap:10px}
    #gamesSection .g-pgroups{grid-template-columns:minmax(0,1fr)}
    #gamesSection .g-act{align-self:start}
    #gamesSection .g-act .cell-label{display:block}
    #gamesSection .g-steam-history .cell-label{position:static;display:block;width:auto;height:auto;margin:0 0 2px;clip:auto;white-space:normal}
}
/* Phone: the extra filters fold behind «تصفية» (the platforms stay at hand), the rows stack */
@media(max-width:600px){
    #gamesSection .g-band{padding:10px;border-radius:10px}
    #gamesSection .g-filter-row{gap:6px}
    #gamesSection .g-platforms-toggle{flex:1 1 auto;justify-content:center}
    #gamesSection .g-filter-extra{display:none}
    #gamesSection .g-band.filters-open .g-filter-extra{display:flex;flex-wrap:wrap;gap:6px;flex-basis:100%}
    #gamesSection .g-band:not(.filters-open) #gPrefsPanel{display:none}
    /* The ratings take the full width under the cover, so the badge and its three cells stay on one line. */
    #gamesSection .g-row{grid-template-columns:56px minmax(0,1fr) auto;grid-template-areas:"cover main year" "rating rating rating" "plat plat plat" "price price act" "history history act";gap:8px 12px;padding:12px}
    #gamesSection .g-steam-history{max-width:185px}
    #gamesSection .g-prices{grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:4px 12px}
    #gamesSection .g-rank{display:none}
    #gamesSection .g-cover,#gamesSection .g-year{align-self:start}
    #gamesSection .g-year{padding-top:1px}
    #gamesSection .g-rating{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
    #gamesSection .g-ratings{flex:1 1 150px;margin-top:0;max-width:260px}
    /* The game windows: labels above their fields, one column; each store of the prices table on two lines */
    #gameDetailsPanel .g-buy-table thead{display:none}
    #gameDetailsPanel .g-buy-table,#gameDetailsPanel .g-buy-table tbody{display:block}
    #gameDetailsPanel .g-buy-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"store open" "price open" "cut open";column-gap:10px;padding:7px 0}
    #gameDetailsPanel .g-buy-table tbody th{grid-area:store;padding:0}
    #gameDetailsPanel .g-buy-table td{padding:0}
    #gameDetailsPanel .g-bt-price{grid-area:price;padding-top:3px}
    #gameDetailsPanel .g-bt-cut{grid-area:cut;padding-top:3px}
    #gameDetailsPanel .g-bt-cut:empty{display:none}
    #gameDetailsPanel .g-bt-open{grid-area:open;align-self:center;width:auto}
    #gameKeyshopPanel .g-ks-table thead{display:none}
    #gameKeyshopPanel .g-ks-table,#gameKeyshopPanel .g-ks-table tbody{display:block}
    #gameKeyshopPanel .g-ks-table tbody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"store price" "where price" "code open";gap:4px 10px;padding:10px 0}
    #gameKeyshopPanel .g-ks-table tbody th,#gameKeyshopPanel .g-ks-table td{padding:0}
    #gameKeyshopPanel .g-ks-table tbody th{grid-area:store}
    #gameKeyshopPanel .g-ks-where{grid-area:where}
    #gameKeyshopPanel .g-ks-price{grid-area:price;text-align:end}
    #gameKeyshopPanel .g-ks-code{grid-area:code;align-self:center;min-width:0}
    #gameKeyshopPanel .g-ks-open{grid-area:open;align-self:center;width:auto}
    #gameLinksPanel .g-link-row{grid-template-columns:minmax(0,1fr);gap:4px}
    #gameStoresPanel .g-tokens{top:-14px;margin-top:-14px;padding-top:14px;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain}
    #gameStoresPanel .g-token{flex:0 0 auto}
    #gameStoresPanel .g-store-urls,#gameRegionPanel .g-region-fields{grid-template-columns:minmax(0,1fr)}
    #gameStoresPanel .g-store-tools{margin-inline-start:0}
}
