/* === TFM - Tahyme Football Manager - Theme FC26 =================== */
/* Refonte visuelle phase 5 : fond bleu nuit a motifs diagonaux,
   navigation horizontale, CTA rose/magenta, valeurs colorees par
   qualite. Les noms de classes historiques sont conserves : seul
   leur rendu change. Les regles du live/terrain (pitch, announce,
   scoreboard, stats...) sont copiees telles quelles. */

:root {
    /* Fond et surfaces */
    --bg: #0a0f2c;
    --bg-soft: #101740;
    --card: #0b0e20;
    --card-2: #161c40;
    --border: #262e5c;
    --text: #eef1fb;
    --muted: #939cc4;

    /* Accent CTA (rose/magenta FC26) */
    --accent: #f0327f;
    --accent-2: #ff5ea0;
    --accent-soft: rgba(240, 50, 127, .16);

    /* Couleurs historiques (composants existants) */
    --green: #37c65a;
    --green-soft: rgba(55, 198, 90, .14);
    --gold: #f2c94c;
    --red: #ff5d6c;
    --blue: #59a8ff;

    /* Couleurs de qualite (paliers FC26) */
    --q-good: #42d95c;   /* 80+ */
    --q-mid: #f2c94c;    /* 65-79 */
    --q-warn: #ff8a3d;   /* 50-64 */
    --q-low: #ff5d6c;    /* < 50 */

    --radius: 12px;
    --font-cond: "Bahnschrift SemiCondensed", "Bahnschrift", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background-color: var(--bg);
    /* Motif diagonal discret facon FC26 */
    background-image:
        linear-gradient(115deg,
            rgba(255, 255, 255, .025) 0%, rgba(255, 255, 255, .025) 14%,
            transparent 14%, transparent 30%,
            rgba(255, 255, 255, .016) 30%, rgba(255, 255, 255, .016) 40%,
            transparent 40%),
        radial-gradient(1100px 560px at 85% -10%, rgba(38, 60, 160, .45), transparent 60%),
        radial-gradient(900px 700px at -10% 110%, rgba(16, 26, 88, .6), transparent 55%),
        linear-gradient(160deg, #0d1338 0%, #0a0f2c 45%, #070b22 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Titres condenses en MAJUSCULES */
h1, h2, .hero {
    font-family: var(--font-cond);
    text-transform: uppercase;
    letter-spacing: .045em;
}
h1 { font-size: 1.9rem; font-weight: 800; margin: 0 0 4px; }
h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 12px; color: var(--text); }
h3 { font-size: 1rem; margin: 0 0 8px; }
.subtitle { color: var(--muted); margin: 0 0 20px; }

/* Tres gros titre de page (ex : LUNDI, 26 JANV) */
.hero { font-size: clamp(2rem, 4.5vw, 3.2rem); font-weight: 800; margin: 0 0 6px; line-height: 1.05; }
.hero small { display: block; font-family: "Segoe UI", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--muted); font-weight: 400; margin-top: 6px; }
.section-title {
    font-family: var(--font-cond);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .82rem;
    font-weight: 700;
    color: var(--muted);
}

/* --- Layout / navigation horizontale FC26 ------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(7, 10, 30, .92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 24px 8px;
    max-width: 1400px;
    margin: 0 auto;
}
.topnav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.topnav a {
    color: var(--muted);
    font-family: var(--font-cond);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 700;
    font-size: .98rem;
    padding: 8px 14px;
    border-radius: 8px;
    white-space: nowrap;
}
.topnav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); text-decoration: none; }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, .07); box-shadow: inset 0 -2px 0 var(--accent); }
.subnav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 24px 8px;
    max-width: 1400px;
    margin: 0 auto;
    overflow-x: auto;
}
.subnav a {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 600;
    padding: 5px 13px;
    border-radius: 999px;
    white-space: nowrap;
}
.subnav a:hover { color: var(--text); background: rgba(255, 255, 255, .05); text-decoration: none; }
.subnav a.active { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }

.topbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.05rem;
    color: var(--text);
    background: rgba(255, 255, 255, .05);
    border: 1px solid transparent;
}
.icon-btn:hover { text-decoration: none; background: rgba(255, 255, 255, .1); }
.icon-btn.active { border-color: var(--accent); }
.icon-btn .notif-badge { position: absolute; top: -5px; right: -7px; margin-left: 0; }
.profile-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-size: .88rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .05);
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-link:hover { text-decoration: none; background: rgba(255, 255, 255, .1); }
.profile-link.active { box-shadow: inset 0 0 0 1px var(--accent); }
.profile-ico { font-size: .95rem; line-height: 1; }
.admin-link { color: var(--gold); }
.logout-link { color: var(--muted); font-size: .82rem; white-space: nowrap; }
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    font-size: 1.2rem;
    padding: 4px 10px;
    cursor: pointer;
}

.content { padding: 26px 24px 48px; max-width: 1400px; margin: 0 auto; }
.content-public {
    margin: 0 auto;
    max-width: 480px;
    padding: 8vh 20px;
}

.logo { display: flex; align-items: center; gap: 9px; padding: 0; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-ball { font-size: 1.6rem; }
.logo strong { font-family: var(--font-cond); font-size: 1.2rem; letter-spacing: 1.5px; display: block; line-height: 1.1; }
.logo small { color: var(--muted); font-size: 0.66rem; display: block; line-height: 1.1; }

.club-chip {
    display: flex; align-items: center; gap: 9px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 12px 4px 5px;
}
.club-crest {
    background: linear-gradient(135deg, var(--c1, #1a5fb4), var(--c2, #fff));
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.6);
    font-weight: 700;
    font-size: 0.72rem;
    border-radius: 999px;
    padding: 7px 6px;
    min-width: 38px;
    text-align: center;
}
.club-chip-info strong { display: block; font-size: 0.8rem; line-height: 1.2; }
.club-chip-info small { color: var(--muted); font-size: 0.7rem; line-height: 1.2; }

/* Largeurs intermediaires : on compacte le bandeau droit */
@media (max-width: 1360px) {
    .logo small { display: none; }
    .club-chip-info { display: none; }
    .club-chip { padding: 4px 5px; }
}
@media (max-width: 1220px) {
    .profile-link .profile-name { display: none; }
    .live-banner .live-text { display: none; }
    .live-banner { padding: 6px 9px; }
    .logout-link { font-size: .76rem; }
}

/* Nav repliable sous 900px */
@media (max-width: 900px) {
    .topbar-inner { flex-wrap: wrap; gap: 10px; }
    .nav-toggle { display: block; margin-left: auto; }
    .topnav, .topbar-right { display: none; }
    .topbar.nav-open .topnav {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        flex: 0 0 100%;
        width: 100%;
        order: 5;
    }
    .topbar.nav-open .topbar-right {
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        order: 6;
        padding-bottom: 8px;
    }
    /* Menu deplie : on reaffiche les libelles compactes */
    .topbar.nav-open .profile-link .profile-name { display: inline; }
    .topbar.nav-open .live-banner .live-text { display: inline; }
    .topbar.nav-open .club-chip-info { display: block; }
    .club-chip-info { display: none; }
    .content { padding: 18px 14px 40px; }
}

/* --- Live (bandeau match en direct) -------------------------------- */
.live-banner {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    background: #6e131333;
    border: 1px solid #f8514966;
    color: #ff7b72 !important;
    font-weight: 700;
    border-radius: 999px;
    padding: 6px 14px;
    letter-spacing: 1px;
    font-size: 0.75rem;
    white-space: nowrap;
}
.live-banner:hover { text-decoration: none; filter: brightness(1.2); }
.live-dot {
    width: 9px; height: 9px;
    background: var(--red);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(248, 81, 73, .6); }
    70% { box-shadow: 0 0 0 8px rgba(248, 81, 73, 0); }
    100% { box-shadow: 0 0 0 0 rgba(248, 81, 73, 0); }
}

/* --- Cartes / grilles -------------------------------------------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
    background: linear-gradient(175deg, rgba(20, 26, 58, .55), rgba(9, 12, 30, .92) 40%), var(--card);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 10px 30px rgba(3, 5, 16, .35);
}
.card h2 { display: flex; align-items: center; gap: 8px; }
.kpi { font-size: 1.6rem; font-weight: 800; font-family: var(--font-cond); letter-spacing: .02em; }
.kpi small { color: var(--muted); font-size: 0.78rem; font-weight: 400; display: block; font-family: "Segoe UI", system-ui, sans-serif; letter-spacing: 0; }
.kpi.gold { color: var(--gold); }
.kpi.green { color: var(--q-good); }

/* Panneau de detail (colonne droite facon FC26) */
.detail-panel {
    position: sticky;
    top: 96px;
    align-self: start;
}

/* --- Tables ------------------------------------------------------ */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: .6px;
    padding: 9px 12px;
    border-bottom: 1px solid var(--border);
}
td { padding: 11px 12px; border-bottom: 1px solid rgba(255, 255, 255, .05); }
tr:last-child td { border-bottom: none; }
tbody tr:hover td, table tr:hover td { background: rgba(255, 255, 255, .028); }
tr.highlight td, tr.highlight:hover td { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Badges / stats ---------------------------------------------- */
.pos { font-weight: 700; font-size: 0.72rem; padding: 3px 7px; border-radius: 6px; }
.pos-gk { background: #6e40c933; color: #d2a8ff; }
.pos-def { background: #1f6feb33; color: #79c0ff; }
.pos-mid { background: #23863a33; color: #7ee787; }
.pos-att { background: #da363333; color: #ff7b72; }
/* Valeurs colorees par palier de qualite (echelle FC26 unique) */
.quality { font-weight: 700; font-variant-numeric: tabular-nums; }
.quality-good { color: var(--q-good); }
.quality-mid { color: var(--q-mid); }
.quality-warn { color: var(--q-warn); }
.quality-low { color: var(--q-low); }

.tag {
    font-size: 0.72rem; padding: 2px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .05); border: 1px solid var(--border); color: var(--muted);
}
.tag-injury { background: #6e131333; border-color: #f8514966; color: #ff7b72; }
.tag-youth { background: #1f6feb33; border-color: #58a6ff66; color: #79c0ff; }
.tag-starter { background: var(--green-soft); border-color: #2ea04366; color: #7ee787; }

/* Pilule generique et puce statistique (nouvelles classes phase 5) */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 13px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.pill-accent { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.stat-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .08);
    min-width: 86px;
}
.stat-chip small {
    color: var(--muted);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 600;
}
.stat-chip strong { font-family: var(--font-cond); font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; }

.bar {
    display: inline-block; width: 64px; height: 7px;
    background: rgba(255, 255, 255, .1); border-radius: 4px; overflow: hidden; vertical-align: middle;
}
.bar-fill { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.bar-fill.bar-mid { background: var(--gold); }
.bar-fill.bar-low { background: var(--red); }

/* --- Carte joueur "ecusson" (nouvelle, phase 5) -------------------- */
.player-crest {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 12px 12px;
    min-width: 96px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(28, 36, 78, .85), rgba(10, 13, 32, .95));
    border: 1px solid rgba(255, 255, 255, .1);
    text-align: center;
}
.player-crest .crest-top { display: flex; align-items: center; gap: 6px; }
.player-crest .crest-rating { font-family: var(--font-cond); font-size: 1.25rem; font-weight: 800; line-height: 1; }
.player-crest .crest-form { font-size: .72rem; }
.player-crest .crest-form.up { color: var(--q-good); }
.player-crest .crest-form.down { color: var(--q-low); }
.player-crest .crest-name {
    font-weight: 700;
    font-size: .84rem;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player-crest .crest-pos { color: var(--muted); font-size: .7rem; font-weight: 700; letter-spacing: .06em; }
.player-crest .crest-bar { width: 72px; height: 5px; }

/* --- Footer tactique (ecran equipe, nouvelle, phase 5) -------------- */
.tactic-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    align-items: center;
    padding: 14px 20px;
    border-radius: var(--radius);
    background: rgba(7, 10, 26, .85);
    border: 1px solid rgba(255, 255, 255, .08);
}
.tactic-footer .tf-item { display: flex; flex-direction: column; gap: 1px; }
.tactic-footer .tf-item small {
    color: var(--muted);
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 600;
}
.tactic-footer .tf-item strong { font-family: var(--font-cond); font-size: 1.02rem; letter-spacing: .02em; }

/* --- Formulaires / boutons --------------------------------------- */
input, select {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 0.95rem;
    width: 100%;
}
input:focus, select:focus { outline: 2px solid rgba(240, 50, 127, .35); border-color: var(--accent); }
select option { background: var(--bg-soft); color: var(--text); }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 12px 0 4px; }
input[type="color"] { padding: 2px; height: 42px; }
input[type="checkbox"] { width: auto; }

.btn {
    display: inline-block;
    background: rgba(255, 255, 255, .07);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter .15s, background .15s;
}
.btn:hover { filter: brightness(1.2); text-decoration: none; }
.btn-primary {
    background: linear-gradient(180deg, var(--accent-2), var(--accent));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 16px rgba(240, 50, 127, .35);
}
.btn-gold { background: #7d5b1a; border-color: var(--gold); color: #ffdf8e; }
.btn-danger { background: #6e1313; border-color: var(--red); color: #ffb3ae; }
.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
form.inline { display: inline; }

.btn-twitch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #9146ff;
    border-color: #9146ff;
    color: #fff;
    font-size: 1rem;
    padding: 12px 16px;
}
.btn-twitch:hover { background: #a970ff; text-decoration: none; }
.separator {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: .8rem;
    margin: 16px 0 4px;
}
.separator::before, .separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.avatar { width: 24px; height: 24px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.profile-link .avatar { margin-right: 0; }

/* --- Flash ------------------------------------------------------- */
.flash {
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid;
    font-size: 0.92rem;
}
.flash-success { background: #23863a22; border-color: #2ea04366; color: #7ee787; }
.flash-error { background: #6e131322; border-color: #f8514966; color: #ff7b72; }

/* --- Fixtures ----------------------------------------------------- */
.fixture-row {
    display: grid;
    grid-template-columns: 1fr 110px 1fr;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text);
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.fixture-row:hover { background: rgba(255, 255, 255, .04); text-decoration: none; }
.fixture-row.is-live { background: #6e131315; }
.fx-club { font-weight: 600; }
.fx-club.is-mine { color: #7ee787; }
.fx-away { text-align: right; }
.fx-score {
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
}

/* --- Page match live ---------------------------------------------- */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 20px;
    text-align: center;
    padding: 26px 18px;
}
.scoreboard .team { font-size: 1.15rem; font-weight: 700; }
.scoreboard .team small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; }
.score-main { font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums; font-family: var(--font-cond); }
.score-minute { color: var(--gold); font-weight: 700; }
.events-feed { max-height: 480px; overflow-y: auto; display: flex; flex-direction: column-reverse; gap: 0; }
.event-line {
    display: flex; gap: 12px; padding: 9px 6px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    font-size: 0.92rem;
    animation: fadeIn .4s;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
.event-minute { color: var(--muted); min-width: 34px; font-variant-numeric: tabular-nums; font-weight: 700; }
.event-goal { background: #23863a1c; border-left: 3px solid var(--green); }
.event-red { background: #6e13131c; border-left: 3px solid var(--red); }

/* --- Tutoriel ------------------------------------------------------ */
.tuto-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 6, 18, .74);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 30px;
    z-index: 100;
}
.tuto-overlay[hidden] { display: none; }
.tuto-box {
    background: var(--card);
    border: 1px solid var(--accent);
    border-radius: 14px;
    padding: 20px 24px;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 18px 60px rgba(0,0,0,.6);
}
.tuto-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tuto-step-label { color: var(--accent-2); font-weight: 700; font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; }
.tuto-skip { background: none; border: none; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; }
.tuto-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; }
.tuto-progress { color: var(--muted); font-size: .82rem; }
.tuto-highlight {
    position: relative;
    z-index: 101;
    outline: 2px solid var(--accent-2);
    outline-offset: 3px;
    border-radius: 8px;
}

/* --- Divers -------------------------------------------------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.muted { color: var(--muted); }
.mt { margin-top: 16px; }
.facility { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.facility:last-child { border-bottom: none; }
.facility-info strong { display: block; }
.facility-info small { color: var(--muted); }
.level-pips { display: flex; gap: 3px; margin-top: 4px; }
.pip { width: 14px; height: 6px; background: rgba(255, 255, 255, .12); border-radius: 3px; }
.pip.on { background: var(--gold); }
.auth-card { margin-top: 18px; }
.onboarding { max-width: 480px; margin: 4vh auto 0; }
.auth-logo { text-align: center; font-size: 3rem; margin-bottom: 4px; }
.auth-title { text-align: center; margin-bottom: 24px; }
.auth-title small { display: block; color: var(--muted); }
.sponsor-offer { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; background: var(--card-2); }
.sponsor-offer h3 { display: flex; justify-content: space-between; }
.sponsor-tier { color: var(--gold); font-size: .78rem; }
.rd-cost { color: var(--gold); font-weight: 700; }

/* --- Filtres marche ----------------------------------------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.filter-bar > div { flex: 1 1 150px; }
.filter-bar label { margin: 0 0 4px; }
.filter-count { margin-left: auto; font-size: 0.8rem; font-weight: 400; }

/* --- Live 2D (retransmission) --------------------------------------
   Regles consommees par live.js / pitch.js / sounds.js :
   conservees telles quelles (ne pas renommer). */
.score-minute-live { font-size: 1.35rem; }
.score-live-tag {
    display: inline-flex; align-items: center; gap: 6px;
    margin-top: 4px;
    color: #ff7b72; font-weight: 700; font-size: .72rem; letter-spacing: 1px;
}
.broadcast-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 1000px) { .broadcast-grid { grid-template-columns: 1fr; } }
.pitch-card { padding: 10px; }
.pitch-wrap { position: relative; width: 100%; }
.pitch-wrap canvas { display: block; width: 100%; border-radius: 8px; }
.flash-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    font-size: clamp(1.5rem, 4.5vw, 2.8rem);
    font-weight: 800; letter-spacing: 2px;
    color: #fff; text-shadow: 0 4px 18px rgba(0, 0, 0, .85);
    opacity: 0; transform: scale(.82);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
    z-index: 5;
}
.flash-overlay.show { opacity: 1; transform: scale(1); }
.flash-overlay.flash-goal { color: #7ee787; }
.flash-overlay.flash-red { color: #ff7b72; }
.flash-overlay.flash-sub { color: var(--gold); font-size: clamp(1.1rem, 3vw, 1.7rem); }
.flash-overlay.flash-fulltime { color: #fff; font-size: clamp(1.2rem, 3.4vw, 2rem); }
.flash-overlay.flash-pen { color: #ffd866; }

/* Annonce discrete en haut du terrain : touche, hors-jeu, corner, arret... */
.pitch-announce {
    position: absolute; top: 8px; left: 50%;
    transform: translateX(-50%) translateY(-6px);
    padding: 3px 14px; border-radius: 999px;
    background: rgba(8, 12, 16, .82); color: #fff;
    font-size: .82rem; font-weight: 700; letter-spacing: .5px;
    white-space: nowrap;
    opacity: 0; transition: opacity .2s, transform .2s;
    pointer-events: none;
    z-index: 4;
}
.pitch-announce.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.stats-panel .poss-row {
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 700; font-variant-numeric: tabular-nums;
    margin-bottom: 6px;
}
.stats-panel .poss-row .muted { font-size: .8rem; font-weight: 400; }
.poss-bar {
    display: flex; height: 10px;
    background: #21262d; border-radius: 6px; overflow: hidden;
    margin-bottom: 12px;
}
.poss-bar span { display: block; height: 100%; transition: width .8s ease; }
#poss-home-bar { background: var(--green); }
#poss-away-bar { background: var(--blue); }
.stats-panel .stat-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    padding: 7px 2px;
    border-bottom: 1px solid #1f2937;
    font-variant-numeric: tabular-nums;
}
.stats-panel .stat-row:last-child { border-bottom: none; }
.stat-row .stat-label { color: var(--muted); font-size: .8rem; text-align: center; align-self: center; }
.stat-row .stat-val { font-weight: 700; }
.stat-row .stat-val + .stat-label + .stat-val { text-align: right; }

.lineup-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 1000px) { .lineup-cols { grid-template-columns: 1fr; } }
.lineup-list { list-style: none; margin: 0; padding: 0; }
.lineup-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 2px;
    border-bottom: 1px solid #1f2937;
    font-size: .88rem;
}
.lineup-list li:last-child { border-bottom: none; }
.lineup-energy { margin-left: auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.bench summary { cursor: pointer; color: var(--muted); font-size: .85rem; margin: 8px 0 4px; }

.subs-box .subs-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.subs-box .subs-row > div { flex: 1 1 190px; }
.subs-box label { margin: 0 0 4px; }

.toast {
    position: fixed; bottom: 20px; right: 20px;
    z-index: 200;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 18px;
    max-width: 340px;
    font-size: .92rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
    animation: fadeIn .3s;
}
.toast-ok { border-color: #2ea04366; color: #7ee787; }
.toast-err { border-color: #f8514966; color: #ff7b72; }

.note-badge {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    border-radius: 6px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, .08);
    color: var(--muted);
}
.note-badge.note-high { background: #23863a33; color: #7ee787; }
.note-badge.note-mid { background: #7d5b1a55; color: #ffdf8e; }

/* --- Divisions (pyramide de ligues) -------------------------------- */
.division-card { scroll-margin-top: 96px; }
.division-card.is-mine { border-color: #2ea04366; }
tr.row-promo td { background: #23863a10; }
tr.row-promo td:first-child { border-left: 3px solid var(--green); }
tr.row-releg td { background: #f851490d; }
tr.row-releg td:first-child { border-left: 3px solid var(--red); }
tr.highlight.row-promo td, tr.highlight.row-releg td { background: var(--accent-soft); }
.promo-arrow { color: var(--green); font-size: .72rem; }
.releg-arrow { color: var(--red); font-size: .72rem; }

.division-filter { margin-bottom: 16px; }
.division-filter select { max-width: 260px; }
.fx-wrap { display: flex; align-items: center; gap: 8px; }
.fx-wrap .fixture-row { flex: 1; min-width: 0; }
.fx-wrap[hidden] { display: none; }
.round-card[hidden] { display: none; }
.fx-div-tag { display: none; flex: 0 0 auto; white-space: nowrap; }
.show-div-tags .fx-div-tag { display: inline-block; }

/* --- Notifications (phase 4A) -------------------------------------- */
.notif-badge {
    display: inline-block;
    min-width: 18px;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-align: center;
    font-size: .72rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.4;
}
.notif-list { list-style: none; margin: 0; padding: 0; }
.notif-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
    border-left: 3px solid transparent;
}
.notif-row:last-child { border-bottom: none; }
.notif-row.notif-unread { background: #2ea04312; border-left-color: var(--green); }
.notif-icon { flex: 0 0 auto; font-size: 1.2rem; line-height: 1.3; }
.notif-content { flex: 1; min-width: 0; }
.notif-content p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.notif-date { flex: 0 0 auto; color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }

/* --- Dotation generale (panel admin) -------------------------------- */
textarea {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    width: 100%;
    padding: 8px 10px;
    font: inherit;
    resize: vertical;
}
textarea:focus { outline: 2px solid rgba(240, 50, 127, .35); border-color: var(--accent); }
.grant-all-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.grant-all-row label { margin-top: 0; }
.grant-all-msg { flex: 1 1 260px; }

/* --- Portraits joueurs (phase 3A) ----------------------------------- */
[data-portrait] { display: inline-block; line-height: 0; vertical-align: middle; flex: 0 0 auto; }
[data-portrait] svg { display: block; border-radius: 50%; }
.flag { font-size: 1.1rem; line-height: 1; }

/* --- Page joueur ----------------------------------------------------- */
.player-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.player-identity { flex: 1; min-width: 220px; }
.player-identity h1 { margin-bottom: 6px; }
.player-badges { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; flex-wrap: wrap; }
.player-meta { margin: 0 0 10px; }
.player-club-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--card-2); border: 1px solid var(--border); border-radius: 8px;
    padding: 6px 10px; color: var(--text); font-weight: 600; font-size: .88rem;
}
.player-club-chip:hover { text-decoration: none; filter: brightness(1.15); }
.player-club-chip .club-crest { font-size: .7rem; padding: 4px 5px; min-width: 34px; }
.player-figures { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.attr-cols { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 16px; align-items: center; }
@media (max-width: 700px) { .attr-cols { grid-template-columns: 1fr; } }
.attr-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.attr-label { min-width: 34px; font-size: .78rem; font-weight: 700; letter-spacing: .4px; }
.attr-bar { flex: 1; width: auto; height: 8px; }
.attr-row .stat { min-width: 26px; text-align: right; }
.radar { width: 100%; max-width: 240px; margin: 0 auto; display: block; }
.radar-grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar-shape { fill: #2ea04338; stroke: var(--green); stroke-width: 1.5; stroke-linejoin: round; }
.radar-label { fill: var(--muted); font-size: 11px; font-weight: 700; }
.mini-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; text-align: center; }
@media (max-width: 900px) { .mini-stats { grid-template-columns: repeat(3, 1fr); } }
.card-yellow, .card-red { display: inline-block; width: 10px; height: 13px; border-radius: 2px; }
.card-yellow { background: var(--gold); }
.card-red { background: var(--red); }

/* --- Top stats du classement ------------------------------------------ */
.topstat-row { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-size: .9rem; }
.topstat-row:last-child { border-bottom: none; }
.topstat-rank { min-width: 14px; text-align: right; font-variant-numeric: tabular-nums; font-size: .8rem; }
.topstat-name { font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topstat-club { margin-left: auto; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38%; text-align: right; }
.topstat-value { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); min-width: 22px; text-align: right; }
