@font-face {
    font-family: 'Roboto Condensed';
    src: url(../fonts/roboto-condensed-regular.woff);
}
    
@font-face {
    font-family: 'Roboto Condensed';
    src: url(../fonts/roboto-condensed-bold.woff);
    font-weight: bold;
}
    
:root {
    --board-size: 85vmin;
    --gray: #aaaaaa;
}

body {
    font-family: 'Roboto Condensed', sans-serif;
    cursor: default;
    transition: opacity 2s ease;
    margin: 0;
    opacity: 0;
}

#outer {
    display: table;
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
}

#middle {
    display: table-cell;
    vertical-align: middle;
}

#inner {
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-weight: bold;
    text-align: center;
    color: var(--gray);
    font-size: calc(var(--board-size) / 3.85);
    margin-top: -10px;
    margin-bottom: 8px;
}

.reset {
    position: relative;
    width: calc(var(--board-size) / 10);
    height: calc(var(--board-size) / 10);
    cursor: pointer;
    margin: auto;
    margin-bottom: 12px;
}

.reset::after {
    content: '';
    position: absolute;
    left: calc(var(--board-size) / 10 * -0.4);
    right: calc(var(--board-size) / 10 * -0.4);
    top: calc(var(--board-size) / 10 * -0.3);
    bottom: calc(var(--board-size) / 10 * -0.2);
}

.crown {
    position: absolute;
    width: 100%;
    height: auto;
    opacity: 1;
    top: 0;
    left: 0;
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.board {
    display: grid;
    position: relative;
    grid-template-columns: repeat(8, 1fr);
    width: calc(var(--board-size));
    height: calc(var(--board-size));
    border: 10px solid var(--gray);
    border-radius: 7px;
    padding: 2px;
    margin: auto;
}

.square {
    display: grid;
    place-items: center;
    width: var(--board-size) / 8;
    height: var(--board-size) / 8;
    background-color: white;
}

.square:nth-child(16n + 2),
.square:nth-child(16n + 4),
.square:nth-child(16n + 6),
.square:nth-child(16n + 8),
.square:nth-child(16n + 9),
.square:nth-child(16n + 11),
.square:nth-child(16n + 13),
.square:nth-child(16n + 15) {
    background: var(--gray);
}

.place, .piece, .piece > div {
    width: calc(var(--board-size) / 8 * 0.7);
    height: calc(var(--board-size) / 8 * 0.7);
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 50%;
}

.piece, .piece > div {
    display: grid;
    position: absolute;
    place-items: center;
    opacity: 1;
    cursor: pointer;
    transition: opacity 0.3s ease-in-out;
}

.piece::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    left: calc(var(--board-size) / 8 * -0.3);
    right: calc(var(--board-size) / 8 * -0.3);
    top: calc(var(--board-size) / 8 * -0.3);
    bottom: calc(var(--board-size) / 8 * -0.3);
}

img {
    width: calc(var(--board-size) / 8 * 0.5);
    height: calc(var(--board-size) / 8 * 0.5);
    opacity: 0;
}

.king img {
    transition: opacity 0.2s ease-in-out;
    opacity: 1;
}

.white > div {
    background: white;
    border: 1px solid var(--gray);
}

.black > div {
    background: black;
}

.disappear {
    opacity: 0;
}

.removed {
    display: none;
}

.selected {
    background: repeating-linear-gradient(-45deg,var(--gray),var(--gray) 1.5px,white 1.5px,white 3px) !important;
}

.move {
    z-index: 100;
    transition: all 0.5s ease-in-out;
}

.move-m {
    z-index: 100;
}

.return {
    transition: all 0.2s ease-in-out !important;
}

.settle {
    transition: all 0.2s ease-in-out;
}

@keyframes zoom {

    0% {
    transform: scale(1.0);
    }

    100% {
    transform: scale(1.2);
    }
}

.zoom > div {
    animation: zoom 0.25s 2 linear forwards alternate;
}

@keyframes zoom-crown {

    0% {
    transform: scale(1.0);
    }

    100% {
    transform: scale(2.0);
    }
}

.origin {
    transform-origin: 50% 75%;
}

.zoom-crown {
    transform: scale(2.0);
}

.zoom-crown.crown-gray {
    opacity: 0 !important;
}

@keyframes blink {

    0% {
    opacity: 1; 
    }

    50% {
    opacity: 0.3;
    } 

    100% {
    opacity: 1; 
    } 
}

.blink {
    animation: blink 0.2s ease-in-out forwards;
}

#designed {
    text-align: center;
    position: relative;
    align-self: auto;
    color: white;
    font-size: 9px; 
    margin-top: -12px;
}

@media (prefers-color-scheme: dark) {

    body, .square {
        background-color: black;
    }

    .white > div {
        background-color: white;
    }

    .black > div {
        background-color: black;
        border: 1px solid var(--gray);
    }

    .selected {
        background: repeating-linear-gradient(-45deg,var(--gray),var(--gray) 1.5px,black 1.5px,black 3px) !important;
    }

    #designed {
        color: black;
    }
}

@media (orientation: landscape) and (max-height: 460px) {

    h1 {
        display: none;
    }
}

@media (min-width: 460px) and (min-height: 460px) {

    :root {
        --board-size-big: 400px;
    }

    h1 {
        font-size: 105px;
    }

    .reset {
        width: calc(var(--board-size-big) / 10);
        height: calc(var(--board-size-big) / 10);  
    }

    .reset::after {
        left: calc(var(--board-size-big) / 10 * -0.3);
        right: calc(var(--board-size-big) / 10 * -0.3);
        top: calc(var(--board-size-big) / 10 * -0.3);
        bottom: calc(var(--board-size-big) / 10 * -0.2);
    }

    .board {
        width: var(--board-size-big);
        height: var(--board-size-big);
        border: 15px solid var(--gray);
    }

    .square {
        width: calc(var(--board-size-big) / 8);
        height: calc(var(--board-size-big) / 8);
    } 

    .place, .piece, .piece > div {
        width: calc(var(--board-size-big) / 8 * 0.7);
        height: calc(var(--board-size-big) / 8 * 0.7);
    }

    .piece::after {
        left: calc(var(--board-size-big) / 8 * -0.3);
        right: calc(var(--board-size-big) / 8 * -0.3);
        top: calc(var(--board-size-big) / 8 * -0.3);
        bottom: calc(var(--board-size-big) / 8 * -0.3);
    }
    
    img {
        width: calc(var(--board-size-big) / 8 * 0.5);
        height: calc(var(--board-size-big) / 8 * 0.5);
    }

    #designed {
        font-size: 12.8px; 
        margin-top: -16.9px;
    }
}

.noselect {
    -webkit-tap-highlight-color: transparent;
          -webkit-touch-callout: none;
            -webkit-user-select: none; 
               -moz-user-select: none; 
                -ms-user-select: none; 
                    user-select: none; 
}