/* =========================================================
   Maskot Bajtík
   ========================================================= */

.mk {
	--mk-size: 92px;
	position: fixed;
	left: 0;
	top: 0;
	z-index: 9990;
	width: var(--mk-size);
	height: var(--mk-size);
	will-change: transform;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
}
.mk[hidden] { display: none; }
@media (max-width: 600px) { .mk { --mk-size: 70px; } }

.mk-hit {
	position: absolute;
	inset: 0;
	padding: 0;
	margin: 0;
	border: 0;
	background: none !important;
	box-shadow: none !important;
	cursor: grab;
	-webkit-tap-highlight-color: transparent;
}
.mk.is-dragging .mk-hit { cursor: grabbing; }
.mk-hit:focus-visible { outline: 3px solid #C084FC; outline-offset: 4px; border-radius: 50%; }

.mk-flip { position: absolute; inset: 0; transition: transform .25s ease; }
.mk.face-left .mk-flip { transform: scaleX(-1); }
.mk-body { position: absolute; inset: 0; transform-origin: 50% 100%; }
.mk svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* tieň pod maskotom */
.mk-shadow {
	position: absolute;
	left: 18%;
	right: 18%;
	bottom: -4px;
	height: 10px;
	border-radius: 50%;
	background: rgba(0, 0, 0, .35);
	filter: blur(3px);
	transition: transform .2s ease, opacity .2s ease;
}

/* ---------- časti tela ---------- */
.mk .mk-eyes-closed { opacity: 0; }
.mk.is-blink .mk-eyes, .mk.is-sleeping .mk-eyes { opacity: 0; }
.mk.is-blink .mk-eyes-closed, .mk.is-sleeping .mk-eyes-closed { opacity: 1; }
.mk.is-happy.is-blink .mk-eyes-closed { opacity: 0; }
.mk .mk-pupils { transition: transform .12s ease-out; }
.mk .mk-arm-r, .mk .mk-arm-l { transform-box: fill-box; }
.mk .mk-arm-r { transform-origin: 30% 15%; transform: rotate(-25deg); }
.mk .mk-arm-l { transform-origin: 70% 15%; transform: rotate(25deg); }
.mk .mk-foot-l, .mk .mk-foot-r { transform-box: fill-box; transform-origin: 50% 50%; }
.mk .mk-tail { transform-box: fill-box; transform-origin: 0% 100%; animation: mk-tail 2.4s ease-in-out infinite; }
.mk .mk-mouth-happy, .mk .mk-eyes-happy { opacity: 0; }
.mk.is-happy .mk-mouth-happy, .mk.is-happy .mk-eyes-happy { opacity: 1; }
.mk.is-happy .mk-mouth, .mk.is-happy .mk-eyes { opacity: 0; }

/* dýchanie v pokoji */
.mk .mk-body { animation: mk-breathe 3.2s ease-in-out infinite; }

/* chôdza */
.mk.is-walking .mk-body { animation: mk-bob .36s ease-in-out infinite; }
.mk.is-walking .mk-foot-l { animation: mk-step .36s ease-in-out infinite; }
.mk.is-walking .mk-foot-r { animation: mk-step .36s ease-in-out -.18s infinite; }
.mk.is-walking .mk-shadow { transform: scaleX(.85); }

/* mávanie */
.mk.is-waving .mk-arm-r { animation: mk-wave .5s ease-in-out 4; }

/* radosť – skákanie */
.mk.is-jumping .mk-body { animation: mk-jump .6s cubic-bezier(.3, .7, .4, 1) infinite; }
.mk.is-jumping .mk-shadow { animation: mk-shadow-jump .6s cubic-bezier(.3, .7, .4, 1) infinite; }
.mk.is-jumping .mk-arm-r { animation: mk-cheer-r .3s ease-in-out infinite alternate; }
.mk.is-jumping .mk-arm-l { animation: mk-cheer-l .3s ease-in-out infinite alternate; }

/* spánok */
.mk.is-sleeping .mk-body { animation: mk-breathe 4.5s ease-in-out infinite; }

@keyframes mk-breathe { 50% { transform: scale(1.03, .97); } }
@keyframes mk-bob { 50% { transform: translateY(-7%) rotate(-2deg); } }
@keyframes mk-step { 50% { transform: translateY(-14%); } }
@keyframes mk-wave { 0%, 100% { transform: rotate(-170deg); } 50% { transform: rotate(-125deg); } }
@keyframes mk-tail { 50% { transform: rotate(12deg); } }
@keyframes mk-jump {
	0%   { transform: translateY(0) scale(1.12, .86); }
	30%  { transform: translateY(-62%) scale(.94, 1.08); }
	55%  { transform: translateY(-70%) scale(1, 1); }
	85%  { transform: translateY(0) scale(1.1, .88); }
	100% { transform: translateY(0) scale(1.12, .86); }
}
@keyframes mk-shadow-jump { 30%, 55% { transform: scale(.5); opacity: .35; } }
@keyframes mk-cheer-r { from { transform: rotate(-130deg); } to { transform: rotate(-165deg); } }
@keyframes mk-cheer-l { from { transform: rotate(130deg); } to { transform: rotate(165deg); } }

/* ---------- bublina ---------- */
.mk-bubble {
	position: absolute;
	bottom: calc(100% + 12px);
	left: 50%;
	width: max-content;
	max-width: 230px;
	padding: 10px 14px;
	border-radius: 16px;
	background: #fff;
	color: #1B1033;
	font: 600 14px/1.35 'Inter', system-ui, sans-serif;
	text-align: center;
	box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .45);
	transform: translateX(-50%) scale(.6);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.mk-bubble::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	margin-left: -8px;
	border: 8px solid transparent;
	border-top-color: #fff;
}
.mk-bubble.is-on { opacity: 1; transform: translateX(-50%) scale(1); }
.mk.bubble-below .mk-bubble { bottom: auto; top: calc(100% + 14px); }
.mk.bubble-below .mk-bubble::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #fff; }
.mk.bubble-left .mk-bubble { left: auto; right: -6px; transform: scale(.6); transform-origin: 90% 100%; }
.mk.bubble-left .mk-bubble.is-on { transform: scale(1); }
.mk.bubble-left .mk-bubble::after { left: auto; right: 30px; }
.mk.bubble-right .mk-bubble { left: -6px; transform: scale(.6); transform-origin: 10% 100%; }
.mk.bubble-right .mk-bubble.is-on { transform: scale(1); }
.mk.bubble-right .mk-bubble::after { left: 30px; }

/* ---------- malé tlačidlá (zvuk, skryť) ---------- */
.mk-tools {
	position: absolute;
	top: -6px;
	right: -14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	opacity: 0;
	transform: scale(.8);
	transition: opacity .2s ease, transform .2s ease;
}
.mk:hover .mk-tools, .mk:focus-within .mk-tools, .mk.tools-on .mk-tools { opacity: 1; transform: none; }
.mk-tool {
	width: 26px;
	height: 26px;
	padding: 0 !important;
	border: 1px solid rgba(255, 255, 255, .25) !important;
	border-radius: 50% !important;
	background: rgba(20, 16, 40, .9) !important;
	color: #E9E3FF !important;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
	display: flex;
	align-items: center;
	justify-content: center;
}
.mk-tool:hover { background: #7C4DFF !important; }
.mk-tool svg { width: 14px; height: 14px; }

/* srdiečka a hviezdičky pri radosti */
.mk-fx {
	position: fixed;
	z-index: 9991;
	pointer-events: none;
	font-size: 20px;
	animation: mk-fx 1.3s ease-out forwards;
}
@keyframes mk-fx {
	0% { transform: translate(0, 0) scale(.4) rotate(0); opacity: 0; }
	15% { opacity: 1; }
	100% { transform: translate(var(--dx), -110px) scale(1.15) rotate(var(--rot)); opacity: 0; }
}

/* zZz pri spánku */
.mk-zzz {
	position: absolute;
	top: -8px;
	right: 4px;
	font: 700 16px 'Space Grotesk', sans-serif;
	color: #C084FC;
	opacity: 0;
	pointer-events: none;
}
.mk.is-sleeping .mk-zzz { animation: mk-zzz 2.4s ease-in-out infinite; }
@keyframes mk-zzz { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -26px) scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
	.mk .mk-body, .mk .mk-tail, .mk.is-walking .mk-foot-l, .mk.is-walking .mk-foot-r { animation: none !important; }
	.mk.is-jumping .mk-body { animation: none; }
}
