/* 国际跳棋游戏样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 800px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #333;
    font-size: 2.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

/* 游戏设置面板 */
.game-settings {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.setting-group label {
    font-weight: bold;
    color: #495057;
    min-width: 80px;
}

.setting-btn {
    padding: 8px 16px;
    border: 2px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.setting-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.setting-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.computer-side {
    display: none;
    align-items: center;
    gap: 10px;
}

.game-controls {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

#new-game {
    background: #28a745;
    color: white;
}

#new-game:hover {
    background: #218838;
    transform: translateY(-1px);
}

#surrender {
    background: #dc3545;
    color: white;
}

#surrender:hover {
    background: #c82333;
    transform: translateY(-1px);
}

#undo {
    background: #ffc107;
    color: #212529;
}

#undo:hover {
    background: #e0a800;
    transform: translateY(-1px);
}

/* 游戏信息 */
.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.turn-info {
    font-weight: bold;
    color: #495057;
}

#current-turn {
    color: #007bff;
    font-size: 1.1em;
}

.capture-info {
    display: flex;
    gap: 20px;
    font-weight: 500;
    color: #6c757d;
}

.status-message {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.9em;
}

/* 棋盘样式 */
.board {
    display: grid;
    gap: 1px;
    background: #8b4513;
    border: 3px solid #654321;
    border-radius: 8px;
    padding: 10px;
    margin: 0 auto;
    width: 500px;
    height: 500px;
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.square.light {
    background: #f0d9b5;
}

.square.dark {
    background: #b58863;
}

.square.dark:hover {
    background: #a67c52;
}

/* 棋子样式 */
.piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    border: 3px solid #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.piece:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.piece.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #e0e0e0);
    color: #333;
    border-color: #666;
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #444, #222);
    color: #fff;
    border-color: #000;
}

.piece.king::after {
    content: '♔';
    position: absolute;
    font-size: 1.5em;
    color: #ffd700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 高亮样式 */
.square.selected {
    background: #ffeb3b !important;
    box-shadow: inset 0 0 0 3px #ff9800;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.square.valid-move {
    background: #4caf50 !important;
    box-shadow: inset 0 0 0 3px #2e7d32;
}

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    opacity: 0.8;
}

.square.must-jump {
    background: #f44336 !important;
    box-shadow: inset 0 0 0 3px #d32f2f;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.7; }
}

/* 最后一步移动痕迹样式 */
.square.last-move-from {
    background: #ff9800 !important;
    box-shadow: inset 0 0 0 3px #f57c00;
}

.square.last-move-from::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 2px dashed #fff;
    border-radius: 4px;
    pointer-events: none;
}

.square.last-move-to {
    background: #2196f3 !important;
    box-shadow: inset 0 0 0 3px #1976d2;
}

.square.last-move-to::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border: 2px solid #fff;
    border-radius: 4px;
    pointer-events: none;
}

/* 游戏结束模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

#play-again {
    background: #007bff;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#play-again:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    .board {
        width: 400px;
        height: 400px;
    }
    
    .game-settings {
        flex-direction: column;
        gap: 15px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .capture-info {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .board {
        width: 320px;
        height: 320px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .piece {
        font-size: 1em;
    }
    
    .piece.king::after {
        font-size: 1.2em;
    }
}