.pg-mobile-site-header,
.pg-mobile-site-header-spacer,
.pg-mobile-menu {
    display: none;
}

:root {
    --pg-wp-admin-bar-height: 0px;
}

body.admin-bar {
    --pg-wp-admin-bar-height: 32px;
}

@media (max-width: 782px) {
    body.admin-bar {
        --pg-wp-admin-bar-height: 46px;
    }
}

body.admin-bar .pg-list-desktop-nav {
    top: var(--pg-wp-admin-bar-height) !important;
}

@media (max-width: 899px) {
    :root {
        --pg-mobile-header-height: 62px;
        --pg-mobile-header-height: calc(62px + constant(safe-area-inset-top));
        --pg-mobile-header-height: calc(62px + env(safe-area-inset-top));
    }

    body.pg-mobile-menu-open {
        overflow: hidden;
        touch-action: none;
    }

    .pg-topbar {
        display: none !important;
    }

    body.playground-home .pg-app-shell,
    body.page-template-page-list .pg-app-shell,
    body.category .pg-app-shell,
    body.search .pg-app-shell,
    body.page-template-page-ranking .pg-app-shell,
    body.single-post.playground-home .pg-app-shell,
    body.page-template-page-game-detail.playground-home .pg-app-shell,
    body.playground-home.page .pg-app-shell,
    body.error404 .pg-app-shell {
        padding-top: 0 !important;
    }

    .pg-mobile-site-header {
        position: fixed;
        top: var(--pg-wp-admin-bar-height, 0px) !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 900;
        display: block;
        width: 100% !important;
        max-width: none;
        margin: 0 !important;
        padding-top: constant(safe-area-inset-top);
        padding-top: env(safe-area-inset-top);
        border-bottom: 1px solid rgba(226, 232, 240, 0.92);
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        backdrop-filter: blur(18px);
        -webkit-backdrop-filter: blur(18px);
        transform: none;
        box-sizing: border-box;
    }

    .pg-mobile-site-header-spacer {
        display: block;
        height: var(--pg-mobile-header-height, 62px);
        flex: 0 0 auto;
    }

    body.admin-bar .pg-mobile-site-header-spacer {
        height: calc(var(--pg-mobile-header-height, 62px) + var(--pg-wp-admin-bar-height, 0px));
    }

    body.admin-bar .pg-ranking-exact-tabs {
        top: calc(var(--pg-mobile-header-height, 62px) + var(--pg-wp-admin-bar-height, 0px)) !important;
    }

    .pg-mobile-site-header__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: min(640px, 100%);
        min-height: 62px;
        margin-inline: auto;
        margin-left: auto;
        margin-right: auto;
        padding: 0 18px;
        box-sizing: border-box;
    }

    .pg-mobile-site-header__logo {
        position: relative;
        display: inline-flex;
        align-items: center;
        width: min(186px, 52vw);
        height: 44px;
        min-width: 0;
    }

    .pg-mobile-site-header__logo img {
        display: block;
        width: 100%;
        max-width: 186px;
        height: 100%;
        object-fit: contain;
        object-position: left center;
    }

    .pg-mobile-site-header__logo .site-logo--dark {
        display: block;
    }

    .pg-mobile-site-header__logo .site-logo--light {
        display: none;
    }

    .pg-mobile-site-header__actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        flex: 0 0 auto;
    }

    .pg-mobile-site-header__button,
    .pg-mobile-site-header__burger,
    .pg-mobile-menu__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 999px;
        color: #111827;
        background: rgba(243, 246, 250, 0.96);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .pg-mobile-site-header__button .material-symbols-outlined,
    .pg-mobile-menu__close .material-symbols-outlined {
        font-size: 22px;
        line-height: 1;
    }

    .pg-mobile-site-header__burger {
        flex-direction: column;
        gap: 4px;
        background: #111827;
    }

    .pg-mobile-site-header__burger span {
        display: block;
        width: 16px;
        height: 2px;
        border-radius: 999px;
        background: #ffffff;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .pg-mobile-site-header__burger[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .pg-mobile-site-header__burger[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .pg-mobile-site-header__burger[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .pg-mobile-menu {
        position: fixed;
        inset: 0;
        z-index: 1600;
        display: block;
        pointer-events: none;
    }

    .pg-mobile-menu[hidden] {
        display: none !important;
    }

    .pg-mobile-menu__backdrop {
        position: absolute;
        inset: 0;
        border: 0;
        background: rgba(15, 23, 42, 0.48);
        opacity: 0;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        transition: opacity 220ms ease;
    }

    .pg-mobile-menu__panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(82vw, 330px);
        padding: calc(18px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom));
        box-sizing: border-box;
        color: #111827;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: -24px 0 48px rgba(15, 23, 42, 0.2);
        transform: translateX(104%);
        transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .pg-mobile-menu.is-open {
        pointer-events: auto;
    }

    .pg-mobile-menu.is-open .pg-mobile-menu__backdrop {
        opacity: 1;
    }

    .pg-mobile-menu.is-open .pg-mobile-menu__panel {
        transform: translateX(0);
    }

    .pg-mobile-menu__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding-bottom: 18px;
        border-bottom: 1px solid rgba(226, 232, 240, 0.92);
    }

    .pg-mobile-menu__logo {
        display: inline-flex;
        align-items: center;
        width: min(186px, 58vw);
        height: 44px;
    }

    .pg-mobile-menu__logo img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: left center;
    }

    .pg-mobile-menu__logo .site-logo--dark {
        display: block;
    }

    .pg-mobile-menu__logo .site-logo--light {
        display: none;
    }

    .pg-mobile-menu__nav {
        display: grid;
        gap: 8px;
        padding: 20px 0;
    }

    .pg-mobile-menu__nav a {
        display: grid;
        grid-template-columns: 36px 1fr 20px;
        align-items: center;
        gap: 10px;
        min-height: 52px;
        padding: 0 12px;
        border-radius: 14px;
        color: #111827;
        text-decoration: none;
        background: rgba(248, 250, 252, 0.92);
    }

    .pg-mobile-menu__nav a.is-active {
        color: #0057d9;
        background: rgba(0, 122, 255, 0.1);
    }

    .pg-mobile-menu__nav span {
        width: 36px;
        height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        color: inherit;
        background: rgba(255, 255, 255, 0.88);
        font-size: 21px;
    }

    .pg-mobile-menu__nav strong {
        font-size: 15px;
        line-height: 1.2;
        font-weight: 800;
    }

    .pg-mobile-menu__nav i {
        color: #9ca3af;
        font-size: 20px;
        font-style: normal;
    }

    .pg-mobile-menu__quick {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: auto;
    }

    .pg-mobile-menu__quick button {
        min-height: 44px;
        border: 0;
        border-radius: 999px;
        color: #ffffff;
        background: #007aff;
        font-size: 14px;
        font-weight: 800;
    }

    .pg-mobile-menu__quick button:last-child {
        color: #111827;
        background: #eef2f7;
    }
}

@media (max-width: 360px) {
    .pg-mobile-site-header__inner {
        padding-inline: 14px;
    }

    .pg-mobile-site-header__logo {
        width: min(146px, 40vw);
    }

    .pg-mobile-site-header__actions {
        gap: 6px;
    }

    .pg-mobile-site-header__button,
    .pg-mobile-site-header__burger {
        width: 38px;
        height: 38px;
    }
}
