@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

:root {
    --cam-green: #004A2F;
    --cam-gold: #F2C200;
    --cam-white: #FFFFFF;
    --cam-dark-text: #333333;
}

/* Reset et optimisations globales */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%; /* Empêche l'ajustement automatique de la taille du texte sur iOS */
    -ms-text-size-adjust: 100%;
}

body, html {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    color: var(--cam-white);
    line-height: 1.6;
    background: linear-gradient(135deg, var(--cam-green) 0%, #125740 50%, var(--cam-gold) 100%);
    min-height: 100vh;
    -webkit-overflow-scrolling: touch; /* Améliore le défilement sur iOS */
    overflow-x: hidden; /* Empêche le défilement horizontal */
}

.hero {
    position: relative;
    min-height: 100vh; /* Changé de height à min-height pour permettre l'expansion */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 20px 0; /* Ajoute un padding pour éviter que le contenu touche les bords */
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-75%, -50%);
    width: 80%;
    height: 80%;
    background: url('assets/background-logo.svg') no-repeat;
    background-size: contain;
    opacity: 1;
    z-index: 10;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background-color: rgba(0, 74, 47, 0.3); /* Superposition plus légère pour laisser voir le dégradé */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 20;
    max-width: 800px;
    padding: 20px;
}

.logo {
    margin-bottom: 40px;
}

.logo-img {
    max-width: 300px;
    height: auto;
}

.main-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 30px;
}

.text-content p {
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.cta-buttons {
    margin-top: 40px;
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.3s ease, color 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn:hover {
    transform: translateY(-3px);
}

.btn.btn-primary {
    background-color: var(--cam-gold);
    color: var(--cam-dark-text);
    border-color: var(--cam-gold);
}

.btn.btn-primary:hover {
    background-color: #dcb000;
    border-color: #dcb000;
}

.btn.btn-secondary {
    background-color: transparent;
    color: var(--cam-white);
    border: 2px solid var(--cam-white);
}

.btn.btn-secondary:hover {
    background-color: var(--cam-white);
    color: var(--cam-dark-text);
}

/* Responsive */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh; /* Assure une hauteur minimale sur tablette */
        padding: 40px 20px; /* Plus de padding sur tablette */
    }
    
    .main-title {
        font-size: 2rem;
    }
    .logo-img {
        max-width: 250px;
    }
    .text-content p {
        font-size: 1rem;
    }
    .btn {
        padding: 12px 25px;
    }
}

@media (max-width: 480px) {
    body {
        overflow-x: hidden; /* Empêche le scroll horizontal */
    }
    
    .hero {
        min-height: 100vh; /* Hauteur minimale sur mobile */
        min-height: 100dvh; /* Utilise dvh si supporté pour éviter les problèmes de barre d'adresse */
        padding: 60px 15px; /* Plus de padding vertical sur mobile */
    }
    
    .main-title {
        font-size: 1.8rem;
        line-height: 1.3; /* Améliore la lisibilité */
    }
    .logo-img {
        max-width: 200px;
    }
    .cta-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .btn {
        width: 80%;
        margin: 10px 0;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    background-color: var(--cam-white);
    padding: 15px;
    border-radius: 10px;
    width: 100%;
    height: 100%;
    max-width: 900px;
    max-height: 700px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--cam-gold);
    color: var(--cam-green);
    border: 2px solid var(--cam-white);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    z-index: 10;
}

#game-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 5px;
}

/* Responsive pour tablettes */
@media (max-width: 768px) {
    .modal-overlay {
        padding: 5px;
    }
    
    .modal-content {
        max-width: 100%;
        max-height: 100%;
        padding: 10px;
        border-radius: 5px;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 20px;
        top: -8px;
        right: -8px;
    }
}

/* Responsive pour mobile */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 0;
    }
    
    .modal-content {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        padding: 5px;
    }
    
    .modal-close {
        top: 5px;
        right: 5px;
        position: fixed;
        z-index: 1001;
    }
}

.hidden {
    display: none;
}
