body {
    /* Layout e Alinhamento */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;

    /* Tipografia */
    font-family: Arial, sans-serif;

     /* Estilos de Fundo */
     background-color: #000; /* Cor de fundo de fallback (preto) */
     /* background-image moved to pseudo-element to allow fixed desktop backgrounds
         and a different behavior on mobile (prevents duplicate rendering). */

     position: relative; /* needed when swapping pseudo-element visibility */

    /* Espaçamento (padding) */
    /* Usando a última especificação: 20px superior/inferior, 0 esquerda/direita */
    padding: 20px 0; 
    background: scroll;
}

a {
    color: #00aaff;
    text-decoration: none;
}

a:hover {
    color: #ffaa00;
}

a:visited {
    color: #ffaa00;
}

a:active {
    color: #ff0000;
}

p {
    filter: drop-shadow(0 0 8px #ffffff2c) !important;
}

/* Seleciona o INPUT DE PESQUISA */
/* Seleciona TODOS os outros elementos da barra de filtro (selects e buttons) */
/* (Esta é a regra que estava usando 10px 15px e causava a diferença) */
input, select, button {
    padding: 20px 15px; /* Aumenta o padding vertical para 20px (igual ao #search) */
    font-size: 18px;    /* Aumenta a fonte para 18px */
    border-radius: 10px;
    border: none;
    outline: none;
    transition: all 0.2s ease-in-out;
    background-color: #494949;
    color: #fff;
    border: 2px solid #ffffff86;
}

#search {
    width: calc(100% + 40px); 
    margin-left: -20px; 
    margin-right: -20px; 
    max-width: none; 
    padding: 20px 30px; 
    margin: 10px;
}

/* Note: Eu usei 20px vertical e mantive 15px horizontal nos selects/buttons, 
   mas você pode usar 20px 30px em todos se quiser que o preenchimento lateral 
   também seja maior. O importante é o padding vertical (20px). */

#search:focus {
    outline: none;
    border: 2px solid #ffffff;
    filter: drop-shadow(0 0 13px #ffffff);
}

.title {
    width: 100%;
    max-width: 800px;
    height: auto;
    display: block;
    margin: 20px auto 50px auto;
    box-sizing: border-box;
    padding: 0 10px;
    filter: drop-shadow(0 0 12px #ffffff80);
}

.top-bar {
    display: flex;
    flex-direction: column; 
    width: 100%;
    /* MUDANÇA AQUI: Centraliza todos os filhos (Search e Filter-Group) horizontalmente */
    align-items: center; 
    padding: 0 20px;
    box-sizing: border-box;
    margin: 0 auto; /* Adicionar margem auto para centralizar o bloco inteiro (se necessário) */
}

.filter-group {
    display: flex;
    gap: 12px;
    width: 100%; 
    max-width: 800px; /* Use o mesmo max-width do search ou o desejado */
    
    /* MUDANÇA AQUI: Garante que os selects e o botão estejam centralizados dentro do grupo */
    justify-content: center; 
    
    flex-wrap: wrap; 
}

input:focus, select:focus {
    border: 2px solid #ffffff;
    filter: drop-shadow(0 0 13px #ffffff);
}

input {
    flex: 1;
}

input::placeholder {
    color: #aaa;
}

select:hover, button:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.scale:hover {
    transform: scale(1.3);
}

.card {
    position: relative;
    background-color: #111;
    color: #fff;
    border-radius: 15px;
    border: 2px solid #ffffff;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    margin: 15px 0;
    padding: 15px;
    margin: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: auto; /* Deixa o grid controlar a largura da célula */
    margin: 0; /* Remove a margem vertical desnecessária entre os cards na grid */
    
    /* Garante que o card ocupe o espaço da célula de forma flexível */
    min-height: min-content;
}

.card-top {
    display: flex;
    gap: 15px;
    position: relative;
}

/* Allow flex children to shrink properly and prevent overflow */
.card, .card-top, .card-content {
    min-width: 0;
}

/* Prevent long words/titles from overflowing */
.card-content h3,
.card-content p,
.popup-info h2,
.popup-info p {
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: normal;
}

.card-icon {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 10px;
    filter: drop-shadow(0 0 12px #ffffffc5);
    margin: 7px;
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #1a1a1a; /* fundo do subbloco */
    padding: 15px;            /* espaço interno */
    border-radius: 10px;      /* bordas arredondadas */
    border: 2px solid #ffffff;   /* borda do subbloco */
    box-shadow: 0 0 10px #ffffff88; /* leve brilho */
    position: relative;
    width: 100%;
}

.card-content .download-btn {
    padding: 8px 15px;
    border-radius: 25px;
    background-color: #646464;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    text-decoration: none;
    display: flex;               /* centraliza */
    justify-content: center;     /* centraliza horizontal */
    align-items: center;         /* centraliza vertical */
    width: fill;          /* mantém o tamanho certinho */
}
.card-content p {
    font-size: 20px;
}
.card-content .download-btn:hover {
    background-color: #333;
    transform: scale(1.05);
}

.pack-description-text {
    /* Define a altura máxima que a descrição pode ter antes de rolar. 
       Ajuste este valor conforme necessário para seu layout. 
       Por exemplo, 4rem é cerca de 4 linhas de texto. */
    max-height: 4rem; 
    
    /* Habilita a barra de rolagem vertical (scroll) 
       SOMENTE se o conteúdo exceder o max-height. */
    overflow-y: auto; 
    
    /* Opcional: Adiciona preenchimento para que a barra de rolagem 
       não fique muito grudada no texto. */
    padding-right: 10px; 
    
    /* Opcional: Adiciona margem inferior para separar do botão de Download. */
    margin-bottom: 10px; 
}

/* Opcional: Estilize a barra de rolagem para um visual mais limpo (apenas WebKit/Chrome/Safari) */
.pack-description-text::-webkit-scrollbar {
    width: 6px;
}

.pack-description-text::-webkit-scrollbar-thumb {
    background-color: #ffffff; /* Cor da alça do scroll */
    border-radius: 3px;
}

.pack-description-text::-webkit-scrollbar-track {
    background-color: #464646; /* Cor de fundo do scroll */
}

.download-count {
    margin: 4px 0 0 0;
    font-size: 12px;
    color: #aaa;
    text-align: center;
}

.card-content .more-info {
    position: absolute;
    top: 15px;
    right: 15px;
    
    width: 35px;
    height: 35px;
    padding: 0;
    
    border-radius: 50%;
    background-color: #646464;
    border: 2px solid #fff;
    
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;

    color: #fff;
    font-size: 20px;
    font-weight: bold;

    overflow: hidden;
    z-index: 10;
}

.card-content .more-info img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    pointer-events: none;
}


.card-content .more-info:hover {
    background-color: #333;
}

.card-screenshot {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
    border: 3px solid #ffffff;
}

.cards-grid {
    display: grid;
    /* Define 2 colunas com largura igual */
    grid-template-columns: 1fr 1fr; 
    /* Espaçamento entre os cards (20px horizontal, 30px vertical) */
    gap: 30px 20px; 
    /* Limita a largura máxima da grade para evitar que se espalhe demais */
    max-width: 1400px; 
    width: 100%;
    margin: 20px auto; /* Centraliza a grade */
}

.description-card {
    font-size: 16px;
}

.popup-bg {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.popup-box {
    background-color: #161616;
    color: white;
    padding: 30px;
    border-radius: 15px;
    border: 2px solid #ffffff;
    width: 800px;
    max-height: 90vh;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    overflow-y: auto;
}

.popup-box button {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #7e7e7e;
    border: none;
    border-radius: 10px;
    color: #111;
    font-weight: bold;
    cursor: pointer;
    animation: popupFade .2s ease-in-out;
}

.popup-box button:hover {
    background-color: #4b4b4b;
}

@keyframes popupFade {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.popup-box h2 {
    margin-top: 0;
    text-align: center;
    font-size: 22px;
}

.popup-box p {
    margin: 5px 0;
    font-size: 16px;
    color: #ddd;
}

.popup-box img {
    width: 90%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 5px;
}

.popup-box .popup-image {
    width: 100%;
    height: auto;
    display: block;
    top: 30px;
    margin: 30px auto;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 3px solid #ffffff;
}

.popup-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.popup-info {
    text-align: left;
    flex: 1;
    border: 2px solid #ffffff;   /* borda do subbloco */ /* leve brilho */
    gap: 10px;
    background-color: #2b2b2b; /* fundo do subbloco */
    padding: 15px;            /* espaço interno */
    border-radius: 10px; 
    width: 100%;
}

.popup-info p {
    font-size: 25px;
}

.popup-info h2 {
    margin-top: 0;
    font-size: 30px;
}

.popup-top .pack-icon {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border-radius: 10px;
}

.popup-top .popup-info p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;  /* espaço entre linhas */
    color: #ddd;
}

@media (max-width: 600px) {

    body {
        padding: 10px 0;
    }

    h1.title {
        font-size: 26px;
    }

    .top-bar {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    #search {
        width: 100%;
        font-size: 14px;
        padding: 8px;
    }

    button, input, select {
        padding: 20px 25px;
        font-size: 20px;
    }

    /* --- CARDS --- */
    .card {
        width: 100%;
        padding: 12px;
        margin: 10px 0;
        border-radius: 12px;
        gap: 12px;
    }

    .card-top {
        /* MUDANÇA PRINCIPAL: Altera de lado a lado para empilhado (Coluna) */
        flex-direction: column; 
        /* Centraliza o ícone e o conteúdo horizontalmente */
        align-items: center; 
        gap: 10px;
    }

    /* 2. Ajustar o Tamanho do Ícone */
    .card-icon {
        /* Aumentar um pouco o tamanho do ícone para dar destaque */
        width: 120px; 
        height: 120px;
        /* Remover o display flex (se ele estivesse sendo aplicado indevidamente) */
        display: block; 
    }

    /* 3. Ajustar o Conteúdo do Card */
    .card-content {
        /* Garante que o conteúdo ocupe a largura total */
        width: 100%; 
        /* Alinha o texto à esquerda (ou centralizado, se preferir) */
        text-align: left; 
    }

    /* Ocultar o botão 'i' em telas muito pequenas, ou movê-lo para o canto superior direito do card-top */
    .card-content .more-info {
        top: 0;
        right: 0;
        /* Posiciona em relação ao card-top (se o card-top for position: relative) */
        position: absolute; 
    }

    .card-content h3 {
        font-size: 18px;
    }

    .card-content p {
        font-size: 14px;
        max-height: none;
    }

    .card-content button {
        font-size: 14px;
        padding: 6px 10px;
    }

    .more-info {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .card-screenshot {
        width: 100%;
        border-radius: 8px;
        max-height: 200px;
        object-fit: cover;
    }

    /* POPUP */
    .popup-box {
        width: 90%;
        height: 85vh;
    }

    .popup-top {
        flex-direction: column;
        text-align: center;
    }

    .pack-icon {
        width: 120px;
        height: 120px;
    }

    .popup-info p {
        font-size: 14px;
    }

    .cards-grid {
        grid-template-columns: 1fr; /* Volta para uma única coluna */
        gap: 20px 0; /* Ajusta o espaçamento quando é 1 coluna */
        padding: 0 10px;
    }
    
    /* Ajustes no card para mobile dentro da media query */
    .card {
        max-width: 100%; /* Garante que o card ocupe 100% do container */
    }
}

#popup {
    display: none; /* MUITO IMPORTANTE */
}

#popup {
    scrollbar-width: thin;
}

#popup::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar {
    width: 10px; 
}

::-webkit-scrollbar-track {
    background: #111;   
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    border: 2px solid #222; /* borda */
    background: #444;         /* parte que desliza */
}

::-webkit-scrollbar-thumb:hover {
    background: #666;         /* quando passa o mouse */
}

#pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px;
    margin-bottom: 100px;
    border-radius: 12px;
    border: 2px solid #ffffff;
    padding: 15px 25px;
    box-shadow: 0 0 12px #ffffff88;
    background-color: #1a1a1a;
}

#pagination button {
    padding: 10px 20px;
    border-radius: 6px;
    background: #222;
    color: white;
    border: 1px solid #ffffffab;
    cursor: pointer;
    font-size: 18px;
}

#pagination button:hover:not(.active-page) {
    background: #444;
}

#pagination .active-page {
    background: #006eff;
    font-weight: bold;
}

.no-scroll {
    overflow: hidden;
    height: 100vh;
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: 1fr; /* Uma coluna apenas */
        gap: 20px;
        padding: 0 15px;
    }

    .top-bar {
        padding: 0 15px;
    }

    .filter-group {
        gap: 8px;
    }

    /* Reduzindo o exagero do padding em botões e inputs */
    input, select, button, .top-bar select, .top-bar input {
        padding: 12px 15px !important;
        font-size: 16px !important;
    }

    #search {
        margin: 10px 0;
        width: 100%; /* Ocupa a largura total sem transbordar */
    }
}

/* Ajustes para Celulares (Smartphones) */
@media (max-width: 600px) {
    body {
        background-attachment: scroll; /* Melhora performance em mobile */
    }

    .title {
        margin: 10px auto 30px auto;
        max-width: 90%;
    }

    /* Card Mobile: Empilhar ícone e texto */
    .card-top {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .card-icon {
        width: 120px;
        height: 120px;
        margin: 0 0 10px 0;
    }

    .card-content {
        padding: 10px;
        text-align: center;
    }

    .card-content .more-info {
        top: -10px;
        right: -10px;
        width: 30px;
        height: 30px;
    }

    .card-content h3 {
        font-size: 16px;
    }

    .card-content p {
        font-size: 14px;
        max-height: none; /* Deixa o texto expandir no mobile */
    }

    /* Popups Mobile */
    .popup-box {
        width: 95%;
        padding: 15px;
        max-height: 95vh;
    }

    .popup-top {
        flex-direction: column;
    }

    .popup-top .pack-icon {
        width: 150px;
        height: 150px;
    }

    .popup-info h2 {
        font-size: 20px;
        margin-top: 10px;
    }

    .popup-info p {
        font-size: 14px !important;
    }

    /* Paginação */
    #pagination {
        padding: 10px;
        flex-wrap: wrap;
        margin-bottom: 80px;
    }

    #pagination button {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* Ajuste para telas muito pequenas (iPhone SE / etc) */
@media (max-width: 380px) {
    .filter-group {
        flex-direction: column;
    }

    .filter-group select, 
    .filter-group button {
        width: 100%;
    }
}

/* Garante que o popup não suma ao clicar se estiver ativo */
.popup-bg[style*="display: flex"] {
    display: flex !important;
}

.add-pack-btn {
    background-color: #2b7cff;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 16px;
    cursor: pointer;
}

.add-pack-btn:hover {
    background-color: #1a62d6;
}

.invite-box h2 {
    margin-top: 0;
    font-size: 24px;
}

.invite-box p {
    margin: 5px 0;
    font-size: 20px;
    color: #ddd;
}

.invite-box p { font-size: 16px; color: #ddd; }

@media (max-width: 600px) {
    .invite-box { padding: 18px; }
    .invite-box h2 { font-size: 20px; }
}

.site-footer {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    justify-content: center;
    pointer-events: auto;
    z-index: 500; /* below popups (999) */
}

.footer-inner {
    background: rgba(20,20,20,0.66);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 8px 12px;
    border-radius: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    transition: transform .12s ease, background-color .12s ease;
    font-weight: 500;
}

.social-btn svg { display: block; }
.social-label { display: inline-block; }

.social-btn:hover { transform: translateY(-3px); }

.social-btn.youtube { background: rgba(255,0,0,0.12); }
.social-btn.discord { background: rgba(114,137,218,0.08); }
.social-btn.github { background: rgba(255,255,255,0.04); }
.social-btn.admin { background: rgba(100,181,246,0.12); }

@media (max-width: 540px) {
    .site-footer { left: 8px; right: 8px; bottom: 8px; }
    .social-label { display: none; } /* hide text labels on small screens */
    .social-btn { padding: 8px; }
}

.pack-icon {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
    filter: drop-shadow(0 0 12px #ffffffc5);
}

.popup-bottom-content .description-block {
    margin-top: 20px;
    padding: 15px;
    background: rgba(43, 43, 43, 0.76);
    border-left: 5px solid #00aaff;
    border-radius: 4px;
    color: #ccc;
    text-align: left;
}

.popup-top .title-popp {
    text-align: center;
}

.popup-top .popup-info .info-details-list p {
    font-size: 20px;
    margin: 6px 0;
}

.popup-top .popup-info .download-btn {
    color: white;
    background-color: #006eff;
}

.popup-bottom-content .action-links .details-btn {
    padding: 10px 18px;
    font-size: 18px;
    border-radius: 25px;
    background-color: #646464;
    color: #fff;
}

.popup-box.closepopup {
    margin-top: 20px;
    padding: 12px 24px;
    font-size: 18px;
    border-radius: 12px;
    background-color: #7e7e7e;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
    animation: popupFade .2s ease-in-out;
}

/* No seu arquivo style.css */

/* Estilos de Brilho Amarelo para o Título (Mantido) */

.featured-star {
    font-size: 1.2em; 
    margin-right: 5px;
}

/* Mobile background fixes: force scroll on touch devices and provide pseudo-element fallback */
@media (pointer: coarse), (hover: none) {
        body {
                background-attachment: scroll !important;
        }
}

/* Alternative approach: use a pseudo-element for a fixed desktop background
     and switch it to absolute positioning on mobile so it scrolls with content. */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('/img/bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: -1;
    pointer-events: none;
}

@media (pointer: coarse), (max-width: 900px) {
    /* On touch / small screens hide the fixed pseudo-element to avoid
         duplication and performance issues, then use the body's background
         which will scroll normally. */
    body::before { display: none !important; }

    body {
        background-image: url('/img/bg.png');
        background-size: cover;
        background-repeat: no-repeat;
        background-position: center;
        background-attachment: scroll !important;
    }
}