/* vars */
    /* Likely meant to be temporary*/
    :root{
        --appsize-x: 500px;
        --appsize-y: 499px;
    }

/* basic */
    * {
        margin: 0px;
        padding: 0px;

        user-select: none;

        font-family: 'Nimbus', 'Arial';
        -webkit-tap-highlight-color: #0000;
        -webkit-touch-callout: none;
    }

    body, html{
        display: flex;
        flex-direction: column;
        width: 100%;
        height: 100%;
        background-color: #000;
        
        cursor: default;
    }

    div{
        display: flex;
        flex-direction: column;
    }

    @media (pointer: coarse) and (orientation: landscape) {
        /*resize on tablet*/
        body {
            zoom: 0.35;
        }
    }


/*headbar*/
.headbar{
    position: fixed;
    top: env(titlebar-area-height, 0px);
    left: 10px;
    width: calc(100% - 20px);
    height: 48px;
    /*background-color: #f00;*/
    z-index: 99999;
    pointer-events: none;

    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}
    .headbar-home-button{
        /*background-color: #00f;*/
        width: 48px;
        height: 48px;
        pointer-events: all;
        cursor: pointer;
    }
    .headbar-watermark{
        /*background-color: #00f;*/
        width: 128px;
        height: 32px;
        pointer-events: all;
        cursor: pointer;
    }

/* tab */
    .tab:not(.active){
        display: none;
    }
    .tab.active{
        flex-shrink: 0;
        flex-grow: 1;
        flex-basis: 100%;

        /*change later to background image*/
        /*background-color: #fff;*/
    }
        @media (display-mode: window-controls-overlay) and (pointer: fine) {
            /*only in PWA mode*/
            .tab.active{
                max-width: var(--appsize-x);
                max-height: var(--appsize-y);
                flex-basis: var(--appsize-y);
                flex-shrink: 1;
                flex-grow: 0;
            }
        }

/* topbar */
    .space-topbar{
        flex-basis: env(titlebar-area-height, 33px);
        flex-grow: 0;
        flex-shrink: 0;
    }
    .topbar-container{
        position: absolute;
        display: block;
        top: env(titlebar-area-top, 0);
        left: env(titlebar-area-x, 0);
        
        width: env(titlebar-area-width, 100%);
        /*height: env(titlebar-area-height, 33px);*/
        height: env(titlebar-area-height, 48px);

        
        window-drag: drag;
        -webkit-app-region:drag;
    }
    @media (max-width: 400px) {
        .topbar-container{
            width: 80%;
        }
    }

        .topbar{
            display: flex;
            align-self: stretch;
            flex-basis: 100%;
            height: 100%;
            align-items: center;
            justify-content: center;
            flex-direction: row;
        }

            .device-name{
                line-height: 1;
                cursor: text;

                window-drag: no-drag;
                -webkit-app-region:no-drag;
            }
            .device-name:focus{
                outline: none;
            }
            /*@media (display-mode: window-controls-overlay) {
                .topbar-container{
                    background-color: #22ccff;
                    color:#fff;
                }
            }*/

/* section */
    .section{
        align-items: center;
        justify-content: center;

        flex-basis: 100%;
        flex-shrink: 1;
        flex-grow: 0;
    }

/* bottom */
    .bottom{
        /*padding: 10px;*/
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .type-code{
        cursor: text;
    }
    .type-code:focus{
        outline: none;
    }

/* screen */
    .screen {
        flex-basis: 100%;
        flex-shrink: 0;
        flex-grow: 0;
    }


/*Specific segments*/
    /*Uploading*/
        /*Cast*/
            .cast-area{
                flex-direction: row;
                justify-content: center;
            }
                .text-code{
                    justify-content: center;
                }
            

        /*Connections*/
            .section.connections{
                flex-direction: column;
                justify-content: flex-start;
                
                flex-basis: 100%;
            }
            .connection{
                flex-direction: row;
                padding: 5px;

                align-self: stretch;
                justify-content: space-between;
                
            }
                .name{
                    flex-basis: calc(100% - 180px);
                }
                .statusbar{
                    flex-basis: 150px;
                }
                .connection-strength{
                    flex-basis: 15px;
                }
                .kick-button{
                    flex-basis: 15px;
                }
    /*Downloading*/
        .download-progress-bar{
            /*background-color: #fff;*/
            /*width: 200px;*/
        }
        .download-status{
            height: 100%;
            /*background-color: #0f0;*/
        }

/* Modal/notificaiton */
/*    #modal{
        position: fixed;
        
        display: none;

        bottom: 25px;
        left: 25px;
        width: calc(100% - 50px);
        height: 70px;

        padding: -10px;

        justify-items: center;
        align-content: center;

        background-color: #0f0;
    }
        #modal.play{        
            display: block;
            animation: notification 7s ease forwards;
        }
        @keyframes notification{
            0% {
                display: block;
                bottom: -70px;
                opacity: 1;
            }
            5% {
                bottom: 25px;
                opacity: 1;
                transform: scale(1);
            }
            95% {
                bottom: 25px;
                opacity: 0.7;
                transform: scale(0.9);
            }
            100%{
                transform: scale(0.9);
                bottom: -70px;
                opacity: 0;
                display: none;
            }
        }*/

/* Interactions */
    .section.upload:hover{
        
    }
    .app-dragover{
        background-color: #0004;
    }
    .app-copy-on-click{
        cursor: pointer;
        /*background-color: #0002;*/
    }