/* ============================================================
   LaSpecial — Mes groupes (espace social persistant)
   ============================================================ */
:root {
    --bg-dark: #07030f;
    --card-bg: #1c1326;
    --card-border: rgba(255, 255, 255, 0.08);
    --gold: #FFD700;
    --gradient-fire: linear-gradient(135deg, #FF7A00 0%, #FF004D 50%, #7000FF 100%);
    --muted: #907d9e;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }

body {
    margin: 0;
    font-family: 'Fredoka', sans-serif;
    background: var(--bg-dark);
    background-image:
        radial-gradient(circle at 18% 6%, rgba(178, 0, 255, 0.22), transparent 55%),
        radial-gradient(circle at 82% 96%, rgba(255, 0, 77, 0.18), transparent 55%),
        linear-gradient(180deg, #14082a 0%, #07030f 100%);
    background-attachment: fixed;
    color: #fff;
    min-height: 100dvh;
}
#app {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}
#app > section { display: flex; flex-direction: column; flex: 1; }

/* ---------- HEADER ---------- */
.gp-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 8px;
    gap: 12px;
}
.gp-back, .gp-add-btn, .gp-icon-btn {
    width: 42px; height: 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 13px;
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: transform 0.1s, background 0.15s;
    font-family: inherit;
}
.gp-back:active, .gp-add-btn:active, .gp-icon-btn:active { transform: scale(0.92); }
.gp-add-btn {
    background: var(--gradient-fire);
    border: none;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 0, 77, 0.35);
}
.gp-title {
    flex: 1;
    margin: 0;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hl {
    background: var(--gradient-fire);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
}
.gp-spacer { width: 42px; flex-shrink: 0; }

/* Header dans la vue groupe (avec titre custom) */
.gp-header-group { padding: 14px 16px 12px; }
.gp-group-title-wrap { flex: 1; min-width: 0; text-align: center; }
.gp-group-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-group-meta { margin: 2px 0 0; color: var(--muted); font-size: 0.78rem; }

/* ---------- MAIN ---------- */
.gp-main {
    flex: 1;
    padding: 6px 16px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
body.ls-has-bottom-nav .gp-main {
    padding-bottom: calc(28px + 76px + env(safe-area-inset-bottom));
}

/* ---------- CARDS ---------- */
.gp-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.gp-card-head {
    display: flex; align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.gp-card-head h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex; align-items: center; gap: 8px;
}
.gp-card-head h3 i { color: var(--gold); font-size: 0.9rem; }
.gp-card-sub { margin: 0 0 14px; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.gp-count {
    background: rgba(255, 215, 0, 0.18);
    color: var(--gold);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.gp-big-icon {
    display: block;
    text-align: center;
    font-size: 2.6rem;
    background: linear-gradient(135deg, #FFD700, #FF8A00);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    margin-bottom: 12px;
}
.gp-empty {
    text-align: center;
    padding: 28px 22px;
}
.gp-empty h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 900; text-transform: uppercase; }
.gp-empty p { margin: 0 0 18px; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }

.gp-cta {
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 8px;
    padding: 14px 22px;
    background: var(--gradient-fire);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-weight: 900;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    box-shadow: 0 6px 0 #3a0052;
    width: 100%;
}
.gp-cta:active { transform: translateY(4px); box-shadow: 0 2px 0 #3a0052; }

/* ---------- FORM NOUVEAU GROUPE (inline) ---------- */
.gp-new-form {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.1), rgba(255, 0, 77, 0.06));
    border: 1px dashed rgba(255, 122, 0, 0.4);
    border-radius: 18px;
    padding: 16px;
    display: flex; flex-direction: column;
    gap: 12px;
    animation: gp-slide 0.22s ease;
}
@keyframes gp-slide {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
.gp-new-head {
    display: flex; align-items: center; justify-content: space-between;
}
.gp-new-head h3 {
    margin: 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--gold);
    letter-spacing: 1.2px;
    font-weight: 800;
}
.gp-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 12px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
}
.gp-input:focus { outline: 2px solid var(--gold); }

.gp-color-picker {
    display: flex; gap: 8px; flex-wrap: wrap;
}
.gp-swatch {
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    padding: 0;
    transition: transform 0.1s;
}
.gp-swatch:active { transform: scale(0.92); }
.gp-swatch.is-active {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4);
}

.gp-feedback {
    margin: 0;
    font-size: 0.86rem;
    text-align: center;
    color: var(--muted);
}
.gp-feedback.err { color: #ff6b6b; }
.gp-feedback.ok { color: #86efac; }

/* ---------- LISTE GROUPES ---------- */
.gp-groups-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gp-group-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    padding: 14px 14px 14px 18px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: #fff;
    display: flex; align-items: center; gap: 12px;
    transition: transform 0.1s, border-color 0.15s, background 0.15s;
    font-family: inherit;
    text-align: left;
    width: 100%;
}
.gp-group-card:active { transform: scale(0.985); }
.gp-group-card:hover { border-color: rgba(255, 215, 0, 0.35); }
.gp-group-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 5px; height: 100%;
    background: var(--gc, var(--gold));
}
.gp-group-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.gp-group-card-name { font-weight: 800; font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-group-card-meta { font-size: 0.74rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.gp-avatars { display: flex; align-items: center; }
.gp-avatars > .gp-mini-avatar + .gp-mini-avatar { margin-left: -6px; }
.gp-mini-avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid var(--card-bg);
    background: var(--gradient-fire);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 900;
    display: inline-flex; align-items: center; justify-content: center;
}
.gp-mini-avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.gp-mini-avatar.more { background: rgba(255, 255, 255, 0.14); color: var(--muted); font-size: 0.6rem; }
.gp-arrow {
    color: var(--muted);
    font-size: 0.95rem;
    flex-shrink: 0;
}

/* ============================================================
   SUB-TABS (Conversations / Mes groupes) sur listView
   ============================================================ */
.gp-sub-tabs {
    display: flex;
    gap: 6px;
    padding: 8px 16px 0;
}
.gp-sub-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--muted);
    padding: 10px 8px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center; justify-content: center;
    gap: 6px;
    position: relative;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.gp-sub-tab i { font-size: 0.82rem; }
.gp-sub-tab.is-active {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(255, 0, 77, 0.10));
    color: #fff;
    border-color: rgba(255, 0, 77, 0.4);
}
.gp-sub-tab-badge {
    background: #FF004D;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 1px 7px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(255, 0, 77, 0.4);
}
.gp-sub-pane { display: none; flex-direction: column; gap: 14px; }
.gp-sub-pane.is-active { display: flex; }

/* ============================================================
   LISTE CONVERSATIONS
   ============================================================ */
.gp-conv-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gp-conv-row {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    color: #fff;
    text-decoration: none;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: transform 0.1s, border-color 0.15s, background 0.15s;
    position: relative;
}
.gp-conv-row:active { transform: scale(0.985); }
.gp-conv-row:hover { border-color: rgba(0, 229, 255, 0.35); }
.gp-conv-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.gp-conv-avatar {
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--gradient-fire);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 0.92rem;
}
.gp-conv-avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.gp-conv-online-dot {
    position: absolute;
    bottom: 0; right: 0;
    width: 12px; height: 12px;
    background: #22c55e;
    border: 2px solid var(--card-bg);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}
.gp-conv-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.gp-conv-name {
    font-weight: 800;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.gp-conv-preview {
    color: var(--muted);
    font-size: 0.82rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gp-conv-preview.is-unread { color: #fff; font-weight: 700; }
.gp-conv-preview.is-mine::before { content: 'Toi : '; color: var(--muted); font-weight: 400; }
.gp-conv-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}
.gp-conv-time {
    font-size: 0.7rem;
    color: var(--muted);
}
.gp-conv-unread {
    background: #FF004D;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(255, 0, 77, 0.45);
}
.gp-conv-empty {
    padding: 30px 22px;
    text-align: center;
}
.gp-conv-empty p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ---------- TABS DANS LA VUE GROUPE ---------- */
.gp-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 14px;
    padding: 4px;
}
.gp-tab {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 10px 6px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}
.gp-tab i { font-size: 0.78rem; }
.gp-tab.is-active {
    background: var(--gradient-fire);
    color: #fff;
}
.gp-pane { display: none; flex-direction: column; gap: 14px; }
.gp-pane.is-active { display: flex; }

/* Membres list dans le groupe */
.gp-members-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 8px;
}
.gp-member-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}
.gp-member-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient-fire);
    color: #fff;
    font-weight: 800;
    font-size: 0.82rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.gp-member-avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.gp-member-avatar.is-admin { box-shadow: inset 0 0 0 2px rgba(0, 229, 255, 0.6); }
.gp-member-name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-member-tag {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.4px;
}
.gp-member-tag.owner { background: rgba(255, 215, 0, 0.18); color: var(--gold); }
.gp-member-tag.me { background: rgba(0, 229, 255, 0.15); color: #00E5FF; }

/* Game grid dans launcher */
.gp-game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.gp-game-tile {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 14px 8px;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    transition: transform 0.1s, border-color 0.15s, background 0.15s;
}
.gp-game-tile:active { transform: scale(0.95); }
.gp-game-tile:hover { border-color: rgba(255, 215, 0, 0.45); background: rgba(255, 215, 0, 0.04); }
.gp-game-emoji { font-size: 1.8rem; line-height: 1; margin-bottom: 4px; }
.gp-game-name { font-weight: 800; font-size: 0.84rem; line-height: 1.1; }
.gp-game-tag { font-size: 0.66rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
   Banner "partie en cours" (rejoindre)
   ============================================================ */
.gp-active-banner {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(255, 0, 77, 0.10));
    border: 1px solid rgba(255, 0, 77, 0.45);
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(255, 0, 77, 0.15);
    animation: gp-active-pulse 2.5s ease-in-out infinite;
}
@keyframes gp-active-pulse {
    0%, 100% { box-shadow: 0 6px 20px rgba(255, 0, 77, 0.15); }
    50%      { box-shadow: 0 6px 24px rgba(255, 0, 77, 0.3); }
}
.gp-active-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.gp-active-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.gp-active-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp-active-text strong { font-weight: 800; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-active-text small { font-size: 0.72rem; color: #cab5e6; }
.gp-active-actions { display: flex; gap: 6px; flex-shrink: 0; }
.gp-active-btn {
    border: none;
    padding: 8px 14px;
    border-radius: 999px;
    font-family: inherit;
    font-weight: 800; font-size: 0.82rem;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: transform 0.1s;
}
.gp-active-btn:active { transform: scale(0.95); }
.gp-active-resume {
    background: var(--gradient-fire);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 0, 77, 0.35);
}
.gp-active-end {
    background: rgba(255, 0, 77, 0.12);
    color: #ff6b6b;
    width: 32px; height: 32px;
    padding: 0;
}

/* ============================================================
   CHAT DE GROUPE (phase 2 — fonctionnel)
   ============================================================ */
.gp-chat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: min(60dvh, 480px);
}
.gp-chat-status {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}
.gp-chat-status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #6b7280;
    box-shadow: 0 0 6px rgba(107, 114, 128, 0.5);
    flex-shrink: 0;
}
.gp-chat-status.is-online .gp-chat-status-dot {
    background: #22c55e;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
    animation: gp-pulse 2s ease-in-out infinite;
}
.gp-chat-status.is-error .gp-chat-status-dot { background: #ff6b6b; }
@keyframes gp-pulse { 50% { transform: scale(1.2); } }

.gp-chat-messages {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
}
.gp-chat-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    font-style: italic;
    padding: 24px 12px;
}

.gp-chat-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    max-width: 88%;
}
.gp-chat-msg.is-me { flex-direction: row-reverse; align-self: flex-end; }
.gp-chat-msg-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--gradient-fire);
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.gp-chat-msg-avatar.has-image { background-size: cover; background-position: center; color: transparent; }
.gp-chat-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px 14px 14px 4px;
    padding: 8px 12px;
    display: flex; flex-direction: column;
    gap: 2px;
    min-width: 0;
    position: relative;
}
.gp-chat-report-btn {
    position: absolute; top: 4px; right: -28px;
    background: transparent; border: none; color: var(--muted, #907d9e);
    width: 22px; height: 22px; border-radius: 50%;
    cursor: pointer; opacity: 0; transition: opacity 0.15s, color 0.15s, background 0.15s;
    font-size: 0.72rem;
}
.gp-chat-msg:hover .gp-chat-report-btn,
.gp-chat-report-btn:focus { opacity: 1; }
.gp-chat-report-btn:hover { color: #ff7a93; background: rgba(255, 122, 147, 0.12); }
@media (hover: none) {
    .gp-chat-report-btn { opacity: 0.55; right: 4px; top: 4px; }
    .gp-chat-msg-bubble { padding-right: 28px; }
}
.gp-chat-msg.is-me .gp-chat-msg-bubble {
    background: linear-gradient(135deg, rgba(255, 122, 0, 0.18), rgba(255, 0, 77, 0.12));
    border-radius: 14px 14px 4px 14px;
}
.gp-chat-msg-author {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--gold);
}
.gp-chat-msg.is-me .gp-chat-msg-author { display: none; }
.gp-chat-msg-content {
    font-size: 0.92rem;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.gp-chat-msg-time {
    font-size: 0.66rem;
    color: var(--muted);
    align-self: flex-end;
    margin-top: 2px;
}

/* Message système (kind='system') */
.gp-chat-msg.is-system {
    align-self: center;
    max-width: 100%;
}
.gp-chat-msg.is-system .gp-chat-msg-avatar { display: none; }
.gp-chat-msg.is-system .gp-chat-msg-bubble {
    background: rgba(255, 215, 0, 0.08);
    border: 1px dashed rgba(255, 215, 0, 0.3);
    color: var(--muted);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 0.78rem;
}
.gp-chat-msg.is-system .gp-chat-msg-content { color: var(--gold); font-weight: 700; }
.gp-chat-msg.is-system .gp-chat-msg-author,
.gp-chat-msg.is-system .gp-chat-msg-time { display: none; }

.gp-chat-form {
    display: flex;
    gap: 8px;
}
.gp-chat-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    padding: 11px 14px;
    color: #fff;
    font-family: inherit;
    font-size: 0.92rem;
}
.gp-chat-input:focus { outline: 2px solid var(--gold); }
.gp-chat-input:disabled { opacity: 0.5; }
.gp-chat-send {
    width: 44px;
    background: var(--gradient-fire);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #3a0052;
}
.gp-chat-send:active { transform: translateY(4px); box-shadow: 0 0 0 #3a0052; }
.gp-chat-send:disabled { opacity: 0.5; box-shadow: 0 4px 0 #3a0052; cursor: not-allowed; }

/* ============================================================
   SCORES (phase 2 — leaderboard + historique)
   ============================================================ */
.gp-scores-filter {
    display: flex; gap: 6px;
    overflow-x: auto;
    padding: 2px;
    scrollbar-width: none;
}
.gp-scores-filter::-webkit-scrollbar { display: none; }
.gp-filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #cab5e6;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gp-filter-btn:active { transform: scale(0.95); }
.gp-filter-btn.is-active {
    background: var(--gradient-fire);
    color: #fff;
    border-color: transparent;
}

.gp-leaderboard {
    list-style: none;
    margin: 0; padding: 0;
    display: flex; flex-direction: column;
    gap: 6px;
    counter-reset: rank;
}
.gp-leaderboard li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    counter-increment: rank;
}
.gp-leaderboard li::before {
    content: counter(rank);
    width: 26px; height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.gp-leaderboard li:first-child::before { background: var(--gradient-fire); color: #fff; }
.gp-leaderboard li:nth-child(2)::before { background: linear-gradient(135deg, #C0C0C0, #808080); color: #fff; }
.gp-leaderboard li:nth-child(3)::before { background: linear-gradient(135deg, #CD7F32, #8B4513); color: #fff; }
.gp-lb-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-lb-stats { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.gp-lb-stat { display: flex; flex-direction: column; align-items: center; }
.gp-lb-stat-val { font-weight: 900; font-size: 0.92rem; color: var(--gold); }
.gp-lb-stat-lbl { font-size: 0.6rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.gp-scores-empty {
    color: var(--muted);
    text-align: center;
    padding: 20px 12px;
    font-style: italic;
    font-size: 0.88rem;
}

.gp-results-list {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-direction: column; gap: 6px;
}
.gp-results-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    font-size: 0.85rem;
}
.gp-res-game {
    font-size: 1.2rem;
    flex-shrink: 0;
}
.gp-res-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gp-res-line {
    font-weight: 700;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gp-res-line .winner { color: var(--gold); }
.gp-res-time { font-size: 0.7rem; color: var(--muted); }

/* Placeholder chat / scores */
.gp-chat-placeholder { text-align: center; padding: 32px 22px; }
.gp-chat-placeholder h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 900; text-transform: uppercase; }
.gp-chat-placeholder p { margin: 0 0 14px; color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.gp-soon-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.15);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.6px;
}

/* ---------- LOADING ---------- */
.gp-loading {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 14px;
    color: var(--muted);
    padding: 60px 20px;
}
.gp-spinner {
    width: 38px; height: 38px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: gp-spin 0.9s linear infinite;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }

/* ---------- MODAL ÉDITION ---------- */
.gp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: gp-fade 0.18s ease;
}
@keyframes gp-fade { from { opacity: 0; } to { opacity: 1; } }
.gp-modal-content {
    background: linear-gradient(160deg, #1c1326 0%, #14082a 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    width: 100%;
    max-width: 440px;
    max-height: 90dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: gp-pop 0.22s cubic-bezier(0.2, 0.8, 0.2, 1.05);
}
@keyframes gp-pop {
    from { transform: translateY(20px) scale(0.94); opacity: 0; }
    to   { transform: translateY(0) scale(1);    opacity: 1; }
}
.gp-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.gp-modal-head h3 { margin: 0; font-size: 1.05rem; font-weight: 900; }
.gp-modal-close {
    width: 32px; height: 32px;
    background: rgba(255, 255, 255, 0.06);
    border: none; color: #fff;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
}
.gp-modal-close:active { transform: scale(0.92); }
.gp-modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.gp-modal-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 800;
}
.gp-edit-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gp-edit-members li {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}
.gp-edit-members .name { flex: 1; font-size: 0.9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-edit-members .remove {
    background: rgba(255, 0, 77, 0.12);
    color: #ff6b6b;
    border: none;
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
}
.gp-edit-members .owner-tag {
    background: rgba(255, 215, 0, 0.18);
    color: var(--gold);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
}

.gp-modal-foot {
    display: flex; gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.gp-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.gp-btn:active { transform: scale(0.96); }
.gp-btn-primary {
    background: var(--gradient-fire);
    color: #fff;
}
.gp-btn-danger {
    background: rgba(255, 0, 77, 0.15);
    color: #ff6b6b;
    border: 1px solid rgba(255, 0, 77, 0.4);
}
