@charset "UTF-8";

/* ==========================================================================
   Movie Review Critic "Cocoon Custom: Lavity Edition"
   Component: Back to Top Button (ちびラビティぴょこっと出現 ＆ 吹き出し)
   ========================================================================== */

/* 1. ボタン本体 */
.go-to-top-button {
    overflow: visible !important;
    position: fixed !important;
    right: 40px !important;
    bottom: 40px !important;
    z-index: 9999 !important;
    transition: all 0.3s ease !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    width: 150px !important;
    height: 150px !important;
    padding: 0 !important;
    cursor: pointer !important;
}

/* 元のボタン内部の矢印アイコンやテキストを完全に消去 */
.go-to-top-button span,
.go-to-top-button::before,
.go-to-top-button::after {
    display: none !important;
}

/* 2. ちびラビティキャラクター画像 */
.oslp-back-to-top-character {
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%) translateY(80px) scale(0.4);
    width: 150px;
    height: 150px;
    pointer-events: none;
    opacity: 0;
    z-index: 1;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
    transform-origin: bottom center;
}

.oslp-back-to-top-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    image-rendering: auto !important;
}

/* 3. セリフ吹き出し */
.oslp-back-to-top-balloon {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: #ffffff;
    color: var(--ojou-green, #0c4c33);
    border: 2px solid var(--ojou-green, #0c4c33);
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(12, 76, 51, 0.15);
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
}

/* 吹き出しの三角部分（内側の白） */
.oslp-back-to-top-balloon::after {
    content: '' !important;
    position: absolute !important;
    bottom: -7px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-width: 8px 6px 0 !important;
    border-style: solid !important;
    border-color: #ffffff transparent transparent !important;
    display: block !important;
    width: 0 !important;
    z-index: 2 !important;
}

/* 吹き出しの三角部分（外側の緑枠線） */
.oslp-back-to-top-balloon::before {
    content: '' !important;
    position: absolute !important;
    bottom: -10px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-width: 10px 7px 0 !important;
    border-style: solid !important;
    border-color: var(--ojou-green, #0c4c33) transparent transparent !important;
    display: block !important;
    width: 0 !important;
    z-index: 1 !important;
}

/* 4. 出現＆ホバー時アクション */
.go-to-top-button.is-visible .oslp-back-to-top-character {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(0.95);
}

.go-to-top-button.is-visible:hover .oslp-back-to-top-character {
    opacity: 1;
    transform: translateX(-50%) translateY(-40px) scale(1.1);
    animation: oslp-rabity-bounce 0.8s ease-in-out infinite alternate;
}

.go-to-top-button.is-visible:hover .oslp-back-to-top-balloon {
    opacity: 1;
    transform: translateX(-50%) scale(1.0);
}

@keyframes oslp-rabity-bounce {
    0% {
        transform: translateX(-50%) translateY(-40px) scale(1.1);
    }
    100% {
        transform: translateX(-50%) translateY(-50px) scale(1.1) rotate(4deg);
    }
}

/* 5. レスポンシブ対応（768px以下） */
@media screen and (max-width: 768px) {
    .go-to-top-button {
        width: 100px !important;
        height: 100px !important;
        right: 20px !important;
        bottom: 20px !important;
    }
    .oslp-back-to-top-character {
        width: 100px;
        height: 100px;
        bottom: 0px;
        transform: translateX(-50%) translateY(50px) scale(0.4);
    }
    .oslp-back-to-top-balloon {
        top: -20px;
        padding: 3px 10px;
        font-size: 10px;
    }
    .go-to-top-button.is-visible .oslp-back-to-top-character {
        transform: translateX(-50%) translateY(0) scale(0.9);
    }
    .go-to-top-button.is-visible:hover .oslp-back-to-top-character {
        transform: translateX(-50%) translateY(-25px) scale(1.05);
        animation: oslp-rabity-bounce-mobile 0.8s ease-in-out infinite alternate;
    }
    .go-to-top-button.is-visible:hover .oslp-back-to-top-balloon {
        opacity: 1;
        transform: translateX(-50%) scale(0.95);
    }
}

@keyframes oslp-rabity-bounce-mobile {
    0% {
        transform: translateX(-50%) translateY(-25px) scale(1.05);
    }
    100% {
        transform: translateX(-50%) translateY(-31px) scale(1.05) rotate(3deg);
    }
}
