/* ==========================================================================
   S11.cz - MATCH.CSS
   Styly pro detail zápasu, scoreboard a sestavy
   ========================================================================== */

/* --- LAYOUT: hlavní obsah na full-width container + fixed sidebar na pravém okraji.
   Sidebar je mimo flow (position: fixed), tudíž blokový layout stačí. .match-main
   má padding-right na desktopu aby content nezasahoval pod sidebar. */
.match-layout {
    display: block;
}

.match-main    { min-width: 0; padding-right: 72px; }
.match-sidebar { /* fixed pozice řešena níže v media queries */ }

/* Na velkém displeji (> 1340 px) je sidebar zcela mimo container → padding zrušíme. */
@media (min-width: 1340px) {
    .match-main { padding-right: 0; }
}

/* Sticky panel — kopíruje chování home-sidebar, ale s ohledem na sticky scoreboard.
   Scoreboard je sticky na top: 75 px a vysoký cca 240–280 px → sidebar začíná pod ním. */
/* Sidebar je VŽDY fixed (mimo flow) na všech desktopech > 992 px.
   - Na velkém displeji (> 1340 px) sedí mimo container, bez kolize s contentem.
   - V rozmezí 993–1339 px je content uvnitř container's pravého paddingu
     (.match-main má padding-right pro prostor pod sidebar).
   Sticky uvnitř gridu nebylo dost spolehlivé (závisí na výšce parent grid cell),
   proto fixní pozice z window scrollu. */
.match-sidebar {
    position: fixed;
    right: 16px;
    top: calc(75px + var(--scoreboard-h, 290px) + 16px);
    max-height: calc(100vh - var(--scoreboard-h, 290px) - 110px);
    overflow-y: auto;
    scrollbar-width: thin;
    z-index: 30;
}

/* Vertikální „bookmark" chips – ve smyslu i vizuálu kopie .home-sidebar .chip,
   ale stojí samostatně, aby na home-page nedošlo k regresi. */
.match-sidebar .chip {
    display: block;
    width: 40px;
    min-height: 130px;
    margin: 0 0 6px auto;
    padding: 14px 6px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 8px 0 0 8px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    transition: width 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.match-sidebar .chip:hover {
    width: 44px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main, #fff);
}

.match-sidebar .chip.active {
    width: 48px;
    background: var(--accent-glow);
    color: var(--accent);
    border-color: var(--accent);
    border-right-color: transparent;
    font-weight: 700;
}

/* --- TABY (jen jedna sekce viditelná v daný moment) --- */
.match-tab[hidden] { display: none; }
.match-tab        { animation: matchTabFade 0.18s ease-out; }

@keyframes matchTabFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- SCOREBOARD (Hlavní panel s výsledkem) --- */
.match-scoreboard {
    background: var(--bg-card);
    padding: 50px 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    margin-top: 24px;
    margin-bottom: 40px;
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 242, 255, 0.05) 0%, rgba(22, 27, 34, 0) 100%);
    box-shadow: 0 15px 50px rgba(0,0,0,0.4);
    /* Default (mobil) = sticky pod navigací. Na desktopu se přepne na fixed
       níže v media query, aby uživatel měl 100% garantovanou pozici scoreboardu
       při scrollu (sticky občas selhává v komplexních flex/grid layoutech). */
    position: sticky;
    top: 75px;
    z-index: 20;
    backdrop-filter: blur(4px);
}

/* Desktop: scoreboard je skutečně fixed (out of flow). Match-layout dostává
   margin-top podle změřené výšky scoreboardu, aby pod ním zbyl prostor.

   Šířka scoreboardu = šířka .match-main (sekce pod ním). Na 993–1339 px má
   .match-main padding-right: 72px (prostor pro fixed sidebar), takže scoreboard
   posouváme o 36px doleva (polovinu offsetu) a zužujeme o 72px. Nad 1340 px
   sedí scoreboard na plné šířce container content (sidebar je mimo container). */
@media (min-width: 993px) {
    .match-scoreboard {
        position: fixed;
        top: 75px;
        left: 50%;
        transform: translateX(calc(-50% - 36px));
        /* min() vybírá menší z dostupné šířky a stropu (container 1200 - padding 40 - sidebar 72). */
        width: min(calc(100vw - 40px - 72px), 1088px);
        margin: 0;
        z-index: 20;
    }
    .match-layout {
        margin-top: calc(var(--scoreboard-h, 290px) + 24px);
    }
}

@media (min-width: 1340px) {
    .match-scoreboard {
        transform: translateX(-50%);
        width: min(calc(100vw - 40px), 1160px);
    }
}

.m-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
    font-weight: 700;
}

.m-main-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.m-team {
    flex: 1;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
}

.m-team a {
    text-decoration: none;
    color: white;
    transition: color 0.2s;
}

.m-team a:hover {
    color: var(--accent);
}

.m-team.home { text-align: right; }
.m-team.away { text-align: left; }

.m-score-box {
    background: #000;
    padding: 20px 35px;
    border-radius: 15px;
    border: 2px solid var(--accent);
    min-width: 160px;
    box-shadow: 0 0 30px var(--accent-glow);
}

.m-score-box .score {
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent);
    display: block;
    line-height: 1;
    letter-spacing: -2px;
}

.m-penalty-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
    font-weight: 600;
    text-transform: uppercase;
}

.m-sub-info {
    margin-top: 30px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* --- HEADER POLOČASU + závěrečná pilulka 1. poločasu --- */
.half-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 32px 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.half-header:first-child {
    margin-top: 0;
}

.half-header-label {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.half-header-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.half-header-extra {
    margin-left: 6px;
    color: var(--accent);
    font-weight: 600;
}

.timeline-half-end {
    margin-bottom: 0;
}

/* Závěrečná pilulka poločasu má jemnější vizuál než „Konec zápasu". */
.te-pill-half {
    border-color: var(--text-muted);
    box-shadow: none;
}

.te-pill-half .te-minute { color: var(--text-muted); }
.te-pill-half .te-label  { color: var(--text-muted); }

/* --- ČASOVÁ OSA ZÁPASU (Timeline gólů) --- */
.match-timeline {
    position: relative;
    padding-left: 30px;
    border-left: 2px solid var(--border);
    margin: 20px 0 40px 10px;
}

.timeline-item {
    margin-bottom: 25px;
    position: relative;
}

/* Minuta jako badge – v split layoutu sedí přímo na centrální ose;
   v jednosloupcovém fallbacku na levé hraniční ose. */
.t-minute {
    font-weight: 800;
    color: var(--accent);
    font-size: 0.85rem;
    background: var(--bg-main);
    border: 2px solid var(--accent);
    border-radius: 999px;
    padding: 3px 10px;
    line-height: 1.2;
    white-space: nowrap;
    display: inline-block;
}

.t-content {
    background: rgba(255,255,255,0.02);
    padding: 12px 18px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: inline-block;
}

.t-assist {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Ikony a popisky uvnitř události na časové ose */
.t-content .t-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

.t-content .t-icon-goal {
    font-size: 1.05rem;
    line-height: 1;
}

/* Hlavní řádek události uvnitř .t-content: ikona + jméno.
   Defaultní směr (hosté) = ikona vlevo. U domácích se přes row-reverse
   ikona dostane napravo od jména (vždy blíže centrální ose). */
.t-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-item.t-home .t-row { flex-direction: row-reverse; }

/* Více ikon (např. ŽK+ČK u druhé žluté) drží pohromadě v jednom flex childu,
   aby row-reverse nepřevracel jejich vnitřní pořadí. */
.t-icons {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Střídání: vstupující hráč nahoře, odcházející dole. */
.t-sub-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.t-sub-out-name {
    color: var(--text-muted);
}

/* Závěrečná značka „Konec zápasu" na konci časové osy */
.timeline-end {
    position: relative;
    text-align: center;
    margin-top: 30px;
    padding-top: 10px;
}

.te-pill {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 10px 22px;
    background: var(--bg-main);
    border: 2px solid var(--accent);
    border-radius: 999px;
    position: relative;
    z-index: 2;
    box-shadow: 0 0 16px var(--accent-glow);
}

.te-minute {
    font-weight: 800;
    color: var(--accent);
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.te-label {
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-size: 0.78rem;
}

/* --- ROZDĚLENÁ ČASOVÁ OSA (domácí vlevo / hosté vpravo) --- */
.match-timeline.timeline-split {
    position: relative;
    padding-left: 0;
    margin: 20px 0 40px;
    border-left: none;
}

.match-timeline.timeline-split::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
    transform: translateX(-50%);
}

.timeline-split .timeline-item {
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 25px;
}

.timeline-split .timeline-item.t-home {
    margin-left: 0;
    padding: 0 50px 0 0;
    text-align: right;
}

.timeline-split .timeline-item.t-away {
    margin-left: 50%;
    padding: 0 0 0 50px;
    text-align: left;
}

/* Minuta sedí přímo na centrální ose. Vertikální offset = padding-top obsahu
   (.t-content má padding 12px) – tím se badge i text první řádky vizuálně srovnají. */
.timeline-split .t-minute {
    position: absolute;
    top: 12px;
    z-index: 3;
}

.timeline-split .timeline-item.t-home .t-minute {
    right: 0;
    transform: translateX(50%);
}

.timeline-split .timeline-item.t-away .t-minute {
    left: 0;
    transform: translateX(-50%);
}

.timeline-split .timeline-item .t-content { text-align: left; }
.timeline-split .timeline-item.t-home .t-content { text-align: right; }

/* Barevné orámování badge minuty podle typu události */
.timeline-item.event-yc  .t-minute { border-color: #e3b341; color: #e3b341; }
.timeline-item.event-yc2 .t-minute,
.timeline-item.event-rc  .t-minute { border-color: #f85149; color: #f85149; }
.timeline-item.event-sub .t-minute { border-color: var(--text-muted); color: var(--text-muted); }

/* Střídání – flex řádek – zarovnáme podle strany */
.timeline-split .timeline-item.t-home .t-sub-row { justify-content: flex-end; }
.timeline-split .timeline-item.t-away .t-sub-row { justify-content: flex-start; }

/* Pod 992 px se osa vrací do jednoho sloupce vlevo, minuta sedí na levé ose */
@media (max-width: 992px) {
    .match-timeline.timeline-split {
        padding-left: 30px;
        border-left: 2px solid var(--border);
    }
    .match-timeline.timeline-split::before { display: none; }

    .timeline-split .timeline-item,
    .timeline-split .timeline-item.t-home,
    .timeline-split .timeline-item.t-away {
        width: 100%;
        margin-left: 0;
        padding: 0 0 0 30px;
        text-align: left;
    }
    .timeline-split .timeline-item .t-content,
    .timeline-split .timeline-item.t-home .t-content { text-align: left; }

    .timeline-split .t-minute,
    .timeline-split .timeline-item.t-home .t-minute,
    .timeline-split .timeline-item.t-away .t-minute {
        left: -30px;
        right: auto;
        transform: translateX(-50%);
    }

    .timeline-split .timeline-item.t-home .t-sub-row,
    .timeline-split .timeline-item.t-away .t-sub-row { justify-content: flex-start; }
}

/* --- SESTAVY (Lineups) ---
   .lineup-container = původní layout (stále používá match-fragment.php — roleta na úvodce).
   .lineup-grid      = nový layout detailu zápasu se sekcemi jako rows přes obě strany,
                       aby Absence/Trenér obou týmů byly výškově zarovnané. */
.lineup-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 30px;
}

.lineup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 50px;
    row-gap: 0;
    align-items: start;
    margin-top: 10px;
}

/* Titulek sekce zabírá obě sloupce – funguje jako oddělovač řádků v gridu */
.lineup-row-title {
    grid-column: 1 / -1;
    margin: 30px 0 12px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.lineup-row-title:first-child {
    margin-top: 0;
}

.lineup-cell {
    min-width: 0;
}

.lineup-column h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    color: #fff;
}

.p-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    transition: background 0.2s;
}

.p-row:hover {
    background: rgba(255,255,255,0.01);
}

.p-shirt {
    width: 28px;
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

.p-name {
    flex-grow: 1;
    text-decoration: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.p-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p-name:hover {
    color: var(--accent);
}

/* --- ZRCADLOVÝ LAYOUT HOSTUJÍCÍHO TÝMU ---
   Domácí (zleva-doprava):  [shirt] [name + badges] [events: ⚽ ŽK ČK ↓]
   Hosté   (zprava-doleva): [events: ↓ ČK ŽK ⚽] [badges + name] [shirt]
   Dosaženo přes flex-direction: row-reverse na .p-row, .p-events i .p-name. */
.lineup-cell[data-side="away"] .p-row     { flex-direction: row-reverse; }
.lineup-cell[data-side="away"] .p-events  { flex-direction: row-reverse; }
.lineup-cell[data-side="away"] .p-name    { flex-direction: row-reverse; }
.lineup-cell[data-side="away"] .p-name-text { text-align: right; }
.lineup-cell[data-side="away"] .lineup-coach-card { text-align: right; }
.lineup-cell[data-side="away"] .lineup-empty      { text-align: right; }

.p-cap {
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8rem;
}

/* Pozice u hráče (zatím jen „BR" = brankář). Vizuálně i pozičně se chová
   stejně jako „(C)" — inline label uvnitř .p-name, jen jiná barva.
   Schema nemá pole Position → identifikace běží přes heuristiku
   „první v shirt-asc pořadí" v šabloně. */
.p-pos-badge {
    color: #fbbf24;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bench-title {
    margin-top: 40px;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

/* --- IKONY UDÁLOSTÍ V SESTAVĚ --- */
.p-events {
    display: flex;
    align-items: center;
    gap: 8px;
}

.y-card { width: 10px; height: 14px; background: #e3b341; border-radius: 2px; box-shadow: 0 0 5px rgba(227, 179, 65, 0.4); }
.r-card { width: 10px; height: 14px; background: #f85149; border-radius: 2px; box-shadow: 0 0 5px rgba(248, 81, 73, 0.4); }

/* Dvojitá žlutá karta = dva žluté obdélníky překryté pod úhlem.
   Druhá karta lehce posunutá vpravo nahoru, takže tvoří „dvojici". */
.yc-double {
    display: inline-flex;
    align-items: center;
    position: relative;
    width: 16px;
    height: 16px;
}

.yc-double .y-card {
    position: absolute;
    top: 1px;
    left: 0;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.yc-double .y-card:first-child {
    transform: rotate(-8deg);
    z-index: 1;
}

.yc-double .y-card:last-child {
    top: 0;
    left: 4px;
    transform: rotate(8deg);
    z-index: 2;
}

.sub-in { border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid #2ea44f; }
.sub-out { border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid #f85149; }

/* Ikona gólu/ů u hráče v soupisce – stejná emoji jako v časové ose */
.p-goal {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 0.9rem;
    line-height: 1;
}

.p-goal-icon {
    font-size: 0.95rem;
    line-height: 1;
}

.p-goal-count {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
}

.p-goal-own {
    opacity: 0.75;
    filter: grayscale(0.4);
}

.p-goal-own .p-goal-count {
    color: #f87171;
}

.lineup-empty {
    margin: 4px 0 12px;
    font-size: 0.85rem;
    font-style: italic;
}

/* Trenér jako poslední karta uvnitř soupisky — jen jméno, bez labelu a podbarvení.
   Drobný padding aby řádek držel sjednocenou výšku se sousedními .p-row. */
.lineup-coach-card {
    padding: 8px 0;
}

.lineup-coach-card .lineup-coach-name {
    color: var(--text-main, #fff);
    font-weight: 600;
}

/* --- STATISTIKY: filtr týmu + tabulka --- */
/* Filtr a hlavička tabulky zůstávají při scrollu zafixované pod scoreboardem. */
.stats-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 -16px 0;
    padding: 12px 16px;
    background: var(--bg-main);
    position: sticky;
    top: calc(75px + var(--scoreboard-h, 290px));
    z-index: 11;
    border-bottom: 1px solid var(--border);
}

.stats-filter-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    font-weight: 700;
    margin-right: 4px;
}

.stats-filter-chip {
    display: inline-block;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.stats-filter-chip:hover {
    color: var(--text-main, #fff);
    background: rgba(255, 255, 255, 0.05);
}

.stats-filter-chip.active {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
    font-weight: 700;
}

.match-stats-table tbody tr[data-hidden="true"] { display: none; }

/* Wrapper kolem tabulky statistik. Neaktivujeme overflow-x:auto na desktopu,
   protože overflow blokuje position:sticky uvnitř (sticky thead pak nedrží
   pod stats-controls, ale uvnitř kontejneru → vypadá rozbitě). */
.match-stats-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 25px;
}

@media (max-width: 768px) {
    /* Na úzkém displeji obětujeme sticky thead pro horizontální scroll. */
    .match-stats-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .match-stats-table thead th { position: static !important; }
}

/* Sticky hlavička tabulky statistik – drží těsně pod stats-controls.
   border-collapse: separate je nezbytné, jinak Chrome ztrácí spodní border. */
.match-stats-table {
    border-collapse: separate;
    border-spacing: 0;
}

.match-stats-table thead th {
    position: sticky;
    top: calc(75px + var(--scoreboard-h, 290px) + var(--stats-controls-h, 56px));
    background: var(--bg-card);
    z-index: 10;
    box-shadow: inset 0 -1px 0 var(--border);
}

/* Aktivní sort column: --accent-glow je RGBA s 0.15 alpha → skrz prosvítají
   řádky tbody. Vrstvíme glow nad solidním bg-card, takže pozadí je neprůhledné. */
.match-stats-table thead th.stat-active,
.match-stats-table thead th[data-dir] {
    background:
        linear-gradient(var(--accent-glow), var(--accent-glow)),
        var(--bg-card);
}

/* --- H2H: seznam zápasů (mini-row formát) --- */
.h2h-block {
    margin-bottom: 36px;
}

.h2h-block:last-child {
    margin-bottom: 0;
}

.h2h-block .section-header {
    margin-bottom: 14px;
}

.h2h-block .section-header h3 {
    font-size: 1rem;
    margin: 0;
}

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

.h2h-item[hidden] { display: none; }

.h2h-row {
    display: grid;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--border);
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 0.9rem;
    transition: border-color 0.15s ease, background 0.15s ease;
}

/* „Posledních N zápasů" – 6 sloupců včetně V/R/P badge na levé straně */
.h2h-list-recent .h2h-row {
    grid-template-columns: 28px 88px 1fr 80px 1fr 140px;
}

/* „Vzájemné zápasy" – bez badge, 5 sloupců */
.h2h-list-mutual .h2h-row {
    grid-template-columns: 88px 1fr 80px 1fr 140px;
}

.h2h-row:hover {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.02);
}

/* Výsledek z perspektivy target týmu: levý border + barevný badge */
.h2h-result-W { border-left-color: #2ea44f; }
.h2h-result-D { border-left-color: #e3b341; }
.h2h-result-L { border-left-color: #f85149; }

.h2h-result-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: var(--text-muted);
    line-height: 1;
}

.h2h-result-W .h2h-result-badge { background: #2ea44f; }
.h2h-result-D .h2h-result-badge { background: #e3b341; color: #1a1a1a; }
.h2h-result-L .h2h-result-badge { background: #f85149; }

/* Vítěz / poražený v každém H2H řádku.
   Vítěz: zachová bílou + bold (jako default), poražený se zploští do šedé. */
.h2h-team-winner {
    color: var(--text-main, #fff);
    font-weight: 700;
}

.h2h-team-loser {
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0.7;
}

.h2h-date {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.h2h-team {
    font-weight: 600;
    color: var(--text-main, #fff);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.h2h-home { text-align: right; }
.h2h-away { text-align: left; }

.h2h-score {
    text-align: center;
    font-weight: 800;
    color: var(--accent);
    font-size: 1rem;
}

.h2h-comp {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.expand-toggle {
    margin-top: 12px;
    padding: 8px 16px;
    background: transparent;
    border: 1px dashed var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.expand-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    border-style: solid;
}

.expand-remaining {
    margin-left: 6px;
    opacity: 0.7;
    font-size: 0.78rem;
}

/* --- TABULKA: zvýraznění řádků obou týmů z detailu --- */
.standings-row-home,
.standings-row-away {
    background: var(--accent-glow);
    box-shadow: inset 3px 0 0 var(--accent);
}

.standings-row-home td,
.standings-row-away td {
    font-weight: 600;
}

/* --- RESPONZIVITA --- */
@media (max-width: 992px) {
    .m-main-row { gap: 20px; }
    .m-team { font-size: 1.4rem; }
    .m-score-box { min-width: 120px; padding: 15px 20px; }
    .m-score-box .score { font-size: 2.8rem; }
    .lineup-container { grid-template-columns: 1fr; gap: 40px; }
    .lineup-grid      { grid-template-columns: 1fr; column-gap: 0; }
    .lineup-row-title { margin-top: 24px; }

    /* Sidebar pod scoreboard, taby horizontálně jako pillboxes */
    .match-main { padding-right: 0; }
    .match-sidebar {
        position: static;
        top: auto;
        right: auto;
        max-height: none;
        overflow: visible;
        margin-bottom: 20px;
    }
    .match-sidebar .sidebar-section {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        justify-content: center;
        margin-bottom: 14px;
    }
    .match-sidebar .sidebar-title {
        writing-mode: horizontal-tb;
        transform: none;
        flex-basis: 100%;
        text-align: center;
        margin-bottom: 6px;
        padding-bottom: 4px;
    }
    .match-sidebar .chip {
        display: inline-block;
        width: auto !important;
        min-height: 0;
        margin: 0;
        padding: 6px 14px;
        writing-mode: horizontal-tb;
        transform: none;
        border: 1px solid var(--border);
        border-radius: 999px;
        text-align: center;
        font-size: 0.85rem;
    }
    .match-sidebar .chip.active {
        border-color: var(--accent);
    }

    /* H2H mini-row: kompaktní layout, kompetice + datum schované */
    .h2h-list-recent .h2h-row {
        grid-template-columns: 22px 1fr 70px 1fr;
        gap: 10px;
    }
    .h2h-list-mutual .h2h-row {
        grid-template-columns: 1fr 70px 1fr;
        gap: 10px;
    }
    .h2h-date,
    .h2h-comp {
        display: none;
    }
    .h2h-result-badge {
        width: 22px;
        height: 22px;
    }
}

@media (max-width: 600px) {
    .match-scoreboard { padding: 30px 20px; }
    .m-main-row { flex-direction: column; gap: 15px; }
    .m-team { font-size: 1.6rem; text-align: center !important; }

    .h2h-row {
        font-size: 0.85rem;
        padding: 8px 10px;
    }
}