/*
|-----------------------------------------
| Core CSS
|-----------------------------------------
 */

html, body {
    font-family: Open Sans, Arial, sans-serif;
    height: 100%;
    width:100%;
    margin: 0;
    padding: 0;
    background: #624D97;
    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;
    z-index: -10;
    position: relative;
}

/* reset all list items */
ul{
    list-style: none;
    padding: 0;
    margin: 0;
}

#container {
    width: 100%;
    height: 100%;
    /* touch-action: manipulation; */
    display: flex; 
    flex-flow: column;
}

#contianer * {
    /* touch-action: manipulation; */
}

#main {
    /* position:absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px; */
    padding: 0;
}

#emulator_target {
    background-color: lightgrey;
}

#full-loading {
    height: 100%;
    width: 100%;
    background-color: rgba(50, 50, 50, 0.5);
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    align-items: center;
    justify-content: center;
    color: white;
}

#full-loading.show {
    display: flex;
    animation: show 1s;
}

#drawer {
    width: 100%;
    height: 145px;
    top: -149px;
    left: 0;
    display: block;
    position: fixed;
    background-color: #383735;
    -webkit-overflow-scrolling: touch;
    border-bottom: 4px solid black;
    transition: 0.5s;
}

#drawer.open {
    top: 0px;
    -webkit-box-shadow: 0px 3px 13px 0px rgba(50, 50, 50, 0.75);
    -moz-box-shadow:    0px 3px 13px 0px rgba(50, 50, 50, 0.75);
    box-shadow:         0px 3px 13px 0px rgba(50, 50, 50, 0.75);
}

#drawer #game-list {
    display: flex;
    flex-direction: row;
    overflow-x: scroll;
}

#drawer #game-list li {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    background: url('/user_img/emulator/cart.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 150px;
    height: 95px;
    position: relative;
    margin: 10px 10px;
    cursor: pointer;
    padding: 15px 50px;
    text-align: center;
    font-weight: bold;
}

#drawer #options {
    width: 50px;
    height: 100%;
    background: black;
    color: white;
    cursor: pointer;
    font-size: 2em;
    padding: 0;
    text-align: center;
}

#drawer #expander {
    /* -webkit-border-radius: 0 0 400px 400px; */
    /* border-radius: 0 0 15px 15px; */
    /* background-color: black; */
    /* color: white; */
    background: center no-repeat;
    background-image: url('/user_img/emulator/eject-2x.png');
    background-size: contain;
    width: 50px;
    height: 35px;
    position: absolute;
    bottom: -28px;
    left: 50%;
    margin-left: -25px;
    text-align: center;
    opacity: 0.7;
    cursor: pointer;
}
#drawer #expander:before {
    display: block;
    background: center no-repeat;
    background-image: url('/user_img/emulator/eject-2x.png');
    background-size: contain;
    height: 100%;
    width: 100%;
    opacity: inherit;
    content: "";
}

#drawer.open #expander .fa-chevron-up {
    display: none;
}

#drawer #expander .fa-chevron-up {
    display: none;
}

#drawer.open #expander .fa-chevron-down {
    display: none;
}

#drawer #expander .fa-chevron-down {
    display: none;
}

#drawer.open #expander {
    opacity: 1;
}

@keyframes show {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/*
|-----------------------------------------
| 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;
    margin: auto;
    width: 90%;
    min-height: 10px;
    left: 0;
    right: 0;
    /* display: none; */
    opacity: 0;
    visibility: hidden;
    font-weight: bold;
    vertical-align: bottom;
    font-family: monospace;
    z-index: 1;
    transition: opacity 0.8s;
}

.message.show {
    /* display: block; */
    opacity: 1;
    visibility: visible;
}

/*
|-----------------------------------------
| Main Menu
|-----------------------------------------
 */

/* top level menu */
div#menu {
    z-index: 1;
    line-height: 3em;
}
#menu-container {
    position: absolute;
    height: 100%;
    width: 50px;
    min-width: 25px;
    top: 0;
    right: 0;
    background-color: black;
    overflow-x: scroll;
    transition: width 0.6s;
}
#menu-container.visible {
    width: 100%;
}
.menu {
    float: left;
    margin-right: -999em;
    color: white;
    background-color: black;
    border-bottom: 1px solid rgba(0,0,0,.1);
    transition: .3s ease;
}
.menu * {
    display: inline-block;
}

.menu > li {
    white-space: nowrap;
    position: relative;
    cursor:pointer;
    vertical-align: top;
    line-height: 145px;
}

/* sub level menu */
.menu ul {
    position: absolute;
    top:100%;
    left:0;
    background-color: black;
    box-shadow: 0 5px 10px 0 rgba(0,0,0,.1);
    transition: .3s ease;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.menu li.open ul {
    top: 0;
}

.menu li li {
    padding: 0;
    background: red;
    margin: 0;
    line-height: initial;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: #5B3E83;
}

li.hide {
    display: none !important;
}

/* bottom level nav */
.menu ul ul {
    top:0;
    left: 100%;
}

#menu_top li {
    padding: 0em 1em;
    border-left: 1px solid #333;
}

.menu ul li {
    padding: .3em 1em !important;
}

.menu li.shown {
    display: inline-block;
}

.menu > li:first-child {
    display: inline-block;
}

/* show sub nav on hover */
.menu li:hover > ul{
    visibility: visible;
    opacity: 1;
}

.menu .toggle.active {
    background-color: rgb(43,194,83);
}

#gdrive-connect {
    display: none;
    margin: 55px auto;
    width: 200px;
    text-align: center;
    background-color: #624D97;
    height: 2em;
    line-height: 2em;
    border-radius: 8px;
    border: 2px solid #301A65;
    color: white;
    cursor: pointer;
}
#gdrive-connect.show {
    display: block;
}

#info {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background-color: rgba(30, 30, 30, 0.8);
    display: none;
}

#info > div {
    margin: auto;
    max-width: 500px;
    border-radius: 15px;
    background-color: rgb(30,30,30);
    color: rgb(200, 200, 200);
}

#info ol {
    padding: 0;
}

#info li {
    display: none;
}

#info li.active {
    display: block;
}

#info li div.image {
    height: 150px;
    border-radius: 15px 15px 0 0;
    background-position: center;
    background-size: cover;
}

#info li h3,
#info div.button {
    color: white;
    text-align: center;
    background: rgb(40,40,40);
    line-height: 2em;
    margin-top: 10px;
}

#info div.button {
    margin-bottom: 15px;
    cursor: pointer;
}

#info li p {
    height: 100px;
    overflow: scroll;
    margin: 20px;
}

/*
|-----------------------------------------
| Touch Controls
|-----------------------------------------
 */

.touch-controls {
    display: block;
    position: relative;
    flex: 1 1 auto;
    /* bottom: 0px;
    left: 0px;
    right: 0px;
    height: 50%; */
}

.touch-controls div.button {
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    border:0;
    outline: 0;
    width: 70px;
    height: 70px;
    cursor: pointer;
    transition: .1s ease;
    position: absolute;
}

./* touch-controls .touch-buttons div.button {
    border-radius: 100px;
} */

.touch-controls div.button.pressed {
    background-color: red;
}


/* BUTTON POSITIONING */
.touch-controls div.button {
    /* background-color: red; */
    background-color: transparent;
}
.touch-controls div {
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
.touch-controls div.button.top {
    width: 170px;
    background-position: top;
}
.touch-controls #touch-l.button {
    left: 0;
    /* background-image: url('/user_img/emulator/top-left-bnt.png') */
}
.touch-controls #touch-r.button {
    right: 0;
    /* background-image: url('/user_img/emulator/top-right-bnt.png'); */
}
.touch-controls #touch-speed {
    left: 50%;
    height: 44px;
    margin-left: -10px;
    bottom: 15px;
    /* background-image: url('/user_img/emulator/turbo-2x.png'); */
}
.touch-controls #touch-speed.active {
    /* background-image: url('/user_img/emulator/turbo-enabled-2x.png'); */
}
.touch-controls .touch-buttons.ab {
    position: absolute; 
    right: 10px; 
    top: 50%; 
    margin-top: -75px; 
    height: 150px; 
    width: 150px;
}
.touch-controls .touch-buttons.ab div.button {
    top: 45%;
    /* background-size: 70px; */
    background: contain;
    background-position: center 0;
    transition: 0.05s;
}
.touch-controls #touch-b {
    left: 10px; 
    margin-top: -10px;
    /* background-image: url('/user_img/emulator/b-bnt-2x.png'); */
}
.touch-controls #touch-b.pressed {
    /* background-image: url('/user_img/emulator/b-bnt-pressed-2x.png'); */
    background-position: center 4px;
}
.touch-controls #touch-a {
    right: 0px; 
    margin-top: -40px;
    /* background-image: url('/user_img/emulator/a-bnt-2x.png'); */
}
.touch-controls #touch-a.pressed {
    /* background-image: url('/user_img/emulator/a-bnt-pressed-2x.png'); */
    background-position: center 4px;
}
.touch-controls .touch-buttons.bottom {
    position: absolute;
    bottom: 25px; 
    left: 80px; 
}
.touch-controls .touch-buttons.bottom div {
    height: 44px;
    position: initial;
}
.touch-controls .touch-buttons.bottom #touch-select {
    /* background-image: url('/user_img/emulator/select-bnt.png'); */
}
.touch-controls .touch-buttons.bottom #touch-start {
    /* background-image: url('/user_img/emulator/start-bnt.png'); */
}
.touch-controls .touch-dpad {
    position: absolute; 
    left: 10px; 
    top: 45%; 
    margin-top: -75px; 
    height: 150px; 
    width: 150px;
    /* background-image: url('/user_img/emulator/Controller.png'); */
}
.touch-controls .touch-dpad::before {
    height: 100%;
    width: 100%;
    display: block;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    content: "";
}
.touch-controls .touch-dpad.touch-down::before {
    background-size: 100% 97%;
    background-position-y: bottom;
}
.touch-controls .touch-dpad.touch-up::before {
    background-size: 100% 97%;
    background-position-y: top;
}
.touch-controls .touch-dpad.touch-right::before {
    background-size: 97% 100%;
    background-position-x: right;
}
.touch-controls .touch-dpad.touch-left::before {
    background-size: 97% 100%;
    background-position-x: left;
}
.touch-controls .touch-dpad.touch-down.touch-left::before,
.touch-controls .touch-dpad.touch-down.touch-right::before,
.touch-controls .touch-dpad.touch-up.touch-left::before,
.touch-controls .touch-dpad.touch-up.touch-right::before {
    background-size: 97% 97%;
}
.touch-controls .touch-dpad #touch-down {
    left: 50%; 
    bottom: 0px; 
    margin-left: -25px; 
    height: 50px; 
    width: 50px;
}
.touch-controls .touch-dpad #touch-right {
    right: 0; 
    top: 50%; 
    margin-top: -25px; 
    height: 50px; 
    width: 50px;
}
.touch-controls .touch-dpad #touch-left {
    left: 0; 
    top: 50%; 
    margin-top: -25px; 
    height: 50px; 
    width: 50px;
}
.touch-controls .touch-dpad #touch-up {
    top: 0;
    left: 50%; 
    margin-left: -25px; 
    height: 50px; 
    width: 50px;
}

#splash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #624D97;
    opacity: 1;
    transition: 0.6s;
}

#splash.invisible {
    opacity: 0;
    visibility: hidden;
}


/* 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;
    } */
/* } */