html, body {
    box-sizing:border-box;
    margin:0;
    padding:0;
    display:flex;
    flex-wrap:wrap;
    align-items:space-between;
    justify-content:center;
    width:100vw;
    height:100vh;
    height: calc(var(--vh, 1vh) * 100);
    background-color:greenyellow;
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
    overscroll-behavior: contain;
}
#menu-bar {
    width:100%;
    height:max-content;
    z-index:5;
    padding:15px 10px;
    box-sizing:border-box;
    margin:0;
    display:flex;
    align-items:baseline;
    background-color:white;
    flex-wrap:wrap;
    box-shadow:rgba(0, 0, 0, 0.12) 2px 2px 14px 0px;
    user-select:none;
}
#menu-bar h2 {
    font-size:22px;
    margin:0 15px 0 0;
    padding:0;
    cursor:pointer;
    font-weight:normal;
}
#menu-bar a {
    text-decoration:none;
    color:initial;
}
#menu-bar h2:hover {
    font-weight:bold;
}
#menu-bar h2.active {
    border-bottom: 2px solid greenyellow;
    font-weight:bold;
}
#score-menu {
    margin-left:auto;
    display: flex;
    align-items: center;
    height: 100%;
}
.menu-info {
    background-color:greenyellow;
    padding:7px 16px;
    font-weight:500;
    border-radius:3px;
    margin:0;
    font-size:22px;
    display:flex;
    align-items:center;
    margin-left:20px;
}
@keyframes rotation {
0% {
    -webkit-transform: rotateY(0deg);
            transform: rotateY(0deg); }
40% {
    -webkit-transform: rotateY(180deg);
            transform: rotateY(180deg); }
100% {
    -webkit-transform: rotateY(360deg);
            transform: rotateY(360deg); } 
}
.menu-info img {
    height:20px;
    width:20px;
    margin-right:5px;
}
#difficulty:hover, #menu-restart:hover, #difficulty-list > p:hover {
    opacity:0.6;
    cursor:pointer;
    transform:scale(1.03);
    transition:0.1s ease-in;
}
#difficulty-list {
    position:absolute;
    display:none;
    z-index:101;
    background-color:white;
    padding:0 5px;
    margin:0;
    box-shadow:rgba(0, 0, 0, 0.12) 2px 2px 14px 0px;
    user-select: none;
}
#difficulty-list > p {
    margin-left:0;
    margin:10px 5px;
    cursor:pointer;
}

#grid-container {
    width:100%;
    height:85%;
    padding:10px;
    display:grid;
    box-sizing:border-box;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(5, 1fr);
    grid-gap: 10px;
    z-index:2;
    grid-auto-flow:row dense;
    /* transform: rotate(180deg); */
}
.grid-item {
    transition: opacity 0.6s ease-in-out, transform 0.3s ease-in-out; 
    cursor:pointer;
    border:1px dotted white;
    z-index: 5;
    position:relative;
}
.grid-item:hover {
    opacity:0.7;
    transform:scale(1.05) translateX(-3px);
    box-shadow:
    1px 1px #fff,
    2px 2px #fff,
    3px 3px #fff;
/* transform: translateX(-3px); */

}

.one {
    background-color:red;
}
.two {
    background-color:blue;
}
.three {
    background-color:yellow;
}
.four {
    background-color:white;
}
.five {
    background-color:black;
}
.six {
    background-color:violet;
}
.seven {
    background-color:mediumseagreen;
}
.eight {
    background-color:orange;
}
.nine {
    background-color:purple;
}

.dragItem {
    cursor:pointer;
    position:absolute;
    left:100px;
    top:100px;
    transition:0.3s;
    transition-property: transform;
    transform:scale(0.8) translateX(3px);
    z-index:10;
    border-radius:50%;
    box-shadow:
    1px 1px #fff,
    2px 2px #fff,
    3px 3px #fff;
}

#score {
    z-index:-1;
    position:absolute;
    bottom:50px;
    right:50px;
    font-size:40px;
    z-index:15;
    background-color:white;
    padding:10px 20px;
    font-weight:bold;
    box-shadow:rgba(0, 0, 0, 0.12) 2px 2px 14px 0px;
    opacity:0;
}
#level {
    z-index:-1;
    position:absolute;
    bottom:50px;
    left:50px;
    font-size:40px;
    z-index:15;
    background-color:white;
    padding:10px 20px;
    font-weight:bold;
    box-shadow:rgba(0, 0, 0, 0.12) 2px 2px 14px 0px;
    opacity:0;
}
#modal-window, #modal-window-instructions {
    position: fixed;
    background-color: rgba(255, 255, 255, 0.5);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    opacity: 1;
    transition: all 0.3s; 
    justify-content:center;
    align-items:center;
    display:flex;
}
#modal-window {
    display:none;
}
#restart-modal, #instructions-modal {
    /* width: 50%; */
    padding: 30px;
    margin:20px;
    background-color:#fafafa;
    box-sizing:border-box;
    box-shadow: 0 5px 10px rgba(154,160,185,.05), 0 15px 40px rgba(166,173,201,.2);
    display:flex;
    flex-direction:column;
    align-items:center;
}
#restart-modal h2, #instructions-modal h2, #instructions-modal h1 {
    text-align:center;
}
#instructions-modal h2 {
    font-weight:normal;
    margin-top:0;
}
.losing-block {
    width:22px;
    height:22px;
    position:relative;
    top: 3px;
    display:inline-block;
}

#restart-modal button, #instructions-modal button {
    outline:none;
    font-size:24px;
    font-weight:500;
    padding:7px 16px;
    border-radius:3px;
    background-color:greenyellow;
    border:none;
    cursor:pointer;
    display:flex;
    align-items:center;
    user-select:none;
    margin-bottom:10px;
}
#restart-modal button:hover, #instructions-modal button:hover {
    opacity:0.6;
    transform:scale(1.03);
    transition:0.1s ease-in;
}
#restart-modal button:hover > img, #menu-restart:hover > img { 
    transform:rotate(180deg);
    transition:0.1s ease-in;
}
#restart-modal button img {
    width:22px;
    height:22px;
    margin-right:8px;
}
#instructions-modal button img {
    width:26px;
    height:26px;
    margin-right:4px;
    transform:translateX(-2px);
}
#high-score {
    margin-top:10px;
    text-align:center;
}

/* Mobile queries */
@media (max-width: 875px) {
    #menu-bar {
        justify-content:space-evenly;
        padding:8px;
    }
    #live-score {
        display:none;
    }
    #score-menu {
        flex-wrap:wrap;
        justify-content:space-evenly;
        margin-left:0;
    }
    .menu-info, #menu-bar h2 {
        font-size:20px;
    }
}

/* Mobile Portrait mode */
@media (max-width: 500px) {
    #score-menu {
        width:100%;
    }
    #menu-bar p {
        margin-top:5px;
    }
    .menu-info {
        margin-left:0;
    }
}

/* Mobile Landscape for Small Phones TEST */
@media (orientation: landscape) and (max-width:580px) {
    .menu-info, #menu-bar h2, #instructions-modal h2, #instructions-modal button {
        font-size:19px;
    }
    #instructions-modal {
        padding: 10px 20px;
    }
    #instructions-modal h1 {
        margin:15px 0;
    }
}
@media (orientation: portrait) and (max-height:580px) {
    #instructions-modal {
        padding: 10px 20px;
    }
}