/* =====================================================
   PLAYER PAGE  —  pl- prefix
   ===================================================== */

/* ── Breadcrumb ── */
.pl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 24px;
}
.pl-breadcrumb a { color: #9ca3af; text-decoration: none; }
.pl-breadcrumb a:hover { color: #e8192c; }

/* ── Hero ── */
.pl-hero {
    background: linear-gradient(135deg, #111827 0%, #0d1117 60%, #1a0a0a 100%);
    border: 1px solid #1f2937;
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.pl-hero__avatar {
    width: 88px;
    height: 88px;
    background: #1f2937;
    border-radius: 50%;
    border: 2px solid #374151;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: #4b5563;
    flex-shrink: 0;
    overflow: hidden;
}
.pl-hero__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.pl-hero__info { flex: 1; min-width: 0; }
.pl-hero__name {
    font-size: 28px;
    font-weight: 800;
    color: #f9fafb;
    margin: 0 0 8px;
    line-height: 1.1;
}
.pl-hero__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.pl-hero__meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #9ca3af;
}
.pl-hero__meta-item svg { color: #6b7280; flex-shrink: 0; }
.pl-pos-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 20px;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.pl-pos-badge--Forward  { background: rgba(232,25,44,.12);  color: #e8192c; }
.pl-pos-badge--Midfielder{ background: rgba(59,130,246,.12); color: #60a5fa; }
.pl-pos-badge--Defender { background: rgba(34,197,94,.12);  color: #22c55e; }
.pl-pos-badge--Goalkeeper{ background: rgba(234,179,8,.12); color: #facc15; }
.pl-pos-badge--default  { background: rgba(255,255,255,.06); color: #9ca3af; }

.pl-hero__team {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 7px 12px;
    width: fit-content;
    transition: border-color .15s;
}
.pl-hero__team:hover { border-color: #e8192c; }
.pl-hero__team img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}
.pl-hero__team-name {
    font-size: 13px;
    font-weight: 600;
    color: #f9fafb;
}
.pl-hero__league {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
}
.pl-hero__league:hover { color: #e8192c; text-decoration: underline; }

.pl-hero__stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 28px;
    border-left: 1px solid #1f2937;
    min-width: 180px;
}
.pl-hero__stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.pl-hero__stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pl-hero__stat-val {
    font-size: 22px;
    font-weight: 800;
    color: #e8192c;
    line-height: 1;
}
.pl-hero__stat-val--neutral { color: #f9fafb; }

/* ── Hero pitch (mini position map) ── */
.pl-hero__pitch {
    padding-left: 20px;
    border-left: 1px solid #1f2937;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.pl-hero__pitch .pl-pitch {
    width: 56px;
    height: auto;
    display: block;
    border-radius: 4px;
}

/* ── Rating badge ── */
.pl-rating-badge {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 8px;
    min-width: 58px;
    text-align: center;
    flex-shrink: 0;
}
.pl-rating-badge--high { background: rgba(34,197,94,.15);  border: 1px solid rgba(34,197,94,.3); }
.pl-rating-badge--mid  { background: rgba(234,179,8,.12);  border: 1px solid rgba(234,179,8,.25); }
.pl-rating-badge--low  { background: rgba(232,25,44,.1);   border: 1px solid rgba(232,25,44,.2); }
.pl-rating-badge__val {
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}
.pl-rating-badge--high .pl-rating-badge__val { color: #22c55e; }
.pl-rating-badge--mid  .pl-rating-badge__val { color: #facc15; }
.pl-rating-badge--low  .pl-rating-badge__val { color: #e8192c; }
.pl-rating-badge__label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 3px;
}

/* ── Tabs ── */
.pl-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid #1f2937;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-wrap: nowrap;
}
.pl-tabs::-webkit-scrollbar { display: none; }
.pl-tab {
    flex-shrink: 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 10px 16px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
    margin-bottom: -1px;
    white-space: nowrap;
}
.pl-tab:hover { color: #e8192c; }
.pl-tab.active { color: #e8192c; border-bottom-color: #e8192c; }
/* Sticky nav: JS wraps tabs in full-width bar, centering content via container */
.pl-tabs-stuck-wrapper {
    position: fixed;
    left: 0;
    width: 100%;
    background: #111827;
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
    z-index: 200;
}
.pl-tabs-stuck-wrapper .pl-tabs {
    max-width: var(--container, 1240px);
    margin: 0 auto !important;
    margin-bottom: 0 !important;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pl-tabs-stuck-wrapper .pl-tabs::-webkit-scrollbar { display: none; }

/* ── Sections (scroll-based) ── */
.pl-section {
    scroll-margin-top: calc(var(--header-h, 58px) + 50px + 8px);
    min-height: 4px;
    padding-bottom: 24px;
}

/* ── Layout ── */
.pl-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 20px;
    align-items: start;
}

/* ── Content blocks ── */
.pl-block {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.pl-block__title {
    font-size: 14px;
    font-weight: 700;
    color: #f9fafb;
    padding: 14px 18px;
    border-bottom: 1px solid #1f2937;
}

/* ── Stats grid ── */
.pl-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    padding: 20px;
    gap: 12px;
}
.pl-stat-card {
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
}
.pl-stat-card__val {
    font-size: 26px;
    font-weight: 800;
    color: #e8192c;
    line-height: 1;
    margin-bottom: 6px;
}
.pl-stat-card__val--neutral { color: #f9fafb; }
.pl-stat-card__val--yellow  { color: #f59e0b; }
.pl-stat-card__val--red     { color: #e8192c; }
.pl-stat-card__label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .05em;
}

/* ── Position mini-field ── */
.pl-position-section {
    padding: 20px;
    display: flex;
    justify-content: center;
}
.pl-pitch-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.pl-pitch {
    width: 120px;
    height: 168px;
    border-radius: 6px;
    overflow: hidden;
}
.pl-pitch-label {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
}

/* ── Match row ── */
.pl-match {
    display: grid;
    grid-template-columns: 80px 1fr 100px 1fr 70px;
    align-items: center;
    gap: 0;
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,.04);
    text-decoration: none;
    color: inherit;
    transition: background .12s;
    min-height: 52px;
}
.pl-match:last-child { border-bottom: none; }
.pl-match:hover { background: rgba(255,255,255,.02); }

.pl-match__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    border-right: 1px solid rgba(255,255,255,.04);
}
.pl-match__date-str {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
}
.pl-match__comp {
    font-size: 10px;
    color: #374151;
    margin-top: 2px;
    text-align: center;
}
.pl-match__team {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #d1d5db;
    overflow: hidden;
}
.pl-match__team--right { justify-content: flex-end; }
.pl-match__team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-match__crest {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.pl-match__score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px 4px;
    border-left: 1px solid rgba(255,255,255,.04);
    border-right: 1px solid rgba(255,255,255,.04);
}
.pl-score-box {
    background: #0d1117;
    border: 1px solid #1f2937;
    border-radius: 6px;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 800;
    color: #f9fafb;
}
.pl-score-sep { color: #374151; }
.pl-match__result {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
}
.pl-result-badge {
    font-size: 11px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pl-result-badge--W { background: rgba(34,197,94,.15);  color: #22c55e; }
.pl-result-badge--D { background: rgba(255,255,255,.06); color: #9ca3af; }
.pl-result-badge--L { background: rgba(232,25,44,.12);  color: #e8192c; }

/* ── Profile card (sidebar) ── */
.pl-profile-list {
    display: flex;
    flex-direction: column;
}
.pl-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 18px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    gap: 12px;
}
.pl-profile-row:last-child { border-bottom: none; }
.pl-profile-row__label {
    font-size: 12px;
    color: #6b7280;
}
.pl-profile-row__val {
    font-size: 13px;
    font-weight: 600;
    color: #f9fafb;
    text-align: right;
}

/* ── CTA sidebar block ── */
.pl-cta-block {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 18px;
    margin-top: 16px;
    text-align: center;
}
.pl-cta-block__title {
    font-size: 13px;
    font-weight: 700;
    color: #f9fafb;
    margin-bottom: 6px;
}
.pl-cta-block__sub {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 14px;
    line-height: 1.5;
}
.pl-cta-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #e8192c;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    margin-bottom: 8px;
    transition: background .15s;
}
.pl-cta-btn:hover { background: #c0111f; }
.pl-cta-btn--secondary {
    background: transparent;
    border: 1px solid #374151;
    color: #9ca3af;
}
.pl-cta-btn--secondary:hover { background: transparent; border-color: #6b7280; color: #f9fafb; }

/* ── Loader / error ── */
.pl-loader {
    display: flex;
    justify-content: center;
    padding: 48px 0;
}
.pl-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: #e8192c;
    border-radius: 50%;
    animation: plSpin .7s linear infinite;
}
@keyframes plSpin { to { transform: rotate(360deg); } }

.pl-error {
    background: rgba(224,84,84,.08);
    border: 1px solid rgba(224,84,84,.15);
    border-radius: 8px;
    padding: 14px 18px;
    color: #e05454;
    font-size: 13px;
}

/* ── Advanced stats detail grid ── */
.pl-detail-grid {
    display: flex;
    flex-direction: column;
}
.pl-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255,255,255,.04);
    gap: 16px;
}
.pl-detail-row:last-child { border-bottom: none; }
.pl-detail-row__label {
    font-size: 13px;
    color: #9ca3af;
}
.pl-detail-row__val {
    font-size: 14px;
    font-weight: 700;
    color: #f9fafb;
    text-align: right;
}

/* ── Transfer history ── */
.pl-tf-row {
    display: grid;
    grid-template-columns: 110px 1fr 80px;
    align-items: center;
    gap: 0;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.pl-tf-row:last-child { border-bottom: none; }
.pl-tf-date {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
}
.pl-tf-clubs {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}
.pl-tf-club {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #d1d5db;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.pl-tf-club span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-tf-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    background: #fff;
    border-radius: 4px;
    padding: 2px;
}
.pl-tf-logo-ph {
    width: 22px;
    height: 22px;
    background: #1f2937;
    border-radius: 4px;
    flex-shrink: 0;
}
.pl-tf-arrow {
    font-size: 16px;
    color: #374151;
    flex-shrink: 0;
    padding: 0 4px;
}
.pl-tf-type { text-align: right; }
.pl-tf-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}
.pl-tf-badge--paid { background: rgba(232,25,44,.1);  color: #e8192c; border: 1px solid rgba(232,25,44,.2); }
.pl-tf-badge--free { background: rgba(34,197,94,.1);  color: #22c55e; border: 1px solid rgba(34,197,94,.2); }
.pl-tf-badge--loan { background: rgba(59,130,246,.1); color: #60a5fa; border: 1px solid rgba(59,130,246,.2); }
.pl-tf-badge--na   { background: rgba(107,114,128,.1); color: #9ca3af; border: 1px solid rgba(107,114,128,.2); }

/* ── Injury history ── */
.pl-inj-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.pl-inj-row:last-child { border-bottom: none; }
.pl-inj-row--current { background: rgba(234,179,8,.04); }
.pl-inj-icon { font-size: 18px; flex-shrink: 0; line-height: 1.4; }
.pl-inj-type {
    font-size: 13px;
    font-weight: 600;
    color: #f9fafb;
    margin-bottom: 3px;
}
.pl-inj-active {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    background: rgba(234,179,8,.15);
    color: #facc15;
    border: 1px solid rgba(234,179,8,.3);
    border-radius: 10px;
    padding: 1px 6px;
    vertical-align: middle;
    margin-left: 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pl-inj-dates {
    font-size: 12px;
    color: #6b7280;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .pl-layout { grid-template-columns: 1fr; }
    .pl-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .pl-hero { flex-direction: column; align-items: flex-start; gap: 18px; }
    .pl-hero__stats { padding-left: 0; border-left: none; border-top: 1px solid #1f2937; padding-top: 16px; width: 100%; flex-direction: row; flex-wrap: wrap; }
    .pl-match { grid-template-columns: 68px 1fr 84px 1fr; }
    .pl-match__result { display: none; }
}
@media (max-width: 420px) {
    .pl-hero { padding: 14px; }
    .pl-hero__name { font-size: 20px; }
    .pl-stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .pl-stat-card { padding: 12px; }
    .pl-stat-card__val { font-size: 22px; }
    .pl-match { grid-template-columns: 52px 1fr 74px 1fr; font-size: 11px; }
    .pl-tabs { gap: 0; }
    .pl-tab { font-size: 12px; padding: 8px 10px; }
}

/* ── Trophies tab ── */
.pl-trophy-section {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    padding: 10px 16px 6px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.pl-trophy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.pl-trophy-row:last-child { border-bottom: none; }
.pl-trophy-row__name { font-size: 13px; font-weight: 600; color: #f1f5f9; }
.pl-trophy-row__country { font-size: 11px; color: #6b7280; margin-top: 2px; }
.pl-trophy-row__right { text-align: right; flex-shrink: 0; }
.pl-trophy-row__count { font-size: 16px; font-weight: 700; color: #facc15; }
.pl-trophy-row__seasons { font-size: 10px; color: #6b7280; margin-top: 2px; max-width: 120px; }
