* {
    margin: 0;
    box-sizing: border-box;
    font-family: 'Lato', sans-serif;
}

body {
    height: 100svh;
    width: 100vw;
    overflow-x: hidden;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    background-image: url("../assets/simon-background.svg");
    background-repeat: no-repeat;
    background-size: cover;
    background-color: rgb(198, 0, 105);
    color: white;
    font-size: 1rem;
}

header,
nav {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.primary-logo {
    margin-left: 3vmin;
    margin-top: 1vmin;
    font-size: 5rem;
    font-weight: 400;
}

.mobile-nav-toggle {
    display: none;
}

.primary-navigation {
    display: flex;
    flex-direction: row;
    margin-top: 1vmin;
    padding-block: 2rem;
    padding-inline: 3rem;
    gap: 4rem;
    background: hsl(0 0% 0%/ 0.79);
    list-style: none;
    font-weight: 300;
}

.primary-navigation a {
    color: white;
    text-decoration: none;
}

.primary-navigation a:hover {
    font-weight: 700;
    cursor: pointer;
}

.primary-navigation a > [aria-hidden = "true"] {
    font-weight: 700;
    margin-inline-end: 0.75rem;
}

.popup-container {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    position: absolute;
    top: 25%;
    right: 25%;
    z-index: 9000;
    height: 25rem;
    width: 50vw;
    background: hsl(0 0% 0%/ 0.79);
}

.close-popup {
    width: 2rem;
    border: 2px solid white;
    border-radius: 100%;
}

.close-popup:hover {
    cursor: pointer;
    outline: white solid 1px;
}

.reset-game-link {
    pointer-events: none;
}

h2 {
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 400;
    font-size: 2.5rem;
    text-decoration: underline;
}

p {
    font-size: 1rem;
}

ol li {
    margin-bottom: 1rem;
}

.high-score-div > button {
    width: auto;
    position: relative;
    top: 5rem;
    border: 2px solid red; 
    border-radius: 25px;
    background: hsl(0 0% 100%/ 0.75);
    backdrop-filter: blur(1rem);
    color: red;
    font-size: 1rem;
}

.high-score-div > button:hover {
    border: 2px solid red;
    font-weight: 700;
    cursor: pointer;
    transform: scale(0.95);
    transition: transform 25ms ease-in;
}

.sfx-controls-div > p {
    display: flex;
    justify-content: center;
}

.toggle {
    opacity: 0;
    position: absolute;
    left: -9000px;
    top: -9000px;
    cursor: pointer;
}

.toggle + label {
    margin-top: 1rem;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle + label::before {
    content: "";
    width: 2.5em;
    height: 1em;
    background-color: rgba(251, 251, 251, 0.5);
    border-radius: 1em;
    margin-right: 0.5em;
}

.toggle + label::after {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    content: "\2713";
    color:rgba(251, 251, 251, 0.95);
    left: 0.1em;
    width: 0.9em;
    height: 0.9em;
    background-color: rgba(16, 139, 3, 0.5);
    border-radius: 1em;
    transition: transform 200ms ease-in-out;
}

.toggle:checked + label::after {
    content: "\2715";
    transform: translateX(150%);
    background-color: rgba(252, 2, 2, 0.5);
}

.slider {
    margin-right: 0.5em;
}

.volume {
    display: flex;
    align-items: center;
    justify-content: center;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.message-container {
    margin-top: 12vmin;
    width: 100%;
    height: 6rem;
}

.message {
    position: relative;
    text-align: center;
    font-size: 1.5em;
    font-weight: 200;
}

.message:before {
    content: "";
    position: absolute;
    top: 0;
    left: 25%;
    width: 50%;
    height: 100%;
    background-color: rgba(251, 251, 251, 0.153);
    filter: blur(15px);
    border-radius: 100%;
    z-index: -1;
}

.button-container {
    height: 6rem;
    width: 10rem;
}

.start-button,
.level-button,
.reset-button {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 4rem;
    width: 10rem;
    border: 1px solid white; 
    border-radius: 10px;
    background: none;
    color: white;
}

.start-button::before,
.level-button::before,
.reset-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsl(0 0% 100%/ 0.1);
    border-radius: 10%;
    z-index: -1;
}

.start-button:hover,
.level-button:hover,
.reset-button:hover  {
    border: 2px solid white;
    font-weight: 700;
    cursor: pointer;
    transform: scale(0.95);
    transition: transform 25ms ease-in;
}

.keyboard-container {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 63%;
}

.keyboard-row-1,
.keyboard-row-2,
.keyboard-row-3 {
    margin-bottom: .5rem;
    gap: .5rem;
}

.keyboard-row-2 {
    margin-right: 3rem;
}

.keyboard-row-3 {
    margin-right: 9rem;
}

.keyboard-container > div > div {
    height: 5rem;
    width: 5rem;
    border: 3px solid white;
    border-radius: 7px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.keyboard-container > div > div::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: hsl(0 0% 100%/ 0.1);
    border-radius: 10%;
    z-index: -1;
}

.keyboard-container > div > div:hover {
    border: 4px solid white;
    font-weight: 700;
    cursor: pointer;
    transform: scale(0.95);
    transition: transform 25ms ease-in;
}

.active {
    border: 4px solid white;
    font-weight: 700;
    cursor: pointer;
    transform: scale(0.95);
    transition: transform 25ms ease-in;
}

.hidden {
    display: none
}

.locked {
    pointer-events: none;
}

.flex-ctr {
    display: flex;
    justify-content: center;
    align-items: center;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

:focus {
    box-shadow: 
    0 0 0 5px rgba(184, 0, 96, .7);
}

input[type="checkbox"].toggle:focus + label::before { 
    box-shadow: 
    0 0 0 5px rgba(184, 0, 96, .7);
}

.close-popup:focus {
    box-shadow: 
    0 0 0 5px rgba(184, 0, 96, .7);
} 

@supports (backdrop-filter: blur(1rem)) {
    .primary-navigation,
    .popup-container,
    .keyboard-container > div > div::before,
    .start-button::before,
    .level-button::before,
    .reset-button::before {
        backdrop-filter: blur(1rem);
        background: hsl(0 0% 100%/ 0.1);
    }
}

@media (max-width: 640px) {
    .primary-logo {
        font-size: 4rem;
        font-weight: 600;
        margin-left: .5rem;
    }

    .primary-navigation {
        gap: 2em;
        position: fixed;
        z-index: 1000;
        inset: 0 0 0 40%;
        flex-direction: column;
        padding: min(35vh, 8rem) 2em;
        transform: translateX(100%);
        transition: transform 350ms ease-out;
    }

    .primary-navigation[data-visible="true"] {
        transform: translateX(0%);
    }

    .mobile-nav-toggle {
        display: block;
        position: absolute;
        z-index: 9999;
        background-color: transparent;
        background-image: url("../assets/icon-hamburger.svg");
        background-repeat: no-repeat;
        width: 2rem;
        border: 0;
        aspect-ratio: 1;
        top: 1.5rem;
        right: 1.5rem;
    }

    .mobile-nav-toggle[aria-expanded="true"] {
        background-image: url("../assets/icon-close.svg");
    }

    .popup-container {
        top: 25%;
        right: 0;
        height: 80vmin;
        width: 100vmin;
    }

    .message-container {
        margin-top: 20vmin;
    }

    .message {
        font-size: 1.7rem;
    }

    .button-container {
        height: 5rem;
        width: 20rem;
    }
    
    .start-button,
    .level-button,
    .reset-button {
        height: 3rem;
        width: 20rem;
    }

    .keyboard-container {
        top: 55%;
    }

    .keyboard-container > div > div {
        height: 6rem;
        width: 2.1rem;
    }

    .keyboard-row-1,
    .keyboard-row-2,
    .keyboard-row-3 {
        margin-bottom: .3rem;
        gap: .3rem;
    }

    .keyboard-row-2 {
        margin-right: 1rem;
    }

    .keyboard-row-3 {
        margin-right: 3rem;
    }
}

@media (min-width: 640px) and (max-width: 768px) {
    .primary-logo {
        margin-top: 1rem;
        margin-left: 1rem;
        font-size: 2.5rem;
    }

    .primary-navigation {
        padding-block: 1rem;
        padding-inline: 2rem;
        gap: 2rem;
        font-size: .8rem;
    }

    .primary-navigation a > [aria-hidden = "true"] {
        display: none;
    }

    .popup-container {
        top: 30%;
        right: 0;
        height: 50vmin;
        width: 100vmin;
    }

    .high-score-div > button {
        top: 4rem;
    }

    .message-container {
        margin-top: 19vmin;
    }

    .message {
        font-size: 1.7rem;
    }

    .button-container {
        height: 5rem;
        width: 10rem;
    }
    
    .start-button,
    .level-button,
    .reset-button {
        height: 4rem;
        width: 8rem;
    }

    .keyboard-container {
        top: 63%
    }

    .keyboard-container > div > div {
        height: 5rem;
        width: 3.5rem;
    }

    .keyboard-row-1,
    .keyboard-row-2,
    .keyboard-row-3 {
        margin-bottom: .5rem;
        gap: .5rem;
    }

    .keyboard-row-2 {
        margin-right: 1rem;
    }

    .keyboard-row-3 {
        margin-right: 5rem;
    }
}

@media (min-width: 768px) and (max-width: 900px) {
    .primary-logo {
        margin-top: .5rem;
        font-size: 3rem;
        width: 10rem;
    }

    .primary-navigation {
        margin-bottom: 1rem;
        padding-block: 2rem;
        padding-inline: 2.5rem;
        gap: 2.5rem;
    }

    .primary-navigation a > [aria-hidden = "true"] {
        display: none;
    }

    .popup-container {
        top: 25%;
        right: 15%;
        height: 50vmin;
        width: 70vmin;
    }

    .keyboard-container {
        top: 68%;
    }

    .keyboard-container > div > div {
        height: 4rem;
        width: 4rem;
    }
}

@media  (min-width: 900px) and (max-width: 1160px) {
    .primary-logo {
        margin-top: 1rem;
        font-size: 3.5rem;
    }

    .primary-navigation {
        padding-block: 1.5rem;
        padding-inline: 1.5rem;
        gap: 1.5rem;
    }

    .popup-container {
        top: 25%;
        right: 25%;
        height: 55vmin;
        width: 70vmin;
    }

    .keyboard-container > div > div {
        height: 4.7rem;
        width: 4.7rem;
    }
}

@media (min-width: 1160px) and (max-width: 1280px) {
    .primary-logo {
        font-size: 4.5rem;
    }

    .primary-navigation {
        margin-top: .5rem;
        padding-block: 1.5rem;
        padding-inline: 1.5rem;
        gap: 2rem;
    }
}