/*
 * Match Experience V3
 * Integrated home-vs-away stage and high-visibility live actions.
 */

:root {
    --mx3-ink: #151a31;
    --mx3-muted: #697086;
    --mx3-navy: #171d3f;
    --mx3-blue: #3249a5;
    --mx3-coral: #ff5d4a;
    --mx3-line: #e5e8f1;
}

/* --------------------------------------------------------------------------
 * Homepage schedule: every row has a real first-source live button.
 * ----------------------------------------------------------------------- */

body.sb-template-home .fl-match-row {
    grid-template-columns: minmax(0, 1fr) 112px !important;
    align-items: center;
    padding: 0 !important;
    overflow: hidden;
}

body.sb-template-home .fl-match-data {
    min-width: 0;
}

body.sb-template-home .fl-match-action {
    position: static !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    justify-self: center;
    gap: 6px;
    width: 92px !important;
    min-width: 92px !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    border-radius: 11px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ff6a49, #f33f64) !important;
    box-shadow: 0 7px 16px rgba(240, 63, 92, .2) !important;
    font-size: 12px;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
    transform: none !important;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

body.sb-template-home .fl-match-action::before,
body.sb-template-home .fl-match-action::after {
    display: none !important;
}

body.sb-template-home .fl-match-action i {
    display: inline-flex !important;
    color: #fff !important;
    font-size: 12px;
}

body.sb-template-home .fl-match-action span,
body.sb-template-home .fl-match-action .x-mask-txt {
    position: static !important;
    display: inline !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    color: #fff !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
}

body.sb-template-home .fl-match-action:hover {
    color: #fff !important;
    filter: saturate(1.08);
    box-shadow: 0 10px 22px rgba(240, 63, 92, .28) !important;
    transform: translateY(-1px) !important;
}

/* --------------------------------------------------------------------------
 * Match header: one unified matchup stage.
 * ----------------------------------------------------------------------- */

body.sb-template-match .sp-match-hero {
    padding: 20px 0 28px !important;
    background:
        radial-gradient(circle at 14% 18%, rgba(71, 95, 191, .12), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(255, 93, 74, .1), transparent 28%),
        #f4f6fb !important;
}

body.sb-template-match .sp-match-hero::before {
    opacity: .3 !important;
    background-image:
        linear-gradient(rgba(44, 62, 139, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(44, 62, 139, .045) 1px, transparent 1px) !important;
    background-size: 52px 52px !important;
}

body.sb-template-match .sp-match-crumb {
    display: flex;
    align-items: center;
    width: max-content;
    max-width: 100%;
    margin: 0 0 12px !important;
    padding: 7px 12px;
    overflow: hidden;
    border: 1px solid #e1e5ef;
    border-radius: 999px;
    color: #6f778c !important;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 6px 16px rgba(25, 36, 83, .05);
}

body.sb-template-match .sp-match-crumb > * {
    color: inherit !important;
}

body.sb-template-match .sp-match-crumb > * + *::before {
    content: "•";
    margin: 0 8px;
    color: #a9afbf;
}

body.sb-template-match .sp-scoreboard {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(270px, .82fr) minmax(0, 1fr) !important;
    gap: 0 !important;
    min-height: 292px;
    overflow: hidden !important;
    border: 1px solid rgba(255, 255, 255, .14) !important;
    border-radius: 24px !important;
    background:
        radial-gradient(circle at 12% 20%, rgba(73, 108, 224, .42), transparent 28%),
        radial-gradient(circle at 88% 20%, rgba(255, 93, 74, .24), transparent 27%),
        linear-gradient(130deg, #121831 0%, #1d2758 52%, #151a36 100%) !important;
    box-shadow: 0 24px 52px rgba(20, 29, 70, .2) !important;
}

body.sb-template-match .sp-scoreboard::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent 49.9%, rgba(255, 255, 255, .07) 50%, transparent 50.1%),
        radial-gradient(ellipse at 50% 112%, transparent 0 31%, rgba(255, 255, 255, .055) 31.3% 31.8%, transparent 32.1%);
    pointer-events: none;
}

body.sb-template-match .sp-scoreboard::after {
    content: "";
    position: absolute;
    top: -90px;
    left: 50%;
    width: 480px;
    height: 260px;
    border-radius: 50%;
    background: rgba(88, 111, 222, .14);
    filter: blur(54px);
    transform: translateX(-50%);
    pointer-events: none;
}

body.sb-template-match .sp-team-panel,
body.sb-template-match .sp-score-core {
    z-index: 1;
    min-height: 292px !important;
    border: 0 !important;
    border-radius: 0 !important;
    color: #fff !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.sb-template-match .sp-team-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 34px 24px 26px !important;
    text-align: center;
}

body.sb-template-match .sp-team-panel:first-child {
    border-right: 1px solid rgba(255, 255, 255, .08) !important;
}

body.sb-template-match .sp-team-panel:last-child {
    border-left: 1px solid rgba(255, 255, 255, .08) !important;
}

body.sb-template-match .sp-team-panel::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(#6d5cf2, #4569d8);
}

body.sb-template-match .sp-team-panel:last-child::after {
    right: auto;
    left: 0;
    background: linear-gradient(#ff765f, #f23f68);
}

body.sb-template-match .sp-team-role {
    position: absolute;
    top: 18px;
    padding: 5px 9px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    color: rgba(255, 255, 255, .72);
    background: rgba(255, 255, 255, .07);
    font-size: 10px;
    font-weight: 800;
}

body.sb-template-match .sp-team-link {
    flex-direction: column;
    justify-content: center !important;
    gap: 13px !important;
    width: 100%;
}

body.sb-template-match .sp-team-logo {
    position: static !important;
    width: 82px !important;
    height: 82px !important;
    padding: 13px !important;
    border: 1px solid rgba(255, 255, 255, .5) !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: 0 14px 30px rgba(2, 7, 28, .32) !important;
    transform: none !important;
}

body.sb-template-match .sp-team-link strong {
    max-width: 100%;
    color: #fff !important;
    font-size: clamp(20px, 2vw, 27px) !important;
    line-height: 1.25;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .25) !important;
}

body.sb-template-match .sp-team-panel p {
    margin: 10px 0 0 !important;
    color: rgba(255, 255, 255, .62) !important;
    font-size: 12px;
}

body.sb-template-match .sp-score-core {
    order: 0 !important;
    grid-column: auto !important;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px 20px !important;
}

body.sb-template-match .sp-score-core::after {
    display: none !important;
}

body.sb-template-match .sp-score-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
}

body.sb-template-match .sp-match-stage {
    color: rgba(255, 255, 255, .48);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .18em;
}

body.sb-template-match .sp-match-league,
body.sb-template-match .sp-score-core .sp-match-league {
    margin: 0 !important;
    padding: 5px 10px !important;
    border: 1px solid rgba(255, 255, 255, .2) !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .09) !important;
    font-size: 11px !important;
}

body.sb-template-match .sp-score-core h1 {
    max-width: 300px;
    margin: 13px 0 0 !important;
    padding: 0 !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    text-align: center;
    text-shadow: none !important;
}

body.sb-template-match .sp-score-row {
    margin: 13px 0 10px !important;
}

body.sb-template-match .sp-score-row.is-pending span,
body.sb-template-match .sp-score-row span,
body.sb-template-match .sp-score-row b {
    display: grid;
    place-items: center;
    width: 70px;
    height: 70px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
    color: #fff !important;
    background:
        radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .2), transparent 30%),
        linear-gradient(145deg, #ff755f, #ef405f) !important;
    box-shadow: 0 12px 26px rgba(239, 64, 95, .3);
    font-size: 23px !important;
    font-weight: 900;
    line-height: 1 !important;
    text-shadow: none !important;
}

body.sb-template-match .sp-score-row:not(.is-pending) {
    display: flex;
    gap: 8px;
}

body.sb-template-match .sp-score-row:not(.is-pending) span {
    width: auto;
    border: 0;
    background: transparent !important;
    box-shadow: none;
}

body.sb-template-match .sp-status-line {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px !important;
    color: rgba(255, 255, 255, .66) !important;
}

body.sb-template-match .sp-status-line time {
    color: rgba(255, 255, 255, .7) !important;
    font-size: 11px;
}

body.sb-template-match .sp-status-pill,
body.sb-template-match .sp-status-pill.is-next {
    padding: 5px 9px !important;
    border: 1px solid rgba(255, 255, 255, .15) !important;
    border-radius: 999px !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .09) !important;
    font-size: 10px !important;
}

body.sb-template-match .sp-hero-actions {
    margin: 13px 0 0 !important;
}

body.sb-template-match .sp-hero-actions a.jzt-live-btn {
    min-width: 138px;
    min-height: 40px;
    border: 0 !important;
    border-radius: 12px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #ff704f, #f23f65) !important;
    box-shadow: 0 10px 24px rgba(239, 64, 95, .28) !important;
}

body.sb-template-match .sp-hero-actions a.jzt-live-btn:hover {
    color: #fff !important;
    filter: brightness(1.06);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
 * Live sources: strong launch cards with clear calls to action.
 * ----------------------------------------------------------------------- */

body.sb-template-match .sp-match-layout {
    margin-top: 18px !important;
}

body.sb-template-match .sp-live-card {
    overflow: hidden;
    border: 1px solid #e1e5ef !important;
    border-radius: 20px !important;
    background: #fff !important;
    box-shadow: 0 14px 34px rgba(27, 38, 83, .08) !important;
}

body.sb-template-match .sp-live-card .sp-section-head {
    min-height: 62px;
    padding: 14px 20px !important;
    border-bottom: 1px solid #e6e9f1 !important;
    background: linear-gradient(90deg, #f3f5fb, #fff 76%) !important;
}

body.sb-template-match .sp-live-card .sp-section-head h2 {
    color: var(--mx3-ink) !important;
}

body.sb-template-match .sp-live-card .sp-section-head h2::before {
    background: #344ca8 !important;
}

body.sb-template-match .sp-live-card .sp-section-head > span {
    padding: 5px 9px;
    border-radius: 999px;
    color: #344ca8 !important;
    background: #eaf0ff;
}

body.sb-template-match .sp-live-body {
    padding: 18px 20px 20px !important;
}

body.sb-template-match .sp-live-intro {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 12px;
    margin: 0 0 15px;
}

body.sb-template-match .sp-live-kicker {
    padding: 7px 9px;
    border-radius: 8px;
    color: #3349a2;
    background: #eaf0ff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .11em;
}

body.sb-template-match .sp-live-intro p {
    margin: 0 !important;
    color: var(--mx3-muted) !important;
    line-height: 1.65;
}

body.sb-template-match .sp-live-lines {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn {
    position: relative;
    box-sizing: border-box;
    display: flex !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    min-width: 0;
    min-height: 72px !important;
    padding: 12px 102px 12px 14px !important;
    overflow: hidden;
    border: 0 !important;
    border-radius: 16px !important;
    color: #fff !important;
    background: linear-gradient(135deg, #5b49dc, #8368f4) !important;
    box-shadow: 0 12px 24px rgba(91, 73, 220, .2) !important;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn:nth-child(2) {
    background: linear-gradient(135deg, #ff6e4d, #f23f68) !important;
    box-shadow: 0 12px 24px rgba(242, 63, 104, .2) !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn:nth-child(3) {
    background: linear-gradient(135deg, #029db7, #08c2ad) !important;
    box-shadow: 0 12px 24px rgba(2, 157, 183, .2) !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn:nth-child(4) {
    color: #4d3300 !important;
    background: linear-gradient(135deg, #f4a821, #ffd24c) !important;
    box-shadow: 0 12px 24px rgba(244, 168, 33, .23) !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn i {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px !important;
    width: 42px !important;
    height: 42px !important;
    border: 1px solid rgba(255, 255, 255, .22) !important;
    border-radius: 13px !important;
    color: #fff !important;
    background: rgba(255, 255, 255, .16) !important;
    font-size: 18px !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn i::before {
    content: "▶" !important;
    font-family: inherit !important;
    font-size: 13px !important;
    font-style: normal;
    line-height: 1;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn:nth-child(4) i {
    border-color: rgba(77, 51, 0, .12) !important;
    color: #4d3300 !important;
    background: rgba(255, 255, 255, .35) !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn .x-mask-txt {
    min-width: 0;
    overflow: hidden;
    color: inherit !important;
    font-size: 14px;
    font-weight: 900 !important;
    text-overflow: ellipsis;
    text-shadow: none !important;
    white-space: nowrap;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn::before {
    display: none !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn::after {
    content: "立即观看" !important;
    position: absolute;
    top: 50%;
    right: 14px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    height: 30px !important;
    padding: 0 11px !important;
    border: 1px solid rgba(255, 255, 255, .2) !important;
    border-radius: 999px !important;
    color: inherit !important;
    background: rgba(255, 255, 255, .16) !important;
    font-size: 10px !important;
    font-weight: 900;
    line-height: 1;
    transform: translateY(-50%) !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn:nth-child(4)::after {
    border-color: rgba(77, 51, 0, .1) !important;
    background: rgba(255, 255, 255, .35) !important;
}

body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn:hover {
    filter: saturate(1.1) brightness(1.04);
    transform: translateY(-3px);
}

body.sb-template-match .sp-smart-sidebar-wrap > section,
body.sb-template-match .sp-smart-sidebar-wrap .sp-sidebar-card {
    border-color: #e1e5ef !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 28px rgba(27, 38, 83, .065) !important;
}

body.sb-template-match .sp-smart-sidebar-wrap h2::before {
    background: var(--mx3-coral) !important;
}

@media (max-width: 1023px) {
    body.sb-template-match .sp-scoreboard {
        grid-template-columns: minmax(0, 1fr) minmax(220px, .76fr) minmax(0, 1fr) !important;
    }

    body.sb-template-match .sp-team-panel {
        padding-right: 15px !important;
        padding-left: 15px !important;
    }
}

@media (max-width: 767px) {
    body.sb-template-home .fl-match-row {
        grid-template-columns: minmax(0, 1fr) !important;
        padding: 0 0 8px !important;
    }

    body.sb-template-home .fl-match-action {
        justify-self: stretch;
        width: auto !important;
        min-width: 0 !important;
        height: 34px !important;
        min-height: 34px !important;
        margin: 0 8px !important;
        border-radius: 10px !important;
    }

    body.sb-template-match .sp-match-hero {
        padding: 12px 0 18px !important;
    }

    body.sb-template-match .sp-match-crumb {
        width: 100%;
        margin-bottom: 9px !important;
        padding: 6px 9px;
        overflow-x: auto;
        border-radius: 10px;
        font-size: 10px;
        white-space: nowrap;
        scrollbar-width: none;
    }

    body.sb-template-match .sp-scoreboard {
        grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr) !important;
        min-height: 232px;
        border-radius: 17px !important;
    }

    body.sb-template-match .sp-team-panel,
    body.sb-template-match .sp-score-core {
        min-height: 232px !important;
    }

    body.sb-template-match .sp-team-panel {
        padding: 34px 5px 14px !important;
    }

    body.sb-template-match .sp-team-role {
        top: 10px;
        padding: 3px 6px;
        font-size: 8px;
    }

    body.sb-template-match .sp-team-link {
        gap: 8px !important;
    }

    body.sb-template-match .sp-team-logo {
        width: 48px !important;
        height: 48px !important;
        padding: 8px !important;
    }

    body.sb-template-match .sp-team-link strong {
        max-width: 100%;
        overflow: hidden;
        font-size: 13px !important;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.sb-template-match .sp-team-panel p {
        display: none;
    }

    body.sb-template-match .sp-score-core {
        padding: 17px 5px !important;
    }

    body.sb-template-match .sp-match-stage {
        display: none;
    }

    body.sb-template-match .sp-match-league,
    body.sb-template-match .sp-score-core .sp-match-league {
        padding: 4px 7px !important;
        font-size: 9px !important;
    }

    body.sb-template-match .sp-score-core h1 {
        display: none;
    }

    body.sb-template-match .sp-score-row {
        margin: 10px 0 8px !important;
    }

    body.sb-template-match .sp-score-row.is-pending span,
    body.sb-template-match .sp-score-row span,
    body.sb-template-match .sp-score-row b {
        width: 48px;
        height: 48px;
        font-size: 16px !important;
    }

    body.sb-template-match .sp-status-line {
        flex-direction: column;
        gap: 3px !important;
    }

    body.sb-template-match .sp-status-pill,
    body.sb-template-match .sp-status-pill.is-next {
        padding: 3px 6px !important;
        font-size: 8px !important;
    }

    body.sb-template-match .sp-status-line time {
        font-size: 8px;
    }

    body.sb-template-match .sp-hero-actions {
        margin-top: 8px !important;
    }

    body.sb-template-match .sp-hero-actions a.jzt-live-btn {
        min-width: 94px;
        min-height: 34px;
        padding: 0 8px !important;
        font-size: 10px;
    }

    body.sb-template-match .sp-live-card {
        border-radius: 15px !important;
    }

    body.sb-template-match .sp-live-card .sp-section-head {
        min-height: 54px;
        padding: 11px 13px !important;
    }

    body.sb-template-match .sp-live-card .sp-section-head h2 {
        font-size: 15px !important;
    }

    body.sb-template-match .sp-live-body {
        padding: 13px !important;
    }

    body.sb-template-match .sp-live-intro {
        display: block;
        margin-bottom: 12px;
    }

    body.sb-template-match .sp-live-kicker {
        display: inline-flex;
        margin-bottom: 7px;
    }

    body.sb-template-match .sp-live-intro p {
        font-size: 12px;
    }

    body.sb-template-match .sp-live-lines {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 9px !important;
    }

    body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 60px !important;
        margin: 0 !important;
        padding: 9px 94px 9px 10px !important;
        border-radius: 13px !important;
    }

    body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn i {
        flex-basis: 38px !important;
        width: 38px !important;
        height: 38px !important;
        border-radius: 11px !important;
    }

    body.sb-template-match.sb-redesign .sp-match-page .sp-live-lines a.jzt-live-btn::after {
        right: 10px;
        height: 27px !important;
        padding: 0 9px !important;
        font-size: 9px !important;
    }
}

@media (max-width: 360px) {
    body.sb-template-match .sp-scoreboard {
        grid-template-columns: minmax(0, 1fr) 102px minmax(0, 1fr) !important;
    }

    body.sb-template-match .sp-team-logo {
        width: 44px !important;
        height: 44px !important;
    }

    body.sb-template-match .sp-team-link strong {
        font-size: 12px !important;
    }

    body.sb-template-match .sp-hero-actions a.jzt-live-btn {
        min-width: 88px;
        font-size: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.sb-template-home .fl-match-action,
    body.sb-template-match .sp-hero-actions a.jzt-live-btn,
    body.sb-template-match .sp-live-lines a.jzt-live-btn {
        transition: none !important;
    }
}
