/* ================================
   Chess Game Styles
   ================================ */

#chess-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

#board {
    width: min(90vw, 600px);
    aspect-ratio: 1 / 1;
    max-width: 600px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    border: 3px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    user-select: none;
    margin: 0 auto;
}

.square {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.5rem, 4vw, 3.5rem);
    cursor: pointer;
    position: relative;
    transition: background-color 150ms ease;
    box-sizing: border-box;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

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

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

.square.selected {
    background-color: #829769 !important;
}

.square.valid-move {
    position: relative;
}

.square.valid-move::after {
    content: '';
    position: absolute;
    width: 25%;
    height: 25%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.square.valid-move.capture::after {
    width: 80%;
    height: 80%;
    background-color: transparent;
    border: 3px solid rgba(0, 0, 0, 0.3);
}

.square.last-move {
    background-color: rgba(255, 255, 102, 0.5) !important;
}

.square.piece-white {
    color: #ffffff;
    text-shadow:
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        -1px 0 0 #000,
        1px 0 0 #000,
        0 -1px 0 #000,
        0 1px 0 #000;
    font-weight: bold;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.square.piece-black {
    color: #000000;
    text-shadow:
        -2px -2px 0 #fff,
        2px -2px 0 #fff,
        -2px 2px 0 #fff,
        2px 2px 0 #fff,
        -1px 0 0 #fff,
        1px 0 0 #fff,
        0 -1px 0 #fff,
        0 1px 0 #fff;
    font-weight: bold;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.3));
}

#status {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    min-height: 2rem;
    color: var(--text-dark);
}

#analysis-result {
    padding: var(--spacing-md);
    background: var(--bg-lighter);
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    min-height: 3rem;
    border-left: 4px solid var(--primary-purple);
}

#analysis-result.thinking {
    color: var(--text-light);
    font-style: italic;
}

#game-info {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    flex-wrap: wrap;
}

/* Chess mobile adjustments */
@media (max-width: 768px) {
    #board {
        width: min(95vw, 500px);
    }

    .square {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
    }

    #analysis-result {
        font-size: 0.9rem;
    }
}
