:root 
{
    --page-bg: #0d6efd;
    --shell-bg: radial-gradient(circle at top, #111827 0, #020617 60%, #000 100%);
    --card-bg: #020617;
    --card-bg-soft: #030712;
    --border-soft: rgba(148, 163, 184, 0.25);
    --accent: #22d3ee;
    --accent-soft: rgba(34, 211, 238, .18);
    --accent-2: #a855f7;
    --accent-2-soft: rgba(168, 85, 247, .25);
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;

    --red: #f97373;
    --green: #22c55e;
    --blue: #3b82f6;

    --shadow: 0 24px 70px rgba(255, 255, 255, 0.85);
    --radius-xl: 1.4rem;
}

* { box-sizing: border-box; }

body 
{
    margin: 0;
    min-height: 100vh;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--page-bg);
    color: var(--text-main);
}

/* ==== BOXED SHELL ==== */

.rgb-shell 
{
    max-width: 1200px;
    margin: 2.5rem auto;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--shell-bg);
    box-shadow: var(--shadow);
    border: 1px solid rgba(15,23,42,.8);
}

/* ==== NAVBAR / MENUS ==== */

.rgb-navbar {
    padding: .65rem 1.5rem;
    background: rgba(15,23,42,0.95);
    border-bottom: 1px solid rgba(31,41,55,0.9);
}

.navbar-brand 
{
    display: flex;
    align-items: center;
    gap: .6rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    font-size: 20px;
}

.brand-logo 
{
    width: 60px;
    height: 50px;
    padding: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-inner 
{
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: left;
}

.brand-logo .brand-logo-inner img 
{
    width: 100%;
    height: auto;
}

.navbar-nav .nav-link 
{
    font-size: .86rem;
    padding-inline: .85rem;
    color: var(--text-muted);
}

.navbar-nav .nav-link.active 
{
    color: var(--accent);
    position: relative;
}

.navbar-nav .nav-link.active::after 
{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35rem;
    margin-inline: auto;
    width: 60%;
    height: 2px;
    border-radius: 999px;
    background: #9ca3af;
}

.navbar-nav .nav-link:hover 
{
    color: var(--text-main);
}

.navbar-user 
{
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.navbar-user .dropdown button span 
{
    margin: 0px 7px;
    font-size: 14px;
}

/* Avatar user circulaire */
.btn-user 
{
    width: 32px;
    height: 32px;
    border-radius: 999px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #22c55e;
    background: radial-gradient(circle at 0 0, #22c55e 0, #0f172a 55%);
    color: #e5e7eb;
    box-shadow:
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 10px 25px rgba(15, 23, 42, 0.9);
}

.btn-user i 
{
    font-size: 1rem;
}

.btn-user::after 
{          
    /* flèche Bootstrap */
    margin-left: 0.1rem;
}

.btn-user:hover,
.btn-user:focus 
{
    background: radial-gradient(circle at 0 0, #4ade80 0, #020617 60%);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.9),
        0 14px 30px rgba(15, 23, 42, 1);
}

/* Menu déroulant */
.user-menu 
{
    background: #020617;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 0.4rem 0;
    min-width: 210px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
}

.user-menu .dropdown-item 
{
    color: #e5e7eb;
    font-size: 0.9rem;
    padding: 0.55rem 1rem;
    display: flex;
    align-items: center;
}

.user-menu .dropdown-item i 
{
    font-size: 1rem;
}

.user-menu li hr.dropdown-divider
{
    border-top: 1px solid rgba(148, 163, 184, 0.35);
}

.user-menu .dropdown-item:hover,
.user-menu .dropdown-item:focus 
{
    background: #1f3057;
    color: #ffffff;
}

/* Déconnexion en rouge mais cohérente */
.user-menu .dropdown-item.text-danger
 {
    color: #f97373;
}

.user-menu .dropdown-item.text-danger:hover 
{
    color: #fecaca;
}

.navbar-user .dropdown-menu-end 
{
    left: 0;
    right: auto;
}

/* Bouton "Inviter" type pill + dégradé */
.btn-cta 
{
    border-radius: 999px;
    border: none;
    padding: 0.4rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.5);
}

.btn-cta:hover,
.btn-cta:focus 
{
    filter: brightness(1.08);
    box-shadow: 0 18px 40px rgba(59, 130, 246, 0.8);
}

/* ==== MAIN LAYOUT ==== */

.rgb-main 
{
    padding: 1.4rem 1.5rem 1.7rem;
}

.rgb-card 
{
    background: radial-gradient(circle at top left, rgba(148,163,184,.12), transparent 55%) var(--card-bg);
    border-radius: 1.1rem;
    border: 1px solid rgba(31,41,55,.9);
    box-shadow: 0 20px 45px rgba(0,0,0,.7);
}

.rgb-card-header 
{
    padding: .75rem 1rem .4rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .9rem;
}

.rgb-card-header i 
{
    color: var(--accent);
}

.rgb-card-body 
{
    padding: .45rem 1rem 1rem;
}

/* Bloc brand dans la navbar */
.rgb-brand 
{
    display: flex;             
    flex-direction: column;    
    align-items: flex-start;    
    gap: 0;
}

.rgb-brand .brand-logo-inner img
{
    width: 100%;
    height: auto;
    max-width: 60px;
}

.rgb-brand .brand-logo-inner span.brand-title
{
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-left: 7px;
}

/* Titre + slogan sous le titre */
.rgb-brand .brand-text 
{
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: center;         
}

.brand-tagline 
{       
    font-size: .7rem;
    color: #94a3b8;            
    margin-top: 2px;
}

/* ==== MENU LATÉRAL ==== */

.side-menu 
{
    padding-bottom: .6rem;
}

.side-menu-title 
{
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.side-menu .nav-link 
{
    border-radius: .75rem;
    font-size: .85rem;
    padding: .45rem .65rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    color: var(--text-muted);
}

.side-menu .nav-link i 
{
    font-size: 1rem;
    color: #ffffff;
}

.side-menu .nav-link.active 
{
    background: #1f3057;
    color: var(--accent);
    border: 1px solid rgba(34,211,238,.6);
}

.side-menu .nav-link:hover 
{
    background: rgba(15,23,42,.9);
    color: var(--text-main);
}

.side-menu-footer 
{
    margin-top: 1rem;
    padding: .6rem .7rem;
    border-radius: .9rem;
    background: linear-gradient(135deg, rgba(168,85,247,.2), rgba(30,64,175,.7));
    font-size: .78rem;
}

/* ==== INFOS SALLE ==== */

.room-info 
{
    margin-top: .9rem;
    padding: .55rem .7rem;
    border-radius: .9rem;
    background: rgba(15,23,42,.95);
    font-size: .8rem;
    color: var(--text-muted);
}

.dot-live 
{
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 9px rgba(34,211,238,.9);
    display: inline-block;
    margin-right: .25rem;
}

/* ==== JOUEURS (DANS CARTE DÉDIÉE EN BAS) ==== */

.players-card 
{
    margin-top: 1.1rem;
}

.players-list 
{
    display: flex;
    flex-direction: column;
    gap: .65rem;
    max-height: 260px;
    overflow-y: auto;
    padding-right: .2rem;
}

.player-item 
{
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem .75rem;
    border-radius: .9rem;
    background: var(--card-bg-soft);
    border: 1px solid rgba(31,41,55,.9);
}

.player-item .avatar 
{
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 600;
    color: #020617;
}

.player-item.red   .avatar { background: radial-gradient(circle at 25% 25%, #fee2e2, var(--red)); }
.player-item.green .avatar { background: radial-gradient(circle at 25% 25%, #dcfce7, var(--green)); }
.player-item.blue  .avatar { background: radial-gradient(circle at 25% 25%, #dbeafe, var(--blue)); }

.player-item.active 
{
    border-color: var(--accent-soft);
    box-shadow: 0 0 14px rgba(34,211,238,.4);
}

.player-meta 
{
    flex: 1;
    font-size: .8rem;
}

.player-name 
{
    display: flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
}

.player-status 
{
    color: var(--text-muted);
    font-size: .76rem;
}

.pill 
{
    border-radius: 999px;
    font-size: .72rem;
    padding: .1rem .5rem;
    border: 1px solid rgba(148,163,184,.4);
}

/* ==== STATS HAUTES ==== */

.stat-card 
{
    border-radius: 1rem;
    padding: .8rem 1rem;
    background: radial-gradient(circle at top left, rgba(56,189,248,.2), rgba(15,23,42,1));
    border: 1px solid rgba(30,64,175,.7);
}

.stat-label 
{
    font-size: .76rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
}

.stat-value 
{
    font-size: 1.25rem;
    font-weight: 600;
}

.stat-sub 
{
    font-size: .75rem;
    color: var(--text-muted);
}

/* ==== ZONE DE JEU ==== */

.game-card 
{
    margin-top: 1rem;
}

.game-header-line 
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .6rem;
}

.game-header-line h2 
{
    font-size: .96rem;
    margin: 0;
}

.game-header-line p 
{
    margin: 0;
    font-size: .78rem;
    color: var(--text-muted);
}

.game-actions 
{
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.status-pill 
{
    border-radius: 999px;
    font-size: .76rem;
    padding: .18rem .7rem;
    border: 1px solid rgba(34,211,238,.7);
    color: var(--accent);
}

.game-actions .btn-sm 
{
    border-radius: 999px;
    font-size: .78rem;
    padding: .22rem .7rem;
}

.game-stage-wrapper 
{
    display: flex;
    justify-content: center;
}

.game-stage 
{
    width: 100%;
    max-width: 900px; /* zone de jeu max 900px */
    aspect-ratio: 1 / 1;
    border-radius: 1.1rem;
    border: 1px solid rgba(34,211,238,.8);
    background:
        radial-gradient(circle at top, rgba(34,211,238,.12), transparent 55%),
        radial-gradient(circle at bottom, rgba(168,85,247,.12), transparent 60%),
        #020617;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(0,0,0,.9),
        0 0 60px rgba(15,23,42,1);
}

.game-stage::before 
{
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(37,99,235,.22) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(37,99,235,.22) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: .9;
    pointer-events: none;
}

.game-stage-inner 
{
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}

.game-stage-inner h3 
{
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    letter-spacing: .05em;
    margin-bottom: .4rem;
}

.game-stage-inner p 
{
    font-size: .88rem;
    color: var(--text-muted);
    max-width: 85%;
    margin-bottom: .9rem;
}

.rgb-dots 
{
    display: flex;
    gap: .45rem;
}

.rgb-dot 
{
    width: 18px;
    height: 18px;
    border-radius: 999px;
    box-shadow: 0 0 14px currentColor;
}

.rgb-dot.red   { color: var(--red);   background: var(--red); }
.rgb-dot.green { color: var(--green); background: var(--green); }
.rgb-dot.blue  { color: var(--blue);  background: var(--blue); }

/* --- Footer --- */

.rgb-footer 
{
    padding: 10px 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(to top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.6), transparent);
    box-shadow: 0 -10px 30px rgba(56, 189, 248, 0.25);
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    display: flex;
    align-items: center;
}

.rgb-footer-inner 
{
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    width: 100%;
    justify-content: space-between;
    font-size: 11px;
    line-height: 1.4;
    color: rgba(148, 163, 184, 0.85);
}

.rgb-footer-copy 
{
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-weight: 500;
    opacity: 0.9;
    font-size: 13px;
}

.rgb-footer-links 
{
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.rgb-footer-links a 
{
    color: rgba(96, 165, 250, 0.9); /* bleu néon léger */
    text-decoration: none;
    font-weight: 500;
}

.rgb-footer-links a:hover 
{
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.9);
}

.rgb-footer-separator 
{
    opacity: 0.4;
}

.scroll-top 
{
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 44px;
    height: 44px;
    border-radius: 999px;

    border: 1px solid rgba(56, 189, 248, 0.6);   /* cyan */
    background: radial-gradient(circle at 30% 0,
        #1d4ed8 0,
        #020617 55%,
        #000 100%);
    color: #e5f2ff;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;

    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition:
        opacity .25s ease,
        transform .25s ease,
        box-shadow .2s ease,
        border-color .2s ease,
        background .2s ease;
    z-index: 50; /* au-dessus du reste de l'UI */
}

.scroll-top:hover 
{
    border-color: rgba(96, 165, 250, 0.9);
    box-shadow: 0 0 26px rgba(59, 130, 246, 0.7);
    background: radial-gradient(circle at 30% 0,
        #2563eb 0,
        #020617 55%,
        #000 100%);
}

.scroll-top--visible 
{
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

@media (max-width: 767.98px) 
{
    .game-header-line 
    {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-stage-inner p 
    {
        max-width: 100%;
    }
}

@media (max-width: 991.98px) 
{
    .rgb-main 
    {
        padding: 1.2rem;
    }
}

/* === Responsive mobile === */ 
@media (max-width: 600px) 
{
    :root 
    {
        --page-bg: black;
    }

    .navbar-brand .brand-logo
    {
        width: 60px;
        height: 50px;
    }

    .rgb-shell 
    {
        margin: 0 auto;
        border-radius: 0px;
    }

    .navbar-toggler
    {
        position: absolute;
        right: 15px;
        top: 15px;
    }

    .navbar-brand .brand-tagline
    {
        display: inline-block;
        max-width: 230px;
        white-space: normal;
        line-height: 1.3;
        font-size: 11px;
        text-align: left;
    }

    .rgb-footer .rgb-footer-inner
    {
        justify-content: center;
        flex-direction: column;
    }

    .rgb-footer .rgb-footer-inner .rgb-footer-copy
    {
        margin-bottom: 5px;
        text-align: center;
    }

    .rgb-footer .rgb-footer-links
    {
        justify-content: center;
    }
}