body {
    display: flex;
    padding-top: 3.5rem;
    line-height: normal
}

#left {
    padding: 0 0 .5rem .5rem;
    flex: 0 0 50%;
    min-width: 10.5rem;
    max-width: calc(100vw - 4rem);

    > div {
        border: 1px solid var(--theme-3);
        display: flex;
        overflow: hidden;
        border-radius: .5rem;
        height: 100%;

        > div {
            flex: 1 1 0;
            min-width: 0;
            position: relative;
            background-color: var(--theme-1);
            z-index: 1;
            overflow: hidden
        }
    }

    &.open #folder {
        flex-basis: 10rem;

        > button {
            transform: translateY(50%)
        }
    }
}

#folder {
    flex: 0 0 0;
    position: relative;
    border-right: 1px solid var(--theme-3);
    min-width: 0;
    box-sizing: content-box;
    transition: flex-basis .2s;

    > div {
        font-size: .8rem;
        overflow: hidden;
        width: 10rem;
        height: 100%
    }

    > button {
        position: absolute;
        right: 0;
        padding: 1rem;
        transform-origin: right;
        z-index: 20;
        bottom: 50%;
        transition: transform .2s, background-color .2s;
        transform: scaleX(-1) translateY(50%);
        border: 1px solid var(--theme-3);
        border-right: none;
        border-top-left-radius: 1rem;
        border-bottom-left-radius: 1rem;
        font-size: 1rem;
        cursor: pointer;
        background-color: #000;
        color: #fff;

        &:hover {
            background-color: var(--theme-2)
        }
    }

    section {
        display: flex;
        gap: .5rem;
        padding: .5rem;

        input {
            display: none
        }

        > * {
            text-align: center;
            flex: 1 1 0;
            padding: .2rem;
            border-radius: .5rem;
            border: none;
            background-color: var(--theme-2);
            font: inherit;
            color: inherit;
            transition: color .2s, background-color .2s;
            cursor: pointer;

            &:hover {
                background-color: var(--theme-3);
                color: #fff
            }
        }
    }
}

#files {
    display: flex;
    flex-direction: column;

    div {
        display: flex;
        cursor: pointer;
        background-color: var(--theme-2);
        transition: background-color .2s;

        &:hover {
            background-color: var(--theme-3)
        }

        input {
            padding: .5rem;
            border: none;
            outline: none;
            min-width: 0;
            width: 100%;
            flex: 1 1 0;
            font: inherit;
            background: none;
            color: inherit;

            &:focus {
                background-color: #000
            }

            &:disabled {
                color: inherit;
                pointer-events: none
            }
        }

        i {
            display: block;
            font-size: 1rem;
            padding: .5rem;
            cursor: pointer;
            background-color: var(--theme-2);
            transition: color .2s, background-color .2s;

            &:hover {
                color: #f55;
                background-color: var(--theme-3)
            }
        }
    }
}

#right {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    padding: 0 .5rem .5rem 0;
    min-width: 0;

    canvas {
        background-color: #000;
        border-radius: .5rem;
        width: 100%;
        flex: 1 1 0;
        min-height: 0
    }

    > section {
        background-color: #000;
        overflow: hidden;
        flex: 0 0 3rem;
        display: flex;
        flex-direction: column;
        border-radius: .5rem;
        max-height: calc(100% - .5rem);
        min-height: 3rem;

        section {
            padding: .5rem;
            background-color: var(--theme-2);
            display: flex;
            gap: .5rem
        }
    }

    #error {
        margin-left: auto;
        visibility: hidden;

        &.active {
            visibility: visible
        }
    }

    button, #error {
        height: 2rem;
        flex: 0 0 2rem;
        border: none;
        border-radius: .5rem;
        cursor: pointer;
        transition: background-color .2s;
        color: #fff;
        font-size: inherit
    }

    pre {
        margin: 0;
        flex: 1 1 0;
        overflow-y: auto;
        padding: .5rem;
        white-space: pre-wrap;
        word-wrap: break-word;
        font-family: mono, monospace
    }
}

#fullscreen, #error {
    background-color: transparent;

    &:hover {
        background-color: var(--theme-4)
    }
}

#run {
    background-color: hsl(var(--hue-2), 100%, 50%);

    &:hover {
        background-color: hsl(var(--hue-2), 100%, 40%)
    }

    &:disabled {
        background-color: var(--theme-3)
    }
}

#overlay {
    position: absolute;
    inset: 0;
    background-color: var(--theme-1);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;

    &.active {
        visibility: visible
    }
}

#vert {
    flex: 0 0 .5rem;
    cursor: ew-resize
}

#hor {
    flex: 0 0 .5rem;
    cursor: ns-resize
}