/* 화면 가이드(스포트라이트 투어) · 도움말 버튼 · 시작 미션 — js/tour.js */

.tour-layer { position: fixed; inset: 0; z-index: 9000; }
.tour-layer.hidden { display: none; }
/* 대상이 없는 단계(환영·마무리)에서는 화면 전체를 어둡게 */
.tour-layer.tour-full { background: rgba(15, 23, 42, .62); }

/* 스포트라이트: 대상 둘레만 밝게 두고 나머지는 거대한 그림자로 어둡게 덮는다 */
.tour-spot {
    position: fixed; border-radius: 10px; pointer-events: none;
    box-shadow: 0 0 0 100vmax rgba(15, 23, 42, .62);
    outline: 3px solid #60a5fa; outline-offset: 0;
    transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
    animation: tour-pulse 1.6s ease-in-out infinite;
}
.tour-layer.tour-full .tour-spot { display: none; }
@keyframes tour-pulse { 0%, 100% { outline-color: #60a5fa; } 50% { outline-color: #bfdbfe; } }

.tour-card {
    position: fixed; width: 340px; max-width: calc(100vw - 24px);
    background: var(--c-bg-surface, #fff); color: var(--c-text-primary, #111827);
    border: 1px solid var(--c-border, #e5e7eb); border-radius: 14px;
    box-shadow: 0 20px 40px -8px rgb(0 0 0 / .35); padding: 16px 18px 14px;
}
.tour-card .tour-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: #1d4ed8; background: #dbeafe; border-radius: 999px; padding: 2px 10px; }
.tour-card h3 { margin: 10px 0 6px; font-size: 16px; font-weight: 700; }
.tour-card p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--c-text-secondary, #4b5563); white-space: pre-line; }
.tour-card .tour-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--c-text-muted, #9ca3af); cursor: pointer; font-size: 14px; }
.tour-card .tour-close:hover { color: var(--c-text-primary, #111827); }
.tour-bar { height: 4px; background: var(--c-bg-surface3, #e5e7eb); border-radius: 999px; margin-top: 14px; overflow: hidden; }
.tour-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, #22c55e); border-radius: 999px; transition: width .25s ease; }
.tour-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-actions .grow { flex: 1; }
.tour-btn { font-size: 13px; font-weight: 600; border-radius: 8px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--c-border-input, #d1d5db); background: var(--c-bg-surface, #fff); color: var(--c-text-primary, #111827); }
.tour-btn:hover { background: var(--c-bg-surface2, #f3f4f6); }
.tour-btn:disabled { opacity: .4; cursor: default; }
.tour-btn.primary { background: #2563eb; border-color: #2563eb; color: #fff; }
.tour-btn.primary:hover { background: #1d4ed8; }
.tour-link { font-size: 12.5px; color: #2563eb; background: none; border: 0; cursor: pointer; padding: 0; text-decoration: underline; }

/* 도움말 버튼(우하단) — 둘레의 링이 시작 미션 진행도 */
.help-fab {
    position: fixed; right: 18px; bottom: 18px; z-index: 45; width: 48px; height: 48px; border-radius: 50%;
    border: 0; cursor: pointer; color: #fff; font-size: 18px; font-weight: 700;
    background: conic-gradient(#22c55e var(--help-pct, 0%), #93c5fd 0);
    box-shadow: 0 8px 18px -4px rgb(37 99 235 / .55); display: flex; align-items: center; justify-content: center;
}
.help-fab::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: #2563eb; }
.help-fab > * { position: relative; }
.help-fab:hover { transform: translateY(-1px); }
.help-fab .help-dot { position: absolute; top: -2px; right: -2px; width: 14px; height: 14px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; z-index: 2; }
.help-fab.help-hidden, .help-fab.help-cleared { display: none; }

.help-panel {
    position: fixed; right: 18px; bottom: 76px; z-index: 46; width: 330px; max-width: calc(100vw - 24px);
    background: var(--c-bg-surface, #fff); color: var(--c-text-primary, #111827);
    border: 1px solid var(--c-border, #e5e7eb); border-radius: 14px; box-shadow: 0 20px 40px -8px rgb(0 0 0 / .35); overflow: hidden;
}
.help-panel.hidden { display: none; }
.help-panel header { padding: 14px 16px 10px; border-bottom: 1px solid var(--c-border, #e5e7eb); }
.help-panel header h4 { margin: 0; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.help-panel header small { color: var(--c-text-muted, #9ca3af); font-size: 12px; }
.help-missions { list-style: none; margin: 0; padding: 8px 10px; max-height: 260px; overflow-y: auto; }
.help-missions li button { width: 100%; text-align: left; display: flex; align-items: center; gap: 10px; background: none; border: 0; border-radius: 8px; padding: 7px 8px; cursor: pointer; color: inherit; font-size: 13.5px; }
.help-missions li button:hover { background: var(--c-bg-surface2, #f3f4f6); }
.help-missions .chk { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--c-border-input, #d1d5db); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; flex-shrink: 0; }
.help-missions li.done .chk { background: #22c55e; border-color: #22c55e; }
.help-missions li.done span.lbl { color: var(--c-text-muted, #9ca3af); text-decoration: line-through; }
.help-actions { padding: 10px 12px 12px; display: grid; gap: 8px; border-top: 1px solid var(--c-border, #e5e7eb); }
.help-actions a, .help-actions button { display: flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.help-cheer { font-size: 12.5px; color: #15803d; background: #dcfce7; border-radius: 8px; padding: 6px 10px; margin: 0 12px 6px; }

/* 미션 완료 축하 */
.help-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 9100; overflow: hidden; }
.help-confetti i { position: absolute; top: -20px; font-style: normal; font-size: 22px; animation: help-fall 1.9s ease-in forwards; }
@keyframes help-fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }

@media (prefers-reduced-motion: reduce) { .tour-spot, .tour-bar > i { transition: none; } .tour-spot, .help-confetti i { animation: none; } }
@media (max-width: 639px) {
    /* 전체화면 서랍 안의 아래쪽 메뉴도 시트 위로 끌어올릴 수 있게 목록 끝에 여백을 둔다 */
    .tour-on #sidebar nav { padding-bottom: 320px; }
    .tour-card { left: 12px !important; right: 12px; bottom: 12px; top: auto !important; width: auto; max-width: none; }
    .help-fab { right: 12px; bottom: 12px; }
    .help-panel { right: 12px; bottom: 68px; }
}
