/* The player lists (player-list.js, player-picker.js) and their toolbar (player-filter-bar.js):
   a search, Filter and Sort buttons with a panel of option chips, the filters in use as chips, a
   clean table with sortable headers, and a floating dark bar for the ticked players. */
.pl-toolbar { position: relative; margin-bottom: 14px; }
.pl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.pl-row .search { margin-bottom: 0; flex: 1 1 240px; max-width: 420px; }
.pl-button { display: inline-flex; align-items: center; gap: 7px; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--gray-200); border-radius: 980px; padding: 8px 15px; cursor: pointer; white-space: nowrap; }
.pl-button:hover { border-color: var(--gray-300); background: #fbfbfd; }
.pl-button.on { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.pl-icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pl-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 980px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }
.player-count { margin-left: auto; }
.pl-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 10px; }
.pl-chips:empty { display: none; }
.pl-chip { display: inline-flex; align-items: center; border-radius: 980px; background: var(--brand-light); color: var(--link); font-size: 14px; }
.pl-chip-label, .pl-chip-x { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.pl-chip-label { padding: 5px 4px 5px 13px; }
.pl-chip-x { padding: 5px 11px 5px 6px; font-size: 16px; line-height: 1; border-radius: 0 980px 980px 0; }
.pl-chip-x:hover, .pl-chip-label:hover { color: var(--ink); }
.pl-clear { font-size: 14px; }
.pl-panel { position: absolute; z-index: 30; width: min(440px, 100%); max-height: min(70vh, 560px); overflow: auto; padding: 14px 16px 12px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: 0 16px 40px rgba(0, 0, 0, .14), 0 2px 8px rgba(0, 0, 0, .06); }
.pl-field + .pl-field { margin-top: 12px; }
.pl-field-title { font-size: 13px; font-weight: 600; color: var(--gray-600); margin-bottom: 6px; }
.pl-options { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-option { font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 1px solid transparent; border-radius: 980px; padding: 5px 12px; cursor: pointer; }
.pl-option:hover { border-color: var(--gray-300); }
.pl-option.on { background: var(--ink); color: #fff; }
.pl-panel-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hairline); }
.player-table thead th { white-space: nowrap; }
.sort-button { font: inherit; color: inherit; background: none; border: 0; padding: 2px 0; cursor: pointer; white-space: nowrap; }
.sort-button:hover, .player-table th[aria-sort] .sort-button { color: var(--ink); }
.sort-arrow { font-size: 12px; }
.player-table .pick-cell { width: 40px; padding-right: 0; text-align: center; cursor: default; }
.player-table .pick-cell input { width: 18px; height: 18px; cursor: pointer; }
.player-table .star-cell { width: 28px; padding-left: 4px; padding-right: 4px; text-align: center; color: #ff9500; }
.player-table tr.selected td, .player-table tr.selected:hover td { background: var(--brand-light); }
.group-chip { display: inline-block; font-size: 13px; color: var(--gray-600); background: var(--paper); border-radius: 980px; padding: 1px 9px; margin: 1px 4px 1px 0; white-space: nowrap; }
.player-none { padding: 24px; margin-top: 8px; text-align: center; background: var(--surface); border-radius: var(--r-lg); }
.link-button { font: inherit; color: var(--link); background: none; border: 0; padding: 0; cursor: pointer; }
.link-button:hover { text-decoration: underline; }
/* The floating bar: sticks to the bottom of the window while the table scrolls. */
.pl-selection { position: sticky; bottom: 20px; z-index: 25; width: fit-content; max-width: 100%; margin: 16px auto 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 4px; padding: 6px 6px 6px 18px; background: rgba(29, 29, 31, .94); color: #fff; border-radius: 980px; box-shadow: 0 12px 32px rgba(0, 0, 0, .22); }
.pl-picked { margin-right: 8px; font-weight: 600; white-space: nowrap; }
.pl-action { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 15px; color: #fff; background: none; border: 0; border-radius: 980px; padding: 7px 13px; cursor: pointer; white-space: nowrap; }
.pl-action:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.pl-action:disabled { opacity: .4; cursor: default; }
.pl-action.danger { color: #ff8a80; }
.pl-action.close { font-size: 20px; line-height: 1; padding: 5px 11px; color: rgba(255, 255, 255, .75); }
/* A toast stays above the floating bar. */
body:has(.pl-selection:not([hidden])) .toast { bottom: 92px; }
/* The picker inside a dialog. */
.pl-picker .pl-toolbar { margin-bottom: 8px; }
.pl-picker .pl-row .search { max-width: none; }
.pl-pick-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 6px; }
.pl-pick-all { margin: 0; font-size: 15px; }
.pl-pick-list { display: grid; gap: 1px; max-height: min(46vh, 440px); overflow: auto; background: var(--hairline); border-radius: var(--r-md); }
.pl-pick-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface); cursor: pointer; font-size: 16px; }
.pl-pick-row.on { background: var(--brand-light); }
.pl-pick-row input { flex: none; width: 18px; height: 18px; }
.pl-pick-name { flex: 1 1 auto; min-width: 0; }
.pl-pick-meta { display: block; font-size: 13px; }
.pl-pick-row .group-cell { flex: none; max-width: 45%; text-align: right; }
@media (max-width: 640px) {
  .player-count { margin-left: 0; }
  .pl-panel { left: 0 !important; width: 100%; }
  .pl-selection { bottom: 12px; padding-left: 14px; }
  .pl-action { padding: 7px 9px; }
  .pl-pick-row .group-cell { display: none; }
}

/* The player dialog's team members (team-members.js): the two picked players, a search that also
   takes a new name, and the saved players to tap. */
.team-members .member-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.team-members .member-picks:empty { display: none; }
.member-pick { display: inline-flex; align-items: center; gap: 4px; padding: 3px 4px 3px 13px; border-radius: 980px; background: var(--brand-light); color: var(--ink); font-size: 15px; }
.member-pick .mini { border: 0; background: none; color: var(--gray-600); cursor: pointer; border-radius: 980px; }
.member-pick .mini:hover { color: var(--ink); background: rgba(0, 0, 0, .06); }
.member-entry { display: flex; gap: 8px; align-items: center; }
.member-entry .search { flex: 1 1 auto; margin-bottom: 0; min-width: 0; }
.member-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow: auto; padding: 2px 0; }
.member-chips:empty { display: none; }
.member-chips .chip { font-size: 14px; padding: 4px 12px; }
