/* ============================================
   SwiPredict Walkthrough & Onboarding System
   ============================================ */

/* ---- Spotlight cutout (box-shadow trick = overlay + highlight) ---- */
.wt-spotlight {
    position: fixed;
    z-index: 100001;
    border-radius: 12px;
    box-shadow:
        0 0 0 9999px rgba(0, 0, 0, 0.85),
        0 0 20px rgba(168, 85, 247, 0.5),
        0 0 40px rgba(0, 212, 255, 0.3);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    will-change: top, left, width, height;
}

/* Pulse animation removed — was causing repaint jank on mobile */

/* ---- Tooltip ---- */
.wt-tooltip {
    position: fixed;
    z-index: 100002;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    box-shadow:
        0 0 30px rgba(168, 85, 247, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.5);
    padding: 20px 24px;
    max-width: 320px;
    min-width: 260px;
    transition: top 0.2s cubic-bezier(0.4,0,0.2,1),
                left 0.2s cubic-bezier(0.4,0,0.2,1),
                opacity 0.15s ease;
    pointer-events: all;
}

/* Arrow — rotated square */
.wt-tooltip::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.4);
    transform: rotate(45deg);
}

/* Tooltip BELOW target → arrow at top center pointing up */
.wt-tooltip--below::before {
    top: -7px;
    left: 50%;
    margin-left: -6px;
    border-bottom: none;
    border-right: none;
}

/* Tooltip ABOVE target → arrow at bottom center pointing down */
.wt-tooltip--above::before {
    bottom: -7px;
    left: 50%;
    margin-left: -6px;
    border-top: none;
    border-left: none;
}

/* Tooltip RIGHT of target → arrow at left pointing left */
.wt-tooltip--right::before {
    left: -7px;
    top: 50%;
    margin-top: -6px;
    border-top: none;
    border-right: none;
}

/* Tooltip LEFT of target → arrow at right pointing right */
.wt-tooltip--left::before {
    right: -7px;
    top: 50%;
    margin-top: -6px;
    border-bottom: none;
    border-left: none;
}

.wt-tooltip__title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.wt-tooltip__text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 16px;
}

.wt-tooltip__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Step dots */
.wt-dots {
    display: flex;
    gap: 6px;
}

.wt-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.3s;
}

.wt-dot--active {
    background: #a855f7;
}

.wt-step-counter {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-left: 8px;
}

/* Next button */
.wt-btn-next {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wt-btn-next:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

/* Skip link */
.wt-skip {
    display: block;
    text-align: center;
    margin-top: 12px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 4px;
    width: 100%;
}

.wt-skip:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Welcome Modal (Loom-style centered)
   ============================================ */

.wt-welcome {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    transition: opacity 0.3s ease;
}

.wt-welcome--hidden {
    opacity: 0;
    pointer-events: none;
}

.wt-welcome__card {
    position: relative;
    background: rgba(15, 15, 25, 0.95);
    border: 1px solid rgba(168, 85, 247, 0.4);
    border-radius: 24px;
    box-shadow:
        0 0 60px rgba(168, 85, 247, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 40px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: wt-welcome-in 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes wt-welcome-in {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.wt-welcome__art {
    margin: 0 auto 24px;
    max-height: 280px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 8px;
}

.wt-welcome__art pre {
    margin: 0 !important;
}

.wt-welcome__title {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.wt-welcome__tagline {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 32px;
    line-height: 1.4;
}

.wt-welcome__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.wt-btn-tour {
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px 36px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 280px;
}

.wt-btn-tour:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(168, 85, 247, 0.5);
}

.wt-btn-skip-welcome {
    background: transparent;
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 12px 36px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    max-width: 280px;
}

.wt-btn-skip-welcome:hover {
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Help Button ("?")
   ============================================ */

.wt-help-btn {
    position: fixed;
    bottom: 90px;
    right: 16px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a855f7, #8b5cf6);
    color: #fff;
    border: none;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
    box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
    transition: all 0.2s;
}

.wt-help-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}

/* ============================================
   Swipe Hint (play.html)
   ============================================ */

.wt-swipe-hint {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    transition: opacity 0.3s ease;
}

.wt-swipe-hint--hidden {
    opacity: 0;
    pointer-events: none;
}

.wt-swipe-hint__container {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wt-swipe-arrow {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 700;
    user-select: none;
}

.wt-swipe-arrow__icon {
    font-size: 36px;
    line-height: 1;
}

.wt-swipe-arrow__label {
    font-size: 15px;
    letter-spacing: 1px;
}

.wt-swipe-arrow--left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    animation: wt-arrow-left 1.5s ease-in-out infinite;
}

.wt-swipe-arrow--right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    animation: wt-arrow-right 1.5s ease-in-out infinite;
}

.wt-swipe-arrow--up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    animation: wt-arrow-up 1.5s ease-in-out infinite;
}

.wt-swipe-arrow--left .wt-swipe-arrow__label { color: #ef4444; }
.wt-swipe-arrow--right .wt-swipe-arrow__label { color: #22c55e; }
.wt-swipe-arrow--up .wt-swipe-arrow__label { color: #00d4ff; }
.wt-swipe-arrow--left .wt-swipe-arrow__icon { color: #ef4444; }
.wt-swipe-arrow--right .wt-swipe-arrow__icon { color: #22c55e; }
.wt-swipe-arrow--up .wt-swipe-arrow__icon { color: #00d4ff; }

@keyframes wt-arrow-left {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(-15px); }
}

@keyframes wt-arrow-right {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(15px); }
}

@keyframes wt-arrow-up {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-15px); }
}

.wt-swipe-hint__dismiss {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
}

/* ============================================
   Mobile Responsive
   ============================================ */

@media (max-width: 768px) {
    .wt-tooltip {
        position: fixed !important;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
        left: 8px !important;
        right: 8px !important;
        top: auto !important;
        max-width: 100%;
        width: auto;
        border-radius: 16px;
        padding: 20px;
    }

    .wt-tooltip::before {
        display: none;
    }

    .wt-welcome__card {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .wt-welcome__title {
        font-size: 20px;
    }

    .wt-help-btn {
        bottom: calc(60px + env(safe-area-inset-bottom, 0px));
    }
}

/* ============================================
   Shared Gold CTA Button
   ============================================ */

.wt-btn-gold {
    display: block;
    width: 100%;
    max-width: 280px;
    padding: 14px 36px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 16px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    text-align: center;
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
    box-shadow: 0 4px 24px rgba(245, 158, 11, 0.4);
    transition: all 0.2s;
}

.wt-btn-gold:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.5);
}

.wt-btn-gold:active {
    transform: scale(0.98);
}

/* Glass outlined button — secondary CTA */
.wt-btn-glass {
    display: block;
    width: 100%;
    max-width: 280px;
    padding: 12px 36px;
    border: 1px solid rgba(167, 139, 250, 0.35);
    border-radius: 12px;
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-size: 14px;
    font-weight: 700;
    color: rgba(167, 139, 250, 0.9);
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    background: rgba(167, 139, 250, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(167, 139, 250, 0.08);
    transition: all 0.2s;
    margin-top: 10px;
}
.wt-btn-glass:hover {
    background: rgba(167, 139, 250, 0.12);
    border-color: rgba(167, 139, 250, 0.5);
    box-shadow: 0 0 30px rgba(167, 139, 250, 0.15);
    transform: translateY(-1px);
}

/* Subtle dismiss link */
.wt-btn-dismiss {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.35);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.wt-btn-dismiss:hover {
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   Unified Welcome Modal — Close + Tour Link
   ============================================ */

.wt-welcome__close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
    z-index: 1;
}

.wt-welcome__close:hover {
    color: rgba(255, 255, 255, 0.8);
}

.wt-btn-tour-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wt-btn-tour-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Post-tour hype stats */
.wt-welcome__hype {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 24px;
    letter-spacing: 0.3px;
}

/* Replay the Tour link (post-tour modal) */
.wt-btn-replay {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.wt-btn-replay:hover {
    color: rgba(255, 255, 255, 0.7);
}
