html, body {
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
}
body {
    display: flex;
    justify-content: center;
    background-color: #3F2820;
    background-image: linear-gradient(to bottom, #3F2820, #271813);
}
* {
    box-sizing: border-box;
    font-family: "Rubik Dirt", "Open Sans", "sans-serif";
    color: #b18c69CC;
    text-shadow: 0 0 4px #000, 1px 1px 4px #3F2820, -1px -1px 4px #3F2820;
    font-weight: 100;
    user-select: none;
}
#gameWrap {
    width: 125vh;
    height: 100vh;
    box-shadow: 0 0 50px #000;
}
#game {
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    background-image: url(./media/wood.png);
    background-size: cover;
    overflow-x: hidden;
}
#titleBar {
    height: 10%;
    flex-basis: 100%;
}
h1 {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1vh;
    color: #fff;
    text-align: center;
    font-size: 6vh;
    background-color: rgba(0, 0, 0, 0.5);
    user-select: none;
}
#sideBar {
    height: 90vh;
    flex-grow: 1;
    flex-shrink: 1;
    background-color: rgba(0, 0, 0, 0.5);
    position: relative;
}

#orderContainer {
    position: absolute;
    bottom: 30%;
    left: 25%;
    right: 25%;
    aspect-ratio: 1 / 1;
    background-image: url(./media/wood.png);
    background-size: 200%;
    box-shadow: 0 0 10px #000;
    /* display: flex; */
    display: none;
    flex-wrap: wrap;
}
.orderSquare {
    width: 50%;
    aspect-ratio: 1 / 1;
}
.orderSquare:nth-child(1), .orderSquare:nth-child(4) {
    background-color: rgba(0, 0, 0, 0.5);
}
.orderPiece {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-image: url(./media/BISH.png);
    background-size: contain;
    background-position: center center;
    user-select: none;
}

h2 {
    padding: 1vh;
    padding-top: 3vh;
    margin: 0;
    width: 100%;
    color: #fff;
    font-size: 5vh;
    text-align: center;
}
h3 {
    margin: 0;
    padding: 0;
    color: #fff;
    width: 100%;
    text-align: center;
    font-size: 4.5vh;
}
#menu {
    width: 100%;
    height: 20%;
    display: flex;
    position: absolute;
    bottom: 0;
    right: 0;
}
#buttonTray {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    width: 75%;
}
button {
    padding: 1vh;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    font-size: 3vh;
    cursor: pointer;
    transition: 0.125s;
}
button:hover {
    box-shadow: 0 0 10px #fff inset, 0 0 30px #fff;
}
#settings, #volume {
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    transition: 0.125s;
}
#settings>div, #volume>div {
    width: 50%;
    aspect-ratio: 1 / 1;
    background-image: url(./media/settings.svg);
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    filter: opacity(75%);
    transition: 0.5s;
    transition-timing-function: ease-in-out;
    border-radius: 100%;
}
#settings:hover, #volume:hover {
    box-shadow: 0 0 10px #fff inset, 0 0 30px #fff;
}
#settings:hover>div {
    transform: rotate(30deg);
}
#volume>.sound { background-image: url(./media/sound.svg); }
#volume>.muted { background-image: url(./media/mute.svg); }
#grid {
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    aspect-ratio: 1 / 1;
    height: 90vh;
    background-size: contain;
    overflow: hidden;
}
.row {
    flex-grow: 1;
    display: flex;
}
.row:nth-child(odd)>.square:nth-child(odd),
.row:nth-child(even)>.square:nth-child(even) {
    background-color: rgba(210, 210, 210, 0);
}
.row:nth-child(even)>.square:nth-child(odd),
.row:nth-child(odd)>.square:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.5);
}
.square {
    width: 12.5%;
    aspect-ratio: 1 / 1;
    position: relative;
    transition: 0.125s;
}
.glowHover .square:hover {
    box-shadow: 0 0 10px #fff inset, 0 0 30px #fff;
}
.square.active {
    box-shadow: unset;
}
.piece {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: contain;
    background-position: center center;
    user-select: none;
    cursor: pointer;
    position: absolute;
    z-index: 1;
}
.piece.white {
    filter: invert(0);
}
.piece.black {
    filter: invert(1);
}
.glow {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: contain;
    background-position: center center;
    user-select: none;
    position: absolute;
    transition: 0.125s;
    filter: opacity(0);
    animation: pulse 1s ease-in-out 0s infinite;
}

.checking {
    box-shadow: 0 0 30px #f00 inset;
    animation: checking 1s ease-in-out infinite;
}
.checking:hover {
    box-shadow: 0 0 30px #f00 inset, 0 0 10px #fff;
    animation: checkingHover 1s ease-in-out infinite;
}
[class*=" check-"] .piece>p {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 6vh;
    content: "10";
    color: white;
    font-weight: 100;
    border-radius: 100%;
    filter: invert(1);
    opacity: 0%;
    transition: 1s;
}
[class^="square check-"]:hover .piece>p {
    opacity: 100%;
}
[class^="square check-"] .glow { filter: blur(5px) sepia(200000%) hue-rotate(10deg) saturate(200000%); }
.square.check-2 .glow { filter: blur(5px) sepia(200000%) hue-rotate(6deg) saturate(20000%); }
.square.check-3 .glow, .square.red .glow { filter: blur(5px) sepia(200000%) hue-rotate(0deg) saturate(200000%); }
.square.check-3 .glow { animation: warning 1s ease-in-out 0s infinite; }
.square.check-3 .piece { animation: flash 1s ease-in-out 0s infinite; }
.square.pink .glow { filter: blur(5px) sepia(200000%) hue-rotate(270deg) saturate(200000%); }
.square.white .glow { filter: blur(10px) brightness(100000%); animation: pulseWhite 1s ease-in-out 0s infinite; }
.square.party .glow { animation: partyTime 2s ease-in-out 0s infinite; }
.flyingBack {
    transition: 0.25s;
    top: 0 !important;
    left: 0 !important;
}

.num, .let {
    position: absolute;
    top: 2%;
    left: 2%;
    font-family: "Rubik Dirt", "Open Sans", "sans-serif";
    color: #b18c69CC;
    text-shadow: 0 0 4px #000, 1px 1px 4px #3F2820, -1px -1px 4px #3F2820;
}
.let {
    top: unset;
    left: unset;
    bottom: 2%;
    right: 5%;
}
#modalBkg.visible {
    top: 0;
    bottom: 0;
}
#modalContent.visible {
    top: 25%;
    transition: 0.5s;
}
#modalBkg {
    position: fixed;
    top: -200vh;
    bottom: 200vh;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.5);
    filter: blur(10px);
    z-index: 1000;
    transition: 0.5s;
    cursor: pointer;
}
#modalContent {
    position: fixed;
    top: -125vh;
    left: 25%;
    width: 50vw;
    height: 50vh;
    background-image: url(./media/wood.png);
    background-position: center center;
    background-size: cover;
    box-shadow: 0 0 5px #000;
    z-index: 1000;
    transition: 0.25s;
}
#modalContent.how-to-play {
    top: 0;
    bottom: unset;
    height: 100vh;
    background-image: linear-gradient(to bottom, #3F2820, #271813);
    background-attachment: local;
    overflow-y: scroll;
}
#modalContent.how-to-play div {
    height: unset;
}
#modalInstructions { display: none; }
#modalInstructions p, #modalInstructions h5 {
    padding: 4vh;
    color: #fff;
    font-size: 3vh;
    user-select: text;
    text-align: justify;
}
#modalInstructions p {
    font-family: "Open Sans", sans-serif;
    font-size: 3.5vh;
}
::selection {
    background-color: rgba(255, 255, 255, 0.5);
}
#modalInstructions li {
    list-style-position: inside;
}
#modalInstructions li::marker, #modalInstructions h5 {
    color: #fff;
    font-size: 3vh;
    display: inline;
}
#modalTitle { background-color: rgba(0, 0, 0, 0.5); height: 20%; }
#modalSubtitle {
    margin: 0;
    margin-bottom: 2vh;
    padding-left: 1vh;
    padding-right: 1vh;
    font-size: 4vh;
    text-align: center;
    color: #fff;
    font-weight: lighter;
    text-shadow: 0 0 20px #000 inset;
}
#modalContent>div {
    height: 80%;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 20%;
}
[id^="modalData"] {
    display: none;
    width: 75%;
    font-size: 3vh;
    background-color: rgba(0, 0, 0, 0.5);
    border: 0.5vh rgba(0, 0, 0, 0.5) inset;
    margin-bottom: 2vh;
    color: #fff;
}
[id^="modalData"]:focus {
    box-shadow: 0 0 1px #fff inset, 0 0 30px #fff;
}
option { color: #fff; }
#modalBtn {
    height: 5.5vh;
    width: 100%;
    position: relative;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    font-size: 3vh;
    color: #fff;
}
#modalContent h6 {
    display: none;
    padding: 1vh;
    margin: 0;
    font-size: 5vh;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 10px #000;
}

#about {
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
}
#about>button {
    color: #AAA;
    text-align: right;
    background-color: transparent;
    font-size: 2vh;
    transition: 0.25s;
    text-decoration: underline;
    text-decoration-color: #AAA0;
}
#about>button:hover {
    box-shadow: none;
    text-decoration: underline;
    text-decoration-color: #AAAF;
}
#menuHamburger {
    display: none;
}
@media screen and (max-width: 1011px) {
    #game {
        display: block;
        flex-direction: row;
        height: 100vh;
        width: 100vw;
        background: #3F2820;
    }
    #titleBar {
        display: none;
    }
    h1 {
        font-size: 2.5vh;
    }
    #sideBar {
        height: 10vh;
        width: 100%;
        display: flex;
        box-shadow: 0 0 10px #000;
        z-index: 999;
    }
    #readoutTray {
        flex-basis: 40%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
    }
    #sideBar h2, #sideBar h3 {
        padding: 0;
        padding-left: 0.5vh;
        display: flex;
    }
    #sideBar h2 {
        font-size: 2vh;
        flex-basis: 60%;
    }
    #sideBar h3 {
        font-size: 1.5vh;
        flex-basis: 40%;
    }
    #menuHamburger {
        height: 10vh;
        width: 10vh;
        background-position: center center;
        background-size: 60%;
        background-repeat: no-repeat;
        background-image: url(./media/menu.svg);
        cursor: pointer;
        transition: 0.5s;
        position: fixed;
        display: block;
        opacity: 100%;
        top: 0;
        right: 0;
        z-index: 998;
        box-shadow: 0 0 15px #000;
    }
    #menuHamburger:hover {
        background-color: rgba(0, 0, 0, 0.5);
    }
    #menu.clicked #menuHamburger {
        background-image: url(./media/close.svg);
        background-color: #130C09;
        box-shadow: none;
    }
    #menu {
        height: 10vh;
        width: 90%;
        position: fixed;
        right: 10vh;
        top: -15vh;
        z-index: 997;
        display: flex;
        background-color: #271813;
        transition: 1s;
        box-shadow: 0 0 15px #000;
    }
    #menu.clicked {
        top: 0;
    }
    #menu>* {
        height: 10vh;
    }
    #buttonTray {
        height: 10vh;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: 1fr;
        flex-basis: 60%;
    }
    #about {
        position: relative;
        flex-direction: row;
        flex-basis: 50%;
        justify-content: space-around;
        background-color: rgba(0, 0, 0, 0.5);
    }
    #about button { text-align: center; }

    #volume, #settings { width: 15vh; }

    #grid {
        max-height: 100vw;
        background-image: url(./media/wood.png);
        box-shadow: 0 0 50px #000;
    }
    .num, .let {
        font-size: 2vw;
    }
    #modalContent {
        left: 12.5%;
        width: 75%;
    }
    #orderContainer {
        position: fixed;
        height: 8vh;
        top: 1vh;
        left: 50%;
        transform: translate(-50%, 0);
    }
}
@media screen and (max-width: 800px) {
    #readoutTray {
        flex-wrap: wrap;
    }
    #sideBar h2 {
        font-size: 2vh;
        flex-basis: 60%;
    }
    #sideBar h3 {
        font-size: 1.5vh;
        flex-basis: 40%;
    }
    #modalContent {
        left: 0;
        width: 100%;
    }
    #grid {
        position: fixed;
        top: 10vh;
        transition: 1s;
    }
    #sideBar:has(#menu.clicked)+#grid {
        top: -100%;
    }
    #menu {
        top: -100vh;
        right: 0;
        width: 100vw;
        height: 90vh;
        background-color: #130C09;
    }
    #menu * {
        background-color: transparent;
    }
    #menu.clicked {
        top: 10vh;
        flex-wrap: wrap;
    }
    #menu.clicked #buttonTray {
        height: 70%;
        flex-basis: 100%;
    }
    #menu.clicked #buttonTray {
        position: relative;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(3, 1fr);
    }
    #settings, #volume {
        width: 25%;
    }
    #menu #about {
        bottom: 100vh;
        transition: 1s;
    }
    #menu.clicked #about {
        height: 10vh;
        width: 100vw;
        position: fixed;
        top: unset;
        bottom: 0;
        right: 0;
    }
}