body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    user-select: none;
}

.hidden { display: none !important; }

/* --- STYLE DES MENUS D'ACCUEIL --- */
#menu-screen {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.menu-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.menu-content h1 {
    font-size: 3rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.menu-subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.menu-btn {
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background-color: #3498db;
    color: white;
    transition: background 0.2s, transform 0.1s;
}

.menu-btn:hover { background-color: #2980b9; transform: translateY(-2px); }
#btn-ai-menu { background-color: #9b59b6; }
#btn-ai-menu:hover { background-color: #8e44ad; }

/* Boutons Difficultés */
#difficulty-section {
    margin-top: 30px;
    border-top: 2px solid #ecf0f1;
    padding-top: 20px;
    animation: fadeIn 0.3s ease-in;
}

.difficulty-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.diff-btn {
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: white;
    transition: opacity 0.2s, transform 0.1s;
}

.diff-btn:hover { opacity: 0.9; transform: scale(1.02); }
.diff-btn.easy { background-color: #2ecc71; }
.diff-btn.medium { background-color: #f1c40f; color: #333; }
.diff-btn.hard { background-color: #e67e22; }
.diff-btn.expert { background-color: #e74c3c; }

/* --- INTÉRIEURE DU JEU --- */
#game-container { text-align: center; }
#game-container h2 { color: #2c3e50; margin: 0 0 5px 0; }
#status { font-size: 1.2rem; font-weight: bold; margin-bottom: 15px; height: 25px; }

.player1-text { color: #e74c3c; }
.player2-text { color: #f1c40f; }

#board {
    display: grid;
    grid-template-columns: repeat(7, 70px);
    grid-template-rows: repeat(6, 70px);
    gap: 10px;
    background-color: #2c3e50;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    margin: 0 auto 20px auto;
    position: relative;
    overflow: hidden;
}

.cell { background-color: #f0f2f5; border-radius: 50%; cursor: pointer; position: relative; z-index: 2; }
.cell.player1 { background-color: #e74c3c; cursor: not-allowed; }
.cell.player2 { background-color: #f1c40f; cursor: not-allowed; }

/* Animation de chute */
.animated-token {
    position: absolute;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    z-index: 1;
    animation: dropDown 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}
.animated-token.p1 { background-color: #e74c3c; }
.animated-token.p2 { background-color: #f1c40f; }

@keyframes dropDown {
    0% { transform: translateY(-80px); }
    85% { transform: translateY(calc(var(--drop-stretch) + 4px)); }
    100% { transform: translateY(var(--drop-stretch)); }
}

/* Contrôles du jeu */
.game-controls { display: flex; justify-content: center; gap: 15px; }
#restart-btn, #menu-back-btn, #end-restart-btn, #end-menu-btn {
    padding: 10px 20px; font-size: 1rem; font-weight: bold; border: none; border-radius: 5px; cursor: pointer; color: white;
}
#restart-btn { background-color: #34495e; }
#menu-back-btn, #end-menu-btn { background-color: #7f8c8d; }
#end-restart-btn { background-color: #2ecc71; font-size: 1.2rem; }

/* Écran de fin */
#end-screen { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background-color: rgba(44, 62, 80, 0.85); display: flex; justify-content: center; align-items: center; z-index: 10; }
.end-content { background: white; padding: 40px 60px; border-radius: 15px; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.5); animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.end-content h2 { font-size: 2.5rem; margin-bottom: 25px; }
.win-title { color: #2ecc71; }
.lose-title { color: #e74c3c; }
.draw-title { color: #7f8c8d; }

@keyframes popIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }