﻿/* =============================================================
   EVT Chat — Frontend CSS
   Couleurs club : bleu foncé #1a3a5c / bleu moyen #2c5282
   Remplace le vert WhatsApp par le bleu CEH4
   ============================================================= */

:root {
    /* Palette CEH4 */
    --ec-primary:      #1a3a5c;   /* bleu foncé club */
    --ec-primary-mid:  #2c5282;   /* bleu moyen */
    --ec-primary-lt:   #e8f0f8;   /* bleu très clair */
    --ec-primary-dim:  #4a7ab5;   /* bleu clair actif */
    --ec-gold:         #c9a84c;   /* or accent */
    --ec-sent-bg:      #1a3a5c;   /* bulle envoyée  */
    --ec-sent-text:    #ffffff;
    --ec-recv-bg:      #f0f4f8;   /* bulle reçue */
    --ec-recv-text:    #1a1a2e;
    --ec-sidebar-bg:   #f7f9fc;
    --ec-header-bg:    #1a3a5c;
    --ec-header-text:  #ffffff;
    --ec-border:       #d0dce8;
    --ec-radius:       12px;
    --ec-radius-sm:    6px;
    --ec-shadow:       0 2px 8px rgba(26,58,92,.12);
    --ec-font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Conteneur principal ────────────────────────────────── */
.evt-chat-app {
    display: flex;
    position: relative;   /* nécessaire pour positionner les overlays absolus */
    height: 600px;
    max-height: 90vh;
    border: 1px solid var(--ec-border);
    border-radius: var(--ec-radius);
    overflow: hidden;
    box-shadow: var(--ec-shadow);
    font-family: var(--ec-font);
    font-size: 16px;
    color: var(--ec-recv-text);
    background: #fff;
}

/* Portail d'overlays — couvre toute l'app, au-dessus de tout le contenu */
.evt-chat-overlays {
    position: absolute;
    inset: 0;
    z-index: 1000;
    pointer-events: none; /* laisse passer les clics si vide */
    overflow: hidden;     /* respecte le border-radius de l'app */
    border-radius: inherit;
}
.evt-chat-overlays > * {
    pointer-events: all;
}

/* ── Sidebar événements ─────────────────────────────────── */
.evt-chat-sidebar {
    width: 280px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--ec-border);
    background: var(--ec-sidebar-bg);
    overflow: hidden;
    transition: width .25s ease, min-width .25s ease, border-right-color .25s ease;
}
/* Sidebar fermée — desktop : collapse, mobile : slide (override dans @media) */
.evt-chat-sidebar.is-hidden {
    width: 0;
    min-width: 0;
    border-right-color: transparent;
}
/* Bouton retour visible dès que le sidebar est fermé (PC + mobile) */
.evt-chat-sidebar.is-hidden + .evt-chat-main .evt-chat-header__back {
    display: flex;
    align-items: center;
}

.evt-chat-sidebar__header {
    background: var(--ec-primary);
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.evt-chat-logo {
    letter-spacing: .3px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.evt-chat-logo__img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}
.evt-chat-logo__img--lg {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

/* ── Barre utilisateur connecté (bas de sidebar) ─────────── */
.evt-chat-sidebar__user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid var(--ec-border);
    background: var(--ec-sidebar-bg);
    flex-shrink: 0;
}
.evt-chat-sidebar__user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ec-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}
.evt-chat-sidebar__logout-btn {
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 11px;
    cursor: pointer;
    color: #6b7a8d;
    white-space: nowrap;
    margin-left: 8px;
    transition: background .15s, border-color .15s, color .15s;
    -webkit-appearance: none;
    appearance: none;
}
.evt-chat-sidebar__logout-btn:hover {
    background: #fff5f5;
    border-color: #c0392b;
    color: #c0392b;
}

.evt-chat-search-toggle {
    background: none;
    border: none;
    color: rgba(255,255,255,.85);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background .15s, color .15s;
    flex-shrink: 0;
}
.evt-chat-search-toggle:hover,
.evt-chat-search-toggle.is-active {
    background: rgba(255,255,255,.2);
    color: #fff;
}

/* ── Navigation saisons (mode readonly) ────────────────────── */
.evt-chat-season-nav {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    border-bottom: 1px solid var(--ec-border);
    background: var(--ec-sidebar-bg);
    gap: 8px;
}
.evt-chat-season-nav__btn {
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ec-text);
    flex-shrink: 0;
    transition: background .15s;
}
.evt-chat-season-nav__btn:hover:not(:disabled) { background: var(--ec-primary-lt); }
.evt-chat-season-nav__btn:disabled { opacity: .35; cursor: default; }
.evt-chat-season-nav__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--ec-primary);
    text-align: center;
    flex: 1;
}

/* Search rétractable */
.evt-chat-sidebar__search {
    overflow: hidden;
    max-height: 0;
    padding: 0 12px;
    border-bottom: none;
    transition: max-height .25s ease, padding .25s ease, border-color .25s ease;
    box-sizing: border-box;
}
.evt-chat-sidebar__search:not(.evt-chat-sidebar__search--collapsed) {
    max-height: 60px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--ec-border);
}
.evt-chat-sidebar__search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--ec-border);
    border-radius: 20px;
    font-size: 13px;
    outline: none;
    background: #fff;
    box-sizing: border-box;
}
.evt-chat-sidebar__search input:focus {
    border-color: var(--ec-primary-dim);
    box-shadow: 0 0 0 2px rgba(44,82,130,.15);
}

/* ── Liste des événements ───────────────────────────────── */
.evt-chat-event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}
.evt-chat-event-list::-webkit-scrollbar { width: 4px; }
.evt-chat-event-list::-webkit-scrollbar-thumb { background: var(--ec-border); border-radius: 4px; }

.evt-chat-event-list li {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--ec-border);
    transition: background .15s;
    position: relative;
}
.evt-chat-event-list li:hover { background: var(--ec-primary-lt); }
.evt-chat-event-list li.is-active {
    background: var(--ec-primary-lt);
    border-left: 3px solid var(--ec-primary);
}
.evt-chat-event-list__loading {
    color: #999;
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

.evt-chat-event-item__title {
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ec-primary);
}
.evt-chat-event-item__meta {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evt-chat-event-item__badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 3px;
}
.evt-chat-event-item__badge--current {
    background: var(--ec-gold);
    color: #fff;
}
.evt-chat-event-item__badge--future  { background: #d4edda; color: #296f3c; }
.evt-chat-event-item__badge--past    { background: #e2e8f0; color: #555; }

/* ── Zone principale (header + messages + input) ────────── */
.evt-chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.evt-chat-header {
    display: flex;
    flex-direction: column;
    background: var(--ec-primary);
    color: var(--ec-header-text);
    padding: 6px 16px 2px;
}
.evt-chat-header__row1 {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
}
.evt-chat-header__row2 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.evt-chat-header__back {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: none;
    padding: 0 4px;
}
.evt-chat-header__info { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.evt-chat-header__title {
    display: block;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-width: 0;
}
.evt-chat-header__meta {
    display: block;
    font-size: 11px;
    opacity: .8;
    white-space: nowrap;
    flex-shrink: 0;
}
.evt-chat-header__live {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    background: rgba(255,255,255,.15);
    border-radius: 12px;
    padding: 3px 10px;
    position: relative;
    cursor: pointer;
    user-select: none;
}

/* Tooltip liste des connectés */
.evt-chat-live__tooltip {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    min-width: 150px;
    z-index: 2000;
    padding: 4px 0;
    color: #333;
    font-size: 12px;
    white-space: nowrap;
}
.evt-chat-header__live:hover .evt-chat-live__tooltip,
.evt-chat-header__live.is-open .evt-chat-live__tooltip { display: block; }
.evt-chat-live__tooltip-item {
    padding: 5px 14px;
    line-height: 1.4;
}
.evt-chat-live__tooltip-item.is-me {
    font-weight: 700;
    color: var(--ec-primary);
}

/* Header actions : bouton galerie etc. */
.evt-chat-header__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 4px;
}
.evt-chat-header__gallery-btn {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.3);
    color: #fff;
}
.evt-chat-header__gallery-btn:hover {
    background: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}
.evt-chat-live-dot {
    width: 7px; height: 7px;
    background: #6ee08a;
    border-radius: 50%;
    animation: ec-pulse 1.5s infinite;
}
@keyframes ec-pulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.5; transform:scale(1.3); }
}

/* Fenêtre messages */
.evt-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    background: #f5f7fa;
    display: flex;
    flex-direction: column;
}
.evt-chat-messages::-webkit-scrollbar { width: 5px; }
.evt-chat-messages::-webkit-scrollbar-thumb { background: var(--ec-border); border-radius: 4px; }

.evt-chat-messages__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;   /* pousse vers le bas */
}
.evt-chat-messages__placeholder {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 14px;
    text-align: center;
}

/* Indicateur "X est en train d'écrire…" */
.evt-chat-typing {
    display: none;
    padding: 4px 16px 4px;
    font-size: 12px;
    color: #6b7c93;
    font-style: italic;
    background: #f5f7fa;
    border-top: 1px solid var(--ec-border);
    min-height: 24px;
}
.evt-chat-typing.is-active { display: block; }
.evt-chat-typing__dots span {
    display: inline-block;
    animation: ec-typing 1.4s infinite;
    opacity: 0;
}
.evt-chat-typing__dots span:nth-child(2) { animation-delay: .22s; }
.evt-chat-typing__dots span:nth-child(3) { animation-delay: .44s; }
@keyframes ec-typing {
    0%, 60%, 100% { opacity: 0; }
    30%           { opacity: 1; }
}

/* Badge messages non lus dans le header */
.evt-chat-unread-badge {
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 2px 7px;
    margin-left: 4px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
    animation: ec-pulse 1.5s infinite;
}

/* Bouton "charger plus" */
.evt-chat-load-more {
    align-self: center;
    margin-bottom: 10px;
    background: none;
    border: 1px solid var(--ec-primary-dim);
    color: var(--ec-primary-mid);
    border-radius: 20px;
    padding: 4px 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s;
}
.evt-chat-load-more:hover { background: var(--ec-primary-lt); }

/* ── Bulles de messages ─────────────────────────────────── */
.evt-chat-bubble {
    word-break: break-word;
    animation: ec-fadein .2s ease;
    display: flex;
    flex-direction: column;
}
@keyframes ec-fadein { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }

.evt-chat-bubble--sent  { align-self: flex-end;  align-items: flex-end;  width: fit-content; max-width: 72%; }
.evt-chat-bubble--recv  { align-self: flex-start; align-items: flex-start; width: fit-content; max-width: 72%; }

/* Ligne méta : auteur + heure + bouton supprimer (EN DEHORS de la bulle) */
.evt-chat-bubble__meta {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 2px;
    padding: 0 2px;
    flex-wrap: nowrap;
    max-width: 100%;
}
.evt-chat-bubble--sent .evt-chat-bubble__meta { flex-direction: row-reverse; }

.evt-chat-bubble__author {
    font-size: 11px;
    font-weight: 600;
    color: var(--ec-primary-mid);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}
.evt-chat-bubble__time {
    font-size: 10px;
    opacity: .6;
    white-space: nowrap;
    flex-shrink: 0;
    color: #888;
}

/* Bouton supprimer : discret, visible au survol de la bulle */
.evt-chat-msg__delete {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 1px;
    line-height: 1;
    opacity: 0;
    color: rgba(100,100,100,.7);
    transition: opacity .15s;
    flex-shrink: 0;
}
.evt-chat-bubble:hover .evt-chat-msg__delete { opacity: 1; }

.evt-chat-msg__edit-score {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    line-height: 1;
    opacity: 0;
    transition: opacity .15s;
    flex-shrink: 0;
}
.evt-chat-bubble:hover .evt-chat-msg__edit-score { opacity: 1; }
/* Curseur indiquant le double-clic sur les bulles match en cours */
.evt-chat-bubble--inprog { cursor: pointer; }

.evt-chat-delete-confirm {
    display: inline-block;
    background: #d93025;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    cursor: pointer;
    margin-left: 4px;
    vertical-align: middle;
    animation: evt-del-pop .12s ease;
    white-space: nowrap;
}
@keyframes evt-del-pop {
    from { transform: scale(.7); opacity: 0; }
    to   { transform: scale(1);  opacity: 1; }
}

.evt-chat-bubble__body {
    border-radius: var(--ec-radius);
    padding: 8px 12px;
    position: relative;
    line-height: 1.45;
    font-size: 17px;
}
.evt-chat-bubble--sent  .evt-chat-bubble__body {
    background: var(--ec-sent-bg);
    color: var(--ec-sent-text);
    border-bottom-right-radius: 3px;
}
.evt-chat-bubble--recv .evt-chat-bubble__body {
    background: var(--ec-recv-bg);
    color: var(--ec-recv-text);
    border-bottom-left-radius: 3px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Galerie photos dans bulle */
.evt-chat-bubble__gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.evt-chat-bubble__gallery img {
    width: 180px;
    height: 135px;
    object-fit: cover;
    border-radius: 6px;
    cursor: zoom-in;
    transition: opacity .3s, transform .15s;
    display: block;
    background: #e8edf2;
}
.evt-chat-bubble__gallery img:hover { opacity: .85; transform: scale(1.03); }

/*  Bulles score : Victoire (vert) / Bravo/podium (orange) / Défaite (rouge) */
.evt-chat-bubble--score-win,
.evt-chat-bubble--score-lose,
.evt-chat-bubble--score-defeat { align-self: initial; max-width: 100%; }
.evt-chat-bubble--score-win  .evt-chat-bubble__body {
    background: #14532d !important;
    color: #dcfce7 !important;
    border-radius: var(--ec-radius) !important;
    font-weight: 600;
}
.evt-chat-bubble--score-lose .evt-chat-bubble__body {
    background: #92400e !important;
    color: #fef3c7 !important;
    border-radius: var(--ec-radius) !important;
    font-weight: 600;
}
.evt-chat-bubble--score-defeat .evt-chat-bubble__body {
    background: #7f1d1d !important;
    color: #fee2e2 !important;
    border-radius: var(--ec-radius) !important;
    font-weight: 600;
}
.evt-chat-bubble--score-win    .evt-chat-bubble__time,
.evt-chat-bubble--score-lose   .evt-chat-bubble__time,
.evt-chat-bubble--score-defeat .evt-chat-bubble__time { color: rgba(255,255,255,.6); }
.evt-chat-bubble--score-win    .evt-chat-bubble__meta,
.evt-chat-bubble--score-lose   .evt-chat-bubble__meta,
.evt-chat-bubble--score-defeat .evt-chat-bubble__meta { justify-content: center; }

/* ── Zone identité : connexion WP + mode invité ─────────── */
.evt-chat-identity {
    position: absolute;
    inset: 0;
    z-index: 500;
    background: var(--ec-primary-lt);
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
    justify-content: center;
    max-height: none;
    border-top: none;
}
.evt-chat-login-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ec-primary);
    text-align: center;
    margin-bottom: 4px;
}
.evt-chat-login-subtitle {
    font-size: 12px;
    color: #6b7a8d;
    text-align: center;
    margin-bottom: 14px;
}
/* Formulaire connexion WP */
.evt-chat-wp-login {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.evt-chat-wp-login__input {
    width: 100%;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}
.evt-chat-wp-login__input:focus {
    border-color: var(--ec-primary-dim);
    box-shadow: 0 0 0 2px rgba(44,82,130,.15);
}
.evt-chat-login-error {
    font-size: 12px;
    color: #c0392b;
    background: #fff5f5;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 6px 10px;
    margin-top: 2px;
}
/* Séparateur ou */
.evt-chat-login-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9eaab8;
    font-size: 11px;
    margin: 12px 0;
}
.evt-chat-login-sep::before,
.evt-chat-login-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ec-border);
}
/* Mode invité : nouvelle disposition */
.evt-chat-pseudo-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.evt-chat-pseudo-form input {
    width: 100%;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    background: #fff;
}
.evt-chat-pseudo-form input:focus {
    border-color: var(--ec-primary-dim);
    box-shadow: 0 0 0 2px rgba(44,82,130,.15);
}
/* Variantes boutons */
.evt-chat-btn--full { width: 100%; justify-content: center; }
.evt-chat-btn--sm   { font-size: 12px; padding: 4px 12px; margin-top: 8px; align-self: center; }
.evt-chat-login-version {
    margin-top: 16px;
    text-align: center;
    font-size: 11px;
    color: #b0bec5;
    letter-spacing: .04em;
}

/* ── Zone de saisie ─────────────────────────────────────── */
.evt-chat-input-area {
    border-top: 1px solid var(--ec-border);
    background: #fff;
    padding: 6px 8px;
}

.evt-chat-previews {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
    align-items: flex-end;
}
.evt-chat-previews__count {
    width: 100%;
    font-size: 11px;
    color: var(--ec-primary-dim);
    font-weight: 600;
    margin-bottom: 2px;
}
/* État drag-over */
.evt-chat-input-area--dragover {
    background: var(--ec-primary-lt);
    border-top-color: var(--ec-primary-dim);
    outline: 2px dashed var(--ec-primary-dim);
    outline-offset: -3px;
}
.evt-chat-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
}
.evt-chat-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--ec-border);
}
.evt-chat-preview-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--ec-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

/* ── Reset WP thème pour la ligne de saisie ───────────────── */
/* S'assure que les styles du thème n'inføatent pas les boutons */
#evt-chat-app .evt-chat-input-row > button,
#evt-chat-app .evt-chat-input-row > label {
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    max-width: 38px !important;
    max-height: 38px !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    flex-shrink: 0 !important;
}
#evt-chat-app .evt-chat-input-row > textarea {
    box-sizing: border-box !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 8px 14px !important;
    margin: 0 !important;
    align-self: center !important;
}

.evt-chat-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.evt-chat-btn-icon {
    background: var(--ec-primary-lt);
    border: 1px solid var(--ec-border);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    transition: background .15s, border-color .15s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}
.evt-chat-btn-icon:hover { background: var(--ec-primary); border-color: var(--ec-primary); color: #fff; }

/* Variante bouton envoyer */
.evt-chat-btn-icon--send {
    background: var(--ec-primary);
    color: #fff;
    border-color: var(--ec-primary);
    font-size: 18px;
}
.evt-chat-btn-icon--send:hover {
    background: var(--ec-primary-mid);
    border-color: var(--ec-primary-mid);
    color: #fff;
}

.evt-chat-textarea {
    flex: 1;
    border: 1px solid var(--ec-border);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    line-height: 20px;
    height: 38px;
    min-height: 38px;
    max-height: 120px;
    overflow-y: hidden;
    transition: border-color .15s;
    box-sizing: border-box;
    display: block;
    vertical-align: middle;
}
.evt-chat-textarea:focus {
    border-color: var(--ec-primary-dim);
    box-shadow: 0 0 0 2px rgba(44,82,130,.12);
}

/* Boutons */
.evt-chat-btn { display: inline-flex; align-items: center; justify-content: center;
                padding: 7px 18px; border-radius: 20px; border: none;
                font-size: 13px; font-weight: 600; cursor: pointer; transition: filter .15s; }
.evt-chat-btn:hover { filter: brightness(.9); }
.evt-chat-btn--primary { background: var(--ec-primary); color: #fff; }
.evt-chat-btn--send    { background: var(--ec-primary); color: #fff;
                         display: flex; align-items: center; justify-content: center;
                         border-radius: 50%; width: 38px; height: 38px; padding: 0; font-size: 16px;
                         box-sizing: border-box; flex-shrink: 0; -webkit-appearance: none; appearance: none; margin: 0; }
.evt-chat-btn--ghost   { background: none; border: 1px solid var(--ec-border); color: #c0392b; font-size: 12px; }

.evt-chat-input-status {
    font-size: 11px;
    color: #c0392b;
    min-height: 16px;
    margin-top: 4px;
    padding: 0 4px;
}

/* ── Lightbox simple ────────────────────────────────────── */
.evt-chat-lightbox {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.evt-chat-lightbox img {
    max-width: 95%;
    max-height: 95%;
    border-radius: 6px;
    box-shadow: 0 4px 30px rgba(0,0,0,.5);
}
/* ── Galerie plein écran ────────────────────────────────────── */
.evt-chat-gallery-overlay {
    position: absolute;
    inset: 0;
    background: #111;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.evt-chat-gallery-overlay__topbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(0,0,0,.7);
    color: #fff;
    backdrop-filter: blur(4px);
}
.evt-chat-gallery-overlay__title {
    font-size: 13px;
    font-weight: 600;
    opacity: .9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    margin-right: 12px;
}
.evt-chat-gallery-overlay__close {
    background: rgba(255,255,255,.15);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s;
}
.evt-chat-gallery-overlay__close:hover { background: rgba(255,255,255,.3); }
.evt-chat-gallery-overlay__grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 20px;
}
.evt-chat-gallery-overlay__img {
    width: 100%;
    display: block;
    cursor: zoom-in;
    transition: opacity .15s;
}
.evt-chat-gallery-overlay__img:hover { opacity: .9; }
/* ── Responsive : mobile (<600px) ───────────────────────── */
@media (max-width: 600px) {
    .evt-chat-app { height: 100svh; border-radius: 0; border: none; }

    .evt-chat-sidebar {
        width: 100%;
        position: absolute;
        inset: 0;
        z-index: 2;
        transition: transform .25s ease;
    }
    /* Sur mobile : slide plutôt que collapse (sidebar est en overlay absolu) */
    .evt-chat-sidebar.is-hidden {
        width: 100%;
        min-width: unset;
        border-right-color: transparent;
        transform: translateX(-100%);
        pointer-events: none;
    }
    .evt-chat-main { width: 100%; }
    .evt-chat-bubble { max-width: 86%; }
}

/* ── Liste événements : groupes et items ───────────────── */
.evt-chat-event-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.evt-chat-group-header--ongoing {
    color: #1fa86a;
    font-weight: 800;
}
.evt-chat-group-header {
    padding: 6px 14px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--ec-primary-dim);
    background: var(--ec-sidebar-bg);
    border-top: 1px solid var(--ec-border);
    position: sticky;
    top: 0;
    z-index: 1;
}
.evt-chat-group-header:first-child { border-top: none; }

.evt-chat-event-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--ec-border);
    transition: background .15s;
}
.evt-chat-event-item:hover {
    background: var(--ec-primary-lt);
}
.evt-chat-event-item--active {
    background: var(--ec-primary-lt);
    border-left: 3px solid var(--ec-primary);
    padding-left: 11px;
}
.evt-chat-event-item__label {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: var(--ec-primary);
    line-height: 1.3;
}
.evt-chat-event-item__info {
    display: block;
    font-size: 11px;
    color: #6b7c93;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evt-chat-event-list__loading,
.evt-chat-event-list__empty,
.evt-chat-event-list__error {
    padding: 16px 14px;
    font-size: 13px;
    color: #6b7c93;
    list-style: none;
}
.evt-chat-event-list__error { color: #c0392b; }

/*  Badge nombre de messages  */
.evt-chat-event-item__row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.evt-chat-event-item__label {
    flex: 1;
    min-width: 0;
}
.evt-chat-event-item__live-dot {
    width: 7px; height: 7px;
    background: #6ee08a;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ec-pulse 1.5s infinite;
}
.evt-chat-badge {
    background: var(--ec-primary);
    color: #fff;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
    line-height: 16px;
}
.evt-chat-event-item--active .evt-chat-badge {
    background: var(--ec-gold);
    color: #fff;
}
.evt-chat-badge--unread {
    background: #e53935 !important;
    animation: ec-pulse 1.5s infinite;
}

/*  Panneau emoji  */
.evt-chat-emoji-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 6px;
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(26,58,92,.18);
    max-height: 180px;
    overflow-y: auto;
    margin-bottom: 6px;
}
.evt-chat-emoji {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 32px;
    padding: 5px 4px;
    border-radius: 6px;
    line-height: 1;
    transition: background .1s, transform .1s;
}
.evt-chat-emoji:hover { background: var(--ec-primary-lt); transform: scale(1.25); }

/* Mode emoji : cache textarea et bouton envoyer */
.evt-chat-input-area.is-emoji-mode .evt-chat-textarea,
.evt-chat-input-area.is-emoji-mode .evt-chat-btn--send {
    display: none;
}

/* Mode photo : cache textarea, garde bouton envoyer visible */
.evt-chat-input-area.is-photo-mode .evt-chat-textarea {
    display: none;
}

/* Loader upload dans preview */
.evt-chat-upload-loader {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ec-primary-dim);
    font-weight: 600;
    padding: 4px 2px;
    width: 100%;
}
.evt-chat-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--ec-primary-lt);
    border-top-color: var(--ec-primary);
    border-radius: 50%;
    animation: ec-spin .7s linear infinite;
    flex-shrink: 0;
}
@keyframes ec-spin { to { transform: rotate(360deg); } }

/* ── Bouton palmarès dans header ───────────────────────── */
.evt-chat-header__palmares-btn {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.3);
    color: #fff;
    font-size: 16px;
}
.evt-chat-header__palmares-btn:hover {
    background: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}

/* ── Overlay palmarès ──────────────────────────────────── */
.evt-chat-palmares-overlay {
    position: absolute; inset: 0;
    background: var(--ec-primary);
    overflow-y: auto;
    color: #fff;
    -webkit-overflow-scrolling: touch;
}
.evt-chat-palmares-overlay__topbar {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: rgba(26,58,92,.97);
    border-bottom: 1px solid rgba(255,255,255,.15);
    backdrop-filter: blur(4px);
}
.evt-chat-palmares-overlay__title {
    font-size: 15px; font-weight: 700; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    margin-right: 12px;
}
.evt-chat-palmares-overlay__topactions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.evt-chat-palmares-overlay__addbtn {
    background: var(--ec-gold); color: #fff; border: none;
    border-radius: 16px; padding: 5px 14px;
    font-size: 13px; font-weight: 700; cursor: pointer;
    transition: filter .15s;
}
.evt-chat-palmares-overlay__addbtn:hover { filter: brightness(.9); }
.evt-chat-palmares-overlay__content {
    padding: 16px; max-width: 700px; margin: 0 auto;
}
.evt-chat-palmares-overlay__empty {
    text-align: center; padding: 48px 16px; opacity: .55; font-size: 15px;
}
.evt-chat-palmares-section { margin-bottom: 28px; }
.evt-chat-palmares-section__header {
    font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .9px; opacity: .6;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 14px;
}
.evt-chat-palmares-section__empty { opacity: .5; font-size: 13px; padding: 8px 0; }
.evt-chat-palmares-group { margin-bottom: 18px; }
.evt-chat-palmares-group__title {
    font-size: 13px; font-weight: 700; color: var(--ec-gold);
    text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
}
.evt-chat-palmares-row {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,.07); border-radius: 10px;
    padding: 10px 12px; margin-bottom: 6px;
    transition: background .15s;
}
.evt-chat-palmares-row:hover { background: rgba(255,255,255,.11); }
.evt-chat-palmares-row__medal {
    width: 52px; height: 52px; object-fit: contain; flex-shrink: 0;
}
.evt-chat-palmares-row__medal-fallback {
    width: 52px; height: 52px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--ec-gold); border-radius: 50%;
    font-weight: 900; font-size: 14px; color: #fff;
}
.evt-chat-palmares-row__info { flex: 1; min-width: 0; }
.evt-chat-palmares-row__name {
    display: block; font-weight: 700; font-size: 14px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.evt-chat-palmares-row__meta {
    display: block; font-size: 11px; opacity: .6; margin-top: 2px;
}
.evt-chat-palmares-row__delete {
    background: none; border: 1px solid rgba(255,255,255,.25);
    color: rgba(255,255,255,.5); border-radius: 50%;
    width: 26px; height: 26px; cursor: pointer; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; padding: 0; line-height: 1; transition: all .15s;
}
.evt-chat-palmares-row__delete:hover {
    background: rgba(220,50,50,.4); border-color: #e74c3c; color: #fff;
}

/* Formulaire ajout palmarès */
.evt-chat-palmares-form { max-width: 460px; margin: 16px auto 0; }
.evt-chat-palmares-form__row { margin-bottom: 14px; }
.evt-chat-palmares-form__row label {
    display: block; font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .5px;
    opacity: .7; margin-bottom: 5px;
}
.evt-chat-palmares-form__select {
    width: 100%; padding: 9px 12px; border-radius: 8px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.1); color: #fff;
    font-size: 14px; outline: none;
    transition: border-color .15s, background .15s;
}
.evt-chat-palmares-form__select:focus {
    border-color: var(--ec-gold); background: rgba(255,255,255,.15);
}
.evt-chat-palmares-form__select option { background: #1a3a5c; color: #fff; }
/* Séparateur de section dans le formulaire */
.evt-chat-palmares-form__sep {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; opacity: .6;
    border-top: 1px solid rgba(255,255,255,.2);
    padding-top: 14px; margin: 6px 0 10px;
}
/* Séparateur "ou" entre dropdown et saisie libre */
.evt-chat-palmares-form__or {
    display: flex; align-items: center; gap: 8px;
    color: rgba(255,255,255,.5); font-size: 11px;
    margin: 4px 0 10px;
}
.evt-chat-palmares-form__or::before,
.evt-chat-palmares-form__or::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,.2);
}
.evt-chat-palmares-form__btns {
    display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end;
}
.evt-chat-palmares-form__btn {
    padding: 9px 24px; border-radius: 20px; border: none;
    font-size: 14px; font-weight: 700; cursor: pointer; transition: filter .15s;
}
.evt-chat-palmares-form__btn:disabled { opacity: .45; cursor: not-allowed; }
.evt-chat-palmares-form__btn--cancel {
    background: rgba(255,255,255,.12); color: #fff;
    border: 1px solid rgba(255,255,255,.2);
}
.evt-chat-palmares-form__btn--save { background: var(--ec-gold); color: #fff; }
.evt-chat-palmares-form__btn:not(:disabled):hover { filter: brightness(.88); }

/* ── Bouton plein écran ─────────────────────────────────── */
.evt-chat-header__fullscreen-btn {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.3);
    color: #fff;
    font-size: 15px;
}
.evt-chat-header__fullscreen-btn:hover {
    background: rgba(255,255,255,.35);
    border-color: rgba(255,255,255,.5);
    color: #fff;
}

/* Plein écran via API native */
.evt-chat-app:fullscreen,
.evt-chat-app:-webkit-full-screen {
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    border: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
}

/* Fallback CSS (iOS safari) */
.evt-chat-app--css-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
}

/*  Masquer le badge reCAPTCHA (ne s'affiche pas sur la page chat)  */
.grecaptcha-badge,
.rc-anchor-container,
div[class*='rc-anchor'] {
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ── Masquer la barre d'admin WordPress ─────────────────── */
#wpadminbar { display: none !important; }
html { margin-top: 0 !important; }
body { margin-top: 0 !important; }

/* ── Bouton @ ────────────────────────────────────────────── */
.evt-chat-at-btn {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -.5px;
    flex-shrink: 0;
}
.evt-chat-at-btn.is-active {
    color: var(--ec-gold);
    background: var(--ec-primary-lt);
    border-radius: 50%;
}

/* ── Panel tireurs (glisse depuis la droite) ─────────────── */
.evt-chat-tireurs-panel {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 340px;
    background: #fff;
    border-left: 1px solid var(--ec-border);
    z-index: 800;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -3px 0 12px rgba(0,0,0,.12);
    animation: ec-panel-in .18s ease;
}
@keyframes ec-panel-in {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}
.evt-chat-tireurs-panel__hdr {
    background: var(--ec-primary);
    color: #fff;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}
.evt-chat-tireurs-panel__hdr button {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    opacity: .8;
}
.evt-chat-tireurs-panel__hdr button:hover { opacity: 1; }
.evt-chat-tireurs-panel__list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.evt-chat-tireurs-panel__empty {
    padding: 16px;
    color: #888;
    font-size: 13px;
    text-align: center;
}
.evt-chat-tireurs-panel__item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--ec-border);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    color: var(--ec-primary);
    transition: background .12s;
}
.evt-chat-tireurs-panel__item small {
    font-size: 11px;
    font-weight: 400;
    color: #888;
}
.evt-chat-tireurs-panel__item:hover {
    background: var(--ec-primary-lt);
}

/* ── Popup score ─────────────────────────────────────────── */
/* ── Score Popup ──────────────────────────────────────── */
.evt-chat-score-popup {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.evt-chat-score-popup__box {
    background: #fff;
    border-radius: 14px;
    padding: 18px 16px 14px;
    width: 340px;
    max-width: calc(100% - 24px);
    max-height: 92%;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    position: relative;
}
.evt-chat-score-popup__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ec-primary);
    text-align: center;
    margin-bottom: 14px;
    padding-right: 28px;
}
.evt-chat-score-popup__section {
    margin-bottom: 14px;
}
.evt-chat-score-popup__section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--ec-primary-mid);
    margin-bottom: 7px;
}
/* Tours de tableau : boutons de sélection */
.evt-chat-score-popup__rounds {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
}
.evt-chat-score-popup__round-btn {
    padding: 5px 9px;
    border: 2px solid var(--ec-border);
    border-radius: 7px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    color: #555;
    transition: all .12s;
}
.evt-chat-score-popup__round-btn:hover { border-color: var(--ec-primary); color: var(--ec-primary); }
.evt-chat-score-popup__round-btn.is-selected {
    background: var(--ec-primary);
    border-color: var(--ec-primary);
    color: #fff;
}
/* Label Victoire / Défaite */
.evt-chat-score-popup__row-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 7px 0 4px;
}
.evt-chat-score-popup__row-label.is-win  { color: #1fa86a; }
.evt-chat-score-popup__row-label.is-lose { color: #d97706; }
/* Grille de boutons */
.evt-chat-score-popup__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.evt-chat-score-popup__btn {
    height: 34px;
    min-width: 44px;
    padding: 0 6px;
    border: 2px solid var(--ec-border);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .12s;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Petits boutons compacts pour les scores tableau 0–14 */
.evt-chat-score-popup__btn--sm {
    min-width: 28px;
    height: 28px;
    font-size: 11px;
    padding: 0;
    border-radius: 6px;
}
.evt-chat-score-popup__btn--win {
    border-color: #1fa86a;
    color: #1fa86a;
}
.evt-chat-score-popup__btn--win:hover:not(:disabled) {
    background: #1fa86a;
    color: #fff;
    transform: scale(1.08);
}
.evt-chat-score-popup__btn--lose {
    border-color: #c94040;
    color: #c94040;
}
.evt-chat-score-popup__btn--lose:hover:not(:disabled) {
    background: #c94040;
    color: #fff;
    transform: scale(1.08);
}
/* Boutons en attente de sélection de tableau */
.evt-chat-score-popup__btn.is-pending,
.evt-chat-score-popup__btn:disabled {
    opacity: .25;
    cursor: not-allowed;
    transform: none !important;
}
.evt-chat-score-popup__tab-scores { padding-top: 2px; }
.evt-chat-score-popup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .12s;
}
.evt-chat-score-popup__close:hover { background: #f0f0f0; color: #333; }
/* Bouton score pré-sélectionné (mode édition) */
.evt-chat-score-popup__btn.is-init-selected {
    box-shadow: 0 0 0 2px currentColor;
    opacity: 1 !important;
    font-weight: 800;
}
/* Confirmation d'envoi en mode édition */
.evt-chat-score-popup__edit-confirm {
    margin-top: 14px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid var(--ec-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    position: sticky;
    bottom: 0;
}
.evt-chat-score-popup__confirm-preview {
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    color: #1e293b;
    padding: 4px 0;
    word-break: break-word;
    border-bottom: 1px solid var(--ec-border);
    padding-bottom: 8px;
}
.evt-chat-score-popup__confirm-btn {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .12s;
}
.evt-chat-score-popup__confirm-btn--pub {
    background: var(--ec-primary);
    color: #fff;
}
.evt-chat-score-popup__confirm-btn--pub:hover { opacity: .88; }
.evt-chat-score-popup__confirm-btn--temp {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid var(--ec-border);
}
.evt-chat-score-popup__confirm-btn--temp:hover { background: #e2e8f0; }
@media (max-width: 400px) {
    .evt-chat-score-popup__box { width: 100%; max-width: 100%; border-radius: 14px 14px 0 0; }
    .evt-chat-score-popup { align-items: flex-end; }
}

/* ── Ligne avec avatar externe (score) ────────────────── */
.evt-chat-bubble-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    align-self: center !important;
    max-width: 92%;
}
.evt-chat-bubble__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,.4);
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    order: -1;
    transition: transform .15s;
}
.evt-chat-bubble__avatar:hover { transform: scale(1.08); }
/* Groupe d'avatars tireurs pour les scores d'équipe */
.evt-chat-bubble__team-av-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-shrink: 0;
    order: -1;
    cursor: pointer;
    height: 52px;
    padding: 0 4px;
}
.evt-chat-bubble__team-av-item {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: rgba(100,116,139,.5);
    flex-shrink: 0;
    box-shadow: 0 1px 5px rgba(0,0,0,.3);
    transition: transform .15s;
    position: relative;
}
.evt-chat-bubble__team-av-item + .evt-chat-bubble__team-av-item {
    margin-left: -13px;
}
.evt-chat-bubble__team-av-group:hover .evt-chat-bubble__team-av-item {
    transform: translateY(-4px) scale(1.07);
}
.evt-chat-bubble__team-av-more {
    background: rgba(71,85,105,.75);
    font-size: 11px;
    font-weight: 800;
}
/* Zoom avatar (lightbox ronde) */
.evt-chat-avatar-zoom {
    /* hérite position:absolute; inset:0; background; display:flex de .evt-chat-lightbox */
    overflow: hidden; /* confine les confettis dans l'overlay */
    flex-direction: column;
    gap: 24px;
}
/* Conteneur centré : photo + célébration */
.evt-chat-avatar-zoom__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    position: relative;
    z-index: 2;
}
.evt-chat-avatar-zoom__inner > img {
    width: min(300px, 60vw);
    height: min(300px, 60vw);
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 8px 48px rgba(0,0,0,.7);
    display: block;
}
/* ── Célébration avatar (score terminé) ──────────────── */
.evt-chat-confetti {
    position: absolute;
    top: 0;
    display: block;
    pointer-events: none;
    animation: ec-confetti-fall linear forwards;
    z-index: 6;
    opacity: .9;
}
@keyframes ec-confetti-fall {
    0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(105vh) rotate(720deg); opacity: 0; }
}
.evt-chat-avatar-celeb {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    pointer-events: none;
    z-index: 3;
}
.evt-chat-avatar-celeb__clap {
    font-size: 46px;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,.45));
    animation: ec-celeb-pop .45s cubic-bezier(.36,.07,.19,.97) forwards;
}
.evt-chat-avatar-celeb__medal {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ec-celeb-pop .55s .18s cubic-bezier(.36,.07,.19,.97) both;
}
.evt-chat-avatar-celeb__medal img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,.5));
}
.evt-chat-avatar-celeb__medal-fb {
    font-size: 72px;
    filter: drop-shadow(0 4px 14px rgba(0,0,0,.4));
    line-height: 1;
}
/* Texte d'encouragement dans l'animation */
.evt-chat-avatar-celeb__text {
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,.6);
    text-align: center;
    letter-spacing: .02em;
    animation: ec-celeb-pop .5s .3s both;
    pointer-events: none;
    z-index: 3;
    padding: 0 16px;
    line-height: 1.25;
}
.evt-chat-avatar-zoom__score-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 3;
    pointer-events: none;
}
.evt-chat-avatar-zoom__round-badge {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    padding: 3px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.22);
    color: #fff;
    backdrop-filter: blur(4px);
}
.evt-chat-avatar-zoom__score-text {
    font-size: 15px;
    color: rgba(255,255,255,.92);
    font-weight: 600;
    text-align: center;
    text-shadow: 0 1px 6px rgba(0,0,0,.65);
    max-width: 280px;
    word-break: break-word;
}
@keyframes ec-celeb-pop {
    0%   { transform: scale(0) rotate(-12deg); opacity: 0; }
    65%  { transform: scale(1.18) rotate(4deg); opacity: 1; }
    100% { transform: scale(1)    rotate(0deg); opacity: 1; }
}
/* Stats tireurs panel */
.evt-chat-tireurs-panel__item-meta {
    font-size: 11px;
    color: #5a7a9a;
    margin-top: 2px;
    letter-spacing: .01em;
}
.evt-chat-stat--win {
    font-weight: 700;
    color: #1a9e3f;
}
.evt-chat-stat--lose {
    font-weight: 700;
    color: #d93025;
}

/* ── Tireurs panel : wrap item + colonne d'actions ──────── */
.evt-chat-tireurs-panel__item-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 2px;
}
.evt-chat-tireurs-panel__item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ec-primary);
    white-space: normal;
    line-height: 1.3;
}
.evt-chat-tireurs-panel__item-recap {
    font-size: 11px;
    color: #5a7a9a;
    line-height: 1.4;
    letter-spacing: .01em;
}
.evt-chat-tireurs-panel__item-recap-day {
    font-weight: 700;
    color: var(--ec-primary-mid);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.evt-chat-tireurs-panel__item-wrap {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--ec-border);
}
.evt-chat-tireurs-panel__item-wrap .evt-chat-tireurs-panel__item {
    border-bottom: none;
    flex: 1;
    min-width: 0;
}
.evt-chat-tireurs-panel__actions {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-left: 1px solid var(--ec-border);
}
.evt-chat-tireurs-panel__cnt-btn {
    flex: 1;
    width: 46px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #888;
    transition: background .12s, color .12s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.evt-chat-tireurs-panel__cnt-btn + .evt-chat-tireurs-panel__cnt-btn {
    border-top: 1px solid var(--ec-border);
}
.evt-chat-tireurs-panel__cnt-btn:hover {
    background: var(--ec-primary-lt);
    color: var(--ec-primary);
}
.evt-chat-tireurs-panel__score-btn {
    font-size: 16px;
}

/* ── Compteur de touches (modal) ────────────────────── */
.evt-chat-touch-counter {
    position: absolute;
    inset: 0;
    background: rgba(10,20,40,.82);
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Plein écran — pas de clic possible en dehors */
}
.evt-chat-touch-counter__box {
    background: #fff;
    border-radius: 16px;
    padding: 20px 20px 16px;
    width: 360px;
    max-width: calc(100% - 16px);
    max-height: calc(100% - 16px);
    box-shadow: 0 8px 32px rgba(0,0,0,.22);
    position: relative;
    overflow-y: auto;
}
.evt-chat-touch-counter__title {
    font-weight: 700;
    font-size: 15px;
    color: var(--ec-primary);
    text-align: center;
    margin-bottom: 16px;
    padding-right: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.evt-chat-touch-counter__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--ec-border);
    flex-shrink: 0;
}
.evt-chat-touch-counter__grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}
.evt-chat-touch-counter__col {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}
.evt-chat-touch-counter__name {
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--ec-primary);
    border: none;
    border-bottom: 2px solid var(--ec-border);
    background: transparent;
    padding: 2px 0 4px;
    outline: none;
    width: 100%;
}
.evt-chat-touch-counter__name:focus { border-bottom-color: var(--ec-primary); }
.evt-chat-touch-counter__score {
    font-size: 56px;
    font-weight: 900;
    text-align: center;
    color: var(--ec-primary);
    line-height: 1;
    padding: 4px 0;
    transition: color .2s;
}
.evt-chat-touch-counter__score.is-win  { color: #1fa86a; }
.evt-chat-touch-counter__score.is-lose { color: #d97706; }
.evt-chat-touch-counter__btn-add {
    width: 100%;
    height: 56px;
    font-size: 32px;
    font-weight: 900;
    border: none;
    border-radius: 12px;
    background: #1fa86a;
    color: #fff;
    cursor: pointer;
    transition: transform .1s, background .1s;
    line-height: 1;
    user-select: none;
}
.evt-chat-touch-counter__btn-add:active { transform: scale(.94); background: #178a56; }
.evt-chat-touch-counter__btn-sub {
    width: 100%;
    height: 34px;
    font-size: 20px;
    font-weight: 700;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #f5f5f5;
    color: #666;
    cursor: pointer;
    transition: transform .1s, background .1s;
    line-height: 1;
    user-select: none;
}
.evt-chat-touch-counter__btn-sub:active { transform: scale(.96); background: #e0e0e0; }
.evt-chat-touch-counter__sep {
    font-size: 13px;
    font-weight: 700;
    color: #bbb;
    text-align: center;
    padding: 0 2px;
    align-self: center;
    margin-top: 34px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: relative;
}
.evt-chat-touch-counter__coach {
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 6px;
    font-size: 14px;
    padding: 2px 5px;
    cursor: pointer;
    transition: background .12s;
    line-height: 1.2;
}
.evt-chat-touch-counter__coach:hover { background: #f0f0f0; }
.evt-chat-touch-counter__coach-picker {
    display: none;
    flex-direction: column;
    gap: 3px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    z-index: 1001;
    min-width: 140px;
    margin-top: 2px;
    white-space: nowrap;
}
.evt-chat-touch-counter__coach-opt {
    background: none;
    border: none;
    text-align: left;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background .1s;
}
.evt-chat-touch-counter__coach-opt:hover { background: var(--ec-primary-lt); }
.evt-chat-coach-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.95);
    border: 1.5px solid rgba(0,0,0,.12);
    box-shadow: 0 1px 5px rgba(0,0,0,.15);
    font-size: 14px;
    flex-shrink: 0;
    align-self: center;
    position: relative;
    cursor: default;
}
.evt-chat-coach-badge::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    background: rgba(30,30,30,.88);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 100;
}
.evt-chat-coach-badge:hover::after { opacity: 1; }
.evt-chat-touch-counter__piste {
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 6px;
    color: #888;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 3px 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, color .12s;
}
.evt-chat-touch-counter__piste:hover { background: #f0f0f0; color: #444; }
.evt-chat-touch-counter__piste-picker {
    display: none;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border: 1px solid var(--ec-border);
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,.18);
    z-index: 1000;
    width: 180px;
    margin-top: 4px;
}
.evt-chat-touch-counter__piste-num {
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
    padding: 4px 2px;
    cursor: pointer;
    text-align: center;
    transition: background .1s, color .1s;
}
.evt-chat-touch-counter__piste-num:hover { background: var(--ec-primary); color: #fff; border-color: var(--ec-primary); }
.evt-chat-touch-counter__reset {
    display: block;
    width: 100%;
    padding: 8px;
    background: none;
    border: 1px solid var(--ec-border);
    border-radius: 8px;
    color: #888;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background .12s, color .12s;
}
.evt-chat-touch-counter__reset:hover { background: #f5f5f5; color: #333; }
.evt-chat-touch-counter__post {
    display: block;
    width: 100%;
    padding: 11px;
    background: var(--ec-primary);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .12s;
    margin-bottom: 8px;
}
.evt-chat-touch-counter__post:hover { opacity: .88; }
.evt-chat-touch-counter__fin {
    display: block;
    width: 100%;
    padding: 13px;
    background: #1fa86a;
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .12s, transform .1s;
    letter-spacing: .01em;
}
.evt-chat-touch-counter__fin:hover { opacity: .88; }
.evt-chat-touch-counter__fin:active { transform: scale(.97); }
.evt-chat-touch-counter__fin:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none !important;
}
/* Zone sélection tour de tableau */
.evt-chat-touch-counter__round-zone {
    margin-top: 4px;
}
.evt-chat-touch-counter__round-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--ec-primary);
    margin-bottom: 8px;
    text-align: center;
}
.evt-chat-touch-counter__round-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}

/* ── Réactions emoji sur messages ────────────────────────── */
.evt-chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
    min-height: 0;
}
.evt-chat-reaction {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 12px;
    padding: 1px 7px;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
    transition: transform .1s;
    user-select: none;
}
.evt-chat-reaction:hover { transform: scale(1.25); }
.evt-chat-reaction.is-mine {
    background: rgba(44, 82, 130, .18);
    border-color: rgba(44, 82, 130, .45);
    font-weight: 700;
}
.evt-chat-rxn-picker {
    position: fixed;
    z-index: 999999;
    background: #fff;
    border-radius: 14px;
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    width: 208px;
    box-shadow: 0 6px 24px rgba(0,0,0,.22);
    animation: evt-del-pop .12s ease;
}
.evt-chat-rxn-picker__btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .1s, transform .1s;
}
.evt-chat-rxn-picker__btn:hover { background: #f0f0f0; transform: scale(1.3); }
.evt-chat-rxn-picker__btn.is-active { background: #e8f4ea; }

/* Bouton trigger réaction */
.evt-chat-rxn-trigger {
    display: none;
    background: none;
    border: 1px solid rgba(0,0,0,.13);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    opacity: .7;
    transition: opacity .15s, transform .15s;
    vertical-align: middle;
}
.evt-chat-bubble:hover .evt-chat-rxn-trigger,
.evt-chat-bubble-row:hover .evt-chat-rxn-trigger { display: inline-flex; align-items: center; justify-content: center; }
.evt-chat-rxn-trigger:hover { opacity: 1; transform: scale(1.2); }

/* ── Bouton Répondre ─────────────────────────────────────── */
.evt-chat-reply-btn {
    display: none;
    background: none;
    border: 1px solid rgba(0,0,0,.13);
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-top: 4px;
    opacity: .7;
    transition: opacity .15s, transform .15s;
    vertical-align: middle;
}
.evt-chat-bubble:hover .evt-chat-reply-btn,
.evt-chat-bubble-row:hover .evt-chat-reply-btn { display: inline-flex; align-items: center; justify-content: center; }
.evt-chat-reply-btn:hover { opacity: 1; transform: scale(1.15); color: var(--ec-primary); }

/* ── Quote dans la bulle ─────────────────────────────────── */
.evt-chat-bubble__quote {
    border-left: 3px solid var(--ec-primary);
    padding: 4px 8px;
    margin-bottom: 6px;
    border-radius: 3px;
    background: rgba(0,0,0,.06);
    font-size: 11px;
    line-height: 1.4;
    max-height: 52px;
    overflow: hidden;
    cursor: pointer;
}
.evt-chat-bubble--sent .evt-chat-bubble__quote {
    border-left-color: rgba(255,255,255,.6);
    background: rgba(0,0,0,.15);
}
.evt-chat-bubble__quote-author {
    display: block;
    font-weight: 700;
    color: var(--ec-primary);
    margin-bottom: 2px;
}
.evt-chat-bubble--sent .evt-chat-bubble__quote-author { color: rgba(255,255,255,.85); }
.evt-chat-bubble__quote-text {
    display: block;
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Barre de réponse en cours dans la zone de saisie ─────── */
.evt-chat-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ec-primary-lt);
    border-left: 3px solid var(--ec-primary);
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px 4px 0 0;
}
.evt-chat-reply-bar__content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.evt-chat-reply-bar__author {
    font-weight: 700;
    color: var(--ec-primary);
    font-size: 11px;
}
.evt-chat-reply-bar__text {
    color: #6b7c93;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evt-chat-reply-bar__close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: #6b7c93;
    padding: 0 2px;
    flex-shrink: 0;
}

/* Surbrillance temporaire du message parent lors du scroll */
.evt-chat-bubble--highlight {
    animation: ec-highlight .6s ease 2;
}
@keyframes ec-highlight {
    0%, 100% { box-shadow: none; }
    50%       { box-shadow: 0 0 0 3px rgba(44,82,130,.5); }
}

/* 
   SCORE TEMPORAIRE COLLAPSED
 */
.evt-chat-score-collapsed {
    display: inline-flex;
    flex-direction: column;   /* timer en haut, puis corps */
    align-items: stretch;
    gap: 0;
    padding: 4px 8px 4px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,.04);
}
.evt-chat-score-collapsed__avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    cursor: zoom-in;
    transition: transform .15s;
    flex-shrink: 0;
}
.evt-chat-score-collapsed__avatar.is-win    { border-color: #1fa86a; box-shadow: 0 0 8px rgba(31,168,106,.45); }
.evt-chat-score-collapsed__avatar.is-lose   { border-color: #d97706; box-shadow: 0 0 8px rgba(217,119,6,.45); }
.evt-chat-score-collapsed__avatar.is-defeat { border-color: #dc2626; box-shadow: 0 0 8px rgba(220,38,38,.45); }
.evt-chat-score-collapsed__avatar:hover   { transform: scale(1.1); }
.evt-chat-score-collapsed__avatar--emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    background: rgba(255,255,255,.12);
    cursor: default;
}
.evt-chat-score-collapsed__avatar--equipe {
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.evt-chat-score-collapsed__avatar--equipe:hover {
    transform: scale(1.12);
    box-shadow: 0 0 14px rgba(99,102,241,.55);
}
/* Corps horizontal : avatar + info */
.evt-chat-score-collapsed__body {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
}
.evt-chat-score-collapsed__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.evt-chat-score-collapsed__score-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.evt-chat-score-collapsed__score-label.is-win    { color: #1a8c58; }
.evt-chat-score-collapsed__score-label.is-lose   { color: #b45309; }
.evt-chat-score-collapsed__score-label.is-defeat { color: #b91c1c; }
.evt-chat-score-collapsed__meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
}
.evt-chat-score-collapsed__pub-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 4px;
    opacity: .65;
    transition: opacity .15s;
    line-height: 1;
}
.evt-chat-score-collapsed__pub-btn:hover { opacity: 1; }
.evt-chat-score-collapsed__edit-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s;
}
.evt-chat-score-collapsed:hover .evt-chat-score-collapsed__edit-btn {
    opacity: 1;
    pointer-events: auto;
}
/* Barre de progression SCORE_TEMP */
.evt-chat-score-collapsed__timer {
    width: 100%;
    height: 3px;
    background: rgba(150,150,150,.12);
    border-radius: 2px;
    overflow: hidden;
    align-self: stretch;
    margin-bottom: 2px;
    flex-shrink: 0;
}
.evt-chat-score-collapsed__timer-fill {
    height: 100%;
    width: 100%;
    border-radius: 2px;
    transform-origin: left center;
    /* animation définie entièrement via JS inline (scaleX) */
}
@keyframes ec-timer-shrink {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* Bouton " Publier" inline dans une bulle score */
.evt-chat-msg__publish-score {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 3px;
    margin-left: 2px;
    opacity: .65;
    line-height: 1;
}
.evt-chat-msg__publish-score:hover { opacity: 1; }

/* Zone de confirmation fin de match */
.evt-chat-touch-counter__confirm-zone {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 8px 8px;
    align-items: stretch;
}
.evt-chat-touch-counter__confirm-preview {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    background: rgba(44,82,130,.08);
    border-radius: 8px;
    padding: 8px 10px;
    word-break: break-word;
}

/* 
   HISTORIQUE SCORES TIREUR
 */
.evt-chat-score-history__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 2px 4px;
    max-height: 60vh;
    overflow-y: auto;
}
.evt-chat-score-history__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 13px;
}
.evt-chat-score-history__row.is-win  { background: rgba(31,168,106,.12); }
.evt-chat-score-history__row.is-lose { background: rgba(217,119,6,.12); }
.evt-chat-score-history__content {
    flex: 1;
    word-break: break-word;
}
.evt-chat-score-history__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 11px;
    color: #7a869a;
}
.evt-chat-score-history__status {
    background: #f59e0b;
    color: #fff;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
}

/* 
   MODE INDIVIDUEL / �QUIPE (score popup + compteur)
 */
.evt-chat-mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}
.evt-chat-mode-toggle__btn {
    flex: 1;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.evt-chat-mode-toggle__btn.is-active {
    background: var(--ec-primary, #2c5282);
    color: #fff;
    border-color: var(--ec-primary, #2c5282);
}
.evt-chat-equipe-section {
    display: none;
}
.evt-chat-equipe-max {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 10px;
}
.evt-chat-equipe-max__btn {
    padding: 5px 14px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.evt-chat-equipe-max__btn.is-active {
    background: #1e40af;
    color: #fff;
    border-color: #1e40af;
}
.evt-chat-equipe-scores {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    margin: 10px 0;
}
.evt-chat-equipe-scores__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.evt-chat-equipe-scores__label {
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.evt-chat-equipe-scores__stepper {
    display: flex;
    align-items: center;
    gap: 6px;
}
.evt-chat-equipe-scores__val {
    min-width: 36px;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}
.evt-chat-equipe-scores__btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    border: 1px solid #cbd5e1;
    background: #f1f5f9;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: background .1s;
}
.evt-chat-equipe-scores__btn:hover { background: #e2e8f0; }
.evt-chat-equipe-vs {
    font-size: 14px;
    font-weight: 700;
    color: #94a3b8;
}
.evt-chat-equipe-send {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: #1d4ed8;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background .15s;
}
.evt-chat-equipe-send:hover { background: #1e40af; }
/* affichage du max score dans le compteur */
.evt-chat-touch-counter__mode-row {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
    justify-content: center;
}
.evt-chat-touch-counter__mode-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
}
.evt-chat-touch-counter__mode-btn.is-active {
    background: var(--ec-primary, #2c5282);
    color: #fff;
    border-color: transparent;
}
.evt-chat-touch-counter__maxscore-row {
    display: none;
    gap: 6px;
    justify-content: center;
    margin-bottom: 6px;
}
.evt-chat-touch-counter__maxscore-row.is-visible { display: flex; }
.evt-chat-touch-counter__maxscore-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.evt-chat-touch-counter__maxscore-btn.is-active {
    background: #1e40af;
    color: #fff;
    border-color: transparent;
}

/* ---- Score équipe : grille perdant ---- */
.evt-chat-equipe-lose-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0;
    justify-content: flex-start;
}
.evt-chat-equipe-lose-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}
.evt-chat-equipe-lose-btn:hover { background: #fee2e2; border-color: #fca5a5; }
.evt-chat-equipe-lose-btn.is-active { background: #dc2626; color: #fff; border-color: transparent; }
/* ---- Séparateur de jour ---- */
.evt-chat-day-sep {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #94a3b8;
    margin: 10px 8px;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: capitalize;
}
.evt-chat-day-sep::before,
.evt-chat-day-sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ---- Tireur avatar / initiales ---- */
.evt-chat-tireurs-panel__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    align-self: flex-start;
    display: block;
}
.evt-chat-tireurs-panel__avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .02em;
}

/* ---- Score history : entête jour ---- */
.evt-chat-score-history__day {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    text-transform: capitalize;
    padding: 8px 0 4px;
    border-top: 1px solid #e2e8f0;
    margin-top: 4px;
}
.evt-chat-score-history__day:first-child { border-top: none; margin-top: 0; }

/* ---- Score collapsed : heure ---- */
.evt-chat-score-collapsed__time {
    font-size: 10px;
    color: rgba(140,140,140,.9);
    line-height: 1.3;
    white-space: nowrap;
}

/* ---- Score équipe : select perdant ---- */
.evt-chat-equipe-lose-select {
    width: 100%;
    padding: 7px 10px;
    border-radius: 8px;
    border: 2px solid #fca5a5;
    background: #fff5f5;
    font-size: 14px;
    font-weight: 600;
    color: #dc2626;
    cursor: pointer;
    margin: 4px 0 8px;
    appearance: auto;
    -webkit-appearance: auto;
}
/* ---- Historique scores : boutons éditer/publier ---- */
.evt-chat-score-history__edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 0 2px;
    opacity: .6;
    transition: opacity .12s;
    line-height: 1;
    flex-shrink: 0;
}
.evt-chat-score-history__edit-btn:hover { opacity: 1; }
.evt-chat-score-history__del-btn       { color: #b91c1c; }
.evt-chat-score-history__del-btn:hover { color: #dc2626; }
.evt-chat-score-history__pub-btn       { color: #1d7a4a; }
.evt-chat-score-history__pub-btn:hover { color: #16a34a; }
.evt-chat-score-history__status--pub   { background: rgba(22,163,74,.15); color: #15803d; border-radius: 4px; padding: 0 4px; }

/* ── Classement final dans l'historique des scores ── */
.evt-chat-score-history__ranking {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    margin: 4px 0 8px;
    background: rgba(99,102,241,.07);
    border-radius: 8px;
    border: 1px solid rgba(99,102,241,.18);
    font-size: 13px;
    flex-wrap: wrap;
}
.evt-chat-score-history__ranking-icon { font-size: 17px; flex-shrink: 0; }
.evt-chat-score-history__ranking-lbl  { font-weight: 600; color: #374151; }
.evt-chat-score-history__ranking-val  { font-weight: 700; color: #1e293b; min-width: 58px; }
.evt-chat-score-history__ranking-sel  { border: 1px solid #d1d5db; border-radius: 5px; padding: 2px 6px; font-size: 12px; background: #fff; }
.evt-chat-score-history__ranking-hint { font-size: 11px; color: #9ca3af; }

/* ── Bouton équipes dans l'en-tête du panel tireurs ── */
.evt-chat-tireurs-panel__eq-btn {
    background: rgba(99,102,241,.1);
    border: 1px solid rgba(99,102,241,.25);
    border-radius: 6px;
    color: #4f46e5;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 8px;
    margin-right: 4px;
    white-space: nowrap;
    line-height: 1.4;
}
.evt-chat-tireurs-panel__eq-btn:hover { background: rgba(99,102,241,.18); }

/* ── Gestionnaire d'équipes ── */
.evt-chat-equipe-manager__list { margin-bottom:4px; }
.evt-chat-equipe-manager__list-hdr { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; padding-bottom:6px; border-bottom:1px solid rgba(0,0,0,.08); }
.evt-chat-equipe-manager__list-title { font-weight:700; font-size:13px; color:#374151; }
.evt-chat-equipe-manager__new-btn { background:rgba(99,102,241,.1); border:1px solid rgba(99,102,241,.25); border-radius:6px; color:#4f46e5; font-size:12px; font-weight:600; cursor:pointer; padding:4px 10px; transition:background .12s; }
.evt-chat-equipe-manager__new-btn:hover { background:rgba(99,102,241,.2); }
.evt-chat-equipe-manager__empty { font-size:13px; color:#888; text-align:center; padding:12px 0; }
.evt-chat-equipe-manager__row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,.07);
    flex-wrap: wrap;
}
.evt-chat-equipe-manager__name  { font-weight: 700; font-size: 13px; min-width: 60px; }
.evt-chat-equipe-manager__members { flex: 1; font-size: 11px; color: #666; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-chat-equipe-manager__btn { background:none; border:none; cursor:pointer; font-size:14px; padding:0 3px; opacity:.65; transition:opacity .12s; }
.evt-chat-equipe-manager__btn:hover { opacity:1; }
.evt-chat-equipe-manager__btn--del { color:#b91c1c; }
.evt-chat-equipe-manager__btn--del:hover { color:#dc2626; }
.evt-chat-equipe-manager__add { margin-top:10px; display:flex; flex-direction:column; gap:4px; }
.evt-chat-equipe-manager__edit { margin-top:12px; padding-top:10px; border-top:1px solid rgba(0,0,0,.1); display:flex; flex-direction:column; gap:6px; }
.evt-chat-equipe-manager__checks { display:flex; flex-wrap:wrap; gap:6px 12px; max-height:180px; overflow-y:auto; padding:4px 0; }
.evt-chat-equipe-manager__check-lbl { display:flex; align-items:center; gap:4px; font-size:12px; cursor:pointer; }

.evt-chat-equipe-manager__formzone {
    border-top: 1px solid rgba(0,0,0,.09);
    padding-top: 12px;
    margin-top: 8px;
}
/* Grille de sélection d'icône équipe */
.evt-chat-equipe-manager__icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.evt-chat-equipe-manager__icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: rgba(0,0,0,.05);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .12s, border-color .12s, background .12s;
    padding: 0;
    line-height: 1;
}
.evt-chat-equipe-manager__icon-btn:hover {
    transform: scale(1.15);
    background: rgba(99,102,241,.12);
}
.evt-chat-equipe-manager__icon-btn.is-selected {
    border-color: #6366f1;
    background: rgba(99,102,241,.18);
    transform: scale(1.1);
}

/* ── Label nom d'équipe dans la bulle réduite ── */
.evt-chat-score-collapsed__eq-label {
    display: block;
    font-size: 9px;
    font-weight: 700;
    text-align: center;
    line-height: 1.1;
    margin-top: 1px;
    letter-spacing: .02em;
}

/* ── Séparateur de section équipes dans le panel tireurs ── */
.evt-chat-tireurs-panel__section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6366f1;
    padding: 8px 12px 4px;
    border-top: 1px solid rgba(0,0,0,.08);
    margin-top: 4px;
}
.evt-chat-tireurs-panel__avatar--equipe {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: -.5px;
}

/* ── Profil équipe (lightbox grille) ── */
.evt-chat-team-profile {
    flex-direction: column;
    justify-content: center;
    padding: 16px;
}
.evt-chat-team-profile__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    position: relative;
    z-index: 2;
    max-width: 520px;
    width: 100%;
}
.evt-chat-team-profile__header {
    display: flex;
    align-items: center;
    gap: 12px;
    animation: ec-celeb-pop .45s cubic-bezier(.36,.07,.19,.97) forwards;
}
.evt-chat-team-profile__icon {
    font-size: 52px;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,.5));
}
.evt-chat-team-profile__name {
    font-size: 30px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,.7);
    letter-spacing: .02em;
}
.evt-chat-team-profile__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 12px;
    justify-content: center;
    max-width: 480px;
}
.evt-chat-team-profile__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    animation: ec-celeb-pop .45s both;
}
.evt-chat-team-profile__av-wrap {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,.65);
    flex-shrink: 0;
}
.evt-chat-team-profile__av-img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform .18s;
}
.evt-chat-team-profile__av-img:hover { transform: scale(1.06); }
.evt-chat-team-profile__av-ini {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 900;
    color: rgba(255,255,255,.9);
    text-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.evt-chat-team-profile__av-name {
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,.92);
    text-shadow: 0 1px 6px rgba(0,0,0,.7);
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.evt-chat-team-profile__empty {
    font-size: 14px;
    color: rgba(255,255,255,.7);
    text-align: center;
    padding: 12px 0;
}
.evt-chat-team-profile__hist-btn {
    background: rgba(255,255,255,.18);
    border: 1px solid rgba(255,255,255,.32);
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 20px;
    backdrop-filter: blur(6px);
    transition: background .15s;
    animation: ec-celeb-pop .5s .35s both;
}
.evt-chat-team-profile__hist-btn:hover { background: rgba(255,255,255,.28); }

/* ═══════════════════════════════
   BOUTON AIDE (HEADER)
═══════════════════════════════ */
.evt-chat-header__help-btn {
    background: rgba(255,255,255,.18);
    border-color: rgba(255,255,255,.3);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}
.evt-chat-header__help-btn:hover {
    background: rgba(255,255,255,.4);
    border-color: rgba(255,255,255,.6);
    color: #fff;
}

/* ═══════════════════════════════
   OVERLAY AIDE
═══════════════════════════════ */
.evt-chat-help-overlay {
    position: absolute;
    inset: 0;
    background: var(--ec-bg, #f4f6fb);
    z-index: 1200;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: ec-slide-up .22s both;
}
.evt-chat-help-overlay__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ec-primary, #1f5fa6);
    color: #fff;
    flex-shrink: 0;
}
.evt-chat-help-overlay__title {
    font-weight: 700;
    font-size: 15px;
}
.evt-chat-help-overlay__close {
    background: rgba(255,255,255,.2);
    border: 1px solid rgba(255,255,255,.35);
    color: #fff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    transition: background .15s;
}
.evt-chat-help-overlay__close:hover { background: rgba(255,255,255,.38); }
.evt-chat-help-overlay__content {
    flex: 1;
    overflow-y: auto;
    padding: 14px 14px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.evt-chat-help-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: #fff;
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    border: 1px solid rgba(0,0,0,.06);
}
.evt-chat-help-card__icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
    padding-top: 2px;
}
.evt-chat-help-card__body { flex: 1; min-width: 0; }
.evt-chat-help-card__title {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ec-primary, #1f5fa6);
    line-height: 1.3;
}
.evt-chat-help-card__text {
    margin: 0;
    font-size: 12px;
    color: #444;
    line-height: 1.55;
}
.evt-chat-help-card__text strong { color: #222; }
.evt-chat-help-card__text em {
    font-style: normal;
    background: #f0f4ff;
    border-radius: 4px;
    padding: 1px 4px;
    color: var(--ec-primary, #1f5fa6);
    font-size: 11px;
}
.evt-chat-help-overlay__footer {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    padding: 8px 0 4px;
}
/* 
   MODE LECTURE SEULE (readonly)
 */
.evt-chat-app--readonly .evt-chat-input-area,
.evt-chat-app--readonly .evt-chat-identity,
.evt-chat-app--readonly .evt-chat-sidebar__user,
.evt-chat-app--readonly .evt-chat-msg__delete,
.evt-chat-app--readonly .evt-chat-reply-btn,
.evt-chat-app--readonly .evt-chat-score-collapsed__pub-btn {
    display: none !important;
}
/* Bouton @ dans le header : masqué en mode normal (il est dans le footer),
   visible uniquement en readonly où le footer est caché */
#evt-chat-at-btn-hdr {
    display: none;
}
.evt-chat-app--readonly #evt-chat-at-btn-hdr {
    display: inline-flex;
}