body{
    padding: 0;
    margin: 0;
    background-color: white;
}

.parent {
    width: 100%;
}

.container {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    overflow: hidden;
    padding: 56.49% 0 0 0; /* 34.37% = 100 / (w / h) = 100 / (640 / 220) */
}

#ptz-container {
    grid-area:ptz;
}
.camlist {
    display: flex;
    flex-wrap: wrap;
    grid-area: cam;
    
}
.camlist a,.back,.touch{
    height: 3em;
    padding: 1em;
    margin:  1em;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2),0 6px 20px 0 rgba(0, 0, 0, 0.19);
} 
.camlist a{
    height: fit-content;
}
.camlist a div{
    display: flex;
    position:relative;
}
.camlist a div img{
    width:auto;
    max-width: 320px;
}
.camlist a div span{
    position:absolute;
}

.menu a{
    height: 1.5em;
    padding: .2em .5em;
    margin:  0.5em;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),0 3px 10px 0 rgba(0, 0, 0, 0.19);
}
#publish-button,.camlist a,.back, .menu a,.touch,.camlist a div span{
    align-self: auto;
    border-width: 1px;
    border-color: #ea5a00;
    background-color: #ea5a00;
    text-decoration: none;
    vertical-align: middle;
    color: black;
    transition: all .2s ease-in-out;
    font-family: sans-serif;
    font-weight: bold;    
}
#publish-button:hover,.camlist a:hover,.back:hover,.touch:hover{
    box-shadow: 0 5px 9px 0 rgba(0, 0, 0, 0.2),0 7px 22px 0 rgba(0, 0, 0, 0.19);
}
.menu a:hover{
    box-shadow: 0 2.2px 4.4px 0 rgba(0, 0, 0, 0.2),0 3.3px 11px 0 rgba(0, 0, 0, 0.19);
}
#publish-button:hover,.camlist a:hover,.back:hover,.menu a:hover,.touch:hover,.camlist a:hover div span{
    transform: scale(1.1);
    align-self: auto;
    border-width: 1px;
    border-color: #c81e0f;
    background-color: #c81e0f;
    text-decoration: none;
    vertical-align: middle;
    color: black;
}
.menu{
    grid-area: menu;
    padding-top: 0;
    position: fixed;
    top: 0;
    padding-left:0;
    overflow: hidden;
    display: flex;
    flex-wrap: wrap;
}
.header {
    grid-area: header;
    font-family: sans-serif;
    padding-top: 150px;
    padding-left: 10px;
    position: absolute;
    word-break: break-word;
    width: 20%;
}
.credit {
    grid-area: credit;
    height:100%;
}
.credit span,.ptz-container span {
    align-items:left;
    font-family: sans-serif;
    position: absolute;
    bottom: 15px;
    margin-left:1em;
    font-size: x-small;
    width:20%;
}
.credit span a{
    color:darkgray;
    text-decoration:none;
}
.header h1{
    position: relative;
    font-size: large;
    font-weight: bolder;
}
.header .back{
    margin-top:2em !important;
    position:absolute;
    margin-left: 0.67em !important;
    left:0;
}
.jsmpeg, .video{
    width:100%;
    z-index: 1;
    margin:0;
    height: 100%;
    grid-area: cam;
}
.logo{
    height:250px !important;
    padding: 10px 10px 0 10px;
}
main{
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    display: grid;
    grid-gap: 10;
    z-index: 2;
}
#indicator{
    width: 20px;
    height: 20px;
    position: fixed;
    left:50%;
    top:50%;
    z-index: 2;
    border-radius: 10px;
    border-width: 1px;
    border-style: solid;
    background-color: rgba(100, 100, 100, 0.44);
    padding: 5px;
    border-color: lightgrey;
    display:none;
}

#target{
    display:none;
}
#target[active=true]{
    display:block;
}
@media only screen and (min-width:1200px) and (max-height:499px){
    main.mpeg {
        grid-template-columns: 20% 60% 20%;
        grid-template-rows: 100%;
        grid-template-areas:
            "back cam menu";
    }
    main.list{
        grid-template-columns: 20% 80%;
        grid-template-rows: 20% 70% 10%;
        grid-template-areas:
            "header cam";
    }
    .header{
        z-index: 2;
        top:100%;
    }
    .header h1{
        visibility: hidden;
    }
    .header .back{
        grid-area: back;
        position: fixed;
        bottom: 0;
        z-index: 2;
    }
    .ptz-container{
        display:none;
    }
    .touch{
        grid-area: back;
        display: unset;
        bottom: 0;
        left:auto;
        right:2em;
        position: fixed;
        z-index: 2;
    }
    .menu a{
        z-index: 2;
    }
    .credit{
        display:none;
    }
}
@media only screen and (min-width:1200px) and (min-height:600px){
    main.mpeg {
        grid-template-columns: 20% 30% 30% 20%;
        grid-template-rows: 4em 40% 40% auto;
        grid-template-areas:
            "menu menu menu menu"
            "header cam cam blank"
            "header cam cam blank"
            "credit credit credit ptz";
    }
    .header{
        background-image: url('/static/img/logo.svg');
        background-position: 10px 15%;
        background-repeat: no-repeat;
        background-size: 8%;
        background-attachment: fixed;
        top: 10%;
    }
    main.list{
        grid-template-columns: 20% 80%;
        grid-template-rows: 20% 70% 10%;
        grid-template-areas:
            "header blank"
            "header cam"
            "credit credit";
    }
    .touch{
        display:none;
    }
    .ptz-container{
        grid-area:ptz;
    }
}
@media only screen 
and (min-width:300px) 
and (max-width:1000px) 
and (orientation : landscape){
    main.mpeg {
        grid-template-columns: auto;
        grid-template-rows: auto;
        grid-template-areas:
            "cam";
    }
    .menu{
        display:none;
    }
    .header{
        z-index: 2;
        top:100%;
    }
    .header h1{
        visibility: hidden;
    }
    #target{
        z-index:2;
        grid-area:cam;
        position:absolute;
        display:none;
        left: 311px;
        top: 99px;
    }
    #target[active=true]{
        display:block;
    }
    #target span{        
        z-index:2;
        border-width: 5px;
        border-radius: 20px;
        padding: 4px 12px 4px 12px;
        border-color: lime;
        border-style: solid;
        width: 10px;
        height: 10px;
    }
    .header .back{
        grid-area: cam;
        position: fixed;
        bottom: 0;
        z-index: 2;
    }
    div.jsmpeg{
        height:100%;
        max-width:100%;
        align-items:center;
    }
    .ptz-container{
        display:none;
    }
    canvas{
        height:100%!important;
        max-width:100%;
    }
    .touch{
        grid-area: cam;
        display: unset;
        bottom: 0;
        left:auto;
        right:2em;
        position: fixed;
        z-index: 2;
    }
    .credit{
        display:none;
    }
}
@media only screen and (min-height:500px) and (max-width:1199px){
    main.mpeg {
        grid-template-columns: 100%;
        grid-template-rows: 4em 80% auto;
        grid-template-areas:
            "menu"
            "cam"
            "back";
    }
    main.list{
        grid-template-columns: 100%;
        grid-template-rows: 100%;
        grid-template-areas:
            "cam";
    }
    .menu{
        display: inline-flex;
        flex-wrap:nowrap;
        overflow: hidden;
    }
    .ptz-container{
        display:none;
    }
    .header .back{
        grid-area: back;
        position: fixed;
        bottom: 0;
        z-index: 2;
    }
    .menu a{
        z-index: 2;
    }
    .header{
        z-index: 2;
        top:100%;
        height:0;
    }
    .touch{
        grid-area: cam;
        display: unset;
        bottom: 0;
        left:auto;
        right:2em;
        position: fixed;
        z-index: 2;
    }
    .header h1{
        visibility: hidden;
    }
}
body{
    overflow:hidden;
    margin:0;
}
*{
    box-sizing: border-box;
}
