/* Modern match detail layer inspired by Live Desk dialog */
:root {
  --md-accent: #38bdf8;
  --md-accent-soft: rgba(56, 189, 248, 0.14);
  --md-accent-border: rgba(56, 189, 248, 0.26);
  --md-panel: rgba(8, 16, 24, 0.94);
  --md-panel-2: rgba(15, 23, 42, 0.78);
  --md-line: rgba(226, 232, 240, 0.1);
  --md-text: #f8fafc;
  --md-muted: rgba(226, 232, 240, 0.62);
}

body.et-md-football {
  --md-accent: #22c55e;
  --md-accent-soft: rgba(34, 197, 94, 0.14);
  --md-accent-border: rgba(34, 197, 94, 0.32);
}

body.et-md-basketball {
  --md-accent: #f97316;
  --md-accent-soft: rgba(249, 115, 22, 0.15);
  --md-accent-border: rgba(249, 115, 22, 0.34);
}

body.et-md-tennis {
  --md-accent: #bef264;
  --md-accent-soft: rgba(190, 242, 100, 0.14);
  --md-accent-border: rgba(190, 242, 100, 0.32);
}

.md-page {
  max-width: 1180px;
  padding: 96px 18px 82px;
}

.md-breadcrumb {
  width: fit-content;
  max-width: 100%;
  margin-bottom: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(226, 232, 240, 0.09);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.52);
  backdrop-filter: blur(12px);
  color: rgba(226, 232, 240, 0.58);
  letter-spacing: 0;
}

.md-breadcrumb a:hover { color: var(--md-accent); }

.md-hero {
  border-radius: 8px !important;
  border: 1px solid var(--md-accent-border) !important;
  background:
    radial-gradient(circle at 50% -10%, var(--md-accent-soft), transparent 46%),
    linear-gradient(180deg, rgba(8, 16, 24, 0.96), rgba(3, 7, 18, 0.94)) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  padding: 16px !important;
  margin-bottom: 16px;
}

.md-hero::before {
  background:
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px) center / 72px 72px,
    linear-gradient(0deg, rgba(255,255,255,0.035) 1px, transparent 1px) center / 72px 72px !important;
  opacity: 0.58;
}

.md-hero-league {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: var(--md-accent) !important;
  letter-spacing: 0;
}

.md-hero-league img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.08);
}

.md-status-badge {
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0;
  color: #f8fafc !important;
  background: var(--md-accent-soft) !important;
  border: 1px solid var(--md-accent-border) !important;
}

.md-hero-teams {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 14px 8px 8px;
}

.md-team {
  min-width: 0;
  gap: 8px;
}

.md-team-logo,
.md-team-logo-fb {
  width: 78px !important;
  height: 78px !important;
  padding: 8px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.76) !important;
  border: 1px solid rgba(226, 232, 240, 0.13) !important;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), 0 0 24px var(--md-accent-soft);
}

.md-team-logo-fb {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--md-accent) !important;
}

.md-team-name {
  max-width: 100%;
  color: var(--md-text);
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.18;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.md-team-role {
  color: var(--md-muted) !important;
  font-size: 0.68rem;
  letter-spacing: 0;
}

.md-score-block {
  min-width: 128px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--md-accent-border);
  background: rgba(2, 6, 23, 0.74);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.md-score,
.md-score-vs {
  min-width: 104px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--md-accent-border);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.78));
  color: #e0f2fe;
  font-size: 2.12rem;
  font-weight: 1000;
  letter-spacing: 0;
  text-align: center;
}

.md-score-vs {
  font-size: 1.08rem;
  color: var(--md-accent);
}

.md-score-ht,
.md-match-time {
  color: rgba(226, 232, 240, 0.68);
  font-weight: 800;
  letter-spacing: 0;
}

.md-pred-card,
.md-card {
  border-radius: 8px !important;
  border: 1px solid rgba(226, 232, 240, 0.09) !important;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.88), rgba(5, 10, 18, 0.88)) !important;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.045) !important;
}

.md-pred-card {
  border-color: var(--md-accent-border) !important;
  background:
    radial-gradient(circle at 18% 0%, var(--md-accent-soft), transparent 38%),
    linear-gradient(180deg, rgba(10, 20, 18, 0.94), rgba(4, 11, 18, 0.92)) !important;
}

.md-pred-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.08);
}

.md-pred-ai-badge {
  border-radius: 8px;
  background: var(--md-accent-soft) !important;
  border-color: var(--md-accent-border) !important;
  color: #f8fafc !important;
  letter-spacing: 0;
}

.md-pred-type {
  color: var(--md-text);
  letter-spacing: 0;
}

.md-pred-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.md-pred-meta-item {
  min-width: 0;
  padding: 11px;
  border-radius: 8px;
  border: 1px solid rgba(226, 232, 240, 0.08);
  background: rgba(255, 255, 255, 0.045);
}

.md-pred-meta-val {
  color: var(--md-accent) !important;
  font-weight: 1000;
}

.md-pred-meta-label,
.md-card-title,
.cmp-title,
.stat-label,
.cmp-row-label,
.h2h-stat-label {
  letter-spacing: 0 !important;
}

.md-pred-reasoning {
  border-left: 0;
  border: 1px solid rgba(226, 232, 240, 0.08);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.48);
  color: rgba(226, 232, 240, 0.72);
}

.md-tabs {
  position: sticky;
  top: 72px;
  z-index: 20;
  gap: 6px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, 0.08);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.md-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 12px;
  color: rgba(226, 232, 240, 0.58);
  letter-spacing: 0;
}

.md-tab:hover {
  color: var(--md-text);
  background: rgba(255, 255, 255, 0.045);
}

.md-tab.active {
  color: var(--md-text) !important;
  border-color: var(--md-accent-border) !important;
  background: var(--md-accent-soft) !important;
}

.md-card-title,
.cmp-title {
  color: var(--md-accent) !important;
  font-size: 0.84rem;
}

.cmp-row,
.stat-row,
.h2h-match,
.form-match-row,
.injury-row,
.lineup-player,
.event-item {
  border-color: rgba(226, 232, 240, 0.075) !important;
}

.cmp-row,
.stat-row {
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.cmp-bar-wrap,
.h2h-bar,
.stat-bar-wrap {
  height: 8px;
  border-radius: 8px;
  background: rgba(226, 232, 240, 0.08) !important;
}

.cmp-bar-home,
.stat-bar-home,
.h2h-bar-home {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.85), var(--md-accent)) !important;
}

.cmp-bar-away,
.stat-bar-away,
.h2h-bar-away {
  background: linear-gradient(90deg, var(--md-accent), rgba(248, 113, 113, 0.82)) !important;
}

.h2h-summary {
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.h2h-stat-num {
  color: var(--md-text);
  letter-spacing: 0;
}

.h2h-match,
.form-match-row,
.injury-row,
.lineup-team {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.h2h-match,
.form-match-row,
.injury-row {
  padding: 10px;
  margin-bottom: 8px;
  border-bottom: 0;
}

.h2h-match-score,
.form-match-score,
.form-match-venue,
.lineup-num,
.lineup-formation,
.injury-type {
  border-radius: 8px;
}

.form-badge {
  border-radius: 6px;
}

.lineup-team {
  border: 1px solid rgba(226, 232, 240, 0.08);
}

.events-timeline::before {
  background: linear-gradient(180deg, var(--md-accent), rgba(226, 232, 240, 0.08));
}

.event-dot {
  background: var(--md-panel);
}

.md-empty,
.md-error,
.md-loading {
  border-radius: 8px;
}

body.et-md-football .md-hero,
body.et-md-basketball .md-hero,
body.et-md-tennis .md-hero,
body.et-md-football .md-card,
body.et-md-basketball .md-card,
body.et-md-tennis .md-card,
body.et-md-football .md-pred-card,
body.et-md-basketball .md-pred-card,
body.et-md-tennis .md-pred-card {
  border-color: var(--md-accent-border) !important;
}

@media (max-width: 760px) {
  .md-page {
    padding: 88px 10px 68px;
  }

  .md-hero {
    padding: 12px !important;
  }

  .md-hero-league {
    align-items: flex-start;
    gap: 7px;
    font-size: 0.7rem;
  }

  .md-hero-teams {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
    padding: 8px 0 4px;
  }

  .md-team-logo,
  .md-team-logo-fb {
    width: 48px !important;
    height: 48px !important;
    padding: 5px;
  }

  .md-team-name {
    font-size: 0.76rem;
  }

  .md-team-role {
    font-size: 0.6rem;
  }

  .md-score-block {
    min-width: 78px;
    padding: 6px;
  }

  .md-score,
  .md-score-vs {
    min-width: 66px;
    padding: 6px 7px;
    font-size: 1.32rem;
  }

  .md-score-vs {
    font-size: 0.82rem;
  }

  .md-score-ht,
  .md-match-time {
    font-size: 0.64rem;
  }

  .md-tabs {
    top: 68px;
    padding: 6px;
  }

  .md-tab {
    padding: 8px 10px;
    font-size: 0.74rem;
  }

  .md-card,
  .md-pred-card {
    padding: 14px;
  }

  .md-pred-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .h2h-match {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .h2h-match-date {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .md-team-logo,
  .md-team-logo-fb {
    width: 42px !important;
    height: 42px !important;
  }

  .md-score-block {
    min-width: 70px;
  }

  .md-score,
  .md-score-vs {
    min-width: 58px;
    font-size: 1.12rem;
  }
}
