* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    position: relative;
    height: 100vh;
    background-color: #006400;
    margin: 0 auto;
    text-align: center;
    font-family:'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    padding-top: 5%;
    /*background: beige;*/
}

.header {
    position: relative;
    padding: 5%;
}

/*.game-rules {
    padding-top: 10%;
}*/

.header h1 {
    font-size: 2.5rem;
    color: greenyellow;
    font-family: "Protest Revolution", sans-serif;
    font-weight: 600;
    font-style: normal;
    margin-bottom: 3%;
}

.instructions {
    position: relative;
}

.header h2 {
    color: aliceblue;
    font-size: 1.2rem; 
}

.stopwatch {
    position: relative;
    font-size: 1.2rem; 
    color: rgb(252, 220, 42); 
    background-color: transparent;
    border: none;
    outline: none;
}

.shake {
    animation: tilt-shaking 0.3s; 
    animation-iteration-count: 21;
}

@keyframes tilt-shaking {
    0%  {transform: rotate(0deg);}
    25% {transform: rotate(20deg);}
    50% {transform: rotate(0deg);}
    75% {transform: rotate(-20deg);}
    100% {transform: rotate(0deg);}
}

.counter {
    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;
}

.main {
    position: relative;
    width: 80%;
    height: auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 0 auto;
    padding-bottom: 45%; /*20%*/
    /*background: pink;*/
}

.happy-tennis-cartoon {
    width: 300px;
    height: 200px;
    border-radius: 6px;
    margin-top: -5%;
}

.ball {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: aliceblue;
    background-color: darkgreen;
    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);
}

.flipped {
    transform: rotateY(180deg);
}

.icons {
    visibility: hidden;
}

.visible {
    visibility: visible;
}

/**icons-------------------------------------------/*/

.heart {
    color: red;
}

.medal {
    color: whitesmoke;
}

.shoe-prints {
    color: black;
}

.tennis-ball {
    color: darkgreen;
}

.person {
    color: ivory;
}

.spa {
    color: magenta;
}

.plane {
    color: black;
}

.money {
    color: ivory;
}

.handshake {
    color: teal;
}

.hide {
    display: none;
}

.show {
    display: block;
}

/*.flipped {
    transform: rotateY(180deg);
    background-color: black;
}*/

.matched {
    pointer-events: none;
    opacity: 0.5;
}

.winner-tennis-cartoon {
    width: 270px;
    height: 270px;
}

.angry-tennis-cartoon {
    width: 300px;
    height: 270px;
}

.footer {
    /*position: fixed;
    bottom: 0;*/
    text-align: center;
    width: 100%;
    padding-bottom: 5%;
    /*background: green;*/
}

.footer h2 {
    font-size: 0.9rem;
    color: aliceblue;
}

.results-container { 
    position: absolute;
    top: -99px;
    height: auto;
    display: flex;
    justify-content: center;
    visibility: hidden;
}

.visible {
    visibility: visible;
}

.hide {
    visibility: hidden;
}

@keyframes easeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.winner {  
    height: auto; 
    display: none;
    font-size: 2rem; 
    background-color: snow;
    background-color: darkgreen;
    padding-top: 23%;
    padding-right: 5%;
    padding-left: 5%;
    border-radius: 20px;
    animation: easeIn 0.5s; 
}

.congrats-text {
    color: snow;
    padding-bottom: 5%;
}

.winner-icons {
    color: gold;
}

.loser { 
    height: auto; 
    position: absolute;
    position: relative;
    margin-top: 23%; /*70px;*/
    font-size: 2.5rem;
    color: aliceblue;
    background-color: transparent;
    padding-right: 5%;
    padding-left: 5%;
    border-radius: 20px;
    display: none;
    animation: easeIn 0.5s;
}

.rematch-btn {
    position: absolute;
    top: 105%;
    /*top:117px;*/
    width: auto;
    height: auto;
    background-color: crimson;
    padding-top: 3%;
    padding-right: 5%;
    padding-bottom: 3%;
    padding-left: 5%;
    color: white;
    margin-top: 5%;
    border-radius: 6px;
    font-size: 1.2rem;
    font-size: bold;
    display: none;
    outline: none;
    border: none;
}

.rematch-btn:hover {
    background-color: green;
    color: white;
}


.score {
    position: fixed;
    top: 0;
    width: 100%;
    height: auto;
    color: white;
    font-size: 1.7rem;
    background-color: crimson;
    display: none;
    padding: 4%;
}

@media screen and (min-width: 600px) {
    .body {
        padding-top: 5%;
    }
    .header {
        padding-top: 5%;
        padding-bottom: 2%;
    }
    .header p {
        font-size: 1.9rem;
        margin-bottom: 0;
    }

    .counter {
        margin-top: 2%;
        margin-bottom: 2%;
    }
    .main {
        width: 45%;
    }
}

@media screen and (min-width: 900px) {
    .body {
        padding-top: 0;
    }

    .header {
        padding-top: 2%;
    }

    .main {
    width: 35%;
    }
    .results-container {
        top: -110px;
    }
    .winner {
        padding-left: 20%;
        padding-right: 20%;
    }
    .loser {
        min-width: 600px;
    }
    .score {
        top: 0;
        left: 25%;
        width: 50%;
        padding-top: 1%;
        padding-bottom: 1%;
        border-radius: 25px;
    }
}