/* Live match page — reproduces the redesigned Play-Cricket scorecard look
   (see page_download/page.html mock-up). Club colours: maroon / amber / blue. */

@font-face {
    font-family: 'AvenirNextCondensed';
    src: url('/static/fonts/AvenirNextCondensed-Regular.woff') format('woff'),
         url('/static/fonts/AvenirNextCondensed-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'AvenirNextCondensed';
    src: url('/static/fonts/AvenirNextCondensed-Medium.woff') format('woff'),
         url('/static/fonts/AvenirNextCondensed-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'AvenirNextCondensed';
    src: url('/static/fonts/AvenirNextCondensed-DemiBold.woff') format('woff'),
         url('/static/fonts/AvenirNextCondensed-DemiBold.ttf') format('truetype');
    font-weight: 600 800;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --maroon: #872734;
    --amber: #e8a22b;
    --blue: #0b4169;
    --banner-bg: #2d65ad;      /* mid blue banner */
    --banner-dark: #08192f;    /* dark navy — left of the banner fade */
    --banner-fade: linear-gradient(90deg, #08192f 0%, #2d65ad 100%);
    --banner-panel: rgba(8, 139, 237, 0.10);
    --muted: #b0b3b9;          /* grey labels on the banner */
    --page-bg: #f4f5f7;
    --surface: #ffffff;
    --text: #23303c;
    --text-soft: #6b7280;
    --border: #e6e8eb;
    --row-alt: #f7f9fb;
    --live: #12a150;
    --maxw: 1200px;
}

body {
    font-family: 'AvenirNextCondensed', -apple-system, BlinkMacSystemFont,
        'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--page-bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

/* --- Top colour bars --- */
.colorbar {
    display: flex;
    height: 8px;
}
.colorbar span:nth-child(1) { flex: 0 0 40%; background: var(--maroon); }
.colorbar span:nth-child(2) { flex: 0 0 18%; background: var(--amber); }
.colorbar span:nth-child(3) { flex: 1;       background: var(--blue); }

/* --- Club / competition header --- */
.club-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.club-header .inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.club-header .title {
    font-weight: 800;
    letter-spacing: 0.02em;
    font-size: 18px;
    text-transform: uppercase;
}
.club-header .comp {
    font-size: 16px;
    color: var(--text-soft);
    text-align: right;
}
.club-header .comp a { color: var(--blue); text-decoration: none; }
.club-header .comp a:hover { text-decoration: underline; }

/* --- Main match banner --- */
.banner-wrap {
    max-width: var(--maxw);
    margin: 22px auto 0;
    padding: 0 20px;
}
.banner {
    background: var(--banner-fade);
    color: #fff;
    border-radius: 14px 14px 0 0;
    padding: 26px 24px 22px;
}
.live-dot {
    display: inline-block;
    vertical-align: middle;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--live);
    box-shadow: 0 0 0 0 rgba(18, 161, 80, 0.7);
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(18, 161, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(18, 161, 80, 0); }
}

/* Teams line — three equal columns: home | center | away */
.teams-line {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 16px;
}
.team { text-align: center; }
.team .badge {
    width: 72px;
    height: 72px;
    line-height: 72px;
    border-radius: 50%;
    border: 3px solid #fff;
    margin: 0 auto 8px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}
.team .badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #fff;
}
.team .name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    min-height: 44px;
}
.team .score {
    font-size: 52px;
    font-weight: 800;
    line-height: 1.1;
    margin-top: 6px;
}
.team .score .small { font-size: 30px; font-weight: 600; }
/* Breathing room on both sides of the slash between score and wickets. */
.team .score .score-sep { margin: 0 0.12em; }
.team .overs { font-size: 16px; color: var(--muted); margin-top: 2px; }
.team.batting .score { color: #ffe08a; }

/* Center column: status, V, then stacked stats */
.center-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 128px;
    text-align: center;
}
.center-col .status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.25;
    max-width: 260px;
    text-align: center;
}
/* Play-Cricket status silhouette — white PNG, sits above the status label. */
.center-col .status .status-icon {
    height: 46px;
    width: auto;
    display: block;
}
/* Finished match — Play-Cricket win style: the winning team's name on top, then
   the icon to the LEFT of the result with a green accent dot, and a white
   underline beneath the whole block. */
.center-col .status.status-result {
    flex-direction: column;
    align-items: center;
    gap: 8px;
    max-width: 340px;
    padding-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.92);
}
.result-winner {
    font-weight: 400;
    font-size: 24px;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.15;
}
.result-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    font-size: 24px;
}
.center-col .status.status-result .status-icon { height: 58px; }
.result-line .status-label { text-align: left; }
.result-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--live);
    margin-left: 8px;
    vertical-align: baseline;
}
/* The score is only highlighted yellow while a game is in play (the batting
   side, see .team.batting). When the game is finished it returns to white. */
.center-col .vs-mark {
    font-size: 16px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.center-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
}
.cstat { display: flex; flex-direction: column; line-height: 1.05; }
.cstat .clabel {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
}
.cstat .cval { font-size: 36px; font-weight: 800; color: #fff; }
.cstat .cval small { font-size: 16px; font-weight: 600; color: var(--muted); }

/* Need headline — large, matching the team score (52 / 30). */
.cstat-need .cval { font-size: 52px; }
.cstat-need .cval small { font-size: 30px; }

/* Two smaller stats side by side (e.g. current + required run rate under Need) */
.cstat-pair { display: flex; gap: 22px; justify-content: center; }
.cstat-pair .cstat { align-items: center; }
.cstat-pair .cval { font-size: 24px; }

/* All-out state (innings complete) shown in place of the projection */
.ao-note { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 2px; }
.ao-badge {
    display: inline-block;
    background: var(--amber);
    color: #23303c;
    font-weight: 800;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 14px;
    border-radius: 999px;
}
.ao-sub { font-size: 16px; color: var(--muted); }
.team .toss-note {
    font-size: 16px;
    color: var(--muted);
    margin-top: 8px;
    line-height: 1.3;
    padding: 0 6px;
}

/* --- Chase card (from the mock-up) --- */
.chase-card {
    width: 90%;
    max-width: 360px;
    margin: 18px auto 2px;
    text-align: left;
    color: #fff;
}
.chase-card-top {
    padding: 0 4px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}
.chase-card-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 4px;
}
.chase-card-headline { font-size: 19px; color: var(--muted); font-weight: 400; line-height: 1.15; }
.chase-card-headline .cc-big { font-size: 32px; color: #fff; font-weight: 800; }
.chase-card-bottom { display: flex; padding-top: 10px; }
.chase-card-col { flex: 1; padding: 2px 4px; }
.chase-card-col + .chase-card-col {
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    padding-left: 16px;
}
.chase-card-label { font-size: 16px; color: var(--muted); margin-bottom: 1px; }
.chase-card-rate { font-size: 28px; color: #fff; font-weight: 800; line-height: 1.15; }

/* First-innings progress (run rate / projected total) */
.prog-card {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 16px auto 2px;
    color: #fff;
}
.prog-col { text-align: center; }
.prog-label {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    margin-bottom: 2px;
}
.prog-val { font-size: 30px; font-weight: 800; line-height: 1.1; }

/* Live overs-per-innings control on the banner (projection basis) */
.overs-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 12px auto 2px;
    color: var(--muted);
    font-size: 16px;
}
.overs-control label { text-transform: uppercase; letter-spacing: 0.04em; }
.overs-control input {
    width: 56px;
    padding: 3px 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
}
.overs-control input:focus { outline: none; border-color: #fff; background: rgba(255, 255, 255, 0.2); }
.overs-control .overs-hint { font-size: 16px; opacity: 0.75; }

/* --- Ball-by-ball strip (single scrollable line, most recent first) --- */
.ball-strip-wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px;
}
.ball-strip {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 5px;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    padding: 12px 16px;
    scrollbar-width: thin;
}
.ball-strip::-webkit-scrollbar { height: 8px; }
.ball-strip::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.over { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.over-no {
    font-size: 16px;
    color: var(--text-soft);
    min-width: 14px;
    text-align: right;
    margin-right: 2px;
}
.over-sep { color: var(--border); font-weight: 700; padding: 0 3px; user-select: none; flex: 0 0 auto; }
.over-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-soft);
    margin-left: 3px;
    flex: 0 0 auto;
}

.ball {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: #cfd4da;
    cursor: help;
    flex: 0 0 auto;
}
.ball-dot   { background: #dfe3e8; }
.ball-dot::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6b7784;   /* centred dot inside the dot-ball circle */
}
.ball-run   { background: #7a8794; }
.ball-four  { background: #1e63c4; }   /* blue */
.ball-six   { background: #12a150; }   /* green */
.ball-wicket{ background: #111418; }   /* black */
.ball-wide,
.ball-noball,
.ball-bye   { background: #e8a22b; font-size: 16px; }  /* amber extras */

/* --- Innings tabs --- */
.card {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 20px 40px;
}
.innings-tabs {
    display: flex;
    flex-wrap: wrap;
    /* Square bottom so the tabs sit flush against the block below them. */
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}
.innings-tab {
    flex: 1;
    min-width: 160px;
    background: var(--page-bg);
    color: var(--text);
    padding: 12px 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
    /* Every tab reserves a 1px border on all sides (transparent by default) so
       the boxes stay aligned; each state then colours only the sides it needs.
       An unselected tab shows just its bottom edge — the panel's top line runs
       under it — with nothing on the top or sides. */
    border: 1px solid transparent;
    border-bottom-color: var(--border);
}
.innings-tab:hover { background: #eceef1; }
/* The selected tab's outline wraps up the left, over the top and down the
   right, then opens at the bottom so it joins the panel below — the border
   runs around the tab and back around the scorecard as one continuous line. */
.innings-tab.active {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
    border-bottom-color: transparent;
}
.innings-tab .tab-score { display: block; font-size: 16px; font-weight: 500; color: var(--text-soft); }

/* --- Scorecard tables --- */
/* Transparent container; each section is its own white block, so the gaps
   between them reveal the grey page background as a separator. */
.scorecard {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sc-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px 0 12px;
}
/* When innings tabs are present the first block joins directly onto the active
   tab: no rounded top, no top border, no gap — so the tab and its content read
   as one connected panel. */
.scorecard.has-tabs .sc-block:first-child {
    border-top: none;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
.sc-section-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-soft);
    font-weight: 700;
    padding: 16px 18px 6px;
}
/* Tables scroll horizontally rather than crush their columns on narrow screens. */
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.sc {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 16px;
}
table.sc th {
    text-align: right;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    font-weight: 600;
    padding: 6px 10px;
    border-bottom: 2px solid var(--border);
}
table.sc th.left { text-align: left; padding-left: 18px; }
table.sc td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border);
    text-align: right;
    white-space: nowrap;
}
table.sc td.left { text-align: left; padding-left: 18px; white-space: normal; }
table.sc tbody tr:nth-child(even) { background: var(--row-alt); }
table.sc td.name { font-weight: 600; }
a.pc-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #b7bdc4;
}
a.pc-link:hover { color: var(--blue); border-bottom-color: var(--blue); }
.on-strike {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--live);
    margin-left: 7px;
    vertical-align: middle;
}
table.sc td.name .order {
    display: inline-block;
    color: #9aa1a9;
    font-size: 16px;
    font-weight: 400;
    margin-right: 8px;
}
table.sc td.howout-cell {
    text-align: left;
    font-weight: 400;
    font-size: 16px;
    color: var(--text-soft);
    white-space: normal;
}
.pill-notout {
    display: inline-block;
    background: #6b7784;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 999px;
    white-space: nowrap;
}
td.strong { font-weight: 800; }
.na { color: #c4c9cf; }
.extras-row td, .total-row td { font-weight: 700; border-top: 2px solid var(--border); }
.total-row td { font-size: 16px; }
.dnb-row td { color: var(--text-soft); }
.dnb-row td.name a.pc-link { color: var(--text-soft); }
.dnb-row .howout-cell { font-style: italic; }

/* --- Worm graph --- */
.worm-card { padding: 8px 0 10px; }
.worm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 18px;
}
.worm-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.worm-leg {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 16px;
    color: var(--text);
}
.worm-leg i {
    width: 16px;
    height: 4px;
    border-radius: 2px;
    display: inline-block;
}
.worm-leg.sq i { width: 12px; height: 12px; }
.mbar { transition: opacity 0.1s; }
.mbar:hover { opacity: 0.82; }
.worm-chart { padding: 4px 6px 0; position: relative; }
.worm-chart svg { width: 100%; height: auto; display: block; }
.worm-hit { cursor: crosshair; }
.worm-cross { stroke: #9aa1a9; stroke-width: 1; stroke-dasharray: 4 3; pointer-events: none; }
.worm-marker { pointer-events: none; }
.worm-tip {
    position: absolute;
    top: 8px;
    background: rgba(35, 48, 60, 0.95);
    color: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 16px;
    line-height: 1.5;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    z-index: 5;
}
.worm-tip .wt-over { font-weight: 700; margin-bottom: 3px; color: #cfd6dd; }
.worm-tip .wt-row { display: flex; align-items: center; gap: 6px; }
.worm-tip .wt-row i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.worm-tip .wt-row b { margin-left: auto; padding-left: 12px; }
.worm-grid { stroke: #eef1f4; stroke-width: 1; }
.worm-axis { stroke: #d3d8de; stroke-width: 1; }
.worm-ylabel { fill: var(--text-soft); font-size: 16px; text-anchor: end; }
.worm-xlabel { fill: var(--text-soft); font-size: 16px; text-anchor: middle; }
.worm-axis-title {
    fill: var(--text-soft);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-anchor: middle;
}

/* --- Win predictor (WinViz) --- */
.winviz-card { padding: 6px 0 14px; }
.winviz-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 18px;
}
.winviz-note { font-size: 16px; color: var(--text-soft); }
.winviz-body { padding: 4px 18px 0; }
.winviz-labels {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 0 8px;
}
.wv-team {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    font-size: 16px;
    color: var(--text-soft);
    min-width: 0;
    flex: 0 1 auto;
    max-width: 49%;
}
.wv-team b { font-size: 20px; font-weight: 800; color: var(--text); }
.wv-team .wv-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winviz-bar {
    display: flex;
    height: 22px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border);
}
.wv-seg { height: 100%; transition: width 0.5s ease; }

/* --- Partnership bars --- */
.pnr-block { padding-bottom: 14px; }
.pnr-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 2px 0 12px;
}
.pnr-key {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 16px;
    color: var(--text-soft);
}
.pnr-sw { width: 13px; height: 13px; border-radius: 3px; display: inline-block; }
.pnr-others { background: #2f6fd6; }   /* singles / other runs */
.pnr-fours  { background: #e0392b; }   /* 4s */
.pnr-sixes  { background: var(--maroon); }  /* 6s */

.pnr-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pnr-chart { position: relative; min-width: 540px; padding: 0 14px; }
/* Continuous dashed centre line the bars diverge from. */
.pnr-axis {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    border-left: 1px dashed #b6bbc2;
    transform: translateX(-0.5px);
}
.pnr-row {
    display: grid;
    grid-template-columns: 1fr 240px 1fr;
    align-items: center;
    column-gap: 10px;
    padding: 6px 0;
}
.pnr-name { font-size: 16px; white-space: nowrap; color: var(--text); }
.pnr-name b { font-weight: 700; }
.pnr-name-left { text-align: right; }
.pnr-name-right { text-align: left; }
.pnr-mid { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.pnr-total { font-size: 16px; font-weight: 700; position: relative; }
.pnr-bars { display: flex; width: 100%; }
/* 1px gap so adjacent colour segments stay legible. */
.pnr-half { flex: 1; display: flex; gap: 1px; }
.pnr-half-left { justify-content: flex-end; }
.pnr-half-right { justify-content: flex-start; }
.pnr-seg { height: 13px; display: inline-block; }

/* --- Header nav controls (Match Feed link + recent-matches dropdown) --- */
.hdr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hdr-controls { display: flex; align-items: center; gap: 14px; }
.hdr-link {
    color: var(--blue);
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
}
.hdr-link:hover { text-decoration: underline; }
.hdr-recent {
    font-size: 16px;
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    max-width: 240px;
    cursor: pointer;
}

/* --- Match feed / results page --- */
.mf-wrap { max-width: var(--maxw); margin: 22px auto 40px; padding: 0 20px; }

/* Track-a-match form */
.mf-add { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.mf-input, .mf-overs {
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
}
.mf-input { flex: 1 1 320px; min-width: 0; }
.mf-overs { flex: 0 0 90px; width: 90px; }
.mf-input:focus, .mf-overs:focus { outline: none; border-color: var(--blue); }
.mf-btn {
    flex: 0 0 auto;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}
.mf-btn:hover { background: #0a3a5f; }
.mf-btn:disabled { opacity: 0.55; cursor: default; }
.mf-add-msg { font-size: 16px; min-height: 1.25em; margin-bottom: 16px; color: var(--text-soft); }
.mf-add-msg.err { color: var(--maroon); }
.mf-add-msg.ok { color: var(--live); }

.mf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.mf-card {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    text-decoration: none;
    color: var(--text);
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.mf-card:hover {
    border-color: #cdd2d8;
    box-shadow: 0 4px 14px rgba(8, 25, 47, 0.08);
    transform: translateY(-1px);
}
.mf-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.mf-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #fff;
    background: #6b7280;
}
.mf-badge.mf-live { background: var(--live); }
.mf-badge.mf-upcoming { background: #2563eb; }
.mf-badge.mf-complete { background: #6b7280; }
.mf-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.mf-grade { font-size: 16px; color: var(--text-soft); }
.mf-teams { display: flex; flex-direction: column; gap: 6px; }
.mf-team { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.mf-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.mf-score { font-size: 18px; font-weight: 800; white-space: nowrap; }
.mf-score .mf-wkts { font-weight: 600; }
.mf-score .mf-ov { font-size: 16px; font-weight: 500; color: var(--text-soft); }
.mf-score .mf-yet { font-size: 16px; font-weight: 500; color: var(--text-soft); }
.mf-foot {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 16px;
    color: var(--text-soft);
    min-height: 1.2em;
}
.mf-foot .mf-err { color: var(--maroon); }

/* --- Footer / refresh status --- */
.refresh-bar {
    max-width: var(--maxw);
    margin: 14px auto 40px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
    color: var(--text-soft);
    flex-wrap: wrap;
}
.refresh-bar .live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--live);
    font-weight: 700;
}
.refresh-bar button {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 16px;
    cursor: pointer;
}
.refresh-bar button:hover { background: var(--row-alt); }
.refresh-bar button:disabled { opacity: 0.5; cursor: default; }

.state-msg {
    max-width: var(--maxw);
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
    color: var(--text-soft);
}
.state-msg.error { color: var(--maroon); }

/* ---------- Mobile / small screens ---------- */
@media (max-width: 680px) {
    .club-header .inner { padding: 12px 14px; }
    .club-header .title { font-size: 16px; }
    .club-header .comp { font-size: 16px; }

    .banner-wrap, .ball-strip-wrap { padding: 0 10px; }
    .card { padding: 0 10px 30px; }
    .banner { padding: 18px 12px 16px; border-radius: 12px 12px 0 0; }

    /* Keep the three columns but scale everything down to fit a phone. */
    .teams-line { gap: 6px; }
    .team .badge { width: 46px; height: 46px; line-height: 46px; font-size: 16px; margin-bottom: 6px; }
    .team .name { font-size: 16px; min-height: 31px; line-height: 1.15; }
    .team .score { font-size: 22px; margin-top: 4px; }
    .team .score .small { font-size: 16px; }
    .team .overs { font-size: 16px; }
    .team .toss-note { font-size: 16px; margin-top: 5px; padding: 0 2px; }

    .center-col { min-width: 0; gap: 4px; }
    .center-col .status { font-size: 16px; max-width: 130px; gap: 5px; }
    .center-col .status .status-icon { height: 34px; }
    .center-col .status.status-result { gap: 8px; max-width: 150px; padding-bottom: 8px; }
    .center-col .status.status-result .status-icon { height: 40px; }
    .center-col .vs-mark { font-size: 16px; }
    .center-stats { gap: 5px; }
    .cstat .clabel { font-size: 16px; }
    .cstat .cval { font-size: 22px; }
    .cstat .cval small { font-size: 16px; }
    .cstat-pair { flex-direction: column; gap: 3px; }   /* stack the two rates */
    .cstat-pair .cval { font-size: 16px; }
    .cstat-need .cval { font-size: 30px; }
    .cstat-need .cval small { font-size: 17px; }
    .ao-badge { font-size: 16px; padding: 3px 10px; }
    .overs-control { font-size: 16px; gap: 6px; flex-wrap: wrap; }
    .overs-control input { width: 48px; }

    /* Scorecard: tables already scroll (min-width); tighten the surrounding chrome. */
    .sc-section-title { padding: 12px 12px 6px; font-size: 16px; }
    table.sc { font-size: 16px; }
    table.sc th.left, table.sc td.left { padding-left: 12px; }
    .innings-tab { min-width: 120px; font-size: 16px; padding: 10px 8px; }
    .innings-tab .tab-score { font-size: 16px; }

    /* Charts scroll rather than shrink their labels into illegibility. */
    .worm-chart { overflow-x: auto; padding: 4px 0 0; }
    .worm-chart svg { min-width: 560px; }
    .worm-head { padding-right: 12px; }
    .worm-legend { gap: 10px; }
    .worm-leg { font-size: 16px; }

    .winviz-note { display: none; }
    .winviz-head, .winviz-body { padding-left: 12px; padding-right: 12px; }
    .winviz-body { padding-left: 12px; padding-right: 12px; }
    .wv-team { font-size: 16px; }
    .wv-team b { font-size: 16px; }
}

@media (max-width: 380px) {
    .team .name { font-size: 16px; }
    .team .score { font-size: 19px; }
    .center-col .status { font-size: 16px; }
    .cstat .cval { font-size: 19px; }
}
