﻿/* Outer board container */
.puzzle-board-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
}

/* Wrapper: Rank numbers + Board + Rank numbers */
.puzzle-rank-file-wrapper {
    display: flex;
    align-items: center;
}

/* Rank numbers (left + right) */
.puzzle-rank-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0 4px;
    font-size: clamp(10px, 2vw, 16px);
    color: #777;
}

.puzzle-rank {
    height: 12.5%; /* Matches each row height */
    display: flex;
    align-items: center;
}

/* Responsive board wrapper */
.puzzle-chess-board {
    display: grid;
    grid-template-rows: repeat(8, 1fr);
    grid-template-columns: repeat(8, 1fr);
    width: min(100vw, 90vh);
    aspect-ratio: 1 / 1;
    border: 0px solid #444;
    border-radius: 0;
    overflow: hidden;
}

/* Row wrapper (not strictly required, but fine to keep) */
.puzzle-board-row {
    display: contents;
}

/* Individual squares */
.puzzle-square {
    position: relative;
    width: 100%;
    aspect-ratio: 1; /* Perfect square */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 5vw, 30px);
}

/* Colors */
.puzzle-light {
    background: #eeeed2;
}

.puzzle-dark {
    background: #769656;
}

/* Highlight selected square */
.selected-square {
    outline: 3px solid #ffcc00;
    outline-offset: -3px;
}

/* Pieces */
.puzzle-piece {
    font-size: inherit;
    user-select: none;
}

/* Dots showing possible moves */
.possible-move-dot {
    width: 25%;
    height: 25%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

/* MOBILE OPTIMIZATION */
@media (max-width: 480px) {
    .puzzle-rank-labels {
        margin: 0 2px;
        font-size: clamp(8px, 3vw, 14px);
    }
}

.square-label.file-label {
    position: absolute;
    bottom: 2px;
    right: 2px;
    line-height: 1;
    font-size: 12px;
    left: auto;
}

.square-label.square-label-number {
    position: absolute;
    top: 10px;
    right: 2px;
    line-height: 1;
    font-size: 14px;
}