/**
 * gallery-v2.css — Galeria de skins, chapéus e efeitos refeita.
 * Mesma linguagem visual das Configurações (settings-v2): fundo escuro, barra
 * lateral de seções, cartões e explicações. O modal antigo (#gallery-modal)
 * deixa de ser usado — ver gallery-v2.js.
 */

#pxg-back {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(4, 8, 16, 0.72);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: pxgFade 0.18s ease-out;
}
@keyframes pxgFade { from { opacity: 0; } }

#pxg-modal {
    position: fixed;
    z-index: 100001;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(1040px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(120, 190, 255, 0.22);
    background: linear-gradient(180deg, #101827 0%, #0b111c 100%);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65);
    color: #dfe7f5;
    font-family: 'Ubuntu', system-ui, sans-serif;
    animation: pxgIn 0.2s cubic-bezier(.2, .9, .3, 1);
}
@keyframes pxgIn { from { opacity: 0; transform: translate(-50%, -47%) scale(0.985); } }

/* ── Cabeçalho ── */
.pxg-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.pxg-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: #fff; }
.pxg-head h2 i { color: #58c8ff; margin-right: 8px; font-size: 15px; }

/* Prévia do que está equipado, no cabeçalho */
.pxg-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 6px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
}
.pxg-cell {
    position: relative;
    width: 34px; height: 34px;
    flex: none;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #2b3a5c, #16203a);
    border: 2px solid rgba(255, 255, 255, 0.16);
    overflow: hidden;
}
.pxg-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pxg-cell .pxg-hat {
    position: absolute;
    top: -8px; left: 50%;
    width: 26px; height: 26px;
    transform: translateX(-50%);
    object-fit: contain;
    overflow: visible;
}
.pxg-eq { font-size: 11px; line-height: 1.35; color: #8496b3; }
.pxg-eq b { display: block; color: #eaf2ff; font-size: 12px; font-weight: 700; }

.pxg-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 300px;
    margin-left: auto;
    display: flex;
    align-items: center;
}
.pxg-search > i { position: absolute; left: 11px; font-size: 12px; color: #6f8299; pointer-events: none; }
.pxg-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px 9px 31px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: #eaf2ff;
    font-family: inherit;
    font-size: 12.5px;
    outline: none;
}
.pxg-search input:focus { border-color: rgba(0, 190, 255, 0.5); background: rgba(0, 190, 255, 0.07); }
.pxg-x {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: #9fb0c9;
    font-size: 15px;
    cursor: pointer;
}
.pxg-x:hover { background: rgba(255, 90, 120, 0.16); border-color: rgba(255, 90, 120, 0.4); color: #fff; }

/* ── Corpo ── */
.pxg-body { flex: 1 1 auto; display: flex; min-height: 0; }
.pxg-nav {
    flex: 0 0 196px;
    padding: 12px 10px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.015);
}
.pxg-nav button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    margin-bottom: 3px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: none;
    color: #b9c8de;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.pxg-nav button i { width: 17px; text-align: center; font-size: 13px; color: #6f8299; }
.pxg-nav button:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.pxg-nav button.on {
    background: linear-gradient(90deg, rgba(0, 190, 255, 0.18), rgba(0, 190, 255, 0.05));
    border-color: rgba(0, 190, 255, 0.32);
    color: #fff;
}
.pxg-nav button.on i { color: #58c8ff; }
.pxg-nav .pxg-count {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 10px;
    font-weight: 800;
    color: #9fb0c9;
}

.pxg-content { flex: 1 1 auto; min-width: 0; padding: 16px 18px 24px; overflow-y: auto; }
.pxg-content::-webkit-scrollbar { width: 9px; }
.pxg-content::-webkit-scrollbar-thumb { background: rgba(140, 175, 220, 0.22); border-radius: 5px; }

.pxg-sec-title { margin: 0 0 2px; font-size: 16px; font-weight: 800; color: #fff; }
.pxg-sec-desc { margin: 0 0 14px; font-size: 12.5px; color: #8496b3; line-height: 1.45; }
.pxg-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #8fd4ff;
}
.pxg-group:first-child { margin-top: 4px; }
.pxg-group .pxg-line { flex: 1 1 auto; height: 1px; background: rgba(255, 255, 255, 0.07); }

/* ── Grade de itens ── */
.pxg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 11px;
}
.pxg-item {
    position: relative;
    padding: 11px 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.14s, background 0.14s, transform 0.12s;
}
.pxg-item:hover { border-color: rgba(0, 200, 255, 0.45); background: rgba(0, 200, 255, 0.07); transform: translateY(-2px); }
.pxg-item.on { border-color: rgba(0, 200, 255, 0.8); background: rgba(0, 200, 255, 0.13); }
.pxg-item.on::after {
    content: '\\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 6px; right: 7px;
    font-size: 10px;
    color: #04121c;
    background: #00d4ff;
    width: 17px; height: 17px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.pxg-thumb {
    width: 62px; height: 62px;
    margin: 0 auto 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.pxg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pxg-item.hat .pxg-thumb { background: rgba(255, 255, 255, 0.03); }
.pxg-item.hat .pxg-thumb img { object-fit: contain; padding: 8px; box-sizing: border-box; }
.pxg-name {
    font-size: 11px;
    font-weight: 700;
    color: #cfe0f5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pxg-tag {
    display: inline-block;
    max-width: 100%;
    margin-top: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    /* a célula tem ~88px: etiqueta comprida corta em vez de estourar a grade */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pxg-tag.priv { background: rgba(255, 209, 102, 0.16); color: #ffd166; }
.pxg-tag.wait { background: rgba(160, 160, 255, 0.16); color: #b3b3ff; }
.pxg-tag.no { background: rgba(255, 120, 140, 0.16); color: #ff9aad; }
.pxg-tag.ok { background: rgba(111, 240, 165, 0.16); color: #6ff0a5; }
.pxg-tag.gif { background: rgba(0, 200, 255, 0.16); color: #7fd0ff; }

/* Item "nenhum" */
.pxg-item.none .pxg-thumb { border-style: dashed; color: #6f8299; font-size: 18px; }

/* Efeitos (auras) */
.pxg-aura .pxg-thumb { font-size: 26px; background: rgba(255, 255, 255, 0.04); }
.pxg-item.locked { opacity: 0.55; cursor: not-allowed; }
.pxg-item.locked:hover { transform: none; border-color: rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.03); }
.pxg-req { margin-top: 3px; font-size: 10px; color: #7d8ea8; }

/* ── Envio de skin ── */
.pxg-card {
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.028);
    overflow: hidden;
}
.pxg-card-head {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 12px; font-weight: 800; letter-spacing: 0.4px; text-transform: uppercase; color: #8fd4ff;
}
.pxg-drop {
    margin: 14px;
    padding: 22px 16px;
    border: 2px dashed rgba(0, 200, 255, 0.32);
    border-radius: 14px;
    background: rgba(0, 200, 255, 0.04);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.pxg-drop:hover, .pxg-drop.over { border-color: rgba(0, 200, 255, 0.7); background: rgba(0, 200, 255, 0.1); }
.pxg-drop i { font-size: 26px; color: #58c8ff; }
.pxg-drop-t { margin-top: 9px; font-size: 13.5px; font-weight: 700; color: #eaf2ff; }
.pxg-drop-d { margin-top: 4px; font-size: 11.5px; color: #8496b3; line-height: 1.45; }
.pxg-rules { margin: 0 14px 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.pxg-rule {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.035);
    font-size: 11px;
    color: #9db0cb;
}
.pxg-rule i { color: #6ff0a5; margin-right: 5px; font-size: 10px; }
.pxg-sel-file {
    display: flex; align-items: center; gap: 12px;
    margin: 0 14px 12px; padding: 11px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.035);
}
.pxg-sel-file .pxg-thumb { margin: 0; width: 54px; height: 54px; }
.pxg-sel-info { flex: 1 1 auto; min-width: 0; font-size: 12px; color: #9db0cb; }
.pxg-sel-info b { display: block; color: #eaf2ff; font-size: 13px; margin-bottom: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pxg-vis { display: flex; gap: 8px; margin: 0 14px 12px; }
.pxg-vis label {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    font-size: 12px;
}
.pxg-vis label.on { border-color: rgba(0, 200, 255, 0.6); background: rgba(0, 200, 255, 0.1); }
.pxg-vis b { display: block; font-size: 12.5px; color: #eaf2ff; margin-bottom: 3px; }
.pxg-vis span { color: #8496b3; line-height: 1.4; }
.pxg-btn {
    padding: 10px 16px;
    border-radius: 11px;
    border: 1px solid rgba(0, 200, 255, 0.45);
    background: rgba(0, 200, 255, 0.16);
    color: #9fe4ff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.pxg-btn:hover { filter: brightness(1.15); }
.pxg-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.pxg-btn.ghost { border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.05); color: #cfe0f5; }
.pxg-btn.danger { border-color: rgba(255, 120, 140, 0.5); background: rgba(255, 120, 140, 0.14); color: #ffb3c0; }
.pxg-actions { display: flex; gap: 9px; margin: 0 14px 14px; align-items: center; }
.pxg-msg { margin: 0 14px 12px; font-size: 12px; line-height: 1.5; }
.pxg-msg.err { color: #ff9aad; }
.pxg-msg.ok { color: #6ff0a5; }
.pxg-note {
    margin: 0 14px 12px;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid rgba(255, 209, 102, 0.26);
    background: rgba(255, 209, 102, 0.07);
    color: #ffdca0;
    font-size: 11.5px;
    line-height: 1.45;
}
.pxg-empty { padding: 26px 10px; text-align: center; color: #7d8ea8; font-size: 12.5px; }
.pxg-empty i { display: block; font-size: 24px; margin-bottom: 8px; color: #4f6178; }

/* Rodapé */
.pxg-foot {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11.5px; color: #6f8299;
}
.pxg-foot .pxg-btn { margin-left: auto; padding: 7px 13px; font-size: 12px; }

@media (max-width: 760px) {
    #pxg-modal { width: 100vw; height: 100dvh; max-height: none; border-radius: 0; border: 0; top: 0; left: 0; transform: none; }
    @keyframes pxgIn { from { opacity: 0; } }
    .pxg-head { flex-wrap: wrap; }
    .pxg-search { order: 4; flex: 1 0 100%; max-width: none; margin: 9px 0 0; }
    .pxg-body { flex-direction: column; }
    .pxg-nav {
        flex: 0 0 auto; display: flex; gap: 6px; padding: 9px 10px;
        overflow-x: auto; border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        white-space: nowrap;
    }
    .pxg-nav button { width: auto; margin: 0; padding: 8px 12px; }
    .pxg-nav .pxg-count { display: none; }
    .pxg-content { padding: 13px 12px 22px; }
    .pxg-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 9px; }
    .pxg-thumb { width: 54px; height: 54px; }
    .pxg-vis { flex-direction: column; }
}

/* Chapéus/efeitos desativados temporariamente (gallery-v2.js → offNotice) */
.pxg-off {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 0 14px 14px;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid rgba(255, 176, 77, 0.35);
    background: rgba(255, 176, 77, 0.08);
    color: #ffdca0;
    font-size: 12.5px;
    line-height: 1.45;
}
.pxg-off > i { font-size: 18px; margin-top: 2px; color: #ffb04d; }
.pxg-off b { display: block; color: #ffe2b3; font-size: 13.5px; margin-bottom: 2px; }
.pxg-off span { opacity: .85; }
.pxg-grid.pxg-disabled { opacity: .38; filter: grayscale(.85); pointer-events: none; user-select: none; }
/* Prévia da skin no menu: sem chapéu enquanto estiver desativado. */
#hat-preview-img, #dual-hat-preview-img { display: none !important; }

/* ── Excluir skin enviada (Minhas skins) ─────────────────────────────────── */
.pxg-del {
    position: absolute;
    top: 5px; left: 6px;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(10, 14, 20, 0.75);
    color: #ff9aad;
    font-size: 10px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0.75;
    transition: opacity 0.12s, background 0.12s, border-color 0.12s;
}
.pxg-item:hover .pxg-del,
.pxg-del:focus-visible { opacity: 1; }
.pxg-del:hover { background: rgba(255, 90, 110, 0.25); border-color: rgba(255, 120, 140, 0.6); }
.pxg-delask {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    background: rgba(10, 14, 20, 0.95);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px;
    padding: 6px;
    cursor: default;
}
.pxg-delask span { font-size: 11px; font-weight: 800; color: #e6eefb; line-height: 1.25; }
.pxg-delask small { font-size: 9.5px; color: #ff9aad; line-height: 1.2; }
.pxg-delrow { display: flex; gap: 5px; }
.pxg-delask button {
    border: 0;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 10.5px;
    font-weight: 800;
    cursor: pointer;
}
.pxg-delask .yes { background: #ff5a6e; color: #fff; }
.pxg-delask .yes:disabled { opacity: 0.6; cursor: wait; }
.pxg-delask .no { background: rgba(255, 255, 255, 0.12); color: #e6eefb; }
