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

body {
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 560px;
    padding: 10px 20px;
    background: #3d3d3d;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.turn-indicator {
    font-size: 1.4rem;
    color: #f0d9b5;
    font-weight: bold;
}

.reset-btn {
    padding: 10px 20px;
    font-size: 1rem;
    font-family: 'Georgia', serif;
    background: linear-gradient(135deg, #8b7355 0%, #6b5344 100%);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 70px);
    grid-template-rows: repeat(8, 70px);
    border: 8px solid #5c4033;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

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

.piece-img {
    width: 60px;
    height: 60px;
    image-rendering: pixelated;
}

.square.light {
    background: #f0d9b5;
    color: #333;
}

.square.dark {
    background: #b58863;
    color: #333;
}

.square.selected {
    box-shadow: inset 0 0 0 4px #ffff00;
}

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: rgba(0, 128, 0, 0.5);
    border-radius: 50%;
    pointer-events: none;
}

.square.valid-capture {
    box-shadow: inset 0 0 0 4px #ff0000;
}

.square:hover {
    filter: brightness(1.1);
}

.piece {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
}

.piece::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: inset 0 -3px 0 rgba(0,0,0,0.3);
}

.piece.white::before {
    background: linear-gradient(135deg, #fff 0%, #f0f0f0 50%, #ddd 100%);
    border: 2px solid #333;
}

.piece.black::before {
    background: linear-gradient(135deg, #333 0%, #1a1a1a 50%, #000 100%);
    border: 2px solid #fff;
}

.piece.king::after { content: 'K'; }
.piece.queen::after { content: 'Q'; }
.piece.rook::after { content: 'R'; }
.piece.bishop::after { content: 'B'; }
.piece.knight::after { content: 'N'; }
.piece.pawn::after { content: 'P'; }

.piece::after {
    position: relative;
    z-index: 1;
    font-family: Arial Black, sans-serif;
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
}

.piece.white::after { color: #000; }
.piece.black::after { color: #fff; }

.captured-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-height: 50px;
    padding: 10px;
    background: #3d3d3d;
    border-radius: 8px;
    max-width: 560px;
}

.captured-pieces .piece {
    font-size: 30px;
}

.status {
    font-size: 1.2rem;
    color: #f0d9b5;
    padding: 15px 25px;
    background: #3d3d3d;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.status.check {
    color: #ff6b6b;
    animation: pulse 1s infinite;
}

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

@media (max-width: 600px) {
    .board {
        grid-template-columns: repeat(8, 45px);
        grid-template-rows: repeat(8, 45px);
    }
    
    .square {
        width: 45px;
        height: 45px;
    }
    
    .piece {
        width: 40px;
        height: 40px;
    }
    
    .piece::before {
        width: 32px;
        height: 32px;
    }
    
    .piece::after {
        font-size: 18px;
    }
    
    .captured-pieces .piece {
        width: 28px;
        height: 28px;
    }
    
    .captured-pieces .piece::before {
        width: 22px;
        height: 22px;
    }
    
    .captured-pieces .piece::after {
        font-size: 14px;
    }
}