/**
 * settings-v2.css — Configurações refeitas: barra lateral com seções, cartões
 * por assunto e cada opção com uma linha de explicação. Substitui o modal
 * antigo (abas espremidas no topo, sem explicação e com banner de anúncio).
 */

#pxs-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: pxsFade 0.18s ease-out;
}
@keyframes pxsFade { from { opacity: 0; } to { opacity: 1; } }

#pxs-modal {
    position: fixed;
    z-index: 100001;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(1000px, calc(100vw - 32px));
    height: min(660px, 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), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: #dfe7f5;
    font-family: 'Ubuntu', system-ui, sans-serif;
    animation: pxsIn 0.2s cubic-bezier(.2, .9, .3, 1);
}
@keyframes pxsIn { from { opacity: 0; transform: translate(-50%, -47%) scale(0.985); } }

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

/* Barra de pesquisa: acha a opção sem precisar saber em que seção ela mora. */
.pxs-search {
    position: relative;
    flex: 1 1 auto;
    max-width: 340px;
    margin-left: 14px;
    display: flex;
    align-items: center;
}
.pxs-search > i {
    position: absolute;
    left: 11px;
    font-size: 12px;
    color: #6f8299;
    pointer-events: none;
}
.pxs-search input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 32px 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;
    transition: border-color 0.15s, background 0.15s;
}
.pxs-search input::placeholder { color: #64768e; }
.pxs-search input:focus { border-color: rgba(0, 190, 255, 0.5); background: rgba(0, 190, 255, 0.07); }
.pxs-search input::-webkit-search-cancel-button { display: none; }
.pxs-q-x {
    position: absolute;
    right: 6px;
    width: 22px; height: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 6px;
    background: none;
    color: #6f8299;
    font-size: 11px;
    cursor: pointer;
}
.pxs-q-x:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.pxs-x {
    margin-left: auto;
    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;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pxs-x:hover { background: rgba(255, 90, 120, 0.16); border-color: rgba(255, 90, 120, 0.4); color: #fff; }

/* ── Corpo: barra lateral + conteúdo ── */
.pxs-body { flex: 1 1 auto; display: flex; min-height: 0; }

.pxs-nav {
    flex: 0 0 216px;
    padding: 12px 10px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.015);
}
.pxs-nav-group {
    padding: 12px 10px 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #5d6f8a;
}
.pxs-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;
    transition: background 0.14s, color 0.14s;
}
.pxs-nav button i { width: 17px; text-align: center; font-size: 13px; color: #6f8299; }
.pxs-nav button:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.pxs-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;
}
.pxs-nav button.on i { color: #58c8ff; }

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

.pxs-sec-title { margin: 0 0 2px; font-size: 16px; font-weight: 800; color: #fff; }
.pxs-sec-desc { margin: 0 0 16px; font-size: 12.5px; color: #8496b3; line-height: 1.45; }

/* ── Cartão de sub-assunto (o "submenu" de cada seção) ── */
.pxs-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;
}
.pxs-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;
}
.pxs-card-head i { font-size: 12px; }

/* ── Linha de opção ── */
.pxs-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.045);
}
.pxs-card-head + .pxs-row { border-top: 0; }
.pxs-row-txt { flex: 1 1 auto; min-width: 0; }
.pxs-row-lab { font-size: 13.5px; font-weight: 700; color: #eaf2ff; }
.pxs-row-desc { margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: #8496b3; }
.pxs-row-ctl { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }

/* Interruptor */
.pxs-sw {
    position: relative;
    width: 44px; height: 24px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: background 0.16s;
}
.pxs-sw::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #b9c8de;
    transition: transform 0.16s, background 0.16s;
}
.pxs-sw.on { background: rgba(0, 200, 255, 0.42); }
.pxs-sw.on::after { transform: translateX(20px); background: #fff; }

/* Select / botões / campos */
.pxs-sel, .pxs-btn, .pxs-key {
    padding: 7px 11px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #e6eefb;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.pxs-sel { min-width: 132px; }
.pxs-sel option { background: #101827; }
.pxs-btn:hover, .pxs-key:hover { background: rgba(0, 200, 255, 0.14); border-color: rgba(0, 200, 255, 0.4); }
.pxs-btn.accent { border-color: rgba(0, 200, 255, 0.45); background: rgba(0, 200, 255, 0.14); color: #9fe4ff; }
.pxs-btn.ghost { color: #9fb0c9; }
.pxs-key {
    min-width: 92px;
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.4px;
    color: #9fe4ff;
    border-color: rgba(0, 200, 255, 0.3);
    background: rgba(0, 200, 255, 0.09);
}
.pxs-key.capturing { color: #ffd166; border-color: rgba(255, 209, 102, 0.6); background: rgba(255, 209, 102, 0.12); }

/* Slider */
.pxs-range { display: flex; align-items: center; gap: 9px; }
.pxs-range input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 150px; height: 4px; border-radius: 3px;
    background: rgba(255, 255, 255, 0.16);
    outline: none; cursor: pointer;
}
.pxs-range input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 15px; height: 15px; border-radius: 50%;
    background: #58c8ff; border: 0; cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 200, 255, 0.55);
}
.pxs-range input[type="range"]::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%;
    background: #58c8ff; border: 0; cursor: pointer;
}
.pxs-range-val {
    min-width: 54px;
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    color: #9fe4ff;
    font-variant-numeric: tabular-nums;
}

/* Cartões de escolha (radio) */
.pxs-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 12px 14px; }
.pxs-choice {
    display: block;
    padding: 11px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: border-color 0.14s, background 0.14s;
}
.pxs-choice:hover { border-color: rgba(0, 200, 255, 0.35); }
.pxs-choice.on { border-color: rgba(0, 200, 255, 0.65); background: rgba(0, 200, 255, 0.1); }
.pxs-choice-t { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; color: #eaf2ff; }
.pxs-choice-tag {
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(0, 200, 255, 0.2);
    color: #9fe4ff;
    font-size: 9.5px;
    font-weight: 800;
    text-transform: uppercase;
}
.pxs-choice-d { margin-top: 4px; font-size: 11.5px; line-height: 1.42; color: #8496b3; }

/* Cores (indicador do modo aba) */
.pxs-colors { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.pxs-sw-color {
    width: 24px; height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0; cursor: pointer;
}
.pxs-sw-color.on { outline: 2px solid #fff; outline-offset: 1px; }
.pxs-pick {
    width: 36px; height: 27px; padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px; background: transparent; cursor: pointer;
}

/* Aviso dentro de um cartão */
.pxs-note {
    margin: 0 14px 12px;
    padding: 9px 11px;
    border-radius: 9px;
    border: 1px solid rgba(255, 209, 102, 0.28);
    background: rgba(255, 209, 102, 0.08);
    color: #ffdca0;
    font-size: 11.5px;
    line-height: 1.45;
}

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

@media (max-width: 760px) {
    #pxs-modal { width: 100vw; height: 100vh; max-height: none; border-radius: 0; border: 0; top: 0; left: 0; transform: none; }
    @keyframes pxsIn { from { opacity: 0; } }
    .pxs-body { flex-direction: column; }
    .pxs-nav {
        flex: 0 0 auto;
        display: flex;
        gap: 6px;
        padding: 9px 10px;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        white-space: nowrap;
    }
    .pxs-nav-group { display: none; }
    .pxs-nav button { width: auto; margin: 0; padding: 8px 12px; }
    .pxs-nav button span { display: none; }
    .pxs-head { flex-wrap: wrap; }
    .pxs-search { order: 3; flex: 1 0 100%; max-width: none; margin: 10px 0 0; }
    .pxs-nav button.on span { display: inline; }
    .pxs-content { padding: 14px 13px 24px; }
    .pxs-row { flex-wrap: wrap; }
    .pxs-row-ctl { width: 100%; justify-content: flex-end; }
    .pxs-choices { grid-template-columns: 1fr; }
    .pxs-range input[type="range"] { width: 120px; }
}

/* ── Interface (Configurações › Interface) — classes postas pelo applyHud ── */
body.px-hide-lb #eps-leaderboard,
body.px-hide-score #px-score,
body.px-hide-status #eps-status { display: none !important; }

html body.px-hud-more:not(.game-menu-open) #eps-leaderboard,
html body.px-hud-more:not(.game-menu-open) #eps-mm-wrap,
html body.px-hud-more:not(.game-menu-open) #px-score,
html body.px-hud-more:not(.game-menu-open) #px-mbar,
html body.px-hud-more:not(.game-menu-open) #spx-corner-bar,
html body.px-hud-more:not(.game-menu-open) #spx-team-hud,
html body.px-hud-more:not(.game-menu-open) .team-hud-panel { opacity: .85 !important; }

html body.px-hud-full:not(.game-menu-open) #eps-leaderboard,
html body.px-hud-full:not(.game-menu-open) #eps-mm-wrap,
html body.px-hud-full:not(.game-menu-open) #px-score,
html body.px-hud-full:not(.game-menu-open) #px-mbar,
html body.px-hud-full:not(.game-menu-open) #spx-corner-bar,
html body.px-hud-full:not(.game-menu-open) #spx-team-hud,
html body.px-hud-full:not(.game-menu-open) .team-hud-panel { opacity: 1 !important; }

/* ── Engrenagem de configurações no HUD (settings-v2.js › hudGear) ──────────
   No menu é o botão largo "Configurações" do topo; ao clicar em Jogar ele
   aparece no mesmo lugar e encolhe até ficar só a engrenagem. */
#pxs-hud-gear {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 9000;
    transform: translate(-50%, -110%);
    height: 38px;
    width: 40px;
    padding: 0;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0;
    overflow: hidden;
    white-space: nowrap;
    border: 1px solid var(--pc-line, rgba(233, 239, 228, .10));
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: var(--pc-panel, #131715);
    color: var(--pc-dim, #8b958c);
    cursor: pointer;
    opacity: .55;
    transition: width .45s cubic-bezier(.65, 0, .35, 1), gap .45s cubic-bezier(.65, 0, .35, 1),
        transform .3s ease, opacity .2s ease, color .15s ease, border-color .15s ease;
}
#pxs-hud-gear i { font-size: 16px; transition: transform .6s cubic-bezier(.65, 0, .35, 1); }
#pxs-hud-gear span {
    max-width: 0;
    opacity: 0;
    font: 500 11px var(--pc-mono, ui-monospace, monospace);
    letter-spacing: .12em;
    text-transform: uppercase;
    transition: max-width .45s cubic-bezier(.65, 0, .35, 1), opacity .25s ease;
}
#pxs-hud-gear.on { display: inline-flex; transform: translate(-50%, 0); }
/* Largo = igual ao botão do menu; ao perder a classe, encolhe e a engrenagem gira. */
#pxs-hud-gear.wide { width: 230px; gap: 9px; opacity: 1; color: var(--pc-text, #e9efe4); }
#pxs-hud-gear.wide span { max-width: 180px; opacity: 1; }
#pxs-hud-gear:not(.wide) i { transform: rotate(180deg); }
#pxs-hud-gear:hover { opacity: 1; color: var(--pc-acid, #d4ff3a); border-color: var(--pc-acid, #d4ff3a); }
#pxs-hud-gear:hover i { transform: rotate(270deg); }
body.game-menu-open #pxs-hud-gear { display: none !important; }
/* No celular o HUD já tem o botão de menu (≡); a engrenagem fica só no PC. */
@media (max-width: 900px), (pointer: coarse) {
    #pxs-hud-gear { display: none !important; }
}
