.cat {
    width: 320px;
    height: 320px;
    margin: 0 auto;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.cat-shadow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    width: 220px;
    height: 40px;
    background: rgba(0,0,0,0.15);
    border-radius: 50%;
    transform: translateX(-50%);
    filter: blur(6px);
    animation: shadowPulse 4s infinite ease-in-out;
}

@keyframes shadowPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.4; }
    50% { transform: translateX(-50%) scale(1.1); opacity: 0.2; }
}

.cat-body {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 220px;
    background: linear-gradient(180deg, #242424, #111);
    border-radius: 45% 45% 35% 35%;
    box-shadow: inset -12px -20px 40px rgba(255,255,255,0.05);
}

.cat-neck {
    position: absolute;
    top: 20px;
    left: 50%;
    width: 120px;
    height: 140px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #1e1e1e, #0d0d0d);
    border-radius: 60% 60% 40% 40%;
}

.cat-head {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 190px;
    background: linear-gradient(180deg, #333, #111);
    border-radius: 55% 55% 45% 45%;
    box-shadow: inset -18px -15px 25px rgba(0,0,0,0.65);
    z-index: 1;
}

.cat-ear {
    position: absolute;
    width: 70px;
    height: 90px;
    background: linear-gradient(180deg, #2f2f2f, #0a0a0a);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    top: -55px;
    transform-origin: bottom center;
    --ear-open: 0deg;
    --ear-state: 0deg;
    --ear-lean: 0deg;
    --ear-shift: 0px;
    --ear-react: 1;
    transform: rotate(calc(var(--ear-open) + var(--ear-state))) skewX(var(--ear-lean)) translateY(var(--ear-shift)) scaleY(var(--ear-react));
    transition: transform 0.4s ease;
    z-index: 0;
}

.ear-left {
    left: 20px;
    --ear-open: -24deg;
    --ear-lean: -4deg;
}

.ear-right {
    right: 30px;
    --ear-open: 24deg;
    --ear-lean: 4deg;
}

.cat-ear::after {
    content: '';
    position: absolute;
    inset: 12px;
    background: linear-gradient(180deg, #fffdf7, #ffecec);
    clip-path: inherit;
}

.cat-eye {
    position: absolute;
    top: 30px;
    width: 56px;
    height: 92px;
    background: radial-gradient(circle at 50% 30%, #fff, #d0e7ff 70%);
    border-radius: 50% / 55% 55% 45% 45%;
    overflow: hidden;
    animation: blink 8s infinite;
}

.eye-left { left: 32px; }
.eye-right { right: 32px; }

@keyframes blink {
    0%, 45%, 100% { transform: scaleY(1); }
    48% { transform: scaleY(0.1); }
    50% { transform: scaleY(0.02); }
    52% { transform: scaleY(0.1); }
    55% { transform: scaleY(1); }
}

.cat-eye .pupil {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 34px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #000, #222 50%, #000 100%);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.cat-muzzle {
    position: absolute;
    top: 115px;
    left: 50%;
    width: 70px;
    height: 45px;
    transform: translateX(-50%);
    background: #272727;
    border-radius: 50% 50% 45% 45%;
}

.cat-nose {
    position: absolute;
    top: 4px;
    left: 50%;
    width: 24px;
    height: 16px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, #ff9a9e, #f6416c);
    border-radius: 50% 50% 60% 60%;
}

.cat-mouth {
    position: absolute;
    top: 18px;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translateX(-50%);
    border-bottom: 8px solid #9E9E9E;
    border-radius: 0 0 50% 50%;
}

.cat-mouth::after,
.cat-mouth::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 16px;
    border-bottom: 3px solid #333;
    border-radius: 0 0 50% 50%;
    top: 0;
}

.cat-mouth::before { left: -18px; transform: rotate(-20deg); }
.cat-mouth::after { right: -18px; transform: rotate(20deg); }

.cat-whiskers {
    position: absolute;
    top: 100px;
    left: 50%;
    width: 220px;
    height: 60px;
    transform: translateX(-50%);
}

.cat-whiskers .whisker {
    position: absolute;
    width: 90px;
    height: 2px;
    background: #fdf1d6;
    box-shadow: 0 0 6px rgba(255,255,255,0.4);
}

.whisker--left {
    left: calc(110% - 15px);
    transform-origin: right center;
}

.whisker--right {
    left: calc(-50% + 15px);
    transform-origin: left center;
}

.whisker--top { top: 6px; }
.whisker--mid { top: 28px; }
.whisker--bottom { top: 50px; }

.whisker--left.whisker--top { transform: rotate(-6deg) translateX(-60px); }
.whisker--left.whisker--mid { transform: rotate(0deg) translateX(-60px); }
.whisker--left.whisker--bottom { transform: rotate(6deg) translateX(-60px); }

.whisker--right.whisker--top { transform: rotate(6deg) translateX(60px); }
.whisker--right.whisker--mid { transform: rotate(0deg) translateX(60px); }
.whisker--right.whisker--bottom { transform: rotate(-6deg) translateX(60px); }

.cat-paw {
    position: absolute;
    bottom: -18px;
    width: 94px;
    height: 66px;
    background: linear-gradient(180deg, #2d2d2d, #090909);
    border-radius: 60px 60px 18px 18px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: inset 0 -10px 18px rgba(0,0,0,0.35);
}

.paw-left { left: 28px; }
.paw-right { right: 28px; }

.cat-paw::before {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    width: 64px;
    height: 1px;
    background: #EEEEEE;
    border-radius: 48px;
    transform: translateX(-50%);
    box-shadow: inset 0 -4px 6px rgba(0,0,0,0.15);
}

.cat-paw::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 10px;
    height: 24px;
    background: #9E9E9E;
    border-radius: 45% 45% 35% 35%;
    transform: translateX(-50%);
    box-shadow:
        -28px 0 0 0 #9E9E9E,
         28px 0 0 0 #9E9E9E,
        -28px 16px 0 -12px #fff,
         0 16px 0 -12px #fff,
         28px 16px 0 -12px #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

/* Preserve raised-palm pose for future "hands up" emotion */
.cat--hands-up .cat-paw {
    bottom: -5px;
    width: 78px;
    height: 98px;
    border-radius: 40% 40% 50% 50%;
    align-items: flex-end;
    box-shadow: none;
}

.cat--hands-up .cat-paw::before {
    bottom: 16px;
    width: 52px;
    height: 32px;
    background: #f2d0c6;
    box-shadow: none;
}

.cat--hands-up .cat-paw::after {
    bottom: 56px;
    width: 18px;
    height: 24px;
    border-radius: 50% 50% 40% 40%;
    box-shadow:
        -24px 4px 0 0 #f7b0b0,
         24px 4px 0 0 #f7b0b0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.15));
}

.cat-tail {
    position: absolute;
    margin-left: 187px;
    margin-top: 112px;
    width: 50;
    height: 440;
    display: flex;
    transform-origin: left center;
    translate: rotate(-10deg);
    animation: tailWiggle 3.6s infinite ease-in-out;
}

.cat-tail span {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(180deg, #1f1f1f, #050505);
    margin-left: -5px;
    box-shadow: inset -4px -6px 10px rgba(255,255,255,0.08);
    animation: tailBeat 3.6s infinite ease-in-out;
}

.cat-tail span::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.12) 20%, transparent 70%);
    top: 4px;
    left: -8px;
    transform: rotate(-18deg);
    opacity: 0.4;
}

.cat-tail span:nth-child(even) {
    transform: translateY(6px);
}

.cat-tail span:nth-child(odd) {
    transform: translateY(-6px);
}

.cat-tail span:nth-child(2) { animation-delay: 0.2s; }
.cat-tail span:nth-child(3) { animation-delay: 0.4s; }
.cat-tail span:nth-child(4) { animation-delay: 0.6s; }
.cat-tail span:nth-child(5) { animation-delay: 0.8s; }
.cat-tail span:nth-child(6) { animation-delay: 1s; }
.cat-tail span:nth-child(7) { animation-delay: 1.2s; }
.cat-tail span:nth-child(8) { animation-delay: 1.4s; }
.cat-tail span:nth-child(9) { animation-delay: 1.6s; }
.cat-tail span:nth-child(10) { animation-delay: 1.8s; }

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

@keyframes tailWiggle {
    0%, 100% { rotate: -8deg; }
    50% { rotate: 8deg; }
}

.cat-ear.ear-left::after,
.cat-ear.ear-right::after,
.cat-eye,
.cat-paw,
.cat-tail {
    transition: transform 0.3s ease, filter 0.3s ease;
}

/* Idle run-prep motion */
.cat--run-ready.cat--idle .cat-body {
    animation: runPrepBounce 2.4s infinite ease-in-out;
}

.cat--run-ready.cat--idle .cat-ear {
    animation: earSync 1.8s infinite ease-in-out;
}

.cat--run-ready.cat--idle .cat-paw.paw-left {
    animation: pawStrideLeft 1.6s infinite ease-in-out;
}

.cat--run-ready.cat--idle .cat-paw.paw-right {
    animation: pawStrideRight 1.6s infinite ease-in-out;
}

@keyframes runPrepBounce {
    0%, 100% { bottom: 40px; }
    50% { bottom: 46px; }
}

@keyframes earSync {
    0%, 100% { top: -55px; }
    50% { top: -60px; }
}

@keyframes pawStrideLeft {
    0%, 100% { bottom: -5px; }
    50% { bottom: 4px; }
}

@keyframes pawStrideRight {
    0%, 100% { bottom: 4px; }
    50% { bottom: -5px; }
}
