.gift {
    width: 50px;
    height: 50px;
    background-color: red;
    border-radius: 10px;
    position: absolute;
    animation: moveGift 5s infinite linear;
    cursor: pointer;
}

@keyframes moveGift {
    0% {
        top: 0;
        left: 0;
    }
    25% {
        top: 0;
        left: calc(100% - 50px);
    }
    50% {
        top: calc(100% - 50px);
        left: calc(100% - 50px);
    }
    75% {
        top: calc(100% - 50px);
        left: 0;
    }
    100% {
        top: 0;
        left: 0;
    }
}