.games-page .main-grid { grid-template-columns: minmax(0, 1fr) 260px; }
.games-header { margin-bottom: 14px; }
.games-header h1 { font-size: 28px; margin: 0 0 4px; }
.games-header p { margin: 0; color: var(--muted); font-size: 13px; }

.games-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 14px; padding: 12px; border: 1px solid #23295c;
  background: #0b0e31; border-radius: 12px;
}
.games-toolbar select {
  background: #0c0f32; border: 1px solid #303467; color: #fff;
  border-radius: 8px; padding: 9px 12px; min-width: 130px; cursor: pointer;
}
.games-toolbar .reset-btn {
  background: #17113f; color: #d8d9f0; border: 1px solid #2e3266;
  border-radius: 8px; padding: 9px 14px; cursor: pointer;
  margin-left: auto;
}

.games-grid {
  display: grid; gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.games-pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 18px 0 8px; flex-wrap: wrap;
}
.games-pagination button {
  min-width: 36px; height: 36px; border-radius: 8px; border: 1px solid #2e3266;
  background: #17113f; color: #d8d9f0; cursor: pointer;
}
.games-pagination button.active { background: linear-gradient(#ffd72f, #ffa900); color: #181000; border-color: #ffa900; }
.games-pagination button:disabled { opacity: .4; cursor: not-allowed; }
.games-pagination span { color: var(--muted); font-size: 12px; margin-left: 8px; }

.games-sidebar .quick-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.games-sidebar .quick-filters button {
  background: #12153d; border: 1px solid #2b3268; color: #e8ebff;
  border-radius: 10px; padding: 10px 8px; cursor: pointer; font-size: 12px;
}
.games-sidebar .quick-filters button:hover { border-color: #6947c2; }
.games-sidebar .quick-filters button.active { background: linear-gradient(#5431a8, #261261); border-color: #6947c2; }

.cat-list { display: grid; gap: 6px; }
.cat-list button {
  display: flex; justify-content: space-between; align-items: center;
  background: transparent; border: 0; color: #d8dcf5; padding: 8px 6px;
  border-radius: 8px; cursor: pointer; font-size: 13px; text-align: left;
}
.cat-list button:hover, .cat-list button.active { background: #12153d; }
.cat-list em { font-style: normal; color: #8b93c4; font-size: 12px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud button {
  background: #12153d; border: 1px solid #2b3268; color: #c5cae8;
  border-radius: 999px; padding: 6px 11px; font-size: 11px; cursor: pointer;
}
.tag-cloud button:hover, .tag-cloud button.active { border-color: #6947c2; color: #fff; }

.random-box {
  text-align: center; padding: 6px 0 2px;
}
.random-box p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.random-dice { font-size: 42px; margin-top: 8px; }

.games-loading, .games-empty {
  grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 20px;
}

.leftbar .nav-link { text-decoration: none; display: block; color: inherit; }
.side-card a.nav-link { text-decoration: none; display: block; }
.side-card a.nav-link button { width: 100%; }

@media (max-width: 1400px) {
  .games-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .games-page .main-grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .games-sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 760px) {
  .games-page .main-grid,
  .games-page .center { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
  .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
  .games-grid .game-tile-label { display: none !important; }
  .games-toolbar {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
    width: 100%;
    box-sizing: border-box;
  }
  .games-toolbar select {
    flex: 1 1 0;
    min-width: 0;
    font-size: 11px;
    padding: 7px 8px;
  }
  .games-toolbar .reset-btn {
    flex: 0 0 auto;
    margin-left: 0;
    padding: 7px 10px;
    font-size: 11px;
    white-space: nowrap;
  }
  .games-sidebar { grid-template-columns: 1fr; width: 100%; }
  .games-header h1 { font-size: 24px; }
  .games-header p { font-size: 12px; }
  .games-pagination button { min-width: 32px; height: 32px; font-size: 12px; }
}
@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
