/* صفحة بروفايل اللاعب
   الهدف: كروت بنفس لغة الموقع (match-board / الإحصائيات)،
   وارتفاع أقل — المركز والرادار في صف واحد بدل سطرين كاملين. */

.player-profile-page {
    --pp-accent: var(--mb-accent, #39dbbf);
    --pp-card: var(--mb-panel-bg, #151825);
    --pp-card-line: var(--mb-panel-border, #1e2235);
    --pp-chip: #1a1d2e;
    --pp-chip-line: #252a40;
    --pp-text: #fff;
    --pp-muted: #8b90a8;
    --pp-radius: 12px;
}

html.light .player-profile-page {
    --pp-card: #fff;
    --pp-card-line: #e8eaf3;
    --pp-chip: #f8f9fc;
    --pp-chip-line: #e8eaf3;
    --pp-text: #0e1019;
    --pp-muted: #6c6f83;
}

.player-profile-page .inner-page-content {
    padding-top: 10px;
    padding-bottom: 8px;
}

.player-profile-page .match-block-item {
    margin-bottom: 14px;
}

/* --------------------------------------------------------------------------
   الترويسة: أقصر، والصورة لا تغطي شريط الصفات
   -------------------------------------------------------------------------- */

.player-profile-page .profile-header-wrapper.player {
    min-height: 0;
}

.player-profile-page .profile-header-wrapper.player .player-profile-info {
    min-height: 210px;
    padding-bottom: 76px;
    gap: 12px;
}

.player-profile-page .player-info-wrap {
    position: relative;
    z-index: 3;
}

.player-profile-page .profile-header-wrapper.player .player-big-img {
    width: min(36%, 230px);
    max-width: min(36%, 230px);
    left: 0;
    z-index: 1;
}

.player-profile-page .profile-header-wrapper.player .player-big-img img {
    max-height: 200px;
    max-width: 100%;
    width: auto;
}

.player-profile-page .player-info-wrap .text .player-name h1.player-page-heading,
.player-profile-page .player-info-wrap .text .player-name h3 {
    font-size: 24px;
    margin-bottom: 6px;
}

.player-profile-page .player-info-wrap .text .player-name p.player-subline {
    font-size: 13px;
    line-height: 1.45;
    max-width: 42em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.player-profile-page .player-info-wrap .player-stats-info {
    position: relative;
    z-index: 4;
}

.player-profile-page .profile-header-wrapper.player .player-info-wrap .player-stats-info {
    left: clamp(118px, 30vw, 220px);
    right: 12px;
}

.player-profile-page .player-info-wrap .player-stats-info .player-info-item {
    padding: 2px 16px;
}

@media (min-width: 992px) {
    .player-profile-page .profile-header-wrapper.player .player-profile-info {
        padding-bottom: 0;
        min-height: 210px;
    }

    .player-profile-page .player-info-wrap {
        margin-left: min(28vw, 240px);
        width: auto;
        max-width: none;
        padding-top: 16px;
    }

    .player-profile-page .profile-header-wrapper.player .player-info-wrap .player-stats-info {
        position: relative;
        left: auto;
        right: auto;
    }

    .player-profile-page .profile-header-wrapper.player .player-big-img {
        width: auto;
        max-width: min(32vw, 240px);
    }
}

/* --------------------------------------------------------------------------
   الإحصائيات: كروت أصغر، والجزائيات/أساسي جنب بعض
   -------------------------------------------------------------------------- */

.player-profile-page .players-stats-wrap .player-stats-item .block-title {
    margin-bottom: 10px;
}

.player-profile-page .players-stats-wrap .scrollable-area-x {
    margin-bottom: 10px;
}

.player-profile-page .players-stats-wrap .stats-block-wrap {
    padding: 12px;
}

.player-profile-page .players-stats-wrap .general-stats-wrap {
    gap: 8px;
    display: flex !important;
    flex-wrap: wrap !important;
}

.player-profile-page .players-stats-wrap .general-stats-item:not(.penalties) {
    min-height: 78px;
    padding: 10px 8px !important;
}

.player-profile-page .players-stats-wrap .general-stats-item:not(.penalties) .head {
    margin-bottom: 4px;
    gap: 4px;
}

.player-profile-page .players-stats-wrap .general-stats-item:not(.penalties) .head span {
    font-size: 20px;
}

.player-profile-page .players-stats-wrap .general-stats-item:not(.penalties) .head svg {
    width: 18px;
    height: 18px;
}

.player-profile-page .players-stats-wrap .player-stats-split-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    order: 10;
}

.player-profile-page .players-stats-wrap .player-stats-split-row:has(> :only-child) {
    grid-template-columns: 1fr;
}

.player-profile-page .players-stats-wrap .general-stats-wrap > .google-auto-placed,
.player-profile-page .players-stats-wrap .general-stats-wrap > ins,
.player-profile-page .players-stats-wrap .general-stats-wrap > .adsbygoogle {
    flex: 1 1 100%;
    width: 100%;
    order: 20;
}

.player-profile-page .players-stats-wrap .general-stats-item.penalties {
    flex: none !important;
    width: 100% !important;
    max-width: none;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 10px !important;
    gap: 8px;
}

.player-profile-page .players-stats-wrap .penalties-stats.m-3,
.player-profile-page .players-stats-wrap .general-stats-item.penalties .m-2,
.player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 .penalty-info-item .m-2 {
    margin: 0 !important;
}

.player-profile-page .players-stats-wrap .general-stats-item.penalties:not(.m-2) .penalties-stats,
.player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 .total-goals,
.player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 .penalty-info-item {
    padding: 10px 8px;
}

.player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 .penalty-info-item {
    grid-column: auto;
}

.player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 .total-goals .progress {
    margin: 0 0 6px;
    transform: scale(0.78);
    transform-origin: center top;
}

/* --------------------------------------------------------------------------
   صف المركز + أداء الموسم
   -------------------------------------------------------------------------- */

.player-profile-page .player-insight-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: stretch;
    margin-top: 12px;
}

.player-profile-page .player-insight-grid .match-block-item {
    margin: 0;
    min-width: 0;
}

.player-profile-page .player-insight-grid .p-r-s-position-data,
.player-profile-page .player-insight-grid .p-r-s-radar-data,
.player-profile-page .player-insight-grid .p-r-s-radar-block,
.player-profile-page .player-insight-grid .p-r-s-position-block {
    width: 100%;
    max-width: 100%;
    flex: none;
    height: 100%;
}

.player-profile-page .p-r-s-radar-block,
.player-profile-page .p-r-s-position-block {
    background: var(--pp-card);
    border: 1px solid var(--pp-card-line);
    border-radius: var(--pp-radius);
    box-shadow: none;
    display: flex;
    flex-direction: column;
}

html .player-profile-page .p-r-s-radar-block,
html .player-profile-page .p-r-s-position-block {
    background: var(--pp-card);
    border-color: var(--pp-card-line);
}

.player-profile-page .p-r-s-radar-header,
.player-profile-page .p-r-s-position-header {
    min-height: 36px;
    padding: 7px 12px;
    background: transparent;
    border-bottom: 1px solid var(--pp-card-line);
}

html .player-profile-page .p-r-s-radar-header,
html .player-profile-page .p-r-s-position-header {
    background: transparent;
    border-bottom-color: var(--pp-card-line);
}

html .player-profile-page .p-r-s-position-header span,
html .player-profile-page .p-r-s-radar-title,
html .player-profile-page .p-r-s-position-name,
html .player-profile-page .p-r-s-radar-label strong {
    color: var(--pp-text);
}

html .player-profile-page .p-r-s-radar-small-title,
html .player-profile-page .p-r-s-position-small-title,
html .player-profile-page .p-r-s-position-more-title,
html .player-profile-page .p-r-s-radar-matches span,
html .player-profile-page .p-r-s-radar-legend,
html .player-profile-page .p-r-s-radar-label span {
    color: var(--pp-muted);
}

html .player-profile-page .p-r-s-radar-matches strong {
    color: var(--pp-accent);
}

html .player-profile-page .p-r-s-position-code {
    background: rgba(57, 219, 191, 0.12);
    border-color: rgba(57, 219, 191, 0.28);
    color: var(--pp-accent);
}

html .player-profile-page .p-r-s-radar-label,
html .player-profile-page .p-r-s-position-label {
    background: var(--pp-chip);
    border-color: var(--pp-chip-line);
    color: var(--pp-text);
    box-shadow: none;
}

.player-profile-page .p-r-s-position-content {
    padding: 10px;
    gap: 8px;
    align-items: center;
    flex: 1;
}

.player-profile-page .p-r-s-position-info {
    padding: 4px 8px;
    flex: 0 1 42%;
}

.player-profile-page .p-r-s-position-map {
    flex: 1 1 58%;
    min-width: 0;
}

.player-profile-page .p-r-s-position-name {
    font-size: 15px;
}

.player-profile-page .p-r-s-position-field {
    max-width: 280px;
    aspect-ratio: 16 / 10;
}

.player-profile-page .p-r-s-radar-chart-wrapper {
    padding: 8px 6px 2px;
}

.player-profile-page .p-r-s-radar-chart {
    max-width: 210px;
}

.player-profile-page .p-r-s-radar-legend {
    padding: 4px 12px 10px;
}

/* --------------------------------------------------------------------------
   التقييم والانتقالات: أقل حشواً
   -------------------------------------------------------------------------- */

.player-profile-page .p-r-s-wrapper .block-title {
    margin-bottom: 10px;
}

.player-profile-page .p-r-s-leagues {
    margin: 0 0 10px;
}

.player-profile-page .p-r-s-league {
    min-height: 38px;
    padding: 5px 12px;
}

.player-profile-page .p-r-s-team-card {
    min-height: 88px;
    padding: 10px 14px;
    gap: 12px;
    border-radius: var(--pp-radius);
}

.player-profile-page .p-r-s-team-logo {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
}

.player-profile-page .p-r-s-monthly-chart {
    height: 140px;
}

.player-profile-page .p-r-s-monthly-card {
    padding: 12px 14px 10px;
    border-radius: var(--pp-radius);
}

.player-profile-page .p-r-s-match-row {
    min-height: 52px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.player-profile-page .player-transfers-block {
    margin-bottom: 16px;
}

.player-profile-page .player-transfers-block .section-title {
    margin-bottom: 10px;
}

.player-profile-page .player-transfers-block .stats-block-wrap {
    padding: 12px;
    gap: 8px;
}

.player-profile-page .player-transfers-block .transform-history-item {
    padding: 10px 12px;
}

/* --------------------------------------------------------------------------
   جوال: عمود واحد، الترويسة تبقى كما هي تقريباً
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
    .player-profile-page .player-info-wrap {
        margin-left: 0;
    }

    .player-profile-page .profile-header-wrapper.player .player-info-wrap {
        padding-top: 20px;
    }

    .player-profile-page .profile-header-wrapper.player .player-info-wrap .player-stats-info {
        left: calc(min(36%, 230px) + 12px);
    }

    .player-profile-page .player-insight-grid {
        grid-template-columns: 1fr;
    }

    .player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .player-profile-page .players-stats-wrap .general-stats-item.penalties.m-2 .penalty-info-item {
        grid-column: 1 / -1;
    }

    .player-profile-page .p-r-s-radar-chart {
        max-width: 240px;
    }
}

@media (max-width: 767px) {
    .player-profile-page .profile-header-wrapper.player .player-big-img {
        width: 32%;
        max-width: 120px;
        left: -6px;
    }

    .player-profile-page .profile-header-wrapper.player .player-big-img img {
        max-height: 168px;
    }

    .player-profile-page .profile-header-wrapper.player .player-info-wrap .player-stats-info {
        left: calc(32% + 8px);
        gap: 4px;
        flex-wrap: wrap;
        overflow: visible;
    }

    .player-profile-page .profile-header-wrapper.player .player-profile-info {
        padding-bottom: 148px;
        min-height: 220px;
    }

    .player-profile-page .profile-header-wrapper.player .player-info-wrap .player-stats-info .player-info-item {
        flex: 1 1 calc(33.333% - 4px);
        min-width: 0;
        height: 58px;
        padding: 4px 2px !important;
    }

    .player-profile-page .players-stats-wrap .player-stats-split-row {
        grid-template-columns: 1fr;
    }

    .player-profile-page .p-r-s-position-content {
        flex-direction: column-reverse;
    }

    .player-profile-page .p-r-s-position-info,
    .player-profile-page .p-r-s-position-map {
        width: 100%;
        flex: none;
    }

    .player-profile-page .p-r-s-position-field {
        max-width: 320px;
    }
}
