@font-face {
    font-family: 'monogram';
    src: url('assets/fonts/monogram-extended.woff2');
    font-weight: normal;
    font-style: normal;
}

body {
    background-color: #222034;
    color: #fff;
    font-family: "monogram";
    font-size: 32px;
    margin: 0;
    width: 100vw;
    height: 100vh;
}

h1 {
    margin-top: 0;
    margin-bottom: 0;
}

form section {
    display: grid;
    margin-bottom: 0.5rem;
}

#dweb {
    display: flex;
    justify-content: center;
    margin: 0;
}

#dweb article {
    max-width: 50%;
}

#game {
    display: flex;
    justify-content: center;
    margin: 0;
    width: 100%;
    height: 100%;
}

#gameContainer {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

#chatDialog {
    width: 30%;
    height: 2rem;
    padding: 1rem;
    border: 1px solid black;
}

#chatDialog form {
    display: flex;
    height: 100%;
}

#chatDialog input {
    margin-right: 1rem;
    flex-grow: 1;
    font-family: "monogram";
    font-size: 100%;
}

#errorForm {
    display: grid;
}

#character {
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
}

[type=radio] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

[type=radio] + img {
    cursor: pointer;
}

[type=radio]:checked + img {
    outline: 2px groove white;
}

/* Scale up canvas image on small screens.  Loses pixel perfectness
   but improves visibility on phones. */
@media (max-width: 960px) or (max-height: 720px) {
    canvas {
        display: block;
        margin: auto auto;
        image-rendering: pixelated;
        object-fit: contain;
        width: 100%;
        height: 100%;
    }
}

@media (min-width: 960px) or (min-height: 720px) {
    canvas {
        display: block;
        margin: auto auto;
    }
}

@media (pointer: fine) {
    #onscreen-controls {
        display: none;
    }
}

/* Onscreen controls for "coarse" pointer devices assumed to be
   touchscreens on phones/tablets.  Inline SVG is used so that we can
   attach click handlers to individual elements of the controls. */
@media (pointer: coarse) {
    #onscreen-controls {
        position: absolute;
        width: 100%;
        bottom: 0;
        display: flex;
        flex-direction: row;
        align-items: center;
    }

    #onscreen-controls #dpad-container {
        width: min(40vw,40vh);
        height: min(40vw,40vh);
        margin: 5%;
    }

    #onscreen-controls #button-container {
        width: min(25vw,25vh);
        height: min(25vw,25vh);
        margin: 5%;
        margin-left: auto;
    }
}
