*{
    box-sizing: border-box;

}

body {
    cursor: url("—Pngtree—tennis\ racquet\ icon_12288917.png") 20 20, auto;

    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #7a3331;
    background-image: url(Outdoor-Tennis-Court-Sport-Game-Graphics-7914628-1-1-580x371.jpeg);
    animation: backgroundAnimation 10s infinite alternate; /* Adjust animation duration and other properties */

}
@keyframes backgroundAnimation {
    0% {
        background-position: 0 0; /* Start position */
    }
    100% {
        background-position: 100% 100%; /* End position */
    }
}

.tennis-court {
    width: 800px;
    height: 400px;
    background-color: #1f8a11;
    position: relative;
    overflow: hidden;
}
.tennis-net {
    width: 2px;
    height: 100%;
    background-color: #fff;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}


@keyframes moveAround {
    0% {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) translateX(0px);
    }
    25% {
        top: 10%;
        left: 50%;
        transform: translate(-50%, -50%) translateX(150px);
    }
    50% {
        top: 50%;
        left: 90%;
        transform: translate(-50%, -50%) translateY(0px);
    }
    75% {
        top: 90%;
        left: 50%;
        transform: translate(-50%, -50%) translateX(-150px);
    }
    100% {
        top: 50%;
        left: 10%;
        transform: translate(-50%, -50%) translateY(0px);
    }
}



.baseline {
    width: 100%;
    height: 2px;
    background-color: #fff;
    position: absolute;
    bottom: 0px; /* Adjust the position as needed */
}

.sideline {
    width: 2px;
    height: 100%;
    background-color: #fff;
    position: absolute;
    left: 0px; /* Adjust the position as needed */
}
.topline {
    width: 100%;
    height: 2px;
    background-color: #fff;
    position: absolute;
    top: 0px; /* Adjust the position as needed */
}

.rightline {
    width: 2px;
    height: 100%;
    background-color: #fff;
    position: absolute;
    right: 0px; /* Adjust the position as needed */
}

/* Styling for the tennis balls (images) */
.tennis-ball {
    width: 40px; /* Adjust the width and height to match your image size */
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    bottom: 10;
    animation: moveAround 5s linear infinite;
}


@keyframes moveHorizontal {
    0% {
        left: -40px; 
    }
    100% {
        left: 100%; 
    }
}

.ball-1 {
    top: 50%; 
    left: -40px; 
    animation: moveHorizontal 6s linear infinite; 
}

.ball-2 {
    top: 50%; 
    left: -40px; 
    animation: moveHorizontal 8s linear infinite; 
}

.ball-3 {
    top: 50%; 
    left: -40px; 
    animation: moveHorizontal 5s linear infinite; 
}

.ball-4 {
    top: 50%; 
    left: -40px; 
    animation: moveHorizontal 7s linear infinite; 
}


@keyframes spin {
    0% {
        transform: translateX(-50%) translateY(-50%) rotate(0deg);
    }
    100% {
        transform: translateX(-50%) translateY(-50%) rotate(360deg);
    }
}
@keyframes moveForward {
    0% {
        left: 0;
    }
    50% {
        left: 50%;
    }
    100% {
        left: 100%;
    }
}
@keyframes moveReverse {
    0% {
        left: 100%;
    }
    50% {
        left: 50%;
    }
    100% {
        left: 0;
    }
}


/* Style for the spinning ball */
.spinning-ball {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 20%;
    transform: translate(-50%, -50%);
    animation: spin 4s linear infinite, moveHorizontal 8s linear infinite;
}
.spinning-ball2 {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    left: 0;
    bottom: 10%;
    transform: translate(-50%, -50%);
    animation: spin 4s linear infinite, moveHorizontal 8s linear infinite;
}
/* Keyframes animation for zigzag movement */
@keyframes zigzag {
    0% {
        left: 0;
        top: 0;
    }
    25% {
        left: 50%;
        top: 0;
    }
    50% {
        left: 50%;
        top: 50%;
    }
    75% {
        left: 0;
        top: 50%;
    }
    100% {
        left: 0;
        top: 0;
    }
}

/* Style for the tennis ball */
.tennis-ball-zigzag {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 0;
    animation: zigzag 1s linear infinite; /* Adjust the animation duration */
}

@keyframes zigzagFromBottom {
    0% {
        left: 0;
        top: 100%;
    }
    25% {
        left: 50%;
        top: 100%;
    }
    50% {
        left: 50%;
        top: 50%;
    }
    75% {
        left: 0;
        top: 50%;
    }
    100% {
        left: 0;
        top: 100%;
    }
}

/* Style for the tennis ball starting from the bottom corner */
.tennis-ball-zigzag-bottom {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 100%; /* Start from the bottom corner */
    animation: zigzagFromBottom 1s linear infinite; /* Adjust the animation duration */
}
@keyframes zigzagFromOppositeBottom {
    0% {
        left: 100%;
        top: 100%;
    }
    25% {
        left: 50%;
        top: 100%;
    }
    50% {
        left: 50%;
        top: 50%;
    }
    75% {
        left: 100%;
        top: 50%;
    }
    100% {
        left: 100%;
        top: 100%;
    }
}

/* Style for the tennis ball starting from the opposite bottom corner */
.tennis-ball-zigzag-opposite-bottom {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    left: 100%; /* Start from the opposite bottom corner */
    top: 100%; /* Start from the opposite bottom corner */
    animation: zigzagFromOppositeBottom 1s linear infinite; /* Adjust the animation duration */
}

@keyframes zigzagFromTop {
    0% {
        left: 100%;
        top: 0;
    }
    25% {
        left: 50%;
        top: 0;
    }
    50% {
        left: 50%;
        top: 50%;
    }
    75% {
        left: 100%;
        top: 50%;
    }
    100% {
        left: 100%;
        top: 0;
    }
}

/* Style for the tennis ball starting from the top corner */
.tennis-ball-zigzag-top {
    width: 40px;
    height: 40px;
    background-color: #f0f0f0;
    border-radius: 50%;
    position: absolute;
    left: 100%; /* Start from the top-right corner */
    top: 0; /* Start from the top-right corner */
    animation: zigzagFromTop 1s linear infinite; /* Adjust the animation duration */
}


