body,
html {
    height: 100%;
}

body {
    background-color: #222;
}

.container {
    height: 300px;
    width: 300px;
    background-color: brown;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.absolute-center {
    left: 50%;
    top: 50%;
    position: absolute;
    transform: translate(-50%, -50%);
}

.cradle__top {
    height: 10px;
    background-color: lightgray;
    width: 80%;
    border-radius: 6px;
}

.cradle__pendulum-box {
    height: 70%;
    width: 80%;
    position: relative;
    display: flex;
    justify-content: space-between;
}

.cradle__pendulum {
    height: 100%;
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform-origin: top center;
}

.cradle__pendulum:nth-of-type(1) {
    animation: move-left-pendulum 2.5s ease-in-out infinite;
}

.cradle__pendulum:nth-last-of-type(1) {
    animation: move-right-pendulum 2.5s ease-in-out infinite;
}

.cradle__pendulum-cord {
    height: 78%;
    width: 1px;
    background-color: white;
}

.cradle__pendulum-ball {
    height: 22%;
    width: 100%;
    border-radius: 100%;
    background-color: white;
    position: relative;
}

@keyframes move-left-pendulum {
    0%,
    50%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(40deg);
    }
}

@keyframes move-right-pendulum {
    0%,
    50%,
    100% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(-40deg);
    }
}
