/* roster.css — "Roster & attendance" screen.
 *
 * Theme tokens only (auto light/dark). Reuses .card .btn .btn-primary .btn-ghost
 * .pill .chip(.is-on) .input .field .field-hint .eyebrow .list .row .muted
 * .screen-sub; everything new is namespaced `roster-`. Tinted neutrals only,
 * one card depth (no nested cards), transform/opacity motion with var(--ease).
 */

/* ------------------------------------------------------------- Back link --- */
/* Compact, left-aligned "Back to Team" — the roster is reached from the Team
   summary, so it needs an obvious way home. Sits above the intro copy. */
.roster-back {
  width: auto;
  gap: var(--sp-1);
  margin-bottom: var(--sp-3);
  padding-left: var(--sp-3);
  padding-right: var(--sp-4);
}

/* --------------------------------------------------------------- Add form -- */
.roster-add { margin-bottom: var(--sp-4); }

/* Name takes the full width; number + position share the row below it. The
   number stays narrow so the jersey field reads as "just a couple of digits". */
.roster-add__grid {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.roster-add__name { grid-column: 1 / -1; margin-bottom: 0; }
.roster-add__num { margin-bottom: 0; }
.roster-add__pos { margin-bottom: 0; }

.roster-add__btn { width: 100%; }

.roster-ico { display: inline-flex; align-items: center; }

/* ------------------------------------------------------------- Roster list - */
.roster-list { margin-bottom: var(--sp-4); }

.roster-ul { margin-top: var(--sp-3); }

/* The list is itself a card surface, so flatten the inner .list chrome to avoid
   a card-in-card look (single depth only). */
.roster-list .roster-ul {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.roster-row { gap: var(--sp-3); }

.roster-row__info {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 0;            /* let long names truncate instead of overflowing */
  flex: 1 1 auto;
}
.roster-row__text { min-width: 0; }
.roster-row__name {
  display: block;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-row__pos {
  display: block;
  font-size: var(--fs-sm);
  margin-top: 2px;
}

/* Jersey badge — a small tinted circle. Empty (no number) reads quieter. */
.roster-badge {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.roster-badge--empty {
  background: var(--surface-2);
  color: var(--text-muted);
  font-weight: 700;
}

/* Row actions: two square, tappable icon buttons. */
.roster-row__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: none;
}
.roster-iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0;
  border-radius: var(--radius-input);
}
.roster-iconbtn--danger { color: var(--accent); }

/* Gentle inline empty state for a roster with no players yet. */
.roster-empty {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-4);
  text-align: center;
  background: var(--surface-2);
  border-radius: var(--radius-input);
}

/* ------------------------------------------------------ Inline row editor -- */
.roster-row--editing {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--sp-3);
}
.roster-edit__fields {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  flex: 1 1 220px;
  min-width: 0;
}
.roster-edit__meta {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--sp-2);
}
.roster-row--editing .roster-row__actions { padding-top: 2px; }

/* ------------------------------------------------------------- Attendance -- */
/* Reuses .chips/.chip(.is-on). A small jersey number sits inside each chip; on
   the selected (present) chip it inherits the chip's full-contrast text. */
.roster-att { gap: var(--sp-2); }
.roster-att__chip {
  gap: var(--sp-2);
  padding-left: var(--sp-3);
}
.roster-att__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.roster-att__chip.is-on .roster-att__num {
  background: var(--surface);
  color: var(--text);
}
.roster-att__hint {
  margin: 0;
  padding: var(--sp-3);
  background: var(--surface-2);
  border-radius: var(--radius-input);
}

/* ----------------------------------------------------------- Narrow phones - */
@media (max-width: 360px) {
  .roster-add__grid,
  .roster-edit__meta {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------- Reduced motion ------ */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
