/* Forecaster mode. Flat and restrained to match the xG / tactics pages:
   surface cards, thin borders, one accent used sparingly. No gradients. */

:root {
  --los:  var(--defender);    /* wrong pick / eliminated — orange */
  --go:   var(--pitch);       /* advanced / correct — green */
  --acc:  var(--xg-accent);   /* trophy odds — gold */
}

/* --- stage stepper (title odds + bracket run-throughs) -------------------- */
.tl { margin: 14px 0 0; }
.tl-stage { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.tl-stage-label { font-size: 1.02rem; font-weight: 760; letter-spacing: -0.01em; }
.tl-stage-alive { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }

/* a row of stage buttons; wraps on narrow screens */
.stage-nav {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; margin: 0 0 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: fit-content; max-width: 100%;
}
.stage-btn {
  font: inherit; font-size: 0.76rem; font-weight: 650; cursor: pointer;
  color: var(--text-muted); background: none; border: 1px solid transparent;
  border-radius: 8px; padding: 6px 13px; transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.stage-btn:hover:not(.active) { color: var(--text); }
.stage-btn.active { color: var(--text); background: var(--bg); border-color: var(--border); font-weight: 750; }

.tl-caption { margin: 12px 2px 16px; font-size: 0.86rem; color: var(--text-muted); line-height: 1.55; min-height: 2.4em; }

.asof { margin: 0 0 26px; color: var(--text-muted); font-size: 0.82rem; }

/* country flag chips, used next to team names everywhere */
.flag {
  height: 12px; width: 18px; object-fit: cover; border-radius: 2px; margin-right: 7px;
  vertical-align: -1px; flex: none; box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}

/* --- section blocks ---------------------------------------------------- */
.block { margin: 30px 0; }
.block > h2 { margin: 0; font-size: 1.22rem; font-weight: 740; letter-spacing: -0.01em; }
.lead { margin: 5px 0 16px; color: var(--text-muted); font-size: 0.88rem; }

/* --- title odds (timeline roster) ------------------------------------- */
/* Flex column so each team row can be re-ordered per stage via `order` while its
   DOM node stays put — the bar widths then transition in place, reading as a
   bar-chart race rather than the whole list re-rendering under the slider. */
.odds { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 18px; }
.odds-item { transition: opacity 0.3s ease; }
.odds-item:not(:last-child) { border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
.odds-item.out { opacity: 0.4; }
.odds-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 420px) 52px; align-items: center; gap: 18px; padding: 9px 0; }
.odds-name { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.odds-item.lead-team .odds-name { font-weight: 750; }
.odds-track { display: block; height: 8px; background: color-mix(in srgb, var(--text) 9%, transparent); border-radius: 4px; overflow: hidden; }
.odds-fill { display: block; height: 100%; width: 0; background: var(--acc); border-radius: 4px; transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1); }
.odds-val { text-align: right; font-size: 0.86rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.odds-item.out .odds-val { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }

/* page layout: contain the content; the title odds run full width so the
   bar-chart race has room to breathe */
.fc-main { max-width: var(--page-max); margin: 0 auto; }
.fc-odds { margin-top: 22px; }

/* --- bracket ----------------------------------------------------------- */
.bk-note { font-size: 0.84rem; color: var(--text-muted); margin: 10px 2px 12px; min-height: 1.1em; }
.bk-note b { color: var(--text); }

.bracket-scroll { overflow-x: auto; padding-bottom: 8px; }

/* Two-sided mirrored bracket: left half flows right, right half mirrors. */
.bracket { display: flex; align-items: stretch; width: max-content; min-width: max-content; margin: 0 auto; }
.bk-col { display: flex; flex-direction: column; flex: none; }
.bk-head { text-align: center; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; padding-bottom: 10px; }
.bk-list { flex: 1; display: flex; flex-direction: column; }
.bk-match { flex: 1; min-height: 52px; display: flex; align-items: center; position: relative; padding-block: 5px; }

/* left and right columns */
.bracket.two .bk-col.l { width: 154px; }
.bracket.two .bk-col.r { width: 154px; }
.bracket.two .bk-col.l .bk-match { padding-right: 24px; padding-left: 0; }
.bracket.two .bk-col.r .bk-match { padding-left: 24px; padding-right: 0; }

/* horizontal stubs pointing inward toward centre */
.bracket.two .bk-col.l .bk-match::after {
  content: ""; position: absolute; top: 50%; right: 0; width: 24px; height: 1px; background: var(--border);
}
.bracket.two .bk-col.r .bk-match::after {
  content: ""; position: absolute; top: 50%; left: 0; width: 24px; height: 1px; background: var(--border);
}

/* vertical join between each feeder pair (right edge for l, left edge for r) */
.bracket.two .bk-col.l:not(.no-join) .bk-list .bk-match:nth-child(odd)::before {
  content: ""; position: absolute; top: 50%; right: 0; width: 1px; height: 100%; background: var(--border);
}
.bracket.two .bk-col.r:not(.no-join) .bk-list .bk-match:nth-child(odd)::before {
  content: ""; position: absolute; top: 50%; left: 0; width: 1px; height: 100%; background: var(--border);
}
.bracket.two .bk-col.no-join .bk-match::before { display: none !important; }

/* centre column: champion, final, third-place stacked and vertically centred */
.bracket.two .center-col {
  width: 206px;
  display: flex; flex-direction: column;
}
.bk-final-content {
  flex: 1;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  gap: 16px; padding: 0 6px;
}
.bk-final-content .bk-champ { align-items: center; text-align: center; }
.bk-center-node .bk-head { padding-bottom: 6px; }
.bk-center-node .bk-match { flex: none; min-height: 0; padding: 0; }
.bk-bronze .bk-head { padding-bottom: 6px; }
.bk-bronze .bk-match { flex: none; min-height: 0; padding: 0; }
.bk-bronze .bk-box { opacity: 0.88; }

/* compact font/padding for all match boxes in the bracket */
.bracket .bk-box { font-size: 0.74rem; }
.bracket .bk-row { padding: 5px 8px; gap: 4px; }

.bk-box { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 0.78rem; }
.bk-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 9px; color: var(--text-muted); }
.bk-row + .bk-row { border-top: 1px solid var(--border); }
.bk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-meta { font-variant-numeric: tabular-nums; font-size: 0.74rem; flex: none; }
.bk-tag { font-size: 0.56rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); margin-left: 3px; vertical-align: 1px; }
.bk-row.win { color: var(--text); box-shadow: inset 2px 0 0 var(--go); }
.bk-row.win .bk-name { font-weight: 700; }
.bk-row.tbd { color: color-mix(in srgb, var(--text-muted) 60%, transparent); font-style: italic; }
.bk-row .mark { font-weight: 700; }
.bk-row .mark.hit { color: var(--go); }
.bk-row .mark.miss { color: var(--los); }

/* champion node */
.bk-champ { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; }
.bk-champ .cl { font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-muted); font-weight: 700; }
.bk-champ .cn { font-weight: 780; font-size: 1.1rem; }
.bk-champ.tbd .cn { color: var(--text-muted); font-weight: 600; }

/* --- groups (explicit predictions) ------------------------------------ */
.groups { display: flex; flex-wrap: wrap; justify-content: center; gap: 13px; }
.gcard { flex: 1 1 258px; max-width: 290px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px 13px; }
.gcard h3 { margin: 0 0 4px; font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.gcol-head { display: grid; grid-template-columns: 16px 1fr 64px 30px; gap: 8px; font-size: 0.58rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); padding: 4px 0; border-bottom: 1px solid var(--border); }
.gcol-head span:nth-child(3) { text-align: right; }
.gcol-head span:nth-child(4) { text-align: center; }
.grow { display: grid; grid-template-columns: 16px 1fr 64px 30px; align-items: center; gap: 8px; padding: 6px 0; font-size: 0.86rem; }
.grow + .grow { border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent); }
.grow .gp { color: var(--text-muted); font-size: 0.76rem; font-variant-numeric: tabular-nums; text-align: center; }
.gname { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gpred { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-muted); }
.gout { text-align: center; font-weight: 700; }
.grow.adv .gname { font-weight: 750; }
.grow.adv .gout { color: var(--go); }
.grow.elim { opacity: 0.55; }
.grow.elim .gout { color: var(--los); }

/* --- accuracy ---------------------------------------------------------- */
.acc { display: grid; grid-template-columns: minmax(0, 290px) 1fr; gap: 26px; align-items: center; }
.acc-chart svg { width: 100%; height: auto; display: block; }
.acc-text { font-size: 0.92rem; line-height: 1.6; }
.acc-text b { font-weight: 700; }
.acc-compare { margin: 16px 0 4px; display: flex; flex-direction: column; gap: 9px; max-width: 420px; }
.acc-bar { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 10px; font-size: 0.82rem; }
.acc-bar .lab { color: var(--text-muted); }
.acc-bar.me .lab { color: var(--text); font-weight: 700; }
.acc-track { height: 9px; background: var(--bg); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.acc-track > span { display: block; height: 100%; background: color-mix(in srgb, var(--text-muted) 40%, transparent); }
.acc-bar.me .acc-track > span { background: var(--go); }
.acc-bar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.acc-foot { color: var(--text-muted); font-size: 0.8rem; margin-top: 12px; }

.fc-foot { color: var(--text-muted); font-size: 0.76rem; line-height: 1.5; margin-top: 26px; }

@media (max-width: 760px) {
  .acc { grid-template-columns: 1fr; }
}
