/*
 * Kisure FE923 — Match scorecard reference layout / semantic heading / lineup formation fallback
 * Presentation only: no match, lineup, live-state, event, statistic or provider ownership changes.
 */

/* Keep the semantic match H1 in the document/accessibility tree without spending visual space. */
html body.site-body main.football-page .football-match-page-heading--seo[data-kisure-match-heading="seo-preserved"] {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    min-height: 0 !important;
}

/* Desktop/tablet: scorecard and all match sections own the same main content column.
   The rail starts at the scorecard top and continues beside the page. */
@media (min-width: 801px) {
    html body.site-body main.football-page.football-page--team-themed > .article-match-scoreboard--match-page {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
    }

    html body.site-body main.football-page.football-page--team-themed > .ad-slot {
        grid-column: 1 !important;
        grid-row: 2 !important;
        min-width: 0 !important;
    }

    html body.site-body main.football-page.football-page--team-themed > .football-section-tabs--match {
        grid-column: 1 !important;
        grid-row: 3 !important;
    }

    html body.site-body main.football-page.football-page--team-themed .football-match-main-column {
        grid-column: 1 !important;
        grid-row: 4 !important;
        min-width: 0 !important;
    }

    html body.site-body main.football-page.football-page--team-themed .football-match-sidebar-stack {
        grid-column: 2 !important;
        grid-row: 1 / 5 !important;
        align-self: start !important;
        margin-top: 0 !important;
    }
}

/* Reference-inspired card shell. Uses the saved team palette for the thin side accents. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] {
    position: relative !important;
    isolation: isolate;
    overflow: hidden !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    padding: 0 12px 14px !important;
    border: 1px solid var(--ks-border, #dbe4e8) !important;
    border-radius: 22px !important;
    background: var(--ks-card, #fff) !important;
    color: var(--ks-text, #102126) !important;
    box-shadow: 0 8px 30px rgba(15, 23, 42, .06) !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"]::before,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"]::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    z-index: 2;
    pointer-events: none;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"]::before {
    left: 0;
    background: var(--ks-home-team-color, #0B9CA0);
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"]::after {
    right: 0;
    background: var(--ks-away-team-color, #087C78);
}

/* Competition header — compact like the supplied reference card. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__meta {
    min-height: 50px !important;
    margin: 0 !important;
    padding: 10px 18px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-bottom: 1px solid var(--ks-border, #e5ecef) !important;
    color: var(--ks-text, #102126) !important;
    font-size: 14px !important;
    line-height: 1.25 !important;
    text-align: center !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__meta > i {
    color: var(--ks-primary, #0B9CA0) !important;
    font-size: 14px !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__meta > *,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__competition-link,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__competition-link strong {
    color: var(--ks-text, #102126) !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__competition-link strong {
    font-size: 14px !important;
    font-weight: 750 !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__meta > span {
    color: var(--ks-muted, #64757b) !important;
    font-weight: 600 !important;
}

/* Date/venue strip. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__context {
    min-height: 42px;
    margin: 0 -12px;
    padding: 9px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 24px;
    border-bottom: 1px solid var(--ks-border, #edf1f3);
    color: var(--ks-muted, #64757b);
    background: color-mix(in srgb, var(--ks-card, #fff) 94%, var(--ks-primary, #0B9CA0) 6%);
    font-size: 12px;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__context > :is(span, a) {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ks-muted, #64757b) !important;
    text-decoration: none !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__context i {
    color: var(--ks-primary, #0B9CA0) !important;
}

/* Team / score / team — preserve all existing live selectors and links. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__main {
    width: min(100%, 880px) !important;
    max-width: 880px !important;
    min-height: 116px !important;
    margin: 0 auto !important;
    padding: 25px 22px 16px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 64px 118px 64px minmax(0, 1fr) !important;
    align-items: center !important;
    column-gap: 12px !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team strong {
    min-width: 0 !important;
    color: var(--ks-text, #102126) !important;
    font-size: clamp(16px, 1.8vw, 22px) !important;
    line-height: 1.16 !important;
    font-weight: 650 !important;
    text-decoration: none !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team--home {
    text-align: right !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team--away {
    text-align: left !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest {
    width: 58px !important;
    height: 66px !important;
    display: grid !important;
    place-items: center !important;
    border: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    transition: transform .2s ease !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest:hover {
    transform: scale(1.06);
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest img {
    width: 54px !important;
    height: 62px !important;
    max-width: 100% !important;
    object-fit: contain !important;
    filter: drop-shadow(0 3px 5px rgba(15, 23, 42, .10));
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score {
    min-width: 0 !important;
    min-height: 76px !important;
    padding: 0 !important;
    display: flex !important;
    align-content: center !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    color: var(--ks-text, #102126) !important;
    text-align: center !important;
    text-decoration: none !important;
    background: transparent !important;
    border: 0 !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > b {
    color: var(--ks-text, #102126) !important;
    font-size: clamp(34px, 4vw, 43px) !important;
    font-weight: 760 !important;
    line-height: .95 !important;
    letter-spacing: -.035em !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > em {
    width: 12px !important;
    height: auto !important;
    display: inline-grid !important;
    place-items: center !important;
    background: transparent !important;
    border: 0 !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > em::before {
    content: "–" !important;
    color: var(--ks-muted, #64757b) !important;
    font-size: 24px !important;
    font-style: normal !important;
    font-weight: 500 !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > span {
    flex: 0 0 100% !important;
    margin: 2px 0 0 !important;
    color: var(--ks-muted, #64757b) !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    letter-spacing: .01em !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > span :is(small, strong) {
    color: inherit !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"].is-live .article-match-scoreboard__score > span,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"].is-live [data-live-phase-label],
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"].is-live [data-live-clock-time] {
    color: var(--ks-primary, #0B9CA0) !important;
}

/* Half-time / penalties remain first-class data, but visually compact. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__details--halftime,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__details--penalties {
    width: min(100%, 880px) !important;
    max-width: 880px !important;
    margin: -4px auto 6px !important;
    padding: 0 16px !important;
    display: flex !important;
    justify-content: center !important;
    color: var(--ks-text, #102126) !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__halftime-pill,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__penalty-pill {
    border: 1px solid color-mix(in srgb, var(--ks-primary, #0B9CA0) 35%, transparent) !important;
    border-radius: 999px !important;
    background: color-mix(in srgb, var(--ks-primary, #0B9CA0) 10%, var(--ks-card, #fff)) !important;
    color: var(--ks-primary, #0B9CA0) !important;
    box-shadow: none !important;
}

/* Scorers / assists / missed penalties / cards — reference-like three-column rows. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support {
    width: min(100%, 880px) !important;
    max-width: 880px !important;
    min-height: 42px !important;
    margin: 0 auto !important;
    padding: 9px 20px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr) !important;
    align-items: center !important;
    gap: 10px !important;
    border-top: 1px solid var(--ks-border, #e8edef) !important;
    background: transparent !important;
    color: var(--ks-muted, #53656b) !important;
    font-size: 12px !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support[hidden] {
    display: none !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col {
    min-width: 0 !important;
    display: block !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col--home,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col--home strong {
    text-align: right !important;
    justify-content: flex-end !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col--away,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col--away strong {
    text-align: left !important;
    justify-content: flex-start !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col strong {
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
    color: var(--ks-text, #102126) !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
    font-weight: 560 !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col strong span,
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__player-link {
    color: var(--ks-text, #102126) !important;
    font-size: inherit !important;
    line-height: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__player-link:hover {
    color: var(--ks-primary, #0B9CA0) !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-center {
    min-width: 0 !important;
    width: 46px !important;
    display: grid !important;
    place-items: center !important;
    gap: 0 !important;
    color: var(--ks-muted, #64757b) !important;
}

/* Keep the accessible row label while matching the supplied icon-centred reference visually. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-title {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-center .football-event-icon {
    width: 27px !important;
    height: 27px !important;
    display: grid !important;
    place-items: center !important;
    font-size: 16px !important;
    line-height: 1 !important;
}

/* Footer keeps referee / attendance / season without competing with the primary card. */
html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__details--last {
    width: min(100%, 880px) !important;
    max-width: 880px !important;
    min-height: 38px !important;
    margin: 4px auto 0 !important;
    padding: 10px 20px 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px 18px !important;
    border-top: 1px solid var(--ks-border, #e8edef) !important;
    color: var(--ks-muted, #64757b) !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__details--last :is(a, span) {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    color: var(--ks-muted, #64757b) !important;
    font-size: 11px !important;
    text-decoration: none !important;
}

html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__details--last i {
    color: var(--ks-primary, #0B9CA0) !important;
}

/* Dark mode stays unmistakably Kisure rather than turning the scorecard generic black. */
html[data-theme="dark"] body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] {
    background: var(--ks-card, #172124) !important;
    border-color: var(--ks-border, #344448) !important;
    box-shadow: none !important;
}

html[data-theme="dark"] body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__context {
    background: color-mix(in srgb, var(--ks-card, #172124) 91%, var(--ks-primary, #0B9CA0) 9%) !important;
}

/* Tablet tuning: retain desktop two-column page and exactly the same scorecard/content width. */
@media (min-width: 801px) and (max-width: 1100px) {
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__main {
        grid-template-columns: minmax(0, 1fr) 54px 104px 54px minmax(0, 1fr) !important;
        padding-inline: 12px !important;
        column-gap: 8px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest {
        width: 50px !important;
        height: 58px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest img {
        width: 48px !important;
        height: 56px !important;
    }
}

/* Phone layout: same data, compact geometry, no horizontal overflow. */
@media (max-width: 800px) {
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] {
        border-radius: 17px !important;
        padding: 0 8px 12px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__meta {
        min-height: 44px !important;
        padding: 9px 12px !important;
        gap: 6px !important;
        font-size: 12px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__competition-link strong {
        font-size: 12px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__context {
        margin: 0 -8px !important;
        padding: 8px 10px !important;
        gap: 5px 14px !important;
        font-size: 10px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__main {
        min-height: 98px !important;
        padding: 19px 6px 12px !important;
        grid-template-columns: minmax(0, 1fr) 44px 82px 44px minmax(0, 1fr) !important;
        column-gap: 5px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team,
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team strong {
        font-size: 12px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest {
        width: 42px !important;
        height: 48px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest img {
        width: 40px !important;
        height: 46px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > b {
        font-size: 31px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__score > span {
        font-size: 10px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support {
        min-height: 40px !important;
        padding: 8px 8px !important;
        grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr) !important;
        gap: 6px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-center {
        width: 34px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col strong,
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__support-col strong span,
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__player-link {
        font-size: 10.5px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__details--last {
        padding-inline: 8px !important;
        gap: 7px 12px !important;
    }
}

@media (max-width: 460px) {
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__main {
        grid-template-columns: minmax(0, 1fr) 38px 72px 38px minmax(0, 1fr) !important;
        column-gap: 3px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team,
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__team strong {
        font-size: 11px !important;
    }

    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest,
    html body.site-body main.football-page .article-match-scoreboard--match-page[data-kisure-match-scorecard-version="923"] .article-match-scoreboard__crest img {
        width: 36px !important;
        height: 42px !important;
    }
}
