.chess-engine-container {
    margin: 20px auto;
    max-width: 900px;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    position: relative;
}

.chess-board-wrapper {
    margin: 0 auto 20px;
    max-width: 100%;
    width: 100%;
    aspect-ratio: 1;
}

/* Dialogue de configuration */
.chess-config-dialog {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.hidden {
    display: none !important;
}

.chess-config-dialog.hidden {
    display: none;
}

.chess-config-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.chess-config-content h3 {
    margin: 0 0 25px 0;
    text-align: center;
    color: #2c3e50;
    font-size: 24px;
}

.chess-config-section {
    margin-bottom: 25px;
}

.chess-config-section label {
    display: block;
    margin-bottom: 12px;
    color: #2c3e50;
    font-weight: 500;
    font-size: 16px;
}

.chess-color-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.color-btn {
    padding: 15px 10px;
    border: 2px solid #ddd;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

.color-btn:hover {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-2px);
}

.color-btn.selected {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.color-icon {
    font-size: 32px;
}

.chess-level-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, #27ae60 0%, #f39c12 50%, #e74c3c 100%);
    outline: none;
    -webkit-appearance: none;
}

.chess-level-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid #3498db;
}

.chess-level-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 3px solid #3498db;
}

.level-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #7f8c8d;
}

.level-value {
    font-weight: bold;
    color: #3498db;
}

.chess-start-btn {
    width: 100%;
    margin-top: 10px;
    padding: 15px;
    font-size: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.chess-start-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Contrôles */
.chess-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.chess-btn {
    padding: 10px 20px;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chess-btn:hover {
    background-color: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.chess-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.chess-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.chess-status {
    text-align: center;
    padding: 15px;
    background-color: #ecf0f1;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chess-status.thinking {
    background-color: #3498db;
    color: white;
}

.chess-status.checkmate {
    background-color: #e74c3c;
    color: white;
}

.chess-status.draw {
    background-color: #95a5a6;
    color: white;
}

.chess-status.check {
    background-color: #f39c12;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .chess-engine-container {
        margin: 10px;
    }
    
    .chess-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .chess-config-content {
        padding: 20px;
    }
    
    .color-btn {
        padding: 12px 8px;
        font-size: 12px;
    }
    
    .color-icon {
        font-size: 24px;
    }
}
