body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f4;
    text-align: center;
    margin: 0;
    padding: 0;
}

.container {
    margin: 20px auto;
    max-width: 1000px;
    width: 90%;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.abacus {
    display: flex;
    justify-content: space-evenly;
    flex-wrap: wrap;
    padding: 20px;
    border: 4px solid #7B4F2E; /* Wooden frame color */
    border-radius: 10px;
    background: #F7E6D1; /* Light wood background */
    position: relative;
    max-width: 100%; /* Ensure it fits within the screen width */
}

.rod {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 50px;
    margin: 5px;
}

.rod::before {
    content: '';
    position: absolute;
    width: 2px; /* Thickness of the rod */
    height: 100%;
    background-color: #7B4F2E; /* Rod color */
    left: 50%; /* Center the rod within each column */
    transform: translateX(-50%);
    z-index: 0; /* Places the rod behind the beads *//
}

.upper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Adjust bead spacing within the upper section */
    margin-bottom: 35px; /* Increase the gap between the upper and lower sections */
}

.lower {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; /* Adjust bead spacing within the lower section */
	margin-top: 5px;
}


.abacus::before {
    content: '';
    position: absolute;
    top: 32%; /* Center the line */
    left: 0;
    width: 100%; /* Spans the entire abacus */
    height:6px; /* Thickness of the line */
    background-color: #7B4F2E; /* Matches the abacus frame */
    z-index: 1; /* Ensures the line appears behind the beads */
	
}


.bead {
    width: 60px;
    height: 25px;
    background: #333; /* Dark bead color */
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1; /* Ensures beads appear above the rod */
    transition: transform 0.2s;
}

.bead.active {
    transform: translateY(-20px); /* Move bead up */
    background: #555;
}

.bead.activeUp {
    transform: translateY(20px); /* Move bead down */
    background: #555;
}

.result {
    font-size: 1.2rem;
    color: #555;
    margin-top: 20px;
}


@keyframes slide {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(0);
    }
}
