/* ============================================================
   STATS HUB + INDIVIDUAL PLAYER PAGES
   ============================================================ */

/* ── Stats Hub Page ────────────────────────────────────────── */
.pl-stats-page-section {
    padding: 40px 0 72px;
    background: var(--pl-white);
}

/* Position / role filter row */
.pl-stats-filters {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--pl-border);
    background: var(--pl-cream);
    flex-wrap: wrap;
}

.pl-stats-filter-label {
    font-family: var(--pl-font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pl-ink-light);
    flex-shrink: 0;
}

.pl-stats-filter-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.pl-filter-btn {
    font-family: var(--pl-font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--pl-ink-mid);
    background: var(--pl-white);
    border: 1px solid var(--pl-border);
    padding: 4px 12px;
    border-radius: var(--pl-radius);
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.pl-filter-btn:hover {
    background: var(--pl-green-muted);
    color: var(--pl-green);
    border-color: var(--pl-green);
}

.pl-filter-btn--active {
    background: var(--pl-green);
    color: var(--pl-white);
    border-color: var(--pl-green);
}
.pl-filter-btn--active:hover {
    background: var(--pl-green);
    color: var(--pl-white);
}

/* Player name link in stats tables */
.pl-stats-player-link {
    color: var(--pl-green);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.12s;
}
.pl-stats-player-link:hover {
    color: var(--pl-green-light);
    text-decoration: underline;
}

/* Team cell with logo — used in /stats/ hub table */
.pl-stats-team-cell {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    font-family: var(--pl-font-display) !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.04em !important;
    color: var(--pl-ink-mid) !important;
    white-space: nowrap;
    vertical-align: middle;
}

.pl-stats-team-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}

.pl-stats-pos-col {
    font-family: var(--pl-font-display) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.06em !important;
    color: var(--pl-ink-light) !important;
    text-transform: uppercase !important;
}

/* ══════════════════════════════════════════════════════════
   PLAYER HERO
══════════════════════════════════════════════════════════ */

.pl-player-hero {
    background-color: var(--team-accent, var(--pl-green));
    background-image: repeating-linear-gradient(
        90deg, transparent, transparent 28px,
        rgba(255,255,255,0.04) 28px, rgba(255,255,255,0.04) 30px
    );
    padding: 40px 24px 56px;
    position: relative;
    overflow: hidden;
}

.pl-player-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: 0; right: 0;
    height: 60px;
    background: var(--pl-white);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.pl-player-hero__inner { position: relative; z-index: 1; }

.pl-player-hero__identity {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 20px 0 28px;
}

.pl-player-hero__team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.25));
}

.pl-player-hero__name {
    font-family: var(--pl-font-display);
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--team-text, #fff);
    line-height: 1;
    margin: 0 0 6px;
}

.pl-player-hero__team-link {
    font-family: var(--pl-font-display);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    display: block;
    margin-bottom: 6px;
    transition: color 0.15s;
}
.pl-player-hero__team-link:hover { color: #fff; text-decoration: none; }

.pl-player-hero__pos {
    font-family: var(--pl-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.12);
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* Rankings row */
.pl-player-hero__ranks {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.pl-player-hero__rank-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--pl-radius-lg);
    padding: 10px 18px;
    min-width: 64px;
    text-align: center;
}

.pl-player-hero__rank-num {
    font-family: var(--pl-font-mono);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--pl-gold);
    line-height: 1;
    display: block;
}

.pl-player-hero__rank-label {
    font-family: var(--pl-font-display);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-top: 4px;
    display: block;
}

/* ── Player Body ───────────────────────────────────────────── */
.pl-player-body {
    padding-top: 48px;
    padding-bottom: 72px;
}

.pl-player-section {
    margin-bottom: 48px;
}

/* Stat tables on player page */
.pl-player-stat-table td {
    font-size: 0.88rem !important;
    padding: 12px 14px !important;
}

/* ── Shared logo+abbr cell pattern ─────────────────────────── */
/*
 * pl-player-team-col  → th header for stat tables (year/team split tables)
 * pl-player-team-td   → td body cell for stat tables (uses inline-flex, not flex)
 * pl-gl-team-col      → th header for game log columns
 * pl-gl-team-cell     → td body cell for game log team/opp columns
 *
 * Key rule: td cells must use inline-flex (not flex) so the browser
 * still respects td layout — flex on a td collapses its height context.
 */

/* th header — stat tables (season/career splits) */
.pl-player-team-col {
    white-space: nowrap;
    min-width: 70px;
    font-family: var(--pl-font-display) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

/* td body cell — stat tables (season/career splits) */
.pl-player-team-td {
    white-space: nowrap;
    vertical-align: middle !important;
    line-height: 0; /* collapse line-height so inline-flex span has no extra vertical space */
}
.pl-player-team-td .pl-player-team-inner {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--pl-font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--pl-ink-mid);
    line-height: 1; /* restore normal line-height inside the span */
    vertical-align: middle;
}
/* Inside flex containers, block removes the inline-block baseline gap */
.pl-player-team-td .pl-stats-team-logo,
.pl-gl-team-cell .pl-stats-team-logo {
    display: block;
    vertical-align: unset;
}

/* th header — game log columns */
.pl-gl-team-col {
    white-space: nowrap;
    min-width: 68px;
    font-family: var(--pl-font-display) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

/* td body cell — game log team/opp */
.pl-gl-team-cell {
    white-space: nowrap;
    vertical-align: middle;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.pl-gl-team-cell .pl-gl-team-inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 32px; /* fixed height so TEAM and OPP cells are identically sized */
    font-family: var(--pl-font-display);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--pl-ink-mid);
}

/* vs / @ indicator — match font metrics to the abbr text */
.pl-player-gamelog-ha {
    font-family: var(--pl-font-display);
    font-size: 0.78rem;  /* same size as abbr so baseline aligns */
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    color: var(--pl-ink-light);
    flex-shrink: 0;
}

/* ── Player stat table — year column ───────────────────────── */
.pl-player-year-col {
    font-family: var(--pl-font-mono) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: var(--pl-ink-mid) !important;
    white-space: nowrap;
    min-width: 48px;
    text-align: center !important;
}

/* Career total row — gold top border, cream bg, bold */
.pl-player-total-row td {
    background: var(--pl-cream) !important;
    border-top: 2px solid var(--pl-gold) !important;
    font-weight: 700;
}

/* Year-subtotal row (TOT line within a multi-team year) */
.pl-player-yr-total-row td {
    background: #f0ede7 !important;
    border-top: 1px dashed var(--pl-border) !important;
    font-style: italic;
    color: var(--pl-ink-mid) !important;
}
.pl-player-yr-total-row .pl-gl-team-cell .pl-gl-team-inner span,
.pl-player-yr-total-row .pl-player-team-td .pl-player-team-inner span {
    color: var(--pl-ink-light);
    font-style: italic;
}

/* ── Game log game column ──────────────────────────────────── */
.pl-player-gamelog-game-col {
    min-width: 100px !important;
    white-space: nowrap;
}

.pl-player-gamelog-link {
    font-family: var(--pl-font-mono);
    font-size: 0.72rem;
    color: var(--pl-green);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.12s;
}
.pl-player-gamelog-link:hover { color: var(--pl-green-light); text-decoration: underline; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .pl-player-hero__identity { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pl-player-hero__team-logo { width: 56px; height: 56px; }
    .pl-player-hero__ranks { gap: 10px; }
    .pl-player-hero__rank-item { padding: 8px 12px; min-width: 52px; }
    .pl-player-hero__rank-num { font-size: 1.1rem; }
    .pl-stats-pos-col { display: none; }
    .pl-player-year-col { display: none; }
}

@media (max-width: 480px) {
    .pl-stats-filters { gap: 8px; }
    .pl-filter-btn { padding: 3px 9px; font-size: 0.65rem; }
}