/* ============================================================
   MAP ANIMATIONS — премиальный слой движения
   ============================================================ */

/* ---------- Keyframes ---------- */
@keyframes htCharIn {
    from {
        opacity: 0;
        transform: translate3d(0, 110%, 0) rotateX(-70deg);
        filter: blur(6px);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) rotateX(0);
        filter: blur(0);
    }
}

@keyframes htReveal {
    from {
        opacity: 0;
        transform: translate3d(var(--rv-tx, 0px), var(--rv-ty, 40px), 0) scale(var(--rv-scale, 1));
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}

@keyframes htShimmerSweep {
    to { transform: translateX(250%) skewX(-20deg); }
}

@keyframes htArrowBounce {
    0%, 100% { transform: translateX(0); }
    50%      { transform: translateX(5px); }
}

@keyframes htLockPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255, 255, 255, 0.10); }
    50%      { box-shadow: 0 0 50px rgba(255, 255, 255, 0.22), 0 0 30px rgba(255, 255, 255, 0.14); }
}

/* ---------- FIX: центрируем скин (было 5%/5%) ---------- */
.map-skin-img {
    top: 50%;
    left: 50%;
}

/* ---------- Hero glow (как в howto) ---------- */
.map-hero::before {
    content: '';
    position: absolute;
    top: 100px;
    left: 40px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, transparent 65%);
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
}

/* ---------- Title: посимвольное появление ---------- */
.map-title { perspective: 1000px; }

.ht-char {
    display: inline-block;
    opacity: 0;
    transform: translate3d(0, 110%, 0) rotateX(-70deg);
    filter: blur(6px);
    transform-origin: 50% 100%;
    will-change: opacity, transform, filter;
}

body.is-ready .ht-char {
    animation: htCharIn 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--i, 0) * 26ms + 40ms);
}

/* ---------- Scroll-reveal ---------- */
.anim-reveal {
    --rv-tx: 0px;
    --rv-ty: 40px;
    --rv-scale: 1;
    opacity: 0;
    transform: translate3d(var(--rv-tx), var(--rv-ty), 0) scale(var(--rv-scale));
    will-change: opacity, transform;
}
.anim-reveal--left   { --rv-tx: -70px; --rv-ty: 0px; }
.anim-reveal--right  { --rv-tx: 70px;  --rv-ty: 0px; }
.anim-reveal--scale  { --rv-tx: 0px;   --rv-ty: 0px; --rv-scale: 0.9; }

.anim-reveal.is-visible {
    animation: htReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: var(--anim-delay, 0ms);
    opacity: 1;
    transform: none;
}

/* ---------- Card glow за курсором на карте ---------- */
.map-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mx, 50%) var(--my, 50%),
        rgba(255, 255, 255, 0.09) 0%,
        transparent 55%
    );
    pointer-events: none;
    transition: background 0.15s linear;
    z-index: 0;
}

/* ---------- Lock icon: мягкая пульсация ---------- */
.map-lock-icon {
    animation: htLockPulse 3s ease-in-out infinite;
}

/* ---------- Кнопка Discord: shimmer + магнит ---------- */
.map-notify-btn {
    will-change: transform;
    position: relative;
    overflow: hidden;
}
.map-notify-btn::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    transform: translateX(-180%) skewX(-20deg);
    pointer-events: none;
}
.map-notify-btn:hover::after {
    animation: htShimmerSweep 0.9s ease;
}

/* ---------- Bounce стрелки на hover (если появятся) ---------- */
.map-notify-btn:hover svg {
    animation: htArrowBounce 0.7s ease infinite;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .ht-char { opacity: 1; transform: none; filter: none; }
    .anim-reveal { opacity: 1; transform: none; }
    .map-hero::before { display: none; }
}