html {
    font-family: 'Arial', sans-serif;
    --bg-win: rgba(192, 192, 192, 0.25);
    --bg: rgba(224, 224, 224, 0.5);
    --fg-soft: rgba(32, 32, 32, 0.5);
    --footer-height: 2em;
}

noscript {
    display: block;
    text-align: center;
    margin: calc(var(--vh, 1vh) * 20) auto 1em auto;
    max-width: 650px;
    padding: 2em !important;
}

body {
    margin: 0;
    min-height: calc(var(--vh, 1vh) * 100);
}

#wrapper {
    box-sizing: border-box;
    width: 100%;
    padding: 1em;
    height: calc(var(--vh, 1vh) * 100 - var(--footer-height));
}

h1, h2, h3, h4, h5, h6 {
    color: #000000;
    font-weight: normal;
}

#windows {
    position: fixed;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 1em;
    top: 0;
    left: 0;
}

#windows > *,
main {
    border: 1px solid var(--bg-win);
    background: var(--bg-win);
    border-radius: 4px;
    box-sizing: border-box;
}

main {
    max-width: 800px;
    height: 100%;
    margin: 0 auto;
}

#windows > * {
    padding: 0.5em 1em;
}

div.window-login,
div.window-welcome {
    max-width: 650px;
    margin: calc(max(var(--vh, 1vh) * 25, 8em) - 8em) auto 1em auto;
}

div.window-login h1,
div.window-welcome h1 {
    text-align: center;
    font-size: 1.5rem;
}

footer {
    width: 100%;
    border-top: 1px solid var(--bg-win);
    background: var(--bg-win);
    height: var(--footer-height);
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
}

footer div {
    font-size: 0.75em;
    display: inline;
    color: #000000;
    margin: 0.5em 1em;
    text-align: center;
}

form {
    max-width: 400px;
    margin: 1.5em auto;
}

form input,
form button,
a.button,
form div {
    border: 1px solid var(--bg);
    border-radius: 4px;
    outline: none;
    padding: 0.5em 1em;
    display: block;
    box-sizing: border-box;
    margin: 1em auto;
    font-size: 1em;
    color: #000000;
    transition: border-color 0.125s, background-color 0.125s;
}

form input,
form button,
a.button {
    background-color: var(--bg);
}

form div.error {
    border-color: rgba(192, 0, 0, 0.75);
    text-align: center;
    color: #C00000;
    padding: 1em;
}

a.button {
    text-decoration: none;
    text-align: center;
    display: block;
    width: 100px;
}

form input,
form button {
    width: 100%;
}

form button,
a.button {
    cursor: pointer;
}

form input::placeholder {
    color: var(--fg-soft);
    opacity: 1;
}

form input[invalid] {
    border-color: rgba(192, 0, 0, 0.75);
}

form input:not(:disabled):focus,
form input:not(:disabled):hover,
form button:not(:disabled):focus,
form button:not(:disabled):hover,
a.button:not(:disabled):focus,
a.button:not(:disabled):hover {
    border-color: rgba(255, 255, 255, 0.75);
}

form *:disabled {
    cursor: not-allowed;
}

form button:active,
a.button:active {
    background-color: rgba(224, 224, 224, 0.75);
}

main .chat {
    height: 100%;
    box-sizing: border-box;
}

main .chat-history {
    height: calc(100% - 3em);
    overflow-y: scroll;
    box-sizing: border-box;
}

main .chat-input-wrapper {
    width: 100%;
    height: 3em;
    border-top: 1px solid var(--bg-win);
    padding: 0.5em 1em;
    box-sizing: border-box;
}

main .chat-input-wrapper input {
    background-color: rgba(0,0,0,0);
    border: 1px solid var(--bg-win);
    border-radius: 4px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    outline: none;
    padding: 0.25em 1em;
    font-size: 0.875rem;
}

main .chat .message {
    margin: 1em;
    border: 1px solid var(--bg-win);
    border-radius: 4px;
    padding: 0.5em 1em;
    display: block;
    width: fit-content;
    width: -moz-fit-content;
    background-color: rgba(255, 255, 255, 0.875);
    font-size: 0.875rem;
}

main .chat .message.pending {
    border-color: #C00000;
}

main .chat ::-webkit-scrollbar {
    width: 4px;
}

main .chat ::-webkit-scrollbar-track {
    background-color: rgba(0, 0, 0, 0);
}

main .chat ::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.5);
}

main .chat ::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.75);
}

@media screen and (min-width: 100px) {
    body {
        background-image: url("/res/images/background.jpg");
        background-repeat: no-repeat;
        background-position: top center;
        background-size: cover;
    }
    #windows > * {
        backdrop-filter: blur(32px);
    }
    footer {
        backdrop-filter: blur(32px);
    }
    main .chat-input-wrapper {
        backdrop-filter: blur(32px);
    }
    main .chat-history {
        backdrop-filter: blur(4px);
    }
}

@media screen and (max-width: 600px) {
    #wrapper {
        height: calc(var(--vh, 1vh) * 100);
        padding: 0;
    }
    #windows {
        padding: 0;
    }
    footer {
        flex-direction: column;
    }
    html {
        --footer-height: 4em;
    }
}