/* Простая CSS схема попаданий - замена для Konva.js */
.hitbox-container {
    position: relative;
    width: 470px;
    height: 360px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 25%, #16213e 50%, #2a2d3a 75%, #0f172a 100%);
    border: 2px solid rgba(79, 83, 117, 0.6);
    border-radius: 15px;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6), 
        inset 0 2px 0 rgba(255, 255, 255, 0.15),
        0 0 40px rgba(79, 83, 117, 0.2);
    backdrop-filter: blur(10px);
}

.hitbox-body {
    position: absolute;
    left: 325px; /* Центр между правым краем hitbox-stats (179px) и правой границей hitbox-container (470px) */
    top: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 330px;
}

/* SVG силуэт игрока с современными эффектами */
.player-silhouette {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.player-silhouette .body-part {
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: 
        drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) 
        saturate(1.1) 
        brightness(1.0);
    transform-origin: center;
}

.player-silhouette .body-part:hover {
    stroke: #f38ba8 !important;
    stroke-width: 4 !important;
    filter: 
        brightness(1.6) 
        saturate(1.5) 
        drop-shadow(0 0 15px rgba(243, 139, 168, 0.9)) 
        drop-shadow(0 0 30px rgba(243, 139, 168, 0.6)) !important;
    transform: scale(1.12) rotate(1deg);
    z-index: 100;
    animation: pulseGlow 1.2s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        filter: 
            brightness(1.6) 
            saturate(1.5) 
            drop-shadow(0 0 15px rgba(243, 139, 168, 0.9)) 
            drop-shadow(0 0 30px rgba(243, 139, 168, 0.6));
        transform: scale(1.12) rotate(1deg);
    }
    100% {
        filter: 
            brightness(1.8) 
            saturate(1.7) 
            drop-shadow(0 0 20px rgba(243, 139, 168, 1)) 
            drop-shadow(0 0 40px rgba(243, 139, 168, 0.8));
        transform: scale(1.15) rotate(-0.5deg);
    }
}

/* Части тела */
.body-part {
    position: absolute;
    border: 2px solid #4f5375;
    background: rgba(79, 83, 117, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #cdd6f4;
    font-weight: bold;
}

.body-part:hover {
    border-color: #74c7ec;
    background: rgba(116, 199, 236, 0.3);
    transform: scale(1.05);
    z-index: 10;
}

.body-part.highlighted {
    border-color: #f38ba8;
    background: rgba(243, 139, 168, 0.3);
    box-shadow: 0 0 10px rgba(243, 139, 168, 0.4);
}

/* Позиционирование частей тела */
.head {
    top: 10px;
    left: 55px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.chest {
    top: 50px;
    left: 45px;
    width: 50px;
    height: 45px;
    border-radius: 8px 8px 4px 4px;
}

.stomach {
    top: 95px;
    left: 50px;
    width: 40px;
    height: 30px;
    border-radius: 4px;
}

.leftarm {
    top: 60px;
    left: 20px;
    width: 20px;
    height: 50px;
    border-radius: 10px;
    transform: rotate(-10deg);
}

.rightarm {
    top: 60px;
    right: 20px;
    width: 20px;
    height: 50px;
    border-radius: 10px;
    transform: rotate(10deg);
}

.leftleg {
    top: 125px;
    left: 50px;
    width: 16px;
    height: 60px;
    border-radius: 8px;
}

.rightleg {
    top: 125px;
    left: 74px;
    width: 16px;
    height: 60px;
    border-radius: 8px;
}

/* Статистика */
.hitbox-stats {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(30, 30, 46, 0.9);
    color: #cdd6f4;
    padding: 12px;
    border-radius: 8px;
    font-size: 11px;
    min-width: 140px;
    max-height: 280px;
    overflow-y: auto;
}

.weapon-name {
    color: #a6e3a1;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 13px;
    text-align: center;
}

.stat-line {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    padding: 2px 0;
    border-bottom: 1px solid rgba(79, 83, 117, 0.3);
}

.stat-line:last-child {
    border-bottom: none;
}

.stat-label {
    color: #b4befe;
    flex: 1;
}

.stat-value {
    color: #f9e2af;
    font-weight: bold;
    margin-left: 8px;
}

.stat-percent {
    color: #fab387;
    margin-left: 4px;
}

/* Полоски прогресса */
.stat-bar {
    width: 100%;
    height: 4px;
    background: rgba(79, 83, 117, 0.3);
    border-radius: 2px;
    margin-top: 2px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a6e3a1, #74c7ec);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* Tooltip */
.hitbox-tooltip {
    position: absolute;
    background: rgba(30, 30, 46, 0.95);
    color: #cdd6f4;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    border: 1px solid #4f5375;
    pointer-events: none;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hitbox-tooltip.show {
    opacity: 1;
}

/* Заголовок */
.hitbox-title {
    position: absolute;
    top: -30px;
    left: 0;
    right: 0;
    text-align: center;
    color: #cdd6f4;
    font-size: 14px;
    font-weight: bold;
}

/* Расширенные анимации */
@keyframes pulse {
    0%, 100% { 
        opacity: 0.7; 
        transform: scale(1);
    }
    50% { 
        opacity: 1;
        transform: scale(1.02);
        filter: brightness(1.2) saturate(1.1);
    }
}

.body-part.pulse {
    animation: pulse 2s infinite;
}

@keyframes bloodFlow {
    0% {
        filter: brightness(0.9) saturate(1.0);
        transform: scale(1);
    }
    25% {
        filter: brightness(1.1) saturate(1.2);
        transform: scale(1.01);
    }
    50% {
        filter: brightness(1.3) saturate(1.4);
        transform: scale(1.02);
    }
    75% {
        filter: brightness(1.1) saturate(1.2);
        transform: scale(1.01);
    }
    100% {
        filter: brightness(0.9) saturate(1.0);
        transform: scale(1);
    }
}

.body-part.blood-active {
    animation: bloodFlow 3s infinite;
}

@keyframes weaponChange {
    0% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    25% {
        opacity: 0.8;
        transform: scale(0.95) rotate(-0.5deg);
    }
    50% {
        opacity: 0.6;
        transform: scale(0.9) rotate(0deg);
    }
    75% {
        opacity: 0.8;
        transform: scale(0.95) rotate(0.5deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.hitbox-body.weapon-changing .body-part {
    animation: weaponChange 1s ease-in-out;
}

@keyframes damageIntensity {
    0% {
        filter: brightness(1) saturate(1);
    }
    50% {
        filter: brightness(1.3) saturate(1.5) hue-rotate(-10deg);
    }
    100% {
        filter: brightness(1) saturate(1);
    }
}

.body-part.high-damage {
    animation: damageIntensity 2.5s infinite;
}

/* Индикатор данных */
.data-indicator {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 8px;
    color: #a6e3a1;
    background: rgba(30, 30, 46, 0.8);
    padding: 2px 6px;
    border-radius: 10px;
}

/* Легенда цветов (вне контейнера) */
.hitbox-legend {
    margin: 10px auto 0 auto;
    width: 470px;
    background: rgba(24, 24, 37, 0.85);
    border: 1px solid rgba(79, 83, 117, 0.6);
    border-radius: 10px;
    padding: 10px 12px;
    color: #cdd6f4;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.hitbox-legend-title {
    font-weight: bold;
    color: #b4befe;
    margin-bottom: 6px;
    text-align: left;
    font-size: 12px;
}

.hitbox-legend-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
    font-size: 11px;
}

.hitbox-legend-list li {
    display: flex;
    align-items: center;
    color: #cdd6f4;
}

.hitbox-legend .swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 8px;
    border: 1px solid #4f5375;
}

/* Цвета соответствуют логике в PHP/JS */
.swatch-none { background: rgba(79, 83, 117, 0.1); }
.swatch-low { background: rgba(116, 199, 236, 0.4); }
.swatch-mid { background: rgba(166, 227, 161, 0.6); }
.swatch-high { background: rgba(249, 226, 175, 0.7); }
.swatch-veryhigh { background: rgba(243, 139, 168, 0.8); }

/* Мобильные устройства */
@media (max-width: 600px) {
    .hitbox-container {
        width: 100%;
        max-width: 400px;
        height: 300px;
    }
    
    .hitbox-body {
        left: 276px; /* Центр между правым краем hitbox-stats (151px) и правой границей hitbox-container (400px) */
        width: 120px;
        height: 200px;
    }
    
    .hitbox-stats {
        font-size: 10px;
        min-width: 120px;
        padding: 8px;
    }

    .hitbox-legend {
        width: 100%;
        max-width: 400px;
    }
}