/* =========================================================
   local_bored – Mascot styles & animations
   ========================================================= */

/* ── Container ─────────────────────────────────────────── */
#local-bored-mascot {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 80px;
    height: 80px;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    transition: bottom 0.3s ease;
}

#local-bored-mascot.chasing {
    position: fixed;
    transition: left 0.18s linear, top 0.18s linear;
    bottom: auto;
}

/* ── SVG frames ─────────────────────────────────────────── */
#local-bored-mascot .mascot-frame {
    display: none;
    width: 80px;
    height: 80px;
}

#local-bored-mascot .mascot-frame.active {
    display: block;
}

/* ── Click counter badge ────────────────────────────────── */
#local-bored-clicks {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff5252;
    color: #fff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    font-weight: bold;
    line-height: 22px;
    text-align: center;
    display: none;
    font-family: sans-serif;
}

#local-bored-clicks.visible {
    display: block;
}

/* ── Sleep animation (zzz bounce) ───────────────────────── */
@keyframes bored-sleep-body {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(0deg); }
    50%       { transform: translateX(-50%) translateY(-4px) rotate(-2deg); }
}

@keyframes bored-zzz {
    0%   { opacity: 0; transform: translate(0, 0)   scale(0.6); }
    30%  { opacity: 1; }
    100% { opacity: 0; transform: translate(18px, -24px) scale(1.1); }
}

#local-bored-mascot.sleeping {
    animation: bored-sleep-body 2.4s ease-in-out infinite;
}

#local-bored-mascot .zzz {
    position: absolute;
    top: 4px;
    right: -8px;
    font-size: 14px;
    font-weight: bold;
    color: #7ec8e3;
    font-family: sans-serif;
    animation: bored-zzz 2.4s ease-in-out infinite;
    pointer-events: none;
}

#local-bored-mascot .zzz:nth-child(2) {
    font-size: 10px;
    top: 14px;
    right: -16px;
    animation-delay: 0.8s;
}

#local-bored-mascot .zzz:nth-child(3) {
    font-size: 8px;
    top: 22px;
    right: -22px;
    animation-delay: 1.6s;
}

/* ── Wake-up flash ──────────────────────────────────────── */
@keyframes bored-wakeup {
    0%   { transform: translateX(-50%) scale(1); }
    25%  { transform: translateX(-50%) scale(1.3) rotate(8deg); }
    50%  { transform: translateX(-50%) scale(1.1) rotate(-6deg); }
    75%  { transform: translateX(-50%) scale(1.25) rotate(4deg); }
    100% { transform: translateX(-50%) scale(1) rotate(0deg); }
}

#local-bored-mascot.waking {
    animation: bored-wakeup 0.5s ease-in-out;
}

/* ── Chase animation (wiggle legs) ─────────────────────── */
@keyframes bored-chase {
    0%, 100% { transform: rotate(-5deg) scaleX(1); }
    50%       { transform: rotate(5deg)  scaleX(1); }
}

#local-bored-mascot.chasing svg,
#local-bored-mascot.chasing img {
    animation: bored-chase 0.25s linear infinite;
}

/* ── Catch flash ────────────────────────────────────────── */
@keyframes bored-catch {
    0%   { transform: scale(1.4) rotate(15deg); }
    50%  { transform: scale(0.8) rotate(-10deg); }
    100% { transform: scale(1)   rotate(0deg); }
}

#local-bored-mascot.catching {
    animation: bored-catch 0.5s ease-in-out;
}

/* ── Star burst on catch ────────────────────────────────── */
#local-bored-starburst {
    position: fixed;
    pointer-events: none;
    z-index: 10000;
    font-size: 28px;
    display: none;
    animation: bored-starburst 0.6s ease-out forwards;
}

@keyframes bored-starburst {
    0%   { opacity: 1; transform: scale(0.5); }
    60%  { opacity: 1; transform: scale(1.4); }
    100% { opacity: 0; transform: scale(1.8); }
}
