/* A antiga faixa fica oculta desde o primeiro quadro. O módulo a remove
   após inicializar as fichas, ainda usadas pela galeria em Sobre o projeto. */
#main > .intro { display: none !important; }
#library-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  padding: 24px 0 16px;
  /* Navegação e catálogo pertencem à mesma superfície, sem um segundo filete. */
  border-bottom: 0;
}
#library-controls > .library-navigation {
  margin: 0;
  padding: 0;
  border: 0;
  gap: 8px;
}
#library-controls > .category-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
#library-controls > .category-choices > button {
  font: 400 14px/1.4 var(--font-ui);
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid #87977c;
  border-radius: 30px;
  background: transparent;
  color: #30412f;
  box-shadow: none;
}
#library-controls > .category-choices > button::before { display: none; }
#library-controls > .category-choices > button[aria-pressed='true'] { background: #e9d18a; border-color: #856a22; }
#library-controls > .category-choices > button:hover { background: #eadeb8; }
#library-controls > .category-choices[hidden],
#library-controls:has(> .category-choices[hidden]):not(:has(> .library-navigation)) { display: none; }
#main > .games > .game-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.opening-category-count { font: 400 12px/1.4 var(--font-ui); letter-spacing: 0; text-transform: none; }
#main > .games > button:not(.game-info-nav) > span:not(.game-nav-icon) { display: none; }
#main > .games > button:not(.game-info-nav) {
  font-family:var(--font-ui);
  /* Reserva o ícone de informação e 16px de margem até a borda do cartão. */
  padding-right: 60px;
}
@media(min-width: 761px) {
  #main > .games { grid-template-columns: repeat(6,minmax(0,1fr)); }
  #main > .games > button:not(.game-info-nav) { grid-column: span 2; }
  #main > .games > button[data-game] { grid-column: span 3; }
}
@media(max-width:760px) {
  #library-controls { gap: 16px; padding: 20px 0 16px; }
  #library-controls > .category-choices { gap: 7px; }
  #library-controls > .category-choices > button { padding: 10px 12px; font-size: 13px; }
  #main > .games > button:not(.game-info-nav) { padding-left: 48px; }
  #main > .games > button.has-game-nav-icon > .game-nav-icon { left: 14px; }
}
@media(max-width:480px) {
  #main > .games { grid-template-columns: minmax(0,1fr); }
  #main > .games > button:not(.game-info-nav) { min-height: 118px; }
}

/* Na biblioteca, a última rota não deve parecer uma seleção ativa. */
#main > .games:not([hidden]) > button:not(.game-info-nav)[aria-pressed='true'] {
  background: #fffaf0;
  border-color: #87977c;
  color: #30412f;
}
#main > .games:not([hidden]) > button[aria-pressed='true'] small { color: #445440; }

/* Título e filtros compartilham uma linha, mantendo a ordem de leitura no celular. */
.library-heading-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  /* Afasta os filtros da divisória sem aumentar o espaço abaixo do título. */
  padding-block: 28px 16px;
}
.library-heading-row > .category-heading { margin: 0; padding: 0; gap: 12px; }
.library-heading-row > #library-controls { padding: 0; margin-inline-start: auto; }
.library-heading-row #categories { justify-content: flex-end; }
body.approved-game-view .library-heading-row { padding-block: 8px 12px; }
@media(max-width:760px) {
  .library-heading-row { gap: 12px; }
  .library-heading-row > .category-heading { flex: 1 0 100%; }
  .library-heading-row > #library-controls { max-width: 100%; }
}
