/* =====================================================================
   RWC - janela "Filtrar por classe" do ranking (tema escuro e claro)
===================================================================== */
:root { --fcl-ouro: #f5c542; --fcl-ouro2: #d9a520; --fcl-ouro-txt: #1f1500; }

/* botao no formulario */
.fcl-botao { display: flex; align-items: center; gap: .45rem; min-height: 38px; cursor: pointer; overflow: hidden; white-space: nowrap; }
.fcl-mini { display: inline-flex; flex: none; }
.fcl-mini img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; border: 1px solid var(--bg-card); margin-left: -6px; }
.fcl-mini img:first-child { margin-left: 0; }
.fcl-texto { overflow: hidden; text-overflow: ellipsis; }

/* janela */
.fcl-modal .modal-content {
    background: var(--bg-card); color: var(--text-primary);
    border: 1px solid var(--border-color); border-radius: 18px; box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.fcl-modal .modal-header { border-bottom: 0; padding: 1.25rem 1.25rem .5rem; align-items: flex-start; gap: 1rem; }
.fcl-modal .modal-title { font-weight: 800; font-size: 1.3rem; margin-bottom: .55rem; }
.fcl-ajuda { color: var(--text-muted); font-size: .86rem; font-weight: 600; }
.fcl-fechar {
    flex: none; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
    background: var(--bg-darker); border: 1px solid var(--border-color); color: var(--text-primary); font-size: 1rem;
}
.fcl-fechar:hover { border-color: var(--text-muted); }
.fcl-modal .modal-body { padding: .75rem 1.25rem 1.25rem; }
.fcl-modal .modal-footer { border-top: 1px solid var(--border-color); padding: .9rem 1.25rem; gap: .6rem; }

/* grade de classes */
.fcl-grade { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; }
.fcl-classe {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem;
    padding: .8rem .4rem .7rem; border-radius: 14px; cursor: pointer;
    background: var(--bg-darker); border: 1.5px solid var(--border-color); color: var(--text-primary);
    transition: border-color .15s, background .15s, transform .12s;
}
.fcl-classe:hover { border-color: var(--text-muted); transform: translateY(-1px); }
.fcl-classe:focus-visible { outline: 2px solid var(--fcl-ouro); outline-offset: 2px; }
.fcl-classe img { width: 58px; height: 60px; border-radius: 8px; object-fit: cover; filter: grayscale(.15); transition: filter .15s; }
.fcl-classe span { font-size: .8rem; font-weight: 700; line-height: 1.2; text-align: center; }
.fcl-check {
    position: absolute; top: .4rem; right: .4rem; width: 20px; height: 20px; border-radius: 50%;
    display: grid; place-items: center; font-size: .8rem; color: var(--fcl-ouro-txt); background: var(--fcl-ouro);
    opacity: 0; transform: scale(.6); transition: opacity .15s, transform .15s;
}
.fcl-classe.ativo {
    border-color: var(--fcl-ouro);
    background: color-mix(in srgb, var(--fcl-ouro) 12%, var(--bg-darker));
    box-shadow: 0 0 0 1px var(--fcl-ouro) inset;
}
.fcl-classe.ativo img { filter: none; }
.fcl-classe.ativo .fcl-check { opacity: 1; transform: scale(1); }

/* rodape */
.fcl-contagem { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.fcl-limpar {
    border-radius: 12px; padding: .6rem 1rem; font-weight: 700;
    background: var(--bg-darker); border: 1px solid var(--border-color); color: var(--text-primary);
}
.fcl-limpar:hover { border-color: var(--text-muted); color: var(--text-primary); background: var(--bg-darker); }
.fcl-pronto {
    border-radius: 12px; padding: .6rem 1.4rem; font-weight: 800; border: 0;
    background: linear-gradient(180deg, var(--fcl-ouro), var(--fcl-ouro2)); color: var(--fcl-ouro-txt);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--fcl-ouro) 35%, transparent);
}
.fcl-pronto:hover { filter: brightness(1.06); color: var(--fcl-ouro-txt); }

html[data-theme="light"] .fcl-modal .modal-content { box-shadow: 0 24px 60px rgba(15,23,42,.18); }
html[data-theme="light"] .fcl-classe, html[data-theme="light"] .fcl-fechar, html[data-theme="light"] .fcl-limpar { background: #f8fafc; }
html[data-theme="light"] .fcl-classe.ativo { background: #fff8e1; }

@media (max-width: 767px) { .fcl-grade { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 575px) {
    .fcl-grade { grid-template-columns: repeat(3, 1fr); gap: .5rem; }
    .fcl-classe img { width: 48px; height: 50px; }
    .fcl-classe span { font-size: .74rem; }
    .fcl-contagem { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fcl-classe, .fcl-check, .fcl-classe img { transition: none; } }
