.game-board-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-turn-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.chess-board-wrapper {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    position: relative;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: repeat(8, minmax(0, 1fr));
    width: 400px;
    height: 400px;
    border: 2px solid #fff;
    border-radius: 4px;
    overflow: hidden;
}

.square {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    cursor: default;
    position: relative;
    user-select: none;
    line-height: 1;
}

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

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

/* Coordinates / Columns & Rows */
.square.rank-val::before {
    content: attr(data-rank);
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.8rem;
    font-family: "Outfit", sans-serif;
    color: #5c4033; /* Dark brown for light squares */
    font-weight: 800;
    z-index: 5;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
}
.square.file-val::after {
    content: attr(data-file);
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 0.8rem;
    font-family: "Outfit", sans-serif;
    color: #5c4033;
    font-weight: 800;
    z-index: 5;
    text-shadow: 1px 1px 0 rgba(255,255,255,0.3);
    text-transform: uppercase;
}
.square.dark.rank-val::before, .square.dark.file-val::after {
    color: #f0d9b5; /* Cream for dark squares */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.piece {
    cursor: grab;
    transition: transform 0.1s;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    line-height: 1;
}
.piece:active {
    cursor: grabbing;
}

/* Coloring Pieces */
.piece.w { color: #ffffff; text-shadow: 0 0 2px #000, 2px 2px 4px rgba(0,0,0,0.5); }
.piece.b { color: #000000; text-shadow: 0 0 2px #fff, 2px 2px 4px rgba(0,0,0,0.5); }

/* Highlights */
.square.selected {
    background-color: rgba(16, 185, 129, 0.7) !important;
}

.square.valid-move {
    position: relative;
}
.square.valid-move::before {
    content: '';
    position: absolute;
    width: 25%;
    height: 25%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.square.valid-move:hover {
    background-color: rgba(16, 185, 129, 0.4) !important;
}

.square.last-move {
    background-color: rgba(234, 179, 8, 0.5) !important;
}

/* Promotion Modal */
#promotion-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-dark);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 100;
    text-align: center;
    box-shadow: 0 0 50px rgba(0,0,0,0.9);
}

.promo-pieces {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.promo-pieces span {
    font-size: 3rem;
    cursor: pointer;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.2s;
}
.promo-pieces span:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

@media (max-width: 500px) {
    .chess-board {
        width: 320px;
        height: 320px;
    }
    .square { font-size: 2rem; }
}
