@font-face {
    font-family: 'Maxi';
    src: url('/assets/fonts/variable/ABCMaxiPlusVariableUnlicensedTrial-Regular.ttf') format('truetype');
    // src: url('/assets/fonts/variable/ABCMaxiRoundMonoVariableUnlicensedTrial-Regular.ttf') format('truetype');
    // src: url('/assets/fonts/variable/ABCMaxiRoundVariableUnlicensedTrial-Regular.ttf') format('truetype');
    // src: url('/assets/fonts/variable/ABCMaxiSharpMonoVariableUnlicensedTrial-Regular.ttf') format('truetype');
    // src: url('/assets/fonts/variable/ABCMaxiSharpVariableUnlicensedTrial-Regular.ttf') format('truetype');
}

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

button {
    all: unset;
    cursor: pointer;
    border: 1px solid #aaa;
    border-radius: 4px;
    margin: 1em 0 0;
    &:hover {
        border-color: #fff;
        color: #fff;
    }
    padding: 0.15em 0.3em;
}

main {
    position: relative;
    height: 100vh;
    z-index: 1;

    font-family: 'Maxi', sans-serif;

    div {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        white-space: nowrap;
    }
}

nav {
    position: absolute;
    left: 30px;
    top: 30px;
    width: 320px;
    border: 1px solid #333;
    background-color: rgba(0,0,0,.7);
    z-index: 2;
    #titleBar,
    #generalSettings {
        padding: 15px;
    }
    #generalSettings {
        border-top: 1px solid #333;
        padding-bottom: 25px;
    }
    #gradationSettings {
        border-top: 1px solid #333;
        display: flex;
        .side {
            width: 50%;
            padding: 15px;
        }
        .side + .side {
            border-left: 1px solid #333;
        }
    }
    opacity: 0.3;
    transition: opacity 0.15s ease;
    &:hover {
        opacity: 1;
    }
}

h1 {
    font-size: 120%;
    margin: 0;
    font-family: 'Maxi';
    letter-spacing: 0.1em;
}

h2 {
    font-size: 100%;
    color: #888;
}

h3 {
    font-size: 100%;
    margin: 1em 0 0.5em;
    font-weight: normal;
}

label {
    display: block;
}
label + label {
    margin-top: 1.5em;
}

input[type=range] {
    display: block;
    width: 100%;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    height: 1px;
    background: #777;
    margin-top: 0.8em;

    &:hover {
        background: #999;
    }
    &:focus {
        background: #fff;
    }

    &::-webkit-slider-thumb {
        background: #fff;
        -webkit-appearance: none;
        appearance: none;
        width: 4px;
        height: 10px;
        cursor: pointer;
    }

    &::-moz-range-thumb {
        background: #fff;
        width: 4px;
        height: 10px;
        cursor: pointer;
    }
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1px solid #777;
    background: transparent;
    width: 36px;
    height: 18px;
    border-radius: 2px;
    cursor: pointer;

    &::-webkit-color-swatch-wrapper {
        padding: 0;
    }

    &::-webkit-color-swatch {
        border: none;
    }

    &:hover {
        border-color: #fff;
    }

}


// @borderColor: rgba(255,255,255,.15);
// @selectionColor: #37f;
// @navBackground: rgba(0, 0, 0, 0.6);


// main {
//     height: 100vh;
//     display: flex;
//     justify-content: center;
//     align-items: center;
//     canvas {
//         display: block;
//         height: 100% !important;
//         width: auto !important;
//         image-rendering: pixelated;
//     }
// }
// body[horizontal="true"] {
//     main canvas,
//     #grid canvas {
//         height: auto !important;
//         width: 100% !important;
//     }
// }
// #grid {
//     position: absolute;
//     left: 0;
//     top: 0;
//     width: 100vw !important;
//     height: 100vh !important;
//     opacity: 0.05;
//     z-index: 1;
//     pointer-events: none;
//     object-fit: contain;
//     image-rendering: pixelated;
// }
// body[grid="true"] #grid {
//     display: block !important;
// }

// body:not(.loaded) {

//     nav,
//     main {
//         display: none;
//     }
// }

// body.loaded {
//     #p5_loading {
//         display: none;
//     }
// }

// input[type="number"] {
//     border: 0;
//     background: transparent;
//     color: #fff;
// }

// #main, #panel {
//     background-color: @navBackground;
// }

// #main {
//     position: fixed;
//     left: 0;
//     top: 0;
//     width: 160px;
//     height: 100vh;
//     z-index: 2;
//     display: flex;
//     flex-direction: column;
//     justify-content: space-between;
//     border-right: @borderColor 1px solid;

//     .title {
//         padding: 8px 10px 0;
//         text-align: center;
//     }

//     .flex {
//         display: flex;
//         justify-content: center;

//         // &.center {
//         //     justify-content: center;
//         // }

//         // &.right {
//         //     justify-content: flex-end;
//         // }
//     }

//     #size {
//         display: flex;
//         align-items: center;
//         justify-content: center;

//         .times {
//             font-size: 18px;
//             color: #666;
//         }

//         input {
//             width: 55px;
//         }
//     }

//     #speed {
//         padding-right: 10px;

//         input {
//             width: 40px;
//         }

//         &:after {
//             content: '%';
//         }
//     }

//     input {
//         height: 40px;
//         text-align: center;
//         -moz-appearance: textfield;
//         -webkit-appearance: none;
//         appearance: none;

//         &::-webkit-outer-spin-button,
//         &::-webkit-inner-spin-button {
//             -webkit-appearance: none;
//             margin: 0;
//         }
//     }

//     h1,
//     input,
//     #speed {
//         font-size: 18px;
//         line-height: 40px;
//         font-weight: normal;
//     }

//     #fps {
//         text-align: center;
//         padding-bottom: 15px;
//         color: #666;
//         &:after {
//             content: ' FPS';
//         }
//     }

//     .separator {
//         height: 1px;
//         background-color: @borderColor;
//         margin: 10px 0;
//     }

// }

// // #main, #panel {
// //     transition: opacity 0.2s 0s;
// // }
// // body.hideMain {
// //     #main {
// //         opacity: 0;
// //         transition-delay: 0.2s;
// //     }
// // }
// // body.hidePanel {
// //     #panel {
// //         opacity: 0;
// //         transition-delay: 0.2s;
// //     }
// // }

// #panel {
//     position: fixed;
//     right: 0;
//     top: 0;
//     z-index: 2;
//     height: 100vh;
//     width: 280px;
//     border-left: @borderColor 1px solid;

//     #settings {
//         height: 50%;
//         padding: 15px;
//         overflow: auto;

//         [layer] {
//             display: none;
//         }

//         .list {
//             .option {
//                 display: grid;
//                 grid-template-columns: 80px 1fr;
//                 align-items: center;
//                 // padding: 0.5em 0;
//                 height: 36px;

//                 .set {
//                     display: flex;
//                     gap: 7px;
//                     &.position {
//                         input {
//                             width: 100%;
//                         }
//                     }
//                 }
//             }
//         }

//         span {
//             color: #888;
//         }

//         input[type="number"] {
//             border-bottom: 1px dotted #777;
//             max-width: 40px;
//             margin: 0 5px;
//             text-align: center;

//             &:hover {
//                 border-color: #fff;
//             }
//         }

//         input[type="checkbox"] {
//             display: block;
//             -webkit-appearance: none;
//             -moz-appearance: none;
//             appearance: none;
//             width: 20px;
//             height: 20px;
//             background: transparent;
//             border: 1px solid #777;
//             border-radius: 50%;
//             cursor: pointer;
//             position: relative;

//             &:checked {
//                 background-color: #fff;
//                 opacity: 1;
//             }

//             &:checked:after {
//                 content: '';
//                 position: absolute;
//                 top: 1.5px;
//                 left: 6px;
//                 width: 4px;
//                 height: 10px;
//                 border: solid #000;
//                 border-width: 0 2px 2px 0;
//                 transform: rotate(45deg);
//             }

//             &:hover {
//                 border-color: #fff;
//             }

//         }

//         input[type="color"] {
//             -webkit-appearance: none;
//             -moz-appearance: none;
//             appearance: none;
//             border: 1px solid #777;
//             background: transparent;
//             width: 36px;
//             height: 18px;
//             border-radius: 2px;
//             cursor: pointer;

//             &::-webkit-color-swatch-wrapper {
//                 padding: 0;
//             }

//             &::-webkit-color-swatch {
//                 border: none;
//             }

//             &:hover {
//                 border-color: #fff;
//             }

//         }

//         select {
//             background: transparent;
//             color: #fff;
//             border: 0;
//             border: 1px solid @borderColor;
//             padding: 5px;
//             border-radius: 2px;
//             font-size: 13px;
//             cursor: pointer;
//             width: 100%;

//             &:hover {
//                 border-color: #aaa;
//             }
//         }
//     }

//     #layers {
//         border-top: @borderColor 1px solid;
//         padding: 15px 0 0;
//         height: 50%;

//         .options {
//             display: flex;
//             justify-content: space-between;
//             margin-bottom: 1em;
//             padding: 0 15px;

//             .side {
//                 display: flex;
//                 align-items: center;
//                 gap: 10px;
//             }

//             button {
//                 all: unset;
//                 width: 18px;
//                 height: 18px;
//                 background: #222;
//                 font-size: 0;
//                 background: no-repeat center;
//                 background-size: 18px;
//                 cursor: pointer;
//                 opacity: 0.8;

//                 &:hover {
//                     opacity: 1;
//                 }

//                 &[type="pixel"] {
//                     background-image: url('/assets/icons/pixel.svg');
//                 }

//                 &[type="circle"] {
//                     background-image: url('/assets/icons/circle.svg');
//                 }

//                 &[type="draw"] {
//                     background-image: url('/assets/icons/drawing.svg');
//                 }

//                 &[type="gfx"] {
//                     background-image: url('/assets/icons/image.svg');
//                 }

//                 &[type="line"] {
//                     background-image: url('/assets/icons/line.svg');
//                 }

//                 &#removeLayer {
//                     background-image: url('/assets/icons/remove.svg');
//                 }

//                 &#duplicateLayer {
//                     background-image: url('/assets/icons/duplicate.svg');
//                 }
//                 &[active="false"] {
//                     opacity: 0.3;
//                     pointer-events: none;
//                 }
//             }
//         }

//         .list {
//             overflow: auto;
//             height: ~"calc(100% - 30px)";
//             padding-bottom: 15px;

//             .layer {
//                 display: block;
//                 .bar {
//                     display: grid;
//                     align-items: center;
//                     height: 30px;
//                     cursor: pointer;
//                     padding: 0 15px;
//                 }

//                 &.object .bar {
//                     grid-template-columns: 25px 1fr 50px;
//                 }

//                 &:hover {
//                     .name {
//                         text-decoration: underline;
//                     }
//                 }

//                 input:checked+.bar {
//                     background-color: rgba(255,255,255,.1);
//                 }

//                 &[active="false"] {

//                     .visibility,
//                     .name {
//                         opacity: 0.5;
//                     }
//                 }

//                 .visibility {
//                     width: 18px;
//                     height: 100%;
//                     background: url('/assets/icons/visibility.svg') no-repeat center;
//                     background-size: 30px;
//                     cursor: pointer;

//                     &:hover {
//                         opacity: 0.8;
//                     }
//                 }

//                 &.dragging {
//                     background-color: @selectionColor;
//                 }

//                 .name {
//                     width: 100%;
//                     overflow: hidden;
//                     white-space: nowrap;
//                 }

//                 .type {
//                     text-align: right;
//                     opacity: 0.5;
//                     font-style: italic;
//                     padding-right: 3px;
//                 }

//             }
//         }
//     }
// }

// h2 {
//     font-size: 16px;
//     margin-bottom: 0.75em;
//     // font-weight: normal;
// }

// *[contenteditable] {
//     cursor: text;
// }

// .icon {
//     all: unset;
//     width: 40px;
//     height: 40px;
//     background: #555;
//     text-align: center;
//     background: no-repeat center;
//     font-size: 0;
//     background-size: 40px;
//     cursor: pointer;

//     &#saveProject {
//         background-image: url('/assets/icons/save-project.svg');
//     }

//     &#loadProject {
//         background-image: url('/assets/icons/load-project.svg');
//     }

//     &#toggleGrid {
//         background-image: url('/assets/icons/grid.svg');
//     }

//     &#saveFrame {
//         background-image: url('/assets/icons/save-frame.svg');
//     }

//     &#recordVideo {
//         background-image: url('/assets/icons/record.svg');
//         &[inprogress="true"] {
//             background-image: url('/assets/icons/recording.svg');
//         }
//     }

//     &#toggleFullscreen {
//         background-image: url('/assets/icons/fullscreen.svg');
//         margin-left: 0;
//     }

//     &#togglePlay {
//         margin: 0 -5px 0 0;
//         background-image: url('/assets/icons/play.svg');
//     }

//     opacity: 0.8;

//     &:hover {
//         opacity: 1;
//     }

//     &[active="false"] {
//         opacity: 0.3;

//         &#togglePlay+#speed,
//         &#toggleGrid+#gridSize {
//             opacity: 0.3;
//         }
//     }
// }

// *::selection {
//     background: @selectionColor;
// }


// h3 {
//     margin: 1em 0 0.75em;
// }

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

//     &:hover,
//     &:focus {
//         background: #fff;
//     }

//     &::-webkit-slider-thumb {
//         background: #fff;
//         -webkit-appearance: none;
//         appearance: none;
//         width: 4px;
//         height: 10px;
//         cursor: pointer;
//     }

//     &::-moz-range-thumb {
//         background: #fff;
//         width: 4px;
//         height: 10px;
//         cursor: pointer;
//     }
// }

// #p5_loading {
//     position: fixed;
//     left: 50%;
//     top: 50%;
//     transform: translate(-50%, -50%);
//     color: #444;
//     font-size: 40px;
// }

// // #media {
// //     position: absolute;
// //     left: 150px;
// //     top: 20px;
// // }