/* SVL_STATS_FRONTEND_V1 */

.stats-hero { margin-bottom: 18px; }

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0 18px;
}

.stats-summary-card,
.stats-coverage-panel,
.stats-block,
.stats-empty,
.stats-data-note {
    background: #fff;
    border: 1px solid rgba(17,24,39,.08);
    border-radius: 20px;
    box-shadow: 0 10px 34px rgba(17,24,39,.05);
}

.stats-summary-card {
    min-height: 108px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stats-summary-card span,
.stats-summary-card small { color: #6b7280; font-size: 13px; }

.stats-summary-card strong {
    display: block;
    margin: 5px 0 2px;
    color: #111827;
    font: 700 30px/1.05 Manrope, Inter, sans-serif;
    letter-spacing: -.03em;
}

.stats-scope {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 0 18px;
}

.stats-scope a {
    flex: 0 0 auto;
    padding: 10px 15px;
    border: 1px solid rgba(17,24,39,.10);
    border-radius: 999px;
    background: #fff;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.stats-scope a:hover,
.stats-scope a.active {
    color: #111827;
    border-color: rgba(17,24,39,.22);
    background: #f4f6f8;
}

.stats-coverage-panel,
.stats-block,
.stats-data-note { padding: 24px; margin: 0 0 20px; }

.stats-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 18px;
}

.stats-section-head h2,
.stats-leader-head h3,
.stats-empty h2,
.stats-empty h3 { margin: 4px 0 0; color: #111827; }

.stats-section-head p {
    max-width: 560px;
    margin: 2px 0 0;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
    text-align: right;
}

.stats-coverage-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    gap: 10px;
}

.stats-coverage-item { padding: 13px 14px; border-radius: 14px; background: #f7f8fa; }
.stats-coverage-item > span { display: block; margin-bottom: 7px; color: #4b5563; font-size: 12px; font-weight: 700; }

.stats-coverage-badge {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

.stats-coverage-badge.is-full { color: #176b45; background: #eaf7f0; }
.stats-coverage-badge.is-partial { color: #8a5a0a; background: #fff4d8; }
.stats-coverage-badge.is-none { color: #6b7280; background: #eceff3; }

.stats-table-wrap { width: 100%; overflow-x: auto; border: 1px solid rgba(17,24,39,.07); border-radius: 16px; }
.stats-table { width: 100%; min-width: 760px; border-collapse: collapse; background: #fff; }
.stats-table th, .stats-table td { padding: 12px 13px; border-bottom: 1px solid rgba(17,24,39,.07); text-align: right; white-space: nowrap; }
.stats-table th { color: #6b7280; background: #f8f9fb; font-size: 11px; text-transform: uppercase; }
.stats-table th:nth-child(2), .stats-table td:nth-child(2), .stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table tbody tr:last-child td { border-bottom: 0; }
.stats-table tbody tr:hover { background: #fafbfc; }
.stats-rank { width: 42px; color: #9ca3af; text-align: center !important; }

.stats-team { display: inline-flex; align-items: center; gap: 10px; color: #111827; font-weight: 700; text-decoration: none; }
.stats-team:hover { text-decoration: underline; text-underline-offset: 3px; }
.stats-team img { width: 30px; height: 30px; object-fit: contain; }

.stats-player-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.stats-leader-card { overflow: hidden; border: 1px solid rgba(17,24,39,.08); border-radius: 17px; background: #fff; }
.stats-leader-head { display: flex; justify-content: space-between; gap: 16px; padding: 17px 18px 13px; border-bottom: 1px solid rgba(17,24,39,.07); }
.stats-leader-head h3 { font-size: 18px; }
.stats-leader-head small { color: #9ca3af; font-size: 11px; padding-top: 5px; }

.stats-leader-row {
    display: grid;
    grid-template-columns: 24px 36px minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(17,24,39,.06);
}
.stats-leader-row:last-child { border-bottom: 0; }
.stats-leader-rank { color: #9ca3af; font-size: 12px; font-weight: 800; text-align: center; }
.stats-player-photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #eef1f4; }
.stats-player-photo.is-empty { display: block; }
.stats-player-name { min-width: 0; }
.stats-player-name strong, .stats-player-name a, .stats-player-name span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-player-name strong { color: #111827; font-size: 13px; }
.stats-player-name a, .stats-player-name span { margin-top: 2px; color: #6b7280; font-size: 11px; text-decoration: none; }
.stats-leader-value { color: #111827; font: 700 17px/1 Manrope, Inter, sans-serif; }
.stats-leader-note { padding: 10px 16px; color: #6b7280; background: #fafbfc; border-top: 1px solid rgba(17,24,39,.06); font-size: 11px; }
.stats-empty-card { padding: 20px 18px; color: #6b7280; font-size: 13px; }

.stats-empty { margin: 0 0 20px; padding: 28px; }
.stats-empty.compact { box-shadow: none; background: #f8f9fb; }
.stats-empty p, .stats-data-note p { margin: 8px 0 0; color: #6b7280; line-height: 1.6; }
.stats-empty a { color: #111827; font-weight: 700; }

@media (max-width: 900px) {
    .stats-summary-grid, .stats-coverage-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .stats-player-grid { grid-template-columns: 1fr; }
    .stats-section-head { flex-direction: column; gap: 8px; }
    .stats-section-head p { text-align: left; }
}

@media (max-width: 640px) {
    .stats-summary-grid { gap: 10px; }
    .stats-summary-card { padding: 15px; min-height: 94px; }
    .stats-summary-card strong { font-size: 24px; }
    .stats-coverage-panel, .stats-block, .stats-data-note, .stats-empty { padding: 18px; border-radius: 16px; }
    .stats-leader-row { grid-template-columns: 22px 32px minmax(0,1fr) auto; gap: 8px; padding: 9px 12px; }
    .stats-player-photo { width: 32px; height: 32px; }
}

/* SVL_STATS_UI_POLISH_V1 */

.stats-page .container {
    max-width: 1220px;
}

.stats-scope {
    width: max-content;
    max-width: 100%;
    gap: 4px;
    margin: 2px 0 20px;
    padding: 4px;
    border: 1px solid rgba(17,24,39,.07);
    border-radius: 14px;
    background: #eef1f4;
}

.stats-scope a {
    flex: 0 0 auto;
    border: 0;
    border-radius: 10px;
    background: transparent;
    padding: 9px 14px;
    font-size: 13px;
    color: #667085;
}

.stats-scope a:hover {
    background: rgba(255,255,255,.55);
}

.stats-scope a.active {
    color: #111827;
    background: #fff;
    box-shadow: 0 1px 3px rgba(17,24,39,.08), 0 6px 18px rgba(17,24,39,.06);
}

.stats-section-head {
    margin-bottom: 20px;
}

.stats-section-head h2 {
    font-size: 21px;
    line-height: 1.22;
    letter-spacing: -.02em;
}

.stats-section-head p {
    max-width: 500px;
    font-size: 13px;
    line-height: 1.5;
    color: #7b8494;
}

.stats-coverage-item {
    min-height: 82px;
    padding: 14px 15px;
}

.stats-coverage-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 9px;
}

.stats-coverage-top > span {
    color: #344054;
    font-size: 12px;
    font-weight: 750;
}

.stats-coverage-top > small {
    color: #98a2b3;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.stats-coverage-badge {
    padding: 5px 9px;
    font-size: 11px;
}

.stats-table {
    min-width: 820px;
    font-size: 13px;
}

.stats-table th,
.stats-table td {
    padding: 14px 15px;
}

.stats-table th {
    font-size: 10.5px;
    letter-spacing: .035em;
}

.stats-team {
    gap: 11px;
    font-size: 13.5px;
}

.stats-team img {
    width: 32px;
    height: 32px;
}

.stats-table-goals td:nth-child(4),
.stats-table-goals td:nth-child(6) {
    font-weight: 750;
    color: #111827;
}

.stats-player-grid {
    gap: 16px;
}

.stats-leader-card {
    border-radius: 18px;
    box-shadow: 0 6px 20px rgba(17,24,39,.035);
}

.stats-leader-head {
    padding: 18px 18px 14px;
}

.stats-leader-head h3 {
    font-size: 19px;
}

.stats-leader-row {
    min-height: 58px;
    padding: 10px 16px;
}

.stats-leader-row.is-top-1,
.stats-leader-row.is-top-2,
.stats-leader-row.is-top-3 {
    background: linear-gradient(90deg, rgba(248,250,252,.95), rgba(255,255,255,1));
}

.stats-leader-row.is-top-1 .stats-leader-rank,
.stats-leader-row.is-top-1 .stats-leader-value {
    color: #111827;
}

.stats-leader-row.is-top-2 .stats-leader-rank,
.stats-leader-row.is-top-3 .stats-leader-rank {
    color: #667085;
}

.stats-leader-value {
    min-width: 44px;
    font-size: 18px;
    text-align: right;
}

.stats-leader-more {
    border-top: 1px solid rgba(17,24,39,.06);
}

.stats-leader-more summary {
    cursor: pointer;
    list-style: none;
    padding: 12px 16px;
    color: #475467;
    background: #fafbfc;
    font-size: 12px;
    font-weight: 750;
    text-align: center;
    user-select: none;
}

.stats-leader-more summary::-webkit-details-marker {
    display: none;
}

.stats-leader-more summary::after {
    content: " ↓";
    color: #98a2b3;
}

.stats-leader-more[open] summary::after {
    content: " ↑";
}

.stats-leader-more[open] summary {
    border-bottom: 1px solid rgba(17,24,39,.06);
}

.stats-data-note {
    background: #f8fafc;
    box-shadow: none;
    border-style: dashed;
}

.stats-data-note strong {
    font-size: 13px;
}

.stats-data-note p {
    max-width: 920px;
    font-size: 12px;
}

@media (max-width: 900px) {
    .stats-page .container {
        max-width: none;
    }

    .stats-section-head p {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .stats-scope {
        width: 100%;
        border-radius: 12px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .stats-scope::-webkit-scrollbar {
        display: none;
    }

    .stats-scope a {
        padding: 9px 12px;
        font-size: 12px;
    }

    .stats-section-head h2 {
        font-size: 18px;
    }

    .stats-section-head p {
        font-size: 12px;
        line-height: 1.45;
    }

    .stats-coverage-item {
        min-height: 76px;
        padding: 12px;
    }

    .stats-coverage-top {
        margin-bottom: 7px;
    }

    .stats-coverage-top > span {
        font-size: 11px;
    }

    .stats-coverage-top > small {
        font-size: 9.5px;
    }

    .stats-table-wrap {
        position: relative;
        margin-left: -4px;
        margin-right: -4px;
        width: calc(100% + 8px);
        border-radius: 13px;
        -webkit-overflow-scrolling: touch;
    }

    .stats-table {
        min-width: 760px;
        font-size: 12px;
    }

    .stats-table th,
    .stats-table td {
        padding: 12px 10px;
    }

    .stats-table th {
        font-size: 9.5px;
    }

    .stats-team {
        font-size: 12px;
    }

    .stats-team img {
        width: 26px;
        height: 26px;
    }

    .stats-table-goals th:first-child,
    .stats-table-goals td:first-child {
        position: sticky;
        left: 0;
        z-index: 4;
        width: 38px;
        min-width: 38px;
        background: #fff;
    }

    .stats-table-goals th:nth-child(2),
    .stats-table-goals td:nth-child(2) {
        position: sticky;
        left: 38px;
        z-index: 3;
        min-width: 150px;
        background: #fff;
        box-shadow: 7px 0 10px -10px rgba(17,24,39,.55);
    }

    .stats-table-goals thead th:first-child,
    .stats-table-goals thead th:nth-child(2),
    .stats-table-metrics thead th:first-child {
        background: #f8f9fb;
    }

    .stats-table-metrics th:first-child,
    .stats-table-metrics td:first-child {
        position: sticky;
        left: 0;
        z-index: 3;
        min-width: 155px;
        background: #fff;
        box-shadow: 7px 0 10px -10px rgba(17,24,39,.55);
    }

    .stats-player-grid {
        gap: 12px;
    }

    .stats-leader-card {
        border-radius: 15px;
    }

    .stats-leader-head {
        padding: 15px 14px 12px;
    }

    .stats-leader-head h3 {
        font-size: 17px;
    }

    .stats-leader-row {
        grid-template-columns: 22px 32px minmax(0,1fr) auto;
        min-height: 53px;
        padding: 8px 11px;
    }

    .stats-player-name strong {
        font-size: 12px;
    }

    .stats-player-name a,
    .stats-player-name span {
        font-size: 10px;
    }

    .stats-leader-value {
        min-width: 38px;
        font-size: 16px;
    }

    .stats-leader-more summary {
        padding: 11px 12px;
    }

    .stats-data-note {
        padding: 15px 16px;
    }
}

/* SVL_STATS_PLAYER_PROFILE_LINK_V1 */
.stats-player-name .stats-player-profile-link {
    color: inherit;
    text-decoration: none;
    font: inherit;
    font-size: inherit;
}
.stats-player-name .stats-player-profile-link:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.stats-player-name .stats-player-profile-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 3px;
}

/* SVL_TEAM_RATING_FRONTEND_V1 */
.stats-rating-block { position: relative; overflow: hidden; }

.stats-rating-block::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #111827, #6b7280, transparent);
    pointer-events: none;
}

.stats-rating-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -2px 0 16px;
}

.stats-rating-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 9px;
    border-radius: 10px;
    background: #f6f7f9;
    color: #6b7280;
    font-size: 11px;
    line-height: 1;
}

.stats-rating-legend b {
    color: #111827;
    font-size: 10px;
    letter-spacing: .03em;
}

.stats-rating-table { min-width: 1040px; }

.stats-rating-table th:nth-child(2),
.stats-rating-table td:nth-child(2) {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 210px;
    background: #fff;
    box-shadow: 8px 0 14px -14px rgba(17,24,39,.45);
}

.stats-rating-table thead th:nth-child(2) {
    z-index: 3;
    background: #f8f9fb;
}

.stats-rating-table tbody tr:hover td:nth-child(2) {
    background: #fafbfc;
}

.stats-rating-score {
    display: inline-flex;
    min-width: 48px;
    justify-content: center;
    padding: 6px 9px;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    font: 800 14px/1 Manrope, Inter, sans-serif;
}

.stats-rating-confidence {
    display: inline-flex;
    min-width: 46px;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 999px;
    background: #eef1f4;
    color: #4b5563;
    font-size: 12px;
    font-weight: 800;
}

.stats-rating-note {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 16px;
    margin-top: 13px;
    color: #8a919d;
    font-size: 11px;
    line-height: 1.45;
}

.stats-rating-unavailable { margin-bottom: 20px; }

@media (max-width: 640px) {
    .stats-rating-table { min-width: 980px; }
    .stats-rating-table th,
    .stats-rating-table td { padding: 11px 10px; }
    .stats-rating-table th:nth-child(2),
    .stats-rating-table td:nth-child(2) { min-width: 180px; }
    .stats-rating-legend { gap: 6px; }
    .stats-rating-legend span { padding: 6px 8px; }
}
