/* Liste des cartes DM5 */
.cards-sub { margin: 0 0 1rem; color: var(--carnelian); font-style: italic; }
.cards-tools { display: flex; gap: .8rem 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
#q { flex: 1 1 260px; padding: .6rem .9rem; font: inherit; color: var(--ink); background: #fffaf0;
  border: 2px solid var(--gold); border-radius: 0; }
#q:focus { outline: 3px solid var(--turquoise); outline-offset: 1px; }
#count { color: var(--lapis-deep); font-family: 'Cinzel', serif; font-size: .9rem; white-space: nowrap; }
.opt { flex: 1 1 100%; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.opt input { accent-color: var(--lapis); width: 1.1rem; height: 1.1rem; cursor: pointer; }
.table-box { border: 2px solid var(--gold); background: #fffaf0; }
.scroll { max-height: 70vh; overflow: auto; }
#t { width: 100%; border-collapse: collapse; }
#t thead th { position: sticky; top: 0; z-index: 1; background: var(--lapis); color: var(--gold-light);
  text-align: left; padding: .7rem 1rem; font: 500 .9rem 'Cinzel', serif; letter-spacing: .05em;
  border-bottom: 3px solid var(--gold); cursor: pointer; user-select: none; }
#t thead th:hover { background: var(--lapis-deep); }
#t thead th.asc::after { content: " \25B2"; font-size: .7em; }
#t thead th.desc::after { content: " \25BC"; font-size: .7em; }
#t tbody tr:nth-child(even) { background: rgba(200,160,58,.14); }
#t tbody tr:hover { background: rgba(42,140,130,.2); }
#t td { padding: .45rem 1rem; border-bottom: 1px solid rgba(142,47,28,.2); }
#t td.num { width: 5.5rem; color: var(--lapis); font-weight: 700; font-variant-numeric: tabular-nums; }
#t td.pw { width: 10rem; font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; }
#t td.pw.none { color: #8a7a60; }
#t td.pw.extra { color: #1f5fbf; font-weight: 600; }
#t tr.hidden { display: none; }

/* Mobile : tableau plus compact */
@media (max-width: 800px) {
  .cards-tools { gap: .5rem .8rem; margin-bottom: .7rem; }
  #q { padding: .45rem .6rem; font-size: .9rem; }
  #count { font-size: .8rem; }
  .opt { font-size: .85rem; line-height: 1.3; gap: .4rem; }
  .opt input { width: .95rem; height: .95rem; }
  .scroll { max-height: 65vh; }
  #t { font-size: .8rem; line-height: 1.3; }
  #t thead th { padding: .4rem .5rem; font-size: .7rem; letter-spacing: .02em; }
  #t td { padding: .25rem .5rem; }
  #t td.num { width: 2.6rem; }
  #t td.pw { width: 5.6rem; letter-spacing: 0; }
}

/* Mots de passe DM7 & 8 : filtre par jeu (boutons segmentés) et pastilles */
.game-filter { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.game-filter-label { margin-right: .4rem; font: 500 .9rem 'Cinzel', serif; color: var(--lapis-deep); }
.game-filter label { cursor: pointer; }
.game-filter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.game-filter label span { display: inline-block; padding: .35rem .9rem; border: 2px solid var(--gold);
  background: #fffaf0; color: var(--lapis-deep); font-size: .95rem; line-height: 1.3; transition: background .15s, color .15s; }
.game-filter label:hover span { background: var(--sand); }
.game-filter input:checked + span { background: var(--lapis); color: var(--gold-light); }
.game-filter input:focus-visible + span { outline: 3px solid var(--turquoise); outline-offset: 2px; }
.tag { display: inline-block; padding: .05rem .55rem; margin: .1rem .25rem .1rem 0; border: 1px solid var(--gold);
  font: 500 .72rem/1.5 'Cinzel', serif; letter-spacing: .02em; white-space: nowrap; }
.tag-sc { background: var(--lapis); color: var(--gold-light); }
.tag-rd { background: var(--carnelian); color: var(--papyrus); }
#t td.name { font-weight: 500; }
#t td.games { width: 14rem; }
@media (max-width: 800px) {
  .game-filter { gap: .35rem; }
  .game-filter-label { flex: 1 1 100%; margin: 0; font-size: .75rem; }
  .game-filter label span { padding: .3rem .6rem; font-size: .8rem; }
  .tag { font-size: .6rem; padding: 0 .3rem; margin-right: .15rem; }
  #t td.games { width: 6rem; }
}
