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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 50%, #CD853F 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.game-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    padding: 20px;
    text-align: center;
    max-width: 700px;
    width: 95%;
}

h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 15px 0;
    padding: 12px;
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    border-radius: 10px;
    color: white;
    flex-wrap: wrap;
    gap: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.info-label {
    font-size: 0.8em;
    opacity: 0.9;
    margin-bottom: 3px;
}

.info-value {
    font-size: 1.1em;
    font-weight: bold;
}

.current-player {
    padding: 4px 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.2);
    font-weight: bold;
    transition: all 0.3s ease;
}

.current-player.red {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.current-player.black {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
}

.controls {
    margin: 15px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.ai-active {
    background: linear-gradient(135deg, #26de81 0%, #20bf6b 100%);
}

.game-board {
    margin: 20px auto;
    display: inline-block;
}

.board-container {
    padding: 20px;
    background: linear-gradient(135deg, #654321 0%, #8B4513 100%);
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    gap: 0;
    border: 4px solid #654321;
    border-radius: 8px;
    overflow: hidden;
}

.square {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.square.light {
    background: #f5deb3;
}

.square.dark {
    background: #8b4513;
}

.square.valid-move {
    background: rgba(34, 197, 94, 0.6) !important;
    border: 2px solid #22c55e;
    animation: validMovePulse 1s infinite;
}

@keyframes validMovePulse {
    0%, 100% { box-shadow: 0 0 10px rgba(34, 197, 94, 0.3); }
    50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.6); }
}

.square.selected {
    background: rgba(239, 68, 68, 0.6) !important;
    border: 2px solid #ef4444;
}

.square.last-move {
    background: rgba(59, 130, 246, 0.6) !important;
    border: 2px solid #3b82f6;
}

.piece {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.piece.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #dc2626);
    border: 3px solid #991b1b;
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #4b5563, #1f2937);
    border: 3px solid #111827;
}

.piece.king {
    font-size: 20px;
    background: radial-gradient(circle at 30% 30%, #fbbf24, #f59e0b);
    border: 3px solid #d97706;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.piece.king::before {
    content: '👑';
}

.piece:hover {
    transform: scale(1.1);
    z-index: 10;
}

.piece.selected {
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
    z-index: 15;
}

.piece.moving {
    animation: pieceMove 0.5s ease;
}

@keyframes pieceMove {
    0% { transform: scale(1.15); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1); }
}

.piece.captured {
    animation: pieceCaptured 0.5s ease-out forwards;
}

@keyframes pieceCaptured {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5) rotate(360deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(720deg);
        opacity: 0;
    }
}

.game-status-panel {
    margin: 20px 0;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.status-message {
    font-size: 1.1em;
    font-weight: bold;
    color: #4a5568;
    padding: 10px 20px;
    background: #f7fafc;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
}

.thinking-indicator {
    font-size: 1em;
    color: #8B4513;
    padding: 8px 16px;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 15px;
    animation: thinking 1.5s infinite;
}

@keyframes thinking {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.victory-message, .rules-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #8B4513 0%, #CD853F 100%);
    color: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    z-index: 1000;
    animation: modalAppear 0.5s ease;
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.victory-message h2 {
    font-size: 2em;
    margin-bottom: 20px;
    animation: victoryText 2s infinite;
}

@keyframes victoryText {
    0%, 100% { color: #FFD700; }
    50% { color: #FFA500; }
}

.victory-stats {
    margin: 20px 0;
    font-size: 1.1em;
}

.victory-stats div {
    margin: 8px 0;
}

.rules-modal h2 {
    margin-bottom: 20px;
    color: #FFD700;
}

.rules-modal .rules-content {
    text-align: left;
    margin: 20px 0;
    line-height: 1.6;
}

.rules-modal .rules-content h3 {
    color: #FFA500;
    margin: 15px 0 10px 0;
}

.rules-modal .rules-content ul {
    margin-left: 20px;
}

.rules-modal .rules-content li {
    margin: 5px 0;
}

.instructions {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #FF6B6B 0%, #4ECDC4 100%);
    border-radius: 15px;
    color: white;
    text-align: left;
}

.instructions h3 {
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.instructions ul {
    margin-left: 20px;
    line-height: 1.6;
}

.instructions li {
    margin: 8px 0;
}

.instructions li strong {
    color: #FFD700;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        width: 98%;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .game-info {
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
    }
    
    .info-item {
        min-width: 60px;
    }
    
    .info-label {
        font-size: 0.7em;
    }
    
    .info-value {
        font-size: 1em;
    }
    
    .controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    button {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .checkers-board {
        grid-template-columns: repeat(8, 45px);
        grid-template-rows: repeat(8, 45px);
    }
    
    .square {
        width: 45px;
        height: 45px;
    }
    
    .piece {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .piece.king {
        font-size: 14px;
    }
    
    .instructions {
        text-align: center;
        padding: 15px;
    }
    
    .instructions ul {
        margin-left: 0;
        list-style-position: inside;
    }
    
    .instructions li {
        font-size: 0.9em;
    }
    
    .victory-message, .rules-modal {
        padding: 30px 20px;
    }
    
    .status-message {
        font-size: 1em;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    .checkers-board {
        grid-template-columns: repeat(8, 35px);
        grid-template-rows: repeat(8, 35px);
    }
    
    .square {
        width: 35px;
        height: 35px;
    }
    
    .piece {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .piece.king {
        font-size: 12px;
    }
    
    .info-item {
        min-width: 50px;
    }
    
    .info-label {
        font-size: 0.6em;
    }
    
    .info-value {
        font-size: 0.9em;
    }
    
    button {
        padding: 6px 12px;
        font-size: 11px;
    }
}