/* Champions League prediction hub + per-match pages.
 *
 * Page-scoped under .cpred-*, the same discipline champions_simulations.css
 * follows: nothing here inherits a base class that lives only in another
 * sport's stylesheet, so the page cannot render half-styled when loaded on its
 * own. It sits on top of simulations.css for .sim-page / .sim-hero /
 * .sim-card / .sim-chip / .sim-how / .sim-faq, which ARE in the shared sheet.
 *
 * The .why-* explainability block is intentionally NOT redefined here: it is
 * the site-wide contract shared with the NBA, football, EuroLeague and tennis
 * match pages, and forking it would let the champions card drift.
 */

.cpred-page {
    --cpred-home: #4F8DFF;
    --cpred-draw: #9AA3B2;
    --cpred-away: #F5A623;
    --cpred-hit: #43C18A;
    --cpred-miss: #E2685F;
}

/* ── hub layout ─────────────────────────────────────────────────────── */
.cpred-section {
    margin-bottom: 1.75rem;
}

.cpred-section-note {
    margin: 0 0 1rem;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.92rem;
    line-height: 1.55;
}

.cpred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

/* ── card ───────────────────────────────────────────────────────────── */
.cpred-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.cpred-card--played {
    background: rgba(255, 255, 255, 0.015);
}

.cpred-card__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.cpred-stage {
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.cpred-kickoff {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
}

.cpred-teams {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.35;
}

.cpred-teams a {
    color: inherit;
    text-decoration: none;
}

.cpred-teams a:hover,
.cpred-teams a:focus-visible {
    text-decoration: underline;
}

.cpred-vs {
    margin: 0 0.4rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 400;
}

.cpred-neutral {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ── probability rows ───────────────────────────────────────────────── */
.cpred-odds {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.cpred-odds__row {
    display: grid;
    grid-template-columns: minmax(0, 8.5rem) 1fr 3.4rem;
    align-items: center;
    gap: 0.6rem;
}

.cpred-odds__label {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpred-odds__row.is-pick .cpred-odds__label {
    font-weight: 600;
    color: #fff;
}

.cpred-odds__track {
    position: relative;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.cpred-odds__fill {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.cpred-odds__fill--h { background: var(--cpred-home); }
.cpred-odds__fill--d { background: var(--cpred-draw); }
.cpred-odds__fill--a { background: var(--cpred-away); }

.cpred-odds__pct {
    text-align: right;
    font-size: 0.85rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.9);
}

/* The outcome that actually happened, on a played match. Marked with a rule
 * rather than a colour, so it never reads as "the model got it right". */
.cpred-odds__row.is-actual .cpred-odds__pct {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cpred-odds--large .cpred-odds__row {
    grid-template-columns: minmax(0, 12rem) 1fr 4.2rem;
    gap: 0.9rem;
}

.cpred-odds--large .cpred-odds__track { height: 13px; }
.cpred-odds--large .cpred-odds__label { font-size: 1rem; }
.cpred-odds--large .cpred-odds__pct { font-size: 1rem; }

/* ── key-factor chips ───────────────────────────────────────────────── */
.cpred-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cpred-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.76rem;
    line-height: 1.3;
}

.cpred-chip--home {
    border-color: rgba(79, 141, 255, 0.45);
    background: rgba(79, 141, 255, 0.12);
}

.cpred-chip--away {
    border-color: rgba(245, 166, 35, 0.45);
    background: rgba(245, 166, 35, 0.12);
}

.cpred-chip__label { color: rgba(255, 255, 255, 0.78); }
.cpred-chip__value {
    color: #fff;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── grade ──────────────────────────────────────────────────────────── */
.cpred-grade {
    margin: 0;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    font-size: 0.84rem;
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(255, 255, 255, 0.25);
}

.cpred-grade--hit { border-left-color: var(--cpred-hit); }
.cpred-grade--miss { border-left-color: var(--cpred-miss); }

.cpred-more {
    align-self: flex-start;
    font-size: 0.84rem;
    text-decoration: none;
}

.cpred-more:hover { text-decoration: underline; }

/* ── empty state ────────────────────────────────────────────────────── */
/* Left-aligned prose, not the shared centred "no data" card. This is a page
 * with something to say — why coverage starts with the league phase and when
 * the first card lands — and a centred 460px column reads as an error notice.
 * `.sim-empty p` in simulations.css sets `max-width: 460px; margin: 0 auto`,
 * so both have to be unset explicitly or the paragraphs sit indented under a
 * left-aligned heading. */
.cpred-empty {
    padding: 2.25rem 1.5rem;
    text-align: left;
    max-width: 46rem;
}

.cpred-empty p {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.cpred-empty__title {
    margin: 0 0 0.9rem;
    font-size: 1.35rem;
}

.cpred-empty__body,
.cpred-empty__next,
.cpred-empty__links {
    margin: 0 0 0.85rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.78);
}

.cpred-empty__links { margin-bottom: 0; }

/* ── match page ─────────────────────────────────────────────────────── */
.cpred-breadcrumb {
    margin-bottom: 0.9rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.cpred-breadcrumb a { color: rgba(255, 255, 255, 0.8); }

.cpred-hero--match h1 { line-height: 1.25; }

.cpred-note {
    margin: 0.9rem 0 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.62);
}

.cpred-provenance {
    margin: 0.6rem 0 0;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.45);
}

.cpred-provenance code {
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.35rem;
    border-radius: 5px;
}

.cpred-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 0.9rem;
    margin: 0;
}

.cpred-fact dt {
    font-size: 0.74rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.cpred-fact dd {
    margin: 0.15rem 0 0;
    font-size: 1.25rem;
    font-variant-numeric: tabular-nums;
    color: #fff;
}

.cpred-graded__score {
    margin: 0.4rem 0 0.5rem;
    font-size: 2.1rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cpred-graded__line {
    margin: 0 0 0.6rem;
    font-size: 1rem;
    line-height: 1.55;
}

.cpred-graded__note {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

.cpred-graded--hit { border-left: 3px solid var(--cpred-hit); }
.cpred-graded--miss { border-left: 3px solid var(--cpred-miss); }

@media (max-width: 480px) {
    .cpred-grid { grid-template-columns: 1fr; }
    .cpred-odds__row,
    .cpred-odds--large .cpred-odds__row {
        grid-template-columns: minmax(0, 6.5rem) 1fr 3.2rem;
        gap: 0.5rem;
    }
    .cpred-graded__score { font-size: 1.7rem; }
}

/* ── the shared .why-* card, recoloured to this page ─────────────────────
 *
 * article.css owns the component (it is the same card the NBA, football,
 * EuroLeague and tennis match pages render, and forking it would let the
 * champions version drift). Only the two accent colours are overridden, and
 * only inside .cpred-match, so the factor bars agree with the probability bars
 * directly above them instead of arriving in NBA orange.
 */
.cpred-match .why-pull.p1,
.cpred-match .why-bar.p1 { color: var(--cpred-home); }
.cpred-match .why-bar.p1 { background: var(--cpred-home); }
.cpred-match .why-pull.p2 { color: var(--cpred-away); }
.cpred-match .why-bar.p2 { background: var(--cpred-away); }

/* .why-model brings its own padding/background from article.css; on this page
 * the .sim-card wrapper already provides both, so drop the double frame. */
.cpred-match .why-model {
    padding: 0;
    background: none;
    border: 0;
}

/* ── season shape: the competition itself, in aggregate ──────────────────
 *
 * Ten seasons of tournament results as CSS bars. No chart library on purpose:
 * the hub loads none today, a stacked percentage needs none, and a block that
 * costs nothing to render is a block that cannot break the page it is a
 * secondary section of.
 *
 * The three segment colours are the SAME custom properties the probability
 * bars use on the cards above, so "home" is one colour on this page, not two.
 */
.cpred-shape__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.6rem;
    align-items: start;
}

.cpred-shape__title {
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.cpred-shape__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin: 0 0 0.7rem;
    padding: 0;
    list-style: none;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.62);
}

.cpred-shape__legend li {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.cpred-key {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}

.cpred-key--h { background: var(--cpred-home); }
.cpred-key--d { background: var(--cpred-draw); }
.cpred-key--a { background: var(--cpred-away); }

.cpred-shape__rows {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.cpred-shape__row {
    display: grid;
    grid-template-columns: 3.9rem 1fr;
    align-items: center;
    gap: 0.6rem;
}

.cpred-shape__label {
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.62);
}

.cpred-shape__stack {
    display: flex;
    height: 18px;
    border-radius: 5px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
}

/* The number sits INSIDE its own segment: a legend plus a value is enough to
 * read the row without a tooltip, and a segment too narrow for its label just
 * clips it rather than pushing the stack out of shape. */
.cpred-shape__seg {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0.7rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: rgba(4, 10, 12, 0.82);
}

.cpred-shape__seg--h { background: var(--cpred-home); }
.cpred-shape__seg--d { background: var(--cpred-draw); }
.cpred-shape__seg--a { background: var(--cpred-away); }

.cpred-shape__foot {
    margin: 0.85rem 0 0;
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

/* Goals per match: zero-based columns against a fixed 4.0 ceiling (the
 * loader's GOALS_AXIS_MAX). A cropped baseline would turn a 0.5-goal drift
 * into a cliff, which is exactly the chart lie this house does not tell. */
.cpred-goals {
    position: relative;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0.35rem;
    height: 180px;
    padding-top: 0.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.cpred-goals__col {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    height: 100%;
    gap: 0.25rem;
}

.cpred-goals__value {
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.72);
}

.cpred-goals__bar {
    width: 100%;
    max-width: 26px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(
        180deg,
        var(--cpred-home) 0%,
        rgba(79, 141, 255, 0.45) 100%
    );
}

.cpred-goals__label {
    position: absolute;
    bottom: -1.35rem;
    font-size: 0.68rem;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.5);
}

/* The decade average, as a hairline across the columns. It carries NO inline
 * label: at 4.0 the line sits close to the tallest bars, and a label pinned to
 * either end lands on top of a value. The caption underneath names it. */
.cpred-goals__avg {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px dashed rgba(255, 255, 255, 0.28);
    pointer-events: none;
}

.cpred-shape .cpred-goals { margin-bottom: 1.5rem; }

@media (max-width: 860px) {
    .cpred-shape__grid { grid-template-columns: 1fr; gap: 1.9rem; }
}

@media (max-width: 480px) {
    .cpred-shape__row { grid-template-columns: 3.2rem 1fr; gap: 0.45rem; }
    .cpred-shape__label { font-size: 0.72rem; }
    .cpred-shape__stack { height: 16px; }
    .cpred-goals { height: 150px; gap: 0.2rem; }
    .cpred-goals__value { font-size: 0.6rem; }
    .cpred-goals__label { font-size: 0.6rem; }
}
