@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ==========================================================================
   1. VARIABLES & RESET GLOBAL (Fermeté sur les liens)
   ========================================================================== */
:root {
    /* Palette Joueur (Clair, Très Contrasté & Super Lisible) */
    --player-bg: #f8fafc;
    --player-text: #0f172a;
    --player-border: #cbd5e1;
    
    /* Palette Admin / Régie (Dark Mode "2026" - Style Écran Géant) */
    --admin-bg: #09090b;
    --admin-text: #fafafa;
    --admin-text-muted: #a1a1aa;
    --admin-glass: rgba(22, 22, 25, 0.7);
    --admin-glass-border: rgba(255, 255, 255, 0.08);

    /* Couleurs Universelles */
    --primary-red: #ef4444;
    --primary-red-hover: #dc2626;
    --success: #22c55e;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

/* SUPPRESSION RADICALE ET GLOBALE DES SOULIGNEMENTS M_OCHES */
a, a:hover, a:visited, a:active, .btn-small, button {
    text-decoration: none !important;
}

/* ==========================================================================
   2. INTERFACE JOUEUR (Application Mobile - Thème Lumineux)
   ========================================================================== */
body {
    background-color: var(--player-bg);
    color: var(--player-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    padding: 20px 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 { color: var(--primary-red); font-size: 2.2rem; font-weight: 800; text-transform: uppercase; margin-bottom: 5px; letter-spacing: -0.5px; }
h2, h3, h4 { color: var(--player-text); margin-bottom: 15px; font-weight: 700; }
.subtitle { color: #64748b; margin-bottom: 30px; font-size: 1rem; }
.hidden { display: none !important; }

/* Conteneur Joueur (Boîtier Géométrique Épuré) */
.container {
    width: 100%; 
    max-width: 480px; 
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px; /* Angles nets et élégants, fini les ovales */
    padding: 35px 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    text-align: center;
}

/* Formulaires Joueur */
.input-group { display: flex; flex-direction: column; gap: 10px; text-align: left; margin-bottom: 24px;}
label { font-weight: 600; color: #334155; font-size: 1rem; padding-left: 4px; }
input[type="text"], input[type="password"] {
    width: 100%; padding: 16px; font-size: 1.1rem; border: 1px solid var(--player-border);
    border-radius: 10px; background: #ffffff; color: var(--player-text); transition: all 0.2s ease;
    text-align: center;
}
input[type="text"]:focus, input[type="password"]:focus { 
    outline: none; border-color: var(--primary-red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* VRAI DESIGN DE BOUTON (Carré Premium Légèrement Adouci) */
button, .btn-primary, .btn-small {
    font-family: inherit; 
    font-weight: 700; 
    border: none; 
    border-radius: 10px; /* Coins de boutons modernes de 2026 */
    cursor: pointer; 
    color: #ffffff !important; 
    background: var(--primary-red);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2), 0 2px 4px -2px rgba(239, 68, 68, 0.2);
}
button:hover, .btn-primary:hover {
    background: var(--primary-red-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 15px -3px rgba(239, 68, 68, 0.3);
}
button:active, .btn-primary:active, .btn-small:active { 
    transform: scale(0.97) translateY(0); 
    filter: brightness(0.95);
}

.btn-primary, button#btn-generate { 
    width: 100%; 
    padding: 18px 24px; 
    font-size: 1.1rem; 
}

/* ==========================================================================
   SÉQUENCE DE VOTE JOUEUR (Lisibilité et Ergonomie Tactile)
   ========================================================================== */
/* Passage sur une seule colonne verticale pour un meilleur confort de lecture des textes longs */
.button-grid { 
    display: flex; 
    flex-direction: column; 
    gap: 12px; 
    margin-top: 24px; 
}

/* Vrai design de bouton Premium pour les propositions */
.btn-vote-tactile {
    width: 100%;
    min-height: 65px;
    padding: 16px 20px;
    background: #ffffff; 
    color: var(--player-text) !important; /* Force le texte à être sombre (et non blanc !) */
    border: 1px solid var(--player-border); 
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: none; /* Pas de majuscules forcées pour préserver les noms d'artistes */
    letter-spacing: normal;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    
    /* Alignement du texte à gauche pour une lecture naturelle */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    line-height: 1.3;
}

/* Effets au survol et au clic */
.btn-vote-tactile:hover { 
    border-color: #94a3b8; 
    background: #f8fafc; 
}

.btn-vote-tactile:active { 
    background: #f1f5f9; 
    border-color: var(--primary-red); 
    transform: scale(0.98); 
}
/* Avatars IA */
#pseudo-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.btn-choice { font-size: 1rem; padding: 16px; color: var(--player-text) !important; border: 1px solid transparent; text-transform: none; letter-spacing: normal; box-shadow: none; }
.btn-choice:hover { transform: translateY(-1px); }
.btn-cute { background: #ffe4e6; border-color: #fecdd3; color: #9f1239 !important; }
.btn-dark { background: #0f172a; color: #ffffff !important; }
.btn-work { background: #f1f5f9; border-color: #e2e8f0; color: #334155 !important; }
.btn-trace { background: #e0f2fe; border-color: #bae6fd; color: #0369a1 !important; }

/* En-tête de Session Mobile */
.game-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--player-border); width: 100%; }
.user-badge { background: #0f172a; color: white; padding: 8px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; }
#state-indicator { background: var(--primary-red); color: white; padding: 8px 20px; border-radius: 8px; font-weight: 800; font-size: 0.9rem; text-transform: uppercase; box-shadow: none; }

.loader { border: 4px solid #e2e8f0; border-top: 4px solid var(--primary-red); border-radius: 50%; width: 40px; height: 40px; margin: 20px auto; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pulse-text { animation: pulse 1.5s infinite; color: var(--primary-red); font-weight: 800; }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }


/* ==========================================================================
   3. THEME REGIE / INTERFACE D'ADMINISTRATION (Fichier complet Glassmorphism)
   ========================================================================== */
body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Outfit', sans-serif;
    display: block;
    padding: 4vh 20px;
}

body.admin-body h1 { background: linear-gradient(90deg, #ffffff, #a1a1aa); -webkit-background-clip: text; -webkit-text-fill-color: transparent; font-size: 2.4rem; font-weight: 900; text-align: left; margin-bottom: 10px; }
body.admin-body h2, body.admin-body h3, body.admin-body h4 { color: var(--admin-text); font-weight: 700; }
body.admin-body p, body.admin-body label { color: var(--admin-text-muted); }
body.admin-body a { color: var(--admin-text); transition: color 0.2s ease; font-weight: 500; }
body.admin-body a:hover { color: var(--primary-red); }

body.admin-body .container { background: transparent; border: none; box-shadow: none; max-width: 720px; padding: 0; margin: 0 auto; text-align: left; }

/* Panneaux Verre Dépoli Regie */
.admin-card, .control-panel, .q-box, .q-trigger-card {
    background: var(--admin-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--admin-glass-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.control-panel { border: 1px solid rgba(230, 57, 70, 0.4); position: sticky; top: 15px; z-index: 100; }

body.admin-body input[type="text"], body.admin-body input[type="password"], body.admin-body input[type="file"], body.admin-body select {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-family: 'Outfit', sans-serif;
    padding: 14px;
    border-radius: 8px;
    text-align: left;
}
body.admin-body input[type="text"]:focus, body.admin-body select:focus { border-color: var(--primary-red); background: rgba(255,255,255,0.08); box-shadow: none; }

/* Structure des Grilles de Boutons d'Action Admin */
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-top: 20px; }

.btn-small { 
    width: auto;
    padding: 12px 16px; 
    font-size: 0.95rem; 
    border-radius: 8px; /* Design angulaire et strict */
    box-shadow: none; 
    font-family: 'Outfit', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Couleurs Boutons d'Administration */
.btn-grey { background: rgba(255, 255, 255, 0.08); color: #ffffff !important; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: none; }
.btn-grey:hover { background: rgba(255, 255, 255, 0.15); }

.btn-green { background: rgba(34, 197, 94, 0.15); color: #4ade80 !important; border: 1px solid rgba(34, 197, 94, 0.4); box-shadow: none; }
.btn-green:hover { background: rgba(34, 197, 94, 0.25); }

.btn-blue { background: rgba(59, 130, 246, 0.15); color: #60a5fa !important; border: 1px solid rgba(59, 130, 246, 0.4); box-shadow: none; }
.btn-blue:hover { background: rgba(59, 130, 246, 0.25); }

/* Drapeaux techniques */
.badge { padding: 6px 12px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; display: inline-block; margin-bottom: 15px; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-preparation { background: rgba(255,255,255,0.08); color: #a1a1aa; border: 1px solid rgba(255,255,255,0.05); }
.badge-en-ligne, .badge-online { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.2); }
.badge-clos { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.2); }

.rep-li { background: rgba(255,255,255,0.02); padding: 12px 16px; border-radius: 8px; margin-bottom: 8px; color: #d4d4d8; border-left: 3px solid rgba(255,255,255,0.1); }
.rep-correct { background: rgba(34, 197, 94, 0.08); border-left-color: #22c55e; color: #4ade80; font-weight: 600; }
.row-rep { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.edit-form-area { display: none; background: rgba(0,0,0,0.4); padding: 20px; border-radius: 12px; margin-top: 15px; border: 1px solid rgba(255,255,255,0.05); }
.active-q { border-color: #22c55e !important; background: rgba(34, 197, 94, 0.05) !important; box-shadow: 0 0 15px rgba(34, 197, 94, 0.15); }