/* ===== Header ===== */
.md-header { margin-bottom: 1.25rem; }
.md-league { text-align: center; margin-bottom: 0.75rem; }
.md-league-name { font-weight: 700; color: rgba(255,255,255,0.9); font-size: 0.95rem; }
.md-league-sub { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.md-hero {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  border-radius: 1rem; border: 1px solid rgba(168,85,247,0.22);
  background: linear-gradient(165deg, rgba(15,23,42,0.65) 0%, rgba(0,0,0,0.45) 50%, rgba(30,27,75,0.35) 100%);
  box-shadow: 0 8px 40px rgba(124,58,237,0.12);
  padding: 1.1rem 1rem;
}
.md-hero-team { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; min-width: 0; }
.md-hero-logo { width: 3.25rem; height: 3.25rem; object-fit: contain; }
.md-hero-logo--ph { background: rgba(255,255,255,0.08); border-radius: 0.75rem; }
.md-hero-name { font-weight: 700; font-size: 0.85rem; text-align: center; color: #fff; }
.md-hero-center { text-align: center; }
.md-hero-score { font-size: 1.75rem; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.md-hero-score .score-pen { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-left: 0.15rem; }
.md-hero-dash { color: var(--text-muted); margin: 0 0.25rem; }
.md-hero-vs { font-size: 1rem; color: var(--text-muted); }
.md-hero-status { margin-top: 0.25rem; font-size: 0.75rem; color: var(--text-muted); }
.md-hero-status--live { color: #22c55e; font-weight: 600; }
.md-live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 9999px; background: #22c55e; margin-right: 0.3rem; animation: md-pulse 1.5s ease-in-out infinite; }
@keyframes md-pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

/* ===== Tabs (underline) ===== */
.md-tabs { display: flex; gap: 0.25rem; margin-top: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); overflow-x: auto; }
.md-tab { flex: 1 1 0; padding: 0.6rem 0.5rem; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 0.8rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.md-tab:hover { color: rgba(255,255,255,0.85); }
.md-tab.is-active { color: var(--accent-cyan); border-bottom-color: var(--accent-cyan); }

/* ===== Panels & cards ===== */
.md-panel { display: none; }
.md-panel.is-active { display: block; }
.md-card { margin-top: 0.85rem; border-radius: 1rem; border: 1px solid rgba(168,85,247,0.22); background: rgba(0,0,0,0.25); padding: 1rem 1.1rem; }
.md-empty { color: var(--text-muted); font-size: 0.8rem; }

/* Stats — possession 2 sisi (home ungu | away cyan) */
.md-poss-row { display: flex; align-items: center; gap: 0.5rem; }
.md-poss-pct { font-size: 0.8rem; font-weight: 700; color: #fff; min-width: 2.4rem; }
.md-poss-pct--r { text-align: right; }
.md-poss { flex: 1; height: 8px; border-radius: 9999px; overflow: hidden; display: flex; background: rgba(255,255,255,0.08); }
.md-poss-h { display: block; height: 100%; background: var(--accent-purple); }
.md-poss-a { display: block; height: 100%; background: var(--accent-cyan); }
.md-poss-lbl { text-align: center; font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin: 0.3rem 0 0.85rem; }
.md-stat { display: grid; grid-template-columns: 3rem 1fr 3rem; align-items: center; padding: 0.35rem 0; font-size: 0.8rem; border-top: 1px solid rgba(255,255,255,0.04); }
.md-stat:first-of-type { border-top: 0; }
.md-stat-a { text-align: left; font-weight: 700; color: #fff; }
.md-stat-b { text-align: right; font-weight: 700; color: #fff; }
.md-stat-k { text-align: center; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* Timeline — ikon & warna jelas */
.md-tl { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; font-size: 0.8rem; color: rgba(255,255,255,0.88); }
.md-tl--away { flex-direction: row-reverse; text-align: right; }
.md-tl-min { font-family: ui-monospace, monospace; color: var(--accent-cyan); min-width: 2.5rem; flex: none; }
.md-tl-txt b { color: #22c55e; }
.md-tl-ic { flex: none; display: inline-flex; }
.md-tl-ic--goal { color: #fff; }
.md-tl-ic--sub { color: #22c55e; }
.md-tl-ic--var { font-size: 0.55rem; font-weight: 800; color: var(--accent-cyan); border: 1px solid currentColor; border-radius: 0.25rem; padding: 0 0.2rem; }
.md-tl-card { flex: none; display: inline-block; width: 0.62rem; height: 0.85rem; border-radius: 1px; }
.md-tl-card--yellow { background: var(--accent-gold); }
.md-tl-card--red { background: #ef4444; }
.md-tl-dot { flex: none; width: 7px; height: 7px; border-radius: 9999px; background: var(--text-muted); display: inline-block; }
.md-sub-in { color: #22c55e; }
.md-sub-out { color: #ef4444; }

/* Line-ups (lapangan) */
.md-lu-heads { display: flex; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; color: rgba(255,255,255,0.85); margin-bottom: 0.6rem; }
.md-lu-head { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-lu-head--away { justify-content: flex-end; text-align: right; }
.md-lu-head b { font-size: 0.6rem; letter-spacing: 0.05em; }
.md-lu-chip { width: 0.6rem; height: 0.6rem; border-radius: 9999px; flex: none; }
.md-lu-head--home .md-lu-chip { background: var(--accent-purple); }
.md-lu-head--away .md-lu-chip { background: var(--accent-cyan); }

.md-pitch {
  position: relative;
  width: 100%;
  max-width: 26rem;
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(34,211,238,0.10) 0%, transparent 45%, transparent 55%, rgba(168,85,247,0.12) 100%),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.035) 0 8.33%, transparent 8.33% 16.66%),
    var(--bg-deep);
}
.md-pitch::before, .md-pitch::after {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%);
  width: 56%; height: 15%; border: 1px solid rgba(255,255,255,0.22);
}
.md-pitch::before { bottom: -1px; border-bottom: 0; border-bottom-left-radius: 0; }
.md-pitch::after  { top: -1px; border-top: 0; }
.md-pitch-lines { position: absolute; inset: 0; pointer-events: none; }
.md-pitch-lines::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid rgba(255,255,255,0.2); }
.md-pitch-lines::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,0.2); border-radius: 9999px; }

.md-pitch-tag { position: absolute; font-size: 0.6rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.4); pointer-events: none; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-pitch-tag--away { top: 0.4rem; left: 0.6rem; text-align: left; }
.md-pitch-tag--home { bottom: 0.4rem; right: 0.6rem; text-align: right; }

.md-pp { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 0.12rem; width: 4rem; }
.md-pp-dot {
  width: 1.85rem; height: 1.85rem; border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 700; font-variant-numeric: tabular-nums;
  border: 2px solid rgba(255,255,255,0.85);
}
.md-pp--home .md-pp-dot { background: var(--accent-purple); color: #fff; }
.md-pp--away .md-pp-dot { background: var(--accent-cyan); color: #06121a; }
.md-pp-name { font-size: 0.58rem; color: rgba(255,255,255,0.92); text-align: center; max-width: 4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,0.7); }

@media (max-width: 480px) {
  .md-pitch { max-width: 100%; aspect-ratio: 3 / 4; }
  .md-pp { width: 3rem; }
  .md-pp-dot { width: 1.5rem; height: 1.5rem; font-size: 0.6rem; border-width: 1.5px; }
  .md-pp-name { font-size: 0.5rem; max-width: 3.2rem; }
}

/* H2H */
.md-h2h-title { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 1rem 0 0.4rem; }
.md-h2h-title:first-child { margin-top: 0; }
.md-h2h-row { display: grid; grid-template-columns: 4.5rem 1fr auto 1fr; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.8rem; }
.md-h2h-row:last-child { border-bottom: none; }
.md-h2h-date { color: var(--text-muted); font-family: ui-monospace, monospace; font-size: 0.7rem; }
.md-h2h-home { text-align: right; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-h2h-away { text-align: left; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-h2h-score { font-weight: 700; font-family: ui-monospace, monospace; color: var(--accent-cyan); padding: 0 0.3rem; }

.md-recent-row { display: grid; grid-template-columns: 1.4rem 4.5rem 1fr auto; align-items: center; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.8rem; }
.md-recent-row:last-child { border-bottom: none; }
.md-recent-res { width: 1.4rem; height: 1.4rem; border-radius: 0.3rem; display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 800; color: #06121a; }
.md-recent-res--W { background: #22c55e; }
.md-recent-res--D { background: var(--text-muted); color: #fff; }
.md-recent-res--L { background: #ef4444; color: #fff; }
.md-recent-date { color: var(--text-muted); font-family: ui-monospace, monospace; font-size: 0.7rem; }
.md-recent-opp { color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-recent-score { font-family: ui-monospace, monospace; font-weight: 700; color: var(--accent-cyan); }

/* Prediksi — card & modal dari match-prediction.css */
.md-pred-actions { margin: 0.85rem 0; display: flex; justify-content: flex-end; }
.md-pred-actions .btn-primary-cta.is-locked,
.md-pred-actions .btn-primary-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.3);
}

/* Layout tab Prediksi (hanya kartu: hasil, score, tips, tactical, referensi) */
.md-panel[data-md-panel="prediksi"] .pred-grid {
  grid-template-columns: 1fr;
  grid-template-areas:
    "hasil"
    "score"
    "tips"
    "tactical"
    "referensi";
}

@media (min-width: 768px) {
  .md-panel[data-md-panel="prediksi"] .pred-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "hasil score"
      "tips tips"
      "tactical referensi";
  }
}
