/**
 * Superplays — interactive video hub (front-end).
 *
 * Uniform responsive card grid (1 / 2 cols). Each card = a YouTube
 * thumbnail with a play target that opens a single shared autoplay modal, plus
 * optional card-body description/detail content. Deep-tone background,
 * compact system-font metrics, and brand-red accents. The modal is a
 * frosted-glass theatre overlay with strict focus/scroll isolation.
 */

.superplays {
	/* Superplay-scoped palette and geometry. */
	--sp-bg: #000;
	--sp-card-bg: #111111;
	--sp-card-border: #1c1c1e;
	--sp-card-radius: 16px;
	--sp-line-2: #3a3a3f;
	--sp-text: #ffffff;
	--sp-muted: #c4c7c8;
	--sp-accent: #e60012;
	--sp-radius: 1rem;

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

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

/* Page background — pure black, matching the DP system page. */
.superplays-page-article {
	background: #000;
	min-height: 60vh;
	position: relative;
	z-index: 0;
	isolation: isolate;
}

/* ---- Header (page title kept 1:1 with the Distributors title) ---- */
.superplays__header {
	text-align: center;
	margin-bottom: 2.75rem;
}

.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 );
}

/* Subtitle directly beneath the title. */
.superplays__subtitle {
	margin: max( 1rem, clamp( 10px, 1.2vw, 16px ) ) 0 0;
	max-width: none;
	color: #86868b;
	font-family: "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-size: clamp( 0.95rem, 1.8vw, 1.25rem );
	font-weight: 400;
	line-height: 1.35;
	letter-spacing: -0.01em;
}

.superplays__subtitle > :first-child {
	margin-top: 0;
}

.superplays__subtitle > :last-child {
	margin-bottom: 0;
}

.superplays__subtitle a,
.superplays__subtitle a:visited {
	color: var( --sp-accent, #e60012 ) !important;
	text-decoration: underline;
	text-underline-offset: 0.16em;
	cursor: pointer;
	pointer-events: auto;
}

.superplays__subtitle a:hover,
.superplays__subtitle a:focus-visible,
.superplays__subtitle a:active {
	color: #ff2a36 !important;
	text-decoration-thickness: 0.12em;
}

/* ---- Uniform card grid ---- */
.superplays__grid {
	display: grid;
	grid-template-columns: 1fr;
	align-items: start;
	gap: 1.75rem;
	margin-bottom: 3rem;
}

@media ( min-width: 768px ) {
	.superplays__grid {
		grid-template-columns: repeat( 2, 1fr );
	}
}

/* ---- Card ---- */
.superplays__card {
	position: relative;
	display: block;
	border-radius: var(--sp-card-radius);
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
	transform: translate3d( 0, 0, 0 );
	backface-visibility: hidden;
	will-change: transform;
	isolation: isolate;
	transition: transform 0.4s ease;
}

/* One continuous 3px outline spans the original 2px outer highlight and 1px
 * card edge. Keeping it on a single rasterized curve avoids the dark seam that
 * appears when two independently antialiased rounded borders touch. */
.superplays__card::after {
	content: "";
	position: absolute;
	inset: -2px;
	z-index: 2;
	border: 3px solid rgba( 230, 0, 18, 0 );
	border-radius: calc( var(--sp-card-radius) + 2px );
	pointer-events: none;
	transition: border-color 0.25s ease;
}

.superplays__card-surface {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--sp-card-bg);
	border: 1px solid var(--sp-card-border);
	border-radius: inherit;
	overflow: hidden;
}

.superplays__card:hover,
.superplays__card:focus-within,
.superplays__card:active {
	transform: translate3d( 0, -4px, 0 );
}

.superplays__card:hover::after,
.superplays__card:focus-within::after,
.superplays__card:active::after {
	border-color: var(--sp-accent);
}

.superplays__card--hidden {
	display: none;
}

/* Revealed by "Load More" — a soft fade-in. */
.superplays__card.is-revealed {
	animation: sp-card-in 0.5s ease;
}

@keyframes sp-card-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ---- Standard YouTube embed ---- */
.superplays__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	overflow: hidden;
}

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

/* The native YouTube player fills the frame (title / play / Watch-on-YouTube). */
.superplays__embed {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

/* Transparent catcher that opens the theatre modal. Hidden on mobile (base):
 * there the embed itself is fully interactive and plays inline. */
.superplays__catch {
	display: none;
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	z-index: 2;
}

/* Tablet + desktop: enable the catcher that opens the theatre modal. */
@media ( min-width: 768px ) {
	.superplays__catch {
		display: block;
	}
}

.superplays__catch:focus-visible {
	outline: 3px solid var(--sp-accent);
	outline-offset: -3px;
}

/* ---- Refactored lower card ---- */
.superplays__card-body {
	padding: 1rem 1.25rem;
	background: var(--sp-card-bg);
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.superplays__description {
	margin: 0;
	color: var(--sp-muted);
	font-family: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	line-height: 1.65;
}

.superplays__description p {
	margin: 0;
}

.superplays__description p + p {
	margin-top: 0.75rem;
}

.superplays__details-heading {
	margin: 0;
	color: var(--sp-text);
	font-family: inherit;
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.superplays__details-heading p {
	margin: 0;
}

.superplays__details-heading p + p {
	margin-top: 0.35em;
}

.superplays__details-heading a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

/* Metrics + bottom-right Media Library image. */
.superplays__card-lower {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem;
	min-width: 0;
}

.superplays__metrics-column {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
	gap: 0.5rem;
}

.superplays__metrics-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 16px fit-content( 6.25rem ) minmax( 0, 1fr );
	column-gap: 0.375rem;
	row-gap: 0.4rem;
}

.superplays__metric-row {
	display: grid;
	grid-column: 1 / -1;
	align-items: center;
	grid-template-columns: subgrid;
	width: 100%;
	padding: 0.35rem 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.superplays__metric-icon {
	display: inline-flex;
	grid-column: 1;
	align-items: center;
	justify-content: flex-end;
	width: 16px;
	height: 16px;
	color: #8e8e93;
}

.superplays__metric-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.superplays__metric-label {
	grid-column: 2;
	min-width: 0;
	color: #86868b;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.2;
	text-transform: uppercase;
	text-align: right;
	letter-spacing: 0.06em;
	white-space: normal;
	overflow-wrap: anywhere;
}

.superplays__metric-value {
	grid-column: 3;
	min-width: 0;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.01em;
	text-align: left;
	position: relative;
	top: -1px;
	overflow-wrap: anywhere;
}

.superplays__branding {
	display: flex;
	flex: 0 0 var(--sp-branding-size, 48px);
	align-items: center;
	justify-content: center;
	margin-left: auto;
}

.superplays__branding-image {
	display: block;
	width: auto;
	height: auto;
	max-width: var(--sp-branding-size, 48px);
	max-height: var(--sp-branding-size, 48px);
	object-fit: contain;
}

/* ---- Load More ---- */
.superplays__load-more {
	display: flex;
	justify-content: center;
	padding: 2rem 0 1rem;
	overflow-anchor: none;
}

.superplays__load-more[hidden] {
	display: none;
}

/* Remains in flow after the CTA is suppressed, giving IntersectionObserver a
 * stable target between batches without introducing a scroll listener. */
.superplays__sentinel {
	width: 100%;
	height: 1px;
	pointer-events: none;
	overflow-anchor: none;
}

.superplays__sentinel[hidden] {
	display: none;
}

.superplays__load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 4rem;
	background: #D90500;
	color: #fff;
	border: var(--renewal-cta-border-width, 2px) solid transparent;
	border-radius: var(--renewal-cta-radius, 8px);
	font-family: "Montserrat-Bold", Helvetica, Arial, sans-serif;
	font-size: 1.05rem;
	font-weight: 500;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.superplays__load-more-btn:hover,
.superplays__load-more-btn:focus-visible {
	background: #fff;
	color: #D90500;
	border-color: #D90500;
}

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

/* ---- Theatre modal ---- */
/* The modal is reparented to <body> at runtime (for background isolation), so
 * it must carry its own tokens — it no longer inherits them from .superplays. */
.superplays__modal {
	--sp-accent: #e60012;
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: grid;
	place-items: center;
	padding: 2.5rem;
	background: rgba( 0, 0, 0, 0.7 );
	backdrop-filter: blur( 25px );
	-webkit-backdrop-filter: blur( 25px );
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s cubic-bezier( 0.25, 1, 0.5, 1 );
}

.superplays__modal.is-active {
	opacity: 1;
	pointer-events: auto;
}

.superplays__modal-dialog {
	width: 100%;
	max-width: 960px;
	max-height: 80vh;
	aspect-ratio: 16 / 9;
	background: #000;
	/* Very subtle, slight round on the video corners. */
	border-radius: 6px;
	overflow: hidden;
	border: 1px solid rgba( 255, 255, 255, 0.1 );
	box-shadow: 0 30px 60px rgba( 0, 0, 0, 0.9 );
	transform: scale( 0.95 );
	transition: transform 0.4s cubic-bezier( 0.25, 1, 0.5, 1 );
}

.superplays__modal.is-active .superplays__modal-dialog {
	transform: scale( 1 );
}

.superplays__modal-frame {
	position: relative;
	width: 100%;
	height: 100%;
}

.superplays__modal-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.superplays__modal-close {
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.1 );
	color: #fff;
	cursor: pointer;
	z-index: 2;
	transition: background 0.25s ease, transform 0.15s ease;
}

/* Turn the button shape red on hover AND while pressed. */
.superplays__modal-close:hover,
.superplays__modal-close:focus-visible,
.superplays__modal-close:active {
	background: var(--sp-accent);
	outline: none;
}

.superplays__modal-close:active {
	transform: scale( 0.94 );
}

.superplays__modal-close:focus-visible {
	box-shadow: 0 0 0 2px #fff;
}

/* Much bigger, semi-bold X. */
.superplays__modal-close svg {
	width: 32px;
	height: 32px;
	stroke-width: 2.6;
}

/* Body scroll lock while the modal is open. */
body.superplays-modal-open {
	overflow: hidden;
}

/* ---- Reduced motion ---- */
@media ( prefers-reduced-motion: reduce ) {
	.superplays__card,
	.superplays__card::after,
	.superplays__card-surface,
	.superplays__embed,
	.superplays__modal,
	.superplays__modal-dialog,
	.superplays__modal-close,
	.superplays__load-more-btn {
		transition: none !important;
		animation: none !important;
	}
}

/* ---- Responsive ---- */
@media ( max-width: 767px ) {
	.superplays {
		padding: 2rem 1rem 4rem;
	}

	.superplays__modal {
		padding: 1rem;
	}

	.superplays__modal-close {
		top: 0.75rem;
		right: 0.75rem;
		width: 42px;
		height: 42px;
	}

	.superplays__card-body {
		padding: 1rem;
	}
}

@media ( max-width: 767px ) {
	.superplays__load-more-btn {
		display: inline-flex;
		width: auto;
		max-width: min( 100%, 22rem );
		box-sizing: border-box;
		align-items: center;
		justify-content: center;
		padding: 0.85rem 1.6rem;
		min-width: 0;
		background: #D90500;
		color: #fff;
		border: var(--renewal-cta-border-width, 2px) solid transparent;
		border-radius: var(--renewal-cta-radius, 8px);
		font-family: "Montserrat-Bold", Helvetica, Arial, sans-serif;
		font-size: 1.05rem;
		font-weight: 500;
		line-height: 1.2;
		letter-spacing: var(--renewal-cta-letter-spacing, normal);
		text-transform: none;
		text-decoration: none;
		text-align: center;
		white-space: normal;
		box-shadow: var(--renewal-cta-shadow, 0 8px 18px rgba( 3, 3, 3, .18 ));
		transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .2s ease, box-shadow .2s ease;
	}

	.superplays__load-more-btn:hover,
	.superplays__load-more-btn:focus-visible {
		background: #fff;
		color: #D90500;
		border-color: #D90500;
		transform: translateY( -2px );
		box-shadow: 0 10px 24px rgba( 217, 5, 0, .18 );
	}

	.superplays__load-more-btn:focus-visible,
	.superplays__load-more-btn:active {
		border-color: #D90500;
	}
}

@media ( max-width: 359px ) {
	.superplays__card-lower {
		flex-wrap: wrap;
		gap: 0.5rem 0.75rem;
	}

	.superplays__metrics-column {
		flex-basis: 100%;
	}

	.superplays__branding {
		flex-basis: var(--sp-branding-size-small, 42px);
	}

	.superplays__branding-image {
		max-width: var(--sp-branding-size-small, 42px);
		max-height: var(--sp-branding-size-small, 42px);
	}
}
