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

:root {
    --back: #181818;
    --text: #3af750;
    --borders: #cf42cf;
    --font: 'Indie Flower';
}

/* ////////// body, wrapper, header ////////// */

body {
    background: var(--back);
    font-family: var(--font);
}

.wrapper {
    max-width: 1500px;
    margin: 0 auto;
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 550px;
    overflow: hidden;
    min-width: 775px;
}

h1 {
    text-align: center;
    font-size: 50px;
    color: var(--text);
    text-shadow: 0px 0px 3px var(--text);
    margin: 20px 0px;
}

.text-line {
    background-color: var(--text);
    border-color: var(--text);
    width: 150px;
    margin: 0 auto;
}

/* ////////// main: game-wrapper ////////// */

.game-wrapper {
    position: relative;
    height: 70%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-result {
    position: absolute;
    z-index: -10;
    opacity: 0;
    top: -450px;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    width: 255px;
    height: 255px;
    background-color: var(--back);
    border: 5px solid var(--text);
    border-radius: 10px;
    transform: rotate(-5deg);
}

.modal-result.active {
    z-index: 10;
    opacity: 1;
    top: 25%;
}

.result-text,
.result-count {
    font-size: 35px;
    color: var(--text);
    text-shadow: 0px 0px 3px var(--text);
    transform: rotate(5deg);
}

.result-count {
    font-size: 30px;
}

.result-button {
    width: 150px;
    height: 50px;
    font-size: 25px;
    color: var(--text);
    border: 3px solid var(--text);
    border-radius: 5px;
    background-color: var(--back);
    animation: 2s infinite buttonPulse;
    transition: 0.5s;
    cursor: pointer;
}

.result-button:hover {
    color: var(--borders);
    background-color: var(--text);
}

@keyframes buttonPulse {
    0% {
        transform: scale(1) rotate(5deg);
    }

    50% {
        transform: scale(1.2) rotate(5deg);
    }

    100% {
        transform: scale(1) rotate(5deg);
    }
}

.settings {
    width: 210px;
    height: 250px;
    padding-right: 15px;
    font-size: 35px;
    color: var(--text);
    text-shadow: 0px 0px 3px var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

.dark-light {
    width: 50px;
    height: 50px;
    background-image: url(svg/sun_icon_green.svg);
    background-size: 50px 50px;
    cursor: pointer;
    transition: 0.5s;
}

.dark-light.light {
    background-image: url(svg/moon_icon_purple.svg);
}

.dark-light:hover {
    transform: rotate(90deg);
}

.dark-light.light:hover {
    transform: rotate(45deg);
}

.selects {
    width: 80%;
    display: flex;
    justify-content: space-around;
}

.select-x.selected {
    border-bottom: 2px solid var(--text);
}

.select-0.selected {
    border-bottom: 2px solid var(--text);
}

.select-x,
.select-0 {
    cursor: pointer;
    transition: 0.5s;
}

.select-x:hover,
.select-0:hover {
    transform: scale(1.3);
    cursor: pointer;
}

.scoreboard-button {
    transition: 0.5s;
    cursor: pointer;
}

.scoreboard-button:hover {
    transform: scale(1.1);
}

.modal-scoreboard {
    position: absolute;
    z-index: -10;
    opacity: 0;
    top: -450px;
    width: 550px;
    height: 400px;
    background-color: var(--back);
    border: 5px solid var(--text);
    border-radius: 10px;
    transition: 0.5s;
}

.modal-scoreboard.active {
    z-index: 10;
    opacity: 1;
    top: 15%;
}

.toggle-scoreboard {
    padding: 10px 20px;
    font-size: 25px;
    color: var(--text);
    cursor: pointer;
}

.scoreboard-item {
    padding-left: 130px;
    font-size: 30px;
    line-height: 1.1;
    color: var(--text);
}

.score-title {
    font-size: 35px;
}

.score {
    width: 210px;
    padding-right: 15px;
    height: 250px;
    font-size: 30px;
    color: var(--text);
    text-shadow: 0px 0px 3px var(--text);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
}

.score .text-line {
    width: 50%;
}

.field-style {
    width: 351px;
    height: 305px;
    display: flex;
    flex-wrap: wrap;
    border: 3px solid var(--borders);
    box-shadow: inset 0px 0px 10px 2px var(--borders);
}

.cell {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 115px;
    height: 100px;
    font-size: 70px;
    color: var(--text);
    text-shadow: 0px 0px 3px var(--text);
    border: 2px solid var(--borders);
    box-shadow: 0px 0px 7px 1px var(--borders);
    cursor: pointer;
}

/* ////////// footer ////////// */

footer {
    position: absolute;
    height: 50px;
    display: flex;
    width: 100%;
    justify-content: space-around;
    bottom: 0;
}

.github-link,
.rs-link,
.year {
    text-decoration: none;
    color: var(--text);
    font-size: 23px;
    font-weight: 700;
}

.github-link {
    position: relative;
    transition: 0.5s;
}

.github-logo {
    position: absolute;
    width: 30px;
    height: 30px;
    left: -40px;
    top: -5px;
}

.github-link:hover {
    transform: scale(1.2);
}

.rs-link {
    width: 85px;
    height: 30px;
    background-image: url(svg/rs_school_js-green.svg);
    background-size: 80px 30px;
    background-repeat: no-repeat;
    transition: 0.5s;
}

.rs-link.light {
    background-image: url(svg/rs_school_js_light.svg);
}

.rs-link:hover {
    transform: scale(1.2);
}

@media (max-width: 775px) {
    .field-style {
        width: 270px;
        height: 255px;
    }

    .wrapper {
        overflow: auto;
        min-width: 300px;
    }

    .game-wrapper {
        position: relative;
        margin: 25px 0;
        display: flex;
        height: auto;
        flex-direction: column;
    }
    
    .cell {
        width: 88px;
        height: 83px;
    }

    .modal-scoreboard {
        width: 290px;
        height: 400px;
    }

    .modal-scoreboard.active {
        top: 10%;
    }
    
    .scoreboard-item {
        padding-left: 20px;
        font-size: 25px;
        line-height: 1.1;
        color: var(--text);
    }

    .settings {
        font-size: 30px;
        margin-bottom: 15px;
    }

    .select-x,
    .select-0 {
        margin: 10px 0;
        font-size: 50px;
        line-height: 1;
    }

    .score {
        margin-top: 15px;
        font-size: 30px;
    }

    footer {
        bottom: auto;
        height: 50px;
        font-size: 15px;
        justify-content: center;
        gap: 10px;
    }

    .github-link {
        font-size: 17px;
        margin-left: 20px;
        padding-top: 5px;
    }

    .year {
        margin-left: 5px;
    }

    .rs-link {
        margin-left: 10px;
    }

    .github-logo {
        width: 25px;
        height: 25px;
        left: -30px;
        top: 0;
    }
}