* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

.subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    font-weight: 300;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.95);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.player-info {
    display: flex;
    gap: 30px;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.player.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    transform: scale(1.05);
}

.player-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.player-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.game-status {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.game-board {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.board-container {
    background: rgba(255,255,255,0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

/* Nouveau style pour le plateau Fanorona avec intersections */
.board {
    position: relative;
    width: 450px;
    height: 250px;
    background: #DEB887;
    border: 3px solid #8B4513;
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0;
    padding: 20px;
}

/* Lignes de connexion entre les intersections */
.board::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background-image: 
        /* Lignes horizontales */
        linear-gradient(to right, #8B4513 1px, transparent 1px),
        linear-gradient(to right, #8B4513 1px, transparent 1px),
        linear-gradient(to right, #8B4513 1px, transparent 1px),
        linear-gradient(to right, #8B4513 1px, transparent 1px),
        /* Lignes verticales */
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px),
        linear-gradient(to bottom, #8B4513 1px, transparent 1px);
    background-size: 
        47.5px 1px, 47.5px 1px, 47.5px 1px, 47.5px 1px,
        1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px, 1px 47.5px;
    background-position: 
        0 0, 0 47.5px, 0 95px, 0 142.5px,
        0 0, 47.5px 0, 95px 0, 142.5px 0, 190px 0, 237.5px 0, 285px 0, 332.5px 0, 380px 0, 427.5px 0;
    pointer-events: none;
    z-index: 1;
}

/* Diagonales pour les intersections centrales */
.board::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    background-image: 
        /* Diagonales principales */
        linear-gradient(45deg, transparent calc(50% - 0.5px), #8B4513 calc(50% - 0.5px), #8B4513 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
        linear-gradient(-45deg, transparent calc(50% - 0.5px), #8B4513 calc(50% - 0.5px), #8B4513 calc(50% + 0.5px), transparent calc(50% + 0.5px));
    background-size: 47.5px 47.5px;
    background-position: 47.5px 47.5px, 47.5px 47.5px;
    pointer-events: none;
    z-index: 1;
}

.cell {
    width: 40px;
    height: 40px;
    background: #DEB887;
    border: 2px solid #A0522D;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    margin: auto;
}

.cell:hover {
    background: #F4A460;
    transform: scale(1.1);
}

.cell.selected {
    background: #FFD700;
    border-color: #FFA500;
    box-shadow: 0 0 15px rgba(255,215,0,0.7);
}

.cell.valid-move {
    background: #90EE90;
    border-color: #32CD32;
    box-shadow: 0 0 10px rgba(144,238,144,0.5);
}

.cell.player1 {
    background: #FF6B6B;
    border-color: #C44569;
    box-shadow: 0 0 10px rgba(255,107,107,0.5);
}

.cell.player2 {
    background: #4ECDC4;
    border-color: #00B894;
    box-shadow: 0 0 10px rgba(78,205,196,0.5);
}

.cell::before {
    content: '';
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: inherit;
    border: 2px solid rgba(255,255,255,0.3);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.btn-info {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.rules-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.rules-content h3 {
    color: #667eea;
    margin: 20px 0 10px 0;
}

.rules-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.rules-content li {
    margin-bottom: 5px;
}

.rules-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
    }
    
    .player-info {
        gap: 15px;
    }
    
    .board {
        width: 350px;
        height: 200px;
    }
    
    .cell {
        width: 30px;
        height: 30px;
    }
    
    .cell::before {
        width: 18px;
        height: 18px;
    }
    
    .controls {
        gap: 10px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .board {
        width: 280px;
        height: 160px;
    }
    
    .cell {
        width: 25px;
        height: 25px;
    }
    
    .cell::before {
        width: 15px;
        height: 15px;
    }
}

/* Animation pour les captures */
@keyframes capture {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

.cell.capturing {
    animation: capture 0.5s ease-out forwards;
}

/* Animation pour les mouvements */
@keyframes move {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.cell.moving {
    animation: move 0.3s ease-in-out;
} 