/*
|-----------------------------------------
| Core CSS
|-----------------------------------------
 */

html, body {
    font-family: Open Sans, Arial, sans-serif;
    height: 100%;
    width:100%;
    margin: 0;
    padding: 0;
    background: #000;
    overflow: hidden;
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* reset all list items */
ul{
    list-style: none;
    padding: 0;
    margin: 0;
}

#container {
    width: 100%;
    height: 100%;
}

#main {
    position:absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
}

/*
|-----------------------------------------
| Canvas
|-----------------------------------------
|
| Classes are automatically overwritten 
| by the filter styles, therefore only
| attributes and id's can be used.
|
 */

canvas {
    margin: auto;
    display: block;
    padding: 0px;
    background-color: rgb(248, 248, 248);
    cursor: none;
}

canvas.textureSmooth {
    image-rendering: auto;
    image-rendering: optimizeQuality;
    -ms-interpolation-mode: bicubic;
}

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

/*
|-----------------------------------------
| Messages
|-----------------------------------------
 */

.message {
    background: #6cc27d;
    padding: 1em 2em;
    text-align: center;
    color: #fff;
    bottom: 0px;
    position: fixed;
    left: 0px;
    display: none;
    font-weight: bold;
    vertical-align: bottom;
    font-family: monospace;
    z-index: 1;
}

/*
|-----------------------------------------
| Main Menu
|-----------------------------------------
 */

/* top level menu */
div#menu {
    position: absolute;
    z-index: 1;
    width: 100%;
    height: 0px;
}
.menu {
    position: fixed;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.1);
    transition: .3s ease;
	cursor: pointer;
}

/* auto hide menu while playing */
.playing .menu{opacity: 0;}
.playing .menu:hover{opacity: 0.9;}

/* sub level menu */
.menu ul{
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top:100%;
    left:0;
    background-color: rgb(245, 245, 245);
    box-shadow: 0 5px 10px 0 rgba(0,0,0,.1);
    transition: .3s ease;
    z-index: 1;
}

li.hide {
    display: none !important;
}

/* bottom level nav */
.menu ul ul{
    top:0;
    left: 100%;
}

#menu_top li {
    padding: .7em 1em;
}

.menu ul li {
    padding: .3em 1em !important;
}

.menu li{
    white-space: nowrap;
    position: relative;
    cursor:pointer;
}

.menu li:hover{
    background: rgba(0,0,0,.1);
}

/* show sub nav on hover */
.menu li:hover > ul{
    visibility: visible;
    opacity: 1;
}

/*
|-----------------------------------------
| Touch Controls
|-----------------------------------------
 */

.touch-controls{
    display: flex;
    padding: 1em;
    position: absolute;
    bottom: 0px;
    left: 0px;
    right: 0px;
}

.touch-controls button{
    display: inline-block;
    -webkit-appearance: none;
    border:0;
    outline: 0;
    background: #fff;
    opacity: 0.7;
    width: 3em;
    height: 3em;
    line-height: 3em;
    text-align: center;
    cursor: pointer;
    transition: .1s ease;
    margin:.5em;
}

.touch-controls button:active{
    transform: scale(0.95);
    box-shadow: 0 0 10px 0 rgba(0,0,0,0.4) inset;
}

.touch-dpad, .touch-buttons{
    flex-grow: 1;
    text-align: center;
}

.touch-buttons{
    align-self: flex-end;
}

.touch-dpad--up{
    flex-grow: 1;
    width: 100%;
}

/* Only show controls on portrait mode screens */
@media screen and (min-aspect-ratio: 1/1) {
    .touch-controls{
        display: none;
    }
    #main {
        display: flex;
        justify-content: center;
        flex-grow: 1;
        align-items: center;
    }
}