html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: black;
    font-size: 13px;
    line-height: 1.2em;
    font-family: sans-serif;
    color: #ccc;
    overflow: hidden;
    letter-spacing: 0.3px;
}

button,
input[type=number] {
    all: unset;
    cursor: pointer;
}

body,
input,
button {
    font-size: 14px;
}

#text {
    border: 1px solid #444;
    padding: 0.2em;
    white-space: nowrap;
    height: 40px;
    overflow: auto;
    border-radius: 5px;
}

body[filling="true"] {
    main canvas {
        object-fit: cover;
    }
}

main {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    image-rendering: pixelated;
}

body.noMove:not([sidemenu="true"]) {
    &,
    * {
        cursor: none;
    }

    nav {
        display: none;
    }
}

*[disabled] {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

h3 {
    font-size: 100%;
    margin: 1.2em 0 0.7em;
    font-weight: normal;
}

nav {
    position: absolute;
    left: 3vh;
    top: 50%;
    transform: translateY(-50%);
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(0,0,0,.8);
    padding: 20px 20px 23px;
    z-index: 999;
    width: 240px;
    border: 1px solid #222;
    border-radius: 10px;

    &>*:first-child {
        margin-top: 0;
    }
}

body[sidemenu="true"] {
    nav {
        left: 0;
        top: 0;
        height: 100vh;
        max-height: 100vh;
    }

    main {
        left: 250px;
    }
}

.flex {
    display: flex;
    gap: 8px;
    margin: 1.3em 0 0.5em;
    align-items: center;

    h3 {
        margin: 0;
    }
}

input[type=range] {
    display: block;
    width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: #444;

    &:hover,
    &:focus {
        background: #888;
    }

    &::-webkit-slider-thumb {
        background: #ccc;
        -webkit-appearance: none;
        appearance: none;
        width: 6px;
        height: 6px;
        cursor: pointer;
    }

    &::-moz-range-thumb {
        background: #ccc;
        width: 6px;
        height: 6px;
        cursor: pointer;
    }
}

button {
    display: inline-block;
    background: #333;
    padding: 2px 4px;
    margin: 0 2px 2px 0;
    cursor: pointer;
    border-radius: 2px;

    &:hover {
        background-color: #666;
    }

    &[active="true"] {
        background-color: rgb(20, 255, 0);
        color: #000;
    }

    &:active {
        background-color: #444;
    }
}

input[type=number] {
    text-align: center;
    border-bottom: 1px solid #bbb;
}

.size {
    display: flex;
    gap: 5px;
    align-items: center;

    button {
        background: none;
        font-size: 160%;
        opacity: 0;

        &:hover {
            color: rgb(0, 100, 0);
        }
    }

    &:hover button {
        opacity: 1;
    }
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    box-shadow: 1px rgba(0, 0, 0, 0.1) inset;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
}

.colors {
    font-size: 0;

    .color {
        display: inline-block;
        position: relative;
        margin: 0 2px 2px 0;

        input {
            position: relative;
            z-index: 1;
            vertical-align: top;
        }

        button {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 0;
            transition: transform 0.2s ease;
            transform: translateY(0);
        }

        &:hover {
            z-index: 9;

            button {
                transform: translateY(20px);
            }
        }
    }

    button {
        width: 20px;
        height: 18px;
        padding: 0;
        font-size: 14px;
        line-height: 0;
        vertical-align: top;
        text-align: center;
        padding-bottom: 2px;

        &.remove {
            color: rgba(255, 255, 255, 0);

            &:after {
                display: inline-block;
                color: #000;
                font-size: 14px;
                content: '×';
            }

            &:hover {
                color: #fff;
            }
        }

    }
}

#fps {
    color: #bbb;
}

svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 3;
    pointer-events: none;
}