* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* Bloque le zoom accidentel sur mobile lors des "double-tap" */
    touch-action: manipulation;
}

html,
body {
    margin: 0;
    height: 100dvh; /* Hauteur dynamique stricte (règle le bug Safari de la barre d'adresse) */
    width: 100%; /* Remplacé 100vw par 100% pour éviter le scroll horizontal */
    overflow-x: hidden; /* Coupe tout débordement horizontal */
    font-family: 'Inter Tight', sans-serif;
    display: flex;
    flex-direction: column;
    /* Empêche le redimensionnement du texte en mode paysage */
    -webkit-text-size-adjust: 100%;
}

/* Zone centrale avec marges */
.body {
    width: 100%;

    /* On garde de la place en bas pour le footer (90px + petite marge) */
    padding: 2vw 5vw calc(110px + env(safe-area-inset-bottom)) 5vw; 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: space-evenly; /* MAGIQUE : répartit l'espace vertical sans marges fixes */
}

/* HEADER */
header {
    width: 100%; /* Remplacé 100vw par 100% */
    display: flex;
    align-items: center;
    padding: 4vw 5vw; /* Ajusté pour correspondre à .body */
    position: sticky;
    top: 0; /* Ajout obligatoire pour que sticky fonctionne */
    justify-content: space-between;
    background-color: #ffffff; /* Pour que le header cache le contenu qui passe dessous */
    z-index: 1000;
    /* Bloque la sélection du texte et des icônes ici */
    user-select: none;
    -webkit-user-select: none;
}

header img {
    width: 30vw;
    /* Empêche de glisser l'image accidentellement */
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Page INDEX */
img.logo {
    width: auto;
    max-width: 85%; /* Ne dépasse jamais la largeur de l'écran */
    max-height: 20vh; /* Ne dépasse jamais 25% de la hauteur de l'écran */
    object-fit: contain; /* Garde les bonnes proportions */
    margin: 0 auto; /* Centre l'image */
    display: block;
}

.introduction {
    background-color: #cc1b3060;
    border-radius: 20px;
    margin: 0; 
}

.intro {
    padding: 4vw;
    font-size: 3vw;
    text-align: center;
    /* Évite la sélection involontaire du texte */
    user-select: none;
    -webkit-user-select: none;
}

.register-btn,
.login-btn {
    -webkit-appearance: none; 
    appearance: none;
    border: 2px solid #cc1b30;
    border-radius: 20px;
    background-color: transparent;
    width: 60vw; /* Un peu plus large pour être plus cliquable */
    font-size: 6vw;
    padding: 3vw;
    color: #cc1b30;
    text-decoration: none;
    display: block; 
    text-align: center;
    cursor: pointer;
    margin: 0; /* Important : on enlève le margin-top: 6vw ici */
}
.buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4vw; /* Espace fixe entre les boutons au lieu de margin-top */
    margin: 0; /* Suppression des marges fixes */
}

form {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly; /* Répartit h1, inputs et boutons dynamiquement */
    flex-grow: 1; /* Le formulaire prend toute la hauteur du .body */
    height: 100%;
}

/* PAGE INSCRIPTION et CONNEXION */
h1 {
    text-align: center; 
    margin: 0; 
}

label {
    font-weight: 900;
}

.input {
    padding: 12px;
    margin-top: 2vw;
    background-color: #cc1b3060;
    color: #ffffff;
    border-radius: 10vw;
    overflow: hidden;
}

input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus, 
input:-webkit-autofill:active {
    -webkit-text-fill-color: #000000;
    -webkit-box-shadow: 0 0 0px 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s;
}

.pseudo-container, 
.email-container {
    margin-bottom: 0; /* Était: margin-bottom: 20vw; */
    width: 100%;
}

#pseudo,
#email {
    -webkit-appearance: none;
    appearance: none;
    background-color: transparent;
    border: transparent;
    height: 8vw;
    width: 100%;
}

#pseudo:focus,
#email:focus {
    outline: none;
    border: none;
}

.login,
.register {
    text-align: center; 
    margin: 0; 
    font-size: 3.5vw;
    border: none;
    background: none;
}

.login a,
.register a {
    text-decoration: none;
    color: #cc1b30;
}

.message-success {
    color: #4b8549;
    text-align: center;
    font-weight: bold;
    margin: 5vw 0;
}

.message-error {
    color: #e74c3c;
    text-align: center;
    font-weight: bold;
    margin: 5vw 0;
}

.classement-container {
    flex-grow: 1;
    overflow-y: auto; /* Active le scroll UNIQUEMENT pour la liste des joueurs */
    /* Cache la barre de défilement pour faire plus "App" */
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.classement-container::-webkit-scrollbar {
    display: none;
}

/* FOOTER */
.navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: #cc1b30;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 999;
    padding-bottom: env(safe-area-inset-bottom);
}

.navigation ul {
    display: flex;
    width: 100%;
    max-width: 500px;
    padding: 0;
    margin: 0;
    position: relative;
}

.navigation ul li {
    list-style: none;
    flex: 1;
    height: 60px;
    z-index: 1;
    -webkit-tap-highlight-color: transparent;
}

.navigation ul li a {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.navigation ul li.active a .icon {
    position: absolute;
    background: #fff;
    color: #cc1b30;
    width: 65px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0 0 25px 25px;
    transition: 0.3s;
    z-index: 10;
}

.nav-svg {
    width: 24px;
    height: 24px;
    transition: 0.3s;
    filter: brightness(0) invert(1);
}

/* La bulle blanche qui descend quand le menu est actif */
.navigation ul li.active a .icon {
    position: absolute;
    background: #fff;
    width: 65px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 0 0 25px 25px;
    transition: 0.3s;
    z-index: 10;
}

/* Quand le menu est actif, on retrouve le ROUGE de base */
.navigation ul li.active a .icon .nav-svg {
    /* On annule le filtre blanc : votre icône retrouve son rouge parfait d'origine ! */
    filter: none;
}

.footer-text {
    position: absolute;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: 100%;
    text-align: center;
    color: white;
    font-size: 10px;
    opacity: 0.8;
    pointer-events: none;
}

.footer-text {
    position: absolute;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: 100%;
    text-align: center;
    color: white;
    font-size: 10px;
    opacity: 0.8;
    pointer-events: none;
}
/*HORS CONNEXION*/
#offline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 15, 15, 0.95); /* Fond très sombre mais légèrement transparent */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease; /* Transition très fluide */
}

/* Quand la classe 'active' est ajoutée par le JS */
#offline-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Le contenu central - VERSION RENFORCÉE */
.offline-content {
    text-align: center;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 15px;
}


#offline{
    height: 30vw;
    margin: 5vw;
}

.offline-btn{
    -webkit-appearance: none;
    appearance: none;
    border: 2px solid #cc1b30;
    border-radius: 20px;
    background-color: white;
    width: 60vw;
    font-size: 4vw;
    padding: 3vw;
    color: #cc1b30;
    text-decoration: none;
    display: block;
    text-align: center;
    cursor: pointer;
    margin: 5vw;
}
