/* Setup */
:root {
    margin: 0;
    padding: 0;
    --vertical-margin: 15px;
    --white-eval-percentage: 50%;
    font: 1rem monospace ;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
}

body {
    background-color: #414141;
}

.hide {
    display: none;
}

/* Container */
.container {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    height: 100%;
    padding-left: 10vw;
    width: 90vw;
}

/* Board */
.board-container {
    display: flex;
    width: calc(100vh - (var(--vertical-margin) * 2));
    position: relative;
    margin: var(--vertical-margin) 0;
}

.board {
    border-radius: 5px;
    background-color: #fff;
}

/* Eval */
.eval {
    background-color: inherit;
    height: 100%;
    position: absolute;
    right: 0;
    transform: translate(30px);
    width: 20px;
    border-radius: 5px;
    overflow: hidden;
}

.black-eval {
    width: 100%;
    background-color: #222;
    height: calc(100% - var(--white-eval-percentage));
    transition: height ease-in-out 500ms;
}

.white-eval {
    width: 100%;
    background-color: #eee;
    height: var(--white-eval-percentage);
    transition: height ease-in-out 500ms;
}

/* Game Sidebar */
.game-sidebar {
    background-color: #333;
    border-radius: 5px;
    position: relative;
    width: 20vw;
    margin-top: var(--vertical-margin);
    margin-bottom: var(--vertical-margin);
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    margin-left: 40px;
}

.module-selector {
    display: flex;
    flex-wrap: wrap;
    width: 92%;
    margin: 5px 4%;
}

/* Module selector buttons */
.module-selector>button {
    flex: 1 1 auto;
    padding: 0.5em;
    background-color: #555;
    border-style: solid;
    color: #ccc;
    font: inherit;
    border-color: #333;
    border-radius: 5px;
}

.module-selector>button:hover {
    background-color: #494949;
    border-color: #2d2d2d;
}

.module-selector>button:active {
    background-color: #444;
    border-color: #222;
}

/* Modules */

.module {
    width: 92%;
    margin: 5px 4%;
    background-color: #4a4a4a;
    flex-grow: 1;
    border-radius: 3px;
    overflow-y: scroll;
}

.module::-webkit-scrollbar {
    display: none;
}

.module-title {
    color: #ddd;
    text-align: center;
}

/* Move list */
.move-list-columns {
    display: flex;
    flex-direction: row;
    margin: 0px 3px;
}

.move-column {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 50%;
    height: 100%;
}

.move {
    color: #ddd;
    background-color: #333;
    padding: 5px;
    margin: 3px 1px;
}

/* New Game */

button.new-game {
    padding: 0.5em;
    background-color: #555;
    border-style: solid;
    color: #ccc;
    font: inherit;
    border-color: #333;
    border-radius: 5px;
    width: 96%;
    margin: 0 2%;
}

button.new-game:hover {
    background-color: #494949;
    border-color: #2d2d2d;
}

button.new-game:active {
    background-color: #444;
    border-color: #222;
}

button.square-button {
    width: 3rem;
    height: 3rem;
    border-radius: 5px;
    border: #aaa solid 2px;
}

button.square-button:hover {
    border: #666 solid 2px;
}

button.square-button:active {
    border: #555 solid 3px;
}
button.square-button.selected {
    border-width: 5px;
    border-color: #3e6eb6;
}

button.square-button.white {
    background-color: #fff;
}
button.square-button.random {
    background-image: -webkit-gradient(linear, left bottom, right bottom, color-stop(0.5, white), color-stop(0.51, black));
}
button.square-button.black {
    background-color: #000;
}

/* Board Maker */

.fen-display {
    overflow-x: scroll;
    margin: 3px;
    background: #797979;
    padding: 3px;
    border-radius: 3px;
    border: black 1px solid;
}

.fen-display::-webkit-scrollbar {
    display: none;
}

.fen-display span {
    user-select: all;
    white-space: nowrap;
}

.board-maker-radio-container {
    clear: both;
    display: block;
    margin: 3px;
}

.board-maker-radio {
    position: absolute;
    left: -9999em;
    top: -9999em;
}

.board-maker-radio + label {
    float: left;
    padding: 0.25em 0.5em;
    cursor: pointer;
    border: 1px solid #414141;
    margin-right: -1px;
    color: #fff;
    background-color: #5a5a5a;
}

.board-maker-radio + label:first-of-type {
    border-radius: 0.4em 0 0 0.4em;
}

.board-maker-radio + label:last-of-type {
    border-radius: 0 0.4em 0.4em 0;
}

.board-maker-radio:checked + label {
    background-color: #4f4f4f;
}

.special-button {
    border-radius: 0.4em;
    padding: 0.25em 0.5em;
    cursor: pointer;
    border: 1px solid #414141;
    margin: 3px;
    color: #fff;
    background-color: #5a5a5a;
}

/* Modal */

.blackout {
    z-index: 1010;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: none;
}

.blackout.visible {
    display: block;
}

.modal {
    z-index: 1011;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    border: #444 solid 2px;
    background-color: #ccc;
    border-radius: 10px;
    opacity: 0;
    pointer-events: none;
    transition: all ease-in-out 0.3s;
}

.modal.visible {
    opacity: 1;
    pointer-events: all;
}

.modal-title {
    font-size: 2.5rem;
}

/* Settings */

.settings-top {
    border-bottom: #000 solid 1px;
    margin: 0;
    padding: 10px;
}
.settings-modal {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.settings-body {
    flex: 1 1 auto;
    padding: 10px;
    max-height: 60vh;
    overflow-y: overlay;
}

.settings-close {
    background-color: #f66;
    width: 3em;
    height: 3em;
    border-radius: 5px;
    padding: 10px;
    float: right;
}
.settings-close:hover {
    cursor: pointer;
}

.settings-group-label {
    display: block;
    font-size: 1.5rem;

}

.settings-group {
    margin-left: 1.5rem;
}

.setting {
    display: block;
}

.setting label {
    font-size: 1rem;
}

.pickr {
    display: inline;
}

/* Sidebar */
.sidebar {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 10vw;
    height: 100%;
    flex-direction: column;
    background-color: #2e2e2e;
}

.sidebar > a {
    border: 2px solid #222;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: #333;
    border-radius: 3px;
    margin: 3px;
    padding: 10px 0;
}

.sidebar > a .tooltip {
    visibility: hidden;
    background-color: black;
    color: #fff;
    text-align: center;
    padding: 5px 10px;
    border-radius: 6px;
    
    /* Position the tooltip text - see examples below! */
    position: absolute;
    top: -5px;
    left: 105%;
}

.sidebar > a:hover .tooltip {
    visibility: visible;
}

.sidebar>span {
    color: #fff;
    margin: 5px;
    font-weight: bold;
    font-size: x-large;
}

.sidebar>span::after {
    content: "";
    width: 98%;
    display: block;
    border: 1px solid #ddd;
    margin: 10px 1%;
}

.sidebar h3 {
    color: #fff;
    margin: 5px 0px 10px 3px;
    font-size: 35px;
}

.sidebar button {
    border: 2px solid #222;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background-color: rgb(94, 94, 94);
    border-radius: 3px;
    margin: 3px;
    padding: 10px 0;
    cursor: pointer;
    font-family: monospace;
}

.sidebar button:hover {
    border-color: #666;
}

.sidebar button:active {
    border-width: 3px;
    border-color: #444;
}

.sidebar .bottom {
    margin-top: auto;
    margin-bottom: 6px;
}