/* =========================================================
   URTIPUUL MOBIL KABUK (mobile shell)
   - Ana sayfanin sol ust kosesindeki uç nokta -> soldan menu
   - Alt bar sadeleştirmesi (yalnizca mobil)
   Masaustu gorunumu bu dosyadan ETKILENMEZ: tum kurallar
   max-width: 768px blogunun icinde.
   ========================================================= */

.mshell-topbar,
.mshell-scrim,
.mshell-drawer {
    display: none;
}

.mshell-profile-actions {
    display: none;
}

@media screen and (max-width: 768px) {

    /* ---------- 1) ALT BAR: sadeleştirme ----------
       Alt barda kalanlar: UrtiAi, Ana Sayfa, Videolar, Mesajlar, Profil
       Menuye tasinanlar: Oyuna Gir, Bildirimler, Arama
       Sag alttaki "..." alt menusu de menuye tasindi. */
    .sidebar .menu-item.game-mode-btn,
    .sidebar .menu-item[data-page="bildirimler"],
    .sidebar .menu-item[data-page="arama"] {
        display: none !important;
    }

    .sidebar .sidebar-more-container {
        display: none !important;
    }

    .sidebar .menu-item[data-page="urtiai-page"] {
        order: 1;
    }

    .sidebar .menu-item[data-page="ana-sayfa"] {
        order: 2;
    }

    .sidebar .menu-item[data-page="videolar"] {
        order: 3;
    }

    .sidebar .menu-item[data-page="mesajlar"] {
        order: 4;
    }

    .sidebar .menu-item[data-page="profil"] {
        order: 5;
    }

    /* ---------- 2) ANA SAYFA UST BARI ---------- */
    .mshell-topbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        position: sticky;
        top: 0;
        z-index: 900;
        height: 54px;
        padding: 0 8px;
        margin: 0;
        background: var(--bg-primary);
        border-bottom: 1px solid var(--border-color);
    }

    .mshell-topbar .mshell-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 17px;
        font-weight: 800;
        letter-spacing: -0.4px;
        color: var(--text-primary);
        pointer-events: none;
    }

    .mshell-btn {
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 50%;
        background: transparent;
        color: var(--text-primary);
        font-size: 19px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease, transform 0.1s ease;
    }

    .mshell-btn:active {
        transform: scale(0.9);
        background: rgba(127, 127, 127, 0.14);
    }

    /* ---------- 3) PERDE + SOLDAN ACILAN MENU ---------- */
    .mshell-scrim {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1190;
        background: rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .mshell-scrim.is-open {
        opacity: 1;
        pointer-events: auto;
    }

    .mshell-drawer {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1200;
        width: min(84vw, 322px);
        max-width: 100%;
        background: var(--bg-primary);
        border-radius: 0 20px 20px 0;
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.32);
        transform: translateX(-104%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .mshell-drawer.is-open {
        transform: translateX(0);
    }

    .mshell-drawer-head {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 20px 18px 16px;
        border-bottom: 1px solid var(--border-color);
    }

    .mshell-drawer-head img {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        object-fit: cover;
    }

    .mshell-drawer-head .mshell-head-text {
        display: flex;
        flex-direction: column;
        min-width: 0;
        flex: 1;
    }

    .mshell-drawer-head strong {
        font-size: 17px;
        font-weight: 800;
        color: var(--text-primary);
        line-height: 1.2;
    }

    .mshell-drawer-head span {
        font-size: 12px;
        color: var(--text-secondary);
    }

    .mshell-close {
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 50%;
        background: rgba(127, 127, 127, 0.12);
        color: var(--text-primary);
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        flex: 0 0 auto;
    }

    .mshell-drawer-body {
        flex: 1;
        overflow-y: auto;
        padding: 10px 10px 16px;
        -webkit-overflow-scrolling: touch;
    }

    .mshell-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: 14px;
        width: 100%;
        padding: 13px 14px;
        border: none;
        border-radius: 12px;
        background: transparent;
        color: var(--text-primary);
        font-family: inherit;
        font-size: 15px;
        font-weight: 600;
        text-align: left;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: background 0.15s ease;
    }

    .mshell-item:active {
        background: rgba(127, 127, 127, 0.14);
    }

    .mshell-item .mshell-ico {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        font-size: 17px;
        color: var(--text-secondary);
        flex: 0 0 auto;
    }

    .mshell-item .mshell-ico img {
        width: 19px;
        height: 19px;
        object-fit: contain;
    }

    .mshell-item-primary {
        margin: 4px 4px 8px;
        width: calc(100% - 8px);
        padding: 14px 16px;
        border-radius: 14px;
        background: linear-gradient(135deg, #4361ee, #1d9bf0);
        color: #fff;
        font-size: 15.5px;
        font-weight: 700;
        box-shadow: 0 8px 18px rgba(29, 155, 240, 0.32);
    }

    .mshell-item-primary .mshell-ico {
        color: #fff;
    }

    .mshell-sep {
        height: 1px;
        margin: 8px 12px;
        background: var(--border-color);
    }

    .mshell-label {
        padding: 12px 18px 4px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        color: var(--text-secondary);
    }

    .mshell-badge {
        display: none;
        margin-left: auto;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 999px;
        background: #ed4956;
        color: #fff;
        font-size: 11px;
        font-weight: 800;
        line-height: 20px;
        text-align: center;
    }

    .mshell-badge.is-visible {
        display: inline-block;
    }

    .mshell-item-danger {
        color: #ed4956;
    }

    .mshell-item-danger .mshell-ico {
        color: #ed4956;
    }

    /* ---------- 4) PROFIL SAYFASI KISAYOLLARI ---------- */
    .mshell-profile-actions {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin: 0 0 26px;
    }

    .mshell-profile-actions button {
        flex: 1 1 0;
        min-width: 92px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 13px 8px;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        background: var(--card-bg);
        color: var(--text-primary);
        font-family: inherit;
        font-size: 12.5px;
        font-weight: 600;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.1s ease;
    }

    .mshell-profile-actions button:active {
        transform: scale(0.96);
    }

    .mshell-profile-actions i {
        font-size: 17px;
        color: var(--accent-color);
    }
}
