/* Equalise home page widgets */

.eq-demo,
.eq-helper,
.eq-stats {
	--eq-ink: #3b3f94;
	--eq-ink-soft: #6b6fb5;
	font-family: "Fredoka", "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
	color: var(--eq-ink);
	box-sizing: border-box;
}

.eq-demo *,
.eq-helper *,
.eq-stats * {
	box-sizing: border-box;
}

/* ---------- Live puzzle demo ---------- */

/* In centred sections Elementor shrinks widgets to their content; the demo needs the room. */
.elementor-widget-equalise-demo,
.elementor-widget-equalise-helper,
.elementor-widget-equalise-stats {
	width: 100%;
	max-width: 100%;
}

.eq-demo {
	container-type: inline-size;
	position: relative;
	width: 100%;
	max-width: 460px;
	margin: 0 auto;
	padding: 18px;
	background: #fff;
	border-radius: 30px;
	box-shadow: 0 10px 0 #e4e6fa, 0 24px 50px rgba(59, 63, 148, 0.16);
	overflow: hidden;
	transition: transform 0.4s ease;
}

.eq-demo-tilt-yes .eq-demo {
	transform: rotate(-1.5deg);
}

.eq-demo-tilt-yes .eq-demo.is-playing,
.eq-demo-tilt-yes .eq-demo:hover {
	transform: rotate(0);
}

.eq-demo-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 14px;
}

.eq-demo-head .eq-mascot {
	--m-size: 58px;
}

.eq-demo .eq-demo-bubble {
	margin: 0 0 0 6px;
	background: #f1f8ff;
	font-size: 15px;
	box-shadow: none;
}

.eq-demo .eq-demo-bubble::before {
	border-right-color: #f1f8ff;
}

.eq-demo-goal {
	display: grid;
	justify-items: center;
	flex: none;
}

.eq-demo-goal-label {
	font-size: 11px;
	font-weight: 600;
	color: var(--eq-ink-soft);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.eq-demo-goal-num {
	display: grid;
	place-items: center;
	min-width: 52px;
	height: 46px;
	padding: 0 8px;
	background: #5cc2ff;
	border-radius: 14px;
	box-shadow: 0 4px 0 #2fa2ea;
	color: #fff;
	font-size: 26px;
	font-weight: 700;
}

.eq-demo-board {
	display: grid;
	grid-template-columns: repeat(calc(var(--n) + 1), minmax(0, 1fr));
	gap: 7px;
	font-size: clamp(14px, calc(100cqi / (var(--n) + 1) * 0.36), 34px);
}

.eq-demo-cell,
.eq-demo-sum {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 14px;
	font-family: inherit;
	font-size: 1em;
	font-weight: 700;
	line-height: 1;
	color: var(--eq-ink);
}

.eq-demo .eq-demo-cell {
	background: #eef0fb;
	cursor: default;
}

.eq-demo .eq-demo-cell.is-empty {
	background: #ddf3ff;
	border: 2px dashed #5cc2ff;
}

.eq-demo.is-playing .eq-demo-cell:not(.is-fixed) {
	cursor: pointer;
}

.eq-demo .eq-demo-cell.is-target {
	animation: eq-demo-target 0.45s ease both;
}

.eq-demo-placed {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	border-radius: inherit;
	background: var(--tone);
	box-shadow: inset 0 -4px 0 var(--tone-edge);
	color: #fff;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

.eq-demo-placed.eq-land {
	animation: eq-demo-land 0.45s ease-out;
}

.eq-demo-sum {
	border: 2px solid #5cc2ff;
	background: #ddf3ff;
	font-size: 0.8em;
	transition: background 0.2s ease;
}

.eq-demo-sum.is-ok {
	background: #4fddaa;
	border-color: #28c48c;
	color: #fff;
}

.eq-demo-sum.is-bad {
	background: #ffe0e0;
	border-color: #ff8a8a;
	color: #c94a4a;
}

.eq-demo-sum.is-target {
	background: #5cc2ff;
	border-color: #5cc2ff;
	color: #fff;
	font-size: 0.66em;
}

.eq-demo-tray {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	min-height: 60px;
	margin-top: 16px;
	padding: 10px;
	background: #fff8e7;
	border-radius: 18px;
}

.eq-demo .eq-demo-tile {
	display: grid;
	place-items: center;
	width: 50px;
	height: 50px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: var(--tone);
	box-shadow: inset 0 -4px 0 var(--tone-edge);
	color: #fff;
	font-family: inherit;
	font-size: 22px;
	font-weight: 700;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.eq-demo .eq-demo-tile:hover {
	background: var(--tone);
	color: #fff;
}

.eq-demo .eq-demo-tile.is-lifted,
.eq-demo .eq-demo-tile.is-selected {
	transform: translateY(-8px) scale(1.1) rotate(-4deg);
	box-shadow: inset 0 -4px 0 var(--tone-edge), 0 8px 16px rgba(59, 63, 148, 0.25);
}

.eq-demo .eq-demo-tile.is-selected {
	outline: 3px solid var(--eq-ink);
	outline-offset: 2px;
}

.eq-demo .eq-demo-tile.is-used {
	display: none;
}

button.eq-demo-ghost,
button.eq-demo-ghost:hover,
button.eq-demo-ghost:focus,
.eq-demo-ghost {
	position: fixed;
	padding: 0;
	box-shadow: inset 0 -4px 0 var(--tone-edge), 0 10px 20px rgba(59, 63, 148, 0.3);
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
	z-index: 9999;
	display: grid;
	place-items: center;
	margin: 0;
	border: 0;
	border-radius: 14px;
	background: var(--tone);
	color: #fff;
	font-family: "Fredoka", system-ui, sans-serif;
	font-size: 22px;
	font-weight: 700;
	outline: 0;
	pointer-events: none;
	transition: transform 0.6s cubic-bezier(0.5, -0.3, 0.3, 1.3);
}

.eq-demo-cta {
	display: block;
	margin: 16px auto 0;
	padding: 12px 22px;
	width: fit-content;
	background: #ffd84d;
	border-radius: 999px;
	box-shadow: 0 5px 0 #f2b91a;
	color: var(--eq-ink) !important;
	font-weight: 700;
	text-decoration: none !important;
	transition: transform 0.15s ease;
}

.eq-demo-cta:hover {
	transform: translateY(-3px);
}

.eq-demo-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

.eq-demo-cell.eq-line-win {
	animation: eq-demo-pop 0.5s ease both;
	animation-delay: calc(var(--k, 0) * 60ms);
}

.eq-demo-cell.eq-line-win::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.85) 50%, transparent 70%);
	background-size: 260% 100%;
	pointer-events: none;
	animation: eq-demo-shine 0.9s ease both;
	animation-delay: calc(var(--k, 0) * 60ms);
}

.eq-demo-sum.eq-burst::after {
	content: "";
	position: absolute;
	inset: -3px;
	border: 3px solid #ffd84d;
	border-radius: inherit;
	animation: eq-demo-ring 0.8s ease-out both;
}

.eq-demo-board.is-solved .eq-demo-cell {
	animation: eq-demo-pop 0.6s ease both;
	animation-delay: calc(var(--rc, 0) * 70ms);
}

.eq-demo-confetti {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.eq-demo-confetti i {
	position: absolute;
	top: -16px;
	width: 10px;
	height: 14px;
	background: var(--tone);
	border-radius: 3px;
	animation: eq-demo-fall 2.4s ease-in both;
	animation-delay: var(--d);
}

.eq-demo-confetti i.is-star {
	width: 15px;
	height: 15px;
	border-radius: 0;
	clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes eq-demo-target {
	50% { transform: scale(1.1); box-shadow: 0 0 0 4px #ffd84d; }
	100% { box-shadow: 0 0 0 4px #ffd84d; }
}

@keyframes eq-demo-land {
	0% { transform: translateY(-12px) scale(0.7); }
	55% { transform: translateY(0) scale(1.14, 0.86); }
	80% { transform: scale(0.95, 1.05); }
	100% { transform: scale(1); }
}

@keyframes eq-demo-pop {
	50% { transform: scale(1.12) rotate(-2deg); }
}

@keyframes eq-demo-shine {
	0% { background-position: 130% 0; opacity: 1; }
	100% { background-position: -30% 0; opacity: 0; }
}

@keyframes eq-demo-ring {
	from { transform: scale(1); opacity: 1; }
	to { transform: scale(1.7); opacity: 0; }
}

@keyframes eq-demo-fall {
	0% { opacity: 1; transform: translate(0, 0) rotate(0); }
	100% { opacity: 0.2; transform: translate(var(--x), 520px) rotate(var(--r)); }
}

@media (max-width: 480px) {
	.eq-demo,
	.eq-demo-tilt-yes .eq-demo {
		padding: 14px;
		transform: none;
	}

	.eq-demo-head .eq-mascot {
		--m-size: 46px;
	}

	.eq-demo .eq-demo-bubble {
		font-size: 13px;
		padding: 8px 10px;
	}

	.eq-demo .eq-demo-tile {
		width: 44px;
		height: 44px;
		font-size: 20px;
	}
}

/* ---------- The Equalise helper ---------- */

.eq-helper {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
}

.eq-helper .eq-mascot {
	--m-size: var(--eq-helper-size, 150px);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.eq-helper .eq-mascot:focus-visible {
	outline: 3px solid #3b3f94;
	outline-offset: 6px;
	border-radius: 20px;
}

.eq-helper .eq-helper-bubble {
	flex: 0 1 280px;
	margin: 0 0 0 8px;
	padding: 14px 18px;
	font-size: 18px;
}

.eq-helper.bubble-left {
	flex-direction: row-reverse;
}

.eq-helper.bubble-left .eq-helper-bubble {
	margin: 0 8px 0 0;
}

.eq-helper.bubble-left .eq-helper-bubble::before {
	left: auto;
	right: -9px;
	border: 9px solid transparent;
	border-left-color: #fff;
	border-right: 0;
}

.eq-helper.bubble-top {
	flex-direction: column-reverse;
}

.eq-helper.bubble-top .eq-helper-bubble {
	flex-basis: auto;
	margin: 0 0 6px;
	text-align: center;
}

.eq-helper.bubble-top .eq-helper-bubble::before {
	top: auto;
	bottom: -9px;
	left: 50%;
	border: 9px solid transparent;
	border-top-color: #fff;
	border-bottom: 0;
	transform: translateX(-50%);
}

@media (max-width: 600px) {
	.eq-helper:not(.bubble-top) {
		flex-direction: column-reverse;
	}

	.eq-helper:not(.bubble-top) .eq-helper-bubble {
		flex-basis: auto;
		margin: 0 0 6px;
		text-align: center;
	}

	.eq-helper:not(.bubble-top) .eq-helper-bubble::before {
		top: auto;
		right: auto;
		bottom: -9px;
		left: 50%;
		border: 9px solid transparent;
		border-top-color: #fff;
		border-bottom: 0;
		transform: translateX(-50%);
	}
}

/* ---------- Floating symbols behind a section ---------- */

.eq-floaters-src {
	display: none;
}

.elementor-editor-active .eq-floaters-src {
	display: block;
	padding: 6px 10px;
	border: 2px dashed #b69cff;
	border-radius: 10px;
	color: #6b6fb5;
	font-size: 13px;
	text-align: center;
}

.elementor-widget-equalise-floaters {
	margin: 0 !important;
}

/* The symbols sit above the section background but below everything in it,
   without changing how Elementor positions anything inside the section. */
.eq-has-floaters {
	position: relative;
	overflow: hidden;
	isolation: isolate;
}

.eq-floaters-layer {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	pointer-events: none;
}

.eq-floaters-layer span {
	position: absolute;
	top: 105%;
	color: var(--tone);
	font-family: "Fredoka", system-ui, sans-serif;
	font-size: var(--size);
	font-weight: 700;
	opacity: var(--eq-float-opacity, 0.22);
	animation: eq-home-float var(--dur) linear infinite;
	animation-delay: var(--delay);
}

@keyframes eq-home-float {
	from { top: 105%; transform: rotate(0); }
	to { top: -12%; transform: rotate(var(--spin)); }
}

/* ---------- Game numbers ---------- */

.eq-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	gap: 18px;
}

.eq-stat-card {
	display: grid;
	justify-items: center;
	gap: 4px;
	padding: 22px 12px 18px;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 7px 0 var(--tone-light);
	text-align: center;
	transition: transform 0.2s ease;
}

.eq-stat-card:hover {
	transform: translateY(-5px) rotate(-1.5deg);
}

.eq-stat-icon {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	background: var(--tone);
	border-radius: 16px;
	box-shadow: inset 0 -4px 0 var(--tone-edge);
	color: #fff;
	font-size: 26px;
	font-weight: 700;
}

.eq-stat-num {
	font-size: clamp(34px, 5vw, 46px);
	font-weight: 700;
	line-height: 1.1;
	color: var(--eq-ink);
}

.eq-pop-done .eq-stat-num {
	animation: eq-stat-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.eq-stat-label {
	font-size: 16px;
	font-weight: 600;
	color: var(--eq-ink-soft);
}

@keyframes eq-stat-pop {
	50% { transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
	.eq-demo *,
	.eq-helper *,
	.eq-stats *,
	.eq-demo,
	.eq-demo-ghost {
		animation: none !important;
		transition: none !important;
	}
}

/* Keep the demo's look when a theme styles all buttons. */
.eq-demo button.eq-demo-cell,
.eq-demo button.eq-demo-cell:hover,
.eq-demo button.eq-demo-cell:focus {
	margin: 0;
	padding: 0;
	border: 0;
	background: #eef0fb;
	color: var(--eq-ink);
	font-size: 1em;
	text-transform: none;
}

.eq-demo button.eq-demo-cell.is-empty,
.eq-demo button.eq-demo-cell.is-empty:hover,
.eq-demo button.eq-demo-cell.is-empty:focus {
	background: #ddf3ff;
	border: 2px dashed #5cc2ff;
}

.eq-demo button.eq-demo-tile,
.eq-demo button.eq-demo-tile:hover,
.eq-demo button.eq-demo-tile:focus {
	padding: 0;
	border: 0;
	background: var(--tone);
	color: #fff;
	text-transform: none;
}

.eq-demo button:focus-visible {
	outline: 3px solid var(--eq-ink);
	outline-offset: 2px;
}
