/* --- СТИЛИ ДЛЯ ЭКРАНА СПИСКА БОССОВ --- */
@keyframes reward-pop-in { 0% { transform: scale(0) rotate(-180deg); opacity: 0; } 60% { transform: scale(1.2) rotate(10deg); opacity: 1; } 100% { transform: scale(1) rotate(0deg); opacity: 1; } }
.reward-popup-item { animation: reward-pop-in 0.6s cubic-bezier(.34,1.56,.64,1) both; }
.reward-popup-item .counter { animation: reward-text-glow 1.2s ease-in-out 0.4s both; }
@keyframes reward-text-glow { 0% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 12px #76c7ff, 0 0 20px #76c7ff; } 100% { text-shadow: 0 0 0 transparent; } }
@keyframes zoom005-in-zoom-out { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } }

/* --- СТИЛИ ДЛЯ ЭКРАНА БОЯ --- */
.battle-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px; 
    height: 640px;    
    max-height: 100vh;
    margin: 0 auto;
    overflow: hidden;
    background: #000;
    cursor: crosshair; 
    user-select: none;
}
.battle-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: brightness(0.7);
}

/* ШКАЛА БОССА */
.boss-health-container {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    width: 85%; height: 22px;
    background: rgba(0, 0, 0, 0.7); border: 2px solid #555; border-radius: 12px;
    z-index: 20; box-shadow: 0 0 10px rgba(0,0,0,0.8), inset 0 0 5px rgba(0,0,0,0.5);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.boss-health-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    background: linear-gradient(90deg, #ff2a2a, #ff6b6b);
    border-radius: 10px; transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px #ff2a2a;
}
.boss-health-text { position: relative; z-index: 2; font-size: 12px; font-weight: bold; text-shadow: 1px 1px 2px #000; letter-spacing: 1px; }

/* РЕСУРСЫ ПОД ШКАЛОЙ ЗДОРОВЬЯ */
.resources-display {
    position: absolute;
    top: 50px; 
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 20;
}
.resources-display .reward-miniatures { margin: 0; }
.resources-display .counter { font-size: 11px; }

/* ШКАЛА ИГРОКА */
.player-health-container {
    position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%);
    width: 65%; height: 18px;
    background: rgba(0, 0, 0, 0.8); border: 2px solid #333; border-radius: 10px;
    z-index: 15; box-shadow: 0 0 10px rgba(0,0,0,0.8);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
}
.player-health-fill {
    position: absolute; top: 0; left: 0; height: 100%;
    background: linear-gradient(90deg, #30ff44, #1bd110);
    border-radius: 8px; transition: width 0.3s ease-out; box-shadow: 0 0 10px #30ff44;
}
.player-health-text { position: relative; z-index: 2; font-size: 11px; font-weight: bold; text-shadow: 1px 1px 2px #000; }

/* БОСС И РУКИ */
.boss-container {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 80%; height: 80%; display: flex; justify-content: center; align-items: center;
    z-index: 5; will-change: transform; --bx: 0px; --by: 140px; --bscale: 1.5;
    transition: transform 0.1s ease-out;
}
.boss-img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.8)); }

.hands-layer { position: absolute; bottom: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 10; }
.hand { position: absolute; bottom: -10%; width: 65%; height: auto; transform-origin: bottom center; will-change: transform; --scale: 1.3; }
.hand.left { left: -15%; --tx: -70px; --ty: -60px; }
.hand.right { right: -15%; --tx: 70px; --ty: 10px; }

/* АНИМАЦИИ */
@keyframes breathe-hands-left {
    0% { transform: translate(var(--tx), var(--ty)) scale(var(--scale)) translateY(0) rotate(0deg); }
    50% { transform: translate(var(--tx), var(--ty)) scale(calc(var(--scale) * 1.02)) translateY(2%) rotate(-1deg); }
    100% { transform: translate(var(--tx), var(--ty)) scale(var(--scale)) translateY(0) rotate(0deg); }
}
@keyframes breathe-hands-right {
    0% { transform: translate(var(--tx), var(--ty)) scale(var(--scale)) translateY(0) rotate(0deg); }
    50% { transform: translate(var(--tx), var(--ty)) scale(calc(var(--scale) * 1.02)) translateY(2%) rotate(1deg); }
    100% { transform: translate(var(--tx), var(--ty)) scale(var(--scale)) translateY(0) rotate(0deg); }
}
@keyframes breathe-boss {
    0% { transform: translate(-50%, -50%) translate(var(--bx), var(--by)) scale(var(--bscale)); }
    50% { transform: translate(-50%, -50%) translate(var(--bx), calc(var(--by) - 1%)) scale(calc(var(--bscale) * 1.02)); }
    100% { transform: translate(-50%, -50%) translate(var(--bx), var(--by)) scale(var(--bscale)); }
}

.hand.left { animation: breathe-hands-left 3s infinite ease-in-out; }
.hand.right { animation: breathe-hands-right 3s infinite ease-in-out; }
.boss-container { animation: breathe-boss 4s infinite ease-in-out; }

.hand.strike { animation: none !important; transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) !important; }
.hand.left.strike { transform: translate(var(--tx), var(--ty)) scale(calc(var(--scale) * 1.2)) translateY(-20%) rotate(15deg) !important; }
.hand.right.strike { transform: translate(var(--tx), var(--ty)) scale(calc(var(--scale) * 1.2)) translateY(-20%) rotate(-15deg) !important; }

.boss-container.hit {
    animation: none !important;
    transform: translate(-50%, -50%) translate(var(--bx), calc(var(--by) + 20px)) scale(calc(var(--bscale) * 0.97)) !important;
}

/* Кнопка настроек */
#settings-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 20px;
    color: #ffd700;
    text-shadow: 1px 1px 2px #000;
    z-index: 50;
    transition: transform 0.2s ease;
}
#settings-btn:hover {
    transform: translateY(-50%) rotate(45deg);
} 
/* Анимация для основной цифры урона */
@keyframes floatUp {
    0% { opacity: 1; transform: translate(-50%, 0) scale(0.8); }
    20% { transform: translate(-50%, -20px) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -80px) scale(1); }
}

/* Анимация для плашек со способностями (появляются ниже, улетают вверх и исчезают) */
@keyframes floatUpAbility {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    20% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(-20px) scale(1); }
    100% { opacity: 0; transform: translateY(-40px) scale(0.9); }
}