/* Chess Specific Styles */
.chess-main-layout {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

.chess-game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 20px;
}

.chess-header {
    text-align: center;
    width: 100%;
}

.chess-header h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.chess-timer-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0;
}

.timer {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 215, 0, 0.2);
    color: #888;
    min-width: 120px;
    text-align: center;
}

.timer.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    color: var(--primary);
}

.timer.white {
    color: #fff;
}

.timer.black {
    color: #aaa;
}

.chess-board-wrapper {
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    border: 2px solid #444;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    position: relative;
    user-select: none;
}

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

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

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

/* Highlights */
.square.selected {
    background-color: rgba(255, 255, 0, 0.6) !important;
}

.square.possible-move::after {
    content: '';
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 50%;
}

.square.check {
    background-color: rgba(255, 0, 0, 0.5) !important;
}

.square.last-move {
    background-color: rgba(255, 255, 0, 0.3);
}

.piece {
    width: 60px;
    height: 60px;
    position: absolute;
    top: 0;
    left: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    pointer-events: none;
    z-index: 10;
}

.chess-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

/* Side Panel */
.chess-side-panel {
    width: 180px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 20px;
}

.side-panel-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.eval-score-container {
    width: 100%;
    text-align: center;
}

.eval-placeholder {
    font-size: 2rem;
    color: #444;
}

/* Promotion Modal */
#chess-promotion-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.promotion-options {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.promo-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    font-size: 3rem;
    color: white;
    transition: all 0.2s;
}

.promo-btn:hover {
    background: var(--primary);
    color: black;
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    .chess-main-layout {
        flex-direction: column;
        align-items: center;
    }

    .chess-board {
        grid-template-columns: repeat(8, 40px);
        grid-template-rows: repeat(8, 40px);
    }

    .square,
    .piece {
        width: 40px;
        height: 40px;
    }
}