/* «Живые» счётчики и комментарии (reboot-child / inc/live.php, assets/live.js) */

/* скрытый рейтинг (0) — карточка выводит его всегда, чтобы показать после первого голоса */
.mc-rate[hidden],
.js-lv-r[hidden] { display: none !important; }

/* цифра изменилась — короткая вспышка */
.lv-bump {
    display: inline-block;
    animation: lv-bump .9s cubic-bezier(.2, .8, .3, 1);
}
.mc-rate.lv-bump { display: inline-flex; }
@keyframes lv-bump {
    0%   { transform: scale(1); color: inherit; }
    25%  { transform: scale(1.28); color: #2d81e0; text-shadow: 0 0 10px rgba(45, 129, 224, .35); }
    100% { transform: scale(1); }
}

/* новый комментарий */
#comments li.lv-new > .comment-body {
    animation: lv-new 4s ease-out;
    border-radius: 12px;
}
@keyframes lv-new {
    0%   { background: rgba(45, 129, 224, .16); box-shadow: 0 0 0 6px rgba(45, 129, 224, .16); transform: translateY(8px); opacity: 0; }
    10%  { transform: none; opacity: 1; }
    60%  { background: rgba(45, 129, 224, .10); box-shadow: 0 0 0 6px rgba(45, 129, 224, .10); }
    100% { background: transparent; box-shadow: 0 0 0 6px transparent; }
}

/* плашка «N новых комментариев ↓» */
.lv-pill {
    position: fixed;
    left: 50%;
    bottom: 22px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 18px 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #2d81e0;
    color: #fff;
    font: 600 14px/1.2 inherit;
    font-family: inherit;
    box-shadow: 0 10px 28px -8px rgba(45, 129, 224, .65), 0 2px 6px rgba(0, 0, 0, .12);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 16px);
    transition: opacity .25s, transform .25s;
}
.lv-pill.is-visible { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.lv-pill:hover { background: #1f6fcc; }
.lv-pill:focus-visible { outline: 3px solid rgba(45, 129, 224, .45); outline-offset: 2px; }
.lv-pill__dot {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #7dffb0;
    flex-shrink: 0;
}
.lv-pill__dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #7dffb0;
    animation: lv-pulse 1.6s ease-out infinite;
}
@keyframes lv-pulse {
    0%   { transform: scale(.5); opacity: .9; }
    100% { transform: scale(1.6); opacity: 0; }
}
@media (max-width: 767px) {
    /* над нижней мобильной навигацией */
    .lv-pill { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); font-size: 13px; }
}

/* отправка комментария */
#commentform.is-sending { position: relative; }
#commentform.is-sending textarea,
#commentform.is-sending input:not([type="hidden"]) { opacity: .6; }
#commentform.is-sending [type="submit"] { cursor: progress; }

.lv-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.45;
    animation: lv-note .3s ease-out;
}
.lv-note[hidden] { display: none; }
.lv-note::before { flex-shrink: 0; font-size: 16px; line-height: 1.3; }
.lv-note--ok   { background: #e9f8ef; color: #12733b; }
.lv-note--ok::before   { content: "✓"; font-weight: 700; }
.lv-note--wait { background: #eef4fd; color: #1f5fa8; }
.lv-note--wait::before { content: "⏳"; }
.lv-note--err  { background: #fdecee; color: #b4232f; }
.lv-note--err::before  { content: "!"; font-weight: 700; }
@keyframes lv-note {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: none; }
}

/* свой комментарий на модерации */
#comments li.lv-own > .comment-body { border-left: 3px solid #2d81e0; padding-left: 12px; }

@media (prefers-reduced-motion: reduce) {
    .lv-bump, #comments li.lv-new > .comment-body, .lv-note, .lv-pill__dot::after { animation: none; }
    .lv-pill { transition: none; }
}
