/* =============================================
   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;
}
.lmc-stat-row {
  display: grid;
  grid-template-columns: 40px 1fr 90px 1fr 40px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.lmc-stat-h, .lmc-stat-a {
  font-weight: 800;
  color: #fff;
  text-align: center;
}
.lmc-stat-label {
  text-align: center;
  color: var(--text-secondary, #aaa);
  font-size: 11px;
}
.lmc-stat-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
}
.lmc-stat-bar:first-of-type {
  /* home（左邊）的 bar 從右側往左長 */
  display: flex;
  justify-content: flex-end;
}
.lmc-stat-bar-h {
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 193, 7, 0.4), rgba(255, 193, 7, 0.85));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.lmc-stat-bar-a {
  height: 100%;
  background: linear-gradient(90deg, rgba(66, 165, 245, 0.85), rgba(66, 165, 245, 0.4));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ── 出場名單 ── */
.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: 32px 1fr 76px 1fr 32px;
    font-size: 11px;
  }
}
