/* ========================================== */
/*            FEUILLE DE STYLE WELCOME        */
/* ========================================== */

/* Conservation des variables du site principal */
:root {
    --color-primary: #D32F2F;      /* Rouge dominant */
    --color-secondary: #2E7D32;    /* Vert Agriculture */
    --color-brique: #D84315;       /* Brique - Génie rural */
    --color-gold: #F57F17;         /* Jaune/Or Élevage */
    --color-blue: #1565C0;         /* Bleu Russie / Admin */
    
    --color-dark: #1E1E1E;
    --color-light: #F8F9FA;
    --color-white: #FFFFFF;
    --color-gray: #757575;
    
    --font-titles: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-dark);
    color: var(--color-white);
    overflow-x: hidden;
    height: 100vh;
}

/* ========================================== */
/*            1. SPINNER LOADER STYLES        */
/* ========================================== */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0d1117;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner-ring {
    width: 120px;
    height: 120px;
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top: 4px solid var(--color-primary);
    border-right: 4px solid var(--color-gold);
    border-bottom: 4px solid var(--color-secondary);
    border-left: 4px solid var(--color-blue);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-core {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.loader-logo-icon {
    position: absolute;
    top: 35px;
    font-size: 2.2rem;
    color: var(--color-white);
    animation: pulse 1.5s ease-in-out infinite alternate;
}

.loader-text {
    margin-top: 25px;
    font-family: var(--font-titles);
    font-size: 0.95rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #94a3b8;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { transform: scale(0.9); opacity: 0.7; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* ========================================== */
/*          2. WELCOME SCREEN STYLES          */
/* ========================================== */
.welcome-screen {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    overflow: hidden;
    padding: 40px 20px;
}

/* Particules de fond */
.bg-animated-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    animation: floatUp linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    50% { opacity: 0.6; }
    100% { transform: translateY(-10vh) scale(1.2); opacity: 0; }
}

/* Effets de lueur colorés */
.bg-glow {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.25;
    pointer-events: none;
}

.glow-1 { background-color: var(--color-primary); top: -100px; left: -100px; }
.glow-2 { background-color: var(--color-blue); bottom: -100px; right: -100px; }

/* Conteneur Central */
.welcome-container {
    position: relative;
    z-index: 10;
    max-width: 900px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* GRAND LOGO EN MAJESTÉ */
.welcome-hero-logo {
    position: relative;
    margin-bottom: 35px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.grand-logo-badge {
    width: 170px;
    height: 170px;
    border-radius: 35px;
    background: linear-gradient(135deg, var(--color-primary) 0%, #b71c1c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 20px 50px rgba(211, 47, 47, 0.4),
                inset 0 0 15px rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.grand-logo-badge:hover {
    transform: scale(1.08) rotate(3deg);
}

.logo-main-icon {
    font-size: 5rem;
    color: var(--color-white);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

/* Cercles d'ondes pulsatiles */
.logo-pulse-ring {
    position: absolute;
    width: 170px;
    height: 170px;
    border-radius: 35px;
    border: 2px solid var(--color-primary);
    animation: waveExpand 3s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
    z-index: 1;
}

.logo-pulse-ring.delay {
    animation-delay: 1.5s;
}

@keyframes waveExpand {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

/* Textes */
.welcome-badge {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 18px;
    border-radius: 30px;
    font-family: var(--font-titles);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-gold);
    display: inline-block;
    margin-bottom: 15px;
}

.welcome-title {
    font-family: var(--font-titles);
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 15px;
    background: linear-gradient(to right, #ffffff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
    font-size: 1.05rem;
    color: #94a3b8;
    max-width: 680px;
    line-height: 1.6;
    margin-bottom: 35px;
}

/* Sélecteur de Langues */
.lang-selector-box {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 25px;
    border-radius: 16px;
    margin-bottom: 40px;
    width: 100%;
    max-width: 580px;
}

.lang-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.lang-options {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.lang-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-white);
    padding: 10px 20px;
    border-radius: 8px;
    font-family: var(--font-titles);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lang-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.lang-btn.active {
    background-color: var(--color-blue);
    border-color: var(--color-blue);
    box-shadow: 0 4px 15px rgba(21, 101, 192, 0.4);
}

/* Boutons d'action */
.welcome-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 15px 32px;
    border-radius: 8px;
    font-family: var(--font-titles);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-welcome-primary {
    background-color: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 10px 25px rgba(211, 47, 47, 0.3);
}

.btn-welcome-primary:hover {
    background-color: #b71c1c;
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(211, 47, 47, 0.5);
}

.btn-welcome-game {
    background-color: rgba(255, 255, 255, 0.08);
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-welcome-game:hover {
    background-color: var(--color-secondary);
    border-color: var(--color-secondary);
    transform: translateY(-3px);
}

.welcome-footer-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    line-height: 0;
    pointer-events: none;
    opacity: 0.3;
}

/* ========================================== */
/*          3. MODALE MINI-JEU STYLES         */
/* ========================================== */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.game-modal.active {
    opacity: 1;
    visibility: visible;
}

.game-modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.game-modal-card {
    position: relative;
    z-index: 2;
    background-color: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.game-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    cursor: pointer;
}

.game-header h3 {
    font-family: var(--font-titles);
    color: var(--color-gold);
    margin-bottom: 5px;
}

.game-header p {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 20px;
}

.game-stats {
    display: flex;
    justify-content: space-around;
    background-color: #0f172a;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: var(--font-titles);
    font-weight: 800;
}

.game-arena {
    position: relative;
    width: 100%;
    height: 250px;
    background-color: #0f172a;
    border: 2px dashed #334155;
    border-radius: 12px;
    overflow: hidden;
}

.game-start-screen {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-target {
    position: absolute;
    width: 45px;
    height: 45px;
    background-color: var(--color-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    animation: targetPop 0.3s ease;
}

@keyframes targetPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .welcome-title { font-size: 2rem; }
    .grand-logo-badge { width: 130px; height: 130px; }
    .logo-pulse-ring { width: 130px; height: 130px; }
    .logo-main-icon { font-size: 3.8rem; }
}