/* =========================
   TEAM PAGE - FINAL CLEAN VERSION
========================= */

.team-page {
    --team-accent: #4f8cff;
    --team-accent-2: #22d3ee;
    --team-accent-soft: rgba(79, 140, 255, 0.12);
    --team-border: rgba(255, 255, 255, 0.10);

    display: grid;
    gap: 18px;
    min-width: 0;
}

/* HERO */

.team-hero {
    position: relative;
    overflow: hidden;
    min-height: 245px;
    padding: 30px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-width: 0;
    background:
        radial-gradient(circle at 9% 40%, rgba(244, 91, 219, 0.22), transparent 26%),
        radial-gradient(circle at 92% 24%, rgba(184, 92, 255, 0.24), transparent 28%),
        linear-gradient(135deg, rgba(9,17,33,.98), rgba(8,13,27,.98) 55%, rgba(36,15,45,.96));
    border: 1px solid var(--team-border);
    box-shadow:
        0 22px 50px rgba(0,0,0,.35),
        inset 0 0 80px rgba(79,140,255,.06);
}

.team-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at top, rgba(255,255,255,.10), transparent 38%),
        linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 100% 100%, 42px 42px, 42px 42px;
    opacity: .42;
    pointer-events: none;
}

.team-hero-orb {
    position: absolute;
    right: -70px;
    top: -80px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 1px solid rgba(79,140,255,.35);
    background:
        radial-gradient(circle, rgba(79,140,255,.20), transparent 58%),
        radial-gradient(circle at 30% 40%, rgba(255,255,255,.14), transparent 32%);
    box-shadow: 0 0 45px rgba(79,140,255,.22);
    pointer-events: none;
}

.team-hero-left {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 26px;
    min-width: 0;
    flex: 1 1 auto;
}

.team-logo-aura {
    position: relative;
    width: 135px;
    height: 135px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(79,140,255,.24), transparent 58%),
        rgba(255,255,255,.035);
    border: 1px solid rgba(79,140,255,.32);
    box-shadow:
        0 0 30px rgba(79,140,255,.35),
        inset 0 0 26px rgba(79,140,255,.12);
}

.team-logo-aura::before {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: inherit;
    border: 1px solid rgba(79,140,255,.28);
    box-shadow: 0 0 28px rgba(79,140,255,.22);
}

.team-hero-logo {
    width: 92px;
    height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 18px 22px rgba(0,0,0,.45));
}

.team-hero-info {
    min-width: 0;
}

.team-country {
    color: var(--team-accent);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .14em;
    margin-bottom: 8px;
}

.team-hero h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 4.4vw, 30px);
    line-height: .92;
    letter-spacing: -2px;
    font-weight: 950;
    text-shadow: 0 14px 34px rgba(0,0,0,.42);
    overflow-wrap: anywhere;
}

.team-subtitle {
    margin-top: 8px;
    color: var(--team-accent);
    font-size: clamp(20px, 2.2vw, 20px);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -1px;
}

.team-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.team-meta span {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    border-radius: 10px;
    background: rgba(255,255,255,.055);
    border: 1px solid rgba(255,255,255,.10);
    color: #e8efff;
    font-size: 12px;
    font-weight: 850;
}

.team-standing-card {
    position: relative;
    z-index: 2;
    width: 220px;
    min-height: 140px;
    flex: 0 0 220px;
    padding: 22px;
    border-radius: 18px;
    display: grid;
    align-content: center;
    text-align: center;
    background:
        radial-gradient(circle at 82% 24%, rgba(79,140,255,.28), transparent 46%),
        rgba(255,255,255,.055);
    border: 1px solid rgba(79,140,255,.48);
    box-shadow:
        0 0 28px rgba(79,140,255,.23),
        inset 0 0 30px rgba(79,140,255,.08);
}

.team-standing-card span {
    display: block;
    color: #dcb8ff;
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.team-standing-card strong {
    display: block;
    color: #fff;
    font-size: 35px;
    line-height: .9;
    font-weight: 950;
    text-shadow: 0 0 18px rgba(79,140,255,.45);
}

.team-standing-card small {
    display: block;
    margin-top: 12px;
    color: #f4d8ff;
    font-size: 13px;
    font-weight: 850;
}

/* KPI */

.team-kpi-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    min-width: 0;
}

.team-kpi {
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 112px;
    padding: 12px 10px 18px;
    border-radius: 14px;
    display: flex;
    place-items: center;
    flex-direction: column;
    background:
        radial-gradient(circle at top right, rgba(79,140,255,.16), transparent 40%),
        linear-gradient(180deg, rgba(14,24,46,.95), rgba(7,13,27,.98));
    border: 1px solid rgba(79,140,255,.20);
    box-shadow: 0 14px 28px rgba(0,0,0,.25);
}

.team-kpi::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 11px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--team-accent), rgba(79,140,255,.15), transparent);
    box-shadow: 0 0 14px rgba(79,140,255,.45);
}

.team-kpi em {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--team-accent);
    background: rgba(79,140,255,.10);
    border: 1px solid rgba(79,140,255,.22);
    font-size: 13px;
    font-style: normal;
    margin-bottom: 8px;
}

.team-kpi span {
    display: block;
    color: #b8c6e4;
    font-size: 9px;
    line-height: 1.15;
    font-weight: 950;
    text-transform: uppercase;
    min-height: 23px;
    margin-bottom: 10px;
    overflow-wrap: anywhere;
    text-align: center;
}

.team-kpi strong {
    display: block;
    margin-top: auto;
    color: #fff;
    font-size: 25px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -1px;
}

/* GENERAL PANELS */

.team-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    min-width: 0;
}

.team-panel {
    position: relative;
    overflow: hidden;
    min-width: 0;
    padding: 20px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top left, rgba(79,140,255,.11), transparent 34%),
        linear-gradient(180deg, rgba(13,23,43,.96), rgba(6,12,25,.98));
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: 0 16px 38px rgba(0,0,0,.24);
}

.team-neon-panel {
    border-color: rgba(79,140,255,.34);
    box-shadow:
        0 16px 38px rgba(0,0,0,.26),
        inset 0 0 34px rgba(79,140,255,.04);
}

.team-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 13px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.team-panel-head h2 {
    margin: 0;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    font-weight: 950;
    letter-spacing: -.3px;
    text-transform: uppercase;
}

.team-panel-head span {
    display: block;
    margin-top: 5px;
    color: #aab7d3;
    font-size: 12px;
    font-weight: 850;
}

/* SEASON STATS + GOAL TRENDS
   BAR FULL WIDTH VERSION */

.team-stat-bars,
.team-trend-bars {
    display: grid;
    gap: 10px;
    min-width: 0;
}

/* Season stats row */
.team-stat-bar-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 62px;
    grid-template-areas:
        "icon name value"
        ".    bar  value";
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    min-height: 62px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.055);
    min-width: 0;
}

.team-stat-icon {
    grid-area: icon;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--team-accent);
    font-size: 14px;
}

.team-stat-name {
    grid-area: name;
    min-width: 0;
    color: #d8e2f7;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-stat-bar-row strong {
    grid-area: value;
    align-self: center;
    justify-self: end;
    min-width: 54px;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    text-align: right;
}

.team-stat-track {
    grid-area: bar;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    overflow: hidden;
}

.team-stat-track span,
.team-trend-track span {
    display: block;
    width: var(--bar-width, 0%);
    height: 100%;
    min-width: 4px;
    border-radius: inherit;
    background: linear-gradient(90deg, #f45bdb 0%, #ff90ef 100%);
    box-shadow: 0 0 14px rgba(79,140,255,.70);
}

/* Goal trends row */
.team-trend-bar-row {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 52px 58px;
    grid-template-areas:
        "icon name pct count"
        ".    bar  bar count";
    align-items: center;
    column-gap: 12px;
    row-gap: 8px;
    min-height: 66px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.055);
    min-width: 0;
}

.team-trend-icon {
    grid-area: icon;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    color: var(--team-accent);
    font-size: 14px;
}

.team-trend-name {
    grid-area: name;
    min-width: 0;
    color: #d8e2f7;
    font-size: 12px;
    line-height: 1.15;
    font-weight: 850;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-trend-bar-row strong {
    grid-area: pct;
    justify-self: end;
    min-width: 45px;
    color: #fff;
    font-size: 13px;
    font-weight: 950;
    text-align: right;
}

.team-trend-bar-row em {
    grid-area: count;
    justify-self: end;
    min-width: 55px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 850;
    font-style: normal;
    text-align: right;
    white-space: nowrap;
}

.team-trend-track {
    grid-area: bar;
    width: 100%;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.10);
    overflow: hidden;
}


/* PLAYER PREVIEW */

.team-player-preview-panel {
    border-color: rgba(79,140,255,.34);
}

.team-player-preview-head {
    align-items: center;
}

.team-view-link {
    color: var(--team-accent);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.team-player-preview-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    min-width: 0;
}

.team-player-preview-card {
    min-width: 0;
    overflow: hidden;
    padding: 14px;
    border-radius: 15px;
    background:
        radial-gradient(circle at top, rgba(79,140,255,.12), transparent 42%),
        rgba(255,255,255,.035);
    border: 1px solid rgba(79,140,255,.25);
}

.team-preview-label {
    color: #ff9df0;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 950;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.team-preview-player {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.team-preview-player div {
    min-width: 0;
}

.team-preview-player img,
.team-preview-player > span {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(79,140,255,.14);
    border: 1px solid rgba(79,140,255,.35);
}

.team-preview-player > span {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 950;
}

.team-preview-player strong {
    display: block;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-preview-player small {
    display: block;
    color: #9eb0cf;
    font-size: 10px;
    font-weight: 800;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-preview-value {
    margin-top: 14px;
    color: var(--team-accent);
    font-size: 32px;
    line-height: 1;
    font-weight: 950;
}

.team-preview-sub {
    margin-top: 4px;
    color: #cbd5e1;
    font-size: 12px;
    font-weight: 800;
}

/* MATCH LIST */

.team-match-list {
    display: grid;
    gap: 10px;
}

.team-match-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 12px;
    border-radius: 12px;
    color: #fff;
    text-decoration: none;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.06);
    transition: .18s ease;
}

.team-match-row:hover {
    background: rgba(79,140,255,.08);
    border-color: rgba(79,140,255,.20);
}

.team-match-date {
    color: #9eb0cf;
    font-size: 12px;
    font-weight: 850;
    white-space: nowrap;
}

.team-match-teams {
    min-width: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-match-row strong {
    color: #f7b7ef;
    font-size: 12px;
    font-weight: 950;
}

.team-result {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 12px;
    font-weight: 950;
}

.team-result-w { background: #22c55e; }
.team-result-d { background: #f59e0b; }
.team-result-l { background: #ef4444; }

.team-empty {
    color: #9eb0cf;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.04);
}

/* FULL PLAYER TABLE */

.team-player-stats-table-wrap {
    width: 100%;
    overflow-x: hidden;
    border-radius: 14px;
    border: 1px solid rgba(79,140,255,.22);
    background: rgba(5,11,22,.42);
}

.team-player-stats-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    color: #dce7ff;
}

.team-player-stats-table thead {
    background: rgba(79,140,255,.08);
}

.team-player-stats-table th {
    height: 40px;
    padding: 0 5px;
    color: #e9dcff;
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .02em;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,.06);
    white-space: nowrap;
}

.team-player-stats-table th:first-child {
    text-align: left;
}

.team-player-stats-table td {
    height: 44px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 850;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,.045);
    border-top: 1px solid rgba(255,255,255,.045);
    white-space: nowrap;
}

.team-player-stats-table tbody tr:nth-child(odd) {
    background: rgba(255,255,255,.018);
}

.team-player-stats-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,.035);
}

.team-player-stats-table tbody tr:hover {
    background: rgba(79,140,255,.08);
}

.team-player-stats-table th:nth-child(1),
.team-player-stats-table td:nth-child(1) {
    width: 210px;
}

.team-player-stats-table th:nth-child(2),
.team-player-stats-table td:nth-child(2) {
    width: 42px;
}

.team-player-stats-table th:nth-child(3),
.team-player-stats-table td:nth-child(3),
.team-player-stats-table th:nth-child(4),
.team-player-stats-table td:nth-child(4) {
    width: 50px;
}

.team-player-stats-table th:nth-child(5),
.team-player-stats-table td:nth-child(5) {
    width: 56px;
}

.team-player-stats-table th:nth-child(6),
.team-player-stats-table td:nth-child(6),
.team-player-stats-table th:nth-child(7),
.team-player-stats-table td:nth-child(7),
.team-player-stats-table th:nth-child(10),
.team-player-stats-table td:nth-child(10),
.team-player-stats-table th:nth-child(11),
.team-player-stats-table td:nth-child(11) {
    width: 34px;
}

.team-player-stats-table th:nth-child(8),
.team-player-stats-table td:nth-child(8),
.team-player-stats-table th:nth-child(9),
.team-player-stats-table td:nth-child(9) {
    width: 46px;
}

.team-player-stats-table th:nth-child(12),
.team-player-stats-table td:nth-child(12) {
    width: 48px;
}

.team-player-stats-table .tps-player {
    text-align: left;
    background: rgba(12,22,42,.98);
    border-right: 1px solid rgba(79,140,255,.18);
}

.team-player-stats-table thead .tps-player {
    background: rgba(34,28,56,.98);
}

.tps-player-main {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.tps-player-main img,
.tps-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.tps-player-main img {
    object-fit: cover;
    background: rgba(255,255,255,.08);
}

.tps-avatar {
    display: grid;
    place-items: center;
    background: rgba(79,140,255,.18);
    border: 1px solid rgba(79,140,255,.30);
    color: #fff;
    font-size: 11px;
    font-weight: 950;
}

.tps-player-main strong {
    display: block;
    color: #ff9df0;
    font-size: 12px;
    font-weight: 950;
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tps-player-main span {
    display: block;
    color: #9eb0cf;
    font-size: 9px;
    font-weight: 800;
    margin-top: 1px;
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tps-rating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 22px;
    padding: 0 6px;
    border-radius: 99px;
    background: rgba(79,140,255,.16);
    border: 1px solid rgba(79,140,255,.48);
    color: #ffd5f8;
    font-size: 11px;
    font-weight: 950;
}

/* NOTE */

.team-data-note {
    color: #7e8faa;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    padding: 10px 0 2px;
}

/* RESPONSIVE */

@media (max-width: 1500px) {
    .team-kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .team-player-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .team-hero {
        flex-direction: column;
        align-items: stretch;
    }

    .team-hero-left {
        align-items: flex-start;
    }

    .team-standing-card {
        width: 100%;
        flex: 0 0 auto;
    }

    .team-grid-two {
        grid-template-columns: 1fr;
    }

    .team-player-stats-table-wrap {
        overflow-x: auto;
    }

    .team-player-stats-table {
        min-width: 760px;
        table-layout: auto;
    }

    .team-player-stats-table .tps-player {
        position: sticky;
        left: 0;
        z-index: 2;
    }

    .team-player-stats-table thead .tps-player {
        z-index: 3;
    }
}

@media (max-width: 640px) {
    .team-page {
        gap: 14px;
    }

    .team-hero {
        min-height: auto;
        padding: 18px;
        border-radius: 18px;
        gap: 16px;
    }

    .team-hero-left {
        gap: 14px;
    }

    .team-logo-aura {
        width: 82px;
        height: 82px;
    }

    .team-logo-aura::before {
        inset: -6px;
    }

    .team-hero-logo {
        width: 58px;
        height: 58px;
    }

    .team-country {
        font-size: 10px;
        margin-bottom: 6px;
    }

    .team-hero h1 {
        font-size: 32px;
        line-height: 1;
        letter-spacing: -1px;
    }

    .team-subtitle {
        font-size: 20px;
    }

    .team-meta {
        gap: 6px;
        margin-top: 10px;
    }

    .team-meta span {
        min-height: 29px;
        font-size: 10px;
        padding: 0 9px;
    }

    .team-standing-card {
        min-height: 110px;
        border-radius: 16px;
        padding: 14px;
    }

    .team-standing-card strong {
        font-size: 40px;
    }

    .team-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .team-kpi {
        min-height: 88px;
        padding: 12px;
        border-radius: 14px;
    }

    .team-kpi em {
        width: 28px;
        height: 28px;
        margin-bottom: 6px;
    }

    .team-kpi span {
        font-size: 10px;
        min-height: auto;
        margin-bottom: 8px;
    }

    .team-kpi strong {
        font-size: 24px;
    }

    .team-panel {
        padding: 14px;
        border-radius: 16px;
    }

    .team-panel-head {
        flex-direction: column;
        gap: 6px;
    }

    .team-panel-head h2 {
        font-size: 17px;
    }

    .team-panel-head span {
        font-size: 11px;
    }

    .team-stat-bar-row {
        grid-template-columns: 24px minmax(0, 1fr) 52px;
        grid-template-areas:
            "icon name value"
            ".    bar  value";
        gap: 8px;
        padding: 9px 10px;
        min-height: auto;
    }

    .team-trend-bar-row {
        grid-template-columns: 24px minmax(0, 1fr) 42px 52px;
        grid-template-areas:
            "icon name pct count"
            ".    bar  bar count";
        gap: 8px;
        padding: 9px 10px;
        min-height: auto;
    }

    .team-player-preview-grid {
        grid-template-columns: 1fr;
    }

    .team-match-row {
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 10px 12px;
        min-height: auto;
    }

    .team-match-date,
    .team-result {
        display: none;
    }

    .team-player-stats-table {
        min-width: 720px;
    }

    .team-player-stats-table th {
        font-size: 9px;
        padding: 0 4px;
    }

    .team-player-stats-table td {
        font-size: 10px;
        padding: 0 4px;
    }

    .tps-player-main strong {
        font-size: 11px;
        max-width: 120px;
    }

    .tps-player-main span {
        font-size: 8px;
        max-width: 120px;
    }
}