/*
 * Badges (platforms, stores, status): small text plates; on an image they sit at the bottom (B1-27, rules §3); max 3 then «+N», one row.
 * A store mark is the official image as it is: no filter, opacity or dark-mode change (R29).
 */
.tq-badges {
	display: flex;
	flex-wrap: nowrap;
	gap: 3px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tq-badges--media {
	position: absolute;
	inset-inline: 6px;
	inset-block-end: 6px;
	z-index: 2;
	overflow: hidden;
}

/*
 * One row always, and a label is never cut (HADES II): the card picture is a size container. A wide picture shows 3
 * badges, a middle one 2, a narrow one 1 (widths raised 15/11 for the brand glyph: > 190px 3, > 150px 2); the matching «+N» (counted by the server for each level) takes the rest.
 */
.tq-badges--media .tq-badge {
	flex: 0 0 auto;
}

.tq-badges .tq-badge--more-2,
.tq-badges .tq-badge--more-1 {
	display: none;
}

@container (max-width: 190px) {
	.tq-badges--media .tq-badge--at-3,
	.tq-badges .tq-badge--more-3 {
		display: none;
	}

	.tq-badges .tq-badge--more-2 {
		display: inline-flex;
	}
}

@container (max-width: 150px) {
	.tq-badges--media .tq-badge--at-2,
	.tq-badges .tq-badge--more-2 {
		display: none;
	}

	.tq-badges .tq-badge--more-1 {
		display: inline-flex;
	}
}

/*
 * 615-1 (Sherif 17/11): a row made only of platform logo chips (24px each) fits 3 + «+N» from 110px, 2 from 84px.
 * Same server-counted «+N» levels as above; only the widths change, and only when no badge in the row has text.
 */
@container (min-width: 110px) and (max-width: 190px) {
	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--at-3,
	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--at-2,
	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--more-3 {
		display: inline-flex;
	}

	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--more-2,
	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--more-1 {
		display: none;
	}
}

@container (min-width: 84px) and (max-width: 109.98px) {
	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--at-2,
	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--more-2 {
		display: inline-flex;
	}

	.tq-badges--media:not(:has(.tq-badge:not(.tq-badge--icon):not(.tq-badge--more))) .tq-badge--more-1 {
		display: none;
	}
}

.tq-badge {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	height: 18px;
	padding-inline: 5px;
	border-radius: var(--tq-radius-s);
	background: var(--tq-plate);
	color: var(--tq-on-plate);
	box-shadow: 0 1px 3px var(--tq-shade);
	font: 700 10px/1 var(--tq-font-meta);
	white-space: nowrap;
}

/* A platform badge on its brand colour, the brand glyph before the name (Sherif 15/11: logos with their colours, as the
   game page «متاحة على»). Colours = the tile brand tokens; no brand = the plain plate above. */
.tq-badge[class*="tq-badge--b-"] {
	gap: 3px;
	padding-inline: 4px;
	background: var(--tq-badge-c);
	color: var(--tq-on-brand, var(--awhite));
}

.tq-badge__mark {
	width: 11px;
	height: 11px;
}

.tq-badge--b-playstation { --tq-badge-c: var(--tq-brand-playstation); }
.tq-badge--b-xbox { --tq-badge-c: var(--tq-brand-xbox); }
.tq-badge--b-nintendo { --tq-badge-c: var(--tq-brand-nintendo); }
.tq-badge--b-steam { --tq-badge-c: var(--tq-brand-steam); }
.tq-badge--b-windows { --tq-badge-c: var(--tq-brand-windows); }
.tq-badge--b-apple { --tq-badge-c: var(--tq-brand-apple); }
.tq-badge--b-google_play { --tq-badge-c: var(--tq-brand-google_play); }

.tq-badges--inline .tq-badge {
	background: var(--tq-soft);
	color: var(--tq-text);
	box-shadow: none;
}

.tq-badge__link {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: inherit;
	text-decoration: none;
}

.tq-store-mark {
	display: block;
	width: auto;
	height: 12px;
}

/* A store logo chip (the official square mark alone, inside its own link) on the fixed light plate, as the offer cards' store chip (228#2). */
.tq-badge--store {
	height: auto;
	padding: 3px;
	box-shadow: inset 0 0 0 1px var(--tq-line);
}

.tq-badge--store .tq-store-mark {
	width: 20px;
	height: 20px;
}
