/**
 * Superplays — video gallery (front-end).
 *
 * Solid deep-tone (#030303) background; Montserrat throughout. The focal player
 * spans the full content width with the title / date / CTA / description stacked
 * below it (YouTube watch-page layout); the thumbnail rail is a horizontal
 * scroll strip paged by centred edge chevrons (matching the About-Products
 * games carousel).
 */

.superplays {
	--sp-bg: #030303;
	--sp-surface: #1c1b1b;
	--sp-surface-2: #20201f;
	--sp-line: #353535;
	--sp-text: #e5e2e1;
	--sp-muted: #c6c6c7;
	--sp-accent: #e60012;
	--sp-pill-bg: var(--sp-accent);
	--sp-thumb-media-center: calc( ( min( 17rem, 72vw ) * 9 / 16 ) / 2 );
	--sp-radius: 0.75rem;

	box-sizing: border-box;
	max-width: 1280px;
	margin: 0 auto;
	padding: 2.5rem 1.5rem 5rem;
	background: var(--sp-bg);
	color: var(--sp-text);
	font-family: "Montserrat", "Helvetica Neue", Arial, sans-serif;
}

.superplays *,
.superplays *::before,
.superplays *::after {
	box-sizing: border-box;
}

/* Page background — keep the whole template on the deep tone. */
.superplays-page-article {
	background: #030303;
	min-height: 60vh;
	position: relative;
	z-index: 0;
	isolation: isolate;
}

/* ---- Header ---- */
.superplays__header {
	text-align: center;
	margin-bottom: 2.25rem;
}

/* Typography matched 1:1 to the Distributors page title (.distributors-hero__title). */
.superplays__heading {
	margin: 0;
	font-family: "Montserrat-Bold", Helvetica, Arial, sans-serif;
	font-size: clamp( 2rem, 5vw, 3rem );
	line-height: 1.1;
	letter-spacing: normal;
	text-transform: none;
	color: #fff;
	text-shadow: 0 10px 28px rgba( 0, 0, 0, 0.4 );
}


/* ---- Focal stage (YouTube watch-page layout: large player, info below) ---- */
.superplays__stage {
	display: block;
	margin-bottom: 3rem;
}

/* Responsive player: never taller than the viewport. Width is capped so the
 * 16:9 height fits the visible area (theater-style), shrinking on short /
 * not-maximised windows and centred within the content column. The info column
 * shares the same width so the title/description align to the video's edges. */
.superplays__stage {
	--sp-stage-max: min( 100%, calc( ( 100vh - 13rem ) * 16 / 9 ) );
}

.superplays__player {
	min-width: 0;
	margin: 0 auto 1.25rem;
	width: 100%;
	max-width: var( --sp-stage-max );
}

/* Intrinsic 16:9 ratio — scales fluidly down to the narrowest frame. */
.superplays__ratio {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border: 1px solid var(--sp-line);
	border-radius: var(--sp-radius);
	overflow: hidden;
}

/* Fallback for browsers without aspect-ratio. */
@supports not ( aspect-ratio: 16 / 9 ) {
	.superplays__ratio::before {
		content: "";
		display: block;
		padding-top: 56.25%;
	}
}

.superplays__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.superplays__info {
	min-width: 0;
	width: 100%;
	max-width: var( --sp-stage-max );
	margin: 0 auto;
}

.superplays__title {
	margin: 0 0 0.75rem;
	font-family: "Montserrat", sans-serif;
	font-weight: 700;
	font-size: clamp( 1.4rem, 2.6vw, 2.1rem );
	line-height: 1.25;
	color: var(--sp-text);
}

/* Meta row beneath the title: upload date on the left, CTA on the right. */
.superplays__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--sp-line);
}

.superplays__date {
	margin: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--sp-accent);
}

.superplays__date[hidden] {
	display: none;
}

.superplays__desc {
	margin-top: 1rem;
	display: grid;
	gap: 1rem;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--sp-muted);
	white-space: normal;
}

.superplays__desc p {
	margin: 0 0 0.9rem;
}

.superplays__desc p:last-child {
	margin-bottom: 0;
}

.superplays__desc a {
	color: var(--sp-text);
	text-decoration: underline;
	word-break: break-word;
}

/* Admin-configurable description shares the same area, set off from the
 * YouTube description above it. */
.superplays__desc-custom:empty {
	display: none;
}

.superplays__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	margin: 0;
	padding: 0.7rem 1.5rem;
	background: var(--sp-accent);
	color: #fff;
	border: 2px solid var(--sp-accent);
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-radius: 9999px;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

/* Hover / active / focus: invert to a white pill with a red outline + red text. */
.superplays__cta:hover,
.superplays__cta:focus-visible,
.superplays__cta:active {
	background: #fff;
	color: var(--sp-accent);
	border-color: var(--sp-accent);
	outline: none;
}

.superplays__cta:active {
	transform: scale( 0.97 );
}

/* Up-right diagonal arrow (matches the YouTube channel link icon). */
.superplays__cta-icon {
	display: block;
	width: 1.45em;
	height: 1.45em;
	flex: 0 0 auto;
	stroke-width: 2.35;
}

/* ---- Thumbnail rail ---- */
.superplays__rail-section {
	position: relative;
}

/* Viewport hosts the centred edge chevrons around the native horizontal scroll
 * strip. The chevrons are copied in look/function/style from the "exA-Arcadia
 * Games" carousel on /about-products (.exa-slider__inline-nav): a transparent
 * button with a white stroked chevron icon, vertically centred at each edge. */
.superplays__rail-viewport {
	position: relative;
}

.superplays__chev {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: var(--sp-thumb-media-center);
	transform: translateY( -50% );
	width: 58px;
	height: 58px;
	padding: 0;
	border: 1px solid rgba( 255, 255, 255, 0.2 );
	border-radius: 50%;
	background: rgba( 3, 3, 3, 0.72 );
	box-shadow: 0 12px 28px rgba( 0, 0, 0, 0.38 );
	color: #fff;
	cursor: pointer;
	z-index: 4;
	pointer-events: auto;
	touch-action: manipulation;
	backdrop-filter: blur( 8px );
	-webkit-backdrop-filter: blur( 8px );
	transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.superplays__chev:hover,
.superplays__chev:focus-visible {
	outline: none;
	background: rgba( 3, 3, 3, 0.9 );
	border-color: rgba( 255, 255, 255, 0.42 );
	box-shadow: 0 14px 32px rgba( 0, 0, 0, 0.46 );
}

.superplays__chev--prev {
	left: 0.35rem;
}

.superplays__chev--next {
	right: 0.35rem;
}

.superplays__chev:disabled {
	opacity: 0.35;
	cursor: default;
}

.superplays__chev:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.superplays__chev.is-hidden {
	display: none;
}

.superplays__chev-icon {
	display: block;
	width: 38px;
	height: 38px;
	stroke-width: 2.4;
	filter: drop-shadow( 0 1px 4px rgba( 0, 0, 0, 0.55 ) );
}

.superplays__rail-label {
	margin: 0 0 1rem;
	font-family: "Space Grotesk", "Montserrat", sans-serif;
	font-size: 1rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: none;
	color: var(--sp-text);
}

/* Native horizontal scroll strip; paged by the centred edge chevrons. The
 * scrollbar is hidden (the chevrons + touch-swipe drive it) to match the
 * About-Products games carousel. */
.superplays__rail {
	display: flex;
	gap: 1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	max-width: 100%;
	padding-inline: clamp( 2.75rem, 6vw, 3.75rem );
	scroll-padding-inline: clamp( 2.75rem, 6vw, 3.75rem );
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* old Edge/IE */
}

.superplays__rail::-webkit-scrollbar {
	width: 0;
	height: 0;
	display: none;
}

.superplays__thumb {
	flex: 0 0 auto;
	width: 17rem;
	max-width: 72vw;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	text-align: left;
	cursor: pointer;
	scroll-snap-align: start;
	font-family: inherit;
}

.superplays__thumb-media {
	display: block;
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: 0.5rem;
	overflow: hidden;
	border: 2px solid transparent;
	background: #000;
	transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

@supports not ( aspect-ratio: 16 / 9 ) {
	.superplays__thumb-media::before {
		content: "";
		display: block;
		padding-top: 56.25%;
	}
}

.superplays__thumb-media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.superplays__thumb:hover .superplays__thumb-media {
	transform: translateY( -2px );
}

.superplays__thumb.is-active .superplays__thumb-media {
	border-color: var(--sp-accent);
	box-shadow: 0 0 0 1px rgba( 230, 0, 18, 0.35 );
}

.superplays__thumb-status {
	position: absolute;
	top: 0.65rem;
	right: 0.65rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 1.6rem;
	padding: 0.28rem 0.7rem;
	border-radius: 999px;
	background: var(--sp-pill-bg);
	color: #fff;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	opacity: 0;
	transform: translateY( -4px );
	transition: opacity 0.18s ease, transform 0.18s ease;
	pointer-events: none;
	z-index: 1;
}

.superplays__thumb.is-active .superplays__thumb-status {
	opacity: 1;
	transform: translateY( 0 );
}

.superplays__thumb-title {
	display: block;
	margin-top: 0.6rem;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.35;
	color: var(--sp-text);
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.superplays__thumb-date {
	display: block;
	margin-top: 0.2rem;
	font-size: 0.75rem;
	color: var(--sp-muted);
}

/* ---- Empty state ---- */
.superplays__empty {
	padding: 4rem 1rem;
	text-align: center;
	color: var(--sp-muted);
	border: 1px dashed var(--sp-line);
	border-radius: var(--sp-radius);
}

@media ( max-width: 768px ) {
	.superplays {
		padding: 2rem 1rem 4rem;
	}

	.superplays__meta {
		align-items: stretch;
	}

	.superplays__cta {
		width: 100%;
		justify-content: center;
	}

	.superplays__chev {
		width: 50px;
		height: 50px;
	}

	.superplays__chev-icon {
		width: 32px;
		height: 32px;
	}

	.superplays__rail {
		gap: 0.85rem;
		padding-inline: 2.75rem;
		scroll-padding-inline: 2.75rem;
	}

	.superplays__thumb {
		width: min( 15rem, 76vw );
	}

	.superplays {
		--sp-thumb-media-center: calc( ( min( 15rem, 76vw ) * 9 / 16 ) / 2 );
	}

	.superplays__thumb-status {
		top: 0.5rem;
		right: 0.5rem;
		padding: 0.25rem 0.6rem;
		font-size: 0.625rem;
	}
}
