/*
 * UKV legacy responsive compatibility layer.
 *
 * This file is intentionally shared by every public regional template. Keep
 * desktop rules conservative and place layout changes behind media queries so
 * the existing wide-screen presentation remains stable.
 */

html {
	-webkit-text-size-adjust: 100%;
	-ms-text-size-adjust: 100%;
}

html,
body,
#page-bg,
#mainbody {
	max-width: 100%;
}

body {
	min-width: 0;
}

div.wrapper,
td.leftcol,
td.maincol,
td.rightcol,
td.leftcol .padding,
td.maincol .padding,
td.rightcol .padding,
#content-padding {
	box-sizing: border-box;
}

td.maincol,
td.leftcol,
td.rightcol {
	min-width: 0;
}

td.maincol img,
td.leftcol img,
td.rightcol img,
#banner img,
.contentpaneopen img,
.blog img {
	max-width: 100%;
	height: auto;
	box-sizing: border-box;
}

td.maincol iframe,
td.maincol object,
td.maincol embed,
td.maincol video {
	max-width: 100%;
}

td.maincol pre,
td.maincol code {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

td.maincol input,
td.maincol select,
td.maincol textarea,
td.maincol button {
	max-width: 100%;
	box-sizing: border-box;
}

/* JavaScript adds this wrapper around data tables without changing the table. */
.ukv-table-scroll {
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	box-sizing: border-box;
}

.ukv-table-scroll:focus {
	outline: 2px solid #36678a;
	outline-offset: 2px;
}

.ukv-table-scroll > table {
	margin-left: 0;
	margin-right: 0;
}

td.rightcol img.ukv-ranking-team-logo {
	display: inline-block !important;
	width: 40px !important;
	height: 40px !important;
	max-width: 40px !important;
	max-height: 40px !important;
	object-fit: contain;
	object-position: center;
	vertical-align: middle;
}

#ukv-mobile-navigation {
	display: none;
}

.ukv-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@media screen and (max-width: 900px) {
	body,
	body.f-default,
	body.f-larger,
	body#ff-optima,
	body#ff-georgia {
		font-size: 15px;
		line-height: 1.5;
	}

	div.wrapper,
	#mainbody.wrapper {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	#top-bar,
	#mod-login {
		height: auto;
		min-height: 0;
	}

	#header {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		height: auto !important;
		min-height: 76px;
		padding: 6px 10px;
		overflow: hidden;
		box-sizing: border-box;
	}

	#header > a.nounder {
		display: block;
		flex: 1 1 380px;
		max-width: 700px;
		min-width: 0;
	}

	img#logo {
		display: block;
		width: 100% !important;
		max-width: 700px !important;
		height: 76px !important;
		margin: 0 auto !important;
		background-position: center !important;
		background-size: contain !important;
		background-repeat: no-repeat !important;
	}

	#banner {
		flex: 1 1 260px;
		width: auto;
		max-width: 100%;
		height: auto !important;
		min-height: 0;
		overflow: visible;
	}

	#banner .moduletable > div,
	#banner .moduletable > div[align="center"] {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		gap: 6px;
	}

	#banner img {
		width: auto !important;
		max-width: 31% !important;
		max-height: 56px;
		margin: 3px !important;
	}

	#main-shadow,
	#main-shadow2,
	.side-shadow1,
	.side-shadow2,
	#bottom-shadow1,
	#bottom-shadow2 {
		margin-left: 0 !important;
		margin-right: 0 !important;
		background-image: none !important;
	}

	#main-content {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	html.ukv-responsive-js #ukv-mobile-navigation {
		display: block;
		position: relative;
		z-index: 50;
		margin: 0 8px 8px;
	}

	#ukv-mobile-menu-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		width: 100%;
		min-height: 48px;
		padding: 10px 16px;
		border: 1px solid #244966;
		border-radius: 4px;
		background: #36678a;
		color: #fff;
		font: 700 16px/1.2 Arial, sans-serif;
		cursor: pointer;
		box-sizing: border-box;
	}

	#ukv-mobile-menu-toggle:hover,
	#ukv-mobile-menu-toggle:focus {
		background: #244966;
		outline: 2px solid #fff;
		outline-offset: -4px;
	}

	.ukv-menu-toggle-icon {
		display: inline-flex;
		flex-direction: column;
		gap: 4px;
		width: 22px;
	}

	.ukv-menu-toggle-icon span {
		display: block;
		width: 22px;
		height: 2px;
		background: currentColor;
		transition: transform 0.15s ease, opacity 0.15s ease;
	}

	html.ukv-menu-open .ukv-menu-toggle-icon span:first-child {
		transform: translateY(6px) rotate(45deg);
	}

	html.ukv-menu-open .ukv-menu-toggle-icon span:nth-child(2) {
		opacity: 0;
	}

	html.ukv-menu-open .ukv-menu-toggle-icon span:last-child {
		transform: translateY(-6px) rotate(-45deg);
	}

	#ukv-mobile-menu-panel {
		display: none;
		max-height: 72vh;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		margin-top: 4px;
		padding: 8px;
		border: 1px solid #c5d1da;
		border-radius: 4px;
		background: #fff;
		box-shadow: 0 5px 16px rgba(0, 0, 0, 0.2);
		box-sizing: border-box;
	}

	html.ukv-menu-open #ukv-mobile-menu-panel {
		display: block;
	}

	#ukv-mobile-menu-panel ul,
	#ukv-mobile-menu-panel li {
		position: static !important;
		display: block !important;
		float: none !important;
		width: auto !important;
		height: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		list-style: none !important;
		background-image: none !important;
	}

	#ukv-mobile-menu-panel ul ul {
		padding-left: 16px !important;
	}

	#ukv-mobile-menu-panel a,
	#ukv-mobile-menu-panel a:visited {
		display: block !important;
		float: none !important;
		width: auto !important;
		height: auto !important;
		min-height: 44px;
		padding: 11px 12px !important;
		border-bottom: 1px solid #e1e6ea;
		background: transparent !important;
		color: #163b59 !important;
		font: 600 15px/1.45 Arial, sans-serif !important;
		white-space: normal !important;
		text-decoration: none !important;
		box-sizing: border-box;
	}

	#ukv-mobile-menu-panel a:hover,
	#ukv-mobile-menu-panel a:focus {
		background: #eef5fa !important;
		color: #001d30 !important;
		text-decoration: underline !important;
	}

	html.ukv-responsive-js #iefix {
		display: none;
	}

	html.ukv-responsive-js td.leftcol #sub-menu {
		display: none;
	}

	table.mainbody,
	table.mainbody > tbody {
		display: block;
		width: 100%;
		max-width: 100%;
	}

	table.mainbody > tbody > tr,
	table.mainbody > tr {
		display: flex;
		flex-direction: column;
		width: 100%;
		max-width: 100%;
	}

	table.mainbody td.maincol,
	table.mainbody td.leftcol,
	table.mainbody td.rightcol {
		display: block;
		width: 100% !important;
		max-width: 100%;
	}

	table.mainbody td.maincol {
		order: 1;
	}

	table.mainbody td.leftcol {
		order: 2;
	}

	table.mainbody td.rightcol {
		order: 3;
	}

	td.maincol .padding,
	td.leftcol .padding,
	td.rightcol .padding {
		padding: 14px 12px;
	}

	#content-padding {
		padding: 0 2px;
	}

	.spacer .block,
	.spacer.w99 .block,
	.spacer.w49 .block,
	.spacer.w33 .block,
	.spacer.w24 .block {
		float: none;
		width: 100% !important;
	}

	.contentheading,
	.componentheading {
		overflow-wrap: anywhere;
	}

	.contentpaneopen,
	.blog {
		max-width: 100%;
	}

	.ukv-table-scroll {
		margin: 8px 0 14px;
		padding-bottom: 4px;
	}

	#joomleague,
	#joomleague .jl-club-page,
	#joomleague form {
		width: 100%;
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}

	#joomleague input[type="text"],
	#joomleague input[type="password"],
	#joomleague input[type="email"],
	#joomleague input[type="date"],
	#joomleague select,
	#joomleague textarea {
		max-width: 100%;
		box-sizing: border-box;
	}

	#bottom .padding {
		padding-left: 12px;
		padding-right: 12px;
	}
}

/* Player profile: photo and metadata remain side by side until phone width. */
@media screen and (max-width: 760px) {
	table.ukv-player-profile-table {
		table-layout: auto;
	}

	table.ukv-player-profile-table tr.ukv-player-profile-row {
		display: flex;
		flex-wrap: wrap;
		align-items: flex-start;
		gap: 14px;
		width: 100%;
	}

	table.ukv-player-profile-table tr.ukv-player-profile-row > td {
		display: block;
		width: auto !important;
		padding: 0 !important;
		box-sizing: border-box;
	}

	table.ukv-player-profile-table td.ukv-player-profile-photo {
		flex: 1 1 220px;
		max-width: 300px;
		margin: 0 auto;
	}

	table.ukv-player-profile-table td.ukv-player-profile-photo img {
		width: auto !important;
		max-width: 100% !important;
		height: auto !important;
		margin: 0 auto !important;
	}

	table.ukv-player-profile-table td.ukv-player-profile-details {
		flex: 2 1 330px;
		min-width: 0;
	}

	table.ukv-player-details {
		width: 100% !important;
		table-layout: auto;
	}
}

@media screen and (max-width: 520px) {
	table.ukv-player-profile-table tr.ukv-player-profile-row {
		display: block;
	}

	table.ukv-player-profile-table tr.ukv-player-profile-row > td {
		width: 100% !important;
		max-width: 100%;
		margin-bottom: 14px;
	}

	table.ukv-player-details tr {
		display: block;
		padding: 7px 0;
		border-bottom: 1px solid #e2e6e9;
	}

	table.ukv-player-details td {
		display: block;
		width: 100% !important;
		padding: 1px 4px !important;
		box-sizing: border-box;
	}
}

/* The current beach rating becomes a readable card list on phones/tablets. */
@media screen and (max-width: 760px) {
	.ukv-rating-tools,
	.ukv-rating-no-results,
	.ukv-current-rating-calc-spoiler {
		width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.ukv-rating-filter-label {
		display: block !important;
		margin: 0 0 6px !important;
	}

	.ukv-rating-filter-input {
		width: 100% !important;
		max-width: 100% !important;
		min-height: 44px;
	}

	table.ukv-rating-group,
	table.ukv-rating-group > tbody {
		display: block;
		width: 100% !important;
		max-width: 100%;
		margin: 0 0 16px !important;
		border-collapse: separate;
	}

	table.ukv-rating-group > tbody > tr:first-child,
	table.ukv-rating-group > tr:first-child {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		min-height: 44px;
		background: #dcdcdc;
		box-sizing: border-box;
	}

	table.ukv-rating-group > tbody > tr:first-child > th,
	table.ukv-rating-group > tr:first-child > th {
		display: none;
		width: auto !important;
		padding: 8px 12px;
		background: transparent !important;
		box-sizing: border-box;
	}

	table.ukv-rating-group > tbody > tr:first-child > th:first-child,
	table.ukv-rating-group > tr:first-child > th:first-child,
	table.ukv-rating-group > tbody > tr:first-child > th:last-child,
	table.ukv-rating-group > tr:first-child > th:last-child {
		display: block;
	}

	table.ukv-rating-group > tbody > tr:first-child > th:first-child,
	table.ukv-rating-group > tr:first-child > th:first-child {
		background: #ffd700 !important;
	}

	table.ukv-rating-group > tbody > tr:first-child h3,
	table.ukv-rating-group > tr:first-child h3 {
		margin: 0;
		padding: 0;
		font-size: 20px;
	}

	table.ukv-rating-group tr.ukv-rating-player-row {
		display: grid;
		grid-template-columns: 104px minmax(0, 1fr);
		grid-template-rows: auto auto auto;
		gap: 5px 12px;
		width: 100%;
		padding: 12px;
		border: 1px solid #d5dde3;
		border-top: 0;
		background: #fff;
		box-sizing: border-box;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td {
		display: block;
		width: auto !important;
		padding: 0 !important;
		text-align: left !important;
		box-sizing: border-box;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:first-child {
		display: none;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(2) {
		grid-column: 1;
		grid-row: 1 / 4;
		align-self: start;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(2) img {
		display: block;
		width: 104px !important;
		max-width: 104px !important;
		height: 132px !important;
		object-fit: cover;
		object-position: center top;
		border-radius: 4px;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) {
		grid-column: 2;
		grid-row: 1;
		align-self: center;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) > a > div > div:first-child,
	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) > div > div:first-child {
		font-size: 21px !important;
		line-height: 1.15 !important;
		overflow-wrap: anywhere;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) > a > div > div:last-child,
	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) > div > div:last-child {
		font-size: 16px !important;
		line-height: 1.25 !important;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(4) {
		grid-column: 2;
		grid-row: 2;
		align-self: center;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(4) img.ukv-badge {
		width: auto !important;
		max-width: 72px !important;
		height: auto !important;
		max-height: 52px !important;
		margin: 2px 4px 2px 0 !important;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(5) {
		grid-column: 2;
		grid-row: 3;
		align-self: end;
		font-weight: 700;
		color: #1f3f6d;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(5)::before {
		content: "Рейтинг: ";
		font-size: 15px;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(5) font {
		font-size: 22px !important;
	}
}

@media screen and (max-width: 480px) {
	#header {
		padding: 4px 8px;
	}

	img#logo {
		height: 62px !important;
	}

	#banner {
		flex-basis: 100%;
	}

	#banner img {
		max-height: 46px;
	}

	td.maincol .padding,
	td.leftcol .padding,
	td.rightcol .padding {
		padding: 11px 8px;
	}

	.contentheading {
		font-size: 23px;
		line-height: 1.2;
	}

	.componentheading {
		font-size: 21px;
		line-height: 1.2;
	}

	table.ukv-rating-group tr.ukv-rating-player-row {
		grid-template-columns: 82px minmax(0, 1fr);
		gap: 4px 9px;
		padding: 10px;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(2) img {
		width: 82px !important;
		max-width: 82px !important;
		height: 108px !important;
	}

	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) > a > div > div:first-child,
	table.ukv-rating-group tr.ukv-rating-player-row > td:nth-child(3) > div > div:first-child {
		font-size: 18px !important;
	}
}

@media print {
	#ukv-mobile-navigation {
		display: none !important;
	}

	.ukv-table-scroll {
		overflow: visible !important;
	}
}
