/* import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Russo+One&display=swap');

/* add base styling */
* {
    margin: 0;
    padding: 0;
    border: none;
    box-sizing: border-box;
    font-family: 'Russo One', sans-serif;
    text-align: center;
    text-transform: uppercase;
}

/* assign image aspect ratio depending on dimensions provided in html */
img {
    height: auto;
  }

/* style .clear class to clear floats */
.clear {
    clear: both;
    line-height: 0;
}

/* style title area */
.title-area {
    margin: 1rem 0 1rem 0;
    color: #74522F;
}

.title-area h1 {
    font-size: 2.5rem;
    padding: 0.1rem 0;
}

/* style footer */
footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    overflow: hidden;
    margin: 1rem 0;
}

footer a {
    text-decoration: none;
    width: 100%;
    height: 100%;
    color: #FFFFFF;
}

/* style and position game area sections */
.games-area {
    width: 80%;
    margin: 0 auto;
    position: relative;
}

#match-area {
    margin-top: 2rem;
}

/* style rules area */
#rules-area h2 {
    text-decoration: underline;
    margin-bottom: 0.5rem;
    color: #74522F;
}

#rules-image-container {
    width: 30%;
    margin: 0 auto;
    border-radius: 10%;
    overflow: hidden;
}

#rules {
    margin: 0 auto;
    padding-top: 1rem;
    font-size: 1.25rem;
}

#rules ol {
    list-style-position: inside;
    padding-left: 0;
    text-transform: lowercase;
}

#rules li {
    text-transform: initial;
}

/* style player areas */
.player-area, .central-area {
    display: inline-block;
}

#user-area {
    float: left;
}

#cpu-area {
    float: right;
}

.player-area {
    width: 40%;
    padding: 1rem;
}

.player-area p {
    font-size: 1.5rem;
    padding-top: 0.25rem;
    color: #74522F;
}

.player-name {
    font-size: 2rem;
}

/* style central area */
.central-area {
    width: 20%;
}

#results-area, #countdown-area {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #74522F;
}

#results-area {
    font-size: 1.5rem;
    width: 20%;
}

#countdown-area {
    font-size: 2rem;
    color: #1B1D4E;
}

/* style images */
.image-container {
    border-radius: 10%;
    margin: 1rem;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    margin-bottom: -0.3rem;
}

/* style buttons */
.btn, .btn-small {
    padding: 0.5rem;
    margin: 0.5rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #1B1D4E;
    color: #FFFFFF;
    background-color: #1B1D4E;
}

#rules-area .btn {
    background-color: #74522F;
    border: 1px solid #74522F;
}

.btn:hover, .btn-small:hover {
    color: #1B1D4E;
    background-color: #FFFFFF;
}

#rules-area .btn:hover {
    color: #74522F;
    background-color: #FFFFFF;
}

/* style buttons within user image */
.btn-user {
    padding: 0;
    margin: 0;
    position: absolute;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    border-radius: 50%;
    opacity: 0;}

#user-image-container {
    position: relative;
}

#rock-button {
    top: 21.5%;
    left: 50.5%;
}

#paper-button {
    top: 43.5%;
    left: 80%;
}

#scissors-button {
    top: 78%;
    left: 69%;
}

#lizard-button {
    top: 78%;
    left: 32%;
}

#spock-button {
    top: 43.7%;
    left: 20.5%;
}

/* add class to hide elements upon request */
.hide {
    display: none;
}

.hide-visible {
    visibility: hidden;
}

/* add media queries for responsive design */
@media screen and (max-width: 950px) {
    .title-area h1 {
        font-size: 2rem;
        padding: 1rem 0;
    }

    #results-area {
        font-size: 1rem;
    }
}

/* threshold for vertical stacking */
@media screen and (max-width: 800px) {
    .title-area {
        margin: 1rem 0;
    }

    .title-area h1, #rules-area h2 {
        font-size: 1.5rem;
    }

    footer {
        margin: 0.25rem 0;
    }

    #rules-image-container {
        width: 50%;
    }

    .games-area, #rules-area {
        width: 95%;
    }

    #match-area {
        margin-top: 0;
    }

    .central-area {
        display: block;
        width: 100%;
        height: 7rem;
        position: relative;
    }

    .btn-small {
        font-size: 0.75rem;
    }

    #results-area {
        width: 100%;
    }

    .player-area{
        padding: 0;
    }

    .player-area p {
        font-size: 1.25rem;
    }

    #user-area, #cpu-area {
        float: none;
        clear: both;
        display: block;
        margin: 0 auto;
        width: 100%;
    }

    .image-container {
        width: 40%;
        margin: 0 auto;
    }

    .hide-visible {
        display: initial;
        visibility: hidden;
    }
}

@media screen and (max-width: 400px) {
    .title-area {
        margin: 0.5rem 0;
    }

    .title-area h1, #rules-area h2 {
        font-size: 0.9rem;
        padding: 0;
    }

    .games-area h2 {
        font-size: 0.8rem;
        padding: 0;
    }

    .player-area p {
        font-size: 0.75rem;
    }

    #rules {
        font-size: 0.8rem;
    }

    #rules-image-container {
        width: 40%;
    }

    .central-area {
        height: 3rem;
    }

    .btn {
        font-size: 0.8rem;
    }

    .btn-small {
        padding: 0.3rem;
        margin: 0;
        font-size: 0.75rem;
        border-radius: 0.25rem;
    }

    .image-container {
        width: 50%;
    }

    #current-result {
        font-size: 0.8rem;
    }
}