/* 首頁「贊助主播直播中」浮動按鈕：疊在聊天按鈕上方，沒有聊天按鈕時貼底 */
.live-float {
  --lf-live: #ef4444;
  --lf-twitch: #9146ff;
  --lf-bg: var(--color-nav, #1A1A22);
  --lf-bottom: 20px;
  --lf-size: 58px;

  position: fixed;
  z-index: 1031;
  right: 20px;
  bottom: var(--lf-bottom);
}
/* 聊天室浮鈕在同層、且排在前面時往上讓位（chat_float 關閉時不會輸出） */
.chat-float-fab ~ .live-float { --lf-bottom: 76px; }
.live-float[hidden] { display: none !important; }
.live-float *, .live-float *::before, .live-float *::after { box-sizing: border-box; }

.live-float__fab {
  position: relative;
  display: block;
  width: var(--lf-size);
  height: var(--lf-size);
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}
.live-float__fab:focus-visible { outline: 2px solid #f7c24b; outline-offset: 4px; }
.live-float__fab:active { transform: scale(0.95); }

.live-float__avatar {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #222;
  border: 3px solid var(--lf-live);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.live-float__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--lf-live);
  animation: lf-ring 2.4s ease-out infinite;
}

.live-float__tag {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.5;
  color: #fff;
  background: var(--lf-live);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.live-float__more {
  position: absolute;
  z-index: 2;
  top: -4px;
  right: -6px;
  min-width: 24px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  color: #fff;
  background: var(--lf-twitch);
  border: 2px solid var(--lf-bg);
}
.live-float__more[hidden] { display: none; }

.live-float.is-enter .live-float__fab { animation: lf-enter 0.5s cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes lf-ring {
  0% { transform: scale(1); opacity: 0.7; }
  80%, 100% { transform: scale(1.45); opacity: 0; }
}
@keyframes lf-enter {
  0% { transform: translateY(16px) scale(0.6); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .live-float__ring { animation: none; opacity: 0.5; }
  .live-float.is-enter .live-float__fab { animation: none; }
}

/* ── 手機：底部導覽列上方 ── */
@media (max-width: 767px) {
  .live-float {
    --lf-size: 52px;
    --lf-nav: calc(var(--lux-bottom-nav-offset, 80px) + env(safe-area-inset-bottom, 0px));
    right: 22px;
    bottom: calc(var(--lf-nav) + 4px);
  }
  .chat-float-fab ~ .live-float { bottom: calc(var(--lf-nav) + 12px + 40px + 8px); }
  body.chat-float-open .live-float { display: none; }
}
