/* ============================================================
   BACK TO TOP — LYNXREACTOR
   ============================================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-gold);
    color: var(--color-text-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 24px rgba(200, 154, 91, 0.3);
    text-decoration: none;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--color-gold-light);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 40px rgba(200, 154, 91, 0.4);
}

.back-to-top:active {
    transform: scale(0.95);
}

/* Иконка стрелки */
.back-to-top .arrow-up {
    display: inline-block;
    transition: transform 0.3s ease;
    line-height: 1;
}

.back-to-top:hover .arrow-up {
    transform: translateY(-3px);
}

/* Tooltip при наведении */
.back-to-top .tooltip {
    position: absolute;
    right: calc(100% + 16px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-card-bg);
    color: var(--color-text-primary);
    padding: 6px 14px;
    border-radius: 6px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.06);
    pointer-events: none;
}

.back-to-top .tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--color-card-bg);
}

.back-to-top:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   АДАПТИВНОСТЬ
   ============================================================ */

@media (max-width: 768px) {
    .back-to-top {
        width: 46px;
        height: 46px;
        font-size: 18px;
        bottom: 20px;
        right: 20px;
    }
    .back-to-top .tooltip {
        display: none;
    }
}

@media (max-width: 480px) {
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 16px;
        bottom: 16px;
        right: 16px;
    }
}

/* ============================================================
   АНИМАЦИЯ ПРИ ПОЯВЛЕНИИ
   ============================================================ */

@keyframes backToTopPulse {
    0%, 100% {
        box-shadow: 0 4px 24px rgba(200, 154, 91, 0.3);
    }
    50% {
        box-shadow: 0 4px 40px rgba(200, 154, 91, 0.5);
    }
}

.back-to-top.visible {
    animation: backToTopPulse 2s ease-in-out infinite;
}

.back-to-top.visible:hover {
    animation: none;
}