body {
    background-color: #2c3e50;
    color: white;
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
}

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

.mode-select {
    background: #34495e;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 5px;
}

select {
    padding: 5px;
    border-radius: 4px;
    font-family: inherit;
}

.controls {
    display: flex;
    gap: 10px; /* Reduced gap to fit buttons */
    align-items: center;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.turn-indicator {
    background: #34495e;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: bold;
    border: 2px solid #f1c40f;
}

button {
    padding: 10px 15px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 90vw;
    height: 90vw;
    max-width: 500px;
    max-height: 500px;
    border: 5px solid #5d4037;
    background-color: #ecf0f1;
    transition: transform 0.5s ease; /* Smooth Flip */
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.square.light { background-color: #fcebb6; }
.square.dark { background-color: #8b5a2b; }

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(46, 204, 113, 0.8);
    border-radius: 50%;
    box-shadow: 0 0 8px #2ecc71;
    z-index: 10;
}

.piece.must-jump {
    box-shadow: 0 0 15px 5px yellow;
    z-index: 20;
}

.square.selected {
    background-color: rgba(241, 196, 15, 0.5) !important;
}

/* Pieces */
.piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    box-shadow: 0 3px 5px rgba(0,0,0,0.5);
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.piece.red {
    background: radial-gradient(circle at 30% 30%, #ff6b6b, #c0392b);
    border: 2px solid #96281b;
}

.piece.black {
    background: radial-gradient(circle at 30% 30%, #555, #000);
    border: 2px solid #fff;
}

.piece.king::after {
    content: '👑';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: gold;
    text-shadow: 0 1px 2px black;
}

.info {
    text-align: center;
    font-size: 0.9em;
    color: #bdc3c7;
}

.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 100;
}
.modal-content {
    background: #2c3e50;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid #f1c40f;
}

/* --- FLIP STYLES --- */
.board.flipped { 
    transform: rotate(180deg); 
}
.board.flipped .piece { 
    transform: rotate(180deg); 
}