* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
}

#fields {
    position: absolute;
    border: solid 1px #000;
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    display: grid;
    animation-timing-function: cubic-bezier(.5,-0.2,.5,1.2);
    animation-fill-mode: forwards;
    animation-duration: 3s;
    --umdrehung: 0;
    background-image: url("wood2.jpg");
    background-size: cover;
    box-shadow: 20px 20px 30px #000, -20px -20px 30px #000;
    padding: 15px;
}

.field {
    width: 5rem;
    height: 5rem;
    transform: scale(0);
    transition: transform 1s;
    box-shadow: 1px 1px 7px #000, -1px -1px 7px #222;
    font-family: serif;
}

.field:hover {
    box-shadow: inset 1px 1px 10px #333, inset -1px -1px 10px #333;
}

.blackField {
    background: linear-gradient(-45deg, #B38728, #dcd575, #B38728);
    color: #000;
}

.field[data-marker="1"]:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30%;
    height: 30%;
    transform: translate(-50%, -50%);
    background: #0a0;
    opacity: 0.7;
    border-radius: 50%;
    cursor: pointer;
}

.field[data-marker="2"]:after, .field[data-marker="6"]:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,0,0,0.4);
    cursor: pointer;
    box-shadow: inset 5px 5px 0 #f00, inset -5px -5px 0 #f00;
}

.field[data-marker="3"]:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    box-shadow: inset 7px 7px 0 #0f0, inset -7px -7px 0 #0f0;
}

.field[data-marker="4"]:after, .field[data-marker="5"]:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30%;
    height: 30%;
    border: solid 0.4rem #0f0;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    border-radius: 50%;
    cursor: pointer;
}

.field[data-marker="6"]:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30%;
    height: 30%;
    border: solid 0.4rem #f00;
    transform: translate(-50%, -50%);
    opacity: 0.7;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.field[data-marker="1"] {
    cursor: pointer;
}

.field[data-marker="4"] {
    cursor: pointer;
}

.whiteField {
    background: linear-gradient(-45deg, #ddd, #fff, #ddd);
    color: #000;
}

.rotateField {
    transform: rotate(180deg);
}

@keyframes rotateField {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(calc(180deg * var(--umdrehung)));
    }
}

#background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("wood3.jpg");
    background-size: cover;
    overflow: hidden;
}

.figur {
    cursor: pointer;
    user-select: none;
    font-size: 4em;
    text-align: center;
    align-items: center;
    justify-content: center;
    vertical-align: center;
    display: flex;
    width: 100%;
    height: 100%;
}

#schachBanner {
    position: absolute;
    width: 100%;
    height: 15rem;
    text-align: center;
    justify-content: center;
    align-items: center;
    font-size: 60px;
    color: #eee;
    background-color: rgba(0,0,0,0.9);
    transform: translateY(-50%);
    display: none;
    top: 50%;
    left: -100%;
    animation: schach 2s;
    animation-timing-function: cubic-bezier(.5,-0.3,.5,1.3);
}

#schachmattBanner {
    position: absolute;
    width: 100%;
    height: 15rem;
    text-align: center;
    justify-content: center;
    font-size: 60px;
    color: #e00;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    transform: translateY(-50%);
    top: 50%;
    display: none;
    animation: schachmatt 4s forwards;
}

#schachmattBanner button {
    font-family: serif;
    font-size: 30px;
    background-color: transparent;
    color: #eee;
    border: none;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
}

#schachmattBanner button:hover {
    background-color: rgba(255,255,255,0.2);
}

@keyframes schach {
    0% {
        left: -100%;
    }

    20% {
        left: 0;
    }

    80% {
        left: 0;
    }

    100% {
        left: 100%;
    }
}

@keyframes schachmatt {
    0% {
        transform: translateY(-50%) scale(10);
        top: 50%;
    }

    10% {
        transform: translateY(-50%) scale(1);
        top: 50%;
    }

    50% {
        transform: translateY(-50%);
        top: 50%;
        height: 15rem;
        font-size: 60px;
    }

    70% {
        transform: translateY(0);
        top: 0;
        height: 7rem;
        font-size: 25px;
    }

    100% {
        transform: translateY(0);
        top: 0;
        height: 7rem;
        font-size: 25px;
    }
}

.cheatButton {
    position: absolute;
    width: 50%;
    height: 50%;
}

#cheatButtonWhiteLeft {
    left: 0;
}

#cheatButtonWhiteRight {
    right: 0;
}

#cheatButtonBlackLeft {
    left: 0;
}

#cheatButtonBlackRight {
    right: 0;
}

#chooseFigure {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.9);
    width: 100%;
    text-align: center;
    display: none;
    justify-content: center;
    padding: 3rem 0;
    left: -100%;
    animation: chooseFig 1s forwards;
    animation-timing-function: cubic-bezier(.5,-0.3,.5,1.3);
}

.chooseFigureElm {
    position: relative;
    width: 7rem;
    height: 7rem;
    margin: 1rem;
    cursor: pointer;
    transition: 100ms;
    text-align: center;
    font-size: 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(-45deg, #ddd, #fff, #ddd);
    color: #000;
}

.chooseFigureElm:hover {
    transform: scale(1.05);
}

@keyframes chooseFig {
    0% {
        left: -100%;
    }

    100% {
        left: 0;
    }
}
