* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(180deg, hsla(265, 53%, 29%, 1) 0%, hsla(24, 93%, 73%, 1) 100%);
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-content: center;
    font-family: 'Press Start 2P', cursive;
    gap: 2em;
    user-select: none;
}

body > footer {
    position: sticky;
    top: 100vh;
}

#heading {
    font-family: inherit;
    display: flex;
    flex-wrap: wrap;
}

#tic {
    color: #ff747b;
    text-shadow: -1px -1px 1px #ffa79e, 5px 5px #bb275d;
}

#tac {
    color: #fda200;
    text-shadow: -1px -1px 1px #eafe99, 5px 5px #cb690b;
}

#toe {
    color: #cffd55;
    text-shadow: -1px -1px 1px #f0ff9a, 5px 5px #1aac43;
}

footer {
    display: flex;
    justify-content: center;
    padding: 1em;
    font-size: 0.8em;
    background-color: #46475c;
    box-shadow: inset 4px 4px 0px 0px #333350;
    border: none;
    margin: 0;
    color: #6e83eb;
}

footer a {
    text-decoration: none;
    color: #b2c0d4;
}
footer a:hover {
    color: #808196;
}

.modal-outer {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    display: none;
    justify-content: center;
    align-items: center;
}

.modal-hidden {
    display: none;
}

#modal-welcome-content {
    background-color: black;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    line-height: 2em;
    width: 80%;
    height: 80%;
    border-radius: 25px;
    padding: 10px;
    border: 3px solid white;
    text-align: center;
}
#modal-welcome-content span {
    font-weight: bolder;
}
#modal-welcome-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.modal-input-text {
    font-family: 'Press Start 2P', cursive;
    border: none;
    padding: 0.5em;
    color: #808196;
    width: 18em;
}

#container {
    display: flex;
    flex-direction: column;
    grid-template-areas:
        'heading'
        'playing-area';
    gap: 3em;
}

#heading {
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: xx-large;
    font-weight: lighter;
    text-align: center;
}

#playing-area {
    display: grid;
    grid-template-areas: 'left-side board right-side';
    gap: 2em;
    padding: 2em;
    box-shadow: 10px 5px 5px red;
    background-color: white;
    border-radius: 25px;
}

.side {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    max-width: 8em;
    text-align: center;
    line-height: 1.4;
    font-size: medium;
}

#left-side {
    grid-area: left-side;
}

#right-side {
    grid-area: right-side;
}

.score-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5em;
}

.score {
    border: 3px solid black;
    width: 3em;
    height: 3em;
    display: grid;
    place-content: center;
    font-size: xx-large;
}

#board {
    width: fit-content;
    height: fit-content;
    grid-area: board;
    display: grid;
    grid-template-columns: repeat(3, auto);
    gap: 0.5em;
    background-color: black;
}

.cell {
    width: 130px;
    height: 130px;
    background-color: white;
    display: grid;
    place-content: center;
    text-align: center;
    font-size: 5em;
}
.cell:hover {
    background-color: gray;
    box-shadow: 1px 1px 5px gray;
}

.board-footer {
    display: flex;
    justify-content: flex-end;
    margin-right: 2em;
    margin-bottom: -1em;
    width: 100%;
    align-self: flex-end;
}

#praettorians {
    font-family: Arial, Helvetica, sans-serif;
    color: #8cffa9;
    font-size: 1rem;
    padding: 4px;
}

#modal-score-content {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    align-items: center;
    width: 80%;
    height: 200px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    line-height: 2em;
    border-radius: 25px;
    padding: 10px;
    border: 2px solid white;
}

#modal-score-buttons {
    width: 60%;
    display: flex;
    justify-content: space-evenly;
}

#modal-high-scores {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 90%;
    height: 90%;
    background-color: black;
    color: white;
    border-radius: 25px;
    border: 2px solid white;
    gap: 3em;
    animation: background-changer 10s infinite alternate linear;
}

#modal-scroll-container {
    width: 80%;
    height: 50%;
    overflow: hidden;
}

#modal-scrolling-text {
    height: 100%;
    padding: 1em;
    color: #29c04f;
    transform: translateY(100%);
    animation: scrolling-scores 15s linear infinite;
}
#modal-scrolling-text p {
    color: #ffaf4d;
}

@keyframes background-changer {
    0% {
        background-color: #1c1632;
    }
    25% {
        background-color: #475494;
    }
    50% {
        background-color: #6a3e8c;
    }
    75% {
        background-color: #1e503f;
    }
    100% {
        background-color: #f05e5e;
    }
}

@keyframes scrolling-scores {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(-100%);
    }
}

.button:before {
    top: -3px;
    left: 0;
    border-top: 3px solid white;
    border-bottom: 3px solid white;
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    box-sizing: content-box;
}

.button {
    height: 2.5em;

    display: inline-block;
    position: relative;
    text-align: center;
    padding: 5px 7px;
    text-decoration: none;
    color: black;
    border: none;
    font-family: 'Press Start 2P', cursive;
}

.button:after {
    left: -3px;
    top: 0;
    border-left: 3px solid white;
    border-right: 3px solid white;
    content: '';
    width: 100%;
    height: 100%;
    position: absolute;
    box-sizing: content-box;
}

.modal-button-yes {
    box-shadow: inset -4px -4px 0px 0px #26804b;
    background: #29c04f;
    width: 20%;
}

.modal-button-yes:hover {
    background: #8cffa9;
}

.modal-button-yes:active {
    box-shadow: inset 4px 4px 0px 0px #26804b;
}

.modal-button-no {
    box-shadow: inset -4px -4px 0px 0px #b84074;
    background: #f0698f;
    width: 20%;
}

.modal-button-no:hover {
    background: #ffa8bf;
}

.modal-button-no:active {
    box-shadow: inset 4px 4px 0px 0px #b84074;
}

.modal-button-continue {
    box-shadow: inset -4px -4px 0px 0px #475494;
    background: #6e83eb;
}

.modal-button-continue:hover {
    background: #9eaeff;
}

.modal-button-continue:active {
    box-shadow: inset 4px 4px 0px 0px #475494;
}

@media screen and (max-width: 50em) {
    h2 {
        font-size: 1em;
    }
    #heading {
        font-size: 1em;
    }
    #playing-area {
        grid-template-areas:
            'left-side right-side'
            'board board';
        display: grid;
        place-content: center;
        padding: 10px;
    }
    .score-container {
        font-size: 0.8em;
    }
    .cell {
        width: 80px;
        height: 80px;
        font-size: 3em;
    }
    .modal-button-no {
        width: 70px;
    }
    .modal-button-yes {
        width: 70px;
    }
}
