:root {
    /* Fond & panneaux */
    --bg: #0f1115;
    --bg-grad1: #11151c;
    --bg-grad2: #0c0f14;

    /* Traits & texte */
    --border: #2a3140;
    --hoverBorder: #3a4559;

    --text: #E7E9ED;
    --muted: #8c95a3;
    --navText: #E9ECF4;

    /* Accents */
    --accent: #6ea8ff;
    
    /* Halo discret */
    --glow: rgba(110, 168, 255, .12);
}

:root[data-theme="light"] {
    --bg: #f5f5f5;
    --bg-grad1: #ffffff;
    --bg-grad2: #e0e0e0;

    --border: #cccccc;
    --hoverBorder: #bbbbbb;

    --text: #1a1a1a;
    --muted: #6b6b6b;
    --navText: #1a1a1a;

    --accent: #6ea8ff;

    --glow: rgba(110, 168, 255, .2);
}

:root[data-theme="dark"] {
    --bg: #0f1115;
    --bg-grad1: #11151c;
    --bg-grad2: #0c0f14;

    /* Traits & texte */
    --border: #2a3140;
    --hoverBorder: #3a4559;

    --text: #E7E9ED;
    --muted: #8c95a3;
    --navText: #E9ECF4;

    /* Accents */
    --accent: #6ea8ff;
    
    /* Halo discret */
    --glow: rgba(110, 168, 255, .12);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(1200px 560px at 75% -15%, var(--glow), transparent 60%),
        linear-gradient(180deg, var(--bg-grad1), var(--bg-grad2));
    /* MÊME POLICE QUE ADMIN */
    font: 14px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: var(--text);
}

/* -------------------------------
   Marge principale pour le contenu
-------------------------------- */
body > main {
    margin-top: 6rem;
    margin-left: 1%;
    margin-right: 1%;
    font-size: clamp(14px, .9vw + 12px, 16px);
}

/* ==========================================
   HEADER PRINCIPAL
   ========================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    height: 5rem;
    width: 100%;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 0 2%;
}

/* Logo GameLink (à gauche) */
header .logo {
    height: 2.5rem;
    width: auto;
    display: block;
}

/* Menu de navigation */
.Menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Liens du menu */
.Menu a {
    color: var(--navText);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.Menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Lien actif (page actuelle) */
.Menu a.active {
    background: rgba(110, 168, 255, 0.2);
    color: var(--accent);
}

/* Icône de profil (à droite) */
header > a:last-child img {
    height: 2.5rem;
    width: auto;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

header > a:last-child img:hover {
    transform: scale(1.1);
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.3);
}

/* ==========================================
   BOUTON HAMBURGER (caché par défaut)
   ========================================== */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 11;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--navText);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animation du hamburger quand le menu est ouvert */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* ==========================================
   RESPONSIVE - TABLETTE ET MOBILE
   ========================================== */
@media (max-width: 1024px) {
    /* Afficher le bouton hamburger */
    .hamburger {
        display: flex;
    }

    /* Container pour hamburger + profil */
    header > a:last-child {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    /* Menu déroulant */
    .Menu {
        position: fixed;
        top: 5rem;
        left: 0;
        width: 100%;
        flex-direction: column;
        background-color: rgba(0, 0, 0, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 2rem 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.3s ease;
    }

    /* Menu ouvert */
    .Menu.active {
        max-height: 400px;
        opacity: 1;
    }

    /* Liens du menu mobile */
    .Menu a {
        width: 100%;
        text-align: center;
        padding: 1rem 2rem;
        border-radius: 0;
        font-size: 1.1rem;
    }

    .Menu a:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: none;
    }

    .Menu a.active {
        background: rgba(110, 168, 255, 0.25);
    }

    /* Ajustements du header */
    header .logo {
        height: 2rem;
    }

    header > a:last-child img {
        height: 2rem;
    }

    /* Ajuster la marge du contenu */
    body > main {
        margin-top: 5.5rem;
    }
}

/* ==========================================
   RESPONSIVE - MOBILE
   ========================================== */
@media (max-width: 768px) {
    header {
        height: 4rem;
        padding: 0 4%;
    }

    .Menu {
        top: 4rem;
    }

    .Menu a {
        font-size: 1rem;
        padding: 0.9rem 2rem;
    }

    header .logo {
        height: 1.8rem;
    }

    header > a:last-child img {
        height: 1.8rem;
    }

    .hamburger {
        width: 26px;
        height: 19px;
    }

    .hamburger span {
        height: 2.5px;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    body > main {
        margin-top: 4.5rem;
    }
}

/* ==========================================
   RESPONSIVE - PETIT MOBILE
   ========================================== */
@media (max-width: 480px) {
    header {
        height: 3.5rem;
        padding: 0 5%;
    }

    .Menu {
        top: 3.5rem;
        padding: 1.5rem 0;
    }

    .Menu a {
        font-size: 0.95rem;
        padding: 0.8rem 1.5rem;
    }

    header .logo {
        height: 1.5rem;
    }

    header > a:last-child img {
        height: 1.5rem;
    }

    header > a:last-child {
        gap: 0.8rem;
    }

    .hamburger {
        width: 24px;
        height: 18px;
    }

    .hamburger span {
        height: 2px;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    body > main {
        margin-top: 4rem;
    }
}

/* ==========================================
   Focus visible (accessibilité)
   ========================================== */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Focus pour le hamburger */
.hamburger:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}