.moves-tree {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid #6c757d;
    border-radius: 4px;
    background: #fff;
}

.moves-table {
    table-layout: fixed;
    border-collapse: collapse;
    border: 1px solid #dee2e6;
    background: #f5f5f5;
    margin-left: auto;
    margin-right: auto;
}

.moves-table td {
    border: 1px solid #dee2e6;
    padding: 2px 6px;
    vertical-align: middle;
}

.moves-table .move-num {
    color: #888;
    font-size: 0.85em;
    user-select: none;
    width: 2.2em;
    min-width: 2.2em;
    text-align: right;
}

.moves-table .ply-cell {
    width: 5.25em;
    min-width: 5.25em;
    text-align: center;
}

.moves-table .ply-cell .ply {
    display: inline-block;
    padding: 2px 6px;
}

.ply {
    cursor: pointer;
    padding: 1px 4px;
    border-radius: 3px;
    transition: background-color 0.15s;
    white-space: nowrap;
}

.ply:hover {
    background-color: #e2e6ea;
}

.ply-active {
    background-color: #b8d4f0;
    font-weight: 600;
}

.start-ref {
    color: #999;
    font-weight: normal;
    letter-spacing: 1px;
}

.start-ref.ply-active {
    color: #555;
}

.variation-row .variation-cell {
    padding-left: 1rem;
    padding-top: 2px;
    padding-bottom: 2px;
    border-left: 2px solid #ccc;
    vertical-align: top;
}

.variation-row .variation-cell .moves-table {
    color: #666;
    font-size: 0.92em;
}

.nav-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.nav-buttons button {
    padding: 0.25rem 1rem;
    font-size: 0.85rem;
    border: 1px solid #6c757d;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s;
}

.nav-buttons button:hover:not(:disabled) {
    background-color: #e9ecef;
}

.nav-buttons button:active:not(:disabled),
.nav-buttons button.keyboard-pressed:not(:disabled) {
    background-color: #d0d4d8;
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
