/* Плотность UI: normal / compact (~1024×768) — без zoom всего viewport. */
:root {
    --ui-font: 14px;
    --work-btn-pad-y: 8px;
    --work-btn-pad-x: 16px;
    --work-btn-font: 14px;
    --header-title-size: 1.35rem;
    --ct-font: 14px;
    --ct-th-font: 15px;
    --ct-name-font: 15px;
    --ct-row-h: 28px;
    --ct-name-max: 220px;
    --ct-opp-w: 28px;
    /* Чуть уже — 4 колонки (1/16…½) в ряд на типичной правой панели. */
    --ko-col-w: 212px;
    --ko-col-gap: 16px;
    --ko-slot-min-h: 26px;
    --ko-slot-font: 14px;
    --ko-title-font: 13px;
    --list-row-pad-y: 8px;
    --app-toolbar-gap: 10px;
}

a.nav-btn {
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

.tournaments-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 0 16px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.tournaments-filter select {
    min-width: 120px;
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font: inherit;
}

.hub-create-btn {
    flex: 0 0 auto;
    margin-left: 4px;
    white-space: nowrap;
}

.hub-create-btn__short {
    display: none;
}

.club-switcher--after-home {
    margin-right: 4px;
    max-width: min(280px, 28vw);
}

.club-switcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.club-switcher__prefix {
    white-space: nowrap;
}

.clubs-modal {
    max-width: 720px;
    width: calc(100% - 32px);
}

.players-visibility-modal {
    max-width: 980px;
}

/* Окно правки/создания игрока поверх модалки «Игроки» (Сервис). */
#modal-backdrop {
    z-index: 1100;
}

#editPlayerModal,
#createPlayerModal {
    z-index: 1300;
}

.players-visibility-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.players-visibility-col__title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--primary, #336e78);
}

.players-visibility-list {
    width: 100%;
    min-height: 280px;
    box-sizing: border-box;
    border: 1px solid #c5ced6;
    border-radius: 8px;
    padding: 4px;
    font: inherit;
}

.players-visibility-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding-top: 22px;
}

.players-visibility-actions .work-btn {
    min-width: 44px;
    padding-left: 10px;
    padding-right: 10px;
}

@media (max-width: 640px) {
    .players-visibility-grid {
        grid-template-columns: 1fr;
    }

    .players-visibility-actions {
        flex-direction: row;
        justify-content: center;
        padding-top: 0;
    }
}

.clubs-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.clubs-modal__header h2 {
    text-align: left;
    color: var(--primary, #336e78);
}

.club-usb-block {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(51, 110, 120, 0.18);
}

.club-import-preview {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(51, 110, 120, 0.06);
    border-radius: 8px;
}

.club-import-changes {
    margin: 0;
    padding-left: 18px;
    max-height: 220px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
}

.club-import-changes .club-import-add {
    color: #1b6b3a;
}

.club-import-changes .club-import-del {
    color: #8a3030;
}

.club-switcher__select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.95);
    color: var(--primary, #336e78);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 30px;
    padding: 9px 36px 9px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    max-width: min(240px, 42vw);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23336e78' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.club-switcher__select:disabled {
    opacity: 0.75;
    cursor: default;
}

.club-switcher__select:focus {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 2px;
}

.app-panel {
    max-width: 960px;
    margin: 28px auto;
    background: #fff;
    padding: 28px 32px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* Турнир: на всю ширину окна (шахматка | туры), без боковых «полей» 960px. */
.app-panel.tournament-view {
    max-width: none;
    width: auto;
    margin: 12px 16px 20px;
    padding: 8px 20px 20px;
    box-sizing: border-box;
}

.app-panel h1 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.6rem;
}

.app-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--app-toolbar-gap);
    align-items: center;
    margin-bottom: 18px;
}

.app-toolbar #page-title {
    flex: 1 1 auto;
    min-width: 0;
}

.app-toolbar-back {
    flex: 0 0 auto;
    margin-left: auto;
}

.app-panel.tournament-view .app-toolbar {
    margin-bottom: 4px;
    flex-wrap: nowrap;
    align-items: flex-start;
}

.app-panel.tournament-view .tournament-head {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 14px;
    row-gap: 6px;
}

.app-panel.tournament-view .app-toolbar #page-title {
    font-size: var(--header-title-size);
    line-height: 1.35;
    margin: 0;
    flex: 0 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-panel.tournament-view .page-round {
    font-weight: 700;
    font-size: 1.15rem;
    color: #222;
    white-space: nowrap;
    flex: 0 0 auto;
}

.app-panel.tournament-view .tournament-actions {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
}

.page-round {
    font-weight: 700;
    font-size: 1.15rem;
    color: #222;
}

.page-round.page-round--arena {
    color: #1b5e20;
}

.page-round.page-round--arena-expired {
    color: #e65100;
}

.modal.modal--params {
    max-width: 440px;
}

/* «Свойства турнира» поверх окна создания (#edit-form, z-index 1200). */
#tournament-properties-backdrop {
    z-index: 1400;
}

#tournament-properties-modal {
    z-index: 1500;
}

.modal.modal--export {
    max-width: 420px;
}

.export-format-buttons {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.params-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.params-row {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 10px;
    align-items: baseline;
}

.params-key {
    color: #666;
    font-size: 1.05rem;
}

.params-val {
    font-weight: 600;
    font-size: 1.1rem;
    color: #222;
    word-break: break-word;
}

.modal.modal--params > h2 {
    font-size: 1.35rem;
}

.app-panel.tournament-view .tournament-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 0 !important;
}

.app-panel.tournament-view .app-meta {
    display: none;
    margin: 0;
    min-height: 0;
}

.app-panel.tournament-view #form-error:empty {
    display: none;
    margin: 0;
    min-height: 0;
    padding: 0;
}

.app-panel.tournament-view #view-actions .work-btn {
    margin: 0;
    padding: var(--work-btn-pad-y) var(--work-btn-pad-x);
    font-size: var(--work-btn-font);
}

/* Швейцарка/арена: Итоговая / Шахматка [/ Шкала]; нокаут/каскад: Итоговая / Сетка. */
.standings-view-toggle {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid #b8bec8;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    flex: 0 0 auto;
}

.standings-view-toggle__btn {
    margin: 0;
    border: 0;
    border-right: 1px solid #b8bec8;
    background: transparent;
    color: #333;
    font: inherit;
    font-size: var(--work-btn-font, 0.95rem);
    padding: var(--work-btn-pad-y, 6px) var(--work-btn-pad-x, 12px);
    cursor: pointer;
    line-height: 1.2;
    white-space: nowrap;
}

.standings-view-toggle__btn:last-of-type {
    border-right: 0;
}

.standings-view-toggle__btn:hover {
    background: #f0f2f5;
}

.standings-view-toggle__btn.is-active {
    background: #1976d2;
    color: #fff;
}

.standings-view-toggle__btn.is-active:hover {
    background: #1565c0;
}

/* Мобильный селект вместо кнопок вида — на ПК скрыт. */
.standings-view-select {
    display: none;
    width: 100%;
    min-height: 42px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #c5d0d4;
    border-radius: 8px;
    background: #fff;
    color: #234;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.browse-hub__mobile-select-label {
    display: none;
}

/* Арена: шкала «Время за доской». */
.arena-board-time {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    align-self: stretch;
}

/* В .ko-bracket-wrap (align-items:flex-start) иначе шкала сжимается и появляются поля. */
.ko-bracket-wrap > .arena-board-time {
    align-self: stretch;
    width: 100%;
}

/* Шкала на всю ширину панели — без боковых отступов standings. */
.app-panel.tournament-view #standings.pairings-board:has(.arena-board-time) {
    padding-left: 0;
    padding-right: 0;
}

.arena-board-time__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin: 0 0 8px;
    padding: 0;
    font-size: 0.85rem;
    color: #555;
}

.arena-board-time__swatch {
    display: inline-block;
    width: 18px;
    height: 10px;
    margin-right: 4px;
    border: 1px solid #9aa3ad;
    vertical-align: middle;
    box-sizing: border-box;
}

.arena-board-time__swatch--pieces-white {
    background: #f2f2f2;
    border-color: #9aa3ad;
}

.arena-board-time__swatch--pieces-black {
    background: #9e9e9e;
    border-color: #757575;
}

.arena-board-time__swatch--win {
    background: #2e7d32;
    border-color: #2e7d32;
}

.arena-board-time__swatch--loss {
    background: #c62828;
    border-color: #c62828;
}

.arena-board-time__swatch--idle {
    background: #fff;
}

/* Одна сетка: колонка ФИО = ширина самого длинного имени. */
.arena-board-time__list {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    column-gap: 8px;
    width: 100%;
    border: 1px solid #c5ccd6;
    background: #fff;
    box-sizing: border-box;
}

.arena-board-time__row {
    display: contents;
}

.arena-board-time__name {
    padding: 5px 0 5px 6px;
    border-bottom: 1px solid #e4e7ec;
    white-space: nowrap;
    font-size: 0.92rem;
    color: #222;
    align-self: center;
    box-sizing: border-box;
}

.arena-board-time__track {
    position: relative;
    height: 18px;
    margin: 5px 6px 5px 0;
    padding: 0;
    border: 1px solid #9aa3ad;
    border-bottom: 1px solid #9aa3ad;
    background: #fff;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
    align-self: center;
}

.arena-board-time__row:last-child > .arena-board-time__name,
.arena-board-time__row:last-child > .arena-board-time__track {
    border-bottom-color: transparent;
}

.arena-board-time__row--alt > .arena-board-time__name {
    background: #f7f8fa;
}

.arena-board-time__name--link {
    cursor: pointer;
    color: #1565c0;
}

.arena-board-time__name--link:hover {
    text-decoration: underline;
}

.arena-board-time__play {
    position: absolute;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    min-width: 1px;
    overflow: hidden;
    cursor: default;
}

.arena-board-time__play[data-tip] {
    cursor: help;
}

.arena-board-time__play[data-tip-opponent-id] {
    cursor: pointer;
}

.standings-data-tip,
.arena-board-time__tip {
    position: absolute;
    z-index: 20;
    max-width: min(360px, 92%);
    padding: 6px 8px;
    border: 1px solid #8a97a5;
    border-radius: 6px;
    background: #5b6775;
    color: #f4f6f8;
    font-size: 0.82rem;
    line-height: 1.35;
    white-space: normal;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(40, 50, 60, 0.22);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

/* display:flex иначе перебивает [hidden] — остаётся чёрный «уголок» padding+border. */
.standings-data-tip[hidden],
.arena-board-time__tip[hidden] {
    display: none !important;
}

.standings-data-tip__names {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
}

.standings-data-tip__vs {
    color: #d5dde5;
    font-weight: 600;
    flex: 0 0 auto;
}

.standings-data-tip__name {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
}

.standings-data-tip__name--pieces-white {
    background: #f2f2f2;
}

.standings-data-tip__name--pieces-black {
    background: #9e9e9e;
}

.standings-data-tip__name--win {
    color: #2e7d32;
}

.standings-data-tip__name--pieces-black.standings-data-tip__name--win {
    color: #2e7d32;
}

.standings-data-tip__name--loss {
    color: #c62828;
}

.standings-data-tip__name--pieces-black.standings-data-tip__name--loss {
    color: #c62828;
}

.standings-data-tip__name--draw {
    color: #000;
}

.standings-data-tip__name--pieces-black.standings-data-tip__name--draw {
    color: #000;
}

.standings-data-tip__name--pending {
    color: #1565c0;
}

.standings-data-tip__name--pieces-black.standings-data-tip__name--pending {
    color: #90caf9;
}

.standings-data-tip__meta {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.standings-data-tip__h2h {
    color: #e8eef3;
    font-size: 0.78rem;
    white-space: nowrap;
}

.standings-data-tip__duration {
    color: #d5dde5;
    font-size: 0.78rem;
    white-space: nowrap;
}

.swiss-final-table td.swiss-final-game-tip {
    cursor: help;
}

.swiss-final-table td.swiss-final-game-tip[data-tip-opponent-id] {
    cursor: pointer;
}

.crosstable td.ct-game-tip {
    cursor: help;
}

.crosstable td.ct-game-tip[data-tip-opponent-id] {
    cursor: pointer;
}

.arena-board-time__half {
    flex: 1 1 50%;
    min-height: 0;
    display: block;
}

.arena-board-time__half--top {
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
}

.arena-board-time__half--pieces-white {
    background: #f2f2f2;
}

.arena-board-time__half--pieces-black {
    background: #9e9e9e;
}

.arena-board-time__half--win {
    background: #2e7d32;
}

.arena-board-time__half--loss {
    background: #c62828;
}

.arena-board-time__half--draw {
    background: #000;
}

.arena-board-time__half--pending {
    background: #90caf9;
}

.arena-board-time__gap {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #fff;
    z-index: 1;
}

body.tournament-guest-fs .arena-board-time__name--link {
    cursor: default;
    color: #222;
    text-decoration: none;
}

body.ct-watch-page .arena-board-time {
    max-width: none;
    padding: 0;
}

@media (max-width: 640px) {
    .standings-view-toggle {
        flex-wrap: wrap;
    }
}

.tournament-head {
    flex: 1 1 auto;
    min-width: 0;
}

.app-panel.tournament-view #view-panel.is-visible {
    display: block;
}

.app-panel.tournament-view #standings.pairings-board {
    margin-top: 0;
}

.app-panel.tournament-view #pairings.pairings-board,
.tournament-view #pairings.pairings-board {
    margin-top: 12px;
}

/* Нет туров — только шахматка/сетка. */
.app-panel.tournament-view #view-panel.is-visible.no-rounds #pairings.pairings-board {
    display: none;
}

/* Партии слева по ширине таблицы (без пустоты правее «Чёрные»), шахматка справа. */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0 0;
    align-items: stretch;
    min-height: calc(100vh - 170px);
}

/* Компактнее слева — тоже по содержимому. */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0 0;
    align-items: stretch;
    min-height: calc(100vh - 170px);
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #standings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #standings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board {
    margin-top: 0;
    height: calc(100vh - 170px);
    max-height: calc(100vh - 170px);
    overscroll-behavior: contain;
    min-width: 0;
    box-sizing: border-box;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #standings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #standings.pairings-board {
    /* H-скролл только у .swiss-final-standings; шахматка — fitCrosstable. */
    overflow-x: hidden;
    overflow-y: auto;
}

/* DOM: standings затем pairings — order ставит партии слева. */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board {
    order: 1;
    border-right: 1px solid #dcdfe6;
    border-left: none;
    padding-left: 4px;
    padding-right: 4px;
    /* Колонка по ширине таблицы; только вертикальный скролл (без max-width — иначе H-полосы в каждом туре). */
    width: fit-content;
    max-width: none;
    min-width: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board .pairings-scroll,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board .pairings-scroll {
    display: contents;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board .pairings-scroll-inner,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board .pairings-scroll-inner {
    width: max-content;
    box-sizing: border-box;
}

/* Не плодить H-скролл на каждый тур — таблица задаёт ширину колонки. */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board .round-block .table-scroll,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board .round-block .table-scroll {
    overflow: visible;
    width: max-content;
    max-width: none;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board .data-table,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board .data-table {
    width: max-content;
    max-width: none;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #standings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #standings.pairings-board {
    order: 2;
    /* Отступ от разделителя и скроллбара левой панели (иначе таблица «наезжает»). */
    padding-left: 16px;
    padding-right: 4px;
    min-width: 0;
    overflow-x: hidden;
}

/* Каскад мест: сетка дальше от вертикальной линии; без H-скролла (колонки переносятся). */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side.format-cascade-places #standings.pairings-board,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide.format-cascade-places #standings.pairings-board {
    padding-left: 20px;
    overflow-x: hidden;
}

/* Компактные туры: split-wide и телефон (stack) — пара = две строки. */
.app-panel.tournament-view #view-panel.split-wide .round-block--compact .round-block__title-row h2,
.app-panel.tournament-view #view-panel.split-wide .round-block--compact h2,
.app-panel.tournament-view #view-panel.split-stack .round-block--compact .round-block__title-row h2,
.app-panel.tournament-view #view-panel.split-stack .round-block--compact h2 {
    font-size: 1rem;
    margin-bottom: 0;
}

.app-panel.tournament-view #view-panel.split-wide .data-table--pairing-compact,
.app-panel.tournament-view #view-panel.split-stack .data-table--pairing-compact {
    font-size: 13px;
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
}

.app-panel.tournament-view #view-panel.split-wide .data-table--pairing-compact th,
.app-panel.tournament-view #view-panel.split-wide .data-table--pairing-compact td,
.app-panel.tournament-view #view-panel.split-stack .data-table--pairing-compact th,
.app-panel.tournament-view #view-panel.split-stack .data-table--pairing-compact td {
    padding: 4px 6px;
    vertical-align: top;
    word-break: break-word;
    white-space: normal;
}

.app-panel.tournament-view #view-panel.split-wide .pairing-compact-row td,
.app-panel.tournament-view #view-panel.split-stack .pairing-compact-row td {
    vertical-align: top;
    padding-top: 6px;
    padding-bottom: 8px;
}

.app-panel.tournament-view #view-panel.split-wide .pairing-compact-row .pairing-result-done,
.app-panel.tournament-view #view-panel.split-stack .pairing-compact-row .pairing-result-done {
    color: #222;
    font-weight: 700;
}

.pairing-result-done {
    font-weight: 700;
}

.app-panel.tournament-view #view-panel.split-wide .pairing-compact-names,
.app-panel.tournament-view #view-panel.split-stack .pairing-compact-names {
    font-weight: 600;
    line-height: 1.25;
}

.app-panel.tournament-view #view-panel.split-wide .pairing-compact-vs,
.app-panel.tournament-view #view-panel.split-stack .pairing-compact-vs {
    color: #888;
    font-weight: 400;
    margin: 0 2px;
}

/* Компактная колонка wide: кнопки мельче и с переносом. */
.app-panel.tournament-view #view-panel.split-wide .result-btns {
    flex-wrap: wrap;
    gap: 4px;
}

.app-panel.tournament-view #view-panel:not(.split-wide):not(.split-stack) .result-btns {
    flex-wrap: nowrap;
}

.app-panel.tournament-view #view-panel.split-wide .btn-result {
    padding: 4px 6px;
    font-size: 12px;
    min-width: 0;
}

/*
 * Смартфон: ФИО слева, кнопки справа 2×2.
 * Важно перебить десктопные width:4.25rem / overflow:hidden у .result-cell —
 * иначе кнопки схлопываются и «пропадают».
 */
.app-panel.tournament-view #view-panel.split-stack .round-block--compact .data-table--pairing-compact,
.app-panel.tournament-view #view-panel.split-stack .round-block--compact .data-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    table-layout: fixed !important;
}

/*
 * Смартфон: слева 3 строки (мета / белые / чёрные), справа 2×2:
 *   1:0   0:1
 *   ½:½   ×
 * Важно сбросить десктопные стили td:nth-child(2) / .result-cell
 * (overflow:hidden, 4.25rem), иначе нижний ряд с ничьей обрезается.
 */
.app-panel.tournament-view .round-block--phone-pairings .data-table--pairing-compact {
    table-layout: fixed !important;
    width: 100% !important;
    max-width: 100% !important;
}

.app-panel.tournament-view .pairing-compact-row--phone > td:first-child,
.app-panel.tournament-view .pairing-compact-row--phone .pairing-compact-players-cell {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    vertical-align: top !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
    padding: 6px 6px 8px 4px !important;
}

.app-panel.tournament-view .pairing-compact-row--phone .pairing-meta {
    display: block;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    font-weight: 700;
    color: #444;
    line-height: 1.25;
    overflow: visible !important;
}

.app-panel.tournament-view .pairing-compact-row--phone > td:last-child,
.app-panel.tournament-view .pairing-compact-row--phone .result-cell,
.app-panel.tournament-view .round-block--phone-pairings .pairing-compact-row--phone .result-cell,
.app-panel.tournament-view .round-block--phone-pairings .data-table td.result-cell,
.app-panel.tournament-view #view-panel.split-stack .pairing-compact-row--phone .result-cell {
    width: 48% !important;
    min-width: 9.5rem !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    vertical-align: top !important;
    padding: 6px 2px 8px 6px !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
    text-align: left !important;
}

/* Перебить width:max-content у .result-btns в туре. */
.app-panel.tournament-view .round-block--phone-pairings .result-btns--phone,
.app-panel.tournament-view .pairing-compact-row--phone .result-btns--phone {
    width: 100% !important;
    max-width: 100% !important;
}

/*
 * Плоская сетка 2×2 (порядок в DOM: 1:0, 0:1, 1/2:1/2, ×):
 *   1:0      0:1
 *   1/2:1/2  ×
 */
.app-panel.tournament-view .result-btns--phone {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: auto auto !important;
    grid-auto-flow: row !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: calc(36px * 2 + 8px) !important;
    overflow: visible !important;
    align-items: stretch !important;
}

.app-panel.tournament-view .result-btns--phone .btn-result {
    min-width: 0 !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 6px 2px !important;
    font-size: 14px !important;
    font-weight: 700;
    border-radius: 10px;
    line-height: 1.1;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    overflow: visible !important;
    white-space: nowrap !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.app-panel.tournament-view .result-btns--phone .btn-result--WhiteWins {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.app-panel.tournament-view .result-btns--phone .btn-result--BlackWins {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

.app-panel.tournament-view .result-btns--phone .btn-result--Draw,
.app-panel.tournament-view .result-btns--phone .result-btns__spacer {
    grid-column: 1 !important;
    grid-row: 2 !important;
}

.app-panel.tournament-view .result-btns--phone .btn-result--Draw {
    font-size: 13px !important;
}

.app-panel.tournament-view .result-btns--phone .btn-result--None {
    grid-column: 2 !important;
    grid-row: 2 !important;
}

/* Смартфон: мета, ФИО белых и ФИО чёрных — три строки. */
.app-panel.tournament-view #view-panel.split-stack .pairing-compact-names {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    min-width: 0;
}

.app-panel.tournament-view #view-panel.split-stack .pairing-compact-vs {
    display: none;
}

.app-panel.tournament-view #view-panel.split-stack .pairing-seat {
    display: block;
    min-width: 0;
    word-break: break-word;
    white-space: normal;
}

.app-panel.tournament-view #view-panel.split-stack .round-block .table-scroll {
    overflow-x: hidden;
}

.app-panel.tournament-view #view-panel.split-stack .round-block .table-scroll > .data-table,
.app-panel.tournament-view #view-panel.split-stack .round-block--board .data-table,
.app-panel.tournament-view #view-panel.split-stack .round-block--groups .data-table,
.app-panel.tournament-view #view-panel.split-stack .round-block--places .data-table {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

/*
 * Правая панель: одна H-полоса — у итоговой таблицы.
 * Шахматка всегда в ширину панели (fitCrosstable), без своего скролла.
 * .ko-bracket-wrap / #standings без горизонтального overflow — иначе две полосы.
 */
.app-panel.tournament-view #standings > .ko-bracket-wrap {
    overflow-x: hidden;
    overflow-y: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.app-panel.tournament-view #standings .swiss-final-standings {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.app-panel.tournament-view #standings .swiss-final-table {
    width: max-content;
    min-width: 0;
}

.app-panel.tournament-view #standings .points-standings-crosstable,
.app-panel.tournament-view #standings .ct-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Не влезает в половину (или узкий экран): полная ширина шахматки/сетки, туры снизу. */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-stack {
    display: block;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-stack #standings.pairings-board {
    height: auto;
    max-height: none;
    overflow-x: hidden;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-stack #pairings.pairings-board {
    margin-top: 16px;
    height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
    border-left: none;
    padding-left: 0;
    min-width: 0;
}

/*
 * Смартфон во время турнира: партии туров сверху, турнирная таблица / шахматка — в конце
 * (в т.ч. альбом >768px и iframe хаба, где split-stack иначе display:block).
 */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.pairings-first {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.pairings-first #pairings.pairings-board {
    order: 1 !important;
    margin-top: 0 !important;
}

.app-panel.tournament-view #view-panel.is-visible.has-rounds.pairings-first #standings.pairings-board {
    order: 2 !important;
    margin-top: 16px !important;
}

/* Только шахматка/сетка (без боковых туров) — тоже гориз. скролл на узком экране. */
.app-panel.tournament-view #view-panel.is-visible.no-rounds #standings.pairings-board {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

.app-panel.tournament-view .round-block,
.tournament-view .round-block {
    margin-top: 14px;
}

.app-panel.tournament-view .round-block:first-child,
.tournament-view .round-block:first-child {
    margin-top: 0;
}

.app-panel.tournament-view .round-block__title-row,
.tournament-view .round-block__title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin: 0 0 8px;
}

/* Заголовок/кнопки не задают ширину max-content колонки — только таблица пар. */
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board .round-block__title-row,
.app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board .round-block__title-row {
    width: 0;
    min-width: 100%;
    box-sizing: border-box;
}

.app-panel.tournament-view .round-block__title-row h2,
.tournament-view .round-block__title-row h2,
.app-panel.tournament-view .round-block h2,
.tournament-view .round-block h2 {
    margin: 0;
    font-size: 1.1rem;
}

.app-panel.tournament-view .round-block__actions,
.tournament-view .round-block__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    /* Не раздувать колонку партий шире таблицы пар. */
    max-width: 100%;
}

.app-panel.tournament-view .round-block__actions .work-btn,
.tournament-view .round-block__actions .work-btn {
    padding: 4px 8px;
    font-size: 0.88rem;
    line-height: 1.2;
    white-space: nowrap;
}

.app-panel.tournament-view .work-btn--round-finish,
.tournament-view .work-btn--round-finish {
    background: #2e7d32;
    border-color: #1b5e20;
    color: #fff;
}

.app-panel.tournament-view .work-btn--round-next,
.tournament-view .work-btn--round-next {
    background: #1976d2;
    border-color: #1565c0;
    color: #fff;
}

.app-panel.tournament-view .work-btn--round-next:hover,
.tournament-view .work-btn--round-next:hover {
    background: #1565c0;
}

.app-panel.tournament-view .work-btn--round-finish:hover,
.tournament-view .work-btn--round-finish:hover {
    background: #1b5e20;
}

.pairing-player-select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    font: inherit;
    line-height: 1.25;
    padding: 4px 6px;
    border: 1px solid #c8c8d0;
    border-radius: 6px;
    background: #fff;
    color: #1e1e1e;
}

.pairing-player-select.pairing-player-select--rematch,
tr.pairing-row-rematch td {
    background: #ffecc8;
}

.pairing-rematch-warn {
    color: #a03c00;
    font-weight: 700;
}

.pairing-compact-names .pairing-player-select {
    width: calc(50% - 10px);
    display: inline-block;
    vertical-align: middle;
    margin: 0;
}

.app-toolbar .spacer {
    flex: 1;
}

.app-panel--lists {
    max-width: none;
    width: auto;
    margin: 12px 16px 20px;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    height: calc(100dvh - 118px);
    min-height: 420px;
    overflow: hidden;
    box-sizing: border-box;
}

.lists-pane {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.lists-pane--players {
    border-right: 1px solid #dde2e8;
}

.lists-pane__scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.app-panel--lists .app-toolbar,
.app-panel--tournaments .app-toolbar,
.app-panel--players .app-toolbar--players {
    margin-bottom: 6px;
    flex-shrink: 0;
}

.app-panel--lists #tournaments-table .data-table,
.app-panel--tournaments #tournaments-table .data-table {
    font-size: 18px;
}

.app-panel--lists #tournaments-table .data-table td,
.app-panel--lists #tournaments-table .data-table th,
.app-panel--tournaments #tournaments-table .data-table td,
.app-panel--tournaments #tournaments-table .data-table th {
    padding: 14px 16px;
}

.app-panel--lists .tournaments-filter,
.app-panel--tournaments .tournaments-filter {
    font-size: 15px;
}

.app-panel--lists .tournaments-filter select,
.app-panel--tournaments .tournaments-filter select {
    padding: 8px 10px;
    min-width: 140px;
}

.app-panel--lists #players-table .data-table,
.app-panel--players #players-table .data-table {
    font-size: 18px;
}

.app-panel--lists #players-table .data-table td,
.app-panel--lists #players-table .data-table th,
.app-panel--players #players-table .data-table td,
.app-panel--players #players-table .data-table th {
    padding: 14px 16px;
}

.app-panel--lists .players-sort,
.app-panel--players .players-sort,
.app-panel--players-hub .players-sort {
    font-size: 15px;
    padding: 8px 10px;
}

/* Шапка списка игроков — как desktop: Игроки · Все · Сортировка · Категория. */
.app-toolbar--players {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.app-toolbar--players .players-sort-row,
.app-toolbar--players .tournaments-filter {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--primary, #336e78);
    white-space: nowrap;
}

.app-toolbar--tournaments {
    margin-bottom: 6px;
}

.app-toolbar--player-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin-bottom: 0;
    flex-shrink: 0;
}

.app-toolbar--player-stats #page-title {
    flex: 0 1 auto;
    min-width: 0;
}

.players-stats-actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.app-panel--lists #players-error:empty,
.app-panel--players #players-error:empty {
    display: none;
}

.app-panel--lists #tournaments-error:empty,
.app-panel--tournaments #tournaments-error:empty {
    display: none;
}

@media (max-width: 900px) {
    .app-panel--lists {
        flex-direction: column;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .lists-pane {
        flex: none;
        max-height: min(70vh, 640px);
    }

    .lists-pane--players {
        border-right: none;
        border-bottom: 1px solid #dde2e8;
    }
}

.app-meta {
    color: #666;
    font-size: 14px;
    margin-bottom: 14px;
}

/* Шапка в #app-shell: sticky на обёртке, иначе уезжает вместе с коротким родителем */
#app-shell {
    position: sticky;
    top: 0;
    z-index: 200;
}

#app-shell:empty {
    display: none;
}

/* Гостевая шапка: бренд | клуб | меню */
.top-bar.top-bar--guest {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.top-bar--guest .guest-club-title {
    display: block;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
}

.top-bar--guest .top-bar__row--nav {
    flex: 0 1 auto;
    margin-left: auto;
    justify-content: flex-end;
}

@media (max-width: 900px) {
    .top-bar.top-bar--guest {
        gap: 10px 12px;
    }

    .top-bar--guest .top-bar__row--club {
        flex: 1 1 100%;
        text-align: left;
        justify-content: flex-start;
    }
}

/* Смартфон: не мешать landing.css — ряды через display:contents. */
@media (max-width: 768px) {
    .top-bar.top-bar--guest {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 6px;
    }

    .top-bar--guest .top-bar__row--nav {
        display: contents;
        margin-left: 0;
    }

    .top-bar--guest .guest-club-title {
        flex: 1 1 100%;
        font-size: 15px;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--ui-font, 15px);
}

.data-table th,
.data-table td {
    text-align: left;
    padding: var(--list-row-pad-y, 10px) 12px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.data-table th {
    color: var(--primary);
    font-weight: 700;
}

.data-table tr:hover td {
    background: #f7fbfd;
}

.data-table .actions {
    white-space: nowrap;
    text-align: right;
}

.btn-sm {
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 6px 12px;
    margin: 0 2px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.btn-sm.danger {
    background: #e74c3c;
}

.btn-sm.secondary {
    background: #5d6d7e;
}

.btn-sm--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    line-height: 0;
}

.btn-sm--icon-refresh {
    flex: 0 0 auto;
    background: #fff;
    color: #456;
    border: 1px solid #c5d0d4;
    box-shadow: none;
}

.btn-sm--icon-refresh:hover {
    background: #f4f7f9;
    color: #234;
    border-color: #a8b4bc;
}

.btn-sm__icon {
    display: block;
    flex: 0 0 auto;
}

.btn-sm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.player-check-list {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 10px;
    margin: 8px 0 14px;
}

.tournament-players-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tournament-players-all {
    margin: 0;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.modal.modal--tournament-edit.scheveningen-teams-mode {
    max-width: 980px;
}

.scheveningen-teams {
    margin: 8px 0 14px;
}

.modal.modal--tournament-edit .scheveningen-teams {
    margin-bottom: 8px;
}

.modal.modal--tournament-edit .scheveningen-teams .players-visibility-list {
    min-height: 220px;
}

.modal.modal--tournament-edit {
    max-width: 640px;
    width: calc(100% - 32px);
    /* Колонка: заголовок → скролл (форма+список) → «Выбрано» + кнопки. */
    display: flex;
    flex-direction: column;
    height: min(90dvh, 90vh);
    max-height: min(90dvh, 90vh);
    padding-bottom: 16px;
    overflow: hidden;
    box-sizing: border-box;
}

.modal.modal--tournament-edit > h2 {
    flex: 0 0 auto;
}

/* Одна зона прокрутки: поля формы и список игроков. */
.modal.modal--tournament-edit .tournament-edit-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.modal.modal--tournament-edit .inline-form,
.modal.modal--tournament-edit .tournament-players-head {
    flex: 0 0 auto;
}

.modal.modal--tournament-edit .player-check-list {
    /* Высоту даёт родительский .tournament-edit-scroll — без второго скролла. */
    max-height: none;
    min-height: 120px;
    margin-bottom: 8px;
    overflow: visible;
}

/* Ручное создание: старые обёртки «Посев»/«Вид»/«Финал» скрыты (плоский список форматов). */
.modal.modal--tournament-edit.manual-create-mode #t-swiss-variant-wrap,
.modal.modal--tournament-edit.manual-create-mode #t-rr-circles-wrap,
.modal.modal--tournament-edit.manual-create-mode #t-ko-losses-wrap,
.modal.modal--tournament-edit.manual-create-mode #t-final-format-wrap {
    display: none !important;
}

.modal.modal--tournament-edit #selected-count {
    flex: 0 0 auto;
    margin: 8px 0 0;
    padding-top: 2px;
    background: #fff;
}

.modal.modal--tournament-edit #edit-form-error {
    flex: 0 0 auto;
}

.modal.modal--tournament-edit #edit-form-error:empty {
    display: none;
    margin: 0;
    padding: 0;
}

.modal.modal--tournament-edit .tournament-edit-actions {
    position: static;
    z-index: 2;
    margin-top: 8px !important;
    padding-top: 8px;
    background: #fff;
    border-top: 1px solid #e8e8e8;
    flex: 0 0 auto;
}

/* Смартфон: на видимую область экрана (без translate — стабильная высота). */
@media (max-width: 768px) {
    .modal.modal--tournament-edit {
        top: max(6px, env(safe-area-inset-top, 0px));
        left: 8px;
        right: 8px;
        bottom: max(6px, env(safe-area-inset-bottom, 0px));
        transform: none;
        width: auto;
        max-width: none;
        height: auto;
        max-height: none;
        padding: 14px 12px 10px;
    }

    .modal.modal--tournament-edit > h2 {
        font-size: 1.15rem;
        margin-bottom: 10px;
    }

    .modal.modal--tournament-edit .player-check-list {
        min-height: 100px;
    }
}

.modal.modal--tournament-edit.edit-form--page {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    max-width: none;
    width: auto;
    max-height: none;
    overflow: visible;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    z-index: auto;
}

.modal.modal--tournament-edit.edit-form--page h2 {
    display: none;
}

.player-check-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px;
    cursor: pointer;
    font-weight: normal;
}

.player-check-list label:hover {
    background: #f0f7fa;
}

.pairings-board {
    margin-top: 18px;
}

.pairings-board h2 {
    color: var(--primary);
    font-size: 1.2rem;
}

.status-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    background: #e8f4f6;
    color: var(--primary);
}

.status-pill.inprogress {
    background: #e8f8e8;
    color: #1e7a2e;
}

.status-pill.finished {
    background: #eee;
    color: #555;
}

.empty-hint {
    color: #777;
    padding: 24px 0;
    text-align: center;
}

.result-btns {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
}

.tournament-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 4px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.tournament-flag input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.tournament-flag input[type="number"] {
    width: 3.2em;
    min-height: 28px;
    margin: 0;
    padding: 2px 6px;
    border: 1px solid #c5d5da;
    border-radius: 8px;
    font: inherit;
    font-weight: 600;
}

.btn-result {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #c5d5da;
    border-radius: 12px;
    padding: 10px 16px;
    min-width: 56px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.btn-result:hover:not(:disabled) {
    background: #e8e8e8;
}

.btn-result:disabled {
    background: #f5f5f5;
    color: #999;
    cursor: default;
    opacity: 0.85;
}

.btn-result.active {
    /* Как в desktop: зелёная подсветка выбранного результата */
    background: #64b464;
    color: #fff;
    border-color: #4a9a4a;
}

.result-cell {
    min-width: 0;
}

/* Как desktop Absolute columns: фиксированные ширины, без растягивания панели. */
.round-block .data-table {
    width: max-content;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.round-block .data-table td,
.round-block .data-table th {
    font-size: 16px;
    padding: 12px 8px;
}

.round-block .data-table td:nth-child(1),
.round-block .data-table th:nth-child(1) {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.round-block--board .data-table {
    /* Доска + Белые + Результат + Чёрные */
    width: 34rem;
}

.round-block--board .data-table td:nth-child(1),
.round-block--board .data-table th:nth-child(1) {
    width: 3.25rem;
}

/* Группы: «Гр.N · д.M» + полный ряд кнопок — шире таблица и левая вкладка. */
.round-block--groups .data-table {
    width: 44rem;
}

.round-block--groups .data-table td:nth-child(1),
.round-block--groups .data-table th:nth-child(1) {
    width: 6.75rem;
    min-width: 6.75rem;
}

.round-block--groups .result-cell,
.round-block--groups .data-table th:nth-child(3),
.round-block--groups .data-table td:nth-child(3) {
    width: 16.5rem;
    min-width: 16.5rem;
    max-width: 16.5rem;
}

/* Нокаут: «1/16 · д.N» — чуть шире «Доска», без раздувания левой панели (иначе ½/финал уезжают). */
.round-block--ko-stage .data-table td:nth-child(1),
.round-block--ko-stage .data-table th:nth-child(1) {
    width: 6.5rem;
    min-width: 6.5rem;
    max-width: 7rem;
}

/* Без min-width таблицы: иначе «Результат» (width:1%) забирает лишнее — зазор до «Чёрные». */
.round-block--ko-stage:not(.round-block--archive) .data-table {
    min-width: 0;
}

.round-block--places .data-table {
    width: 34rem;
}

.round-block--places .data-table td:nth-child(1),
.round-block--places .data-table th:nth-child(1) {
    width: 7rem;
}

/* Белые / Чёрные — равные колонки, без лишнего воздуха до «Результат». */
.round-block .data-table th:nth-child(2),
.round-block .data-table td:nth-child(2),
.round-block .data-table th:nth-child(4),
.round-block .data-table td:nth-child(4) {
    width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.round-block .data-table td:nth-child(2) {
    padding-right: 4px;
}

.round-block .data-table td:nth-child(4) {
    padding-left: 4px;
}

/* Результат — фиксированная ширина: значения в одной вертикали по всем строкам. */
.round-block .data-table th:nth-child(3),
.round-block .data-table td:nth-child(3),
.round-block .result-cell {
    width: 4.25rem;
    min-width: 4.25rem;
    max-width: 4.25rem;
    padding-left: 4px;
    padding-right: 4px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}

.round-block:not(.round-block--archive) .data-table {
    width: max-content;
    min-width: 0;
}

/* Кнопки 1:0 / ½:½ / 0:1 / × — строго по содержимому, без воздуха до «Чёрные». */
.round-block:not(.round-block--archive) .result-cell,
.round-block:not(.round-block--archive) .data-table th:nth-child(3),
.round-block:not(.round-block--archive) .data-table td:nth-child(3) {
    width: 1%;
    min-width: 0;
    max-width: max-content;
    padding-right: 2px;
    overflow: visible;
}

.round-block:not(.round-block--archive) .result-btns {
    width: max-content;
    max-width: max-content;
}

.round-block .pairing-meta {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.round-block .data-table td:nth-child(2),
.round-block .data-table td:nth-child(4) {
    font-size: 17px;
    font-weight: 700;
}

.round-block--archive {
    margin-top: 8px;
}

.round-block--archive h2 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.round-block--archive .data-table th,
.round-block--archive .data-table td {
    font-size: 14px;
    padding: 5px 6px;
}

.round-block--archive .data-table td:nth-child(2) {
    padding-right: 2px;
}

.round-block--archive .data-table th:nth-child(3),
.round-block--archive .data-table td:nth-child(3),
.round-block--archive .result-cell {
    width: 3.75rem;
    min-width: 3.75rem;
    max-width: 3.75rem;
    padding-left: 2px;
    padding-right: 2px;
}

.round-block--archive .data-table td:nth-child(4) {
    padding-left: 2px;
}

.round-block--archive .data-table td:nth-child(2),
.round-block--archive .data-table td:nth-child(4) {
    font-size: 15px;
}

.round-block--archive.round-block--board .data-table {
    width: 30rem;
}

.round-block--archive .pairing-meta {
    font-size: 13px;
}

.modal.modal--result-confirm {
    max-width: 560px;
    text-align: center;
}

.modal.modal--result-confirm .result-confirm-text {
    margin: 8px 0 16px;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
    color: #1e1e23;
}

.modal.modal--result-confirm .result-confirm-rest {
    text-align: left;
    margin: 0 auto 20px;
    max-width: 420px;
}

.modal.modal--result-confirm .result-confirm-rest label {
    font-size: 16px;
}

.modal.modal--result-confirm .buttons .work-btn {
    min-width: 120px;
    font-size: 16px;
    padding: 12px 24px;
}

/* «Нет» — серый, как в desktop ConfirmResultForm */
.modal.modal--result-confirm .buttons .work-btn#result-confirm-no {
    background: #78787d;
    border-color: #78787d;
    color: #fff;
}

.modal.modal--result-confirm .buttons .work-btn#result-confirm-no:hover {
    background: #6a6a6f;
    border-color: #6a6a6f;
}

.standings-section {
    margin-bottom: 1.25rem;
}

.standings-section-title {
    margin: 0 0 0.5rem;
    font: 700 1.35rem/1.3 "Segoe UI Semibold", "Segoe UI", sans-serif;
    color: #1a1a1a;
}

.groups-final-standings__groups .standings-section-title {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
}

.groups-final-standings .groups-final-bracket {
    margin-top: 0.25rem;
}

.groups-final-standings__rounds {
    width: 100%;
    margin: 8px 0 16px;
}

.groups-final-standings__rounds .round-block {
    margin-bottom: 12px;
}

.groups-final-standings__final {
    margin-top: 0.5rem;
}

.ct-name--select {
    padding: 2px 4px !important;
    min-width: 180px;
}

.ct-name--select .group-seat-select {
    width: 100%;
    max-width: 280px;
    font-weight: 600;
}

/* Группы+финал: шахматки групп всегда в одну колонку. */
.groups-final-standings__groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px 16px;
    align-items: start;
}

.groups-final-standings__groups--one-col {
    grid-template-columns: minmax(0, 1fr);
}

.groups-final-standings__groups--two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.groups-final-standings__groups .standings-section {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-bottom: 0;
}

.groups-final-standings__groups .ct-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

@media (max-width: 900px), (pointer: coarse) and (max-width: 1200px) {
    .groups-final-standings__groups .ct-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
    }
}

.ct-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    margin-top: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.ko-bracket-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow-x: auto;
    padding: 4px 0 12px;
    width: 100%;
    gap: 12px;
}

/* Список мест сразу над сеткой — без зазора; колонки переносятся, без H-скролла. */
.ko-bracket-wrap--cascade {
    gap: 0;
    overflow-x: hidden;
}

.ko-cascade-band-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 10px;
}

.ko-cascade-band-row:last-child {
    margin-bottom: 0;
}

.ko-bracket-wrap--cascade .ko-places-row {
    margin: 0;
}

.ko-bracket-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.ko-bracket {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
    flex: 0 0 auto;
}

.ko-bracket--wrap-row {
    margin-bottom: 0;
}

.ko-bracket--main {
    margin-bottom: 8px;
}

.ko-places-row {
    width: 100%;
    margin: 0 0 4px;
}

/* Устаревший ряд (на случай старой разметки) */
.ko-late-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    flex: 0 0 auto;
    margin-top: 12px;
}

.ko-cascade-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    width: 100%;
}

.ko-cascade-place-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
}

.ko-cascade-band {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.ko-cascade-title {
    font-size: 16px;
    font-weight: 700;
    color: #28282d;
    text-transform: none;
}

/* Один уровень: «за 3–12», «за 3–8», «за 3–6», «за 3–4» в одной строке над карточками. */
.ko-cascade-subtitles {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    width: max-content;
    margin: 0 0 4px;
}

.ko-col-subtitle {
    flex: 0 0 auto;
    width: var(--ko-col-w);
    min-height: 1.15em;
    font-weight: 700;
    font-size: var(--ko-title-font);
    color: #222;
    line-height: 1.2;
}

.ko-late-cols {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
}

.ko-top8 {
    position: relative;
    flex: 0 0 auto;
    /* Ширина по содержимому; fitKoTopStandingsTable ужимает шрифт под панель. */
    width: max-content;
    max-width: none;
    --ko-top-font: 15px;
    --ko-top-num-font: 13px;
    --ko-top-pad-y: 5px;
    --ko-top-pad-x: 4px;
    --ko-top-name-max: none;
    font-size: var(--ko-top-font);
}

/* С колонками туров — растём вправо, пока не ужали шрифт. */
.ko-top8--rounds {
    max-width: none;
}

/* После автоподгона — без горизонтального скролла. */
.ko-top8.ko-top8--fit {
    width: 100%;
    max-width: 100%;
}

.ko-top8.ko-top8--fit .ko-top-table {
    width: 100%;
    max-width: 100%;
}

.ko-top8.ko-top8--fit-clip .ko-top-name {
    max-width: var(--ko-top-name-max, 8rem);
    overflow: hidden;
    text-overflow: ellipsis;
}

.ko-top-table {
    border-collapse: collapse;
    table-layout: auto;
    width: max-content;
    /* Точно как .crosstable .ct-name; размер — через --ko-top-font. */
    font-size: var(--ko-top-font, 15px);
    font-weight: 700;
    background: #fafafc;
}

.ko-top-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 700;
    font-size: var(--ko-top-font, 15px);
    margin-bottom: 8px;
}

.ko-top-table th,
.ko-top-table td {
    border: 1px solid #c8c8cd;
    padding: var(--ko-top-pad-y, 5px) var(--ko-top-pad-x, 4px);
    text-align: left;
    vertical-align: middle;
    font-size: var(--ko-top-font, 15px);
    font-weight: 700;
}

.ko-top-table th {
    background: #f0f0f3;
}

.ko-top-table tr.ko-top-alt td {
    background: #f5f8fa;
}

.ko-top-table tr.ko-top-resting td,
.ko-top-table tr.ko-top-alt.ko-top-resting td {
    background: #fff3cd;
}

/* Узкие Место / В / П / R+ / ΔR — em, чтобы сжимались со шрифтом; ФИО — по длине. */
.ko-top-place {
    width: 4.5em;
    padding-left: 2px;
    padding-right: 2px;
    text-align: center;
    white-space: nowrap;
}

.ko-top-name {
    width: auto;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    word-break: normal;
}

/* Турнирная таблица мест: клик по ФИО — как в шахматке (.ct-name--link). */
.ko-top-table tbody td.ko-top-name--link {
    cursor: pointer;
}

.ko-top-table tbody td.ko-top-name--link:hover {
    background: #dceef5;
}

.ko-top-num {
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    padding-left: 2px;
    padding-right: 2px;
}

.ko-top-num--wl {
    width: 1.85em;
}

.ko-top-num--start {
    width: 3.25em;
    min-width: 2.5em;
    text-align: center;
    font-size: var(--ko-top-num-font, 13px);
    font-weight: 600;
}

.ko-top-num--round {
    width: 4.25em;
    min-width: 3.5em;
    text-align: center;
    font-size: var(--ko-top-num-font, 13px);
    font-weight: 600;
}

/* Объявленная партия (без результата) — жёлтый фон (не сбрасывать на hover строки). */
/* Партия чёрными / исход — как .swiss-final-* и шахматка. */
.ko-top-table td.ko-top-black,
.ko-top-table tr.ko-top-alt td.ko-top-black {
    background: #dedede !important;
}

.ko-top-table td.ko-top-win {
    color: #2e7d32;
    font-weight: 700;
}

.ko-top-table td.ko-top-loss {
    color: #c62828;
    font-weight: 700;
}

.ko-top-table td.ko-top-draw {
    color: #000;
    font-weight: 700;
}

.ko-top-table td.ko-top-pending,
.ko-top-table tr.ko-top-alt td.ko-top-pending,
.ko-top-table tr:hover td.ko-top-pending {
    background: #ffeca0 !important;
    color: #503200;
}

.ko-top-table td.ko-top-game-tip {
    cursor: help;
}

.ko-top-table td.ko-top-game-tip[data-tip-opponent-id] {
    cursor: pointer;
}

.ko-match.ko-match--game-tip {
    cursor: help;
}

.ko-match.ko-match--game-tip[data-tip-opponent-id] {
    cursor: pointer;
}

/* Швейцарка/круговая: «Очки» / «Бухг.» шире, чем «В»/«П». */
.ko-top-num--pts,
.ko-top-num--tie {
    width: 3.5em;
    min-width: 3em;
}

.ko-top-num--rating {
    width: 2.9em;
}

.ko-top-num--delta {
    width: 2.9em;
}

.ko-top8--points {
    max-width: none;
}

.ko-top8--points .ko-top-num--rating,
.ko-top8--points .ko-top-num--delta {
    width: 3.5em;
    min-width: 3em;
}

/* Швейцарка: итоговая сверху; отступ снизу даёт шахматка (marginTop в JS). */
.swiss-final-standings {
    position: relative;
    margin-top: 0;
    overflow-x: auto;
}

/* Схевенинген: счёт команд над личной таблицей. */
.scheveningen-team-score {
    margin: 0 0 10px;
    padding: 0;
}
.scheveningen-team-score__line {
    font-weight: 700;
    font-size: 1.05em;
    color: #336e78;
}
.scheveningen-team-score__note {
    margin-top: 2px;
    font-size: 0.85em;
    color: #6a6a70;
}
.swiss-final-table .swiss-final-team {
    display: inline-block;
    margin-left: 0.35em;
    font-weight: 600;
    font-size: 0.9em;
    color: #336e78;
    white-space: nowrap;
}

/* «Время на отдых» / «Мин. время партии» больше не используются. */
#t-rest-wrap,
#edit-form #t-rest-wrap,
#prop-rest-wrap,
#prop-min-game-wrap {
    display: none !important;
}

/* Ручной отдых (арена / нокаут «Авто»): жёлтая строка + прямой отсчёт. */
.swiss-final-table tr.swiss-final-resting td {
    background: #fff3cd;
}
.swiss-final-table .swiss-final-rest-elapsed,
.standings-rest-elapsed {
    color: #785a14;
    font-weight: 600;
    white-space: nowrap;
}

.swiss-final-table {
    width: max-content;
    min-width: 0;
    border-collapse: collapse;
    font-size: 14px;
}

.swiss-final-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 8px;
}

.swiss-final-table th,
.swiss-final-table td {
    border: 1px solid #c8c8cd;
    padding: 5px 8px;
    text-align: center;
    white-space: nowrap;
}

.swiss-final-table th {
    background: #f0f0f3;
    font-weight: 700;
}

.swiss-final-table td.swiss-final-name {
    text-align: left;
    font-weight: 700;
}

.swiss-final-table td.swiss-final-name--link {
    cursor: pointer;
}

.swiss-final-table td.swiss-final-name--link:hover {
    background: #dceef5;
}

/* Гостевой fullscreen: без перехода по ФИО (как в шахматке). */
body.tournament-guest-fs .swiss-final-table td.swiss-final-name--link {
    cursor: default;
}

body.tournament-guest-fs .swiss-final-table td.swiss-final-name--link:hover {
    background: inherit;
}

/* Текущие партии тура — как .ko-top-pending в нокауте.
   !important / tr:hover: иначе .data-table tr:hover td (#f7fbfd) перекрывает жёлтый. */
/* Партия чёрными — как .ct-black в шахматке. */
.swiss-final-table td.swiss-final-black {
    background: #dedede !important;
}

.swiss-final-table td.swiss-final-win {
    color: #2e7d32;
    font-weight: 700;
}

.swiss-final-table td.swiss-final-loss {
    color: #c62828;
    font-weight: 700;
}

.swiss-final-table td.swiss-final-draw {
    color: #222;
    font-weight: 700;
}

.swiss-final-table td.swiss-final-pending,
.swiss-final-table tr:hover td.swiss-final-pending {
    background: #ffeca0 !important;
    color: #503200;
    font-weight: 700;
}

.ko-delta-up {
    color: #14703c;
}

.ko-delta-down {
    color: #a02828;
}

.ko-col {
    flex: 0 0 auto;
    width: var(--ko-col-w);
}

.ko-col-title {
    font-weight: 700;
    font-size: var(--ko-title-font);
    margin: 0 0 8px;
    color: #222;
}

.ko-col-matches {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ko-col-matches--abs {
    position: relative;
    display: block;
    gap: 0;
}

.ko-match--abs {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
}

.ko-match-block {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.ko-section {
    font-size: 12px;
    color: #888;
    margin: 0 0 0 2px;
    padding: 0;
    font-style: italic;
    line-height: 1.25;
}

.ko-section--bold {
    font-weight: 700;
    font-size: 13px;
    color: #222;
    font-style: normal;
}

.ko-match {
    border: 1px solid #c8c8cd;
    border-radius: 4px;
    background: #fafafc;
    overflow: hidden;
    position: relative;
}

.ko-match--refs {
    /* Место слева под место/−N; справа — номер партии + запас под счёт.
       overflow:visible — чтобы −N у исходящих линий не обрезался. */
    padding-right: 36px;
    overflow: visible;
}

/* Бейдж места — absolute у правого края слота; padding слота держит счёт левее. */
.ko-match--badges {
    padding-right: 0;
}

.ko-match--badges .ko-slot {
    padding-right: 22px;
}

.ko-match--refs.ko-match--badges {
    padding-right: 36px;
}

.ko-match--refs.ko-match--badges .ko-slot {
    padding-right: 4px;
}

.ko-match--refs .ko-score {
    margin-right: 4px;
}

.ko-match--badges .ko-score {
    margin-right: 2px;
}

.ko-loser-dest {
    position: absolute;
    left: 100%;
    top: 50%;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    color: #777;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

/* Целиком над / под линией связи (ступенька и вилка). */
.ko-loser-dest--above-line {
    transform: translate(4px, calc(-100% - 3px));
}

.ko-loser-dest--below-line {
    transform: translate(4px, 3px);
}

.ko-place-badge {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    min-width: 18px;
    padding: 1px 4px;
    border-radius: 2px;
    background: #b42828;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    pointer-events: none;
}

.ko-match--badges .ko-match-num {
    right: 26px;
}

.ko-match--done {
    background: #f5faf7;
}

.ko-match--empty {
    opacity: 0.45;
}

.ko-from {
    flex: 0 0 26px;
    width: 26px;
    font-size: 11px;
    font-weight: 700;
    color: #777;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.ko-match-num {
    position: absolute;
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    min-width: 22px;
    padding: 1px 3px;
    border: 1px solid #c8c8cd;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    text-align: center;
    background: #fafafc;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
    box-shadow: 0 0 0 1px #fafafc; /* перекрыть линию между слотами */
}

.ko-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    min-height: var(--ko-slot-min-h);
    padding: 4px 4px 4px 5px;
    font-size: var(--ko-slot-font);
    border-bottom: 1px solid #e0e0e4;
}

.ko-slot:last-child {
    border-bottom: none;
}

.ko-slot--bye {
    color: #888;
    font-style: italic;
}

.ko-slot--win {
    color: #14703c;
    font-weight: 700;
}

.ko-slot--win .ko-name {
    font-weight: 700;
}

.ko-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ko-score {
    flex: 0 0 auto;
    margin-left: auto;
    font-weight: 700;
    min-width: 1em;
    text-align: right;
}

/* Горизонтальный зазор между турами нокаута (без стрелок). */
.ko-col-gap {
    flex: 0 0 var(--ko-col-gap);
    width: var(--ko-col-gap);
    align-self: stretch;
}

.ko-arrow {
    flex: 0 0 28px;
    align-self: center;
    height: 2px;
    margin-top: 40px;
    background: #c4c4c8;
    position: relative;
}

.ko-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border: 5px solid transparent;
    border-left-color: #c4c4c8;
    border-right-width: 0;
}

/* Соединители сетки с местами: две линии → одна (как бланк НТ). */
.ko-connectors {
    flex: 0 0 44px;
    width: 44px;
    align-self: flex-start;
    margin-top: 0;
    overflow: visible;
}

.crosstable {
    border-collapse: collapse;
    table-layout: fixed;
    width: 100%;
    font-size: var(--ct-font);
    background: #fff;
}

.crosstable th {
    background: #969696;
    color: #fff;
    font-weight: 700;
    font-size: var(--ct-th-font);
    padding: 7px 2px;
    text-align: center;
    white-space: nowrap;
    border: 1px solid #7a7a7a;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crosstable td {
    border: 1px solid #e0e0e0;
    text-align: center;
    padding: 3px 1px;
    vertical-align: middle;
    height: var(--ct-row-h);
    overflow: hidden;
    text-overflow: ellipsis;
}

.crosstable tr.ct-alt td {
    background: #f8f8f8;
}

.crosstable tr.ct-resting td,
.crosstable tr.ct-alt.ct-resting td {
    background: #fff3cd;
}

.crosstable .ct-place {
    width: 3.6em;
    white-space: nowrap;
}

.crosstable .ct-name {
    text-align: left !important;
    font-weight: 700;
    font-size: var(--ct-name-font);
    padding-left: 6px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: var(--ct-name-max); /* как CrosstableControl — не раздувать ФИО на широкой панели */
}

.crosstable tbody td.ct-name--link {
    cursor: pointer;
}

.crosstable tbody td.ct-name--link:hover {
    background: #dceef5;
}

.crosstable thead .ct-name {
    text-align: center !important;
    font-size: var(--ct-name-font);
}

.crosstable .ct-num {
    width: 36px;
}

/* Заголовки R / Очки / Бухг. / R+ / ΔR — не обрезать многоточием при сжатии. */
.crosstable th.ct-num--rating,
.crosstable th.ct-num--pts,
.crosstable th.ct-num--tie,
.crosstable th.ct-num--delta {
    overflow: visible;
    text-overflow: clip;
    padding-left: 2px;
    padding-right: 2px;
}

.crosstable th.ct-num--pts,
.crosstable th.ct-num--tie {
    min-width: 48px;
}

.crosstable th.ct-num--rating {
    min-width: 40px;
}

.crosstable th.ct-num--delta {
    min-width: 28px;
}

.crosstable .ct-opp,
.crosstable .ct-cell {
    width: var(--ct-opp-w);
    font-weight: 600;
    font-size: 12px;
    /* Не «1…» для «12б»: обрезка без многоточия; ширину держит fitCrosstable. */
    text-overflow: clip;
}

.crosstable .ct-diag {
    background: #969696 !important;
    color: #969696 !important;
}

.crosstable .ct-diag.ct-diag-bye {
    color: #fff !important;
    font-weight: 700;
}

.crosstable .ct-black {
    background: #dedede !important;
}

.crosstable tr.ct-alt .ct-black {
    background: #d4d4d4 !important;
}

/* Очки в шахматке: 1 — зелёный, 0 — красный, ½ — чёрный. */
.crosstable .ct-score-win {
    color: #2e7d32;
}

.crosstable .ct-score-loss {
    color: #c62828;
}

.crosstable .ct-score-draw {
    color: #000;
}

.crosstable .ct-pending {
    background: #ffeca0 !important;
    color: #503200 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-overflow: clip;
    white-space: nowrap;
}

/* Последняя завершённая партия: уголок-метка, фон цвета фигур (белый / серый) не трогаем. */
.crosstable .ct-latest {
    position: relative;
}

.crosstable .ct-latest::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 10px 10px 0;
    border-color: transparent #2e7d32 transparent transparent;
    pointer-events: none;
}

.crosstable .ct-bold {
    font-weight: 700;
}

.crosstable .ct-delta-up {
    color: #2e7d32;
}

.crosstable .ct-delta-down {
    color: #c62828;
}

/* Подмигивание свежих результатов (онлайн-просмотр).
   Не через @keyframes background: у .ct-black фон с !important, анимация его не перебивает
   (!important в keyframes браузеры игнорируют). Класс on/off ставит JS раз в ~0.55 с. */
.crosstable td.ct-blink,
.swiss-final-table td.ct-blink {
    font-weight: 700;
}

/* Шахматка: по-прежнему мигает фон. */
.crosstable td.ct-blink-on,
.crosstable tr.ct-alt td.ct-blink-on,
.crosstable td.ct-blink-on.ct-black,
.crosstable tr.ct-alt td.ct-blink-on.ct-black {
    background: #ff9800 !important;
    color: #fff !important;
}

.crosstable td.ct-blink-on .ct-score-win,
.crosstable td.ct-blink-on .ct-score-loss,
.crosstable td.ct-blink-on .ct-score-draw {
    color: #fff !important;
}

.crosstable td.ct-blink-off,
.crosstable tr.ct-alt td.ct-blink-off,
.crosstable td.ct-blink-off.ct-black,
.crosstable tr.ct-alt td.ct-blink-off.ct-black {
    background: #fff !important;
    color: #222 !important;
}

.crosstable td.ct-blink-off .ct-score-win {
    color: #2e7d32 !important;
}

.crosstable td.ct-blink-off .ct-score-loss {
    color: #c62828 !important;
}

.crosstable td.ct-blink-off .ct-score-draw {
    color: #000 !important;
}

/* Турнирная таблица: фон и цвет результата (сер/зел/красн) остаются;
   минуту только подмигивает текст (видимый ↔ прозрачный). */
.swiss-final-table td.ct-blink-off,
.swiss-final-table td.swiss-final-win.ct-blink-off,
.swiss-final-table td.swiss-final-loss.ct-blink-off,
.swiss-final-table td.swiss-final-draw.ct-blink-off,
.swiss-final-table td.swiss-final-black.ct-blink-off {
    color: transparent !important;
}

/* Отдельное окно браузера / Smart View: шахматка на весь экран. */
html:has(body.ct-watch-page) {
    height: 100%;
    background: #fff;
}

body.ct-watch-page {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    width: 100dvw;
    /* Под Smart View / альбомную ориентацию на телефоне у ТВ. */
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

body.ct-watch-page.ct-watch-page--fs {
    height: 100%;
    width: 100%;
}

/* Кнопка «На весь экран» — жест для fullscreen (нужен для Smart View). */
.ct-watch-fs-btn {
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    margin: 0;
    padding: 12px 22px;
    border: 0;
    border-radius: 10px;
    background: rgba(35, 68, 100, 0.92);
    color: #fff;
    font: 600 15px/1.2 "Segoe UI Semibold", "Segoe UI", sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.ct-watch-fs-btn[hidden] {
    display: none !important;
}

body.ct-watch-page .ct-watch-error {
    margin: 24px;
    font-size: 1.05rem;
}

body.ct-watch-page .ct-watch-arena-clock {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    text-align: center;
    font: 700 1.55rem/1.25 "Segoe UI Semibold", "Segoe UI", sans-serif;
    padding: 10px 16px;
    background: #e8f5e9;
    color: #1b5e20;
    letter-spacing: 0.02em;
}

body.ct-watch-page .ct-watch-arena-clock.ct-watch-arena-clock--expired {
    background: #fff3e0;
    color: #e65100;
}

body.ct-watch-page .ct-watch-viewport {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: #fff;
}

body.ct-watch-page.has-arena-clock .ct-watch-viewport {
    top: 52px;
}

body.ct-watch-page .ct-watch-scale {
    display: inline-block;
    transform-origin: top left;
}

/* Сетка в просмотре: натуральный масштаб, скролл по высоте. */
body.ct-watch-page .ct-watch-scale:has(.ko-bracket-wrap),
body.ct-watch-page .ct-watch-scale:has(.ko-cascade-stack) {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
}

body.ct-watch-page .ct-wrap {
    margin: 0;
    background: #fff;
    width: max-content;
    max-width: none;
    min-width: 0;
    overflow: visible;
}

/* Шкала / шахматка на табло: без клипа до внешнего scale. */
body.ct-watch-page .ct-watch-scale:has(.arena-board-time),
body.ct-watch-page .ct-watch-scale:has(table.crosstable):not(:has(.ct-watch-live)) {
    display: block;
    width: max-content;
    max-width: none;
    height: auto;
    box-sizing: border-box;
    padding: 0;
}

body.ct-watch-page .ct-watch-scale > #standings:has(.arena-board-time),
body.ct-watch-page .ct-watch-scale > #standings:has(table.crosstable):not(:has(.ct-watch-live)) {
    height: auto;
    max-height: none;
    overflow: visible;
}

body.ct-watch-page .arena-board-time {
    width: 100%;
    max-width: none;
    height: auto;
    box-sizing: border-box;
}

body.ct-watch-page .ct-name--link {
    pointer-events: none;
    cursor: default;
}

body.ct-watch-page .ct-watch-groups-grid {
    display: grid;
    gap: 14px 18px;
    align-items: start;
    justify-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px;
    min-width: 0;
}

body.ct-watch-page .ct-watch-groups-grid .standings-section {
    margin: 0;
    min-width: 0;
    /* Не клипать R+/ΔR: ширину даёт натуральная шахматка, масштаб — на .ct-watch-live. */
    max-width: none;
    overflow: visible;
}

body.ct-watch-page .ct-watch-groups-grid .ct-wrap {
    width: max-content;
    max-width: none;
    overflow-x: visible;
    box-sizing: border-box;
}

body.ct-watch-page .ct-watch-groups-grid .standings-section-title {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
}

body.ct-watch-page .ko-bracket-wrap {
    margin: 0;
    max-width: none;
    overflow: visible;
}

body.ct-watch-page .ko-top-name--link {
    pointer-events: none;
    cursor: default;
}

/* Итоговая / шкала: без «руки» и нативной подсказки «Игры с соперником». */
body.ct-watch-page .swiss-final-table td.swiss-final-game-tip,
body.ct-watch-page .swiss-final-table td.swiss-final-game-tip[data-tip-opponent-id],
body.ct-watch-page .ko-top-table td.ko-top-game-tip,
body.ct-watch-page .ko-top-table td.ko-top-game-tip[data-tip-opponent-id],
body.ct-watch-page .ko-match.ko-match--game-tip,
body.ct-watch-page .ko-match.ko-match--game-tip[data-tip-opponent-id],
body.ct-watch-page .crosstable td.ct-game-tip,
body.ct-watch-page .crosstable td.ct-game-tip[data-tip-opponent-id],
body.ct-watch-page .arena-board-time__play[data-tip],
body.ct-watch-page .arena-board-time__play[data-tip-opponent-id] {
    cursor: default !important;
}

/* Идущие швейцарка/нокаут: узкая панель досок + итоговая таблица. */
body.ct-watch-page .ct-watch-live {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
    background: #fff;
}

body.ct-watch-page .ct-watch-boards {
    --ct-watch-row-pad: 8px;
    --ct-watch-title-mb: 12px;
    --ct-watch-panel-pad-y: 14px;
    --ct-watch-sep-my: 10px;
    --ct-watch-board-font: 1.15rem;
    --ct-watch-board-num-font: 1.05rem;
    --ct-watch-board-pair-font: 1.15rem;
    --ct-watch-board-line: 1.3;
    --ct-watch-board-title-font: 1.25rem;
    flex: 0 0 26rem;
    width: 26rem;
    max-width: 42vw;
    border-right: 1px solid #c8c8cd;
    background: #f7f7f9;
    overflow-x: hidden;
    overflow-y: hidden;
    padding: var(--ct-watch-panel-pad-y) 12px;
    box-sizing: border-box;
}

/* Подпись «д.N · за 3–16» — шире колонка досок. */
body.ct-watch-page .ct-watch-boards--wide {
    flex: 0 0 34rem;
    width: 34rem;
    max-width: 52vw;
}

body.ct-watch-page .ct-watch-boards-title {
    font-size: var(--ct-watch-board-title-font);
    font-weight: 700;
    margin: 0 0 var(--ct-watch-title-mb) 6px;
    color: #333;
}

body.ct-watch-page .ct-watch-board-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: var(--ct-watch-row-pad) 6px;
    border-radius: 4px;
    font-size: var(--ct-watch-board-font);
    line-height: var(--ct-watch-board-line);
}

body.ct-watch-page .ct-watch-board-row--busy {
    background: #fff;
}

/* Новая объявленная доска — голубой фон ~1 мин. */
body.ct-watch-page .ct-watch-board-row--fresh {
    background: #d0eaf8;
}

body.ct-watch-page .ct-watch-board-row--waiting .ct-watch-board-pair {
    font-weight: 500;
    color: #8a8a90;
}

body.ct-watch-page .ct-watch-board-row--waiting .ct-watch-wait-rest {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    color: #8a8a90;
    white-space: nowrap;
}

body.ct-watch-page .ct-watch-game-duration {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #456;
    white-space: nowrap;
}

body.ct-watch-page .ct-watch-boards-sep {
    height: 0;
    margin: var(--ct-watch-sep-my) 6px;
    border: 0;
    border-top: 1px solid #c8c8cd;
}

body.ct-watch-page .ct-watch-board-num {
    flex: 0 1 auto;
    min-width: 2rem;
    max-width: 9.5rem;
    font-weight: 700;
    font-size: var(--ct-watch-board-num-font);
    font-variant-numeric: tabular-nums;
    color: #222;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
}

body.ct-watch-page .ct-watch-boards--wide .ct-watch-board-num {
    max-width: 15rem;
}

body.ct-watch-page .ct-watch-board-pair {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: var(--ct-watch-board-pair-font);
    color: #1a1a1a;
    white-space: nowrap;
    overflow: hidden;
}

body.ct-watch-page .ct-watch-board-free {
    font-weight: 500;
    font-size: var(--ct-watch-board-pair-font);
    color: #6a6a70;
    font-style: italic;
}

body.ct-watch-page .ct-watch-standings-main {
    --ct-watch-st-font: 1.15rem;
    --ct-watch-st-name: 1.2rem;
    --ct-watch-st-round: 1.05rem;
    --ct-watch-st-pad-y: 7px;
    --ct-watch-st-pad-x: 8px;
    --ct-watch-st-line: 1.25;
    --ct-watch-st-panel-pad: 10px;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: var(--ct-watch-st-panel-pad) 14px;
    box-sizing: border-box;
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
}

/*
 * Смартфон / низкий альбомный экран: доски ~1/5 ширины (как на ПК),
 * иначе max-width:42vw съедает почти половину экрана.
 */
@media (orientation: landscape) and (max-height: 520px),
       (max-width: 900px) and (orientation: landscape) {
    body.ct-watch-page .ct-watch-boards {
        flex: 0 0 28vw;
        width: 28vw;
        max-width: 32vw;
        min-width: 9.5rem;
        padding: var(--ct-watch-panel-pad-y) 6px;
        --ct-watch-row-pad: 3px;
        --ct-watch-title-mb: 4px;
        --ct-watch-panel-pad-y: 6px;
        --ct-watch-sep-my: 4px;
        --ct-watch-board-font: 0.82rem;
        --ct-watch-board-num-font: 0.76rem;
        --ct-watch-board-pair-font: 0.82rem;
        --ct-watch-board-line: 1.15;
        --ct-watch-board-title-font: 0.88rem;
    }

    body.ct-watch-page .ct-watch-boards--wide {
        flex: 0 0 34vw;
        width: 34vw;
        max-width: 38vw;
        min-width: 11rem;
    }

    body.ct-watch-page .ct-watch-boards-title {
        margin-left: 2px;
    }

    body.ct-watch-page .ct-watch-board-row {
        gap: 5px;
        padding-left: 2px;
        padding-right: 2px;
    }

    body.ct-watch-page .ct-watch-board-num {
        max-width: 7rem;
        min-width: 1.4rem;
    }

    body.ct-watch-page .ct-watch-boards--wide .ct-watch-board-num {
        max-width: 9rem;
    }

    body.ct-watch-page .ct-watch-standings-main {
        padding-left: 8px;
        padding-right: 8px;
    }
}

body.ct-watch-page .ct-watch-standings-main .ko-bracket-wrap {
    padding: 0;
    gap: 0;
    overflow: visible;
    width: max-content;
    max-width: none;
}

body.ct-watch-page .ct-watch-standings-main .ko-places-row {
    margin: 0;
}

body.ct-watch-page .ct-watch-standings-main .swiss-final-standings {
    /* Как у .ko-top8: свои --ct-watch-st-* (fitCtWatchStandingsTable пишет сюда). */
    --ct-watch-st-font: 1.15rem;
    --ct-watch-st-name: 1.2rem;
    --ct-watch-st-round: 1.05rem;
    --ct-watch-st-pad-y: 7px;
    --ct-watch-st-pad-x: 8px;
    --ct-watch-st-line: 1.25;
    --ct-watch-st-panel-pad: 10px;
    margin-top: 0;
}

body.ct-watch-page .ct-watch-standings-main .ko-top8,
body.ct-watch-page .ct-watch-standings-main .swiss-final-standings {
    /* Ширина по содержимому: ФИО = самая длинная запись (как на панели турнира). */
    width: max-content;
    max-width: none;
}

body.ct-watch-page .ct-watch-standings-main .ko-top-table,
body.ct-watch-page .ct-watch-standings-main .swiss-final-table {
    width: max-content;
    max-width: none;
    table-layout: auto;
    font-size: var(--ct-watch-st-font);
}

body.ct-watch-page .ct-watch-standings-main .ko-top-table caption,
body.ct-watch-page .ct-watch-standings-main .swiss-final-table caption,
body.ct-watch-page .ct-watch-scale > #standings .ko-top-table caption,
body.ct-watch-page .ct-watch-scale > #standings .swiss-final-table caption {
    display: none;
}

body.ct-watch-page .ct-watch-standings-main .ko-top-table th,
body.ct-watch-page .ct-watch-standings-main .ko-top-table td,
body.ct-watch-page .ct-watch-standings-main .swiss-final-table th,
body.ct-watch-page .ct-watch-standings-main .swiss-final-table td {
    font-size: var(--ct-watch-st-font);
    line-height: var(--ct-watch-st-line);
    padding: var(--ct-watch-st-pad-y) var(--ct-watch-st-pad-x);
}

body.ct-watch-page .ct-watch-standings-main .ko-top-name,
body.ct-watch-page .ct-watch-standings-main .swiss-final-name {
    width: auto;
    font-size: var(--ct-watch-st-name);
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

body.ct-watch-page .ct-watch-standings-main .ko-top-num--start,
body.ct-watch-page .ct-watch-standings-main .ko-top-num--round {
    font-size: var(--ct-watch-st-round);
}

/* Завершённый нокаут/швейцарка в просмотре — та же крупная итоговая таблица. */
body.ct-watch-page .ct-watch-scale > #standings {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

body.ct-watch-page .ct-watch-scale > #standings .ko-top8,
body.ct-watch-page .ct-watch-scale > #standings .swiss-final-standings {
    --ct-watch-st-font: 1.15rem;
    --ct-watch-st-name: 1.2rem;
    --ct-watch-st-round: 1.05rem;
    --ct-watch-st-pad-y: 7px;
    --ct-watch-st-pad-x: 8px;
    --ct-watch-st-line: 1.25;
    --ct-watch-st-panel-pad: 8px;
}

body.ct-watch-page .ct-watch-scale > #standings .ko-bracket-wrap {
    padding: 0;
    gap: 0;
    height: 100%;
    box-sizing: border-box;
}

body.ct-watch-page .ct-watch-scale > #standings .swiss-final-standings {
    margin-top: 0;
    height: 100%;
    box-sizing: border-box;
    padding: var(--ct-watch-st-panel-pad);
    overflow: hidden;
}

body.ct-watch-page .ct-watch-scale > #standings .ko-top-table,
body.ct-watch-page .ct-watch-scale > #standings .swiss-final-table {
    font-size: var(--ct-watch-st-font);
}

body.ct-watch-page .ct-watch-scale > #standings .ko-top-table th,
body.ct-watch-page .ct-watch-scale > #standings .ko-top-table td,
body.ct-watch-page .ct-watch-scale > #standings .swiss-final-table th,
body.ct-watch-page .ct-watch-scale > #standings .swiss-final-table td {
    font-size: var(--ct-watch-st-font);
    line-height: var(--ct-watch-st-line);
    padding: var(--ct-watch-st-pad-y) var(--ct-watch-st-pad-x);
}

body.ct-watch-page .ct-watch-scale > #standings .ko-top-name,
body.ct-watch-page .ct-watch-scale > #standings .swiss-final-name {
    font-size: var(--ct-watch-st-name);
}

body.ct-watch-page .ct-watch-scale > #standings .ko-top-num--start,
body.ct-watch-page .ct-watch-scale > #standings .ko-top-num--round {
    font-size: var(--ct-watch-st-round);
}

body.ct-watch-page .ct-watch-scale:has(.ct-watch-live),
body.ct-watch-page .ct-watch-scale:has(.ko-top-table),
body.ct-watch-page .ct-watch-scale:has(.swiss-final-standings) {
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    padding: 0;
}

/* После JS-scale шахматка/шкала растягиваются на layoutW — не клипать. */
body.ct-watch-page .ct-watch-scale > #standings:has(.arena-board-time) .arena-board-time,
body.ct-watch-page .ct-watch-scale > #standings:has(.ct-wrap) .ct-wrap {
    max-width: none;
}

/* Полноэкранный онлайн-просмотр шахматки (гость). */
.online-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: none;
    flex-direction: column;
    background: #f4f6f7;
}

body.online-mode-active {
    overflow: hidden;
}

.online-overlay__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding: 12px 18px;
    background: var(--primary, #336e78);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.online-overlay__titles {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.online-overlay__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.online-overlay__round {
    font-size: 0.95rem;
    opacity: 0.92;
}

.online-overlay__exit {
    flex: 0 0 auto;
    background: #fff;
    color: var(--primary, #336e78);
    border-color: #fff;
    font-weight: 700;
}

.online-overlay__exit:hover {
    background: #e8f3f5;
}

.online-overlay__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding: 14px 16px 24px;
}

.online-overlay__body .ct-wrap {
    margin-top: 0;
    background: #fff;
}

@media (max-width: 768px) {
    .online-overlay__bar {
        padding: 10px 12px;
        gap: 10px;
    }

    .online-overlay__title {
        font-size: 1.05rem;
    }

    .online-overlay__body {
        padding: 10px;
    }
}

.rating-delta-up {
    color: #2e7d32;
    font-weight: 700;
}

.rating-delta-down {
    color: #c62828;
    font-weight: 700;
}

.rating-delta-zero {
    color: #666;
    font-weight: 600;
}

.ct-legend {
    margin-top: 6px;
    padding: 8px 10px;
    font-size: 13px;
    color: #643c00;
    background: #fff8dc;
    border-radius: 4px;
}

.stats-page {
    max-width: 1200px;
}

/* Хабы Игроки / Турниры: без пустой полосы внизу — панель на всю высоту под шапкой. */
body[data-page="players-hub"],
body[data-page="tournaments-hub"],
body[data-page="browse-hub"],
body[data-page="sportclub"] {
    display: flex;
    flex-direction: column;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
}

body[data-page="players-hub"] #app-shell,
body[data-page="tournaments-hub"] #app-shell,
body[data-page="browse-hub"] #app-shell,
body[data-page="sportclub"] #app-shell {
    flex: 0 0 auto;
}

.app-panel--players-hub,
.app-panel--tournaments-hub,
.app-panel--browse-hub {
    max-width: none;
    width: auto;
    margin: 12px 16px 12px;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.browse-hub__tree {
    flex: 0 0 36%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 12px 10px;
    box-sizing: border-box;
    border-right: 1px solid #dde2e8;
    overflow: hidden;
}

.browse-hub__tree .app-toolbar {
    margin-bottom: 0;
    flex-shrink: 0;
}

.browse-hub__category {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 8px 0 6px;
    font-size: 15px;
    color: #456;
    white-space: nowrap;
}

.browse-hub__category label {
    flex: 0 0 auto;
    font-weight: 700;
    font-size: 1.05em;
    color: #234;
}

.browse-hub__category select {
    font: inherit;
    padding: 4px 8px;
    border: 1px solid #c5d0d4;
    border-radius: 6px;
    background: #fff;
    color: #244;
    flex: 1 1 auto;
    min-width: 0;
}

.browse-hub__tree #browse-error:empty,
.browse-hub__tree #sportclub-error:empty {
    display: none;
}

.browse-hub__club-label {
    display: none !important;
}

.browse-hub__mode-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin: 0 0 8px;
    min-width: 0;
}

.browse-hub__mode-toggle {
    flex: 1 1 auto;
    min-width: 0;
}

.browse-hub__mode-row .hub-create-btn {
    flex: 0 0 auto;
    margin-left: 0;
    padding: 8px 15px;
    font-size: 14.5px;
    line-height: 1.25;
}

.browse-hub__lists {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 4px;
}

.browse-hub__lists--single {
    gap: 0;
    margin-top: 0;
}

.browse-hub__lists--single .browse-hub__list-col {
    flex: 1 1 auto;
}

.browse-hub__lists--single .browse-hub__list-col[hidden] {
    display: none !important;
}

.browse-hub__list-col {
    flex: 1 1 50%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.browse-hub__list-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 10px;
    border-bottom: 1px solid #e4e8ec;
    flex-shrink: 0;
    min-width: 0;
}

.browse-hub__list-title-row .browse-hub__list-title {
    margin: 0;
    padding: 0;
    border: none;
    flex: 1 1 auto;
    min-width: 0;
}

.browse-hub__list-title-row .hub-create-btn {
    flex: 0 0 auto;
    padding: 8px 15px;
    font-size: 14.5px;
    line-height: 1.25;
}

.browse-hub__sport-value {
    font-weight: 600;
    color: #234;
}

.browse-hub__list-title {
    margin: 0;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #345;
    border-bottom: 1px solid #e4e8ec;
    flex-shrink: 0;
}

.browse-hub__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

/* Мобильный селект вместо длинного списка — на ПК скрыт. */
.browse-hub__mobile-select-wrap {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.browse-hub__mobile-select-label {
    font-size: 13px;
    font-weight: 600;
    color: #456;
}

.browse-hub__mobile-select {
    width: 100%;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #c5d0d4;
    border-radius: 8px;
    background: #fff;
    color: #234;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

.browse-hub__list-item {
    display: block;
    padding: 6px 10px;
    /* Как ФИО в шахматках / строки data-table справа. */
    font-size: var(--ct-name-font, 15px);
    color: #234;
    text-decoration: none;
    line-height: 1.3;
    cursor: pointer;
}

.browse-hub__list-item:hover {
    background: #eef3f7;
}

.browse-hub__list-item.is-selected {
    background: #d8e8f4;
    font-weight: 600;
}

.browse-hub__list-hint {
    padding: 10px;
    font-size: var(--ui-font, 14px);
    color: #789;
}

.browse-hub__tree-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 4px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.browse-hub__detail {
    flex: 1 1 64%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f5f6f8;
    overflow: hidden;
}

/* Правая панель игрока — на всю высоту detail. */
.browse-hub__detail > .players-hub__stats {
    flex: 1 1 0;
    min-height: 0;
    align-self: stretch;
}

.browse-hub__detail > #browse-detail-empty {
    flex: 1 1 auto;
}

.browse-hub__detail > [hidden] {
    display: none !important;
}

.browse-hub__tournament {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.browse-hub__frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

.tournaments-hub__list {
    flex: 0 0 34%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 14px 16px 10px;
    box-sizing: border-box;
    border-right: 1px solid #dde2e8;
    overflow: hidden;
}

.tournaments-hub__list .app-toolbar {
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Пустой error не занимает место между заголовком и таблицей. */
.tournaments-hub__list #tournaments-error:empty {
    display: none;
}

.tournaments-hub__list #tournaments-error {
    margin: 4px 0 0;
    min-height: 0;
}

.tournaments-hub__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 4px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.tournaments-hub__detail {
    flex: 1 1 66%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #f5f6f8;
    overflow: hidden;
}

.tournaments-hub__frame {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    border: 0;
    background: #fff;
}

.work-btn--danger {
    color: #a01e1e;
    background: #eceff1;
    border-color: #d0d5da;
}

.work-btn--danger:hover {
    background: #e4e7ea;
}

body.tournament-embed {
    margin: 0;
    background: #f5f6f8;
    /* Одна прокрутка: шахматка/сетка, затем туры (как desktop archive). */
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
}

/* Шапка турнира в хабе: название/тур, под ними кнопки. */
body.tournament-embed .app-panel.tournament-view .app-toolbar {
    margin: 0;
    padding: 4px 12px 2px;
    gap: 6px;
}

body.tournament-embed .app-panel.tournament-view .tournament-head {
    column-gap: 12px;
    row-gap: 6px;
    flex-wrap: wrap;
}

body.tournament-embed .app-panel.tournament-view .app-toolbar #page-title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    color: #1e1e23;
}

body.tournament-embed .app-panel.tournament-view .tournament-actions {
    flex: 1 0 100%;
    width: 100%;
}

body.tournament-embed .app-panel.tournament-view .tournament-actions .work-btn {
    font-weight: 700;
}

body.tournament-embed #app-shell {
    display: none !important;
}

body.tournament-embed > main.app-panel {
    margin: 0;
    max-width: none;
    width: auto;
    min-height: 100%;
    height: auto;
    box-sizing: border-box;
    overflow: visible;
}

/* Запасной запрет бокового сплита в iframe хаба (JS уже ставит split-stack). */
body.tournament-embed .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side,
body.tournament-embed .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide {
    display: block;
    min-height: 0;
}

body.tournament-embed .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #standings.pairings-board,
body.tournament-embed .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board,
body.tournament-embed .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #standings.pairings-board,
body.tournament-embed .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board {
    height: auto;
    max-height: none;
    overflow: visible;
    order: unset;
    border-left: none;
    border-right: none;
    padding-left: 0;
    padding-right: 0;
}

/* «На весь экран» — без гориз. скролла, вертикальный допускается. */
body.tournament-guest-fs {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    height: 100%;
    -webkit-user-select: none;
    user-select: none;
}

body.tournament-guest-fs #app-shell {
    display: none !important;
}

html:fullscreen,
html:-webkit-full-screen {
    background: #f5f6f8;
}

body.tournament-guest-fs > main.app-panel {
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
    min-height: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

body.tournament-guest-fs #view-panel,
body.tournament-guest-fs .pairings-board,
body.tournament-guest-fs .table-scroll,
body.tournament-guest-fs .ct-wrap,
body.tournament-guest-fs .ko-bracket-wrap {
    max-width: 100%;
    overflow-x: hidden !important;
}

body.tournament-guest-fs #tournament-fs-btn,
body.tournament-guest-fs #guest-fs-btn,
body.tournament-guest-fs #view-actions {
    display: none !important;
}

/* Хаб «Турниры»: iframe турнира на весь viewport поверх списка. */
body.tournaments-hub-fs {
    overflow: hidden;
}

body.tournaments-hub-fs .tournaments-hub__detail {
    position: fixed;
    inset: 0;
    z-index: 9000;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    background: #f5f6f8;
    overflow: hidden;
}

body.tournaments-hub-fs #tournament-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* В fullscreen ФИО не подсвечиваются и не выглядят кликабельными. */
body.tournament-guest-fs .crosstable tbody td.ct-name--link,
body.tournament-guest-fs .ko-top-table tbody td.ko-top-name--link {
    cursor: default;
    pointer-events: none;
}

body.tournament-guest-fs .crosstable tbody td.ct-name--link:hover,
body.tournament-guest-fs .ko-top-table tbody td.ko-top-name--link:hover {
    background: inherit;
}

/* Хаб /browse: iframe турнира на весь viewport поверх дерева. */
body.browse-tournament-fs {
    overflow: hidden;
}

body.browse-tournament-fs #browse-tournament-panel {
    position: fixed;
    inset: 0;
    z-index: 9000;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    background: #f5f6f8;
    overflow: hidden;
}

body.browse-tournament-fs #browse-tournament-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 900px) {
    /*
     * Смартфон: список фиксированной высоты (свой скролл),
     * панель под ним — оставшаяся высота с одним скроллом.
     */
    body[data-page="players-hub"],
    body[data-page="tournaments-hub"],
    body[data-page="browse-hub"],
    body[data-page="sportclub"] {
        display: flex;
        flex-direction: column;
        height: 100dvh;
        max-height: 100dvh;
        min-height: 0;
        overflow: hidden;
    }

    body[data-page="players-hub"] #app-shell,
    body[data-page="tournaments-hub"] #app-shell,
    body[data-page="browse-hub"] #app-shell,
    body[data-page="sportclub"] #app-shell {
        flex: 0 0 auto;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .app-panel--tournaments-hub,
    .app-panel--players-hub,
    .app-panel--browse-hub {
        flex-direction: column;
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: hidden;
        margin: 6px 8px 8px;
    }

    .browse-hub__tree,
    .tournaments-hub__list,
    .players-hub__list {
        flex: 0 0 auto;
        height: auto;
        max-height: none;
        min-height: 0;
        padding: 8px 10px 8px;
        border-right: none;
        border-bottom: 1px solid #dde2e8;
        overflow: visible;
    }

    /* Название клуба уже в селекте — дублирующую строку не показываем. */
    .browse-hub__club-label {
        display: none !important;
    }

    .browse-hub__mode-row {
        margin: 0 0 6px;
        flex-shrink: 0;
    }

    .browse-hub__lists,
    .browse-hub__lists--single,
    .browse-hub__list-col {
        flex: 0 0 auto;
        min-height: 0;
        overflow: visible;
        border: none;
        background: transparent;
        border-radius: 0;
    }

    .browse-hub__mobile-select-wrap {
        display: flex;
        margin: 0 0 2px;
    }

    .browse-hub__mobile-select-label {
        display: none !important;
    }

    .browse-hub__list,
    .tournaments-hub__list-scroll,
    .players-hub__list-scroll {
        display: none !important;
    }

    /* Вид статистики / турнира — селект вместо кнопок (не трогаем Игроки/Турниры). */
    .standings-view-toggle:has(.standings-view-select) {
        display: flex;
        width: 100%;
        max-width: 100%;
        border: none;
        border-radius: 0;
        background: transparent;
        overflow: visible;
    }

    .standings-view-toggle:has(.standings-view-select) > .standings-view-toggle__btn {
        display: none !important;
    }

    .standings-view-select {
        display: block;
        width: 100%;
    }

    /* Тап по клетке/карточке: подсказка H2H чуть крупнее. */
    .standings-data-tip {
        max-width: min(320px, 94%);
        font-size: 0.9rem;
        padding: 8px 10px;
        z-index: 40;
    }

    .standings-data-tip--fixed {
        position: fixed !important;
        z-index: 10000 !important;
        max-width: min(320px, calc(100vw - 16px)) !important;
        pointer-events: none;
    }

    .standings-data-tip__h2h,
    .standings-data-tip__duration,
    .standings-data-tip__meta {
        font-size: 0.85rem;
    }

    .players-hub__stats .app-toolbar #stats-view-toggle {
        flex: 1 1 100%;
        min-width: 0;
        margin-top: 4px;
    }

    #view-actions .standings-view-toggle,
    #view-actions .standings-view-toggle:has(.standings-view-select) {
        flex: 1 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .app-panel.tournament-view #view-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .app-panel.tournament-view #view-actions .standings-view-select {
        width: 100%;
    }

    /*
     * Хаб на смартфоне: название уже в селекте сверху;
     * переключатель вида — отдельная строка, Экспорт / Табло — под ним.
     */
    body.tournament-embed .app-panel.tournament-view .app-toolbar #page-title {
        display: none !important;
    }

    body.tournament-embed .app-panel.tournament-view .app-toolbar {
        margin-bottom: 2px;
        padding: 2px 8px 0;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-head {
        flex-wrap: wrap;
        width: 100%;
        gap: 4px 8px;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-actions,
    body.tournament-embed .app-panel.tournament-view #view-actions {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        width: 100%;
        gap: 6px 8px;
    }

    body.tournament-embed .app-panel.tournament-view #view-actions .standings-view-toggle,
    body.tournament-embed .app-panel.tournament-view #view-actions
        .standings-view-toggle:has(.standings-view-select) {
        flex: 1 0 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    body.tournament-embed .app-panel.tournament-view #view-actions .standings-view-select {
        min-height: 36px;
        font-size: 14px;
        padding: 6px 10px;
        width: 100%;
    }

    body.tournament-embed .app-panel.tournament-view #view-actions .work-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        min-height: 0;
        white-space: nowrap;
        /* Как меню сайта / nav-btn на смартфоне. */
        padding: 8px 14px;
        margin: 5px;
        font-size: 14px;
        line-height: 1.2;
        border-radius: 30px;
        box-sizing: border-box;
    }

    .browse-hub__detail,
    .tournaments-hub__detail,
    .players-hub__stats,
    .players-hub__stats.stats-page {
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        display: flex;
        flex-direction: column;
    }

    .browse-hub__detail > .players-hub__stats,
    .browse-hub__detail > #browse-detail-empty,
    .browse-hub__detail > .browse-hub__tournament {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    /* Один скролл карточки игрока / пустого состояния. */
    .browse-hub__detail > .players-hub__stats,
    .browse-hub__detail > #browse-detail-empty,
    .app-panel--players-hub .players-hub__stats {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 8px 10px 12px;
    }

    /* Турнир: iframe на всю оставшуюся высоту, скролл внутри кадра. */
    .browse-hub__tournament,
    .tournaments-hub__detail {
        overflow: hidden !important;
    }

    .browse-hub__frame,
    .tournaments-hub__frame {
        flex: 1 1 auto;
        width: 100%;
        height: 100%;
        min-height: 0;
        border: 0;
        display: block;
    }
}

.players-hub__list {
    flex: 0 0 42%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 10px 16px 10px;
    box-sizing: border-box;
    border-right: 1px solid #dde2e8;
    overflow: hidden;
}

/* Пустой error не занимает место между шапкой и списком / графиком. */
.players-hub__list #players-error:empty,
.players-hub__stats #stats-error:empty {
    display: none;
}

.players-hub__list #players-error,
.players-hub__stats #stats-error {
    margin: 4px 0 0;
    min-height: 0;
}

.players-hub__list-scroll {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 4px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.players-hub__stats,
.players-hub__stats.stats-page {
    flex: 1 1 58%;
    min-width: 0;
    max-width: none;
    width: auto;
    display: flex;
    flex-direction: column;
    padding: 10px 16px 12px;
    box-sizing: border-box;
    /* Высоту делят карточки; таблицы скроллятся внутри. */
    overflow: hidden;
    background: #f5f6f8;
}

.players-hub__stats .app-toolbar {
    flex-shrink: 0;
    margin-bottom: 0;
}

.players-hub__stats #stats-error {
    flex-shrink: 0;
}

/* Переключатели разделов статистики в шапке карточки игрока. */
.players-hub__stats .app-toolbar {
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: center;
}

.players-hub__stats .app-toolbar #stats-view-toggle {
    flex: 0 1 auto;
    max-width: 100%;
}

.players-hub__stats .app-toolbar #stats-view-toggle[hidden] {
    display: none !important;
}

.players-hub__stats .app-toolbar #stats-view-toggle .standings-view-toggle__btn {
    white-space: nowrap;
}

/* basis 0 — блок статистики всегда занимает всю высоту под шапкой. */
.players-hub__stats #stats-body.stats-grid--stack {
    flex: 1 1 0;
    min-height: 0;
    margin-top: 4px;
    gap: 10px;
    overflow: hidden;
}

/* Один раздел на весь блок (переключатель в шапке). */
.players-hub__stats #stats-body.stats-grid--tabs {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    gap: 0;
}

.players-hub__stats #stats-body.stats-grid--tabs > .stats-card[hidden] {
    display: none !important;
}

.players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]) {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    grid-column: auto !important;
    display: flex !important;
    flex-direction: column;
    overflow: hidden;
    padding-top: 8px;
}

.players-hub__stats #stats-body.stats-grid--tabs > .stats-card--rating:not([hidden]) .chart-wrap,
.players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) .chart-wrap {
    flex: 1 1 0;
    min-height: 0;
    height: auto;
}

.players-hub__stats #stats-body.stats-grid--tabs > .stats-card--tournaments:not([hidden]) .table-scroll {
    flex: 1 1 0;
    min-height: 0;
}

.players-hub__stats #stats-empty {
    flex: 1 1 0;
    min-height: 0;
}

.players-hub__stats #stats-empty[hidden],
.players-hub__stats #stats-body[hidden] {
    display: none !important;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}

.stats-grid--stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stats-grid--stack .stats-card--h2h,
.stats-grid--stack .stats-card--tournaments {
    grid-row: auto;
    grid-column: auto;
}

/* График — заметная доля высоты, без жёсткого потолка 30%. */
.players-hub__stats .stats-grid--stack > .stats-card:nth-child(1) {
    flex: 1.25 1 0;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
    overflow: hidden;
}

.players-hub__stats .stats-grid--stack > .stats-card:nth-child(1) h2 {
    flex-shrink: 0;
    margin-bottom: 6px;
}

/* Турниры и H2H забирают оставшуюся высоту поровну. */
.players-hub__stats .stats-grid--stack > .stats-card--tournaments,
.players-hub__stats .stats-grid--stack > .stats-card--h2h {
    flex: 1.15 1 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Каталог и хаб «Игроки»: турниры и H2H рядом; на узком экране — столбиком. */
body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack,
body[data-page="players-hub"] .players-hub__stats .stats-grid--stack,
body[data-page="sportclub"] .players-hub__stats .stats-grid--stack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(160px, 1.15fr) minmax(0, 1.2fr);
    gap: 14px;
}

body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack > .stats-card:nth-child(1),
body[data-page="players-hub"] .players-hub__stats .stats-grid--stack > .stats-card:nth-child(1),
body[data-page="sportclub"] .players-hub__stats .stats-grid--stack > .stats-card:nth-child(1) {
    grid-column: 1 / -1;
    flex: none;
    min-height: 160px;
}

body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack > .stats-card--tournaments,
body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack > .stats-card--h2h,
body[data-page="players-hub"] .players-hub__stats .stats-grid--stack > .stats-card--tournaments,
body[data-page="players-hub"] .players-hub__stats .stats-grid--stack > .stats-card--h2h,
body[data-page="sportclub"] .players-hub__stats .stats-grid--stack > .stats-card--tournaments,
body[data-page="sportclub"] .players-hub__stats .stats-grid--stack > .stats-card--h2h {
    flex: none;
    min-height: 0;
}

body[data-page="browse-hub"] .stats-card .data-table td.tournaments-title,
body[data-page="browse-hub"] .stats-card .data-table th:nth-child(2),
body[data-page="players-hub"] .stats-card .data-table td.tournaments-title,
body[data-page="players-hub"] .stats-card .data-table th:nth-child(2) {
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body[data-page="browse-hub"] .stats-card .data-table td.h2h-color,
body[data-page="players-hub"] .stats-card .data-table td.h2h-color {
    text-align: center;
    width: 2.5rem;
}

/* Планшет (~901–1100): делить высоту между карточками. На телефоне — нет (иначе пустая зона). */
@media (min-width: 901px) and (max-width: 1100px) {
    body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack,
    body[data-page="players-hub"] .players-hub__stats .stats-grid--stack,
    body[data-page="sportclub"] .players-hub__stats .stats-grid--stack {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        grid-template-rows: none;
    }

    body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack > .stats-card:nth-child(1),
    body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack > .stats-card--tournaments,
    body[data-page="browse-hub"] .players-hub__stats .stats-grid--stack > .stats-card--h2h,
    body[data-page="players-hub"] .players-hub__stats .stats-grid--stack > .stats-card:nth-child(1),
    body[data-page="players-hub"] .players-hub__stats .stats-grid--stack > .stats-card--tournaments,
    body[data-page="players-hub"] .players-hub__stats .stats-grid--stack > .stats-card--h2h,
    body[data-page="sportclub"] .players-hub__stats .stats-grid--stack > .stats-card:nth-child(1),
    body[data-page="sportclub"] .players-hub__stats .stats-grid--stack > .stats-card--tournaments,
    body[data-page="sportclub"] .players-hub__stats .stats-grid--stack > .stats-card--h2h {
        flex: 1.1 1 0;
        min-height: 140px;
    }
}

.players-hub__stats .stats-grid--stack > .stats-card h2 {
    flex-shrink: 0;
}

.players-hub__stats .stats-grid--stack > .stats-card--h2h .h2h-filters {
    flex-shrink: 0;
}

.players-hub__stats .stats-grid--stack .chart-wrap,
.players-hub__stats .stats-grid--stack .table-scroll {
    flex: 1 1 0;
    min-height: 0;
}

.stats-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 14px 16px 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    min-width: 0;
}

.stats-card h2 {
    margin: 0 0 12px;
    color: var(--primary, #336e78);
    font-size: 1.05rem;
}

.stats-card--h2h {
    grid-row: 1 / span 2;
    grid-column: 2;
}

.stats-card--tournaments {
    grid-column: 1;
    overflow: hidden;
}

@media (max-width: 900px) {
    /* Карточки статистики — по содержимому; скролл у панели detail / players-hub__stats. */
    .players-hub__stats #stats-body.stats-grid--stack,
    .players-hub__stats #stats-body.stats-grid--tabs {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }

    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]),
    .players-hub__stats #stats-body.stats-grid--stack > .stats-card:not([hidden]),
    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]),
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]),
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]) {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .players-hub__stats #stats-empty {
        flex: none !important;
        min-height: 0 !important;
    }

    .players-hub__stats .stats-grid--stack .stats-card--rating .chart-wrap,
    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--rating:not([hidden]) .chart-wrap,
    body[data-page="sportclub"] .players-hub__stats .stats-card--rating .chart-wrap,
    body[data-page="browse-hub"] .players-hub__stats .stats-card--rating .chart-wrap {
        flex: none !important;
        width: 100% !important;
        height: 240px !important;
        min-height: 240px !important;
        max-height: 240px !important;
        overflow: hidden !important;
    }

    .players-hub__stats .stats-grid--stack .stats-card--h2h .chart-wrap,
    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) .chart-wrap,
    body[data-page="sportclub"] .players-hub__stats .stats-card--h2h .chart-wrap,
    body[data-page="browse-hub"] .players-hub__stats .stats-card--h2h .chart-wrap {
        flex: none !important;
        width: 100% !important;
        height: 168px !important;
        min-height: 168px !important;
        max-height: 168px !important;
        overflow: hidden !important;
    }

    .players-hub__stats .stats-grid--stack .chart-wrap canvas,
    .players-hub__stats #stats-body.stats-grid--tabs .chart-wrap canvas,
    body[data-page="sportclub"] .players-hub__stats .chart-wrap canvas {
        touch-action: manipulation;
        display: block;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .players-hub__list-scroll::-webkit-scrollbar,
    .browse-hub__list::-webkit-scrollbar,
    .tournaments-hub__list-scroll::-webkit-scrollbar {
        width: 4px;
    }

    .players-hub__list-scroll::-webkit-scrollbar-thumb,
    .browse-hub__list::-webkit-scrollbar-thumb,
    .tournaments-hub__list-scroll::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.25);
        border-radius: 4px;
    }

    /* Таблицы: горизонтальный скролл свой; вертикаль — у панели карточки. */
    .players-hub__stats .stats-grid--stack .table-scroll,
    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--tournaments:not([hidden]) .table-scroll,
    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) .table-scroll {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    .players-hub__stats .stats-card--tournaments,
    .players-hub__stats .stats-card--h2h,
    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--tournaments:not([hidden]),
    .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) {
        flex: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    .players-hub__stats .h2h-filters {
        flex-wrap: wrap;
    }

    .players-hub__stats .h2h-summary {
        white-space: normal;
    }
}

/* Ширины колонок считает sizeStatsDataTable (Наименование — по самой широкой записи). */
.stats-card--tournaments .table-scroll,
.stats-card--h2h .table-scroll {
    overflow: auto;
}

.stats-card--tournaments .table-scroll > .data-table,
.stats-card--h2h .table-scroll > .data-table {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}

.stats-card--tournaments .data-table th,
.stats-card--tournaments .data-table td,
.stats-card--h2h .data-table th,
.stats-card--h2h .data-table td {
    padding: 8px 5px;
    white-space: nowrap;
}

.stats-card--tournaments .data-table th,
.stats-card--h2h .data-table th {
    overflow: visible;
}

.stats-card--tournaments .data-table td,
.stats-card--h2h .data-table td {
    overflow: hidden;
    text-overflow: clip;
}

.stats-card--tournaments .data-table td.tournaments-title,
.stats-card--h2h .data-table td.tournaments-title {
    text-align: left;
}

.stats-card--tournaments .data-table th:last-child,
.stats-card--tournaments .data-table td:last-child {
    font-variant-numeric: tabular-nums;
}

.chart-wrap {
    width: 100%;
    min-width: 0;
    min-height: 160px;
    overflow: hidden;
    position: relative;
}

#rating-chart,
#h2h-chart {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 160px;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
    touch-action: pan-y;
}

.h2h-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 10px;
    min-width: 0;
}

.h2h-filters #opponent-select {
    flex: 0 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

.h2h-summary {
    flex: 1 1 220px;
    font-weight: 700;
    font-size: 15px;
    margin: 0;
    color: #333;
    white-space: normal;
    line-height: 1.35;
}

.table-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.table-scroll > .data-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

/* Заголовок не уезжает при вертикальном скролле таблицы. */
.stats-card--tournaments .table-scroll > .data-table thead th,
.stats-card--h2h .table-scroll > .data-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    box-shadow: inset 0 -1px 0 #eee;
}

#opponent-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.edit-player-display {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    padding: 6px 0;
    color: #1a1a1a;
}

.players-hub__stats .stats-card--tournaments .data-table,
.players-hub__stats .stats-card--h2h .data-table {
    font-size: 16.5px;
}

.players-hub__stats .stats-card--tournaments .data-table th,
.players-hub__stats .stats-card--h2h .data-table th {
    font-size: 17px;
}

tr.clickable {
    cursor: pointer;
}

tr.clickable:hover td {
    background: #eef6f8;
}

tr.clickable.selected td {
    background: #dceef5;
}

/* Разделители как в десктопе: тонкая №|ФИО|Пол|Рейтинг|Партий. */
.players-table {
    --players-line-thin: #d2dce0;
    --players-line-group: #9bb4ba;
    border-collapse: collapse;
    border: none;
}

.players-table--single .players-name {
    text-align: left;
}

.players-table--single .players-group-start {
    border-left: 2px solid var(--players-line-group);
}

.players-table th,
.players-table td {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--players-line-thin);
}

.players-table thead th {
    text-align: center;
}

.players-table .players-corner {
    vertical-align: middle;
    text-align: left;
}

.players-table .players-cat {
    font-size: 18px;
    letter-spacing: 0.01em;
}

.players-table .players-sub {
    font-size: 15px;
    font-weight: 600;
    color: #4a6b72;
    white-space: nowrap;
}

.players-table .players-num {
    border-right: 1px solid var(--players-line-thin);
    text-align: center;
}

.players-table .players-name {
    border-right: 1px solid var(--players-line-thin);
}

.players-table .players-sex {
    border-right: 2px solid var(--players-line-group);
    text-align: center;
    width: 48px;
    min-width: 2.5em;
}

.players-table .players-rating {
    border-right: 1px solid var(--players-line-thin);
    text-align: center;
    min-width: 4.5em;
    white-space: nowrap;
}

.players-table .players-games {
    text-align: center;
    min-width: 4em;
    white-space: nowrap;
}

/* Узкая левая панель: не сжимать рейтинг/партии — гориз. скролл при необходимости. */
.players-hub__list-scroll .players-table,
.lists-pane--players .players-table {
    width: max-content;
    min-width: 100%;
}

/* Толстые стыки категорий (Блиц, Классика); у Рапид линия на правом крае «Пол». */
.players-table tbody td.players-group-start:not(:nth-child(4)),
.players-table thead tr:first-child th.players-group-start:not(:nth-child(4)),
.players-table thead tr:last-child th.players-group-start:nth-child(3),
.players-table thead tr:last-child th.players-group-start:nth-child(5) {
    border-left: 2px solid var(--players-line-group);
}

.data-table tr.pairing-row-waiting td {
    color: #8a8a8a;
    background: #f7f7f7;
}

.pairing-waiting {
    color: #8a8a8a;
    font-style: italic;
}

.player-rest-left {
    color: #8a6a14;
    font-weight: 600;
    font-style: normal;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .stats-card--h2h,
    .stats-card--tournaments {
        grid-column: 1;
        grid-row: auto;
    }
}

/* Шапка при ширине ~1024: поджать название клуба (дополняет landing.css). */
@media (min-width: 769px) and (max-width: 1100px) {
    .top-bar .club-switcher,
    .top-bar .club-switcher--after-home {
        max-width: min(150px, 16vw);
        font-size: 13px;
    }
}

/* Компактная плотность только по ширине (~1024), не по высоте окна на большом мониторе. */
@media (max-width: 1100px) {
    .hub-create-btn__full {
        display: none;
    }

    .hub-create-btn__short {
        display: inline;
    }

    :root {
        --ui-font: 13px;
        --work-btn-pad-y: 5px;
        --work-btn-pad-x: 12px;
        --work-btn-font: 12.5px;
        --header-title-size: 1.15rem;
        --ct-font: 12.5px;
        --ct-th-font: 13px;
        --ct-name-font: 13.5px;
        --ct-row-h: 24px;
        --ct-name-max: none;
        --ct-opp-w: 24px;
        --ko-col-w: 196px;
        --ko-col-gap: 12px;
        --ko-slot-min-h: 24px;
        --ko-slot-font: 13px;
        --ko-title-font: 12.5px;
        --list-row-pad-y: 5px;
        --app-toolbar-gap: 6px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 5px 8px;
    }

    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide {
        min-height: 0;
        max-height: calc(100dvh - 150px);
    }

    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #standings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #standings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board {
        height: auto;
        max-height: calc(100dvh - 150px);
        overflow: auto;
    }

    .standings-section-title {
        font: 700 1.15rem/1.3 "Segoe UI Semibold", "Segoe UI", sans-serif;
    }

    .groups-final-standings__groups .standings-section-title {
        font-size: 1rem;
    }

    .ko-top8 {
        --ko-top-font: 13px;
        --ko-top-num-font: 11px;
    }

    .app-panel.tournament-view .tournament-head {
        gap: 6px 10px;
    }

    .pairing-block {
        margin-bottom: 8px;
    }

    /* Игроки / Турниры: ужать шапки левой и правой панелей, уменьшить кнопки */
    .players-hub__list,
    .tournaments-hub__list {
        padding: 6px 10px 6px;
    }

    .players-hub__stats {
        padding: 6px 10px 8px;
    }

    .app-toolbar--players,
    .app-toolbar--tournaments,
    .app-toolbar--player-stats,
    .tournaments-hub__list .app-toolbar,
    .players-hub__stats .app-toolbar {
        gap: 5px 8px;
        margin-bottom: 0;
    }

    .players-hub__list .app-toolbar h1,
    .tournaments-hub__list .app-toolbar h1 {
        font-size: 1.1rem;
        line-height: 1.2;
    }

    .app-toolbar--player-stats #page-title,
    .players-hub__stats .app-toolbar h2 {
        font-size: 0.98rem !important;
        line-height: 1.25;
    }

    .app-toolbar--players .players-sort-row {
        gap: 5px;
        font-size: 12.5px;
    }

    .app-panel--players-hub .players-sort {
        font-size: 12.5px;
        padding: 3px 6px;
    }

    .players-hub__list .work-btn,
    .players-hub__stats .work-btn,
    .tournaments-hub__list .work-btn,
    .players-stats-actions .work-btn,
    .hub-create-btn {
        padding: 5px 11px;
        margin: 0;
        font-size: 12.5px;
        border-radius: 14px;
        line-height: 1.2;
    }

    .browse-hub__list-title-row .hub-create-btn {
        padding: 8px 15px;
        font-size: 14.5px;
        line-height: 1.25;
    }

    .players-hub__list .work-btn:hover,
    .players-hub__stats .work-btn:hover,
    .tournaments-hub__list .work-btn:hover,
    .hub-create-btn:hover {
        transform: none;
    }

    /* Правая панель Турниры (iframe): шапка турнира и кнопки действий */
    body.tournament-embed .app-panel.tournament-view .app-toolbar {
        padding: 2px 8px 0;
        gap: 4px 6px;
        margin-bottom: 2px;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-head {
        column-gap: 8px;
        row-gap: 4px;
    }

    body.tournament-embed .app-panel.tournament-view .app-toolbar #page-title {
        font-size: 0.95rem;
        line-height: 1.25;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-actions .work-btn,
    body.tournament-embed .app-panel.tournament-view #view-actions .work-btn {
        padding: 8px 14px;
        margin: 5px;
        font-size: 14px;
        border-radius: 30px;
        line-height: 1.2;
        min-height: 0;
        box-sizing: border-box;
    }

    /* Смартфон: те же отступы шапки, высота кнопок уже выровнена выше. */
    @media (max-width: 900px) {
        body.tournament-embed .app-panel.tournament-view .app-toolbar {
            margin-bottom: 2px;
            padding: 2px 8px 0;
        }

        body.tournament-embed .app-panel.tournament-view .tournament-head {
            row-gap: 4px;
        }
    }
}

/* Смартфоны: компактная вёрстка панелей, шапки и таблиц */
@media (max-width: 768px) {
    .app-panel {
        margin: 12px 10px 24px;
        padding: 16px 14px;
        border-radius: 8px;
        max-width: none;
    }

    /* Хаб клуба: без пустой полосы под меню и внизу экрана. */
    .app-panel--browse-hub,
    .app-panel--players-hub {
        margin: 4px 8px 8px;
        padding: 0;
    }

    .app-panel h1 {
        font-size: 1.35rem;
        line-height: 1.3;
    }

    .app-toolbar {
        gap: 8px;
        margin-bottom: 12px;
        align-items: flex-start;
    }

    .app-toolbar-back {
        margin-left: 0;
        width: 100%;
    }

    .app-panel.tournament-view .app-toolbar {
        flex-wrap: wrap;
    }

    .app-panel.tournament-view .tournament-head {
        flex-wrap: wrap;
    }

    .app-panel.tournament-view .tournament-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    .app-panel.tournament-view .tournament-actions .work-btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .app-panel.tournament-view .app-toolbar #page-title {
        font-size: 1.1rem;
        line-height: 1.35;
        white-space: normal;
    }

    /* Embed в хабе: переключатель вида сверху, кнопки действий ниже. */
    body.tournament-embed .app-panel.tournament-view .tournament-head {
        flex-wrap: wrap;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-actions {
        flex-wrap: wrap;
        width: 100%;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-actions .standings-view-toggle {
        flex: 1 0 100%;
        width: 100%;
    }

    body.tournament-embed .app-panel.tournament-view .tournament-actions .work-btn {
        flex: 0 0 auto;
    }

    body.tournament-embed .app-panel.tournament-view .app-toolbar #page-title {
        display: none !important;
    }

    /*
     * Турнир на телефоне: один скролл страницы (палец), без внутренней полосы у края.
     * Таблицы/результаты не раздувают ширину за viewport.
     */
    body[data-page="tournament"],
    body.tournament-embed {
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .app-panel.tournament-view {
        margin: 8px;
        padding: 12px 10px 16px;
        max-width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
    }

    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-stack {
        display: flex !important;
        flex-direction: column !important;
        max-height: none !important;
        min-height: 0 !important;
        grid-template-columns: none !important;
    }

    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #standings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #standings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-side #pairings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds.split-wide #pairings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds #standings.pairings-board,
    .app-panel.tournament-view #view-panel.is-visible.has-rounds #pairings.pairings-board {
        height: auto !important;
        max-height: none !important;
        width: auto !important;
        max-width: 100% !important;
        border-left: none;
        border-right: none;
        padding-left: 0;
        padding-right: 0;
        /* visible ломает H-скролл шахматки (.ct-wrap); оставляем auto по X. */
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    /* Шахматка на телефоне: пальцевый гориз. скролл (fitCrosstable ставит preferScroll). */
    .app-panel.tournament-view #standings .points-standings-crosstable,
    .app-panel.tournament-view #standings .ct-wrap {
        overflow-x: auto !important;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        max-width: 100%;
    }

    /* Партии туров сверху, турнирная таблица / шахматка — в конце. */
    .app-panel.tournament-view #view-panel.is-visible.has-rounds #pairings.pairings-board {
        order: 1 !important;
        margin-top: 0 !important;
    }

    .app-panel.tournament-view #view-panel.is-visible.has-rounds #standings.pairings-board {
        order: 2 !important;
        margin-top: 16px !important;
    }

    .app-panel.tournament-view #pairings.pairings-board .pairings-scroll,
    .app-panel.tournament-view #pairings.pairings-board .pairings-scroll-inner {
        display: block !important;
        width: auto !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .app-panel.tournament-view .round-block .table-scroll {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }

    .app-panel.tournament-view .round-block .table-scroll > .data-table,
    .app-panel.tournament-view #pairings.pairings-board .data-table,
    .app-panel.tournament-view .round-block .table-scroll > .data-table--pairing-compact {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .app-panel.tournament-view .result-btns {
        flex-wrap: wrap;
        gap: 4px;
        width: auto !important;
        max-width: 100% !important;
    }

    .app-panel.tournament-view .btn-result {
        padding: 8px 10px;
        min-width: 44px;
        font-size: 13px;
    }

    .app-panel.tournament-view .round-block:not(.round-block--phone-pairings)
        .data-table td:nth-child(2),
    .app-panel.tournament-view .round-block .data-table td:nth-child(4) {
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
        max-width: 28vw;
    }

    .app-panel.tournament-view .round-block--phone-pairings
        .pairing-compact-row--phone .pairing-compact-players-cell {
        font-size: 14px;
        white-space: normal !important;
        word-break: break-word;
        max-width: none !important;
        overflow: visible !important;
    }

    .app-panel.tournament-view .round-block--phone-pairings
        .pairing-compact-row--phone .result-cell {
        width: 48% !important;
        min-width: 9.5rem !important;
        max-width: none !important;
        height: auto !important;
        overflow: visible !important;
        white-space: normal !important;
    }

    .app-panel.tournament-view .ct-wrap,
    .app-panel.tournament-view #standings.pairings-board {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .crosstable {
        font-size: 12px;
    }

    .crosstable th,
    .crosstable td {
        padding: 4px 1px;
        height: 26px;
    }

    .crosstable .ct-name {
        font-size: 13px;
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .swiss-final-table td.swiss-final-name,
    .ko-top-table td.ko-top-name {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .ko-top8.ko-top8--fit-clip .ko-top-name {
        max-width: none !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .ko-col {
        width: 200px;
    }

    .ko-slot {
        font-size: 13px;
        padding: 4px 6px;
    }

    .ko-top8 {
        max-width: 100%;
        /* На узком экране — скролл внутри, ФИО не сжимаем искусственно. */
        overflow-x: auto;
    }

    .standings-section-title {
        font-size: 1.05rem;
    }

    .groups-final-standings__groups .standings-section-title {
        font-size: 0.95rem;
    }

    .app-panel.tournament-view .page-round,
    .page-round {
        font-size: 1.05rem;
    }

    .params-row {
        grid-template-columns: 100px 1fr;
    }

    .top-bar--guest .guest-club-title {
        font-size: 16px;
        line-height: 1.25;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .top-bar--guest .top-bar__row--nav {
        margin-left: 0;
    }

    .club-switcher {
        max-width: 100%;
        font-size: 15px;
    }

    .club-switcher__name {
        max-width: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .work-btn,
    .btn-sm {
        padding: 8px 14px;
        font-size: 14px;
    }

    /*
     * «Опоздавший» / «Свойства» / «Табло» / «Экспорт» —
     * одна высота с меню сайта (nav-btn) и .work-btn на смартфоне.
     */
    .app-panel.tournament-view #view-actions .work-btn,
    .app-panel.tournament-view .tournament-actions .work-btn,
    body.tournament-embed .app-panel.tournament-view #view-actions .work-btn,
    body.tournament-embed .app-panel.tournament-view .tournament-actions .work-btn {
        padding: 8px 14px !important;
        font-size: 14px !important;
        line-height: 1.2 !important;
        margin: 5px !important;
        min-height: 0 !important;
        border-radius: 30px !important;
        box-sizing: border-box;
    }

    .data-table {
        font-size: 13px;
        width: 100%;
        max-width: 100%;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
        white-space: nowrap;
    }

    .stats-page,
    .stats-grid,
    .stats-card {
        min-width: 0;
        max-width: 100%;
    }

    .stats-card--h2h,
    .stats-card--tournaments {
        overflow: hidden;
    }

    .table-scroll,
    #players-table,
    #tournaments-table,
    #h2h-table,
    .round-block .table-scroll,
    .ct-wrap {
        display: block;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-scroll > .data-table,
    #h2h-table > .data-table {
        width: max-content;
        min-width: 100%;
    }

    /* Компактные пары на телефоне — на ширину экрана; иначе max-content даёт гориз. скролл. */
    .round-block .table-scroll > .data-table:not(.data-table--pairing-compact) {
        width: max-content;
        min-width: 0;
    }

    .round-block .table-scroll > .data-table--pairing-compact {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .stats-card--tournaments #tournaments-table {
        overflow: auto;
    }

    .app-panel.tournament-view,
    #view-panel,
    #standings,
    #pairings {
        min-width: 0;
        max-width: 100%;
    }

    .crosstable .ct-name {
        max-width: none !important;
        overflow: hidden !important;
        text-overflow: clip !important;
    }

    .browse-tree__children {
        padding-left: 12px;
    }

    .browse-tree__toggle,
    .browse-tree__club-link {
        padding: 10px 8px;
        gap: 6px;
        align-items: flex-start;
    }

    .browse-tree__label {
        font-size: 15px;
        white-space: normal;
        word-break: break-word;
    }

    .browse-tree__meta {
        font-size: 12px;
        white-space: normal;
    }

    .inline-form {
        flex-direction: column;
        align-items: stretch;
    }

    .inline-form .form-group {
        min-width: 0;
        width: 100%;
    }

    .players-sort {
        min-width: 0;
        width: 100%;
    }

    .stats-card {
        padding: 14px;
    }

    .chart-wrap {
        overflow-x: auto;
    }

    .buttons {
        gap: 8px;
    }

    .buttons .work-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.inline-form .form-group {
    margin-bottom: 0;
    min-width: 160px;
}

.inline-form input[type="text"],
.inline-form input[type="number"],
.inline-form input[type="date"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Крупные стрелки шага для «Туров» / «Досок» (нативные спиннеры слишком мелкие). */
.number-step {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
}

.number-step__input {
    width: 100%;
    padding: 8px 40px 8px 8px !important;
    -moz-appearance: textfield;
    appearance: textfield;
}

.number-step__input::-webkit-outer-spin-button,
.number-step__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-step__spinners {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    width: 34px;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ddd;
    border-radius: 0 3px 3px 0;
    overflow: hidden;
    background: #f3f6f7;
}

.number-step__spin {
    flex: 1;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.number-step__spin + .number-step__spin {
    border-top: 1px solid #ddd;
}

.number-step__spin:hover {
    background: #e4eef1;
}

.number-step__spin:active {
    background: #d2e4e9;
}

.number-step__spin::before {
    content: "";
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 11px solid #3d5c64;
}

.number-step__spin--down::before {
    border-bottom: none;
    border-top: 11px solid #3d5c64;
}

.number-step:has(input:disabled) .number-step__spin {
    opacity: 0.35;
    pointer-events: none;
    cursor: default;
}

.players-sort {
    appearance: auto;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: #fff;
    min-width: 150px;
    cursor: pointer;
}

.club-switcher__name {
    color: inherit;
    font-weight: 700;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-bar .club-switcher .club-switcher__prefix,
.top-bar .club-switcher .club-switcher__name {
    color: inherit;
}

.browse-tree {
    margin-top: 8px;
}

/* Гостевой каталог: плотнее строки дерева. */
body[data-page="browse-hub"] .browse-tree {
    margin-top: 4px;
}

body[data-page="browse-hub"] .browse-tree__children {
    margin-top: 0;
    padding-left: 14px;
}

body[data-page="browse-hub"] .browse-tree__toggle,
body[data-page="browse-hub"] .browse-tree__club-link {
    padding: 3px 8px;
    gap: 6px;
    border-radius: 4px;
}

body[data-page="browse-hub"] .browse-tree__leaf,
body[data-page="browse-hub"] .browse-tree__section-link {
    padding: 2px 8px 2px 22px;
    gap: 6px;
    border-radius: 4px;
}

body[data-page="browse-hub"] .browse-tree__hint {
    padding: 2px 8px 2px 22px;
    font-size: 12px;
}

body[data-page="browse-hub"] .browse-tree__meta {
    font-size: 12px;
}

body[data-page="browse-hub"] .browse-tree__leaf-wrap {
    margin: 0;
    padding: 0;
}

.browse-tree__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.browse-tree__children {
    display: none;
    padding-left: 18px;
    margin-top: 2px;
    border-left: 1px solid #e2e8ea;
}

.browse-tree__item.is-open > .browse-tree__children {
    display: block;
}

.browse-tree__toggle,
.browse-tree__club-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    color: #244;
    font: inherit;
    text-decoration: none;
}

.browse-tree__toggle:hover,
.browse-tree__club-link:hover {
    background: #f3f7f8;
}

.browse-tree__marker {
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #6a8f96;
    flex: 0 0 auto;
    transition: transform 0.15s ease;
}

.browse-tree__item.is-open > .browse-tree__toggle > .browse-tree__marker,
.browse-tree__item.is-open > .browse-tree__club-row > .browse-tree__toggle > .browse-tree__marker {
    transform: rotate(90deg);
}

.browse-tree__club-row {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.browse-tree__toggle--club {
    width: auto;
    flex: 0 0 auto;
    padding-right: 4px;
}

.browse-tree__club-row .browse-tree__club-link {
    flex: 1 1 auto;
    min-width: 0;
}

.browse-tree__leaf,
.browse-tree__section-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    padding: 6px 10px 6px 28px;
    border-radius: 6px;
    cursor: pointer;
    color: #244;
    font: inherit;
    text-decoration: none;
}

.browse-tree__leaf:hover {
    background: #f3f7f8;
}

.browse-tree__leaf.is-selected {
    background: #e7f2f4;
    outline: 1px solid #9bb7bc;
}

.browse-tree__leaf .browse-tree__label {
    font-weight: 500;
}

.browse-tree__hint {
    padding: 6px 10px 6px 28px;
    color: #7a8a8e;
    font-size: 13px;
}

.browse-tree__leaves {
    border-left-color: #e8eef0;
}

.browse-tree__label {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
}

.browse-tree__meta {
    flex: 0 0 auto;
    color: #7a8a8e;
    font-size: 13px;
    font-weight: 500;
}

.browse-tree__clubs {
    border-left-color: #d5e2e5;
}

.browse-tree__club-link .browse-tree__label {
    color: var(--primary, #336e78);
}

.browse-tree__club-link::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9bb7bc;
    flex: 0 0 auto;
}

.browse-tree__club-link.is-selected {
    background: #e7f2f4;
    outline: 1px solid #9bb7bc;
}

.browse-tree__club-link.is-selected::before {
    background: var(--primary, #336e78);
}

/* === Смартфон: фикс. список + один скролл панели (усиливает блок выше) === */
@media (max-width: 900px) {
    html:has(body[data-page="sportclub"]),
    html:has(body[data-page="browse-hub"]),
    html:has(body[data-page="players-hub"]),
    html:has(body[data-page="tournaments-hub"]) {
        height: 100%;
        overflow: hidden;
    }

    body[data-page="sportclub"],
    body[data-page="browse-hub"],
    body[data-page="players-hub"],
    body[data-page="tournaments-hub"] {
        display: flex !important;
        flex-direction: column !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body[data-page="sportclub"] #app-shell,
    body[data-page="browse-hub"] #app-shell,
    body[data-page="players-hub"] #app-shell,
    body[data-page="tournaments-hub"] #app-shell {
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body[data-page="sportclub"] .app-panel--browse-hub,
    body[data-page="browse-hub"] .app-panel--browse-hub,
    body[data-page="players-hub"] .app-panel--players-hub,
    body[data-page="tournaments-hub"] .app-panel--tournaments-hub {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: hidden !important;
        margin: 4px 8px 8px !important;
    }

    body[data-page="sportclub"] .browse-hub__tree,
    body[data-page="browse-hub"] .browse-hub__tree,
    body[data-page="players-hub"] .players-hub__list,
    body[data-page="tournaments-hub"] .tournaments-hub__list {
        flex: 0 0 auto !important;
        height: auto !important;
        max-height: none !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
    }

    body[data-page="sportclub"] .browse-hub__lists,
    body[data-page="browse-hub"] .browse-hub__lists,
    body[data-page="sportclub"] .browse-hub__lists--single .browse-hub__list-col:not([hidden]),
    body[data-page="browse-hub"] .browse-hub__lists--single .browse-hub__list-col:not([hidden]) {
        flex: 0 0 auto !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: visible !important;
        border: none !important;
        background: transparent !important;
    }

    body[data-page="sportclub"] .browse-hub__lists--single .browse-hub__list-col[hidden],
    body[data-page="browse-hub"] .browse-hub__lists--single .browse-hub__list-col[hidden] {
        display: none !important;
    }

    body[data-page="sportclub"] .browse-hub__mobile-select-wrap,
    body[data-page="browse-hub"] .browse-hub__mobile-select-wrap {
        display: flex !important;
    }

    body[data-page="sportclub"] .browse-hub__list,
    body[data-page="browse-hub"] .browse-hub__list,
    body[data-page="players-hub"] .players-hub__list-scroll,
    body[data-page="tournaments-hub"] .tournaments-hub__list-scroll {
        display: none !important;
    }

    body[data-page="sportclub"] .browse-hub__detail,
    body[data-page="browse-hub"] .browse-hub__detail,
    body[data-page="tournaments-hub"] .tournaments-hub__detail,
    body[data-page="players-hub"] .players-hub__stats {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    body[data-page="sportclub"] .browse-hub__detail > .players-hub__stats,
    body[data-page="browse-hub"] .browse-hub__detail > .players-hub__stats,
    body[data-page="sportclub"] .browse-hub__detail > #browse-detail-empty,
    body[data-page="browse-hub"] .browse-hub__detail > #browse-detail-empty {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 8px !important;
    }

    body[data-page="sportclub"] .browse-hub__detail > .browse-hub__tournament,
    body[data-page="browse-hub"] .browse-hub__detail > .browse-hub__tournament {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body[data-page="sportclub"] .browse-hub__detail > .players-hub__stats[hidden],
    body[data-page="browse-hub"] .browse-hub__detail > .players-hub__stats[hidden],
    body[data-page="sportclub"] .browse-hub__detail > .browse-hub__tournament[hidden],
    body[data-page="browse-hub"] .browse-hub__detail > .browse-hub__tournament[hidden],
    body[data-page="sportclub"] .browse-hub__detail > #browse-detail-empty[hidden],
    body[data-page="browse-hub"] .browse-hub__detail > #browse-detail-empty[hidden],
    body[data-page="players-hub"] .players-hub__stats[hidden] {
        display: none !important;
    }

    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--tabs,
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--tabs,
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--tabs,
    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--stack,
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--stack,
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--stack,
    body[data-page="sportclub"] .players-hub__stats #stats-body,
    body[data-page="browse-hub"] .players-hub__stats #stats-body,
    body[data-page="players-hub"] .players-hub__stats #stats-body {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }

    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]),
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]),
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card:not([hidden]),
    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--stack > .stats-card:not([hidden]),
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--stack > .stats-card:not([hidden]),
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--stack > .stats-card:not([hidden]) {
        flex: none !important;
        height: auto !important;
        overflow: visible !important;
    }

    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--rating:not([hidden]) .chart-wrap,
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--rating:not([hidden]) .chart-wrap,
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--rating:not([hidden]) .chart-wrap,
    body[data-page="sportclub"] .players-hub__stats .stats-card--rating .chart-wrap,
    body[data-page="browse-hub"] .players-hub__stats .stats-card--rating .chart-wrap,
    body[data-page="players-hub"] .players-hub__stats .stats-card--rating .chart-wrap {
        flex: none !important;
        height: 240px !important;
        min-height: 240px !important;
        max-height: 240px !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) .chart-wrap,
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) .chart-wrap,
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--h2h:not([hidden]) .chart-wrap,
    body[data-page="sportclub"] .players-hub__stats .stats-card--h2h .chart-wrap,
    body[data-page="browse-hub"] .players-hub__stats .stats-card--h2h .chart-wrap,
    body[data-page="players-hub"] .players-hub__stats .stats-card--h2h .chart-wrap {
        flex: none !important;
        height: 168px !important;
        min-height: 168px !important;
        max-height: 168px !important;
        width: 100% !important;
        overflow: hidden !important;
    }

    body[data-page="sportclub"] .players-hub__stats .h2h-filters,
    body[data-page="browse-hub"] .players-hub__stats .h2h-filters,
    body[data-page="players-hub"] .players-hub__stats .h2h-filters {
        margin-bottom: 6px !important;
        gap: 6px 10px !important;
    }

    body[data-page="sportclub"] .players-hub__stats .h2h-summary,
    body[data-page="browse-hub"] .players-hub__stats .h2h-summary,
    body[data-page="players-hub"] .players-hub__stats .h2h-summary {
        font-size: 13px !important;
        flex: 1 1 100% !important;
    }

    /* Таблицы в карточке — по высоте содержимого; вертикальный скролл у панели. */
    body[data-page="sportclub"] .players-hub__stats #stats-body .stats-card--tournaments,
    body[data-page="browse-hub"] .players-hub__stats #stats-body .stats-card--tournaments,
    body[data-page="players-hub"] .players-hub__stats #stats-body .stats-card--tournaments,
    body[data-page="sportclub"] .players-hub__stats #stats-body .stats-card--h2h,
    body[data-page="browse-hub"] .players-hub__stats #stats-body .stats-card--h2h,
    body[data-page="players-hub"] .players-hub__stats #stats-body .stats-card--h2h {
        flex: none !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    body[data-page="sportclub"] .players-hub__stats #stats-body .stats-card--tournaments .table-scroll,
    body[data-page="browse-hub"] .players-hub__stats #stats-body .stats-card--tournaments .table-scroll,
    body[data-page="players-hub"] .players-hub__stats #stats-body .stats-card--tournaments .table-scroll,
    body[data-page="sportclub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--tournaments:not([hidden]) .table-scroll,
    body[data-page="browse-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--tournaments:not([hidden]) .table-scroll,
    body[data-page="players-hub"] .players-hub__stats #stats-body.stats-grid--tabs > .stats-card--tournaments:not([hidden]) .table-scroll,
    body[data-page="sportclub"] .players-hub__stats #stats-body .table-scroll,
    body[data-page="browse-hub"] .players-hub__stats #stats-body .table-scroll,
    body[data-page="players-hub"] .players-hub__stats #stats-body .table-scroll {
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
    }

    body[data-page="sportclub"] .players-hub__stats .app-toolbar {
        flex-wrap: wrap !important;
        margin-bottom: 6px !important;
        flex-shrink: 0 !important;
    }

    body[data-page="sportclub"] .players-hub__stats .app-toolbar #stats-view-toggle .standings-view-toggle__btn,
    body[data-page="browse-hub"] .players-hub__stats .app-toolbar #stats-view-toggle .standings-view-toggle__btn {
        white-space: normal !important;
        font-size: 12px !important;
        padding: 6px 8px !important;
    }
}

/* Смартфон: выпадающий список сразу под строкой select (без «Назад»/«Далее»). */
.mobile-select-sheet {
    position: fixed;
    inset: 0;
    z-index: 12000;
    pointer-events: none;
}

.mobile-select-sheet__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: default;
    pointer-events: auto;
}

.mobile-select-sheet__panel {
    position: absolute;
    z-index: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #c8c8cd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    pointer-events: auto;
    overflow: hidden;
    box-sizing: border-box;
}

.mobile-select-sheet__list {
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
}

.mobile-select-sheet__option {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 11px 14px;
    font: inherit;
    font-size: 1rem;
    color: #1a1a1a;
    cursor: pointer;
    white-space: nowrap;
}

.mobile-select-sheet__option + .mobile-select-sheet__option {
    border-top: 1px solid #f0f0f3;
}

.mobile-select-sheet__option.is-selected {
    background: #e8f3f5;
    font-weight: 700;
    color: #1e4a52;
}

.mobile-select-sheet__option.is-disabled {
    opacity: 0.4;
    cursor: default;
}

.mobile-select-sheet__option:active:not(.is-disabled) {
    background: #dfeef1;
}

body.mobile-select-sheet-open {
    overflow: hidden;
}
