/* ECRAN DE CHARGEMENT */
#loader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: var(--bg-dark); z-index: 9999; display: flex;
    align-items: center; justify-content: center; flex-direction: column;
    font-weight: 900; font-size: 1.5rem; color: var(--primary-blue);
    transition: opacity 0.5s;
}

/* BOUTONS FLOTTANTS */
.settings-btn-floating {
    position: fixed; bottom: 30px; right: 30px; z-index: 1000;
    background: linear-gradient(135deg, var(--primary-blue), #2563eb);
    color: white; padding: 12px 24px; border-radius: 50px; font-weight: 800; font-family: 'Inter'; font-size: 0.9rem; border: none; cursor: pointer;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.2); display: flex; align-items: center; gap: 10px; transition: 0.3s;
}
.settings-btn-floating:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(59, 130, 246, 0.6); }

.export-btn-floating {
    position: fixed; bottom: 30px; left: 30px; z-index: 1000;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: white; padding: 12px 24px; border-radius: 50px; font-weight: 800; font-family: 'Inter'; font-size: 0.9rem; border: none; cursor: pointer;
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255,255,255,0.2); display: flex; align-items: center; gap: 10px; transition: 0.3s;
}
.export-btn-floating:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(139, 92, 246, 0.6); }

/* BLOCS VOLANTS */
#floating-layer { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; }
.flying-block {
    position: absolute; background: rgba(19, 20, 28, 0.7); backdrop-filter: blur(4px);
    border: 1px solid rgba(30, 32, 45, 0.8); border-radius: 12px; padding: 10px; width: 140px;
    display: flex; flex-direction: column; gap: 8px; box-shadow: 0 10px 20px rgba(0,0,0,0.5); will-change: transform;
}
.fb-header { display: flex; align-items: center; justify-content: space-between; }
.fb-header img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(255,255,255,0.1); }
.fb-percent { font-size: 0.85rem; font-weight: 900; }
.fb-progress-bg { width: 100%; height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; }
.fb-progress-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease-out, background 0.5s; }

/* TYPOGRAPHIE ET CARTE ROULETTE */
.hub-container { 
    width: 100%; 
    max-width: 950px; 
    margin: 40px auto 0 auto; /* C'est cette ligne qui force le centrage parfait */
    padding: 0 20px; 
    display: flex;
    flex-direction: column;
    align-items: center; /* Centre le contenu à l'intérieur */
    text-align: center; 
    position: relative; 
    z-index: 10; 
    box-sizing: border-box;
}

.main-title {
    font-size: 4rem; font-weight: 900; margin-bottom: 5px; letter-spacing: -2px; 
    text-shadow: 0 15px 40px rgba(0,0,0,0.9), 0 0 30px rgba(59, 130, 246, 0.4), 0 5px 10px rgba(0,0,0,0.5);
}
.main-title span { color: var(--primary-blue); }
.subtitle { color: var(--text-muted); font-weight: 800; font-size: 1.25rem; margin-bottom: 50px; text-shadow: 0 5px 15px rgba(0,0,0,0.8); }

.roulette-card {
    width: 100%; /* Force la carte à s'étendre de manière symétrique */
    background: rgba(19, 20, 28, 0.65); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(30, 32, 45, 0.8); border-radius: 24px; padding: 40px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.8), inset 0 1px 0 rgba(255,255,255,0.05); position: relative; overflow: hidden;
    box-sizing: border-box;
}

/* ROULETTE ANIMATION */
.roulette-viewport {
    position: relative; width: 100%; height: 170px; background: rgba(0, 0, 0, 0.6);
    border-radius: 16px; border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden; display: flex; align-items: center; box-shadow: inset 0 10px 30px rgba(0,0,0,0.8); 
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    20% { transform: translate(-3px, 0px) rotate(1deg); }
    40% { transform: translate(1px, -1px) rotate(1deg); }
    60% { transform: translate(-3px, 1px) rotate(0deg); }
    80% { transform: translate(-1px, -1px) rotate(1deg); }
}
.shake-active { animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both; }

.center-cursor {
    position: absolute; left: 50%; top: 0; bottom: 0; width: 4px;
    background: var(--recruit-red); z-index: 10; transform: translateX(-50%);
    box-shadow: 0 0 20px var(--recruit-red), 0 0 5px rgba(255,255,255,0.5); border-radius: 2px;
}

.roulette-rail { display: flex; position: absolute; left: 0; will-change: transform; }

.champ-card {
    box-sizing: border-box; min-width: 124px; width: 124px; height: 140px; margin: 0 8px;
    background: rgba(30, 32, 45, 0.9); border: 1px solid rgba(255,255,255,0.05); border-radius: 14px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}
.champ-card img { width: 75px; height: 75px; border-radius: 12px; object-fit: cover; margin-bottom: 12px; transition: 0.3s; }
.champ-card span { font-size: 0.8rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.champ-card.winner-active {
    border-color: var(--primary-blue); background: rgba(59, 130, 246, 0.15);
    transform: scale(1.08); box-shadow: 0 0 30px var(--primary-glow); z-index: 5;
}
.champ-card.winner-active img { border-color: var(--primary-blue); box-shadow: 0 0 20px var(--primary-glow); }
.champ-card.winner-active span { color: #fff; text-shadow: 0 0 10px var(--primary-glow); }

/* BOUTONS DE CONTRÔLE */
.roulette-controls { margin-top: 35px; display: flex; flex-direction: column; align-items: center; gap: 12px; }

.btn-glow {
    padding: 16px 50px; border-radius: 14px; font-family: 'Inter', sans-serif; font-weight: 900; font-size: 1.1rem;
    text-transform: uppercase; letter-spacing: 1px; color: white; border: none; cursor: pointer; transition: all 0.3s;
    background: linear-gradient(135deg, var(--primary-blue), #2563eb); box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255,255,255,0.2); 
}
.btn-glow:hover:not(:disabled) { box-shadow: 0 15px 30px rgba(59, 130, 246, 0.5); transform: translateY(-2px); }
.btn-glow:disabled { background: #1e202d; box-shadow: none; color: #475569; cursor: not-allowed; transform: none; }

.status-message { font-size: 0.9rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; height: 20px; }

.btn-reset {
    background: none; border: none; color: rgba(255,255,255,0.2); font-family: 'Inter'; font-size: 0.7rem; font-weight: 800;
    text-transform: uppercase; cursor: pointer; transition: 0.2s; text-decoration: underline; margin-top: 5px;
}
.btn-reset:hover { color: var(--recruit-red); }

/* MODALS (PARAMÈTRES ET EXPORT) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.8); backdrop-filter: blur(10px); z-index: 2000;
    display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s;
}
.modal-overlay.active { display: flex; opacity: 1; }

.modal-content {
    background: #13141c; border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 20px;
    width: 95%; max-width: 900px; height: 85vh; display: flex; flex-direction: column;
    box-shadow: 0 30px 60px rgba(0,0,0,0.9); overflow: hidden; position: relative;
}
.modal-content.small-modal { height: auto; max-width: 650px; }

.modal-header {
    padding: 25px 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); display: flex;
    justify-content: space-between; align-items: center; background: rgba(0,0,0,0.3); 
}
.modal-header h2 { margin: 0; font-size: 1.5rem; font-weight: 900; }

.btn-close { background: transparent; color: var(--text-muted); border: 1px solid rgba(255, 255, 255, 0.1); padding: 10px 20px; border-radius: 10px; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-close:hover { background: rgba(255,255,255,0.05); color: white; }

.search-bar { padding: 20px 30px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.search-bar input {
    width: 100%; padding: 15px 20px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0,0,0,0.5); color: white; font-family: 'Inter'; font-size: 1rem; box-sizing: border-box;
}
.search-bar input:focus { outline: none; border-color: var(--primary-blue); }

/* GRILLE CHAMPIONS */
#viewGrid { flex: 1; overflow-y: auto; padding: 20px 30px; display: flex; flex-direction: column; gap: 30px; }
#viewGrid::-webkit-scrollbar { width: 8px; }
#viewGrid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

.grid-section-title { font-size: 1.1rem; font-weight: 900; color: white; margin: 0 0 15px 0; }
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 15px; }

.champ-card-mini {
    background: rgba(30, 32, 45, 0.6); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 12px;
    padding: 15px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: 0.2s;
}
.champ-card-mini:hover { background: rgba(59, 130, 246, 0.2); border-color: var(--primary-blue); transform: translateY(-3px); }
.champ-card-mini img { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; }
.champ-card-mini span { font-size: 0.8rem; font-weight: 800; text-align: center; }

.divider { text-align: center; position: relative; margin: 20px 0; }
.divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: dashed 1px rgba(255,255,255,0.2); z-index: 1; }
.divider span { position: relative; z-index: 2; background: #13141c; padding: 0 15px; color: var(--text-muted); font-size: 0.8rem; font-weight: 900; letter-spacing: 2px; }

.champ-grid.inactive .champ-card-mini { opacity: 0.5; filter: grayscale(80%); }
.champ-grid.inactive .champ-card-mini:hover { opacity: 1; filter: grayscale(0%); background: rgba(244, 63, 94, 0.2); border-color: var(--recruit-red); }

/* EDITEUR CHAMPIONS */
#viewEditor { flex: 1; display: none; flex-direction: column; padding: 30px; align-items: center; justify-content: center; overflow-y: auto; }
.editor-header { width: 100%; display: flex; justify-content: flex-start; margin-bottom: 20px; }
.btn-back { background: transparent; color: var(--text-muted); border: none; font-size: 1rem; font-weight: bold; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.btn-back:hover { color: white; }

.editor-profile { display: flex; flex-direction: column; align-items: center; gap: 15px; margin-bottom: 40px; }
.editor-profile img { width: 100px; height: 100px; border-radius: 20px; border: 2px solid var(--primary-blue); box-shadow: 0 10px 20px rgba(0,0,0,0.5); }
.editor-profile h3 { margin: 0; font-size: 2rem; font-weight: 900; letter-spacing: -1px; }

.editor-form { width: 100%; max-width: 500px; display: flex; flex-direction: column; gap: 25px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 1rem; font-weight: 900; color: white; }
.form-desc { font-size: 0.8rem; color: var(--text-muted); margin: 0 0 5px 0; line-height: 1.4; }
.form-group input { background: rgba(0,0,0,0.5); border: 1px solid rgba(255, 255, 255, 0.1); color: white; padding: 12px 15px; border-radius: 10px; font-family: 'Inter'; font-weight: bold; font-size: 1rem; }
.form-group input:focus { border-color: var(--primary-blue); outline: none; }

.editor-actions { display: flex; gap: 15px; margin-top: 20px; width: 100%; max-width: 500px; }
.btn-toggle-champ { flex: 1; padding: 15px; border-radius: 10px; font-weight: 900; border: none; cursor: pointer; transition: 0.2s; color: white; }
.btn-toggle-add { background: var(--success-green); }
.btn-toggle-add:hover { background: #059669; }
.btn-toggle-remove { background: var(--recruit-red); }
.btn-toggle-remove:hover { background: #e11d48; }
.btn-save-champ { flex: 1; background: var(--primary-blue); color: white; padding: 15px; border-radius: 10px; font-weight: 900; border: none; cursor: pointer; transition: 0.2s; }
.btn-save-champ:hover { background: #2563eb; }