/* =============================================
   Live Match Center 樣式
   ============================================= */

.lmc-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.lmc-modal {
  position: relative;
  width: 100%;
  max-width: 760px;
  background: linear-gradient(180deg, #1A2244 0%, #0A0F2C 100%);
  border: 1px solid rgba(255, 193, 7, 0.25);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(255, 193, 7, 0.15);
  color: #fff;
  margin: 40px auto 80px;
  overflow: hidden;
}

.lmc-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 36px; height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s;
}
.lmc-close:hover { background: rgba(255, 255, 255, 0.18); }

.lmc-body { padding: 24px 20px; }

.lmc-loading,
.lmc-error {
  text-align: center;
  padding: 60px 20px;
  font-size: 15px;
  color: #FFD54F;
}
.lmc-error { color: #ff6b7a; }

/* ── 計分板 ── */
.lmc-scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 20px 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.lmc-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}
.lmc-team-logo {
  width: 64px; height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.lmc-team-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  max-width: 130px;
}
.lmc-score-center {
  text-align: center;
  min-width: 130px;
}
.lmc-score {
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #FFD54F;
  text-shadow: 0 0 18px rgba(255, 193, 7, 0.4);
}
.lmc-status-live {
  display: inline-block;
  background: linear-gradient(135deg, rgba(255, 71, 87, 0.85), rgba(255, 71, 87, 0.6));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  margin-top: 4px;
  animation: lmc-pulse 1.4s ease-in-out infinite;
}
@keyframes lmc-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 71, 87, 0); }
}
.lmc-status-ft {
  display: inline-block;
  background: rgba(76, 175, 80, 0.2);
  color: #81C784;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  margin-top: 4px;
}
.lmc-status-upcoming {
  display: inline-block;
  color: var(--text-secondary, #aaa);
  font-size: 12px;
  margin-top: 4px;
}
.lmc-venue {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-top: 6px;
}

/* ── Section 通用 ── */
.lmc-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.lmc-section-title {
  font-size: 14px;
  font-weight: 800;
  color: #FFD54F;
  margin-bottom: 12px;
}

/* ── 事件時間軸 ── */
.lmc-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
}
.lmc-event {
  display: grid;
  grid-template-columns: 50px 32px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  font-size: 13px;
}
.lmc-event-home { border-left: 3px solid rgba(255, 193, 7, 0.5); }
.lmc-event-away { border-right: 3px solid rgba(66, 165, 245, 0.5); border-left: none; }
.lmc-event-away { grid-template-columns: 1fr 32px 50px; text-align: right; }
.lmc-event-away .lmc-event-desc { order: -1; }
.lmc-event-away .lmc-event-icon { order: 0; }
.lmc-event-away .lmc-event-minute { order: 1; }
.lmc-event-minute {
  color: var(--text-secondary, #aaa);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.lmc-event-icon { text-align: center; font-size: 16px; }
.lmc-event-desc { color: #fff; }
.lmc-event-sub {
  color: var(--text-muted, #888);
  font-size: 11px;
  margin-left: 4px;
}

/* ── 統計 bars ── */
.lmc-stats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Apple Sports 風：雙欄、贏的高亮紅 pill */
.lmc-stat-row {
  display: grid;
  grid-template-columns: 1fr 130px 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 17px;
}
.lmc-stat-row:last-child { border-bottom: none; }
.lmc-stat-val {
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 6px 14px;
  border-radius: 18px;
  min-width: 36px;
  display: inline-block;
  justify-self: center;
  background: transparent;
  transition: background 0.2s, color 0.2s;
}
.lmc-stat-val.lmc-stat-win {
  background: #ef4444;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(239,68,68,0.25);
}
.lmc-stat-label {
  text-align: center;
  color: var(--text-secondary, #aaa);
  font-size: 14px;
  font-weight: 600;
}

/* ── 出場名單 ── */
.lmc-lineups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lmc-lineup-team {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 14px;
}
.lmc-lineup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  color: #fff;
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.lmc-formation {
  background: rgba(255, 193, 7, 0.15);
  color: #FFD54F;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 8px;
}
.lmc-coach {
  font-size: 11px;
  color: var(--text-muted, #888);
  margin-bottom: 10px;
}
.lmc-lineup-section {
  font-size: 11px;
  color: var(--text-secondary, #aaa);
  margin: 10px 0 6px;
  font-weight: 700;
}
.lmc-player {
  display: grid;
  grid-template-columns: 28px 1fr 30px;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
}
.lmc-number {
  background: rgba(255, 193, 7, 0.18);
  color: #FFD54F;
  font-weight: 800;
  text-align: center;
  border-radius: 4px;
  padding: 1px 0;
  font-size: 11px;
}
.lmc-pname { color: #fff; }
.lmc-pos {
  color: var(--text-muted, #888);
  font-size: 10px;
  text-align: right;
}
.lmc-sub .lmc-number { background: rgba(255, 255, 255, 0.06); color: var(--text-secondary, #aaa); }
.lmc-sub .lmc-pname { color: var(--text-secondary, #ccc); }

/* ── footer ── */
.lmc-footer {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted, #888);
}
.lmc-live-indicator { color: #ff6b7a; font-weight: 700; }

/* ── 手機版 ── */
@media (max-width: 600px) {
  .lmc-overlay { padding: 0; }
  .lmc-modal { border-radius: 14px 14px 0 0; margin: 12px 0 0; }
  .lmc-body { padding: 18px 14px; }
  .lmc-score { font-size: 30px; letter-spacing: 2px; }
  .lmc-team-logo { width: 48px; height: 48px; }
  .lmc-team-name { font-size: 13px; }
  .lmc-lineups { grid-template-columns: 1fr; }
  .lmc-event {
    grid-template-columns: 40px 28px 1fr;
    font-size: 12px;
  }
  .lmc-event-away { grid-template-columns: 1fr 28px 40px; }
  .lmc-stat-row {
    grid-template-columns: 1fr 110px 1fr;
    font-size: 15px;
    padding: 6px 0;
  }
  .lmc-stat-val { padding: 5px 12px; min-width: 30px; }
  .lmc-stat-label { font-size: 12px; }
}

/* ╔═════════════════════════════════════════════════╗
   ║  即時事件動畫 — 進球 / 紅黃牌 / 換人              ║
   ╚═════════════════════════════════════════════════╝ */

/* 進球 — 該隊區大跳 + 金色光暈 */
@keyframes lmc-anim-goal {
  0%   { transform: scale(1) rotate(0); filter: none; }
  20%  { transform: scale(1.20) rotate(-3deg); filter: drop-shadow(0 0 18px #FFD54F); }
  45%  { transform: scale(1.08) rotate(2deg); filter: drop-shadow(0 0 12px #FFD54F); }
  75%  { transform: scale(1.04) rotate(-1deg); }
  100% { transform: scale(1); filter: none; }
}
.lmc-anim-goal {
  animation: lmc-anim-goal 1.4s cubic-bezier(.36, 1.5, .5, 1);
}

/* 進球比分 — 文字放大 + 金色發光 */
@keyframes lmc-anim-score {
  0%   { transform: scale(1); color: inherit; text-shadow: none; }
  30%  { transform: scale(1.5); color: #FFD54F; text-shadow: 0 0 24px #FFD54F, 0 0 12px rgba(255,213,79,0.6); }
  60%  { transform: scale(1.15); color: #FFD54F; text-shadow: 0 0 12px #FFD54F; }
  100% { transform: scale(1); color: inherit; text-shadow: none; }
}
.lmc-anim-score-pulse {
  animation: lmc-anim-score 1.4s ease-out;
  display: inline-block;
}

/* 黃牌 — 該隊區黃色光暈閃爍 2 下 */
@keyframes lmc-anim-yellow {
  0%, 100% { box-shadow: none; background: transparent; }
  25%, 75% {
    box-shadow: 0 0 0 4px rgba(255,235,59,0.45), 0 0 24px rgba(255,235,59,0.55);
    background: rgba(255,235,59,0.05);
  }
}
.lmc-anim-card-yellow {
  animation: lmc-anim-yellow 1.2s;
  border-radius: 10px;
}

/* 紅牌 — 該隊區紅色光暈 + 抖動 */
@keyframes lmc-anim-red {
  0%, 100% { transform: translateX(0); box-shadow: none; background: transparent; }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-4px);
    box-shadow: 0 0 0 4px rgba(255,82,82,0.35), 0 0 20px rgba(255,82,82,0.55);
    background: rgba(255,82,82,0.06);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(4px);
    box-shadow: 0 0 22px rgba(255,82,82,0.60);
    background: rgba(255,82,82,0.10);
  }
}
.lmc-anim-card-red {
  animation: lmc-anim-red 1.3s;
  border-radius: 10px;
}

/* 換人 — 淡藍色脈衝 */
@keyframes lmc-anim-subst {
  0%, 100% { box-shadow: none; }
  50%      { box-shadow: 0 0 0 3px rgba(91,182,255,0.35), 0 0 14px rgba(91,182,255,0.40); }
}
.lmc-anim-subst {
  animation: lmc-anim-subst 0.8s;
  border-radius: 10px;
}

/* 進球 confetti — 從上方掉落 emoji */
.lmc-goal-confetti {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
}
.lmc-goal-confetti span {
  position: absolute;
  top: -50px;
  font-size: 26px;
  user-select: none;
  animation: lmc-fall 2s ease-in forwards;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
@keyframes lmc-fall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(115vh) rotate(720deg); opacity: 0.3; }
}

/* 事件 toast — 上方居中、半透明卡 */
.lmc-event-toast {
  position: fixed;
  top: 78px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 9998;
  padding: 10px 18px;
  border-radius: 24px;
  font-size: 14px; font-weight: 800;
  color: #fff;
  background: rgba(20, 20, 20, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.3s, transform 0.4s cubic-bezier(.36,1.4,.5,1);
  pointer-events: none;
  letter-spacing: 0.5px;
  max-width: 90vw;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lmc-event-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.lmc-toast-goal {
  background: linear-gradient(135deg, #FFD54F, #d9a829);
  color: #1a1a1a;
  border: 1px solid #FFD54F;
  box-shadow: 0 8px 24px rgba(244,196,48,0.5), 0 0 40px rgba(244,196,48,0.30);
}
.lmc-toast-card-red {
  background: linear-gradient(135deg, #ff5252, #d63838);
  border: 1px solid #ff5252;
  box-shadow: 0 8px 24px rgba(255,82,82,0.5);
}
.lmc-toast-card-yellow {
  background: linear-gradient(135deg, #ffeb3b, #fbc02d);
  color: #1a1a1a;
  border: 1px solid #ffeb3b;
}
.lmc-toast-min {
  opacity: 0.7;
  margin-right: 4px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .lmc-event-toast { top: 62px; font-size: 13px; padding: 8px 14px; }
}

/* 站內即時戰報內：看 ofagirls 影片直播按鈕 */
.lmc-watch-live-wrap {
  margin: 14px 16px 6px;
  text-align: center;
}
.lmc-watch-live-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
  border: 2px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.3px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(239,68,68,0.40);
  transition: transform 0.15s, box-shadow 0.2s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.lmc-watch-live-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(239,68,68,0.55);
}
.lmc-watch-live-btn:active {
  transform: translateY(0) scale(0.98);
}
.lmc-watch-live-dot {
  width: 9px; height: 9px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(255,255,255,0.8);
  animation: lmcWatchPulse 1.2s ease-in-out infinite;
}
@keyframes lmcWatchPulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.7); }
}
