/* ==========================================================================
 * Специфичные стили для страниц статистики
 * ========================================================================== */

/* --- StatGrid: сетка KPI-плиток --- */
.stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: var(--space-md);
}
.daily-metrics-grid {
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.opponent-map-kpis {
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.stat-grid-item {
	background: var(--color-bg);
	border-radius: var(--radius-md);
	padding: var(--space-lg);
	text-align: center;
}

/* --- PlayerBadge в таблице --- */
.player-badge {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
}
.player-badge-info {
	min-width: 0;
}
.player-badge-name {
	font-weight: 500;
	color: var(--color-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.player-badge-meta {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}

/* --- Карточка прогноза (predict) --- */
.predict-cards {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--space-xl);
	flex-wrap: wrap;
	padding: var(--space-xl);
}
.predict-player {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-width: 140px;
	max-width: 200px;
	flex: 1 1 140px;
}
.predict-player-name {
	font-size: 14px;
	font-weight: 600;
	margin-top: 8px;
	word-break: break-word;
}
.predict-player-rating {
	font-size: 12px;
	color: var(--color-text-muted);
}
.predict-player-meta {
	font-size: 11px;
	color: var(--color-text-muted);
}
.predict-role-tag {
	display: inline-block;
	padding: 2px 12px;
	border-radius: var(--radius-full, 20px);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.03em;
	margin-top: 4px;
}
.predict-role-you {
	background: var(--color-primary);
	color: #fff;
}
.predict-role-opp {
	background: var(--color-danger);
	color: #fff;
}
.predict-vs {
	font-size: 32px;
	font-weight: 700;
	color: var(--color-text-muted);
	padding: 0 var(--space-xl);
}
.predict-vs-swap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	vertical-align: middle;
	margin-left: 6px;
	font-size: 20px;
	font-weight: 700;
	color: var(--color-text-muted);
	cursor: pointer;
	transition: color 0.15s, transform 0.15s;
	user-select: none;
}
.predict-vs-swap:hover {
	color: var(--color-primary);
	transform: scale(1.2);
}
.predict-probability {
	text-align: center;
	padding: var(--space-2xl);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	margin-top: var(--space-md);
}
.predict-bar {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--space-xl);
	flex-wrap: wrap;
}
.predict-bar-value {
	text-align: center;
	flex: 0 1 auto;
}
.predict-bar-num {
	font-size: 48px;
	font-weight: 700;
	line-height: 1.1;
}
.predict-bar-num-win {
	color: var(--color-success);
}
.predict-bar-num-lose {
	color: var(--color-danger);
}
.predict-bar-label {
	font-size: 13px;
	margin-top: 4px;
	word-break: break-word;
	max-width: 180px;
}
.predict-bar-vs {
	font-size: 24px;
	font-weight: 300;
	color: var(--color-text-muted);
	padding: 0 var(--space-md);
	align-self: center;
}
.predict-base-info {
	font-size: 13px;
	margin-top: var(--space-md);
}

/* --- Вкладки (compare, heatmap, player card) --- */
.tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 0;
	border-bottom: 1px solid var(--color-border);
	margin-bottom: var(--space-lg);
	background: transparent;
	padding: 0;
}
.tab {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	padding: var(--space-md) var(--space-lg);
	font-family: inherit;
	font-size: var(--font-size-sm);
	font-weight: 500;
	line-height: 1.3;
	color: var(--color-text-muted);
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	border-radius: var(--radius-sm) var(--radius-sm) 0 0;
	transition: color 0.15s, background 0.15s, border-color 0.15s;
	white-space: nowrap;
}
.tab:hover {
	color: var(--color-primary);
	background: transparent;
}
.tab.tab-active {
	color: var(--color-primary);
	border-bottom-color: var(--color-primary);
	background: var(--color-sidebar-active);
}
.tab-content {
	display: none;
}
.tab-content.tab-content-active {
	display: block;
}

/* --- .ft-table: базовые стили таблиц (дублирование из components.css для надёжности) --- */
.ft-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--font-size-sm);
}
.ft-table th {
	text-align: left;
	padding: var(--space-sm) var(--space-md);
	font-weight: 600;
	color: var(--color-text-muted);
	border: 1px solid var(--color-border);
	border-bottom-width: 2px;
	white-space: nowrap;
	font-size: var(--font-size-xs);
	background: var(--color-bg);
}
.ft-table td {
	padding: var(--space-sm) var(--space-md);
	border: 1px solid var(--color-border-light);
	vertical-align: middle;
}
.ft-table tr:hover td {
	background: var(--color-bg);
}
/* --- Модификаторы .ft-table для тепловой карты --- */
.ft-table .heat-col-active {
	background: var(--color-primary-light);
	color: var(--color-primary);
}
.ft-table .heat-date-active {
	color: var(--color-primary);
	/* имитация жирности без изменения ширины */
	text-shadow: 0 0 0.5px currentColor;
}

/* обводка ячейки при наведении — без изменения размеров */
.ft-table .heat-cell:hover {
	outline: 2px solid #9ca3b0;
	outline-offset: -2px;
}

/* --- Тепловая карта --- */
.heatmap-page {
	min-width: 0;
}
.heatmap-grid {
	display: inline-grid;
	gap: 2px;
}
.heatmap-cell {
	width: 32px;
	height: 32px;
	border-radius: var(--radius-sm);
	position: relative;
}
.heatmap-legend {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	margin-top: var(--space-md);
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}

/* --- Страница сравнения периодов --- */
.compare-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-xl);
}

/* --- Бредкрамбы --- */
.ft-breadcrumbs {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
	font-size: var(--font-size-sm);
	margin-bottom: var(--space-lg);
}
.ft-breadcrumbs a {
	color: var(--color-primary);
	text-decoration: none;
}
.ft-breadcrumbs .breadcrumb-sep {
	color: var(--color-text-muted);
}
.ft-breadcrumbs .breadcrumb-current {
	color: var(--color-text);
	font-weight: 500;
}

/* --- Плитки метрик (form, career, monthly, analytics) --- */
.form-metric-stat {
	cursor: pointer;
	transition: box-shadow 0.2s ease, background-color 0.15s ease, border-color 0.2s ease;
}
.form-metric-stat-static {
	cursor: default;
}

/* Блочные плитки — единый класс .metric-tile */
.metric-tile,
.form-top-item.form-metric-stat,
.stat-grid .stat-item.form-metric-stat,
.stat-grid > .form-metric-stat:not(.daily-metric-card),
.trend-item.form-metric-stat,
.opponent-map-kpis > .form-metric-stat,
.flex.gap-md > .form-metric-stat {
	display: block;
	text-align: center;
	padding: var(--space-md);
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-md);
	min-width: 0;
}

.metric-tile:hover,
.form-top-item.form-metric-stat:hover,
.stat-grid .stat-item.form-metric-stat:hover,
.stat-grid > .form-metric-stat:not(.daily-metric-card):hover,
.trend-item.form-metric-stat:hover,
.opponent-map-kpis > .form-metric-stat:hover,
.flex.gap-md > .form-metric-stat:hover {
	box-shadow: 0 6px 20px rgba(82, 63, 105, 0.14);
	border-color: rgba(114, 109, 200, 0.35);
}

.metric-tile--up {
	background: rgba(46, 201, 183, 0.12);
	border-color: rgba(46, 201, 183, 0.35);
}
.metric-tile--down {
	background: rgba(251, 62, 124, 0.08);
	border-color: rgba(251, 62, 124, 0.25);
}
.metric-tile--up .stat-value,
.opponent-map-kpis > .metric-tile--up > div:first-child {
	color: var(--color-success-dark);
}
.metric-tile--down .stat-value,
.opponent-map-kpis > .metric-tile--down > div:first-child {
	color: var(--color-danger);
}

/* Переопределения для opponent-map-kpis */
.opponent-map-kpis > .form-metric-stat .stat-value,
.opponent-map-kpis > .form-metric-stat > div:first-child {
	font-size: 24px;
	font-weight: 700;
	color: var(--color-text);
	line-height: 1.2;
}
.opponent-map-kpis > .form-metric-stat .stat-label {
	font-size: var(--font-size-xs);
}

/* Сравнение периодов — кликабельные строки статистики (Период 1 / П2 / Дельта) */
.compare-period-stats-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}
.compare-period-stats .compare-stat-row {
	display: block;
	margin-top: 4px;
	padding: 6px 10px;
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-sm);
	line-height: 1.4;
}
.compare-period-stats .compare-stat-row:hover {
	background: var(--color-surface);
	border-color: rgba(114, 109, 200, 0.35);
	box-shadow: 0 4px 12px rgba(82, 63, 105, 0.12);
}
@media (max-width: 759px) {
	.compare-period-stats-grid {
		grid-template-columns: 1fr;
	}
}

/* Маркеры сравнения периодов (флаги под таблицей) */
.compare-flags .compare-flag-badge {
	cursor: pointer;
	transition: box-shadow 0.2s ease, opacity 0.15s ease;
}
.compare-flags .compare-flag-badge:hover {
	box-shadow: 0 2px 8px rgba(82, 63, 105, 0.15);
	opacity: 0.92;
}

/* Верхний блок «текущие показатели» (analytics/form) */
.form-top-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: var(--space-md);
}
.form-top-value,
.stat-value {
	font-size: var(--font-size-xl);
	font-weight: 700;
	color: var(--color-primary);
	line-height: 1.2;
}
.form-top-label,
.stat-label--top {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	margin-bottom: var(--space-xs);
	line-height: 1.3;
}
.form-top-sub,
.stat-label {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	margin-top: var(--space-xs);
	line-height: 1.3;
}
.form-index-large {
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.1;
}
.form-confidence-inline {
	font-size: var(--font-size-xs);
	margin-top: 2px;
}

/* Группы показателей на странице формы */
.form-stat-group {
	margin-bottom: var(--space-xl);
}
.form-stat-group:last-child {
	margin-bottom: 0;
}
.form-stat-group-title {
	margin: 0 0 var(--space-md);
	font-size: var(--font-size-h4);
	font-weight: 600;
	color: var(--color-text);
}

/* Тренды */
.trend-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: var(--space-md);
}
.trend-label {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	margin-bottom: var(--space-xs);
}
.trend-value {
	font-size: var(--font-size-lg);
	font-weight: 700;
}
.trend-legend {
	margin-top: var(--space-sm);
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	text-align: center;
}

/* Ячейки таблиц с метриками */
td.form-metric-stat,
th.form-metric-stat {
	cursor: pointer;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
td.form-metric-stat:hover,
th.form-metric-stat:hover {
	background: var(--color-primary-light);
	box-shadow: inset 0 0 0 1px rgba(114, 109, 200, 0.2);
}

/* Карточки метрик «по дням» */
.daily-metric-card {
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-md);
	padding: var(--space-md);
	cursor: default;
}
.daily-metric-card > .form-metric-stat[data-metric-key^="daily_metric_"] {
	display: block;
	text-align: center;
	font-weight: 600;
	font-size: var(--font-size-sm);
	margin-bottom: var(--space-sm);
	padding: 0;
	background: transparent;
	border: none;
	box-shadow: none;
}
.daily-metric-card > .form-metric-stat[data-metric-key^="daily_metric_"]:hover {
	box-shadow: none;
	border-color: transparent;
}
.daily-metric-card .form-metric-stat[data-metric-key^="daily_stat_"] {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-sm);
	padding: var(--space-xs) 0;
	font-size: var(--font-size-xs);
	background: transparent;
	border: none;
	border-radius: 0;
	border-bottom: 1px solid var(--color-border-light);
	text-align: left;
}
.daily-metric-card .form-metric-stat[data-metric-key^="daily_stat_"]:last-child {
	border-bottom: none;
}
.daily-metric-card .form-metric-stat[data-metric-key^="daily_stat_"]:hover {
	box-shadow: none;
	background: var(--color-primary-light);
}

/* Сравнение периодов */
.compare-periods-info {
	font-size: var(--font-size-sm);
	margin-bottom: var(--space-md);
	padding: var(--space-md);
	background: var(--color-bg-secondary);
	border-radius: var(--radius-md);
	border: 1px solid var(--color-border-light);
}
.compare-period-line + .compare-period-line {
	margin-top: var(--space-xs);
}
.compare-chart-selectors {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-sm);
	align-items: center;
	margin-bottom: var(--space-md);
}

/* H2H: фильтр двух игроков */
.h2h-filter-grid {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--space-md);
}
.h2h-filter-grid .form-group {
	margin-bottom: 0;
}
.h2h-player-group {
	flex: 1 1 200px;
	min-width: 0;
	position: relative;
}
@media (max-width: 759px) {
	.h2h-player-group {
		flex: 1 1 auto;
	}
}
.h2h-player-input-row {
	display: flex;
	align-items: stretch;
	gap: var(--space-xs);
}
.h2h-player-input-row .form-input {
	flex: 1;
	min-width: 0;
}
.h2h-player-input-row .form-input:disabled {
	background: var(--color-bg-secondary);
}
.h2h-player-clear {
	flex-shrink: 0;
}
.h2h-autocomplete-dropdown {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 10;
	margin-top: 2px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	max-height: 140px;
	overflow-y: auto;
	box-shadow: var(--shadow-card);
}
.h2h-filter-actions {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: var(--space-xs);
	min-width: 0;
}
.h2h-filter-actions .form-label-spacer {
	visibility: hidden;
	margin: 0;
	line-height: 1.2;
	min-height: 1em;
	user-select: none;
}
.h2h-filter-btns {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-sm);
}
.h2h-filter-btns .btn {
	white-space: nowrap;
}

/* H2H лог — мобильная вёрстка */
.h2h-log-mobile {
	display: none;
}
.h2h-log-mobile-block {
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-md);
	margin-bottom: var(--space-md);
	overflow: hidden;
}
.h2h-log-mobile-period {
	padding: var(--space-sm) var(--space-md);
	background: var(--color-bg-secondary);
	font-weight: 600;
	text-align: center;
}
.h2h-log-mobile-stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}
.h2h-log-mobile-p1data,
.h2h-log-mobile-p2data {
	padding: var(--space-md);
}
.h2h-log-mobile-p1data {
	border-right: 1px solid var(--color-border-light);
	background: var(--color-primary-light);
}
.h2h-log-mobile-label {
	font-size: var(--font-size-xs);
	font-weight: 600;
	margin-bottom: var(--space-sm);
	color: var(--color-text-muted);
}

/* --- Мобильная адаптация --- */
@media (max-width: 759px) {
	.stat-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.compare-grid {
		grid-template-columns: 1fr;
	}
	.predict-cards {
		flex-direction: column;
		gap: var(--space-md);
		padding: var(--space-md);
	}
	.predict-player {
		min-width: 0;
		max-width: 100%;
		flex: 1 1 auto;
		width: 100%;
	}
	.predict-player-name {
		font-size: 13px;
	}
	.predict-vs {
		padding: var(--space-sm) 0;
		font-size: 24px;
	}
	.predict-vs-swap {
		font-size: 16px;
	}
	.predict-probability {
		padding: var(--space-lg) var(--space-md);
	}
	.predict-bar {
		gap: var(--space-md);
	}
	.predict-bar-num {
		font-size: 32px;
	}
	.predict-bar-label {
		font-size: 11px;
		max-width: 120px;
	}
	.predict-bar-vs {
		font-size: 18px;
		padding: 0 var(--space-sm);
	}
	.ft-table {
		font-size: var(--font-size-xs);
	}
	.ft-table th,
	.ft-table td {
		padding: var(--space-xs) var(--space-sm);
	}
	.form-top-grid {
		grid-template-columns: repeat(2, 1fr);
	}
	.h2h-filter-grid {
		flex-direction: column;
		align-items: stretch;
	}
	.h2h-filter-actions .form-label-spacer {
		display: none;
	}
	.h2h-filter-btns {
		width: 100%;
	}
	.h2h-filter-btns .btn {
		flex: 1 1 auto;
		min-width: 120px;
	}
	.h2h-log-desktop {
		display: none;
	}
	.h2h-log-mobile {
		display: block;
	}
}

/* --- Очень маленькие экраны (≤400px) --- */
@media (max-width: 400px) {
	.predict-bar-num {
		font-size: 26px;
	}
	.predict-bar-label {
		font-size: 10px;
		max-width: 100px;
	}
	.predict-bar-vs {
		font-size: 14px;
	}
	.predict-player-name {
		font-size: 12px;
	}
	.predict-player-rating,
	.predict-player-meta {
		font-size: 10px;
	}
	.predict-vs-swap {
		font-size: 14px;
	}
}

/* --- Диалог калькулятора рейтингов --- */
.rating-calc-dialog {
	background: var(--color-bg);
	border-radius: 12px;
	padding: 24px;
	width: 100%;
	max-width: 420px;
	box-shadow: 0 8px 32px rgba(0,0,0,0.25);
	position: relative;
}
.rating-calc-header {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
}
.rating-calc-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 600;
}
.rating-calc-fields {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.rating-calc-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.rating-calc-label {
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text-muted);
}
.rating-calc-input {
	font-size: 24px;
	font-weight: 700;
	padding: 12px 16px;
	text-align: center;
	height: auto;
	border: 2px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-bg-secondary);
	transition: border-color 0.15s;
}
.rating-calc-input:focus {
	border-color: var(--color-primary);
	background: var(--color-bg);
	outline: none;
	box-shadow: 0 0 0 3px rgba(114,109,200,0.12);
}
.rating-calc-input::-webkit-outer-spin-button,
.rating-calc-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
}
.rating-calc-input[type=number] {
	-moz-appearance: textfield;
	appearance: textfield;
}
.rating-calc-reference-text {
	font-size: 14px;
	font-weight: 600;
	color: var(--color-text);
	line-height: 1.4;
	padding: 10px 14px;
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-md);
}
.rating-calc-buttons {
	display: flex;
	gap: var(--space-md);
	margin-top: 20px;
}
.rating-calc-buttons .btn {
	flex: 1;
}
@media (max-width: 480px) {
	.rating-calc-dialog {
		padding: 16px;
		max-width: 100%;
	}
	.rating-calc-input {
		font-size: 20px;
		padding: 10px 14px;
	}
	.rating-calc-reference-text {
		font-size: 13px;
		padding: 8px 10px;
	}
}

/* --- Сравнение периодов: hover на барах и точках диаграммы --- */
.cb-bar {
	cursor: pointer;
	pointer-events: all;
	transition: opacity 0.15s ease;
}
.cb-bar:hover {
	opacity: 0.75 !important;
	stroke: #333 !important;
	stroke-width: 1 !important;
}
.cb-dot {
	cursor: pointer;
	pointer-events: all;
	transition: r 0.15s ease;
}
.cb-dot:hover {
	r: 6 !important;
	stroke: #fff !important;
	stroke-width: 2 !important;
}

/* --- Реестр матчей --- */

/* Сетка фильтров */
.mr-filter-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.mr-filter-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: flex-end;
}

/* Ряд с двумя полями (Игрок + Соперник) */
.mr-filter-row-2 .mr-filter-field {
	flex: 1 1 calc(50% - 4px);
	min-width: 200px;
}

/* Ряд с четырьмя полями (город + 3 селекта) */
.mr-filter-row-4 .mr-filter-field-city {
	flex: 1 1 calc(55% - 8px);
	min-width: 200px;
}
.mr-filter-row-4 .mr-filter-field:not(.mr-filter-field-city) {
	flex: 1 1 calc(15% - 8px);
	min-width: 120px;
}

/* Ряд с действиями (период + даты + кнопки) */
.mr-filter-row-actions {
	gap: 8px;
}
.mr-filter-field-15 {
	flex: 0 0 calc(15% - 8px);
	min-width: 110px;
}
.mr-filter-actions {
	display: flex;
	align-items: flex-end;
	margin-left: auto;
}
.mr-filter-btns {
	display: flex;
	gap: 8px;
}

/* Поле фильтра */
.mr-filter-field {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.mr-filter-field .form-label {
	font-size: 12px;
	color: var(--color-text-muted);
	margin-bottom: 0;
}

.mr-filter-field .form-input {
	width: 100%;
}

/* Автокомплит внутри фильтра */
.mr-autocomplete-wrap {
	position: relative;
}
.mr-input-row {
	display: flex;
	gap: 4px;
	align-items: stretch;
}
.mr-input-row .form-input {
	flex: 1;
}
.mr-clear-btn {
	flex-shrink: 0;
	padding: 4px 8px !important;
	font-size: 14px;
	line-height: 1;
}
.mr-autocomplete-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 10;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	max-height: 200px;
	overflow-y: auto;
	min-width: 100%;
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Строка заголовка турнира (группировка по tour_id) */
.match-tour-header td {
	border-bottom: 2px solid var(--color-border) !important;
}

/* Строка матча */
tr.match-row:last-child {
	border-bottom: 1px solid var(--color-border-light);
}

/* Имя игрока в таблице матчей */
.match-player-name {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
	cursor: pointer;
}

.match-player-name:hover {
	color: var(--color-primary) !important;
}

/* Имя победителя */
.match-player-winner {
	font-weight: 700;
}

/* Dropdown действий при клике на ФИО игрока */
.match-player-dropdown {
	position: fixed;
	min-width: 200px;
	background: var(--color-bg-elevated, #fff);
	border: 1px solid var(--color-border, #e0e0e0);
	border-radius: var(--radius-md, 8px);
	box-shadow: var(--shadow-card, 0 4px 16px rgb(0 0 0 / 0.12));
	z-index: 9999;
	overflow: hidden;
}

.match-player-dropdown__item {
	padding: 10px 16px;
	font-size: var(--font-size-md, 14px);
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s ease, color 0.15s ease;
	border-bottom: 1px solid var(--color-border-light, #f0f0f0);
}

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

.match-player-dropdown__item:hover {
	background: var(--color-bg-secondary, #f5f5f5);
	color: var(--color-primary);
}

/* Мобильный диалог действий */
.match-player-mobile-overlay {
	position: fixed;
	inset: 0;
	z-index: 9998;
	background: rgb(0 0 0 / 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
}

.match-player-mobile-dialog {
	background: var(--color-bg-elevated, #fff);
	border-radius: var(--radius-lg, 12px);
	box-shadow: var(--shadow-card, 0 4px 16px rgb(0 0 0 / 0.12));
	width: 90%;
	max-width: 360px;
	max-height: 80vh;
	overflow-y: auto;
}

.match-player-mobile-dialog__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid var(--color-border-light, #f0f0f0);
	font-weight: 600;
	font-size: var(--font-size-lg, 16px);
	color: var(--color-text-primary, #333);
}

.match-player-mobile-dialog__close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--color-text-muted, #999);
	padding: 0;
	line-height: 1;
}

.match-player-mobile-dialog__close:hover {
	color: var(--color-text-primary, #333);
}

.match-player-mobile-dialog__item {
	padding: 14px 16px;
	font-size: var(--font-size-md, 14px);
	cursor: pointer;
	border-bottom: 1px solid var(--color-border-light, #f0f0f0);
	transition: background 0.15s ease, color 0.15s ease;
}

.match-player-mobile-dialog__item:last-child {
	border-bottom: none;
}

.match-player-mobile-dialog__item:hover {
	background: var(--color-bg-secondary, #f5f5f5);
	color: var(--color-primary);
}

/* Мобильная версия фильтров */
@media (max-width: 759px) {
	.mr-filter-row-2 .mr-filter-field {
		flex: 1 1 100%;
		min-width: 0;
	}
	.mr-filter-row-4 .mr-filter-field-city {
		flex: 1 1 100%;
		min-width: 0;
	}
	.mr-filter-row-4 .mr-filter-field:not(.mr-filter-field-city) {
		flex: 1 1 calc(50% - 4px);
		min-width: 0;
	}
	.mr-filter-field-15 {
		flex: 1 1 calc(50% - 8px);
		min-width: 0;
	}
	.mr-filter-actions {
		margin-left: 0;
		flex: 1 1 100%;
	}
	.mr-filter-btns {
		width: 100%;
	}
	.mr-filter-btns .btn {
		flex: 1 1 calc(50% - 4px);
	}
}
/* --- Классификация РТТ --- */
.rating-filters {
	gap: 12px;
}
.rating-filters .form-group {
	margin-bottom: 0;
}

/* =============================================
   Единая панель фильтров классификации (.rating-filter-panel)
   Базовые стили общие для /rating/roster, /rating/details, /rating/player
   ============================================ */
.rating-filter-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.rating-filter-panel__row {
	display: grid;
	gap: 12px;
	align-items: end;
}
.rating-filter-panel__row--main {
	grid-template-columns: 1fr 1fr;
}
.rating-filter-panel__row--bottom {
	grid-template-columns: 1fr;
}
.rating-filter-panel__field,
.rating-filter-panel__actions {
	margin-bottom: 0;
	min-width: 0;
}
.rating-filter-panel__field .form-select,
.rating-filter-panel__field .form-input {
	width: 100%;
}
.rating-filter-panel__city-wrap {
	position: relative;
}
.rating-filter-panel__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	align-items: end;
}
.rating-filter-panel__btn {
	width: 100%;
	text-align: center;
	justify-content: center;
}
/* ===================================================
   Туры: плоская grid-сетка (мобильные + десктоп)
   =================================================== */
.rating-filter-panel--tours {
	display: grid;
	gap: 12px;
	align-items: end;
	grid-template-columns: repeat(6, 1fr);
}
/* Мобильные: явная row-раскладка */
.rating-filter-panel--tours > :nth-child(1)  { grid-row: 1; grid-column: span 6; }  /* row 1: Игрок */
.rating-filter-panel--tours > :nth-child(2)  { grid-row: 2; grid-column: span 3; }  /* row 2: Участие */
.rating-filter-panel--tours > :nth-child(4)  { grid-row: 2; grid-column: span 3; }  /* row 2: Статус */
.rating-filter-panel--tours > :nth-child(6)  { grid-row: 3; grid-column: span 2; }  /* row 3: Разряд */
.rating-filter-panel--tours > :nth-child(7)  { grid-row: 3; grid-column: span 2; }  /* row 3: Пол */
.rating-filter-panel--tours > :nth-child(8)  { grid-row: 3; grid-column: span 2; }  /* row 3: Возраст */
.rating-filter-panel--tours > :nth-child(9)  { grid-row: 4; grid-column: span 2; }  /* row 4: Категория */
.rating-filter-panel--tours > :nth-child(5)  { grid-row: 4; grid-column: span 2; }  /* row 4: Система */
.rating-filter-panel--tours > :nth-child(10) { grid-row: 4; grid-column: span 2; }  /* row 4: Период */
.rating-filter-panel--tours > :nth-child(11) { grid-row: 5; grid-column: span 3; }  /* row 5: От даты */
.rating-filter-panel--tours > :nth-child(12) { grid-row: 5; grid-column: span 3; }  /* row 5: До даты */
.rating-filter-panel--tours > :nth-child(3)  { grid-row: 6; grid-column: span 6; }  /* row 6: Город */
.rating-filter-panel--tours > :nth-child(13) { grid-row: 7; grid-column: span 6; }  /* row 7: Название */
.rating-filter-panel--tours > :nth-child(14) { grid-row: 8; grid-column: span 6; }  /* row 8: кнопки */
/* Переопределения grid-колонок для десктопа */
@media (min-width: 760px) {
	.rating-filter-panel--roster .rating-filter-panel__row--main {
		grid-template-columns: 15% 15% 15% 15%;
	}
	.rating-filter-panel--roster .rating-filter-panel__row--bottom {
		grid-template-columns: 60% 1fr;
		align-items: end;
	}
	.rating-filter-panel--details .rating-filter-panel__row--main {
		grid-template-columns: 40% 15% 15% 1fr;
	}
	.rating-filter-panel--player .rating-filter-panel__row--main {
		grid-template-columns: 40% 15% 1fr;
	}
	.rating-filter-panel__actions {
		grid-template-columns: auto auto;
		justify-content: start;
	}
	.rating-filter-panel__btn {
		width: auto;
	}
	/* player — одна кнопка */
	.rating-filter-panel--player .rating-filter-panel__actions {
		grid-template-columns: auto;
	}
	/* tours — десктоп (12-колоночная сетка, 3 строки) */
	.rating-filter-panel--tours {
		grid-template-columns: repeat(12, 1fr);
	}
	.rating-filter-panel--tours > :nth-child(1)  { grid-row: 1; grid-column: span 6; }  /* 1: Игрок */
	.rating-filter-panel--tours > :nth-child(2)  { grid-row: 1; grid-column: span 2; }  /* 1: Участие */
	.rating-filter-panel--tours > :nth-child(3)  { grid-row: 1; grid-column: span 4; }  /* 1: Город */
	.rating-filter-panel--tours > :nth-child(4)  { grid-row: 2; grid-column: span 2; }  /* 2: Статус */
	.rating-filter-panel--tours > :nth-child(5)  { grid-row: 2; grid-column: span 2; }  /* 2: Система */
	.rating-filter-panel--tours > :nth-child(6)  { grid-row: 2; grid-column: span 2; }  /* 2: Разряд */
	.rating-filter-panel--tours > :nth-child(7)  { grid-row: 2; grid-column: span 2; }  /* 2: Пол */
	.rating-filter-panel--tours > :nth-child(8)  { grid-row: 2; grid-column: span 2; }  /* 2: Возраст */
	.rating-filter-panel--tours > :nth-child(9)  { grid-row: 2; grid-column: span 2; }  /* 2: Категория */
	.rating-filter-panel--tours > :nth-child(10) { grid-row: 3; grid-column: span 2; }  /* 3: Период */
	.rating-filter-panel--tours > :nth-child(11) { grid-row: 3; grid-column: span 2; }  /* 3: От даты */
	.rating-filter-panel--tours > :nth-child(12) { grid-row: 3; grid-column: span 2; }  /* 3: До даты */
	.rating-filter-panel--tours > :nth-child(13) { grid-row: 3; grid-column: span 4; }  /* 3: Название */
	.rating-filter-panel--tours > :nth-child(14) { grid-row: 3; grid-column: span 2; }  /* 3: кнопки */
	.rating-filter-panel--tours .rating-filter-panel__actions {
		grid-template-columns: 1fr 1fr;
	}
	.rating-filter-panel--tours .rating-filter-panel__btn {
		width: 100%;
	}
}
/* ===================================================
   Профиль — реестр турниров: плоская grid-сетка
   =================================================== */
.rating-filter-panel--profile-app {
	display: grid;
	gap: 12px;
	align-items: end;
	grid-template-columns: repeat(6, 1fr);
}
/* Мобильные: явная row-раскладка */
.rating-filter-panel--profile-app > :nth-child(1)  { grid-row: 1; grid-column: span 6; }  /* row 1: Участие */
.rating-filter-panel--profile-app > :nth-child(2)  { grid-row: 2; grid-column: span 3; }  /* row 2: Категория */
.rating-filter-panel--profile-app > :nth-child(3)  { grid-row: 2; grid-column: span 3; }  /* row 2: Возрастная группа */
.rating-filter-panel--profile-app > :nth-child(4)  { grid-row: 3; grid-column: span 3; }  /* row 3: Завершённость */
.rating-filter-panel--profile-app > :nth-child(5)  { grid-row: 3; grid-column: span 3; }  /* row 3: Период */
.rating-filter-panel--profile-app > :nth-child(6)  { grid-row: 4; grid-column: span 3; }  /* row 4: От даты */
.rating-filter-panel--profile-app > :nth-child(7)  { grid-row: 4; grid-column: span 3; }  /* row 4: До даты */
.rating-filter-panel--profile-app > :nth-child(8)  { grid-row: 5; grid-column: span 6; }  /* row 5: кнопки */
.rating-filter-panel--profile-app .rating-filter-panel__actions {
	grid-template-columns: 1fr 1fr;
}
.rating-filter-panel--profile-app .rating-filter-panel__btn {
	width: 100%;
}
@media (min-width: 760px) {
	.rating-filter-panel--profile-app {
		grid-template-columns: repeat(12, 1fr);
	}
	.rating-filter-panel--profile-app > :nth-child(1)  { grid-row: 1; grid-column: span 3; }  /* row 1: Участие */
	.rating-filter-panel--profile-app > :nth-child(2)  { grid-row: 1; grid-column: span 3; }  /* row 1: Категория */
	.rating-filter-panel--profile-app > :nth-child(3)  { grid-row: 1; grid-column: span 3; }  /* row 1: Возрастная группа */
	.rating-filter-panel--profile-app > :nth-child(4)  { grid-row: 1; grid-column: span 3; }  /* row 1: Завершённость */
	.rating-filter-panel--profile-app > :nth-child(5)  { grid-row: 2; grid-column: span 3; }  /* row 2: Период */
	.rating-filter-panel--profile-app > :nth-child(6)  { grid-row: 2; grid-column: span 3; }  /* row 2: От даты */
	.rating-filter-panel--profile-app > :nth-child(7)  { grid-row: 2; grid-column: span 3; }  /* row 2: До даты */
	.rating-filter-panel--profile-app > :nth-child(8)  { grid-row: 2; grid-column: span 3; }  /* row 2: кнопки */
	.rating-filter-panel--profile-app .rating-filter-panel__actions {
		grid-template-columns: 1fr 1fr;
	}
	.rating-filter-panel--profile-app .rating-filter-panel__btn {
		width: 100%;
	}
}
.rating-chart-container {
	width: 100%;
	height: 400px;
}

/* --- Мобильные карточки для таблиц (<760px) --- */
@media (max-width: 759px) {
	.ft-table--mobile-cards,
	.ft-table--mobile-cards thead,
	.ft-table--mobile-cards tbody,
	.ft-table--mobile-cards th,
	.ft-table--mobile-cards td,
	.ft-table--mobile-cards tr {
		display: block;
	}
	.ft-table--mobile-cards thead {
		display: none;
	}
	.ft-table--mobile-cards tr {
		margin-bottom: 12px;
		border: 1px solid var(--color-border);
		border-radius: 8px;
		padding: 8px 0;
		background: var(--color-bg);
	}
	.ft-table--mobile-cards tbody tr:hover td {
		background: transparent;
	}
	.ft-table--mobile-cards th {
		border-right: none;
		border-bottom: none;
	}
	.ft-table--mobile-cards td {
		padding: 6px 12px;
		border-bottom: none;
		border-right: none;
		text-align: left;
		position: relative;
	}
	.ft-table--mobile-cards td[data-label]:not([data-label=""])::before {
		content: attr(data-label);
		display: inline-block;
		width: 100px;
		flex-shrink: 0;
		font-size: 11px;
		font-weight: 600;
		color: var(--color-text-muted);
	}
	.ft-table--mobile-cards td[data-label]:not([data-label=""]) {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 8px;
	}
	/* В мобильных карточках столбцы Сторона 1 / Сторона 2 — блочный режим, чтобы <br> работал */
	.ft-table--mobile-cards td[data-label="Сторона 1"],
	.ft-table--mobile-cards td[data-label="Сторона 2"] {
		display: block;
	}
	.ft-table--mobile-cards td[data-label="Сторона 1"]::before,
	.ft-table--mobile-cards td[data-label="Сторона 2"]::before {
		display: block;
		width: auto;
		margin-bottom: 2px;
	}
	/* Аватар слева в мобильной карточке (pretournament) */
	.pretournament-table td[data-label=""] {
		float: left;
		padding: 6px 8px 0 12px;
	}
	/* Действия справа в мобильной карточке (pretournament) */
	.pretournament-table td:last-child {
		display: flex;
		flex-wrap: wrap;
		gap: 4px;
		justify-content: flex-end;
		padding-top: 4px;
		padding-bottom: 6px;
		border-top: 1px solid var(--color-border-light);
		white-space: normal !important;
	}
	.pretournament-table tr {
		overflow: hidden;
		padding: 8px;
	}
	/* Кнопка удаления в мобильных карточках: текст вместо иконки, выравнивание вправо */
	.ft-table--mobile-cards .pr-delete-cell {
		text-align: right;
		padding-top: 4px;
		border-top: 1px solid var(--color-border-light);
	}
	.ft-table--mobile-cards .pr-delete-icon {
		display: none;
	}
	.ft-table--mobile-cards .pr-delete-text {
		display: inline;
	}
	.ft-table--mobile-cards .pr-delete-btn {
		width: auto;
		height: auto;
		padding: 4px 12px;
		font-size: 12px;
		border-radius: 4px;
	}
	/* Каждый .mobile-sub на своей строке внутри flex-td */
	.ft-table--mobile-cards .mobile-sub {
		display: block;
		flex-basis: 100%;
		font-size: var(--font-size-xs);
		color: var(--color-text-muted);
		line-height: 1.45;
		margin-top: 1px;
	}
	/* .desktop-sub скрываем на мобильных */
	.desktop-sub {
		display: none;
	}
}
/* =============================================
   Заголовок с действием (кнопка «Сравнить»)  /
   ============================================ */
.page-header--with-action {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
}
.page-header--with-action h1 {
	margin-bottom: 0;
}
.btn-rating-compare {
	flex-shrink: 0;
}

/* =============================================
   Легенда диаграммы сравнения
   ============================================ */
.chart-legend {
	justify-content: center;
}
.chart-legend-item {
	transition: background 0.15s, border-color 0.15s;
}
.chart-legend-item:hover {
	background: var(--color-bg-secondary);
}

/* =============================================
   Таблица с центрированием и бордерами (на базе .ft-table)
   ============================================ */
.ft-table--bordered th,
.ft-table--bordered td {
	border-right: 1px solid var(--color-border-light);
	vertical-align: top;
	text-align: center;
}
.ft-table--bordered th:last-child,
.ft-table--bordered td:last-child {
	border-right: none;
}
.ft-table--bordered td small {
	display: block;
	margin-top: 2px;
}

/* =============================================
   Панель фильтров реестра прогнозов (.pr-filter-panel)
   ============================================ */
.pr-filter-panel {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.pr-filter-row {
	display: flex;
	gap: 12px;
	align-items: flex-end;
}
.pr-filter-row--main {
	flex-wrap: wrap;
}
.pr-filter-field {
	margin-bottom: 0;
	min-width: 0;
}
.pr-filter-field .form-input,
.pr-filter-field .form-select {
	width: 100%;
}

/* Десктоп: Мои игроки 60%, Период занимает оставшееся пространство, кнопка auto */
@media (min-width: 760px) {
	.pr-filter-field--player {
		flex: 0 0 60%;
		max-width: 60%;
	}
	.pr-filter-field--period {
		flex: 1 1 auto;
	}
	.pr-filter-field--actions {
		flex: 0 0 auto;
	}
	.pr-filter-field--actions .form-label {
		display: none;
	}
}

/* Мобильная версия (≤759px): три строки */
@media (max-width: 759px) {
	.pr-filter-row--main {
		flex-wrap: wrap;
	}
	.pr-filter-field--player {
		flex: 0 0 100%;
		max-width: 100%;
	}
	/* Строка 2: Период 50% + Применить 50% */
	.pr-filter-row--main .pr-filter-field--period {
		flex: 0 0 calc(50% - 6px);
		max-width: calc(50% - 6px);
	}
	.pr-filter-row--main .pr-filter-field--actions {
		flex: 0 0 calc(50% - 6px);
		max-width: calc(50% - 6px);
	}
	.pr-filter-row--bottom {
		display: flex;
	}
	.pr-filter-row--bottom .form-group {
		width: 100%;
	}
	.pr-filter-row--bottom .pr-new-btn {
		width: 100%;
	}
}

/* Кнопка удаления (иконка корзины) */
.btn-icon-danger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: none;
	background: transparent;
	color: var(--color-text-muted);
	border-radius: 6px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.btn-icon-danger:hover {
	background: rgba(220, 53, 69, 0.1);
	color: var(--color-danger);
}
/* Кликабельные строки таблицы (реестр прогнозов и др.) */
.ft-table-clickable tbody tr {
	cursor: pointer;
}
/* Текст «Удалить» — скрыт на десктопе, виден только в мобильных карточках */
.pr-delete-text {
	display: none;
}

/* Пагинация с ограниченным окном номеров страниц */
.pagination--compact {
	margin-top: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	flex-wrap: nowrap;
}
.pagination-current {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	min-height: 32px;
	padding: 0 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--color-text, #000);
	cursor: default;
	pointer-events: none;
}

/* ============================================================
 * Карточка турнира (/tours/card)
 * ============================================================ */

/* Хедер карточки */
.tour-card-header {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 16px;
	padding: 12px 16px;
	background: var(--color-bg-secondary, #f5f5f5);
	border-radius: 8px;
	font-size: 14px;
}
.tour-card-header__dates {
	color: var(--color-text, #333);
}
.tour-card-header__location {
	color: var(--color-text-muted, #666);
}

/* Полоса табов */
.tour-card-tabs {
	display: flex;
	gap: 0;
	border-bottom: 2px solid var(--color-border, #ddd);
	margin-bottom: 16px;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
}
.tour-card-tab {
	padding: 10px 16px;
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	font-size: 14px;
	color: var(--color-text-muted, #666);
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.15s, border-color 0.15s;
}
.tour-card-tab:hover {
	color: var(--color-text, #333);
}
.tour-card-tab--active {
	color: var(--color-primary, #0066cc);
	border-bottom-color: var(--color-primary, #0066cc);
	font-weight: 600;
}

/* Секции карточки */
.tour-card-section {
	display: none;
}
.tour-card-section--active {
	display: block;
}
.tour-card-section__empty {
	text-align: center;
	padding: 32px 16px;
	color: var(--color-text-muted, #999);
	font-size: 14px;
}

/* Организатор */
.tour-card-org__item {
	padding: 4px 0;
	font-size: 14px;
	line-height: 1.5;
}
.tour-card-org__label {
	font-weight: 500;
	color: var(--color-text-muted, #666);
}

/* Спортобъекты */
.tour-card-sob {
	padding: 8px 0;
	border-bottom: 1px solid var(--color-border-light, #eee);
}
.tour-card-sob:last-child {
	border-bottom: none;
}
.tour-card-sob__item,
.tour-card-referee__item {
	padding: 4px 0;
	font-size: 14px;
	line-height: 1.5;
}
.tour-card-sob__label,
.tour-card-referee__label {
	font-weight: 500;
	color: var(--color-text-muted, #666);
}

/* Сроки проведения — таблица этапов */
.tour-card-schedule-stages {
	margin-bottom: 16px;
}
.tour-card-schedule-stages th,
.tour-card-schedule-stages td {
	font-size: 12px;
	padding: 6px 8px;
	text-align: center;
}
.tour-card-schedule-stages .cell-type {
	text-align: center;
	font-weight: 600;
}

/* Территориальные ограничения */
.tour-card-geof {
	margin-bottom: 16px;
}
.tour-card-geof th,
.tour-card-geof td {
	font-size: 12px;
	padding: 6px 8px;
	text-align: left;
}
.tour-card-geof th:last-child,
.tour-card-geof td:last-child {
	text-align: center;
	width: 120px;
}
.tour-card-geof--allow {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	background: #e8f5e9;
	color: #2e7d32;
}
.tour-card-geof--deny {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	background: #fce4ec;
	color: #c62828;
}

/* Этапы */
.tour-card-stages th,
.tour-card-stages td {
	font-size: 13px;
	padding: 6px 8px;
	text-align: center;
}
@media (max-width: 759px) {
	.tour-card-schedule-dl {
		grid-template-columns: 1fr;
		gap: 2px;
	}
	.tour-card-schedule-dl dd {
		margin-bottom: 8px;
	}
}

/* Под-табы заявок */
.tour-card-requests-subtabs {
	display: flex;
	gap: 4px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}
.tour-card-requests-subtab {
	padding: 6px 12px;
	background: var(--color-bg-secondary, #f0f0f0);
	border: 1px solid var(--color-border, #ddd);
	border-radius: 6px;
	font-size: 13px;
	color: var(--color-text, #333);
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}
.tour-card-requests-subtab:hover {
	background: var(--color-bg-hover, #e8e8e8);
}
.tour-card-requests-subtab--active {
	background: var(--color-primary, #0066cc);
	color: #fff;
	border-color: var(--color-primary, #0066cc);
}

/* Заголовок раздела в списке заявок */
.tour-card-requests-list-title {
	margin: 16px 0 8px;
	padding-bottom: 4px;
	border-bottom: 1px solid var(--color-border, #ddd);
	font-size: 14px;
	font-weight: 700;
	color: var(--color-text, #1f2937);
}
.tour-card-requests-list-title:first-child {
	margin-top: 0;
}

/* Индикатор проверки игрока */
.tour-card-check-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	vertical-align: middle;
}

/* --- Заявочный список: фиксированные колонки --- */
.tour-card-requests {
	table-layout: fixed;
	width: 100%;
}
.tour-card-requests th {
	white-space: normal;
	text-align: center;
	vertical-align: middle;
}
.tour-card-requests .tc-req-n     { width: 56px; }
.tour-card-requests .tc-req-chk   { width: 40px; }
.tour-card-requests .tc-req-rni   { width: 100px; }
.tour-card-requests .tc-req-name  { width: auto; text-align: left; }
.tour-card-requests .tc-req-rat   { width: 96px; }
.tour-card-requests .tc-req-ent   { width: 108px; }
.tour-card-requests .tc-req-join  { width: 120px; white-space: normal; word-wrap: break-word; }
.tour-card-requests .tc-req-reg   { width: 72px; }
.tour-card-requests .tc-req-note  { width: 200px; white-space: normal; word-wrap: break-word; }
.tour-card-requests td {
	text-align: center;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tour-card-requests td.tc-req-name { text-align: left; white-space: normal; }
.tour-card-requests td.tc-req-note { white-space: normal; text-align: left; }

/* Десктоп: скрываем общую мобильную строку и текст проверки */
.tc-req-common-mobile  { display: none; }
.tour-card-check-text  { display: none; }
.tour-card-check-dot   { display: inline-block; }

/* Командный турнир: строки */
.tour-card-requests .tour-card-requests-group .tc-team-header td {
	background: #dbeafe;
	font-weight: 600;
}
.tour-card-requests .tour-card-requests-group .tc-team-player td {
	background: #fff;
}
.tour-card-requests .tour-card-requests-group .tc-team-footer td {
	background: #f3f4f6;
	color: var(--color-text-muted, #6b7280);
	font-size: 12px;
}
/* Название команды и капитан — по левому краю */
.tour-card-requests .tc-team-name { text-align: left !important; }
.tour-card-requests .tc-team-capt { text-align: left !important; }

/* Командные группы: ховер — только строка игрока */
.tour-card-requests .tc-team-header td,
.tour-card-requests .tc-team-header:hover td {
	background: #dbeafe !important;
}
.tour-card-requests .tc-team-footer td,
.tour-card-requests .tc-team-footer:hover td {
	background: #f3f4f6 !important;
}
.tour-card-requests .tc-team-player:hover td {
	background: var(--color-bg-hover, #f0f4ff) !important;
}

/* Мобильные карточки: компактный вид */
@media (max-width: 759px) {
	.tour-card-requests,
	.tour-card-requests thead,
	.tour-card-requests tbody,
	.tour-card-requests th,
	.tour-card-requests td,
	.tour-card-requests tr {
		display: block;
		width: 100% !important;
	}
	.tour-card-requests thead { display: none; }

	/* Группа участника — отдельный блок */
	.tour-card-requests-group {
		display: block;
		margin-bottom: 10px;
		border: 1px solid var(--color-border, #ddd);
		border-radius: 8px;
		background: var(--color-bg, #fff);
		padding: 6px 8px;
	}

	/* Строки игроков — inline-flow */
	.tour-card-requests-group > tr:not(.tc-req-common-mobile) {
		display: flex;
		flex-wrap: wrap;
		gap: 2px 8px;
		align-items: baseline;
		padding: 4px 6px;
		margin: 2px 0;
		border-radius: 4px;
	}
	.tc-req-common-mobile {
		border-top: 1px solid var(--color-border, #ccc);
		margin-top: 6px;
		padding-top: 6px;
	}

	.tour-card-requests td {
		padding: 1px 2px;
		font-size: 12px;
		border: none;
		text-align: left;
		overflow: visible;
		text-overflow: clip;
		white-space: normal !important;
	}

	/* Скрываем общие поля из строк игроков */
	.tc-req-mobile-hide { display: none !important; }

	/* Общая строка для мобильной версии */
	.tc-req-common-mobile {
		display: flex !important;
		flex-wrap: wrap;
		gap: 2px 8px;
		align-items: baseline;
		padding: 4px 0 2px;
	}
	.tc-req-common-mobile td {
		padding: 1px 2px;
		font-size: 12px;
	}
	.tc-req-common-mobile td:empty { display: none !important; }

	/* Разделитель перед РНИ (одиночный/парный разряд, не командный) */
	.tour-card-requests-group > tr:not(.tc-req-common-mobile):not(.tc-team-header):not(.tc-team-player):not(.tc-team-footer) td.tc-req-rni {
		border-top: 1px solid var(--color-border, #ccc);
		margin-top: 4px;
		padding-top: 6px;
	}

	/* Порядок: сначала поля игроков, потом общие */
	.tour-card-requests td.tc-req-n    { order: 1; font-weight: 700; flex-shrink: 0; }
	.tour-card-requests td.tc-req-chk  { order: 2; flex-shrink: 0; }
	.tour-card-requests td.tc-req-rni  { order: 3; flex-shrink: 0; }
	.tour-card-requests td.tc-req-name { order: 4; flex-basis: 100%; }
	.tour-card-requests td.tc-req-reg  { order: 5; flex-shrink: 0; }
	.tour-card-requests td.tc-req-rat  { order: 6; flex-shrink: 0; }
	.tour-card-requests td.tc-req-ent  { order: 7; flex-shrink: 0; }
	.tour-card-requests td.tc-req-join { order: 8; flex-shrink: 0; }
	.tour-card-requests td.tc-req-note { order: 9; flex-basis: 100%; }

	/* Точка скрыта, текст виден */
	.tour-card-check-dot  { display: none !important; }
	.tour-card-check-text { display: inline; color: inherit; }

	/* Лейблы через ::before */
	.tour-card-requests td[data-label]:not([data-label=""])::before {
		content: attr(data-label);
		display: inline-block;
		width: auto;
		min-width: 90px;
		flex-shrink: 0;
		font-size: 11px;
		font-weight: 600;
		color: var(--color-text-muted, #6b7280);
	}
	.tour-card-requests td[data-label]:not([data-label=""]) {
		display: flex !important;
		align-items: baseline;
		gap: 6px;
	}
}

/* Подстрока с датой рождения и городом */
.tour-card-player-sub {
	font-size: 12px;
	color: var(--color-text-muted, #6b7280);
}

/* Ссылка на публичную карточку игрока */
.tour-card-player-link {
	color: var(--color-link, #1a56db);
	text-decoration: none;
	cursor: pointer;
}
.tour-card-player-link:hover {
	text-decoration: underline;
	color: var(--color-link-hover, #1e40af);
}

.rating-roster-player-link {
	color: var(--color-link, #1a56db);
	text-decoration: none;
}

.rating-roster-player-link:hover {
	text-decoration: underline;
	color: var(--color-link-hover, #1e40af);
}

/* --- Таблица участников --- */
.tour-card-members {
	table-layout: fixed;
	width: 100%;
}
.tour-card-members .tcm-n     { width: 56px; }
.tour-card-members .tcm-pos   { width: 60px; }
.tour-card-members .tcm-pos-label { width: 70px; }
.tour-card-members .tcm-st    { width: 90px; }
.tour-card-members .tcm-rni   { width: 90px; }
.tour-card-members .tcm-name  { width: auto; text-align: left; }
.tour-card-members .tcm-birth { width: 100px; }
.tour-card-members .tcm-city  { width: 160px; }
.tour-card-members .tcm-rat   { width: 96px; }
.tour-card-members .tcm-realreg { width: 72px; }
.tour-card-members .tcm-ent   { width: 108px; }
.tour-card-members .tcm-regdt { width: auto; }

.tour-card-members td {
	text-align: center;
	vertical-align: middle;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.tour-card-members td.tcm-name { white-space: normal; text-align: left; }

.tour-card-members-group-title {
	font-size: 14px;
	font-weight: 600;
	margin: 12px 0 6px;
	color: var(--color-text, #333);
}

/* Командный турнир: строки из таблицы участников — те же классы, что и в заявках */
.tour-card-members .tour-card-requests-group .tc-team-header td {
	background: #dbeafe;
	font-weight: 600;
}
.tour-card-members .tour-card-requests-group .tc-team-player td {
	background: #fff;
}
.tour-card-members .tour-card-requests-group .tc-team-footer td {
	background: #f3f4f6;
	color: var(--color-text-muted, #6b7280);
	font-size: 12px;
}
.tour-card-members .tc-team-name { text-align: left !important; }
.tour-card-members .tc-team-capt { text-align: left !important; }

/* Командные в таблице участников: ховер — только строка игрока */
.tour-card-members .tc-team-header td,
.tour-card-members .tc-team-header:hover td {
	background: #dbeafe !important;
}
.tour-card-members .tc-team-footer td,
.tour-card-members .tc-team-footer:hover td {
	background: #f3f4f6 !important;
}
.tour-card-members .tc-team-player:hover td {
	background: var(--color-bg-hover, #f0f4ff) !important;
}

/* Мобильная версия таблицы участников */
@media (max-width: 759px) {
	.tour-card-members,
	.tour-card-members thead,
	.tour-card-members tbody,
	.tour-card-members th,
	.tour-card-members td,
	.tour-card-members tr {
		display: block;
		width: 100% !important;
	}
	.tour-card-members thead { display: none; }
	.tour-card-members tbody { border-bottom: 2px solid var(--color-border, #ddd); margin-bottom: 8px; padding-bottom: 4px; }
	.tour-card-members tr {
		display: flex;
		flex-wrap: wrap;
		gap: 2px 8px;
		align-items: baseline;
		padding: 4px 0 2px;
	}
	.tour-card-members td[data-label]:not([data-label=""])::before {
		content: attr(data-label);
		display: inline-block;
		width: auto;
		min-width: 90px;
		flex-shrink: 0;
		font-size: 11px;
		font-weight: 600;
		color: var(--color-text-muted, #6b7280);
	}
	.tour-card-members td[data-label]:not([data-label=""]) {
		display: flex !important;
		align-items: baseline;
		gap: 6px;
	}
	.tour-card-members td { border: none !important; }
	/* Порядок колонок в мобильной */
	.tour-card-members td.tcm-n     { order: 1; font-weight: 700; flex-shrink: 0; }
	.tour-card-members td.tcm-st    { order: 2; flex-shrink: 0; }
	.tour-card-members td.tcm-rni   { order: 3; flex-shrink: 0; }
	.tour-card-members td.tcm-name  { order: 4; flex-basis: 100%; }
	.tour-card-members td.tcm-birth { order: 5; flex-shrink: 0; }
	.tour-card-members td.tcm-city  { order: 6; flex-shrink: 0; }
	.tour-card-members td.tcm-rat   { order: 7; flex-shrink: 0; }
	.tour-card-members td.tcm-ent   { order: 8; flex-shrink: 0; }
	.tour-card-members td.tcm-realreg { order: 9; flex-shrink: 0; }
	.tour-card-members td.tcm-pos   { order: 10; flex-shrink: 0; }
	.tour-card-members td.tcm-regdt { order: 11; flex-shrink: 0; }
	/* Разделитель перед РНИ (одиночный/парный разряд, не командный) */
	.tour-card-members .tour-card-requests-group > tr:not(.tc-req-common-mobile):not(.tc-team-header):not(.tc-team-player):not(.tc-team-footer) td.tcm-rni {
		border-top: 1px solid var(--color-border, #ccc) !important;
		margin-top: 4px;
		padding-top: 6px;
	}
	/* Для команд — порядок ячеек в шапке */
	.tour-card-members .tc-team-header td.tcm-n     { order: 1; font-weight: 700; }
	.tour-card-members .tc-team-header td.tcm-st    { order: 2; }
	.tour-card-members .tc-team-header td.tc-team-name { order: 3; flex-basis: 100%; }
	.tour-card-members .tc-team-header td.tcm-rat   { order: 4; }
	.tour-card-members .tc-team-header td.tcm-ent   { order: 5; }
	/* Командные строки игроков */
	.tour-card-members .tc-team-player td.tcm-pos   { order: 1; font-weight: 700; }
	.tour-card-members .tc-team-player td.tcm-rni   { order: 2; }
	.tour-card-members .tc-team-player td.tcm-name  { order: 3; flex-basis: 100%; }
	.tour-card-members .tc-team-player td.tcm-rat   { order: 4; }
	.tour-card-members .tc-team-player td.tcm-ent   { order: 5; }
	/* Командный подвал */
	.tour-card-members .tc-team-footer td.tc-team-capt   { order: 1; flex-basis: 100%; }
	.tour-card-members .tc-team-footer td.tcm-pos-label  { order: 2; }
	.tour-card-members .tc-team-footer td.tcm-pos        { order: 3; }
	/* Выравнивание в мобильной — всё по центру */
	.tour-card-members .tc-team-name,
	.tour-card-members .tc-team-capt,
	.tour-card-members td.tcm-name { text-align: center !important; }
	/* Точка скрыта, текст виден */
	.tour-card-check-dot  { display: none !important; }
	.tour-card-check-text { display: inline; color: inherit; }
}

/* Группа участника в заявках — выделяется целиком при наведении (кроме командных) */
.tour-card-requests .tour-card-requests-group:not(.tour-card-requests-group-team):hover tr,
.tour-card-requests .tour-card-requests-group:not(.tour-card-requests-group-team):hover td {
	background: var(--color-bg-hover, #f0f4ff);
}

/* Таблица участников: выделяется весь участник при наведении */
.tour-card-members .tour-card-requests-group:not(.tour-card-requests-group-team):hover tr,
.tour-card-members .tour-card-requests-group:not(.tour-card-requests-group-team):hover td {
	background: var(--color-bg-hover, #f0f4ff);
}

/* Бейджи */
.tour-card-badge {
	display: inline-block;
	padding: 2px 6px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 2px;
}
.tour-card-badge--seed {
	background: #e3f2fd;
	color: #1565c0;
}
.tour-card-badge--wc {
	background: #fff3e0;
	color: #e65100;
}
.tour-card-badge--waiter {
	background: #fce4ec;
	color: #c62828;
}
.tour-card-badge--addit {
	background: #f3e5f5;
	color: #6a1b9a;
}
.tour-card-badge--poe {
	background: #e8f5e9;
	color: #2e7d32;
}

/* Сообщения (объявления, инфо-карты) */
.tour-card-message {
	padding: 12px 0;
	border-bottom: 1px solid var(--color-border-light, #eee);
}
.tour-card-message:last-child {
	border-bottom: none;
}
.tour-card-message__header,
.tour-card-message__title {
	margin-bottom: 4px;
	font-size: 14px;
}
.tour-card-message__body {
	font-size: 13px;
	color: var(--color-text, #333);
	line-height: 1.5;
	white-space: pre-wrap;
}

/* Расписание */
.tour-card-schedule-day {
	margin-bottom: 16px;
}
.tour-card-schedule-day__header {
	padding: 8px 12px;
	background: var(--color-bg-secondary, #f5f5f5);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 8px 0;
}

/* ============================================================
 * Турнирные сетки (TourGrid)
 * Олимпийская = линейный протокол (столбцы участников и побед)
 * Круговая    = таблица (каждый с каждым)
 * ============================================================ */

/* --- Контейнер с горизонтальным скроллом (используется в tour.js) --- */
.tourgrid-container {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.tourgrid__empty {
	text-align: center;
	padding: 24px 16px;
	color: var(--color-text-muted, #999);
	font-size: 14px;
}

/* === ОЛИМПИЙСКАЯ СЕТКА: линейный протокол === */

/* --- Внешняя обёртка со скроллом --- */
.olymp-wrapper {
	width: 100%;
	overflow-x: auto;
	padding-bottom: 32px;
}

/* --- Flex-строка столбцов --- */
.olymp-container {
	display: flex;
	width: max-content;
	margin: 0 auto;
	gap: 0;
}

/* --- Столбец --- */
.olymp-col {
	display: flex;
	flex-direction: column;
	width: 200px;
	flex-shrink: 0;
}
.olymp-col.olymp-col-start {
	width: 320px;
}

/* --- Заголовок столбца --- */
.olymp-title {
	font-weight: 600;
	font-size: 11px;
	color: #9ca3af;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 10px;
	margin-bottom: 20px;
	text-align: center;
}

/* --- Бокс с элементами (фикс. высота, flex равной высоты) --- */
.olymp-box {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* --- Блок участника (пара) --- */
.olymp-pair {
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background-color: #f8fafc;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 0;
	overflow: hidden;
	flex: 1;
	min-height: 0;
}

/* --- Строка одного участника внутри пары --- */
.olymp-team {
	display: flex;
	flex-direction: column;
}
.olymp-team.olymp-clickable {
	cursor: pointer;
	transition: background-color 0.15s;
}
.olymp-team.olymp-clickable:hover {
	background-color: #e0f2fe;
}
/* Командный матч — кликабельная вся ячейка */
.olymp-pair.olymp-clickable-team,
.ob-branch.olymp-clickable-team {
	cursor: pointer;
}
.olymp-pair.olymp-clickable-team:hover,
.ob-branch.olymp-clickable-team:hover {
	background-color: #f3f4f6;
}

/* Счёт командного матча — крупнее */
.team-score,
.team-score-box {
	font-size: 16px;
	font-weight: 700;
}
.ob-score .team-score {
	display: inline-block;
	text-align: center;
}

/* В круговой сетке — ячейка со счётом */
.cell-match .team-score-box {
	text-align: center;
	padding: 2px 4px;
	border-radius: 3px;
	display: block;
}
td.cell-match:hover {
	background-color: #f3f4f6;
}
.olymp-team + .olymp-team {
	border-top: 1px solid #cbd5e1;
}

/* --- Flex-строка: позиция + бейджи + имя --- */
.olymp-team-row {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 4px;
}

/* --- Номер позиции (внутри строки участника) --- */
.olymp-pos {
	width: 24px;
	flex-shrink: 0;
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: #6b7280;
}

/* --- Бейджи (внутри строки, перед именем) --- */
.olymp-badges {
	display: inline-flex;
	gap: 2px;
	flex-shrink: 0;
}

/* --- Имя игрока --- */
.olymp-player {
	font-size: 13px;
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0;
	min-height: 20px;
	flex: 1;
	min-width: 0;
}
.olymp-player--single {}
.olymp-player--double {
	white-space: nowrap;
	overflow: visible;
}

/* --- Бейджи --- */
.olymp-badge {
	font-size: 10px;
	padding: 1px 4px;
	border-radius: 3px;
	font-weight: 700;
	flex-shrink: 0;
}
.olymp-badge--si { background-color: #eff6ff; color: #1e40af; }
.olymp-badge--sk { background-color: #fef2f2; color: #991b1b; }
.olymp-badge--poe{ background-color: #ecfdf5; color: #065f46; }
.olymp-badge--oj { background-color: #fefce8; color: #854d0e; }
.olymp-badge--di { background-color: #fdf2f8; color: #831843; }

/* --- Блок победителя раунда --- */
.ob-branch {
	display: flex;
	flex-direction: column;
	justify-content: center;
	position: relative;
	min-height: 0;
	flex: 1;
}

/* Горизонтальная линия ровно по центру блока (совпадает с разделителем участников) */
.ob-branch::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 2px;
	background-color: #6b7280;
	z-index: 0;
	transform: translateY(-50%);
}

/* Имя победителя над линией */
.ob-winner {
	height: 36px;
	font-size: 12px;
	font-weight: 700;
	color: #065f46;
	padding-left: 20px;
	padding-bottom: 4px;
	margin-top: 0;
	line-height: 1.25;
	position: relative;
	z-index: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: bottom;
}

.ob-winner--done {
	color: #065f46;
	height: 36px;
	vertical-align: bottom;
}

/* Пустой placeholder */
.ob-handle {
	height: 100%;
	min-height: 30px;
}

/* Счёт под линией (с номером матча: "#23: 6-4,6-2") */
.ob-score {
	font-size: 11px;
	color: #6b7280;
	padding-left: 20px;
	padding-top: 4px;
	margin-top: -6px;
	line-height: 1.3;
	position: relative;
	z-index: 1;
	min-height: 36px;
	vertical-align: top;
}

.ob-match-status {
	display: block;
	font-size: 10px;
	color: #9ca3af;
	font-style: italic;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Плейсхолдер участника (СК, ПОЭ, Х) */
.olymp-player--placeholder {
	color: #9ca3af;
	font-style: italic;
}

/* Вертикальные усы справа (::after) — высоты задаются динамически через <style> */
.ob-branch::after {
	content: "";
	position: absolute;
	right: 0;
	width: 2px;
	background-color: #6b7280;
}

/* ============================================================
 * Круговая сетка (таблица)
 * ============================================================ */
.tour-grid-circle {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.tour-grid-circle th,
.tour-grid-circle td {
	border: 1px solid var(--color-border, #ccc);
	padding: 4px 6px;
	text-align: center;
	vertical-align: middle;
}
.tour-grid-circle .cell-nn {
	width: 40px;
	font-weight: 700;
	background: var(--color-bg-secondary, #f5f5f5);
}
.tour-grid-circle .cell-member {
	min-width: 130px;
	text-align: left;
	font-weight: 600;
	padding: 4px 8px;
}
.tour-grid-circle .cell-pts,
.tour-grid-circle .cell-place,
.tour-grid-circle .cell-matches,
.tour-grid-circle .cell-sets,
.tour-grid-circle .cell-games {
	width: 70px;
	font-weight: 700;
	background: var(--color-bg-secondary, #f5f5f5);
}
.tour-grid-circle .cell-match {
	min-width: 100px;
	font-size: 11px;
	line-height: 1.3;
}
.tour-grid-circle .cell-empty {
	background: #ccc;
}
.cg-stat-hint {
	color: #9ca3af;
	font-size: 10px;
	font-weight: 400;
}
.cg-stat-sub {
	border-top: 1px solid #bbb;
	margin-top: 2px;
	padding-top: 2px;
}
.cg-match-status {
	display: block;
	font-size: 10px;
	color: #9ca3af;
	font-style: italic;
}
.tour-grid-circle .row-alt {
	background: #fafafa;
}

/* Расписание — сетка корты × запуски */
.tour-card-schedule-grid {
	width: auto;
	border-collapse: collapse;
	font-size: 12px;
}
.tour-card-schedule-grid tbody tr:hover td {
	background: transparent;
}
.tour-card-schedule-grid th {
	background: var(--color-bg-secondary, #f5f5f5);
	text-align: center;
	font-weight: 600;
	padding: 6px 8px;
	border: 1px solid var(--color-border, #ccc);
}
.tour-card-schedule-grid td {
	border: 1px solid var(--color-border, #ccc);
	padding: 0;
	vertical-align: top;
}
.tour-card-schedule-launch {
	text-align: center;
	font-weight: 600;
	white-space: nowrap;
	background: var(--color-bg-secondary, #f5f5f5);
	min-width: 80px;
}

/* Ячейка расписания — фиксированный размер */
.tour-card-schedule-cell {
	width: 235px;
	height: 169px;
	min-width: 235px;
	min-height: 169px;
	box-sizing: border-box;
}
.tour-card-schedule-cell-inner {
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	font-size: 11px;
	line-height: 1.25;
	cursor: pointer;
	overflow: hidden;
	box-sizing: border-box;
}

/* Шапка */
.schedule-cell-header {
	text-align: center;
	flex-shrink: 0;
	padding: 4px 6px 2px;
	border-bottom: 1px solid var(--color-border-light, #eee);
}
.schedule-cell-type {
	font-size: 11px;
	font-weight: 600;
}
.schedule-cell-time {
	font-size: 11px;
	font-weight: 600;
	color: var(--color-text-muted, #666);
}
.schedule-cell-meta {
	font-size: 9px;
	opacity: .8;
	margin-top: 1px;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.schedule-cell-stage {
	font-weight: 600;
	flex-shrink: 0;
	margin-left: 4px;
}

/* Командный заголовок */
.schedule-cell-teams {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	font-size: 9px;
	font-weight: 600;
	margin-bottom: 2px;
}
.schedule-cell-team-name {
	max-width: 42%;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	word-break: break-word;
	line-height: 1.2;
}
.schedule-cell-team-vs {
	flex-shrink: 0;
	opacity: .5;
	font-size: 8px;
	padding: 0 2px;
}

/* Центр — игроки и счёт */
.schedule-cell-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	text-align: center;
	padding: 2px 6px;
}
.schedule-cell-player {
	font-size: 11px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.schedule-cell-player--winner {
	color: #000;
	opacity: 1;
}
.schedule-cell-player--loser {
	opacity: 0.8;
}
.schedule-cell-score {
	font-weight: 700;
	font-size: 12px;
	color: var(--color-primary, #3c8dbc);
	padding: 2px 0;
}

/* Подвал */
.schedule-cell-footer {
	display: flex;
	justify-content: space-between;
	font-size: 9px;
	opacity: .7;
	flex-shrink: 0;
	padding: 2px 6px 4px;
	border-top: 1px solid var(--color-border-light, #eee);
}
.schedule-cell-umpire {
	text-align: left;
	max-width: 65%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.schedule-cell-match-no {
	text-align: right;
	flex-shrink: 0;
}

/* Hover: выделение бордюром вместо фона */
.tour-card-schedule-cell-inner:hover {
	outline: 2px solid var(--color-primary, #2563eb);
	outline-offset: -2px;
	background: transparent !important;
}

/* Подсветка матча текущего игрока */
.schedule-cell--mine {
	outline: 2px solid var(--color-primary, #2563eb);
	outline-offset: -2px;
	box-shadow: inset 0 0 8px rgba(37,99,235,.08);
}

/* Цвета grid_color_1..32 — пастельные фоны для разных турниров */
/* Базовые оттенки 1–8: */
.grid_color_1  { background: #e8ddfb; } /* светло-лавандовый */
.grid_color_2  { background: #ddfbec; } /* светло-мятный */
.grid_color_3  { background: #ddf7fb; } /* светло-голубой */
.grid_color_4  { background: #f8e9ff; } /* светло-розовый */
.grid_color_5  { background: #fef3c7; } /* светло-жёлтый */
.grid_color_6  { background: #ffe4d6; } /* светло-персиковый */
.grid_color_7  { background: #d1fae5; } /* светло-салатовый */
.grid_color_8  { background: #ede9fe; } /* светло-сиреневый */
/* 9–32: вариации яркости базовых оттенков */
.grid_color_9  { background: #ddd0f5; }
.grid_color_10 { background: #cbf2db; }
.grid_color_11 { background: #caecf5; }
.grid_color_12 { background: #f3dafc; }
.grid_color_13 { background: #fdeab5; }
.grid_color_14 { background: #ffd8c5; }
.grid_color_15 { background: #c0f0d5; }
.grid_color_16 { background: #e0dcf8; }
.grid_color_17 { background: #e8ddfb; }
.grid_color_18 { background: #ddfbec; }
.grid_color_19 { background: #ddf7fb; }
.grid_color_20 { background: #f8e9ff; }
.grid_color_21 { background: #fef3c7; }
.grid_color_22 { background: #ffe4d6; }
.grid_color_23 { background: #d1fae5; }
.grid_color_24 { background: #ede9fe; }
.grid_color_25 { background: #ddd0f5; }
.grid_color_26 { background: #cbf2db; }
.grid_color_27 { background: #caecf5; }
.grid_color_28 { background: #f3dafc; }
.grid_color_29 { background: #fdeab5; }
.grid_color_30 { background: #ffd8c5; }
.grid_color_31 { background: #c0f0d5; }
.grid_color_32 { background: #e0dcf8; }

/* Специальные ячейки расписания */
.schedule-special-cell {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 8px;
	box-sizing: border-box;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.3;
}

/* 1293 — Разминка участников */
.schedule-special--warmup {
	background: #fff;
	color: #222;
}

/* 1294 — Корт не доступен (тёмно-серый, большой крест, белый текст) */
.schedule-special--unavailable {
	background: #4a4a4a;
	color: #fff;
	font-size: 14px;
}

/* 1295 — Использование корта под вопросом (тёмно-жёлтый, большой знак вопроса) */
.schedule-special--question {
	background: #b8860b;
	color: #fff;
	font-size: 14px;
}

/* 1373 — Ячейка с комментарием (белый фон, чёрный текст) */
.schedule-special--comment {
	background: #fff;
	color: #222;
}

.schedule-special-text {
	word-break: break-word;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
}

/* Справка (модальное окно) */
.help-dialog {
	max-width: 720px;
	max-height: 80vh;
	overflow-y: auto;
}

/* --- Диалог информации об участнике сетки --- */
.olymp-dialog-overlay {
	position: fixed;
	top: 0; left: 0; right: 0; bottom: 0;
	background: rgba(0,0,0,0.5);
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}
.olymp-dialog {
	background: var(--color-bg, #fff);
	border-radius: 12px;
	padding: 24px;
	max-width: 480px;
	width: 100%;
	box-shadow: 0 8px 32px rgba(0,0,0,0.25);
	position: relative;
	max-height: 80vh;
	overflow-y: auto;
}
.olymp-dialog-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #e5e7eb;
}
.olymp-dialog-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}
.olymp-dialog-close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: #9ca3af;
	padding: 0;
	line-height: 1;
}
.olymp-dialog-close:hover {
	color: #374151;
}
.olymp-dialog-body {}
.olymp-dialog-player {
	margin-bottom: 8px;
}
.olymp-dialog-table {
	width: 100%;
	border-collapse: collapse;
}
.olymp-dialog-table td {
	padding: 4px 8px;
	font-size: 13px;
	vertical-align: top;
}
.olymp-dialog-label {
	color: #6b7280;
	width: 40%;
	font-weight: 500;
}
.olymp-dialog-sep {
	border: none;
	border-top: 1px dashed #e5e7eb;
	margin: 12px 0;
}

/* Таблица дочерних матчей командного разряда в диалоге */
.team-match-dialog {
	max-width: 1040px; /* 40+100+140+300+160+300 + padding */
	max-height: 105vh;
	overflow-y: auto;
	padding-bottom: 14px;
}
.team-match-dialog-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.team-match-dialog-table th {
	background: #f3f4f6;
	padding: 6px 8px;
	text-align: left;
	font-weight: 600;
	font-size: 12px;
}
.team-match-dialog-table td {
	padding: 6px 8px;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: top;
	font-size: 13px;
}
.team-match-dialog-table tbody tr:hover td {
	background: #f3f4f6;
}
.tmd-n { width: 40px; text-align: center; }
.tmd-rank { width: 100px; }
.tmd-status { width: 140px; }
.tmd-team { width: 300px; }
.tmd-score { width: 160px; text-align: center; font-weight: 600; white-space: nowrap; }

/* Команды в мобильной версии диалога — показываем сверху */
.tmd-mobile-teams {
	display: none;
	margin-bottom: 12px;
	padding: 4px 0;
}
.tmd-mobile-team {
	font-size: 13px;
	margin: 3px 0;
}
.tmd-mobile-team span {
	font-weight: 600;
}

/* Мобильная: таблица → карточки матчей */
@media (max-width: 759px) {
	.team-match-dialog {
		max-width: 95vw;
	}
	.tmd-desktop-head { display: none; }
	.tmd-mobile-teams { display: block; }
	.team-match-dialog-table,
	.team-match-dialog-table tbody,
	.team-match-dialog-table tr,
	.team-match-dialog-table td {
		display: block;
		width: 100% !important;
	}
	.team-match-dialog-table tr {
		border-bottom: none;
		padding: 8px 0;
		margin-bottom: 0;
	}
	/* Разделитель над первой строкой — отделяет названия команд от матчей */
	.team-match-dialog-table tbody tr:first-child {
		border-top: 1px solid #ccc;
		padding-top: 12px;
		margin-top: 12px;
	}
	/* Разделители между матчами */
	.team-match-dialog-table tbody tr + tr {
		border-top: 1px solid #ccc;
		padding-top: 12px;
		margin-top: 12px;
	}
	.team-match-dialog-table td {
		border: none;
		padding: 2px 4px;
		font-size: 13px;
		text-align: left;
	}
	.team-match-dialog-table td::before {
		content: attr(data-label);
		font-weight: 600;
		display: inline-block;
		min-width: 110px;
	}
	.tmd-score {
		font-weight: 700;
	}
}
/*==================================================================
 * Стили страницы профиля игрока
 *==================================================================*/

/* --- Шапка и заголовок профиля --- */
.profile-page-header {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	margin-bottom: var(--space-lg);
}

.profile-page-title h1 {
	margin: 0;
	font-size: var(--font-size-xl);
}

.profile-page-title p {
	margin: 2px 0 0;
	color: var(--color-text-muted);
	font-size: var(--font-size-sm);
}

/* --- Сетка документов (больше не используется — документы в .card, но оставляем для обратной совместимости) --- */

.profile-doc-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: var(--space-sm);
}

/* --- Статус документа: правый край, крупнее, цветной --- */
.profile-doc-status {
	text-align: right;
	font-size: 15px;
	font-weight: 500;
}

.profile-doc-card-files {
	margin-top: var(--space-sm);
	font-size: var(--font-size-sm);
}

.profile-doc-card-files a {
	display: block;
	color: var(--color-primary);
}

.profile-doc-card-files a:hover {
	text-decoration: underline;
}

.profile-doc-field {
	display: block;
	font-size: var(--font-size-sm);
	margin-bottom: 2px;
}

.profile-doc-fields-view {
	margin-bottom: var(--space-sm);
}

/* --- Режим редактирования документа --- */
.profile-doc-card-edit .profile-doc-card-fields {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
	margin-bottom: var(--space-md);
}

.profile-doc-card-edit .profile-doc-card-fields .form-group {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.profile-doc-card-edit .profile-doc-card-fields .form-group label {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
	font-weight: 500;
}

.profile-doc-upload-section {
	border-top: 1px solid var(--color-border-light);
	padding-top: var(--space-sm);
	margin-bottom: var(--space-sm);
}

.profile-doc-upload-section-title {
	font-size: var(--font-size-sm);
	font-weight: 500;
	margin-bottom: var(--space-sm);
	color: var(--color-text-muted);
}

.profile-doc-file-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 8px;
	background: var(--color-bg-secondary);
	border-radius: var(--radius-sm);
	margin-bottom: 4px;
	font-size: var(--font-size-sm);
}

.profile-doc-file-item-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 70%;
	color: var(--color-primary);
	text-decoration: none;
}

.profile-doc-file-item-name:hover {
	text-decoration: underline;
}

.profile-doc-file-delete {
	color: var(--color-danger);
	cursor: pointer;
	background: none;
	border: none;
	font-size: var(--font-size-xs);
	padding: 2px 6px;
	border-radius: var(--radius-sm);
}

.profile-doc-file-delete:hover {
	background: var(--color-danger-bg);
}

.profile-doc-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: var(--space-xs);
	position: relative;
	overflow: hidden;
}

.profile-doc-file-input-hidden {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	cursor: pointer;
}

.profile-doc-card-actions {
	display: flex;
	justify-content: flex-end;
	gap: var(--space-sm);
	margin-top: var(--space-sm);
	padding-top: var(--space-sm);
	border-top: 1px solid var(--color-border-light);
}

/* --- Приоритеты (Drag & Drop) --- */
.profile-priority-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 60vh;
	overflow-y: auto;
	touch-action: none;
}

.profile-priority-block {
	display: flex;
	align-items: center;
	gap: var(--space-md);
	padding: var(--space-sm) var(--space-md);
	background: var(--color-bg-secondary);
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-md);
	cursor: grab;
	transition: box-shadow 0.2s, background 0.2s;
	user-select: none;
	touch-action: none;
}

.profile-priority-block:active {
	cursor: grabbing;
}

.profile-priority-block:hover {
	background: var(--color-bg-hover);
}

.profile-priority-block--dragging {
	opacity: 0.5;
	box-shadow: var(--shadow-md);
}

.profile-priority-block--over {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px var(--color-primary-light);
}

.profile-priority-block-num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--color-primary);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 600;
	font-size: var(--font-size-sm);
	flex-shrink: 0;
}

.profile-priority-block-info {
	flex: 1;
	min-width: 0;
}

.profile-priority-block-name {
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.profile-priority-block-meta {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}

.profile-priority-block-arrows {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex-shrink: 0;
}

.profile-priority-arrow {
	width: 24px;
	height: 24px;
	padding: 0;
	border: 1px solid var(--color-border-light);
	border-radius: var(--radius-sm);
	background: var(--color-bg);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--color-text);
	font-size: 12px;
	line-height: 1;
	transition: background 0.15s, border-color 0.15s;
}

.profile-priority-arrow:hover {
	background: var(--color-primary);
	color: #fff;
	border-color: var(--color-primary);
}

.profile-priority-arrow:disabled {
	opacity: 0.3;
	cursor: not-allowed;
	pointer-events: none;
}

.profile-priority-actions {
	display: flex;
	justify-content: flex-end;
	gap: var(--space-sm);
	margin-top: var(--space-lg);
}

/* --- Штрафы: дисквалификация --- */
.profile-penalty-disqual {
	background: var(--color-warning-bg);
}

.profile-penalty-disqual td {
	font-weight: 500;
}

/* --- Под-табы --- */
.profile-sub-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: var(--space-md);
	border-bottom: 1px solid var(--color-border-light);
}

.profile-sub-tab {
	padding: 6px 16px;
	border: none;
	background: none;
	cursor: pointer;
	font-size: var(--font-size-sm);
	color: var(--color-text-muted);
	border-bottom: 2px solid transparent;
	transition: all 0.2s;
}

.profile-sub-tab:hover {
	color: var(--color-primary);
}

.profile-sub-tab.profile-sub-tab--active {
	color: var(--color-primary);
	border-bottom-color: var(--color-primary);
}

/* --- Тело таба профиля --- */
.profile-tab-body {
	margin-top: var(--space-md);
}

/* --- Заголовок недели (заявки на турниры) --- */
.profile-week-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: var(--font-size-base);
	font-weight: 600;
	padding: var(--space-md);
	margin: var(--space-md) 0 var(--space-sm) 0;
	background: var(--color-bg-secondary);
	border-left: 3px solid var(--color-primary);
	border-radius: var(--radius-sm);
}

/* --- Подписи к данным в таблицах --- */
.desktop-sub {
	font-size: var(--font-size-xs);
	color: var(--color-text-muted);
}
.mobile-sub {
	display: none;
}

/* --- Блок «Доступные функции» в карточке турнира --- */
.tour-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.tour-card-actions-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.tour-card-actions-legend {
	cursor: pointer;
	font-size: 14px;
	opacity: 0.6;
	background: none;
	border: none;
	color: var(--color-text-muted);
}
.tour-card-actions-legend:hover {
	opacity: 1;
}
.tour-card-actions-empty {
	margin: 0;
}
.tour-card-files-links {
	white-space: normal;
}
.tour-card-file-link {
	color: var(--color-primary);
	text-decoration: none;
}
.tour-card-file-link:hover {
	text-decoration: underline;
}
.legend-available {
	color: var(--color-success);
	font-weight: 600;
}
.legend-unavailable {
	color: var(--color-text-muted);
}
.legend-submitted {
	color: var(--color-warning, #856404);
	font-weight: 600;
}
.legend-cancelled {
	color: var(--color-danger, #dc3545);
	font-weight: 600;
}

/* --- Мобильная адаптация --- */
@media (max-width: 759px) {
	.profile-page-header {
		flex-direction: column;
		text-align: center;
	}
}
