/*
 * players.css — Players page responsive polish
 * Scoped to html[data-route="/players"] — zero bleed to other pages.
 *
 * Layout: the .app grid fills the full viewport like every other route — the
 * sidebar pins to the far-left edge and .content fills the rest. (A prior
 * max-width:1440px cap that centered the whole shell was removed 2026-07-03;
 * see the LAYOUT note lower in this file.)
 *
 * Filter bar: condensed to a single row — position dropdown, label-less
 * conf/team/sort selects, and a compact icon-led search.
 *
 * Polish bundle: motion, interaction depth, team-link style, skeleton fade.
 */

/* ─── CARD ENTRANCE ─────────────────────────────────────────────────────── */
@keyframes pl-card-fadein {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pl-card.is-pl-visible {
  animation: pl-card-fadein 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  @keyframes pl-card-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ─── MODAL ENTRANCE ────────────────────────────────────────────────────── */
@keyframes pl-modal-fadein {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.pl-modal[open] {
  animation: pl-modal-fadein 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  @keyframes pl-modal-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
  }
}

/* ─── ACTION BUTTONS ────────────────────────────────────────────────────── */
.pl-act-btn:focus-visible {
  outline: 2px solid var(--sns-accent, var(--red-primary, #FF1A1A));
  outline-offset: 2px;
}

.pl-act-btn:active {
  transform: scale(0.96);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Icon inside action buttons (injected by player-actions.js renderButtons()) */
.pl-act-ic {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.pl-act-ic svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ─── MODAL CLOSE BUTTON ────────────────────────────────────────────────── */
.pl-modal-close {
  min-width: 44px;
  min-height: 44px;
}

.pl-modal-close:hover {
  background: rgba(255, 0, 0, 0.35); /* Q-EXP-5: match exp-card.css ✕ hover */
  border-radius: 8px;
}

.pl-modal-close:focus-visible {
  outline: 2px solid var(--sns-accent, var(--red-primary, #FF1A1A));
  outline-offset: 2px;
  border-radius: 6px;
}

/* ─── POSITION CHIPS ────────────────────────────────────────────────────── */
.pl-chip:active {
  transform: scale(0.97);
}

.pl-chip.is-active {
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* ─── TEAM LINK ─────────────────────────────────────────────────────────── */
.pl-card-school.team-link,
.pl-modal-school.team-link {
  text-decoration: underline;
  text-decoration-color: var(--red-primary, #FF1A1A);
  text-underline-offset: 3px;
  /* Long school names ("Middle Tennessee") hard-cut on narrow cards (ui-audit
     TEXT_CLIP); truncate gracefully with an ellipsis instead of clipping mid-letter. */
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.pl-card-school.team-link:hover,
.pl-modal-school.team-link:hover {
  color: var(--red-bright, #FF4d4d);
}

/* ─── SKELETON FADE ─────────────────────────────────────────────────────── */
/* Applied by JS as a transition class before clearing the grid */
.pl-loading-banner--fading {
  transition: opacity 0.3s ease;
  opacity: 0 !important;
}

/* ─── LAYOUT — full-bleed sidebar + full-width content ──────────────────────
   The .app grid (sidebar + content) used to be capped at max-width:1440px and
   centered. On any monitor WIDER than 1440px that pushed the whole shell —
   sidebar included — into the middle of the screen, so the SNS rail no longer
   sat flush to the far-left edge and the content stopped filling the page.
   Removed: /players now matches every other route — .app fills 100vw, the
   sidebar pins to the left edge, and .content fills the remaining 1fr and
   auto-formats to the viewport. — pward 2026-07-03 */

/* ─── FILTER BAR — condensed to a single row ────────────────────────────────
   Position filter collapsed from a 7-chip strip into one dropdown; the
   CONF / TEAM / SORT text labels removed (each select's own option text
   carries the context); search collapsed to an icon-led compact field that
   widens on focus. The toolbar now flows on one line on desktop and wraps
   gracefully on smaller screens instead of the old overflow-scroll strip.
   Page-scoped — beats the shared components.css rules via html[data-route]
   specificity; components.css itself is untouched. — pward 2026-07-03 */
html[data-route="/players"] {

  /* One wrapping row at every width (overrides the components.css mobile
     column-stack + overflow-scroll fallbacks). */
  .pl-bar {
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
  }

  /* Compact, icon-led search — slim by default, widens on focus. */
  .pl-search.pl-search--compact {
    flex: 0 1 190px;
    min-width: 46px;
    max-width: 100%;
    width: auto;
    transition: flex-basis .18s ease;
  }
  .pl-search.pl-search--compact:focus-within { flex-basis: 280px; }
  .pl-search--compact .pl-search-input {
    min-height: 40px;
    padding: 8px 12px 8px 34px;
    letter-spacing: .04em;
  }

  /* Position dropdown + the conf/team/sort selects — label-less, uniform height. */
  .pl-sort { gap: 0; flex: 0 0 auto; }
  .pl-sort-select { min-height: 40px; }
  .pl-pos-select { font-weight: 700; }

  /* Injury toggle stays a chip, matched to the control height. */
  .pl-chip--injury {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

} /* end html[data-route="/players"] scope */

/* Mobile tap-target compliance (Phase C8): the filter controls are the primary
   interactive surface on /players, so on phones they must clear the 44px
   thumb-zone floor. The shared route.css sets these to 44px @≤880, but it lives
   in @layer components and is out-ranked by this unlayered file — so the 44px
   floor is re-asserted here where it actually wins. Desktop keeps the denser
   40px toolbar. */
@media (max-width: 880px) {
  html[data-route="/players"] .pl-search--compact .pl-search-input,
  html[data-route="/players"] .pl-sort-select,
  html[data-route="/players"] .pl-chip--injury {
    min-height: 44px;
  }
}

/* ─── SCHOOL-COLOR PLAYER TILES (2026-07-01 v2, Pat) ─────────────────────────
   Tile fades school color (top) → BLACK (bottom). Position badge in the TOP-LEFT
   corner; name centered beneath the avatar. Type bright-white + uniform; school-
   name underline WHITE. THIN white ring only behind the player image (no white
   panel). Missing photo → SNS shield. .is-school-colored set in JS (--team). */
html[data-route="/players"] {
  /* tile: school color at the very top → black at the bottom */
  .pl-card.is-school-colored {
    position: relative;
    background: linear-gradient(180deg,
      var(--team) 0%,
      color-mix(in srgb, var(--team) 42%, #000000) 46%,
      #000000 100%);
    border-color: rgba(255, 255, 255, 0.14);
  }
  /* uniform bright-white type (shadow keeps it legible under the top band) */
  .pl-card.is-school-colored .pl-card-name,
  .pl-card.is-school-colored .pl-card-school,
  .pl-card.is-school-colored .pl-card-stats .stat-val,
  .pl-card.is-school-colored .pl-card-stats .stat-lbl,
  .pl-card.is-school-colored .pl-card-pos {
    color: #F5F5F5 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  }
  /* school-name underline = WHITE */
  .pl-card.is-school-colored .pl-card-school.team-link {
    text-decoration-color: #FFFFFF;
    -webkit-text-decoration-color: #FFFFFF;
    text-underline-offset: 3px;
  }
  /* position badge → top-left corner; name centers beneath the avatar */
  .pl-card.is-school-colored .pl-card-pos {
    position: absolute;
    top: 8px;
    left: 8px;
    margin: 0;
    background: rgba(0, 0, 0, 0.38);
    z-index: 2;
  }
  .pl-card.is-school-colored .pl-card-head { justify-content: center; }
  /* THIN white ring, only behind the player image */
  .pl-card.is-school-colored .pl-card-img-wrap::before {
    inset: -2px;
    background: #FFFFFF;
  }
  /* Lock the avatar to a perfect circle — the fixed height was losing to an
     intrinsic-aspect fallback on mobile (image rendered 60x44.7 → oval ring). */
  .pl-card.is-school-colored .pl-card-img,
  .pl-card.is-school-colored .pl-card-img-wrap {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px;
    aspect-ratio: 1 / 1;
  }
  .pl-card.is-school-colored .pl-card-img {
    object-fit: cover;
    background: #FFFFFF;
  }
  /* contained (not cropped) for SNS-logo / school-logo fallbacks, on white */
  .pl-card.is-school-colored .pl-card-img--logo {
    object-fit: contain;
    padding: 6px;
    background: #FFFFFF;
  }
  .pl-card.is-school-colored:hover {
    border-color: #FFFFFF;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  }
}

/* ─── FORMAT BUCKET TABS — scopes the pool server-side via ?bucket= ────────
   Sits above the filter toolbar (row-pl-buckets). "Canton" (NFL/pro) is a
   disabled coming-soon chip — SNS is college-only, no pro data behind it. */
.pl-bucket-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pl-bucket-tab {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--gray-border, #2A2A2A);
  background: transparent;
  color: var(--gray-light, #8A8A8A);
  font-family: var(--f-mono, monospace);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.pl-bucket-tab:hover:not(.is-disabled) {
  border-color: var(--red-primary, #FF1A1A);
  color: var(--white-bright, #F5F5F5);
}
.pl-bucket-tab.is-active {
  background: var(--red-primary, #FF1A1A);
  border-color: var(--red-primary, #FF1A1A);
  color: #fff;
}
.pl-bucket-tab.is-disabled,
.pl-bucket-tab[disabled] {
  opacity: .4;
  cursor: not-allowed;
}
@media (max-width: 880px) {
  .pl-bucket-tab { min-height: 44px; }
}

/* ─── ADP BADGE — player-pool parity (A) ────────────────────────────────── */
.pl-card-adp {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--f-mono, monospace);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gray-light, #8A8A8A);
  border: 1px solid var(--gray-border, #2A2A2A);
  background: rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  white-space: nowrap;
}
.pl-card.is-school-colored .pl-card-adp {
  color: #F5F5F5 !important;
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.28);
  text-shadow: none;
}

/* ─── TIER BADGE — 2026 projection engine (positional tier) ─────────────── */
.pl-card-tier {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-family: var(--f-mono, monospace);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  vertical-align: middle;
  white-space: nowrap;
  border: 1px solid transparent;
}
.pl-card-tier.is-elite { color: #1A1205; background: #F2C14E; border-color: #F2C14E; }  /* gold — elite */
.pl-card-tier.is-good  { color: #06231A; background: #4ADE80; border-color: #4ADE80; }  /* green — strong */
.pl-card-tier.is-mid   { color: var(--white-bright, #F5F5F5); background: rgba(255, 255, 255, 0.08); border-color: var(--gray-border, #2A2A2A); }
.pl-card-tier.is-low   { color: var(--gray-light, #8A8A8A); background: rgba(255, 255, 255, 0.03); border-color: var(--gray-border, #2A2A2A); }
/* keep the neutral/low bands legible on school-colour tiles */
.pl-card.is-school-colored .pl-card-tier.is-mid,
.pl-card.is-school-colored .pl-card-tier.is-low {
  color: #F5F5F5 !important;
  background: rgba(0, 0, 0, 0.30);
  border-color: rgba(255, 255, 255, 0.30);
}

