/* ========================================================
   今彩539 抬頭「開獎直播倒數看板」專用樣式表
   檔案路徑: static/css/lottery_539_live.css
   ======================================================== */

.live-539-countdown-card {
  position: relative;
  background: linear-gradient(135deg, #090d16 0%, #0f172a 50%, #0a0e1a 100%);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45), inset 0 0 15px rgba(245, 158, 11, 0.04);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 頂部光芒背景微亮條 */
.live-539-countdown-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #f59e0b, #ef4444, #f59e0b, transparent);
  opacity: 0.8;
}

/* 臨戰倒數 (20:25 ~ 20:30) 金紅警示呼吸燈 */
.live-539-countdown-card.urgent {
  border-color: #ef4444 !important;
  animation: urgent-card-pulse 1.4s infinite alternate ease-in-out;
}

@keyframes urgent-card-pulse {
  0% {
    border-color: #ef4444;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.6), inset 0 0 14px rgba(239, 68, 68, 0.15);
  }
  100% {
    border-color: #f59e0b;
    box-shadow: 0 0 28px rgba(245, 158, 11, 0.85), inset 0 0 18px rgba(245, 158, 11, 0.25);
  }
}

/* LIVE 連線出球模式 */
.live-539-countdown-card.is-live {
  border-color: #10b981 !important;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.5), inset 0 0 15px rgba(16, 185, 129, 0.12);
}

/* 標題列 */
.live-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.live-title-badge-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.live-dot-indicator {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
  display: inline-block;
  flex-shrink: 0;
  animation: pulse-live-dot 1.2s infinite ease-in-out;
}

.live-539-countdown-card.is-live .live-dot-indicator {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-live-dot 0.8s infinite ease-in-out;
}

@keyframes pulse-live-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.35;
    transform: scale(0.85);
  }
}

.live-main-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fef08a;
  letter-spacing: 0.3px;
  margin: 0;
  line-height: 1.3;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.live-countdown-text {
  color: #38bdf8;
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  letter-spacing: 0.5px;
}

.live-539-countdown-card.urgent .live-countdown-text {
  color: #ef4444 !important;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.8) !important;
  animation: blink-urgent-text 0.8s infinite alternate ease-in-out;
}

@keyframes blink-urgent-text {
  0% { opacity: 1; filter: drop-shadow(0 0 4px #ef4444); }
  100% { opacity: 0.6; filter: drop-shadow(0 0 10px #f59e0b); }
}

/* 狀態標籤 */
.live-status-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  white-space: nowrap;
  flex-shrink: 0;
}

.live-539-countdown-card.urgent .live-status-pill {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: #ef4444;
}

.live-539-countdown-card.is-live .live-status-pill {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border-color: #10b981;
}

/* 提示訊息列 */
.live-sub-notice {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-source-hint {
  font-size: 0.72rem;
  color: #64748b;
}

/* 5 顆球槽架子容器（無外部懸掛標籤，乾淨緊湊） */
.live-slots-rack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 12px 10px;
  background: rgba(15, 23, 42, 0.65);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.live-ball-slot {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.85);
  border: 2px dashed rgba(148, 163, 184, 0.35);
  color: #64748b;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

/* 球槽內部結構：垂直置中排版，大號碼在上方、生肖單字刻在號碼下方（零外部標籤） */
.live-ball-slot.drawn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.live-ball-slot .ball-num-main {
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.5px;
}

.live-ball-slot .ball-zodiac-engraved {
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  margin-top: 1px;
  color: #78350f;
  background: rgba(254, 240, 138, 0.55);
  padding: 0px 3px;
  border-radius: 3px;
  letter-spacing: 0;
  display: block;
}

/* 徹底移除球下方標籤與偽元素 */
.live-ball-slot::after {
  display: none !important;
  content: none !important;
}

/* 開出球號：金黃立體彩球 */
.live-ball-slot.drawn {
  background: radial-gradient(circle at 35% 30%, #fef08a 0%, #f59e0b 55%, #b45309 100%) !important;
  border: 2px solid #fef08a !important;
  color: #0f172a !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.75), inset -2px -2px 6px rgba(0, 0, 0, 0.45), inset 2px 2px 6px rgba(255, 255, 255, 0.8) !important;
  animation: ball-pop-drop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ball-pop-drop {
  0% {
    transform: scale(0.3) translateY(-15px);
    opacity: 0;
  }
  60% {
    transform: scale(1.22) translateY(2px);
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* 手機版排版調適 */
@media (max-width: 480px) {
  .live-539-countdown-card {
    padding: 12px 10px;
  }
  .live-main-title {
    font-size: 0.95rem;
  }
  .live-ball-slot {
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }
}

/* ========================================================
   🟡 封盤倒數期 (20:25 ~ 20:30) 空白光牌呼吸燈與開球點亮動態
   ======================================================== */
.ball-slot-blank {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px dashed rgba(251, 191, 36, 0.7) !important;
  background: radial-gradient(circle at 40% 35%, rgba(254, 240, 138, 0.25) 0%, rgba(245, 158, 11, 0.12) 50%, rgba(15, 23, 42, 0.85) 100%) !important;
  color: #fde047 !important;
  font-size: 1.15rem;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35), inset 0 0 10px rgba(251, 191, 36, 0.2) !important;
  box-sizing: border-box;
  animation: blankBallGlow 1.4s ease-in-out infinite alternate;
}

@keyframes blankBallGlow {
  0% {
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.3), inset 0 0 6px rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.45);
    transform: scale(0.96);
  }
  100% {
    box-shadow: 0 0 22px rgba(251, 191, 36, 0.85), 0 0 35px rgba(245, 158, 11, 0.45), inset 0 0 14px rgba(254, 240, 138, 0.4);
    border-color: rgba(253, 224, 71, 0.95);
    transform: scale(1.05);
  }
}

.official-ball-cell .ball-slot-blank {
  width: 44px;
  height: 44px;
  margin: 0 auto;
}

.ball-drop-pop-anim {
  animation: ballDropPopKeyframe 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ballDropPopKeyframe {
  0% {
    transform: scale(0.2) translateY(-25px);
    opacity: 0;
  }
  60% {
    transform: scale(1.22) translateY(2px);
    opacity: 1;
  }
  100% {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
