/**
 * Kubota Europe prize wheel (WPBakery element `vc_kbeu_prize_wheel`).
 *
 * Figma lead generation page, nodes 5037-5131 … 5133 (heading), 5037-5093 (left
 * column), 5037-5104 (wheel), 5037-5061 (rule) and 5037-5062 (success card), on
 * the 2560px artboard:
 *
 *   - two columns: the texts in the left 937px of the 1896px column (49.4%),
 *     the wheel at the right end, centred on the texts' height;
 *   - left: the heading (the `heading` partial), then 58px lower a bold
 *     "Ready to play?" (32px / Bold) over its paragraph (24px / Light), the hint
 *     box 38px below (1.5px dashed black outline, 12px corners, a 20px info icon
 *     12px before a 24px / Light line; 60px tall), the 54px turquoise button 52px
 *     below and the "View contest rules" link (20px / Roman) 44px under it;
 *   - right: the 440px wheel — a 6px turquoise rim over a black disc, the wedges
 *     (21 … 210px radii) with 14px / Bold labels along their bisectors, an 80px
 *     white-and-black hub holding a 64px turquoise "SPIN" disc, a 26 × 25.5px
 *     turquoise pointer 12px above, three small "motion" bars 20px below; the
 *     disc casts 0 12px 24px / 19%;
 *   - a 1px #e5e5e5 rule 55px under the columns, and 56px under it the success
 *     card (turquoise 1px outline on #e0f2f1, 12px corners, 24px padding, a 36px
 *     turquoise disc with a white tick, 20px / Bold title over an 18px / Light
 *     grey line), hidden until the wheel stops.
 *
 * The wheel is an SVG in a 440 × 440 box, so it scales as one piece with
 * `--kbeu-pw-size`; the rotor (`g`) turns about the box's centre. Sizes are
 * `clamp()`s whose maximum is the Figma value.
 */

.kbeu-prize-wheel {
	--kbeu-pw-size: clamp( 260px, 17.19vw, 440px );
	--kbeu-pw-teal: var( --kbeu-color-teal );
	--kbeu-pw-spin: 6s;

	width: 100%;
	font-family: var( --kbeu-font-principal );
	color: #000;
}

.kbeu-prize-wheel__grid {
	display: grid;
	grid-template-columns: minmax( 0, 49.4% ) minmax( 0, 1fr );
	align-items: center;
	column-gap: 32px;
}

.kbeu-prize-wheel__main {
	min-width: 0;
}

/* --- Left column ----------------------------------------------------------- */

.kbeu-prize-wheel__play {
	margin-top: clamp( 32px, 2.27vw, 58px );
}

.kbeu-prize-wheel .kbeu-prize-wheel__play-title {
	margin: 0;
	padding: 0;
	font-family: inherit;
	font-weight: 700;
	font-size: clamp( 22px, 1.25vw, 32px );
	line-height: 1.37;
	letter-spacing: 0;
	color: #000;
}

.kbeu-prize-wheel__play-text {
	margin: clamp( 8px, 0.6vw, 15px ) 0 0;
	font-weight: 300;
	font-size: clamp( 16px, 0.94vw, 24px );
	line-height: 1.55;
	color: #000;
}

.kbeu-prize-wheel__hint {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: clamp( 20px, 1.5vw, 38px ) 0 0;
	padding: clamp( 8px, 0.39vw, 10px ) clamp( 14px, 0.78vw, 20px );
	border: 1.5px dashed #000;
	border-radius: 12px;
	background: #fff;
	font-weight: 300;
	font-size: clamp( 16px, 0.94vw, 24px );
	line-height: 1.55;
	color: #000;
	transition: border-color 0.3s ease, background-color 0.3s ease;
}

.kbeu-prize-wheel__hint-icon {
	flex: 0 0 auto;
	width: 0.83em;
	height: 0.83em;
}

.kbeu-prize-wheel__hint-icon--ready {
	display: none;
	color: var( --kbeu-pw-teal );
}

/* Clicked before entering: the hint points at the form. */
.kbeu-prize-wheel__hint.is-flash {
	border-color: var( --kbeu-pw-teal );
	background: #e0f2f1;
}

/* The entry is in: a solid turquoise outline and a tick. */
.kbeu-prize-wheel:not( [data-state='locked'] ) .kbeu-prize-wheel__hint {
	border-style: solid;
	border-color: var( --kbeu-pw-teal );
}

.kbeu-prize-wheel:not( [data-state='locked'] ) .kbeu-prize-wheel__hint-icon--info {
	display: none;
}

.kbeu-prize-wheel:not( [data-state='locked'] ) .kbeu-prize-wheel__hint-icon--ready {
	display: block;
}

.kbeu-prize-wheel__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	margin-top: clamp( 28px, 2.03vw, 52px );
}

.kbeu-prize-wheel .kbeu-prize-wheel__button {
	min-height: clamp( 46px, 2.11vw, 54px );
	padding: 0 clamp( 28px, 2.7vw, 69px );
	border-radius: 15px;
	font-family: inherit;
	font-weight: 400;
	font-size: clamp( 16px, 0.78vw, 20px );
	line-height: 1.5;
	cursor: pointer;
}

.kbeu-prize-wheel .kbeu-prize-wheel__button:disabled {
	opacity: 0.5;
	cursor: default;
}

.kbeu-prize-wheel__rules {
	margin-top: clamp( 20px, 1.72vw, 44px );
	font-weight: 400;
	font-size: clamp( 16px, 0.78vw, 20px );
	line-height: 1.5;
	color: #000;
	text-decoration: none;
}

a.kbeu-prize-wheel__rules:hover,
a.kbeu-prize-wheel__rules:focus-visible {
	color: var( --kbeu-pw-teal );
	text-decoration: underline;
}

/* --- The wheel ------------------------------------------------------------- */

/* Room for the pointer above (44 / 440 of the wheel) and for the disc's shadow
   at the sides (30 / 440), as in the design's 500 × 520 frame. */
.kbeu-prize-wheel__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-self: end;
	padding: calc( var( --kbeu-pw-size ) * 0.1 ) calc( var( --kbeu-pw-size ) * 0.068 ) 0;
}

.kbeu-prize-wheel__wheel {
	position: relative;
	width: var( --kbeu-pw-size );
	aspect-ratio: 1;
}

.kbeu-prize-wheel:is( [data-state='ready'] ) .kbeu-prize-wheel__wheel {
	cursor: pointer;
}

.kbeu-prize-wheel__svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	filter: drop-shadow( 0 calc( var( --kbeu-pw-size ) * 0.027 ) calc( var( --kbeu-pw-size ) * 0.027 ) rgba( 0, 0, 0, 0.19 ) );
}

.kbeu-prize-wheel__pointer {
	position: absolute;
	z-index: 1;
	top: -10%;
	left: 50%;
	width: 7.73%;
	height: 7.73%;
	transform: translateX( -50% );
	filter: drop-shadow( 0 2px 2px rgba( 0, 0, 0, 0.13 ) );
}

.kbeu-prize-wheel__rotor {
	transform-box: view-box;
	transform-origin: 50% 50%;
}

.kbeu-prize-wheel[data-state='spinning'] .kbeu-prize-wheel__rotor {
	transition: transform var( --kbeu-pw-spin ) cubic-bezier( 0.12, 0.66, 0.1, 1 );
}

.kbeu-prize-wheel__label,
.kbeu-prize-wheel__hub-label {
	font-family: var( --kbeu-font-principal );
	font-weight: 700;
	font-size: 14px;
	text-anchor: middle;
	dominant-baseline: central;
	pointer-events: none;
}

/* The design's three "motion" bars under the wheel; they slide while it spins. */
.kbeu-prize-wheel__motion {
	display: flex;
	gap: calc( var( --kbeu-pw-size ) * 0.018 );
	margin-top: calc( var( --kbeu-pw-size ) * 0.045 + 16px );
}

.kbeu-prize-wheel__motion i {
	display: block;
	width: calc( var( --kbeu-pw-size ) * 0.0545 );
	height: 4px;
	border-radius: 2px;
	background: var( --kbeu-pw-teal );
	opacity: 0.6;
}

.kbeu-prize-wheel__motion i:nth-child( 2 ) {
	width: calc( var( --kbeu-pw-size ) * 0.109 );
	background: #e5e5e5;
	opacity: 1;
}

.kbeu-prize-wheel__motion i:nth-child( 3 ) {
	width: calc( var( --kbeu-pw-size ) * 0.036 );
	opacity: 0.3;
}

.kbeu-prize-wheel[data-state='spinning'] .kbeu-prize-wheel__motion i {
	animation: kbeu-pw-motion 0.9s ease-in-out infinite alternate;
}

.kbeu-prize-wheel[data-state='spinning'] .kbeu-prize-wheel__motion i:nth-child( 2 ) {
	animation-delay: 0.15s;
}

.kbeu-prize-wheel[data-state='spinning'] .kbeu-prize-wheel__motion i:nth-child( 3 ) {
	animation-delay: 0.3s;
}

@keyframes kbeu-pw-motion {
	to {
		opacity: 1;
		background: var( --kbeu-pw-teal );
	}
}

/* The prize the wheel stopped on stands out once the result is shown. */
.kbeu-prize-wheel[data-state='done'] .kbeu-prize-wheel__segment:not( .is-won ),
.kbeu-prize-wheel[data-state='done'] .kbeu-prize-wheel__segment:not( .is-won ) + .kbeu-prize-wheel__label {
	opacity: 0.55;
	transition: opacity 0.4s ease;
}

/* --- Rule and success card ------------------------------------------------- */

.kbeu-prize-wheel .kbeu-prize-wheel__rule {
	display: block;
	height: 1px;
	margin: clamp( 32px, 2.15vw, 55px ) 0 0;
	padding: 0;
	border: 0;
	background: #e5e5e5;
}

.kbeu-prize-wheel__success {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: clamp( 24px, 2.19vw, 56px );
	/* The design's 24px are measured to the trimmed texts. */
	padding: clamp( 14px, 0.78vw, 20px ) clamp( 16px, 0.94vw, 24px ) clamp( 12px, 0.59vw, 15px );
	border: 1px solid var( --kbeu-pw-teal );
	border-radius: 12px;
	background: #e0f2f1;
}

.kbeu-prize-wheel__success[hidden] {
	display: none;
}

.kbeu-prize-wheel__success-icon {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var( --kbeu-pw-teal );
	color: #fff;
}

.kbeu-prize-wheel__success-icon svg {
	display: block;
	width: 18px;
	height: 18px;
}

.kbeu-prize-wheel__success-body {
	min-width: 0;
}

.kbeu-prize-wheel__success-title {
	margin: 0;
	font-weight: 700;
	font-size: clamp( 17px, 0.78vw, 20px );
	line-height: 1.3;
	color: var( --kbeu-color-ink );
}

.kbeu-prize-wheel__success-text {
	margin: 4px 0 0;
	font-weight: 300;
	font-size: clamp( 15px, 0.7vw, 18px );
	line-height: 1.4;
	color: #595959;
}

.kbeu-prize-wheel .kbeu-prize-wheel__prize {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect( 0 0 0 0 );
	white-space: nowrap;
	border: 0;
}

/* --- Stacked --------------------------------------------------------------- */

@media ( max-width: 1024px ) {
	.kbeu-prize-wheel__grid {
		grid-template-columns: minmax( 0, 1fr );
		row-gap: 40px;
	}

	.kbeu-prize-wheel__stage {
		justify-self: center;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.kbeu-prize-wheel {
		--kbeu-pw-spin: 0.01s;
	}

	.kbeu-prize-wheel__hint {
		transition: none;
	}

	.kbeu-prize-wheel[data-state='spinning'] .kbeu-prize-wheel__motion i {
		animation: none;
	}
}
