/* ── Match Modal ── */

#mm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
#mm-overlay.open {
  opacity: 1;
  pointer-events: all;
}

#mm-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  transform: translateY(28px) scale(.97);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1);
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}
#mm-overlay.open #mm-card {
  transform: translateY(0) scale(1);
}

/* ── Header bar ── */
.mm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 20px 11px;
  border-bottom: 1px solid #273549;
}
.mm-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mm-badge {
  background: #3b82f6;
  color: #fff;
  border-radius: 5px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
}
.mm-date {
  font-size: 12px;
  color: #64748b;
}
.mm-close {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 15px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background .12s, color .12s;
  flex-shrink: 0;
}
.mm-close:hover { background: #334155; color: #e2e8f0; }

/* ── Score section ── */
.mm-score-section {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 28px 24px 26px;
  background: linear-gradient(155deg, #0b1628 0%, #1a2a44 100%);
}
.mm-team { flex: 1; }
.mm-home { text-align: right; }
.mm-away { text-align: left; }
.mm-team-name {
  font-size: 17px;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.3;
}
.mm-score-box {
  text-align: center;
  min-width: 108px;
  flex-shrink: 0;
}
.mm-score {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 2px;
  color: #475569;
}
.mm-score.played {
  color: #f59e0b;
  text-shadow: 0 0 40px rgba(245, 158, 11, .3);
}
.mm-score.pending {
  font-size: 26px;
  letter-spacing: 5px;
  color: #334155;
}
.mm-score-sep { color: #92400e; }
.mm-score-sublabel {
  font-size: 10px;
  color: #475569;
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: .09em;
}

/* ── Section heading ── */
.mm-section-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #475569;
  margin-bottom: 14px;
}

/* ── Award tiers ── */
.mm-tiers {
  padding: 20px 22px;
  border-top: 1px solid #273549;
}

.mm-tier {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid #273549;
  background: rgba(255,255,255,.018);
  margin-bottom: 8px;
  opacity: 0;
  animation: mmTierIn .38s cubic-bezier(.22, 1, .36, 1) forwards;
}
.mm-tier:last-child { margin-bottom: 0; }

@keyframes mmTierIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.mm-tier-inner { flex: 1; min-width: 0; }
.mm-tier-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 500;
  margin-bottom: 8px;
}
.mm-tier-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.mm-chip {
  border-radius: 20px;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0;
  animation: mmChipIn .32s cubic-bezier(.34, 1.56, .64, 1) forwards;
}
@keyframes mmChipIn {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Predictions table ── */
.mm-preds {
  padding: 0 22px 22px;
  border-top: 1px solid #273549;
}
.mm-preds .mm-section-title { padding-top: 18px; margin-bottom: 10px; }

table.mm-table {
  width: 100%;
  border-collapse: collapse;
}
table.mm-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 500;
  color: #475569;
  padding: 4px 6px 7px;
  border-bottom: 1px solid #334155;
}
table.mm-table th:not(:first-child) { text-align: center; }
table.mm-table td {
  padding: 6px 6px;
  border-bottom: 1px solid #1a2332;
  font-size: 13px;
  vertical-align: middle;
}
table.mm-table tr:last-child td { border-bottom: none; }
table.mm-table tr:hover td { background: rgba(255,255,255,.02); }
table.mm-table tr.mm-me td { color: #60a5fa; }
table.mm-table tr.mm-me .mm-pname { font-weight: 700; }
.mm-pc { text-align: center; }
.mm-pred-badge {
  display: inline-block;
  background: #1e3a5f;
  color: #93c5fd;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 600;
  font-size: 12px;
}
.mm-result-badge {
  display: inline-block;
  background: #1a2332;
  color: #f59e0b;
  border: 1px solid #2d3f55;
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 700;
  font-size: 12px;
}
.mm-no-pred { color: #334155; }

/* ── Loading / error ── */
.mm-loading, .mm-error {
  padding: 56px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.mm-error { color: #fca5a5; }

/* ── pts-badge (needed when modal opens from index.html which lacks these) ── */
.pts-badge {
  display: inline-block;
  border-radius: 4px;
  padding: 2px 7px;
  font-weight: 700;
  font-size: 12px;
  min-width: 36px;
  text-align: center;
}
.pts-badge.p200 { background: #166534; color: #bbf7d0; }
.pts-badge.p100 { background: #14532d; color: #86efac; }
.pts-badge.p95  { background: #1a4731; color: #6ee7b7; }
.pts-badge.p75  { background: #1e3a5f; color: #93c5fd; }
.pts-badge.p20  { background: #3b2d0d; color: #fde68a; }
.pts-badge.p0   { background: #7f1d1d; color: #fca5a5; }
.pts-badge.pending { background: #1e293b; color: #475569; }

/* mm-tier pts-badge sizing */
.mm-tier .pts-badge {
  flex-shrink: 0;
  font-size: 13px;
  padding: 5px 10px;
  margin-top: 1px;
  min-width: 48px;
}

/* ── Mobile ── */
@media (max-width: 600px) {
  #mm-card { border-radius: 12px; }
  .mm-score-section { padding: 20px 16px; gap: 8px; }
  .mm-score { font-size: 36px; }
  .mm-score.pending { font-size: 20px; }
  .mm-team-name { font-size: 14px; }
  .mm-score-box { min-width: 80px; }
  .mm-tiers { padding: 16px 14px; }
  .mm-tier { padding: 8px 10px; gap: 9px; }
  .mm-preds { padding: 0 14px 16px; }
  .mm-header { padding: 11px 14px 9px; }
  .mm-chip { font-size: 11px; padding: 2px 9px; }
  table.mm-table th, table.mm-table td { font-size: 12px; padding: 5px 4px; }
}

/* ── Clickable match elements ── */
th.match-clickable { cursor: pointer; }
th.match-clickable:hover { background: rgba(59,130,246,.1) !important; }
tr.match-clickable { cursor: pointer; }
tr.match-clickable:hover td { background: rgba(59,130,246,.07) !important; }
