@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    height: 100vh;
    overflow: hidden;
}

h4 {
    font-size: 20px;
    margin: 5px;
    text-transform: uppercase;
}

.counter {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.counter.hide {
    transform: translate(-50%, -50%) scale(0);
    animation: hide 0.2s ease-out;
}


/* animation 'hide' used above, it will hide the numbers */

@keyframes hide {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
    }
}

.final {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    text-align: center;
}


/* property that will enable the animation show */

.final.show {
    transform: translate(-50%, -50%) scale(1);
    animation: show 0.2s ease-out;
}

@keyframes show {
    /* starting with 0 */
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    /* applying the css to scale it to 1.4x of its size */
    30% {
        transform: translate(-50%, -50%) scale(1.4);
    }
    /* resizing it to normal size here */
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}


/* styling the nums div  */

.nums {
    color: #3498db;
    font-size: 50px;
    /* we are positioning it relative so that it's child elements can be made absolute */
    position: relative;
    overflow: hidden;
    width: 250px;
    height: 50px;
}

.nums span {
    /* next 3 line will center the span to body */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(120deg);
    /* it will make it rotate from the bottom center */
    transform-origin: bottom center;
}

.nums span.in {
    transform: translate(-50%, -50%) rotate(0deg);
    animation: goIn 0.5s ease-in-out;
}

.nums span.out {
    animation: goOut 0.5s ease-in-out;
}


/* Level of rotation can be changed by changing the percentage */

@keyframes goIn {
    0% {
        transform: translate(-50%, -50%) rotate(120deg);
    }
    30% {
        transform: translate(-50%, -50%) rotate(-20deg);
    }
    60% {
        transform: translate(-50%, -50%) rotate(10deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
}

@keyframes goOut {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    60% {
        transform: translate(-50%, -50%) rotate(20deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(-120deg);
    }
}

#replay {
    background-color: #3498db;
    border-radius: 3px;
    border: none;
    color: aliceblue;
    padding: 5px;
    text-align: center;
    display: inline-block;
    cursor: pointer;
    transition: all 0.3s;
}