
/**
Table Of Contents
=======================================
0.0 - General
    0.1 - Base
    0.2 - Control
    0.3 - Forms
1.0 - Lobby
2.0 - Console
3.0 - Popup
*/

/*=====================================
 * 0.0 - Reset
 ====================================*/

/* 0.1 Base Styles ------------------*/

@font-face {
    font-family: BrogueCE;
    src:
        url('./assets/BrogueCE.woff2') format('woff2'),
        url('./assets/BrogueCE.woff') format('woff'),
        url('./assets/BrogueCE.ttf') format('truetype');
}

body {
    margin: 0;
    padding: 0;
    background-color: black;
    font-family: Rubik, "Source Sans Pro", Arial, Helvetica, sans-serif;
    font-size: 110%;
    line-height: 1.3;
    color: #bbbbbb;
    background-color: #101010;
    width: 100vw;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: Fondamento, "Source Sans Pro", Arial, Helvetica, sans-serif;
    color: #db1d1d;
    margin: 0.5em 0 0.3em 0;
}

ul, ol {
    margin: 0.2em 0;
}

li {
    margin: 0.2em 0;
}

a, a:visited {
    color: inherit;
    text-decoration: underline #80addb;
}

a:hover, a:active {
    color: #61b0ff;
}

* {
    scrollbar-color: #263e52 #0f1418;
    word-wrap: break-word;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: #0f1418;
}

::-webkit-scrollbar-thumb {
    background-color: #263e52;
    border-radius: 8px;
    border: 2px solid #0f1418;
}

::-webkit-scrollbar-corner {
    background-color: #0f1418;
}

*::-moz-selection {
    color: white;
    background: #3c58a5;
}

*::selection {
    color: white;
    background: #3c58a5;
}

/* 0.2 Control Styles ---------------*/

.inactive {
    display : none;
}

/* 0.3 Form Styles -------------------*/

label {
    display: inline;
    font-weight: bold;
    font-size: 75%;
}

input {
    display: inline;
    margin-bottom: 0.7em;
    color: white;
    background-color: #406080;
    border: 1px solid #80addb;
    font-family: inherit;
}

input::placeholder {
    color: #80addb;
}

input[type="radio"] {
    display: inline;
}

input[type="checkbox"] {
    vertical-align: middle;
    position: relative;
    bottom: 1px;
}

button {
    display: block;
    color: white;
    background-color: #406080;
    border: 1px solid #80addb;
    font-family: inherit;
}

button:hover {
    border-color: white;
    background-color: #6090c0;
}


th, td {
    padding: 0.1em 0.5em;
    text-align: left;
}

/*=====================================
 * 1.0 Lobby
 *===================================*/

.header {
    margin: 0;
    text-align: center;
    color: #999999;
    background-color: #102030;
}

.lobby-top {
    display: flex;
    flex-direction: row;
    background-color: #202020;
    background-image: url(./assets/corridor.jpg);
    background-position: 50% 10%;
    background-repeat: no-repeat;
    background-size: 100vw 30vw;
    background-attachment: local;
}

.banner-container {
    flex: auto;
    max-width: 70vw;
    margin: auto;
    padding: 1em;
}

.banner {
    display: block;
    width: 100%;
    max-width: 561px;
    margin: auto;
}

.lobby-main {
    display: flex;
    flex-direction: row;
}

.lobby-left {
    flex: none;
    background-color: #102030;
    width: 20vw;
    min-width: 20em;
}

.lobby-right {
    flex: auto;
    min-width: 30em;
}

.loading {
    margin: 3em;
    text-align: center;
}

.auth,
.play,
.about,
.lobby-chat,
.current-games,
.mini-scores,
.last-wins-scores,
.site-news,
.all-scores,
.users-page,
.server-statistics,
.user-statistics {
    margin: 0 1em;
}

.about p, .about ul {
    font-size: 80%;
}

.auth input {
    width: 100%;
}

.auth button {
    float: right;
}

.lobby-chat {
    max-width: 25em;
}

.lobby-chat input {
    width: 100%;
}

.lobby-chat button {
    margin-left: auto;
}

.lobby-chat-messages,
.console-chat-messages {
    list-style-type: none;
    padding: 0;
    margin: 0;
    overflow: auto;
    font-size: 75%;
    border: 1px solid #35485a;
    background-color: #00000060;
}

.lobby-chat-messages {
    height: 15em;
    max-height: 15em;
}

.server-statistics table {
    width: auto;
}

.ac-result {
    font-size: 80%;
}

.highlight {
    color: #ff0000;
}

.with-tooltip {
    display: inline;
}

.with-tooltip:before {
    visibility: hidden;
    content: attr(tooltip);
    position: absolute;
    color: #aaaaaa;
    background-color: #222222;
    border: 1px solid #555555;
    padding: 0 0.3em;
    border-radius: 0.3em;
    transform: translateX(-100%) translate(1.8em, -1.8em);
}

.with-tooltip:hover:before {
    visibility: visible;
}

#current-games-table,
#all-scores-grid,
#mini-scores-grid,
#last-wins-scores-grid,
#user-stats-scores-grid {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}

@media screen and (max-width:50em) {
    .lobby-main {
        flex-direction: column;
    }
    .lobby-right,
    .lobby-left {
        background-color: inherit;
        width: 100%;
        min-width: 100%;
    }
}


/*=====================================
 * 2.0 Console
 *===================================*/

.console-wrapper {
    position : relative;
    overflow : hidden;
    user-select: none;
    outline: none;
    height: 95vh;
}

.console {
    outline: none;
    position : relative;
    overflow : hidden;
    user-select: none;
    outline: none;
}

.console-holder {
    height: calc(100vh - 1.3em);
    margin: 0;
    background-image: url(./assets/marble.jpg);
    background-repeat: repeat;
}

.console.full-height {
    height : 100%;
}

.console-button {
    z-index: 5000;
    opacity: 50%;
    color: white;
    position: fixed;
    bottom: "auto";
    left: 0;
    top: 0;
    width: 4rem;
    height: 4rem;
    font-size: 2rem;
    line-height: 1;
    padding: 1rem;
    border-radius: 0 0 0 0;
    /* The scaling must happen about the TL corner otherwise the subsequent translation is offset by (1 - 1 / scale) * centre-origin / 2 */
    transform-origin: 0% 0%;
    text-align: center;
}

.console-button-dpad {
    z-index: 5000;
    opacity: 50%;
    color: white;
    position: fixed;
    bottom: "auto";
    left: 0;
    top: 0;
    width: auto;
    height: 3rem;
    font-size: 1rem;
    line-height: 1;
    padding: 1rem;
    border-radius: 0 0 0 0;
    /* The scaling must happen about the TL corner otherwise the subsequent translation is offset by (1 - 1 / scale) * centre-origin / 2 */
    transform-origin: 0% 0%;
    text-align: center;
}
/*
.console-button#console-up { bottom: 11rem; left: 1rem; }
.console-button#console-left { bottom: 7rem; }
.console-button#console-down { bottom: 3rem; left: 1rem; }
.console-button#console-right { bottom: 7rem; left: 2rem; }
.console-button#console-centre { bottom: 7rem; left: 1rem; }
.console-button#console-up-left { bottom: 11rem; }
.console-button#console-up-right { bottom: 11rem; left: 2rem; }
.console-button#console-down-left { bottom: 3rem; }
.console-button#console-down-right { bottom: 3rem; left: 2rem; }
.console-button#console-right-right { bottom: 7rem; left: 3rem; }
.console-button#console-up-right-right { bottom: 11rem; left: 3rem; }
.console-button#console-down-right-right { bottom: 3rem; left: 3rem; }
*/
.console-cell {
    font-family: BrogueCE, "Source Code Pro", Monaco, Consolas, Noto Sans, monospace;
    position : absolute;
    overflow: visible;
    text-align: center;
    cursor: default;
    line-height: 1;
}

.console-chat {
    visibility: hidden;
    display: none;
    word-wrap: break-word;
    height: 100%;
}

.console-chat-inner {
    height: 100%;
    padding: 1em 0.5em 0.5em 0.5em;
    width: 25vw;
    max-width: 25em;
}

.console-chat form {
    width: 100%;
    margin: 0 auto;
}

.console-chat input {
    width: 100%;
}

.console-chat button {
    float: right;
    clear: left;
}

.console-chat-buttons {
    position: absolute;
    z-index: 5000;
    right: 1em;
    top: 2em;
}

.console-chat-messages {
    height: calc(100% - 10em);
    width: 100%;
    margin-top: 3em;
}

@media screen and (min-width: 700px) {

    .console-chat {
        float: right;
        visibility: inherit;
        display: inherit;
    }
}

/*=====================================
 * 3.0 Popup
 *===================================*/

.popup {
    position: fixed;
    z-index: 2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 2em;
    border: 1px solid white;
    background-color: #102030;
}

.popup .close {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(30%, -30%);
    border: 1px solid white;
    background-color: black;
    color: white;
    width: 1em;
    height: 1em;
    line-height: 1;
    font-size: 1.5em;
    text-align: center;
    vertical-align: middle;
    font-weight: bold;
    cursor: pointer;
}

.seed-popup {
    display: block;
}

.popup-overlay {
    position: fixed;
    z-index: 1;
    top:0;
    right: 0;
    left:0;
    bottom:0;
}

.popup button {
    float: right;
}
