/* ===========================================================================
   MATCHIQ — FIFA World Cup 2026 prediction console
   =========================================================================== */

:root {
    --bg:        #0a0e17;
    --card:      #0f1422;
    --border:    #1a2035;
    --text:      #e2e8f0;   /* primary  */
    --text-2:    #718096;   /* secondary*/
    --muted:     #4a5568;   /* muted    */
    --team1:     #1D9E75;
    --team2:     #378ADD;
    --amber:     #EF9F27;
    --mono:      'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --body:      system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Twemoji flag images inline with text */
img.emoji { height: 1em; width: 1em; vertical-align: -0.12em; margin: 0 1px; }

.label {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 10px;
    color: var(--text-2);
}

.amber { color: var(--amber); }
.c-team1 { color: var(--team1); }
.c-team2 { color: var(--team2); }
.muted { color: var(--muted); }

/* ===========================================================================
   App shell: sidebar + main
   =========================================================================== */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    flex: 0 0 220px;
    background: var(--card);
    border-right: 1px solid var(--border);
    padding: 20px 16px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
}

.brand { margin-bottom: 24px; }
.brand .logo {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--text);
}
.brand .tag {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 10px;
    color: var(--amber);
    margin-top: 2px;
}

.day-group { margin-bottom: 18px; }
.day-label {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

.fixture {
    display: block;
    padding: 6px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text-2);
    transition: background .12s;
    margin-bottom: 2px;
}
.fixture:hover { background: #131a2c; color: var(--text); }
.fixture .teams { color: var(--text); }
.fixture .meta { font-size: 10px; color: var(--muted); letter-spacing: .04em; }
.fixture.done .teams { color: var(--text-2); }
.fixture.done .meta { color: var(--muted); }
.fixture.live .teams { color: var(--amber); }
.fixture.live .meta { color: var(--amber); }

.main { flex: 1 1 auto; padding: 28px 36px; max-width: 1100px; }

.main-head { margin-bottom: 22px; }
.main-head .date { font-size: 22px; font-weight: 700; }
.main-head .stage {
    text-transform: uppercase; letter-spacing: .1em;
    font-size: 11px; color: var(--amber); margin-top: 2px;
}

/* ===========================================================================
   Index: today match cards
   =========================================================================== */

.cards { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
}

.match-card .mc-meta {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.match-card .mc-meta .grp { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--text-2); }
.badge {
    text-transform: uppercase; letter-spacing: .08em; font-size: 9px;
    padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
    color: var(--text-2);
}
.badge.live { color: var(--amber); border-color: var(--amber); }

.mc-teams { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.mc-teams .t { font-size: 17px; font-weight: 700; }
.mc-teams .t1 { color: var(--team1); }
.mc-teams .t2 { color: var(--team2); }
.mc-teams .x { color: var(--muted); font-size: 12px; }

.mc-probs { display: flex; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.mc-probs .seg { flex: 1; text-align: center; padding: 8px 4px; }
.mc-probs .seg + .seg { border-left: 1px solid var(--border); }
.mc-probs .seg .v { font-size: 16px; font-weight: 700; }
.mc-probs .seg .k { display: block; text-transform: uppercase; letter-spacing: .06em; font-size: 9px; color: var(--text-2); margin-top: 2px; }
.mc-probs .seg.s1 .v { color: var(--team1); }
.mc-probs .seg.s2 .v { color: var(--team2); }

.mc-xg { font-size: 11px; color: var(--text-2); margin-top: 12px; letter-spacing: .03em; }
.mc-note { font-size: 11px; margin-top: 6px; color: var(--text); }
.mc-cta { margin-top: 14px; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--amber); }

.empty { color: var(--text-2); padding: 40px 0; text-align: center; }

/* ===========================================================================
   Match detail page
   =========================================================================== */

.match-page { max-width: 920px; margin: 0 auto; padding: 28px 24px 60px; }
.back { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--text-2); }
.back:hover { color: var(--text); }

.m-head { margin: 18px 0 26px; }
.m-head .ctx { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--text-2); margin-bottom: 10px; }
.m-title { font-size: 30px; font-weight: 700; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.m-title .t1 { color: var(--team1); }
.m-title .t2 { color: var(--team2); }
.m-title .vs { color: var(--muted); font-size: 16px; }
.m-title .score { color: var(--text); font-variant-numeric: tabular-nums; }

.prob-bar { margin: 22px 0 8px; }
.pb-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.pb-row .name { width: 120px; font-weight: 700; }
.pb-row.r1 .name { color: var(--team1); }
.pb-row.r2 .name { color: var(--team2); }
.pb-row.rd .name { color: var(--text-2); }
.pb-track { flex: 1; height: 10px; background: #0a0e17; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.pb-fill { height: 100%; }
.pb-fill.f1, .prob-bar-team1 { background: #1D9E75; }
.pb-fill.fd, .prob-bar-draw  { background: #4a5568; }
.pb-fill.f2, .prob-bar-team2 { background: #378ADD; }
.pb-row .pct { width: 44px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.section { margin-top: 30px; }
.section > h2 {
    text-transform: uppercase; letter-spacing: .1em; font-size: 11px;
    color: var(--amber); font-weight: 700; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 1px solid var(--border);
}

.narrative { font-family: var(--body); font-size: 14px; line-height: 1.7; color: var(--text); }

.mathblock {
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 14px 16px; margin-top: 14px; font-size: 12px; color: var(--text-2);
    white-space: pre-wrap; line-height: 1.8;
}
.mathblock b { color: var(--text); }

.scoreline-list { display: grid; gap: 8px; }
.sl-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.sl-row .sl { width: 52px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sl-track { flex: 1; height: 14px; background: #0a0e17; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.sl-fill { height: 100%; background: var(--amber); opacity: .85; }
.sl-row .sl-pct { width: 48px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

.strength-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px 18px; align-items: center; }
.sg-head .h-team1 { color: var(--team1); font-weight: 700; text-align: right; }
.sg-head .h-team2 { color: var(--team2); font-weight: 700; }
.sg-head .h-k { text-align: center; }
.sg-row .v1 { text-align: right; font-variant-numeric: tabular-nums; }
.sg-row .v2 { text-align: left; font-variant-numeric: tabular-nums; }
.sg-row .k {
    text-align: center; text-transform: uppercase; letter-spacing: .06em;
    font-size: 10px; color: var(--text-2);
}
.na { color: var(--muted); border-bottom: 1px dotted var(--muted); cursor: help; font-size: 12px; }

.pvr { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px 20px; align-items: center; }
.pvr .col-h { text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--text-2); }
.pvr .arrow { color: var(--muted); text-align: center; }
.pvr .v1 { font-variant-numeric: tabular-nums; }
.verdict { margin-top: 14px; font-size: 13px; }
.verdict .ok { color: var(--team1); font-weight: 700; }
.verdict .no { color: var(--amber); font-weight: 700; }
.verdict .brier { color: var(--text-2); }

.season-record {
    margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: .08em; font-size: 11px;
    font-weight: 700; color: var(--text);
}

/* model edge */
.model-edge {
    background: #060a10; border: 1px solid var(--border);
    border-radius: 8px; padding: 16px 18px;
}
.model-edge > h2 { border-bottom: none; margin-bottom: 8px; }
.me-bet { font-size: 18px; font-weight: 700; color: var(--text); }
.me-stats {
    margin-top: 10px; display: flex; gap: 18px; flex-wrap: wrap;
    font-size: 11px; color: var(--text-2); letter-spacing: .04em;
}

.model-foot {
    margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--border);
    text-transform: uppercase; letter-spacing: .08em; font-size: 10px; color: var(--muted);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}

/* ===== Methodology / evaluation page ===== */
.methodology {
    max-width: 760px; margin: 0 auto; padding: 28px 20px 64px;
}
.methodology .back {
    display: inline-block; margin-bottom: 18px; color: var(--text-2);
    text-decoration: none; font-size: 13px;
}
.methodology .back:hover { color: var(--text); }
.eval-head h1 { font-size: 24px; margin: 0 0 4px; }
.eval-sub { color: var(--text-2); font-size: 13px; margin: 0 0 18px; }
.anchor-callout {
    background: var(--card); border: 1px solid var(--border);
    border-left: 3px solid var(--team1); border-radius: 8px;
    padding: 14px 16px; font-size: 13.5px; line-height: 1.55; margin-bottom: 26px;
}
.anchor-badge {
    display: inline-block; background: var(--team1); color: #06281c;
    font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 2px 7px; border-radius: 4px; margin-right: 8px;
}
.m-section { margin-bottom: 30px; }
.m-section h2 {
    font-size: 13px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--text-2); margin: 0 0 12px; font-weight: 700;
}
.chart-wrap {
    background: var(--card); border: 1px solid var(--border); border-radius: 10px;
    padding: 16px; max-width: 460px;
}
.reliability-svg { display: block; }
.reliability-svg .ax { fill: var(--text-2); font-size: 11px; font-family: inherit; }
.reliability-svg .ay { text-anchor: end; }
.legend {
    list-style: none; display: flex; flex-wrap: wrap; gap: 14px;
    margin: 12px 0 0; padding: 0; font-size: 12px; color: var(--text-2);
}
.legend li { display: flex; align-items: center; gap: 6px; }
.legend .sw { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend .sw.dash {
    background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 8px);
}
.caption { font-size: 12px; color: var(--text-2); line-height: 1.5; margin: 12px 0 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.eval-table {
    width: 100%; border-collapse: collapse; font-size: 13px; min-width: 380px;
}
.eval-table th, .eval-table td {
    text-align: right; padding: 9px 12px; border-bottom: 1px solid var(--border);
}
.eval-table th:first-child, .eval-table td:first-child { text-align: left; }
.eval-table th {
    color: var(--text-2); font-weight: 700; text-transform: uppercase;
    font-size: 10px; letter-spacing: .06em;
}
.eval-table td.best { color: var(--team1); font-weight: 700; }
.metric-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.metric-card {
    flex: 1 1 180px; background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; padding: 14px 16px;
}
.mc-label {
    font-size: 10px; text-transform: uppercase; letter-spacing: .06em;
    color: var(--text-2); margin-bottom: 8px;
}
.mc-value { font-size: 20px; font-weight: 700; }
.mc-value .good { color: var(--team1); }
.mc-value .mc-arrow, .mc-value .muted { color: var(--muted); font-weight: 400; }
.mc-foot { font-size: 11px; color: var(--text-2); margin-top: 6px; }
.limitations { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.limitations li { margin-bottom: 8px; }
.eval-foot {
    margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--border);
    font-size: 11px; color: var(--text-2); line-height: 1.7;
}
.eval-foot code { color: var(--text); background: var(--card); padding: 1px 5px; border-radius: 4px; }
.nav-eval {
    display: inline-block; margin-top: 10px; font-size: 11px; color: var(--team1);
    text-decoration: none; letter-spacing: .04em;
}
.nav-eval:hover { text-decoration: underline; }
@media (max-width: 520px) {
    .methodology { padding: 20px 14px 48px; }
    .eval-head h1 { font-size: 20px; }
    .metric-card { flex: 1 1 100%; }
}
