* {
    box-sizing: border-box;
}

html, body, .page-container, canvas {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: Montserrat, serif;
}

body {
    background-color: black;
}

.page-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(#1c0168, orange, violet);
}

.game-container {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    width: 1150px;
    height: 750px;
    min-width: 1150px;
    min-height: 750px;
    margin-top: 100px;
    background-size: 100px;
    background-repeat: repeat;
    background-color: #83abd7;
    border: 10px solid #7070d5;
}

.game-container.rotated {
    transform: rotate(-90deg);
    width: 85vh;
    min-width: 85vh;
    height: 57vh;
    min-height: 57vh;
}

.game-container.rotated.black {
    transform: rotate(90deg);
}

.game-container .block {
    position: relative;
    display: flex;
    width: calc(100% / 12);
    height: calc(100% / 8);
    color: rgba(255,255,255,0.3);
    box-shadow: 0 0 10px #1f404d inset;
    background-size: contain;
    color: transparent;
}

.game-container.rotated .block {
    transform: rotate(90deg);
}

.game-container.rotated.black .block {
    transform: rotate(-90deg);
}

.block[data-y="2"]:nth-child(2n+1), .block[data-y="4"]:nth-child(2n+1), .block[data-y="6"]:nth-child(2n+1), .block[data-y="8"]:nth-child(2n+1) {
    background-color: #b5dff0;
    box-shadow: 0 0 10px #fff inset;
}

.block[data-y="1"]:nth-child(2n+2), .block[data-y="3"]:nth-child(2n+2), .block[data-y="5"]:nth-child(2n+2), .block[data-y="7"]:nth-child(2n+2) {
     background-color: #b5dff0;
     box-shadow: 0 0 10px #fff inset;
}


.game-container .block.piece {
    box-shadow: 0 0 10px white inset;
    cursor: pointer;
}

.game-container .block.piece::before {
    position: absolute;
    content: '';
    z-index: 1;
    top: -4px;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    filter: drop-shadow(rgba(0, 0, 0, 0.4) 5px 5px 4px);
}

.game-container .block.piece.selected {
    background-color: #73ddc9;
}

.game-container .block.piece.winner {
    background-color: #73ddc9;
    text-decoration: underline;
}

.game-container .block.last-move {
    background-color: #ffb300;
}

.game-container .block.last-move-2 {
    background: radial-gradient(yellow, #ff3c00);
    border: 3px solid yellow;
}

.game-container .block.lava {
    background-image: url('../images/lava.gif');
}

.game-container .block.water {
    background-image: url('../images/water.gif');
}

.game-container .block.rock {
    background-image: url('../images/rock.png');
    border-bottom: 20px solid rgba(0, 0, 0, 0.24);
    box-shadow: none;
}

.game-container .block.grass {
    background-image: url('../images/grass.gif');
    filter: brightness(140%) saturate(120%);
    background-size: 200%;
}

.game-container .block.grass::before {
    filter: brightness(70%);
}

.game-container .block.white-rook::before {
    background-image: url('../images/pieces/white-rook.png');
}
.game-container .block.white-knight::before  {
    background-image: url('../images/pieces/white-knight.png');
}
.game-container .block.white-bishop::before  {
    background-image: url('../images/pieces/white-bishop.png');
}
.game-container .block.white-king::before {
    background-image: url('../images/pieces/white-king.png');
}

.game-container .block.black-rook::before  {
    background-image: url('../images/pieces/black-rook.png');
}
.game-container .block.black-knight::before  {
    background-image: url('../images/pieces/black-knight.png');
}
.game-container .block.black-bishop::before  {
    background-image: url('../images/pieces/black-bishop.png');
}
.game-container .block.black-king::before  {
    background-image: url('../images/pieces/black-king.png');
}

.ui-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 80px;
}

.ui-container label {
    position: absolute;
    color: white;
    font-size: 30px;
    text-shadow: 0 0 3px #00000082, -1px -1px 1px #00000047, 1px 1px 1px #000000ba;
}

.ui-container label.game-info {
    left: calc(50% - 300px);
    top: 30px;
    width: 600px;
    text-align: center;
}

.ui-container label.player1-name {
    left: 40px;
    top: 30px;
}

.ui-container label.player2-name {
    right: 40px;
    top: 30px;
}

.ui-container label.selected {
    color: #5ef25e;
}

.ui-container p.message {
    display: none;
    position: absolute;
    bottom: 20px;
    left: calc(50% - 300px);
    width: 600px;
    height: 110px;
    padding: 20px;
    font-size: 25px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px rgba(255, 255, 255, 0.5) solid;
    border-radius: 5px;
    color: white;
}

/***** LOADING *****/
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.3);
    z-index: 9999999;
}

#animationWindow {
    width: 200px;
    height: 200px;
}

/***** POPUP *****/

.message-popup {
    position: absolute;
    z-index: 9999;
    width: 100%;
    padding: 20px;
    left: 0;
    top: 0;
    text-align: center;
    background-color: rgb(56, 65, 83);
    color: white;
    box-shadow: 0 0 10px rgba(86, 197, 240, 0.5);
    font-size: 25px;
    font-weight: bold;
}

.message-popup:empty {
    display: none;
}

@media only screen and (max-width: 600px) {
    .page-container {
        align-items: flex-start;
        padding-top: 30vh;
    }

    .game-container {
        width: 100vw;
        min-width: 0;
        height: 70vw;
        min-height: 0;
    }

    .game-container.rotated {
        width: calc(90vw * 1.53);
        min-width: calc(90vw * 1.53);
        height: 90vw;
        min-height: 90vw;
        margin: 0;
    }

    .game-container .block {
        border-bottom: 3px solid black;
    }

    .ui-container label {
        font-size: 16px;
    }

    .ui-container label.game-info {
        top: 70px;
    }
}



@media only screen and (orientation: landscape) {

}