/* v2 predictions, match detail and the browse pages (markets, leagues).
   Loaded by templates/v2/{predictions,prediction_detail,markets,market,leagues,league}.html.
   Macros in templates/v2/_match.html. */

/* ── shared head ────────────────────────────────────────────────────────── */
.mx-head { padding-top: var(--s-10); padding-bottom: var(--s-6); }
.mx-eyebrow { margin: 0 0 var(--s-3) !important; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); }
.mx-head h1 { font-size: clamp(30px, 5vw, 44px); overflow-wrap: anywhere; }
.mx-sub { margin-top: var(--s-3) !important; font-size: clamp(15px, 1.8vw, var(--fs-md)); color: var(--muted);
  max-width: 68ch; line-height: 1.55; }
.mx-date { color: var(--text); }
.mx-section { margin-top: var(--s-10); }
.mx-section-head { margin-bottom: var(--s-4); }
.mx-section-head h2 { font-size: var(--fs-lg); }
.mx-section-head p { margin-top: var(--s-1); font-size: var(--fs-sm); }
.mx-foot { margin-top: var(--s-3); font-size: var(--fs-sm); }
.mx-nowrap { white-space: nowrap; }
.v2 .is-up { color: var(--accent); }
.v2 .is-down { color: var(--loss); }

/* breadcrumbs */
.mx-crumbs { margin: var(--s-6) 0 var(--s-4); font-size: var(--fs-sm); }
.mx-head .mx-crumbs { margin-top: 0; }
.mx-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-2); }
.mx-crumbs li { display: inline-flex; gap: var(--s-2); color: var(--muted); min-width: 0; }
.mx-crumbs li + li::before { content: "/"; color: var(--line); }
.mx-crumbs a { color: var(--muted); }
.mx-crumbs a:hover { color: var(--text); }
.mx-crumbs [aria-current] { color: var(--text); overflow-wrap: anywhere; }

/* offer */
.mx-offer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin-top: var(--s-5);
  padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  font-size: var(--fs-sm); }
.mx-offer code { font-family: var(--font-mono); font-weight: 700; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-2); }
.mx-offer a { font-weight: 600; margin-left: auto; }

/* chips row, crest sizes, logos */
.mx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mx-chip-link { text-decoration: none !important; }
.mx-chip-link:hover .chip { filter: brightness(1.15); }
.mx-comp-logo { width: 16px; height: 16px; object-fit: contain; vertical-align: -3px; margin-right: 6px; }
.mx-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ── predictions: cards ─────────────────────────────────────────────────── */
.mx-toolbar { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-4); font-size: var(--fs-sm);
  color: var(--muted); }
.mx-toolbar[hidden] { display: none; }
.mx-toolbar select { min-height: 36px; padding: 0 var(--s-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); font: 600 var(--fs-sm) var(--font); cursor: pointer; max-width: 100%; }
.mx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: var(--s-4); }
.v2 .mx-card { display: flex; flex-direction: column; gap: var(--s-3); }
.v2 .mx-card[hidden] { display: none; }
.mx-card-teams { display: grid; gap: var(--s-2); font-weight: 600; font-size: var(--fs-md); }
.mx-card-team { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.mx-card-team > span:last-child { overflow-wrap: anywhere; line-height: 1.25; }
.mx-card .crest, .mx-row .crest { width: 30px; height: 30px; font-size: 9px; flex: none; }
.mx-card .crest img, .mx-row .crest img { width: 22px; height: 22px; }
.mx-call { padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--surface-2); }
.mx-call-lbl { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; }
.mx-call-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2); }
.mx-odds { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-call-sub { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.mx-call-edge { margin-left: auto; }
.mx-scores-inline { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.mx-sc { font-weight: 700; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); }
.mx-sc small { font-weight: 600; opacity: .8; }
.mx-sum { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.mx-lock { display: flex; align-items: center; gap: var(--s-2); color: var(--muted); font-size: var(--fs-sm); }
.mx-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600;
  font-size: var(--fs-sm); }
.mx-empty-title { font-size: var(--fs-lg); }

/* ── predictions: upcoming and archive rows ─────────────────────────────── */
.mx-day { margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent); }
.mx-section-head + .mx-day { margin-top: 0; }
.mx-agg { margin-bottom: var(--s-4); font-size: var(--fs-sm); }
.mx-agg b { font-variant-numeric: tabular-nums; }
.mx-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden; background: var(--surface); }
.mx-list li + li { border-top: 1px solid var(--line); }
.v2 .mx-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); color: var(--text); text-decoration: none; }
.v2 .mx-row:hover { background: var(--surface-2); text-decoration: none; }
.mx-row-teams { display: flex; align-items: center; gap: var(--s-2); min-width: 0; font-weight: 600; font-size: 14px; }
.mx-row-teams > span:not(.crest) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-row-teams i { color: var(--muted); font-style: normal; font-size: var(--fs-xs); font-weight: 500; }
.mx-row-right { display: inline-flex; align-items: center; gap: var(--s-3); flex: none; font-size: var(--fs-sm); }
.mx-row-comp, .mx-row-bet { color: var(--muted); max-width: 28vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-row-sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-row-date { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 639px) {
  .mx-row { flex-direction: column; align-items: stretch; gap: var(--s-1); }
  .mx-row-right { justify-content: flex-start; flex-wrap: wrap; gap: var(--s-1) var(--s-3); }
  .mx-row-comp, .mx-row-bet { max-width: 100%; }
  .mx-row-teams .crest { display: none; }
}

/* ── match detail ───────────────────────────────────────────────────────── */
.v2 .md-hero { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); text-align: center;
  padding: var(--s-8) var(--s-5); }
.md-comp { color: var(--muted); font-size: var(--fs-sm); }
.md-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start;
  gap: var(--s-4); width: 100%; max-width: 760px; font-size: inherit !important; }
.md-team { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); min-width: 0; }
.md-team .crest { width: 72px; height: 72px; font-size: 18px; }
.md-team .crest img { width: 56px; height: 56px; }
.md-team-name { font-size: clamp(20px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.02em; line-height: 1.15;
  overflow-wrap: anywhere; }
.md-vs { align-self: center; color: var(--muted); font-size: var(--fs-md); font-weight: 600; padding-bottom: var(--s-8); }
.md-time { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--muted); font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums; }
.md-chips { justify-content: center; }

.md-h2 { font-size: var(--fs-lg) !important; margin-bottom: var(--s-3) !important; display: flex; align-items: center; gap: var(--s-2); }
.card-head .md-h2 { margin-bottom: 0 !important; }
.md-h3 { font-size: var(--fs-base) !important; margin: var(--s-5) 0 var(--s-2) !important; }
.md-fine { margin-top: var(--s-3) !important; color: var(--muted); font-size: var(--fs-sm); line-height: 1.55; }
.md-fine b, .md-fine em { color: var(--text); font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }

.v2 .md-result { margin-top: var(--s-4); }
.md-res-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); }
.md-res { display: inline-flex; align-items: baseline; gap: var(--s-2); padding: var(--s-2) var(--s-4);
  border-radius: var(--r); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.md-res span { color: var(--muted); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; }
.md-res b { font-size: var(--fs-lg); }
.md-res.is-ft b { font-size: var(--fs-xl); }
.md-verdict { padding: 6px 12px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 700;
  background: var(--surface-2); color: var(--muted); }
.md-verdict.is-won { background: var(--accent-soft); color: var(--accent); }
.md-verdict.is-lost { background: var(--loss-soft); color: var(--loss); }

.md-grid { display: grid; gap: var(--s-4); margin-top: var(--s-4); }
.md-col { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
@media (min-width: 960px) {
  .md-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; }
}

.md-note { padding: var(--s-4) var(--s-5); border-left: 3px solid var(--accent); border-radius: 0 var(--r) var(--r) 0;
  background: var(--accent-soft); line-height: 1.6; }

.md-scores { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.md-sc { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: var(--s-3) var(--s-4);
  border-radius: var(--r); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.md-sc b { font-size: var(--fs-xl); }
.md-sc span { color: var(--muted); font-size: var(--fs-sm); }
.md-sc.is-top { background: var(--accent-soft); }
.md-sc.is-top b { color: var(--accent); }

.md-group + .md-group { margin-top: var(--s-5); padding-top: var(--s-5); border-top: 1px solid var(--line); }
.md-group-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  margin-bottom: var(--s-2); }
.md-group-head h3 { font-size: var(--fs-base); }
.md-lean { font-size: var(--fs-md); }
.v2 .mx-mkt td.mx-model { color: var(--accent); font-weight: 700; }
.md-info { padding-top: var(--s-3); border-top: 1px solid var(--line); }

.mx-hda-vals { display: flex; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-2); }
.mx-hda-vals > div { display: flex; flex-direction: column; min-width: 0; font-size: var(--fs-sm); color: var(--muted); }
.mx-hda-vals > div:nth-child(2) { text-align: center; }
.mx-hda-vals > div:last-child { text-align: right; }
.mx-hda-vals span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-hda-vals b { font-size: var(--fs-lg); color: var(--text); font-variant-numeric: tabular-nums; }
.mx-hda-vals .is-top b { color: var(--accent); }
.mx-hda-bar { display: flex; gap: 3px; height: 10px; }
.mx-hda-bar span { border-radius: var(--r-pill); background: var(--bar-rest); }
.mx-hda-bar span.is-top { background: var(--accent-fill); }

.md-prose { font-size: var(--fs-md); line-height: 1.65; max-width: 68ch; }
.md-lock { text-align: center; display: flex; flex-direction: column; align-items: center; }
.md-lock .md-h2 { justify-content: center; }
.md-blur { filter: blur(5px); user-select: none; pointer-events: none; color: var(--muted); line-height: 1.65;
  margin-bottom: var(--s-4) !important; }

.md-form-t { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.md-form-t th, .md-form-t td { padding: var(--s-2) var(--s-2) var(--s-2) 0; text-align: left; white-space: nowrap; }
.md-form-t thead th { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; border-bottom: 1px solid var(--line); }
.md-form-t tbody th, .md-form-t tbody td { border-top: 1px solid var(--line); }
.md-form-t tbody tr:first-child th, .md-form-t tbody tr:first-child td { border-top: 0; }
.md-form-t tbody th { font-weight: 600; white-space: normal; min-width: 90px; }
.md-formstr { display: inline-flex; gap: 3px; }
.md-formstr i { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-style: normal;
  font-size: 11px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.md-formstr .f-w { background: var(--accent-soft); color: var(--accent); }
.md-formstr .f-l { background: var(--loss-soft); color: var(--loss); }

.md-disc { margin-top: var(--s-6); color: var(--muted); font-size: var(--fs-xs); text-align: center; line-height: 1.55; }

@media (max-width: 559px) {
  .v2 .md-hero { padding: var(--s-6) var(--s-4); }
  .md-team .crest { width: 56px; height: 56px; }
  .md-team .crest img { width: 42px; height: 42px; }
  .md-vs { padding-bottom: var(--s-6); font-size: var(--fs-sm); }
  /* the shared phone layout for .mkt puts the edge cell in column 2; this table has none */
  .v2 .mx-mkt tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v2 .mx-mkt td.mkt-name { grid-column: 1 / -1; }
}

/* ── browse pages ───────────────────────────────────────────────────────── */
.mx-browse { display: grid; gap: var(--s-4); max-width: 860px; }
.mx-prose p + p { margin-top: var(--s-3); }
.mx-prose p { line-height: 1.6; }
.v2 .mx-table-card { padding: var(--s-2) var(--s-4); }
.mx-table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.mx-table th, .mx-table td { padding: var(--s-3) var(--s-3) var(--s-3) 0; text-align: left; border-bottom: 1px solid var(--line); }
.mx-table thead th { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.mx-table tbody th { font-weight: 600; min-width: 140px; }
.mx-table tbody tr:last-child th, .mx-table tbody tr:last-child td { border-bottom: 0; }
.mx-table td:not(:nth-child(3)) { white-space: nowrap; }
.mx-kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); margin: 0; }
.mx-kv > div { padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); background: var(--surface-2); min-width: 0; }
.mx-kv dt { font-size: var(--fs-xs); color: var(--muted); }
.mx-kv dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 559px) { .mx-kv { grid-template-columns: 1fr; } }
.mx-fixtures { list-style: none; margin: 0; padding: 0; }
.mx-fixtures li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(140px, 220px); align-items: center;
  gap: var(--s-4); padding: var(--s-3) 0; border-top: 1px solid var(--line); }
.mx-fixtures li:first-child { border-top: 0; }
.mx-fx-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.mx-fx-vals { display: flex; justify-content: space-between; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
@media (max-width: 479px) { .mx-fixtures li { grid-template-columns: 1fr; gap: var(--s-2); } }
