﻿
/* ========== Mobile (≤768px) ========== */
@media (max-width: 768px) {
    html, body {
        -webkit-tap-highlight-color: transparent;
    }

    .top-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
        height: 48px;
        background: var(--bg0);
        border-bottom: 1px solid var(--brd);
    }

    .btn-mobile-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        margin: 0 -8px 0 0;
        background: transparent;
        color: var(--t1);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-size: 1.25rem;
    }

    .btn-mobile-menu:hover {
        background: var(--bg3);
    }

    .btn-mobile-menu, .btn-logout {
        min-height: 44px;
    }

    .channel-item {
        min-height: 44px;
        padding: 10px 12px;
    }

    .top-nav--guest .btn-mobile-menu {
        display: none;
    }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 898;
        opacity: 0;
        transition: opacity 0.2s ease;
    }


    .sidebars-wrapper {
        position: fixed;
        left: 0;
        top: 48px;
        bottom: 0;
        z-index: 899;
        display: flex;
        flex-direction: column;
        width: 280px;
        max-width: 85vw;
        background: var(--bg0);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        overflow: hidden;
        border-right: 1px solid var(--brd);
    }

    .sidebars-wrapper .guild-sidebar {
        width: 100%;
        min-width: unset;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
        gap: 8px;
        justify-content: flex-start;
        border-right: none;
        border-bottom: 1px solid var(--brd);
    }

    .sidebars-wrapper .guild-divider {
        display: none;
    }

    .sidebars-wrapper .guild-item {
        width: 40px;
        height: 40px;
    }


    .sidebars-wrapper .channel-sidebar {
        width: 100%;
        min-width: unset;
        flex: 1;
        overflow-y: auto;
        padding: 12px;
        border-right: none;
    }

    .main-content {
        min-width: 0;
    }


    .chat-layout {
        height: 100vh;
    }

    .chat-header-bar {
        padding: 0 12px;
        height: 44px;
    }

    .chat-header-title {
        font-size: 0.9rem;
    }

    .chat-header-bar .back-link {
        font-size: 0.9rem;
    }

    .chat-header-bar {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .chat-layout .messages {
        padding: 12px;
    }

    .chat-layout .message {
        gap: 12px;
        padding: 2px 0;
    }

    .message-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 0.9rem;
    }

    .chat-layout .input-area {
        padding: 12px;
        gap: 8px;
        flex-wrap: wrap;
    }

    .chat-layout .input-area input {
        min-width: 0;
    }

    .chat-layout .input-area button {
        padding: 10px 16px;
    }

    /* Voice mobile */
    .voice-layout {
        height: 100vh;
    }

    .voice-main {
        flex-direction: column;
    }

    .voice-tiles-grid {
        gap: 8px;
        padding: 8px 0;
    }

    .voice-tile {
        width: 140px;
        height: 140px;
    }

    .voice-tile-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }

    .voice-tile-name {
        font-size: 13px;
    }

    .voice-tile-screen {
        max-width: 100%;
    }

    .voice-participants-sidebar {
        width: 100%;
        min-width: 0;
        border-left: none;
        border-top: 1px solid var(--brd);
        max-height: 200px;
    }

    .voice-controls-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .voice-control-btn {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .voice-control-btn.btn-leave {
        width: auto;
        min-height: 44px;
        padding: 0 16px;
    }

    .voice-control-btn.btn-invite-voice {
        width: auto;
        min-height: 44px;
    }

    .room-body {
        flex-direction: column;
    }

    .room-side {
        width: 100%;
        min-width: 0;
        border-left: none;
        border-top: 1px solid var(--brd);
        max-height: 50vh;
    }

    .anon-entry-card {
        padding: 24px;
    }

    /* Welcome / Misc */
    .welcome-screen {
        padding: 2rem 1rem;
    }

    .main-full {
        padding: 0;
    }

    .invite-layout {
        padding: 1rem;
        max-width: none;
    }

    .invite-card {
        padding: 24px;
    }

    .modal-content {
        width: 95%;
        max-width: none;
        margin: 0 1rem;
        padding: 20px;
    }

    .profile-card {
        display: none;
    }

    .app-left {
        display: contents;
    }

    .user-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 900;
        border-right: none;
        border-top: 1px solid var(--brd);
    }
    .auth-heading {
        font-size: 22px;
    }

    .auth-subheading {
        font-size: 13px;
        margin-bottom: 20px;
    }

    .auth-cards {
        flex-direction: column;
    }

    .auth-card-left {
        padding: 24px;
    }

    .auth-card-right {
        width: auto;
        border-left: none;
        border-top: 1px solid var(--brd);
        padding: 24px;
    }
}