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

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

body {
    font-family: 'Tajawal', sans-serif;
    color: #000000;
    background-color: whitesmoke;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/*Heading*/
.main-heading {
    font-weight: 500;
    color: #000000;
    font-family: 'Tajawal', sans-serif;
    text-align: center;
    margin: 2%;
    text-decoration: underline;
    text-decoration-thickness: 5px;
    font-size: 3rem;
    text-shadow: 3px 3px 3px red;
}

/* Home Page styling */
/*Buttons- Home Page*/
.main-button {
    margin: 3%;
    padding: 15px;
    font-size: 1em;
    cursor: pointer;
    display: inline-block;
    background-color: #ff0000;
    box-shadow: 2px 2px;
    font-size: 1em;
    text-shadow: 3px 3px 3px #00000069;
    font-weight: 100;
}

.all-buttons {
    display: inline-grid;
    width: 50%;
    align-self: center;
}

/* Hover effect on all buttons */
.rules:hover {
    color: whitesmoke
}

.new-game:hover {
    color: whitesmoke;
}

.home:hover {
    color: whitesmoke;
}

.reset:hover {
    color: whitesmoke;
}

/*Image on home page */
img {
    margin: 5%;
    padding: 5%;
}

/* Image on Rules pop up */
.thinking-img {
    width: inherit;
    margin: auto;
}

/* https://github.com/josswe26/rpsls */
/* Style pop-ups */
.popup {
    width: 250px;
    top: 25px;
    left: 0;
    right: 0;
    margin: auto;
    text-align: center;
    position: absolute;
    border-radius: 10px
}

/* Pop up form styling - hidden by deafult */
.feedback-popup {
    display: none;
}

/* https://blog.logrocket.com/five-cool-css-header-styles-with-cross-browser-compatibility/ */
.feedback-popup h2 {
    font-size: 2em;
    margin: 15px auto;
    text-shadow: 1px 1px 1px #ff0808,
        1px 2px 1px #ff3400,
        1px 3px 1px #ff0707,
        1px 4px 1px #ff0202,
        1px 5px 1px #ff0000,
        1px 6px 1px #ff0000,
        1px 10px 5px rgb(16 16 16 / 50%),
        1px 15px 10px rgb(16 16 16 / 40%),
        1px 20px 30px rgb(16 16 16 / 30%),
        1px 25px 50px rgb(16 16 16 / 20%);
}

.feedback-area {
    padding: 5px;
    color: #ffffff;
    background-color: #271f1fef;
    border-radius: 25px;
}

.feedback-area input,
.feedback-area textarea {
    display: block;
    padding: 10px;
    margin: 11px auto 11px;
    color: #ffffff;
    border: 3px solid #ffffff;
    background: #000000ef;
}

.feedback-area input:focus {
    border-color: #00fffb;
}

.feedback-area button {
    margin: 2%;
    padding: 10px;
    cursor: pointer;
    display: inline-block;
    background-color: red;
    box-shadow: 1px 1px white;
    font-size: 1em;
    font-weight: bold;
    width: 80%;
}

.close-rules {
    margin: 2%;
    padding: 10px;
    cursor: pointer;
    display: inline-block;
    background-color: red;
    box-shadow: 1px 1px white;
    font-size: 1em;
    font-weight: bold;
}

#close-feedback-form:hover,
#close-rules-form:hover {
    background-color: #ffffff;
}

.feedback-area button:hover,
.feedback-area #cancel-btn:hover {
    background-color: #ffffff;
}

/*Styling Rules Pop up */
/* Styling Rules heading */
.instructions {
    font-size: 2em;
    margin: 15px auto;
    text-shadow: 1px 1px 1px #ff0808,
        1px 2px 1px #ff3400,
        1px 3px 1px #ff0707,
        1px 4px 1px #ff0202,
        1px 5px 1px #ff0000,
        1px 6px 1px #ff0000,
        1px 10px 5px rgb(16 16 16 / 50%),
        1px 15px 10px rgb(16 16 16 / 40%),
        1px 20px 30px rgb(16 16 16 / 30%),
        1px 25px 50px rgb(16 16 16 / 20%);
}

/* Code from https://www.w3schools.com/css/css3_flexbox_responsive.asp */
/* Styling Instructions */
#hiderule {
    display: none;
}

.flex-container {
    display: block;
    width: 250px;
    top: 1px;
    left: 0;
    right: 0;
    margin: auto;
    text-align: center;
    position: absolute;
    border-radius: 10px;
    font-size: 10px;
    background-color: #000000cc;
    color: ghostwhite;
    z-index: 9;
}

.flex-item-left {
    padding: 5px;
    flex: 50%;
}

.flex-item-right {
    padding: 5px;
    flex: 50%;
}

/* Styling pop up mesage for choosing player */
#pop-up {
    display: flex;
    position: absolute;
    top: 22%;
    left: 50%;
    transform: translate(-50%, 5%);
    border: 3px solid #000000;
    z-index: 9;
}

.choose-player {
    background: #1d0f0f;
    color: white;
    text-align: initial;
    padding: 5%;
    font-weight: bold;
}

.choose-player-button {
    width: 20%;
    font-weight: bold;
}

#error {
    display: none;
    color: #fffc00;
    font-size: small;
}

#congratulations {
    display: none;
    position: absolute;
    left: 50%;
    transform: translate(-50%, 5%);
    border: 3px solid #000000;
    z-index: 9;
    background: rgba(255, 0, 0, 0.778);
    color: whitesmoke;
    text-align: center;
    font-weight: bold;
    padding: 10%;
    top: 30%;
}

/* Styling Player's Mode */
.players-mode {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding-bottom: 10px;
}

#gamer1 {
    display: inline-block;
    color: black;
    font-size: x-large;
    font-weight: bold;
}

#gamer2 {
    display: inline-block;
    color: black;
    font-size: x-large;
    font-weight: bold;
}

/* Code from:https://www.tutorialstonight.com/tic-tac-toe-javascript */
/* Styling game board */
#board {
    display: contents;
    width: 300px;
    height: 300px;
    border: 1px solid black;
    border-right: 2px solid black;
}

.board-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.game-board {
    width: 100px;
    height: 100px;
    border: 1px solid black;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    font-weight: bold;
}

/* Styling results area */
.result {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 5px;
    font-size: xx-large;
    font-weight: bold;
}

.turn {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: xx-large;
    font-weight: bold;
}

/* Styling score area */
.score {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.score p {
    display: inline-block;
    color: black;
    font-size: x-large;
    font-weight: bold;
}

/* footer */
footer {
    width: 100%;
    display: inline-block;
    height: 70px;
    margin-top: auto;
}

.copyright p {
    background-color: rgb(34 3 3);
    font-size: 0.8em;
    line-height: 70px;
    text-transform: capitalize;
    letter-spacing: 1px;
    color: white;
    text-align: center;
}

/* Styling 404 Page */

.warning {
    display: grid;
    align-content: center;
    justify-content: center;
    align-items: center;
    justify-items: center;
    background-color: crimson;
}

#title-404 {
    font-size: large;
    text-transform: uppercase;
    padding-bottom: 3%;
}

.go-back {
    padding: 10px;
    cursor: pointer;
    display: inline-block;
    background-color: #050505;
    box-shadow: 0px 0px 20px 10px white;
    font-size: 2em;
    color: white;
}

#pic-404 {
    border: 2px solid #ffffff;
    border-radius: 4px;
    box-shadow: 0 0 20px 10px rgb(255 255 0);
    padding: 10px;
}


/* Media Queries */
/* Extra small devices (mobile phones 320px and up) */
@media only screen and (min-width: 320px) {
    .main-button {
        box-shadow: 2px 2px;
        text-shadow: 3px 3px 3px #00000069;
        color: #000000;
        font-weight: bold;
    }

    .close-rules {
        background-color: red;
        box-shadow: 1px 1px white;
        color: #000000;
    }

    .feedback-area button {
        background-color: red;
        box-shadow: 1px 1px white;
        color: #000000;
    }

    .all-buttons2 {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
    }

    img {
        display: block;
        margin-left: auto;
        margin-right: auto;
        width: 85%;
    }
}

/* Small devices (mobile phones 550px and up) */
@media only screen and (min-width: 550px) {
    #pop-up {
        top: 22%;
    }

    .main-button {
        box-shadow: 2px 2px;
        text-shadow: 3px 3px 3px #00000069;
        color: #000000;
        font-weight: bold;
    }

    .close-rules {
        background-color: red;
        box-shadow: 1px 1px white;
        color: #000000;
    }

    .feedback-area button {
        background-color: red;
        box-shadow: 1px 1px white;
        color: #000000;
    }

    .all-buttons {
        display: flex;
        flex-direction: row;
        justify-content: center;
    }

    #congratulations {
        width: 36%;
        top: 25%;
    }

    img {
        display: block;
        margin-left: auto;
        margin-right: auto;
        width: 60%;
    }
}



/* Medium devices (tablets 870px and up) */
@media only screen and (min-width: 870px) {
    #pop-up {
        top: 26%;
    }

    .main-button {
        box-shadow: 2px 2px;
        text-shadow: 3px 3px 3px #00000069;
        color: #000000;
        font-weight: bold;
    }

    .close-rules {
        background-color: red;
        box-shadow: 1px 1px white;
        color: #000000;
    }

    .feedback-area button {
        background-color: red;
        box-shadow: 1px 1px white;
        color: #000000;
    }

    #congratulations {
        width: 20%;
        top: 34%;
        padding: 3%;
    }
}

/* Extra large devices (large laptops and desktops, 1205px and up) */
@media only screen and (min-width: 1205px) {
    #pop-up {
        top: 28%;
    }

    .main-button {
        box-shadow: 2px 2px;
        text-shadow: 3px 3px 3px #00000069;
        color: #000000;
        font-weight: bold;
    }
}