/* ===== Player Data page (uses the colors defined in style.css) ===== */

[hidden] { display: none !important; }

.status { margin: .5rem 0 1rem; font-weight: 600; }
.status:empty { display: none; }
.status.error { color: var(--red); }

.pl-page { max-width: 1200px; }
.pl-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin-bottom: 1rem; }
.pl-header .page-title { margin: 0; }
.pl-sub { margin: 0; color: var(--muted); }

/* ----- Search ----- */
.pl-search { position: relative; max-width: 640px; }
.pl-search input {
  width: 100%; font: inherit; font-size: 1.1rem; padding: .85rem 1rem .85rem 2.9rem;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--card); color: var(--text);
}
.pl-search input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(225, 6, 0, .15); }
.pl-search-icon { position: absolute; left: 1rem; top: 50%; width: 1.2rem; height: 1.2rem; transform: translateY(-50%);
  fill: none; stroke: var(--subtle); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.pl-results {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: .3rem; list-style: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0, 0, 0, .18); max-height: 60vh; overflow-y: auto;
}
.pl-results li { padding: .55rem .7rem; border-radius: 8px; cursor: pointer; display: flex; flex-direction: column; gap: .1rem; }
.pl-results li.active, .pl-results li:hover { background: var(--surface); }
.pl-results li.pl-noresult { cursor: default; color: var(--subtle); }
.pl-r-name { font-weight: 700; }
.pl-r-meta { font-size: .82rem; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: .25rem; }
.pl-r-meta b { color: var(--red); }
.pl-r-logo { width: 16px; height: 16px; object-fit: contain; }
.pl-hint { margin: .5rem 0 1.25rem; font-size: .85rem; color: var(--subtle); }

/* ----- Suggestions ----- */
.pl-empty h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--red); margin: 1rem 0 .6rem; }
.pl-try { display: flex; flex-wrap: wrap; gap: .5rem; }
.pl-try-btn { font: inherit; font-weight: 700; padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card);
  cursor: pointer; display: flex; gap: .4rem; align-items: baseline; color: var(--text); }
.pl-try-btn span { font-weight: 400; font-size: .8rem; color: var(--subtle); }
.pl-try-btn:hover { border-color: var(--ink); }

/* ----- Cards, side by side ----- */
.pl-cards { display: grid; gap: 1.25rem; align-items: start; }
.pl-cards[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pl-cards[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pl-card { border: 1px solid var(--line); border-radius: 16px; background: var(--card); overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, .04); scroll-margin-top: calc(var(--nav-height) + 1rem); }

.pl-card-head {
  position: relative; display: flex; gap: 1rem; align-items: flex-end; padding: 1.25rem 1.25rem 1rem; color: var(--white);
  background: linear-gradient(135deg, var(--team) 0%, #111 120%);
}
.pl-x { position: absolute; top: .5rem; right: .6rem; border: none; background: rgba(255, 255, 255, .15); color: var(--white);
  width: 2rem; height: 2rem; border-radius: 50%; font-size: 1.3rem; line-height: 1; cursor: pointer; }
.pl-x:hover { background: rgba(255, 255, 255, .3); }
.pl-photo { position: relative; flex: none; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, .12); overflow: hidden; display: grid; place-items: center; }
.pl-photo img:not(.pl-photo-logo) { width: 100%; height: 100%; object-fit: cover; object-position: top; position: relative; z-index: 2; }   /* headshot on top */
.pl-initials { position: absolute; font-family: var(--display); font-stretch: 72%; font-style: italic; font-weight: 800; font-size: 2.2rem; color: rgba(255, 255, 255, .55); }
.pl-initials { z-index: 0; }
/* Team logo in the card's top-right corner, next to the close button (never over the player photo) */
.pl-card-logo { position: absolute; top: .6rem; right: 3rem; width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .35)); pointer-events: none; }
.pl-id { min-width: 0; }
.pl-id h2 { margin: .1rem 0 .2rem; font-size: 1.7rem; line-height: 1.1; }
.pl-pos { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.pl-facts { font-size: .9rem; opacity: .9; }
.pl-draftline { font-size: .85rem; font-weight: 700; margin-top: .3rem; }
.pl-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.pl-badge { font-size: .72rem; font-weight: 700; padding: .2rem .5rem; border-radius: 999px; background: rgba(255, 255, 255, .18); }
.pl-b-gold { background: #f4c542; color: #3a2b00; }
.pl-b-active { background: #2fa35a; }
.pl-b-prospect { background: var(--red); }

.pl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); border-bottom: 1px solid var(--line); }
.pl-tile { padding: .7rem .5rem; text-align: center; border-right: 1px solid var(--line); }
.pl-tile b { display: block; font-size: 1.25rem; }
.pl-tile span { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--subtle); }

.pl-sections { padding: .25rem 1.25rem 1.25rem; }
.pl-sec { padding-top: 1rem; }
.pl-sec + .pl-sec, .pl-live:not(:empty) + .pl-sec { border-top: 1px solid var(--line); margin-top: 1rem; }
.pl-sec h3 { margin: 0 0 .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--red); display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; }
.pl-sec h3 a { color: inherit; }
.pl-h-note { font-size: .72rem; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--subtle); }
.pl-note { font-size: .85rem; color: var(--muted); margin: .5rem 0; }
.pl-dim { color: var(--subtle); font-size: .85em; }
.pl-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .35rem 1rem; margin: 0; font-size: .92rem; }
.pl-dl dt { color: var(--muted); }
.pl-dl dd { margin: 0; font-weight: 600; }
.pl-inline-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: -4px; margin-right: .25rem; }
.pl-tiny-logo { width: 14px; height: 14px; object-fit: contain; vertical-align: -2px; margin-right: .2rem; }

/* Combine bars */
.pl-measures { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.pl-measures li { display: grid; grid-template-columns: 5.5rem 4.6rem minmax(0, 1fr) 2.6rem; align-items: center; gap: .5rem; font-size: .88rem; }
.pl-m-label { color: var(--muted); }
.pl-m-val { font-weight: 700; }
.pl-m-pct { font-size: .75rem; color: var(--subtle); text-align: right; }
.pl-bar { height: .55rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pl-bar i { display: block; height: 100%; border-radius: inherit; background: #bbb; }
.pl-bar.hi i { background: #1d8a46; }
.pl-bar.mid i { background: #7bbf5a; }
.pl-bar.lo i { background: #e7a83b; }
.pl-bar.vlo i { background: #d9534f; }
.pl-comps { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .8rem; font-size: .8rem; }
.pl-comps > span { color: var(--muted); margin-right: .2rem; }
.pl-comp { padding: .3rem .6rem; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; }
.pl-comp span { font-weight: 400; color: var(--subtle); }
.pl-comp:hover { border-color: var(--ink); }

/* Stat tables */
.pl-table-wrap { overflow-x: auto; margin: 0 -.25rem; }
.pl-table { border-collapse: collapse; width: 100%; font-size: .82rem; font-variant-numeric: tabular-nums; }
.pl-table th, .pl-table td { padding: .35rem .45rem; text-align: right; white-space: nowrap; }
.pl-table thead th { font-size: .7rem; color: var(--subtle); font-weight: 700; border-bottom: 1px solid var(--line); }
.pl-table .pl-groups th { color: var(--red); text-transform: uppercase; letter-spacing: .05em; border-bottom: none; padding-bottom: 0; text-align: left; }
.pl-table .pl-groups th:not(:first-child) { border-left: 2px solid var(--line); padding-left: .55rem; }
.pl-table td.gs, .pl-table th.gs { border-left: 2px solid var(--line); }
.pl-table .pl-lead { text-align: left; }
.pl-table tbody tr:nth-child(even) { background: var(--surface); }
.pl-table tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.pl-zero { color: #ccc; }
.pl-conf { display: block; font-size: .68rem; color: var(--subtle); }
.pl-snap { position: relative; display: inline-block; width: 3.6rem; height: 1.1rem; background: var(--surface-2); border-radius: 4px; overflow: hidden; vertical-align: middle; }
.pl-snap i { position: absolute; inset: 0 auto 0 0; background: rgba(225, 6, 0, .25); }
.pl-snap b { position: relative; font-size: .72rem; line-height: 1.1rem; padding: 0 .3rem; }

/* Injuries */
.pl-inj { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; }
.pl-inj-row { width: 100%; font: inherit; font-size: .86rem; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
  padding: .45rem .6rem; cursor: pointer; display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: baseline; color: var(--text); }
.pl-inj-row:hover { border-color: var(--line-strong); }
.pl-inj-counts em { color: var(--red); font-style: normal; font-weight: 700; }
.pl-inj-what { color: var(--subtle); margin-left: auto; }
.pl-weeks { font-size: .8rem; padding: .4rem .7rem .2rem; display: grid; gap: .15rem; }

.pl-trades { margin: 0; padding-left: 1.1rem; font-size: .88rem; display: grid; gap: .3rem; }

/* ----- Phones and narrow screens ----- */
@media (max-width: 1200px) {
  .pl-cards[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pl-cards[data-count] { grid-template-columns: minmax(0, 1fr); }
  .pl-card-head { padding: 1rem; gap: .8rem; }
  .pl-photo { width: 72px; height: 72px; }
  .pl-card-logo { width: 38px; height: 38px; top: .55rem; right: 2.7rem; }
  .pl-id h2 { font-size: 1.35rem; }
  .pl-sections { padding: .25rem 1rem 1rem; }
  .pl-measures li { grid-template-columns: 4.6rem 4.2rem minmax(0, 1fr) 2.4rem; font-size: .82rem; }
}
.pl-card-head .pl-id { padding-right: 3.6rem; }   /* room for the corner logo */

/* Corner logo on a light disc so it never blends into the team-color header */
.pl-card-logo { box-sizing: border-box; padding: 7px; border-radius: 50%; background: #f7f7f4; box-shadow: 0 0 0 2px var(--team-2, rgba(255, 255, 255, .5)), 0 3px 10px rgba(0, 0, 0, .3); }
