/* 火柴人样式 */
#interactive-character {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transform-origin: center center;
    overflow: visible; /* 允许动画溢出 */
}

.stickman-body {
    overflow: visible;
}

/* 圆润线条 */
.stickman-body line, 
.stickman-body path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 关节点 */
.stickman-joint {
    fill: #333;
}

/* 血条 */
.stickman-health-bar {
    width: 80px;
}

.health-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.health-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.3s ease, background 0.3s ease;
    border-radius: 4px;
}

.health-text {
    font-size: 10px;
    color: white;
    text-align: center;
    margin-top: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

/* 火焰 */
@keyframes flameFlicker {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(1.3); opacity: 0.8; }
}

/* 伤害数字 */
@keyframes damageFloat {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-50px) scale(1.5); }
}

/* 手臂旋转中心 */
.stickman-arm-left-group,
.stickman-arm-right-group {
    transform-origin: 30px 28px;
}

/* 腿部旋转中心 */
.stickman-leg-left-group,
.stickman-leg-right-group {
    transform-origin: 30px 45px;
}

/* 走路起伏 */
#interactive-character[data-action="walk"] .stickman-head-group,
#interactive-character[data-action="walk"] .stickman-torso {
    animation: walkBounce 0.4s ease-in-out infinite;
}

@keyframes walkBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

#interactive-character[data-action="walk"] .stickman-leg-left-group {
    animation: legSwingLeft 0.8s linear infinite;
}

#interactive-character[data-action="walk"] .stickman-leg-right-group {
    animation: legSwingRight 0.8s linear infinite;
}

#interactive-character[data-action="walk"] .stickman-arm-left-group {
    animation: armSwingLeft 0.8s ease-in-out infinite;
}

#interactive-character[data-action="walk"] .stickman-arm-right-group {
    animation: armSwingRight 0.8s ease-in-out infinite;
}

/* 腿部摆动 */
@keyframes legSwingLeft {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-30deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(20deg); }
    100% { transform: rotate(0deg); }
}

@keyframes legSwingRight {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(20deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-30deg); }
    100% { transform: rotate(0deg); }
}

/* 手臂摆动 */
@keyframes armSwingLeft {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(25deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-25deg); }
    100% { transform: rotate(0deg); }
}

@keyframes armSwingRight {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-25deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(25deg); }
    100% { transform: rotate(0deg); }
}

/* 跳跃 */
#interactive-character[data-action="jump"] .stickman-arm-left-group { transform: rotate(-130deg); transition: transform 0.2s; }
#interactive-character[data-action="jump"] .stickman-arm-right-group { transform: rotate(-130deg); transition: transform 0.2s; }
#interactive-character[data-action="jump"] .stickman-leg-left-group { transform: rotate(15deg); transition: transform 0.2s; }
#interactive-character[data-action="jump"] .stickman-leg-right-group { transform: rotate(-10deg); transition: transform 0.2s; }

/* 破坏 */
#interactive-character[data-action="destroy"] .stickman-arm-left-group { transform: rotate(15deg); transition: transform 0.2s; }
#interactive-character[data-action="destroy"] .stickman-arm-right-group { animation: hammerSwing 0.4s ease-in-out infinite; }
#interactive-character[data-action="destroy"] .stickman-leg-left-group { transform: rotate(-15deg); transition: transform 0.2s; }
#interactive-character[data-action="destroy"] .stickman-leg-right-group { transform: rotate(20deg); transition: transform 0.2s; }

@keyframes hammerSwing {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-100deg); }
    50% { transform: rotate(60deg); }
    70% { transform: rotate(-20deg); }
}

/* 空闲 */
#interactive-character[data-action="idle"] .stickman-arm-left-group,
#interactive-character[data-action="idle"] .stickman-arm-right-group,
#interactive-character[data-action="idle"] .stickman-leg-left-group,
#interactive-character[data-action="idle"] .stickman-leg-right-group {
    transform: rotate(0deg);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 呼吸 */
#interactive-character[data-action="idle"] .stickman-torso {
    animation: breatheBody 2.5s ease-in-out infinite;
    transform-origin: 30px 45px;
}
#interactive-character[data-action="idle"] .stickman-head-group {
    animation: breatheHead 2.5s ease-in-out infinite;
}

@keyframes breatheBody {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.02); }
}
@keyframes breatheHead {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

/* 表情 */
.stickman-mouth { transition: d 0.2s ease; }

/* 眉毛汗滴 */
.stickman-eyebrow-left, .stickman-eyebrow-right, .stickman-sweat { transition: opacity 0.3s ease; }

/* 降落伞 */
#interactive-character[data-action="parachute"] .stickman-arm-left-group { transform: rotate(10deg); transition: transform 0.3s; }
#interactive-character[data-action="parachute"] .stickman-arm-right-group { transform: rotate(-10deg); transition: transform 0.3s; }
#interactive-character[data-action="parachute"] .stickman-leg-left-group { transform: rotate(10deg); transition: transform 0.3s; }
#interactive-character[data-action="parachute"] .stickman-leg-right-group { transform: rotate(-10deg); transition: transform 0.3s; }

/* 特效 */
.stickman-parachute { animation: parachuteFloat 2s ease-in-out infinite; }
@keyframes parachuteFloat {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.8; }
    100% { transform: scale(2); opacity: 0; }
}
@keyframes bounceIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) translateY(-50px); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) translateY(0); }
    70% { transform: translate(-50%, -50%) scale(0.9) translateY(0); }
    100% { transform: translate(-50%, -50%) scale(1) translateY(0); }
}
.destroying { pointer-events: none; position: relative; z-index: 1; }
.cracked { animation: crackedShake 0.2s ease-in-out; }
@keyframes crackedShake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-3px, 2px) rotate(-1deg); }
    75% { transform: translate(3px, -2px) rotate(1deg); }
}
.element-cracked::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 48%, rgba(0,0,0,0.3) 49%, rgba(0,0,0,0.3) 51%, transparent 52%);
    pointer-events: none;
}

[data-indestructible="true"] { 
    position: relative; 
}

/* Voronoi碎裂 */

/* 碎片 */
.voronoi-fragment {
    position: fixed;
    transform-origin: center center;
    transition: none;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 碎裂中 */
.shattering {
    pointer-events: none !important;
    transition: opacity 0.1s ease-out !important;
}

/* 冲击波 */
@keyframes shockwaveExpand {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
        border-width: 3px;
    }
    100% {
        width: 400px;
        height: 400px;
        opacity: 0;
        border-width: 0;
    }
}

/* 闪光 */
@keyframes flashFade {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* 淡出 */
.voronoi-fragment.fading {
    transition: opacity 0.5s ease-out;
    opacity: 0;
}

/* GPU加速 */
.voronoi-fragment,
.shattering {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* 阴影 */
.voronoi-fragment::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0.5;
}

/* 攻击指示 */
@keyframes attackPop {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.3) rotate(10deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg) translateY(-20px);
    }
}

/* 高光 */
.voronoi-fragment.highlighted {
    filter: brightness(1.2) drop-shadow(0 0 5px rgba(255, 150, 0, 0.8));
}

/* 移动端 */
@media (max-width: 768px) {
    .voronoi-fragment {
        box-shadow: none;
    }
    
    .voronoi-fragment::after {
        display: none;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .voronoi-fragment {
        transition: none !important;
        animation: none !important;
    }
}


/* 武器 */

.stickman-weapon {
    --dir: 1;
    transform: translate(-50%, -50%) scaleX(var(--dir));
    position: fixed;
    transition: transform 0.1s ease-out;
    transform-origin: 20% 90%;
    pointer-events: none;
    z-index: 10001;
    line-height: 1; 
    width: 40px; 
    height: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 拳头 */
@keyframes weaponThrust {
    0% { transform: translate(-50%, -50%) scaleX(var(--dir)) translate(0, 0); }
    30% { transform: translate(-50%, -50%) scaleX(var(--dir)) translate(25px, -5px) scale(1.3); } 
    100% { transform: translate(-50%, -50%) scaleX(var(--dir)) translate(0, 0); }
}

/* 锤子 */
@keyframes weaponSwing {
    0% { transform: translate(-50%, -50%) scaleX(var(--dir)) rotate(0deg); }
    20% { transform: translate(-50%, -50%) scaleX(var(--dir)) rotate(-45deg); } 
    50% { transform: translate(-50%, -50%) scaleX(var(--dir)) rotate(90deg); }  
    100% { transform: translate(-50%, -50%) scaleX(var(--dir)) rotate(0deg); }
}

/* 后坐力 */
@keyframes weaponRecoil {
    0% { transform: translate(-50%, -50%) scaleX(var(--dir)) translateX(0); }
    20% { transform: translate(-50%, -50%) scaleX(var(--dir)) translateX(-10px) rotate(10deg); }
    100% { transform: translate(-50%, -50%) scaleX(var(--dir)) translateX(0); }
}

/* 打击特效 */
@keyframes powEffect {
    0% { transform: scale(0.5) rotate(-15deg); opacity: 0; }
    50% { transform: scale(1.5) rotate(15deg); opacity: 1; }
    100% { transform: scale(1.2) rotate(0deg); opacity: 0; }
}

.pow-effect {
    font-family: 'Arial Black', sans-serif;
    font-weight: 900;
    -webkit-text-stroke: 1px black;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.5);
    animation: powEffect 0.4s ease-out forwards;
}

@keyframes weaponIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

/* 电锯 */
@keyframes chainsawSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 激光 */ 
@keyframes laserPulse {
    0%, 100% { opacity: 1; height: 4px; }
    50% { opacity: 0.8; height: 6px; }
}

/* 切换通知 */
@keyframes weaponNotification {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9);
    }
}

/* 攻击动画 */
#interactive-character[data-action="destroy"] .stickman-weapon {
    animation: weaponAttack 0.3s ease-in-out;
}

@keyframes weaponAttack {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(-30deg) scale(1.2); }
    100% { transform: rotate(0deg) scale(1); }
}

/* 枪口火焰 */
@keyframes muzzleFlash {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(2); }
}

/* 子弹 */
.bullet-trail {
    animation: bulletFade 0.1s linear;
}

@keyframes bulletFade {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* 爆炸 */
@keyframes explode {
    0% { 
        transform: scale(0); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.5); 
        opacity: 0.8; 
    }
    100% { 
        transform: scale(2.5); 
        opacity: 0; 
    }
}

/* 冲击 */
@keyframes shockwave {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(3);
        opacity: 0;
    }
}

/* 尾焰 */
@keyframes rocketTrail {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* 充能 */
@keyframes laserCharge {
    0% {
        box-shadow: 0 0 5px #00ffff;
    }
    50% {
        box-shadow: 0 0 20px #00ffff, 0 0 40px #0088ff;
    }
    100% {
        box-shadow: 0 0 5px #00ffff;
    }
}

/* 闪烁 */
@keyframes bombBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 木屑 */
@keyframes woodChipFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(360deg);
    }
}

/* 火花 */
@keyframes sparkFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

/* 悬浮 */
.weapon-icon {
    animation: weaponFloat 3s ease-in-out infinite;
}

@keyframes weaponFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-5px) rotate(5deg);
    }
    75% {
        transform: translateY(-5px) rotate(-5deg);
    }
}

/* 气泡 */
.speech-bubble {
    animation: bounceIn 0.3s ease-out;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 钻地机 */

.stickman-drill {
    animation: drillVibrate 0.1s ease-in-out infinite;
}

@keyframes drillVibrate {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes drillSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes dustPuff {
    0%, 100% { 
        transform: scale(1); 
        opacity: 0.6; 
    }
    50% { 
        transform: scale(1.3); 
        opacity: 0.8; 
    }
}

/* 钻地 */
#interactive-character[data-action="drill"] .stickman-arm-left-group { 
    transform: rotate(-45deg); 
    transition: transform 0.2s; 
}
#interactive-character[data-action="drill"] .stickman-arm-right-group { 
    transform: rotate(-45deg); 
    transition: transform 0.2s; 
}
#interactive-character[data-action="drill"] .stickman-leg-left-group { 
    transform: rotate(-10deg); 
    transition: transform 0.2s; 
}
#interactive-character[data-action="drill"] .stickman-leg-right-group { 
    transform: rotate(10deg); 
    transition: transform 0.2s; 
}

/* 载具 */

.stickman-vehicle {
    animation: vehicleBounce 0.3s ease-in-out infinite;
}

@keyframes vehicleBounce {
    0%, 100% { transform: translateY(0) scaleX(var(--dir, 1)); }
    50% { transform: translateY(-3px) scaleX(var(--dir, 1)); }
}

/* 骑车 */
#interactive-character.riding .stickman-arm-left-group { 
    transform: rotate(-30deg); 
    transition: transform 0.3s; 
}
#interactive-character.riding .stickman-arm-right-group { 
    transform: rotate(-30deg); 
    transition: transform 0.3s; 
}
#interactive-character.riding .stickman-leg-left-group { 
    animation: pedalLeft 0.6s linear infinite;
}
#interactive-character.riding .stickman-leg-right-group { 
    animation: pedalRight 0.6s linear infinite;
}

@keyframes pedalLeft {
    0% { transform: rotate(-20deg); }
    50% { transform: rotate(20deg); }
    100% { transform: rotate(-20deg); }
}

@keyframes pedalRight {
    0% { transform: rotate(20deg); }
    50% { transform: rotate(-20deg); }
    100% { transform: rotate(20deg); }
}

/* 回血 */

/* 吃东西 */
@keyframes eatFood {
    0% {
        opacity: 0;
        transform: translate(-20px, 20px) scale(0.5) rotate(-30deg);
    }
    30% {
        opacity: 1;
        transform: translate(0, 0) scale(1.2) rotate(10deg);
    }
    60% {
        opacity: 1;
        transform: translate(0, -5px) scale(1) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: translate(0, -30px) scale(0.3) rotate(0deg);
    }
}

/* 数字上浮 */
@keyframes healFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-40px) scale(1.3);
    }
}

/* 光圈脉冲 */
@keyframes healPulse {
    0% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.5);
    }
}

/* 追杀者样式 */
.stickman-hunter {
    filter: drop-shadow(0 2px 4px rgba(255, 0, 0, 0.5));
    transform-origin: center center;
    overflow: visible;
}

.hunter-body {
    overflow: visible;
}

.hunter-body line, 
.hunter-body path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 追杀者攻击动画 */
@keyframes hunterAttack {
    0% { 
        transform: scaleX(var(--dir, 1)) translateX(0); 
    }
    30% { 
        transform: scaleX(var(--dir, 1)) translateX(20px) rotate(10deg); 
    }
    60% { 
        transform: scaleX(var(--dir, 1)) translateX(-10px) rotate(-5deg); 
    }
    100% { 
        transform: scaleX(var(--dir, 1)) translateX(0); 
    }
}

/* 攻击斩击效果 */
@keyframes attackSlash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5) rotate(-45deg);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5) rotate(45deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2) rotate(90deg);
    }
}

/* 追杀者武器挥舞 */
.stickman-hunter .hunter-weapon {
    animation: weaponSlash 0.8s ease-in-out infinite;
    transform-origin: 45px 38px;
}

@keyframes weaponSlash {
    0%, 100% { 
        transform: rotate(0deg); 
    }
    25% { 
        transform: rotate(-30deg); 
    }
    75% { 
        transform: rotate(30deg); 
    }
}

/* 追杀者眼睛发光 */
.hunter-eye-left,
.hunter-eye-right {
    animation: eyeGlow 1.5s ease-in-out infinite;
}

@keyframes eyeGlow {
    0%, 100% { 
        fill: #fff;
        filter: drop-shadow(0 0 2px #ff0000);
    }
    50% { 
        fill: #ff6666;
        filter: drop-shadow(0 0 5px #ff0000);
    }
}

/* 追杀者气泡 */
.hunter-speech-bubble {
    animation: hunterBubbleIn 0.3s ease-out;
}

@keyframes hunterBubbleIn {
    0% {
        transform: scale(0) translateY(10px);
        opacity: 0;
    }
    50% {
        transform: scale(1.1) translateY(0);
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 子弹击中动画 */
@keyframes bulletHit {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.5);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* 子弹轨迹 */
.hunter-bullet {
    animation: bulletGlow 0.2s ease-in-out infinite;
}

@keyframes bulletGlow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 15px rgba(255, 0, 0, 1);
        transform: scale(1.2);
    }
}

/* 盾牌防御系统 */
.stickman-shield {
    animation: shieldPulse 0.8s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.8));
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        filter: drop-shadow(0 0 20px rgba(59, 130, 246, 1));
    }
}

/* 盾牌闪光特效 */
@keyframes shieldFlash {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.3);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2);
    }
}

/* 防御成功文字动画 */
@keyframes defenseFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
    }
}

/* 防御姿态 - 火柴人举盾 */
#interactive-character.defending .stickman-arm-left-group {
    transform: rotate(-90deg);
    transition: transform 0.2s ease-out;
}

#interactive-character.defending .stickman-arm-right-group {
    transform: rotate(-90deg);
    transition: transform 0.2s ease-out;
}

/* 盾牌震动效果 */
.stickman-shield.blocking {
    animation: shieldBlock 0.3s ease-out;
}

@keyframes shieldBlock {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    25% {
        transform: translate(-50%, -50%) scale(0.9) rotate(-5deg);
    }
    75% {
        transform: translate(-50%, -50%) scale(1.1) rotate(5deg);
    }
}

/* 时空门动画 */
/* Mobile wall phase */
.wall-phase-effect {
    position: fixed;
    z-index: 10006;
    max-width: min(78vw, 220px);
    padding: 6px 12px;
    border: 2px solid rgba(125, 211, 252, 0.95);
    border-radius: 999px;
    background: rgba(8, 47, 73, 0.92);
    color: #e0f2fe;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.9), inset 0 0 12px rgba(125, 211, 252, 0.25);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: wallPhaseText 0.95s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.hunter-wall-phase-effect {
    border-color: rgba(248, 113, 113, 0.95);
    background: rgba(69, 10, 10, 0.94);
    color: #fee2e2;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.9), inset 0 0 12px rgba(248, 113, 113, 0.25);
}

.wall-phase-ring {
    position: fixed;
    z-index: 10004;
    width: 82px;
    height: 82px;
    border: 3px solid rgba(125, 211, 252, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.85), inset 0 0 14px rgba(56, 189, 248, 0.35);
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.25);
    animation: wallPhaseRing 0.85s ease-out both;
}

.hunter-wall-phase-ring {
    border-color: rgba(248, 113, 113, 0.9);
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.9), inset 0 0 14px rgba(239, 68, 68, 0.35);
}

.wall-phase-spark {
    position: fixed;
    z-index: 10005;
    width: 6px;
    height: 16px;
    margin: -8px -3px;
    border-radius: 999px;
    background: #7dd3fc;
    box-shadow: 0 0 8px #38bdf8;
    pointer-events: none;
    transform: rotate(var(--spark-angle)) translateY(0) scaleY(0.4);
    animation: wallPhaseSpark 0.8s ease-out both;
}

.hunter-wall-phase-spark {
    background: #fca5a5;
    box-shadow: 0 0 8px #ef4444;
}

#interactive-character.wall-phasing,
.stickman-hunter.wall-phasing {
    opacity: 0.68;
    filter: saturate(1.6) brightness(1.35) drop-shadow(0 0 12px rgba(56, 189, 248, 0.95)) !important;
    animation: wallPhaseFlicker 0.18s steps(2, end) infinite;
}

.stickman-hunter.wall-phasing {
    filter: saturate(1.8) brightness(1.25) drop-shadow(0 0 12px rgba(239, 68, 68, 0.95)) !important;
}

@keyframes wallPhaseText {
    0% { opacity: 0; transform: translate(-50%, 8px) scale(0.65) rotate(-3deg); }
    35% { opacity: 1; transform: translate(-50%, -4px) scale(1.08) rotate(2deg); }
    100% { opacity: 0; transform: translate(-50%, -34px) scale(0.92) rotate(0deg); }
}

@keyframes wallPhaseFlicker {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.82; }
}

@keyframes wallPhaseRing {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25) rotate(-20deg); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45) rotate(160deg); }
}

@keyframes wallPhaseSpark {
    0% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(0) scaleY(0.4); }
    25% { opacity: 1; }
    100% { opacity: 0; transform: rotate(var(--spark-angle)) translateY(calc(var(--spark-distance) * -1)) scaleY(1); }
}

/* Mobile space teleport path, anchors, and animated callout. */
@media (max-width: 768px) {
    .mobile-teleport-path {
        position: fixed;
        z-index: 10003;
        height: 4px;
        pointer-events: none;
        transform-origin: 0 50%;
    }

    .mobile-teleport-path-line {
        position: absolute;
        inset: 0;
        border-radius: 999px;
        background: repeating-linear-gradient(90deg, rgba(224, 242, 254, 0.95) 0 12px, transparent 12px 22px);
        box-shadow: 0 0 8px rgba(56, 189, 248, 0.95), 0 0 18px rgba(125, 211, 252, 0.65);
        animation: mobileTeleportPath 0.65s linear infinite;
    }

    .hunter-mobile-teleport-path .mobile-teleport-path-line {
        background: repeating-linear-gradient(90deg, rgba(254, 226, 226, 0.95) 0 12px, transparent 12px 22px);
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.95), 0 0 18px rgba(248, 113, 113, 0.65);
    }

    .mobile-teleport-pulse {
        position: fixed;
        z-index: 10004;
        width: 10px;
        height: 10px;
        margin: -5px;
        border-radius: 50%;
        background: #e0f2fe;
        box-shadow: 0 0 8px #38bdf8, 0 0 16px rgba(125, 211, 252, 0.9);
        pointer-events: none;
        animation: mobileTeleportPulse 0.8s ease-out both;
    }

    .hunter-mobile-teleport-pulse {
        background: #fee2e2;
        box-shadow: 0 0 8px #ef4444, 0 0 16px rgba(248, 113, 113, 0.9);
    }

    .mobile-teleport-anchor {
        position: fixed;
        z-index: 10005;
        width: 26px;
        height: 26px;
        margin: -13px;
        border: 2px solid rgba(125, 211, 252, 0.95);
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(56, 189, 248, 0.95), inset 0 0 8px rgba(125, 211, 252, 0.65);
        pointer-events: none;
        animation: mobileTeleportAnchor 0.9s ease-out both;
    }

    .mobile-teleport-anchor::before,
    .mobile-teleport-anchor::after {
        content: '';
        position: absolute;
        left: 50%;
        top: 50%;
        width: 34px;
        height: 2px;
        background: currentColor;
        box-shadow: 0 0 8px currentColor;
        transform: translate(-50%, -50%);
    }

    .mobile-teleport-anchor::after {
        transform: translate(-50%, -50%) rotate(90deg);
    }

    .mobile-teleport-anchor {
        color: #7dd3fc;
    }

    .hunter-mobile-teleport-anchor {
        color: #fca5a5;
        border-color: rgba(248, 113, 113, 0.95);
        box-shadow: 0 0 10px rgba(239, 68, 68, 0.95), inset 0 0 8px rgba(248, 113, 113, 0.65);
    }

    .mobile-teleport-label {
        position: fixed;
        z-index: 10006;
        max-width: min(74vw, 230px);
        padding: 5px 10px;
        border: 2px solid rgba(125, 211, 252, 0.95);
        border-radius: 999px;
        background: rgba(8, 47, 73, 0.94);
        color: #e0f2fe;
        box-shadow: 0 0 16px rgba(56, 189, 248, 0.9), inset 0 0 10px rgba(125, 211, 252, 0.25);
        font-size: 13px;
        font-weight: 800;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
        pointer-events: none;
        transform: translate(-50%, -50%);
        animation: mobileTeleportLabel 1.05s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    }

    .hunter-mobile-teleport-label {
        border-color: rgba(248, 113, 113, 0.95);
        background: rgba(69, 10, 10, 0.94);
        color: #fee2e2;
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.9), inset 0 0 10px rgba(248, 113, 113, 0.25);
    }

    #interactive-character.mobile-teleporting,
    .stickman-hunter.mobile-teleporting {
        opacity: 0.68;
        filter: saturate(1.7) brightness(1.35) drop-shadow(0 0 14px rgba(56, 189, 248, 0.95)) !important;
        animation: mobileTeleportActor 0.14s steps(2, end) infinite;
    }

    .stickman-hunter.mobile-teleporting {
        filter: saturate(1.9) brightness(1.25) drop-shadow(0 0 14px rgba(239, 68, 68, 0.95)) !important;
    }
}

@keyframes mobileTeleportPath {
    from { background-position: 0 0; }
    to { background-position: 22px 0; }
}

@keyframes mobileTeleportPulse {
    0% { opacity: 0; transform: scale(0.35); }
    35% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0; transform: scale(0.2); }
}

@keyframes mobileTeleportAnchor {
    0% { opacity: 0; transform: scale(0.35) rotate(-45deg); }
    35% { opacity: 1; transform: scale(1.1) rotate(0deg); }
    100% { opacity: 0; transform: scale(1.3) rotate(45deg); }
}

@keyframes mobileTeleportLabel {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.65); }
    28% { opacity: 1; transform: translate(-50%, -4px) scale(1.05); }
    100% { opacity: 0; transform: translate(-50%, -35px) scale(0.92); }
}

@keyframes mobileTeleportActor {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.88; }
}

@keyframes portalPulse {
    0%, 100% { 
        filter: brightness(1) saturate(1);
    }
    50% { 
        filter: brightness(1.3) saturate(1.2);
    }
}

@keyframes portalRotate {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes portalRotateReverse {
    0% { transform: translate(-50%, -50%) rotate(360deg); }
    100% { transform: translate(-50%, -50%) rotate(0deg); }
}

/* 时空门粒子动画 */
@keyframes portalParticle {
    0%, 100% { 
        opacity: 0.3;
        transform: translate(var(--x, 0), var(--y, 0)) scale(1);
    }
    50% { 
        opacity: 1;
        transform: translate(var(--x, 0), var(--y, 0)) scale(1.5);
    }
}

/* 胜利星星动画 */
@keyframes victoryStar {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -150%) scale(1.5) rotate(180deg);
    }
    60% {
        opacity: 1;
        transform: translate(-50%, -200%) scale(1) rotate(360deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -250%) scale(0.5) rotate(540deg);
    }
}

/* 警告脉冲动画 */
@keyframes warningPulse {
    0%, 100% { 
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 20px rgba(255, 140, 0, 0.5);
    }
    50% { 
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 30px rgba(255, 140, 0, 0.8);
    }
}

/* 危险闪烁动画 */
@keyframes dangerFlash {
    0%, 100% { opacity: 0; }
    50% { opacity: 1; }
}

/* 弹入动画 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    70% {
        transform: translateX(-50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}
