* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    min-height: 100vh;
    color: #333;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.game-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.game-info {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rules, .game-status, .controls, .move-history {
    margin-bottom: 20px;
}

.rules h3, .game-status h3, .move-history h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 5px;
}

.rules p, .game-status p {
    margin-bottom: 8px;
    line-height: 1.4;
}

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

.btn {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

#historyList {
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 5px;
}

.history-item {
    padding: 3px 0;
    border-bottom: 1px solid #eee;
}

.game-board-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.board-legend {
    text-align: center;
    margin-bottom: 15px;
    font-weight: bold;
    color: #2c3e50;
}

.game-board {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    aspect-ratio: 1;
}

.cell {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid #34495e;
    border-radius: 50%;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 10px;
    font-weight: bold;
    color: #7f8c8d;
}

.cell:hover {
    background: #d5dbdb;
    transform: scale(1.1);
}

.cell.refuge {
    background: #e8f5e8;
    border-color: #27ae60;
}

.cell.selected {
    background: #f39c12;
    border-color: #d68910;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.6);
    transform: scale(1.2);
}

.cell.possible-move {
    background: #85c1e9;
    border-color: #3498db;
    animation: pulse 1s infinite;
}

.cell.capture-move {
    background: #f1948a;
    border-color: #e74c3c;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.piece {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.piece.cat {
    color: #e74c3c;
    font-size: 24px;
}

.piece.mouse {
    color: #8e44ad;
    font-size: 16px;
}

.connection {
    position: absolute;
    background: #bdc3c7;
    height: 2px;
    transform-origin: left center;
    pointer-events: none;
    z-index: 1;
}

.piece-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.legend-item .piece {
    width: 30px;
    height: 30px;
    border: 2px solid #34495e;
    border-radius: 50%;
    background: #ecf0f1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    pointer-events: none;
}

.message {
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    transform: scale(1);
}

.message.success {
    background: #2ecc71;
    color: white;
}

.message.error {
    background: #e74c3c;
    color: white;
}

.message.info {
    background: #3498db;
    color: white;
}

.message.warning {
    background: #f39c12;
    color: white;
}

/* Responsive design */
@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-info {
        order: 2;
    }
    
    .controls {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .game-container {
        padding: 0 10px;
    }
    
    .cell {
        width: 30px;
        height: 30px;
        font-size: 8px;
    }
    
    .piece {
        font-size: 16px;
    }
    
    .piece.cat {
        font-size: 18px;
    }
    
    .controls {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 8px 10px;
    }
}

/* Animations pour les déplacements */
.piece.moving {
    animation: movepiece 0.5s ease-in-out;
}

@keyframes movepiece {
    0% { transform: scale(1); }
    50% { transform: scale(1.5); }
    100% { transform: scale(1); }
}

/* Effet de capture */
.piece.captured {
    animation: capture 0.6s ease-in-out forwards;
}

@keyframes capture {
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(1.3) rotate(180deg); opacity: 0.5; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}
