/* wordle.css */

/* Configuration générale */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff;
    color: #1a1a1b;
    margin: 0;
    padding: 20px;
}

h1 {
    text-transform: uppercase;
    font-size: 2.5rem;
    letter-spacing: 0.1rem;
    border-bottom: 1px solid #d3d6da;
    margin-bottom: 30px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 500px;
}

/* --- GRILLE DE JEU (TABLEAU) --- */

.wordle-table {
    border-collapse: separate;
    border-spacing: 5px;
    margin-bottom: 20px;
}

/* Colonnes de stats à gauche */
.stat-cell {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #a0a0a0; /* Stats grisées */
    text-align: right;
    padding-right: 15px;
    min-width: 80px;
}

.wordle-table td.word-cell {
    width: 58px;
    height: 58px;
    border: 2px solid #d3d6da;
    text-align: center;
    vertical-align: middle;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
}

/* --- FORMULAIRE AVEC STATS À GAUCHE --- */

.input-row-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

/* On réutilise le style grisé pour les stats du formulaire */
.current-system-stats {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #a0a0a0;
    text-align: right;
    line-height: 1.2;
}
/* --- CLAVIER VIRTUEL --- */

.keyboard {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    user-select: none;
}

.keyboard-row {
    display: flex;
    gap: 6px;
}

.key {
    display: inline-block;
    min-width: 40px;
    height: 58px;
    line-height: 58px;
    padding: 0 8px;
    text-align: center;
    background-color: #d3d6da;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    color: #1a1a1b;
    text-transform: uppercase;
    transition: background-color 0.2s ease, color 0.2s ease;
}


/* Le conteneur qui aligne les 5 cases horizontalement */
.input-container {
    display: flex;          /* Aligne les enfants en ligne */
    justify-content: center; /* Centre le groupe horizontalement */
    gap: 10px;              /* Espace entre les cases */
    margin: 20px 0;
}

.char-input {
    width: 50px;
    height: 50px;

    /* Centrage du texte */
    text-align: center;
    line-height: 50px;      /* Même valeur que height pour le centrage vertical */
    padding: 0;             /* Important : supprime les décalages internes */

    /* Style visuel */
    font-size: 1.8rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 2px solid #878a8c;
    border-radius: 4px;
    outline: none;          /* Supprime la bordure bleue par défaut au clic */
}

/* Optionnel : changer la couleur de bordure quand on tape dedans */
.char-input:focus {
    border-color: #1a1a1b;
    background-color: #f8f8f8;
}

/* --- ÉTATS ET COULEURS (Communs à la grille et au clavier) --- */

/* Vert : Bien placé */
.vert, td.vert, .key.vert {
    background-color: #6aaa64 !important;
    border-color: #6aaa64 !important;
    color: white !important;
}

/* Jaune : Mal placé */
.jaune, td.jaune, .key.jaune {
    background-color: #c9b458 !important;
    border-color: #c9b458 !important;
    color: white !important;
}

/* Gris : Absent */
.gris, td.gris, .key.gris {
    background-color: #787c7e !important;
    border-color: #787c7e !important;
    color: white !important;
}

/* --- MESSAGES ET CONTRÔLES --- */

.status-messages {
    min-height: 40px;
    margin-bottom: 20px;
    text-align: center;
}

.alert {
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
}

.error { background-color: #f8d7da; color: #721c24; }
.success { background-color: #d4edda; color: #155724; }
.fail { background-color: #e2e3e5; color: #383d41; }

.controls {
    margin-top: 10px;
}

.input-guess {
    padding: 10px;
    font-size: 1.2rem;
    border: 2px solid #d3d6da;
    border-radius: 4px;
    width: 150px;
    text-align: center;
    text-transform: uppercase;
}

.btn-submit {
    padding: 10px 20px;
    font-size: 1.2rem;
    background-color: #1a1a1b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.btn-reset {
    background: none;
    border: none;
    color: #787c7e;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 15px;
}

.perf-cell {
    padding-left: 15px;
    vertical-align: middle;
}

.perf-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 0.8rem;
    color: white;
}

/* Rouge : Coup raté */
.perf-blunder {
    background-color: #fa412d;
    box-shadow: 0 2px 0 #b12e1f;
}

/* Vert : Coup normal */
.perf-good {
    background-color: #81b64c;
    box-shadow: 0 2px 0 #5b8136;
}

/* Bleu : Brillant */
.perf-brilliant {
    background-color: #1ba0e1;
    box-shadow: 0 2px 0 #12709e;
}