/* =============================================================================
   [player-hub.css] - styles only the player hub has ({tab}/{slug}-t{id}: overview,
   match stats, salary, trophies). Loaded after leagues-v1.css, league-hub.css and
   team-hub.css, which already style the hero, tab bar, cards, tables, tiles,
   trophy cards, pitch lines and transfer arrows. Prefix: "player-hub-".
   ============================================================================= */

/* Hero: round photo, position chip, country | club ------------------------------ */

.player-hub-hero__photo img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(85, 85, 100, .25);
}

.player-hub-hero__name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-hub-hero__position {
    padding: 0 6px;
    border-radius: 4px;
    background: #1b8cff;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}

.player-hub-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
    color: var(--text-muted, #8c8c8e);
    font-size: 13px;
}

.player-hub-hero__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.player-hub-hero__meta-item + .player-hub-hero__meta-item {
    padding-left: 12px;
    border-left: 1px solid #2a2c33;
}

.player-hub-hero__meta-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Country flag (a span); the club crest (a link) is shown whole */
span.player-hub-hero__meta-item img {
    border-radius: 50%;
    object-fit: cover;
}

.player-hub-hero-favorite img {
    width: 18px;
    height: 18px;
}

/* Overview: general information ------------------------------------------------- */

.player-hub-general__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #191a1e;
}

.player-hub-general__club {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: #fff;
    text-decoration: none;
}

.player-hub-general__club img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.player-hub-general__club span {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-hub-general__club small {
    color: var(--text-muted, #8c8c8e);
    font-size: 12px;
}

.player-hub-general__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 32px;
    margin: 0;
}

.player-hub-general__grid dd img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: -3px;
}

/* Overview: market value line chart (points/crests/labels positioned in %) ------- */

.player-hub-market__chart {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
    grid-template-rows: 200px 24px;
    column-gap: 8px;
    padding-top: 24px;
}

.player-hub-market__plot {
    position: relative;
    border-left: 1px solid #23252b;
    border-bottom: 1px solid #23252b;
}

.player-hub-market__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.player-hub-market__club {
    position: absolute;
    top: -22px;
    width: 16px;
    height: 16px;
    object-fit: contain;
    transform: translateX(-50%);
}

.player-hub-market__point {
    position: absolute;
    z-index: 1;
    width: 8px;
    height: 8px;
    border: 1.5px solid #e6e6e8;
    border-radius: 50%;
    background: #0f1015;
    transform: translate(-50%, -50%);
    cursor: pointer;
}

.player-hub-market__point.is-current {
    width: 10px;
    height: 10px;
    border-color: #1b8cff;
    background: #1b8cff;
}

.player-hub-market__cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    border-left: 1px dashed #1b8cff;
    pointer-events: none;
}

.player-hub-market__tip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    /* display (not opacity): a hidden tip must not widen the page on phones */
    display: none;
    padding: 4px 8px;
    border-radius: 6px;
    background: #23252b;
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
}

.player-hub-market__point.is-right .player-hub-market__tip {
    left: auto;
    right: 0;
    transform: none;
}

.player-hub-market__point.is-left .player-hub-market__tip {
    left: 0;
    transform: none;
}

.player-hub-market__point:hover .player-hub-market__tip,
.player-hub-market__point:focus-visible .player-hub-market__tip {
    display: block;
}

.player-hub-market__axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: -6px 0;
    padding: 0;
    list-style: none;
    color: var(--text-muted, #8c8c8e);
    font-size: 11px;
}

.player-hub-market__labels {
    position: relative;
    color: var(--text-muted, #8c8c8e);
    font-size: 11px;
}

.player-hub-market__labels span {
    position: absolute;
    top: 6px;
    transform: translateX(-50%);
    white-space: nowrap;
}

.player-hub-market__tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-hub-market__tile--current .league-hub-tile__value {
    color: #1b8cff;
}

/* Overview: attributes radar ---------------------------------------------------- */

.player-hub-radar {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    aspect-ratio: 300 / 260;
}

.player-hub-radar__svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.player-hub-radar__grid {
    fill: none;
    stroke: #2a2c33;
    stroke-width: 1;
}

.player-hub-radar__average {
    fill: none;
    stroke: #8c8c8e;
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.player-hub-radar__value {
    fill: rgba(27, 140, 255, .45);
    stroke: #1b8cff;
    stroke-width: 1.5;
}

.player-hub-radar__label {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #e6e6e8;
    font-size: 13px;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

.player-hub-radar__label b {
    padding: 0 5px;
    border: 1px solid #e5233e;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 16px;
}

/* Overview: playing position (list + pitch, the pitch lines are team-hub.css) ----- */

.player-hub-position__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 200px);
    gap: 16px;
}

.player-hub-position__list {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.player-hub-position__list > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid #191a1e;
}

.player-hub-position__list > div:last-child {
    border-bottom: 0;
}

.player-hub-position__list dt {
    margin-bottom: 4px;
    color: var(--text-muted, #8c8c8e);
    font-size: 13px;
    font-weight: 400;
}

.player-hub-position__list dd {
    margin: 0;
    color: #e6e6e8;
    font-size: 13px;
}

.player-hub-position__list dd.is-primary {
    color: #1b8cff;
}

.player-hub-position__list dd.is-empty {
    color: var(--text-muted, #8c8c8e);
}

.player-hub-position__pitch {
    align-self: start;
    border: 1px solid #23252b;
    border-radius: 12px;
    background: #12141a;
}

.player-hub-position__marker {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid #1b8cff;
    border-radius: 50%;
    background: rgba(27, 140, 255, .2);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    transform: translate(-50%, -50%);
}

.player-hub-position__marker.is-primary {
    border-color: #2fbf71;
    background: rgba(47, 191, 113, .25);
}

/* Overview: average rating bars (colour per rating band) ------------------------- */

.player-hub-rating__sub {
    color: var(--text-muted, #8c8c8e);
    font-size: 13px;
}

.player-hub-rating__badge {
    padding: 2px 8px;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.player-hub-rating__chart {
    position: relative;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    height: 200px;
    padding-top: 20px;
    --rating-track: 140px;
}

.player-hub-rating__avg {
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: var(--rating-track);
    pointer-events: none;
}

.player-hub-rating__avg-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px dashed #1b8cff;
}

.player-hub-rating__col {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
    color: var(--text-muted, #8c8c8e);
    font-size: 11px;
    text-decoration: none;
}

.player-hub-rating__track {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    height: var(--rating-track);
}

.player-hub-rating__bar {
    position: relative;
    width: 12px;
    min-height: 4px;
    border-radius: 4px 4px 0 0;
}

.player-hub-rating__value {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    color: inherit;
    font-size: 11px;
    font-weight: 600;
    transform: translateX(-50%);
}

.player-hub-rating__none {
    color: var(--text-muted, #8c8c8e);
}

.player-hub-rating__opponent {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.player-hub-rating--bad { background: #8b1a24; color: #e5233e; }
.player-hub-rating--poor { background: #e5233e; color: #ff6b77; }
.player-hub-rating--average { background: #ff7a1a; color: #ff9b50; }
.player-hub-rating--good { background: #1b8cff; color: #5aaeff; }
.player-hub-rating--great { background: #1fbf6f; color: #3fdc8a; }
.player-hub-rating--elite { background: #8b5cf6; color: #a78bfa; }

.player-hub-rating__badge.player-hub-rating--bad,
.player-hub-rating__badge.player-hub-rating--poor,
.player-hub-rating__badge.player-hub-rating--average,
.player-hub-rating__badge.player-hub-rating--good,
.player-hub-rating__badge.player-hub-rating--great,
.player-hub-rating__badge.player-hub-rating--elite {
    color: #fff;
}

/* Overview: transfer history ---------------------------------------------------- */

.player-hub-transfers__row {
    display: grid;
    grid-template-columns: 60px minmax(0, 1fr) 110px;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    border-top: 1px solid #191a1e;
    color: #e6e6e8;
    font-size: 14px;
}

.player-hub-transfers__row--head {
    min-height: 40px;
    border-top: 0;
    color: var(--text-muted, #8c8c8e);
}

.player-hub-transfers__move {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    text-align: center;
}

.player-hub-transfers__club {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: inherit;
    font-size: 14px;
    text-decoration: none;
}

.player-hub-transfers__club--from {
    justify-content: flex-end;
}

.player-hub-transfers__club span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-hub-transfers__club img {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.player-hub-transfers__fee {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.player-hub-transfers__fee small {
    color: var(--text-muted, #8c8c8e);
    font-size: 12px;
}

.player-hub-transfers__total {
    padding-top: 12px;
    border-top: 1px solid #191a1e;
    color: var(--text-muted, #8c8c8e);
    font-size: 13px;
    text-align: right;
}

.player-hub-transfers__total strong {
    color: #fff;
}

/* Match stats: filters, match rows, rail summary --------------------------------- */

.player-hub-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-hub-filter__toggle {
    min-width: 150px;
    height: 36px;
    justify-content: space-between;
    padding: 0 12px;
    border-radius: 10px;
}

.player-hub-filter__toggle[disabled] {
    cursor: default;
    opacity: .5;
}

.player-hub-matches {
    gap: 0;
    padding: 0;
    overflow: hidden;
}

.player-hub-matches__row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 44px 32px 32px 48px 52px;
    align-items: center;
    column-gap: 6px;
    min-height: 46px;
    padding: 0 12px;
    border-top: 1px solid #191a1e;
    color: #e6e6e8;
    font-size: 13px;
    text-decoration: none;
}

.player-hub-matches__row:hover {
    background: rgba(85, 85, 100, .08);
}

.player-hub-matches__row--head {
    min-height: 44px;
    border-top: 0;
    color: var(--text-muted, #8c8c8e);
    font-size: 12px;
}

.player-hub-matches__row--head:hover {
    background: none;
}

.player-hub-matches__group {
    padding: 10px 12px;
    border-top: 1px solid #191a1e;
    background: #15171d;
}

.player-hub-matches__league {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.player-hub-matches__league img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.player-hub-matches__date {
    color: var(--text-muted, #8c8c8e);
    font-size: 12px;
}

.player-hub-matches__fixture {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.player-hub-matches__row--head .player-hub-matches__fixture {
    display: block;
    text-align: center;
}

.player-hub-matches__team {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 14px;
}

.player-hub-matches__team--home {
    justify-content: flex-end;
}

.player-hub-matches__team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-hub-matches__team img {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.player-hub-matches__score {
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.player-hub-matches__num,
.player-hub-matches__rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.player-hub-matches__rating {
    color: #1b8cff;
    font-weight: 500;
}

.player-hub-matches__row--head .player-hub-matches__rating {
    color: inherit;
}

.player-hub-card-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 10px;
    height: 14px;
    padding: 0 2px;
    border-radius: 2px;
    color: #000;
    font-size: 10px;
    font-weight: 600;
}

.player-hub-card-chip--red {
    background: #e5233e;
    color: #fff;
}

.player-hub-card-chip--yellow {
    background: #ffd21f;
}

.player-hub-icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    background: currentColor;
}

.player-hub-icon--minutes {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.player-hub-icon--assist {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 16c3 0 6-1 8-4l2-5 3 1-1 4c2 1 4 1 6 1v4H9c-2 0-4 0-6-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 16c3 0 6-1 8-4l2-5 3 1-1 4c2 1 4 1 6 1v4H9c-2 0-4 0-6-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.player-hub-summary {
    gap: 0;
    padding: 0 0 8px;
    overflow: hidden;
}

.player-hub-summary__title {
    margin: 0;
    padding: 10px 12px;
    background: #15171d;
    color: #eee;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

.player-hub-summary__list {
    margin: 0;
    padding: 4px 12px 8px;
}

/* Salary tab --------------------------------------------------------------------- */

/* Figma 4600:150391: 48px rows, every cell 12px Regular white and centred, cells split by 0.5px #191a1e lines,
   fixed columns Year 90 | Teams 150 | League (fills) | Contract until 80 | Weekly 110 | Annual 110. The design's
   table text is 12px (the hub-wide 14px applies to list/card names, not to this dense table). */
.player-hub-salary {
    gap: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 8px;
    background: var(--second, #12141b);
}

.player-hub-salary__row {
    display: grid;
    grid-template-columns: 90px 150px minmax(0, 1fr) 80px 110px 110px;
    min-height: 48px;
    border-bottom: .5px solid #191a1e;
    background: var(--second, #12141b);
    color: #fff;
    font-family: var(--font-vn, 'Be Vietnam Pro', sans-serif);
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    text-align: center;
}

.player-hub-salary__row:last-child {
    border-bottom: 0;
}

.player-hub-salary__row--head {
    background: rgba(85, 85, 100, .1);
}

.player-hub-salary__row > * {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 4px;
    border-right: .5px solid #191a1e;
}

.player-hub-salary__row > :first-child,
.player-hub-salary__row > :nth-child(4) {
    padding: 0 8px;
}

.player-hub-salary__row > :last-child {
    border-right: 0;
}

/* Long league names / "Contract until" header end with "..." like the design */
.player-hub-salary__row > * > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Teams cell: crest + name, left-aligned (the header label stays centred) */
.player-hub-salary__team {
    justify-content: flex-start;
    gap: 6px;
    color: inherit;
    text-decoration: none;
}

.player-hub-salary__team:hover span {
    color: #1d8fff;
}

.player-hub-salary__team img {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: contain;
}

.player-hub-salary__weekly {
    color: #1d8fff;
}

/* Trophies tab: one full-width card per honour, season + club per line ---------- */

.player-hub-trophies {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.player-hub-trophies__title {
    font-size: 15px;
    text-transform: uppercase;
}

.player-hub-trophies__title .team-hub-trophy-count {
    margin-left: 6px;
    color: #1b8cff;
}

.player-hub-trophies__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.player-hub-trophies__list li {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    color: #e6e6e8;
    font-size: 12px;
}

.player-hub-trophies__team {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.player-hub-trophies__team img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

@media (max-width: 767px) {
    .player-hub-general__top {
        flex-direction: column;
        align-items: flex-start;
    }

    .player-hub-general__grid {
        grid-template-columns: 1fr;
    }

    .player-hub-position__body {
        grid-template-columns: 1fr;
    }

    .player-hub-position__pitch {
        width: 200px;
        margin: 0 auto;
    }

    .player-hub-rating__chart {
        gap: 2px;
    }

    .player-hub-rating__bar {
        width: 8px;
    }

    .player-hub-rating__score {
        display: none;
    }

    /* phone: date, match, rating */
    .player-hub-matches__row {
        grid-template-columns: 48px minmax(0, 1fr) 40px;
    }

    .player-hub-matches__num {
        display: none;
    }

    .player-hub-salary {
        overflow-x: auto;
    }

    .player-hub-salary__row {
        min-width: 640px;
    }

    .player-hub-trophies__list li {
        grid-template-columns: 100px minmax(0, 1fr);
        font-size: 13px;
    }
}
