* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
}

body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: center;
	padding: 24px 0;
	overflow: hidden;
	background: var(--mm-background);
	color: var(--mm-title-color);
	font-family: var(--mm-font-family);
}

/* CONTENT POSITION */

.mm-position-top-left,
.mm-position-top-center,
.mm-position-top-right {
	justify-content: flex-start;
}

.mm-position-center-left,
.mm-position-center-center,
.mm-position-center-right {
	justify-content: center;
}

.mm-position-bottom-left,
.mm-position-bottom-center,
.mm-position-bottom-right {
	justify-content: flex-end;
}

.mm-position-top-left,
.mm-position-center-left,
.mm-position-bottom-left {
	--mm-content-self: flex-start;
}

.mm-position-top-center,
.mm-position-center-center,
.mm-position-bottom-center {
	--mm-content-self: center;
}

.mm-position-top-right,
.mm-position-center-right,
.mm-position-bottom-right {
	--mm-content-self: flex-end;
}

/* PAGE BACKGROUND */

.mm-background-image,
.mm-background-video,
.mm-overlay {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
}

.mm-background-image {
	z-index: -3;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.mm-background-video {
	z-index: -3;
	object-fit: cover;
}

.mm-overlay {
	z-index: -2;
	background: var(--mm-overlay);
	opacity: var(--mm-overlay-opacity);
}

/* LAYOUT */

.mm-content {
	position: relative;
	flex: 0 0 auto;
	width: 100%;
	min-height: min(var(--mm-content-height), 100vh);
	overflow: visible;
}

.mm-content.mm-full-height {
	position: fixed;
	inset: 0;
	z-index: 0;
	height: 100vh;
	min-height: 100vh;
}

.mm-content.mm-no-box {
	min-height: auto;
}

.mm-content.mm-no-box.mm-full-height {
	position: relative;
	inset: auto;
	height: auto;
	min-height: auto;
}

.mm-box-surface {
	position: absolute;
	top: 0;
	bottom: 0;
	z-index: 0;
	width: min(var(--mm-width), 100%);
	overflow: hidden;
	background: var(--mm-box-background);
	pointer-events: none;
}

.mm-position-top-left .mm-box-surface,
.mm-position-center-left .mm-box-surface,
.mm-position-bottom-left .mm-box-surface {
	left: 0;
}

.mm-position-top-center .mm-box-surface,
.mm-position-center-center .mm-box-surface,
.mm-position-bottom-center .mm-box-surface {
	left: 50%;
	transform: translateX(-50%);
}

.mm-position-top-right .mm-box-surface,
.mm-position-center-right .mm-box-surface,
.mm-position-bottom-right .mm-box-surface {
	right: 0;
}

.mm-content.mm-full-width .mm-box-surface {
	left: 50%;
	right: auto;
	width: 100vw;
	max-width: none;
	transform: translateX(-50%);
}

.mm-content.mm-no-box .mm-box-surface {
	display: none;
}

.mm-box-image,
.mm-box-video,
.mm-box-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.mm-box-image {
	z-index: 0;
	background-position: center;
	background-size: cover;
	background-repeat: no-repeat;
}

.mm-box-video {
	z-index: 0;
	object-fit: cover;
}

.mm-box-overlay {
	z-index: 1;
	background: var(--mm-box-overlay);
	opacity: var(--mm-box-overlay-opacity);
}

.mm-content-inner {
	position: relative;
	z-index: 2;
	width: 100%;
	min-height: inherit;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.mm-copy,
.mm-powered {
	align-self: var(--mm-content-self, center);
	width: min(var(--mm-width), 100%);
}

.mm-content.mm-full-width .mm-copy,
.mm-content.mm-full-width .mm-powered {
	width: 100vw;
	max-width: none;
}

/* Hide language switchers on the maintenance page */

body > :not(.mm-background-image):not(.mm-background-video):not(.mm-overlay):not(.mm-content):not(script):not(noscript) {
	display: none !important;
}

/* TEXT */

.mm-align-left {
	text-align: left;
}

.mm-align-center {
	text-align: center;
}

.mm-align-right {
	text-align: right;
}

h1 {
	margin: 0 0 20px;
	padding-top: .08em;
	color: var(--mm-title-color);
	font-size: var(--mm-title-size);
	line-height: 1.2;
	overflow: visible;
}

.mm-message {
	margin: 0;
	color: var(--mm-message-color);
	font-size: var(--mm-message-size);
	line-height: 1.7;
}

/* COUNTDOWN */

.mm-countdown {
	position: relative;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 0;
	width: min(var(--mm-countdown-width), 100%);
	max-width: none;
	margin-top: 32px;
	background: var(--mm-countdown-background);
}

.mm-countdown-align-left {
	align-self: flex-start;
}

.mm-countdown-align-center {
	align-self: center;
}

.mm-countdown-align-right {
	align-self: flex-end;
}

.mm-countdown.mm-countdown-full-width {
	align-self: center;
	width: 100vw;
	max-width: none;
}

.mm-countdown div {
	position: relative;
	display: flex;
	min-width: 0;
	padding: 18px 10px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: clamp(6px, calc(var(--mm-countdown-label-size) * .3), 18px);
	background: transparent;
	text-align: center;
}

.mm-countdown > div:not(:last-of-type)::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 0;
	z-index: 3;
	display: block;
	width: var(--mm-divider-width);
	height: var(--mm-divider-height);
	background: var(--mm-divider-color);
	opacity: var(--mm-divider-opacity);
	transform: translate(50%, -50%);
	pointer-events: none;
}

.mm-countdown strong {
	display: block;
	margin: 0;
	color: var(--mm-countdown-number-color);
	font-size: var(--mm-countdown-size);
	line-height: 1;
}

.mm-countdown span {
	display: block;
	margin: 0;
	color: var(--mm-countdown-label-color);
	font-size: var(--mm-countdown-label-size);
	line-height: 1.2;
}

/* POWERED */

.mm-powered {
	margin-top: 30px;
	color: var(--mm-powered-text-color);
	font-size: var(--mm-powered-size);
	text-align: center;
}

.mm-powered a {
	color: var(--mm-powered-link-color);
	font-weight: 700;
	text-decoration: none;
}

/* MOBILE */

@media (max-width: 600px) {
	body {
		padding: 16px 0;
		overflow-x: hidden;
		overflow-y: auto;
	}

	.mm-content {
		min-height: min(var(--mm-content-height), 100vh);
	}

	.mm-copy,
	.mm-powered {
		max-width: 100%;
		padding-left: 12px;
		padding-right: 12px;
	}

	/* Keep the same 4-column timer layout as desktop. On small screens we
	   reduce spacing/type only, so the mobile version stays visually consistent. */
	.mm-countdown {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		margin-top: 22px;
	}

	.mm-countdown div {
		min-width: 0;
		padding: 14px 4px;
	}

	h1 {
		margin-bottom: 14px;
		font-size: min(var(--mm-title-size), 9vw);
	}

	.mm-message {
		font-size: min(var(--mm-message-size), 4.5vw);
		line-height: 1.5;
	}

	.mm-countdown strong {
		font-size: min(var(--mm-countdown-size), 7vw);
	}

	.mm-countdown span {
		margin: 0;
		font-size: min(var(--mm-countdown-label-size), 3vw);
		line-height: 1.2;
		white-space: nowrap;
	}

	.mm-powered {
		margin-top: 20px;
		font-size: min(var(--mm-powered-size), 3.5vw);
	}
}
