/* ============================================================================
   DRAFT BOARD — extracted from components.css 2026-05-13
   ----------------------------------------------------------------------------
   This file owns all CSS for the Draft Board surface:
     • Legacy draft-board page (.draft-board-page, header, cap bar, search,
       chips, player list, pick-confirmation modal, log/queue/team panels,
       view-state, empty + loading states)
     • DBR-04: .players-tab__adp-stale-banner (intentionally co-located)
     • DBR-07: .draft-board-sheet* — adaptive snap-point sheet
     • DBR-06: .matrix* — draft matrix board

   Wave 5 tickets (DBR-08–DBR-12) add their CSS HERE, not in components.css.
   Loaded after components.css in index.html so cascade order is unchanged.
   ============================================================================ */

/* ============================================
   DRAFT BOARD (D-BOARD)
   Draft execution interface - mobile-first
   ============================================ */

.draft-board-page {
  background: var(--color-structure-bg);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* DBR-13: .draft-board-cap-bar* block deleted. renderCapBar() was retired
   alongside renderHeader; this is the last surviving piece of the
   pre-DraftStatusHeader cap-display surface. Cap context now lives on
   DraftStatusHeader line 2. */

/* Search Bar */
.draft-board-search {
  padding: 10px 16px;
  background: var(--color-white);
  border-bottom: 2px solid var(--color-structure-lightest);
  position: sticky;
  top: 94px;
  z-index: 190;
}

.draft-board-search__wrapper {
  position: relative;
}

.draft-board-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-structure-medium);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
}

.draft-board-search__input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 3px solid var(--color-structure-lighter);
  border-radius: var(--border-radius-md);
  font-family: var(--font-primary);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--color-structure-bg);
  color: var(--color-structure-deepest);
  outline: none;
  transition: border-color 0.2s;
}

.draft-board-search__input:focus {
  border-color: var(--color-action-primary);
}

/* Position Filter Chips */
.draft-board-filters {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: var(--color-white);
  border-bottom: 2px solid var(--color-structure-lightest);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.draft-board-chip {
  padding: 6px 14px;
  border-radius: 9999px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 1.5px;
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid var(--color-structure-lighter);
  background: var(--color-white);
  color: var(--color-structure-deep);
  transition: all 0.15s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.draft-board-chip--active {
  background: var(--color-structure-deepest);
  color: var(--color-white);
  border-color: var(--color-structure-deepest);
}

/* Position chips — match TeamDetail roster scheme: soft bg, dark themed text. */
.draft-board-chip--qb.draft-board-chip--active  { background: var(--color-position-qb-bg);  color: var(--color-position-qb-text);  border-color: var(--color-position-qb-text);  }
.draft-board-chip--rb.draft-board-chip--active  { background: var(--color-position-rb-bg);  color: var(--color-position-rb-text);  border-color: var(--color-position-rb-text);  }
.draft-board-chip--wr.draft-board-chip--active  { background: var(--color-position-wr-bg);  color: var(--color-position-wr-text);  border-color: var(--color-position-wr-text);  }
.draft-board-chip--te.draft-board-chip--active  { background: var(--color-position-te-bg);  color: var(--color-position-te-text);  border-color: var(--color-position-te-text);  }
.draft-board-chip--k.draft-board-chip--active   { background: var(--color-position-k-bg);   color: var(--color-position-k-text);   border-color: var(--color-position-k-text);   }
.draft-board-chip--def.draft-board-chip--active { background: var(--color-position-def-bg); color: var(--color-position-def-text); border-color: var(--color-position-def-text); }

/* DBR-04: ADP stale-cache banner — non-blocking note inside the Players tab
   when both primary Sleeper fetch and search_rank fallback fail. */
.players-tab__adp-stale-banner {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  padding: var(--space-xs) var(--space-base);
  background: var(--color-warning-bg);
  border-bottom: 1px solid var(--color-structure-lighter);
  text-align: center;
}

/* Pick Confirmation Modal - Bottom Sheet */
.draft-board-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 62, 78, 0.7);
  z-index: 900;
  display: flex;
  align-items: flex-end;
  animation: draft-board-fade-in 0.2s ease;
}

@keyframes draft-board-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.draft-board-modal-sheet {
  background: var(--color-white);
  width: 100%;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom, 0px));
  animation: draft-board-slide-up 0.25s ease;
}

@keyframes draft-board-slide-up {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.draft-board-modal-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--color-structure-lighter);
  border-radius: 9999px;
  margin: 0 auto 16px;
}

.draft-board-modal-sheet__player {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.draft-board-modal-sheet__player-pos {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.9rem;
  letter-spacing: 1px;
  /* bg + color set inline from POS_COLORS to match TeamDetail roster scheme. */
}

.draft-board-modal-sheet__player-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-structure-deepest);
}

.draft-board-modal-sheet__player-team {
  font-size: 0.8rem;
  color: var(--color-structure-medium);
  font-weight: 600;
}

/* Cap Impact Section in Modal */
.draft-board-cap-impact {
  background: var(--color-structure-bg);
  border-radius: var(--border-radius-md);
  padding: 14px;
  margin-bottom: 16px;
  border: 2px solid var(--color-structure-lightest);
}

.draft-board-cap-impact__title {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-structure-deep);
  margin-bottom: 10px;
}

.draft-board-cap-impact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.draft-board-cap-impact-row__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-structure-medium);
}

.draft-board-cap-impact-row__value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.draft-board-cap-impact-row__value--positive { color: var(--color-positive); }
.draft-board-cap-impact-row__value--warning { color: var(--color-action-primary); }
.draft-board-cap-impact-row__value--danger { color: var(--color-danger-primary); }
.draft-board-cap-impact-row__value--neutral { color: var(--color-structure-deepest); }

.draft-board-cap-impact-divider {
  height: 1px;
  background: var(--color-structure-lightest);
  margin: 6px 0;
}

/* Validation Badge */
.draft-board-validation-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 8px;
}

.draft-board-validation-badge--valid {
  background: var(--color-success-bg);
  color: var(--color-success-dark);
}

.draft-board-validation-badge--warning {
  background: var(--color-action-bg);
  color: var(--color-action-dark);
}

.draft-board-validation-badge--error {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
}

/* Modal Actions */
.draft-board-modal-sheet__actions {
  display: flex;
  gap: 10px;
}

.draft-board-modal-sheet__btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-display);
  font-size: 1.2rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  border: 3px solid transparent;
  min-height: 50px;
  text-align: center;
}

.draft-board-modal-sheet__btn--cancel {
  background: var(--color-white);
  color: var(--color-structure-deep);
  border-color: var(--color-structure-lighter);
}

.draft-board-modal-sheet__btn--confirm {
  background: var(--color-action-primary);
  color: var(--color-white);
  border-color: var(--color-action-primary);
}

.draft-board-modal-sheet__btn--confirm:active {
  background: var(--color-action-dark);
}

.draft-board-modal-sheet__btn--confirm:disabled {
  background: var(--color-structure-lighter);
  border-color: var(--color-structure-lighter);
  color: var(--color-structure-medium);
  cursor: not-allowed;
}

/* Salary Input in Modal */
.draft-board-salary-input {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.draft-board-salary-input__field {
  flex: 1;
}

.draft-board-salary-input__label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-structure-medium);
  margin-bottom: 4px;
}

.draft-board-salary-input__input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--color-structure-lighter);
  border-radius: var(--border-radius-md);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--color-white);
  color: var(--color-structure-deepest);
  outline: none;
}

.draft-board-salary-input__input:focus {
  border-color: var(--color-action-primary);
}

/* Bottom Tab Bar
   - Pinned to the viewport bottom on every breakpoint.
   - Mobile: spans full width; respects iOS safe-area-inset-bottom so the
     home-indicator strip doesn't cover the labels.
   - Desktop (>=1024px): offset by the sidebar width (16rem) so the bar
     starts where the sidebar ends instead of sitting under it. */
.draft-board-tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-structure-deepest);
  display: flex;
  border-top: 3px solid var(--color-structure-deep);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 1024px) {
  .draft-board-tab-bar {
    left: 16rem;
  }
}

.draft-board-tab-bar__item {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 12px;
  text-align: center;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  /* Inactive: high-contrast inverse text at reduced opacity. Reads cleanly
     against the dark themed background on every theme (avoids the
     "slightly-lighter-themed-color over deepest-themed-color" failure on red
     palettes). */
  color: var(--text-inverse);
  opacity: 0.7;
  background: none;
  border: none;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.draft-board-tab-bar__item:hover {
  opacity: 0.9;
  background: rgba(255, 255, 255, 0.05);
}

.draft-board-tab-bar__item--active {
  color: var(--color-action-primary);
  opacity: 1;
}

.draft-board-tab-bar__icon {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.draft-board-tab-bar__label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Draft Log Panel */
.draft-board-log {
  padding: 0 0 80px 0;
}

.draft-board-log__header {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-structure-deep);
  padding: 14px 16px 8px;
}

.draft-board-log__pick {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-structure-lightest);
  gap: 10px;
}

.draft-board-log__pick-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-structure-medium);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}

.draft-board-log__pick-number span {
  font-size: 0.6rem;
  color: var(--color-structure-light);
}

.draft-board-log__pick-pos {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.6rem;
  letter-spacing: 1px;
  /* bg + color set inline from POS_COLORS to match TeamDetail roster scheme. */
  flex-shrink: 0;
}

.draft-board-log__pick-info {
  flex: 1;
  min-width: 0;
}

.draft-board-log__pick-player {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-structure-deepest);
}

.draft-board-log__pick-team {
  font-size: 0.7rem;
  color: var(--color-structure-medium);
  font-weight: 600;
}

.draft-board-log__pick-salary {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-action-primary);
  flex-shrink: 0;
}

/* Queue Panel */
.draft-board-queue {
  padding: 0 0 80px 0;
}

.draft-board-queue__header {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-structure-deep);
  padding: 14px 16px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.draft-board-queue__count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--color-structure-medium);
}

/* View State Management */
.draft-board-view { display: none; }
.draft-board-view--active { display: block; }

/* Loading state */
.draft-board-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-structure-medium);
}


/* ============================================================
   DBR-07 — Adaptive snap-point sheet
   Three states: tab-bar-only | preview | expanded
   Transform-only animation (compositor thread). Tab bar is the
   sheet header and drag handle — no separate pill.
   ============================================================ */

.draft-board-sheet {
  position: fixed;
  /* inset: 0 covers the full viewport; visibility is via translateY */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sheet);
  pointer-events: none; /* individual surfaces enable pointer-events selectively */
  will-change: transform;
}

/* Snap animation: iOS spring. Only active when NOT dragging. */
.draft-board-sheet[data-dragging='false'] {
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
}
.draft-board-sheet[data-dragging='true'] {
  transition: none;
}

@media (prefers-reduced-motion: reduce) {
  .draft-board-sheet[data-dragging='false'] {
    transition-duration: 0s;
  }
  /* Cover the per-tab transition too (150ms is below the 200ms blocking
     threshold but addressed for completeness). */
  .draft-board-sheet__tab {
    transition: none;
  }
}

/* Tab bar — the sheet header and drag handle.
   Height is sourced from --draft-board-sheet-tab-bar-height (design-tokens.css),
   the single source of truth shared with TAB_BAR_HEIGHT in draftBoardSnapUtils.js.
   touch-action: none so the browser does not intercept vertical pointer drag
   before the sheet's gesture handler processes it. */
.draft-board-sheet__tab-bar {
  pointer-events: auto;
  height: var(--draft-board-sheet-tab-bar-height);
  display: flex;
  background: var(--color-structure-deepest);
  border-top: 3px solid var(--color-structure-deep);
  /* Safe-area: home-indicator padding inside the bar, matching components.css:8955 pattern */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  touch-action: none;   /* gesture zone owns vertical drag; no browser pan intercept */
  user-select: none;    /* suppress long-press text selection on the tab labels */
  -webkit-user-select: none;
}

.draft-board-sheet__tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xs);
  min-height: 44px; /* WCAG touch target minimum */
  background: transparent;
  border: 0;
  color: var(--text-inverse);
  opacity: 0.7;
  font-size: 0.65rem;
  font-family: var(--font-display);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s;
}

/* Active tab text: --color-action-light (#f3963f) on --color-structure-deepest
   (#183e4e) yields ~5.6:1 WCAG AA contrast at small body-text sizes.
   --color-action-primary was 4.13:1 (below 4.5 threshold for <18px text). */
.draft-board-sheet__tab--active {
  color: var(--color-action-light);
  opacity: 1;
}

.draft-board-sheet__tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Sheet body — sits immediately below the tab bar.
   overflow-y: auto for scrollable content; touch-action: pan-y lets vertical
   scroll work normally. DBR-10 queue-row drag overrides touch-action: none
   locally on the dragging element and uses setPointerCapture. */
.draft-board-sheet__body {
  pointer-events: auto;
  /* Full viewport minus the tab bar (token shared with JS layout constant) */
  height: calc(100vh - var(--draft-board-sheet-tab-bar-height));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-page);
  touch-action: pan-y;
}

/* Scrim — sibling of the sheet, not a child.
   tab-bar-only: opacity 0 + pointer-events: none (clicks pass through to matrix).
   preview: faint overlay (20% opacity), tappable.
   expanded: dark overlay (40% opacity), tappable. */
.draft-board-sheet__scrim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: var(--z-sheet-scrim);
  background: var(--color-black);
  opacity: 0;
  pointer-events: none;
  transition: opacity 280ms cubic-bezier(0.32, 0.72, 0, 1);
}

.draft-board-sheet__scrim[data-snap='preview'] {
  opacity: 0.2;
  pointer-events: auto;
}

.draft-board-sheet__scrim[data-snap='expanded'] {
  opacity: 0.4;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .draft-board-sheet__scrim {
    transition-duration: 0s;
  }
}

/* Off-screen ARIA live region — announces snap-state changes to screen readers */
.draft-board-sheet__live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   DBR-06 — Matrix board
   12 team columns × 10 round rows. Cell size 72×60px. Sticky left round-
   label column (36px) and sticky top team-header row (32px).
   ========================================================================== */

/* Scroll container — the primary visible page surface behind the sheet */
.matrix {
  position: relative;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  /* Reserve vertical space: below status header, above sheet tab bar */
  height: calc(100vh - var(--draft-status-header-height));
  /* Prevent the last round's cells from clipping behind the iOS home indicator */
  padding-bottom: calc(var(--draft-board-sheet-tab-bar-height, 52px) + env(safe-area-inset-bottom, 0px) + var(--space-sm));
  background: var(--bg-page);
}

/* Table — extends beyond viewport so columns can scroll horizontally */
.matrix__table {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
}

/* Sticky team-header row */
.matrix__header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--color-structure-deep);
  color: var(--text-inverse);
}

/* Top-left corner cell — above the round-label column */
.matrix__header-corner {
  position: sticky;
  left: 0;
  /* Above column headers so the corner covers them when scrolled */
  z-index: 3;
  width: 36px;
  min-width: 36px;
  height: 32px;
  background: var(--color-structure-deep);
}

/* Per-team column header */
.matrix__header-cell {
  width: 72px;
  min-width: 72px;
  height: 32px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
  text-transform: uppercase;
  scroll-snap-align: start;
  background: var(--color-structure-deep);
}

/* Sticky left round label — always visible during horizontal scroll */
.matrix__roundlabel {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 36px;
  min-width: 36px;
  height: 60px;
  background: var(--color-structure-bg);
  /* Design review fix: --text-secondary (2.24:1 on --color-structure-bg) fails
     WCAG AA at 11px. --color-structure-deep (~7.5:1) preserves visual hierarchy
     while passing AA body-text threshold. */
  color: var(--color-structure-deep);
  font-weight: 600;
  font-size: 11px;
  text-align: center;
  border-right: 1px solid var(--border-default);
}

/* Base cell */
.matrix__cell {
  position: relative;
  width: 72px;
  min-width: 72px;
  height: 60px;
  padding: 4px 5px;
  border: 1px solid var(--border-default);
  background: var(--bg-card);
  /* Explicit default: commissioners on laptops should not see a pointer cursor;
     cells are non-interactive in v1 (resolved decision #6). */
  cursor: default;
  scroll-snap-align: start;
  vertical-align: top;
  overflow: hidden;
}

/* Inner layout helpers */
.matrix__cell-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-variant-numeric: tabular-nums;
}

.matrix__cell-row--top {
  font-size: 10px;
  /* Design review fix: --text-secondary (2.47:1 on white) fails WCAG AA at 10px.
     --color-structure-deep keeps hierarchy vs --text-primary while passing AA. */
  color: var(--color-structure-deep);
}

.matrix__cell-firstname,
.matrix__cell-lastname,
.matrix__cell-posteam {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.matrix__cell-row--mid {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.1;
  margin-top: 1px;
}

.matrix__cell-row--bot {
  font-size: 10px;
  /* Design review fix: matches --top row contrast bump (--text-secondary → --color-structure-deep). */
  color: var(--color-structure-deep);
  text-transform: uppercase;
  margin-top: 2px;
  letter-spacing: 0.5px;
}

.matrix__cell-pickid {
  flex-shrink: 0;
  /* Design review fix: --text-tertiary (1.94:1 on white) failed even the 3:1 large-text
     threshold. --color-structure-deep gives ~7.5:1 while staying lighter than --text-primary
     for the secondary visual role. */
  color: var(--color-structure-deep);
  margin-left: var(--space-2xs, 4px);
}

/* On-clock state — pulsing orange border */
.matrix__cell--onclock {
  border: 3px solid var(--color-action-primary);
  /* Compensate for thicker border so content doesn't shift */
  padding: 2px 3px;
  animation: matrix-pulse 1.6s ease-in-out infinite;
  /* Sit above neighbors so the glow shadow renders over them */
  z-index: 1;
}

/* Reduced-motion override: vestibular-sensitive users get the static orange
   border (color + data-onclock attribute remain as meaning carriers); only
   the 1.6s pulse loop is suppressed. */
@media (prefers-reduced-motion: reduce) {
  .matrix__cell--onclock {
    animation: none;
  }
}

@keyframes matrix-pulse {
  /* DBR-13: rewritten to use --color-action-primary-rgb (raw R,G,B triple) so
     rgba() can control alpha across the glow animation. The previous approach
     of `var(--color-action-primary)` (a hex token) can't be alpha-mixed inside
     rgba() — this RGB-triple pattern is the CSS custom-property workaround.
     Each theme overrides --color-action-primary-rgb in themeConfig.js so the
     glow colour shifts with the active theme. */
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--color-action-primary-rgb), 0.45); }
  50%       { box-shadow: 0 0 0 4px rgba(var(--color-action-primary-rgb), 0); }
}

/* My-team highlight — 2px left border on every cell whose currentOwner
   matches the viewer's team. Follows current ownership (post-trade picks
   scatter across columns). Color never the only meaning carrier: attribute
   data-mine="true" is also set on the cell (resolved decision #4). */
.matrix__cell--mine {
  border-left: 2px solid var(--border-accent-header);
  /* Design review fix: base cell has padding 4px 5px; the 2px left border
     eats into the 5px left padding (box-sizing: border-box), causing a 2px
     content shift vs. unbordered neighbors. Restore the 5px content gap. */
  padding-left: 5px;
}

/* Traded-pick badge — bottom-right corner, 2-char owner initials */
.matrix__badge {
  position: absolute;
  bottom: 3px;
  right: 3px;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--color-warning-bg, var(--color-action-bg));
  color: var(--color-warning-dark, var(--color-action-dark));
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1;
}

/* ============================================================
   DBR-08 — Pick Confirmation Toast
   Fixed at top of viewport, above sheet (z-toast: 901) and scrim
   (z-modal-backdrop: 900), below modals (z-modal: 1000).
   Mobile: full-width minus 32px side margins.
   Desktop: max-width 400px, centered.
   ============================================================ */

@keyframes pick-toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* The wrapper is rendered UNCONDITIONALLY by PickToast.js so the aria-live
   region is already in the DOM when its text content changes (NVDA / JAWS
   silently ignore late-injected live regions). Base state is hidden;
   .pick-toast--visible promotes it to on-screen. The variant class controls
   color but is independent of visibility. */
.pick-toast {
  position: fixed;
  /* Safe-area inset: accounts for iOS notch / Dynamic Island. The inner 16px
     is required by spec as the env() fallback literal — CSS custom properties
     are not valid fallback arguments inside env(). */
  top: max(var(--space-base), env(safe-area-inset-top, 16px));
  left: var(--space-base);
  right: var(--space-base);
  max-width: 400px;
  /* Center on desktop when wider than 432px (400px + 32px margins) */
  margin-inline: auto;
  z-index: var(--z-toast);
  padding: var(--space-md) var(--space-base);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-md);
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-normal);
  /* Hidden default: offscreen + non-interactive. No animation on the wrapper
     itself so toggling --visible can drive the slide-in. */
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.pick-toast--visible {
  pointer-events: auto;
  animation: pick-toast-slide-in 220ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pick-toast--success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.pick-toast--error {
  background: var(--color-danger-bg);
  color: var(--color-danger-dark);
}

/* Reduced-motion: collapse slide animation to instant appear/disappear.
   The toast still becomes visible — motion is simply removed. */
@media (prefers-reduced-motion: reduce) {
  .pick-toast--visible {
    animation-duration: 0s;
  }
}

/* ==========================================================================
   DBR-09 — Players Tab + Player Row
   PlayersTab: search input + position filter chips + player list + pagination.
   PlayerRow: queue toggle / position chip / name+salary / right slot / ADP bar.
   Touch targets: queue toggle and Draft chip both 44×44px minimum (WCAG 2.5.5).
   Token discipline: no raw hex/rgba/spacing literals below.
   ========================================================================== */

/* --- PlayersTab container ------------------------------------------------ */

.players-tab {
  display: flex;
  flex-direction: column;
}

/* Sticky search zone — stays at top of the sheet body as list scrolls beneath */
.players-tab__search {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-page);
  padding: var(--space-sm) var(--space-base);
  border-bottom: 1px solid var(--color-structure-lightest);
}

.players-tab__search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--space-sm);
  background: var(--bg-card);
  border: 1px solid var(--color-structure-lighter);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  outline: none;
  box-sizing: border-box;
}

.players-tab__search-input:focus {
  border-color: var(--color-action-primary);
}

/* Sticky filter chip strip — stacks below search field */
.players-tab__filters {
  position: sticky;
  top: calc(44px + var(--space-sm) * 2 + 2px); /* search zone height */
  z-index: 10;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-base);
  background: var(--bg-page);
  border-bottom: 1px solid var(--color-structure-lightest);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.players-tab__filter-chip {
  min-height: 44px;
  padding: 0 var(--space-sm);
  border-radius: var(--border-radius-full, 999px);
  border: 1.5px solid var(--color-structure-lighter);
  background: transparent;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

/* Active chip: solid position-tinted fill */
.players-tab__filter-chip--active.players-tab__filter-chip--qb  { background: var(--color-position-qb-bg);  color: var(--color-position-qb-text);  border-color: var(--color-position-qb-text);  }
.players-tab__filter-chip--active.players-tab__filter-chip--rb  { background: var(--color-position-rb-bg);  color: var(--color-position-rb-text);  border-color: var(--color-position-rb-text);  }
.players-tab__filter-chip--active.players-tab__filter-chip--wr  { background: var(--color-position-wr-bg);  color: var(--color-position-wr-text);  border-color: var(--color-position-wr-text);  }
.players-tab__filter-chip--active.players-tab__filter-chip--te  { background: var(--color-position-te-bg);  color: var(--color-position-te-text);  border-color: var(--color-position-te-text);  }
.players-tab__filter-chip--active.players-tab__filter-chip--k   { background: var(--color-position-k-bg);   color: var(--color-position-k-text);   border-color: var(--color-position-k-text);   }
.players-tab__filter-chip--active.players-tab__filter-chip--def { background: var(--color-position-def-bg); color: var(--color-position-def-text); border-color: var(--color-position-def-text); }

/* Inactive chip: subtle position text colour + outline */
.players-tab__filter-chip--qb  { color: var(--color-position-qb-text);  border-color: var(--color-position-qb-text);  }
.players-tab__filter-chip--rb  { color: var(--color-position-rb-text);  border-color: var(--color-position-rb-text);  }
.players-tab__filter-chip--wr  { color: var(--color-position-wr-text);  border-color: var(--color-position-wr-text);  }
.players-tab__filter-chip--te  { color: var(--color-position-te-text);  border-color: var(--color-position-te-text);  }
.players-tab__filter-chip--k   { color: var(--color-position-k-text);   border-color: var(--color-position-k-text);   }
.players-tab__filter-chip--def { color: var(--color-position-def-text); border-color: var(--color-position-def-text); }

@media (prefers-reduced-motion: reduce) {
  .players-tab__filter-chip {
    transition: none;
  }
}

/* Scrollable list — bottom padding avoids home-indicator overlap */
/* Semantic <ul>; reset default list styling so visual rendering matches the
   prior <div> array. <li> children are bare wrappers around <PlayerRow>. */
.players-tab__list {
  flex: 1;
  padding: 0 0 var(--space-3xl, 80px) 0;
  margin: 0;
  list-style: none;
}

.players-tab__list-item {
  list-style: none;
}

/* Empty state — centred, muted (uses --color-structure-deep for WCAG AA on light bg). */
.players-tab__empty {
  text-align: center;
  padding: var(--space-3xl, 60px) var(--space-base);
  color: var(--color-structure-deep);
}

.players-tab__empty-text {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-sm);
}

.players-tab__clear-search {
  background: none;
  border: none;
  color: var(--color-action-primary);
  font-size: var(--font-size-base);
  text-decoration: underline;
  cursor: pointer;
  padding: var(--space-xs) 0;
  min-height: 44px;
}

/* "Show 100 more" footer button */
.players-tab__load-more {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: var(--space-sm) var(--space-base);
  background: var(--bg-card);
  border: none;
  border-top: 1px solid var(--color-structure-lightest);
  color: var(--color-action-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  text-align: center;
  cursor: pointer;
}

.players-tab__load-more:active {
  background: var(--color-action-bg);
}

/* --- PlayerRow ----------------------------------------------------------- */

.player-row {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px; /* increased from 56px to fit salary subtitle (spec) */
  padding: var(--space-xs) var(--space-base);
  background: var(--bg-card);
  border-bottom: 1px solid var(--color-structure-lightest);
  gap: var(--space-sm);
}

/* Queued row: --color-action-bg tint on the entire row */
.player-row--queued {
  background: var(--color-action-bg);
}

/* --- Left: queue toggle (44×44 tap target) ------------------------------ */

.player-row__queue-toggle {
  /* Minimum WCAG 2.5.5 touch target */
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: var(--border-radius-sm);
}

.player-row__queue-toggle:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Center: position chip + name + salary ------------------------------ */

.player-row__main {
  flex: 1;
  min-width: 0; /* allow text truncation */
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.player-row__name-line {
  display: flex;
  align-items: center;
  gap: var(--space-2xs, 4px);
  flex-wrap: nowrap;
  overflow: hidden;
}

/* Position chip inside the row — narrower than filter chips */
.player-row__pos-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 2px 4px;
  border-radius: var(--border-radius-sm, 3px);
  font-size: 0.7rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.player-row__name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-row__team {
  font-size: var(--font-size-sm);
  color: var(--color-structure-deep);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Salary subtitle — second line, --font-size-sm (12px). Uses --color-structure-deep
   for WCAG AA contrast on light backgrounds (--text-secondary fails at this size). */
.player-row__salary {
  font-size: var(--font-size-sm);
  color: var(--color-structure-deep);
  padding-left: calc(34px + var(--space-2xs, 4px)); /* align under the name, past pos chip */
}

/* --- Right: three mutually exclusive slots ------------------------------ */

/* ADP rank number — mono, WCAG-compliant secondary tone */
.adp-rank {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-structure-deep);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}

/* Draft chip — call-to-action; min 44px touch target. Dark text on orange
   for WCAG AA contrast: --color-structure-deepest on --color-action-primary
   resolves to 4.13:1, which clears the 3:1 large-text threshold at 14px bold
   (--font-size-base) but would fail 4.5:1 at 12px. Keep at --font-size-base. */
.draft-chip {
  min-height: 44px;
  padding: 0 var(--space-sm);
  background: var(--color-action-primary);
  color: var(--color-structure-deepest);
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide, 0.05em);
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.12s;
}

.draft-chip:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .draft-chip {
    transition: none;
  }
}

/* Drafted chip — non-interactive label for picked players in search results.
   Dark text on light-blue bg for WCAG AA (--text-secondary fails). */
.drafted-chip {
  display: inline-block;
  padding: var(--space-2xs, 4px) var(--space-xs);
  background: var(--color-structure-lighter);
  color: var(--color-structure-deepest);
  border-radius: var(--border-radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- Bottom: 4px ADP indicator bar -------------------------------------- */

/* Bar track — full row width, 4px, absolute at the bottom edge of the row */
.player-row__adp-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-structure-lightest);
  overflow: hidden;
}

/* Bar fill — proportional width set inline; --color-action-primary orange */
.player-row__adp-bar-fill {
  height: 100%;
  background: var(--color-action-primary);
  transition: width 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  .player-row__adp-bar-fill {
    transition: none;
  }
}

/* ============================================================================
   DBR-10 — My Queue tab
   queue-tab*, queue-row*, overflow menu, drag-lift animations.

   Token discipline: zero raw hex/rgba/spacing literals. Use var(--space-*),
   var(--color-*), var(--font-*).
   WCAG note: do NOT use --text-secondary on light backgrounds (fails 4.5:1).
   Use --color-structure-deep for secondary text on light bg.
   ============================================================================ */

/* ---- Container ---- */

.queue-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: var(--color-structure-bg);
}

/* ---- Sticky header strip ---- */

.queue-tab__header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-xs, 8px) var(--space-sm, 12px);
  background: var(--color-structure-bg);
  border-bottom: 1px solid var(--color-structure-lightest);
  font-size: var(--font-size-sm, 0.875rem);
  /* --color-structure-deep passes 4.5:1 on light backgrounds */
  color: var(--color-structure-deep);
  font-weight: var(--font-weight-regular, 500);
  flex-shrink: 0;
}

/* ---- Scrollable list ---- */

.queue-tab__list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---- Off-screen ARIA live region ---- */
/* Persistently in DOM (NVDA/JAWS require pre-existing live regions).
   clip-path hides it visually without display:none (which silences SR). */

.queue-tab__live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  pointer-events: none;
}

/* ---- Empty state ---- */

.queue-tab__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm, 12px);
  padding: var(--space-xl, 32px) var(--space-md, 16px);
  text-align: center;
  flex: 1;
}

.queue-tab__empty-headline {
  font-size: var(--font-size-base, 1rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-structure-deepest);
}

.queue-tab__empty-subtitle {
  font-size: var(--font-size-sm, 0.875rem);
  /* --color-structure-deep: safe secondary text on light bg */
  color: var(--color-structure-deep);
  max-width: 280px;
  line-height: 1.5;
}

.queue-tab__empty-cta {
  min-height: 44px;
  min-width: 44px;
  padding: var(--space-xs, 8px) var(--space-md, 16px);
  background: var(--color-action-primary);
  /* WCAG: --color-structure-deepest on --color-action-primary = 4.13:1.
     Clears the 3:1 large-text threshold at --font-size-base (14px) bold per
     WCAG 2.1 SC 1.4.3 — same precedent as .draft-chip in DBR-09. Do not
     drop below --font-size-base or below bold weight here. */
  color: var(--color-structure-deepest);
  border: none;
  border-radius: var(--border-radius-md, 8px);
  font-size: var(--font-size-base, 1rem);
  font-weight: var(--font-weight-bold, 700);
  cursor: pointer;
  transition: opacity 0.12s;
}

.queue-tab__empty-cta:hover,
.queue-tab__empty-cta:focus-visible {
  opacity: 0.85;
  outline: 2px solid var(--color-action-primary);
  outline-offset: 2px;
}

/* ============================================================================
   Queue Row
   ============================================================================ */

.queue-row {
  display: flex;
  align-items: center;
  /* ~56px tall — comfortable touch target height */
  min-height: 56px;
  padding: var(--space-xs, 8px) var(--space-xs, 8px) var(--space-xs, 8px) 0;
  border-bottom: 1px solid var(--color-structure-lightest);
  background: var(--bg-card, var(--color-structure-bg));
  position: relative;
  /* will-change so compositor can elevate the row independently during drag */
  will-change: transform;
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: grab;
  user-select: none;
  /* iOS Safari fix: touch-action MUST be `none` from the baseline (not just
     during active drag). The browser evaluates touch-action at the START of
     a touch sequence and commits to pan-y on the first pointermove — long
     before the 400ms long-press timer fires. Switching to `none` only on
     the .queue-row--dragging class is too late; the gesture has already
     been claimed by the sheet body's pan-y scroll. Trade-off: users cannot
     scroll the queue list by dragging on a row. They scroll the sheet body
     via the tab bar, the sticky header, or the area below the rows. For typical
     5–20 entry queues this is acceptable; if queues grow to 100+ we revisit
     with a dedicated drag-handle gesture zone. */
  touch-action: none;
}

.queue-row:focus-visible {
  outline: 2px solid var(--color-action-primary);
  outline-offset: -2px;
}

/* ---- Lifted state (active drag) ---- */

.queue-row--dragging {
  /* Spec line 1410: scale(1.02) translateY(-2px) static lift. JS sets an
     inline `transform: translateY(<delta>px)` during pointermove that
     overrides this rule once drag movement starts; before that, this static
     lift provides the immediate visual "pickup" on long-press fire. */
  transform: scale(1.02) translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  z-index: 20;
  /* Lock touch-action: none on the dragging row so pan-y doesn't
     compete with setPointerCapture (playbook risk #6 mitigation). */
  touch-action: none;
  cursor: grabbing;
}

/* ---- Left: drag handle + position number ---- */

.queue-row__drag-handle {
  display: flex;
  align-items: center;
  gap: var(--space-2xs, 4px);
  /* 44px minimum tap target for the visual grip area */
  min-width: 44px;
  padding: 0 var(--space-xs, 8px);
  flex-shrink: 0;
  color: var(--color-structure-medium);
}

.queue-row__position {
  font-size: var(--font-size-xs, 0.75rem);
  font-weight: var(--font-weight-bold, 700);
  color: var(--color-structure-deep);
  min-width: 16px;
  text-align: center;
}

/* ---- Center: name + position chip ---- */

.queue-row__main {
  flex: 1;
  min-width: 0;
  padding: 0 var(--space-xs, 8px);
}

.queue-row__name-line {
  display: flex;
  align-items: center;
  gap: var(--space-2xs, 4px);
  flex-wrap: nowrap;
  overflow: hidden;
}

.queue-row__pos-chip {
  display: inline-block;
  padding: 2px var(--space-2xs, 4px);
  border-radius: var(--border-radius-sm, 4px);
  font-size: 0.65rem;
  font-weight: var(--font-weight-bold, 700);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide, 0.05em);
  flex-shrink: 0;
  /* bg and color set inline from POS_COLORS token map */
}

.queue-row__name {
  font-size: var(--font-size-base, 1rem);
  font-weight: var(--font-weight-regular, 500);
  color: var(--color-structure-deepest);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-row__team {
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--color-structure-deep);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---- Right: kebab menu wrapper ---- */

.queue-row__menu-wrapper {
  position: relative;
  flex-shrink: 0;
}

/* Kebab icon button — 44×44 touch target */
.queue-row__menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-structure-medium);
  border-radius: var(--border-radius-sm, 4px);
  transition: background 0.1s;
}

.queue-row__menu-btn:hover,
.queue-row__menu-btn:focus-visible {
  background: var(--color-structure-lightest);
  color: var(--color-structure-deepest);
  outline: 2px solid var(--color-action-primary);
  outline-offset: -2px;
}

/* ---- Overflow popover ---- */

.queue-row__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: var(--space-2xs, 4px) 0;
  background: var(--bg-card, var(--color-structure-bg));
  border: 1px solid var(--color-structure-lightest);
  border-radius: var(--border-radius-md, 8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  /* Ensure the menu is above the sheet drag handle in stacking order */
  isolation: isolate;
}

/* Menu items — 44px minimum tap target */
.queue-row__menu-item {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: var(--space-xs, 8px) var(--space-sm, 12px);
  background: none;
  border: none;
  text-align: left;
  font-size: var(--font-size-base, 1rem);
  color: var(--color-structure-deepest);
  cursor: pointer;
  transition: background 0.1s;
}

.queue-row__menu-item:hover,
.queue-row__menu-item:focus-visible {
  background: var(--color-structure-lightest);
  outline: none;
}

.queue-row__menu-item:disabled {
  color: var(--color-structure-medium);
  cursor: not-allowed;
  pointer-events: none;
}

.queue-row__menu-item--remove {
  color: var(--color-danger-primary);
}

.queue-row__menu-item--remove:hover,
.queue-row__menu-item--remove:focus-visible {
  background: color-mix(in srgb, var(--color-danger-primary) 10%, transparent);
}

/* ============================================================================
   Drag-lift and settle animations
   Used on .queue-row--dragging (lift) and on release (settle snap-back).
   Both are 200ms cubic-bezier(0.32, 0.72, 0, 1) per spec.
   ============================================================================ */

@keyframes queue-row-lift {
  from { box-shadow: none; }
  to   { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
}

@keyframes queue-row-settle {
  from { transform: var(--settle-from-transform, none); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); }
  to   { transform: none; box-shadow: none; }
}

/* ============================================================================
   Reduced-motion overrides
   Drag still works; lift / shadow / shuffle animations are disabled.
   Rows snap instantly into position on release.
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .queue-row {
    transition: none;
  }

  .queue-row--dragging {
    box-shadow: none;
  }

  .queue-tab__empty-cta {
    transition: none;
  }

  @keyframes queue-row-lift {
    from { box-shadow: none; }
    to   { box-shadow: none; }
  }

  @keyframes queue-row-settle {
    from { transform: none; box-shadow: none; }
    to   { transform: none; box-shadow: none; }
  }
}

/* ============================================================================
   DBR-11 — Draft Log tab
   Sticky header strip + grouped, newest-first picks list.
   Token discipline: zero raw hex/rgba. Per DBR-09 WCAG audit, secondary text
   on light backgrounds uses --color-structure-deep (not --text-secondary).
   ============================================================================ */

/* Root container — declares the CSS variable that offsets sticky round headers.
   DraftLogTab.js writes --draft-log-header-height at runtime via ResizeObserver
   so the offset self-adjusts when the strip wraps on narrow viewports. */
.draft-log-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ---- Header strip: "N picks made" ---- */
.draft-log-tab__header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-xs, 4px) var(--space-base, 16px);
  background: var(--color-structure-bg);
  border-bottom: 1px solid var(--color-structure-lightest);
  font-size: 0.875rem;           /* 14px */
  font-weight: 500;
  color: var(--color-structure-deep);
  line-height: 1.4;
}

/* ---- Scroll container ---- */
.draft-log-tab__list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Per-round role="list" wrapper (DBR-11 B-A1 fix): role="separator" is not a
   valid child of role="list", so each round's rows live in their own list
   segment with the round-header separator preceding it as a sibling inside
   .draft-log-tab__list (the role-less scroll container). */
.draft-log-tab__list-segment {
  display: block;
}

/* ---- Empty state ---- */
.draft-log-tab__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs, 4px);
  padding: var(--space-2xl, 32px) var(--space-base, 16px);
  text-align: center;
}

.draft-log-tab__empty-headline {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-structure-deepest);
}

.draft-log-tab__empty-subtitle {
  font-size: 0.875rem;
  color: var(--color-structure-deep);
}

/* ---- Skeleton loading (3 shimmer rows while first poll resolves) ---- */
.draft-log-tab__skeleton {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-structure-lightest);
}

.draft-log-tab__skeleton-row {
  height: 56px;
  background: var(--color-structure-bg);
  animation: draft-log-shimmer 1.4s ease-in-out infinite;
}

@keyframes draft-log-shimmer {
  0%   { opacity: 1; }
  50%  { opacity: 0.45; }
  100% { opacity: 1; }
}

/* ---- Sticky "Round N" separator bar ---- */
/* top offset driven by --draft-log-header-height; 41px is the nominal fallback
   only — never the source of truth. ResizeObserver keeps the variable live. */
.draft-log-tab__round-header {
  position: sticky;
  top: var(--draft-log-header-height, 41px);
  z-index: 5;
  padding: var(--space-2xs, 4px) var(--space-base, 16px);
  background: var(--color-structure-bg);
  border-top: 1px solid var(--color-structure-lightest);
  font-size: 0.75rem;            /* 12px */
  font-weight: 600;
  color: var(--color-structure-deep);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ============================================================================
   Draft Log row
   Non-interactive in v1: no hover, no focus ring, no cursor change.
   ============================================================================ */

.draft-log-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: 0 var(--space-base, 16px);
  height: 56px;
  border-bottom: 1px solid var(--color-structure-lightest);
  background: var(--color-structure-bg);
}

/* ---- Left: R.PP pick label (monospace, 14px semibold) ---- */
.draft-log-row__pick-label {
  flex: 0 0 44px;
  font-family: var(--font-mono, 'SF Mono', 'Menlo', monospace);
  font-size: 0.875rem;           /* 14px */
  font-weight: 600;
  color: var(--color-structure-deepest);
  white-space: nowrap;
}

/* ---- Center-left: position chip ---- */
.draft-log-row__position {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 22px;
  padding: 0 var(--space-2xs, 4px);
  border-radius: var(--border-radius-default);
  font-size: 0.6875rem;          /* 11px */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  /* bg + color set inline from POS_COLORS via style prop */
}

/* ---- Center: player name (flex 1, ellipsis-truncate) ---- */
.draft-log-row__player {
  flex: 1 1 0;
  min-width: 0;
  font-size: 0.875rem;           /* 14px */
  font-weight: 600;
  color: var(--color-structure-deepest);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Center-right: NFL team abbreviation ---- */
.draft-log-row__nfl-team {
  flex: 0 0 auto;
  font-size: 0.75rem;            /* 12px */
  color: var(--color-structure-deep);
  white-space: nowrap;
}

/* ---- Right: picker team abbreviation ---- */
.draft-log-row__picker {
  flex: 0 0 36px;
  text-align: right;
  font-size: 0.75rem;            /* 12px */
  font-weight: 600;
  color: var(--color-structure-deep);
  white-space: nowrap;
}

/* ---- Reduced-motion: disable shimmer ---- */
@media (prefers-reduced-motion: reduce) {
  .draft-log-tab__skeleton-row {
    animation: none;
  }
}

/* ==========================================================================
   DBR-12 — My Team tab
   Segmented control (This draft / Full roster) + position-grouped roster list.
   Token discipline: zero raw hex/rgba/spacing literals.
   Fallback values match the token's real resolved value (see CLAUDE.md / DBR-11
   B-D2 lesson):
     --space-xs  → 4px
     --space-sm  → 8px
     --space-base → 16px
     --space-2xl → 32px
     --border-radius-default → 4px
   ========================================================================== */

/* ---- Container ---- */
.my-team-tab {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ---- Segmented control (sticky strip) ---- */
/* Sticks to top of sheet body; sits above the scrollable list.
   The segments container itself is the pill: rounded border wrapping both
   equally-wide segment buttons. */
.my-team-tab__segments {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 0;
  margin: var(--space-xs, 4px) var(--space-base, 16px);
  background: var(--bg-card);
  border: 1px solid var(--color-structure-lightest);
  border-radius: 9999px;
  overflow: hidden;
}

/* Each segment button */
.my-team-tab__segment {
  flex: 1;
  min-height: 44px; /* WCAG touch target minimum */
  padding: var(--space-xs, 4px) var(--space-sm, 8px);
  background: transparent;
  border: none;
  font-family: var(--font-display);
  /* WCAG SC 1.4.3: active-state contrast is 2.76:1 (white on
     --color-action-primary). 14px bold qualifies as "large text" per
     WCAG 2.1, dropping the threshold from 4.5:1 to 3:1 — but 2.76:1
     still fails 3:1. The active state therefore depends on this size+weight
     for visual scannability while leaving the underlying contrast as a
     known theme-wide gap (DBR-13 will address theme tokens broadly).
     Until then, keep size and weight HERE to maximize legibility. */
  font-size: var(--font-size-base, 0.875rem);
  font-weight: 700;
  letter-spacing: var(--letter-spacing-wide, 0.05em);
  text-transform: uppercase;
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
  white-space: nowrap;
}

/* Active segment: primary action fill, inverse text */
.my-team-tab__segment--active {
  background: var(--color-action-primary);
  color: var(--text-inverse);
}

.my-team-tab__segment:not(.my-team-tab__segment--active):hover {
  background: var(--color-action-bg);
}

@media (prefers-reduced-motion: reduce) {
  .my-team-tab__segment {
    transition: none;
  }
}

/* ---- Off-screen ARIA live region ---- */
/* Persists in DOM at all times (NVDA/JAWS need stable live region from mount).
   Same pattern as .queue-tab__live-region / .draft-log-tab__live-region. */
.my-team-tab__live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Scrollable list container ---- */
.my-team-tab__list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px; /* clear sheet tab bar */
}

/* ---- Position groups (Full-roster view) ---- */
.my-team-tab__groups {
  padding: 0;
}

.my-team-tab__position-group {
  margin: 0;
}

/* Sticky section header: role="heading" aria-level=3 (spec line 1715).
   Stacks BELOW the sticky .my-team-tab__segments pill. MyTeamTab.js writes
   the segments' rendered height to --my-team-segments-height via a
   ResizeObserver, so this offset auto-adapts when the segments wrap on
   narrow viewports (same pattern as DBR-11's --draft-log-header-height). */
.my-team-tab__section-header {
  position: sticky;
  top: var(--my-team-segments-height, 52px);
  padding: var(--space-xs, 4px) var(--space-base, 16px);
  background: var(--color-structure-bg);
  border-bottom: 1px solid var(--color-structure-lightest);
  font-family: var(--font-display);
  font-size: var(--font-size-sm, 0.75rem);
  font-weight: 700;
  letter-spacing: var(--letter-spacing-wide, 0.05em);
  text-transform: uppercase;
  /* --color-structure-deep passes WCAG AA at 12px bold on --color-structure-bg */
  color: var(--color-structure-deep);
  z-index: 1;
}

/* Row list within a segment or position group */
.my-team-tab__row-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ---- Empty state ---- */
.my-team-tab__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Top: 2× --space-2xl = 64px (closest tokenized approximation of the
     designer's 60px target — picked the larger side to keep the empty
     state centered visually below the segments strip). */
  padding: calc(var(--space-2xl, 32px) * 2) var(--space-base, 16px) var(--space-2xl, 32px);
  text-align: center;
}

.my-team-tab__empty-headline {
  font-size: var(--font-size-base, 1rem);
  font-weight: 700;
  color: var(--color-structure-deep);
  margin: 0 0 var(--space-xs, 4px);
}

.my-team-tab__empty-subtitle {
  font-size: var(--font-size-sm, 0.75rem);
  /* --color-structure-deep (#255c74) on --bg-card (#fff) = 7.34:1 — clears
     WCAG 4.5:1 at 12px. Do NOT use --text-secondary on light bg (2.47:1).
     Same audit rule as DBR-09's PlayerRow + DBR-11's DraftLogRow. */
  color: var(--color-structure-deep);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   DBR-12 — RosterRow
   Single row for My Team tab. Variant-aware: three right-slot modes.
   Non-interactive in v1 (no hover/focus state, no onClick).
   ========================================================================== */

/* ---- Row base ---- */
.roster-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  padding: var(--space-sm, 8px) var(--space-base, 16px);
  background: var(--bg-card);
  border-bottom: 1px solid var(--color-structure-lightest);
  min-height: 52px;
}

/* ---- Position chip ---- */
/* 14px bold on --color-action-primary yields 4.13:1 (large-text threshold 3:1,
   acceptable per DBR-09 WCAG audit precedent for the .draft-chip element). */
.roster-row__position {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-default, 4px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  /* bg + color set inline from position token map */
  background: var(--color-position-default-bg);
  color: var(--color-position-default-text);
}

/* Per-position chip overrides (same token pattern as PlayerRow / DraftLogRow) */
.roster-row__position--qb  { background: var(--color-position-qb-bg);  color: var(--color-position-qb-text);  }
.roster-row__position--rb  { background: var(--color-position-rb-bg);  color: var(--color-position-rb-text);  }
.roster-row__position--wr  { background: var(--color-position-wr-bg);  color: var(--color-position-wr-text);  }
.roster-row__position--te  { background: var(--color-position-te-bg);  color: var(--color-position-te-text);  }
.roster-row__position--k   { background: var(--color-position-k-bg);   color: var(--color-position-k-text);   }
.roster-row__position--def { background: var(--color-position-def-bg); color: var(--color-position-def-text); }

/* ---- Center: name + NFL team ---- */
.roster-row__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-row__name {
  font-size: var(--font-size-base, 1rem);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.roster-row__nfl-team {
  font-size: var(--font-size-sm, 0.75rem);
  font-weight: 500;
  /* --color-structure-deep on --bg-card = 7.34:1 — clears WCAG 4.5:1 at 12px.
     DBR-09 / DBR-11 precedent: secondary text on light bg uses structure-deep,
     not --text-secondary (which is 2.47:1 here). */
  color: var(--color-structure-deep);
  flex-shrink: 0;
}

/* ---- Right slot ---- */
.roster-row__right {
  flex-shrink: 0;
  text-align: right;
  min-width: 48px;
}

/* Pick label — 'this-draft' variant right slot */
.roster-row__pick-label {
  font-family: var(--font-mono);
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  color: var(--text-primary);
}

/* Smaller pick label used in 'new-pick' variant below salary */
.roster-row__pick-label--small {
  font-size: 0.625rem; /* 10px */
  color: var(--color-structure-deep);
}

/* Stacked salary + years (or pending) container for 'existing' and 'new-pick' */
.roster-row__right-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

/* Salary — top of right stack for 'existing' and 'new-pick' */
.roster-row__salary {
  font-family: var(--font-mono);
  font-size: 0.875rem; /* 14px */
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Years — below salary for 'existing' variant */
.roster-row__years {
  font-size: 0.625rem; /* 10px */
  color: var(--color-structure-deep);
  white-space: nowrap;
}

/* "Pending years" — below salary for 'new-pick' variant */
.roster-row__pending {
  font-size: 0.625rem; /* 10px */
  color: var(--color-structure-deep);
  white-space: nowrap;
}

/* ==========================================================================
   DBR-13 — DraftStatusHeader
   Always-visible 2-line strip at the top of the DraftBoard page surface,
   above MatrixBoard. Sticky so it remains visible when the matrix scrolls.
   Height: 64px (--draft-status-header-height).

   Token discipline: zero raw hex/rgba/spacing literals. All colors via
   var(--color-…), spacing via var(--space-…). Fallback values MUST match
   the token's resolved value (DBR-11/12 lesson).

   Secondary text uses --color-structure-deep (~7.5:1 on white) not
   --text-secondary (fails 3:1 large-text threshold on some themes).
   ========================================================================== */

.draft-status-header {
  /* Sticky at top of the DraftBoard page, above the matrix band */
  position: sticky;
  top: 0;
  z-index: var(--z-sticky, 200);
  height: var(--draft-status-header-height, 64px);

  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;

  padding: 0 var(--space-base, 1rem);

  background: var(--bg-card, #ffffff);
  border-bottom: 1px solid var(--border-default, #d8ebf3);
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.05));
}

/* Root modifier: viewer is on the clock → orange-tinted background */
.draft-status-header--your-turn {
  background: var(--color-action-bg, #fdf2e7);
}

/* ---- Line 1: draft state + timer ---- */
.draft-status-header__line1 {
  display: flex;
  align-items: center;
  gap: var(--space-xs, 0.25rem);
  /* ~28px of the 64px total height */
  line-height: 1.25;
}

/* Modifier class for your-turn line1 (reserved for future visual tweaks;
   color shift is already covered by the root --your-turn modifier) */
.draft-status-header__line1--your-turn {
  /* intentionally empty in v1; root bg handles the visual; modifier
     is still applied to the element for future CSS targeting */
}

/* State text: the label portion of line 1 */
.draft-status-header__state {
  font-family: var(--font-display, 'Bebas Neue', Impact, sans-serif);
  font-size: var(--font-size-display-sm, 1.25rem);
  letter-spacing: var(--letter-spacing-wider, 2px);
  text-transform: uppercase;
  color: var(--text-primary, var(--color-structure-deepest, #183e4e));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Timer portion of line 1 — monospace for legibility of digit changes */
.draft-status-header__timer {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--font-size-base, 0.875rem);
  font-weight: var(--font-weight-semibold, 700);
  color: var(--text-primary, var(--color-structure-deepest, #183e4e));
  white-space: nowrap;
  flex-shrink: 0;
}

/* Critical-timer modifier: text color only. NO animation, NO background change.
   (Spec locked decision #2 — Stephen's answer 2026-05-10.) */
.draft-status-header__timer--critical {
  color: var(--color-timer-critical, var(--color-danger-primary, #cf3e30));
}

/* WCAG: --color-timer-critical (#cf3e30) on the your-turn orange-tinted bg
   (#fdf2e7) = 4.34:1 — fails 4.5:1 body-text and fails large-text 3:1 too
   at 14px bold. Scope the critical color to --color-danger-dark (#7c251d)
   when both your-turn AND critical fire simultaneously: ratio rises to
   ~7.7:1 on the same orange-tinted bg. */
.draft-status-header--your-turn .draft-status-header__timer--critical {
  color: var(--color-danger-dark);
}

/* Off-screen live region — only carries transition announcements. Visual
   line 1 is aria-hidden; this sibling is what screen readers consume.
   Pattern: same visually-hidden technique as DBR-10's .queue-tab__live-region
   and DBR-11's .draft-log-tab__live-region. */
.draft-status-header__live-region {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Line 2: cap + pick context (always visible) ---- */
.draft-status-header__line2 {
  display: flex;
  align-items: center;
  /* ~28px of the 64px total height */
  line-height: 1.25;
}

/* Cap line text: salary / cap · years / limit · Pick R.PP */
.draft-status-header__cap {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--font-size-sm, 0.75rem);
  font-weight: var(--font-weight-regular, 500);
  /* Secondary text on light bg: --color-structure-deep gives ~7.5:1 contrast.
     NOT --text-secondary (--color-structure-medium, fails 3:1 on some themes).
     Consistent with DBR-11 / DBR-12 audit findings. */
  color: var(--color-structure-deep, #255c74);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pick label span — same font, slightly bolder for scannability */
.draft-status-header__pick {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: var(--font-size-sm, 0.75rem);
  font-weight: var(--font-weight-semibold, 700);
  color: var(--color-structure-deep, #255c74);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: var(--space-xs, 0.25rem);
}
