/* ═══════════════════════════════════════════════════════════════
   Кастомный курсор — стильный экономический дизайн
   ═══════════════════════════════════════════════════════════════ */

/* Скрываем стандартный курсор */
* {
    cursor: none !important;
}

/* Внешнее кольцо курсора */
.custom-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 999999;
    width: 19px;
    height: 19px;
    border: 2px solid rgba(0, 212, 255, 0.7);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    transition: width 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                border-color 0.2s ease,
                background 0.2s ease,
                box-shadow 0.2s ease;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2),
                0 0 30px rgba(0, 212, 255, 0.08),
                inset 0 0 10px rgba(0, 212, 255, 0.05);
}

/* Внутренняя точка */
.custom-cursor-dot {
    position: fixed;
    pointer-events: none;
    z-index: 1000000;
    width: 3px;
    height: 3px;
    background: #00d4ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px #00d4ff,
                0 0 20px rgba(0, 212, 255, 0.4);
    transition: width 0.15s ease, height 0.15s ease, background 0.15s ease;
}

/* Хвостик-шлейф за курсором */
.custom-cursor-trail {
    position: fixed;
    pointer-events: none;
    z-index: 999997;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(0, 212, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    animation: trailFade 0.6s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 0.4;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.2);
    }
}

/* Эффект при наведении на кликабельные элементы */
.custom-cursor.hover {
    width: 29px;
    height: 29px;
    border-color: rgba(0, 255, 136, 0.9);
    background: radial-gradient(circle, rgba(0, 255, 136, 0.12) 0%, transparent 70%);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.25),
                0 0 50px rgba(0, 255, 136, 0.1),
                inset 0 0 15px rgba(0, 255, 136, 0.08);
}

.custom-cursor.hover + .custom-cursor-dot,
.custom-cursor-dot.hover {
    width: 5px;
    height: 5px;
    background: #00ff88;
    box-shadow: 0 0 12px #00ff88, 0 0 30px rgba(0, 255, 136, 0.4);
}

/* Эффект при клике */
.custom-cursor.click {
    width: 13px;
    height: 13px;
    border-color: rgba(255, 255, 255, 0.9);
    background: radial-gradient(circle, rgba(0, 212, 255, 0.25) 0%, transparent 70%);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.4),
                0 0 60px rgba(0, 212, 255, 0.15);
}

.custom-cursor-dot.click {
    width: 2px;
    height: 2px;
    background: #ffffff;
    box-shadow: 0 0 15px #ffffff, 0 0 30px rgba(255, 255, 255, 0.5);
}

/* Анимация появления */
.custom-cursor,
.custom-cursor-dot {
    animation: cursorAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cursorAppear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Пульсация внешнего кольца */
.custom-cursor::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border: 1px solid rgba(0, 212, 255, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(1);
    animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.5;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

/* Скрываем на touch-устройствах */
@media (hover: none) and (pointer: coarse) {
    * {
        cursor: auto !important;
    }
    .custom-cursor,
    .custom-cursor-dot,
    .custom-cursor-trail {
        display: none !important;
    }
}

/* Скрываем кастомный курсор в 3D мини-играх (Доставка, Грузчик, Фриланс) */
body.minigame-active .custom-cursor,
body.minigame-active .custom-cursor-dot,
body.minigame-active .custom-cursor-trail {
    opacity: 0 !important;
    pointer-events: none !important;
}