.pagination {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    margin: 12px auto;
    gap: 4px;
}
.pagination .btn {
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--bg-one);
    border: 1px solid var(--accent);
    cursor: pointer;
    transition: all 0.2s ease;
}
.pagination .btn:hover:not(.disabled) {
    background: var(--bg-one);
}
.pagination .btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.pagination .btn.active-page,
.pagination a.active-page {
    background: var(--accent) !important;
    color: var(--bg-one) !important;
    font-weight: bold;
    border-radius: 6px;
    padding: 5px 10px;
}
.pagination input {
    padding: 5px;
    border-radius: 6px;
    border: 1px solid var(--accent);
    width: 60px;
}
button.disabled {
    color: var(--muted);
    opacity: 0.5;
    cursor: not-allowed;
}


.loading {
    display: inline-block;
    margin-left: 12px;
    font-style: italic;
    animation: pulse 1s infinite alternate;
}
@keyframes pulse {
    from { 
        opacity: 0.3; 
    }to { 
        opacity: 1; 
    }
}

.func-bar-top {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 10px 0;
}

.choices { 
    flex-direction: column;
}

.choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custom-choice-wrap {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* .custom-choice-wrap input {
    flex: 1;
    padding: 6px;
} */

.story-image {
    display: block;
    max-width: 100%;
    margin: 12px auto;
    border-radius: 12px;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup {
    background: linear-gradient(180deg, var(--bg-one), var(--bg-two));
    padding: 20px;
    border-radius: 10px;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--accent);
}

.popup p {
    color: var(--accent);
    margin-bottom: 12px;
}

.js-success-popup {
    color: var(--accent);
    background: linear-gradient(180deg, var(--bg-one), var(--bg-two));
    border: none;
    box-shadow: 0 4px 3px 0 rgba(0, 0, 0, 0.2);
} 

.js-success-popup {
    position: fixed;
    top: -60px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 280px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    padding: 5px 10px 5px 10px;
    border-radius: 5px 5px 5px 5px;
    overflow: hidden;
    transition: 0.5s ease-in-out;
    z-index: 2147483647;
}
    
.js-success-popup.active-popup {                          
    top: 40px;
    transition: 0.5s ease-in-out;
}

.loading-anim {
    font-style: italic;
    animation: pulse-anim 1s infinite alternate;
}
@keyframes pulse-anim {
    from { 
        opacity: 0.3; 
    }to { 
        opacity: 1; 
    }
}    

.js-success-top-popup {
    background: var(--panel);
    color: var(--accent);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(20,20,20,0.12);
    position: fixed;
    top: -300px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0px;
    height: 0px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    font-size: 16px;
    padding: 10px;
    transition: 1s ease;
    z-index: 50000;
}
    
.js-success-top-popup.active-top-popup {  
    top: 40px;
    width: 90%;
    height: 50px;
    transition: 1s ease;
}