#interactive-soroban {
    text-align: center;
    font-family: "Segoe UI", sans-serif;
    padding: 20px;
}

#soroban-frame {
    display: flex;
    justify-content: center;
    border: 6px solid black;
    margin: 20px auto;
    width: fit-content;
    background: #eee8dc;
    padding: 15px 0;
    position: relative;
    height: 200px;
}

/* Corrected middle rod position */
#soroban-frame::before {
    content: "";
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    height: 10px;
    background-color: black;
    z-index: 1;
}

/* Rods */
.soroban-rod {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 6px;
    position: relative;
}

/* Rod line (black) */
.soroban-rod::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: black;
    z-index: 0;
}

/* Beads */
.soroban-bead {
    width: 36px;
    height: 22px;
    background: #002f6c;
    border: 2px solid #333;
    margin: 3px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 2;
    position: relative;
}

.soroban-bead.upper {
    margin-bottom: 6px;
}

.soroban-bead.lower {
    margin-top: 3px;
}

/* White dots ON middle rod */
.soroban-middle-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    margin: 6px 0;
    position: relative;
    z-index: 3;
}

.soroban-middle-gap {
    height: 8px;
    margin: 6px 0;
}

/* Display & messages */
#soroban-display-value {
    font-size: 32px;
    margin: 10px 0;
    font-weight: bold;
}

#soroban-problem {
    font-size: 24px;
    margin: 10px 0;
}

.correct {
    color: green;
    font-size: 20px;
}

.wrong {
    color: crimson;
    font-size: 20px;
}
#soroban-reset-btn {
    margin: 10px;
    padding: 6px 12px;
    font-size: 16px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#soroban-reset-btn:hover {
    background-color: #222;
}

