/*
 * DodaSoft_AnimatedMascot: animated lime ticket with navy stick arms and legs.
 * Size comes from --fl-mascot-size (set inline from render()).
 * Scenarios: panic, wave, celebrate, think, point, sad.
 * Layouts: inline (text right), balloon (above), corner (fixed in the screen corner), icon.
 */

.fl-mascot {
    --fl-mascot-size: 96px;
    --fl-balloon-bg: #ffffff;
    --fl-balloon-border: #c4d43a;
    --fl-balloon-text: #232060;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    vertical-align: middle;
    font-family: "Roboto", sans-serif;
}
.fl-mascot--tone-amber { --fl-balloon-bg: #fff4d6; --fl-balloon-border: #f5a300; --fl-balloon-text: #7a4b00; }
.fl-mascot--tone-green { --fl-balloon-bg: #e7f6eb; --fl-balloon-border: #2e9d4a; --fl-balloon-text: #1d5e2c; }
.fl-mascot--tone-red   { --fl-balloon-bg: #fdecea; --fl-balloon-border: #d93025; --fl-balloon-text: #8a1c14; }
.fl-mascot--tone-navy  { --fl-balloon-bg: #232060; --fl-balloon-border: #c4d43a; --fl-balloon-text: #ffffff; }

.fl-mascot__figure {
    flex: none;
    width: var(--fl-mascot-size);
    height: var(--fl-mascot-size);
    line-height: 0;
}
.fl-mascot__svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* ---------- balloon ---------- */
.fl-mascot__balloon,
a.fl-mascot__balloon:visited {
    position: relative;
    display: block;
    box-sizing: border-box;
    max-width: 320px;
    padding: 10px 14px;
    border: 2px solid var(--fl-balloon-border);
    border-radius: 16px;
    background: var(--fl-balloon-bg);
    box-shadow: 0 6px 18px rgba(35, 32, 96, 0.14);
    color: var(--fl-balloon-text);
    font-size: 15px;
    font-weight: bold;
    line-height: 21px;
    text-align: left;
    text-decoration: none;
    animation: flMascotPop 0.35s cubic-bezier(.2, 1.4, .5, 1) both;
}
a.fl-mascot__balloon:hover {
    color: var(--fl-balloon-text);
    text-decoration: none;
    filter: brightness(0.97);
}
.fl-mascot__balloon a {
    color: inherit;
    text-decoration: underline;
}
/* tail: a rotated square with the balloon's border */
.fl-mascot__balloon::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--fl-balloon-border);
    border-top: 0;
    border-left: 0;
    background: var(--fl-balloon-bg);
}

/* inline: mascot left, balloon right with the tail pointing at the mascot */
.fl-mascot--layout-inline .fl-mascot__balloon {
    order: 2;
    margin-left: 6px;
}
.fl-mascot--layout-inline .fl-mascot__balloon::after {
    top: 50%;
    left: -8px;
    margin-top: -7px;
    transform: rotate(135deg);
}

/* balloon: balloon above, tail down to the mascot */
.fl-mascot--layout-balloon {
    flex-direction: column;
    gap: 14px;
}
.fl-mascot--layout-balloon .fl-mascot__balloon {
    text-align: center;
}
.fl-mascot--layout-balloon .fl-mascot__balloon::after {
    bottom: -8px;
    left: 50%;
    margin-left: -7px;
    transform: rotate(45deg);
}

/* celebrate: confetti flies above the hands, keep the balloon clear of it */
.fl-mascot--celebrate.fl-mascot--layout-balloon {
    gap: 24px;
}

/* thinking: a thought cloud, the tail is the mascot's own dots */
.fl-mascot--think .fl-mascot__balloon {
    border-radius: 24px;
}
.fl-mascot--think .fl-mascot__balloon::after {
    display: none;
}

/* corner: fixed, slides in, balloon above */
.fl-mascot--layout-corner {
    position: fixed;
    z-index: 890;
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: 16px;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    max-width: calc(100vw - 32px);
    transition: transform 0.45s cubic-bezier(.2, 1.3, .5, 1), opacity 0.3s;
}
.fl-mascot--layout-corner.fl-mascot--pos-left {
    right: auto;
    left: 16px;
    align-items: flex-start;
}
.fl-mascot--layout-corner .fl-mascot__balloon {
    max-width: min(280px, calc(100vw - 32px));
}
.fl-mascot--layout-corner .fl-mascot__balloon::after {
    bottom: -8px;
    right: calc(var(--fl-mascot-size) / 2 - 7px);
    transform: rotate(45deg);
}
.fl-mascot--layout-corner.fl-mascot--pos-left .fl-mascot__balloon::after {
    right: auto;
    left: calc(var(--fl-mascot-size) / 2 - 7px);
}
.fl-mascot--layout-corner .fl-mascot__figure {
    filter: drop-shadow(0 6px 10px rgba(35, 32, 96, 0.25));
}
.fl-mascot--layout-corner.is-pending,
.fl-mascot--layout-corner.is-leaving {
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
}
.fl-mascot--layout-corner.is-pending .fl-mascot__balloon {
    animation: none;
}
.fl-mascot--layout-corner.is-visible .fl-mascot__balloon {
    animation: flMascotPop 0.35s 0.35s cubic-bezier(.2, 1.4, .5, 1) both;
}
.fl-mascot--layout-corner.is-hidden {
    display: none;
}
.fl-mascot__close {
    position: absolute;
    top: -10px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #2f3184;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}
.fl-mascot__close:hover,
.fl-mascot__close:focus {
    border-color: #ffffff;
    background: #c4d43a;
    color: #2f3184;
}
.fl-mascot--pos-left .fl-mascot__close {
    right: auto;
    left: -6px;
}

@media screen and (max-width: 768px) {
    .fl-mascot__balloon {
        font-size: 14px;
        line-height: 19px;
    }
    .fl-mascot--layout-corner {
        bottom: calc(12px + env(safe-area-inset-bottom));
        right: 12px;
    }
    .fl-mascot--layout-corner.fl-mascot--pos-left {
        left: 12px;
    }
    .fl-mascot--layout-corner .fl-mascot__figure {
        width: min(var(--fl-mascot-size), 76px);
        height: min(var(--fl-mascot-size), 76px);
    }
    .fl-mascot--layout-corner .fl-mascot__balloon::after {
        right: calc(min(var(--fl-mascot-size), 76px) / 2 - 7px);
    }
    .fl-mascot--layout-corner.fl-mascot--pos-left .fl-mascot__balloon::after {
        left: calc(min(var(--fl-mascot-size), 76px) / 2 - 7px);
    }
}

/* ---------- animated parts ---------- */
.fl-mascot__body,
.fl-mascot__mouth,
.fl-mascot__eyes,
.fl-mascot__tear,
.fl-mascot__confetti rect,
.fl-mascot__confetti circle {
    transform-box: fill-box;
}
.fl-mascot__all,
.fl-mascot__arm--l,
.fl-mascot__arm--r,
.fl-mascot__leg--l,
.fl-mascot__leg--r {
    transform-box: view-box;
}
.fl-mascot__arm--l { transform-origin: 19px 35px; }
.fl-mascot__arm--r { transform-origin: 53px 35px; }
.fl-mascot__leg--l { transform-origin: 28px 56px; }
.fl-mascot__leg--r { transform-origin: 44px 56px; }
.fl-mascot__all { transform-origin: 36px 66px; }
.fl-mascot__body { transform-origin: 50% 100%; }
.fl-mascot__eyes { transform-origin: 50% 50%; }

/* 1 panic */
.fl-mascot--panic .fl-mascot__all { animation: flHop 0.5s ease-in-out infinite; }
.fl-mascot--panic .fl-mascot__body { animation: flShake 0.16s linear infinite; }
.fl-mascot--panic .fl-mascot__arm--l { animation: flFlailL 0.22s ease-in-out infinite alternate; }
.fl-mascot--panic .fl-mascot__arm--r { animation: flFlailR 0.22s -0.11s ease-in-out infinite alternate; }
.fl-mascot--panic .fl-mascot__leg--l { animation: flLeg 0.25s ease-in-out infinite alternate; }
.fl-mascot--panic .fl-mascot__leg--r { animation: flLeg 0.25s ease-in-out infinite alternate-reverse; }
.fl-mascot--panic .fl-mascot__mouth { transform-origin: 50% 30%; animation: flScream 0.3s ease-in-out infinite alternate; }
.fl-mascot--panic .fl-mascot__pupils { animation: flDart 0.4s steps(1) infinite; }
.fl-mascot--panic .fl-mascot__marks { animation: flFlicker 0.5s steps(1) infinite; }

/* 2 wave */
.fl-mascot--wave .fl-mascot__all { animation: flBob 1.2s ease-in-out infinite; }
.fl-mascot--wave .fl-mascot__arm--r { animation: flWave 0.4s ease-in-out infinite alternate; }
.fl-mascot--wave .fl-mascot__eyes { animation: flBlink 3.2s infinite; }

/* 3 celebrate */
.fl-mascot--celebrate .fl-mascot__all { animation: flJump 0.7s cubic-bezier(.3, 0, .4, 1) infinite; }
.fl-mascot--celebrate .fl-mascot__arm--l { animation: flPumpL 0.35s ease-in-out infinite alternate; }
.fl-mascot--celebrate .fl-mascot__arm--r { animation: flPumpR 0.35s ease-in-out infinite alternate; }
.fl-mascot--celebrate .fl-mascot__leg--l { animation: flTuckL 0.7s ease-in-out infinite; }
.fl-mascot--celebrate .fl-mascot__leg--r { animation: flTuckR 0.7s ease-in-out infinite; }
.fl-mascot--celebrate .fl-mascot__confetti rect,
.fl-mascot--celebrate .fl-mascot__confetti circle { transform-origin: 50% 50%; animation: flConfetti 1.4s linear infinite; }
.fl-mascot--celebrate .fl-mascot__confetti :nth-child(2) { animation-delay: -0.3s; }
.fl-mascot--celebrate .fl-mascot__confetti :nth-child(3) { animation-delay: -0.7s; }
.fl-mascot--celebrate .fl-mascot__confetti :nth-child(4) { animation-delay: -1s; }
.fl-mascot--celebrate .fl-mascot__confetti :nth-child(5) { animation-delay: -0.5s; }
.fl-mascot--celebrate .fl-mascot__confetti :nth-child(6) { animation-delay: -1.2s; }

/* 4 think */
.fl-mascot--think .fl-mascot__body { animation: flTilt 2.4s ease-in-out infinite; }
.fl-mascot--think .fl-mascot__pupils { animation: flLookAround 3s ease-in-out infinite; }
.fl-mascot--think .fl-mascot__leg--r { animation: flTap 0.5s ease-in-out infinite alternate; }
.fl-mascot--think .fl-mascot__dots circle { animation: flDots 1.5s infinite; }
.fl-mascot--think .fl-mascot__dots circle:nth-child(2) { animation-delay: 0.25s; }
.fl-mascot--think .fl-mascot__dots circle:nth-child(3) { animation-delay: 0.5s; }

/* 5 point */
.fl-mascot--point .fl-mascot__all { animation: flBob 1s ease-in-out infinite; }
.fl-mascot--point .fl-mascot__arm--r { animation: flJab 0.5s ease-in-out infinite alternate; }
.fl-mascot--point .fl-mascot__pupils { transform: translateX(1.2px); }
.fl-mascot--point .fl-mascot__eyes { animation: flBlink 3.6s infinite; }

/* 6 sad */
.fl-mascot--sad .fl-mascot__all { animation: flSway 2.6s ease-in-out infinite; }
.fl-mascot--sad .fl-mascot__arm--l { animation: flDangleL 2.6s ease-in-out infinite; }
.fl-mascot--sad .fl-mascot__arm--r { animation: flDangleR 2.6s ease-in-out infinite; }
.fl-mascot--sad .fl-mascot__pupils { transform: translateY(1px); }
.fl-mascot--sad .fl-mascot__tear { transform-origin: 50% 0; animation: flTear 1.8s ease-in infinite; }

@keyframes flMascotPop {
    from { opacity: 0; transform: scale(0.6) translateY(8px); }
    to { opacity: 1; transform: none; }
}
@keyframes flHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes flBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes flShake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-0.8px) rotate(-3deg); }
    75% { transform: translateX(0.8px) rotate(3deg); }
}
@keyframes flFlailL { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
@keyframes flFlailR { from { transform: rotate(22deg); } to { transform: rotate(-18deg); } }
@keyframes flLeg { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes flScream { from { transform: scale(0.85, 0.8); } to { transform: scale(1.1, 1.25); } }
@keyframes flDart { 0% { transform: translate(-0.8px, -0.6px); } 50% { transform: translate(0.8px, -0.6px); } }
@keyframes flFlicker { 0% { opacity: 1; } 50% { opacity: 0.25; } }
@keyframes flWave { from { transform: rotate(-10deg); } to { transform: rotate(24deg); } }
@keyframes flBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes flJump {
    0%, 100% { transform: translateY(0) scale(1.06, 0.92); }
    15% { transform: translateY(0) scale(1, 1); }
    50% { transform: translateY(-9px) scale(0.97, 1.04); }
    85% { transform: translateY(0) scale(1, 1); }
}
@keyframes flPumpL { from { transform: rotate(-6deg); } to { transform: rotate(10deg); } }
@keyframes flPumpR { from { transform: rotate(6deg); } to { transform: rotate(-10deg); } }
@keyframes flTuckL { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(25deg); } }
@keyframes flTuckR { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-25deg); } }
@keyframes flConfetti {
    0% { opacity: 0; transform: translateY(-4px) rotate(0); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translateY(18px) rotate(220deg); }
}
@keyframes flTilt { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes flLookAround {
    0%, 100% { transform: translate(-1px, -1.4px); }
    40% { transform: translate(1.2px, -1.4px); }
    70% { transform: translate(0, -0.4px); }
}
@keyframes flTap { from { transform: rotate(0); } to { transform: rotate(-14deg); } }
@keyframes flDots { 0%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
@keyframes flJab { from { transform: translateX(0); } to { transform: translateX(3px); } }
@keyframes flSway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
@keyframes flDangleL { 0%, 100% { transform: rotate(4deg); } 50% { transform: rotate(-4deg); } }
@keyframes flDangleR { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes flTear {
    0% { opacity: 0; transform: translateY(0) scale(0.6); }
    20% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(9px) scale(1); }
}

/* 7 hint */
.fl-mascot--hint .fl-mascot__all { animation: flBob 1.2s ease-in-out infinite; }
.fl-mascot--hint .fl-mascot__arm--r { animation: flWag 0.45s ease-in-out infinite alternate; }
.fl-mascot--hint .fl-mascot__sparkle,
.fl-mascot--good .fl-mascot__sparkle { transform-box: fill-box; transform-origin: 50% 50%; animation: flTwinkle 1.2s ease-in-out infinite; }

/* 8 idea */
.fl-mascot--idea .fl-mascot__all { animation: flHop 0.9s ease-in-out infinite; }
.fl-mascot--idea .fl-mascot__glow { transform-box: fill-box; transform-origin: 50% 50%; animation: flGlow 1.2s ease-in-out infinite; }
.fl-mascot--idea .fl-mascot__rays { animation: flFlicker 0.6s steps(1) infinite; }
.fl-mascot--idea .fl-mascot__pupils { transform: translateY(-1.3px); }
.fl-mascot--idea .fl-mascot__arm--r { animation: flWag 0.6s ease-in-out infinite alternate; }

/* 9 good */
.fl-mascot--good .fl-mascot__all { animation: flBob 0.9s ease-in-out infinite; }
.fl-mascot--good .fl-mascot__arm--r { animation: flThumb 0.45s ease-in-out infinite alternate; }

/* 10 wait for tickets to print */
.fl-mascot--print .fl-mascot__pupils { transform: translate(1.3px, 0.8px); }
.fl-mascot--print .fl-mascot__leg--l { animation: flTapL 0.4s ease-in-out infinite alternate; }
.fl-mascot--print .fl-mascot__paper { transform-box: fill-box; animation: flPrint 1.6s ease-in-out infinite; }
.fl-mascot--print .fl-mascot__led { animation: flFlicker 0.4s steps(1) infinite; }
.fl-mascot--print .fl-mascot__dots--wait circle { transform-box: fill-box; animation: flWaitDot 1.2s ease-in-out infinite; }
.fl-mascot--print .fl-mascot__dots--wait circle:nth-child(2) { animation-delay: 0.2s; }
.fl-mascot--print .fl-mascot__dots--wait circle:nth-child(3) { animation-delay: 0.4s; }

/* 11 something is wrong */
.fl-mascot--error .fl-mascot__body { animation: flWobble 1.4s ease-in-out infinite; }
.fl-mascot--error .fl-mascot__arm--r { animation: flScratch 0.18s linear infinite alternate; }
.fl-mascot--error .fl-mascot__arm--l { animation: flShrug 1.4s ease-in-out infinite; }
.fl-mascot--error .fl-mascot__marks--error text { animation: flFloat 1.6s ease-out infinite; }
.fl-mascot--error .fl-mascot__marks--error text:nth-child(2) { animation-delay: 0.5s; }
.fl-mascot--error .fl-mascot__marks--error text:nth-child(3) { animation-delay: 1s; }
.fl-mascot--error .fl-mascot__pupils--spin { transform-box: fill-box; transform-origin: 50% 50%; animation: flLookAround 1.2s ease-in-out infinite; }

@keyframes flWag { from { transform: rotate(-8deg); } to { transform: rotate(8deg); } }
@keyframes flTwinkle { 0%, 100% { opacity: 0.2; transform: scale(0.5) rotate(0); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@keyframes flGlow { 0%, 100% { opacity: 0.35; transform: scale(0.85); } 50% { opacity: 0.95; transform: scale(1.1); } }
@keyframes flThumb { from { transform: translateY(1px) rotate(4deg); } to { transform: translateY(-2px) rotate(-6deg); } }
@keyframes flTapL { from { transform: rotate(0); } to { transform: rotate(14deg); } }
@keyframes flPrint {
    0% { transform: translateY(8px); opacity: 1; }
    60% { transform: translateY(-2px); opacity: 1; }
    85% { transform: translateY(-5px); opacity: 0; }
    100% { transform: translateY(8px); opacity: 0; }
}
@keyframes flWaitDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.35; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes flWobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes flScratch { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes flShrug { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(10deg); } }
@keyframes flFloat { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-6px); } }

/* 13 shy peek: slides in from the right edge of its box, waves, hides again */
.fl-mascot--peek .fl-mascot__figure { overflow: hidden; }
.fl-mascot--peek .fl-mascot__all { animation: flPeek 4s ease-in-out infinite; }
.fl-mascot--peek .fl-mascot__arm--l { animation: flShyWave 0.5s ease-in-out infinite alternate; }

/* 14 sold out */
.fl-mascot--soldout .fl-mascot__all { animation: flNo 1.2s ease-in-out infinite; }
.fl-mascot--soldout .fl-mascot__sign { transform-box: view-box; transform-origin: 62px 50px; animation: flSignWobble 0.6s ease-in-out infinite alternate; }

/* 15 scan me */
.fl-mascot--qr .fl-mascot__all { animation: flBob 1.2s ease-in-out infinite; }
.fl-mascot--qr .fl-mascot__scanline { animation: flScan 2.4s linear infinite; }
.fl-mascot--qr .fl-mascot__ok { animation: flScanOk 2.4s steps(1) infinite; }
.fl-mascot--qr .fl-mascot__pupils { transform: translateX(1.3px); }

/* 16 sleeping */
.fl-mascot--sleep .fl-mascot__body { animation: flBreathe 2.4s ease-in-out infinite; }
.fl-mascot--sleep .fl-mascot__mouth { transform-origin: 50% 50%; animation: flSnore 2.4s ease-in-out infinite; }
.fl-mascot--sleep .fl-mascot__zzz text { animation: flFloat 2.4s ease-out infinite; }
.fl-mascot--sleep .fl-mascot__zzz text:nth-child(2) { animation-delay: 0.8s; }
.fl-mascot--sleep .fl-mascot__zzz text:nth-child(3) { animation-delay: 1.6s; }
.fl-mascot--sleep .fl-mascot__all { transform-origin: 36px 66px; animation: flDoze 4.8s ease-in-out infinite; }

/* 17 rain */
.fl-mascot--rain .fl-mascot__drops path { transform-box: fill-box; animation: flDrop 0.9s linear infinite; }
.fl-mascot--rain .fl-mascot__drops path:nth-child(2) { animation-delay: -0.3s; }
.fl-mascot--rain .fl-mascot__drops path:nth-child(3) { animation-delay: -0.6s; }
.fl-mascot--rain .fl-mascot__drops path:nth-child(4) { animation-delay: -0.45s; }
.fl-mascot--rain .fl-mascot__drops path:nth-child(5) { animation-delay: -0.15s; }
.fl-mascot--rain .fl-mascot__drops path:nth-child(6) { animation-delay: -0.75s; }
.fl-mascot--rain .fl-mascot__umbrella { transform-box: view-box; transform-origin: 50px 32px; animation: flUmbrella 1.6s ease-in-out infinite; }
.fl-mascot--rain .fl-mascot__pupils { transform: translateY(-1.3px); }
.fl-mascot--rain .fl-mascot__leg--l { animation: flLeg 0.8s ease-in-out infinite alternate; }

/* 18 sunny */
.fl-mascot--sunny .fl-mascot__all { animation: flSway 0.9s ease-in-out infinite; }
.fl-mascot--sunny .fl-mascot__arm--l { animation: flPumpL 0.45s ease-in-out infinite alternate; }
.fl-mascot--sunny .fl-mascot__arm--r { animation: flPumpR 0.45s -0.22s ease-in-out infinite alternate; }
.fl-mascot--sunny .fl-mascot__leg--l { animation: flLeg 0.45s ease-in-out infinite alternate; }
.fl-mascot--sunny .fl-mascot__leg--r { animation: flLeg 0.45s ease-in-out infinite alternate-reverse; }
.fl-mascot--sunny .fl-mascot__sunrays { transform-box: view-box; transform-origin: 8px 8px; animation: flSpin 6s linear infinite; }

/* 19 ride */
.fl-mascot--ride .fl-mascot__all { animation: flRide 1.6s ease-in-out infinite; }
.fl-mascot--ride .fl-mascot__arm--l { animation: flFlailL 0.4s ease-in-out infinite alternate; }
.fl-mascot--ride .fl-mascot__arm--r { animation: flFlailR 0.4s ease-in-out infinite alternate; }
.fl-mascot--ride .fl-mascot__track { animation: flTrack 0.6s linear infinite; }

/* 20 cart: three tickets run and jump into the cart (same as the add-to-cart loader) */
.fl-mascot--cart .fl-mascot__ground { animation: flTrack 0.4s linear infinite; }
.fl-mascot--cart .fl-mascot__runner { opacity: 0; animation: flCartRunX 1.8s linear infinite; }
.fl-mascot--cart .fl-mascot__runner-jump { transform-box: fill-box; transform-origin: 50% 50%; animation: flCartRunY 1.8s infinite; }
.fl-mascot--cart .fl-mascot__runner:nth-of-type(2),
.fl-mascot--cart .fl-mascot__runner:nth-of-type(2) .fl-mascot__runner-jump { animation-delay: -0.6s; }
.fl-mascot--cart .fl-mascot__runner:nth-of-type(3),
.fl-mascot--cart .fl-mascot__runner:nth-of-type(3) .fl-mascot__runner-jump { animation-delay: -1.2s; }
.fl-mascot--cart .fl-mascot__runner-body { transform-box: fill-box; transform-origin: 50% 100%; animation: flCartBob 0.3s ease-in-out infinite; }
.fl-mascot--cart .fl-mascot__run-leg,
.fl-mascot--cart .fl-mascot__run-arm { transform-box: fill-box; transform-origin: 50% 0; }
.fl-mascot--cart .fl-mascot__run-arm--b { transform-origin: 100% 0; }
.fl-mascot--cart .fl-mascot__run-arm--a { transform-origin: 0 0; }
.fl-mascot--cart .fl-mascot__run-leg--a,
.fl-mascot--cart .fl-mascot__run-arm--a { animation: flCartLegA 0.3s ease-in-out infinite; }
.fl-mascot--cart .fl-mascot__run-leg--b,
.fl-mascot--cart .fl-mascot__run-arm--b { animation: flCartLegB 0.3s ease-in-out infinite; }
.fl-mascot--cart .fl-mascot__cart { transform-box: fill-box; transform-origin: 50% 100%; animation: flCartBounce 0.6s ease-out -0.31s infinite; }
@keyframes flCartRunX {
    0%   { transform: translateX(-16px); opacity: 0; }
    6%   { opacity: 1; }
    58%  { transform: translateX(18px); }
    86%  { transform: translateX(47px); opacity: 1; }
    94%  { transform: translateX(49px); opacity: 0; }
    100% { transform: translateX(49px); opacity: 0; }
}
@keyframes flCartRunY {
    0%, 56% { transform: translateY(0) rotate(0); animation-timing-function: cubic-bezier(0.2, 0.7, 0.4, 1); }
    72%     { transform: translateY(-22px) rotate(-14deg); animation-timing-function: cubic-bezier(0.6, 0, 0.8, 0.4); }
    88%     { transform: translateY(-5px) rotate(18deg); }
    100%    { transform: translateY(4px) rotate(24deg); }
}
@keyframes flCartBob {
    0%, 100% { transform: rotate(6deg) translateY(0); }
    50%      { transform: rotate(6deg) translateY(-2px); }
}
@keyframes flCartLegA {
    0%, 100% { transform: rotate(35deg); }
    50%      { transform: rotate(-35deg); }
}
@keyframes flCartLegB {
    0%, 100% { transform: rotate(-35deg); }
    50%      { transform: rotate(35deg); }
}
@keyframes flCartBounce {
    0%   { transform: translateY(0) rotate(0); }
    12%  { transform: translateY(1px) rotate(-3deg) scaleY(0.96); }
    35%  { transform: translateY(0) rotate(1deg); }
    60%, 100% { transform: translateY(0) rotate(0); }
}

@keyframes flPeek {
    0%, 100% { transform: translateX(70%) rotate(0); }
    18%, 72% { transform: translateX(6%) rotate(-10deg); }
    45% { transform: translateX(10%) rotate(-6deg); }
}
@keyframes flShyWave { from { transform: rotate(-6deg); } to { transform: rotate(12deg); } }
@keyframes flNo {
    0%, 40%, 100% { transform: rotate(0); }
    10% { transform: rotate(-5deg); }
    20% { transform: rotate(5deg); }
    30% { transform: rotate(-3deg); }
}
@keyframes flSignWobble { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes flScan {
    0% { transform: translateY(0); opacity: 1; }
    55% { transform: translateY(13px); opacity: 1; }
    56%, 100% { transform: translateY(13px); opacity: 0; }
}
@keyframes flScanOk { 0% { opacity: 0; } 60% { opacity: 1; } 95% { opacity: 0; } }
@keyframes flBreathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 1.05); } }
@keyframes flSnore { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.5); } }
@keyframes flDoze { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(3deg); } }
@keyframes flDrop {
    0% { transform: translateY(-6px); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translateY(26px); opacity: 0; }
}
@keyframes flUmbrella { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes flSpin { to { transform: rotate(360deg); } }
@keyframes flRide {
    0% { transform: translateY(0) rotate(-6deg); }
    25% { transform: translateY(-5px) rotate(0); }
    50% { transform: translateY(0) rotate(6deg); }
    75% { transform: translateY(3px) rotate(0); }
    100% { transform: translateY(0) rotate(-6deg); }
}
@keyframes flTrack { to { stroke-dashoffset: -7; } }

@media (prefers-reduced-motion: reduce) {
    .fl-mascot *,
    .fl-mascot *::after {
        animation: none !important;
    }
    .fl-mascot--layout-corner {
        transition: opacity 0.2s;
    }
    /* cart: one still ticket next to the cart */
    .fl-mascot--cart .fl-mascot__runner { opacity: 1; transform: translateX(20px); }
    .fl-mascot--cart .fl-mascot__runner:nth-of-type(n+2) { display: none; }
}

/* ---------- several texts taking turns (sequence.phtml + js/sequence.js) ---------- */
.fl-mascot__balloons {
    display: grid;
    max-width: 320px;
}
.fl-mascot--layout-inline .fl-mascot__balloons {
    order: 2;
}
.fl-mascot--layout-balloon .fl-mascot__balloons,
.fl-mascot--layout-corner .fl-mascot__balloons {
    justify-items: center;
}
.fl-mascot--layout-corner .fl-mascot__balloons {
    justify-items: end;
    max-width: min(280px, calc(100vw - 32px));
}
.fl-mascot--layout-corner.fl-mascot--pos-left .fl-mascot__balloons {
    justify-items: start;
}
/* all balloons share one grid cell, so the box keeps the size of the longest text */
.fl-mascot--sequence .fl-mascot__balloon--turn {
    grid-area: 1 / 1;
    align-self: end;
    visibility: hidden;
    animation: none;
}
.fl-mascot--layout-inline.fl-mascot--sequence .fl-mascot__balloon--turn {
    align-self: center;
}
.fl-mascot--sequence .fl-mascot__balloon--turn.is-active {
    visibility: visible;
    animation: flMascotPop 0.4s cubic-bezier(.2, 1.4, .5, 1) both;
}
.fl-mascot--sequence .fl-mascot__balloon--turn.is-closing {
    visibility: visible;
    animation: flBalloonClose 0.32s ease-in forwards;
}
.fl-mascot--layout-balloon .fl-mascot__balloon--turn { transform-origin: 50% 100%; }
.fl-mascot--layout-inline .fl-mascot__balloon--turn { transform-origin: 0 50%; }
.fl-mascot--layout-corner .fl-mascot__balloon--turn { transform-origin: 85% 100%; }
.fl-mascot--layout-corner.fl-mascot--pos-left .fl-mascot__balloon--turn { transform-origin: 15% 100%; }
.fl-mascot--layout-corner.is-pending .fl-mascot__balloon--turn.is-active {
    animation: none;
}

/* one mascot per pose, stacked; the current one is visible */
.fl-mascot__figure--stack {
    position: relative;
}
.fl-mascot__pose {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0.92);
    transition: opacity 0.18s, transform 0.25s cubic-bezier(.2, 1.4, .5, 1);
}
.fl-mascot__pose.is-current {
    opacity: 1;
    transform: none;
}
.fl-mascot__pose > .fl-mascot {
    display: block;
}

@keyframes flBalloonClose {
    from { opacity: 1; transform: none; }
    to { opacity: 0; transform: scale(0.3) translateY(6px); }
}
@media (prefers-reduced-motion: reduce) {
    .fl-mascot__pose {
        transition: none;
    }
}

/* ---------- center: big mascot in the middle, dark blurred background ---------- */
.fl-mascot--layout-center {
    position: fixed;
    z-index: 1000;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    max-width: none;
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom));
    background: rgba(20, 18, 60, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 1;
    transition: opacity 0.3s;
}
.fl-mascot--layout-center .fl-mascot__figure {
    width: min(50vw, 50vh);
    height: min(50vw, 50vh);
    transition: transform 0.45s cubic-bezier(.2, 1.3, .5, 1);
}
.fl-mascot--layout-center .fl-mascot__balloon,
.fl-mascot--layout-center .fl-mascot__balloons {
    max-width: min(560px, calc(100vw - 32px));
}
.fl-mascot--layout-center .fl-mascot__balloons {
    justify-items: center;
}
.fl-mascot--layout-center .fl-mascot__balloon {
    padding: 14px 22px;
    border-width: 3px;
    border-radius: 22px;
    font-size: clamp(16px, 3.2vmin, 32px);
    line-height: 1.35;
    text-align: center;
}
.fl-mascot--layout-center .fl-mascot__balloon::after {
    bottom: -9px;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -8px;
    border-width: 3px;
    transform: rotate(45deg);
}
.fl-mascot--layout-center .fl-mascot__balloon--turn { transform-origin: 50% 100%; }
.fl-mascot--layout-center .fl-mascot__close {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top));
    right: 16px;
    left: auto;
    width: 40px;
    height: 40px;
    font-size: 26px;
}
.fl-mascot--layout-center.is-pending,
.fl-mascot--layout-center.is-leaving {
    opacity: 0;
    pointer-events: none;
}
.fl-mascot--layout-center.is-pending .fl-mascot__figure,
.fl-mascot--layout-center.is-leaving .fl-mascot__figure {
    transform: scale(0.5) translateY(40px);
}
.fl-mascot--layout-center.is-pending .fl-mascot__balloon {
    animation: none;
}
.fl-mascot--layout-center.is-visible .fl-mascot__balloon:not(.fl-mascot__balloon--turn) {
    animation: flMascotPop 0.4s 0.3s cubic-bezier(.2, 1.4, .5, 1) both;
}
.fl-mascot--layout-center.is-hidden {
    display: none;
}
html.fl-mascot-lock,
html.fl-mascot-lock body {
    overflow: hidden;
}

/* kiosk screensaver: while fading out, the overlay still catches the waking touch */
.fl-mascot--idle.is-leaving {
    pointer-events: auto;
}

/* a center mascot is the main one: corner mascots step aside until it is closed */
.fl-mascot--layout-corner {
    visibility: visible;
}
html.fl-mascot-center-open .fl-mascot--layout-corner {
    visibility: hidden;
    opacity: 0;
    transform: translateY(calc(100% + 24px));
    pointer-events: none;
    transition: transform 0.3s, opacity 0.2s, visibility 0s 0.3s;
}

/* corner at the top of the screen: mascot first, balloon under it, slides in from above */
.fl-mascot--layout-corner.fl-mascot--pos-top {
    top: calc(16px + env(safe-area-inset-top));
    bottom: auto;
    flex-direction: column-reverse;
}
.fl-mascot--layout-corner.fl-mascot--pos-top .fl-mascot__balloon::after {
    top: -8px;
    bottom: auto;
    transform: rotate(225deg);
}
.fl-mascot--layout-corner.fl-mascot--pos-top .fl-mascot__balloon--turn {
    transform-origin: 85% 0;
}
.fl-mascot--layout-corner.fl-mascot--pos-top.fl-mascot--pos-left .fl-mascot__balloon--turn {
    transform-origin: 15% 0;
}
.fl-mascot--layout-corner.fl-mascot--pos-top .fl-mascot__balloons {
    align-items: start;
}
.fl-mascot--layout-corner.fl-mascot--pos-top .fl-mascot__balloon--turn {
    align-self: start;
}
.fl-mascot--layout-corner.fl-mascot--pos-top .fl-mascot__close {
    top: auto;
    bottom: -10px;
}
.fl-mascot--layout-corner.fl-mascot--pos-top.is-pending,
.fl-mascot--layout-corner.fl-mascot--pos-top.is-leaving,
html.fl-mascot-center-open .fl-mascot--layout-corner.fl-mascot--pos-top {
    transform: translateY(calc(-100% - 24px));
}
@media screen and (max-width: 768px) {
    .fl-mascot--layout-corner.fl-mascot--pos-top {
        top: calc(12px + env(safe-area-inset-top));
    }
}
