@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&display=swap');

* {
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: transparent !important;
    font-family: 'Fredoka', 'Segoe UI', sans-serif;
    user-select: none;
}

:root {
    --global-avatar-scale: 1;
}

#canvas-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* ========================================================
   AVATAR ROOT & RIGGING
   ======================================================== */
.avatar-container {
    position: absolute;
    bottom: 20px;
    width: 160px;
    height: 160px;
    z-index: 10;
    pointer-events: auto;
    cursor: grab;
    transform-origin: 50% 100%;
    transform: scale(var(--avatar-scale, var(--global-avatar-scale, 1)));
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
    user-select: none;
    -webkit-user-drag: none;
}

body.resizing-avatar .avatar-container,
.avatar-container.no-transition {
    transition: none !important;
}

.avatar-container:hover {
    filter: brightness(1.04);
}

.avatar-container.is-dragging {
    cursor: grabbing !important;
    z-index: 200 !important;
    transition: none !important;
}

.avatar-container.is-pinned {
    z-index: 25;
}

/* Pushpin for Pinned Mascots (Crisp, High-Prominence 3D Tack) */
.part.pin-tack {
    position: absolute;
    top: 2px;
    right: 8px;
    width: 44px;
    height: 44px;
    z-index: 999 !important;
    pointer-events: auto;
    cursor: pointer;
    display: none;
    transform-origin: 25% 85%;
    filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 3px 6px rgba(0, 0, 0, 0.75));
    transition: transform 0.15s ease;
}

.part.pin-tack:hover {
    transform: scale(1.15) rotate(-5deg);
    filter: drop-shadow(0 0 5px #00ffd2) drop-shadow(0 4px 10px rgba(0, 0, 0, 0.85));
}

.avatar-container.is-pinned .part.pin-tack {
    display: block !important;
    animation: pinThumbtackPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes pinThumbtackPop {
    0% {
        transform: scale(0) translateY(-28px) rotate(-40deg);
        opacity: 0;
    }
    65% {
        transform: scale(1.35) translateY(2px) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) translateY(0) rotate(0deg);
        opacity: 1;
    }
}

.avatar-flip {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    transform-origin: 50% 90%;
    --flip-x: 1;
    transform: scaleX(var(--flip-x, 1)) skewX(var(--soft-skew-x, 0deg)) scale(var(--soft-scale-x, 1), var(--soft-scale-y, 1));
}

.facing-left .avatar-flip {
    --flip-x: -1;
}

/* Base Rig Structure */
.avatar-rig {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Soft Ambient Shadow on Floor */
.avatar-shadow {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 18px;
    background: radial-gradient(ellipse at center, rgba(10, 5, 20, 0.65) 0%, rgba(10, 5, 20, 0) 75%);
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.15s ease-out, opacity 0.15s ease-out;
}

/* 
   Torso Container:
   Contains all body parts so breathing, squash, and stretch
   are inherited synchronously across all parts!
*/
.rig-torso {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: 50% 88%;
    animation: torsoBreathe 3.2s infinite ease-in-out;
}

/* Generic Rigged Part */
.part {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

/* ========================================================
   PARTS CONFIGURATION
   ======================================================== */

/* Bat Wings (Layer behind body) */
.part.wing {
    width: 46px;
    height: 42px;
    top: 48px;
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(255, 60, 180, 0.45));
    transition: transform 0.2s ease;
}

.part.wing-left {
    left: -4px;
    background-image: url('assets/rigged_pillow/wing_left.png');
    transform-origin: 92% 55%;
    animation: wingFlutterLeft 3.2s infinite ease-in-out;
}

.part.wing-right {
    right: -4px;
    background-image: url('assets/rigged_pillow/wing_right.png');
    transform-origin: 8% 55%;
    animation: wingFlutterRight 3.2s infinite ease-in-out;
}

/* Feet (Plush Paws under pillow - anchored seamlessly with zero gap) */
.part.foot {
    width: 32px;
    height: 24px;
    bottom: 12px;
    z-index: 3;
    transform-origin: 50% 25%;
    transition: transform 0.15s ease;
}

.part.foot-left {
    left: 44px;
    background-image: url('assets/rigged_pillow/foot_left.png');
}

.part.foot-right {
    right: 44px;
    background-image: url('assets/rigged_pillow/foot_right.png');
}

/* Pillow Body (Main Cushion Canvas) */
.part.pillow-body {
    width: 124px;
    height: 124px;
    left: 18px;
    bottom: 18px;
    z-index: 5;
    background-image: url('assets/rigged_pillow/pillow_cushion_blank.png');
    filter: drop-shadow(0 6px 14px rgba(15, 5, 30, 0.5));
}

.part.pillow-body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.05s ease-in-out;
    z-index: 2;
}

/* Generic Face & Limbs Parts inside Pillow Body */
.face-part {
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

/* Eyebrows */
.face-part.eyebrow {
    height: 5px;
    z-index: 8;
    transform-origin: center;
    animation: eyebrowIdle 3.2s infinite ease-in-out;
}

.face-part.eyebrow.eyebrow-left {
    left: 36px;
    top: 35px;
    width: 9px;
    background-image: url('assets/rigged_pillow/eyebrow_left.png');
}

.face-part.eyebrow.eyebrow-right {
    right: 36px;
    top: 35px;
    width: 9px;
    background-image: url('assets/rigged_pillow/eyebrow_right.png');
}

/* Sleepy Glowing Eyes with Live2D Blinking & Radiant Prominence */
.face-part.eye {
    top: 41px;
    width: 33px;
    height: 28px;
    z-index: 7;
    transform-origin: 50% 50%;
    filter: none;
}
[data-mascot="classic"] .face-part.eye {
    filter: drop-shadow(0 0 5px rgba(255, 120, 220, 0.95)) drop-shadow(0 0 2px rgba(255, 255, 255, 0.85));
}

.face-part.eye.eye-left {
    left: 27px;
    background-image: url('assets/rigged_pillow/eye_left.png');
}

.face-part.eye.eye-right {
    right: 27px;
    background-image: url('assets/rigged_pillow/eye_right.png');
}

/* Cute Rosy Blush Cheeks */
.face-part.blush {
    top: 59px;
    width: 22px;
    height: 14px;
    z-index: 6;
    opacity: 0.85;
    animation: blushPulse 3.2s infinite ease-in-out;
}

.face-part.blush.blush-left {
    left: 21px;
    background-image: url('assets/rigged_pillow/blush_left.png');
}

.face-part.blush.blush-right {
    right: 21px;
    background-image: url('assets/rigged_pillow/blush_right.png');
}

/* Cute Snout / Mouth with Vampire Fangs (Full Wide Uncut Smile) */
.face-part.mouth {
    left: 50%;
    transform: translateX(-50%);
    top: 57px;
    width: 25px;
    height: 16px;
    z-index: 8;
    transform-origin: 50% 50%;
    background-image: url('assets/rigged_pillow/mouth.png');
    animation: mouthBreathe 3.2s infinite ease-in-out;
}

/* Plush Arms with Pink Stitching */
.face-part.arm {
    bottom: 25px;
    width: 27px;
    height: 29px;
    z-index: 9;
    transition: transform 0.2s ease;
}

.face-part.arm.arm-left {
    left: 30px;
    background-image: url('assets/rigged_pillow/arm_left.png');
    transform-origin: 30% 20%;
    animation: armIdleLeft 3.2s infinite ease-in-out;
}

.face-part.arm.arm-right {
    right: 30px;
    background-image: url('assets/rigged_pillow/arm_right.png');
    transform-origin: 70% 20%;
    animation: armIdleRight 3.2s infinite ease-in-out;
}

/* Nightcap & Head Accessories (Nightcap, Horns, Ears, Crest) */
.part.head-accessory,
.part.nightcap {
    width: 98px;
    height: 53px;
    top: 13px;
    left: 36px;
    z-index: 7;
    background-image: url('assets/rigged_pillow/slouchy_nightcap.png');
    transform-origin: 35% 85%;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    animation: nightcapSway 3.2s infinite ease-in-out;
}

/* Floating Halo Ring (for Deity & Angel) */
.part.floating-halo {
    display: none;
}

/* Aura Glow Flames (for Spirit Creature & Celestial Avatars) */
.part.aura-glow {
    display: none;
}

/* Glowing Star Tassel at Tip of Nightcap */
.star-tassel {
    position: absolute;
    right: -3px;
    bottom: -8px;
    width: 19px;
    height: 21px;
    background-image: url('assets/rigged_pillow/star_tassel.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center top;
    transform-origin: 45% 8%;
    animation: starDangle 2.8s infinite ease-in-out;
    filter: drop-shadow(0 0 6px rgba(255, 105, 180, 0.8));
}

/* ========================================================
   UI & CHAT ELEMENTS
   ======================================================== */
.avatar-nameplate {
    position: absolute;
    bottom: 168px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 12, 35, 0.88);
    backdrop-filter: blur(4px);
    border: 1.5px solid #ff3399;
    border-radius: 12px;
    padding: 3px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    box-shadow: 0 0 10px rgba(255, 51, 153, 0.45);
    z-index: 30;
    pointer-events: none;
}

.user-badge {
    font-size: 11px;
    filter: drop-shadow(0 0 4px #ffd700);
}

.user-name {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 2px #000;
}

/* Speech / Chat Bubble */
.speech-bubble {
    position: absolute;
    bottom: 204px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background: #ffffff;
    color: #1a0933;
    padding: 7px 16px;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    min-width: 100px;
    max-width: 280px;
    width: max-content;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35), 0 0 0 2px #ff3399;
    z-index: 40;
    pointer-events: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
}

.speech-bubble.active {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #ffffff;
}

/* Floating Sleep Zzz */
.zzz-container {
    position: absolute;
    top: -15px;
    right: 15px;
    pointer-events: none;
    z-index: 25;
    display: none;
}

.zzz-char {
    position: absolute;
    font-weight: 700;
    color: #ff66cc;
    font-size: 18px;
    text-shadow: 0 0 8px rgba(255, 102, 204, 0.8);
    opacity: 0;
    animation: floatZzz 2.4s infinite ease-out;
}

.zzz-char:nth-child(2) { animation-delay: 0.8s; font-size: 14px; }
.zzz-char:nth-child(3) { animation-delay: 1.6s; font-size: 22px; }

/* ========================================================
   ANIMATION KEYFRAMES
   ======================================================== */
@keyframes torsoBreathe {
    0%, 100% { transform: scale(1, 1); }
    50% { transform: scale(1.025, 0.975); }
}

@keyframes wingFlutterLeft {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-14deg) scale(1.04); }
}

@keyframes wingFlutterRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(14deg) scale(1.04); }
}

@keyframes nightcapSway {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(6deg); }
}

@keyframes floatZzz {
    0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
    20% { opacity: 0.9; }
    80% { opacity: 0.8; }
    100% { transform: translate(25px, -50px) scale(1.3); opacity: 0; }
}

/* Fine Parts Micro-Animations */
@keyframes live2dEyeBlink {
    0%, 93%, 97%, 100% {
        transform: scaleY(1);
        transform-origin: 50% 75%;
    }
    95% {
        transform: scaleY(0.12) scaleX(1.05);
        transform-origin: 50% 75%;
    }
}

@keyframes starDangle {
    0%, 100% {
        transform: rotate(12deg);
    }
    50% {
        transform: rotate(-14deg);
    }
}

@keyframes armIdleLeft {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-5deg) translateY(1px);
    }
}

@keyframes armIdleRight {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(5deg) translateY(1px);
    }
}

@keyframes eyebrowIdle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(1.5px);
    }
}

@keyframes mouthBreathe {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.05, 0.95);
    }
}

@keyframes blushPulse {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

/* ========================================================
   ACTION STATES
   ======================================================== */

/* WALKING */
.is-walking .part.foot-left {
    animation: waddleFootLeft 0.32s infinite ease-in-out alternate;
}
.is-walking .part.foot-right {
    animation: waddleFootRight 0.32s infinite ease-in-out alternate;
}
.is-walking .face-part.arm.arm-left {
    animation: armWaddleLeft 0.32s infinite ease-in-out alternate;
}
.is-walking .face-part.arm.arm-right {
    animation: armWaddleRight 0.32s infinite ease-in-out alternate;
}
.is-walking .rig-torso {
    animation: waddleTorso 0.32s infinite ease-in-out alternate;
}
.is-walking .part.wing-left {
    animation: wingFastL 0.22s infinite ease-in-out alternate;
}
.is-walking .part.wing-right {
    animation: wingFastR 0.22s infinite ease-in-out alternate;
}
.is-walking .part.nightcap {
    transform: rotate(-6deg);
}
.is-walking .star-tassel {
    animation: starWalkDangle 0.32s infinite ease-in-out alternate;
}

@keyframes waddleFootLeft {
    0% { transform: rotate(-10deg) translateY(-2px) scale(1.02); }
    100% { transform: rotate(8deg) translateY(1px) scale(0.98); }
}
@keyframes waddleFootRight {
    0% { transform: rotate(8deg) translateY(1px) scale(0.98); }
    100% { transform: rotate(-10deg) translateY(-2px) scale(1.02); }
}
@keyframes armWaddleLeft {
    0% { transform: rotate(-8deg) translateY(-1px); }
    100% { transform: rotate(10deg) translateY(1px); }
}
@keyframes armWaddleRight {
    0% { transform: rotate(10deg) translateY(1px); }
    100% { transform: rotate(-8deg) translateY(-1px); }
}
@keyframes waddleTorso {
    0% { transform: rotate(-3.5deg) translateY(-2px) scale(0.99, 1.01); }
    100% { transform: rotate(3.5deg) translateY(0px) scale(1.01, 0.99); }
}
@keyframes wingFastL {
    0% { transform: rotate(-4deg) scale(1.02); }
    100% { transform: rotate(-16deg) scale(0.96); }
}
@keyframes wingFastR {
    0% { transform: rotate(4deg) scale(1.02); }
    100% { transform: rotate(16deg) scale(0.96); }
}
@keyframes starWalkDangle {
    0% { transform: rotate(18deg); }
    100% { transform: rotate(-14deg); }
}

/* JUMPING */
.is-jumping .rig-torso {
    transform: scale(0.92, 1.14);
    animation: none;
}
.is-jumping .part.wing-left {
    animation: wingJumpFlutterL 0.15s infinite ease-in-out alternate;
}
.is-jumping .part.wing-right {
    animation: wingJumpFlutterR 0.15s infinite ease-in-out alternate;
}
.is-jumping .part.nightcap {
    animation: nightcapJumpBounce 0.22s infinite ease-in-out alternate;
}
.is-jumping .star-tassel {
    animation: starJumpJiggle 0.16s infinite ease-in-out alternate;
}
.is-jumping .part.foot-left,
.is-jumping .part.foot-right {
    transform: translateY(2px) scale(0.96);
}
.is-jumping .face-part.arm.arm-left {
    transform: rotate(-22deg) translateY(-3px) scale(1.04);
}
.is-jumping .face-part.arm.arm-right {
    transform: rotate(22deg) translateY(-3px) scale(1.04);
}
.is-jumping .avatar-shadow {
    transform: translateX(-50%) scale(0.45);
    opacity: 0.2;
}

@keyframes wingJumpFlutterL {
    0% { transform: rotate(-32deg) scale(1.15, 0.95); }
    100% { transform: rotate(10deg) scale(0.95, 1.10); }
}
@keyframes wingJumpFlutterR {
    0% { transform: rotate(32deg) scale(1.15, 0.95); }
    100% { transform: rotate(-10deg) scale(0.95, 1.10); }
}
@keyframes nightcapJumpBounce {
    0% { transform: rotate(-8deg) translateY(-2px); }
    100% { transform: rotate(4deg) translateY(2px); }
}
@keyframes starJumpJiggle {
    0% { transform: rotate(-38deg) scale(1.2) translate(-2px, -2px); }
    50% { transform: rotate(-16deg) scale(1.08) translate(1px, 1px); }
    100% { transform: rotate(-30deg) scale(1.15) translate(-1px, 0px); }
}

/* SLEEPING (Cozy, natural, peacefully squished) */
.is-sleeping .rig-torso {
    transform: scale(1.10, 0.78) translateY(17px) !important;
    animation: sleepPulse 3.0s infinite ease-in-out !important;
}
.is-sleeping .face-part.eye {
    animation: none !important;
    opacity: 1 !important;
}
.is-sleeping .face-part.eye.eye-left {
    background-image: url('assets/rigged_pillow/eye_sleep_left.png') !important;
    transform: scale(1) translateY(2px) !important;
    filter: none;
}
.is-sleeping .face-part.eye.eye-right {
    background-image: url('assets/rigged_pillow/eye_sleep_right.png') !important;
    transform: scale(1) translateY(2px) !important;
    filter: none;
}
[data-mascot="classic"].is-sleeping .face-part.eye {
    filter: drop-shadow(0 0 4px rgba(255, 105, 180, 0.75)) !important;
}
.is-sleeping .face-part.blush {
    opacity: 1 !important;
    transform: scale(1.15) translateY(2px) !important;
    animation: none !important;
}
.is-sleeping .face-part.eyebrow {
    transform: translateY(2px) !important;
    animation: none !important;
}
.is-sleeping .face-part.mouth {
    transform: translateX(-50%) scale(0.95, 0.9) translateY(1px) !important;
    animation: none !important;
}
.is-sleeping .face-part.arm.arm-left {
    transform: rotate(20deg) translate(2px, -3px) scale(0.95) !important;
    animation: none !important;
}
.is-sleeping .face-part.arm.arm-right {
    transform: rotate(-20deg) translate(-2px, -3px) scale(0.95) !important;
    animation: none !important;
}
.is-sleeping .part.foot-left {
    transform: translateY(-2px) rotate(4deg) scale(1, 0.9) !important;
    animation: none !important;
}
.is-sleeping .part.foot-right {
    transform: translateY(-2px) rotate(-4deg) scale(1, 0.9) !important;
    animation: none !important;
}
.is-sleeping .part.nightcap {
    transform: rotate(5deg) translateY(4px) !important;
    animation: none !important;
}
.is-sleeping .star-tassel {
    animation-duration: 4.8s !important;
}
.is-sleeping .part.wing-left {
    transform: rotate(18deg) scale(0.85) !important;
    animation: none !important;
    opacity: 0.9;
}
.is-sleeping .part.wing-right {
    transform: rotate(-18deg) scale(0.85) !important;
    animation: none !important;
    opacity: 0.9;
}
.is-sleeping .zzz-container {
    display: block !important;
}

@keyframes sleepPulse {
    0%, 100% { transform: scale(1.10, 0.78) translateY(17px); }
    50% { transform: scale(1.13, 0.75) translateY(18px); }
}

/* CELEBRATE / CHAT POP */
.is-celebrating .rig-torso {
    animation: cheerBounce 0.4s ease;
}
@keyframes cheerBounce {
    0%, 100% { transform: scale(1, 1); }
    40% { transform: scale(1.18, 0.82) translateY(-8px); }
    70% { transform: scale(0.92, 1.12) translateY(-22px); }
}

/* ========================================================
   VIEWER COLOR PALETTES (CSS Filters)
   ======================================================== */
.palette-0 .rig-torso {
    /* Signature NeedSleep: Midnight Navy & Neon Pink */
}

.palette-1 .rig-torso {
    filter: hue-rotate(50deg) saturate(1.2); /* Dreamy Cyan */
}

.palette-2 .rig-torso {
    filter: hue-rotate(290deg) saturate(1.3); /* Sakura Berry */
}

.palette-3 .rig-torso {
    filter: hue-rotate(180deg) saturate(1.1); /* Emerald Slumber */
}

.palette-4 .rig-torso {
    filter: hue-rotate(90deg) saturate(1.4); /* Moonlight Lavender */
}

/* Test HUD */
#test-hud {
    position: fixed;
    top: 15px;
    left: 15px;
    background: rgba(15, 10, 25, 0.85);
    border: 1px solid #ff3399;
    border-radius: 12px;
    padding: 10px 16px;
    color: #fff;
    font-size: 12px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    display: flex;
    gap: 8px;
    align-items: center;
}

#test-hud button {
    background: #ff3399;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 5px 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s;
}

#test-hud button:hover {
    transform: scale(1.05);
    background: #ff66b2;
}

/* ========================================================
   MULTI-MASCOT THEMES CONFIGURATION
   ======================================================== */

/* ========================================================
   DYNAMIC EYE VFX SYSTEM (Sparkle, Hearts, Dizzy, Teary, Star Eyes)
   ======================================================== */
.face-part.eye-sparkle-layer {
    position: absolute;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transform-origin: center center;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

/* Classic Mascot Eye VFX Positions */
.face-part.eye-sparkle-layer.eye-sparkle-left {
    top: 41px;
    left: 27px;
    width: 33px;
    height: 28px;
}
.face-part.eye-sparkle-layer.eye-sparkle-right {
    top: 41px;
    right: 27px;
    width: 33px;
    height: 28px;
}

/* 1. Sparkle: Twinkling Starlight ✨ */
.eye-sparkle .face-part.eye-sparkle-layer {
    opacity: 1 !important;
    background-image: url('assets/fx/sparkle.png') !important;
    animation: eyeSparklePulse 1.25s infinite ease-in-out;
    filter: drop-shadow(0 0 6px #ffffff) drop-shadow(0 0 14px var(--sparkle-glow, #ff66cc));
}

/* 2. Hearts: Pulsing Anime Love Hearts 💖 */
.eye-hearts .face-part.eye-sparkle-layer {
    opacity: 1 !important;
    background-image: url('assets/fx/hearts.png') !important;
    animation: eyeHeartBeat 0.95s infinite ease-in-out;
    filter: drop-shadow(0 0 6px #ff2a85) drop-shadow(0 0 14px rgba(255, 60, 150, 0.95));
}

/* 3. Dizzy: Hypnotic Spinning Spiral 🌀 */
.eye-dizzy .face-part.eye-sparkle-layer {
    opacity: 1 !important;
    background-image: url('assets/fx/dizzy.png') !important;
    animation: eyeSpiralRotate 1.8s infinite linear;
    filter: drop-shadow(0 0 6px #ffd700) drop-shadow(0 0 12px rgba(255, 215, 0, 0.85));
}

/* 4. Teary: Glistening Anime Watery Tears 💧 */
.eye-teary .face-part.eye-sparkle-layer {
    opacity: 1 !important;
    background-image: url('assets/fx/teary.png') !important;
    animation: eyeTearWobble 1.6s infinite ease-in-out;
    filter: drop-shadow(0 0 6px #38bdf8) drop-shadow(0 0 14px rgba(56, 189, 248, 0.9));
}

/* 5. Star Eyes: Dazzling Idol Anime Star ⭐ */
.eye-star_eyes .face-part.eye-sparkle-layer {
    opacity: 1 !important;
    background-image: url('assets/fx/star_eyes.png') !important;
    animation: eyeIdolTwinkle 1.15s infinite ease-in-out;
    filter: drop-shadow(0 0 8px #ffea00) drop-shadow(0 0 18px rgba(255, 255, 255, 0.95));
}

/* Mascot Custom Glow Colors */
[data-mascot="classic"] { --sparkle-glow: #ff66cc; }
[data-mascot="dragon"] { --sparkle-glow: #ff7700; }
[data-mascot="deity"] { --sparkle-glow: #ffd700; }
[data-mascot="angel"] { --sparkle-glow: #00e5ff; }
[data-mascot="aura_ears"] { --sparkle-glow: #00ffd2; }

/* Hide eye VFX when sleeping, blinking, or happy eyes */
.is-sleeping .face-part.eye-sparkle-layer,
.is-blinking .face-part.eye-sparkle-layer,
.eye-happy .face-part.eye-sparkle-layer {
    display: none !important;
}

/* Subtle eyebrow dip during natural blink */
.is-blinking .face-part.eyebrow {
    transform: translateY(1.5px) !important;
}

/* Eye wink for Classic: delicate starlight glint at awake eye highlight */
[data-mascot="classic"].eye-wink .face-part.eye-sparkle-layer.eye-sparkle-left {
    display: none !important;
}
[data-mascot="classic"].eye-wink .face-part.eye-sparkle-layer.eye-sparkle-right {
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
    top: 38px !important;
    right: 25px !important;
    background-image: url('assets/fx/star_glint.png') !important;
    animation: eyeSparklePulse 0.85s infinite ease-in-out !important;
    filter: drop-shadow(0 0 4px #ffffff) drop-shadow(0 0 8px var(--sparkle-glow, #ff66cc)) !important;
}

/* ========================================================
   NATURAL MICRO-BLINK FOR ALL MASCOTS
   ======================================================== */
[data-mascot="classic"].is-blinking .face-part.eye {
    display: block !important;
}
[data-mascot="classic"].is-blinking .face-part.eye.eye-left {
    background-image: url('assets/rigged_pillow/eye_sleep_left.png') !important;
    transform: scale(1) translateY(2px) !important;
    filter: drop-shadow(0 0 4px rgba(255, 105, 180, 0.75)) !important;
}
[data-mascot="classic"].is-blinking .face-part.eye.eye-right {
    background-image: url('assets/rigged_pillow/eye_sleep_right.png') !important;
    transform: scale(1) translateY(2px) !important;
    filter: drop-shadow(0 0 4px rgba(255, 105, 180, 0.75)) !important;
}

/* ========================================================
   MASTERPIECE MULTI-MASCOT PROFILES (FAITHFUL TO CONCEPT ART)
   ======================================================== */

/* 1. DRAGON MASCOT */
/* DRAGON PILLOW BODY */
[data-mascot="dragon"] .part.pillow-body {
    background-image: url('assets/mascots/dragon/pillow_body.png');
    width: 126px;
    height: 154.3px;
    bottom: 8px;
    left: 17px;
    z-index: 5;
}
[data-mascot="dragon"] .part.wing.wing-left {
    background-image: url('assets/mascots/dragon/wing_left.png');
    width: 47.3px;
    height: 54.9px;
    left: -21.2px;
    top: 44.1px;
    transform-origin: 96.9% 60.0%;
    z-index: 2;
}
[data-mascot="dragon"] .part.wing.wing-right {
    background-image: url('assets/mascots/dragon/wing_right.png');
    width: 47.3px;
    height: 54.9px;
    left: 133.7px;
    top: 44.1px;
    transform-origin: 3.1% 60.0%;
    z-index: 2;
}
[data-mascot="dragon"] .part.head-accessory,
[data-mascot="dragon"] .part.floating-halo,
[data-mascot="dragon"] .part.aura-glow,
[data-mascot="dragon"] .part.ear,
[data-mascot="dragon"] .part.foot,
[data-mascot="dragon"] .face-part.arm,
[data-mascot="dragon"] .face-part.eyebrow,
[data-mascot="dragon"] .face-part.blush,
[data-mascot="dragon"] .face-part.eye,
[data-mascot="dragon"] .face-part.mouth {
    display: none !important;
}
[data-mascot="dragon"] .face-part.eye-sparkle-layer.eye-sparkle-left {
    top: 52px;
    left: 24px;
    width: 32px;
    height: 30px;
}
[data-mascot="dragon"] .face-part.eye-sparkle-layer.eye-sparkle-right {
    top: 52px;
    right: 24px;
    left: auto;
    width: 32px;
    height: 30px;
}
[data-mascot="dragon"].is-sleeping .part.pillow-body::after,
[data-mascot="dragon"].is-blinking .part.pillow-body::after {
    background-image: url('assets/mascots/dragon/pillow_body_sleep.png') !important;
    opacity: 1 !important;
}
[data-mascot="dragon"].eye-happy .part.pillow-body::after {
    background-image: url('assets/mascots/dragon/pillow_body_happy.png') !important;
    opacity: 1 !important;
}
[data-mascot="dragon"].eye-wink .part.pillow-body::after {
    background-image: url('assets/mascots/dragon/pillow_body_wink.png') !important;
    opacity: 1 !important;
}

/* 2. DEITY MASCOT */
/* DEITY PILLOW BODY */
[data-mascot="deity"] .part.pillow-body {
    background-image: url('assets/mascots/deity/pillow_body.png');
    width: 128px;
    height: 129.9px;
    bottom: 8px;
    left: 16px;
    z-index: 5;
}
[data-mascot="deity"] .part.floating-halo {
    display: block !important;
    position: absolute;
    background-image: url('assets/mascots/deity/halo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 87.1px;
    height: 43.4px;
    left: 36.4px;
    top: -7.8px;
    z-index: 2;
    animation: haloHover 3.2s infinite ease-in-out, deityHaloPulse 4.0s infinite ease-in-out;
}
[data-mascot="deity"] .part.wing.wing-left {
    background-image: url('assets/mascots/deity/wing_left.png');
    width: 47.2px;
    height: 73.3px;
    left: -13.9px;
    top: 31.2px;
    transform-origin: 97.6% 76.3%;
    z-index: 2;
}
[data-mascot="deity"] .part.wing.wing-right {
    background-image: url('assets/mascots/deity/wing_right.png');
    width: 47.4px;
    height: 73.3px;
    left: 126.6px;
    top: 31.2px;
    transform-origin: 2.4% 76.3%;
    z-index: 2;
}
[data-mascot="deity"] .part.head-accessory,
[data-mascot="deity"] .part.aura-glow,
[data-mascot="deity"] .part.ear,
[data-mascot="deity"] .part.foot,
[data-mascot="deity"] .face-part.arm,
[data-mascot="deity"] .face-part.eyebrow,
[data-mascot="deity"] .face-part.blush,
[data-mascot="deity"] .face-part.eye,
[data-mascot="deity"] .face-part.mouth {
    display: none !important;
}
[data-mascot="deity"] .face-part.eye-sparkle-layer.eye-sparkle-left {
    top: 43px;
    left: 30px;
    width: 30px;
    height: 28px;
}
[data-mascot="deity"] .face-part.eye-sparkle-layer.eye-sparkle-right {
    top: 43px;
    right: 30px;
    left: auto;
    width: 30px;
    height: 28px;
}
[data-mascot="deity"].is-sleeping .part.pillow-body::after,
[data-mascot="deity"].is-blinking .part.pillow-body::after {
    background-image: url('assets/mascots/deity/pillow_body_sleep.png') !important;
    opacity: 1 !important;
}
[data-mascot="deity"].eye-happy .part.pillow-body::after {
    background-image: url('assets/mascots/deity/pillow_body_happy.png') !important;
    opacity: 1 !important;
}
[data-mascot="deity"].eye-wink .part.pillow-body::after {
    background-image: url('assets/mascots/deity/pillow_body_wink.png') !important;
    opacity: 1 !important;
}

/* 3. ANGEL MASCOT */
/* ANGEL PILLOW BODY */
[data-mascot="angel"] .part.pillow-body {
    background-image: url('assets/mascots/angel/pillow_body.png');
    width: 124px;
    height: 132.3px;
    bottom: 12px;
    left: 18px;
    z-index: 5;
}
[data-mascot="angel"] .part.floating-halo {
    display: block !important;
    position: absolute;
    background-image: url('assets/mascots/angel/halo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 82.8px;
    height: 27.0px;
    left: 38.3px;
    top: -11.5px;
    z-index: 8;
}
[data-mascot="angel"] .part.wing.wing-left {
    background-image: url('assets/mascots/angel/wing_left.png');
    width: 48px;
    height: 66px;
    left: -23px;
    top: 28px;
    transform-origin: 95% 52%;
    z-index: 2;
}
[data-mascot="angel"] .part.wing.wing-right {
    background-image: url('assets/mascots/angel/wing_right.png');
    width: 48px;
    height: 66px;
    left: 135px;
    right: auto;
    top: 28px;
    transform-origin: 5% 52%;
    z-index: 2;
}
[data-mascot="angel"] .part.head-accessory,
[data-mascot="angel"] .part.aura-glow,
[data-mascot="angel"] .part.ear,
[data-mascot="angel"] .part.foot,
[data-mascot="angel"] .face-part.arm,
[data-mascot="angel"] .face-part.eyebrow,
[data-mascot="angel"] .face-part.blush,
[data-mascot="angel"] .face-part.eye,
[data-mascot="angel"] .face-part.mouth {
    display: none !important;
}
[data-mascot="angel"] .face-part.eye-sparkle-layer.eye-sparkle-left {
    top: 39px;
    left: 22px;
    width: 30px;
    height: 28px;
}
[data-mascot="angel"] .face-part.eye-sparkle-layer.eye-sparkle-right {
    top: 39px;
    right: 22px;
    left: auto;
    width: 30px;
    height: 28px;
}
[data-mascot="angel"].is-sleeping .part.pillow-body::after,
[data-mascot="angel"].is-blinking .part.pillow-body::after {
    background-image: url('assets/mascots/angel/pillow_body_sleep.png') !important;
    opacity: 1 !important;
}
[data-mascot="angel"].eye-happy .part.pillow-body::after {
    background-image: url('assets/mascots/angel/pillow_body_happy.png') !important;
    opacity: 1 !important;
}
[data-mascot="angel"].eye-wink .part.pillow-body::after {
    background-image: url('assets/mascots/angel/pillow_body_wink.png') !important;
    opacity: 1 !important;
}

/* 4. AURA & EARS MASCOT */
/* AURA_EARS PILLOW BODY */
[data-mascot="aura_ears"] .part.pillow-body {
    background-image: url('assets/mascots/aura_ears/pillow_body.png');
    width: 122px;
    height: 159.9px;
    bottom: 8px;
    left: 19px;
    z-index: 5;
}

/* Ethereal Spirit Flame Aura with Dynamic Wave Surges & Multi-Phase Buff Fire */
[data-mascot="aura_ears"] .part.aura-glow {
    display: block !important;
    position: absolute;
    background-image: url('assets/mascots/aura_ears/aura.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    width: 157.6px;
    height: 172.7px;
    left: 1.1px;
    top: -13.7px;
    z-index: 1;
    transform-origin: 50% 90%;
    animation: auraWaveSurge 2.8s infinite ease-in-out;
}

/* Inner fiery core surging asynchronously (Layer 2) */
[data-mascot="aura_ears"] .part.aura-glow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/mascots/aura_ears/aura.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    transform-origin: 50% 88%;
    mix-blend-mode: screen;
    filter: brightness(1.28) contrast(1.1);
    animation: auraCoreTurbulence 1.7s infinite ease-in-out;
    pointer-events: none;
}

/* Outer billowing ethereal wave crests (Layer 3) */
[data-mascot="aura_ears"] .part.aura-glow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/mascots/aura_ears/aura.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center bottom;
    transform-origin: 50% 92%;
    mix-blend-mode: color-dodge;
    animation: auraWaveBillow 3.4s infinite ease-in-out;
    pointer-events: none;
}

/* Fluffy Animated Animal Ears */
[data-mascot="aura_ears"] .part.ear {
    display: block !important;
    position: absolute;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 6;
}

[data-mascot="aura_ears"] .part.ear.ear-left {
    background-image: url('assets/mascots/aura_ears/ear_left.png');
    width: 36.9px;
    height: 56.1px;
    left: 33.0px;
    top: -7.1px;
    transform-origin: 50% 90%;
    animation: earTwitchLeft 4.2s infinite ease-in-out;
}

[data-mascot="aura_ears"] .part.ear.ear-right {
    background-image: url('assets/mascots/aura_ears/ear_right.png');
    width: 37.7px;
    height: 55.0px;
    left: 89.3px;
    top: -7.1px;
    transform-origin: 50% 90%;
    animation: earTwitchRight 4.6s infinite ease-in-out;
}

[data-mascot="aura_ears"] .part.head-accessory,
[data-mascot="aura_ears"] .part.wing,
[data-mascot="aura_ears"] .part.floating-halo,
[data-mascot="aura_ears"] .part.foot,
[data-mascot="aura_ears"] .face-part.arm,
[data-mascot="aura_ears"] .face-part.eyebrow,
[data-mascot="aura_ears"] .face-part.blush,
[data-mascot="aura_ears"] .face-part.eye,
[data-mascot="aura_ears"] .face-part.mouth {
    display: none !important;
}
[data-mascot="aura_ears"] .face-part.eye-sparkle-layer.eye-sparkle-left {
    top: 61px;
    left: 24px;
    width: 32px;
    height: 32px;
}
[data-mascot="aura_ears"] .face-part.eye-sparkle-layer.eye-sparkle-right {
    top: 61px;
    right: 24px;
    left: auto;
    width: 32px;
    height: 32px;
}
[data-mascot="aura_ears"].is-sleeping .part.pillow-body::after,
[data-mascot="aura_ears"].is-blinking .part.pillow-body::after {
    background-image: url('assets/mascots/aura_ears/pillow_body_sleep.png') !important;
    opacity: 1 !important;
}
[data-mascot="aura_ears"].eye-happy .part.pillow-body::after {
    background-image: url('assets/mascots/aura_ears/pillow_body_happy.png') !important;
    opacity: 1 !important;
}
[data-mascot="aura_ears"].eye-wink .part.pillow-body::after {
    background-image: url('assets/mascots/aura_ears/pillow_body_wink.png') !important;
    opacity: 1 !important;
}

/* ========================================================
   DYNAMIC 10 MOUTH EXPRESSION CLASSES
   ======================================================== */
.mouth-cat .face-part.mouth { background-image: url('assets/mouths/cat_smile.png') !important; }
.mouth-happy .face-part.mouth { background-image: url('assets/mouths/happy_open.png') !important; }
.mouth-o .face-part.mouth { background-image: url('assets/mouths/tiny_o.png') !important; }
.mouth-tongue .face-part.mouth { background-image: url('assets/mouths/cheeky_tongue.png') !important; }
.mouth-smug .face-part.mouth { background-image: url('assets/mouths/smug_w.png') !important; }
.mouth-smile .face-part.mouth { background-image: url('assets/mouths/gentle_smile.png') !important; }
.mouth-shout .face-part.mouth { background-image: url('assets/mouths/wide_shout.png') !important; }
.mouth-yawn .face-part.mouth { background-image: url('assets/mouths/sleepy_yawn.png') !important; }
.mouth-pout .face-part.mouth { background-image: url('assets/mouths/soft_pout.png') !important; }
.mouth-sleep .face-part.mouth { background-image: url('assets/mouths/sleeping_smile.png') !important; }

/* ========================================================
   DYNAMIC EYE VARIANT CLASSES & SPARKLE EFFECTS
   ======================================================== */
[data-mascot="classic"].eye-happy .face-part.eye.eye-left {
    background-image: url('assets/rigged_pillow/eye_happy_left.png') !important;
    animation: none !important;
}
[data-mascot="classic"].eye-happy .face-part.eye.eye-right {
    background-image: url('assets/rigged_pillow/eye_happy_right.png') !important;
    animation: none !important;
}
[data-mascot="classic"].eye-wink .face-part.eye.eye-left {
    background-image: url('assets/rigged_pillow/eye_happy_left.png') !important;
    animation: none !important;
}
[data-mascot="classic"].eye-wink .face-part.eye.eye-right {
    display: block !important;
    background-image: url('assets/rigged_pillow/eye_right.png') !important;
    animation: none !important;
}

/* ========================================================
   BREATHING ARMS & EAR TWITCH KEYFRAMES
   ======================================================== */
@keyframes armBreatheLeft {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    50% {
        transform: rotate(-6deg) translateY(-2px);
    }
}

@keyframes armBreatheRight {
    0%, 100% {
        transform: rotate(0deg) translateY(0);
    }
    50% {
        transform: rotate(6deg) translateY(-2px);
    }
}

@keyframes earTwitchLeft {
    0%, 18%, 28%, 100% {
        transform: rotate(0deg);
    }
    20% {
        transform: rotate(-14deg) scale(0.95, 1.05);
    }
    23% {
        transform: rotate(8deg);
    }
    25% {
        transform: rotate(-5deg);
    }
}

@keyframes earTwitchRight {
    0%, 58%, 68%, 100% {
        transform: rotate(0deg);
    }
    60% {
        transform: rotate(14deg) scale(0.95, 1.05);
    }
    63% {
        transform: rotate(-8deg);
    }
    65% {
        transform: rotate(5deg);
    }
}

@keyframes haloHover {
    0%, 100% {
        transform: translateY(0px) scale(1);
    }
    50% {
        transform: translateY(-4px) scale(1.03);
    }
}

@keyframes deityHaloPulse {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.75)) drop-shadow(0 0 24px rgba(255, 170, 0, 0.55));
        opacity: 0.95;
    }
    50% {
        filter: drop-shadow(0 0 16px rgba(255, 235, 80, 0.95)) drop-shadow(0 0 36px rgba(255, 190, 0, 0.8));
        opacity: 1;
    }
}

/* Surging fiery wave motion with vertical thrusts, licking crests, and dynamic neon flare */
@keyframes auraWaveSurge {
    0% {
        transform: translateY(0px) scale(1, 1) skewX(0deg);
        filter: drop-shadow(0 0 10px rgba(0, 255, 220, 0.75)) drop-shadow(0 -4px 22px rgba(160, 40, 240, 0.55));
    }
    18% {
        transform: translateY(-4px) scale(0.97, 1.05) skewX(-1.8deg);
    }
    38% {
        /* Powerful upward fiery wave surge */
        transform: translateY(-11px) scale(1.03, 1.13) skewX(2.2deg);
        filter: drop-shadow(0 -6px 18px rgba(0, 255, 240, 0.95)) drop-shadow(0 -12px 38px rgba(190, 60, 255, 0.85)) brightness(1.2);
    }
    55% {
        transform: translateY(-6px) scale(1.01, 1.08) skewX(-1.2deg);
    }
    72% {
        /* Secondary surging ripple */
        transform: translateY(-9.5px) scale(0.98, 1.10) skewX(1.5deg);
        filter: drop-shadow(0 -4px 14px rgba(0, 255, 230, 0.85)) drop-shadow(0 -8px 30px rgba(175, 50, 245, 0.75));
    }
    88% {
        transform: translateY(-2px) scale(1.02, 1.02) skewX(-0.8deg);
    }
    100% {
        transform: translateY(0px) scale(1, 1) skewX(0deg);
        filter: drop-shadow(0 0 10px rgba(0, 255, 220, 0.75)) drop-shadow(0 -4px 22px rgba(160, 40, 240, 0.55));
    }
}

@keyframes auraCoreTurbulence {
    0% {
        transform: translateY(1px) scale(0.96, 0.98) rotate(-0.8deg);
        opacity: 0.65;
    }
    25% {
        transform: translateY(-6px) scale(1.04, 1.12) rotate(1.4deg);
        opacity: 0.95;
    }
    50% {
        transform: translateY(-3px) scale(0.98, 1.06) rotate(-1.2deg);
        opacity: 0.75;
    }
    75% {
        transform: translateY(-8px) scale(1.05, 1.15) rotate(1.6deg);
        opacity: 1;
    }
    100% {
        transform: translateY(1px) scale(0.96, 0.98) rotate(-0.8deg);
        opacity: 0.65;
    }
}

@keyframes auraWaveBillow {
    0% {
        transform: scale(1, 1) skewX(0deg);
        opacity: 0.6;
    }
    30% {
        transform: scale(1.06, 1.04) skewX(2.8deg) translateY(-3px);
        opacity: 0.85;
    }
    65% {
        transform: scale(0.98, 1.08) skewX(-2.5deg) translateY(-7px);
        opacity: 0.92;
    }
    100% {
        transform: scale(1, 1) skewX(0deg);
        opacity: 0.6;
    }
}

@keyframes eyeSparkleGlint {
    0%, 100% {
        transform: scale(0.6) rotate(0deg);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.3) rotate(45deg);
        opacity: 1;
    }
}

@keyframes eyeJellyTwinkle {
    0%, 100% {
        transform: scale(0.85, 0.85) rotate(0deg);
        opacity: 0.8;
    }
    25% {
        transform: scale(1.35, 0.9) rotate(45deg) translateY(-2px);
        opacity: 1;
        filter: drop-shadow(0 0 8px var(--sparkle-glow, #ff66cc)) brightness(1.7);
    }
    50% {
        transform: scale(0.8, 1.3) rotate(90deg) translateY(1px);
        opacity: 0.7;
    }
    75% {
        transform: scale(1.25, 1.1) rotate(135deg) translateY(-1px);
        opacity: 1;
        filter: drop-shadow(0 0 10px var(--sparkle-glow, #ff66cc)) brightness(1.8);
    }
}

@keyframes eyeSparkleBounce {
    0%, 100% {
        transform: scale(0.9, 1.1) rotate(0deg) translateY(0);
        opacity: 0.75;
    }
    50% {
        transform: scale(1.3, 0.85) rotate(-45deg) translateY(-2px);
        opacity: 1;
        filter: drop-shadow(0 0 8px #ffffff) brightness(1.8);
    }
}

@keyframes eyeJellyBreathe {
    0%, 100% {
        transform: scale(1, 1);
    }
    50% {
        transform: scale(1.08, 0.92);
    }
}

/* ========================================================
   KEYFRAMES FOR MULTI-VARIANT EYE VFX
   ======================================================== */
@keyframes eyeSparklePulse {
    0%, 100% {
        transform: scale(0.95) rotate(0deg);
        opacity: 0.85;
    }
    50% {
        transform: scale(1.32) rotate(16deg);
        opacity: 1;
    }
}

@keyframes eyeHeartBeat {
    0%, 100% {
        transform: scale(1);
    }
    14% {
        transform: scale(1.30);
    }
    28% {
        transform: scale(1.06);
    }
    42% {
        transform: scale(1.36);
    }
    70% {
        transform: scale(1);
    }
}

@keyframes eyeSpiralRotate {
    0% {
        transform: rotate(0deg) scale(1.05);
    }
    50% {
        transform: rotate(180deg) scale(0.92);
    }
    100% {
        transform: rotate(360deg) scale(1.05);
    }
}

@keyframes eyeTearWobble {
    0%, 100% {
        transform: translateY(0) scale(1, 0.98);
        opacity: 0.9;
    }
    50% {
        transform: translateY(2px) scale(1.08, 1.08);
        opacity: 1;
    }
}

@keyframes eyeIdolTwinkle {
    0%, 100% {
        transform: scale(0.95) rotate(0deg);
    }
    25% {
        transform: scale(1.30) rotate(22deg);
    }
    50% {
        transform: scale(1.05) rotate(0deg);
    }
    75% {
        transform: scale(1.36) rotate(-22deg);
    }
}

/* ========================================================
   AIRBORNE DANGLING & HANGING ANIMATIONS (.is-dragging)
   ======================================================== */
.avatar-container.is-dragging .face-part.arm-left {
    animation: hangArmSquirmLeft 0.28s infinite alternate ease-in-out !important;
}

.avatar-container.is-dragging .face-part.arm-right {
    animation: hangArmSquirmRight 0.28s infinite alternate ease-in-out !important;
}

.avatar-container.is-dragging .face-part.foot-left {
    animation: hangFootPedalLeft 0.24s infinite alternate ease-in-out !important;
}

.avatar-container.is-dragging .face-part.foot-right {
    animation: hangFootPedalRight 0.24s infinite alternate ease-in-out !important;
}

@keyframes hangArmSquirmLeft {
    0% { transform: rotate(-25deg) translateY(-4px) scale(0.95); }
    100% { transform: rotate(15deg) translateY(2px) scale(1.05); }
}

@keyframes hangArmSquirmRight {
    0% { transform: rotate(25deg) translateY(-4px) scale(0.95); }
    100% { transform: rotate(-15deg) translateY(2px) scale(1.05); }
}

@keyframes hangFootPedalLeft {
    0% { transform: translateY(-6px) rotate(-12deg); }
    100% { transform: translateY(4px) rotate(8deg); }
}

@keyframes hangFootPedalRight {
    0% { transform: translateY(4px) rotate(8deg); }
    100% { transform: translateY(-6px) rotate(-12deg); }
}

/* Mascot-Specific Hanging Behaviors */
/* Dragon: Furious Wing Fluttering */
[data-mascot="dragon"].is-dragging .part.wing-left {
    animation: dragonHangFlapLeft 0.14s infinite alternate ease-in-out !important;
}
[data-mascot="dragon"].is-dragging .part.wing-right {
    animation: dragonHangFlapRight 0.14s infinite alternate ease-in-out !important;
}

@keyframes dragonHangFlapLeft {
    0% { transform: rotate(-25deg) scale(0.88, 1.1); }
    100% { transform: rotate(35deg) scale(1.15, 0.9); }
}

@keyframes dragonHangFlapRight {
    0% { transform: rotate(25deg) scale(0.88, 1.1); }
    100% { transform: rotate(-35deg) scale(1.15, 0.9); }
}

/* Angel: Majestic Slow Hover Strokes */
[data-mascot="angel"].is-dragging .part.wing-left {
    animation: angelHangHoverLeft 0.55s infinite alternate ease-in-out !important;
}
[data-mascot="angel"].is-dragging .part.wing-right {
    animation: angelHangHoverRight 0.55s infinite alternate ease-in-out !important;
}

@keyframes angelHangHoverLeft {
    0% { transform: rotate(-8deg) translateY(0px) scale(0.97, 1.04); }
    100% { transform: rotate(10deg) translateY(-4px) scale(1.05, 0.97); }
}

@keyframes angelHangHoverRight {
    0% { transform: rotate(8deg) translateY(0px) scale(0.97, 1.04); }
    100% { transform: rotate(-10deg) translateY(-4px) scale(1.05, 0.97); }
}

/* Aura & Ears: Panicked Rapid Ear Twitches */
[data-mascot="aura_ears"].is-dragging .part.ear.ear-left {
    animation: earHangTwitchLeft 0.16s infinite alternate ease-in-out !important;
}
[data-mascot="aura_ears"].is-dragging .part.ear.ear-right {
    animation: earHangTwitchRight 0.16s infinite alternate ease-in-out !important;
}

@keyframes earHangTwitchLeft {
    0% { transform: rotate(-25deg); }
    100% { transform: rotate(-4deg); }
}

@keyframes earHangTwitchRight {
    0% { transform: rotate(25deg); }
    100% { transform: rotate(4deg); }
}

/* Deity: Radiant Celestial Levitation (Centered above head with divine pulsation) */
[data-mascot="deity"].is-dragging .part.floating-halo {
    animation: deityHaloLevitate 0.7s infinite alternate ease-in-out !important;
    filter: drop-shadow(0 0 18px rgba(255, 235, 80, 0.95)) drop-shadow(0 0 36px rgba(255, 180, 0, 0.85)) brightness(1.18) !important;
}

@keyframes deityHaloLevitate {
    0% { transform: translateY(0px) scale(1.02); }
    100% { transform: translateY(-7px) scale(1.10); }
}

/* Classic: Sleepy Nightcap Swaying */
[data-mascot="classic"].is-dragging .part.nightcap {
    animation: nightcapDangleSwing 0.35s infinite alternate ease-in-out !important;
}

@keyframes nightcapDangleSwing {
    0% { transform: rotate(-16deg) scale(1.05); }
    100% { transform: rotate(12deg) scale(0.98); }
}

/* ========================================================
   FALLING WIND FX & RUSHING AIR STREAM (.is-falling)
   ======================================================== */
.part.falling-wind-fx {
    position: absolute;
    bottom: -15px;
    left: -15px;
    width: 190px;
    height: 190px;
    pointer-events: none;
    z-index: 18;
    display: none;
}

.avatar-container.is-falling .part.falling-wind-fx {
    display: block !important;
}

/* Vertical Wind Breeze Lines */
.wind-line {
    position: absolute;
    bottom: 0;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.85), rgba(180, 230, 255, 0.4), transparent);
    animation: windRushingUp 0.28s infinite linear;
}

.wind-line-1 {
    left: 28px;
    height: 65px;
    animation-delay: 0s;
}

.wind-line-2 {
    right: 28px;
    height: 80px;
    animation-delay: 0.12s;
}

.wind-line-3 {
    left: 50%;
    transform: translateX(-50%);
    height: 50px;
    animation-delay: 0.06s;
    width: 2px;
}

/* Fast Speed Streaks */
.wind-streak {
    position: absolute;
    bottom: 10px;
    width: 4px;
    height: 40px;
    border-radius: 4px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.95), transparent);
    animation: windStreakShoot 0.22s infinite ease-out;
}

.streak-1 {
    left: 15px;
    animation-delay: 0.08s;
}

.streak-2 {
    right: 15px;
    animation-delay: 0.18s;
}

@keyframes windRushingUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    30% {
        opacity: 0.9;
    }
    100% {
        transform: translateY(-90px);
        opacity: 0;
    }
}

@keyframes windStreakShoot {
    0% {
        transform: translateY(30px) scaleY(0.5);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(-110px) scaleY(1.4);
        opacity: 0;
    }
}

/* Mascot-Themed Falling Colors */
/* Dragon: Fiery Flame Embers */
[data-mascot="dragon"] .wind-line,
[data-mascot="dragon"] .wind-streak {
    background: linear-gradient(to top, #ff3300, #ffaa00, transparent) !important;
    box-shadow: 0 0 8px rgba(255, 69, 0, 0.8);
}

/* Deity: Divine Lightning Glints */
[data-mascot="deity"] .wind-line,
[data-mascot="deity"] .wind-streak {
    background: linear-gradient(to top, #ffd700, #ffaa00, transparent) !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.85);
}

/* Angel: Holy Feather Rays */
[data-mascot="angel"] .wind-line,
[data-mascot="angel"] .wind-streak {
    background: linear-gradient(to top, #ffffff, #c7ecee, transparent) !important;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
}

/* Aura & Ears: Spirit Wisps */
[data-mascot="aura_ears"] .wind-line,
[data-mascot="aura_ears"] .wind-streak {
    background: linear-gradient(to top, #a855f7, #06b6d4, transparent) !important;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.8);
}

/* Falling Postures */
.avatar-container.is-falling .face-part.arm-left {
    transform: rotate(-38deg) translateY(-8px) !important;
}

.avatar-container.is-falling .face-part.arm-right {
    transform: rotate(38deg) translateY(-8px) !important;
}

.avatar-container.is-falling .part.nightcap {
    transform: rotate(-22deg) translateY(-14px) scaleY(1.15) !important;
}



