/* ===== GLOBAL ===== */

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #111, #1c1c1c);
    color: #f5f5f5;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    margin-top: 20px;
    letter-spacing: 2px;
    margin-left: 700px;
}

/* ===== LAYOUT ===== */

.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 40px;
    margin-top: 30px;
}

/* ===== BOARD ===== */

#board {
    width: 640px;
    height: 640px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    border: 6px solid #2c2c2c;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

/* ===== SQUARES ===== */

.square {
    aspect-ratio: 1 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 52px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #2c2c2c; /* visible cell borders */
}

/* Light squares */
.light {
    background: #e9e2d0;
}

/* Dark squares */
.dark {
    background: #6b4f3a;
}

/* Hover effect */
.square:hover {
    transform: scale(1.05);
    z-index: 2;
}

/* ===== PIECE COLORS ===== */

.white-piece {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.black-piece {
    color: #111111;
}

/* ===== MOVE HIGHLIGHT ===== */

.highlight {
    box-shadow: inset 0 0 0 4px #3bb273;
}

/* Last move */
.last-move {
    box-shadow: inset 0 0 0 4px #f1c40f;
}

/* King in check */
.check {
    box-shadow: inset 0 0 0 4px #e74c3c;
}

/* ===== SIDE PANEL ===== */

.side-panel {
    width: 280px;
    background: #1f1f1f;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

#status {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* Buttons */
button {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    background: #3bb273;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

button:hover {
    background: #2fa564;
    transform: translateY(-2px);
}

/* Move history */
#history {
    background: #2a2a2a;
    padding: 12px;
    border-radius: 8px;
    height: 420px;
    overflow-y: auto;
    font-size: 14px;
    margin-top: 10px;
    line-height: 1.6;
}

/* ===== PROMOTION MODAL ===== */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #1f1f1f;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.6);
}

.hidden {
    display: none;
}

#promotionChoices span {
    font-size: 48px;
    margin: 15px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#promotionChoices span:hover {
    transform: scale(1.2);
}
