﻿/* =========================
   site.mobile.css (GameSystem)
   Подключается ПОСЛЕ site.css
   ========================= */

/* DESKTOP DEFAULT */
.gs-mobile-burger,
.gs-mobile-nav,
.gs-mobile-nav-overlay {
    display: none;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.gs-body {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

:root {
    --gs-container-pad: 16px;
    --gs-tap: 44px;
}

* {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* =========================
   0) Layout mobile
   ========================= */
@media (max-width: 768px) {
    .gs-main {
        padding: 1.1rem var(--gs-container-pad) 2.2rem;
    }

    .gs-main-inner, .gs-container, .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    body {
        font-size: 16px;
    }
}

/* =========================
   1) Header mobile
   ========================= */
@media (max-width: 768px) {
    .gs-mobile-burger {
        display: inline-flex;
    }

    .gs-mobile-nav {
        display: block;
    }

    .gs-mobile-nav-overlay {
        display: block;
    }

    .gs-header {
        position: sticky;
        top: 0;
        z-index: 1100;
        backdrop-filter: blur(10px);
    }

    .gs-header-inner {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    .gs-logo {
        display: none;
    }

    .gs-nav {
        display: none !important;
    }

    .gs-header-right {
        justify-self: end;
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .gs-header-toggle {
        display: none !important;
    }

    /* вариант Б: логаут в шапке (десктопный) на мобиле не показываем */
    .gs-user-menu-logout--desktop {
        display: none !important;
    }

    /* бургер: 3 неоновые полоски */
    .gs-mobile-burger {
        appearance: none;
        border: none;
        background: transparent;
        padding: 6px 6px;
        min-width: 38px;
        min-height: 38px;
        border-radius: 10px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        user-select: none;
        opacity: 0.95;
    }

        .gs-mobile-burger:active {
            opacity: 1;
        }

    .gs-mobile-burger-icon {
        width: 22px;
        height: 16px;
        position: relative;
        display: inline-block;
        filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
    }

        .gs-mobile-burger-icon::before,
        .gs-mobile-burger-icon::after,
        .gs-mobile-burger-icon span {
            content: "";
            position: absolute;
            left: 0;
            right: 0;
            height: 2px;
            border-radius: 2px;
            background: linear-gradient(90deg, rgba(56,189,248,0.95), rgba(99,102,241,0.95));
            box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
        }

        .gs-mobile-burger-icon::before {
            top: 0;
        }

        .gs-mobile-burger-icon span {
            top: 7px;
        }

        .gs-mobile-burger-icon::after {
            bottom: 0;
        }
}

/* =========================
   2) Off-canvas mobile nav
   ========================= */
@media (max-width: 768px) {
    body.gs-mobile-nav-open {
        overflow: hidden;
        touch-action: none;
    }

    .gs-mobile-nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 160ms ease;
        z-index: 1200;
    }

    .gs-mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        height: 100svh;
        width: min(60vw, 340px);
        transform: translateX(-110%);
        transition: transform 200ms ease;
        z-index: 1250;
        background: rgba(6, 15, 39, 0.30);
        backdrop-filter: blur(16px);
        border-right: 1px solid rgba(88, 141, 255, 0.28);
        box-shadow: 0 20px 60px rgba(2, 6, 23, 0.95);
        display: flex;
        flex-direction: column;
        padding: 10px 0 10px;
        overflow: hidden;
    }

    body.gs-mobile-nav-open .gs-mobile-nav-overlay {
        opacity: 1;
        pointer-events: auto;
    }

    body.gs-mobile-nav-open .gs-mobile-nav {
        transform: translateX(0);
    }

    .gs-mobile-nav-head {
        display: block;
        height: 10px;
        flex: 0 0 auto;
    }

    .gs-mobile-nav-links {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 6px 0;
    }

        /* ССЫЛКИ */
        .gs-mobile-nav-links a {
            display: flex;
            align-items: center;
            width: 100%;
            min-height: 44px;
            padding: 10px 14px;
            border-radius: 0;
            border: none;
            text-decoration: none;
            color: rgba(229, 237, 255, 0.96);
            letter-spacing: 0.08em;
            text-transform: uppercase;
            font-size: 0.85rem;
            background: linear-gradient(90deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.10));
            position: relative;
            opacity: 0.92;
            transition: opacity 0.15s ease, background 0.15s ease;
        }

            .gs-mobile-nav-links a::after {
                content: "";
                position: absolute;
                left: 14px;
                right: 14px;
                bottom: 0;
                height: 1px;
                background: linear-gradient(90deg, rgba(56,189,248,0.10), rgba(99,102,241,0.55), rgba(56,189,248,0.10));
                box-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
                opacity: 0.9;
            }

            .gs-mobile-nav-links a:hover {
                opacity: 1;
                background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.10));
            }

            .gs-mobile-nav-links a:active {
                opacity: 1;
                background: linear-gradient(90deg, rgba(56, 189, 248, 0.20), rgba(15, 23, 42, 0.10));
            }

    /* FORM + BUTTON (Logout) — ДЕЛАЕМ 1:1 КАК ССЫЛКА */
    .gs-mobile-nav-form {
        margin: 0;
    }

    .gs-mobile-nav-item {
        /* вместо all:unset — нормальная база, чтобы не ломать псевдоэлементы/фон */
        display: flex;
        align-items: center;
        width: 100%;
        min-height: 44px;
        padding: 10px 14px;
        border: none;
        border-radius: 0;
        background: linear-gradient(90deg, rgba(15, 23, 42, 0.28), rgba(15, 23, 42, 0.10));
        color: rgba(229, 237, 255, 0.96);
        letter-spacing: 0.08em;
        text-transform: uppercase;
        font-size: 0.85rem;
        cursor: pointer;
        text-align: left;
        position: relative;
        opacity: 0.92;
        transition: opacity 0.15s ease, background 0.15s ease;
        -webkit-tap-highlight-color: transparent;
    }

        .gs-mobile-nav-item::after {
            content: "";
            position: absolute;
            left: 14px;
            right: 14px;
            bottom: 0;
            height: 1px;
            background: linear-gradient(90deg, rgba(56,189,248,0.10), rgba(99,102,241,0.55), rgba(56,189,248,0.10));
            box-shadow: 0 0 10px rgba(56, 189, 248, 0.18);
            opacity: 0.9;
        }

        .gs-mobile-nav-item:hover {
            opacity: 1;
            background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(15, 23, 42, 0.10));
        }

        .gs-mobile-nav-item:active {
            opacity: 1;
            background: linear-gradient(90deg, rgba(56, 189, 248, 0.20), rgba(15, 23, 42, 0.10));
        }

    .gs-mobile-nav-item--danger {
        color: rgba(249, 115, 115, 0.95);
    }

        .gs-mobile-nav-item--danger::after {
            background: linear-gradient(90deg, rgba(249,115,115,0.10), rgba(249,115,115,0.65), rgba(249,115,115,0.10));
            box-shadow: 0 0 10px rgba(249, 115, 115, 0.18);
        }

    .gs-mobile-nav-item:focus {
        outline: none;
    }

    .gs-mobile-nav-item:focus-visible {
        outline: 2px solid rgba(125, 211, 252, 0.45);
        outline-offset: -2px;
    }

    .gs-mobile-nav-footer {
        flex: 0 0 auto;
        padding: 10px 14px 14px;
        border-top: 1px solid rgba(88, 141, 255, 0.20);
        color: rgba(213, 227, 255, 0.75);
        font-size: 0.70rem;
        line-height: 1.25;
        letter-spacing: 0.02em;
        text-align: left;
    }
}

/* Footer сайта на мобиле — прячем */
@media (max-width: 768px) {
    .gs-footer {
        display: none !important;
    }
}

/* Cards / grids */
@media (max-width: 768px) {
    .gs-card,
    .gs-profile-card,
    .gs-games-card,
    .gs-community-card {
        border-radius: 18px;
        padding: 16px 14px;
        box-shadow: 0 12px 26px rgba(2, 6, 23, 0.75);
    }

    .gs-grid,
    .gs-games-grid,
    .gs-community-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

/* Forms */
@media (max-width: 768px) {
    input, select, textarea, button {
        font-size: 16px;
    }

    .gs-form-row {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .gs-input, .gs-select, .gs-textarea {
        width: 100%;
        min-height: var(--gs-tap);
        border-radius: 14px;
    }

    .gs-btn, .btn, button {
        min-height: var(--gs-tap);
        border-radius: 14px;
        padding: 10px 14px;
    }
}
