/* ==========================================================================
   Player directory, public profile modal and company overview tabs.
   Scoped under players-* / player-* / company-tabs-* to avoid collisions.
   ========================================================================== */

.players-directory,
.player-profile {
  min-width: 0;
  max-width: 100%;
  color: var(--text, #e2e8f0);
}

.players-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.players-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 260px;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line, #263449);
  border-radius: 10px;
  background: rgba(7, 13, 25, .55);
}

.players-search:focus-within {
  border-color: var(--cyan, #22d3ee);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, .12);
}

.players-search > span { flex: none; font-size: 13px; }

.players-search input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text, #e2e8f0);
  font: inherit;
  font-size: 13px;
  padding: 8px 0;
}

.players-search input::placeholder { color: var(--muted-2, #7b8aa3); }

.players-loading,
.players-muted {
  color: var(--muted-2, #94a3b8);
  font-size: 12.5px;
  padding: 10px 2px;
}

.players-error {
  color: #fda4af;
  background: rgba(251, 113, 133, .08);
  border: 1px solid rgba(251, 113, 133, .28);
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 12.5px;
}

.players-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.players-table { min-width: 620px; }

.players-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.players-identity > div { min-width: 0; }

.players-identity b {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.players-identity small {
  display: block;
  color: var(--muted-2, #94a3b8);
  font-size: 10px;
  margin-top: 2px;
}

.players-avatar {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line, #263449);
  background: rgba(148, 163, 184, .08);
  overflow: hidden;
  object-fit: cover;
  font-size: 20px;
  line-height: 1;
}

.players-avatar.sm { width: 32px; height: 32px; border-radius: 9px; font-size: 17px; }
.players-avatar.lg { width: 62px; height: 62px; border-radius: 14px; font-size: 31px; }

.players-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.players-online,
.players-offline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted-2, #94a3b8);
  white-space: nowrap;
}

.players-online { color: #6ee7b7; }
.players-online i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .14);
}

.players-cards { display: none; }

.players-card {
  min-width: 0;
  border: 1px solid var(--line, #263449);
  border-radius: 12px;
  background: rgba(7, 13, 25, .42);
  padding: 13px;
}

.players-card-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.players-card-head b {
  display: block;
  overflow-wrap: anywhere;
}

.players-card-head small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2, #94a3b8);
  font-size: 10px;
}

.players-card-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.players-card-facts div {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(148, 163, 184, .055);
}

.players-card-facts dt {
  color: var(--muted-2, #94a3b8);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.players-card-facts dd {
  margin: 3px 0 0;
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.players-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted-2, #94a3b8);
}

.players-pager button:disabled { opacity: .4; cursor: not-allowed; }

/* --------------------------------------------------------- profile modal */

/* modal.js toggles .modal-wide, while app.css only styles .wide. */
.modal-panel.modal-wide { max-width: 940px; }

.player-profile { display: flex; flex-direction: column; gap: 14px; }

.players-modal-loading .skeleton {
  margin-top: 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(148,163,184,.08), rgba(148,163,184,.16), rgba(148,163,184,.08));
}

.player-profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding-right: 36px;
}

.player-profile-title { min-width: 0; flex: 1 1 auto; }
.player-profile-title h3 { margin: 0 0 2px; padding-right: 0; }
.player-profile-title .modal-sub { margin: 0 0 7px; overflow-wrap: anywhere; }

.players-profile-status {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
}

.players-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.players-bio {
  margin: 0;
  padding: 10px 12px;
  border-left: 2px solid rgba(34, 211, 238, .5);
  background: rgba(34, 211, 238, .045);
  border-radius: 0 9px 9px 0;
  color: var(--muted, #cbd5e1);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.players-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.players-panel {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line, #263449);
  border-radius: 12px;
  background: rgba(148, 163, 184, .035);
}

.players-panel h4 {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
}

.players-facts { margin: 0; display: grid; gap: 7px; }

.players-facts div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.players-facts dt { color: var(--muted-2, #94a3b8); font-size: 11px; flex: none; }
.players-facts dd { margin: 0; min-width: 0; text-align: right; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.players-facts dd.mono { font-family: "Space Grotesk", ui-monospace, monospace; }

.players-company-bio {
  margin: 11px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line, #263449);
  font-size: 11.5px;
  color: var(--muted-2, #94a3b8);
}

.players-company-bio b { display: block; color: var(--text, #e2e8f0); margin-bottom: 3px; overflow-wrap: anywhere; }
.players-company-bio span { display: block; overflow-wrap: anywhere; }

.players-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.players-stat {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(7, 13, 25, .4);
}

.players-stat small { display: block; color: var(--muted-2, #94a3b8); font-size: 9.5px; text-transform: uppercase; letter-spacing: .04em; }
.players-stat b { display: block; margin-top: 3px; font-size: 12.5px; overflow-wrap: anywhere; }

.players-season { margin: 10px 0 0; color: var(--muted-2, #94a3b8); font-size: 11px; }

.players-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.players-panel-head h4 { margin: 0; }
.players-panel-head span { color: var(--muted-2, #94a3b8); font-size: 10.5px; }

.players-chart {
  position: relative;
  width: 100%;
  height: 260px;
  min-height: 200px;
}

.players-chart canvas { width: 100% !important; max-width: 100%; }

.players-chart-note { margin: 8px 0 0; color: var(--muted-2, #94a3b8); font-size: 10.5px; }

.players-badges {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 9px;
}

.players-badge {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
  padding: 9px 6px;
  border: 1px solid var(--line, #263449);
  border-radius: 10px;
  background: rgba(7, 13, 25, .35);
}

.players-badge b { font-size: 10.5px; overflow-wrap: anywhere; }
.players-badge small { color: var(--muted-2, #94a3b8); font-size: 9px; }
.players-medal-icon { line-height: 1; }
.players-medal-img { width: 34px; height: 34px; object-fit: contain; }

/* ------------------------------------------------------- company overview */

.company-tabs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.company-tabs-head > div { min-width: 0; }

@media (max-width: 760px) {
  .players-table-wrap { display: none; }
  .players-cards { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .players-profile-grid { grid-template-columns: 1fr; }
  .players-chart { height: 210px; }
  .players-toolbar { align-items: stretch; }
  .players-search { flex-basis: 100%; }
  .players-pager { justify-content: center; }
  .players-profile-head { align-items: flex-start; padding-right: 30px; }
  .players-avatar.lg { width: 50px; height: 50px; font-size: 25px; }
  .players-facts div { flex-wrap: wrap; }
  .players-facts dd { text-align: left; }
}

/* ==========================================================================
   Player directory / profile list refinements.
   Loaded after app.css; keeps the shared table/list layer in sync with the
   player-specific spacing and mobile card rhythm.
   ========================================================================== */

.players-toolbar {
  gap: 10px;
  margin: 0 0 14px;
  align-items: center;
}

.players-search {
  min-height: 40px;
  padding: 0 12px;
}

.players-search input { padding: 9px 0; }

/* The directory table stays vertically bounded; the mobile card list is the
   fallback below 760px, so the wrapper keeps horizontal scrolling on tablets. */
.players-table-wrap {
  max-height: min(68vh, 720px);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #334155 rgba(7, 13, 25, .55);
  border: 1px solid var(--line, #263449);
  border-radius: 12px;
  background: rgba(7, 13, 25, .3);
}

.players-table-wrap::-webkit-scrollbar { width: 9px; height: 9px; }
.players-table-wrap::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 20px;
  border: 2px solid rgba(7, 13, 25, .9);
}
.players-table-wrap::-webkit-scrollbar-thumb:hover { background: #475569; }

.players-table { min-width: 680px; }

.players-table th,
.players-table td { padding: 10px 12px; }

.players-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #14203a;
  box-shadow: inset 0 -1px 0 var(--line, #263449);
}

.players-table tbody tr { transition: background .12s ease; }
.players-table tbody tr:hover td { background: rgba(148, 163, 184, .06); }
.players-table td { border-bottom: 1px solid rgba(148, 163, 184, .09); }
.players-table tbody tr:last-child td { border-bottom: 0; }

.players-actions {
  gap: 6px 7px;
}

.players-actions .btn-xs { min-height: 27px; }

.players-pager {
  margin-top: 16px;
  gap: 10px;
}

.players-pager .btn { min-height: 34px; }

.players-loading,
.players-muted { margin: 2px 0; }

.players-cards { gap: 12px; }
.players-card { padding: 14px; }
.players-card-facts { margin: 12px 0; gap: 8px; }

@media (max-width: 760px) {
  .players-toolbar { gap: 10px; }
  .players-search { flex-basis: 100%; }
  .players-table-wrap { max-height: min(62vh, 620px); border-radius: 10px; }
  .players-table th,
  .players-table td { padding: 9px 11px; }
  .players-card { padding: 13px; }
  .players-cards { gap: 12px; }
  .players-pager { margin-top: 14px; }

  /* Directory cards: let the action buttons share the full card width. */
  .players-card .players-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 7px;
  }
  .players-card .players-actions .btn { width: 100%; }

  .players-actions .btn,
  .players-actions .btn-xs {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 11.5px;
  }
}
