:root {
    --panel: rgba(255, 255, 255, .03);
    --panel2: rgba(0, 0, 0, .18);
    --border: rgba(0, 255, 255, .18);
    --accent: #00ffff;
    --text: rgba(255, 255, 255, .92);
    --muted: rgba(255, 255, 255, .72);
    --shadow: 0 0 14px rgba(0, 255, 255, .12);
}

/* Page */
.factions-page {
    max-width: 1300px;
    margin: 0 auto;
    padding: 120px 24px 40px;
}

.factions-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}

.factions-title {
    margin: 30px 0 0;
    font-size: 2.2rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent), 0 0 24px rgba(0, 255, 255, .35);
}

.factions-header-actions {
    margin-top: 12px;
}

.btn-request-faction {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 14px;
    font-weight: 800;
    text-decoration: none;

    color: #00ffff;
    border: 1px solid rgba(0, 255, 255, .45);
    background: rgba(0, 255, 255, .08);

    box-shadow: 0 0 14px rgba(0, 255, 255, .25);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn-request-faction:hover {
    background: rgba(0, 255, 255, .18);
    box-shadow: 0 0 22px rgba(0, 255, 255, .45);
    transform: translateY(-1px);
}


.factions-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.factions-counter {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 10px 12px;
    box-shadow: var(--shadow);
}

.factions-counter .lbl {
    color: var(--muted);
    margin-right: 8px;
}

.factions-counter .val {
    color: var(--accent);
    font-weight: 900;
}

.factions-hint {
    color: var(--muted);
    font-size: .95rem;
}

/* List */
.factions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* =========================
   CARD — GRID EXACT (4 COLS / 3 ROWS)
   Col1: head (3 rows)
   Col2: niveau/beacon/guerre
   Col3: nom/coords/desc
   Col4: members (3 rows)
   ========================= */

.faction-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 18px;
    position: relative;
    overflow: hidden;

    display: grid;
    grid-template-columns: 120px 180px 1fr 280px;
    grid-template-rows: auto auto auto auto;
    gap: 16px;
    align-items: center;
}

.faction-card::after {
    content: "";
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle at 18% 18%, rgba(0, 255, 255, .09), transparent 58%);
    pointer-events: none;
}

/* COL 1 — big head */
.faction-left {
    grid-column: 1;
    grid-row: 1 / span 4;
    position: relative;
    z-index: 1;

    display: flex;
    justify-content: center;
    align-items: center;
}

.leader-head {
    width: 104px;
    height: 104px;
    border-radius: 20px;
    border: 1px solid rgba(0, 255, 255, .35);
    box-shadow: 0 0 20px rgba(0, 255, 255, .25);
    background: rgba(0, 0, 0, .22);
}

/* COL 2 — stats */
.faction-stats {
    grid-column: 2;
    grid-row: 1 / span 4;
    position: relative;
    z-index: 1;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat {
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(0, 255, 255, .20);
    border-radius: 14px;
    padding: 10px 12px;
    text-align: left;
    font-weight: 800;
    color: rgba(255, 255, 255, .92);

}

.stat b {
    color: var(--accent);
}

/* COL 3 — infos */
.faction-name {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    z-index: 1;
    text-align: left;

    font-size: 1.75rem;
    font-weight: 900;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(0, 255, 255, .40);
}

.faction-created {
    grid-column: 3;
    grid-row: 2;
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, .72);
    font-weight: 700;
    margin-top: -6px;
    /* remonte un peu sous le nom */
}

.faction-coords {
    grid-column: 3;
    grid-row: 3;
    position: relative;
    z-index: 1;
    text-align: center;
}

.coords-copy {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 255, .18);
    background: rgba(0, 0, 0, .20);
    cursor: pointer;
    user-select: none;
}

.coords-copy i {
    color: var(--accent);
    opacity: .9;
}

.coords-copy b {
    color: var(--accent);
}

.faction-slogan {
    grid-column: 3;
    grid-row: 4;
    position: relative;
    z-index: 1;
    text-align: center;

    color: var(--text);
    font-size: 1.05rem;
    line-height: 1.45;
}

/* COL 4 — members (unchanged style) */
.faction-members {
    grid-column: 4;
    grid-row: 1 / span 4;
    position: relative;
    align-self: flex-start;
    z-index: 1;

    border-left: 1px solid rgba(0, 255, 255, .12);
    padding-left: 14px;
}

.members-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.members-title {
    color: rgba(255, 255, 255, .72);
    font-weight: 900;
    font-size: 1.1rem;
}

.members-count {
    color: var(--accent);
    font-weight: 900;
    font-size: 1.05rem;
}

.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 8px;

    background: rgba(0, 0, 0, .18);
    border: 1px solid rgba(0, 255, 255, .14);
    border-radius: 12px;
    padding: 8px 10px;
}

.member-head {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid rgba(0, 255, 255, .22);
    background: rgba(0, 0, 0, .20);
}

.member-name {
    color: rgba(255, 255, 255, .92);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Toast */
.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .75);
    border: 1px solid rgba(0, 255, 255, .22);
    color: rgba(255, 255, 255, .95);
    box-shadow: 0 0 18px rgba(0, 255, 255, .14);
    z-index: 9999;
}

.toast.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 1000px) {
    .faction-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .faction-left,
    .faction-stats,
    .faction-name,
    .faction-coords,
    .faction-slogan,
    .faction-members {
        grid-column: 1;
        grid-row: auto;
    }

    .faction-members {
        border-left: none;
        padding-left: 0;
        margin-top: 10px;
    }
}