/* New football / ice-hockey timeline. Old matchaction-table and history-bar rules stay unchanged. */

.mx-vtimeline {
    list-style: none;
    position: relative;
    margin: 0;
    padding: 10px 6px 14px;
    background: #fff;
    color: #1f2937;
}

.mx-vtimeline:has(.mx-vrow):before {
    content: "";
    position: absolute;
    top: 22px;
    bottom: 22px;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: #d1d5db;
    z-index: 0;
}

.mx-vrow {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 3rem minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    margin: 0 0 14px;
}

.mx-vrail,
.mx-vcard {
    grid-row: 1;
    align-self: center;
}

.mx-vrail {
    grid-column: 2;
    justify-self: center;
    z-index: 1;
}

.mx-vrail span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    min-height: 1.35rem;
    padding: 2px 6px;
    border-radius: 999px;
    border: 2px solid #fff;
    background: #f3f4f6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: #111827;
}

.mx-vcard {
    min-width: 0;
    max-width: 100%;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    box-sizing: border-box;
}

.mx-side-home .mx-vcard {
    grid-column: 1;
    justify-self: end;
    text-align: right;
    margin-right: 8px;
}

.mx-side-away .mx-vcard {
    grid-column: 3;
    justify-self: start;
    text-align: left;
    margin-left: 8px;
}

.mx-kind-goal .mx-vrail span,
.mx-kind-goal .mx-vcard { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.45); }
.mx-kind-goal .mx-vcard { background: rgba(16, 185, 129, 0.45); }
.mx-kind-goal .mx-vkind { color: #000; }
.mx-kind-goal .mx-vkind + .mx-vplayer .mx-vname { font-weight: 800; }
.mx-kind-yellow .mx-vrail span,
.mx-kind-yellow .mx-vcard { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.55); }
.mx-kind-yellowred .mx-vrail span,
.mx-kind-red .mx-vrail span,
.mx-kind-yellowred .mx-vcard,
.mx-kind-red .mx-vcard { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.45); }
.mx-kind-sub .mx-vrail span,
.mx-kind-sub .mx-vcard { box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.45); }

.mx-vkind {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
}

.mx-side-home .mx-vkind { flex-direction: row-reverse; }

.mx-vscore {
    display: inline-flex;
    padding: 1px 6px;
    border-radius: 6px;
    background: #e5e7eb;
    color: #111827;
    font-size: 10px;
    letter-spacing: 0;
    text-transform: none;
}

.mx-vplayer {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    min-width: 0;
    font-size: 12px;
    font-weight: 700;
    color: #111827;
}

.mx-side-home .mx-vplayer { flex-direction: row-reverse; }

.mx-vname {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-ico {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    overflow: visible;
    vertical-align: middle;
}

img.mx-ico { object-fit: contain; }

.mx-vtimeline[data-sport="101"] .mx-kind-penalty svg.mx-ico,
.mx-htimeline[data-sport="101"] .mx-kind-penalty svg.mx-ico {
    background: url(../images/icons/penalty-1.png) no-repeat center / contain;
}

.mx-vtimeline[data-sport="101"] .mx-kind-penalty svg.mx-ico {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

.mx-vtimeline[data-sport="101"] .mx-kind-penalty svg.mx-ico use,
.mx-htimeline[data-sport="101"] .mx-kind-penalty svg.mx-ico use {
    display: none;
}

.mx-htimeline[data-sport="101"] .mx-kind-penalty .mx-ico {
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    flex-basis: 12px;
    background-size: 12px 12px;
}

.mx-htimeline {
    position: relative;
    z-index: 2;
    margin: 2px 8px 8px;
    padding: 2px 4px 6px;
    background: transparent;
    color: #fff;
    border: 0;
    text-align: left;
    box-shadow: none;
}

.mx-htitle {
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.88);
}

.mx-hbody {
    display: flex;
    align-items: center;
    min-height: 72px;
}

.mx-hteams {
    width: 58px;
    flex: 0 0 58px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding-right: 6px;
}

.mx-hteam {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.mx-hteam img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.mx-hteam span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.mx-htrack {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 64px;
}

.mx-hline {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    margin-top: -1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75) 8%, rgba(255, 255, 255, 0.75) 92%, transparent);
}

.mx-hticks {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 0;
}

.mx-htick {
    position: absolute;
    top: -7px;
    transform: translateX(-50%);
    padding: 0 2px;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font-size: 9px;
    line-height: 14px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}

.mx-hmark {
    position: absolute;
    z-index: 3;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.mx-hmark-home { bottom: 50%; margin-bottom: 6px; }
.mx-hmark-away { top: 50%; margin-top: 6px; }

.mx-hmark:before {
    content: "";
    position: absolute;
    left: 50%;
    width: 1px;
    height: 6px;
    margin-left: -0.5px;
    background: rgba(255, 255, 255, 0.85);
    pointer-events: none;
}

.mx-hmark-home:before { top: 100%; }
.mx-hmark-away:before { bottom: 100%; }

.mx-hmark .mx-ico {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 12px;
    flex-basis: 12px;
}

.mx-kind-goal.mx-hmark { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.7); }
.mx-kind-yellow.mx-hmark { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.8); }
.mx-kind-yellowred.mx-hmark,
.mx-kind-red.mx-hmark { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.7); }
.mx-kind-sub.mx-hmark { box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.7); }

.mx-hpop {
    display: none;
    position: absolute;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    min-width: 150px;
    max-width: 220px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111827;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 5;
}

.mx-hpop:after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -5px;
    width: 10px;
    height: 10px;
    margin-left: -5px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    transform: rotate(45deg);
    border-radius: 0 0 2px 0;
}

.mx-hpop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mx-hpop-label {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.mx-hpop-time {
    flex: 0 0 auto;
    padding: 1px 5px;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
}

.mx-hpop-player {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: #111827;
    font-size: 11px;
}

.mx-hmark.mx-kind-goal .mx-hpop-head + .mx-hpop-player {
    font-weight: 800;
}

.mx-hpop-player .mx-ico {
    position: static;
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}

.mx-hpop-score {
    display: block;
    margin-top: 3px;
    color: #6b7280;
    font-size: 10px;
    font-weight: 700;
}

.mx-hmark-away .mx-hpop {
    bottom: 26px;
    top: auto;
}

.mx-hpop.mx-hpop-start {
    left: 0;
    right: auto;
    margin-left: 0;
    transform: none;
}

.mx-hpop.mx-hpop-start:after {
    left: 8px;
    margin-left: -5px;
}

.mx-hpop.mx-hpop-end {
    left: auto;
    right: 0;
    margin-right: 0;
    transform: none;
}

.mx-hpop.mx-hpop-end:after {
    left: auto;
    right: 3px;
    margin-left: 0;
}

.mx-hmark:hover,
.mx-hmark:focus {
    z-index: 20;
}

.mx-hmark:hover .mx-hpop,
.mx-hmark:focus .mx-hpop {
    display: block;
}

/* Period pills between event groups. Football: HT, 2nd Half; hockey: 1st/2nd/3rd Period; both: Overtime, Penalties, FT (not .mx-vrow, so the horizontal timeline ignores them) */
.mx-vbreak {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 4px 0 18px;
    z-index: 1;
}

.mx-vbreak-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px 3px 10px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.mx-vbreak-label {
    letter-spacing: 0.04em;
}

.mx-vbreak-score {
    padding: 3px 8px;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 11px;
}

.mx-vbreak-ft .mx-vbreak-pill { background: #047857; }
.mx-vbreak-ft .mx-vbreak-score { color: #047857; }

@media (max-width: 550px) {
    .mx-vtimeline { padding: 6px 2px 8px; }
    .mx-vrow {
        grid-template-columns: minmax(0, 1fr) 2.2rem minmax(0, 1fr);
        margin-bottom: 8px;
    }
    .mx-vcard { padding: 5px 6px; border-radius: 8px; }
    .mx-side-home .mx-vcard { margin-right: 4px; }
    .mx-side-away .mx-vcard { margin-left: 4px; }
    .mx-vkind { font-size: 8px; gap: 4px; letter-spacing: 0.04em; }
    .mx-vplayer { margin-top: 2px; gap: 4px; font-size: 10px; }
    .mx-vscore { font-size: 8px; padding: 1px 4px; }
    .mx-vrail span {
        min-width: 1.8rem;
        min-height: 1.05rem;
        padding: 1px 4px;
        font-size: 8px;
        font-weight: 800;
    }
    .mx-vtimeline .mx-ico { width: 12px; height: 12px; flex-basis: 12px; }
    .mx-vbreak { margin: 2px 0 10px; }
    .mx-vbreak-pill { gap: 4px; padding: 2px 3px 2px 7px; font-size: 9px; }
    .mx-vbreak-score { padding: 2px 6px; font-size: 9px; }
}

.mx-lineups {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin: 8px 0 12px;
}

.mx-lineup {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
}

.mx-lineup-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
}

.mx-lineup-logo {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #f3f4f6;
}

.mx-lineup-logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.mx-lineup-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.mx-lineup-group-title {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    background: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}

.mx-lineup-group + .mx-lineup-group .mx-lineup-group-title {
    border-top: 1px solid #e5e7eb;
}

.mx-lineup-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
    border-top: 1px solid #f3f4f6;
}

.mx-lineup-num {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #f3f4f6;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
}

.mx-lineup-who {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mx-lineup-flag {
    width: 16px;
    height: 12px;
    flex: 0 0 16px;
    object-fit: cover;
    border-radius: 1px;
}

.mx-lineup-player {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #111827;
}

.mx-lineup-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.mx-lineup-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.mx-lineup-sub {
    padding: 1px 4px;
    border-radius: 6px;
    background: #f3f4f6;
}

.mx-lineup-badge-ico {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.mx-lineup-badge-ico .mx-ico {
    width: 14px;
    height: 14px;
    flex-basis: 14px;
}

.mx-ring-goal { box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.7); }
.mx-ring-yellow { box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.8); }
.mx-ring-red { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.75); }
.mx-ring-sub { box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.7); }

.mx-lineup-badge-count,
.mx-lineup-badge-label {
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .mx-lineups { grid-template-columns: minmax(0, 1fr); }
}
