/* Listing Manager — homepage (templates/front-page.php). Loads after tiles.css, front page only.
   Colours come from the tokens in global.css, so dark and light both follow. The slide and promo
   text sits on a fixed dark overlay and is white in either theme. */

/* ------------------------------------------------------------------
 * Carousel
 * ------------------------------------------------------------------ */

.lm-carousel-section {
	padding-top: 20px;
}

.lm-carousel {
	position: relative;
}

.lm-carousel-track {
	position: relative;
	display: flex;
	gap: 16px;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	border-radius: 14px;
}

.lm-carousel-track::-webkit-scrollbar {
	display: none;
}

.lm-slide {
	position: relative;
	flex: 0 0 66%;
	height: 280px;
	overflow: hidden;
	isolation: isolate;
	scroll-snap-align: start;
	background: #082032;
	border-radius: 14px;
	color: #fff;
	text-decoration: none;
}

.lm-slide:hover,
.lm-slide:focus {
	color: #fff;
}

/* The track clips anything outside it, so the focus ring goes inside the slide. */
.lm-slide:focus-visible {
	outline-offset: -4px;
}

.lm-slide .lm-banner {
	position: absolute;
	inset: 0;
	z-index: -2;
	aspect-ratio: auto;
}

/* A listing with no screenshot gets the plain panel: its icon is already in the copy row. */
.lm-slide .lm-banner.is-icon img {
	display: none;
}

.lm-slide::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient( 0deg, rgba( 3, 19, 32, 0.93 ) 0%, rgba( 3, 19, 32, 0.6 ) 45%, rgba( 3, 19, 32, 0 ) 85% );
}

.lm-slide-copy {
	position: absolute;
	right: 24px;
	bottom: 22px;
	left: 24px;
	display: flex;
	align-items: center;
	gap: 14px;
}

.lm-slide-icon {
	flex: none;
	width: 56px;
	height: 56px;
	border-radius: 12px;
	object-fit: cover;
}

.lm-slide-text {
	display: block;
	min-width: 0;
}

.lm-slide-title {
	display: block;
	font-size: 26px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.lm-slide-desc {
	display: -webkit-box;
	max-width: 520px;
	margin-top: 4px;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.4;
	color: #d6e4f2;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.lm-carousel-arrow {
	position: absolute;
	top: calc( 50% - 22px );
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #fff;
	cursor: pointer;
	background: rgba( 7, 24, 39, 0.82 );
	border: 1px solid rgba( 113, 141, 162, 0.7 );
	border-radius: 50%;
}

.lm-carousel-arrow:hover:not( :disabled ) {
	background: rgba( 7, 24, 39, 0.95 );
	border-color: #fff;
}

.lm-carousel-arrow:disabled {
	cursor: default;
	opacity: 0.35;
}

.lm-carousel-arrow svg {
	width: 22px;
	height: 22px;
}

.lm-carousel-prev {
	left: 12px;
}

.lm-carousel-next {
	right: 12px;
}

/* Dots: drawn small, but each button is a 44px square. */
.lm-carousel-dots {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
}

.lm-carousel-dots button {
	position: relative;
	width: var( --lm-tap );
	height: var( --lm-tap );
	padding: 0;
	cursor: pointer;
	background: none;
	border: 0;
}

.lm-carousel-dots button::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	background: transparent;
	border: 2px solid var( --lm-muted );
	border-radius: 4px;
	transform: translate( -50%, -50% );
	transition: width 0.18s;
}

.lm-carousel-dots button[aria-current='true']::before {
	width: 22px;
	background: var( --lm-blue );
	border-color: var( --lm-blue );
}

/* ------------------------------------------------------------------
 * Quick-pick circles
 * ------------------------------------------------------------------ */

.lm-quick {
	display: flex;
	gap: 12px;
	margin: 0 -8px;
	padding: 8px;
	overflow-x: auto;
	scrollbar-width: none;
}

.lm-quick::-webkit-scrollbar {
	display: none;
}

/* Centred when they all fit, scrollable from the left when they do not. */
.lm-quick-item:first-child {
	margin-left: auto;
}

.lm-quick-item:last-child {
	margin-right: auto;
}

.lm-quick-item {
	flex: 0 0 76px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	min-height: var( --lm-tap );
	color: var( --lm-ink );
	text-decoration: none;
}

.lm-quick-item:hover {
	color: var( --lm-link );
}

.lm-quick-icon {
	display: block;
	width: 60px;
	height: 60px;
	padding: 3px;
	background: var( --lm-panel );
	border: 2px solid var( --lm-blue );
	border-radius: 50%;
}

.lm-quick-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.lm-quick-name {
	display: -webkit-box;
	overflow: hidden;
	max-width: 76px;
	font-size: 12px;
	line-height: 1.3;
	text-align: center;
	overflow-wrap: anywhere;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* ------------------------------------------------------------------
 * Games worth exploring: banner teasers
 * ------------------------------------------------------------------ */

.lm-teasers {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 16px;
}

.lm-teaser {
	display: block;
	min-width: 0;
	overflow: hidden;
	color: var( --lm-ink );
	text-decoration: none;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 12px;
}

.lm-teaser:hover {
	color: var( --lm-ink );
	border-color: var( --lm-blue );
}

.lm-teaser-body {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px;
}

.lm-teaser-body img {
	flex: none;
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 10px;
}

.lm-teaser-text {
	display: block;
	min-width: 0;
}

.lm-teaser-title {
	display: block;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.lm-teaser-desc {
	display: -webkit-box;
	margin-top: 2px;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.35;
	color: var( --lm-muted );
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* ------------------------------------------------------------------
 * Newest desktop listing
 * ------------------------------------------------------------------ */

.lm-promo {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 130px;
	overflow: hidden;
	isolation: isolate;
	background: #07172c;
	border: 1px solid #38467c;
	border-radius: 14px;
	color: #fff;
	text-decoration: none;
}

.lm-promo:hover {
	color: #fff;
	border-color: var( --lm-blue );
}

.lm-promo .lm-banner {
	position: absolute;
	inset: 0;
	z-index: -2;
	aspect-ratio: auto;
}

/* The icon is already shown beside the text; the plain-panel fallback does not repeat it. */
.lm-promo .lm-banner.is-icon img {
	display: none;
}

.lm-promo::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient( 90deg, rgba( 7, 23, 44, 0.95 ) 0%, rgba( 7, 23, 44, 0.8 ) 45%, rgba( 7, 23, 44, 0.12 ) 100% );
}

.lm-promo-copy {
	display: flex;
	align-items: center;
	gap: 20px;
	width: 100%;
	padding: 24px;
}

.lm-promo-icon {
	flex: none;
	width: 78px;
	height: 78px;
	object-fit: cover;
	border-radius: 15px;
}

.lm-promo-text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.lm-promo-kicker {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: #7fd0ff;
}

.lm-promo-title {
	font-size: 25px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
	overflow-wrap: anywhere;
}

.lm-promo-desc {
	display: -webkit-box;
	max-width: 620px;
	overflow: hidden;
	font-size: 14px;
	line-height: 1.45;
	color: #d0deec;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.lm-promo-os {
	font-size: 12px;
	color: #b4cbe2;
}

.lm-promo-go {
	flex: none;
	margin-left: auto;
	font-size: 34px;
	line-height: 1;
}

/* ------------------------------------------------------------------
 * Narrower screens
 * ------------------------------------------------------------------ */

@media ( max-width: 1050px ) {
	.lm-slide {
		height: 250px;
	}
}

@media ( max-width: 900px ) {

	.lm-teasers {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 768px ) {
	.lm-carousel-section {
		padding-top: 12px;
	}

	/* Swipe on a phone; the dots stay. */
	.lm-carousel-arrow {
		display: none;
	}

	/* 8 hit areas of 44px need 352px; overlap them by 4px so they also fit on a 360px phone. */
	.lm-carousel-dots button {
		margin: 0 -2px;
	}

	.lm-carousel-track {
		gap: 12px;
		border-radius: 10px;
	}

	.lm-slide {
		flex-basis: 90%;
		height: 176px;
		border-radius: 10px;
	}

	.lm-slide-copy {
		right: 14px;
		bottom: 14px;
		left: 14px;
		gap: 10px;
	}

	.lm-slide-icon {
		width: 44px;
		height: 44px;
		border-radius: 10px;
	}

	.lm-slide-title {
		font-size: 19px;
	}

	.lm-slide-desc {
		margin-top: 2px;
		font-size: 12px;
		-webkit-line-clamp: 1;
	}

	.lm-teasers {
		gap: 12px;
	}

	.lm-teaser-body {
		gap: 8px;
		padding: 10px;
	}

	.lm-teaser-body img {
		width: 36px;
		height: 36px;
	}

	.lm-teaser-title {
		font-size: 13px;
	}

	.lm-teaser-desc {
		font-size: 12px;
	}

	.lm-promo::after {
		background: rgba( 7, 23, 44, 0.9 );
	}

	.lm-promo-copy {
		gap: 12px;
		padding: 16px;
	}

	.lm-promo-icon {
		width: 56px;
		height: 56px;
		border-radius: 12px;
	}

	.lm-promo-title {
		font-size: 19px;
	}

	.lm-promo-go {
		font-size: 28px;
	}

}

/* ------------------------------------------------------------------
 * Launch hero (templates/parts/homepage-launch.php)
 * ------------------------------------------------------------------ */

.lm-launch {
	position: relative;
	overflow: hidden;
	isolation: isolate;
	padding: 72px 0 56px;
	text-align: center;
}

.lm-launch::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -2;
	background-image:
		linear-gradient( var( --lm-line ) 1px, transparent 1px ),
		linear-gradient( 90deg, var( --lm-line ) 1px, transparent 1px );
	background-size: 56px 56px;
	opacity: 0.55;
	-webkit-mask-image: linear-gradient( #000 30%, transparent 95% );
	mask-image: linear-gradient( #000 30%, transparent 95% );
}

.lm-launch-glow {
	position: absolute;
	inset: -20% 0 auto;
	z-index: -1;
	height: 520px;
	background:
		radial-gradient( 40% 55% at 30% 40%, rgba( 0, 157, 255, 0.35 ), transparent 70% ),
		radial-gradient( 40% 55% at 72% 35%, rgba( 124, 92, 255, 0.28 ), transparent 70% ),
		radial-gradient( 30% 40% at 50% 70%, rgba( 0, 214, 200, 0.18 ), transparent 70% );
	filter: blur( 20px );
}

.lm-launch-inner {
	position: relative;
}

.lm-launch-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 5px 14px 5px 5px;
	font-size: 13px;
	font-weight: 600;
	color: var( --lm-ink );
	text-decoration: none;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 999px;
	box-shadow: 0 2px 12px rgba( 0, 157, 255, 0.15 );
}

.lm-launch-pill:hover {
	color: var( --lm-ink );
	border-color: var( --lm-blue );
}

.lm-launch-pill-tag {
	padding: 3px 10px;
	font-size: 12px;
	color: #fff;
	background: linear-gradient( 135deg, #0870c4, #6a4cf0 );
	border-radius: 999px;
}

.lm-launch-title {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0 0.28em;
	max-width: 900px;
	margin: 22px auto 0;
	font-size: clamp( 52px, 11vw, 120px );
	font-weight: 900;
	line-height: 1;
	letter-spacing: -0.045em;
	color: var( --lm-ink );
}

.lm-launch-grad {
	color: transparent;
	background: linear-gradient( 100deg, #009dff 5%, #7c5cff 55%, #00cfc0 100% );
	-webkit-background-clip: text;
	background-clip: text;
}

.lm-launch-sub {
	max-width: 600px;
	margin: 20px auto 0;
	font-size: clamp( 16px, 2vw, 19px );
	line-height: 1.55;
	color: var( --lm-muted );
}

.lm-launch-search {
	display: flex;
	align-items: center;
	max-width: 580px;
	margin: 32px auto 0;
	padding: 6px;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 16px;
	box-shadow: 0 10px 40px -10px rgba( 0, 157, 255, 0.35 );
}

.lm-launch-search:focus-within {
	border-color: var( --lm-blue );
	box-shadow: 0 0 0 4px rgba( 0, 157, 255, 0.18 ), 0 10px 40px -10px rgba( 0, 157, 255, 0.4 );
}

.lm-launch-search-icon {
	flex: none;
	margin-left: 12px;
	color: var( --lm-muted );
}

.lm-launch-search input[type='search'] {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 12px;
	font-size: 16px;
	color: var( --lm-ink );
	background: transparent;
	border: 0;
	outline: 0;
	box-shadow: none;
}

.lm-launch-search button {
	flex: none;
	height: 44px;
	padding: 0 22px;
	font-size: 15px;
	font-weight: 700;
	color: #fff;
	cursor: pointer;
	background: linear-gradient( 135deg, #0870c4, #6a4cf0 );
	border: 0;
	border-radius: 11px;
}

.lm-launch-search button:hover {
	filter: brightness( 1.1 );
}

.lm-launch-cta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 22px;
}

.lm-launch-btn {
	display: inline-flex;
	align-items: center;
	min-height: var( --lm-tap );
	padding: 0 24px;
	font-size: 15px;
	font-weight: 700;
	color: var( --lm-ink );
	text-decoration: none;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 12px;
}

.lm-launch-btn:hover {
	color: var( --lm-ink );
	border-color: var( --lm-blue );
}

.lm-launch-btn.is-primary,
.lm-launch-btn.is-primary:hover {
	color: #fff;
	background: var( --lm-btn );
	border-color: transparent;
	box-shadow: 0 6px 20px -6px rgba( 8, 112, 196, 0.7 );
}

.lm-launch-trust {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 22px;
	margin: 22px 0 0;
	padding: 0;
	font-size: 13px;
	color: var( --lm-muted );
	list-style: none;
}

.lm-launch-trust li::before {
	content: '\2713';
	margin-right: 6px;
	font-weight: 800;
	color: var( --lm-blue );
}

.lm-launch-icons {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.lm-launch-icon {
	position: absolute;
	width: 64px;
	height: 64px;
	overflow: hidden;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 16px;
	box-shadow: 0 14px 30px -10px rgba( 16, 36, 59, 0.35 );
	animation: lm-float 7s ease-in-out infinite;
}

.lm-launch-icon img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lm-launch-icon.i0 { top: 4%;  left: 3%;  rotate: -8deg; }
.lm-launch-icon.i1 { top: 40%; left: 0;   rotate: 6deg;  animation-delay: -2s; width: 52px; height: 52px; }
.lm-launch-icon.i2 { top: 70%; left: 8%;  rotate: -5deg; animation-delay: -4s; }
.lm-launch-icon.i3 { top: 14%; left: 14%; animation-delay: -1s; width: 48px; height: 48px; }
.lm-launch-icon.i4 { top: 2%;  right: 4%; rotate: 9deg;  animation-delay: -3s; }
.lm-launch-icon.i5 { top: 38%; right: 1%; rotate: -6deg; animation-delay: -5s; width: 54px; height: 54px; }
.lm-launch-icon.i6 { top: 68%; right: 8%; rotate: 7deg;  animation-delay: -1.5s; }
.lm-launch-icon.i7 { top: 16%; right: 15%; animation-delay: -2.5s; width: 46px; height: 46px; }

@keyframes lm-float {
	50% { translate: 0 -12px; }
}

.lm-launch-stats {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	max-width: 560px;
	margin: 48px auto 0;
	padding: 18px 8px;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 16px;
}

.lm-launch-stats div + div {
	border-left: 1px solid var( --lm-line );
}

.lm-launch-stats dt {
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var( --lm-ink );
}

.lm-launch-stats dd {
	margin: 2px 0 0;
	font-size: 13px;
	color: var( --lm-muted );
}

.lm-features {
	display: grid;
	grid-template-columns: repeat( 3, 1fr );
	gap: 16px;
	padding-top: 8px;
	padding-bottom: 32px;
}

.lm-feature {
	padding: 22px;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: 16px;
}

.lm-feature-icon {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	color: #fff;
	background: linear-gradient( 135deg, #0870c4, #6a4cf0 );
	border-radius: 12px;
}

.lm-feature h2 {
	margin: 14px 0 6px;
	font-size: 17px;
	font-weight: 700;
	color: var( --lm-ink );
}

.lm-feature p {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var( --lm-muted );
}

@media ( max-width: 900px ) {
	.lm-launch-icons {
		display: none;
	}

	.lm-features {
		grid-template-columns: 1fr;
	}
}

@media ( max-width: 560px ) {
	.lm-launch {
		padding: 44px 0 36px;
	}

	.lm-launch-search button {
		padding: 0 16px;
	}

	.lm-launch-stats dt {
		font-size: 22px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.lm-launch-icon {
		animation: none;
	}
}

/* Launch hero: brand wordmark and credit */
.lm-launch-brand {
	margin-bottom: 20px;
}

.lm-launch-logo {
	display: inline-grid;
	place-items: center;
	height: 56px;
	padding: 0 22px;
	font-size: 26px;
	font-weight: 900;
	letter-spacing: 0.12em;
	text-indent: 0.12em;
	color: #fff;
	background: linear-gradient( 135deg, #0870c4, #6a4cf0 );
	border-radius: 16px;
	box-shadow: 0 10px 28px -6px rgba( 106, 76, 240, 0.65 );
}

.lm-launch-pill {
	margin-top: 4px;
}

.lm-launch-credit {
	margin: 20px 0 0;
	font-size: 13px;
	color: var( --lm-muted );
}

.lm-launch-credit strong {
	color: var( --lm-ink );
}

.lm-launch-credit a {
	text-decoration: none;
}

.lm-launch-credit a:hover strong,
.lm-launch-credit a:focus-visible strong {
	text-decoration: underline;
}

/* Launch hero: coming-soon status */
.lm-launch-pill.is-soon {
	margin: 4px 0 0;
	padding-left: 12px;
	cursor: default;
}

.lm-launch-dot {
	position: relative;
	width: 8px;
	height: 8px;
	background: #f5a623;
	border-radius: 50%;
}

.lm-launch-dot::after {
	content: '';
	position: absolute;
	inset: -4px;
	border: 2px solid #f5a623;
	border-radius: 50%;
	opacity: 0;
	animation: lm-ping 1.8s ease-out infinite;
}

@keyframes lm-ping {
	from { opacity: 0.8; transform: scale( 0.6 ); }
	to { opacity: 0; transform: scale( 1.6 ); }
}

@media ( prefers-reduced-motion: reduce ) {
	.lm-launch-dot::after {
		animation: none;
	}
}
