/* ========================================
   FICHE ÉQUIPE MULTI-COMPÉTITIONS
======================================== */

.competition-team-page,
.competition-team-page * {
    box-sizing: border-box;
}

.competition-team-page {
    --competition-primary: #a3e635;
    --competition-primary-rgb: 163, 230, 53;
    --competition-secondary: #0f172a;
    --competition-secondary-rgb: 15, 23, 42;
    --competition-banner-image: none;

    width: min(92%, 1280px);
    margin: 26px auto 80px;
    color: #ffffff;
}

/* APERÇU ADMIN */

.team-admin-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 17px;
    margin-bottom: 18px;
    border: 1px solid rgba(250, 204, 21, 0.28);
    border-radius: 15px;
    background: rgba(250, 204, 21, 0.08);
}

.team-admin-preview > span {
    color: #fde047;
    font-size: 1.2rem;
}

.team-admin-preview > div {
    flex: 1;
}

.team-admin-preview p {
    margin-top: 3px;
    color: #fde68a;
    font-size: 0.84rem;
}

.team-admin-preview a {
    color: var(--competition-primary);
    font-weight: 800;
    text-decoration: none;
}

/* HERO */

.team-hero {
    position: relative;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    padding: 32px 36px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    background-image:
        linear-gradient(
            135deg,
            rgba(var(--competition-secondary-rgb), 0.9),
            rgba(2, 6, 23, 0.78)
        ),
        var(--competition-banner-image),
        linear-gradient(135deg, var(--competition-secondary), #020617);
    background-size: auto, cover, auto;
    background-position: center;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.team-hero::after {
    content: "";
    position: absolute;
    right: -90px;
    bottom: -155px;
    width: 270px;
    height: 270px;
    border: 45px solid rgba(var(--competition-primary-rgb), 0.045);
    border-radius: 50%;
}

.team-hero-main {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.team-hero-logo {
    width: 112px;
    height: 112px;
    flex: 0 0 112px;
    display: grid;
    place-items: center;
    padding: 12px;
    overflow: hidden;
    border-radius: 24px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.team-hero-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-hero-logo strong {
    color: #0f172a;
    font-size: 1.25rem;
}

.team-hero-text {
    min-width: 0;
}

.team-hero .section-subtitle,
.team-section-heading .section-subtitle {
    color: var(--competition-primary);
}

.team-hero h1 {
    margin: 5px 0 9px;
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    line-height: 1;
}

.team-hero-text > p:last-child {
    color: #cbd5e1;
    font-weight: 650;
}

.team-hero-position {
    position: relative;
    z-index: 1;
    min-width: 180px;
    padding: 18px 20px;
    border: 1px solid rgba(var(--competition-primary-rgb), 0.22);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.56);
    text-align: center;
    backdrop-filter: blur(8px);
}

.team-hero-position small,
.team-hero-position strong,
.team-hero-position span {
    display: block;
}

.team-hero-position small {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.team-hero-position strong {
    margin: 5px 0 2px;
    color: var(--competition-primary);
    font-size: 2.6rem;
    line-height: 1;
}

.team-hero-position sup {
    font-size: 0.9rem;
}

.team-hero-position span {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 750;
}

/* NAVIGATION */

.competition-hub-navigation {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.competition-hub-group {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.86);
}

.competition-hub-group-heading {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    margin-bottom: 13px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
}

.competition-hub-group-heading > span {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(var(--competition-primary-rgb), 0.1);
    color: var(--competition-primary);
}

.competition-hub-group-heading small,
.competition-hub-group-heading strong {
    display: block;
}

.competition-hub-group-heading small {
    color: var(--competition-primary);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.competition-hub-group-heading strong {
    margin-top: 2px;
    color: #f8fafc;
    font-size: 0.88rem;
}

.competition-hub-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.competition-hub-links a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 800;
    text-decoration: none;
    transition: 0.2s ease;
}

.competition-hub-links a:hover {
    color: var(--competition-primary);
    background: rgba(var(--competition-primary-rgb), 0.12);
}

.competition-hub-mobile-chevron {
    display: none;
}

/* SÉLECTEUR */

.team-switcher-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 18px;
    margin: 16px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 17px;
    background:
        linear-gradient(
            135deg,
            rgba(var(--competition-primary-rgb), 0.055),
            transparent 58%
        ),
        #0f172a;
}

.team-switcher-heading {
    display: flex;
    align-items: center;
    gap: 13px;
}

.team-switcher-heading > span {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(var(--competition-primary-rgb), 0.11);
    color: var(--competition-primary);
}

.team-switcher-heading small,
.team-switcher-heading strong {
    display: block;
}

.team-switcher-heading small {
    color: var(--competition-primary);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.team-switcher-heading strong {
    margin-top: 3px;
}

.team-switcher-control {
    position: relative;
    width: min(100%, 360px);
}

.team-switcher-control select {
    width: 100%;
    min-height: 46px;
    padding: 10px 42px 10px 14px;
    border: 1px solid rgba(var(--competition-primary-rgb), 0.28);
    border-radius: 12px;
    outline: none;
    appearance: none;
    background: #111827;
    color: #f8fafc;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.team-switcher-control select:focus {
    border-color: var(--competition-primary);
}

.team-switcher-control > i {
    position: absolute;
    top: 50%;
    right: 15px;
    color: var(--competition-primary);
    pointer-events: none;
    transform: translateY(-50%);
}

/* RÉSUMÉ */

.team-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0 28px;
}

.team-summary-grid article {
    min-width: 0;
    min-height: 112px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 15px 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 17px;
    background: linear-gradient(145deg, #0f172a, #111827);
}

.team-summary-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: rgba(var(--competition-primary-rgb), 0.1);
    color: var(--competition-primary);
}

.team-summary-grid small,
.team-summary-grid strong,
.team-summary-grid p {
    display: block;
}

.team-summary-grid small {
    color: #94a3b8;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.07em;
}

.team-summary-grid article > div > strong {
    margin-top: 4px;
    font-size: 1.25rem;
}

.team-summary-grid p {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.74rem;
}

.team-form-list {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.team-form-list span,
.team-result-badge {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 900;
}

.team-form-list .win,
.team-result-badge.win {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.team-form-list .draw,
.team-result-badge.draw {
    background: rgba(148, 163, 184, 0.14);
    color: #cbd5e1;
}

.team-form-list .loss,
.team-result-badge.loss {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
}

/* TABLEAU DE BORD */

.team-dashboard-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 14px;
    margin-bottom: 34px;
}

.team-stats-card,
.team-splits-card {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: #0f172a;
}

.team-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 0 18px;
}

.team-section-heading.compact {
    margin: 0 0 17px;
}

.team-section-heading h2 {
    margin-top: 4px;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.team-section-heading > a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--competition-primary);
    font-size: 0.8rem;
    font-weight: 850;
    text-decoration: none;
}

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

.team-stats-grid article {
    min-width: 0;
    padding: 13px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.035);
}

.team-stats-grid small,
.team-stats-grid strong,
.team-stats-grid span {
    display: block;
}

.team-stats-grid small {
    min-height: 30px;
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
}

.team-stats-grid strong {
    margin-top: 5px;
    color: var(--competition-primary);
    font-size: 1.35rem;
}

.team-stats-grid span {
    margin-top: 3px;
    color: #64748b;
    font-size: 0.66rem;
}

.team-split-row {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
}

.team-split-row + .team-split-row {
    margin-top: 9px;
}

.team-split-row > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.team-split-row small {
    color: #94a3b8;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.team-split-row > div:first-child strong {
    color: var(--competition-primary);
}

.team-split-record {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}

.team-split-record span {
    padding: 7px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.045);
    color: #94a3b8;
    font-size: 0.65rem;
    text-align: center;
}

.team-split-record strong {
    display: block;
    color: #f8fafc;
    font-size: 0.84rem;
}

.team-split-record .win strong {
    color: #4ade80;
}

.team-split-record .loss strong {
    color: #f87171;
}

.team-split-row > p {
    margin-top: 9px;
    color: #64748b;
    font-size: 0.7rem;
}

.team-extreme-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.team-extreme-results article {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
}

.team-extreme-results small,
.team-extreme-results strong {
    display: block;
}

.team-extreme-results small {
    color: #64748b;
    font-size: 0.6rem;
    font-weight: 900;
}

.team-extreme-results strong {
    margin-top: 5px;
    font-size: 0.76rem;
}

/* MATCHS */

.team-matches-section {
    margin-top: 34px;
}

.team-match-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.team-match-card {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 17px;
    background: linear-gradient(135deg, #0f172a, #111827);
}

.team-match-card.win {
    border-left: 4px solid #22c55e;
}

.team-match-card.draw {
    border-left: 4px solid #94a3b8;
}

.team-match-card.loss {
    border-left: 4px solid #ef4444;
}

.team-match-card.upcoming {
    border-left: 4px solid var(--competition-primary);
}

.team-match-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 17px;
    padding: 11px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: #94a3b8;
    font-size: 0.72rem;
}

.team-match-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.team-match-location,
.team-match-status {
    margin-left: auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(var(--competition-primary-rgb), 0.1);
    color: var(--competition-primary);
    font-weight: 800;
}

.team-match-status.postponed {
    background: rgba(250, 204, 21, 0.12);
    color: #fde047;
}

.team-match-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    align-items: center;
    gap: 18px;
    padding: 16px 18px;
}

.team-match-opponent {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #f8fafc;
    text-decoration: none;
}

.team-match-opponent:hover strong {
    color: var(--competition-primary);
}

.team-match-logo {
    width: 50px;
    height: 50px;
    flex: 0 0 50px;
    display: grid;
    place-items: center;
    padding: 5px;
    overflow: hidden;
    border-radius: 13px;
    background: #ffffff;
}

.team-match-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.team-match-logo strong {
    color: #0f172a;
    font-size: 0.65rem;
}

.team-match-opponent > span:last-child {
    min-width: 0;
}

.team-match-opponent small,
.team-match-opponent strong {
    display: block;
}

.team-match-opponent small {
    color: #64748b;
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-match-opponent strong {
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-match-score {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.team-match-score > strong {
    min-width: 84px;
    color: #f8fafc;
    font-size: 1.5rem;
    text-align: center;
}

.team-match-score > strong span {
    color: #64748b;
}

.upcoming-score {
    flex-direction: column;
    gap: 2px;
}

.upcoming-score > strong {
    color: var(--competition-primary);
}

.upcoming-score small {
    max-width: 140px;
    overflow: hidden;
    color: #64748b;
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ÉTATS VIDES */

.team-empty-state {
    padding: 55px 25px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.7);
    text-align: center;
}

.team-empty-state.compact {
    padding: 30px 20px;
}

.team-empty-state > i {
    margin-bottom: 12px;
    color: var(--competition-primary);
    font-size: 2rem;
}

.team-empty-state p {
    margin-top: 6px;
    color: #94a3b8;
}

.team-empty-state a {
    display: inline-flex;
    margin-top: 18px;
    padding: 10px 15px;
    border-radius: 10px;
    background: var(--competition-primary);
    color: #07111f;
    font-weight: 850;
    text-decoration: none;
}

.team-not-found {
    margin-top: 150px;
}

/* RESPONSIVE */

@media screen and (max-width: 1050px) {
    .competition-hub-navigation,
    .team-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .team-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 800px) {
    .competition-team-page {
        width: 94%;
    }

    .team-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .team-hero-position {
        width: 100%;
    }

    .team-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 650px) {
    .competition-team-page {
        margin-top: 20px;
        margin-bottom: 55px;
    }

    .team-admin-preview {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .team-admin-preview a {
        width: 100%;
        margin-left: 31px;
    }

    .team-hero {
        min-height: 0;
        padding: 22px 18px;
        border-radius: 19px;
    }

    .team-hero-main {
        align-items: flex-start;
        gap: 14px;
    }

    .team-hero-logo {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
        padding: 8px;
        border-radius: 17px;
    }

    .team-hero h1 {
        font-size: 1.75rem;
    }

    .team-hero-text > p:last-child {
        font-size: 0.78rem;
        line-height: 1.5;
    }

    .team-hero-position {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 4px 12px;
        padding: 13px 15px;
        text-align: left;
    }

    .team-hero-position small {
        grid-column: 1;
    }

    .team-hero-position strong {
        grid-column: 2;
        grid-row: 1 / 3;
        margin: 0;
        font-size: 2rem;
    }

    .team-hero-position span {
        grid-column: 1;
    }

    .competition-hub-navigation {
        gap: 10px;
        margin: 14px 0;
    }

    .competition-hub-group {
        padding: 0;
        overflow: hidden;
        border-radius: 15px;
    }

    .competition-hub-group > .competition-hub-mobile-toggle {
        min-height: 72px;
        display: grid;
        grid-template-columns: 38px minmax(0, 1fr) 24px;
        align-items: center;
        gap: 11px;
        padding: 12px 13px;
        margin: 0;
        cursor: pointer;
    }

    .competition-hub-group-heading > span {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        border-radius: 11px;
    }

    .competition-hub-group-heading small {
        font-size: 0.62rem;
    }

    .competition-hub-group-heading strong {
        font-size: 0.8rem;
    }

    .competition-hub-mobile-chevron {
        display: inline-block;
        justify-self: end;
        color: var(--competition-primary);
        font-size: 0.74rem;
        transition: transform 0.2s ease;
    }

    .competition-hub-group > .competition-hub-links {
        display: none;
        grid-template-columns: 1fr;
        padding: 0 12px 12px;
    }

    .competition-hub-group.is-mobile-open > .competition-hub-links {
        display: grid;
    }

    .competition-hub-group.is-mobile-open .competition-hub-mobile-chevron {
        transform: rotate(180deg);
    }

    .competition-hub-links a {
        width: 100%;
        justify-content: flex-start;
    }

    .team-switcher-panel {
        align-items: stretch;
        flex-direction: column;
        gap: 13px;
    }

    .team-switcher-control {
        width: 100%;
    }

    .team-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    .team-summary-grid article {
        min-height: 96px;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .team-summary-icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }

    .team-summary-grid article > div > strong {
        font-size: 1.05rem;
    }

    .team-form-list {
        gap: 4px;
    }

    .team-form-list span {
        width: 24px;
        height: 24px;
        border-radius: 7px;
    }

    .team-stats-card,
    .team-splits-card {
        padding: 15px;
        border-radius: 17px;
    }

    .team-stats-grid {
        gap: 7px;
    }

    .team-stats-grid article {
        padding: 11px;
    }

    .team-extreme-results {
        grid-template-columns: 1fr;
    }

    .team-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
    }

    .team-section-heading > a {
        padding: 8px 10px;
        border-radius: 9px;
        background: rgba(var(--competition-primary-rgb), 0.09);
    }

    .team-match-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 10px 13px;
    }

    .team-match-location,
    .team-match-status {
        margin-left: 0;
    }

    .team-match-main {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        padding: 13px;
    }

    .team-match-logo {
        width: 43px;
        height: 43px;
        flex-basis: 43px;
    }

    .team-match-opponent strong {
        font-size: 0.84rem;
    }

    .team-match-score {
        gap: 7px;
    }

    .team-match-score > strong {
        min-width: 64px;
        font-size: 1.2rem;
    }

    .upcoming-score small {
        display: none;
    }
}

@media screen and (max-width: 400px) {
    .team-summary-grid {
        grid-template-columns: 1fr;
    }

    .team-summary-grid article {
        min-height: 82px;
    }

    .team-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .team-split-record {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (min-width: 651px) {
    .competition-hub-mobile-chevron {
        display: none !important;
    }

    .competition-hub-group-heading {
        cursor: default;
    }
}
