/* gamingbroject.com rebuild FG2: Free Games wall, form A (fg-wall.css). Loaded when the body has "gbfg".
 * Cascade like the calendar (cal-b.css): everything in @layer s145; colours, borders, shadows, radii and heading fonts
 * carry !important so they beat gbl, gbu, the unlayered theme and Day mode's catch-all. Every rule is scoped by .gbfg
 * or .gbfg-main; nothing here touches the header, footer or banner. Palette = calendar B tokens (dark + Day). */

@layer s145 {

	.gbfg {
		--fg-display: "GB Barlow Condensed", "Barlow Condensed", "Inter", system-ui, sans-serif;
		--fg-text: var(--font-sans, "Inter", "Inter Fallback", system-ui, sans-serif);
		--fg-bg: #0c0712;
		--fg-card: #171020;
		--fg-card-2: #261d31;
		--fg-well: #08050c;
		--fg-ink: #f7f5fb;
		--fg-ink-2: #c9c3d1;
		--fg-ink-3: #9a93a5;
		--fg-line: rgba(255, 255, 255, .1);
		--fg-line-2: rgba(255, 255, 255, .18);
		--fg-red: #df1a3e;
		--fg-red-2: #c8163a;
		--fg-red-text: #ff5c78;
		--fg-red-line: rgba(255, 41, 72, .55);
		--fg-green: #35c46a;
		--fg-green-text: #7be29a;
		--fg-sh: inset 0 1px 0 rgba(255, 255, 255, .06), 0 1px 1px rgba(0, 0, 0, .55), 0 3px 8px -2px rgba(0, 0, 0, .5);
		--fg-sh-2: inset 0 1px 0 rgba(255, 255, 255, .09), 0 2px 3px rgba(0, 0, 0, .5), 0 10px 18px -6px rgba(0, 0, 0, .7);
		--fg-ease: var(--s145-ease, cubic-bezier(.23, 1, .32, 1));
	}
	:root[data-gb-theme="light"] .gbfg {
		--fg-bg: #ffffff;
		--fg-card: #ffffff;
		--fg-card-2: #ffffff;
		--fg-well: #eeebf3;
		--fg-ink: #15121b;
		--fg-ink-2: #4f4958;
		--fg-ink-3: #6a6474;
		--fg-line: rgba(21, 18, 27, .1);
		--fg-line-2: rgba(21, 18, 27, .18);
		--fg-red: #d1123a;
		--fg-red-2: #b80d32;
		--fg-red-text: #b80d32;
		--fg-red-line: rgba(209, 18, 58, .45);
		--fg-green: #1f9a4d;
		--fg-green-text: #157a3b;
		--fg-sh: 0 0 0 1px rgba(21, 18, 27, .08), 0 1px 2px rgba(21, 18, 27, .07), 0 3px 8px -3px rgba(21, 18, 27, .12);
		--fg-sh-2: 0 0 0 1px rgba(21, 18, 27, .08), 0 2px 4px rgba(21, 18, 27, .08), 0 12px 22px -10px rgba(21, 18, 27, .24);
	}

	.gbfg-main { display: block; }
	/* only the wall's own box: the BODY also carries the class gbfg (it selects this CSS), and a width on the body squeezed the
	 * whole page on big screens (4K report 11/11). */
	:where(div, section).gbfg {
		max-width: 1180px;
		margin: 0 auto;
		padding: 20px 16px 48px;
		font-family: var(--fg-text) !important;
		color: var(--fg-ink) !important;
		box-sizing: border-box;
	}
	.gbfg *, .gbfg *::before, .gbfg *::after { box-sizing: border-box; }
	/* Day mode: the wall carries its own white sheet so it never depends on the page behind it */
	:root[data-gb-theme="light"] .gbfg { background: var(--fg-bg) !important; border-radius: 16px !important; }

	/* head */
	.gbfg-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin: 0 0 8px; }
	.gbfg-kicker {
		margin: 0 0 6px;
		font: 600 12px/1.2 var(--fg-text) !important;
		letter-spacing: .14em;
		text-transform: uppercase;
		color: var(--fg-red-text) !important;
	}
	.gbfg .gbfg-h1 {
		margin: 0;
		font-family: var(--fg-display) !important;
		font-weight: 700 !important;
		font-size: clamp(34px, 5vw, 52px) !important;
		line-height: 1 !important;
		letter-spacing: .01em;
		text-transform: uppercase;
		color: var(--fg-ink) !important;
	}
	.gbfg-sub { margin: 8px 0 0; font-size: 14px; color: var(--fg-ink-3) !important; }
	.gbfg-sub b { color: var(--fg-ink) !important; font-weight: 700; }
	.gbfg-ok {
		display: inline-flex; align-items: center; gap: 8px; margin: 0;
		font-weight: 600; font-size: 13px; color: var(--fg-green-text) !important;
	}
	.gbfg-ok i { width: 8px; height: 8px; border-radius: 50% !important; background: var(--fg-green) !important; display: inline-block; }
	.gbfg-intro { max-width: 760px; margin: 10px 0 18px; font-size: 15px; line-height: 1.55; color: var(--fg-ink-2) !important; }

	/* chips */
	.gbfg-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 0 14px; scrollbar-width: none; }
	.gbfg-chips::-webkit-scrollbar { display: none; }
	.gbfg .gbfg-chip {
		flex: none;
		min-height: 40px;
		padding: 8px 14px;
		border: 1px solid var(--fg-line-2) !important;
		border-radius: 999px !important;
		background: var(--fg-card) !important;
		color: var(--fg-ink) !important;
		font: 600 14px/1 var(--fg-text) !important;
		cursor: pointer;
		box-shadow: none !important;
		transition: background-color 120ms var(--fg-ease), color 120ms var(--fg-ease);
	}
	.gbfg .gbfg-chip span { color: var(--fg-ink-3) !important; font-weight: 600; margin-left: 2px; }
	.gbfg .gbfg-chip[aria-pressed="true"] { background: var(--fg-ink) !important; color: var(--fg-bg) !important; border-color: var(--fg-ink) !important; }
	.gbfg .gbfg-chip[aria-pressed="true"] span { color: var(--fg-bg) !important; opacity: .7; }
	.gbfg .gbfg-chip:disabled { opacity: .45; cursor: default; }
	/* categories (owner 11/11): type chips carry an icon, platform chips a brand-colour dot */
	.gbfg .gbfg-chip { display: inline-flex; align-items: center; gap: 7px; }
	.gbfg .gbfg-ci { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
	.gbfg .gbfg-chip.is-type { min-height: 44px; padding: 9px 16px; font-size: 15px !important; }
	.gbfg .gbfg-c-keep .gbfg-ci { color: #ff5c78; }
	.gbfg .gbfg-c-sub .gbfg-ci { color: #ffd35a; }
	.gbfg .gbfg-c-try .gbfg-ci { color: #5ee6a8; }
	.gbfg .gbfg-chip[aria-pressed="true"] .gbfg-ci { color: currentColor; }
	.gbfg .gbfg-dot { width: 9px; height: 9px; flex: none; border-radius: 50% !important; background: #9a93a5 !important; display: inline-block; }
	.gbfg .gbfg-c-ps5 .gbfg-dot { background: #2f7bf5 !important; }
	.gbfg .gbfg-c-xbox .gbfg-dot { background: #16c60c !important; }
	.gbfg .gbfg-c-switch .gbfg-dot { background: #ff3b3b !important; }
	.gbfg .gbfg-c-steam .gbfg-dot { background: #66c0f4 !important; }
	.gbfg .gbfg-c-epic .gbfg-dot { background: #e8e6ee !important; box-shadow: inset 0 0 0 1px #555 !important; }
	.gbfg .gbfg-c-pc .gbfg-dot { background: #b8b2c4 !important; }
	.gbfg-chip-sep { flex: none; width: 1px; align-self: stretch; margin: 6px 4px; background: var(--fg-line-2) !important; }
	html:not(.gbfg-js) .gbfg-chips { display: none; }

	/* section headings */
	.gbfg .gbfg-h2 {
		margin: 26px 0 12px;
		font-family: var(--fg-display) !important;
		font-weight: 700 !important;
		font-size: 28px !important;
		line-height: 1.05 !important;
		letter-spacing: .02em;
		text-transform: uppercase;
		color: var(--fg-ink) !important;
	}

	/* ending soon */
	.gbfg-soon {
		margin: 4px 0 8px;
		padding: 12px 14px 14px;
		border: 1px solid var(--fg-red-line) !important;
		border-radius: 14px !important;
		background: var(--fg-well) !important;
	}
	.gbfg-all + .gbfg-soon { margin-top: 26px; }
	.gbfg-soon.is-few { width: fit-content; max-width: 100%; }   /* few cards: the box hugs them */
	.gbfg-soon.is-few .gbfg-row { overflow-x: visible; }
	.gbfg .gbfg-h2-soon { margin: 2px 0 12px; font-size: 24px !important; color: var(--fg-red-text) !important; }
	.gbfg-row { position: relative; display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; }
	.gbfg-row .gbfg-card { flex: none; width: 168px; scroll-snap-align: start; }

	/* grid */
	.gbfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }

	/* card */
	.gbfg-card {
		position: relative; /* keeps the visually hidden button text inside a scrolling row (FG5) */
		display: flex; flex-direction: column; overflow: hidden; min-width: 0;
		background: var(--fg-card) !important;
		border: 1px solid transparent !important;
		border-radius: 12px !important;
		box-shadow: var(--fg-sh) !important;
	}
	.gbfg-card[hidden] { display: none; }
	.gbfg-art { position: relative; aspect-ratio: 2 / 3; background: var(--fg-well) !important; overflow: hidden; }
	.gbfg .gbfg-img { position: absolute; inset: 0; width: 100% !important; max-width: none !important; height: 100% !important; object-fit: cover; display: block; border-radius: 0 !important; }
	.gbfg-badge, .gbfg-store {
		position: absolute; top: 8px;
		padding: 5px 7px;
		border-radius: 5px !important;
		font: 800 10px/1 var(--fg-text) !important;
		letter-spacing: .1em;
	}
	.gbfg-badge { left: 8px; background: var(--fg-red) !important; color: #fff !important; }
	.gbfg-store { right: 8px; background: rgba(0, 0, 0, .7) !important; color: #fff !important; }
	.gbfg-meta { display: grid; gap: 8px; padding: 10px; flex: 1; align-content: start; }
	.gbfg .gbfg-t {
		margin: 0;
		font: 700 15px/1.25 var(--fg-text) !important;
		color: var(--fg-ink) !important;
		display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	}
	.gbfg-when { margin: 0; font-size: 12.5px; color: var(--fg-ink-3) !important; }
	.gbfg-when b { color: var(--fg-ink) !important; font-weight: 700; font-variant-numeric: tabular-nums; }
	.gbfg-soon .gbfg-when b { color: var(--fg-red-text) !important; }
	.gbfg .gbfg-btn {
		display: flex; align-items: center; justify-content: center;
		min-height: 40px; margin-top: auto; padding: 9px 10px;
		border-radius: 8px !important;
		background: var(--fg-red) !important;
		color: #fff !important;
		font: 700 17px/1 var(--fg-display) !important;
		letter-spacing: .06em;
		text-transform: uppercase;
		text-decoration: none !important;
		text-align: center;
		transition: background-color 120ms var(--fg-ease);
	}
	.gbfg-vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
	@media (hover: hover) and (pointer: fine) {
		.gbfg .gbfg-btn:hover { background: var(--fg-red-2) !important; }
		.gbfg .gbfg-chip:not(:disabled):not([aria-pressed="true"]):hover { background: var(--fg-card-2) !important; }
		.gbfg-card { transition: box-shadow 160ms var(--fg-ease); }
		.gbfg-card:hover { box-shadow: var(--fg-sh-2) !important; }
	}
	.gbfg .gbfg-btn:active { transform: translateY(1px); }

	/* empty, answers, ended, credit */
	.gbfg-empty { margin: 8px 0; padding: 18px; border: 1px dashed var(--fg-line-2) !important; border-radius: 12px !important; color: var(--fg-ink-2) !important; }
	.gbfg-qa { max-width: 820px; }
	.gbfg .gbfg-q { margin: 16px 0 4px; font: 700 16px/1.3 var(--fg-text) !important; color: var(--fg-ink) !important; }
	.gbfg-a { margin: 0; font-size: 15px; line-height: 1.55; color: var(--fg-ink-2) !important; }
	.gbfg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
	.gbfg-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid var(--fg-line) !important; }
	.gbfg-lt { font-weight: 600; color: var(--fg-ink-2) !important; }
	.gbfg-lm { font-size: 13px; color: var(--fg-ink-3) !important; }
	.gbfg-credit { margin: 28px 0 0; font-size: 12.5px; color: var(--fg-ink-3) !important; }

	/* phone: 2 columns */
	@media (max-width: 560px) {
		:where(div, section).gbfg { padding: 14px 16px 40px; }
		.gbfg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
		.gbfg-row .gbfg-card { width: 44vw; max-width: 170px; }
		.gbfg .gbfg-h2 { font-size: 24px !important; }
		.gbfg .gbfg-t { font-size: 14px !important; }
	}

	/* big screens (owner 11/11: «a second row for no reason» with empty space left and right): up to 9 posters in a row */
	@media (min-width: 1500px) {
		div.gbfg { max-width: 1720px; }
	}

	@media (prefers-reduced-motion: reduce) {
		.gbfg *, .gbfg *::before, .gbfg *::after { transition: none !important; }
		.gbfg .gbfg-btn:active { transform: none; }
	}

	/* FG5: the "Free right now" strip on the home (body.gbfg-home, section#gbFreeNow) */
	.gbfg.gbfg-strip { padding: 28px 16px 12px; width: 100%; max-width: min(1180px, 100vw); min-width: 0; overflow: hidden; contain: inline-size; }
	.gbfg-strip .gbfg-row { min-width: 0; max-width: 100%; }
	.gbfg-strip-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
	.gbfg-strip .gbfg-kicker { margin: 0 0 4px; }
	.gbfg-strip .gbfg-h2 { margin: 0 !important; }
	.gbfg .gbfg-strip-all {
		flex: none; padding: 9px 14px; border-radius: 999px !important;
		border: 1px solid var(--fg-line-2) !important; background: var(--fg-card) !important;
		color: var(--fg-ink) !important; font: 600 14px/1 var(--fg-text) !important; text-decoration: none !important; white-space: nowrap;
	}
	.gbfg-strip .gbfg-row .gbfg-card { width: 172px; }
	.gbfg-strip.is-lite .gbfg-row .gbfg-card { width: 44vw; max-width: 172px; }
	@media (hover: hover) and (pointer: fine) {
		.gbfg .gbfg-strip-all:hover { background: var(--fg-card-2) !important; }
	}
	@media (max-width: 560px) {
		.gbfg-strip-head { align-items: center; }
		.gbfg .gbfg-strip-all { padding: 8px 12px; font-size: 13px !important; }
	}
}
