@controls-opacity: .6;
*:not(textarea) {
    -webkit-user-select: none;
}

html,
body {
    position: absolute;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background: #000;
    font-family: helvetica, arial, sans-serif;
}

#canvas {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.loading {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #000;
    text-align: center;
    z-index: 1000;
    span {
        display: block;
        position: relative;
        top: 50%;
        margin-top: -.5em;
        color: #fff;
        font-size: 20px;
    }
}

.console {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 70px 20px 20px;
    color: #fff;
    font-family: "Lucida Console", Monaco, monospace;
    z-index: 510;
    transition: .3s;
    box-sizing: border-box;
}

.btn-level-editor {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 10px 20px;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 510;
    transition: 0.3s;
}

.btn-level-save {
    position: fixed;
    top: 10px;
    right: 100px;
    padding: 10px 20px;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 510;
    transition: 0.3s;
    &.saving {
        pointer-events: none;
        background-color: rgba(255, 203, 30, 0.7);
    }
    &.saved {
        pointer-events: none;
        background-color: rgba(39, 255, 30, 0.7);
    }
}

.btn-edit-menu {
    display: none;
}

.edit-menu {
    display: none;
}

.edit-mode {
    //width: 200%;
    //height: 100%;
    //overflow: scroll;
    //.console {
    //    left: 100px;
    //}
    .background {
        position: fixed;
        background: lightblue;
    }
    .controls {
        opacity: 0;
        z-index: -10;
        //pointer-events: none;
    }
    #player {
        opacity: .5;
    }
    .level {
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        //border: 1px solid #999;
        width: 100%;
        height: 100%;
        //background: yellow;
        //overflow: scroll;
    }
    .btn-level-editor {
        background-color: rgba(55, 255, 35, 0.5);
    }
    .btn-edit-menu {
        display: block;
        position: fixed;
        top: 10px;
        left: 10px;
        padding: 10px 20px;
        color: #fff;
        background-color: rgba(255, 255, 255, 0.25);
        border-radius: 10px;
        text-transform: uppercase;
        cursor: pointer;
        z-index: 510;
    }
    .edit-menu {
        display: block;
        position: fixed;
        top: 100%;
        width: 100%;
        height: 100%;
        padding-top: 60px;
        background-color: rgba(0, 0, 0, 0.5);
        transition: .3s;
        z-index: 509;
        &.active {
            top: 0;
        }
        span {
            display: inline-block;
            position: relative;
            overflow: hidden;
            width: 80px;
            border: 2px solid transparent;
            &.active {
                border: 2px solid #fff;//#0088dd;
                border-radius: 3px;
                box-shadow: 0px 0px 10px 0px rgba(112,214,245,1);
                background-color: rgba(152,254,255,0.4);
            }
            img {
                height: 100%;
            }
        }
    }
}

.level {
    position: absolute;
}

#player {
    position: absolute;
    z-index: 1;
    //overflow: hidden;
    //background-color: yellow;
    //background: url(images/CaptainNovaR1-3.png) gray;
    //background-position: left bottom;
    //background-repeat: no-repeat;
    .body {
        position: absolute;
        display: block;
        overflow: hidden;
        width: 100%;
        height: 100%;
        z-index: 2;
        img {
            position: absolute;
            bottom: 0;
            left: -100%;
            width: 400%;
        }
     }
    .fire {
        position: absolute;
        top: 100%;
        width: 100%;
        height: 100%;
        overflow: hidden;
        z-index: 1;
        img {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 200%;
        }
    }
}

.background {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    //background: url('images/sky_orange.png') #F93;
    //background-repeat: repeat-x;
    background: linear-gradient(#F60, #FC0);
    transition: .3s;
}

.ground {
    position: absolute;
    .block {
        position: absolute;
        display: block;
        //background: #00A37A;
        img {
            width: 100%;
        }
    }
}

.controls {
    position: fixed;
    display: block;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    transition: .3s;
    pointer-events: none;
    .dpad {
        position: absolute;
        left: 10px;
        bottom: 10px;
        width: 100px;
        height: 100px;
        opacity: @controls-opacity;
        .lr, .ud {
            position: absolute;
            display: block;
            background: #fff;
            border-radius: 5px;
        }
        .lr {
            top: 35%;
            left: 0;
            width: 100%;
            height: 30%;
            .left, .right {
                display: block;
                position: absolute;
                width: 50%;
                height: 100%;
            }
            .left {
                left: 0;
            }
            .right {
                left: 50%;
            }
        }
        .ud {
            top: 0;
            left: 35%;
            width: 30%;
            height: 100%;
        }
    }
    .button {
        &.jump {
            position: absolute;
            right: 60px;
            bottom: 70px;
            width: 100px;
            height: 100px;
            background: #fff;
            border-radius: 50%;
            opacity: @controls-opacity;
        }
    }
}

#log {
    color: #fff;
}

.export-level-box {
    position: fixed;
    width: 80%;
    height: 20%;
    top: 10%;
    left: 10%;
    z-index: 600;
    textarea {
        width: 100%;
        height: 100%;
    }
}

.export-level-close {
    position: absolute;
    top: 100%;
    right: 10px;
    margin-top: 10px;
    padding: 10px 20px;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 510;
    transition: 0.3s;
}

.pixelated {
    * {
        image-rendering: optimizeSpeed;
        image-rendering: -moz-crisp-edges;
        image-rendering: -o-crisp-edges;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: optimize-contrast;
        -ms-interpolation-mode: nearest-neighbor;
    }
}

audio {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}
