/* =====================================================
   Страница матчей ФК «Металлург»
   ===================================================== */

.matches-layout {
    width: min(100% - 36px, 1180px);
}

.matches-page,
.match-detail {
    --matches-red: #c61020;
    --matches-red-dark: #7f0712;
    --matches-gold: #f6c542;
    --matches-ink: #171717;
    --matches-muted: #717177;
    --matches-line: #e7e7e9;
    --matches-surface: #fff;
}

.matches-hero {
    position: relative;
    isolation: isolate;
    min-height: 430px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, .65fr);
    overflow: hidden;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(circle at 78% 24%, rgba(246, 197, 66, .19), transparent 24%),
        linear-gradient(128deg, #7d0712 0%, #ae0a19 44%, #d20f22 100%);
    box-shadow: 0 24px 70px rgba(113, 5, 17, .22);
}

.matches-hero::before,
.matches-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 50%;
}

.matches-hero::before {
    width: 430px;
    height: 430px;
    right: -105px;
    top: -170px;
}

.matches-hero::after {
    width: 620px;
    height: 620px;
    right: -260px;
    bottom: -430px;
}

.matches-hero__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(42px, 6vw, 74px);
}

.matches-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, .62);
    font-size: 12px;
    font-weight: 750;
}

.matches-breadcrumbs a:hover { color: var(--matches-gold); }

.matches-kicker,
.matches-section-label {
    display: block;
    color: var(--matches-gold);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.matches-hero h1 {
    max-width: 720px;
    margin: 13px 0 18px;
    font-size: clamp(46px, 7vw, 84px);
    line-height: .92;
    letter-spacing: -.055em;
}

.matches-hero h1 span {
    display: block;
    margin-top: 10px;
    color: var(--matches-gold);
    font-size: .48em;
    letter-spacing: -.03em;
}

.matches-hero__content > p {
    max-width: 590px;
    margin: 0;
    color: rgba(255, 255, 255, .74);
    font-size: 17px;
}

.matches-hero__stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 650px;
    margin-top: 40px;
}

.matches-hero__stats div {
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 15px;
    background: rgba(0, 0, 0, .12);
    backdrop-filter: blur(10px);
}

.matches-hero__stats strong {
    display: block;
    color: #fff;
    font-size: 25px;
    line-height: 1;
}

.matches-hero__stats span {
    display: block;
    margin-top: 6px;
    color: rgba(255, 255, 255, .57);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.matches-hero__visual {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 38px;
}

.matches-hero__visual > img {
    width: min(270px, 75%);
    max-height: 260px;
    object-fit: contain;
    filter: drop-shadow(0 24px 28px rgba(0, 0, 0, .24));
}

.matches-next {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 25px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 16px;
    background: rgba(22, 0, 4, .28);
    backdrop-filter: blur(14px);
}

.matches-next span {
    display: block;
    color: var(--matches-gold);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.matches-next strong {
    display: block;
    margin-top: 5px;
    font-size: 15px;
}

.matches-next small {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, .58);
    font-size: 12px;
}

.matches-roster {
    padding: 52px 0 8px;
}

.matches-roster__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 24px;
}

.matches-roster__head h2 {
    margin: 7px 0 0;
    font-size: clamp(29px, 4vw, 46px);
    line-height: 1;
    letter-spacing: -.04em;
}

.matches-roster__head p {
    max-width: 380px;
    margin: 0;
    color: var(--matches-muted);
    font-size: 14px;
    text-align: right;
}

.matches-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 24px;
}

.matches-filter {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--matches-line);
    border-radius: 999px;
    color: #3c3c40;
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 850;
    transition: .2s ease;
}

.matches-filter span {
    display: inline-grid;
    min-width: 23px;
    height: 23px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    color: #6e6e73;
    background: #f0f0f2;
    font-size: 11px;
}

.matches-filter:hover {
    border-color: #d3a81f;
    transform: translateY(-1px);
}

.matches-filter.is-active {
    border-color: var(--matches-red);
    color: #fff;
    background: var(--matches-red);
    box-shadow: 0 9px 23px rgba(198, 16, 32, .19);
}

.matches-filter.is-active span {
    color: var(--matches-red-dark);
    background: var(--matches-gold);
}

.matches-list {
    display: grid;
    gap: 15px;
}

/* DLE/браузер: display из классов не должен отменять атрибут hidden */
.matches-list[hidden],
.matches-empty[hidden],
.fixture-card[hidden],
.fixture-card.is-filtered-out {
    display: none !important;
}

.fixture-card {
    --status-color: #16734a;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--matches-line);
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(24, 24, 28, .055);
    animation: fixture-enter .42s both;
    animation-delay: calc(var(--match-index, 0) * 35ms);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.fixture-card:hover {
    transform: translateY(-3px);
    border-color: rgba(198, 16, 32, .25);
    box-shadow: 0 19px 48px rgba(24, 24, 28, .095);
}

.fixture-card.is-next {
    border-color: rgba(246, 197, 66, .75);
    box-shadow: 0 18px 48px rgba(159, 112, 0, .13);
}

.fixture-card.is-next::after {
    content: "Ближайший матч";
    position: absolute;
    top: 0;
    right: 22px;
    padding: 5px 10px 6px;
    border-radius: 0 0 9px 9px;
    color: #4a3500;
    background: var(--matches-gold);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.fixture-card { position: relative; }
.fixture-card.is-finished { --status-color: #5e6169; }
.fixture-card.is-postponed { --status-color: #b77700; }
.fixture-card.is-cancelled { --status-color: #9b2630; }

.fixture-card__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 190px;
    padding: 20px 10px;
    color: #fff;
    background:
        linear-gradient(155deg, rgba(255,255,255,.07), transparent 50%),
        linear-gradient(145deg, var(--matches-red-dark), var(--matches-red));
    text-align: center;
}

.fixture-card__date strong {
    font-size: 42px;
    line-height: .9;
    letter-spacing: -.05em;
}

.fixture-card__date span {
    margin-top: 9px;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.fixture-card__date small {
    margin-top: 5px;
    color: rgba(255, 255, 255, .58);
    font-size: 11px;
    text-transform: capitalize;
}

.fixture-card__main {
    min-width: 0;
    padding: 19px 22px 16px;
}

.fixture-card__topline,
.fixture-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.fixture-card__competition {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: var(--matches-muted);
    font-size: 11px;
}

.fixture-card__competition strong {
    overflow: hidden;
    color: #343438;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixture-card__competition span::before {
    content: "•";
    margin-right: 9px;
    color: #c9c9cc;
}

.fixture-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--status-color);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.fixture-status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 13%, transparent);
}

.fixture-card__teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    margin: 20px 0 17px;
}

.fixture-team {
    min-width: 0;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    column-gap: 13px;
}

.fixture-team--opponent {
    grid-template-columns: minmax(0, 1fr) 54px;
    text-align: right;
}

.fixture-team--opponent .fixture-team__logo {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.fixture-team--opponent strong,
.fixture-team--opponent small {
    grid-column: 1;
}

.fixture-team__logo,
.match-detail__logo {
    position: relative;
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    overflow: hidden;
    border: 1px solid #e2e2e5;
    border-radius: 50%;
    background: #f5f5f6;
}

.fixture-team__logo img,
.match-detail__logo img {
    position: relative;
    z-index: 2;
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.fixture-team__logo--opponent img,
.match-detail__logo--opponent img {
    position: absolute;
    inset: 8%;
    width: 84%;
    height: 84%;
}

.fixture-team__initial {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: grid;
    place-items: center;
    color: #7d7d82;
    font-size: 20px;
    font-weight: 950;
}

.fixture-team strong {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixture-team small {
    color: var(--matches-muted);
    font-size: 11px;
}

.fixture-card__result {
    text-align: center;
}

.fixture-card__result strong {
    display: block;
    font-size: 29px;
    line-height: 1;
    letter-spacing: -.04em;
}

.fixture-card__result span {
    display: block;
    margin-top: 6px;
    color: var(--matches-muted);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.fixture-card__bottom {
    padding-top: 13px;
    border-top: 1px solid #eeeeef;
}

.fixture-card__place {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
    color: var(--matches-muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fixture-card__place b { color: #d0d0d3; }

.fixture-card__link {
    flex: 0 0 auto;
    color: var(--matches-red);
    font-size: 11px;
    font-weight: 900;
}

.fixture-card__link:hover { color: var(--matches-red-dark); }

.matches-empty {
    min-height: 260px;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 45px;
    border: 1px dashed #d6d6d9;
    border-radius: 22px;
    color: var(--matches-muted);
    background: rgba(255, 255, 255, .6);
    text-align: center;
}

.matches-empty img {
    width: 66px;
    height: 66px;
    object-fit: contain;
    margin-bottom: 15px;
    opacity: .3;
}

.matches-empty strong {
    color: var(--matches-ink);
    font-size: 18px;
}

.matches-empty span {
    max-width: 480px;
    margin-top: 5px;
    font-size: 13px;
}

/* Полная страница матча */

.match-detail {
    --status-color: #16734a;
}

.match-detail.is-finished { --status-color: #5e6169; }
.match-detail.is-postponed { --status-color: #b77700; }
.match-detail.is-cancelled { --status-color: #9b2630; }

.match-detail__breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
    color: #7c7c82;
    font-size: 12px;
    font-weight: 750;
}

.match-detail__breadcrumbs a:hover { color: var(--matches-red); }

.match-detail__hero {
    overflow: hidden;
    padding: clamp(28px, 5vw, 55px);
    border-radius: 28px;
    color: #fff;
    background:
        radial-gradient(circle at 50% 100%, rgba(246, 197, 66, .13), transparent 36%),
        linear-gradient(135deg, #730711, #c60f20 60%, #df1427);
    box-shadow: 0 24px 65px rgba(113, 5, 17, .2);
}

.match-detail__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(255, 255, 255, .64);
    font-size: 12px;
}

.match-detail__meta .fixture-status { color: var(--matches-gold); }
.match-detail__meta strong { color: #fff; }

.match-detail__date {
    margin-top: 24px;
    text-align: center;
}

.match-detail__date strong {
    display: block;
    font-size: 25px;
}

.match-detail__date span {
    display: block;
    margin-top: 4px;
    color: rgba(255, 255, 255, .6);
    font-size: 13px;
}

.match-detail__scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
    align-items: center;
    gap: 30px;
    max-width: 850px;
    margin: 38px auto 30px;
}

.match-detail__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    text-align: center;
}

.match-detail__logo {
    width: 105px;
    height: 105px;
    border-color: rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .94);
}

.match-detail__team strong {
    max-width: 100%;
    margin-top: 15px;
    overflow: hidden;
    font-size: clamp(20px, 3vw, 30px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-detail__team small {
    color: rgba(255, 255, 255, .55);
}

.match-detail__result { text-align: center; }

.match-detail__result strong {
    display: block;
    color: var(--matches-gold);
    font-size: clamp(43px, 7vw, 74px);
    line-height: .9;
    letter-spacing: -.07em;
}

.match-detail__result span {
    display: block;
    margin-top: 11px;
    color: rgba(255, 255, 255, .55);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.match-detail__place {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, .62);
    font-size: 13px;
}

.match-detail__content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 24px;
    margin-top: 24px;
}

.match-detail__article,
.match-detail__aside {
    border: 1px solid var(--matches-line);
    border-radius: 20px;
    background: #fff;
}

.match-detail__article {
    min-height: 220px;
    padding: clamp(24px, 4vw, 42px);
}

.match-detail__aside {
    align-self: start;
    padding: 22px;
}

.match-detail__aside > span {
    display: block;
    margin-bottom: 14px;
    color: var(--matches-red);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.match-detail__aside dl { margin: 0; }

.match-detail__aside dl div {
    padding: 12px 0;
    border-top: 1px solid #ececee;
}

.match-detail__aside dt {
    color: var(--matches-muted);
    font-size: 10px;
    font-weight: 850;
    text-transform: uppercase;
}

.match-detail__aside dd {
    margin: 3px 0 0;
    font-size: 13px;
    font-weight: 750;
}

.match-detail__aside > a {
    display: inline-flex;
    margin-top: 17px;
    color: var(--matches-red);
    font-size: 12px;
    font-weight: 900;
}

@keyframes fixture-enter {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 880px) {
    .matches-hero { grid-template-columns: 1fr; }
    .matches-hero__visual { min-height: 285px; }
    .matches-hero__visual > img { width: 190px; }
    .matches-next { left: 22px; right: 22px; }

    .match-detail__content { grid-template-columns: 1fr; }
    .match-detail__aside { width: 100%; }
}

@media (max-width: 680px) {
    .matches-layout { width: min(100% - 24px, 1180px); }

    .matches-hero {
        min-height: 0;
        border-radius: 22px;
    }

    .matches-hero__content {
        padding: 35px 22px 27px;
        text-align: center;
    }

    .matches-breadcrumbs { justify-content: center; margin-bottom: 23px; }
    .matches-hero__content > p { font-size: 14px; }

    .matches-hero__stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 28px;
    }

    .matches-hero__visual {
        min-height: 265px;
        padding: 20px 20px 90px;
    }

    .matches-roster { padding-top: 38px; }

    .matches-roster__head {
        display: block;
        text-align: center;
    }

    .matches-roster__head p {
        margin: 10px auto 0;
        text-align: center;
    }

    .matches-filters { justify-content: center; }

    .fixture-card {
        grid-template-columns: 1fr;
        border-radius: 18px;
    }

    .fixture-card__date {
        min-height: 0;
        flex-direction: row;
        gap: 8px;
        padding: 13px 16px;
    }

    .fixture-card__date strong { font-size: 25px; }
    .fixture-card__date span { margin: 0; }
    .fixture-card__date small { margin: 0 0 0 auto; }

    .fixture-card__main { padding: 16px; }
    .fixture-card__topline { align-items: flex-start; }

    .fixture-card__teams {
        grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1fr);
        gap: 8px;
        margin: 19px 0 16px;
    }

    .fixture-team,
    .fixture-team--opponent {
        display: flex;
        flex-direction: column;
        gap: 7px;
        text-align: center;
    }

    .fixture-team--opponent .fixture-team__logo,
    .fixture-team--opponent strong,
    .fixture-team--opponent small {
        grid-column: auto;
        grid-row: auto;
    }

    .fixture-team strong {
        width: 100%;
        font-size: 13px;
        white-space: normal;
    }

    .fixture-team small { display: none; }

    .fixture-team__logo {
        width: 48px;
        height: 48px;
    }

    .fixture-card__result strong { font-size: 23px; }
    .fixture-card__result span { font-size: 8px; }

    .fixture-card__bottom { align-items: flex-end; }
    .fixture-card__place { white-space: normal; }

    .match-detail__hero {
        padding: 25px 15px;
        border-radius: 22px;
    }

    .match-detail__scoreboard {
        grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr);
        gap: 9px;
        margin-top: 28px;
    }

    .match-detail__logo {
        width: 70px;
        height: 70px;
    }

    .match-detail__team strong {
        font-size: 15px;
        white-space: normal;
    }

    .match-detail__result strong { font-size: 38px; }
}

/* Хронология матча в стиле спортивных лайвскоров */

.match-detail__article {
    min-height: 0;
}

.match-detail__report:empty {
    display: none;
}

.match-events + .match-detail__report:not(:empty) {
    margin-top: 34px;
    padding-top: 32px;
    border-top: 1px solid #ececee;
}

.match-events__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.match-events__kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--matches-red);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.match-events__header h2 {
    margin: 0;
    color: var(--matches-ink);
    font-size: clamp(22px, 3vw, 30px);
    letter-spacing: -.035em;
}

.match-events__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    color: var(--matches-muted);
    font-size: 11px;
    font-weight: 800;
}

.match-events__legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.match-events__legend i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.match-events__legend i.is-club { background: var(--matches-red); }
.match-events__legend i.is-opponent { background: #24262d; }

.match-events__teams {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    color: #6f7077;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.match-events__teams strong:first-child { text-align: right; }
.match-events__teams strong:last-child { text-align: left; }
.match-events__teams span { text-align: center; font-size: 9px; letter-spacing: .08em; }

.match-events__timeline {
    position: relative;
    display: grid;
    gap: 12px;
    padding: 5px 0;
}

.match-events__timeline::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    border-radius: 2px;
    background: #e7e8eb;
    content: "";
    transform: translateX(-50%);
}

.match-event {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.match-event__slot {
    min-width: 0;
}

.match-event.is-home .match-event__slot--home {
    grid-column: 1;
}

.match-event.is-away .match-event__slot--away {
    grid-column: 3;
}

.match-event__minute {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    min-height: 32px;
    margin: auto;
    padding: 4px 7px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #3e4047;
    background: #f0f1f3;
    box-shadow: 0 0 0 1px #e1e2e5;
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}

.match-event.is-goal .match-event__minute,
.match-event.is-penalty-goal .match-event__minute,
.match-event.is-own-goal .match-event__minute {
    color: #fff;
    background: var(--matches-red);
    box-shadow: 0 0 0 1px rgba(183, 12, 29, .25);
}

.match-event__card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid #e7e8eb;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(24, 25, 30, .055);
}

.match-event.is-home .match-event__card {
    flex-direction: row-reverse;
    text-align: right;
}

.match-event.is-home .match-event__card::after,
.match-event.is-away .match-event__card::before {
    position: absolute;
    top: 50%;
    width: 10px;
    height: 10px;
    border-top: 1px solid #e7e8eb;
    border-right: 1px solid #e7e8eb;
    background: #fff;
    content: "";
}

.match-event.is-home .match-event__card::after {
    right: -6px;
    transform: translateY(-50%) rotate(45deg);
}

.match-event.is-away .match-event__card::before {
    left: -6px;
    transform: translateY(-50%) rotate(-135deg);
}

.match-event__icon {
    position: relative;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: #24262d;
    font-size: 17px;
    line-height: 1;
}

.match-event.is-goal .match-event__icon,
.match-event.is-penalty-goal .match-event__icon,
.match-event.is-own-goal .match-event__icon {
    color: #17181c;
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px #dedfe3;
}

.match-event.is-yellow .match-event__icon,
.match-event.is-red .match-event__icon,
.match-event.is-second-yellow .match-event__icon {
    background: #f3f4f6;
    box-shadow: inset 0 0 0 1px #dedfe3;
}

.match-event__card-shape {
    display: block;
    width: 12px;
    height: 18px;
    border-radius: 2px;
    background: #f3c522;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .16);
}

.match-event.is-red .match-event__card-shape { background: #d7192d; }

.match-event.is-second-yellow .match-event__card-shape::before {
    position: absolute;
    width: 12px;
    height: 18px;
    margin: -4px 0 0 -4px;
    border-radius: 2px;
    background: #d7192d;
    content: "";
}

.match-event__text {
    min-width: 0;
    flex: 1 1 auto;
}

.match-event__text strong {
    display: block;
    overflow: hidden;
    color: #17181c;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-event__text span {
    display: block;
    margin-top: 3px;
    color: #85868d;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.match-event__score {
    flex: 0 0 auto;
    min-width: 41px;
    padding: 5px 7px;
    border-radius: 8px;
    color: #fff;
    background: var(--matches-red);
    font-size: 12px;
    font-weight: 950;
    text-align: center;
}

.match-events__empty {
    position: relative;
    z-index: 1;
    padding: 25px;
    border: 1px dashed #d9dade;
    border-radius: 14px;
    color: #7e7f86;
    background: #fafafb;
    font-size: 13px;
    font-weight: 750;
    text-align: center;
}

@media (max-width: 680px) {
    .match-events__header {
        display: block;
    }

    .match-events__legend {
        justify-content: flex-start;
        margin-top: 12px;
    }

    .match-events__teams {
        display: none;
    }

    .match-events__timeline {
        gap: 10px;
        padding-left: 42px;
    }

    .match-events__timeline::before {
        left: 17px;
        transform: none;
    }

    .match-event {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
    }

    .match-event__minute {
        position: absolute;
        top: 50%;
        left: -42px;
        grid-column: auto;
        width: 35px;
        min-height: 28px;
        padding: 3px 4px;
        font-size: 9px;
        transform: translateY(-50%);
    }

    .match-event.is-home .match-event__slot--home,
    .match-event.is-away .match-event__slot--away {
        grid-column: 1;
    }

    .match-event.is-home .match-event__card {
        flex-direction: row;
        text-align: left;
    }

    .match-event.is-home .match-event__card::after {
        display: none;
    }

    .match-event.is-away .match-event__card::before,
    .match-event.is-home .match-event__card::before {
        position: absolute;
        top: 50%;
        left: -6px;
        display: block;
        width: 10px;
        height: 10px;
        border-top: 1px solid #e7e8eb;
        border-right: 1px solid #e7e8eb;
        background: #fff;
        content: "";
        transform: translateY(-50%) rotate(-135deg);
    }

    .match-event__text strong {
        white-space: normal;
    }
}

/* =====================================================
   Улучшенная мобильная хронология матча
   ===================================================== */
@media (max-width: 560px) {
    .matches-layout {
        width: calc(100% - 12px);
    }

    .match-detail__content {
        gap: 14px;
        margin-top: 14px;
    }

    .match-detail__article {
        width: 100%;
        padding: 20px 14px;
        border-radius: 18px;
        overflow: hidden;
    }

    .match-events__header {
        margin-bottom: 18px;
    }

    .match-events__header h2 {
        font-size: 22px;
        line-height: 1.08;
    }

    .match-events__legend {
        gap: 10px;
        margin-top: 10px;
        font-size: 10px;
    }

    .match-events__timeline {
        gap: 8px;
        padding: 3px 0 3px 36px;
    }

    .match-events__timeline::before {
        left: 14px;
    }

    .match-event__minute {
        left: -36px;
        width: 31px;
        min-height: 26px;
        padding: 2px 3px;
        border-width: 1px;
        font-size: 8.5px;
    }

    .match-event__card {
        gap: 9px;
        min-height: 54px;
        padding: 9px 9px;
        border-radius: 12px;
        box-shadow: 0 5px 16px rgba(24, 25, 30, .05);
    }

    .match-event.is-home .match-event__card {
        border-left: 3px solid var(--matches-red);
    }

    .match-event.is-away .match-event__card {
        border-left: 3px solid #24262d;
    }

    .match-event__icon {
        width: 30px;
        height: 30px;
        font-size: 15px;
    }

    .match-event__card-shape,
    .match-event.is-second-yellow .match-event__card-shape::before {
        width: 10px;
        height: 16px;
    }

    .match-event__text strong {
        font-size: 12.5px;
        line-height: 1.22;
    }

    .match-event__text span {
        margin-top: 2px;
        font-size: 9.5px;
    }

    .match-event__score {
        min-width: 38px;
        padding: 5px 6px;
        border-radius: 7px;
        font-size: 11px;
    }

    .match-events + .match-detail__report:not(:empty) {
        margin-top: 24px;
        padding-top: 22px;
    }

    .match-detail__aside {
        padding: 18px;
        border-radius: 18px;
    }
}

@media (max-width: 390px) {
    .match-detail__article {
        padding: 18px 11px;
    }

    .match-events__timeline {
        padding-left: 34px;
    }

    .match-event__minute {
        left: -34px;
        width: 29px;
    }

    .match-event__card {
        gap: 7px;
        padding: 8px;
    }

    .match-event__icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .match-event__text strong {
        font-size: 12px;
    }

    .match-event__score {
        min-width: 35px;
        padding: 4px 5px;
        font-size: 10px;
    }
}

/* =====================================================
   Разделение хронологии на первый и второй тайм
   ===================================================== */

.match-events__half {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.match-events__half + .match-events__half {
    margin-top: 12px;
}

.match-events__half-heading {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 42px;
    margin: 2px 0 14px;
    padding: 8px 11px 8px 14px;
    border: 1px solid #e4e5e8;
    border-radius: 12px;
    color: #27282d;
    background: #f6f6f8;
    box-shadow: 0 5px 16px rgba(24, 25, 30, .035);
}

.match-events__half-heading strong {
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.match-events__half-heading span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    color: #fff;
    background: #24262d;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.match-events__half.is-first .match-events__half-heading {
    border-color: rgba(198, 16, 32, .18);
    background: rgba(198, 16, 32, .045);
}

.match-events__half.is-first .match-events__half-heading span {
    background: var(--matches-red);
}

.match-events__half-list {
    display: grid;
    gap: 12px;
}

@media (max-width: 680px) {
    .match-events__half + .match-events__half {
        margin-top: 15px;
    }

    .match-events__half-heading {
        min-height: 38px;
        margin: 0 0 10px -36px;
        padding: 7px 9px 7px 11px;
        border-radius: 10px;
    }

    .match-events__half-heading strong {
        font-size: 10px;
    }

    .match-events__half-heading span {
        min-height: 24px;
        padding: 3px 8px;
        font-size: 9px;
    }

    .match-events__half-list {
        gap: 10px;
    }
}

@media (max-width: 560px) {
    .match-events__half-heading {
        margin-left: -30px;
    }

    .match-events__half-list {
        gap: 8px;
    }
}

@media (max-width: 390px) {
    .match-events__half-heading {
        margin-left: -28px;
    }
}

/* =====================================================
   Дополнительные события: замены, травмы и пенальти
   ===================================================== */

.match-event.is-substitution .match-event__minute {
    color: #147a3f;
    background: #eaf8f0;
    box-shadow: 0 0 0 1px #bfe7cf;
}

.match-event.is-injury .match-event__minute {
    color: #b20f20;
    background: #fff0f2;
    box-shadow: 0 0 0 1px #f0c3ca;
}

.match-event.is-missed-penalty .match-event__minute {
    color: #9a4d00;
    background: #fff5e6;
    box-shadow: 0 0 0 1px #f0d1a3;
}

.match-event.is-substitution .match-event__card {
    border-color: #d9ece1;
    background: #fbfefc;
}

.match-event.is-injury .match-event__card {
    border-color: #f0d5da;
    background: #fffafb;
}

.match-event.is-missed-penalty .match-event__card {
    border-color: #eedbbb;
    background: #fffdf8;
}

.match-event.is-substitution .match-event__icon {
    color: #fff;
    background: #16854a;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}

.match-event.is-injury .match-event__icon {
    color: #fff;
    background: #d7192d;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
    font-size: 18px;
    font-weight: 950;
}

.match-event.is-missed-penalty .match-event__icon {
    color: #17181c;
    background: #fff7e9;
    box-shadow: inset 0 0 0 1px #e8d4b1;
}

.match-event__sub-arrows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 1px;
    font-size: 14px;
    font-weight: 950;
    line-height: 1;
}

.match-event__sub-arrows i {
    font-style: normal;
}

.match-event__sub-arrows i:first-child {
    color: #bff5d2;
}

.match-event__sub-arrows i:last-child {
    color: #ffd0d5;
}

.match-event__penalty-badge {
    position: absolute;
    right: -3px;
    bottom: -3px;
    display: grid;
    place-items: center;
    min-width: 15px;
    height: 15px;
    padding: 0 3px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: var(--matches-red);
    font-size: 7px;
    font-style: normal;
    font-weight: 950;
    line-height: 1;
}

.match-event__penalty-badge.is-missed {
    background: #d98200;
    font-size: 11px;
}

.match-event__penalty-badge.is-own-goal {
    min-width: 21px;
    background: #24262d;
    font-size: 6px;
}

.match-event__substitution-text b,
.match-event__substitution-text em {
    display: block;
    font-style: normal;
    font-weight: 800;
    line-height: 1.35;
}

.match-event__substitution-text b {
    color: #16854a;
}

.match-event__substitution-text em {
    margin-top: 1px;
    color: #b94350;
}

@media (max-width: 560px) {
    .match-event.is-substitution .match-event__card {
        border-left-color: #16854a;
    }

    .match-event.is-injury .match-event__card {
        border-left-color: #d7192d;
    }

    .match-event.is-missed-penalty .match-event__card {
        border-left-color: #d98200;
    }

    .match-event__penalty-badge {
        right: -4px;
        bottom: -4px;
    }
}
