* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


html {
    height: 100dvh;
}

body {
    position: relative;
    max-width: 100%;
    width: 100%; 
    /*height: 100dvh;*/
    background-color: #006400;
    background-color: #021e12;
    margin: 0 auto;
    text-align: center;
    font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}

.game-levels-page {
    position: absolute;
    top: 120px;
    left: 60px;
    color: aliceblue;
}

.header {
    position: relative;
    width: 100%;
    max-width: 100%;
    position: relative;
    padding-top: 20px;
}

.score {
    position: absolute;
    top: 0;
    width: 100%;
    height: auto;
    color: white;
    font-size: 1.7rem;
    background-color: crimson;
    display: none;
    padding: 4%;
}

.header h1 {
    color: greenyellow;
    font-family: "Protest Revolution", monospace, cursive;
    font-weight: 600;
    font-style: normal;
    margin-bottom: 20px;
}

.instructions-container {
    padding-left: 40px;
    padding-right: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.instructions {
    position: relative;
    font-size: 2rem;
    font-family: "Luckiest Guy", cursive;
    font-weight: 100;
}

.beat-the-clock-text {
    color: yellowgreen;
}

.header h2 {
    color: aliceblue;
    font-size: 1.2rem; 
}

.stopwatch {
    position: relative;
    font-size: 1.7rem; /*1.2rem*/
    color: rgb(252, 220, 42); 
    background-color: transparent;
    border: none;
    outline: none;
  margin-left: 5px;
  display: inline-block;
}

.shake {
    animation: tilt-shaking 0.2s; 
    animation-iteration-count: 21;
}

.shake-cartoon {
    animation: tilt-shaking 0.2s; 
    animation-iteration-count: 9;
}

@keyframes tilt-shaking {
    0%  {transform: rotate(0deg);}
    25% {transform: rotate(20deg);}
    50% {transform: rotate(0deg);}
    75% {transform: rotate(-20deg);}
    100% {transform: rotate(0deg);}
}

/*.jump {
    animation: jump 0.4s;
    animation-iteration-count: 5;
}

@keyframes jump {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-50px);
    }
}*/

.game-levels-form {
    max-width: 100%;
    margin-top: 20px;
    margin-bottom: 150x;
}

.game-levels {
    max-width: 100%;
    width: 150px;
    font-size: 1.5rem; 
    font-weight: 400;  
    text-align: center;
    padding-right: 10px;
    padding-bottom: 5px;
    padding-left: 10px;
    border-radius: 8px;
    padding: 2px;
    background-color: rgb(10, 68, 10);
    background-color: #0a2e1b;
    color: whitesmoke;
    font-weight: 500;
    border: none;
}

.game-levels:hover {
    background-color: rgb(81, 148, 8);
}

.rules {
    color: gainsboro;
    font: 0.7rem;
}

.counter {
    max-width: 100%;
    width: 300px;
    display: inline-block;
    text-align: center;
    font-size: 1.8rem;
    background-color: transparent;
    border: none;
    margin-top: 5%;
    outline: none;    
    color: mintcream;
    font-weight: 800;
    margin-bottom: 15px;
}

.main {
    max-width: 100%;
    position: relative;
    width: 100%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    /*gap: 15px;*/
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.gameboard {
    max-width: 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ball {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: aliceblue;
    background-color: darkgreen;
    background-color: transparent;
    border: none;
    perspective: 1000px;
} 

.ball-inner {
    position: relative;
    background-color: yellowgreen;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: transform 01s;
    transform-style: preserve-3d;
}

.front, .back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    backface-visibility: hidden;
    font-weight: 600;
}

.front {
    background-color: yellowgreen;
    transform: translateY(0);
}

.back {
    transform: rotateY(180deg);
}

.ball.flipped .ball-inner {
    transform: rotateY(180deg);
}

.icons {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

/**icons-------------------------------------------/*/

.fa-heart {
    color: red;
}

.fa-medal {
    color: whitesmoke;
}

.fa-shoe-prints {
    color: black;
}

.fa-baseball {
    color: darkgreen;
}

.fa-person-walking {
    color: ivory;
}

.fa-spa {
    color: magenta;
}

.fa-plane {
    color: black;
}

.fa-sack-dollar {
    color: ivory;
}

.fa-handshake {
    color: teal;
}

.hide {
    display: none;
}

.show {
    display: block;
}

/*.flipped {
    transform: rotateY(180deg);
    background-color: black;
}*/

.happy-tennis-cartoon {
    max-width: 100%;
    width: 120px;
    height: 120px; /*200px;*/
    border-radius: 6px;
    margin-top: 5px;
}

.results-container { 
    position: absolute;
    top: -130px; 
    height: auto;
    display: flex;
    justify-content: center;
    visibility: hidden;
}

.winner {  
    max-width: 100%;
    width: 100%;
    height: auto; 
    display: none;
    background-color: snow;
    background-color: darkgreen;
    background-color: transparent;
    margin-top: -40px;
    border-radius: 20px;
    animation: easeIn 0.5s; 
}

.congrats-text {
    font-size: 1.5rem;
    color: snow;
    padding-bottom: 5%;
    font-family: "Luckiest Guy", cursive;
    font-weight: unset;
}

.winner-icons {
    color: gold;
    font-size: 1.7rem;
}

.winner-tennis-cartoon {
    max-width: 100%;
    width: 290px;
    height: 290px;
    padding-bottom: 30px;
}

.matched {
    pointer-events: none;
    opacity: 0.5;
}

.loser { 
    max-width: 100%;
    width: 100%;
    height: auto; 
    position: absolute;
    position: relative;
    margin-top: 75px;
    font-size: 2.5rem;
    color: aliceblue;
    background-color: transparent;
    border-radius: 20px;
    display: none;
    animation: easeIn 0.5s;
}

#announcer {
    position: absolute;
    top: -100%;
}

.game-over-text {
    font-size: 2.9rem;
    font-family: 'Luckiest Guy', cursive;
    font-weight: unset;
}

.angry-tennis-cartoon {
    max-width: 100%;
    width: 280px;
    height: 280px; /*270px;*/
    /*padding-bottom: 20px;*/
}

.rematch-btn {
    position: absolute;
    top: 108%;
    /*top:117px;*/
    width: auto;
    height: auto;
    background-color: crimson;
    padding: 12px 25px;
    color: white;
    margin-top: 20px;
    border-radius: 6px;
    font-size: 1.2rem;
    font-size: bold;
    display: none;
    outline: none;
    border: none;
}

.rematch-btn:hover {
    background-color: green;
    color: white;
}

.remaining-seconds {
    position: absolute; 
    top: 95%;
    color: antiquewhite;
    font-size: 1.7rem;
    font-weight: 800;
}

.footer {
    max-width: 100%;
    text-align: center;
    width: 100%;
}

.footer h3 {
    font-size: 0.9rem;
    color: aliceblue;
}
   
.rules-container {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.rules-container a {
    text-decoration: none;
    color: gainsboro;
    font-family: "Luckiest Guy", cursive;
    font-weight: unset;
}

.visible {
    visibility: visible;
}

.hide {
    visibility: hidden;
}

@keyframes easeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.leaderboard {
    max-width: 100%;
    position: absolute;
    top: 65px; 
    left: 0;
    height: auto;
    background-color: green;
    background-color: #033e1f;
    background-color: #010704;
    background-color: #0a2e1b;
    color: white;
    padding-top: 10px;
    padding-bottom: 10px;
    justify-content: center;
    display: none;
    border: 4px solid white;
    border-radius: 12px;
    margin: 10px;
}

.leaderboard h1 {
    padding-bottom: 15px;
    word-break: break-word;
}

.leaderboard th {
    width: 150px;
}

.leaderboard table {
    line-height: 2;
}

.left {
    text-align: left;
}

.close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 50px;
    background-color: black;
    color: white;
    font-size: 1.3rem;
    font-weight: 700;
    border: none;
    padding: 1%;
    border-radius: 6px;
}

@media screen and (max-width: 320px) {
    .header h1 {
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }
    .score   {
    font-size: 1rem;
}
    .game-over-text {
           overflow-wrap: anywhere;
                word-break: break-word;
                hyphens: auto;
    }
    .rematch-btn {
        padding: 10px;
        top: 115%;
    }
    /*.instructions {
        display: none;
    }*/
    .congrats-text {
           overflow-wrap: anywhere;
                word-break: break-word;
                hyphens: auto;
    }

    .leaderboard {
        font-size: 0.5rem;
        margin: 0;
    }
}

@media  screen and (orientation: landscape) {
    .winner {
        margin-top: 0;
    }

    .loser {
        margin-top: 100px;
    }
    .rematch-btn {
        margin-top: 60px;
    }
}

@media screen and (min-width: 320px) {
    .congrats-text {
        font-size: 2.5rem;
    }    

    .main {
        flex-direction: column;
    }

    .gameboard {
        width: 300px;   
    }

    .leaderboard {
    width: 380px;
    position: absolute;
    top: 290px;
    left: 47.5%;
    transform: translate(-50%, -50%);
    }
}

@media screen and (min-width: 578px) {

    .body {
        display: flex;
        flex-direction: column;
    }

    .header {
        padding: 2%;
        margin-bottom: 10px;
        padding-top: 20px;
    }
    
    .header p {
        font-size: 1.9rem;
        margin-bottom: 0;
    }

    .counter {
        margin-top: 2%;
        margin-bottom: 2%;
    }

    .congrats-text {
        margin-top: 20px;
    }

      .gameboard {
        width: 300px;   
    }

    .footer {
        padding-top: 60px;
    }

    .leaderboard {
        position: absolute;
        top: 320px;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

@media screen and (min-width: 900px) {
    .body {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 25px;
    }

    .header {
        padding-top: 0;
    }

    .main {
        width: 100%;
        flex-direction: column;
    }

    .gameboard {
        width: 600px;   
    }

    .results-container {
        top: -170px;
    }

    .congrats-text {
        margin-top: 0;
    }


    .loser {
        width: 100%;
   
    }

    .score {
        top: 0;
        left: 26%;
        width: 50%;
        padding-top: 1%;
        padding-bottom: 1%;
        border-radius: 25px;
    }

    .leaderboard {
        width: 420px;
        position: absolute;
        top: 40px;
        left: 49%;
        transform: translate(-50%, 12%);
        margin-top: 5px;
    }
    }
  

