/* Back-to-top button */
.kdrama-back-to-top {
    position: fixed;
    right: clamp(14px, 2.2vw, 28px);
    bottom: clamp(14px, 2.2vw, 28px);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #0d2f3f 0%, #3ec2cf 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(13, 47, 63, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px) scale(0.95);
    transition: opacity 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    z-index: 9999;
}

.kdrama-back-to-top svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.kdrama-back-to-top.kdrama-back-to-top--visible,
.kdrama-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.kdrama-back-to-top:hover {
    background: linear-gradient(135deg, #114259 0%, #48d3e0 100%);
    box-shadow: 0 14px 28px rgba(13, 47, 63, 0.34);
    transform: translateY(-2px);
}

.kdrama-back-to-top:active {
    transform: translateY(0);
}

.kdrama-back-to-top:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(62, 194, 207, 0.4), 0 10px 24px rgba(13, 47, 63, 0.28);
}

@media (max-width: 600px) {
    .kdrama-back-to-top {
        width: 44px;
        height: 44px;
        right: 14px;
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kdrama-back-to-top {
        transition: none;
    }
}
