body {
    background: #408;
    font-family: monospace;
    color: white;

    position: relative;

    margin: 0; padding: 0;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;

    --w: 1;
    --h: 1;
    --d: min(calc((100vw - 40px) / var(--w)), calc((100vh - 40px) / var(--h)));
}

#content>div:not(:first-child) {
    display: none;
}

div#game-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}


@media screen and (max-width: 800px) {
    #title-screen {
        transform: scale(.5);
    }
}
@media screen and (max-width: 500px) {
    #title-screen {
        transform: scale(.3);
    }
}

canvas {
    width: calc(var(--d) * var(--w));
    height: calc(var(--d) * var(--h));
}

* {
    background-color: transparent;
    color: transparent;
    border: 0;
    outline: none;
    margin: 0;
    padding: 0;
}

div#title-screen {
    display: flex;
    flex-direction: row;
}

h1#title-container {
    position: relative;

    width: 550px;
    height: 170px;
    background-image: url("res/title.png");
    background-size: cover;
}

button#play-button {
    width: 180px;
    height: 60px;
    background-image: url("res/play-button.png");
    background-size: cover;
    position: absolute;
    bottom: 0;
    right: 0;
}

button#play-button:hover {
    filter: brightness(0.5) sepia(1) hue-rotate(8deg) saturate(200);
}

img#title-right {
    margin: 5px 5px 5px 20px;
    width: 160px;
    height: 160px;
    image-rendering: pixelated;
}

body[data-device-type='touchscreen'] .keyboard-only,
body[data-device-type='keyboard'] .touchscreen-only {
    display: none;
}

#help-screen {
    display: block;
    font-size: 20px;
    width: calc(var(--d) * var(--w));
    height: calc(var(--d) * var(--h));
    overflow: auto;
}

#help-screen * {
    color: white;
    font-family: monospace;
}

#help-screen>* {
    margin: 10px 0;
}

#help-screen #mushroom-tiers td {
    outline: 2px solid white;
    padding: 10px;
    display: table-cell;
}

#help-screen #mushroom-tiers td div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#help-screen p {
    text-align: justify;
}

#help-screen p::before {
    content: "";
    display: inline-block;
    height: 1px;
    width: 20px;
}

#help-screen #mushroom-tiers img {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
}

#help-back-button {
    width: 100%;
    outline: 2px solid white;
    font-size: 20px;
    font-weight: bold;
}

#game-screen>div {
    position: relative;
}

#help-button {
    position: absolute;
    top: 0;
    right: calc(var(--d) / 2);
    width: var(--d);
    height: var(--d);
    background-image: url("res/font/5.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
}