/*
 * Оформление всплывающих эффектов возле получателя действия.
 */

.battle-effect-layer {
    position: absolute;
    z-index: 12;
    top: 12px;
    left: 75px;
    width: min(190px, calc(100% - 20px));
    pointer-events: none;
    transform: translateX(-50%);
}

.battle-effect-popup {
    display: grid;
    gap: 3px;
    width: max-content;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid #ffffff26;
    border-radius: 9px;
    background: #090d14e8;
    box-shadow: 0 8px 24px #00000099;
    animation: battle-effect-popup 1.15s ease both;
    margin: 0 auto;
}

.battle-effect-popup strong {
    overflow: hidden;
    color: #ffffff;
    font-size: 12px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.battle-effect-popup small {
    color: #ff9696;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.battle-final-damage {
    position: absolute;
    z-index: 13;
    top: 45%;
    right: 8px;
    color: #ff626a;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    text-shadow:
        0 2px 4px #000000,
        0 0 13px #e7464f99;
    pointer-events: none;
    animation: battle-final-damage 0.9s ease-out both;
}

#battleScreen.fast-battle-animation .battle-effect-popup {
    animation-duration: 0.92s;
}

#battleScreen.fast-battle-animation .battle-final-damage {
    animation-duration: 0.72s;
}

.battle-effect-compact {
    display: inline-block;
    padding: 6px 9px;
}

.battle-effect-defense {
    border-color: #e2bd62aa;
    box-shadow: 0 0 20px #e2bd6240;
}

.battle-effect-defense small {
    color: #ffe28c;
}

.battle-effect-heal {
    border-color: #58d68daa;
    box-shadow: 0 0 20px #58d68d40;
}

.battle-effect-heal small {
    color: #76f0a8;
}

.battle-effect-boost {
    border-color: #e68b4aaa;
    box-shadow: 0 0 20px #e68b4a40;
}

.battle-effect-damage {
    border-color: #e35d68aa;
    box-shadow: 0 0 20px #e35d6840;
}

.battle-effect-critical {
    border-color: #f0a64faa;
    box-shadow: 0 0 22px #f08a3f59;
}

.battle-effect-critical strong {
    color: #ffd078;
}

.battle-effect-control {
    border-color: #a879e8aa;
    box-shadow: 0 0 20px #a879e84d;
}

.battle-effect-control small {
    color: #d9b7ff;
}

.battle-effect-dodge {
    border-color: #4ebbe0aa;
    color: #9ce9ff;
}

.battle-effect-miss {
    border-color: #9299a5aa;
    color: #d0d4db;
}

@keyframes battle-effect-popup {
    0% {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
    }

    18%,
    72% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateY(-7px) scale(0.98);
    }
}

@keyframes battle-final-damage {
    0% {
        opacity: 0;
        transform: translate(0, 8px) scale(0.72);
    }

    22% {
        opacity: 1;
        transform: translate(-7px, 0) scale(1.12);
    }

    72% {
        opacity: 1;
        transform: translate(-11px, -5px) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-17px, -15px) scale(0.94);
    }
}

@media (max-width: 9999px) {
    .battle-effect-layer {
        top: 7px;
        left: 50%;
        width: min(155px, calc(100% - 12px));
    }

    .battle-effect-popup {
        padding: 6px 8px;
    }

    .battle-effect-popup strong {
        font-size: 10px;
    }

    .battle-effect-popup small {
        font-size: 9px;
    }

    .battle-final-damage {
        top: 42%;
        right: 5px;
        font-size: 20px;
    }
}
