/* Вкладка управления экипировкой */
.equipment-manager-container {
    padding: 20px;
    min-height: calc(100vh - 80px);
}

.character-equipment-view {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 620px;
    padding: 16px 12px;
}

/* Аватарка персонажа в центре */
.character-avatar-large {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* 2 слота по ширине и ~3.5 слота по высоте */
    width: 200px;
    height: 350px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    pointer-events: none;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.avatar-icon-large {
    font-size: 70px;
    opacity: 0.3;
}

.character-avatar-large .character-avatar-img {
    border-radius: 16px;
}

/* Сетка слотов экипировки */
.equipment-slots-grid {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 660px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px; /* уменьшено в 4 раза */
    padding: 12px 10px; /* небольшой зазор, итоговый промежуток ~4px от аватара */
    z-index: 2;
}

/* Слот экипировки */
.equipment-slot {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 58px;
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.equipment-slot:hover {
    border-color: rgba(74, 158, 255, 0.6);
    background: rgba(74, 158, 255, 0.1);
    transform: scale(1.03);
}

.equipment-slot.has-item {
    border-color: rgba(74, 158, 255, 0.5);
    background: rgba(74, 158, 255, 0.05);
}

.slot-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: 6px;
}

.slot-placeholder {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    padding: 4px;
}

/* Экипированный предмет в слоте */
.slot-item-image {
    position: relative;
    width: 95%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 2px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slot-item-rarity-dot {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 1.5px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8), inset 0 0 2px rgba(255, 255, 255, 0.3);
    z-index: 3;
}

.slot-item-level-badge {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85) 0%, rgba(20, 20, 40, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    z-index: 3;
}

.placeholder-slot {
    border: none;
    background: transparent;
    pointer-events: none;
}

/* Список подходящей экипировки в модальном окне */
.equipment-suitable-list-container {
    margin-top: 24px;
    padding: 0 4px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    grid-column: 1 / -1;
    width: 100%;
}

.equipment-suitable-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px 2px 2px;
}

.equipment-suitable-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.equipment-suitable-item:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: rgba(74, 158, 255, 0.3);
    transform: translateX(4px);
}

.equipment-suitable-item-image {
    width: 64px;
    height: 64px;
    min-width: 64px;
    min-height: 64px;
    border: 2px solid;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.equipment-suitable-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.equipment-suitable-item-info {
    flex: 1;
    min-width: 0;
}

.equipment-suitable-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.equipment-suitable-item-stats {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.equipment-suitable-item-stats .stat-badge {
    font-size: 11px;
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* Адаптивность для мобильных */
@media (max-width: 480px) {
    .character-equipment-view {
        min-height: 500px;
        padding: 20px 10px;
    }
    
    .equipment-slots-grid {
        max-width: 100%;
        height: 500px;
        gap: 8px;
        padding: 10px;
    }
    
    .equipment-slot {
        min-height: 60px;
    }
    
    .character-avatar-large {
        width: 170px;
        height: 260px;
    }
    
    .avatar-icon-large {
        font-size: 90px;
    }
    
    .slot-placeholder {
        font-size: 9px;
    }
    
    .equipment-suitable-list {
        max-height: 55vh;
    }
}

