/* ============================================================
   Hunter Tutorial V1
   新手任務鎖、階級按鈕鎖鏈、解鎖動畫、柴元寶指引
   ============================================================ */

.hunter-rank-lock-host {
    position: relative;
    overflow: visible;
}

.hunter-rank-locked {
    filter: saturate(0.75) brightness(0.82);
}

.hunter-tutorial-lock {
    position: absolute;
    top: -16px;
    left: 50%;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 30px;
    pointer-events: none;
    transform: translateX(-50%);
}

.hunter-tutorial-lock-core {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 219, 120, 0.95);
    border-radius: 999px;
    background: radial-gradient(circle at 35% 30%, #49312d 0%, #161116 72%);
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.28),
        0 0 14px rgba(255, 194, 63, 0.45);
    font-size: 15px;
}

.hunter-tutorial-chain {
    position: absolute;
    top: 13px;
    width: 32px;
    height: 7px;
    border-top: 2px solid rgba(255, 224, 146, 0.9);
    border-bottom: 2px solid rgba(104, 82, 67, 0.9);
    background: repeating-linear-gradient(
        90deg,
        rgba(66, 55, 54, 0.95) 0 5px,
        rgba(234, 196, 116, 0.95) 5px 8px
    );
    box-shadow: 0 0 8px rgba(255, 194, 63, 0.25);
}

.hunter-tutorial-chain-left {
    left: 0;
    transform: rotate(-12deg);
}

.hunter-tutorial-chain-right {
    right: 0;
    transform: rotate(12deg);
}

.hunter-rank-locked .hunter-tutorial-lock {
    animation: hunterLockIdle 2.8s ease-in-out infinite;
}

.hunter-rank-lock-hit {
    animation: hunterLockHit 0.46s cubic-bezier(.36,.07,.19,.97);
}

.hunter-rank-lock-hit .hunter-tutorial-lock-core {
    animation: hunterLockSpark 0.52s ease-out;
}

.hunter-rank-unlocking .hunter-tutorial-lock {
    animation: hunterUnlockBreak 1.25s ease-in forwards;
}

.hunter-rank-unlocking .hunter-tutorial-chain-left {
    animation: hunterChainLeftBreak 1.25s ease-in forwards;
}

.hunter-rank-unlocking .hunter-tutorial-chain-right {
    animation: hunterChainRightBreak 1.25s ease-in forwards;
}

@keyframes hunterLockIdle {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    48% { transform: translateX(-50%) translateY(-2px); }
    52% { transform: translateX(-50%) translateY(1px); }
}

@keyframes hunterLockHit {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

@keyframes hunterLockSpark {
    0% { box-shadow: 0 0 0 rgba(255, 58, 58, 0); }
    40% { box-shadow: 0 0 22px rgba(255, 58, 58, 0.95), 0 0 34px rgba(255, 204, 70, 0.8); }
    100% { box-shadow: 0 0 12px rgba(255, 194, 63, 0.45); }
}

@keyframes hunterUnlockBreak {
    0% { opacity: 1; transform: translateX(-50%) scale(1); filter: brightness(1); }
    35% { transform: translateX(-50%) scale(1.15) rotate(-5deg); filter: brightness(1.8); }
    58% { transform: translateX(-50%) scale(0.9) rotate(7deg); filter: brightness(2.4); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-34px) scale(1.9) rotate(18deg); filter: brightness(3); }
}

@keyframes hunterChainLeftBreak {
    to { opacity: 0; transform: translate(-22px, -20px) rotate(-48deg); }
}

@keyframes hunterChainRightBreak {
    to { opacity: 0; transform: translate(22px, -20px) rotate(48deg); }
}

.hunter-tutorial-task-card {
    position: fixed;
    right: 18px;
    bottom: 92px;
    z-index: 120;
    width: min(330px, calc(100vw - 32px));
    padding: 14px 14px 13px;
    border: 1px solid rgba(255, 221, 135, 0.72);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(40, 27, 20, 0.96), rgba(21, 16, 18, 0.96)),
        radial-gradient(circle at top left, rgba(255, 213, 116, 0.22), transparent 55%);
    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.38),
        0 0 18px rgba(255, 192, 72, 0.18);
    color: #fff7db;
    animation: hunterTaskCardIn 0.42s ease-out both;
}


.hunter-tutorial-task-card.is-completed {
    border-color: rgba(134, 239, 172, 0.72);
    background:
        linear-gradient(145deg, rgba(31, 41, 23, 0.97), rgba(21, 16, 18, 0.96)),
        radial-gradient(circle at top left, rgba(134, 239, 172, 0.2), transparent 55%);
    box-shadow:
        0 16px 42px rgba(0, 0, 0, 0.38),
        0 0 22px rgba(134, 239, 172, 0.2);
}

.hunter-tutorial-task-state {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 9px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.18);
    color: #bbf7d0;
    font-size: 12px;
    font-weight: 900;
}

.hunter-tutorial-task-state.is-active {
    background: rgba(255, 204, 74, 0.14);
    color: #ffe29b;
}

.hunter-tutorial-reward-box {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    padding: 9px 10px;
    border: 1px solid rgba(255, 221, 135, 0.44);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff7db;
    font-size: 12px;
}

.hunter-tutorial-reward-box strong {
    color: #ffed9f;
    font-size: 14px;
}

.hunter-tutorial-reward-box.is-muted {
    opacity: 0.82;
}

.hunter-tutorial-claim-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #bbf7d0, #22c55e);
    color: #052e16;
    font-weight: 1000;
    font-size: 14px;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.45),
        0 4px 0 rgba(20, 83, 45, .86),
        0 10px 18px rgba(0, 0, 0, .2);
}

.hunter-tutorial-claim-btn:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        0 2px 0 rgba(20, 83, 45, .86),
        0 6px 12px rgba(0, 0, 0, .14);
}

.hunter-tutorial-claim-btn:disabled,
.hunter-tutorial-claim-btn.is-loading {
    opacity: 0.72;
    cursor: wait;
}

.hunter-tutorial-next-note {
    margin-top: 9px;
    color: rgba(255, 247, 219, 0.68);
    font-size: 12px;
    line-height: 1.5;
}

.hunter-tutorial-task-card.is-minimized {
    opacity: 0.42;
    transform: translateY(12px) scale(0.96);
}

.hunter-tutorial-task-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #ffd66f;
    font-weight: 800;
    font-size: 14px;
}

.hunter-tutorial-close {
    width: 25px;
    height: 25px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff7db;
    cursor: pointer;
}

.hunter-tutorial-task-title {
    margin-top: 8px;
    font-weight: 900;
    font-size: 17px;
}

.hunter-tutorial-task-text {
    margin-top: 7px;
    color: rgba(255, 247, 219, 0.82);
    line-height: 1.55;
    font-size: 13px;
}

.hunter-tutorial-task-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.hunter-tutorial-guide-btn,
.hunter-tutorial-price-link,
.hunter-tutorial-primary-link,
.hunter-tutorial-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 221, 135, 0.72);
    background: rgba(255, 204, 74, 0.14);
    color: #ffe29b;
    font-weight: 800;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
}

.hunter-tutorial-price-link,
.hunter-tutorial-primary-link {
    background: linear-gradient(135deg, #ffd96a, #ff9f2f);
    color: #2b1b12;
    border-color: transparent;
}

@keyframes hunterTaskCardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.hunter-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    display: grid;
    place-items: center;
    padding: 20px;
}

.hunter-tutorial-fog {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 32%, rgba(255, 219, 120, 0.2), transparent 18%),
        rgba(5, 4, 8, 0.72);
    backdrop-filter: blur(3px);
}

.hunter-tutorial-pointer {
    position: absolute;
    top: 8%;
    right: 72%;
    font-size: 42px;
    transform: rotate(-20deg);
    animation: hunterPointerTap 0.9s ease-in-out infinite;
}

.hunter-tutorial-dialogue {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 12px;
    width: min(520px, calc(100vw - 32px));
    padding: 18px;
    border: 1px solid rgba(255, 221, 135, 0.72);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(39, 27, 20, 0.98), rgba(19, 16, 20, 0.98));
    color: #fff7db;
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.hunter-tutorial-dog {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 18px;
    background: rgba(255, 221, 135, 0.14);
    font-size: 32px;
}

.hunter-tutorial-dialogue-title {
    color: #ffd66f;
    font-weight: 900;
    font-size: 18px;
}

.hunter-tutorial-dialogue-text {
    margin-top: 8px;
    color: rgba(255, 247, 219, 0.84);
    line-height: 1.65;
    font-size: 14px;
}

.hunter-tutorial-dialogue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.hunter-tutorial-secondary-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff7db;
}

@keyframes hunterPointerTap {
    0%, 100% { transform: translateY(0) rotate(-20deg) scale(1); }
    50% { transform: translateY(10px) rotate(-20deg) scale(0.94); }
}

.hunter-tutorial-unlock-burst {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: radial-gradient(circle at center, rgba(255, 221, 93, 0.25), rgba(0, 0, 0, 0.18) 45%, transparent 70%);
    animation: hunterUnlockBurstFade 2.25s ease-out forwards;
}

.hunter-tutorial-unlock-burst > * {
    grid-column: 1;
    grid-row: 1;
}

.hunter-tutorial-unlock-lightning {
    transform: translateY(-80px);
    font-size: 76px;
    filter: drop-shadow(0 0 22px rgba(255, 239, 142, 0.9));
    animation: hunterLightningStrike 0.82s ease-out both;
}

.hunter-tutorial-unlock-title {
    transform: translateY(4px);
    color: #fff1a6;
    font-weight: 1000;
    font-size: clamp(28px, 8vw, 54px);
    text-align: center;
    text-shadow:
        0 0 8px rgba(255, 217, 88, 0.9),
        0 0 24px rgba(255, 155, 52, 0.7),
        0 3px 0 rgba(65, 36, 12, 0.9);
    animation: hunterUnlockTitlePop 1.1s ease-out both;
}

.hunter-tutorial-unlock-subtitle {
    transform: translateY(72px);
    color: #fff8d8;
    font-weight: 900;
    font-size: clamp(16px, 4.5vw, 25px);
    text-align: center;
    text-shadow: 0 0 16px rgba(255, 217, 88, 0.65);
    animation: hunterUnlockSubtitlePop 1.35s ease-out both;
}

.hunter-glove-icon-wrap {
    position: relative;
    flex: 0 0 auto;
}

.hunter-glove-lock-overlay {
    position: absolute;
    inset: -4px;

    display: none;
    align-items: center;
    justify-content: center;

    border-radius: 12px;
    background: rgba(17, 24, 39, .48);

    font-size: 24px;
    line-height: 1;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .18),
        0 0 0 1px rgba(17, 24, 39, .16);
}

.hunter-glove-icon-wrap.is-locked .hunter-glove-icon {
    filter: grayscale(100%) brightness(.55);
}

.hunter-glove-icon-wrap.is-locked .hunter-glove-lock-overlay {
    display: flex;
}

@keyframes hunterUnlockBurstFade {
    0% { opacity: 0; }
    12% { opacity: 1; }
    75% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes hunterLightningStrike {
    0% { opacity: 0; transform: translateY(-180px) scale(0.8); }
    35% { opacity: 1; transform: translateY(-60px) scale(1.18); }
    100% { opacity: 0; transform: translateY(-12px) scale(1.35); }
}

@keyframes hunterUnlockTitlePop {
    0% { opacity: 0; transform: translateY(26px) scale(0.82); }
    40% { opacity: 1; transform: translateY(0) scale(1.08); }
    100% { opacity: 1; transform: translateY(4px) scale(1); }
}

@keyframes hunterUnlockSubtitlePop {
    0%, 25% { opacity: 0; transform: translateY(92px); }
    100% { opacity: 1; transform: translateY(72px); }
}

@media (max-width: 640px) {
    .hunter-tutorial-task-card {
        right: 12px;
        bottom: 82px;
    }

    .hunter-tutorial-dialogue {
        grid-template-columns: 1fr;
    }

    .hunter-tutorial-dog {
        width: 48px;
        height: 48px;
    }
}


/* =========================
   Product page tutorial return overlay
========================= */

.hunter-product-tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        radial-gradient(circle at top left, rgba(251, 191, 36, .16), transparent 34%),
        rgba(15, 23, 42, .38);
    backdrop-filter: blur(4px);
    animation: hunterProductTutorialFadeIn .28s ease-out both;
}

.hunter-product-tutorial-fog {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 247, 237, .35), transparent 24%),
        radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .22), transparent 26%),
        linear-gradient(110deg, rgba(255,255,255,.08), rgba(255,255,255,.28), rgba(255,255,255,.08));
    opacity: .82;
    animation: hunterProductFogMove 3.4s ease-in-out infinite alternate;
}

.hunter-product-tutorial-card {
    position: relative;
    z-index: 1;
    width: min(390px, calc(100vw - 34px));
    padding: 18px 18px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 222, 139, .82);
    background:
        radial-gradient(circle at top, rgba(255, 213, 116, .22), transparent 42%),
        linear-gradient(180deg, rgba(35, 24, 21, .97), rgba(15, 23, 42, .96));
    color: #fff7db;
    text-align: center;
    box-shadow:
        0 18px 48px rgba(0, 0, 0, .38),
        0 0 22px rgba(255, 193, 72, .18),
        inset 0 1px 0 rgba(255,255,255,.16);
    animation: hunterProductCardPop .38s cubic-bezier(.22,.9,.24,1.1) both;
}

.hunter-product-tutorial-badge {
    display: inline-flex;
    margin-bottom: 8px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 214, 111, .16);
    color: #ffd66f;
    font-size: 12px;
    font-weight: 900;
}

.hunter-product-tutorial-title {
    margin-bottom: 4px;
    color: #fff;
    font-size: 22px;
    font-weight: 1000;
    letter-spacing: .02em;
}

.hunter-product-tutorial-quest {
    margin-bottom: 10px;
    color: #facc15;
    font-size: 15px;
    font-weight: 900;
}

.hunter-product-tutorial-text {
    margin: 0 auto 12px;
    color: #fdecc8;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.65;
}

.hunter-product-tutorial-countdown {
    margin-bottom: 12px;
    color: #fff7db;
    font-size: 13px;
    font-weight: 900;
}

#hunterTutorialCountdown {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin-right: 3px;
    border-radius: 999px;
    background: #facc15;
    color: #111827;
    box-shadow: 0 0 14px rgba(250, 204, 21, .55);
}

.hunter-product-tutorial-return-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 15px;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    color: #111827;
    font-size: 13px;
    font-weight: 1000;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.45),
        0 4px 0 rgba(146, 64, 14, .8),
        0 9px 18px rgba(0, 0, 0, .16);
}

.hunter-product-tutorial-return-btn:active {
    transform: translateY(2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.35),
        0 2px 0 rgba(146, 64, 14, .8),
        0 5px 12px rgba(0, 0, 0, .12);
}

@keyframes hunterProductTutorialFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes hunterProductCardPop {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes hunterProductFogMove {
    from { transform: translateX(-10px) translateY(0); }
    to { transform: translateX(12px) translateY(-6px); }
}


html.hunter-product-tutorial-locked,
body.hunter-product-tutorial-locked {
    overflow: hidden;
    touch-action: none;
}

.hunter-product-tutorial-overlay {
    pointer-events: auto;
}

/* =========================
   Product tutorial completion overlay fixes
========================= */

html.hunter-product-tutorial-locking,
body.hunter-product-tutorial-locking,
html.hunter-product-tutorial-locked,
body.hunter-product-tutorial-locked {
    overflow: hidden;
    touch-action: none;
}

.hunter-product-tutorial-overlay {
    box-sizing: border-box;
    min-height: 100dvh;
    padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    align-items: center;
    justify-items: center;
}

.hunter-product-tutorial-card {
    box-sizing: border-box;
    max-height: min(520px, calc(100dvh - 32px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.hunter-product-tutorial-title,
.hunter-product-tutorial-quest,
.hunter-product-tutorial-text,
.hunter-product-tutorial-countdown {
    overflow-wrap: anywhere;
}

@media (max-width: 420px) {
    .hunter-product-tutorial-overlay {
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    .hunter-product-tutorial-card {
        width: min(348px, calc(100vw - 24px));
        padding: 15px 13px 14px;
        border-radius: 18px;
    }

    .hunter-product-tutorial-title {
        font-size: 19px;
        line-height: 1.25;
    }

    .hunter-product-tutorial-quest {
        font-size: 13px;
    }

    .hunter-product-tutorial-text {
        margin-bottom: 10px;
        font-size: 12px;
        line-height: 1.55;
    }

    .hunter-product-tutorial-text br {
        display: none;
    }

    .hunter-product-tutorial-return-btn {
        width: 100%;
        min-height: 40px;
    }
}

.hunter-tutorial-task-card.is-closing {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    pointer-events: none;
    transition: opacity .12s ease, transform .12s ease;
}

/* v78: tutorial guide modal mobile centering / overflow guard */
@media (max-width: 640px) {
    .hunter-tutorial-overlay {
        z-index: 9700;
        align-items: center;
        justify-items: center;
        padding: max(14px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
        overflow: auto;
        overscroll-behavior: contain;
    }

    .hunter-tutorial-dialogue {
        width: min(100%, calc(100vw - 24px));
        max-height: calc(100svh - 28px);
        overflow-y: auto;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
    }

    .hunter-tutorial-pointer {
        top: max(18px, env(safe-area-inset-top));
        left: 16px;
        right: auto;
        font-size: 34px;
    }
}

/* v79: tutorial prompt should not cover LINE switch confirmation. */
.hunter-tutorial-overlay {
    z-index: 10000;
}

@media (max-width: 640px) {
    .hunter-tutorial-overlay {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        box-sizing: border-box;
    }
}
