/* Base du site*/

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

html,
body {
    margin: 0;
    height: 100dvh; 
    width: 100%; 
    overflow-x: hidden; 
    font-family: 'Inter Tight', sans-serif;
    display: flex;
    flex-direction: column;
    /* Empêche le redimensionnement automatique du texte sur iOS en mode paysage */
    -webkit-text-size-adjust: 100%;
}

.body {
    width: 100%;
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
    justify-content: flex-start; 
    gap: 5vw; 
     overflow-y: auto; 
    -webkit-overflow-scrolling: touch; /* Rendu fluide du défilement sur iOS */
      padding: 4vw 5vw calc(110px + env(safe-area-inset-bottom)) 5vw; 
}


/* Header*/

header {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 3vw 5vw;
    justify-content: space-between;
    flex-shrink: 0; /* Empêche le header de se faire écraser si l'écran est petit */
    background-color: #ffffff;
    z-index: 1000;
    user-select: none;
    -webkit-user-select: none;
}

header a {
    display: flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent; /* Enlève le carré gris natif au clic sur mobile */
}

header .logo-text {
    width: 30vw; 
    height: auto;
    pointer-events: none; /* Empêche de glisser l'image accidentellement */
}


/* Accueil */

#logo {
    width: 80vw; 
    max-width: 350px; 
    height: auto; 
    max-height: 35vh; 
    margin: 0 auto 4vw auto; 
    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 en appuyant trop longtemps */
    user-select: none;
    -webkit-user-select: none;
}


/* Boutons*/

.buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4vw; /* Espace fixe entre les boutons */
    margin: 0; 
}

.register-btn,
.login-btn {
    -webkit-appearance: none; /* Retire le style par défaut des boutons sur Safari/iOS */
    appearance: none;
    border: 2px solid #cc1b30;
    border-radius: 20px;
    background-color: transparent;
    width: 60vw; 
    font-size: 6vw;
    padding: 3vw;
    color: #cc1b30;
    text-decoration: none;
    display: block; 
    text-align: center;
    cursor: pointer;
    margin: 0; 
}


/* Formulaires*/

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%;
}

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;
}

/* Hack CSS : Empêche Chrome de colorer le fond des inputs */
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; 
    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;
}

/* Messages de retour (Erreur / Succès) */
.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 */

.classement-container {
    overflow-y: auto; /* Active le scroll UNIQUEMENT pour la liste des joueurs */
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

/* Cache la barre de défilement sur Chrome/Safari/Edge */
.classement-container::-webkit-scrollbar {
    display: none;
}


/* Footer*/

.navigation {
    position: fixed; /* Fixe le menu en bas de l'écran */
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90px;
    background: #cc1b30;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

.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;
}

.nav-svg {
    width: 24px;
    height: 24px;
    transition: 0.3s;
    filter: brightness(0) invert(1); /* Transforme les pixels noirs du SVG en blanc pur */

}

/* 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;
}

.navigation ul li.active a .icon .nav-svg {
    filter: none;
}

.footer-text {
    position: absolute;
    bottom: calc(8px + env(safe-area-inset-bottom)); /* Gère la barre des iPhone récents */
    width: 100%;
    text-align: center;
    color: white;
    font-size: 10px;
    opacity: 0.8;
    pointer-events: none;
}


/* Mode hors ligne */

#offline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 15, 15, 0.95);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden; /* Rend l'élément invisible et non-cliquable par défaut */
    transition: all 0.5s ease; 
}

#offline-overlay.active {
    opacity: 1;
    visibility: visible;
}

.offline-content {
    text-align: center;
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 90vw;
}

#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;
}