@font-face {
    font-family: 'Bebas Neue';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/bebas-neue-v14-latin-regular.woff2') format('woff2'),
}

@font-face {
    font-family: 'Oswald';
    font-style: normal;
    font-weight: 400;
    src: url('/fonts/oswald-v53-latin-regular.woff2') format('woff2'),
}

/* Styles de base pour la page */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Bebas Neue', sans-serif;
    background-color: #005428;
    overflow: hidden; /* Empêche le défilement si nécessaire */
}

/* Conteneur principal représentant le terrain de foot */
.container {
    width: auto; /* 90% de la largeur de la fenêtre */
    max-width: 500px;
    height: 90%;
    max-height: 772px; /* Limite la hauteur à 90% de la hauteur de la fenêtre */
    aspect-ratio: 68 / 105; /* Ratio d’un terrain de football */
    background-color: #004a23;
    border: 5px solid #ffffff;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    overflow: hidden; /* Masque tout débordement */
}

/* Sélecteur de langue épuré - En haut à gauche du conteneur */
.language-switcher {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 50;
    font-family: 'Bebas Neue', sans-serif;
    color: #fff;
    cursor: pointer;
    user-select: none;
}

.language-current {
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    padding: 6px 10px;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.language-current:hover {
    background: rgba(0, 0, 0, 0.3);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 6px;
    margin-top: 5px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 60px;
}

.language-switcher.open .language-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: #fff;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin: 2px;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: orange;
}

.language-option.active {
    color: orange;
    background: rgba(255, 165, 0, 0.1);
}

/* Badge MAX - Style cohérent avec le sélecteur de langue */
.max-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 50;
    font-family: 'Bebas Neue', sans-serif;
    color: #fff;
    cursor: pointer;
    user-select: none;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 1px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    padding: 6px 10px;
    border-radius: 1px;
    background: rgba(0, 0, 0, 0.1);
}

.max-badge:hover {
    background: rgba(0, 0, 0, 0.3);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

/* Style spécial pour les utilisateurs MAX connectés */
.max-badge.authenticated {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.max-badge.authenticated:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
}

.max-badge-tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-family: 'Oswald', sans-serif;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: translateY(5px);
}

.max-badge:hover .max-badge-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Messages à l'intérieur du conteneur principal */
.container .message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 300px;
    padding: 10px;
    border-radius: 4px;
    margin: 0;
    text-align: center;
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: bold;
    z-index: 9000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.container .message.visible {
    opacity: 1;
}

.container .message.fade-out {
    opacity: 0;
}

.container .message.error {
    background-color: #f44336;
    color: white;
}

.container .message.success {
    background-color: #4CAF50;
    color: white;
}

/* Ligne blanche au centre */
.container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    z-index: 0;
}

/* Surfaces de réparation */
.penalty-box {
    width: 59%; /* Largeur proportionnelle de la surface de réparation */
    height: 15.7%; /* Hauteur proportionnelle de la surface de réparation */
    border: 3px solid #ffffff;
    border-top: none;
    border-bottom: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

.penalty-box.top {
    top: 0;
    border-bottom: 3px solid #ffffff;
}

.penalty-box.bottom {
    bottom: 0;
    border-top: 3px solid #ffffff;
}

/* Zones des 6 mètres */
.six-yard-box {
    width: 27%; /* Largeur proportionnelle de la zone des 6 mètres */
    height: 5.2%; /* Hauteur proportionnelle de la zone des 6 mètres */
    border: 3px solid #ffffff;
    border-top: none;
    border-bottom: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    pointer-events: none;
}

.six-yard-box.top {
    top: 0;
    border-bottom: 3px solid #ffffff;
}

.six-yard-box.bottom {
    bottom: 0;
    border-top: 3px solid #ffffff;
}

/* Superposition noire transparente pour la configuration du match */
.config-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* Transparent noir */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    opacity: 0; /* Complètement transparent par défaut */
    visibility: hidden; /* Caché visuellement */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Transition fluide */
}

/* Pop-in visible lorsque la classe hidden est retirée */
.config-overlay:not(.hidden) {
    opacity: 1; /* Complètement visible */
    visibility: visible; /* Visible visuellement */
    pointer-events: auto; /* Active les interactions */
}

/* Style pour le formulaire de configuration */
.config-form {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

/* Style pour le texte de copyright */
.copyright {
    position: absolute; /* Positionnement absolu dans la penalty box */
    bottom: 5px; /* Espace depuis le bas */
    width: 100%; /* Prend toute la largeur de la penalty box */
    text-align: center; /* Centre le texte horizontalement */
    font-size: 0.8em; /* Taille de police plus petite */
    color: white; /* Couleur blanche pour le texte */
    font-family: 'Bebas Neue', sans-serif;
    z-index: 100;
    pointer-events: all;
}

/* Style du lien INFOS */
.copyright a.infos-button {
    color: white;
    cursor: pointer !important;
    text-decoration: underline;
    z-index: 100;
    pointer-events: all;
    position: relative;
}

.copyright a.infos-button:hover {
    text-decoration: none;
}

.legal-content {
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px 30px;
    background-color: white;
    border-radius: 8px;
    font-family: 'Oswald', sans-serif;
    color: #333;
}

.legal-content h1 {
    font-family: 'Bebas Neue', sans-serif;
}

.legal-content h2 {
    color: orange;
    margin-bottom: 20px;
    font-size: 24px;
    font-family: 'Bebas Neue', sans-serif;
}

.legal-content h3, 
.legal-content h4 {
    color: orange;
    margin: 25px 0 15px;
    font-size: 18px;
    font-family: 'Bebas Neue', sans-serif;
}

.legal-content p {
    margin: 10px 0;
    line-height: 1.6;
    font-size: 14px;
}

.legal-content ul {
    margin: 10px 0;
    padding-left: 25px;
    list-style-type: disc;
}

.legal-content li {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 14px;
}

.legal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.legal-content {
    background: white;
    color: var(--color-text);
    max-width: 800px;
    width: 90%;
    margin: 20px;
    padding: 30px;
    border-radius: 8px;
    max-height: 80%;
    overflow-y: auto;
}

.legal-content .close-legal {
    display: block;
    margin: 30px auto 10px;
    padding: 10px 30px;
    background-color: orange;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Bebas Neue', sans-serif;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.legal-content .close-legal:hover {
    background-color: orange;
    color: white;
}