/* ==========================================================================
   わんケア 試乗LP専用 スクロール誘導パグギミック（ABテスト対応）
   Namespace: .wc-pug-プレフィックスによる完全隔離
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@500;700;800&family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ステージ外枠（画面全体オーバーレイ：クリック完全透過） */
.wc-pug-stage {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: 9990;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.wc-pug-stage.active {
    opacity: 1;
}

/* パグ本体ラッパー */
.wc-pug-actor {
    position: absolute;
    width: 100px;
    height: 100px;
    top: -200px;
    left: -200px;
    pointer-events: none;
    transition: transform 0.1s ease-out;
    will-change: transform, left, top;
}

/* 10%刻みジャンプ演出 */
.wc-pug-actor.step-jump {
    animation: wcPugJump 0.45s ease-out;
}

@keyframes wcPugJump {
    0% { transform: scale(1) translateY(0); }
    40% { transform: scale(1.15, 0.85) translateY(-24px); }
    70% { transform: scale(0.95, 1.05) translateY(-4px); }
    100% { transform: scale(1) translateY(0); }
}

/* 吹き出し（セリフ） */
.wc-pug-speech {
    position: absolute;
    bottom: 105px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    color: #2c3e50;
    padding: 9px 28px 9px 15px;
    border-radius: 20px;
    font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'ヒラギノ丸ゴ ProN W4', 'Noto Sans JP', sans-serif;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.45;
    white-space: nowrap;
    border: 2.5px solid #f39c12;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    pointer-events: auto !important;
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.wc-pug-speech:hover {
    transform: translateX(-50%) scale(1.04);
}

/* 吹き出しの三角（しっぽ） */
.wc-pug-speech::after {
    content: '';
    position: absolute;
    bottom: -11px;
    left: calc(50% + var(--arrow-x, 0px));
    transform: translateX(-50%);
    border-width: 11px 9px 0 9px;
    border-style: solid;
    border-color: #ffffff transparent transparent transparent;
    z-index: 2;
}

.wc-pug-speech::before {
    content: '';
    position: absolute;
    bottom: -14px;
    left: calc(50% + var(--arrow-x, 0px));
    transform: translateX(-50%);
    border-width: 13px 11px 0 11px;
    border-style: solid;
    border-color: #f39c12 transparent transparent transparent;
    z-index: 1;
}

/* 吹き出しの閉じるボタン（×） */
.wc-pug-close {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #7f8c8d;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    cursor: pointer;
    pointer-events: auto !important;
    transition: background 0.2s, color 0.2s;
}

.wc-pug-close:hover {
    background: #e74c3c;
    color: #ffffff;
}

/* 向き反転ラッパー（吹き出しは反転させず、画像のみ反転） */
.wc-pug-flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transform-origin: center center;
    transition: transform 0.25s ease;
}

/* パグ画像共通 */
.wc-pug-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.wc-pug-img.active {
    opacity: 1;
    visibility: visible;
}

.wc-pug-img.hidden {
    opacity: 0;
    visibility: hidden;
}

/* 各モーション */
.wc-pug-img.run-bounce {
    animation: wcPugRun 0.32s infinite alternate ease-in-out;
}
.wc-pug-img.walk-bob {
    animation: wcPugWalk 0.55s infinite alternate ease-in-out;
}
.wc-pug-img.cheer-wiggle {
    animation: wcPugCheer 0.8s infinite alternate ease-in-out;
}

@keyframes wcPugRun {
    0% { transform: translateY(0) rotate(-2deg); }
    100% { transform: translateY(-7px) rotate(3deg); }
}

@keyframes wcPugWalk {
    0% { transform: translateY(0) rotate(-1deg); }
    100% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes wcPugCheer {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-5px) scale(1.04); }
}

/* タップ時のハートエフェクト */
.wc-pug-tap-heart {
    position: fixed;
    font-size: 24px;
    pointer-events: none;
    z-index: 9999;
    animation: wcPugHeartFloat 0.9s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes wcPugHeartFloat {
    0% { opacity: 1; transform: scale(0.5) translateY(0); }
    50% { opacity: 1; transform: scale(1.3) translateY(-35px); }
    100% { opacity: 0; transform: scale(1) translateY(-60px); }
}

/* ==========================================================================
   レスポンシブ対応（スマホ最適化）
   ========================================================================== */
@media (max-width: 768px) {
    .wc-pug-actor {
        width: 60px;
        height: 60px;
    }

    .wc-pug-speech {
        bottom: 66px;
        font-size: 0.76rem;
        padding: 6px 22px 6px 10px;
        border-width: 2px;
        border-radius: 14px;
        line-height: 1.35;
    }

    .wc-pug-speech::after {
        border-width: 8px 6px 0 6px;
        bottom: -8px;
    }

    .wc-pug-speech::before {
        border-width: 10px 8px 0 8px;
        bottom: -10px;
    }

    .wc-pug-close {
        width: 14px;
        height: 14px;
        line-height: 14px;
        font-size: 9px;
        top: 3px;
        right: 4px;
    }
}
