/* "Recently Updated" home section — grouped +N chapter cards, hover/tap popup. */

#recent-updated-section .recent-updated-skeleton {
    display: none;
}

#recent-updated-section.is-loading .recent-updated-content {
    display: none;
}

#recent-updated-section.is-loading .recent-updated-skeleton {
    display: block;
}

/* ── grouped "+N" chapter cards ─────────────────────────────── */
#recent-updated-section .rc-group {
    position: relative;
}

#recent-updated-section .rc-group:hover,
#recent-updated-section .rc-group.is-open {
    z-index: 50;
}

#recent-updated-section .rc-card {
    position: relative;
    z-index: 1;
}

/* a sheet of "paper" peeking out behind a multi-chapter card */
#recent-updated-section .rc-group.has-more::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: -4px;
    height: 12px;
    border-radius: 0 0 12px 12px;
    background: #101012;
    border: 1px solid rgba(255, 255, 255, .06);
    border-top: 0;
    z-index: 0;
}

#recent-updated-section .rc-more {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 1px 4px rgba(124, 58, 237, .4);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

#recent-updated-section .rc-more:hover {
    filter: brightness(1.1);
}

/* no count pill (lone new chapter) but earlier chapters exist —
   a plain chevron that still opens the popup */
#recent-updated-section .rc-more.rc-more-plain {
    padding: 0 3px;
    background: rgba(255, 255, 255, .08);
    color: rgba(255, 255, 255, .5);
    box-shadow: none;
}

#recent-updated-section .rc-more.rc-more-plain:hover {
    filter: none;
    background: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .85);
}

#recent-updated-section .rc-more.rc-more-plain svg {
    width: 10px;
    height: 10px;
    transition: transform .15s ease;
}

#recent-updated-section .rc-group.is-open .rc-more-plain svg,
#recent-updated-section .rc-group:hover .rc-more-plain svg {
    transform: rotate(180deg);
}

#recent-updated-section .rc-pop {
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    right: 0;
    z-index: 40;
    padding: 8px;
    border-radius: 12px;
    background: #16161a;
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 20px 44px rgba(0, 0, 0, .55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

#recent-updated-section .rc-group:hover .rc-pop,
#recent-updated-section .rc-group.is-open .rc-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#recent-updated-section .rc-pop-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 240px;
    overflow-y: auto;
}

#recent-updated-section .rc-pop-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
    transition: background .12s, color .12s;
}

#recent-updated-section .rc-pop-row:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

#recent-updated-section .rc-pop-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

#recent-updated-section .rc-pop-ch {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#recent-updated-section .rc-pop-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    white-space: nowrap;
}

#recent-updated-section .rc-pop-clock {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, .25);
}

#recent-updated-section .rc-pop-rel {
    color: rgba(255, 255, 255, .4);
}

#recent-updated-section .rc-pop-sep {
    color: rgba(255, 255, 255, .15);
}

#recent-updated-section .rc-pop-date {
    color: rgba(255, 255, 255, .28);
}

#recent-updated-section .rc-pop-ic {
    width: 13px;
    height: 13px;
    display: block;
    flex-shrink: 0;
}

#recent-updated-section .rc-pop-coins {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    color: #a78bfa;
    font-weight: 700;
    font-size: 12px;
    flex-shrink: 0;
}

#recent-updated-section .rc-pop-more {
    display: block;
    margin-top: 4px;
    padding: 7px 8px;
    border-top: 1px solid rgba(255, 255, 255, .06);
    font-size: 12px;
    font-weight: 600;
    color: #a78bfa;
    text-align: center;
}

#recent-updated-section .rc-pop-more:hover {
    color: #c4b5fd;
}

/* touch: :hover sticks after a tap, so let only .is-open drive the popup */
@media (hover: none) {

    #recent-updated-section .rc-group:hover .rc-pop {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
    }

    #recent-updated-section .rc-group.is-open .rc-pop {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}
