/* 研究部の人数の札 (0.5.7、masao-0e3)。live-count.js が is-live (WebSocket がつながっている) と is-bump (値が変わった直後) を付ける。
 * 縁や枠を足さない (0.5.6 の方針)。光は一度だけの外側の滲みと、字の上を走る帯だけ。 */
.masao [data-live-count] { position: relative; isolation: isolate; font-variant-numeric: tabular-nums; }
.masao [data-live-count] .live-count__num { font-weight: inherit; }
/* つながっている印: 小さな点がゆっくり明滅する */
.masao .cta__count[data-live-count]::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%;
  background: var(--color-muted); vertical-align: .12em; opacity: .55; transition: background-color .3s, opacity .3s;
}
.masao .cta__count[data-live-count].is-live::before { background: #19b36b; opacity: 1; animation: masao-live-dot 2.4s ease-in-out infinite; }
@keyframes masao-live-dot { 0%, 100% { box-shadow: 0 0 0 0 rgba(25, 179, 107, .45); } 50% { box-shadow: 0 0 0 4px rgba(25, 179, 107, 0); } }

/* 値が変わった直後: 札が一度光り、字の上を光の帯が通る */
.masao [data-live-count].is-bump { animation: masao-live-glow 1.6s cubic-bezier(.2, .7, .2, 1) 1; }
@keyframes masao-live-glow {
  0% { box-shadow: 0 0 0 0 rgba(21, 86, 223, 0); }
  18% { box-shadow: 0 0 0 3px rgba(255, 216, 76, .9), 0 0 22px 6px rgba(21, 86, 223, .45); }
  100% { box-shadow: 0 0 0 0 rgba(21, 86, 223, 0); }
}
.masao [data-live-count].is-bump .live-count__num {
  background: linear-gradient(100deg, currentColor 0 38%, #ffd84c 46%, #ffffff 50%, #ffd84c 54%, currentColor 62% 100%) 0 0 / 260% 100% no-repeat;
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  animation: masao-live-sweep 1.2s ease-out 1 both;
}
@keyframes masao-live-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
/* 増えた数の小さな札 (+3)。上へ浮いて消える */
.masao .cta__count[data-live-count].is-bump::after {
  content: attr(data-delta); position: absolute; right: -4px; top: -2px; transform: translate(50%, -60%);
  padding: 1px 6px; border-radius: 999px; background: var(--color-cta); color: var(--color-on-cta);
  font: 600 10.5px/1.4 var(--font-mono); pointer-events: none; animation: masao-live-delta 2.2s ease-out 1 both;
}
@keyframes masao-live-delta { 0% { opacity: 0; transform: translate(50%, -20%); } 15% { opacity: 1; transform: translate(50%, -70%); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(50%, -130%); } }

@media (prefers-reduced-motion: reduce) {
  .masao [data-live-count].is-bump, .masao [data-live-count].is-bump .live-count__num, .masao .cta__count[data-live-count].is-live::before { animation: none; }
  .masao [data-live-count].is-bump .live-count__num { -webkit-text-fill-color: currentColor; background: none; }
  .masao .cta__count[data-live-count].is-bump::after { display: none; }
}
