/* Equalise puzzle game */

.eq-game {
	--eq-ink: #3b3f94;
	--eq-ink-soft: #6b6fb5;
	--eq-paper: #ffffff;
	--eq-bg: #fff8e7;
	--eq-line: #e4e6fa;
	--eq-accent: #5cc2ff;
	--eq-accent-edge: #2fa2ea;
	--eq-radius: 22px;
	--eq-font: "Fredoka", "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
	position: relative;
	max-width: 760px;
	margin: 0 auto;
	padding: clamp(14px, 3vw, 28px);
	background: var(--eq-bg);
	border-radius: calc(var(--eq-radius) + 6px);
	color: var(--eq-ink);
	font-family: var(--eq-font);
	line-height: 1.35;
	box-sizing: border-box;
	overflow: hidden;
}

.eq-game *,
.eq-game *::before,
.eq-game *::after {
	box-sizing: border-box;
}

.eq-game button {
	font-family: inherit;
	color: inherit;
	cursor: pointer;
}

.eq-loading {
	text-align: center;
	padding: 40px 0;
	color: var(--eq-ink-soft);
}

.eq-game.eq-ready .eq-loading {
	display: none;
}


/* ---------- Buttons ---------- */

.eq-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 46px;
	padding: 10px 20px;
	border: 0;
	border-radius: 999px;
	font-size: 17px;
	font-weight: 600;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.eq-btn:active {
	transform: translateY(3px);
}

.eq-btn-main {
	background: var(--eq-accent);
	color: #fff !important;
	box-shadow: 0 5px 0 var(--eq-accent-edge);
}

.eq-btn-main:active {
	box-shadow: 0 2px 0 var(--eq-accent-edge);
}

.eq-btn-soft {
	background: var(--eq-paper);
	box-shadow: 0 4px 0 var(--eq-line);
}

.eq-btn-ghost {
	min-height: 40px;
	padding: 6px 14px;
	background: rgba(255, 255, 255, 0.75);
	font-size: 15px;
}

.eq-link {
	display: block;
	margin: 22px auto 0;
	padding: 6px 10px;
	border: 0;
	background: none;
	color: var(--eq-ink-soft) !important;
	font-size: 14px;
	text-decoration: underline;
}

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

/* ---------- Level map ---------- */

.eq-scorebar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 14px;
	padding: 12px 18px;
	margin-bottom: 18px;
	background: var(--eq-paper);
	border-radius: var(--eq-radius);
	box-shadow: 0 5px 0 var(--eq-line);
}

.eq-scorebar-label {
	font-weight: 500;
	color: var(--eq-ink-soft);
}

.eq-scorebar-value {
	font-size: 28px;
	font-weight: 700;
	color: var(--eq-ink);
}

.eq-scorebar-value::before {
	content: "⭐ ";
	font-size: 22px;
}

.eq-scorebar-count {
	margin-left: auto;
	padding: 4px 12px;
	background: #d9f8eb;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
}

.eq-level {
	margin-bottom: 22px;
}

.eq-level-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin-bottom: 12px;
}

.eq-game .eq-level-title {
	margin: 0;
	font-family: inherit;
	font-size: clamp(22px, 4vw, 28px);
	font-weight: 700;
	color: var(--eq-ink);
}

.eq-game .eq-level-desc {
	flex-basis: 100%;
	margin: 0;
	color: var(--eq-ink-soft);
	font-size: 15px;
}

.eq-level-lock {
	padding: 3px 10px;
	background: #ffe0e0;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
}

.eq-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 14px;
}

.eq-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 14px 8px 12px;
	border: 0;
	border-radius: var(--eq-radius);
	background: var(--tone);
	box-shadow: 0 6px 0 var(--tone-edge);
	color: #fff !important;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
	transition: transform 0.18s ease;
	animation: eq-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	animation-delay: calc(var(--i, 0) * 50ms);
}

.eq-card:hover:not(.is-locked):not([aria-disabled="true"]) {
	transform: translateY(-4px) rotate(-1.5deg);
}

.eq-card-num {
	font-size: 14px;
	font-weight: 500;
	opacity: 0.95;
}

.eq-card-size {
	font-size: 34px;
	font-weight: 700;
	line-height: 1.1;
}

.eq-card-foot {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 40px;
	justify-content: center;
}

.eq-card-play {
	padding: 3px 14px;
	background: rgba(255, 255, 255, 0.95);
	color: var(--tone-edge);
	border-radius: 999px;
	font-size: 15px;
	font-weight: 700;
	text-shadow: none;
}

.eq-card-stars {
	color: #fff59d;
	font-size: 20px;
	letter-spacing: 2px;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
}

.eq-card-score {
	font-size: 13px;
	font-weight: 600;
}

.eq-card-badge {
	position: absolute;
	top: -8px;
	right: -8px;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	background: #4fddaa;
	border: 3px solid #fff;
	border-radius: 50%;
	font-size: 14px;
	text-shadow: none;
}

.eq-card-lock {
	font-size: 24px;
}

.eq-card.is-locked {
	background: #d8dbef;
	box-shadow: 0 6px 0 #c3c7e4;
	color: #8a8fc4 !important;
	text-shadow: none;
	cursor: not-allowed;
}

.eq-card.is-done[aria-disabled="true"] {
	cursor: default;
}

/* ---------- Game screen ---------- */

.eq-play {
	position: relative;
}

.eq-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 14px;
}

.eq-top-title {
	font-weight: 600;
	color: var(--eq-ink-soft);
}

.eq-target {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 12px;
	padding: 12px 16px;
	background: var(--tone-light);
	border-radius: var(--eq-radius);
	text-align: center;
	font-size: clamp(16px, 2.6vw, 19px);
	font-weight: 500;
}

.eq-target-num {
	display: inline-grid;
	place-items: center;
	min-width: 64px;
	height: 52px;
	padding: 0 12px;
	background: var(--tone);
	box-shadow: 0 4px 0 var(--tone-edge);
	border-radius: 16px;
	color: #fff;
	font-size: 30px;
	font-weight: 700;
	animation: eq-bounce 2.6s ease-in-out infinite;
}

.eq-stats {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin: 12px 0;
}

.eq-stat {
	padding: 4px 14px;
	background: var(--eq-paper);
	border-radius: 999px;
	font-weight: 600;
	font-size: 15px;
	box-shadow: 0 3px 0 var(--eq-line);
}

.eq-board-wrap {
	container-type: inline-size;
	width: 100%;
	max-width: calc((var(--n) + 1) * 70px);
	margin: 0 auto;
}

.eq-board {
	--gap: clamp(3px, calc(14px - var(--n) * 1px), 8px);
	display: grid;
	grid-template-columns: repeat(calc(var(--n) + 1), minmax(0, 1fr));
	gap: var(--gap);
	padding: var(--gap);
	background: var(--eq-paper);
	border-radius: var(--eq-radius);
	box-shadow: 0 6px 0 var(--eq-line);
	font-size: calc(100cqi / (var(--n) + 1) * 0.42);
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.eq-cell,
.eq-sum {
	position: relative;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	border-radius: clamp(6px, calc(20px - var(--n) * 1.4px), 14px);
	font-weight: 700;
}

.eq-cell.is-empty {
	background: var(--cell-bg, var(--tone-light));
	border: 2px dashed color-mix(in srgb, var(--cell-bg, var(--tone-light)) 45%, #3b3f94);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.eq-cell.is-fixed {
	background: var(--cell-bg, #eef0fb);
	color: var(--eq-ink);
}

.eq-cell.is-fixed.on-dark {
	color: #fff;
}

.eq-cell.is-filled {
	background: var(--cell-bg, transparent);
}

.eq-cell.is-fixed .eq-num {
	opacity: 0.9;
}

.eq-cell.is-over {
	transform: scale(1.08);
	border-style: solid;
	box-shadow: 0 0 0 3px var(--eq-ink);
}

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

.eq-sum {
	font-size: 0.82em;
	border: 2px solid transparent;
}

.eq-sum.is-under {
	background: #ddf3ff;
	border-color: #5cc2ff;
}

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

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

.eq-sum.is-hidden {
	background: var(--eq-paper);
	border-color: var(--eq-line);
	color: var(--eq-ink-soft);
}

.eq-sum.is-target {
	background: var(--tone);
	color: #fff;
	font-size: 0.7em;
}

/* Number tiles */
.eq-tile {
	position: relative;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 14px;
	background: var(--tone);
	box-shadow: inset 0 -4px 0 var(--tone-edge);
	color: #fff !important;
	font-family: "Fredoka", "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
	font-weight: 700;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
	cursor: grab;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}

.eq-cell .eq-tile {
	width: 100%;
	height: 100%;
	border-radius: inherit;
	font-size: 1em;
}

.eq-tile.is-dragging {
	opacity: 0.3;
}

.eq-ghost {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 99999;
	pointer-events: none;
	box-shadow: inset 0 -4px 0 var(--tone-edge), 0 12px 24px rgba(59, 63, 148, 0.3);
	font-size: 22px;
	cursor: grabbing;
}

.eq-game.is-dragging,
.eq-game.is-dragging * {
	cursor: grabbing;
}

/* Tray */
.eq-tray-help {
	margin: 18px 0 8px;
	text-align: center;
	color: var(--eq-ink-soft);
	font-size: 15px;
}

.eq-tray {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	min-height: 76px;
	padding: 12px;
	background: rgba(255, 255, 255, 0.7);
	border: 3px dashed transparent;
	border-radius: var(--eq-radius);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.eq-tray.is-over {
	border-color: var(--tone);
	background: var(--tone-light);
}

.eq-tray .eq-tile {
	width: clamp(46px, 11vw, 58px);
	height: clamp(46px, 11vw, 58px);
	font-size: clamp(19px, 4.4vw, 24px);
	transition: transform 0.15s ease;
}

.eq-tray .eq-tile:hover {
	transform: translateY(-3px) rotate(-3deg);
}

.eq-tray .eq-tile.is-selected {
	transform: translateY(-6px) scale(1.08);
	outline: 3px solid var(--eq-ink);
	outline-offset: 2px;
}

.eq-tray-empty {
	align-self: center;
	font-weight: 600;
	color: var(--eq-ink-soft);
}

.eq-actions {
	display: flex;
	justify-content: center;
	margin-top: 16px;
}

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

/* ---------- Win screen ---------- */

.eq-win {
	position: absolute;
	inset: -10px;
	z-index: 20;
	display: grid;
	place-items: center;
	padding: 16px;
	background: rgba(255, 248, 231, 0.82);
	backdrop-filter: blur(3px);
	animation: eq-fade 0.3s ease both;
}

.eq-win-box {
	width: min(420px, 100%);
	padding: 26px 22px 24px;
	background: var(--eq-paper);
	border-radius: 28px;
	box-shadow: 0 10px 0 var(--eq-line), 0 20px 40px rgba(59, 63, 148, 0.18);
	text-align: center;
	animation: eq-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.eq-game .eq-win-title {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: 34px;
	font-weight: 700;
	color: var(--eq-ink);
	outline: none;
}

.eq-win-stars {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-bottom: 8px;
}

.eq-star {
	font-size: 52px;
	line-height: 1;
	color: #e4e6fa;
}

.eq-star.is-on {
	color: #ffd84d;
	text-shadow: 0 4px 0 #f2b91a;
	animation: eq-star 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	animation-delay: var(--d);
}

.eq-game .eq-win-points {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	color: #28c48c;
}

.eq-game .eq-win-moves,
.eq-game .eq-win-unlock {
	margin: 6px 0 0;
	color: var(--eq-ink-soft);
}

.eq-game .eq-win-unlock {
	font-weight: 600;
	color: var(--eq-ink);
}

.eq-win-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin-top: 18px;
}

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

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

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

/* ---------- Animations ---------- */

.eq-enter {
	animation: eq-fade 0.35s ease both;
}

.eq-pop {
	animation: eq-pop 0.45s ease-out;
}

.eq-shake {
	animation: eq-shake 0.4s ease;
}

.eq-return {
	animation: eq-pop 0.3s ease;
}

.eq-nudge {
	animation: eq-shake 0.35s ease;
}

.eq-glow {
	animation: eq-glow 0.7s ease;
}

@keyframes eq-fade {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@keyframes eq-card-in {
	from { opacity: 0; transform: translateY(16px) scale(0.9); }
	to { opacity: 1; transform: none; }
}

@keyframes eq-pop {
	0% { transform: translateY(-14px) 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-pop-in {
	from { opacity: 0; transform: scale(0.7); }
	to { opacity: 1; transform: none; }
}

@keyframes eq-shake {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-5px); }
	50% { transform: translateX(5px); }
	75% { transform: translateX(-3px); }
}

@keyframes eq-glow {
	0% { transform: scale(1); }
	50% { transform: scale(1.18); box-shadow: 0 0 0 6px rgba(79, 221, 170, 0.35); }
	100% { transform: scale(1); }
}

@keyframes eq-bounce {
	0%, 100% { transform: translateY(0); }
	50% { transform: translateY(-4px); }
}

@keyframes eq-star {
	from { opacity: 0; transform: scale(0) rotate(-90deg); }
	to { opacity: 1; transform: none; }
}

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

@keyframes eq-wave {
	50% { transform: scale(1.1); }
}

.eq-game .eq-admin-note {
	margin: 0 0 14px;
	padding: 10px 14px;
	background: #fff3bf;
	border: 2px dashed #f2b91a;
	border-radius: 14px;
	color: var(--eq-ink);
	font-size: 14px;
	font-weight: 600;
}

/* Target bar with the helper and its speech bubble */
.eq-target.has-mascot {
	flex-wrap: nowrap;
	justify-content: flex-start;
	gap: 10px;
	padding: 10px 14px;
	text-align: left;
}

.eq-login-tiles .eq-mascot {
	--m-size: 84px;
	margin: -12px 4px 0;
}

.eq-win-box .eq-mascot {
	--m-size: 92px;
	margin: -78px auto 0;
}

/* Sound button */
.eq-game button.eq-sound,
.eq-game button.eq-sound:hover,
.eq-game button.eq-sound:focus {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.85);
	box-shadow: 0 3px 0 var(--eq-line);
	font-size: 19px;
	line-height: 1;
}

.eq-scorebar .eq-sound {
	margin-left: 4px;
}

/* Balanced line: shine sweep and a ring around its total */
.eq-cell.eq-line-win {
	animation: eq-line-pop 0.5s ease both;
	animation-delay: calc(var(--k, 0) * 45ms);
}

.eq-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-shine 0.9s ease both;
	animation-delay: calc(var(--k, 0) * 45ms);
}

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

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

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

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

/* Floating maths symbols */
.eq-game > .eq-floaters {
	position: absolute;
	inset: 0;
	z-index: 0;
	overflow: hidden;
	pointer-events: none;
}

.eq-floaters span {
	position: absolute;
	top: 105%;
	color: var(--tone);
	font-size: var(--size);
	font-weight: 700;
	opacity: 0.22;
	animation: eq-float var(--dur) linear infinite;
	animation-delay: var(--delay);
}

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

.eq-game > .eq-map,
.eq-game > .eq-login,
.eq-game > .eq-play {
	position: relative;
	z-index: 1;
}

/* Map extras */
.eq-level-progress {
	display: flex;
	flex-basis: 100%;
	align-items: center;
	gap: 10px;
	margin-top: 4px;
}

.eq-level-track {
	flex: 1;
	max-width: 260px;
	height: 12px;
	overflow: hidden;
	background: #fff;
	border-radius: 999px;
	box-shadow: inset 0 0 0 2px var(--eq-line);
}

.eq-level-fill {
	display: block;
	width: var(--pct);
	height: 100%;
	background: linear-gradient(90deg, #ffd84d, #ffb25c);
	border-radius: inherit;
	animation: eq-grow 1s ease-out both;
}

@keyframes eq-grow {
	from { width: 0; }
	to { width: var(--pct); }
}

.eq-level-stars {
	font-size: 14px;
	font-weight: 700;
	color: #f2b91a;
}

.eq-card.is-next {
	animation: eq-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both, eq-next-glow 1.8s ease-in-out 0.6s infinite;
}

.eq-card-next {
	position: absolute;
	top: -14px;
	left: 50%;
	padding: 3px 12px;
	background: #ffd84d;
	border: 3px solid #fff;
	border-radius: 999px;
	color: var(--eq-ink);
	font-size: 13px;
	font-weight: 700;
	text-shadow: none;
	white-space: nowrap;
	transform: translateX(-50%);
	animation: eq-badge-bounce 1.2s ease-in-out infinite;
}

@keyframes eq-next-glow {
	0%, 100% { box-shadow: 0 6px 0 var(--tone-edge), 0 0 0 0 rgba(255, 216, 77, 0); }
	50% { box-shadow: 0 6px 0 var(--tone-edge), 0 0 0 8px rgba(255, 216, 77, 0.45); }
}

@keyframes eq-badge-bounce {
	0%, 100% { transform: translate(-50%, 0); }
	50% { transform: translate(-50%, -6px); }
}

.eq-card.eq-unlocked-now {
	animation: eq-unlock-pop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both, eq-next-glow 1.8s ease-in-out 1.2s infinite;
}

.eq-unlock-burst {
	position: absolute;
	top: 30%;
	left: 50%;
	font-size: 34px;
	text-shadow: none;
	pointer-events: none;
	animation: eq-unlock-fly 1.1s ease-out 0.3s both;
}

@keyframes eq-unlock-pop {
	0% { transform: scale(0.8) rotate(-6deg); filter: grayscale(1); }
	60% { transform: scale(1.12) rotate(3deg); filter: grayscale(0); }
	100% { transform: none; }
}

@keyframes eq-unlock-fly {
	0% { transform: translate(-50%, 0) scale(1); opacity: 1; }
	100% { transform: translate(-50%, -70px) scale(1.6) rotate(20deg); opacity: 0; }
}

/* Confetti shapes */
.eq-confetti i.is-star {
	width: 16px;
	height: 16px;
	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%);
}

.eq-confetti i.is-dot {
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

@media (max-width: 480px) {
	.eq-play .eq-top {
		flex-wrap: nowrap;
		gap: 8px;
	}

	.eq-play .eq-top-title {
		flex: 1;
		min-width: 0;
		font-size: 14px;
		text-align: center;
	}

	.eq-target.has-mascot .eq-mascot {
		--m-size: 54px;
	}

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

	.eq-target.has-mascot .eq-target-num {
		min-width: 54px;
		height: 46px;
		font-size: 26px;
	}
}

/* ---------- Other operations ---------- */

.eq-sum.eq-sum-op {
	font-size: 0.72em;
	line-height: 1;
}

.eq-sum-sign {
	margin-right: 1px;
	font-size: 0.85em;
	opacity: 0.85;
}

.eq-target-num.is-sign {
	min-width: 64px;
	padding: 0 12px;
	font-size: 26px;
	letter-spacing: 2px;
}

.eq-card-op {
	position: absolute;
	top: 8px;
	left: 8px;
	padding: 1px 7px;
	background: rgba(255, 255, 255, 0.9);
	border-radius: 999px;
	color: var(--eq-ink);
	font-size: 13px;
	font-weight: 700;
	text-shadow: none;
}

/* ---------- Hints ---------- */

.eq-actions {
	flex-wrap: wrap;
	gap: 12px;
}

.eq-game button.eq-btn-hint,
.eq-game button.eq-btn-hint:hover,
.eq-game button.eq-btn-hint:focus {
	background: #ffd84d;
	color: var(--eq-ink);
	box-shadow: 0 5px 0 #f2b91a;
}

.eq-game button.eq-btn-hint:disabled {
	background: #eef0fb;
	box-shadow: 0 4px 0 var(--eq-line);
	color: var(--eq-ink-soft);
	cursor: not-allowed;
	opacity: 0.8;
}

.eq-cell.eq-hint-glow {
	z-index: 2;
	animation: eq-hint-glow 1.6s ease-out;
}

@keyframes eq-hint-glow {
	0% { box-shadow: 0 0 0 0 rgba(255, 216, 77, 0.9); transform: scale(1.15); }
	40% { box-shadow: 0 0 0 10px rgba(255, 216, 77, 0.45); transform: scale(1.05); }
	100% { box-shadow: 0 0 0 0 rgba(255, 216, 77, 0); transform: scale(1); }
}

/* ---------- Level map ---------- */

.eq-level-count {
	padding: 2px 10px;
	background: #fff;
	border-radius: 999px;
	box-shadow: inset 0 0 0 2px var(--eq-line);
	font-size: 13px;
	font-weight: 700;
	color: var(--eq-ink-soft);
}

.eq-level.is-complete {
	padding: 14px;
	margin-left: -14px;
	margin-right: -14px;
	background: linear-gradient(135deg, rgba(255, 216, 77, 0.22), rgba(255, 178, 92, 0.12));
	border: 3px solid #ffd84d;
	border-radius: calc(var(--eq-radius) + 4px);
}

.eq-level-done {
	padding: 3px 12px;
	background: #ffd84d;
	border-radius: 999px;
	color: var(--eq-ink);
	font-size: 14px;
	font-weight: 700;
	animation: eq-badge-bounce-flat 2s ease-in-out infinite;
}

@keyframes eq-badge-bounce-flat {
	0%, 100% { transform: translateY(0) rotate(-2deg); }
	50% { transform: translateY(-3px) rotate(2deg); }
}

/* ---------- Level unlocked screen ---------- */

.eq-splash {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 10px;
	padding: 30px 10px 20px;
	text-align: center;
}

.eq-splash .eq-mascot {
	--m-size: 120px;
}

.eq-game .eq-splash-kicker {
	margin: 0;
	padding: 4px 14px;
	background: #d9f8eb;
	border-radius: 999px;
	font-weight: 700;
	color: #127a52;
}

.eq-game .eq-splash-title {
	margin: 0;
	font-family: inherit;
	font-size: clamp(32px, 7vw, 46px);
	font-weight: 700;
	color: var(--eq-ink);
	outline: none;
	animation: eq-pop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.eq-game .eq-splash-desc {
	max-width: 440px;
	margin: 0;
	color: var(--eq-ink-soft);
	font-size: 17px;
}

.eq-splash-chips {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
	margin: 10px 0 6px;
}

.eq-splash-chip {
	padding: 10px 14px;
	background: var(--tone);
	border-radius: 16px;
	box-shadow: 0 5px 0 var(--tone-edge);
	color: #fff;
	font-size: 22px;
	font-weight: 700;
	text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
	animation: eq-card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
	animation-delay: calc(0.3s + var(--i, 0) * 90ms);
}

.eq-game button.eq-splash-go {
	min-height: 56px;
	padding: 12px 30px;
	font-size: 21px;
}

/* ---------- Typing numbers (phones and tablets) ---------- */

.eq-game.is-type-mode .eq-board,
.eq-game.is-type-mode .eq-tile {
	touch-action: manipulation;
}

.eq-game.is-type-mode .eq-cell:not(.is-fixed) {
	cursor: pointer;
}

.eq-cell.is-entry {
	z-index: 2;
	box-shadow: 0 0 0 3px var(--eq-ink), 0 0 0 6px #ffd84d;
	animation: eq-pulse 1.4s ease-in-out infinite;
}

.eq-cell.is-typing {
	background: #fff;
	border: 0;
	color: var(--eq-ink);
}

.eq-entry-text {
	font-weight: 700;
}

@keyframes eq-pulse {
	0%, 100% { box-shadow: 0 0 0 3px var(--eq-ink), 0 0 0 6px #ffd84d; }
	50% { box-shadow: 0 0 0 3px var(--eq-ink), 0 0 0 9px rgba(255, 216, 77, 0.6); }
}

.eq-keypad {
	position: sticky;
	bottom: 8px;
	z-index: 15;
	width: min(360px, 100%);
	margin: 12px auto 0;
	padding: 10px;
	background: var(--eq-paper);
	border-radius: var(--eq-radius);
	box-shadow: 0 6px 0 var(--eq-line), 0 10px 28px rgba(59, 63, 148, 0.22);
}

.eq-keypad[hidden] {
	display: none;
}

.eq-game .eq-keypad-msg {
	min-height: 0;
	margin: 0;
	color: #c94a4a;
	font-size: 14px;
	font-weight: 600;
	text-align: center;
}

.eq-game .eq-keypad-msg:not(:empty) {
	margin-bottom: 8px;
}

.eq-keypad-keys {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.eq-game button.eq-key,
.eq-game button.eq-key:hover,
.eq-game button.eq-key:focus {
	min-height: 52px;
	padding: 0;
	border-radius: 16px;
	background: #ddf3ff;
	color: var(--eq-ink);
	font-size: 26px;
	font-weight: 700;
	box-shadow: inset 0 -4px 0 #b9e3fb;
}

.eq-game button.eq-key:active {
	transform: translateY(2px);
	box-shadow: inset 0 -2px 0 #b9e3fb;
}

.eq-game button.eq-key.is-back,
.eq-game button.eq-key.is-back:hover,
.eq-game button.eq-key.is-back:focus {
	background: #ffe0e0;
	box-shadow: inset 0 -4px 0 #ffc2c2;
}

.eq-game button.eq-key.is-ok,
.eq-game button.eq-key.is-ok:hover,
.eq-game button.eq-key.is-ok:focus {
	background: #4fddaa;
	color: #fff;
	font-size: 22px;
	box-shadow: inset 0 -4px 0 #28c48c;
}

.eq-game button.eq-key-clear,
.eq-game button.eq-key-clear:hover,
.eq-game button.eq-key-clear:focus {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 8px;
	border-radius: 14px;
	background: none;
	color: var(--eq-ink-soft);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
}

.eq-game .eq-chips-title {
	margin: 18px 0 8px;
	text-align: center;
	font-weight: 700;
	color: var(--eq-ink);
}

.eq-game.is-type-mode .eq-tray button.eq-tile {
	cursor: pointer;
}

/* ---------- Who is playing ---------- */

.eq-login {
	display: grid;
	justify-items: center;
	gap: 18px;
	padding: 10px 0 6px;
}

.eq-login-tiles {
	display: flex;
	gap: 10px;
}

.eq-login-tiles .eq-tile {
	width: 54px;
	height: 54px;
	font-size: 26px;
	cursor: default;
	animation: eq-hop 2.4s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.18s);
}

.eq-login-form {
	width: min(420px, 100%);
	padding: 24px 22px 22px;
	background: var(--eq-paper);
	border-radius: var(--eq-radius);
	box-shadow: 0 8px 0 var(--eq-line);
	text-align: center;
}

.eq-game .eq-login-title {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: clamp(24px, 5vw, 30px);
	font-weight: 700;
	color: var(--eq-ink);
}

.eq-game .eq-login-intro {
	margin: 0 0 16px;
	color: var(--eq-ink-soft);
	font-size: 15px;
}

.eq-field {
	display: grid;
	gap: 6px;
	margin-bottom: 14px;
	text-align: left;
}

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

.eq-game .eq-field input,
.eq-game .eq-field select {
	width: 100%;
	min-height: 50px;
	padding: 10px 14px;
	border: 3px solid var(--eq-line);
	border-radius: 16px;
	background: #fff;
	color: var(--eq-ink);
	font-family: inherit;
	font-size: 19px;
	font-weight: 600;
	box-shadow: none;
}

.eq-game .eq-field input::placeholder {
	color: #a9acd6;
	font-weight: 500;
}

.eq-game .eq-field input:focus,
.eq-game .eq-field select:focus {
	border-color: var(--eq-accent);
	outline: none;
}

.eq-game .eq-login-error {
	min-height: 22px;
	margin: 0 0 10px;
	color: #c94a4a;
	font-weight: 600;
}

.eq-game button.eq-login-go {
	width: 100%;
	min-height: 54px;
	font-size: 20px;
}

.eq-login.is-busy .eq-login-go {
	opacity: 0.7;
	cursor: progress;
}

.eq-hello {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 12px;
	margin-bottom: 12px;
}

.eq-hello-name {
	font-size: clamp(20px, 4vw, 24px);
	font-weight: 700;
	color: var(--eq-ink);
}

.eq-game button.eq-hello-change {
	display: inline;
	margin: 0;
}

@keyframes eq-hop {
	0%, 60%, 100% { transform: translateY(0) rotate(0); }
	30% { transform: translateY(-8px) rotate(-6deg); }
}

@media (max-width: 480px) {
	.eq-cards {
		grid-template-columns: repeat(2, 1fr);
	}

	.eq-scorebar-count {
		margin-left: 0;
	}

	.eq-top {
		justify-content: center;
	}
}

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

/* Elementor widget heading */
.eq-widget-head {
	max-width: 760px;
	margin: 0 auto 18px;
	text-align: center;
	color: #3b3f94;
	font-family: "Fredoka", "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
}

.eq-widget-head .eq-widget-title {
	margin: 0 0 6px;
	font-family: inherit;
	font-size: clamp(28px, 5vw, 40px);
	font-weight: 700;
	color: inherit;
}

.eq-widget-head .eq-widget-intro {
	margin: 0;
	font-size: 18px;
	opacity: 0.85;
}

/* Keep the game's look when a theme styles all buttons. */
.eq-game button,
.eq-game button:hover,
.eq-game button:focus,
button.eq-ghost {
	margin: 0;
	border: 0;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.2;
	white-space: normal;
}

.eq-game button.eq-tile,
.eq-game button.eq-tile:hover,
.eq-game button.eq-tile:focus,
button.eq-tile.eq-ghost {
	padding: 0;
	border-radius: 14px;
	background: var(--tone);
	color: #fff;
}

.eq-game button.eq-card,
.eq-game button.eq-card:hover,
.eq-game button.eq-card:focus {
	padding: 14px 8px 12px;
	border-radius: var(--eq-radius);
	background: var(--tone);
	color: #fff;
}

.eq-game button.eq-card.is-locked,
.eq-game button.eq-card.is-locked:hover,
.eq-game button.eq-card.is-locked:focus {
	background: #d8dbef;
	color: #8a8fc4;
}

.eq-game button.eq-btn {
	padding: 10px 20px;
	border-radius: 999px;
	font-size: 17px;
	font-weight: 600;
}

.eq-game button.eq-btn-ghost {
	padding: 6px 14px;
	font-size: 15px;
}

.eq-game button.eq-btn-main,
.eq-game button.eq-btn-main:hover,
.eq-game button.eq-btn-main:focus {
	background: var(--eq-accent);
	color: #fff;
}

.eq-game button.eq-btn-soft,
.eq-game button.eq-btn-soft:hover,
.eq-game button.eq-btn-soft:focus {
	background: var(--eq-paper);
	color: var(--eq-ink);
}

.eq-game button.eq-btn-ghost,
.eq-game button.eq-btn-ghost:hover,
.eq-game button.eq-btn-ghost:focus {
	background: rgba(255, 255, 255, 0.75);
	color: var(--eq-ink);
}

.eq-game button.eq-link,
.eq-game button.eq-link:hover,
.eq-game button.eq-link:focus {
	padding: 6px 10px;
	background: none;
	color: var(--eq-ink-soft);
	font-size: 14px;
}

.eq-game button.eq-btn:hover,
.eq-game button.eq-card:hover:not(.is-locked) {
	filter: brightness(1.04);
}

.eq-game button.eq-tile,
button.eq-tile.eq-ghost {
	font-family: "Fredoka", "Baloo 2", "Comic Sans MS", system-ui, sans-serif;
	font-weight: 700;
}

.eq-game .eq-tray button.eq-tile {
	font-size: clamp(19px, 4.4vw, 24px);
}

/* Big boards have many tiles: make them a little smaller so the tray stays short. */
.eq-game .eq-tray.is-many {
	gap: 8px;
}

.eq-game .eq-tray.is-many button.eq-tile {
	width: clamp(40px, 9.5vw, 50px);
	height: clamp(40px, 9.5vw, 50px);
	font-size: clamp(17px, 4vw, 21px);
}

button.eq-tile.eq-ghost {
	font-size: 22px;
}

.eq-game button.eq-card {
	font-family: inherit;
	font-weight: 400;
}

.eq-game button.eq-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	width: 100%;
	height: auto;
	text-align: center;
}
