/* =========================
   MOTS MYSTÈRE – STYLE GLOBAL
========================= */

#mots-timer {
    text-align: center;
    font-size: 1.6em;
    margin: 15px 0;
    color: #FFD700;
    font-weight: bold;
}

/* =========================
   GRILLE DU MOT
========================= */

#word-grid {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px auto;
    min-height: 70px;
}

.word-cell {
    width: 60px;
    height: 60px;
    background: #1F1F1F;
    border-radius: 10px;
    border: 2px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.8em;
    font-weight: bold;
    color: #FFF;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

/* États lettres */
.word-cell.correct {
    background: #2ECC71;
    border-color: #2ECC71;
    color: #000;
}

.word-cell.present {
    background: #F1C40F;
    border-color: #F1C40F;
    color: #000;
}

.word-cell.absent {
    background: #555;
    border-color: #444;
    color: #AAA;
}

/* =========================
   CLAVIER
========================= */

.keyboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 520px;
    margin: 20px auto;
}

.key {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #2A2A2A;
    color: #FFF;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s, background 0.2s;
}

.key:hover {
    transform: scale(1.1);
    background: #1E90FF;
}

.key.correct { background: #2ECC71; color:#000; }
.key.present { background: #F1C40F; color:#000; }
.key.absent  { background: #555; color:#AAA; }

/* Touches spéciales */
.key.large {
    width: 90px;
}

/* =========================
   ERREURS & RÉSULTATS
========================= */

#mots-error-counter {
    text-align: center;
    margin: 10px auto;
    font-weight: bold;
    color: #FF6B6B;
}

#mots-result {
    margin: 15px auto;
    padding: 12px;
    max-width: 600px;
    border-radius: 12px;
    text-align: center;
    font-weight: bold;
    display: none;
}

#mots-result.win {
    display: block;
    border: 2px dashed #2ECC71;
    color: #2ECC71;
}

#mots-result.lose {
    display: block;
    border: 2px dashed #FF6B6B;
    color: #FF6B6B;
}

/* =========================
   OVERLAY WIN
========================= */

#mots-win-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
    z-index: 9999;
}

#mots-win-overlay.show {
    opacity: 1;
    pointer-events: all;
}

#mots-win-overlay h1 {
    font-size: 4.5rem;
    color: gold;
    text-shadow: 0 0 20px #fff, 0 0 40px gold;
    animation: pulse 1s infinite alternate;
}

/* ===== ANIMATION FLIP WORDLE ===== */
.word-cell {
    perspective: 800px;
}

.word-cell.flip {
    animation: flip 0.6s ease forwards;
}

@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

/* ===== OVERLAY LOSE ===== */
#mots-lose-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
    z-index: 9999;
}

#mots-lose-overlay.show {
    opacity: 1;
    pointer-events: all;
}

#mots-lose-overlay h1 {
    font-size: 4rem;
    color: #FF6B6B;
    text-shadow: 0 0 20px #FF6B6B;
}

/* Divs résultats */
.cluedo-result-ok,
.cluedo-result-no {
    margin: 10px auto;
    padding: 10px;
    border-radius: 10px;
    max-width: 600px;
    text-align: center;
    font-weight: bold;
    display: none;
}
.cluedo-result-ok {
    border: dashed lightgreen;
}
.cluedo-result-no {
    border: dashed lightcoral;
}

.titre-selection {
    display: block;
    font-weight: bold;
    font-size: 14px;
}

.info-session {
	margin-bottom: 20px;
}

/* =========================
   ANIMATIONS
========================= */

@keyframes pulse {
    from { transform: scale(1); }
    to   { transform: scale(1.3); }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
    .word-cell {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    .key {
        width: 34px;
        height: 34px;
        font-size: 0.9em;
    }

    .key.large {
        width: 70px;
    }

    #mots-timer {
        font-size: 1.3em;
    }
}
