:root {
    --side-width: 44.5rem;
    
    --bg-color: #111916;
    
    --code-color: rgb(102, 136, 102);
    
    --code-color-8: rgba(102, 136, 102, .8);
    --code-color-6: rgba(102, 136, 102, .6);
    --code-color-2: rgba(102, 136, 102, .2);
    --code-color-1: rgba(102, 136, 102, .1);
}

* {
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.4);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 3px;
    height: 3px;
}

::-webkit-scrollbar-corner {
    background: var(--bg-color);
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: #132;
}

::-webkit-scrollbar-thumb:hover {
    background: #132;
}

[animate] {
    transition:
        top 200ms,
        left 200ms,
        right 200ms,
        bottom 200ms,
        width 200ms,
        height 200ms;
}

body {
    background: #000c09;
    color: #cfc;
    font-size: 1.1em;
    text-shadow: -2px 0 0 rgba(0, 100, 200, .4), 2px 0 0 rgba(200, 0, 0, .4);
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body,
button, select {
    font-family: dejavu;
}

button, select {
    font-size: 1em;
}

/*
    @media screen and (min-width: 2300px) {
        :root {
            --side-width: 51.75rem;
        }
        body {
            font-size: 1.3em;
        }
        canvas {
            scale: 1.18;
        }
    }
*/

button {
    display: block;
    background: #354;
    color: white;
    border: none;
    outline: none;
    margin: 0;
    padding: .25em .5em;
    cursor: pointer;
}

button:hover {
    background: #465;
}

button:active {
    background: #496959;
}

button[disabled] {
    cursor: default;
    background: #354;
    opacity: .5;
}

button.highlight {
    outline: 2px solid yellow;
    animation-name: highlight-animation;
    animation-duration: 1s;
    animation-iteration-count: infinite;
    z-index: 1;
}

@keyframes highlight-animation {
    0%, 50% {
        outline-color: rgba(155, 255, 0, 0);
        outline-offset: 0;
    }
    75% {
        outline-color: rgba(155, 255, 0, 1);
        outline-offset: 3px;
    }
    100% {
        outline-color: rgba(155, 255, 0, 0);
        outline-offset: 9px;
    }
}

select {
    padding: .75em;
    outline: none;
    border: none;
    background: #132;
    color: white;
    appearance: none;
    width: 100%;
}

.select-arrow {
    position: absolute;
    top: .6em;
    right: .25em;
    pointer-events: none;
    opacity: .75;
}

option {
    background: black;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    transition: scale 300ms;
}

#top-background {
    position: absolute;
    width: 100%;
    height: 2.75em;
    background: var(--code-color-1);
}

#wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: all 500ms;
    transform: perspective(75vh) rotateX(10deg) scale(.75);
}

#wrapper.visible {
    opacity: 1;
    transform: perspective(75vh) rotateX(0) scale(1);
}

#top {
    position: absolute;
    left: 0;
    padding: .5em;
    gap: .1em;
    z-index: 1;
    display: flex;
    justify-content: center;
    width: 268px;
    left: calc(50% - 134px);
}

#top button {
    text-transform: uppercase;
}

#side.visible + #top {
    left: min(calc(100% - 13em), var(--side-width));
}

#side {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#side.visible {
    width: var(--side-width);
}

#side .select-wrapper {
    position: relative;
    flex: 0;
}

#side .select-wrapper::after {
    font-family: monospace;
    font-size: 1.5em;
    content: '▼';
    position: absolute;
    display: block;
    right: .5em;
    top: .5em;
    pointer-events: none;
}

#side select {
    cursor: pointer;
}

#side.visible + #top + #view,
#side.visible + #top + #view + #log {
    left: var(--side-width);
}

#view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#view.with-log {
    height: 73%;
}

#log {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0;
    padding: 1em 0;
    overflow: hidden scroll;
}

#view.with-log + #log {
    height: 27%;
}

#log div {
    padding: 0 0 0 1em;
    line-height: 1.75em;
    background: #000f0c;
}

#log div:nth-child(odd) {
    background: #091310;
}

#log span {
    margin-right: .4em;
    opacity: .5;
}

#log span + span {
    margin-right: 0;
    opacity: inherit;
}

#empty {
    position: absolute;
    transition: opacity 200ms;
    z-index: -1;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

#side + #view > #empty {
    opacity: 0;
}

#empty,
#side.visible + #top + #view > #empty {
    opacity: 1;
}

#code {
    flex: 1;
}

#code.ace-tm {
    background: #111916;
    text-shadow: none;
    line-height: 1.2em;
}

#code.ace-tm .ace_content {
    padding-right: 0;
}

#code.ace-tm .ace_gutter {
    color: var(--code-color-6);
    background: rgba(0, 0, 0, .3);
}

#code.ace-tm .ace_gutter-active-line {
    color: var(--code-color);
    background: var(--code-color-2);
}

#code.ace-tm .ace_active-line {
    background: var(--code-color-1);
}

#code.ace-tm .ace_cursor {
    color: var(--code-color);
}

#code.ace-tm .ace_selected-word {
    background: var(--code-color-6);
    border: none;
}

#code.ace-tm .ace_marker-layer .ace_selection {
    background: var(--code-color-8);
}

#code.ace-tm {
    color: #7a7;
}

#code.ace-tm .ace_method {
    /* color: #cfc; */
    color: #7fa;
}

#code.ace-tm .ace_block {
    color: #9d3;
}

#code.ace-tm .ace_jump {
    font-weight: bold;
    color: rgb(205, 105, 205);
}

#code.ace-tm .ace_label {
    font-weight: normal;
    color: rgb(255, 125, 255);
}

#code.ace-tm .ace_number {
    color: white;
}

#code.ace-tm .ace_const {
    color: #8ad;
}

#code.ace-tm .ace_func {
    color: #e60;
}

#code.ace-tm .ace_string {
    color: #ccc;
}

#code.ace-tm .ace_key {
    color: #ee6;
}

#code.ace-tm .ace_operator {
    color: cyan;
    text-shadow: 0 0 .2em cyan;
}

#code.ace-tm .ace_gutter,
#code.ace-tm .ace_gutter-layer {
  width: 50px !important;
}

#code.ace-tm .ace_scroller {
    left: 50px !important;
}

#code.ace-tm .ace_gutter-layer > * {
  margin-left: -25px;
}



#top-right {
    position: absolute;
    top: .5em;
    right: .5em;
    z-index: 8;
}

#tools-background,
#tools {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    opacity: 0;
    transition: all 200ms;
}

#tools-background.visible {
    pointer-events: unset;
}

#tools-background.visible,
#tools-background.visible + #tools {
    opacity: 1;
}

#tools-background {
    background: rgba(0, 0, 0, .3);
    z-index: 9;
}

#tools-background + #tools .tabs {
    height: 0
}

#tools-background.visible + #tools .tabs {
    height: 48em;
}



#tools {
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
}

#tools * {
    pointer-events: none;
}
#tools-background.visible + #tools * {
    pointer-events: unset;
}
#tools-background.visible + #tools > * {
    pointer-events: all;
}

.tabs {
    background: var(--bg-color);
    width: 64em;
    display: flex;
    flex-direction: column;
    transition: height 200ms;
}

.tabs__bar {
    flex: 0;
    display: flex;
    background: rgba(0, 0, 0, .5);
}

.tabs__bar > * {
    background: none;
    padding: 1em;
}

.tabs__bar > *.active {
    background: var(--bg-color);
}

.tabs__content {
    height: 100%;
    padding: 1em;
    display: flex;
}

.tabs__content > * {
    flex: 1;
}




#tool-image-to-tausly {
    display: flex;
    flex-direction: column;
}

label.file-upload {
    position: relative;
    border: 3px dashed;
    background: none;
    display: block;
    min-height: 4rem;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: height 200ms;
}

label.file-upload::after {
    content: "Drop a image file here";
    text-shadow: none;
    pointer-events: none;
}

label.file-upload              { border-color: rgba(255, 255, 255, .25) }
label.file-upload::after       {        color: rgba(255, 255, 255, .25) }
label.file-upload:hover        { border-color: rgba(255, 255, 255, .35) }
label.file-upload:hover::after {        color: rgba(255, 255, 255, .35) }
label.file-upload.drag         { border-color: rgba(255, 255, 0, .6) }
label.file-upload.drag::after  {        color: rgba(255, 255, 0, .6) }
label.file-upload.drop         { border-color: rgba(  0, 255, 0, .8) }
label.file-upload.drop::after  {        color: rgba(  0, 255, 0, .8); content: attr(data-filename); }

label.file-upload.drop {
    height: 0;
}

label.file-upload + textarea {
    resize: none;
    margin: 0;
    height: 0;
    overflow: scroll;
    transition: padding 200ms, height 200ms;
    font-size: 1.2em;
    line-height: 1.3em;
    padding: 0 1em;
    background: none;
    outline: none;
    color: inherit;
    border: none;
}

label.file-upload.drop + textarea {
    height: 100%;
    padding: 1em 1em;
}

label.file-upload input[type="file"] {
    display: none;
}