/* Copyright (c) 2026 Brownie, LLC. All rights reserved. */

/*
 * A school's roster, a team's members, the season roll-over and saved
 * scorecards (views/school.ts, views/team.ts, views/roll-over.ts,
 * views/scorecards.ts).
 * Builds on the shared pieces in styles.css and team.css.
 */

.roster-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.roster-past-note {
  padding: 10px 12px;
  border-radius: var(--control-radius);
  background: var(--color-review-soft);
  color: var(--color-text);
}

.roster-season-field {
  max-width: 220px;
}

.roster-counts,
.roll-over-summary {
  font-weight: 600;
}

/* The archer's name heads each row but reads like the other cells. */
.roster-table tbody th,
.roll-over-table tbody th {
  position: static;
  background: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

.roster-table td .button {
  min-height: 32px;
  padding-block: 4px;
}

/* A row's team lists: the error, if any, goes under the list. */
.roster-team-cell .form-error {
  margin-top: 4px;
  font-size: 0.85rem;
  white-space: normal;
}

.roster-edit-slot:empty {
  display: none;
}

.roster-editor h2:focus {
  outline: none;
}

.roll-over-form {
  display: grid;
  gap: 16px;
}

.roll-over-steps {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}

.roll-over-choice {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--control-radius);
}

.roll-over-choice legend {
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.roll-over-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roster-table select,
.roll-over-table select {
  min-width: 160px;
  height: 2.25rem;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--control-radius);
  background: var(--color-page);
  color: var(--color-text);
  font: 500 0.95rem var(--font-body);
}

.roll-over-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.roll-over-leaving {
  color: var(--color-review);
  font-weight: 600;
}

/* Next season's grade; for a leaving archer kept on, under the note. */
.roll-over-table .roll-over-grade {
  display: block;
}

.roll-over-table .roll-over-leaving + .roll-over-grade {
  margin-top: 6px;
}

/* The roster check on a team: green when it meets the team rules. */
.roster-check {
  margin-block: 4px;
  font-weight: 600;
}

.roster-check.is-met {
  color: var(--color-accent);
}

.roster-check.is-short {
  color: var(--color-review);
}

.item-list .roster-check {
  margin: 2px 0 0;
  font-size: 0.9rem;
}

/* ---------- Saved scorecards (views/scorecards.ts) ---------- */

.scorecard-filters[hidden] {
  display: none;
}

.scorecard-list-slot {
  display: grid;
  gap: 12px;
}

.roster-table .delete-button {
  min-height: 32px;
}

/* A card's total and 10s, beside its date. */
.scorecard-score {
  color: var(--color-text-muted);
  white-space: nowrap;
}

.scorecard-score b {
  color: var(--color-text);
  font-size: 1.2rem;
}

/* "Show the arrows" opens under the card, across its whole width. */
.scorecard-arrows {
  flex: 1 1 100%;
}

.scorecard-arrows > summary {
  width: fit-content;
  min-height: 32px;
  padding-block: 4px;
  list-style: none;
}

.scorecard-arrows > summary::-webkit-details-marker {
  display: none;
}

.scorecard-arrows[open] > summary {
  margin-bottom: 8px;
}

/* The scanner's round rows, a little narrower so six fit a phone. */
.scorecard-rounds .round-row {
  grid-template-columns: 64px repeat(5, minmax(28px, 40px)) minmax(36px, 1fr);
  gap: 4px;
}

/* In 3D the animal names get a line of their own, as on the scanner. (The
   scanner's is-three-d class would also hide the side's heading.) */
.scorecard-rounds.has-animals .round-row {
  grid-template-columns: repeat(5, minmax(28px, 40px)) minmax(36px, 1fr);
}

.scorecard-rounds.has-animals .round-label {
  grid-column: 1 / -1;
}

/* One arrow's score: looks like the scanner's arrow box, but can't be changed. */
.arrow-score {
  display: grid;
  place-items: center;
  height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--control-radius);
  background: var(--color-page);
  font: 700 1.1rem/1 var(--font-display);
  font-variant-numeric: tabular-nums;
}

.arrow-score.is-ten {
  border-color: var(--color-ten);
  background: var(--color-ten-soft);
}

.arrow-score.is-empty {
  border-style: dashed;
  color: var(--color-text-muted);
}

/* Cards waiting for an archer (views/needs-archer.ts): the count in the heading. */
.needs-archer-section h2 .badge {
  vertical-align: middle;
}

/* What was read from the card on one line, its buttons beside or below, and the form under both. */
.needs-archer-item p {
  margin: 0;
}

.needs-archer-item > .error-slot,
.needs-archer-item > .needs-archer-form-slot {
  flex-basis: 100%;
}

.needs-archer-form-slot:empty {
  display: none;
}
