@import url('https://fonts.googleapis.com/css2?family=ABeeZee&display=swap');

/* Main Page Layout */

* {
    margin: 0;
    padding: 0;
    border: none;
    box-sizing: inherit;
}

body {
    font-family: 'ABeeZee', sans-serif;
    color: white;
    background: url("../images/background-image.jpg") center;
    width: 100%;
    height: 93.4vh;
}

main {
    position: relative;
    width: 100%;
    /* height: 50%; */
    top: 25%;
    background-color: rgba(192, 192, 192, 0.8);
    border-radius: 100px;
    display: flex;
}

/* Rules Modal Window */
/* Credit to Jonas Schmedmann and the course "The Complete Javascript Course 2022: 
From Zero to Expert", for Code used to create and style the 
"rules" modal window */

.show-rules {
    top: 10%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    width: 20%;
}

.close-rules {
    position: absolute;
    top: 1.2rem;
    right: 2rem;
    font-size: 5rem;
    color: #333;
    cursor: pointer;
    border: none;
    background: none;
}

.rules-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    z-index: 1;
}

.rules {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    background-color: white;
    padding: 50px;
    border-radius: 10px;
    z-index: 2;
}

.rules h1 {
    color: black;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 10px;
}

.rules p {
    color: black;
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.rules li {
    color: black;
    padding: 10px;
    font-size: 1rem;
}

/* Game Elements */

/* Credit to Jonas Schmedmann and the Udemy course "The Complete Javascript Course 2022: 
From Zero to Expert", where Code for the main section styling was used as a template for this project. */

.player {
    padding: 40px;
    align-items: center;
    flex: 50%;
    padding: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-name {
    position: relative;
    text-align: center;
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 3rem;
    cursor: pointer;
}

/* Credit to codepen.io for code used for animation below */

.player-name:hover {
    color: blue;
    animation-name: color;
    animation-duration: 1.5s;
    animation-iteration-count: infinite;
}

@keyframes color {
    0% {
        color: #222;
    }

    50% {
        color: #4285f4;
    }

    100% {
        color: #222;
    }
}

.player-score {
    font-size: 1.5rem;
    margin-bottom: 30px;
    text-align: center;
}

.player-total {
    font-size: 1.5rem;
    text-align: center;
}

.active-player {
    background-color: rgba(255, 0, 0, 0.6);
    border-radius: 100px;
}

.player-wins {
    animation-name: winner;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    border-radius: 100px;
}

/* Credit to codepen.io for code used for animation below */

@keyframes winner {
    0% {
        background-color: rgba(255, 0, 0, 0.6);
    }

    50% {
        background-color: rgba(0, 128, 0, 0.6);
    }

    100% {
        background-color: rgba(255, 0, 0, 0.6);
    }
}

.hide {
    display: none;
}

/* Controls and Dice Styling */

.button {
    color: #444;
    cursor: pointer;
    font-family: inherit;
    background-color: white;
    padding: 7px 15px;
    border-radius: 50px;
}

.button:hover {
    background-color: rgba(255, 0, 0, 0.8);
    color: white;
}

.button-new {
    top: 45%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
}

.controls {
    background-color: rgba(0, 0, 0, 0.6);
    display: inline-block;
    text-align: center;
    width: 100%;
    bottom: 1%;
    position: fixed;
}

.controls h3 {
    text-align: center;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.controls button {
    margin-bottom: 5px;
    font-size: 2rem;
}

.dice {
    position: absolute;
    left: 50%;
    top: 40%;
    transform: translateX(-50%);
    height: 10rem;
}

/* Media Queries for responsiveness */

/* Media Queries for screens smaller than 680px */

@media screen and (max-width: 680px) {
    html {
        font-size: 10px;
    }

    .button {
        font-size: 1.5rem;
    }

    .show-rules {
        font-size: 1.5rem;
    }

    .button-new {
        top: 30%;
    }

    .dice {
        height: 10rem;
        top: 25%;
    }

    .controls {
        height: 100px;
        font-size: 14px;
    }
}

/* Media Queries for screens smaller than 540px */

@media screen and (max-width: 540px) {
    html {
        font-size: 9px;
    }

    main {
        height: 35rem;
        border-radius: 0px;
    }

    .controls {
        height: 50px;
        font-size: 14px;
    }

    .controls button {
        font-size: 1.5rem;
    }

    .active-player {
        border-radius: 0px;
    }

    .button {
        padding: 2px 6px;
    }

    .dice {
        /* height: 8rem; */
        top: 33%;
    }

    .button-new {
        top: 35%;
    }

    .show-rules {
        font-size: 2.5rem;
    }
}