.site-menu-button,
.site-menu-close {
    display: grid;
    place-items: center;
    border: 0;
    color: #fafaff;
    font: inherit;
    cursor: pointer;
}

.site-menu-button {
    position: fixed;
    z-index: 15;
    top: max(1.25rem, env(safe-area-inset-top));
    left: 1.25rem;
    width: 2.4rem;
    height: 2.4rem;
    padding: .55rem .48rem;
    border: 2px solid rgba(255, 255, 255, .65);
    border-radius: 50%;
    background: #6e5c62;
}

.game-page .site-menu-button {
    top: calc(env(safe-area-inset-top) + .425rem);
    left: max(.75rem, calc((100vw - 1440px) / 2 + .75rem));
    background: transparent;
}

.site-menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.site-menu-button:focus-visible,
.site-menu-close:focus-visible,
.site-menu a:focus-visible,
.difficulty-switch button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.site-menu {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(86vw, 20rem);
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: #58494e;
    color: #fafaff;
    box-shadow: .8rem 0 2.5rem rgba(0, 0, 0, .3);
}

.site-menu[open] {
    animation: site-menu-enter .18s ease-out;
}

.site-menu::backdrop {
    background: rgba(32, 24, 27, .72);
    animation: site-menu-backdrop-enter .18s ease-out;
}

.site-menu-panel {
    box-sizing: border-box;
    height: 100%;
    min-height: 100%;
    padding: max(1.15rem, env(safe-area-inset-top)) 1rem max(1.15rem, env(safe-area-inset-bottom));
    overflow-y: auto;
}

.site-menu header {
    display: flex;
    min-height: 2.75rem;
    align-items: center;
    justify-content: space-between;
    padding: 0 .35rem .75rem .65rem;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}

.site-menu h2 {
    margin: 0;
    font-size: 1.35rem;
}

.site-menu-close {
    width: 2.5rem;
    height: 2.5rem;
    background: transparent;
    font-size: 1.8rem;
    line-height: 1;
}

.site-menu nav {
    display: grid;
    gap: .25rem;
    padding-top: .8rem;
}

.site-menu a {
    padding: .75rem .8rem;
    border-radius: .55rem;
    color: inherit;
    text-decoration: none;
}

.site-menu a:hover {
    background: rgba(255, 255, 255, .09);
}

.site-menu a[aria-current="page"] {
    background: #3aa394;
}

.site-menu-label {
    margin: .8rem .8rem .2rem;
    color: #d6cfd2;
    font-size: .7rem;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.site-menu-setting {
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px solid rgba(255, 255, 255, .18);
}

.site-menu-setting .site-menu-label {
    font-weight: 400;
}

.difficulty-switch {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .2rem;
    margin: .45rem .8rem 0;
    padding: .2rem;
    border-radius: .65rem;
    background: rgba(32, 24, 27, .38);
}

.difficulty-switch button {
    min-height: 2.35rem;
    padding: .45rem .65rem;
    border: 0;
    border-radius: .48rem;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.difficulty-switch button:hover {
    background: rgba(255, 255, 255, .09);
}

.difficulty-switch button[aria-pressed="true"] {
    background: #3aa394;
    font-weight: 700;
}

@keyframes site-menu-enter {
    from {
        transform: translateX(-100%);
    }
}

@keyframes site-menu-backdrop-enter {
    from {
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-menu[open],
    .site-menu::backdrop {
        animation-duration: .01ms;
    }
}
