*, *::before, *::after { box-sizing: border-box; }
body { background: #0a0a0a; font-family: 'Inter', sans-serif; margin: 0; color: var(--text-primary); }

/* ── Page Layout ── */
.md-page { max-width: 1100px; min-height: calc(100vh - 190px); margin: 0 auto; padding: 24px 16px 80px; }

/* ── Breadcrumb ── */
.md-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 20px; flex-wrap: wrap; }
.md-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.md-breadcrumb a:hover { color: var(--gold); }
.md-breadcrumb .sep { opacity: 0.4; }

/* ── Hero Card ── */
.md-hero { background: linear-gradient(135deg, #111 0%, #161208 100%); border: 1px solid var(--gold-border); border-radius: 20px; padding: 32px 24px 24px; margin-bottom: 24px; position: relative; overflow: hidden; }
.md-hero::before { content:''; position:absolute; inset:0; background: radial-gradient(ellipse at 50% -20%, rgba(212,175,55,0.08) 0%, transparent 70%); pointer-events: none; }
.md-hero-league { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 20px; }
.md-hero-league img { width: 20px; height: 20px; object-fit: contain; border-radius: 3px; }
.md-hero-teams { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.md-team { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: 1; }
.md-team-logo { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }
.md-team-logo-fb { width: 72px; height: 72px; border-radius: 50%; background: rgba(212,175,55,0.15); border: 2px solid var(--gold-border); display: flex; align-items: center; justify-content: center; font-size: 1.8rem; font-weight: 800; color: var(--gold); }
.md-team-name { font-size: 1rem; font-weight: 800; text-align: center; color: var(--text-primary); line-height: 1.2; }
.md-team-role { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.md-league-link { color: var(--gold); font-weight: 900; text-decoration: none; letter-spacing: 0.06em; text-transform: uppercase; }
.md-league-link:hover { color: var(--gold-light); }
.md-team-link { color: inherit; text-decoration: none; }
.md-team-clickable { cursor: pointer; }
.md-team-clickable .md-team-logo,
.md-team-clickable .md-team-logo-fb,
.md-team-clickable .md-team-link { transition: transform 0.18s ease, color 0.18s ease, filter 0.18s ease; }
.md-team-clickable:hover .md-team-logo,
.md-team-clickable:hover .md-team-logo-fb { transform: translateY(-2px) scale(1.03); filter: drop-shadow(0 8px 16px rgba(212,175,55,0.25)); }
.md-team-clickable:hover .md-team-link { color: var(--gold-light); }
.md-team-clickable.is-resolving { opacity: 0.82; pointer-events: none; }
.md-team-clickable.is-resolving .md-team-logo,
.md-team-clickable.is-resolving .md-team-logo-fb { filter: drop-shadow(0 0 18px rgba(212,175,55,0.32)); }
.md-score-block { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 120px; }
.md-score { font-size: 2.8rem; font-weight: 900; font-family: 'Montserrat', sans-serif; color: var(--text-primary); letter-spacing: -0.02em; line-height: 1; }
.md-score-vs { font-size: 1.2rem; font-weight: 700; color: var(--text-muted); }
.md-score-ht { font-size: 0.72rem; color: var(--text-muted); }
.md-match-time { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.md-status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 100px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.md-status-live { background: rgba(34,197,94,0.15); color: #22c55e; border: 1px solid rgba(34,197,94,0.3); }
.md-status-live::before { content:''; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse-live 1.2s infinite; }
@keyframes pulse-live { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(1.4)} }
.md-status-upcoming { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }
.md-status-finished { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.1); }

/* ── Tabs ── */
.md-tabs { display: flex; gap: 0; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.md-tabs::-webkit-scrollbar { display: none; }
.md-tab { padding: 12px 20px; font-size: 0.82rem; font-weight: 700; color: rgba(255,255,255,0.45); background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.04em; transition: all 0.2s; }
.md-tab:hover { color: rgba(255,255,255,0.75); }
.md-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.md-tab-panel { display: none; }
.md-tab-panel.active { display: block; }

/* ── Section Card ── */
.md-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.md-card-title { font-size: 0.78rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }

/* ── Form Badges ── */
.form-row { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; overflow: hidden; }
.form-badge { width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 800; flex-shrink: 0; }
.form-badge.W { background: rgba(34,197,94,0.2); color: #22c55e; border: 1px solid rgba(34,197,94,0.4); }
.form-badge.D { background: rgba(212,175,55,0.15); color: var(--gold); border: 1px solid var(--gold-border); }
.form-badge.L { background: rgba(239,68,68,0.15); color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.form-badge.U { background: rgba(255,255,255,0.06); color: var(--text-muted); border: 1px solid var(--border); }
.form-match-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.82rem; }
.form-match-row:last-child { border-bottom: none; }
.form-match-opp { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.form-match-opp img { width: 20px; height: 20px; object-fit: contain; }
.form-match-opp span { color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.form-match-score { font-weight: 700; color: var(--text-primary); min-width: 40px; text-align: center; }
.form-match-venue { font-size: 0.68rem; color: var(--text-muted); background: rgba(255,255,255,0.05); padding: 2px 6px; border-radius: 4px; }
.form-match-date { font-size: 0.68rem; color: var(--text-muted); min-width: 60px; text-align: right; }

/* ── H2H ── */
.h2h-summary { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; align-items: center; margin-bottom: 20px; }
.h2h-stat { text-align: center; }
.h2h-stat-num { font-size: 2rem; font-weight: 900; font-family: 'Montserrat', sans-serif; color: var(--text-primary); }
.h2h-stat-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.h2h-stat-home { color: #60a5fa; }
.h2h-stat-draw { color: var(--gold); }
.h2h-stat-away { color: #f87171; }
.h2h-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,0.08); overflow: hidden; margin-bottom: 20px; display: flex; }
.h2h-bar-home { background: #60a5fa; transition: width 0.6s ease; }
.h2h-bar-draw { background: var(--gold); transition: width 0.6s ease; }
.h2h-bar-away { background: #f87171; transition: width 0.6s ease; }
.h2h-match { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.82rem; }
.h2h-match:last-child { border-bottom: none; }
.h2h-match-teams { flex: 1; display: flex; align-items: center; gap: 6px; }
.h2h-match-teams img { width: 18px; height: 18px; object-fit: contain; }
.h2h-match-score { font-weight: 800; color: var(--text-primary); padding: 2px 10px; background: rgba(255,255,255,0.06); border-radius: 6px; min-width: 48px; text-align: center; }
.h2h-match-date { font-size: 0.68rem; color: var(--text-muted); min-width: 70px; text-align: right; }
.h2h-winner-home { color: #60a5fa; font-weight: 700; }
.h2h-winner-away { color: #f87171; font-weight: 700; }
.h2h-winner-draw { color: var(--gold); font-weight: 700; }

/* ── Stats ── */
.stat-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 14px; }
.stat-val { font-size: 0.9rem; font-weight: 700; color: var(--text-primary); }
.stat-val-home { text-align: right; }
.stat-val-away { text-align: left; }
.stat-label { font-size: 0.68rem; color: var(--text-muted); text-align: center; text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.stat-bar-wrap { grid-column: 1 / -1; display: flex; height: 5px; border-radius: 3px; overflow: hidden; gap: 2px; }
.stat-bar-home { background: #60a5fa; border-radius: 3px 0 0 3px; transition: width 0.6s ease; }
.stat-bar-away { background: #f87171; border-radius: 0 3px 3px 0; transition: width 0.6s ease; }
.stat-bar-mid { background: rgba(255,255,255,0.08); flex: 1; }

/* ── Lineup ── */
.lineup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .lineup-grid { grid-template-columns: 1fr; } }
.lineup-team { background: rgba(255,255,255,0.03); border-radius: 12px; padding: 14px; }
.lineup-team-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.lineup-team-header img { width: 24px; height: 24px; object-fit: contain; }
.lineup-team-name { font-size: 0.85rem; font-weight: 800; color: var(--text-primary); }
.lineup-formation { font-size: 0.7rem; color: var(--gold); background: var(--gold-subtle); padding: 2px 8px; border-radius: 4px; font-weight: 700; }
.lineup-player { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 0.8rem; }
.lineup-player:last-child { border-bottom: none; }
.lineup-num { width: 22px; height: 22px; border-radius: 5px; background: rgba(212,175,55,0.12); color: var(--gold); font-size: 0.68rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lineup-pos { font-size: 0.65rem; color: var(--text-muted); background: rgba(255,255,255,0.06); padding: 1px 5px; border-radius: 3px; }
.lineup-name { flex: 1; color: var(--text-secondary); }
.lineup-sub-title { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin: 10px 0 6px; }

/* ── Injuries ── */
.injury-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.injury-row:last-child { border-bottom: none; }
.injury-photo { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: rgba(255,255,255,0.06); }
.injury-name { font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.injury-type { font-size: 0.72rem; color: #f87171; background: rgba(239,68,68,0.1); padding: 2px 8px; border-radius: 4px; }
.injury-team-badge { font-size: 0.65rem; color: var(--text-muted); }

/* ── Prediction Card ── */
.md-pred-card { background: linear-gradient(135deg, #0d1a0d 0%, #0a1208 100%); border: 1px solid rgba(34,197,94,0.25); border-radius: 16px; padding: 20px; margin-bottom: 20px; }
.md-pred-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 8px; }
.md-pred-ai-badge { display: flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 700; color: #22c55e; background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.25); padding: 4px 10px; border-radius: 100px; }
.md-pred-type { font-size: 1.4rem; font-weight: 900; font-family: 'Montserrat', sans-serif; color: var(--text-primary); }
.md-pred-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.md-pred-meta-item { text-align: center; }
.md-pred-meta-val { font-size: 1.2rem; font-weight: 800; color: var(--gold); }
.md-pred-meta-label { font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.md-pred-reasoning { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.6; background: rgba(255,255,255,0.03); border-radius: 10px; padding: 12px; margin-top: 12px; border-left: 3px solid rgba(34,197,94,0.3); }
.md-pred-tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 100px; font-size: 0.72rem; font-weight: 700; background: rgba(212,175,55,0.1); color: var(--gold); border: 1px solid var(--gold-border); margin-top: 10px; }

/* ── Comparison Bars (Team Comparison) ── */
.cmp-section { margin-bottom: 24px; }
.cmp-title { font-size: 0.78rem; font-weight: 800; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.cmp-row { margin-bottom: 14px; }
.cmp-row-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; font-size: 0.78rem; }
.cmp-row-label { color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; text-align: center; }
.cmp-val-home { color: #60a5fa; font-weight: 700; }
.cmp-val-away { color: #f87171; font-weight: 700; }
.cmp-bar-wrap { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; display: flex; }
.cmp-bar-home { background: linear-gradient(90deg, #3b82f6, #60a5fa); border-radius: 4px 0 0 4px; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }
.cmp-bar-away { background: linear-gradient(90deg, #f87171, #ef4444); border-radius: 0 4px 4px 0; margin-left: auto; transition: width 0.8s cubic-bezier(0.4,0,0.2,1); }

/* ── Events Timeline ── */
.events-timeline { position: relative; padding-left: 20px; }
.events-timeline::before { content:''; position:absolute; left:8px; top:0; bottom:0; width:2px; background: rgba(255,255,255,0.08); }
.event-item { position: relative; display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; font-size: 0.82rem; }
.event-dot { position: absolute; left: -16px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg-card); border: 2px solid var(--border); top: 12px; }
.event-dot.goal { border-color: #22c55e; background: rgba(34,197,94,0.3); }
.event-dot.card-yellow { border-color: #fbbf24; background: rgba(251,191,36,0.3); }
.event-dot.card-red { border-color: #ef4444; background: rgba(239,68,68,0.3); }
.event-dot.subst { border-color: #818cf8; background: rgba(129,140,248,0.3); }
.event-time { font-weight: 800; color: var(--gold); min-width: 36px; font-size: 0.78rem; }
.event-icon { font-size: 1rem; }
.event-desc { color: var(--text-secondary); flex: 1; }
.event-team-side { font-size: 0.65rem; color: var(--text-muted); }

/* ── Loading & Empty States ── */
.md-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; gap: 12px; }
.md-spinner { width: 36px; height: 36px; border: 3px solid rgba(212,175,55,0.2); border-top-color: var(--gold); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.md-empty { text-align: center; padding: 32px 24px; color: var(--text-muted); font-size: 0.85rem; }
.md-error { text-align: center; padding: 24px; color: #f87171; font-size: 0.82rem; background: rgba(239,68,68,0.08); border-radius: 10px; border: 1px solid rgba(239,68,68,0.2); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .md-hero-teams { gap: 8px; }
  .md-team-logo { width: 52px; height: 52px; }
  .md-score { font-size: 2rem; }
  .md-team-name { font-size: 0.85rem; }
  .h2h-summary { gap: 8px; }
  .h2h-stat-num { font-size: 1.5rem; }
}
