/**
 * Intro splash — one device GIF, transparent, bottom-centered.
 * Black GIF pixels punched out via mix-blend-mode so the store stays visible.
 */

.xm-intro-splash {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-end; /* bottom of viewport */
	justify-content: center; /* horizontal center */
	padding: 0 0 max(0.5rem, env(safe-area-inset-bottom, 0px));
	box-sizing: border-box;
	background: transparent;
	opacity: 1;
	visibility: visible;
	pointer-events: none;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.xm-intro-splash[hidden],
.xm-intro-splash.is-done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.xm-intro-splash__backdrop {
	display: none;
}

.xm-intro-splash__stage {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: min(100%, 1500px);
	height: auto;
	max-height: min(72vh, 720px);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	overflow: hidden;
	pointer-events: none;
	background: transparent;
	margin: 0 auto;
}

/* Never show more than one creative */
.xm-intro-splash__media {
	display: none !important;
	visibility: hidden;
	position: absolute;
	width: 0;
	height: 0;
	overflow: hidden;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	pointer-events: none;
	user-select: none;
	mix-blend-mode: screen;
}

.xm-intro-splash__media.is-active {
	display: block !important;
	visibility: visible;
	position: relative;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: min(72vh, 720px);
	overflow: visible;
	object-fit: contain;
	object-position: center bottom;
}

/* Placement: bottom (default) — center horizontal, sit on bottom */
.xm-intro-splash--bottom .xm-intro-splash__stage {
	max-height: min(70vh, 680px);
}

.xm-intro-splash--bottom .xm-intro-splash__media.is-active {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: min(70vh, 680px);
	object-fit: contain;
	object-position: center bottom;
}

/* Placement: contain — full GIF, middle of screen */
.xm-intro-splash--contain {
	align-items: center;
}

.xm-intro-splash--contain .xm-intro-splash__stage {
	align-items: center;
	max-height: 100%;
	height: 100%;
}

.xm-intro-splash--contain .xm-intro-splash__media.is-active {
	max-height: 100%;
	object-position: center center;
}

/* Placement: cover */
.xm-intro-splash--cover {
	align-items: stretch;
	padding: 0;
}

.xm-intro-splash--cover .xm-intro-splash__stage {
	max-width: 100%;
	max-height: 100%;
	height: 100%;
	align-items: center;
}

.xm-intro-splash--cover .xm-intro-splash__media.is-active {
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: cover;
	object-position: center center;
}

/* Placement: centered mid frame */
.xm-intro-splash--centered {
	align-items: center;
}

.xm-intro-splash--centered .xm-intro-splash__stage {
	width: min(92vw, 1100px);
	height: min(88vh, 720px);
	max-height: min(88vh, 720px);
	align-items: center;
	margin: auto;
}

.xm-intro-splash--centered .xm-intro-splash__media.is-active {
	width: 100%;
	height: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center center;
}

/* Hard device lock — never paint the other creative even if JS fails */
@media (max-width: 767px) {
	.xm-intro-splash__media--desktop {
		display: none !important;
		visibility: hidden !important;
		width: 0 !important;
		height: 0 !important;
	}
}

@media (min-width: 768px) {
	.xm-intro-splash__media--mobile {
		display: none !important;
		visibility: hidden !important;
		width: 0 !important;
		height: 0 !important;
	}
}

/* Opaque mode (optional) */
.xm-intro-splash.is-opaque {
	background: #000;
	pointer-events: auto;
}

.xm-intro-splash.is-opaque .xm-intro-splash__backdrop {
	display: block;
	position: absolute;
	inset: 0;
	background: #000;
}

.xm-intro-splash.is-opaque .xm-intro-splash__media {
	mix-blend-mode: normal;
	background: #000;
}

.xm-intro-splash__skip {
	position: absolute;
	z-index: 2;
	top: max(0.75rem, env(safe-area-inset-top, 0px));
	right: max(0.75rem, env(safe-area-inset-right, 0px));
	margin: 0;
	padding: 0.45rem 0.9rem;
	border: 1px solid rgba(255, 255, 255, 0.45);
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	pointer-events: auto;
}

.xm-intro-splash__skip:hover,
.xm-intro-splash__skip:focus-visible {
	background: rgba(255, 103, 0, 0.9);
	border-color: transparent;
	outline: none;
}

.xm-intro-splash__audio {
	position: absolute;
	width: 0;
	height: 0;
	opacity: 0;
	pointer-events: none;
}

html.xm-intro-splash-active,
body.xm-intro-splash-active {
	overflow: visible;
}

@media (prefers-reduced-motion: reduce) {
	.xm-intro-splash {
		transition: none;
	}
}
