/* ==========================================
   MATCH DETAIL PAGE
   ========================================== */

/* ==========================================
   MATCH HEADER (Hero)
   Stadium-background hero card: a competition breadcrumb on top,
   then a 3-column row (home team | score center | away team).
   The header always sits on a dark stadium image, so its text
   colors are fixed light-on-dark values (like the topbar/footer)
   and intentionally do not flip with the light theme.
   ========================================== */
.match-header {
    position: relative;
    width: calc(100% - 24px);
    max-width: var(--container-max-width);
    margin: 16px auto 0;
    border-radius: var(--border-radius-card);
    border: 1px solid var(--border-color);
    overflow: hidden;
    text-align: center;
    background-color: var(--bg-dark); /* fixed dark fallback: header is always a dark-island component */
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.46) 48%, rgba(0, 0, 0, 0.72) 100%),
        url('../images/match-header-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.match-header-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 22px 28px 28px;
}

/* ── Breadcrumb: competition › round ── */
.match-header-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.2;
}

.match-header-breadcrumb-league {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.match-header-breadcrumb-league:hover,
.match-header-breadcrumb-league:focus {
    color: var(--accent-lime);
}

.match-header-breadcrumb-league .bi {
    font-size: 12px;
    line-height: 1;
}

.match-header-breadcrumb-sep,
.match-header-breadcrumb-round {
    color: var(--accent-lime);
}

/* ── Hero: 3 columns (home | center | away) ── */
.match-header-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

/* Team block (home / away) */
.match-header-team {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Subtle spotlight glow behind each team (approximates the Figma glow vectors) */
.match-header-team::before {
    content: "";
    position: absolute;
    top: -28px;
    left: 50%;
    width: 260px;
    height: 260px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0) 62%);
    pointer-events: none;
    z-index: 0;
}

.match-header-team > a {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-decoration: none;
}

.match-header-team img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.match-header-team-name {
    font-family: var(--font-heading);
    font-size: var(--font-size-lg);
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-white);
    text-align: center;
}

/* ── Score center ──
   Flex "order" produces the Figma visual stack
   (label → score/time → status → penalties → venue) while the DOM
   keeps the status → score → time order that match-detail-live.js
   relies on when it injects a score node during a live transition. */
.match-header-top {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 200px;
}

.match-header-league-label { order: 1; }
.match-header-score        { order: 2; }
.match-header-time         { order: 2; }
.match-header-status       { order: 3; }
.match-header-penalties    { order: 4; }
.match-header-venue        { order: 5; }

/* Competition badge pill */
.match-header-league-label {
    max-width: 100%;
    padding: 3px 12px;
    font-family: var(--font-heading);
    font-size: var(--font-size-xs);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--accent-lime);
    background: var(--accent-primary-subtle);
    border: 1px solid var(--accent-primary-bg);
    border-radius: var(--border-radius-pill);
}

/* Score line */
.match-header-score {
    font-family: var(--font-heading);
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -3px;
    color: var(--text-white);
}

/* Kick-off time (scheduled matches) occupies the score slot */
.match-header-time {
    font-family: var(--font-heading);
    font-size: var(--font-size-xxl);
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-white);
}

/* Status badge */
.match-header-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.2;
    border-radius: var(--border-radius-btn);
}

.match-header-status.live {
    color: var(--color-live);
    background: var(--match-live-bg);
    animation: pulse-live 2s infinite;
}

/* Pulsing red dot — a CSS pseudo-element so the 1s live ticker can freely
   overwrite the element's textContent without removing the indicator. */
.match-header-status.live::before {
    content: "";
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-live);
}

.match-header-status.ended {
    color: var(--accent-red);
}

.match-header-status.scheduled {
    color: rgba(255, 255, 255, 0.6);
}

.match-header-status.suspended {
    color: var(--accent-yellow);
    background: var(--accent-yellow);
    animation: pulse-suspended 2.5s infinite;
}

/* Venue line */
.match-header-venue {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.72);
}

@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes pulse-suspended {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Suspension banner — shown below the match header for INT/SUSP statuses */
.match-suspended-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: var(--container-max-width);
    margin: 16px auto 0;
    padding: 16px 20px;
    background: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
    border-radius: 10px;
    text-align: center;
}

.match-suspended-icon {
    font-size: 28px;
    color: var(--accent-yellow);
    flex-shrink: 0;
}

.match-suspended-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.match-suspended-title {
    font-size: var(--font-size-md);
    font-weight: 800;
    color: var(--accent-yellow);
    letter-spacing: 1px;
}

.match-suspended-reason {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

@media (max-width: 576px) {
    .match-suspended-banner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

/* Match Tabs — rounded card with centered, underline-style tab buttons */
.match-tabs {
    position: sticky;
    top: var(--header-height);
    z-index: 99;
    width: calc(100% - 24px);
    max-width: var(--container-max-width);
    margin: 16px auto 0;
    /* padding: 0 16px; */
    background: var(--bg-card);
    border-radius: var(--border-radius-card);
    overflow-x: auto;
}

.match-tabs-container {
    display: flex;
    align-items: stretch;
    height: 50px;
    /* padding: 0 24px; */
    overflow-x: auto;
    scrollbar-width: none;
}

/* Center the tab group when it fits; the auto-margin pseudo elements
   collapse to zero when tabs overflow so every tab stays reachable
   by horizontal scrolling. */
.match-tabs-container::before,
.match-tabs-container::after {
    content: "";
    margin: auto;
}

.match-tabs-container::-webkit-scrollbar {
    display: none;
}

.match-tab {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1.22;
    color: var(--text-secondary);
    text-decoration: none;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.match-tab:hover {
    color: var(--text-primary);
}

.match-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Tab Content */
.match-content {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 24px 0px;
    width: calc(100% - 24px);
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Events Tab — centered pill filter (Top Events / All Events) */
.events-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 20px;
}

.events-filter-btn {
    padding: 6px 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: var(--transition-fast);
}

.events-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.events-filter-btn.active,
.events-filter-btn.active:hover {
    background: var(--accent-purple-dark);
    border-color: var(--accent-purple-dark);
    color: var(--text-white);
}

/* Events container wrapper */
.events-timeline {
    background: var(--bg-card);
    border-radius: 14px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Base event item */
.match-event-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}
.match-event-item:last-child {
    border-bottom: none;
}

/* Section markers (Ended, Penalties header, ET, HT, Start Match) */
.match-event-item.bg {
    background: var(--bg-pill);
}
.match-event-item.start-end-match {
    justify-content: center;
    gap: 8px;
}
.match-event-item.start-end-match .text .title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

/* Mid-match result inside separator */
.match-event-item .m-result {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
    color: var(--text-primary);
}

/* Two-column event layout */
.match-event-item .t-side {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}
.match-event-item .t-side.team-a {
    flex-direction: row;
    justify-content: flex-end;
    text-align: end;
}
.match-event-item .t-side.team-b {
    flex-direction: row;
    justify-content: flex-start;
}
.match-event-item .t-side.empty {
    visibility: hidden;
}
.match-event-item .t-side .text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.match-event-item .t-side .text .title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}
.match-event-item .t-side .text .subtitle {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Time badge (centered circle) */
.match-event-item .time {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--bg-pill);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 16px;
}
.match-event-item .time i {
    font-style: normal;
    font-size: 10px;
    color: var(--text-secondary);
    margin-inline-start: 1px;
}

/* Event icon colors */
.event-icon-goal { color: var(--accent-lime); }
.event-icon-own_goal { color: var(--accent-red); }
.event-icon-penalty_goal { color: var(--accent-lime); }
.event-icon-penalty_miss { color: var(--accent-red); }
.event-icon-yellow_card { color: var(--accent-yellow); }
.event-icon-red_card { color: var(--accent-red); }
.event-icon-second_yellow { color: var(--accent-yellow); }
.event-icon-substitution { color: var(--accent-blue); }
.event-icon-var { color: var(--accent-purple); }
.event-icon-goal_cancelled { color: var(--accent-red); }

/* SVG event icons */
.ev-svg {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    object-fit: contain;
}
.ev-svg-inline {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    object-fit: contain;
    display: inline;
    margin-inline-end: 2px;
}

/* Detail subtitle text (penalty, own goal, VAR reason) */
.event-detail-text {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 1px;
    font-weight: 400;
    line-height: 1.2;
}

/* Event type icon container */
.match-event-item .ev-icon {
    flex-shrink: 0;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.match-event-item .ev-icon i {
    font-size: 14px;
}

/* Second yellow icon: two cards overlapping */
.second-yellow-icon {
    display: inline-flex;
    position: relative;
    width: 30px;
    height: 18px;
}
.second-yellow-icon .ev-svg:first-child {
    position: absolute;
    left: 0;
    top: 0;
    width: 14px;
    height: 14px;
}
.second-yellow-icon .ev-svg:last-child {
    position: absolute;
    left: 10px;
    top: 2px;
    width: 14px;
    height: 14px;
}
.second-yellow-icon .bi-card-fill.yellow {
    color: var(--accent-yellow);
    position: absolute;
    left: 0;
    top: 0;
    font-size: 13px;
}
.second-yellow-icon .bi-card-fill.red {
    color: var(--accent-red);
    position: absolute;
    left: 6px;
    top: 2px;
    font-size: 13px;
}

/* Substitution arrows */
.match-event-item .ev-icon .sub-in {
    color: var(--accent-green);
}
.match-event-item .ev-icon .sub-out {
    color: var(--accent-red);
}
.match-event-item .sub-in-img {
    border: 1px solid var(--accent-green);
    z-index: 10;
}
.match-event-item .sub-out-img {
    border: 1px solid var(--accent-red);
    margin-inline-start: -16px;
}

/* VAR badge */
.var-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: var(--accent-purple);
    color: var(--text-white);
    padding: 2px 5px;
    border-radius: 3px;
    line-height: 1;
}

/* Player image in events */
.event-player-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-card-hover);
}

/* Player links */
.match-event-item .t-side a {
    color: inherit;
    text-decoration: none;
}
.match-event-item .t-side a:hover {
    text-decoration: none;
}

/* Penalty shootout card */
.match-event-item.penalties {
    display: flex;
    align-items: flex-start;
    padding: 16px 14px;
}
.match-event-item.penalties .team-item {
    flex: 1;
}
.match-event-item.penalties .result {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 700;
    padding: 0 12px;
}
.match-event-item.penalties .result b {
    color: var(--text-secondary);
}
.match-event-item.penalties .result b.win {
    color: var(--accent-lime);
}
.match-event-item.penalties .result i {
    font-style: normal;
    color: var(--text-secondary);
}
.penalties-shots {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.p-shot-item {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}
.p-shot-item.success { color: var(--accent-lime); }
.p-shot-item.failed { color: var(--accent-red); }
.p-shot-item.neutral { color: var(--text-secondary); }
.p-shot-success {
    filter: brightness(0) saturate(100%) invert(62%) sepia(54%) saturate(456%) hue-rotate(100deg) brightness(94%) contrast(90%);
}
.p-shot-failed {
    filter: brightness(0) saturate(100%) invert(39%) sepia(95%) saturate(2000%) hue-rotate(340deg) brightness(95%) contrast(100%);
}
.shots-text {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: shot;
}
.shots-text li {
    font-size: 11px;
    color: var(--text-secondary);
    counter-increment: shot;
    line-height: 1.6;
}
.shots-text li::before {
    content: counter(shot) ". ";
    font-weight: 600;
}
.shots-text .shots-miss li::before {
    font-weight: 600;
}

/* Team alignment for penalty card */
.match-event-item.penalties .team-item.team-a {
    text-align: end;
}
.match-event-item.penalties .team-item.team-a .penalties-shots {
    justify-content: flex-end;
}
.match-event-item.penalties .team-item.team-b {
    text-align: start;
}
.match-event-item.penalties .team-item.team-b .penalties-shots {
    justify-content: flex-start;
}

/* Video icon in events */
.match-event-item .video-icon {
    flex-shrink: 0;
    margin-inline-start: auto;
    padding-inline-start: 6px;
}
.match-event-item .video-icon a {
    color: var(--accent-blue);
    font-size: 16px;
}

/* Legacy compat: keep old selectors working for JS filter */
.event-item.goal,
.event-item.red_card,
.event-item.second_yellow,
.event-item.var,
.event-item.own_goal,
.event-item.penalty_goal,
.event-item.penalty_miss,
.event-item.yellow_card,
.event-item.substitution {
    /* no longer used but kept for JS compat */
}

/* Quick Stats (in events tab) — "Statistics Summary" panel card:
   card header, possession split bar with team identifiers, then
   home-badge / label / away-value stat rows. */
.quick-stats {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    /* Rendered BELOW the events timeline, so the gap belongs above it to
       separate it from the last event row (was margin-bottom when it sat on top). */
    margin-top: 20px;
}

/* Card header */
.quick-stats-header {
    padding: 12px 16px;
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-primary);
}

/* "Ball possession" caption */
.qs-possession-label {
    padding: 4px 16px;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary);
    text-align: center;
}

/* Possession row: home team | split bar | away team */
.qs-row-possession {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.qs-team {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.qs-team-name {
    max-width: 110px;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qs-team-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
    flex-shrink: 0;
}

/* Split possession bar (home purple segment + away lime segment) */
.qs-bar {
    flex: 1 1 auto;
    display: flex;
    /* gap: 2px; */
    height: 35px;
    min-width: 0;
}

.qs-bar-seg {
    display: flex;
    align-items: center;
    min-width: 52px;
    padding: 0 12px;
    /* border-radius: 3px; */
    transition: width var(--transition-normal);
}

.qs-bar-home {
    background: var(--stat-bar-home);
    justify-content: flex-start;
    border-start-start-radius: 30px;
    border-end-start-radius: 30px;
}

.qs-bar-away {
    background: var(--stat-bar-away);
    justify-content: flex-end;
    border-start-end-radius: 30px;
    border-end-end-radius: 30px;
}

.qs-bar-val {
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 800;
    line-height: 1.22;
    white-space: nowrap;
}

.qs-bar-home .qs-bar-val {
    color: var(--text-white);
}

.qs-bar-away .qs-bar-val {
    color: var(--stat-bar-home);
}

/* Value-based segment coloring: the segment with the HIGHER value gets
   lime (--stat-bar-away), the LOWER gets purple (--stat-bar-home),
   regardless of home/away side */
.qs-bar-home.is-higher {
    background: var(--stat-bar-away);
}

.qs-bar-away.is-lower {
    background: var(--stat-bar-home);
}

.qs-bar-home.is-higher .qs-bar-val {
    color: var(--stat-bar-home);
}

.qs-bar-away.is-lower .qs-bar-val {
    color: var(--text-white);
}

/* Stat rows column (match-detail-live.js appends live-updated rows here) */
.qs-stats-col {
    display: flex;
    flex-direction: column;
}

.qs-stats-col:empty {
    display: none;
}

.qs-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.qs-stats-col > .qs-row:last-child {
    border-bottom: none;
}

/* Higher value — lime pill badge (value-based, not team-based) */
.qs-row .qs-val.is-higher {
    flex: 0 0 auto;
    min-width: 24px;
    padding: 2px 4px;
    background: var(--accent-lime);
    border-radius: var(--border-radius-pill);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.43;
    text-align: center;
    color: var(--stat-bar-home);
}

.qs-row .qs-lbl {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lower value — bold figure */
.qs-row .qs-val.is-lower {
    flex: 0 0 auto;
    min-width: 24px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.22;
    text-align: center;
    color: var(--text-primary);
}

/* ═══ Statistics Tab (panel card) ═══ */
/* Base .stat-row / .stat-value retained: also used by .pitch-player-tooltip */
.stat-row {
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.stat-value {
    width: 50px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value.home {
    text-align: start;
}

.stat-value.away {
    text-align: end;
}

/* Card container */
.stats-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

/* Card header */
.stats-section-title {
    margin: 0;
    padding: 12px 16px;
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-primary);
}

/* Generic stat row: [home pill] [label] [away value] */
.stats-section .stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
}

.stats-section .stat-row:last-child {
    border-bottom: none;
}

/* Equal side columns keep labels centered regardless of value or badge width. */
.stats-section .stat-row:not(.stat-row-possession),
.quick-stats .qs-row:not(.qs-row-possession) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
}

.stats-section .stat-row:not(.stat-row-possession) .stat-value.home,
.quick-stats .qs-row:not(.qs-row-possession) .qs-val-home {
    justify-self: start;
}

.stats-section .stat-row:not(.stat-row-possession) .stat-value.away,
.quick-stats .qs-row:not(.qs-row-possession) .qs-val-away {
    justify-self: end;
}

/* Higher value → lime pill (value-based, not team-based) */
.stats-section .stat-row:not(.stat-row-possession) .stat-value.is-higher {
    width: auto;
    min-width: 24px;
    padding: 2px 6px;
    border-radius: 100px;
    background: var(--accent-lime);
    color: var(--stat-bar-home);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.43;
    text-align: center;
    flex-shrink: 0;
}

/* Centered label */
.stats-section .stat-row .stat-label {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-sm);
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-secondary);
    text-align: center;
}

/* Lower value → bold primary text */
.stats-section .stat-row:not(.stat-row-possession) .stat-value.is-lower {
    width: auto;
    min-width: 24px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.22;
    color: var(--text-primary);
    text-align: center;
    flex-shrink: 0;
}

/* Possession row: centered label + single split track */
.stats-section .stat-row.stat-row-possession {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0;
}

.stats-section .stat-row.stat-row-possession .stat-label {
    flex: none;
    padding: 10px 16px 6px;
}

/* Single horizontal track split into home/away segments */
.stats-section .stat-row-possession .possession-track {
    display: flex;
    flex-direction: row;
    /* gap: 2px; */
    padding: 0 16px 12px;
}

.possession-seg {
    display: flex;
    align-items: center;
    height: 35px;
    min-width: 48px;
    padding: 0 12px;
    /* border-radius: 3px; */
    transition: width var(--transition-normal);
}

.possession-seg-home {
    background: var(--stat-bar-home);
    justify-content: flex-start;
    border-start-start-radius: 30px;
    border-end-start-radius: 30px;
}

.possession-seg-away {
    background: var(--stat-bar-away);
    justify-content: flex-end;
    border-start-end-radius: 30px;
    border-end-end-radius: 30px;
}

/* Values rendered inside each segment */
.stats-section .possession-track .stat-value {
    width: auto;
    min-width: 0;
    padding: 0;
    background: none;
    border-radius: 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 800;
    line-height: 1.22;
    white-space: nowrap;
}

.stats-section .possession-track .stat-value.home {
    text-align: start;
}

.stats-section .possession-track .stat-value.away {
    text-align: end;
}

/* Value-based segment coloring: the segment with the HIGHER value gets
   lime (--stat-bar-away), the LOWER gets purple (--stat-bar-home),
   regardless of home/away side */
.stats-section .possession-seg-home.is-higher {
    background: var(--stat-bar-away);
}

.stats-section .possession-seg-away.is-lower {
    background: var(--stat-bar-home);
}

/* Label contrast follows the segment background */
.stats-section .possession-seg.is-higher .stat-value {
    color: var(--stat-bar-home);
}

.stats-section .possession-seg.is-lower .stat-value {
    color: var(--text-white);
}

/* Detail / Info Tab */
/* Shared card header strip (Match Info, Head-to-Head, Standings snippet):
   same lighter title bar tokens as the standings card head. */
.section-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-light);
}

.section-card-title {
    margin: 0;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    line-height: 1.22;
    color: var(--text-primary);
}

.match-info-table {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.match-info-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
}

.match-info-row:last-child {
    border-bottom: none;
}

.match-info-label {
    width: 130px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.match-info-value {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
}

.match-info-value a {
    color: var(--accent-primary);
}

/* Broadcast channels render as plain accent text (comma separated) */
.match-info-value.match-info-channels {
    color: var(--accent-primary);
}

/* H2H Section */
.h2h-section {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

/* Detail-tab standings snippet: same section rhythm as the H2H block above. */
.fixture-standings-snippet {
    margin-top: 28px;
    margin-bottom: 24px;
}

/* Totals strip: team logos flank the win / draw / win counters */
.h2h-summary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
}

.h2h-summary-logo {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.h2h-summary-item {
    min-width: 44px;
    text-align: center;
}

.h2h-summary-value {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--text-primary);
}

.h2h-summary-label {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* Past meetings: date | centered matchup | competition. Equal side columns
   keep the team-vs-team block optically centered on every row. */
.h2h-match {
    display: grid;
    grid-template-columns: minmax(84px, 1fr) auto minmax(84px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: var(--font-size-sm);
    color: inherit;
    text-decoration: none;
}

.h2h-match:last-child {
    border-bottom: none;
}

.h2h-match-date {
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
}

/* Fixed-width grid (name | fixed score slot | name) so every row of the
   list shares identical column geometry and items line up vertically. */
.h2h-match-center {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: min(560px, 100%);
}

.h2h-match-teams {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
}

.h2h-match-center .h2h-match-teams:first-child {
    justify-self: end;
    text-align: end;
}

.h2h-match-center .h2h-match-teams:last-child {
    justify-self: start;
    text-align: start;
}

/* Winning side (name + score number) takes the theme accent; draws stay neutral */
.h2h-match-teams.is-winner,
.h2h-score-num.is-winner {
    color: var(--accent-primary);
}

.h2h-match-score {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 700;
    color: var(--text-primary);
}

.h2h-match-league {
    justify-self: end;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    text-align: end;
}

/* Lineups Tab */
.lineups-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.lineup-team {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
}

.lineup-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.lineup-team-name {
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-white);
}

.lineup-formation {
    font-size: var(--font-size-sm);
    color: var(--accent-teal);
    font-weight: 600;
}

.lineup-coach {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.lineup-coach span {
    color: var(--text-primary);
}

.lineup-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 16px 0 8px;
}

.lineup-player {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.lineup-player:last-child {
    border-bottom: none;
}

.lineup-player-number {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: 50%;
    font-size: var(--font-size-xs);
    font-weight: 700;
    color: var(--text-white);
    margin-inline-end: 10px;
    flex-shrink: 0;
}

.lineup-player-name {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    flex: 1;
}

.lineup-player-pos {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

/* ==========================================
   Standings Tab (Figma 40000191:5250)
   ========================================== */

/* Stack of standings cards — one per group */
.standings-cards {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Card shell */
.standings-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    overflow: hidden;
}

/* Card head: league identity + matchday counter */
.standings-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-color);
}

.standings-league {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.standings-league-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex-shrink: 0;
}

.standings-league-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.standings-league-name {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 15px;
    line-height: 1.22;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Group name — secondary line under the league name in the card head (e.g.
   "Group A" for multi-group cups). The renderer hides it when it would just
   duplicate the league name on single-group tables. */
.standings-group-name {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 11.5px;
    line-height: 1.22;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.standings-matchday {
    flex-shrink: 0;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 11.5px;
    line-height: 1.22;
    color: var(--text-muted);
    white-space: nowrap;
}

.standings-matchday span {
    color: var(--accent-primary);
}

/* Zone legend */
.standings-legend {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
}

.standings-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.standings-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--zone-color, var(--text-muted));
    flex-shrink: 0;
}

.standings-legend-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 10.5px;
    line-height: 1.22;
    color: var(--text-muted);
}

/* Zone palette — zone-* classes set the custom properties consumed by the
   legend dot, position bar, position number and row tint. */

/* Generic fallback for unmapped zone slugs (regional competitions) —
   :where() keeps specificity at (0,1,0) so the specific .zone-* rules
   below override this via cascade order. */
.standings-cards :where([class*="zone-"]) {
    --zone-color: var(--accent-teal);
    --zone-bg: var(--zone-uecl-bg);
}

.zone-ucl {
    --zone-color: var(--zone-ucl);
    --zone-bg: var(--zone-ucl-bg);
}

.zone-uel {
    --zone-color: var(--zone-uel);
    --zone-bg: var(--zone-uel-bg);
}

.zone-uecl {
    --zone-color: var(--zone-uecl);
    --zone-bg: var(--zone-uecl-bg);
}

.zone-rel {
    --zone-color: var(--accent-red);
    --zone-bg: var(--zone-rel-bg);
}

.zone-promo {
    --zone-color: var(--accent-green);
    --zone-bg: var(--zone-ucl-bg);
}

.zone-sf,
.zone-final {
    --zone-color: var(--accent-yellow);
    --zone-bg: var(--zone-uel-bg);
}

.zone-r16,
.zone-qf {
    --zone-color: var(--accent-teal);
    --zone-bg: var(--zone-uecl-bg);
}

.zone-r32 {
    --zone-color: var(--zone-r32);
    --zone-bg: var(--zone-r32-bg);
}

/* Scroll viewport — the table keeps its fixed column widths and scrolls
   horizontally on narrow screens while head / legend / footer stay pinned. */
.standings-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.standings-table {
    width: 100%;
    min-width: 560px;
    table-layout: fixed;
    border-collapse: collapse;
}

/* Header row */
.standings-table th {
    padding: 10px 0;
    background: var(--bg-pill);
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
}

.standings-table .th-club {
    text-align: start;
    padding-inline-start: 8px;
}

.standings-table .th-pos,
.standings-table .th-pts {
    width: 52px;
}

.standings-table .th-stat {
    width: 48px;
}

.standings-table .th-goals {
    width: 72px;
}

.standings-table .th-diff {
    width: 50px;
}

.standings-table .th-form {
    width: 96px;
}

.standings-table .is-accent {
    color: var(--accent-primary);
}

/* Body rows */
.standings-table td {
    padding: 0;
    text-align: center;
    vertical-align: middle;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 12.5px;
    line-height: 1.22;
    color: var(--text-tertiary);
}

.standings-table tbody tr {
    border-bottom: 1px solid var(--border-light);
}

.standings-table tbody tr:last-child {
    border-bottom: 0;
}

.standings-table tbody tr[class*="zone-"] {
    background-color: var(--zone-bg);
}

.standings-table tbody tr.highlight td {
    background-color: var(--bg-pill);
}

/* Group / zone separator row */
.standings-table .standings-group-row td {
    padding: 3px 20px 3px 56px;
    background: var(--bg-pill);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: start;
}

.standings-table .td-stat,
.standings-table .td-goals,
.standings-table .td-diff,
.standings-table .td-pts {
    padding: 25px 0;
}

/* Position cell: zone bar + zone-colored number */
.standings-table .td-pos {
    position: relative;
}

.standings-table .z-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--zone-color, transparent);
}

.standings-table .pos-num {
    display: block;
    padding: 25px 0;
    font-weight: 800;
    font-size: var(--font-size-sm);
    color: var(--zone-color, var(--text-muted));
}

/* Club cell */
.standings-table .td-club {
    text-align: start;
}

.standings-table .td-club a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-inline-start: 6px;
    color: inherit;
    text-decoration: none;
}

.standings-table .club-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.standings-table .club-name {
    font-weight: 800;
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Goal difference */
.standings-table .td-diff.is-pos {
    color: var(--zone-ucl);
}

.standings-table .td-diff.is-neg {
    color: var(--accent-red);
}

/* Points */
.standings-table .td-pts {
    color: var(--accent-primary);
}

.standings-table tbody tr.zone-rel .td-pts {
    color: var(--accent-red);
}

/* Form guide (last 5 matches) */
.standings-table .td-form {
    padding: 0 6px;
}

.form-guide {
    display: flex;
    justify-content: center;
    gap: 3px;
}

.form-guide .fg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14.5px;
    height: 15px;
    border-radius: 7.35px;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 8px;
    line-height: 1;
}

.fg-w {
    background: var(--form-win-bg);
    color: var(--zone-ucl);
}

.fg-d {
    background: var(--form-draw-bg);
    color: var(--text-muted);
}

.fg-l {
    background: var(--form-loss-bg);
    color: var(--accent-red);
}

.form-none {
    color: var(--text-secondary);
}

/* Card footer: abbreviation key */
.standings-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.standings-foot-note {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Fan Zone */
.fan-zone-votes {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.poll-disabled-msg {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-top: 8px;
    font-style: italic;
}

.poll-error {
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--accent-red);
    margin-top: 8px;
    padding: 6px 12px;
    background: var(--accent-red-bg);
    border-radius: 6px;
}

/* Match-only compositions; shimmer and shape primitives live in style.css. */
.md-skeleton { min-width: 0; }
.md-skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
}
.md-skeleton-stack,
.md-skeleton-row,
.md-skeleton-columns,
.md-skeleton-table-row {
    display: flex;
    gap: var(--font-size-base);
    min-width: 0;
}
.md-skeleton-stack { flex-direction: column; }
.md-skeleton-row { align-items: center; }
.md-skeleton-row > .md-skeleton-stack { flex: 1; }
.md-skeleton-columns > * { flex: 1; min-width: 0; }
.md-skeleton-title { --skeleton-width: 35%; --skeleton-height: 1.3em; }
.md-skeleton-short { --skeleton-width: 60%; }
.md-skeleton-stat {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: var(--font-size-base);
    align-items: center;
}
.md-skeleton-table-row {
    display: grid;
    grid-template-columns: 1em minmax(5em, 2fr) repeat(4, minmax(1em, 1fr));
    align-items: center;
}
.md-skeleton-pitch {
    display: grid;
    grid-template-rows: repeat(4, 1fr);
    aspect-ratio: 4 / 3;
    max-height: 32em;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-card);
}
.md-skeleton-pitch .md-skeleton-row { justify-content: space-around; }
.md-skeleton-pitch .skeleton-circle { --skeleton-width: 2.5em; --skeleton-height: 2.5em; }
.md-skeleton-podium { align-items: flex-end; }
.md-skeleton-podium > * { align-items: center; }
.md-skeleton-podium > :nth-child(2) { padding-bottom: var(--font-size-xl); }
.md-skeleton-news {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--font-size-md);
}
.md-skeleton-news .skeleton-block { height: auto; aspect-ratio: 16 / 9; }
/* H2H already supplies its own card chrome. */
.h2h-section > .md-skeleton .md-skeleton-card { border: 0; }
@media (max-width: 575.98px) {
    .md-skeleton-news { grid-template-columns: 1fr; }
    .md-skeleton-table-row { gap: var(--font-size-sm); }
}

.fan-zone-comments {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
}

.fan-zone-comment-input {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.fan-zone-comment-input input {
    flex: 1;
    padding: 10px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
}

.fan-zone-comment-input button {
    padding: 10px 20px;
    background: var(--accent-teal);
    color: var(--text-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.fan-zone-comment-input button:hover {
    opacity: 0.9;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-user {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--accent-teal);
    margin-bottom: 4px;
}

.comment-text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    line-height: 1.5;
}

.comment-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

/* News Tab — reuses the shared .news-featured component (style.css),
   identical grid structure and card styling to league.php and team.php.
   Grid: 2-column with first card spanning full width (featured). */
.league-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Neutralize responsive.css flex-basis hints inside the grid */
.league-news-grid .news-featured {
    min-width: 0;
}

.league-news-grid .news-featured:first-child {
    grid-column: 1 / -1;
}

/* Deep-purple brand fallback under the article image */
.league-news-grid .news-featured-bg {
    background-color: var(--bg-footer);
}

/* Meta row — clock icon + date */
.league-news-grid .news-featured-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.league-news-grid .news-featured-meta i {
    font-size: var(--font-size-md);
    line-height: 1;
}

/* Match highlights — isolated from the host page's spotlight carousel. */
[data-tab-content="videos-events"],
[data-tab-content="videos-detail"] {
    container-type: inline-size;
    container-name: match-highlights;
    min-width: 0;
}

[data-tab-content="videos-events"]:empty,
[data-tab-content="videos-detail"]:empty {
    display: none;
}

.md-highlights,
.md-highlights-skeleton {
    margin-bottom: var(--highlights-padding);
    min-width: 0;
}

.md-highlights-viewport {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.md-highlights-viewport::-webkit-scrollbar { display: none; }
.md-highlights-track { display: flex; }

.md-highlights-page {
    flex: 0 0 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--highlights-gap);
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.md-highlights[data-columns="2"] .md-highlights-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.md-highlights-card {
    display: flex;
    align-items: center;
    gap: var(--highlights-gap);
    min-width: 0;
    padding: var(--highlights-padding);
    background: var(--bg-card);
    border-radius: var(--border-radius-card);
}

.md-highlights-thumbnail {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--highlights-thumbnail-width);
    max-width: 34%;
    aspect-ratio: 5 / 3;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: var(--border-radius-btn);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
}

.md-highlights-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-highlights-thumbnail i {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--highlights-control-size);
    aspect-ratio: 1;
    font-size: var(--font-size-xl);
}

.md-highlights-thumbnail img + i {
    color: var(--text-white);
    background: var(--highlights-play-bg);
    border-radius: var(--border-radius-pill);
}

.md-highlights-thumbnail:hover { color: var(--text-primary); }
.md-highlights-body { min-width: 0; flex: 1; }

.md-highlights-title {
    margin: 0 0 var(--highlights-space-xs);
    color: var(--text-primary);
    font-family: var(--font-heading);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.md-highlights-description {
    margin: 0 0 var(--highlights-space-sm);
    color: var(--text-secondary);
    font-size: var(--font-size-xs);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.md-highlights-watch {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: var(--highlights-space-sm) var(--highlights-padding);
    background: var(--accent-purple);
    color: var(--text-white);
    border-radius: var(--border-radius-btn);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    text-align: center;
    transition: opacity var(--transition-fast);
}

.md-highlights-watch:hover { color: var(--text-white); opacity: 0.85; }

.md-highlights-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--highlights-space-sm);
    margin-top: var(--highlights-space-sm);
}

.md-highlights [hidden] { display: none !important; }

.md-highlights-dots { display: flex; flex-wrap: wrap; justify-content: center; }

.md-highlights-dot {
    display: grid;
    place-items: center;
    width: var(--highlights-dot-target);
    height: var(--highlights-dot-target);
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.md-highlights-dot::before {
    content: '';
    width: var(--highlights-dot-size);
    height: var(--highlights-dot-size);
    border-radius: var(--border-radius-pill);
    background: var(--border-color);
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.md-highlights-dot.is-active::before { background: var(--accent-primary); transform: scale(1.25); }
.md-highlights a:focus-visible,
.md-highlights button:focus-visible {
    outline: var(--highlights-focus-width) solid var(--accent-primary);
    outline-offset: calc(0px - var(--highlights-focus-width));
}

.md-highlights-skeleton {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--highlights-gap);
}

.md-highlights-skeleton .md-highlights-card + .md-highlights-card { display: none; }
.md-highlights-skeleton .md-highlights-body { display: grid; gap: var(--highlights-space-sm); }
.md-highlights-skeleton .md-highlights-thumbnail { height: auto; }
.md-highlights-skeleton .md-skeleton-title { --skeleton-width: 85%; }
.md-highlights-skeleton .skeleton-pill { width: 60%; height: var(--highlights-control-size); }

@container match-highlights (min-width: 768px) {
    .md-highlights-skeleton { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md-highlights-skeleton .md-highlights-card + .md-highlights-card { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    .md-highlights-viewport { scroll-behavior: auto; }
    .md-highlights-watch,
    .md-highlights-dot::before { transition: none; }
}

/* ==========================================
   3D FOOTBALL PITCH LINEUP
   ========================================== */

.lineups-pitch-wrapper {
    padding: 16px 0;
}

.pitch-container {
    position: relative;
    width: 100%;
    max-width: 840px;
    margin: 0 auto;
    aspect-ratio: 340 / 520;
    border-radius: 8px;
    overflow: visible;
    /* padding: 4px; */
}

.pitch-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.pitch-formation {
    position: absolute;
    font-size: 1rem;
    font-weight: 600;
    padding: 6px 16px;
    /* line-height: 22px; */
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: var(--text-white);
    z-index: 2;
}

.pitch-formation-home {
    bottom: 6%;
    right: 6%;
}

.pitch-formation-away {
    /* bottom: 50px;
    right: 60px; */
    bottom: 6%;
    right: 6%;
}

.pitch-player {
    position: absolute;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
    width: 60px;
    /* padding: 4px; */
    transition: transform 0.18s ease;
}

.pitch-player:hover {
    z-index: 50;
    transform: translate(-50%, -50%) scale(1.08);
}

.pitch-player-img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 2px solid var(--pitch-border-home);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.15);
}

.pitch-player-away .pitch-player-img {
    border-color: var(--pitch-border-away);
}

.pp-num {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: -0.02em;
}

.pitch-player-name {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-white);
    margin-top: 4px;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.85);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
    margin-inline-start: auto;
    margin-inline-end: auto;
}

/* Enhanced player card badges */
.pitch-badge { position: absolute; z-index: 3; }

.pitch-badge-mom {
    top: 2px; left: 50%; transform: translate(-50%, -100%);    
    color: var(--accent-yellow); font-size: 0.55rem; filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
}

.pitch-badge-card {
    /* left: 5px; top: 0; transform: translate(-50%, -50%); */
    left: 0; top: 2px; transform: translate(0, 0);
    width: 8px; height: 10px; border-radius: 1px;
}
.pitch-badge-yellow { background: var(--rank-gold); }
.pitch-badge-red { background: var(--accent-red); }

.pitch-badge-number {
    right: 0; top: 2px; transform: translate(0, 0);
    background: var(--bg-dark); color: var(--text-white); font-size: 0.6rem; font-weight: 800;
    width: 18px; height: 18px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; line-height: 1;
    border: 1.5px solid rgba(255,255,255,0.55);
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.pitch-badge-goal {
    left: 0; top: 22px; transform: translate(-30%, 0);
    font-size: 0.7rem; line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.pitch-badge-assist {
    left: 0; top: 22px; transform: translate(-30%, 0);
    font-size: 0.7rem; line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.6));
}

.badge-count {
    font-size: 0.45rem; color: var(--text-white); font-weight: 700;
    margin-inline-start: 1px; text-shadow: 0 0 2px rgba(0,0,0,0.8);
}

.pitch-badge-sub {
    left: 50%; top: 48px; transform: translateX(-50%);
    font-size: 0.6rem; font-weight: 700; line-height: 1;
    white-space: nowrap;
    background: rgba(0,0,0,0.7);
    padding: 2px 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid rgba(255,255,255,0.15);
}
.pitch-badge-sub-out { color: var(--accent-red); }
.pitch-badge-sub-out .sub-minute { color: var(--text-white); font-size: 0.5rem; }
.pitch-badge-sub-in { color: var(--accent-lime); }

.pitch-player-rating {
    position: absolute; right: -2px; bottom: 18px; transform: none;
    font-size: 0.65rem; font-weight: 800;
    background: rgba(0,0,0,0.75);
    padding: 2px 5px;
    border-radius: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.2);
}
.rating-excellent { color: var(--zone-ucl); }
.rating-good { color: var(--rating-good); }
.rating-avg { color: var(--rating-avg); }

/* Hover popup for player stats - appears BELOW the player icon */
.pitch-player-tooltip {
    display: none; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); 
    margin-top: 5px;
    background: rgba(20,20,30,0.96); border: 1px solid rgba(255,255,255,0.18);
    border-radius: 10px; padding: 10px 12px; min-width: 160px;
    z-index: 9999; backdrop-filter: blur(6px);
    font-size: 0.68rem; color: var(--text-white); white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    pointer-events: none;
}
.pitch-player-tooltip::before {
    content: '';
    position: absolute;
    top: -6px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px; height: 10px;
    background: rgba(20,20,30,0.96);
    border-inline-start: 1px solid rgba(255,255,255,0.18);
    border-top: 1px solid rgba(255,255,255,0.18);
}
.pitch-player:hover .pitch-player-tooltip { display: block; }
.pitch-player-tooltip .stat-row {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.pitch-player-tooltip .stat-row:last-child { border-bottom: none; }
.pitch-player-tooltip .stat-name { color: rgba(255,255,255,0.7); }
.pitch-player-tooltip .stat-value { color: var(--text-white); font-weight: 600; }

.coach-section {
    margin-top: 18px;
}

.pitch-coaches {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 0;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--bg-pill);
}

.pitch-coach {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.coach-photo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--zone-uel-bg);
    border: 2px solid var(--coach-photo-border);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    flex-shrink: 0;
}

.coach-photo-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.55);
    font-size: 1.1rem;
}

.coach-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.coach-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.coach-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pitch-coach a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: opacity 0.15s;
}

.pitch-coach a:hover {
    opacity: 0.8;
    /* text-decoration: underline; */
}

.pitch-substitutes {
    margin-top: 18px;
}

/* Missing Players section (injured / suspended), below the Bench */
.lineup-missing {
    margin-top: 18px;
}

.lineup-missing-group + .lineup-missing-group {
    margin-top: 12px;
}

.lineup-missing-group-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-inline-start: 12px;
}

.lineup-missing-group-missing {
    border-inline-start: 3px solid var(--border-injured);
}

.lineup-missing-group-questionable {
    border-inline-start: 3px solid var(--border-questionable);
}

.lineup-missing-reason {
    color: var(--text-secondary);
}

.subs-title {
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: 14px;
    padding-inline-start: 12px;
    border-inline-start: 3px solid var(--accent-primary);
    text-transform: none;
}

.subs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.subs-team {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sub-player {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--bg-pill);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease, transform 0.15s ease;
}

.sub-player:hover {
    background: rgba(255,255,255,0.07);
    transform: translateX(2px);
}

.sub-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(79, 195, 247, 0.6);
    flex-shrink: 0;
}

.sub-img-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-white);
}

.sub-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.sub-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sub-pos {
    font-size: 0.62rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ==========================================
   LINEUPS TEAM TABS (home/away full-pitch panels)
   All rules scoped under #tab-lineups so the
   team.php lineup pitch is never affected.
   ========================================== */

.lineup-team-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 14px;
}

/* Team tabs mirror the Events "All / Top" filter pills */
.lineup-team-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-family: var(--font-heading);
    font-size: var(--font-size-sm);
    font-weight: 700;
    line-height: 1.22;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-pill);
    cursor: pointer;
    transition: var(--transition-fast);
}

.lineup-team-tab img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.lineup-team-tab span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.lineup-team-tab:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.lineup-team-tab.active,
.lineup-team-tab.active:hover {
    background: var(--accent-purple-dark);
    border-color: var(--accent-purple-dark);
    color: var(--text-white);
}

.lineup-team-panel.is-hidden {
    display: none;
}

/* PNG field replaces the old pitch-svg; aspect ratio matches the
   intrinsic 1078x1055 image so no layout shift occurs. */
#tab-lineups .pitch-container {
    aspect-ratio: 1078 / 1055;
    background: url('../images/Lineup-Soccer-Green-Field.png') center / 100% 100% no-repeat;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

#tab-lineups .pitch-container .pitch-svg {
    display: none;
}

/* Bigger player chips for a clearer single-team view */
#tab-lineups .pitch-player {
    /* width: 76px; */
    width: 100px;
}

#tab-lineups .pitch-player-img {
    width: 56px;
    height: 56px;
}

/* Photo-wrap anchors the around-photo badges — keep it in sync
   with the enlarged photo so badges sit on the photo edge. */
#tab-lineups .pitch-player-photo-wrap {
    width: 56px;
}

#tab-lineups .pitch-player-name {
    /* font-size: 0.72rem; */
    max-width: 84px;
}

#tab-lineups .pp-num {
    font-size: 0.95rem;
}

#tab-lineups .pitch-player-rating {
    /* bottom: 22px; */
}

/* Badges scaled up proportionally with the bigger chips */
#tab-lineups .pitch-badge-mom {
    width: 16px;
    height: 16px;
}

#tab-lineups .pitch-badge-card {
    width: 18px;
    height: 18px;
    border-radius: 9px;
}

#tab-lineups .pitch-badge-card img {
    width: 10px;
    height: 14px;
}

#tab-lineups .pitch-badge-sub {
    width: 18px;
    height: 18px;
    border-radius: 10px;
}

#tab-lineups .pitch-badge-sub img {
    width: 12px;
    height: 12px;
}

#tab-lineups .pitch-badges-left .pitch-badge img {
    width: 12px;
    height: 12px;
}

/* Substitutes: three per row */
.lineup-subs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

/* Substitutions section (hidden until at least one exists) */
.lineup-substitutions {
    margin-top: 18px;
}

.lineup-substitutions.is-empty {
    display: none;
}

.lineup-sub-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lineup-sub-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--bg-pill);
}

.lineup-sub-player {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lineup-sub-player .lineup-sub-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.lineup-sub-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.lineup-sub-out .lineup-sub-info {
    align-items: flex-end;
}

.lineup-sub-meta {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

/* Player rating badge shown next to the name in substitution rows.
   Pill visuals (colored bg + white text) are shared with
   .pitch-player-rating via the combined rules below; only the inline
   placement next to the name is specific to this badge. Higher
   specificity so margin-top beats the shared pill rule further down. */
.lineup-sub-info .lineup-sub-rating {
    display: inline-block;
    margin-inline-start: 5px;
    margin-top: 0;
    vertical-align: middle;
}

.lineup-sub-player a {
    color: inherit;
    text-decoration: none;
    display: block;
    min-width: 0;
}

.lineup-sub-player a:hover .lineup-sub-name {
    text-decoration: underline;
}

.lineup-sub-in {
    text-align: start;
}

.lineup-sub-in .lineup-sub-name {
    color: var(--accent-green);
}

.lineup-sub-out {
    text-align: end;
    justify-content: flex-end;
}

.lineup-sub-out .lineup-sub-name {
    color: var(--accent-red);
}

.lineup-sub-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.15);
    flex-shrink: 0;
}

.lineup-sub-img-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-white);
}

.lineup-sub-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.lineup-sub-icon {
    width: 16px;
    height: 16px;
}

.lineup-sub-minute {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

@media (max-width: 576px) {
    .lineup-subs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #tab-lineups .pitch-player {
        width: 64px;
    }

    #tab-lineups .pitch-player-img {
        width: 46px;
        height: 46px;
    }

    #tab-lineups .pitch-player-photo-wrap {
        width: 46px;
    }

    #tab-lineups .pitch-player-name {
        max-width: 70px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lineup-team-tab,
    #tab-lineups .pitch-player,
    .lineup-subs-grid .sub-player {
        transition: none !important;
    }
}

/* ==========================================
   PENALTY SHOOTOUT STYLES
   ========================================== */

/* 7a. Match header penalty line */
.match-header-penalties {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.match-header-penalties .pen-label {
    font-weight: 400;
    opacity: 0.8;
}

.match-header-penalties .pen-home,
.match-header-penalties .pen-away,
.match-header-penalties .pen-score {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================
   RESPONSIVE — TABLET (max-width: 991.98px)
   ========================================== */
@media (max-width: 991.98px) {
    .match-header-inner {
        gap: 20px;
        padding: 20px 22px 24px;
    }

    .match-header-team img {
        width: 84px;
        height: 84px;
    }

    .match-header-top {
        min-width: 170px;
    }

    .match-header-score {
        font-size: 44px;
    }

    .match-content {
        /* padding: 20px 12px; */
    }

    /* Quick stats */
    .qs-team-name {
        max-width: 84px;
    }

    /* Lineups pitch */
    .pitch-container {
        /* max-width: 440px; */
    }

    .pitch-player {
        width: 54px;
    }

    .pitch-player-img {
        width: 38px;
        height: 38px;
    }

    .pitch-player-name {
        font-size: 0.62rem;
        max-width: 60px;
    }

    /* ── Standings Tab ── */
    .standings-card-head {
        padding: 12px 16px;
    }

    .standings-league-logo {
        width: 32px;
        height: 32px;
    }

    .standings-table .td-stat,
    .standings-table .td-goals,
    .standings-table .td-diff,
    .standings-table .td-pts,
    .standings-table .pos-num {
        padding: 18px 0;
    }
}

/* ==========================================
   RESPONSIVE — MOBILE (max-width: 767.98px)
   ========================================== */
@media (max-width: 767.98px) {
    /* ── Match Header ── */
    .match-header {
        width: calc(100% - 20px);
        margin-top: 12px;
    }

    .match-header-inner {
        gap: 16px;
        padding: 16px 14px 20px;
    }

    .match-header-breadcrumb {
        gap: 6px;
        font-size: 10px;
    }

    .match-header-hero {
        gap: 10px;
    }

    .match-header-team {
        gap: 8px;
    }

    .match-header-team > a {
        gap: 8px;
    }

    .match-header-team::before {
        width: 160px;
        height: 160px;
        top: -20px;
    }

    .match-header-team img {
        width: 56px;
        height: 56px;
    }

    .match-header-team-name {
        font-size: 12px;
        line-height: 1.3;
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .match-header-top {
        min-width: 0;
        gap: 6px;
    }

    .match-header-score {
        font-size: 30px;
        letter-spacing: -1px;
    }

    .match-header-time {
        font-size: 22px;
    }

    .match-header-status {
        font-size: 10px;
        padding: 3px 8px;
    }

    .match-header-league-label {
        font-size: 9px;
        padding: 2px 8px;
    }

    .match-header-venue {
        font-size: 10px;
        max-width: 120px;
    }

    .match-header-penalties {
        font-size: 0.75rem;
    }

    /* ── Suspension Banner ── */
    .match-suspended-banner {
        margin: 12px 10px 0;
        padding: 12px 14px;
        flex-direction: column;
        gap: 8px;
    }

    .match-suspended-icon {
        font-size: 22px;
    }

    .match-suspended-title {
        font-size: 13px;
    }

    .match-suspended-reason {
        font-size: 11px;
    }

    /* ── Tabs ── */
    .match-tabs {
        width: calc(100% - 20px);
        margin: 12px auto 0;
        padding: 0 8px;
    }

    .match-tabs-container {
        height: 46px;
        padding: 0 8px;
        -webkit-overflow-scrolling: touch;
    }

    .match-tab {
        padding: 0 12px;
        font-size: 12px;
        flex-shrink: 0;
    }

    /* ── Tab Content ── */
    .match-content {
        /* padding: 16px 10px; */
    }

    /* ── Quick Stats ── */
    .quick-stats {
        margin-top: 16px;
    }

    .quick-stats-header {
        padding: 10px 12px;
        font-size: 12px;
    }

    .qs-possession-label {
        font-size: var(--font-size-sm);
    }

    .qs-row-possession {
        padding: 8px 12px;
    }

    /* Drop team names so the possession bar keeps enough room */
    .qs-team-name {
        display: none;
    }

    .qs-bar {
        height: 30px;
    }

    .qs-bar-seg {
        min-width: 44px;
        padding: 0 8px;
    }

    .qs-bar-val {
        font-size: 12px;
    }

    .qs-row {
        padding: 8px 12px;
    }

    .qs-row .qs-lbl {
        font-size: var(--font-size-base);
    }

    /* ── Events Filter ── */
    .events-header {
        margin-bottom: 14px;
    }

    .events-filter-btn {
        padding: 6px 14px;
    }

    /* ── Events Timeline ── */
    .events-timeline {
        border-radius: 10px;
    }

    .match-event-item {
        padding: 10px 8px;
    }

    .match-event-item .time {
        width: 30px;
        height: 30px;
        font-size: 11px;
        margin: 0 8px;
    }

    .match-event-item .t-side {
        gap: 5px;
    }

    .match-event-item .t-side .text .title {
        font-size: 11px;
    }

    .match-event-item .t-side .text .subtitle {
        font-size: 9px;
    }

    .ev-svg {
        width: 18px;
        height: 18px;
    }

    .event-player-img {
        width: 24px;
        height: 24px;
    }

    .match-event-item .sub-in-img {
        margin-inline-start: 0;
    }

    .match-event-item .sub-out-img {
        margin-inline-start: -10px;
    }

    /* ── Penalty Shootout ── */
    .match-event-item.penalties {
        padding: 12px 8px;
        flex-wrap: wrap;
    }

    .match-event-item.penalties .team-item {
        min-width: 0;
    }

    .match-event-item.penalties .result {
        padding: 0 8px;
        font-size: 13px;
    }

    .penalties-shots {
        gap: 4px;
    }

    .p-shot-item {
        width: 15px;
        height: 15px;
    }

    .shots-text li {
        font-size: 10px;
    }

    /* ── Detail Tab: Match Info ── */
    .section-card-head {
        padding: 12px 14px;
    }

    .match-info-table {
        margin-bottom: 16px;
    }

    .match-info-row {
        padding: 10px 14px;
    }

    .match-info-label {
        width: 104px;
        font-size: 12px;
    }

    .match-info-value {
        font-size: 13px;
    }

    /* ── H2H Section ── */
    .h2h-section {
        margin-bottom: 16px;
    }

    .h2h-summary {
        gap: 16px;
        padding: 12px 14px;
    }

    .h2h-summary-value {
        font-size: 20px;
    }

    /* Stack: meta row (date + competition) above the centered matchup */
    .h2h-match {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 12px;
        padding: 10px 14px;
        font-size: 12px;
    }

    .h2h-match-league {
        margin-inline-start: auto;
    }

    .h2h-match-center {
        order: 3;
        width: 100%;
    }

    .h2h-match-teams {
        max-width: 120px;
        font-size: 12px;
    }

    /* ── Statistics Tab ── */
    .stats-section .stat-row {
        padding: 10px 12px;
    }

    .stats-section .stat-row.stat-row-possession .stat-label {
        padding: 10px 12px 6px;
    }

    .stats-section .stat-row-possession .possession-track {
        padding: 0 12px 12px;
    }

    .stat-value {
        width: 36px;
        font-size: 11px;
    }

    /* ── Lineups / Pitch ── */
    .lineups-pitch-wrapper {
        padding: 10px 0;
    }

    .pitch-container {
        max-width: 100%;
        aspect-ratio: 440 / 520 !important;
    }

    .pitch-player {
        width: 48px;
        padding: 2px;
    }

    .pitch-player-img {
        width: 34px;
        height: 34px;
    }

    .pitch-player-name {
        font-size: 0.58rem;
        max-width: 52px;
        margin-top: 2px;
    }

    .pitch-badge-number {
        width: 15px;
        height: 15px;
        font-size: 0.5rem;
    }

    .pitch-badge-card {
        width: 6px;
        height: 8px;
    }

    .pitch-badge-sub {
        font-size: 0.5rem;
        padding: 1px 4px;
        top: 40px;
    }

    .pitch-player-rating {
        font-size: 0.55rem;
        padding: 1px 3px;
        bottom: 6px;
    }

    .pitch-formation {
        font-size: 0.6rem;
        padding: 2px 6px;     
    }

    .pp-num {
        font-size: 0.7rem;
    }

    /* Coaches — keep side by side on mobile */
    .coach-section {
        margin-top: 14px;
    }

    .pitch-coaches {
        gap: 8px;
        padding: 10px 12px;
    }

    .coach-photo {
        width: 34px;
        height: 34px;
    }

    .coach-name {
        font-size: 0.72rem;
    }

    .coach-label {
        font-size: 0.55rem;
    }

    /* Substitutes — keep side by side on mobile */
    .pitch-substitutes {
        margin-top: 14px;
    }

    .lineup-missing {
        margin-top: 14px;
    }

    .lineup-missing-group-title {
        font-size: 0.72rem;
    }

    .subs-grid {
        gap: 10px;
    }

    .subs-title {
        font-size: 0.78rem;
    }

    .sub-player {
        padding: 6px 6px;
        gap: 6px;
    }

    .sub-img {
        width: 26px;
        height: 26px;
    }
    .lineup-sub-img{
        width: 26px;
        height: 26px;
    }

    .sub-name {
        font-size: 0.68rem;
    }
    .lineup-sub-player .lineup-sub-name {
        font-size: 0.68rem;
    }

    .lineup-sub-meta{
        font-size: 0.68rem;
    }
    
    .sub-pos {
        font-size: 0.55rem;
    }

    /* ── Standings Tab ── */
    .standings-card-head {
        padding: 12px 14px;
    }

    .standings-league-logo {
        width: 30px;
        height: 30px;
    }

    .standings-league-name {
        font-size: 13px;
    }

    .standings-legend {
        padding: 8px 14px;
    }

    .standings-table {
        min-width: 640px;
    }

    .standings-table th {
        padding: 8px 0;
    }

    .standings-table .td-stat,
    .standings-table .td-goals,
    .standings-table .td-diff,
    .standings-table .td-pts,
    .standings-table .pos-num {
        padding: 12px 0;
    }

    .standings-table .club-name {
        font-size: 12px;
    }

    .standings-card-foot {
        padding: 10px 14px;
    }

    /* ── News Tab ── */
    .league-news-grid {
        grid-template-columns: 1fr;
    }

    /* ── Fan Zone ── */
    .fan-zone-votes {
        padding: 16px 12px;
    }

    /* ── Event Comments Modal ── */
    .event-comments-modal {
        width: 95vw;
        max-width: 95vw;
        margin: 10px;
    }

    /* ── Fan Comments ── */
    .fan-zone-comment-input {
        flex-direction: column;
        gap: 8px;
    }

    .fan-zone-comment-input button {
        width: 100%;
    }
}

/* ==========================================
   RESPONSIVE — SMALL MOBILE (max-width: 479.98px)
   ========================================== */
@media (max-width: 479.98px) {
    /* ── Match Header ── */
    .match-header-inner {
        gap: 12px;
        padding: 14px 10px 16px;
    }

    .match-header-hero {
        gap: 6px;
    }

    .match-header-team img {
        width: 44px;
        height: 44px;
    }

    .match-header-team-name {
        font-size: 11px;
        max-width: 78px;
    }

    .match-header-top {
        gap: 4px;
    }

    .match-header-score {
        font-size: 24px;
        letter-spacing: -1px;
    }

    .match-header-time {
        font-size: 18px;
    }

    .match-header-status {
        font-size: 9px;
        padding: 2px 6px;
    }

    .match-header-league-label {
        font-size: 8px;
        padding: 2px 6px;
    }

    .match-header-venue {
        font-size: 9px;
        max-width: 90px;
    }

    /* ── Tabs ── */
    .match-tab {
        padding: 0 10px;
        font-size: 11px;
    }

    /* ── Content ── */
    .match-content {
        /* padding: 12px 8px; */
    }

    /* ── Quick Stats ── */
    .qs-row-possession,
    .qs-row {
        padding: 8px 10px;
        gap: 8px;
    }

    .qs-team-logo {
        width: 24px;
        height: 24px;
    }

    .qs-bar-seg {
        min-width: 40px;
        padding: 0 6px;
    }

    .qs-row .qs-val {
        font-size: 12px;
    }

    .qs-row .qs-val.is-higher {
        min-width: 20px;
    }

    .qs-row .qs-lbl {
        font-size: 13px;
    }

    /* ── Events ── */
    .match-event-item {
        padding: 8px 6px;
    }

    .match-event-item .time {
        width: 26px;
        height: 26px;
        font-size: 10px;
        margin: 0 6px;
    }

    .match-event-item .t-side .text .title {
        font-size: 10px;
    }

    .match-event-item .t-side .text .subtitle {
        font-size: 8px;
    }

    .ev-svg {
        width: 16px;
        height: 16px;
    }

    .event-player-img {
        width: 20px;
        height: 20px;
    }

    .second-yellow-icon {
        width: 24px;
        height: 14px;
    }

    .second-yellow-icon .ev-svg:first-child,
    .second-yellow-icon .ev-svg:last-child {
        width: 11px;
        height: 11px;
    }

    /* ── Penalty shootout ── */
    .match-event-item.penalties {
        padding: 10px 6px;
    }

    .match-event-item.penalties .result {
        padding: 0 6px;
        font-size: 12px;
    }

    .shots-text li {
        font-size: 9px;
    }

    /* ── Detail Tab ── */
    .section-card-head {
        padding: 10px 12px;
    }

    .match-info-row {
        padding: 8px 12px;
    }

    .match-info-label {
        width: 88px;
        font-size: 11px;
    }

    .h2h-summary {
        gap: 10px;
        padding: 10px 12px;
    }

    .h2h-summary-logo {
        width: 22px;
        height: 22px;
    }

    .h2h-summary-value {
        font-size: 18px;
    }

    .h2h-match {
        padding: 8px 12px;
    }

    .h2h-match-center {
        grid-template-columns: minmax(0, 1fr) 56px minmax(0, 1fr);
    }

    .h2h-match-teams {
        max-width: 96px;
        font-size: 11px;
    }

    /* ── Pitch / Lineups ── */
    .pitch-player {
        width: 42px;
    }

    .pitch-player-img {
        width: 30px;
        height: 30px;
    }

    .pitch-player-name {
        font-size: 0.52rem;
        max-width: 46px;
    }

    .pitch-badge-number {
        width: 13px;
        height: 13px;
        font-size: 0.45rem;
    }

    .pitch-badge-sub {
        font-size: 0.45rem;
        top: 36px;
    }

    .pitch-player-rating {
        font-size: 0.5rem;
        bottom: 6px!important;
    }

    .pitch-badge-goal,
    .pitch-badge-assist {
        font-size: 0.55rem;
        top: 18px;
    }

    /* ── Statistics ── */
    .stats-section {
        /* padding: 12px 10px;  */
    }

    .stat-value {
        width: 30px;
        font-size: 10px;
    }

    .stat-bar-container {
        margin: 0 6px;
    }

    /* ── Standings ── */
    .standings-table {
        min-width: 600px;
    }

    .standings-league-name {
        font-size: 12px;
        max-width: 150px;
    }

    .standings-table .fg {
        width: 13px;
        height: 14px;
    }

    /* ── Fan Zone ── */
    .fan-zone-votes {
        padding: 14px 10px;
    }
}

/* ==========================================
   RESPONSIVE — EXTRA SMALL (max-width: 359.98px)
   ========================================== */
@media (max-width: 359.98px) {
    .match-header-team img {
        width: 38px;
        height: 38px;
    }

    .match-header-team-name {
        font-size: 10px;
        max-width: 65px;
    }

    .match-header-score {
        font-size: 20px;
    }

    .match-tab {
        padding: 0 8px;
        font-size: 10px;
    }

    .qs-bar-seg {
        min-width: 36px;
        padding: 0 4px;
    }

    .qs-bar-val {
        font-size: 11px;
    }

    .match-event-item .time {
        width: 24px;
        height: 24px;
        font-size: 9px;
        margin: 0 4px;
    }

    .pitch-player {
        width: 38px;
    }

    .pitch-player-img {
        width: 26px;
        height: 26px;
    }

    .pitch-player-name {
        font-size: 0.48rem;
        max-width: 40px;
    }
}

/* ==========================================
   TOUCH-FRIENDLY ENHANCEMENTS
   ========================================== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets for tabs */
    .match-tab {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Larger touch targets for filter buttons */
    .events-filter-btn {
        /* min-height: 36px;
        min-width: 44px; */
    }

    /* Ensure links in events have adequate touch area */
    .match-event-item .t-side a {
        padding: 2px 0;
    }

    /* Player links on pitch - larger tap area */
    .pitch-player a {
        display: block;
        /* padding: 4px; */
    }

    /* Sub player rows - adequate touch height */
    .sub-player {
        min-height: 44px;
    }

    /* Disable hover effects that don't apply to touch */
    .pitch-player:hover {
        transform: translate(-50%, -50%);
    }

    .sub-player:hover {
        transform: none;
    }

    /* Standings club links */
    .standings-table .td-club a {
        min-height: 36px;
    }

    /* H2H match links */
    .h2h-match {
        min-height: 44px;
    }
}

/* ==========================================
   LANDSCAPE MOBILE
   ========================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .match-header {
        padding: 12px 0;
    }

    .match-header-team img {
        width: 40px;
        height: 40px;
    }

    .match-header-score {
        font-size: 22px;
    }

    .match-tabs {
        position: relative;
        top: 0;
    }

    .pitch-container {
        /* max-width: 320px; */
    }
}


/* ============================================================
   "Who will win?" poll — redesigned card
   Markup produced by assets/js/match-poll.js for both mounts
   (#poll-fanzone-root in the Fan Zone tab and #poll-detail-root
   in the Details tab — the latter renders results only).
   ============================================================ */

.fan-zone-votes.poll-card {
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    overflow: hidden;
}

.poll-card-header {
    padding: 14px 20px;
    background: var(--bg-card-header);
    border-bottom: 1px solid var(--border-color);
}

.poll-card-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--font-size-md);
    font-weight: 700;
    color: var(--text-primary);
}

.poll-card-body {
    padding: 20px;
}

/* Three equal options on a single row (both states) */
.poll-options {
    display: flex;
    align-items: stretch;
    gap: 16px;
}

.poll-option {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 10px 16px;
    background: var(--bg-pill);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-card);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    font-weight: 600;
    line-height: 1.2;
}

.poll-option-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.poll-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Vote state (buttons) ── */
button.poll-option {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    transition: background var(--transition-fast),
                border-color var(--transition-fast),
                transform var(--transition-fast);
}

button.poll-option:hover:not(:disabled) {
    border-color: var(--accent-primary);
    background: var(--accent-primary-subtle);
    transform: translateY(-1px);
}

button.poll-option:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button.poll-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-primary-bg);
}

button.poll-option:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ── Result state (percentage pills) ── */
/* Pill WIDTH is proportional to the API percentage (--poll-fill, set
   inline by match-poll.js); min-width keeps low-percentage options
   readable. */
.poll-option-result {
    flex: 1 1 var(--poll-fill, 0%);
    min-width: 120px;
    border-radius: 6px;
    overflow: hidden;
    transition: flex-basis var(--transition-normal);
}

/* Outer corners of the row are fully rounded (logical properties → RTL-safe). */
.poll-options-results .poll-option-result:first-child {
    border-start-start-radius: 30px;
    border-end-start-radius: 30px;
}

.poll-options-results .poll-option-result:last-child {
    border-start-end-radius: 30px;
    border-end-end-radius: 30px;
}

/* Full-pill tint; the leading option gets a stronger fill. */
.poll-option-fill {
    position: absolute;
    inset: 0;
    background: var(--poll-fill-bg);
    border-radius: inherit;
    pointer-events: none;
}

.poll-option-result.is-leading .poll-option-fill {
    background: var(--poll-fill-bg-strong);
}

.poll-option-result.is-voted {
    border-color: var(--accent-primary);
}

.poll-option-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.poll-option-pct {
    font-weight: 700;
    flex-shrink: 0;
}

/* Muted centered caption below the options */
.poll-caption {
    margin-top: 14px;
    text-align: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

/* Keep the three options on ONE row on small screens (typical
   prediction-widget behavior); compress and truncate instead. */
@media (max-width: 767.98px) {
    .fan-zone-votes.poll-card {
        padding: 0;
    }

    .poll-card-header {
        padding: 12px 14px;
    }

    .poll-card-body {
        padding: 14px 12px;
    }

    .poll-options {
        gap: 8px;
    }

    .poll-option {
        min-height: 44px;
        padding: 8px 10px;
        gap: 6px;
        font-size: var(--font-size-sm);
    }

    .poll-option-logo {
        width: 20px;
        height: 20px;
    }

    .poll-option-result {
        min-width: 76px;
    }
}

@media (max-width: 479.98px) {
    .poll-options {
        gap: 6px;
    }

    .poll-option {
        padding: 8px 6px;
        font-size: var(--font-size-xs);
    }

    .poll-option-content {
        gap: 4px;
    }

    .poll-option-result {
        min-width: 62px;
    }
}

/* ==========================================
   PITCH PLAYER REDESIGN
   (name pill + number pill, side badges,
   star MOTM, card & substitution badges)
   Overrides the legacy .pitch-badge-* styles
   ========================================== */

/* Photo wrapper — anchor for all around-photo badges */
.pitch-player-photo-wrap {
    position: relative;
    width: 44px;
    margin: 0 auto;
}

/* Circular photo with white ring (home & away identical) */
.pitch-player-img,
.pitch-player-away .pitch-player-img {
    border: 2px solid #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

/* ── MOTM star: centered above the photo ── */
.pitch-badge-mom {
    top: 0;
    left: 50%;
    transform: translate(-50%, -68%);
    width: 16px;
    height: 16px;
    font-size: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.pitch-badge-mom img {
    width: 100%;
    height: 100%;
    display: block;
}

/* ── Card badge: purple rounded square (same as other badges), top-right of photo ── */
.pitch-badge-card {
    left: auto;
    right: -5px;
    top: -4px;
    transform: none;
    width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--bg-footer);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.pitch-badge-card.pitch-badge-yellow,
.pitch-badge-card.pitch-badge-red {
    background: var(--bg-footer);
}

.pitch-badge-card img {
    width: 8px;
    height: 12px;
    display: block;
}

/* ── Substitution badge: purple square w/ circular arrows, right side ── */
.pitch-badge-sub {
    left: auto;
    right: -6px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 17px;
    height: 17px;
    padding: 0;
    border-radius: 8px;
    background: var(--bg-footer);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.pitch-badge-sub,
.pitch-badge-sub-out {
    color: var(--accent-lime);
}

.pitch-badge-sub i {
    font-size: 0.68rem;
    line-height: 1;
    font-weight: 700;
}

.pitch-badge-sub img {
    width: 11px;
    height: 11px;
    display: block;
}

/* ── Left column: goal / assist badges ── */
.pitch-badges-left {
    position: absolute;
    left: 0px;
    top: 50%;
    transform: translate(-45%, -50%);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 4;
    gap: 3px;
}


.pitch-badges-left .pitch-badge {
    position: static;
    transform: none;
    filter: none;
}

.pitch-badges-left .pitch-badge-goal,
.pitch-badges-left .pitch-badge-assist {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-footer);
    border-radius: 8px;
    /* padding: 2px 5px 2px 4px; */
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.pitch-badges-left .pitch-badge img {
    width: 10px;
    height: 10px;
    display: block;
}

.pitch-badges-left .badge-count {
    padding-inline-end: 2px;
    font-size: 0.5rem;
    font-weight: 800;
    color: var(--text-white);
    margin-inline-start: 0;
    text-shadow: none;
    line-height: 1;
}

/* ── Name pill + attached number pill ── */
.pitch-player-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -5px;
    z-index: 1;
    position: relative;
}

.pitch-player-name {
    background: var(--bg-footer);
    color: var(--text-white);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 6px;
    border-radius: var(--border-radius-pill);
    margin: 0;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-overflow: clip;
    white-space: nowrap;
    text-shadow: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.pitch-player-num {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--bg-topbar);
    color: var(--text-white);
    font-size: 0.55rem;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: -6px;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.25);
}

/* Captain: lime-filled number pill (no separate "C" badge anymore) */
.pitch-player-num-captain {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

/* ── Rating pill below the name pill ── */
.pitch-player-rating,
.lineup-sub-rating {
    position: static;
    right: auto;
    bottom: auto;
    display: inline-block;
    margin-top: 3px;
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 2px 9px;
    border-radius: var(--border-radius-pill);
    background: none;
    border: none;
    text-shadow: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
    position: relative;
    right: auto;
    /* bottom: 3px; */
    display: inline-block;
    /* margin-top: 3px; */
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.2;
    padding: 2px 9px;
    border-radius: var(--border-radius-pill);
    background: none;
    border: none;
    text-shadow: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.pitch-player-rating.rating-excellent,
.lineup-sub-rating.rating-excellent { background: var(--zone-ucl); color: var(--text-white); }
.pitch-player-rating.rating-good,
.lineup-sub-rating.rating-good { background: var(--zone-uecl); color: var(--text-white); }
.pitch-player-rating.rating-avg,
.lineup-sub-rating.rating-avg { background: var(--rank-bronze); color: var(--text-white); }

/* ── Responsive: tablet ── */
@media (max-width: 991.98px) {
    .pitch-player-photo-wrap {
        width: 38px;
    }

    .pitch-player-name {
        max-width: 50px;
    }
}

/* ── Responsive: mobile ── */
@media (max-width: 767.98px) {
    .pitch-player-photo-wrap {
        width: 34px;
    }

    .pitch-badge-mom {
        width: 13px;
        height: 13px;
    }

    .pitch-badge-card {
        width: 13px;
        height: 13px;
        border-radius: 8px;
        right: -4px;
        top: -3px;
    }

    .pitch-badge-card img {
        width: 6px;
        height: 9px;
    }

    .pitch-badge-sub {
        width: 14px;
        height: 14px;
        border-radius: 8px;
        top: 50%;
        right: -5px;
        padding: 0;
    }

    .pitch-badge-sub i {
        font-size: 0.55rem;
    }

    .pitch-badge-sub img {
        width: 9px;
        height: 9px;
    }

    .pitch-badges-left {
        gap: 2px;
    }

    .pitch-badges-left .pitch-badge-goal,
    .pitch-badges-left .pitch-badge-assist {
        /* padding: 1px 4px 1px 3px; */
    }

    .pitch-badges-left .pitch-badge img {
        width: 8px;
        height: 8px;
    }

    .pitch-badges-left .badge-count {
        /* font-size: 0.45rem; */
    }

    .pitch-player-tag {
        /* margin-top: 3px; */
    }

    .pitch-player-name {
        font-size: 0.52rem;
        padding: 2px 7px;
        max-width: 44px;
        margin-top: 0;
    }

    .pitch-player-num {
        width: 14px;
        height: 14px;
        font-size: 0.48rem;
        margin-inline-start: -5px;
    }

    .pitch-player-rating {
        font-size: 0.52rem;
        padding: 1px 7px;
        margin-top: 2px;
        bottom: auto;
    }
}

/* ── Responsive: small mobile ── */
@media (max-width: 479.98px) {
    .pitch-player-photo-wrap {
        width: 30px;
    }

    .pitch-badge-mom {
        width: 11px;
        height: 11px;
    }

    .pitch-badge-card {
        width: 11px;
        height: 11px;
    }

    .pitch-badge-card img {
        width: 5px;
        height: 8px;
    }

    .pitch-badge-sub {
        width: 12px;
        height: 12px;
        top: 50%;
    }

    .pitch-badge-sub i {
        font-size: 0.5rem;
    }

    .pitch-badge-sub img {
        width: 8px;
        height: 8px;
    }

    .pitch-player-name {
        font-size: 0.48rem;
        padding: 2px 6px;
        max-width: 40px;
    }

    .pitch-player-num {
        width: 12px;
        height: 12px;
        font-size: 0.42rem;
        margin-inline-start: -4px;
    }

    .pitch-player-rating {
        font-size: 0.48rem;
        padding: 1px 6px;
        bottom: auto;
    }
}

/* ── Responsive: extra small ── */
@media (max-width: 359.98px) {
    .pitch-player-photo-wrap {
        width: 26px;
    }

    .pitch-player-name {
        font-size: 0.44rem;
        max-width: 34px;
        padding: 1px 5px;
    }

    .pitch-player-num {
        width: 11px;
        height: 11px;
        font-size: 0.4rem;
    }

    .pitch-badges-left .pitch-badge img {
        width: 7px;
        height: 7px;
    }
}
