@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Raleway:ital,wght@0,500;1,300&display=swap'); /*-----Google fonts */

/*-------------------------------------------------------Defaults */

:root {
    /* CSS HEX */

/* ...............................player position */
--shaded-cells: #B7f1fa;
--shaded-cells-light: #B7f1fa;
--shaded-cells-dark: #6D76B2;
--player-cell: #6D76B2;
--player-cell-light: #6D76B2;
--player-cell-dark: #00E8FC;


/* ...............................background */
--main-bg-1: #52B788;
--main-bg-1-light: #52B788;
--main-bg-1-dark: #19647E;

--main-bg-2: #BDEED4;
--main-bg-2-light: #BDEED4;
--main-bg-2-dark: #436D98;

/* ...............................dark mode */
--dark-mode: #F9CB40;
--dark-mode-light: #F9CB40;
--dark-mode-dark: #37392E;

/* ...............................Game background and shadow */
--game-bg: #F4F4F9;
--game-bg-light: #F4F4F9;
--game-bg-dark: #37392E;

--game-border: #37392E;
--game-border-light: #37392E;
--game-border-dark: #9A9CA5;

--menu: #436D98;
--menu-light: #436D98;
--menu-dark: #37AFD7;

--menu-text: #0BE2B1;
--menu-text-light: #0BE2B1;
--menu-text-dark: #19647E;

--log-in: #0BE2B1;
--log-in-light: #0BE2B1;
--log-in-dark: #37AFD7;

/* .................................game menu, buttons, numbers */

--system-numbers: black;
--system-numbers-light: black; 
--system-numbers-dark: #F4F4F9;

--numbers: black;
--numbers-light: black;
--numbers-dark:#F9CB40;

--num-bg: #BDEED4;
--num-bg-light: #BDEED4;
--num-bg-dark: #436D98;

--num-highlight: #F7E09D;
--num-highlight-light: #F7E09D;
--num-highlight-dark: #16db85;

--choice: #6D76B2;
--choice-light: #6D76B2;
--choice-dark: #00E8FC;

--choice-active: #6D76B2;
--choice-active-light: #6D76B2;
--choice-active-dark: #00E8FC;

/*---------------------------------------------------footer */
--footer-text: black;
--footer-text-light: black;
--footer-text-dark: #F4F4F9;

--footer-bg: #16db85;
--footer-bg-light: #16db85;
--footer-bg-dark: #37AFD7;
}

body {
    margin: 0;
    border: none;
    padding: 0;
    font-family:'Raleway', sans-serif;
    overflow-x: hidden;
    background: url(../images/leisure-time-g6ab431ab6_1920.jpg) center center no-repeat;
    background-blend-mode: soft-light;
    background-color: var(--main-bg-1);
    background-attachment: fixed;
}

h1, h2, h3, button {
    font-family: 'Lato', sans-serif;
}

a {
    font-size: 1.5rem;
    color: unset;
    text-decoration: none;
}

li {
    display: inline-block;
    padding: 0px 5px;
}

ul {
    list-style-type: none;
}

button {
    border: 2px solid var(--footer-bg);
}

/*-----------------------------------------------------------Added with JavaScript */

.hidden {
    display: none !important;
}

.margin-top {
    margin-top: 8px;
}

.margin-left {
    margin-left: 8px;
}

.system-numbers,
.numbers {
    text-align: center;
    height: 100%;
    width: 100%;
    color: var(--system-numbers);
    font-size: 1.5rem;
}

.numbers {
    background-color: var(--num-bg);
}

.center-cell{
    width: 100%;
    height: 100%;
}

/*-----------------------------------------Player, shaded cells, position and numbers highlighted */
.player {
    background-color: var(--player-cell);
}

.shaded {
    background-color: var(--shaded-cells);
}

.choice-active {
    background-color: var(--choice-active);
}

.num-highlight {
    background-color: var(--num-highlight);
}

.winner {
    background-color: var(--log-in);
}

.loser {
    background-color: #6D76B2;
}

.win,
.lose {
    font-size: 4.5rem;
    font-weight: 900;
    color: var(--dark-mode);
    position: absolute;
    top: 30%;
}

.pencil-mark {
    width: 12px;
    height: 12px;
    text-align: center;
    font-size: .7rem;
    font-weight: 700;
    color: var(--system-numbers);
}

.layer-one {
    z-index: 1;
}

.layer-two {
    z-index: 2;
}

.layer-three {
    z-index: 3;
}

.layer-four {
    z-index: 4;
}

.layer-five {
    z-index: 5;
}

.ani-small-big {
    animation-name: win-or-lose;
    animation-duration: 1.5s;
    animation-iteration-count: 1;
    animation-delay: 0.5s;
    animation-timing-function: ease-in;
}

@keyframes win-or-lose {
    0% {
        font-size: 0rem;
    }
    100% {
        font-size: 4.5rem;
    }
}

/*-------------------------------------------------------game menu */
.top-menu {
    width: 100%;
    padding-top: 2px;
    position: absolute;
    top: 0;
}

.menu-btns {
    width: 100%;
    position: absolute;
}

.dark-mode-button,
.help-button {
    width: 40px;
    height: 40px;
    float: right;
    border-radius: 50%;
    margin-right: 5px;
    cursor: pointer;
    background-color: var(--player-cell);
}

.dark-mode-button:hover .fa-moon,
.dark-mode-button:hover .fa-sun {
    color: var(--dark-mode);
}

.fa-user-circle,
.fa-clock {
    font-size: 1.5rem;
    color: var(--menu);
    position: absolute;
}

.fa-clock {
    font-family: 'Lato', sans-serif;
    left: 50%;
    transform: translate(-50%, -270%);
}

.fa-moon,
.fa-sun,
.fa-question,
.fa-times {
    color: var(--dark-mode);
    font-size: 1.5rem;
}

#user-time {
    color: var(--system-numbers);
    font-size: 1.5rem;
    font-family: 'Lato', sans-serif;
    position: absolute;
    left: 50%;
    transform: translate(-50%, -150%);
}

/*-------------------------------------------------------footer */

footer {
    height: 10vh;
    width: 100%;
    font-size: 1rem;
    position: absolute;
    bottom: 0;
    display: flex;
    flex-wrap: nowrap;
    align-content: center;
    justify-content: center;
}

footer a {
    font-size: 2rem;
}

footer a:hover {
    color: var(--num-highlight);
}

footer div {
    width: 700px;
    color: var(--footer-text)
}

#footer-list {
    float: right;
}

.float-left {
    float: left;
}

.copy-right {
    margin-left: 25px;
    position: absolute;
}

/*-------------------------------------------------------Game board */
.game {
    width: 650px; /*-------------------------------------------------------Game width */
    height: 600px;
    background-color: var(--game-bg);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 10px outset var(--menu-text);
    padding: 5px 5px;
    display: flex;
    flex-wrap: wrap;
    flex: 0 1 auto;
    align-content: center;
    justify-content: center;
}

.help-menu,
form,
#thank-you-msg,
#error-page,
.diff-menu,
.menu,
.return-menu,
.scores {
    width: 650px; /*-------------------------------------------------------Game width */
    height: 600px;
    background-color: var(--game-bg);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.help-menu {
    height: 100%;
    color: var(--menu);
    text-align: center;
}

.help-menu p {
    width: 100%;
}

.help-menu a {
    color: var(--system-numbers);
    cursor: pointer;
}

.small-center {
    width: 500px;
}

.display-diff {
    font-size: 1.2rem;
    text-align: right;
    position: relative;
    z-index: -1;
}

.displayed-diff {
    color: var(--menu);
    transform: translateY(100%);
    margin-right: 5px;
}

/*-------------------------------------------------------first menu */
h2.welcome-menu {
    font-size: 4rem;
    font-style: italic;

    animation-name: welcome;
    animation-duration: 4s;
    animation-delay: 0s;
    animation-timing-function: ease-in;
    animation-iteration-count: 1;
}

@keyframes welcome {
    0%{
        opacity: 0;
    }
    100%{
        opacity: 1;
    }
}

.name-warning {
    font-size: 1.5rem;
    color: var(--log-in);
}

form {
    font-size: 2.5rem;
    color: var(--player-cell);
    text-align: center;

    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
}

label {
    font-size: 2rem;
}

input {
    height: 35px;
    width: 80%;
    font-size: 1.5rem;
    margin: 5px;
    border: 3px inset var(--log-in);
    cursor: pointer;
}

input:hover {
    background-color: var(--log-in);
}

.next {
    height: 35px;
    width: 35%;
    font-size: 1.5rem;
    color: var(--game-bg);
    background-color: var(--player-cell);
    cursor: pointer;
}

/*-----------------------------------------------------difficulty menu */

.diff-menu {
    width: 100%;
    font-size: 2.5rem;
    color: var(--player-cell);

    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
}

.diff-options,
.fa-arrow-alt-circle-left,
.fa-arrow-alt-circle-right {
    position: absolute;
}

.diff-options {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.fa-arrow-alt-circle-left,
.fa-arrow-alt-circle-right {
    top: 50%;
    cursor: pointer;
}

.fa-arrow-alt-circle-left:active,
.fa-arrow-alt-circle-right:active {
    font-size: 3rem;
}

.fa-arrow-alt-circle-left{
    left: 25%;
}

.fa-arrow-alt-circle-right{
    right: 25%;
}

.diff-heading {
    position: absolute;
    top: 15%;
}

.start-game {
    font-size: 1.5rem;
    color: var(--game-bg);
    background-color: var(--player-cell);
    cursor: pointer;
    position: absolute;
    top: 60%;
}

/*------------------------------------------------------ game grid */

#grid {
    margin-top: 8vh;
}

.container-row {
    display: flex;
    flex-direction: row;
}

.game-grid-cells {
    width: 38px;
    height: 38px;
    border: 1px solid var(--game-border);
    border-radius: 5%;
    flex: 0 1 auto;
    display: flex;
    flex-wrap: wrap;
}

.game-grid-cells:hover {
    background-color: var(--menu);
    cursor: pointer;
}

.player-num-choice,
.player-pen-choice {
    height: 100px;
    width: 300px;
    margin-bottom: 1vh;
    display: flex;
    flex-wrap: wrap;
}

.p-number,
.pencil,
.eraser,
.undo {
    width: 40px;
    height: 40px;
    color: var(--system-numbers);
    font-size: 1.2rem;
    text-align: center;
    border: 2px solid var(--game-border);
    border-radius: 50%;
    margin-right: 2px;
    flex: 0 1 auto;
    cursor: pointer;
}

.p-number:hover,
.pencil:hover,
.eraser:hover,
.undo:hover {
    background-color: var(--menu-text);   
}

.n-counter {
    font-size: 0.65rem;
    position: absolute;
    transform: translate(-145%, 165%);
}

.tooltip .tooltip-text {
    color: var(--system-numbers);
    visibility: hidden;
    width: 80px;
    font-size: 2rem;
    font-weight: 900;
    text-align: center;
    position: absolute;
    bottom: 15%;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
}


.return-menu {
    width: 300px;
    height: 300px;
    border: 2px solid var(--menu);

    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    flex: 0 1 auto;
    align-content: center;
    justify-content: center;
}

.home,
.home a,
.play-again,
.show-diff-menu {
    font-size: 2rem;
    color: var(--game-bg);
    background-color: var(--player-cell);
    cursor: pointer;

    margin: 5px 0;
}

/*--------------------------------404 error page */
#error-page {
    text-align: center;
}

#error-page h1 {
    color: var(--system-numbers);
    font-size: 5rem;
}

#error-page p {
    font-size: 2rem;
}

.home-link {
    height: 44px;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--game-bg);
    background-color: var(--player-cell);
    cursor: pointer;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid var(--footer-bg);
}

.frowning {
    color: var(--log-in);
}

/*-------------------------------------------------------Media Queries */

@media screen and (max-width: 720px) {
    body {
        background: none;
        background-color: var(--main-bg-2);
    }

    .game,
    .help-menu,
    form,
    #thank-you-msg,
    #error-page,
    .diff-menu,
    .menu,
    .return-menu {
        width: 90%; /*-------------------------------------------------------Game width */
        height: 90%;
    }

    .return-menu {
        height: 50%;
    }

    h2.welcome-menu {
        font-size: 1.8rem;
    }

    .diff-menu {
        font-size: 2rem;
    }

    footer {
        background-color: var(--footer-bg);
    }

    .fa-arrow-alt-circle-left{
        left: 20%;
    }
    
    .fa-arrow-alt-circle-right{
        right: 20%;
    }

    .copy-right {
        margin-left: 25px;
        position: absolute;
    }
}

/*---------------------------------------------media queries */
@media screen and (max-width: 479px) {
    .diff-menu {
        font-size: 1.5rem;
    }

    .fa-arrow-alt-circle-left:active,
    .fa-arrow-alt-circle-right:active {
        font-size: 2rem;
    }
}

@media screen and (max-width: 410px) {
    #grid {
        width: 100%;
    }

    .game-grid-cells {
        width: 10%;
    }

    .pencil-mark {
        width: 9px;
        height: 9px;
        font-size: .5rem;
    }
    
    .undo .tooltip-text {
        right: 5%;
    }
}

@media screen and (max-width: 375px) {
    .fa-user-circle,
    .fa-clock {
        font-size: 1.3rem;
    }

    .fa-clock {
        top: 12%;
    }
}

@media screen and (max-width: 332px) {
    footer a {
        font-size: 1.5rem;
    }

    .copy-right {
        margin-left: 10px;
    }
}