/*** ТАБЛИЦЫ — общий вид для сайта и для страниц KazPIN (iframe) ***/
/* подключается и в style.php сайта, и в шаблонах KazPIN — поэтому все таблицы выглядят одинаково */

table {border-spacing: 0;border-collapse: collapse;}
td, th {padding: 0;}
.table-scroll {display: block;width: 100%;overflow: auto;overflow-y: hidden;-webkit-overflow-scrolling: touch;}

/* ---------- базовая таблица Bootstrap 5 (.table) ----------
   Bootstrap красит ячейки через свои переменные (--bs-table-*), поэтому цвета задаём ими:
   так работают и table-striped, и table-hover */
.table {
	--tbl-head-bg: #e9ecf1;
	--tbl-border: #dfe3e8;
	--tbl-stripe: #f3f4f7;
	--tbl-hover: #eceff4;

	--bs-table-bg: #fff;
	--bs-table-color: var(--color-black, #111);
	--bs-table-striped-bg: var(--tbl-stripe);
	--bs-table-striped-color: var(--color-black, #111);
	--bs-table-hover-bg: var(--tbl-hover);
	--bs-table-hover-color: var(--color-black, #111);
	--bs-table-border-color: var(--tbl-border);
	width: 100%;
	max-width: 100%;
	margin-bottom: 1.25rem;
	font-size: 0.875rem;
}
.table > :not(caption) > * > * {padding: 0.75rem 0.5rem;vertical-align: middle;}
/* шапка — светлая плашка, жирный текст; длинные заголовки переносятся */
.table > thead {--bs-table-bg: var(--tbl-head-bg);}
.table > thead > tr > th, .table > thead > tr > td {color: #000;font-size: 0.8125rem;font-weight: 700;line-height: 1.15;white-space: normal;vertical-align: middle;}
.table > thead a {color: inherit;text-decoration: none;}
.table > thead nobr {white-space: nowrap;}
/* сетка у .table-bordered */
.table-bordered > :not(caption) > * > * {border: 1px solid var(--tbl-border) !important;}
/* таблица в обёртке с прокруткой — скруглённые углы, без нижнего отступа */
:is(.table-scroll, .table-responsive) {border-radius: 0.5rem;}
:is(.table-scroll, .table-responsive) > .table {margin-bottom: 0;}

/* ---------- матчи: колонки сетов ---------- */
.table tr td.mt_state {width: 5%;text-align: center;vertical-align: middle;}
.table tr td.mt_state img {width: 22px;}
.table tr td.mt_player {text-align: left;vertical-align: middle;min-width: 120px;}
.table tr td.mt_set {width: 10%;text-align: center;vertical-align: middle;min-width: 100px;}
.table tr td.mt_set2 {width: 20%;text-align: center;vertical-align: middle;min-width: 200px;}
.table tr td.mt_set3 {width: 30%;text-align: center;vertical-align: middle;min-width: 300px;}
.table tr.win td.mt_player {font-weight: bold;}
.table tr th.mt_set {text-align: center;}

@media screen and (max-width: 1199px) {
	.table tr td.mt_set {min-width: 95px;}
	.table tr td.mt_set2 {min-width: 190px;}
	.table tr td.mt_set3 {min-width: 285px;}
}
@media screen and (max-width: 991px) {
	.table tr td.mt_set {min-width: 80px;}
	.table tr td.mt_set2 {min-width: 160px;}
	.table tr td.mt_set3 {min-width: 240px;}
}
@media screen and (max-width: 767px) {
	.table tr td.mt_set {min-width: 65px;}
	.table tr td.mt_set2 {min-width: 130px;}
	.table tr td.mt_set3 {min-width: 195px;}
}
@media screen and (max-width: 575px) {
	.table tr td.mt_player {font-size: 12px;}
	.table tr td.mt_set {min-width: 50px;font-size: 12px;}
	.table tr td.mt_set2 {min-width: 100px;}
	.table tr td.mt_set3 {min-width: 150px;}
	.table tr td.mt_state img {width: 16px;}
}
@media screen and (max-width: 499px) {
	.table tr td.mt_set {min-width: 30px;}
	.table tr td.mt_set2 {min-width: 70px;}
	.table tr td.mt_set3 {min-width: 105px;}
}

/* ---------- .table-sportcms: тот же базовый вид + свои элементы ---------- */
.table-sportcms > tbody > tr > td, .table-sportcms > tfoot > tr > td {white-space: nowrap;}
.table-sportcms > tbody > tr > td.wrap, .table-sportcms > tfoot > tr > td.wrap, .table-sportcms > thead > tr > td.wrap {white-space: normal;}
.table-sportcms > tbody > tr > td.border-right {border-right: 1px solid transparent !important;}

/* обрезка длинного текста с затуханием — цвет берём от фона строки */
.table-sportcms td.nowrap {position: relative;overflow: hidden;white-space: nowrap;}
.table-sportcms td.nowrap::after {content: '';position: absolute;top: 0;right: 0;width: 30px;height: 100%;background: linear-gradient(to right, transparent, #fff);}
.table-sportcms.table-striped > tbody > tr:nth-of-type(odd) > td.nowrap::after {background: linear-gradient(to right, transparent, var(--tbl-stripe));}
.table-sportcms.table-hover > tbody > tr:hover > td.nowrap::after {background: linear-gradient(to right, transparent, var(--tbl-hover));}

/* ссылки в ячейках — цветом темы */
.table td a {color: var(--theme-color-text, var(--theme-color));text-decoration: none;transition: color .2s ease;}
.table td a:hover {color: color-mix(in srgb, var(--theme-color-text, var(--theme-color)) 75%, #000);text-decoration: underline;text-underline-offset: 0.15em;}

/* текущая команда / игрок */
.table-sportcms > tbody > tr.current > td, .table-sportcms > tbody > tr.current > td a, .table-sportcms > tbody > tr.current > td span {color: var(--theme-color) !important;font-weight: bold;}
.table-sportcms > tbody > tr.current > td {--bs-table-bg-state: color-mix(in srgb, var(--theme-color) 8%, #fff);}
.table-sportcms > tbody > tr > td .team .current, .table-sportcms > tbody > tr > td .team .current a {color: var(--theme-color);}
.table-sportcms > tbody > tr.line > td {border-bottom: 2px solid var(--theme-color) !important;}

/* содержимое ячеек */
.table-sportcms td .person, .table-sportcms td .team {font-size: 0.8125rem;line-height: 1.4;}
.table-sportcms td .city {color: var(--color-gray, #777);font-size: 0.75rem;line-height: 1.25;}
.table-sportcms .result {font-size: 0.8125rem;line-height: 1;}
.table-sportcms .result b {color: var(--theme-color);font-weight: 700;}
.table-sportcms .result a {text-decoration: none;border-bottom: 1px dotted rgba(0,0,0,.3);}
.table-sportcms .result .overtime {vertical-align: super;font-size: 0.6875rem;}
.plusminus {color: #777;font-size: 0.6875rem;line-height: 1.1;}
.plusminus.win {color: #0b0;vertical-align: super;}
.plusminus.lose {color: #e00;vertical-align: sub;}
.table-sportcms .logo-team {width: 40px;}
.table-sportcms .logo-team img {margin: 0 auto;}
table .table-sportcms.small, .table-sportcms.small > tbody > tr > td {font-size: 0.75rem !important;}

/* ограничения ширины колонок */
.table-sportcms .w5 {max-width: 5px;}
.table-sportcms .w10 {max-width: 10px;}
.table-sportcms .w15 {max-width: 15px;}
.table-sportcms .w20 {max-width: 20px;}
.table-sportcms .w25 {max-width: 25px;}
.table-sportcms .w30 {max-width: 30px;}
.table-sportcms .w35 {max-width: 35px;}
.table-sportcms .w40 {max-width: 40px;}
.table-sportcms .w45 {max-width: 45px;}
.table-sportcms .w50 {max-width: 50px;}
.table-sportcms .w55 {max-width: 55px;}
.table-sportcms .w60 {max-width: 60px;}
.table-sportcms .w65 {max-width: 65px;}
.table-sportcms .w70 {max-width: 70px;}
.table-sportcms .w75 {max-width: 75px;}
.table-sportcms .w80 {max-width: 80px;}
.table-sportcms .w85 {max-width: 85px;}
.table-sportcms .w90 {max-width: 90px;}
.table-sportcms .w95 {max-width: 95px;}
.table-sportcms .w100 {max-width: 100px;}
.table-sportcms .w105 {max-width: 105px;}
.table-sportcms .w110 {max-width: 110px;}
.table-sportcms .w115 {max-width: 115px;}
.table-sportcms .w120 {max-width: 120px;}
.table-sportcms .w125 {max-width: 125px;}
.table-sportcms .w130 {max-width: 130px;}
.table-sportcms .w135 {max-width: 135px;}
.table-sportcms .w140 {max-width: 140px;}
.table-sportcms .w145 {max-width: 145px;}
.table-sportcms .w150 {max-width: 150px;}
.table-sportcms .w155 {max-width: 155px;}
.table-sportcms .w160 {max-width: 160px;}
.table-sportcms .w165 {max-width: 165px;}
.table-sportcms .w170 {max-width: 170px;}
.table-sportcms .w175 {max-width: 175px;}
.table-sportcms .w180 {max-width: 180px;}
.table-sportcms .w185 {max-width: 185px;}
.table-sportcms .w190 {max-width: 190px;}
.table-sportcms .w195 {max-width: 195px;}
.table-sportcms .w200 {max-width: 200px;}
.table-sportcms .w205 {max-width: 205px;}
.table-sportcms .w210 {max-width: 210px;}
.table-sportcms .w215 {max-width: 215px;}
.table-sportcms .w220 {max-width: 220px;}
.table-sportcms .w225 {max-width: 225px;}
.table-sportcms .w230 {max-width: 230px;}
.table-sportcms .w235 {max-width: 235px;}
.table-sportcms .w240 {max-width: 240px;}
.table-sportcms .w245 {max-width: 245px;}
.table-sportcms .w250 {max-width: 250px;}
.table-sportcms .w255 {max-width: 255px;}
.table-sportcms .w260 {max-width: 260px;}
.table-sportcms .w265 {max-width: 265px;}
.table-sportcms .w270 {max-width: 270px;}
.table-sportcms .w275 {max-width: 275px;}
.table-sportcms .w280 {max-width: 280px;}
.table-sportcms .w285 {max-width: 285px;}
.table-sportcms .w290 {max-width: 290px;}
.table-sportcms .w300 {max-width: 300px;}
.table-sportcms .w310 {max-width: 310px;}
.table-sportcms .w320 {max-width: 320px;}
.table-sportcms .w330 {max-width: 330px;}
.table-sportcms .w340 {max-width: 340px;}
.table-sportcms .w350 {max-width: 350px;}
.table-sportcms .w360 {max-width: 360px;}
.table-sportcms .w370 {max-width: 370px;}
.table-sportcms .w380 {max-width: 380px;}
.table-sportcms .w390 {max-width: 390px;}
.table-sportcms .w400 {max-width: 400px;}
.table-sportcms .w410 {max-width: 410px;}
.table-sportcms .w420 {max-width: 420px;}
.table-sportcms .w430 {max-width: 430px;}
.table-sportcms .w440 {max-width: 440px;}
.table-sportcms .w450 {max-width: 450px;}
.table-sportcms .w460 {max-width: 460px;}
.table-sportcms .w470 {max-width: 470px;}
.table-sportcms .w480 {max-width: 480px;}
.table-sportcms .w490 {max-width: 490px;}
.table-sportcms .w500 {max-width: 500px;}
.table-sportcms .w510 {max-width: 510px;}
.table-sportcms .w520 {max-width: 520px;}
.table-sportcms .w530 {max-width: 530px;}
.table-sportcms .w540 {max-width: 540px;}
.table-sportcms .w550 {max-width: 550px;}
.table-sportcms .w560 {max-width: 560px;}
.table-sportcms .w570 {max-width: 570px;}
.table-sportcms .w580 {max-width: 580px;}
.table-sportcms .w590 {max-width: 590px;}
.table-sportcms .w600 {max-width: 600px;}
.table-sportcms .w610 {max-width: 610px;}
.table-sportcms .w620 {max-width: 620px;}
.table-sportcms .w630 {max-width: 630px;}

/* фото в таблице */
.table-sportcms .photo_person {height: 50px;overflow: hidden;border-radius: 50px;}
.table-sportcms .photo_person .img {transform: scale(1.5, 1.5);margin-top: 20px;}

/* цветные метки строк (зоны турнирной таблицы) */
.table-sportcms > tbody > tr.left-green > td:nth-child(1) {border-right: 4px solid #7ca541 !important;}
.table-sportcms > tbody > tr.line-green > td {border-bottom: 2px solid #7ca541 !important;}
.table-sportcms > tbody > tr.left-yellow > td:nth-child(1) {border-right: 4px solid #f8c027 !important;}
.table-sportcms > tbody > tr.line-yellow > td {border-bottom: 2px solid #f8c027 !important;}
.table-sportcms > tbody > tr.left-light-red > td:nth-child(1) {border-right: 4px solid #ee999d !important;}
.table-sportcms > tbody > tr.line-light-red > td {border-bottom: 2px solid #ee999d !important;}
.table-sportcms > tbody > tr.left-red > td:nth-child(1) {border-right: 4px solid #d51d29 !important;}
.table-sportcms > tbody > tr.line-red > td {border-bottom: 2px solid #d51d29 !important;}
.table-sportcms > tbody > tr.grey > td {opacity: .7;}
.table-sportcms > tbody > tr.grey > td .inout {opacity: 1;}

/* составы */
.table-sportcms > tbody > tr.start > td.person {font-weight: bold;}
.table-sportcms > tbody > tr.coach > td {--bs-table-bg-state: #fff;}
.table-sportcms > tbody > tr.coach.head > td.person {font-weight: bold;}
.table-sportcms > tbody > tr > td div.person {position: relative;width: 100%;padding-right: 30px;}
.table-sportcms > tbody > tr > td div.person .inout {position: absolute;top: 0;right: 0;z-index: 10;}
.table-sportcms > tbody > tr > td div.person .inout span {padding-left: 5px;}
.table-sportcms > tbody > tr > td div.person .inout ._in {color: #3aa847;}
.table-sportcms > tbody > tr > td div.person .inout ._out {color: #de131b;}
i.home, i.guest {color: #353535;}

/* итоги */
.table-sportcms > tbody > tr.leaders > td {padding: 0.75rem 0.5rem;}
.table-sportcms > tbody > tr.total > td {padding: 0.625rem 0;font-weight: bold;}
.table-sportcms > tbody > tr.total > td.title {padding: 0.625rem;}

.hidden-whatgames, .hidden-location {display: none;}

/* ---------- кнопки-переключатели над таблицей ---------- */
.btn-group {position: relative;display: inline-block;vertical-align: middle;}
.btn-group > .btn {position: relative;float: left;}
.btn-param {width: 305px;padding-bottom: 0.625rem;}
.btn-param button {width: 95px;margin: 0 auto;padding: 0.375rem 0.25rem;border: 0;border-radius: 0.375rem;background: var(--gray2, #efeeee);color: var(--theme-color);font-size: 0.8125rem;font-weight: 700;text-transform: uppercase;cursor: pointer;outline: 0;transition: background-color .2s ease, color .2s ease;}
.btn-param button.all {margin-right: 0.625rem;}
.btn-param button.prev, .btn-param button.guest {margin-left: 0.625rem !important;}
.btn-param button:hover {background: rgba(0,0,0,.08);}
.btn-param button.active, .btn-param button.active:focus, .btn-param button.active:hover {background: var(--ktf-color);color: var(--theme-color);}

/* ---------- информация о матче ---------- */
.mt-match-info {padding: 0.625rem 0;border-right: 1px solid #eee;font-size: 0.875rem;text-align: center;}
.mt-match-info__title {padding-bottom: 0.3125rem;color: var(--color-gray, #888);font-weight: bold;}
.mt-match-info__title i {padding-right: 0.625rem;color: var(--theme-color);}
.row .mt-match-info:last-child {border-right: 0;}
.mt-match {display: flex;justify-content: center;align-items: center;margin: 1rem 0 !important;border-top: 1px solid #eee;border-bottom: 1px solid #eee;}
.mt-match .mt-match-info {float: none;}

@media screen and (max-width: 767px) {
	.mt-match-info {border-right: 0;border-bottom: 1px solid #eee;}
	.mt-match-info:last-child {border-bottom: 0;}
	.mt-match {flex-direction: column;border-bottom: 0;}
}

@media (prefers-reduced-motion: reduce) {
	.table td a {transition: none !important;}
}