/* board.css
   The board: tracked players grouped into position columns, each independently
   drag-to-rank, laid out four to a row and wrapping to the next (see
   CLAUDE.md's Board section) rather than scrolling sideways.

   Part of the Teleport stylesheet, split by concern. index.html links these
   in source order; keep that order, the cascade depends on it. */

/* ── Toolbar ────────────────────────────────────────────────────────── */
/* Search and Add are one visual unit — the button sits right at the search
   box's own right edge, not pinned to the far end of the row — and that unit
   is what's centred, so it moves as a whole rather than the button drifting
   away from the box it belongs to as the box's width changes. */
.board-toolbar { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.board-search { flex: 1 1 auto; max-width: 640px; }

/* ── Filters ──────────────────────────────────────────────────────── */
/* Three independent, combinable narrowings in one card above the columns —
   grade and projection as toggleable chips (same tone vocabulary as the
   grade pills elsewhere, so a chip and the card it filters read as the same
   colour language), plus a plain numeric box for the critical-factors
   threshold, since that one isn't a fixed set of choices. */
.board-filters {
  margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* The bar's own name, so "why is my board short a few players" has an
   obvious place to look before it becomes a support question. The accent
   colour on the icon ties it to the same colour a coach already associates
   with taking an action on this screen (Add player, the search focus ring). */
.bf-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border-2);
}
.bf-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; letter-spacing: -0.01em; color: var(--label);
}
.bf-title svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.bf-clear { margin-left: auto; }

.bf-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 16px; }
.bf-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bf-label {
  font-size: 11px; font-weight: 650; color: var(--label-2);
  text-transform: uppercase; letter-spacing: 0.05em; flex-shrink: 0;
}
.bf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bf-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--surface-2); border: 1.5px solid transparent;
  font-family: var(--font); font-size: 12px; font-weight: 630; color: var(--label-2);
  cursor: pointer; transition: background 0.13s, border-color 0.13s, color 0.13s, transform 0.08s;
}
.bf-chip:hover { background: var(--border-2); }
.bf-chip:active { transform: scale(0.96); }

/* The tone-matched fill only shows up once a chip is actually toggled on —
   otherwise all nine would out-shout the columns they're meant to sit above. */
.bf-chip--green.is-active  { background: var(--green-light);  border-color: var(--green);  color: var(--green);  }
.bf-chip--gold.is-active   { background: var(--gold-light);   border-color: var(--gold);   color: var(--gold);   }
.bf-chip--slate.is-active  { background: var(--slate-light);  border-color: var(--slate);  color: var(--slate);  }
.bf-chip--red.is-active    { background: var(--red-light);    border-color: var(--red);    color: var(--red);    }
.bf-chip--accent.is-active { background: var(--accent-light); border-color: var(--accent); color: var(--accent-deep); }
:root[data-theme="dark"] .bf-chip--accent.is-active { color: var(--accent); }

/* Ungraded / no-projection are sentinels, not tiers, so they get the same
   dashed-border treatment the ungraded grade pill uses elsewhere rather than
   inventing a fifth colour. */
.bf-chip--ungraded { border-style: dashed; border-color: var(--border); }
.bf-chip--ungraded.is-active {
  background: var(--surface-2); border-style: solid;
  border-color: var(--label-3); color: var(--label);
}

.bf-group--cf { gap: 8px; }
.bf-cf-input {
  width: 60px; flex-shrink: 0; text-align: center;
  padding: 6px 6px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 13px; font-weight: 700; color: var(--label);
  font-variant-numeric: tabular-nums; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.bf-cf-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light); background: var(--surface); }
/* Typed, not spun, the same reasoning as the critical-factors popover this
   scale comes from. */
.bf-cf-input::-webkit-inner-spin-button, .bf-cf-input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.bf-cf-input { appearance: textfield; }

/* ── The grid of columns ──────────────────────────────────────────── */
/* Four equal-width columns per row, then wrap — --board-cols is the one
   number responsive.css turns down as the viewport narrows. align-items:
   start (rather than the grid default, stretch) is what lets a short column
   stay short instead of stretching to match the tallest one sharing its row —
   columns vary a lot in player count, and a stretched empty card reads as
   broken, not tidy. */
.bcols { display: grid; grid-template-columns: repeat(var(--board-cols, 4), 1fr); align-items: start; gap: 14px; }

.bcol {
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.bcol-head {
  display: flex; align-items: baseline; gap: 8px;
  padding: 13px 14px 11px; border-bottom: 1px solid var(--border-2);
}
.bcol-name { font-size: 13.5px; font-weight: 680; letter-spacing: -0.01em; }
.bcol-count {
  margin-left: auto; font-size: 11.5px; font-weight: 650; color: var(--label-2);
  font-variant-numeric: tabular-nums;
}
/* Sits right after the count — see the Dividers section below. `align-self`
   overrides the head's own `align-items: baseline`, which a button (no text
   baseline of its own) would otherwise sit oddly against. */
.bcol-adddiv {
  display: flex; align-items: center; justify-content: center; align-self: center;
  width: 20px; height: 20px; flex-shrink: 0; border: none; background: none;
  color: var(--label-3); cursor: pointer; border-radius: 6px;
  transition: background 0.13s, color 0.13s;
}
.bcol-adddiv:hover { background: var(--border-2); color: var(--accent-deep); }
:root[data-theme="dark"] .bcol-adddiv:hover { color: var(--accent); }
.bcol-adddiv svg { width: 12px; height: 12px; }

.bcol-list { display: flex; flex-direction: column; padding: 6px; gap: 5px; }

/* ── One player, one card ──────────────────────────────────────────── */
.bcard {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 8px 7px 2px; border-radius: var(--r-md);
  position: relative; background: var(--surface);
  transition: background 0.13s;
}
.bcard:hover { background: var(--surface-2); }

/* The card's own grade, as a soft wash rather than one more chip — the same
   -light tints the grade pill uses elsewhere, just spread across the whole
   card instead of packed into a badge. Comes after :hover above so a graded
   card keeps its tint on hover instead of flattening to the plain surface
   colour; darkening it slightly on hover (rather than swapping it out) is what
   still signals "hoverable" without fighting the tint for attention. */
.bcard--green { background: var(--green-light); }
.bcard--gold  { background: var(--gold-light);  }
.bcard--slate { background: var(--slate-light); }
.bcard--red   { background: var(--red-light);   }
.bcard--green:hover,
.bcard--gold:hover,
.bcard--slate:hover,
.bcard--red:hover { filter: brightness(0.97); }

/* `will-change` for the length of the gesture only: the card's transform is
   rewritten every frame while it's held (see ui/drag-list.js), so it wants its
   own layer rather than repainting the column under it on each one. And no
   background transition — the card is being moved, not hovered, and a 130ms
   fade chasing the cursor across other cards' :hover reads as flicker. */
.bcard--dragging {
  background: var(--surface-2); box-shadow: var(--shadow-md); z-index: 5;
  will-change: transform; transition: none;
}
.bcard--dragging.bcard--green,
.bcard--dragging.bcard--gold,
.bcard--dragging.bcard--slate,
.bcard--dragging.bcard--red { filter: none; }

.bcard-handle {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 20px; height: 30px; border: none; background: none;
  color: var(--label-3); cursor: grab; border-radius: 6px; touch-action: none;
}
.bcard-handle:hover { color: var(--label-2); background: var(--border-2); }
.bcard-handle svg { width: 14px; height: 14px; }
.bcard-handle[disabled] { cursor: default; opacity: 0.35; }
.bcard--dragging .bcard-handle { cursor: grabbing; }
.bcard-handle-space { width: 20px; flex-shrink: 0; }

.bcard-rank {
  flex-shrink: 0; width: 16px; text-align: center;
  font-size: 11px; font-weight: 700; color: var(--label-3);
  font-variant-numeric: tabular-nums;
}

.bcard-body {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  color: inherit; text-decoration: none;
}
.bcard-body .face { --face-size: 26px; }
.bcard-main { flex: 1; min-width: 0; }
.bcard-name {
  display: block; font-size: 13px; font-weight: 610; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bcard-sub {
  font-size: 11px; color: var(--label-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* A column with nobody in it — either the position genuinely has no one
   tracked, or a search has narrowed it to no one — rather than the column
   itself disappearing. Every column Maryland's depth chart carries is always
   on screen (see BOARD_POSITIONS in board.js), so an empty position reads as
   "nobody here yet", the same useful signal the team page's Tracked tab gives
   per position. */
.bcol-empty {
  padding: 18px 10px; text-align: center;
  font-size: 11.5px; color: var(--label-3);
}

/* ── Dividers ─────────────────────────────────────────────────────────
   A labeled line a coach drags into a column to mark off a section of it —
   see the Dividers section in views/board.js. Deliberately built on `.bcard`
   rather than a rule of its own: it shares the same drag handle, the same
   draggable identity, and the same slot in the column's flex list, so nothing
   about wireColumnDrag/finishDrag has to know a second shape of row exists.
   `.bdiv` only ever *overrides* what a plain `.bcard` would draw. */
.bdiv {
  background: none;
}
.bdiv:hover { background: none; }

.bdiv-line {
  flex: 1; min-width: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
}
/* The rule itself, drawn full width behind the label — the input's own
   background (below) is what visually "cuts" it around the text, the classic
   line-through-a-heading look, without a second element to keep in sync. */
.bdiv-line::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--border);
}
/* The field *is* the display — no separate edit mode, the same call a
   scenario's money fields make (see wireMoneyField). `size` on the element
   (not set here) gives it a content-ish width without measuring text in JS;
   CSS only caps how far that's allowed to go. */
.bdiv-input {
  position: relative; z-index: 1;
  width: auto; max-width: 100%;
  background: var(--surface); border: none; outline: none;
  font-family: var(--font); text-align: center;
  font-size: 10.5px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--label-2); padding: 3px 12px; border-radius: var(--r-full);
  transition: background 0.13s, color 0.13s, box-shadow 0.13s;
}
.bdiv-input::placeholder {
  color: var(--label-3); font-weight: 600; text-transform: none; letter-spacing: normal;
}
.bdiv-input:hover:not(:disabled) { background: var(--surface-2); }
.bdiv-input:focus {
  background: var(--surface-2); color: var(--label);
  box-shadow: 0 0 0 3px var(--accent-light);
}
.bdiv-input:disabled { cursor: default; }
/* The only acknowledgement a save gets — a moment of green, the same
   flashSaved gesture a scenario's money fields use — since a modal or an
   alert on every keystroke's worth of typing would be unusable. */
.bdiv-input.is-saved { color: var(--green); }

.bdiv-del { flex-shrink: 0; }
