:root { --bg: #121212; --card: #1e1e1e; --primary: #9b59b6; --text: #ffffff; --subtext: #aaaaaa; }
body { background-color: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; display: flex; flex-direction: column; min-height: 100vh; }

.container { padding: 20px; max-width: 600px; margin: 0 auto; flex: 1; box-sizing: border-box; display: flex; flex-direction: column; width: 100%; }
.hidden { display: none !important; }
.center-content { align-items: center; justify-content: center; text-align: center; }

/* LANGUE & LOGO */
.lang-switch { display: flex; justify-content: flex-end; width: 100%; margin-bottom: 10px; }
.lang-btn { background: transparent; color: #666; border: 1px solid #444; padding: 5px 10px; margin-left: 5px; border-radius: 5px; cursor: pointer; font-size: 12px; }
.lang-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.logo-top { display: block; margin: 0 auto 20px; max-width: 180px; height: auto; }

h1, h2, h3 { margin: 10px 0; color: var(--primary); }
p { color: var(--subtext); }

/* Settings */
.settings-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; background: var(--card); padding: 10px 15px; border-radius: 12px; }
select { 
    background-color: #333; color: white; padding: 10px; border-radius: 8px; border: 1px solid #555; 
    font-size: 16px; width: 100%; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23FFF%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat; background-position: right .7em top 50%; background-size: .65em auto;
}
option { background-color: #333; color: white; }
input[type="text"] { background: transparent; border: 1px solid #444; color: white; padding: 10px; border-radius: 5px; font-size: 16px; width: 90%; margin-bottom: 10px; }

/* Compteurs */
.counter-box { display: flex; align-items: center; background: #2a2a2a; border-radius: 8px; padding: 2px; }
.btn-counter { background: #444; color: white; border: none; width: 35px; height: 35px; border-radius: 6px; font-size: 20px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.btn-counter:active { background: var(--primary); }
.counter-value { width: 30px; text-align: center; font-weight: bold; font-size: 18px; }

/* Buttons General */
.btn { border: none; padding: 15px; font-size: 16px; font-weight: bold; border-radius: 12px; cursor: pointer; width: 100%; margin-top: 10px; transition: transform 0.1s; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: #333; color: white; }
.btn-outline { background: transparent; border: 2px dashed #444; color: #888; }
.btn-text { background: transparent; color: #666; }
.btn-mini { padding: 5px 10px; width: auto; font-size: 12px; margin-left: 5px; }

/* Avatars & Lists */
.avatar-large { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--primary); margin-bottom: 20px; }
.avatar-medium { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; background: #333; }
.avatar-small { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; margin-right: 10px; }
.grid-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 10px; width: 100%; margin-bottom: 20px; }
.player-chip { background: var(--card); padding: 10px; border-radius: 10px; text-align: center; position: relative; }
.player-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 5px; }
.player-chip .remove-btn { position: absolute; top: -5px; right: -5px; background: var(--primary); color: white; border-radius: 50%; width: 20px; height: 20px; font-size: 12px; line-height: 20px; cursor: pointer; }

/* Game List */
.list-vertical { width: 100%; }
.player-row { background: var(--card); padding: 15px; margin-bottom: 10px; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; }
.player-info { display: flex; align-items: center; }
.player-order { color: var(--primary); font-weight: bold; font-size: 1.2em; margin-right: 15px; min-width: 25px; }
.dead { opacity: 0.4; filter: grayscale(100%); }
.scroll-list { max-height: 200px; overflow-y: auto; text-align: left; }
.import-row { padding: 10px; border-bottom: 1px solid #333; display: flex; align-items: center; justify-content: space-between; }
.import-left { display: flex; align-items: center; cursor: pointer; flex-grow: 1; }
.delete-saved-btn { background: var(--primary); color: white; border: none; padding: 5px 10px; border-radius: 5px; margin-left: 10px; cursor: pointer; font-size: 12px;}
.empty-list-msg { padding: 15px; color: var(--subtext); font-style: italic; }

/* Secret Area & Modal */
#secret-area { background: #222; border: 2px solid #444; border-radius: 15px; padding: 40px 20px; margin: 20px 0; width: 100%; box-sizing: border-box; user-select: none; }
#secret-text { font-size: 1.5em; font-weight: bold; color: white; }
.secret-box-check { background:#000; padding:20px; margin:10px; border-radius:5px; user-select: none;}
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 100; display: flex; justify-content: center; align-items: flex-end; }
.modal-content { background: #1a1a1a; width: 100%; max-width: 600px; padding: 25px; border-radius: 20px 20px 0 0; text-align: center; animation: slideUp 0.3s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid #333; }
.tab-btn { flex: 1; background: none; border: none; color: #666; padding: 10px; font-weight: bold; border-bottom: 2px solid transparent; }
.tab-btn.active { color: var(--primary); border-bottom: 2px solid var(--primary); }

.avatar-upload { display: flex; justify-content: center; align-items: center; margin-bottom: 20px; }
.avatar-row { display: flex; align-items: center; }
.avatar-row label { cursor: pointer; }
.change-photo-text { margin-left: 15px; color: var(--primary); font-weight: bold; text-decoration: underline; cursor: pointer; }
.loading-spinner { border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top: 3px solid #fff; width: 20px; height: 20px; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

footer { text-align: center; padding: 20px; color: var(--subtext); font-size: 0.9em; margin-top: auto; }

/* ---------------------------------------------------- */
/* DESIGN RGB STABLE & ALIGNÉ (Vitesse rapide)          */
/* ---------------------------------------------------- */

/* 1. La Boîte Globale RGB (Conteneur) */
.rgb-container {
    position: relative;
    padding: 1.5px; /* Bordure plus fine */
    border-radius: 12px; /* Moins rond, plus compact */
    margin-bottom: 20px;
    background: transparent;
    z-index: 1;
}

/* Bordure lumineuse */
.rgb-container::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    padding: 1.5px; /* Bordure plus fine */
    background: conic-gradient(
        from 0deg,
        #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #ff6b6b
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    z-index: -1;
    /* VITESSE AUGMENTÉE ICI (2s au lieu de 6s) */
    animation: hue-rotating 2s linear infinite; 
    filter: blur(0.5px);
}

/* Fond noir interne */
.rgb-inner {
    background: #0a0a0a;
    border-radius: 10px;
    padding: 12px; /* Moins de padding interne */
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

/* Titre "Générer avec IA" */
.rgb-label {
    font-size: 0.8em;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    background: conic-gradient(
        from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #feca57, #ff6b6b
    );
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    margin-bottom: 2px;
    animation: hue-rotating 2s linear infinite;
}

/* Zone flexible pour aligner input et bouton */
.rgb-flex {
    display: flex; 
    gap: 8px; 
    align-items: center; /* Aligne verticalement */
    height: 42px; /* Hauteur fixe pour forcer l'alignement */
}

/* Input texte */
.rgb-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #333;
    color: white;
    border-radius: 8px;
    padding: 0 12px; /* Padding horizontal seulement */
    font-size: 15px;
    width: 100%;
    height: 100%; /* Prend toute la hauteur définie (42px) */
    box-sizing: border-box;
    transition: all 0.3s;
    line-height: 42px; /* Centre le texte verticalement */
}
.rgb-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #555;
}

/* 2. Le Bouton "GO" style Pilule RGB (Affiné) */
.btn-ai-rgb {
    position: relative;
    padding: 0 20px; /* Moins large */
    height: 100%; /* S'adapte à la hauteur de 42px */
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    white-space: nowrap;
    overflow: hidden; 
}

.btn-ai-rgb:hover { transform: scale(1.05); }
.btn-ai-rgb:active { transform: scale(0.95); }

/* Anneau multicolore du bouton */
.btn-ai-rgb::before {
    content: "";
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(
        from 0deg,
        #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57, #ff9ff3, #ff6b6b
    );
    z-index: -2;
    filter: blur(6px); /* Flou légèrement réduit pour plus de netteté */
    animation: hue-rotating 1.5s linear infinite; /* Très rapide */
}

/* Fond noir interne du bouton */
.btn-ai-rgb::after {
    content: "";
    position: absolute;
    inset: 2px; /* Bordure interne plus fine (2px au lieu de 3) */
    background: #000;
    border-radius: 47px;
    z-index: -1;
    filter: blur(0.5px);
}

/* Texte dégradé */
.gradient-text {
    color: transparent;
    background: conic-gradient(
        from 0deg, #ff6b6b, #4ecdc4, #45b7d1, #feca57, #ff6b6b
    );
    background-clip: text;
    -webkit-background-clip: text;
    filter: hue-rotate(0deg);
    font-weight: 800;
}
.btn-ai-rgb:hover .gradient-text { animation: hue-rotating 0.5s linear infinite; }

/* Animation ultra fluide */
@keyframes hue-rotating {
    from { filter: hue-rotate(0deg); }
    to { filter: hue-rotate(360deg); }
}