:root{
    --c: 100px;
    --animation-duration: .2;
    --history-height: 75px;
    --moves-button-size: 50px;
    --moves-width: 250px;
    --padding-size: 10px;
}

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

*::-webkit-scrollbar {
    display: none;
}

body{
    font-family: monospace;
}

/*  */

button{
    all: unset;
    user-select: none;
    cursor: pointer;
}

a{
    text-decoration: none;
    color: white;
}

/*  */

main {
    position: relative;
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: var(--history-height) 1fr;

    grid-template-areas:
        "link    history"
        "sidebar  canvas";

    width: 100vw;
    height: 100dvh;
    min-height: max(500px, 100dvh);
}

#link {
    grid-column: 1;
    grid-row: 1;
    grid-area: link;
}

#history {
    grid-column: 2;
    grid-row: 1;
    grid-area: history;
}

#sidebar {
    grid-column: 1;
    grid-row: 2;
    grid-area: sidebar;
}

#canvas {
    grid-column: 2;
    grid-row: 2;
    grid-area: canvas;
}

#link,
#history,
#sidebar,
#canvas{
    margin: var(--padding-size);
}

@media screen and (max-width: 800px) {
    :root{
        --c: 75px;
    }
    main{
        grid-template-columns: 250px 1fr;
    }
}
@media screen and (min-width: 800px) and (max-height: 700px) {
    :root{
        --c: 75px;
    }
}

@media screen and (max-width: 650px) {
    :root{
        --c: 75px;
    }
    main{
        grid-template-columns: 100px 1fr;
        grid-template-rows: var(--history-height) minmax(295px, 1fr) minmax(100px, 300px);
        /* height: min-content; */
        max-height: 100dvh;

        grid-template-areas:
            "link history"
            "canvas canvas"
            "sidebar sidebar";
    }
}

@media screen and (max-width: 650px) and (max-height: 800px) {
    :root{
        --c: 50px;
    }
}
@media screen and (max-width: 650px) and (max-height: 660px) {
    :root{
        --c: 30px;
    }
}

@media screen and (max-width: 400px) {
    :root{
        --c: 50px;
    }
}

@media screen and (max-width: 400px) and (max-height: 660px) {
    :root{
        --c: 30px;
    }
}

#bg{
    z-index: -1;
    position: absolute;
    width: 100%; height: 100%;
    top: 0; left: 0;
    overflow: hidden;
    background-color: #0a0a0a;
    --grid-size: 75px;
    --grid-color: rgba(255, 255, 255, 0.08);

    background-color: #0a0a0a;

    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);

    background-size: var(--grid-size) var(--grid-size);
    /* background-position: calc(var(--padding-size) / 2) calc(var(--padding-size) / 2); */
}
#bg::before,
#bg::after{
    content: '';
    position: absolute;
    height: 100%;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: #0a0a0a;
}
#bg::after{
    top: 50%;
    left: -10%;
}

#bg::before{
    bottom: 75%;
    right: -20%;
}