@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
    --gridSize: ;

    /* SBV Brand Design (based on the website) */
    --sbv-font: "Atkinson Hyperlegible", sans-serif;
    --sbv-blue: rgb(5 20 175);
    --sbv-blueLight: rgb(222 222 255);
    --sbv-darkGreenLightTeasers: rgb(205 255 200);
    --sbv-orangeLight: rgb(255 230 188);
    --sbv-orangeDark: rgb(255 174 0);
    --sbv-darkGreen: rgb(205 240 237);

    --endlessMode: none;

    --backgroundColor: #0f0f0f;
    --primaryColor: #2e2e2e;
    --secondaryColor: #4e4e4e;
    --tertiaryColor: #d45858;
    --buttonColor: #db3d3d;
    --textColor: white;
    --textColorAlt: black;

    --playerColor: #2196f3;
    --wallColor: #db3d3d;
    --goalColor: greenyellow;
  
    --modalDisplay: none;
    --pathColor: yellow;
}

/* General CSS */

* {
    font-family: var(--sbv-font);
    color: var(--textColor);
}

body {
    background: var(--backgroundColor);
}

p {
    margin: 0.4em;
}

button {
    color: var(--textColorAlt);
    background-color: var(--buttonColor);
    border: none;
}

button:hover {
    opacity: 80%;
    cursor: pointer;
}

/* ----------- */

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

.gridContainer {
    margin: auto;
}

#grid {
    display: grid;
    grid-template-columns: repeat(var(--gridSize), 24px);
    grid-template-rows: repeat(var(--gridSize), 24px);
    gap: 2px;
    margin: auto 1em auto 1em;
    width: max-content;
    border: 5px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.cell {
    width: 24px;
    height: 24px;
    background: #eee;
    border: 1px solid #ccc;
}

.player {
    background: var(--playerColor);
}

.goal {
    background: var(--goalColor)
}

.wall {
    background: var(--wallColor);
}

.restart_button {
    display: flex;
    margin-left: auto;
    margin-right: auto;
    margin-top: 2em;
    margin-bottom: 1em;
    padding: 1.2em 6em 1.2em 6em;
    background-color: var(--buttonColor);
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    color: var(--textColorAlt);
    font-size: x-large;
    font-weight: bold;
    border: none;
    border-radius: 0.5em;
    cursor: pointer;
}

.settings_button {
    display: flex;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5em 6em 1.5em 6em;
    border-radius: 0.5em;
    font-size: large;
    font-weight: bold;
}

/* CHANGE SIZE FORM */
.change_size button {
    padding-left: 1em;
    padding-right: 1em;
    border: none;
    border-radius: 1em;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
}

.change_size output {
    padding: 1em;
    min-width: 16.62px;
    /* I don't know why but this is the only way I could get it to not resize after 2 digits */
}

.change_size {
    display: flex;
}


.change_size>* {
    padding: 0.5em;
    margin-left: auto;
    margin-right: auto;
}

/*------------------*/

#moveCounter {
    font-size: xx-large;
    font-weight: bold;
}

#timer {
    font-weight: bold;
    font-size: xxx-large;
}

.closeModal {
    display: flex;
    margin: auto;
    padding: 1em;
    border-radius: 1em;
    background-color: #db3d3d;
}

.settings {
    display: var(--modalDisplay);
    background-color: var(--primaryColor);
    padding: 2em;
    margin: auto;
    border-radius: 1em;
    width: 35em;
    z-index: 1001;
}


#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 1;
    /* Hide it initially */
    z-index: 1000;
    /* Make sure it's above everything */
}

#overlay button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1001;
    display: flex;
    padding: 1em;
    margin: 1em;
    margin-left: auto;
    margin-right: auto;
    border: none;
    border-radius: 1em;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    background-color: var(--sbv-blueLight);

}

.overlayButton {
    color: var(--textColorAlt);
    z-index: 1001;
    display: flex;
    padding: 2em;
    margin: 1em;
    margin-left: auto;
    margin-right: auto;
    font-size: 1em;
    border: none;
    border-radius: 1em;
    box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    background-color: var(--buttonColor);
}

.overlayText {
    display: flex;
    justify-content: center;
}

.splitsContainer {
    display: var(--endlessMode);
    justify-content: center;
    /* horizontal */
    align-items: center;
    /* vertical */
    height: inherit;
}

.splitsEndless {
    min-width: 10em;

    table {
        margin: auto;

        th,
        td {
            margin: auto
        }
    }
}

.themes {
    margin: 1.5em;
    text-align: center;

    select {
        padding: 0.75em;
        border-radius: 1em;
        color: var(--textColorAlt);
        background-color: var(--buttonColor);
        box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
        border: none;
    }
}

.languages {
    margin: 1.5em;
    text-align: center;
    
    select {
        padding: 0.75em;
        border-radius: 1em;
        color: var(--textColorAlt);
        background-color: var(--buttonColor);
        box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
        border: none;
    }
}

.mazeSave {
    margin: 1.5em;
    text-align: center;

    button {
        color: var(--textColorAlt);
        padding: 1em;
        border-radius: 1em;
        box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    }

    input::file-selector-button {
        color: var(--textColorAlt);
        font-family: var(--sbv-font);
        margin: 1em 0 1em 0;
        padding: 1em;
        background-color: var(--buttonColor);
        border-radius: 1em;
        border: none;
        box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.5);
    }
}

.tutorialButton {
    margin: 0 auto 1em auto;
    padding: 1em;
    font-size: 1em;
    font-weight: 600;
    width: 25%;
    border-radius: 1em;
}

.tutorial {
    max-width: 50%;
    margin: 1em auto 1em auto;
    font-size: 1.5em;
    li {
        margin: 0.5em 0 0.5em 0;
    }
    button {
        margin: 0 auto 0 auto;
        padding: 1em;
        font-size: 1.5em;
        font-weight: 600;
        width: 50%;
        border-radius: 1em;
    }
}

.rainbowBackground {
    color: white;
    background: repeating-linear-gradient(
        90deg,
        #e81416,
        #ffa500,
        #faeb36,
        #79c314,
        #487de7,
        #4b369d,
        #e81416,
        #ffa500,
        #faeb36,
        #79c314,
        #487de7,
        #4b369d,
        #e81416
    );
    background-size: 200% 100%;
    background-clip: text;
    animation: gradient-animation 3s linear infinite;
    -webkit-animation: gradient-animation 3s linear infinite;
    -moz-animation: gradient-animation 3s linear infinite;
    -webkit-text-fill-color: transparent;
}

@keyframes gradient-animation {
    0% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 100% 0%
    }
}

@-moz-keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%
    }
}

@-webkit-keyframes gradient-animation {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%
    }
}

.path {
    background: var(--pathColor);
}