.fill_choice {
    display: inline-block;
    position: relative;
    vertical-align: middle;
}

.fill_choice .current_selected {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 52px;
    min-height: calc(1lh + 12px);
    cursor: pointer;
    border: var(--border);
    border-bottom-width: 4px;
    padding: 3px 10px !important;
    margin: 4px 3px;
    border-radius: 12px;
    transition: border-color .18s ease;
}

.fill_choice.opened .current_selected {
    border-color: var(--accent);
}

.fill_choice .current_selected_value:empty { display: none; }

.fill_choice .fill_choice_chevron {
    display: block;
    flex: 0 0 auto;
    margin-top: 0;
    color: var(--secondary);
    opacity: .55;
    transform: translateY(2px);
}

.fill_choice .current_selected_value:not(:empty) + .fill_choice_chevron { display: none; }

.fill_choice.fill_choice_wrong .current_selected {
    color: var(--red) !important;
    border-color: var(--red) !important;
    background: var(--transp_red) !important;
}

.fill_choice .current_selected.correct_answered {
    pointer-events: none;
    color: var(--green) !important;
    border: 2px solid var(--transp_green) !important;
    border-bottom-width: 4px !important;
    background: var(--transp_green) !important;
}

.fill_choice .dropdown {
    display: none;
    width: max-content;
    max-width: calc(100vw - 32px);
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    overflow: hidden;
    border: var(--border);
    border-radius: 12px;
    background-color: var(--white);
    box-shadow:
        0 10px 28px rgba(48, 53, 69, .22),
        0 2px 8px rgba(48, 53, 69, .14);
    transform: translate(-50%, 0);
}

.fill_choice.opened .dropdown {
    display: block;
    z-index: 7;
    animation: fill-choice-dropdown-enter .16s ease-out;
}

.fill_choice.opened::before,
.fill_choice.opened::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 0;
    height: 0;
    z-index: 8;
    pointer-events: none;
    animation: fill-choice-dropdown-enter .16s ease-out;
}

.fill_choice.opened::before {
    top: calc(100% + 2px);
    margin-left: -9px;
    border-right: 9px solid transparent;
    border-bottom: 9px solid var(--lightgray);
    border-left: 9px solid transparent;
}

.fill_choice.opened::after {
    top: calc(100% + 5px);
    margin-left: -6px;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--white);
    border-left: 6px solid transparent;
}

.fill_choice.left .dropdown { left: 0; transform: none; }
.fill_choice.right .dropdown { right: 0; left: auto; transform: none; }

.fill_choice .dropdown div {
    padding: 8px 14px;
    border: none;
    cursor: pointer;
    text-align: center;
}

.fill_choice .dropdown div:hover {
    background-color: var(--secondary_background);
}

.fill_choice.opened:has(.dropdown div:first-child:hover)::after {
    border-bottom-color: var(--secondary_background);
}

.fill_choice .dropdown div.active {
    background-color: var(--accent);
    color: var(--white);
}

@keyframes fill-choice-dropdown-enter {
    from {
        opacity: 0;
        translate: 0 -4px;
    }

    to {
        opacity: 1;
        translate: 0 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fill_choice.opened .dropdown,
    .fill_choice.opened::before,
    .fill_choice.opened::after {
        animation: none;
    }
}
