/* Arena Health Bars UI */
#arena-health-bars {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    justify-content: center;
    gap: 30px;
    z-index: 9999;
    pointer-events: none;
}

#arena-health-bars.show {
    display: flex;
}

.arena-health-bar-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Health bar frame */
.arena-health-frame {
    position: relative;
    width: 200px;
    height: 35px;
    background-image: url('../assets/icon/dautruong/khungmau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Health fill (máu) */
.arena-health-fill-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.arena-health-fill {
    position: absolute;
    top: 0;
    height: 100%;
    background-image: url('../assets/icon/dautruong/mau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: width 0.3s ease-out;
    width: 100%;
}

/* VS container in center */
.arena-vs-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-shrink: 0;
}

/* VS icon in center */
.arena-vs-icon {
    width: 35px;
    height: 35px;
    background-image: url('../assets/icon/dautruong/vs.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

/* Timer below VS icon */
.arena-timer {
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    font-family: 'Arial', sans-serif;
    letter-spacing: 1px;
}

.arena-timer.warning {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

.arena-timer.danger {
    color: #e74c3c;
    animation: pulse 0.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Left health bar (player) - health decreases from right to left */
.arena-health-bar-left .arena-health-fill {
    left: 0;
    width: 100%;
}

/* Right health bar (opponent) - health decreases from left to right */
.arena-health-bar-right .arena-health-fill {
    right: auto;
    left: 0;
    width: 100%;
}

/* Health text below frame */
.arena-health-text {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 3px;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
}

/* Mobile styles - smaller */
@media (max-width: 768px) {
    #arena-health-bars {
        gap: 15px;
        top: 5px;
    }

    .arena-health-frame {
        width: 140px;
        height: 25px;
    }

    .arena-vs-icon {
        width: 25px;
        height: 25px;
    }

    .arena-timer {
        font-size: 11px;
    }

    .arena-health-text {
        font-size: 9px;
        margin-top: 2px;
    }
}

/* Monster Health Bar (top center) */
#monster-health-bar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 9998;
    pointer-events: none;
}

.monster-health-name {
    color: #e74c3c;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    font-family: 'Arial', sans-serif;
}

.monster-health-frame {
    position: relative;
    width: 200px;
    height: 35px;
    background-image: url('../assets/icon/dautruong/khungmau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.monster-health-fill-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.monster-health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-image: url('../assets/icon/dautruong/mau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: width 0.3s ease-out;
    width: 100%;
}

.monster-health-text {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    font-family: 'Arial', sans-serif;
}

/* Other Player Health Bar (top center, when nearby) */
#other-player-health-bar {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    z-index: 9997;
    pointer-events: none;
}

.other-player-health-name {
    color: #4ba8ff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8), 0 0 10px rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    font-family: 'Arial', sans-serif;
}

.other-player-health-frame {
    position: relative;
    width: 200px;
    height: 35px;
    background-image: url('../assets/icon/dautruong/khungmau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.other-player-health-fill-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.other-player-health-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-image: url('../assets/icon/dautruong/mau.webp');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: width 0.3s ease-out;
    width: 100%;
}

.other-player-health-text {
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    font-family: 'Arial', sans-serif;
}

/* Mobile styles */
@media (max-width: 768px) {
    #monster-health-bar {
        top: 5px;
        gap: 3px;
    }

    .monster-health-name {
        font-size: 11px;
    }

    .monster-health-frame {
        width: 140px;
        height: 25px;
    }

    .monster-health-text {
        font-size: 9px;
    }

    #other-player-health-bar {
        top: 5px;
        gap: 3px;
    }

    .other-player-health-name {
        font-size: 11px;
    }

    .other-player-health-frame {
        width: 140px;
        height: 25px;
    }

    .other-player-health-text {
        font-size: 9px;
    }

    #player-health-bar {
        top: 38px;
    }

    .player-health-frame {
        width: 140px;
        height: 25px;
    }

    .player-health-text {
        font-size: 9px;
    }
}