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

h1 {
    color: #333;
    margin-bottom: 20px;
}

#instructions {
    margin-bottom: 20px;
    text-align: center;
    color: #666;
    max-width: 600px;
}

#board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    width: 480px;
    height: 480px;
    border: 2px solid #333;
    background: #fff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.square.white {
    background-color: #f0d9b5;
}

.square.black {
    background-color: #b58863;
}

.square.selected {
    background-color: rgba(123, 97, 255, 0.5) !important;
}

.square:hover {
    box-shadow: inset 0 0 0 2px rgba(123, 97, 255, 0.5);
}

.piece {
    width: 55px;
    height: 55px;
    position: relative;
    cursor: grab;
    user-select: none;
    z-index: 1;
    transition: transform 0.2s;
    pointer-events: none;
}

.piece:active {
    cursor: grabbing;
    transform: scale(1.1);
}

.explosion {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, rgba(255,165,0,0.8) 0%, rgba(255,0,0,0.8) 50%, transparent 100%);
    animation: explode 0.5s ease-out forwards;
    z-index: 2;
}

@keyframes explode {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

#game-status {
    margin-top: 20px;
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: bold;
    min-width: 300px;
    text-align: center;
}

.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.difficulty-selector {
    margin: 20px 0;
}

.difficulty-selector label {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

.difficulty-selector input {
    width: 60px;
    padding: 5px;
    font-size: 16px;
    text-align: center;
}

#start-game {
    background-color: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

#start-game:hover {
    background-color: #45a049;
}

.control-button {
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.control-button:hover {
    background-color: #c0392b;
}

.control-button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}
