/* Ligová tabulka (Table.render) - sdílí ji hlavní web i embed tabulka.html.
   Používá jen tokeny, které definují obě stránky: --cba-red, --surface,
   --surface2, --border, --text, --text2, --muted, --win, --loss, --draw,
   --zone-top, --zone-playoff, --zone-relegation, --cba-blue.
   Jediný výrazný prvek je červený sloupec bodů; zbytek je záměrně tichý. */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.lt-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.lt-table th { font-size: 0.72rem; font-weight: 600; color: var(--text2); padding: 8px 6px; text-align: center; white-space: nowrap; }
.lt-table th.lt-l, .lt-table td.lt-l { text-align: left; }
.lt-table td { padding: 11px 6px; text-align: center; color: var(--text); border-top: 1px solid var(--border); font-variant-numeric: tabular-nums; }

.lt-row { cursor: pointer; position: relative; }
.lt-row:hover td:not(.lt-pts), .lt-row.open td:not(.lt-pts) { background: var(--surface2); }
.lt-row:focus-visible { outline: 2px solid var(--cba-blue); outline-offset: -2px; }

.lt-pos { width: 64px; padding-left: 16px !important; text-align: left !important; white-space: nowrap; box-shadow: inset 4px 0 0 transparent; transition: box-shadow 0.3s; }
.lt-z-final-four, .lt-z-top { box-shadow: inset 4px 0 0 var(--zone-top); }
.lt-z-playoff { box-shadow: inset 4px 0 0 var(--zone-playoff); }
.lt-z-relegation { box-shadow: inset 4px 0 0 var(--zone-relegation); }
.lt-posnum { display: inline-block; min-width: 20px; font-weight: 800; font-size: 1.15rem; }
.lt-delta { font-size: 0.66rem; font-weight: 700; margin-left: 2px; transition: opacity 0.3s; }
.lt-delta.up { color: var(--win); }
.lt-delta.down { color: var(--loss); }

.lt-team { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lt-name { font-weight: 700; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt-name-short { display: none; }

/* Logo klubu v bílém kolečku - stejné všude na webu (viz .club-logo ve styles.css) */
.lt-logo { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px var(--border); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.lt-logo img { display: block; max-width: 70%; max-height: 70%; object-fit: contain; }
.lt-logo-empty { background: var(--surface2); color: var(--text2); font-size: 0.7rem; font-weight: 800; }

.lt-pm { font-weight: 700; }
.lt-pm.plus { color: var(--win); }
.lt-pm.minus { color: var(--loss); }
.lt-ratio { display: block; font-size: 0.68rem; color: var(--muted); font-weight: 500; margin-top: 1px; }

/* Forma - čtverečky V/R/P, stejné u týmů i hráčů */
.lt-form { display: inline-flex; gap: 2px; vertical-align: middle; }
.lt-form span { width: 16px; height: 16px; border-radius: 3px; font-size: 0.58rem; font-weight: 800; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.lt-form .w { background: var(--win); }
.lt-form .l { background: var(--loss); }
.lt-form .d { background: var(--draw); }
.lt-form .e { background: var(--border); }

/* Hlavní metrika = červený pruh přes celý sloupec */
.lt-table { --lt-pts-w: 64px; }
.lt-table th.lt-pts, .lt-table td.lt-pts { width: var(--lt-pts-w); min-width: var(--lt-pts-w); box-sizing: border-box; }
.lt-table th.lt-pts { color: #fff; background: var(--cba-red); font-weight: 700; }
.lt-table td.lt-pts { background: var(--cba-red); color: #fff; font-size: 1.35rem; font-weight: 800; border-top-color: rgba(255,255,255,0.18); }

.lt-divider td { padding: 10px 6px 4px 20px; font-size: 0.74rem; font-weight: 700; text-align: left; border-top: 0;
    background: linear-gradient(to left, var(--cba-red) var(--lt-pts-w), transparent var(--lt-pts-w)); }
.lt-divider.playoff td { color: var(--zone-playoff); }
.lt-divider.relegation td { color: var(--zone-relegation); }
.lt-divider.top td { color: var(--zone-top); }

/* Rozbalení týmu - plynule přes grid-template-rows */
.lt-detail > td { padding: 0 var(--lt-pts-w) 0 0; text-align: left; border-top: 0;
    background: linear-gradient(to left, var(--cba-red) var(--lt-pts-w), var(--surface2) var(--lt-pts-w)); }
.lt-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.32s cubic-bezier(.2,.8,.2,1); }
.lt-collapse.open { grid-template-rows: 1fr; }
.lt-collapse-in { overflow: hidden; min-height: 0; }
.lt-collapse-pad { padding: 4px 0 14px; opacity: 0; transform: translateY(-4px); transition: opacity 0.2s, transform 0.32s cubic-bezier(.2,.8,.2,1); }
.lt-collapse.open .lt-collapse-pad { opacity: 1; transform: none; transition-delay: 0.06s; }

.lt-results { margin: 0 20px 0 80px; border-collapse: collapse; width: calc(100% - 100px); font-size: 0.8rem; }
.lt-results td { border-top: 1px solid var(--border); padding: 7px 8px; text-align: left; background: none !important; }
.lt-results tr:first-child td { border-top: 0; }
.lt-results .lt-kolo { width: 64px; color: var(--text2); white-space: nowrap; }
.lt-results .lt-misto { width: 44px; color: var(--text2); }
.lt-results .lt-souper { font-weight: 700; }
.lt-results .lt-souper .lt-logo { width: 26px; height: 26px; vertical-align: middle; margin-right: 8px; }
.lt-results .lt-skore { width: 48px; text-align: right; font-weight: 800; font-size: 0.95rem; }
.lt-results .lt-skore.w { color: var(--win); }
.lt-results .lt-skore.l { color: var(--loss); }
.lt-results .lt-skore.d { color: var(--draw); }
.lt-detail-link { margin: 6px 20px 0 88px; font-size: 0.76rem; }
.lt-detail-link button { font: inherit; font-weight: 700; color: var(--cba-red); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.lt-empty-results { margin: 2px 20px 0 88px; font-size: 0.78rem; color: var(--text2); }
.lt-mobile-extra { display: none; }
.lt-pending { display: inline-block; margin-left: 6px; font-size: 0.62rem; font-weight: 700; color: var(--draw); }

.lt-foot { padding: 14px 20px 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.74rem; color: var(--text2); border-top: 1px solid var(--border); }
.lt-foot i { display: inline-block; width: 4px; height: 12px; margin-right: 6px; vertical-align: -2px; }
.lt-foot .lt-bod { flex-basis: 100%; }
.lt-foot .lt-note { flex-basis: 100%; font-style: italic; }

/* Animace pořadí po novém kole (Table.animujPoradi) */
.lt-row.moving { z-index: 2; }
.lt-row.moving td { background: var(--surface); }
.lt-row.moving td.lt-pts { background: var(--cba-red); }
.lt-table.intro .lt-delta { opacity: 0; }
.lt-table.intro .lt-pos { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
    .lt-collapse, .lt-collapse-pad, .lt-delta, .lt-pos { transition: none !important; }
}

@media (max-width: 640px) {
    .lt-col-wide { display: none; }
    .lt-name-full { display: none; }
    .lt-name-short { display: inline; }
    .lt-logo { width: 34px; height: 34px; }
    .lt-team { gap: 9px; }
    .lt-pos { width: 52px; padding-left: 12px !important; }
    .lt-table { --lt-pts-w: 52px; }
    .lt-table td.lt-pts { font-size: 1.15rem; }
    .lt-results { margin: 0 12px; width: calc(100% - 24px); table-layout: fixed; }
    .lt-results .lt-misto, .lt-results .lt-datum { display: none; }
    .lt-results .lt-kolo { width: 56px; }
    .lt-results .lt-souper { display: flex; align-items: center; min-width: 0; }
    .lt-results .lt-souper span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .lt-detail-link, .lt-empty-results { margin-left: 12px; }
    .lt-mobile-extra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; margin: 4px 12px 6px; font-size: 0.72rem; color: var(--text2); }
    .lt-mobile-extra b { color: var(--text); margin-left: 4px; }
    .lt-foot { padding: 12px 14px 16px; }
}

/* Play-off pavouk: bílé zápasy, zóny jako proužek, skóre série v červeném pruhu */
.playoff-match {
    background: var(--surface);
    backdrop-filter: none; -webkit-backdrop-filter: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 0 0;
    box-shadow: none;
    overflow: hidden;
    transition: background 0.15s;
}
.playoff-match:hover { transform: none; box-shadow: none; border-color: var(--text2); }
.playoff-match-label { font-size: 0.72rem; font-weight: 600; color: var(--text2); padding: 0 12px; margin-bottom: 6px; }
.playoff-match-teams { gap: 0; }
.playoff-vs, .playoff-series-result { display: none; }
.playoff-team,
.playoff-team-green, .playoff-team-blue, .playoff-team-east, .playoff-team-west,
.playoff-team-orange, .playoff-team-red, .playoff-team-pending,
.playoff-team-placement-5, .playoff-team-placement-7 {
    background: none;
    border: 0;
    border-top: 1px solid var(--border);
    border-radius: 0;
    padding: 0 0 0 12px;
    min-height: 40px;
    gap: 8px;
    box-shadow: inset 4px 0 0 transparent;
}
.playoff-team-green { box-shadow: inset 4px 0 0 var(--zone-top); }
.playoff-team-blue, .playoff-team-west { box-shadow: inset 4px 0 0 var(--zone-playoff); }
.playoff-team-east { box-shadow: inset 4px 0 0 var(--draw); }
.playoff-team-red { box-shadow: inset 4px 0 0 var(--zone-relegation); }
.playoff-team-orange { box-shadow: inset 4px 0 0 #f97316; }
.playoff-team-pending .playoff-team-name { color: var(--muted); font-weight: 500; }
.playoff-seed,
.playoff-team-green .playoff-seed, .playoff-team-blue .playoff-seed, .playoff-team-east .playoff-seed,
.playoff-team-west .playoff-seed, .playoff-team-orange .playoff-seed, .playoff-team-red .playoff-seed,
.playoff-team-placement-5 .playoff-seed, .playoff-team-placement-7 .playoff-seed {
    background: none; color: var(--text); width: auto; min-width: 22px; height: auto; border-radius: 0;
    font-size: 0.8rem; font-weight: 800; justify-content: flex-start;
}
.playoff-team-logo { width: 26px; height: 26px; }
.playoff-team-name { font-weight: 700; }
.playoff-series-score {
    align-self: stretch; display: flex; align-items: center; justify-content: center;
    min-width: 40px; margin-left: auto;
    background: var(--cba-red); color: #fff; font-weight: 800; font-size: 1rem;
    border-top: 0;
}

.playoff-team-logo { background: #fff; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); padding: 3px; object-fit: contain; box-sizing: border-box; }

/* Embed tabulka.html: soutěže a pohledy jako podtržené záložky */
.widget .soutez-tabs, .widget .view-toggle { display: inline-flex; gap: 0; background: none; border: 0; border-bottom: 2px solid var(--border); border-radius: 0; padding: 0; }
.widget .soutez-tab, .widget .view-toggle-btn {
    font: inherit; font-size: 0.8rem; font-weight: 700; color: var(--text2);
    background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; box-shadow: none;
    padding: 6px 12px; margin-bottom: -2px; cursor: pointer; transition: color 0.2s, border-color 0.25s;
}
.widget .soutez-tab:hover, .widget .view-toggle-btn:hover { color: var(--text); background: none; }
.widget .soutez-tab.active, .widget .view-toggle-btn.active { color: var(--cba-red); border-bottom-color: var(--cba-red); background: none; box-shadow: none; }
.widget .card { border: 0; border-radius: 16px; box-shadow: var(--shadow); background: var(--surface); }

/* Přepínání pohledů a soutěží: podtržení přejede, obsah se prolne */
.lt-tabs-ink { position: relative; }
.lt-tabs-ink > .active { border-bottom-color: transparent !important; }
.lt-ink { position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--cba-red); pointer-events: none; }
.lt-ink-ready .lt-ink { transition: transform 0.28s cubic-bezier(.2,.8,.2,1), width 0.28s cubic-bezier(.2,.8,.2,1); }
.lt-enter { animation: ltEnter 0.22s ease-out both; }
@keyframes ltEnter { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .lt-ink-ready .lt-ink { transition: none; }
    .lt-enter { animation: none; }
}
