/**
 * Fan Rally — /rally/{poll}/{nominee}/ (rally.php + rally.js).
 *
 * Flat by the house rule: no card panels. The nominee's portrait is the one
 * framed object (a gradient hairline ring, the receipt's language); the
 * mission is type on the page background; the only filled shape is the
 * VOTE FOR … button.
 */

/* A stage, not the 1280px site container. The ID selector is not decoration:
   the skin sets `#tie-wrapper .container` to the site width. */
#tie-wrapper main.sa-rally.container,
.sa-rally { max-width: 1040px; margin-left: auto; margin-right: auto; padding-top: clamp(1.4rem, 4vw, 3.4rem); padding-bottom: clamp(2rem, 5vw, 4rem); }
.sa-rally [hidden] { display: none !important; }

.sa-rally__stage {
	display: grid;
	grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
	gap: clamp(1.6rem, 5vw, 4rem);
	align-items: center;
}

/* ── the portrait ──────────────────────────────────────────────────────── */
.sa-rally__face {
	position: relative;
	margin: 0;
	aspect-ratio: 4 / 5;
	border-radius: calc(var(--sa-radius, 16px) + 10px);
	padding: 2px;
	background: var(--sa-gradient);
	box-shadow: 0 30px 80px -40px color-mix(in srgb, var(--sa-magenta, #00C389) 70%, transparent);
}
.sa-rally__face img,
.sa-rally__ini {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: calc(var(--sa-radius, 16px) + 8px);
	object-fit: cover;
	object-position: var(--sa-rally-fx, 50%) var(--sa-rally-fy, 40%);
	background: var(--sa-surface-2, #1c1424);
}
.sa-rally__ini {
	display: grid;
	place-items: center;
	font-family: var(--sa-font-display);
	font-size: clamp(5rem, 16vw, 9rem);
	font-weight: 800;
	color: var(--sa-text);
}
.sa-rally__rank {
	position: absolute;
	left: 18px;
	bottom: 18px;
	padding: .5rem 1rem;
	border-radius: var(--sa-radius-pill, 999px);
	font-family: var(--sa-font-display);
	font-size: 1.35rem;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.02em;
	font-variant-numeric: tabular-nums;
	color: var(--sa-on-accent, #fff);
	background: var(--sa-gradient);
	box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .7);
}

/* ── the mission ───────────────────────────────────────────────────────── */
.sa-rally__copy { min-width: 0; }
.sa-rally__eye {
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	margin-bottom: .9rem;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--sa-heart);
}
.sa-rally__heart { width: 15px; height: 15px; flex: none; color: var(--sa-heart); }

.sa-rally .sa-rally__title {
	margin: 0;
	font-family: var(--sa-font-display);
	font-weight: 800;
	font-size: clamp(2.3rem, 5.6vw, 4rem);
	line-height: 1;
	letter-spacing: -.04em;
	color: var(--sa-text);
	text-wrap: balance;
}
.sa-rally .sa-grad {
	background: var(--sa-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.sa-rally .sa-rally__line {
	margin: 1.1rem 0 0;
	font-size: clamp(1.05rem, 2.2vw, 1.3rem);
	line-height: 1.35;
	color: var(--sa-text-dim);
}
.sa-rally__num {
	display: inline-block;
	font-family: var(--sa-font-display);
	font-size: 1.9em;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.03em;
	font-variant-numeric: tabular-nums;
	vertical-align: -.12em;
	background: var(--sa-gradient);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.sa-rally__rival { font-weight: 700; color: var(--sa-text); }

.sa-rally .sa-rally__race {
	margin: .6rem 0 0;
	font-size: .95rem;
	color: var(--sa-text-muted);
}
#tie-wrapper .sa-rally__race a,
.sa-rally__race a { color: var(--sa-text); font-weight: 700; text-decoration: none; box-shadow: none; }
#tie-wrapper .sa-rally__race a:hover { color: var(--sa-heart); }

.sa-rally .sa-rally__clock {
	display: flex;
	width: fit-content;
	align-items: center;
	gap: .55rem;
	margin: 1.3rem 0 0;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--sa-text);
	font-variant-numeric: tabular-nums;
}
.sa-rally__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--sa-heart);
	box-shadow: 0 0 0 0 color-mix(in srgb, var(--sa-heart) 60%, transparent);
	animation: sa-rally-pulse 2s ease-out 6;
}
@keyframes sa-rally-pulse {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--sa-heart) 55%, transparent); }
	100% { box-shadow: 0 0 0 10px transparent; }
}

/* The one filled shape on the page. */
.sa-rally__cta,
#tie-wrapper a.sa-rally__cta {
	/* Its own row: inline, it sat beside the countdown. */
	display: flex;
	width: fit-content;
	align-items: center;
	justify-content: center;
	gap: .6rem;
	margin-top: 1.6rem;
	padding: 1.05rem 2rem;
	border-radius: var(--sa-radius-pill, 999px);
	font-family: var(--sa-font-display);
	font-size: 1.02rem;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--sa-on-accent, #fff);
	background: var(--sa-gradient);
	box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--sa-magenta, #00C389) 90%, transparent),
		inset 0 1px 0 color-mix(in srgb, #fff 24%, transparent);
	transition: transform .16s ease, filter .2s ease;
}
.sa-rally__ctaheart { width: 18px; height: 18px; flex: none; color: currentColor; }
@media (hover: hover) {
	#tie-wrapper a.sa-rally__cta:hover { transform: translateY(-2px); filter: saturate(1.08) brightness(1.04); color: var(--sa-on-accent, #fff); }
}
.sa-rally__cta:focus-visible { outline: 2px solid var(--sa-vote-2, #22D3EE); outline-offset: 4px; }

/* ── pass it on ───────────────────────────────────────────────────────── */
.sa-rally__pass {
	margin-top: 2rem;
	padding-top: 1.3rem;
	border-top: 1px solid var(--sa-border);
}
.sa-rally__passhead {
	display: block;
	margin-bottom: .8rem;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--sa-text-muted);
}
.sa-rally__pass .sa-shareinline { justify-content: flex-start; }

.sa-rally .sa-rally__fine {
	margin: 1.4rem 0 0;
	max-width: 52ch;
	font-size: .76rem;
	line-height: 1.5;
	color: var(--sa-text-muted);
}

/* ── narrow ────────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
	.sa-rally__stage { grid-template-columns: minmax(0, 1fr); text-align: center; }
	.sa-rally__face { width: min(72vw, 320px); margin: 0 auto; }
	.sa-rally__eye { justify-content: center; }
	.sa-rally .sa-rally__clock { margin-left: auto; margin-right: auto; }
	.sa-rally__cta,
	#tie-wrapper a.sa-rally__cta { display: flex; width: 100%; }
	.sa-rally__pass .sa-shareinline { justify-content: center; }
	.sa-rally .sa-rally__fine { margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.sa-rally__dot { animation: none; }
	.sa-rally__cta,
	#tie-wrapper a.sa-rally__cta { transition: none; }
}

/* The theme's `#content a:hover` underlines every link — and this page's
   <main> IS #content. Buttons and the race link never underline. */
#content a.sa-rally__cta:hover,
#content .sa-rally__race a:hover,
#content .sa-rally__pass a:hover { text-decoration: none; }
