/**
 * Milestone Moments (moment.php + moment.js).
 *
 * One overlay: a centred card on a wide screen, a sheet from the bottom on a
 * phone (the page's vote buttons stay in sight above it). A moving gradient
 * ring, light rays behind THE number, and one burst of confetti on a canvas.
 * It is an overlay, so it is the one place a surface sits on the page — and
 * it leaves after one look.
 */

@property --sa-mm-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.sa-mm {
	position: fixed;
	inset: 0;
	z-index: 100002;
	pointer-events: none;
	font-family: var(--sa-font-body, "Plus Jakarta Sans", system-ui, sans-serif);
	color: var(--sa-text, #EEF3F8);
	-webkit-font-smoothing: antialiased;
}
.sa-mm *, .sa-mm *::before, .sa-mm *::after { box-sizing: border-box; }
.sa-mm.is-on { pointer-events: auto; }

.sa-mm__back {
	position: absolute;
	inset: 0;
	background: radial-gradient(60% 60% at 50% 45%, rgba(40, 10, 40, .35), rgba(6, 3, 8, .8));
	-webkit-backdrop-filter: blur(7px);
	backdrop-filter: blur(7px);
	opacity: 0;
	transition: opacity .35s ease;
}
.sa-mm.is-on .sa-mm__back { opacity: 1; }

.sa-mm__fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }

/* ── the card ─────────────────────────────────────────────────────────── */
.sa-mm__box {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: 50%;
	width: min(430px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	padding: 1.5px;
	border-radius: 30px;
	background: conic-gradient(from var(--sa-mm-a), var(--sa-magenta, #00A870), var(--sa-violet, #00C389), var(--sa-pink, #19D3C5), var(--sa-vote-2, #C6FF3D), var(--sa-magenta, #00A870));
	box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .95), 0 0 90px -20px color-mix(in srgb, var(--sa-violet, #00C389) 55%, transparent);
	opacity: 0;
	transform: translate(-50%, -44%) scale(.9);
	transition: transform .6s cubic-bezier(.2, 1.35, .35, 1), opacity .3s ease;
	animation: sa-mm-spin 6s linear infinite;
}
@keyframes sa-mm-spin { to { --sa-mm-a: 360deg; } }
.sa-mm.is-on .sa-mm__box { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.sa-mm__in {
	position: relative;
	overflow: hidden;
	max-height: calc(100vh - 35px);
	overflow-y: auto;
	padding: 26px 26px 22px;
	border-radius: 28.5px;
	text-align: center;
	background:
		radial-gradient(90% 55% at 50% 0%, color-mix(in srgb, var(--sa-magenta, #19D3C5) 30%, transparent), transparent 70%),
		radial-gradient(70% 40% at 50% 105%, color-mix(in srgb, var(--sa-violet, #00C389) 22%, transparent), transparent 70%),
		var(--sa-bg, #0A0E1A);
}
/* The rays' own clip: the card scrolls on a short screen, they must not. */
.sa-mm__glow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
.sa-mm__rays {
	position: absolute;
	left: 50%;
	top: 36%;
	width: 760px;
	height: 760px;
	margin: -380px 0 0 -380px;
	pointer-events: none;
	opacity: .22;
	background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .55) 0deg 3deg, transparent 3deg 15deg);
	-webkit-mask: radial-gradient(circle, #000 0, transparent 52%);
	mask: radial-gradient(circle, #000 0, transparent 52%);
	animation: sa-mm-rot 40s linear infinite;
}
@keyframes sa-mm-rot { to { transform: rotate(360deg); } }

.sa-mm__grab { display: none; }
.sa-mm .sa-mm__x {
	position: absolute;
	z-index: 3;
	top: 14px;
	right: 14px;
	width: 34px;
	height: 34px;
	padding: 0;
	margin: 0;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .14);
	background: rgba(255, 255, 255, .04);
	color: var(--sa-text-muted, #A9B6C8);
	font: 400 18px/1 system-ui, sans-serif;
	cursor: pointer;
}
.sa-mm .sa-mm__x:hover { color: #fff; border-color: var(--sa-pink, #19D3C5); }
.sa-mm .sa-mm__x:focus { outline: none; box-shadow: none; }
.sa-mm .sa-mm__x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.sa-mm__chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 13px 7px 11px;
	border-radius: 999px;
	background: #fff;
	color: #1B0B18;
	font-size: 10.5px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .2em;
}
.sa-mm__chip svg { width: 13px; height: 13px; color: var(--sa-violet, #00C389); }
.sa-mm__race {
	position: relative;
	margin-top: 12px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: .26em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--sa-text, #EEF3F8) 85%, transparent);
}

/* ── the pictures ─────────────────────────────────────────────────────── */
.sa-mm__art { position: relative; height: 168px; margin: 18px auto 6px; display: grid; place-items: center; }
.sa-mm__pt {
	position: absolute;
	width: 104px;
	aspect-ratio: 4 / 5;
	padding: 2.5px;
	border-radius: 20px;
	background: var(--sa-gradient);
	box-shadow: 0 22px 50px -16px color-mix(in srgb, var(--sa-violet, #00C389) 70%, transparent);
	transition: transform .8s cubic-bezier(.2, 1.2, .3, 1), filter .6s;
}
.sa-mm__ph {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border-radius: 17.5px;
	background: var(--sa-surface-2, #18223A);
}
.sa-mm .sa-mm__ph img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	object-position: var(--fx, 50%) var(--fy, 40%);
}
/* The generated nominee poster: the face window inside its frame (the Story
   Card crops the same 320×400 at 380,416 of 1080×1350 — story-card.php). */
.sa-mm .sa-mm__ph.is-face img {
	position: absolute;
	width: 337.5%;
	height: auto;
	left: -118.75%;
	top: -104%;
	object-fit: fill;
}
.sa-mm__ini { display: grid; place-items: center; width: 100%; height: 100%; font: 700 34px/1 var(--sa-font-display, inherit); color: var(--sa-on-accent, #fff); background: var(--sa-gradient); }
.sa-mm__rk {
	position: absolute;
	left: -10px;
	bottom: 10px;
	padding: 6px 10px;
	border-radius: 11px;
	border: 3px solid var(--sa-bg, #0A0E1A);
	background: var(--sa-gradient);
	color: var(--sa-on-accent, #fff);
	font: 700 16px/1 var(--sa-font-display, inherit);
}
.sa-mm__pt.is-dim { background: rgba(255, 255, 255, .18); box-shadow: none; filter: grayscale(.55) brightness(.62); }
.sa-mm__pt.is-dim .sa-mm__rk { background: #3a2735; }

.sa-mm__art[data-k="round"] .sa-mm__pt { width: 84px; }
.sa-mm__art[data-k="round"] .sa-mm__rk { display: none; }
.sa-mm__art[data-k="round"] .p1 { transform: translateX(-108px) translateY(14px) rotate(-12deg); }
.sa-mm__art[data-k="round"] .p2 { transform: translateX(-38px) rotate(-4deg); z-index: 2; }
.sa-mm__art[data-k="round"] .p3 { transform: translateX(38px) rotate(4deg); z-index: 2; }
.sa-mm__art[data-k="round"] .p4 { transform: translateX(108px) translateY(14px) rotate(12deg); }
.sa-mm__art[data-k="round"][data-n="2"] .p1 { transform: translateX(-46px) rotate(-5deg); }
.sa-mm__art[data-k="round"][data-n="2"] .p2 { transform: translateX(46px) rotate(5deg); }
.sa-mm__art[data-k="round"][data-n="3"] .p1 { transform: translateX(-80px) translateY(10px) rotate(-9deg); }
.sa-mm__art[data-k="round"][data-n="3"] .p2 { transform: none; }
.sa-mm__art[data-k="round"][data-n="3"] .p3 { transform: translateX(80px) translateY(10px) rotate(9deg); z-index: 1; }

.sa-mm__art[data-k="takeover"] .p1 { transform: translateX(-34px) scale(1.22); z-index: 3; }
.sa-mm__art[data-k="takeover"] .p2 { transform: translateX(52px) translateY(18px) scale(.82) rotate(6deg); z-index: 1; }
.sa-mm.is-on .sa-mm__art[data-k="takeover"] .p1 { animation: sa-mm-rise .9s cubic-bezier(.2, 1.3, .3, 1) both .15s; }
@keyframes sa-mm-rise { from { transform: translateX(52px) translateY(18px) scale(.82); } }

.sa-mm__art[data-k="finish"] .p1 { transform: translateX(-66px) rotate(-5deg); }
.sa-mm__art[data-k="finish"] .p2 { transform: translateX(66px) rotate(5deg); }

.sa-mm__vs {
	position: absolute;
	z-index: 4;
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: #fff;
	color: #1B0B18;
	font: 700 15px/1 var(--sa-font-display, inherit);
	box-shadow: 0 0 0 5px var(--sa-bg, #0A0E1A), 0 0 40px color-mix(in srgb, var(--sa-pink, #19D3C5) 90%, transparent);
}
.sa-mm__new {
	position: absolute;
	z-index: 5;
	right: 54px;
	top: 2px;
	padding: 6px 10px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--sa-up, #34E2A0) 40%, transparent);
	background: color-mix(in srgb, var(--sa-up, #34E2A0) 14%, transparent);
	color: var(--sa-up, #34E2A0);
	font-size: 10px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .14em;
}

/* ── the words ────────────────────────────────────────────────────────── */
.sa-mm__big {
	position: relative;
	margin-top: 4px;
	font: 700 96px/.9 var(--sa-font-display, inherit);
	letter-spacing: -.04em;
	font-variant-numeric: tabular-nums;
	background: linear-gradient(100deg, var(--sa-magenta, #00A870) 0%, var(--sa-violet, #00C389) 40%, #fff 50%, var(--sa-violet, #00C389) 60%, var(--sa-pink, #19D3C5) 100%);
	background-size: 250% 100%;
	background-position: 100% 0;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	filter: drop-shadow(0 0 26px color-mix(in srgb, var(--sa-violet, #00C389) 45%, transparent));
}
.sa-mm.is-on .sa-mm__big { animation: sa-mm-sheen 2.6s ease-in-out .5s infinite, sa-mm-pop .7s cubic-bezier(.2, 1.5, .3, 1) both; }
@keyframes sa-mm-sheen { 0% { background-position: 100% 0; } 55%, 100% { background-position: -50% 0; } }
@keyframes sa-mm-pop { from { transform: scale(.55); opacity: 0; } }
.sa-mm .sa-mm__lbl { position: relative; padding: 0; margin: 10px 0 0; font-family: var(--sa-font-body, inherit); font-size: 15px; font-weight: 800; line-height: 1.2; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.sa-mm__sub { position: relative; max-width: 30em; margin: 8px auto 0; font-size: 14px; line-height: 1.5; color: color-mix(in srgb, var(--sa-text, #EEF3F8) 82%, transparent); }
.sa-mm__sub b { color: #fff; font-weight: 800; }

.sa-mm__tug { position: relative; width: 100%; max-width: 300px; margin: 14px auto 0; }
.sa-mm__tug .t { display: flex; gap: 2px; height: 8px; overflow: hidden; border-radius: 9px; background: var(--sa-surface-2, #18223A); }
.sa-mm__tug .t i { display: block; background: var(--sa-gradient); }
.sa-mm__tug .t i + i { background: rgba(255, 255, 255, .32); }
.sa-mm__tug .t2 { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 11px; font-weight: 700; line-height: 1; color: var(--sa-text-muted, #A9B6C8); }
.sa-mm__tug .t2 b { color: #fff; }

.sa-mm__acts { position: relative; display: grid; gap: 10px; justify-items: center; margin-top: 20px; }
.sa-mm a.sa-mm__share,
#tie-wrapper .sa-mm a.sa-mm__share {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	max-width: 300px;
	padding: 15px 22px;
	overflow: hidden;
	border-radius: 999px;
	background: var(--sa-gradient);
	color: var(--sa-on-accent, #fff);
	font-size: 13px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .14em;
	text-decoration: none;
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--sa-violet, #00C389) 13%, transparent), 0 0 0 12px color-mix(in srgb, var(--sa-violet, #00C389) 6%, transparent), 0 16px 34px -12px color-mix(in srgb, var(--sa-violet, #00C389) 95%, transparent);
	-webkit-tap-highlight-color: transparent;
}
.sa-mm a.sa-mm__share::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
	background-size: 250% 100%;
	mix-blend-mode: overlay;
	animation: sa-mm-sheen 3s ease-in-out 1.2s infinite;
}
.sa-mm a.sa-mm__share svg { width: 19px; height: 19px; flex: none; }
.sa-mm a.sa-mm__share:hover { color: var(--sa-on-accent, #fff); filter: brightness(1.1); text-decoration: none; }
.sa-mm a.sa-mm__share:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.sa-mm .sa-mm__keep {
	padding: 6px;
	margin: 0;
	border: 0;
	background: none;
	color: var(--sa-text-muted, #A9B6C8);
	font-size: 11.5px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .14em;
	cursor: pointer;
}
.sa-mm .sa-mm__keep:hover { color: #fff; }
.sa-mm__asof { position: relative; margin-top: 12px; font-size: 12px; font-style: italic; font-weight: 500; line-height: 1; color: var(--sa-text-dim, #7F8CA0); }

/* ── phones: a sheet from the bottom ──────────────────────────────────── */
@media (max-width: 640px) {
	.sa-mm__box {
		left: 0;
		right: 0;
		top: auto;
		bottom: 0;
		width: auto;
		max-height: 92vh;
		padding: 1.5px 1.5px 0;
		border-radius: 28px 28px 0 0;
		opacity: 1;
		transform: translateY(105%);
		transition: transform .6s cubic-bezier(.2, 1.15, .3, 1);
	}
	.sa-mm.is-on .sa-mm__box { transform: none; }
	.sa-mm__box.is-drag { transition: none; }
	.sa-mm__in { max-height: calc(92vh - 2px); padding: 12px 18px max(22px, env(safe-area-inset-bottom)); border-radius: 26.5px 26.5px 0 0; }
	.sa-mm__grab { display: block; width: 40px; height: 4px; margin: 0 auto 14px; border-radius: 4px; background: rgba(255, 255, 255, .28); }
	.sa-mm .sa-mm__x { top: 10px; right: 10px; width: 30px; height: 30px; font-size: 16px; }
	.sa-mm__art { height: 140px; margin: 12px auto 2px; transform: scale(.84); }
	.sa-mm__big { font-size: 72px; }
	.sa-mm .sa-mm__lbl { margin-top: 6px; font-size: 13px; }
	.sa-mm__sub { font-size: 13px; }
	.sa-mm__new { display: none; }
	.sa-mm__rays { top: 40%; width: 520px; height: 520px; margin: -260px 0 0 -260px; }
}

/* ── short phones (SE, 568–700 px tall): the sheet must fit without a scroll ── */
@media (max-width: 640px) and (max-height: 700px) {
	.sa-mm__in { padding: 10px 16px max(16px, env(safe-area-inset-bottom)); }
	.sa-mm__grab { margin-bottom: 10px; }
	.sa-mm__race { margin-top: 8px; }
	.sa-mm__art { height: 112px; margin: 6px auto 0; transform: scale(.7); }
	.sa-mm__big { font-size: 58px; }
	.sa-mm__sub { margin-top: 6px; font-size: 12.5px; }
	.sa-mm__tug { margin-top: 10px; }
	.sa-mm__acts { margin-top: 12px; gap: 4px; }
	.sa-mm a.sa-mm__share, #tie-wrapper .sa-mm a.sa-mm__share { padding: 13px 18px; }
	.sa-mm__asof { margin-top: 8px; }
}

/* ── wide but short (a phone on its side): pictures left, words right ──── */
@media (min-width: 641px) and (max-height: 600px) {
	.sa-mm__box { width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 20px); }
	.sa-mm__in {
		display: grid;
		grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
		column-gap: 18px;
		align-items: center;
		max-height: calc(100vh - 23px);
		padding: 16px 22px 14px;
	}
	.sa-mm__in > * { grid-column: 2; }
	.sa-mm__in > .sa-mm__art { grid-column: 1; grid-row: 1 / span 9; height: 200px; margin: 0; transform: scale(.9); }
	.sa-mm__chip { justify-self: center; }
	.sa-mm__race { margin-top: 8px; }
	.sa-mm__big { font-size: 58px; }
	.sa-mm .sa-mm__lbl { margin-top: 6px; font-size: 13px; }
	.sa-mm__sub { margin-top: 4px; font-size: 12.5px; }
	.sa-mm__tug { margin-top: 8px; }
	.sa-mm__acts { margin-top: 10px; gap: 2px; }
	.sa-mm a.sa-mm__share, #tie-wrapper .sa-mm a.sa-mm__share { padding: 12px 18px; }
	.sa-mm__asof { margin-top: 6px; }
	.sa-mm__rays { left: 25%; top: 50%; }
}

@media (prefers-reduced-motion: reduce) {
	.sa-mm *, .sa-mm *::before, .sa-mm *::after, .sa-mm__box { animation: none !important; transition: none !important; }
}
