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

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    padding: 20px;
}

header {
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    color: #333;
}

.game-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

button {
    padding: 8px 16px;
    background-color: #4a7bcc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.1s;
}

button:hover {
    background-color: #3a61a0;
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    background-color: #95acd1;
    cursor: not-allowed;
}

.game-info {
    display: flex;
    justify-content: space-between;
    width: 500px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: bold;
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 500px;
    height: 500px;
    border: 4px solid #333;
    margin-bottom: 20px;
    position: relative;
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    cursor: pointer;
    position: relative;
    user-select: none;
}

.white {
    background-color: #f0d9b5;
}

.black {
    background-color: #b58863;
}

.square.selected {
    background-color: #8bb3ff;
}

.square.valid-move {
    position: relative;
}

.square.valid-move::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
}

.captured-pieces {
    display: flex;
    width: 500px;
    justify-content: space-between;
    text-align: center;
    margin-top: 20px;
}

.white-captured, .black-captured {
    width: 48%;
    background-color: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#white-captured-pieces, #black-captured-pieces {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    min-height: 50px;
    font-size: 24px;
}

#mode-selection-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    color: white;
    font-size: 24px;
    text-align: center;
    padding: 20px;
}

#mode-selection-overlay button {
    padding: 12px 24px;
    font-size: 18px;
    background-color: #4a7bcc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    margin: 0 10px;
}

#mode-selection-overlay button:hover {
    background-color: #3a61a0;
    transform: scale(1.05);
}

.square.in-check {
    box-shadow: inset 0 0 0 4px red;
    animation: pulsate 1s infinite alternate;
}

@keyframes pulsate {
    from {
        box-shadow: inset 0 0 0 4px rgba(255, 0, 0, 0.8);
    }
    to {
        box-shadow: inset 0 0 0 4px rgba(255, 0, 0, 0.4);
    }
}

@media (max-width: 550px) {
    .chessboard, .game-info, .captured-pieces {
        width: 100%;
    }
}

#promotion-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.promotion-option {
    font-size: 48px;
    cursor: pointer;
    padding: 10px;
    border-radius: 5px;
    transition: background-color 0.2s, transform 0.1s;
}

.promotion-option:hover {
    background-color: #e6e6e6;
    transform: scale(1.1);
}

.promotion-container {
    display: flex;
    gap: 20px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
} 