/*-----------------*
 *----- Games -----*
 *-----------------*/

@import url('/_css/reset.css');

/*----- Global Overrides -----*/
*, * :before, * :after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/*----- Fonts -----*/
@font-face {
    font-family: "Open Sans";
    src: url('/fonts/OpenSans-Regular.ttf') format("truetype");
}

@font-face {
    font-family: "Open Sans";
    font-weight: bold;
    src: url('/fonts/OpenSans-Bold.ttf') format("truetype");
}

body {
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    color: #333;
    background-color: #e5e5e5;
    overflow: hidden;
}

body,
body * {
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
}

a {
    color: #333;
    text-decoration: none;
}

a:active,
a:focus {
    color: #fff;
    background-color: #4f2d7f;
}

strong {
    font-weight: bold;
}

strong.large {
    font-size: 1.5em;
}

:focus {
    outline: #4f2d7f solid 6px;
    outline-offset: 0;
    z-index: 90;
    /*z-index: 1000;*/
}

.hidden,
.unsupported {
    display: none !important;
}

header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 10vh;
    background-color: #fff;
    box-shadow: 0 0 .5em rgba(0, 0, 0, 0.5);
    z-index: 1;
}

header title {
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    padding: .4em;
    color: #333;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
}

header go-home-instructions {
    left: initial;
    right: 0;
    width: 50%;
}

header go-home-instructions home-icon {
    position: absolute;
    left: 0;
    right: initial;
    top: 0;
    height: 100%;
    width: 25%;
    background: transparent url('../_images/How_to_get_home_games.png') no-repeat 5%/auto 70%;
}

header go-home-instructions home-text-wrapper {
    position: absolute;
    left: 0;
    right: initial;
    top: 0;
    height: 100%;
    width: 25%;
    display: table;
    margin-left: 4.5em;
}

header go-home-instructions p {
    display: table-cell;
    vertical-align: middle;
    font-size: 1.1em;
}

header a.exitFullscreen,
header a.enterFullscreen {
    position: absolute;
    top: 0;
    right: 0;
    margin: .8em;
    border: 1px solid #333;
    padding: .6em;
    font-weight: 700;
    font-size: 1.1em;
    z-index: 2;
}

header a.returnToList {
    position: absolute;
    top: 0;
    left: 0;
    margin: .8em;
    border: 1px solid #333;
    padding: .6em;
    font-weight: 700;
    font-size: 1.1em;
    z-index: 2;
}

:-webkit-full-screen,
:fullscreen {
    /* TODO: is this necessary? */
}

game {
    position: absolute;
    top: 10vh;
    right: 0;
    bottom: 0;
    left: 12vw;
    background-color: #000;
}

container {
    position: absolute;
    top: 10vh;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
}

container.no_scroll {
    overflow: hidden;
}

container.gameplay {
    right: initial;
    width: 12vw;
}

nav {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 12vh;
    width: 100%;
    background: #fff;
    box-shadow: 0 0 .5em rgba(0, 0, 0, 0.5);
    z-index: 5;
}

container.gameplay nav {
    width: 12vw;
    height: 10vh;
}

nav a {
    position: absolute;
    width: 50%;
    height: 100%;
    top: 0;
}

nav a.disabled {
    opacity: .3;
}

nav a.down {
    left: 0;
    background: transparent url('../_images/btn_arrow_down.png') no-repeat 50%/auto 70%;
}

nav a.up {
    right: 0;
    background: transparent url('../_images/btn_arrow_up.png') no-repeat 50%/auto 70%;
}

nav a.down:hover,
nav a.down:active,
nav a.down:focus {
    background: #4f2d7f url('../_images/btn_arrow_down_ffffff.png') no-repeat 50%/auto 70%;
    outline: 0;
}

nav a.up:hover,
nav a.up:active,
nav a.up:focus {
    background: #4f2d7f url('../_images/btn_arrow_up_ffffff.png') no-repeat 50%/auto 70%;
    outline: 0;
}

nav a.down.disabled:hover {
    background: transparent url('../_images/btn_arrow_down.png') no-repeat 50%/auto 70%;
}

nav a.up.disabled:hover {
    background: transparent url('../_images/btn_arrow_up.png') no-repeat 50%/auto 70%;
}

container.gameplay nav a.down,
container.gameplay nav a.up,
container.gameplay nav a.down.disabled,
container.gameplay nav a.up.disabled {
    -webkit-background-size: auto 50%;
    background-size: auto 50%;
}

#description-play {
    background: transparent url('../_images/play_game_unselected@2x.png') no-repeat 1vw/auto 2vw;
}

#description-close {
    background: transparent url('../_images/cancel_unselected@2x.png') no-repeat 1vw/auto 2vw;
}

modal-button-box a span {
    /*position: relative;*/
    /*display: inline-block;*/
    /*width: 6vw;*/
    /*vertical-align: middle;*/
    /*padding-bottom: 3vh;*/
    padding-left: 5vw;
}

.description-button:hover,
.description-button:focus,
.description-button:active {
    background-color: #4f2d7f;
    color: #fff;
}

.description-button:hover #description-play,
.description-button:focus #description-play,
.description-button:active #description-play,
#description-play:hover,
#description-play:active,
#description-play:focus {
    background: #4f2d7f url('../_images/play_game_selected@2x.png') no-repeat 1vw/auto 2vw;
    color: #fff;
}

.description-button:hover #description-close,
.description-button:focus #description-close,
.description-button:active #description-close,
#description-close:hover,
#description-close:active,
#description-close:focus {
    background: #4f2d7f url('../_images/cancel_selected@2x.png') no-repeat 1vw/auto 2vw;
    color: #fff;
}

games-list {
    display: block;
    display: -webkit-flex;
    -webkit-flex-direction: row;
    -webkit-flex-wrap: wrap;
    -webkit-justify-content: center;
    -webkit-align-items: center;
    -webkit-align-content: center;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    align-content: center;
    background: #f1f1f1;
    margin-bottom: 12vh;
    padding: 2em;
}

container.gameplay games-list {
    padding: 0;
}

games-list .game {
    position: relative;
    display: inline-block;
    flex: 0 1 auto;
    width: 15vw;
    height: 17vw;
    margin: 1vw 2vw;
    /*border: 2px solid #ccc;*/
    box-shadow: 0 2px 0 0 rgba(0, 0, 0, .2);
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: 1.3em;
    line-height: 1.3;
}

games-list .game:hover,
games-list .game:active,
games-list .game:focus {
    border-color: #4f2d7f;
    z-index: 0;
}

container.gameplay games-list .game {
    width: 10vw;
    height: 10vw;
    margin: 1vh 1vw 1vh;
    font-size: 1.1em;
}

games-list .game img {
    position: relative;
    width: 100%;
}

games-list .game h1 {
    position: absolute;
    width: 100%;
    left: 0;
    bottom: 0;
    padding: .2em;
    line-height: 1.3;
    text-align: center;
    background: #fff;
}

games-list .game:hover h1,
games-list .game:active h1,
games-list .game:focus h1 {
    background-color: #4f2d7f;
    color: #fff;
}

modal-welcome {
    position: fixed;
    width: 100%;
    height: 100%;
    /*z-index: 100;*/
    z-index: 50;
}

modal-background {
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .75);
    z-index: 100;
    /*z-index: 10;*/
}

#description-modal-content {
    width: 80vw;
    overflow: auto;
}

modal-content {
    position: fixed;
    width: 80%;
    top: 50%;
    height: fit-content;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    background-color: #fff;
    z-index: 100;
    /*z-index: 20;*/
    text-align: center;
}

modal-content h1 {
    font-size: 2.5em;
    font-weight: bold;
    text-align: center;
    padding: .5em;
    border-bottom: 1px solid #ccc;
    margin: 0 0 .5em;
}

description-wrapper .game-image {
    margin-top: 1.5vh;
    width: 20vw;
    height: 20vw;
    position: relative;
}

description-text-img {
    width: 70vw;
    display: block;
}

game-img-box {
    width: 22vw;
    height: 22vw;
    box-shadow: 1px 1px 1px 1px rgba(0, 0, 0, .2);
    /* float: left; */
    display: inline-block;
    vertical-align: bottom;
    margin: 0 1em;
}

description-text {
    display: inline-block;
    width: 40vw;
}

description-text h3 {
    /*text-align: left;*/
    margin-left: 1vw;
    border-bottom: 2px solid #ccc;
    padding-bottom: .5em;
    font-size: xx-large;
    font-weight: bold;
}

modal-content intro-message {
    display: block;
    padding: 0 1.5em;
    margin: 1em;
}

modal-content intro-message intro-message-content {
    display: block;
    text-align: left;
    margin-top: 1em;
}

modal-content intro-message intro-message-content img {
    display: inline-block;
    width: 7em;
    vertical-align: middle;
}

modal-content intro-message intro-message-content p {
    display: inline-block;
    padding: 0 0 1em;
    line-height: 1.3;
    font-size: 1.2em;
    margin-left: 1em;
    margin-top: 1.5em;
    width: 80%;
    vertical-align: middle;
}

description-wrapper {
    /* text-align: center; */
    display: inline-block;
    padding: 1.5em;
    /*width: 70vw;*/
}

modal-content description-wrapper p {
    /* width: 20vw; */
    height: 17vw;
    margin-top: 1em;
    /* float: left; */
    line-height: 1.3;
    text-align: left;
    font-size: 1.2em;
    padding-left: 2vh;
}

modal-content a.modal-close {
    display: block;
    padding: 1em;
    font-weight: bold;
    font-size: 2em;
    width: 70%;
    position: relative;
    text-align: center;
    margin: 0 auto 1em;
    background-color: #fff;
    color: #333;
    border: 2px solid #333;
}

modal-button-box {
    display: inline-block;
    /* text-align: center; */
    width: 70vw;
    margin: 3vw 2vw;
    height: 20%;
    padding-top: 1vh;
}

.description-button {
    display: inline-block;
    /* height: 100%; */
    padding: 1vw 1.5vw;
    font-size: 2em;
    margin: 0 4vw;
    width: 25vw;
    background-color: #fff;
    color: #333;
    border: 2px solid #333;
    /* text-align: center; */
    /* vertical-align: middle; */
}

modal-content a.modal-close:active,
modal-content a.modal-close:focus {
    color: #fff;
    border-color: #4f2d7f;
    background-color: #4f2d7f;
}

/*----- Testing -----*/

#output {
    position: relative;
    display: block;
    font-size: 1em;
}

#output span {
    padding: 0 .2em;
}

#focuser a {
    font-weight: 700;
    text-decoration: none;
}

#focuser a:active,
#focuser a:focus {
    background-color: #000;
    color: #fff;
}

/*----- Widescreen -----*/
@media screen
and (min-width: 1600px)
and (min-height: 648px)
and (min-aspect-ratio: 16/10) {
    body {
        font-size: 24px;
    }
}

/*----- iPad in landscape -----*/
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: landscape) {
    body {
        font-size: 16px;
    }

    games-list {
        margin: 0;
    }

    games-list .game {
        margin: 1vw;
    }

    modal-content intro-image {
        height: 15vh;
        width: 20vh;
    }

    header go-home-instructions {
        margin: .5em;
    }

    html[dir="rtl"] #header-debug-div,
    body[dir="rtl"] #header-debug-div {
        right: 0;
    }

    html[dir="rtl"] header go-home-instructions,
    body[dir="rtl"] header go-home-instructions {
        position: absolute;
        left: 0;
        right: initial;
    }

    html[dir="rtl"] header go-home-instructions home-icon,
    body[dir="rtl"] header go-home-instructions home-icon {
        position: fixed;
        left: 0;
        right: initial;
        top: 0;
        height: 10%;
        width: 10%;
        background: transparent url('../_images/How_to_get_home_games.png') no-repeat 10%/auto 70%;
    }

    html[dir="rtl"] header go-home-instructions home-text-wrapper,
    body[dir="rtl"] header go-home-instructions home-text-wrapper {
        position: absolute;
        left: 0;
        right: initial;
        top: 0;
        height: 100%;
        width: 30%;
        display: table;
        margin-left: 4em;
        padding-bottom: 1em;
    }
}

/*----- iPad in landscape -----*/
@media only screen
and (min-device-width: 768px)
and (max-device-width: 1024px)
and (orientation: portrait) {
    body {
        font-size: 16px;
    }

    header {
        height: 6vh;
    }

    container {
        top: 6vh;
    }

    container.gameplay games-list .game {
        font-size: 1em;
        margin: .5vh 1vw;
    }

    game {
        top: 6vh;
    }

    modal-content intro-image {
        height: 15vh;
        width: 20vh;
    }

    header go-home-instructions {
        margin: .5em;
    }

    html[dir="rtl"] #header-debug-div,
    body[dir="rtl"] #header-debug-div {
        right: 0;
    }

    html[dir="rtl"] header go-home-instructions,
    body[dir="rtl"] header go-home-instructions {
        position: absolute;
        left: 0;
        right: initial;
    }

    html[dir="rtl"] header go-home-instructions home-icon,
    body[dir="rtl"] header go-home-instructions home-icon {
        position: fixed;
        left: 1vw;
        right: initial;
        top: 0;
        height: 6%;
        width: 6%;
        background: transparent url('../_images/How_to_get_home_games.png') no-repeat 5%/auto 70%;
    }

    html[dir="rtl"] header go-home-instructions home-text-wrapper,
    body[dir="rtl"] header go-home-instructions home-text-wrapper {
        position: absolute;
        left: 0;
        right: initial;
        top: 0;
        height: 100%;
        width: 30%;
        display: table;
        margin-left: 4em;
        padding-bottom: 1em;
    }
}

/*----- iPhone 6, 7, 8 in portrait -----*/
@media only screen
and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: portrait) {
    body {
        font-size: 16px;
    }

    header {
        height: 5vh;
    }

    header title {
        font-size: 3em;
        padding: .5em;
    }

    header a.returnToList {
        font-size: 1.6em;
    }

    container {
        top: 5vh;
    }

    modal-content intro-image {
        width: 100%;
        margin: 0 0 2em;
        clear: both;
        float: none;
    }

    modal-content logo.getwellnetwork {
        height: 6vh;
    }

    modal-content a.modal-close {
        font-size: 3em;
    }

    games-list {
        margin: 0;
    }

    games-list .game {
        width: 18vw;
        height: 20vw;
    }

    container.gameplay games-list .game {
        font-size: .8em;
        margin: .5vh 1vw;
    }

    game {
        top: 5vh;
    }
}

/*----- iPhone 6, 7, 8 in landscape -----*/
@media only screen
and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape) {
    body {
        font-size: 16px;
    }
}

/*----- iPhone 6 Plus, 7 Plus, 8 Plus in portrait -----*/
@media only screen
and (min-device-width: 414px)
and (max-device-width: 736px)
and (orientation: portrait) {
    body {
        font-size: 16px;
    }

    header {
        height: 5vh;
    }

    header title {
        font-size: 3em;
        padding: .5em;
    }

    header a.returnToList {
        font-size: 1.6em;
    }

    container {
        top: 5vh;
    }

    modal-content intro-image {
        width: 100%;
        margin: 0 0 2em;
        clear: both;
        float: none;
    }

    modal-content logo.getwellnetwork {
        height: 6vh;
    }

    modal-content a.modal-close {
        font-size: 3em;
    }

    games-list {
        margin: 0;
    }

    games-list .game {
        width: 18vw;
        height: 20vw;
    }

    container.gameplay games-list .game {
        font-size: .8em;
        margin: .5vh 1vw;
    }

    game {
        top: 5vh;
    }
}

/*----- iPhone 6 Plus, 7 Plus, 8 Plus in landscape -----*/
@media only screen
and (min-device-width: 414px)
and (max-device-width: 736px)
and (orientation: landscape) {
    body {
        font-size: 16px;
    }
}

/*----- iPhone X in portrait -----*/
@media only screen
and (min-device-width: 375px)
and (max-device-width: 812px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: portrait) {
    body {
        font-size: 16px;
    }

    header {
        height: 5vh;
    }

    header title {
        font-size: 3em;
        padding: .5em;
    }

    header a.returnToList {
        font-size: 1.6em;
    }

    container {
        top: 5vh;
    }

    modal-content intro-image {
        width: 100%;
        margin: 0 0 2em;
        clear: both;
        float: none;
    }

    modal-content logo.getwellnetwork {
        height: 6vh;
    }

    modal-content a.modal-close {
        font-size: 3em;
    }

    games-list {
        margin: 0;
    }

    games-list .game {
        width: 18vw;
        height: 20vw;
    }

    container.gameplay games-list .game {
        font-size: .8em;
        margin: .5vh 1vw;
    }

    game {
        top: 5vh;
    }
}

/*----- iPhone X in landscape -----*/
@media only screen
and (min-device-width: 375px)
and (max-device-width: 812px)
and (-webkit-device-pixel-ratio: 3)
and (orientation: landscape) {
    body {
        font-size: 16px;
    }
}

/*----- iPhone in portrait -----*/
@media only screen
and (min-resolution: 2dppx)
and (orientation: portrait) {
    header go-home-instructions {
        margin: .5em;
    }
}

/*----- iPhone in landscape -----*/
@media only screen
and (min-resolution: 2dppx)
and (orientation: landscape) {
    header go-home-instructions {
        margin: .5em;
    }

    html[dir="rtl"] #header-debug-div,
    body[dir="rtl"] #header-debug-div {
        right: 0;
    }
}

/*----- Right-to-Left Overrides -----*/

