.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    #changelogPanel, 
    #settingsPanel, 
    #rosterPanel {
        width: 95% !important;
        max-height: 90vh;
    }

    .drawer-btn {
        background-color: #2a2f37;
        border: 1px solid #444;
        color: #eee;
        padding: 1rem;
        border-radius: 6px;
        font-size: 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        position: relative;
    }

    .drawer-btn:active {
        background-color: #3f8ff0;
        border-color: #3f8ff0;
        color: white;
    }

    .drawer-close {
        background: none;
        border: none;
        color: #aaa;
        font-size: 2rem;
        line-height: 1;
        padding: 0 1rem;
    }

    .drawer-content {
        padding: 1.5rem;
        overflow-y: auto;
        flex: 1;
    }

    .drawer-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .drawer-header {
        padding: 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
        background-color: rgba(32, 35, 42, 0.5);
    }

    .drawer-header h3 {
        margin: 0;
        color: #fff;
        font-size: 1.4rem;
    }

    .drawer-label {
        display: block;
        color: #3f8ff0;
        font-size: 0.9rem;
        text-transform: uppercase;
        font-weight: bold;
        margin-bottom: 0.8rem;
        letter-spacing: 1px;
    }

    .drawer-section {
        margin-bottom: 2rem;
    }

    .filter-container {
        display: block !important; 
        width: 0;
        height: 0;
        overflow: visible;
        margin: 0;
        position: absolute;
    }

    .filter-container #filterToggleButton {
        display: none !important;
    }

    #filterMenu {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 80% !important;
        max-width: 300px;
        z-index: 2147483647 !important;
        margin: 0 !important;
        opacity: 1; 
    }
    
    #filterMenu.hidden {
        display: none !important;
        opacity: 0;
    }
    
    .filter-option {
        padding: 1rem 0.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    #infoPanel {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .leaflet-tooltip {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

    #mapSearchInput {
        width: 100%;
        font-size: 16px;
        padding: 0.8rem 1rem 0.8rem 2.5rem;
        height: 48px;
        background-color: rgba(33, 33, 33, 0.95);
        backdrop-filter: blur(4px);
    }

    .mobile-badge {
        position: absolute;
        top: 5px;
        right: 5px;
        background-color: #dc3545;
        color: white;
        font-size: 0.7rem;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mobileBottomSheet {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: #2a2f37;
        border-top: 1px solid #3f8ff0;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
        z-index: 20000;
        transform: translateY(110%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        max-height: 50vh;
        padding-bottom: env(safe-area-inset-bottom);
    }

    #mobileBottomSheet.active {
        transform: translateY(0);
    }

    .mobile-drawer {
        position: fixed;
        top: 0;
        right: -300px;
        width: 85%;
        max-width: 300px;
        height: 100vh;
        background-color: #20232a;
        z-index: 2147483647;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
        border-left: 1px solid #3f8ff0;
        box-shadow: -5px 0 20px rgba(0,0,0,0.7);
    }

    .mobile-drawer.open {
        right: 0;
    }

    .mobile-drawer-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0,0,0,0.6);
        z-index: 2147483646;
        backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .mobile-drawer-overlay.visible {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-fab {
        position: fixed;
        top: 10px;
        right: 10px;
        width: 48px;
        height: 48px;
        background-color: #0d6efd;
        color: white;
        border: none;
        border-radius: 8px;
        box-shadow: 0 4px 10px rgba(0,0,0,0.5);
        z-index: 2147483647;
        font-size: 1.5rem;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
    }

    .mobile-only {
        display: block !important;
    }

    .mobile-server-list .dropdown-item {
        padding: 1rem;
        background-color: #2a2f37;
        color: white;
        border: 1px solid #444;
        margin-bottom: 8px;
        border-radius: 4px;
        text-align: center;
        display: block;
        width: 100%;
    }
    
    .mobile-server-list .dropdown-item:active {
        background-color: #0d6efd;
    }

    .mobile-status-row {
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgb(42, 47, 55);
        padding: 1rem;
        border-radius: 6px;
        color: rgb(238, 238, 238);
        font-weight: bold;
        border: 1px solid rgba(255, 255, 255, 0.1);
        text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    }

    .navbar-top {
        top: 10px;
        left: 10px;
        right: 60px;
        width: auto;
    }

    .navbar-top > .dropdown,
    .changelog-btn-container,
    .settings-btn-container,
    .player-counter,
    .palworld-clock,
    .hydra-logo,
    .version-watermark {
        display: none !important;
    }

    .search-container {
        margin-left: 0;
        width: 100%;
    }

    .search-icon {
        top: 50%;
        transform: translateY(-50%);
        left: 1rem;
    }

    #serverNameDisplay.server-name {
        position: fixed !important;
        top: 58px;
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        bottom: auto;
        border-radius: 50px;
        padding: 6px 16px;
        width: auto;
        max-width: 80%;
        background-color: rgba(32, 35, 42, 0.85);
        backdrop-filter: blur(4px);
        border: 1px solid rgba(63, 143, 240, 0.3);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
        font-size: 0.85rem;
        font-weight: 600;
        letter-spacing: 0.5px;
        color: #fff;
        text-align: center;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        z-index: 999;
        pointer-events: none;
    }

    .sheet-close {
        position: absolute;
        top: 2px;
        right: 15px;
        background: none;
        border: none;
        color: #aaa;
        font-size: 1.8rem;
        line-height: 1;
        padding: 5px;
    }

    .sheet-content {
        padding: 15px 20px 25px 20px;
        color: #eee;
        overflow-y: auto;
        font-size: 1rem;
    }

    .sheet-content .guild-row {
        margin-bottom: 8px;
        font-size: 1.1rem;
    }

    .sheet-content .guild-tooltip-container {
        min-width: 100% !important;
        padding: 0;
    }

    .sheet-handle {
        width: 40px;
        height: 4px;
        background-color: #6c757d;
        border-radius: 2px;
    }

    .sheet-header {
        width: 100%;
        height: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
}