:root {
	--rad: 7px;
	--dur: .3s;
	--color-light: #fff;
	--color-brand: #57bd84;
	--font-fam: 'Lato', sans-serif;
	--height: 50px;
	--btn-width: 60px;
	--bez: cubic-bezier(0, 0, 0.43, 1.49);
	--rowSize: 36px;
	--background: #EEE;
	--resultColor: #666;
	--tableCol: #333;
	--hoverCol: #f5f5f5;
	--infoIconColor: #0060df;
	--headerCol: #777;
	--headerBorder: #cecece;
	--headerBG: #e5e5e5;
	--headerHoverBG: #f2f2f2;
	--tdBorder: 1px solid rgba(0,0,0,.1);
	--downloadBGVisited: rgb(240, 240, 240);
	--downloadBGVisitedHover: rgb(235, 235, 235);
	--exampleBG: rgba(0, 0, 0, 0.08);
	--exampleLinkBG: rgba(0, 80, 255, 0.1);
}

body {
	background: var(--background);
	font-family: Arial, Verdana, Helvetica, Geneva, sans-serif;
}

form {
	position: relative;
	margin: 25px auto;
    width: 100%;
    text-align: center;
}

form div {
	margin: 5px;
}

.spoilerSearch,
.infoBox,
#info {
	display: inline-block;
	background: var(--color-light);
	border-radius: var(--rad);
	font-size: 18px;
	position: relative;
	display: inline-block;
	height: var(--height);
	line-height: var(--height);
	vertical-align: middle;
}

.spoilerSearch label {
	cursor: pointer;
	padding-right: 50px;
	display: inline-block;
	padding-left: 14px;
}

.spoilerSearch input {
	width: 24px;
	height: 24px;
	position: absolute;
	right: 14px;
	top: calc(50% - 12px);
	margin: 0;
	cursor: pointer;
}

.searchContainer {
	font-size: 10px;
	width: 500px;
    max-width: calc(100% - 20px);
	background: var(--color-brand);
	border-radius: var(--rad);
	position: relative;
	display: inline-block;
	vertical-align: middle;
    text-align: left;
}
.searchContainer input,
button {
	box-sizing: border-box;
	height: var(--height);
	font-family: var(--font-fam);
	border: 0;
	color: var(--color-dark);
	font-size: 18px;
}
.searchContainer input[type="search"] {
	outline: 0;
	width: 100%;
	background: var(--color-light);
	padding: 0 16px;
	border-radius: var(--rad);
	appearance: none;
	transition: all var(--dur) var(--bez);
	transition-property: width, border-radius;
	z-index: 1;
	position: relative;
}

.searchContainer button {
	display: none;
	position: absolute;
	top: 0;
	right: 0;
	width: var(--btn-width);
	font-weight: bold;
	background: var(--color-brand);
	border-radius: 0 var(--rad) var(--rad) 0;
	cursor: pointer;
}

.searchContainer input:not(:placeholder-shown) {
	border-radius: var(--rad) 0 0 var(--rad);
	width: calc(100% - var(--btn-width));
	+ button {
	display: block;
	}
}

.searchContainer label {
	position: absolute;
	clip: rect(1px, 1px, 1px, 1px);
	padding: 0;
	border: 0;
	height: 1px;
	width: 1px;
	overflow: hidden;
}

.resultBox {
	text-align: center;
	color: var(--resultColor);
	margin: 30px auto;
	display: table;
}

.pageWrapper {
	margin: -120px auto 100px auto;
	display: table;
	flex-wrap: wrap;
	max-width: 90vw;
	font-size: 120%;
}

.resultBox .pageWrapper {
	margin: 16px auto 0 auto;
}

.pageWrapper>* {
	padding: 3px 4px;
	display: inline-block;
}

.resultBox h2 {
	margin: 0;
}

.tableWrapper {
	margin: 0 auto;
	margin-top: 15px;
	margin-bottom: 150px;
	width: fit-content;
	border: var(--tdBorder);
}

table {
	margin: 0;
	color: var(--tableCol);
	background: var(--color-light);
	font-size: 16px;
	border-collapse: collapse;
	line-height: 18px;
}

.sortable thead {
	position: sticky;
	top: 0;
	z-index: 1;
}

table thead th,
table tfoot th {
	color: var(--headerCol);
	background: var(--headerBG);
}

table caption {
	padding:.5em;
}

table th,
table td {
	overflow-wrap: break-word;
	padding: 4px 0.5em;
	border-bottom: var(--tdBorder);
	height: 37px;
	box-sizing: border-box;
	word-break: break-word;
}

table tr:hover td,
table tr:hover .dC a {
	background-color: var(--hoverCol);
}

table tr:hover .dC a:visited {
	background-color: var(--downloadBGVisitedHover);
}

table th {
	border-bottom-color: var(--headerBorder);
}

.dH {
  max-width: max(4vw, 38px);
  padding-left: 0;
}

.sortable th.eH {
	text-align: right !important;
}

.coH {
  max-width: 36px;
  padding-left: 0;
}

.tableWrapper svg {
	pointer-events: none;
	fill: currentColor;
	stroke: currentColor;
	width: 1em;
	height: 1em;
	stroke-width: 1.5;
	margin-left: auto;
}

.pC {
  	padding-right: 4px;
}

.eC {
	word-break: keep-all;
	text-align: right;
	padding-left: 0;
	color: #777;
	min-width: 44px;
}

.eC:empty {
	padding: 0;
	min-width: 0;
}

.mC a {
	max-width: 15em;
}

.daC {
	text-align: right;
	word-break: keep-all;
}

td.e {
	display: none;
}

.sortable th:not(:empty) {
	cursor: pointer;
	font-weight: normal;
	text-align: left;
	text-transform: capitalize;
	white-space: nowrap;
	padding-right: 0px;
}

.sortable th:not(:empty):hover {
	background: var(--headerHoverBG);
}


.sortable th:not(:empty):hover::after {
	color: inherit;
	font-size: 1.2em;
	content: '\025B8';
}

.sortable th:not(:empty)::after {
	font-size: 1.2em;
	color: transparent;
	content: '\025B8';
	width: 1em;
}

.sortable th.dir-d:not(:empty)::after {
	color: inherit;
	content: '\025BE';
}

.sortable th.dir-u:not(:empty)::after {
	color: inherit;
	content: '\025B4';
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

th.dH,
th.dtH {
	justify-content: end;
	text-align: right !important;
}

.coC, .mapIC {
	padding: 0;
	text-align: center;
}

.coC img, .mapIC img {
	vertical-align: bottom;
	object-fit: contain;
	width: var(--rowSize);
	height: var(--rowSize);
	pointer-events: none;
}

.coC, .playerList span {
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center center;
}

.playerList span {
	margin-right: 2px;
}

.mapIC img {
	width: auto;
	max-width: 100%;
	margin: 0 auto;
}

.mapIC {
	width: 50px;
	position: relative;
}

.dtC {
	white-space: nowrap;
}

.mapIC:hover img {
	position: absolute;
	top: 50%;
	left: 50%;
	width: auto;
	max-width: none;
	height: auto;
	z-index: 1;
	transform: translate(-50%, -50%) scale(2);
	image-rendering: pixelated;
}

.dC {
	padding: 0;
	border-right: var(--tdBorder);
	width: var(--rowSize);
	text-align: center;
	font-weight: bold;
	color: var(--headerCol);
}

.dC a {
	display: inline-block;
	width: var(--rowSize);
	height: var(--rowSize);
	background: white no-repeat center url(https://awbw.amarriner.com/terrain/divehide.gif);
	vertical-align: bottom;
	line-height: var(--rowSize);
}

.dC a:not(:empty) {
	background-image: none;
}

.dC a:visited {
	background-color: var(--downloadBGVisited);
}

.dC img {
	vertical-align: bottom;
}

td a {
	display: inline-flex;
	white-space: normal;
	vertical-align: middle;
	align-items: center;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.pC a {
	max-width: 200px;
	max-width: min(10vw, 200px);
	white-space: normal;
	vertical-align: middle;
	align-items: center;
}

.playerList {
	padding: 0 0.4em 0 0;
}

.playerList div {
	max-width: 400px;
	max-width: min(25vw, 400px);
	line-height: 24px;
	font-size: 16px;
	display: flex;
	flex-wrap: wrap;
	min-width: 100%;
	gap: 1%;
}

.playerList a {
	white-space: nowrap;
	flex-basis: 49.5%;
	width: 49.5%;
	overflow: clip;
	padding: 1px 0;
	text-overflow: ellipsis;
}

.playerList span {
	display: inline-block;
	vertical-align: bottom;
	height: 24px;
	width: 24px;
	min-width: 24px;
}

tbody tr:last-child td {
	border-bottom: none;
}

.showVictor .l, .showVictor .l a {
	text-decoration: line-through;
}

.infoBox svg {
	width: 32px;
	padding: 9px;
	cursor: pointer;
	fill: var(--infoIconColor);
}

#info {
	height: auto;
	line-height: 21pt;
	margin: 0 auto;
	max-width: 750px;
	display: table;
}

#info p {
	margin: 15px;
}

.example, .exampleLink {
	background: var(--exampleBG);
	padding: 3px 5px;
	border-radius: 5px;
	white-space: nowrap;
}

.exampleLink {
	background: var(--exampleLinkBG);
}



@media only screen and (max-width: 800px) {
	table th {
		display: flex;
		align-items: center;
		padding: 0;
	}

	table td, table th {
		border-bottom: 0;
	}

	.mapIC {
		min-height: var(--rowSize) !important;
		box-sizing: content-box !important;
	}

	tr {
		display: grid;
		grid-template-columns: 0fr 1fr 44px 0fr 1fr 44px 38px 100px;
	}

	td.playerList {
	    grid-column: span 6;
	}
/*
	tr>*:nth-child(1) { grid-area: dlButton; order: 1; grid-row: 1;}
	tr>*:nth-child(2) { grid-area: gameName; order: 2; grid-column: span 7; grid-row: 1;}
	tr>*:nth-child(3) { grid-area: mapImage; order: 9; grid-row: 3;}
	tr>*:nth-child(4) { grid-area: mapName; order: 10; grid-column: span 5; grid-row: 3;}
	tr>*:nth-child(5) { grid-area: co1; order: 3; grid-row: 2;}
	tr>*:nth-child(6) { grid-area: name1; order: 4; grid-column: span 2; grid-row: 2;}
	tr>*:nth-child(7) { grid-area: rating1; order: 5; grid-row: 2;}
	tr>*:nth-child(8) { grid-area: co2; order: 6; grid-row: 2;}
	tr>*:nth-child(9) { grid-area: name2; order: 7; grid-column: span 2; grid-row: 2;}
	tr>*:nth-child(10) { grid-area: rating2; order: 8; grid-row: 2;}
	tr>*:nth-child(11) { grid-area: days; order: 11; grid-row: 3;}
	tr>*:nth-child(12) { grid-area: date; order: 12; grid-row: 3;}*/

	tr>*:nth-child(1) { order: 1; grid-row: 1;}
	tr>*:nth-child(2) { order: 2; grid-row: 1; grid-column: span 4;}

	tr>*:nth-child(3) { order: 3; grid-row: 1;}
	tr>*:nth-child(4) { order: 4; grid-row: 1; grid-column: span 2;}

	tr>*:nth-child(5) { order: 5; grid-row: 2;}
	tr>*:nth-child(6) { order: 6; grid-row: 2;}
	tr>*:nth-child(7) { order: 7; grid-row: 2;}
	tr>*:nth-child(8) { order: 8; grid-row: 2;}
	tr>*:nth-child(9) { order: 9; grid-row: 2;}
	tr>*:nth-child(10) { order: 10; grid-row: 2;}
	tr>*:nth-child(11) { order: 11; grid-row: 2;}
	tr>*:nth-child(12) { order: 12; grid-row: 2;}

	/*
		grid-template-areas: 
			"dlButton gameName gameName gameName gameName gameName gameName gameName"
			"co1 name1 rating1 co2 name2 name2 name2 rating2"
			"mapImage mapName mapName mapName mapName days date date";
		grid-template-columns: 0fr 1fr 0fr 0fr 0.5fr 0fr 0.5fr 0fr;
		*/

	td {
		flex: 1;
		display: flex;
		align-items: center;
		height: auto !important;
	}

	td.dC {
		flex: 0;
        border-right: 0;
	}

	.pC {
		padding-top: 0;
		padding-bottom: 0;
	    max-height: calc(var(--rowSize) + 12px);
		align-items: baseline;
		overflow: hidden;
	}

	.coC {
	    min-height: calc(var(--rowSize) + 1px);
	}

	.pC a {
		max-width: none;
		min-width: 100%;
		margin: auto;
	}

	td.daC {
		flex: 0;
		min-width: 33px;
    	justify-content: flex-end;
	}

	td.eC {
		flex: 0;
    	justify-content: flex-end;
	}

	td.dtC {
    	justify-content: flex-end;
		flex: 0;
	}

	td.coC {
		min-width: var(--rowSize);
		width: var(--rowSize);
		flex: 0;
	}

	td.mapIC {
		flex: 0;
	}

	.tableWrapper table {
		--rowSize: 28px;
	}

	td.eC {
		width: 44px;
	}

	td.nC a,
	td.mC a {
		text-overflow: ellipsis;
		overflow: hidden;
		width: 100%;
		max-width: 100%;
		line-height: 28px;
		margin-top: -4px;
		margin-bottom: -4px;
	    word-break: break-all;
	    -webkit-line-clamp: 1;
	    line-clamp: 1;
	}

	th.eH,
	th.dH {
		padding-left: 0;
		flex: 0;
	}
	table .coC, table .pC, table .eC, table .daC, table .dtC,
	table .coH, table .plH, table .eH, table .dH, table .dtH,
	table .playerList {
		border-bottom: var(--tdBorder);
	}
}

@media only screen and (max-width: 550px) {
	table .coC, table .pC, table .eC, table .daC, table .dtC,
	table .coH, table .plH, table .eH, table .dH, table .dtH,
	table .playerList {
		border-bottom: 0;
	}

	.coC {
	    min-height: calc(var(--rowSize) + 4px);
	}

	tr {
		grid-template-columns: 0fr 1fr 38px 60px 44px 0fr 0fr 1fr 38px 60px 44px;
	}

	td.playerList {
	    grid-column: span 11;
		padding: 0;
	}

	td.nC {
		padding-right: 0;
	}

	td.mapIC {
		min-width: var(--rowSize);
		width: var(--rowSize);
	}

	tr>*:nth-child(1) { order: 1; grid-row: 1;}
	tr>*:nth-child(2) { order: 2; grid-row: 1; grid-column: span 10;}

	tr>*:nth-child(5) { order: 3; grid-row: 2;}
	tr>*:nth-child(6) { order: 4; grid-row: 2; grid-column: span 3;}
	tr>*:nth-child(7) { order: 5; grid-row: 2;}
	tr>*:nth-child(8) { order: 6; grid-row: 2;}
	tr>*:nth-child(9) { order: 7; grid-row: 2; grid-column: span 4;}
	tr>*:nth-child(10) { order: 8; grid-row: 2;}

	tr>*:nth-child(3) { order: 9; grid-row: 3;}
	tr>*:nth-child(4) { order: 10; grid-row: 3; grid-column: span 7;}
	tr>*:nth-child(11) { order: 11; grid-row: 3;}
	tr>*:nth-child(12) { order: 12; grid-row: 3; grid-column: span 2;}

	table .mC, table .mapIC, table .daC, table .dtC,
	table .mH, table .mapIH, table .dH, table .dtH {
		border-bottom: var(--tdBorder);
	}
}