/* Размеры логотипа продублированы атрибутами width/height в разметке:
   до применения CSS браузер рисует SVG в размере по умолчанию, и при
   переходах по ссылкам «самолётик» на кадр раздувался во весь экран.
   overflow: hidden — вторая страховка на тот же случай. */
.telegram-button {
    overflow: hidden;
    position: fixed;
    right: 20px;
    bottom: 35px;
    background: linear-gradient(135deg, #0088cc 0%, #24a1de 100%);
    border-radius: 50%;
    width: 54px;
    height: 54px;
    color: #ffffff;
    text-align: center;
    line-height: 54px;
    font-size: 26px;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.45);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
    cursor: pointer;
}

.telegram-button:hover {
    transform: scale(1.12);
    box-shadow: 0 12px 30px rgba(0, 136, 204, 0.7);
}

.telegram-button a {
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

/* .fa-telegram в font-awesome.css темы отсутствует — логотип идёт инлайн-SVG */
.telegram-button .tg-icon {
    width: 28px;
    height: 28px;
    display: block;
    margin: 13px auto 0;
    /* оптический центр: у «самолётика» смещён влево-вниз */
    transform: translateX(-1px);
}

/* Мобильный док занимает нижние 60px — поднимаем кнопку над ним,
   иначе она перекрывается панелью навигации. */
@media (max-width: 768px) {
    .telegram-button {
        bottom: calc(76px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        width: 48px;
        height: 48px;
    }

    .telegram-button .tg-icon {
        width: 24px;
        height: 24px;
        margin-top: 12px;
    }
}

.telegram-button:before,
.telegram-button:after {
    content: "";
    display: block;
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(0, 136, 204, 0.6);
    left: -12px;
    right: -12px;
    top: -12px;
    bottom: -12px;
    animation: tg-pulse 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
    pointer-events: none;
}

.telegram-button:after {
    animation-delay: 0.8s;
}

@keyframes tg-pulse {
    0% {
        transform: scale(0.6);
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}