/* ============================================================
   KEY4GAMES — catalog / archive (rendered from the API)
   ============================================================ */
.cat-layout{display:grid;grid-template-columns:262px 1fr;gap:28px;align-items:start;padding:6px 0 60px}
.cat-content{min-width:0}
.cat-layout.is-loading{opacity:.55;pointer-events:none;transition:opacity .2s}

/* ---- sidebar filters ---- */
.filters{position:sticky;top:calc(var(--header-h) + 16px);display:flex;flex-direction:column;gap:14px}
.fblock{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px}
.fblock h4{font-size:11px;font-weight:800;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:14px}
.fsearch{display:flex;align-items:center;background:var(--bg2);border:1px solid var(--line);border-radius:10px;overflow:hidden}
.fsearch:focus-within{border-color:rgba(139,92,246,.5)}
.fsearch input{flex:1;min-width:0;background:none;border:none;color:var(--text);padding:9px 12px;font-size:13.5px}
.fsearch input::placeholder{color:var(--dim)}
.fsearch input:focus{outline:none}
.fsearch button{width:38px;align-self:stretch;display:grid;place-items:center;background:var(--grad)}
.fsearch button svg{width:15px;height:15px;stroke:#fff;fill:none;stroke-width:2.2;stroke-linecap:round}

.fopts{list-style:none;display:flex;flex-direction:column;gap:1px}
.fopt{display:flex;align-items:center;gap:9px;padding:7px 8px;border-radius:8px;color:var(--muted);font-size:13px;transition:.15s}
.fopt:hover{background:rgba(255,255,255,.04);color:var(--text)}
.fdot{width:14px;height:14px;border:1.5px solid var(--line2);border-radius:5px;flex-shrink:0;transition:.15s}
.fopt.is-on{color:var(--text)}
.fopt.is-on .fdot{background:var(--grad);border-color:transparent;box-shadow:inset 0 0 0 2px var(--panel)}
.fopt .cnt{margin-left:auto;font-size:11.5px;color:var(--dim)}
.fopt.is-on .cnt{color:var(--muted)}
.freset{display:block;text-align:center;padding:10px;border:1px dashed var(--line2);border-radius:10px;color:var(--muted);font-size:13px;font-weight:600;transition:.2s}
.freset:hover{border-color:var(--violet);color:var(--text)}

/* ---- toolbar ---- */
.toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:20px}
.fchips{display:flex;flex-wrap:wrap;gap:8px}
.fchip{display:inline-flex;align-items:center;gap:7px;padding:6px 10px;background:rgba(139,92,246,.12);border:1px solid rgba(139,92,246,.35);border-radius:8px;font-size:12.5px;font-weight:600;color:var(--text);transition:.2s}
.fchip:hover{background:rgba(139,92,246,.2)}
.fchip svg{stroke:currentColor;fill:none;stroke-width:2.4;stroke-linecap:round}
.sortform{margin-left:auto}
.sortform select{background:var(--panel);border:1px solid var(--line);border-radius:10px;color:var(--text);font-size:13px;font-weight:600;padding:9px 34px 9px 14px;cursor:pointer;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e94ab' stroke-width='2' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>");background-repeat:no-repeat;background-position:right 12px center}
.sortform select:focus{outline:none;border-color:rgba(139,92,246,.5)}

.cat-empty{padding:60px 0;text-align:center;color:var(--muted)}

/* ---- pagination ---- */
.pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px;margin-top:36px}
.pg{min-width:40px;height:40px;padding:0 12px;display:inline-grid;place-items:center;border:1px solid var(--line);border-radius:10px;color:var(--muted);font-size:13.5px;font-weight:600;transition:.2s}
.pg:hover{color:var(--text);border-color:var(--line2)}
.pg.active{background:var(--grad);color:#fff;border-color:transparent}
.pg.dots{border:none;pointer-events:none}
.pg svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* ---- responsive ---- */
.cat-filters-toggle{display:none}
@media (max-width:1020px){
  .cat-layout{grid-template-columns:1fr}
  .cat-filters-toggle{display:inline-flex;align-items:center;gap:8px;justify-content:center;width:100%;padding:13px;margin-bottom:16px;background:var(--panel);border:1px solid var(--line2);border-radius:12px;font-weight:600;color:var(--text);font-size:14px}
  .cat-filters-toggle svg{stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;transition:transform .2s}
  .cat-layout.filters-open .cat-filters-toggle svg{transform:rotate(180deg)}
  .filters{display:none;position:static;flex-direction:row;flex-wrap:wrap}
  .cat-layout.filters-open .filters{display:flex}
  .filters .fblock{flex:1;min-width:220px}
}
@media (max-width:640px){
  .filters .fblock{min-width:100%}
  .toolbar{gap:10px}
  .sortform{margin-left:0;width:100%}
  .sortform select{width:100%}
}
