:root {
    --light-square: #f0d9b5;
    --dark-square: #b58863;
    --highlight-square: #f6f669;
    --arrow-color: rgba(255, 0, 0, 0.7);
}

.pgn-viewer {
    display: flex;
    flex-direction: column;
    align-items: start;
    gap: 0.5rem;
}

.pgn-viewer chess-board {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    --light-color: var(--light-square);
    --dark-color: var(--dark-square);
}

.pgn-viewer .controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pgn-viewer .controls .btn {
    min-width: 2.5rem;
}

.pgn-viewer .move-list {
    max-height: 240px;
    overflow-y: auto;
    list-style: none;
    padding-left: 0;
    margin-bottom: 0;
    display: grid;
    gap: 0.25rem 0.5rem;
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
}

.pgn-viewer .move-list li {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.pgn-viewer .move-list li:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.pgn-viewer .move-list li.active {
    background-color: var(--highlight-square);
    font-weight: 600;
}

.pgn-viewer .arrow-overlay line {
    stroke: var(--arrow-color);
    stroke-width: 4;
    marker-end: url(#arrowhead);
}

.final-position {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

.final-position-board {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1/1;
    --light-color: var(--light-square);
    --dark-color: var(--dark-square);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
