:root {
    /* --shade: hsl(208, 31%, 81%); default */
    /* shade variable defined in script.js  */
    --glow: hsl(from var(--shade) h s l /0.7);
    --box-bg: hsl(from var(--shade) h s calc(l /8));
    /* chessground/assets/chessground.cburnett.css for pieces img  */
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    overflow: hidden;
    background-color: hsl(from var(--shade) h calc(s /2) calc(l /6));
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Comic Neue', sans-serif;
}

.hidden:not(#nonExistingID#nonExistingID) {
    display: none;
}

#background {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: url("assets/StockCake-Neon_Tech_Pathways-2169742-medium.jpg");
    filter: saturate(20%) opacity(0.4);
    z-index: -1;
}

#back,
#settings,
#themes {
    position: absolute;
    isolation: isolate;
    z-index: 9999;
    /* transition: filter .2s linear; */
}

#back>svg,
#settings>svg,
#themes>svg {
    will-change: filter;
    animation: blink 5s linear infinite;
    animation-play-state: running;
    z-index: 9999;
    position: relative;
    pointer-events: none;
}

#back>svg:hover,
#settings>svg:hover,
#themes>svg:hover {
    animation-play-state: paused;
}

@keyframes blink {
    0% {
        filter: drop-shadow(0 0 20px transparent);
    }

    50% {
        filter: drop-shadow(0 0 20px var(--glow));
    }

    100% {
        filter: drop-shadow(0 0 20px transparent);
    }
}

#back,
#settings {
    top: 5%;
    width: 10vmin;
    height: 10vmin;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    color: var(--shade);
    /* changes svg fill and stroke color  */
    container-type: size;
}

#back {
    /* background-image: url("assets/back.svg"); */
    left: 2%;
    transform: scale(1.5, 1);
    transition: transform .2s linear;
}

#back.blocked {
    cursor: default;
    transform: scale(1, 1.5) rotate(-90deg);
}

#settings {
    right: 2%;
    transform: scale(1.5);
    /* background-image: url("assets/settings.svg"); */
}

#back::before,
#settings::before {
    content: "";
    background-color: var(--box-bg);
    border: 4px solid #333;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    border-top-left-radius: 100cqmax;
    border-top-right-radius: 100cqmax;
    border-bottom-left-radius: 100cqmax;
    border-bottom-right-radius: 100cqmax;
    position: absolute;
    padding: 50cqmax;
    pointer-events: none;
    transition: all .4s ease-out;
    opacity: 0;
}

#back::before {
    transform: scale(1, 1.5);
    left: calc(2% - 4px);
    top: calc(5% - 4px);
}

#back.active::before {
    animation: scaling-right 2s cubic-bezier(0.165, 0.84, 0.44, 1) 1;
}

#back.inactive::before {
    animation: scaling-right 1.5s cubic-bezier(0.165, 0.84, 0.44, 1) 1 reverse;
}

#settings::before {
    right: calc(2% - 5px);
    top: calc(5% - 6px);
}

#settings.active::before {
    animation: scaling-left 2s cubic-bezier(0.165, 0.84, 0.44, 1) 1;
}

#settings.inactive::before {
    animation: scaling-left 1.5s cubic-bezier(0.165, 0.84, 0.44, 1) 1 reverse;
}

#back:hover::before,
#settings:hover::before {
    opacity: 100%;
}

#back.blocked:hover::before {
    opacity: 0;
}

#back.pauseHover:hover::before,
#settings.pauseHover:hover::before {
    opacity: 0;
}

@keyframes scaling-right {
    0% {
        opacity: 100%;
    }

    40% {
        transform: translate(50cqmax, 50cqmax) scale(1, 1.5);
        height: 0%;
        width: 0%;
        border-top-left-radius: 90cqmax;
        border-top-right-radius: 90cqmax;
        border-bottom-left-radius: 90cqmax;
        border-bottom-right-radius: 90cqmax;
    }

    100% {
        transform: translate(50cqmax, 50cqmax) scale(1, 1.5);
        border-radius: 10%;
        height: 8vh;
        width: 8vw;
        border-top-left-radius: 10cqmax;
        border-top-right-radius: 10cqmax;
        border-bottom-left-radius: 10cqmax;
        border-bottom-right-radius: 10cqmax;
        opacity: 100%;
    }
}

@keyframes scaling-left {
    0% {
        opacity: 100%;
    }

    30% {
        transform: translate(-50cqmax, 25cqmax);
        height: 0%;
        width: 0%;
        border-top-left-radius: 90cqmax;
        border-top-right-radius: 90cqmax;
        border-bottom-left-radius: 90cqmax;
        border-bottom-right-radius: 90cqmax;
    }

    100% {
        transform: translate(-50cqmax, 25cqmax);
        border-radius: 10%;
        height: 15vh;
        width: 15vw;
        border-top-left-radius: 10cqmax;
        border-top-right-radius: 10cqmax;
        border-bottom-left-radius: 10cqmax;
        border-bottom-right-radius: 10cqmax;
        opacity: 100%;
    }
}

.box {
    background-color: var(--box-bg);
    border: 4px solid #333;
    cursor: pointer;
    transition: all .8s ease-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    position: absolute;
    border-top-left-radius: 10cqmax;
    border-top-right-radius: 10cqmax;
    border-bottom-left-radius: 10cqmax;
    border-bottom-right-radius: 10cqmax;
    padding: 50cqmax;
    /* box-shadow: 0 0 20px var(--glow); */
    /* display: flex; */
    justify-content: center;
    flex-direction: column;
    z-index: 99;
    align-items: center;
    opacity: 0;
    display: none;
    transition: opacity .5 linear;
}

/* .box:hover {
    border-color: var(--shade);
    box-shadow: 0 0 20px var(--glow);
} */

.box.show {
    opacity: 100%;
    display: flex;
}

#backBox {
    height: 8vh;
    width: 8vw;
    left: calc(2% - 4px);
    top: calc(5% - 4px);
    transform: translate(50cqmax, 50cqmax) scale(1, 1.5);
}

#settingsBox {
    height: 15vh;
    width: 15vw;
    right: calc(2% - 5px);
    top: calc(5% - 6px);
    transform: translate(-50cqmax, 25cqmax);
    gap: 1em;
}

#backBox>div:hover {
    width: 100%;
    color: var(--box-bg);
    background-color: var(--shade);
    border: 1px solid #333;
}

#settingsBox>div:hover:not(#sfxBox),
#settingsBox>div.on {
    width: 80%;
    color: var(--box-bg);
    background-color: var(--shade);
    border: 1px solid #333;
}

#settingsBox>div.on:hover:not(#sfxBox) {
    width: initial;
    color: var(--shade);
    background-color: var(--box-bg);
}

#themes {
    /* background-image: url("assets/theme2.svg"); */
    bottom: 0;
    right: 2%;
    aspect-ratio: 1/1;
    max-height: 30%;
    max-width: 30%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: right;
    cursor: pointer;
}

#colorPicker {
    position: absolute;
    width: 15%;
    /* height: 30%; */
    right: 0%;
    bottom: 15%;
    background-color: var(--shade);
    border: 4px solid #333;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7);
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    transform: rotate(270deg) scale(0);
    transition: all .4s ease-out;
    z-index: 99999;
}

#colorPicker.show {
    transform: rotate(270deg) scale(1);
    bottom: 35%;
}

#game,
#listener {
    padding-top: 10cqh;
    height: 100%;
    box-sizing: border-box;
}

#game {
    float: left;
    width: 49%;
}

#game>div {
    height: 100%;
    width: 100%;
}

#listener {
    float: right;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    margin-right: 10%;
    width: 39%;
}