/* ==========================================================
   SIDEBAR — QUARTIER GÉNÉRAL
   ========================================================== */

.sidebar-card {
    width: 100%;
    color: var(--campaign-text);
}


/* ==========================================================
   PANNEAUX / ACCORDÉONS
   ========================================================== */

.campaign-panel {

    width: 100%;

    margin-bottom: 12px;

    overflow: hidden;

    background:
        linear-gradient(
            180deg,
            rgba(34, 31, 26, .94),
            rgba(25, 23, 20, .96)
        );

    border: 1px solid rgba(190, 160, 95, .18);

    border-radius: 10px;

    box-shadow:
        0 8px 22px rgba(0, 0, 0, .22);

    backdrop-filter: blur(3px);

    transition:
        border-color .25s ease,
        box-shadow .25s ease;
}


.campaign-panel:hover {

    border-color:
        rgba(190, 160, 95, .28);

    box-shadow:
        0 10px 28px rgba(0, 0, 0, .28);

}


/* ==========================================================
   HEADER ACCORDÉON
   ========================================================== */

.accordion-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    width: 100%;

    min-height: 48px;

    padding: 0 14px;

    box-sizing: border-box;

    border: 0;

    background:
        linear-gradient(
            90deg,
            rgba(190, 160, 95, .06),
            rgba(190, 160, 95, .015)
        );

    color: var(--campaign-text);

    cursor: pointer;

    text-align: left;

    transition:
        background .2s ease,
        color .2s ease;
}


.accordion-header:hover {

    background:
        linear-gradient(
            90deg,
            rgba(190, 160, 95, .12),
            rgba(190, 160, 95, .025)
        );

}


/* ==========================================================
   TITRE
   ========================================================== */

.campaign-panel-title {

    position: relative;

    margin: 0;

    padding-left: 18px;

    color: #eee6d8;

    font-family: "Cinzel", serif;

    font-size: .76rem;

    font-weight: 500;

    letter-spacing: .08em;

    text-transform: uppercase;
}


.campaign-panel-title::before {

    content: "◈";

    position: absolute;

    left: 0;

    top: 50%;

    transform: translateY(-50%);

    color: #bea05f;

    font-size: .58rem;

}


/* ==========================================================
   ICÔNE + / -
   ========================================================== */

.accordion-icon {

    display: flex;

    align-items: center;

    justify-content: center;

    width: 24px;
    height: 24px;

    flex-shrink: 0;

    border: 1px solid rgba(190, 160, 95, .20);

    border-radius: 6px;

    background: rgba(190, 160, 95, .05);

    color: #bea05f;

    font-size: .90rem;

    line-height: 1;

    transition:
        transform .25s ease,
        background .2s ease,
        border-color .2s ease;
}


.accordion-header:hover .accordion-icon {

    background:
        rgba(190, 160, 95, .12);

    border-color:
        rgba(190, 160, 95, .40);

}


/* ==========================================================
   CONTENU ACCORDÉON
   ========================================================== */

.accordion-content {

    overflow: hidden;

}


.campaign-panel-body {

    padding: 14px;

    border-top:
        1px solid rgba(190, 160, 95, .10);

}


/* ==========================================================
   ESPACEMENT DES ÉLÉMENTS
   ========================================================== */

/*
 * Le Twig utilise actuellement les classes Tailwind
 * space-y-4 / space-y-3.
 *
 * On garde leur fonctionnement mais on harmonise
 * l'espacement avec le reste du panneau.
 */

.campaign-panel-body .space-y-4 > * + * {

    margin-top: 11px;

}


.campaign-panel-body .space-y-3 > * + * {

    margin-top: 9px;

}


/* ==========================================================
   INFORMATIONS DE CAMPAGNE
   ========================================================== */

.campaign-panel-body .flex.items-center.justify-between {

    min-height: 28px;

    padding: 6px 7px;

    border-radius: 6px;

    transition:
        background .2s ease;

}


.campaign-panel-body .flex.items-center.justify-between:hover {

    background:
        rgba(190, 160, 95, .045);

}


/* Labels */

.campaign-panel-body .text-slate-400 {

    color: #898277 !important;

    font-size: .70rem;

}


/* Valeurs */

.campaign-panel-body .flex.items-center.justify-between > span:last-child {

    color: #ded5c5;

    font-family: "Cinzel", serif;

    font-size: .75rem;

}


/* ==========================================================
   TOUR ACTUEL
   ========================================================== */

.campaign-panel-body .text-2xl {

    color: #d8b36a !important;

    font-family: "Cinzel", serif;

    font-size: 1.35rem;

    font-weight: 400;

    text-shadow:
        0 2px 8px rgba(190, 160, 95, .18);

}


/* ==========================================================
   CARTES DES ÉQUIPES
   ========================================================== */

.team-card{

    display:block;
    width:100%;
    box-sizing:border-box;
    text-decoration:none;
    color:inherit;

    position:relative;

    overflow:hidden;

    background:rgba(255,255,255,.03);

    border:1px solid rgba(184,156,99,.18);

    border-radius:14px;

    padding:16px;

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;

}


/* Ligne colorée de faction */

.team-card::before {

    content: "";

    position: absolute;

    left: 0;
    top: 0;
    bottom: 0;

    width: 3px;

    background: var(--team-color);

    box-shadow:
        0 0 8px color-mix(
            in srgb,
            var(--team-color) 45%,
            transparent
        );

}


/* Petit halo supérieur */

.team-card::after {

    content: "";

    position: absolute;

    top: 0;
    left: 3px;
    right: 0;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            color-mix(
                in srgb,
                var(--team-color) 50%,
                transparent
            ),
            transparent
        );

    opacity: .8;

}


.team-card:hover {

    transform: translateY(-2px);

    background:
        linear-gradient(
            135deg,
            rgba(190, 160, 95, .07),
            rgba(255, 255, 255, .015)
        );

    border-color:
        color-mix(
            in srgb,
            var(--team-color) 55%,
            rgba(190, 160, 95, .20)
        );

    box-shadow:
        0 8px 18px rgba(0, 0, 0, .28),
        0 0 12px color-mix(
            in srgb,
            var(--team-color) 15%,
            transparent
        );

}


/* ==========================================================
   HEADER ÉQUIPE
   ========================================================== */

.team-card-header {

    display: flex;

    align-items: center;

    gap: 11px;

}


.team-emblem {

    width: 42px;
    height: 42px;

    flex-shrink: 0;

    object-fit: contain;

    filter:
        drop-shadow(
            0 2px 5px rgba(0, 0, 0, .45)
        );

}


.team-card-info {

    flex: 1;

    min-width: 0;

}


/* ==========================================================
   NOM ÉQUIPE
   ========================================================== */

.team-card-title {

    overflow: hidden;

    color: #eee6d8;

    font-family: "Cinzel", serif;

    font-size: .78rem;

    font-weight: 600;

    letter-spacing: .06em;

    line-height: 1.2;

    text-overflow: ellipsis;

    white-space: nowrap;

}


.team-card-subtitle {

    margin-top: 4px;

    color: #d0ad68;

    font-size: .68rem;

    font-weight: 600;

}


/* ==========================================================
   SÉPARATEUR
   ========================================================== */

.team-card-divider {

    height: 1px;

    margin: 12px 0;

    background:
        linear-gradient(
            90deg,
            rgba(190, 160, 95, .20),
            rgba(190, 160, 95, .04),
            transparent
        );

}


/* ==========================================================
   STATISTIQUES ÉQUIPE
   ========================================================== */

.team-card-grid {

    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 7px;

}


.team-stat {

    display: flex;

    align-items: center;

    gap: 6px;

    min-height: 32px;

    padding: 5px 8px;

    box-sizing: border-box;

    background:
        rgba(0, 0, 0, .16);

    border:
        1px solid rgba(190, 160, 95, .08);

    border-radius: 6px;

}


.team-stat-icon {

    font-size: .78rem;

    line-height: 1;

}


.team-stat span:last-child {

    color: #d6cdbc;

    font-size: .70rem;

    font-weight: 600;

}


/* ==========================================================
   PV — MISE EN AVANT
   ========================================================== */

.team-card-subtitle::first-letter {

    color: #e1bd70;

}


/* ==========================================================
   SCROLLBAR SIDEBAR
   ========================================================== */

.sidebar-card::-webkit-scrollbar {

    width: 5px;

}


.sidebar-card::-webkit-scrollbar-track {

    background: rgba(0, 0, 0, .15);

}


.sidebar-card::-webkit-scrollbar-thumb {

    background:
        rgba(190, 160, 95, .25);

    border-radius: 999px;

}


.sidebar-card::-webkit-scrollbar-thumb:hover {

    background:
        rgba(190, 160, 95, .45);

}


/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 900px) {

    .campaign-panel-title {

        font-size: .70rem;

    }

    .campaign-panel-body {

        padding: 11px;

    }

    .team-card {

        padding: 12px;

    }

    .team-emblem {

        width: 38px;
        height: 38px;

    }

}


@media (max-width: 600px) {

    .campaign-panel {

        border-radius: 8px;

    }

    .accordion-header {

        min-height: 44px;

        padding: 0 11px;

    }

    .campaign-panel-body {

        padding: 10px;

    }

    .team-card {

        padding: 11px;

    }

}


/* ==========================================================
   NOUVEAU PANNEAU ÉQUIPES — DOUBLE ACCORDÉON
   ========================================================== */

.teams-panel {
    padding: 0;
}

.teams-panel-heading {
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(190,160,95,.10);
}

.teams-panel-heading .campaign-panel-title {
    padding-left: 18px;
}

.teams-panel-count {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(190,160,95,.10);
    border: 1px solid rgba(190,160,95,.18);
    color: #d8b36a;
    font-size: .68rem;
}

/* Équipe — niveau 1 */

.team-accordion {
    position: relative;
    border-bottom: 1px solid rgba(190,160,95,.09);
}

.team-accordion:last-child {
    border-bottom: 0;
}

.team-accordion-summary {
    position: relative;
    min-height: 68px;
    padding: 10px 11px 10px 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    list-style: none;
    cursor: pointer;
    background: rgba(255,255,255,.015);
    transition: background .2s ease;
}

.team-accordion-summary::-webkit-details-marker {
    display: none;
}

.team-accordion-summary:hover {
    background: rgba(190,160,95,.055);
}

.team-color-indicator {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--team-color);
    box-shadow: 0 0 8px color-mix(
        in srgb,
        var(--team-color) 45%,
        transparent
    );
}

.team-accordion-emblem {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,.45));
}

.team-accordion-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.team-accordion-title {
    overflow: hidden;
    color: #eee6d8;
    font-family: "Cinzel", serif;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .035em;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-accordion-meta {
    color: #9e9587;
    font-size: .65rem;
}

.team-accordion-chevron {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bea05f;
    font-size: .9rem;
    transition: transform .2s ease;
}

.team-accordion[open] .team-accordion-chevron {
    transform: rotate(180deg);
}

/* Contenu équipe */

.team-accordion-content {
    padding: 0 10px 11px;
    background: rgba(0,0,0,.10);
    border-top: 1px solid rgba(190,160,95,.07);
}

/* Résumé */

.team-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 9px 0;
}

.team-summary-stat {
    min-width: 0;
    min-height: 43px;
    padding: 5px 6px;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(190,160,95,.08);
    border-radius: 6px;
    background: rgba(0,0,0,.14);
}

.team-summary-icon {
    font-size: .72rem;
}

.team-summary-stat div {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.team-summary-stat strong {
    color: #e1bd70;
    font-family: "Cinzel", serif;
    font-size: .72rem;
    line-height: 1;
}

.team-summary-stat span:last-child {
    margin-top: 3px;
    color: #898277;
    font-size: .55rem;
    line-height: 1.1;
}

/* Sous-accordéons — niveau 2 */

.team-subaccordion {
    margin-top: 6px;
    overflow: hidden;
    border: 1px solid rgba(190,160,95,.10);
    border-radius: 7px;
    background: rgba(255,255,255,.018);
}

.team-subaccordion summary {
    min-height: 37px;
    padding: 0 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    list-style: none;
    cursor: pointer;
    color: #d8d0c1;
    font-size: .66rem;
    font-weight: 600;
}

.team-subaccordion summary::-webkit-details-marker {
    display: none;
}

.team-subaccordion summary::after {
    content: "⌄";
    margin-left: auto;
    color: #bea05f;
    transition: transform .2s ease;
}

.team-subaccordion[open] summary::after {
    transform: rotate(180deg);
}

.team-subaccordion-count {
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: rgba(190,160,95,.08);
    color: #bea05f;
    font-size: .57rem;
}

.team-subaccordion-content {
    padding: 3px 7px 7px;
    border-top: 1px solid rgba(190,160,95,.07);
}

/* Territoires */

.team-territory-row {
    width: 100%;
    min-height: 31px;
    padding: 0 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-bottom: 1px solid rgba(190,160,95,.055);
    background: transparent;
    color: #cfc6b6;
    font: inherit;
    font-size: .64rem;
    text-align: left;
    cursor: pointer;
}

.team-territory-row:last-child {
    border-bottom: 0;
}

.team-territory-row:hover {
    color: #ead49c;
    background: rgba(190,160,95,.055);
}

.team-territory-icon {
    color: #bea05f;
    font-size: .45rem;
}

.team-territory-row span:nth-child(2) {
    flex: 1;
}

.team-territory-arrow {
    color: #796f61;
    font-size: .9rem;
}

/* Conflits */

.team-conflict-row {
    min-height: 43px;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    border-bottom: 1px solid rgba(190,160,95,.055);
}

.team-conflict-row:last-child {
    border-bottom: 0;
}

.team-conflict-row:hover {
    background: rgba(190,160,95,.055);
}

.team-conflict-icon {
    color: #c75c52;
    font-size: .72rem;
}

.team-conflict-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-conflict-main strong {
    overflow: hidden;
    color: #ddd3c2;
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-conflict-main small {
    overflow: hidden;
    color: #827a6e;
    font-size: .54rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.team-conflict-score {
    color: #d8b36a;
    font-family: "Cinzel", serif;
    font-size: .62rem;
    white-space: nowrap;
}

/* Statistiques */

.team-stats-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.team-stats-detail > div {
    min-height: 34px;
    padding: 5px 7px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    border-radius: 5px;
    background: rgba(0,0,0,.14);
}

.team-stats-detail > div:last-child {
    grid-column: 1 / -1;
}

.team-stats-detail span {
    color: #898277;
    font-size: .59rem;
}

.team-stats-detail strong {
    color: #d8b36a;
    font-family: "Cinzel", serif;
    font-size: .66rem;
}

/* Vide */

.team-empty-state {
    padding: 10px 7px;
    color: #766e63;
    font-size: .61rem;
    text-align: center;
}

.teams-empty {
    padding: 18px 10px;
}

/* Mobile */

@media (max-width: 600px) {

    .team-accordion-summary {
        min-height: 62px;
        padding: 9px 9px 9px 12px;
    }

    .team-accordion-emblem {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }

    .team-summary-grid {
        gap: 4px;
    }

    .team-summary-stat {
        padding: 5px;
    }

    .team-summary-icon {
        display: none;
    }

    .team-subaccordion summary {
        min-height: 36px;
    }
}
/* ==========================================================
   📊 STATISTIQUES ÉQUIPE
========================================================== */

.team-statistics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.team-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 34px;
    padding: 7px 10px;

    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;

    background: rgba(255, 255, 255, 0.025);

    transition:
        background 0.15s ease,
        border-color 0.15s ease;
}

.team-stat-row:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(216, 180, 106, 0.18);
}

.team-stat-label {
    display: flex;
    align-items: center;
    gap: 7px;

    color: #a9a9a9;
    font-size: 0.78rem;
    line-height: 1.2;
}

.team-stat-value {
    min-width: 28px;

    color: #d8b46a;
    font-size: 0.9rem;
    font-weight: 700;

    text-align: right;
}

/* ==========================================================
   📱 MOBILE
========================================================== */

@media (max-width: 700px) {

    .team-statistics {
        gap: 5px;
    }

    .team-stat-row {
        min-height: 36px;
        padding: 7px 9px;
    }

    .team-stat-label {
        font-size: 0.76rem;
    }

    .team-stat-value {
        font-size: 0.85rem;
    }
}



/* ----------------------------------------------------------
   Titre "Détails"
---------------------------------------------------------- */

.team-statistics details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    width: 100%;
    min-height: 34px;

    padding: 0 10px;

    box-sizing: border-box;

    list-style: none;

    color: #eee6d8;

    font-size: .72rem;
    font-weight: 600;

    cursor: pointer;

    background: transparent;

    transition:
        background .2s ease,
        color .2s ease;
}


/* Supprime le triangle natif */

.team-statistics details > summary::-webkit-details-marker {
    display: none;
}

.team-statistics details > summary::marker {
    display: none;
    content: "";
}


/* Notre propre flèche */

.team-statistics details > summary::after {
    content: "⌄";

    color: #bea05f;
    font-size: .85rem;

    transition: transform .2s ease;
}


/* État ouvert */

.team-statistics details[open] > summary {
    background:
        linear-gradient(
            90deg,
            rgba(190, 160, 95, .10),
            rgba(190, 160, 95, .025)
        );

    color: #f2eadb;
}

.team-statistics details[open] > summary::after {
    transform: rotate(180deg);
}


/* ----------------------------------------------------------
   Contenu
---------------------------------------------------------- */

.team-statistics details > div {
    padding: 7px 9px 9px;

    border-top: 1px solid rgba(190, 160, 95, .10);
}


/* ----------------------------------------------------------
   Hover
---------------------------------------------------------- */

.team-statistics details > summary:hover {
    background:
        linear-gradient(
            90deg,
            rgba(190, 160, 95, .11),
            rgba(190, 160, 95, .025)
        );
}