/* Mobile Responsiveness fixes */
@media (max-width: 991px) {

    /* Main Layout */
    .container.main .row {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .sections,
    .asidebar {
        width: 100% !important;
        max-width: 100% !important;
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    /* Asidebar fixes */
    .asidebar {
        margin-top: 30px;
    }

    .asidebar>div {
        width: 100% !important;
    }

    /* Spotlight (Top Players / Guilds) */
    .spotlight {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .spotlight>div {
        width: 100% !important;
    }

    /* Screenshots Grid */
    #page-body .screenshot-item {
        /* Ensure items don't overflow */
        max-width: 100%;
    }
}

@media (max-width: 768px) {

    /* Screenshots Grid specific adjustment for small screens */
    div[style*="grid-template-columns:repeat(4, 1fr)"],
    div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Slide / Banner Fix */
    .slide img {
        height: 250px !important; /* Mantém a altura agradável no mobile */
        min-width: 100% !important;
        object-fit: cover; /* Faz a imagem focar no centro sem espremer */
        object-position: center;
    }

    /* Login Box Fixes */
    .painel-user {
        padding: 0 15px;
    }
    
    #login-user, #pass-user {
        width: 100% !important;
        box-sizing: border-box;
    }

    .footer-form {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        margin-top: 15px;
    }

    .footer-form .col-md-7 {
        width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }

    .enter-button {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Mobile Navbar Menu Fix */
    .navbar {
        position: relative !important;
    }

    .navbar-collapse {
        background-color: #1a1e23;
        padding: 15px;
        border-radius: 0 0 5px 5px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
        position: absolute;
        width: 100%;
        top: 100%;
        left: 0;
        z-index: 9999;
    }

    .navbar-nav .nav-item .nav-link {
        color: #fff !important;
        padding: 10px 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }

    .navbar-nav .dropdown-menu {
        background-color: #23282f;
        border: none;
        padding: 5px 0;
        margin: 0;
    }

    .navbar-nav .dropdown-item {
        color: #ddd !important;
        padding: 8px 30px;
    }

    .navbar-nav .dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: #fff !important;
    }

    .rgst-button {
        display: block;
        text-align: center;
        margin: 0px auto 0 auto;
        width: fit-content;
    }

    /* Logo Fix */
    #logo-brand-wrap {
        position: absolute;
        top: 200px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: 90%;
        max-width: 350px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 !important;
        gap: 50px;
    }

    .server-status-widget {
        margin-top: 0;
        padding: 10px 15px;
        border-radius: 30px;
        transform: scale(0.9);
    }

    .ssw-count {
        font-size: 20px;
    }

    .ssw-divider {
        margin: 0 15px;
        height: 30px;
    }
}

@media (max-width: 480px) {

    /* Screenshots Grid for very small screens */
    div[style*="grid-template-columns:repeat(4, 1fr)"],
    div[style*="grid-template-columns: repeat(4, 1fr)"],
    div[style*="grid-template-columns: repeat(2, 1fr)"] {
        grid-template-columns: 1fr !important;
    }
}