/* global vars */
:root {
	--color-announce: steelblue;
	--color-playerName-out: #d7d7d7;
	--color-playerName-in: #e6e8e9;
	--color-score-out: #b6b6b6;
	--color-score-in: #e6e8e9;
	--color-game-out: #6d6d6d;
	--color-game-in: #44484d;
	--color-timer: cornflowerblue;
	}

body {
	font-family: Arial, Helvetica, sans-serif;
}

.liveScoreTable {
	font-size: clamp(2dvw, 2dvw, 3dvw);
	line-height: 1.2em;
	border-collapse: collapse;
	white-space: nowrap;
	}

.liveScoreTable td {
	vertical-align: middle;
	}

.fullWidth {
	width: 100%;
	}

.score {
	position: relative;
	overflow: hidden;
	background: linear-gradient(to bottom, var(--color-score-out), var(--color-score-in) 50%, var(--color-score-out));
	font-weight: 900;
	min-width: 2dvw;
	}

/* overlay for animation */
.score::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-announce);
    opacity: 0;
    transition: opacity 1s ease-in-out;
    border-radius: inherit;
}

/* class to start animation */
.score.bgFadeInOut::after {
    opacity: 0.4;
}

.logo {
	height: max(6dvw, 7dvh);
	}

.logo-bg {
    text-align: center;
    vertical-align: middle;
	background: linear-gradient(to bottom, #fff, #dcdcdc 50%, #fff);
    padding: 1px;
	}

.bottom-element {
	position: fixed;
	bottom: 2.5dvh;
	left: 50%;
	transform: translateX(-50%);
	max-width: 80%;
	z-index: 100;
	}

.hidden {
	visibility: hidden;
	}

.announcement {
	font-size: 1.5dvw;
	font-weight: bold;
	color: var(--color-announce);
	background: linear-gradient(to right, transparent, var(--color-playerName-out) 20%, var(--color-playerName-out) 80%, transparent);
	padding: 0.5dvw 7dvw;
	}

.tdAnnouncement {
	text-align: center;
	}

.tdAnnouncementBig {
	min-width: 4dvw !important;
	}

.playerName {
	background: linear-gradient(to bottom, var(--color-playerName-out), var(--color-playerName-in) 50%, var(--color-playerName-out));
	text-align: center;
	font-weight: bolder;
	padding: 0 2dvw;
	}

.noServe {
	background: var(--color-score-out);
	}

.serve {
	background: var(--color-game-out);
	}

.serveA {
	background: linear-gradient(to right, var(--color-game-out), var(--color-score-out));
	}

.serveB {
	background: linear-gradient(to left, var(--color-game-out), var(--color-score-out));
	}

.game {
	color: #ffffff;
	background: linear-gradient(to bottom, var(--color-game-out), var(--color-game-in) 50%, var(--color-game-out));
	text-align: center;
	font-weight: bolder;
	min-width: 3dvw;
	}

.teams {
	background: linear-gradient(to bottom, var(--color-score-out), var(--color-playerName-in) 50%, var(--color-score-out));
	text-align: center;
	font-weight: 900;
	}

.league {
	color: #ffffff;
	background: linear-gradient(to bottom, var(--color-game-out), var(--color-game-in) 50%, var(--color-game-out));
	text-align: left;
	font-weight: bolder;
	}

.games {
	color: #000000;
	background: linear-gradient(to bottom, #fff, #dcdcdc 50%, #fff);
	text-align: center;
	font-weight: bolder;
	padding: 0.6dvh 0.4dvw;
	min-width: 3dvw;
	}

.border {
	border-color: silver;
	border-style: solid;
	border-width: 1px;
	}

.left {
	text-align: left;
	padding-left: 0.8dvw !important;
	padding-right: 0.8dvw !important;
	}

.right {
	text-align: right;
	padding-left: 0.8dvw !important;
	padding-right: 0.8dvw !important;
	}

.playerColorA {
	--player-color: transparent;
	background: linear-gradient(
		to left,
		var(--player-color),
		var(--player-color) 35%,
		transparent 75%
	);
}

.playerColorB {
	--player-color: transparent;
	background: linear-gradient(
		to right,
		var(--player-color),
		var(--player-color) 35%,
		transparent 75%
	);
}

.video-background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: -1;
	}

.video-background iframe {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 120vw;
	height: 120vh;
	/* transform: translate(-50%, -50%); */
	transform: translate(-50%, -46%) scale(1.02);		/* move video down, to hide original scoreboard */
	pointer-events: none;
	}

/* scoring progress */
.progressParent {
	font-weight: normal;
	display:flex;
    margin: 0 auto;
	}

.progressParent td {
	vertical-align: middle;
	height: 1.5dvw;
	text-align: center;
	padding: 1px 2px;

/*
	border-width: 1px;
	border-color: wheat;
	border-style: solid;
*/
	}

.progressDot {
	background: transparent;
	border-radius: 500px;
	display: flex;
    height: min(100%, 20px);
	aspect-ratio: 1/1;
	justify-content: center;
	align-items: center;
	font-size: 0.9dvw;
	}

.progressDotScored {
	background: var(--color-timer);
	box-shadow: 3px 3px 3px rgb(30, 30, 30);
	}

.progressDotWarning {
	border-radius: 500px;
	box-shadow: 3px 3px 3px rgb(30, 30, 30);
	}

.progressDotPenalty {
	background: orangered;
	border-radius: 500px;
	box-shadow: 3px 3px 3px rgb(30, 30, 30);
	}

.progressIcon {
	font-size: 1.5dvw;
	color: var(--color-timer);
	}

.progressNoScore {
	color: white;
	}

.progressText {
	font-size: 0.9dvw;
	font-weight: bold;
	color: white;
	justify-content: start;
	align-items: center;
	display: flex;
	padding: 0;
	margin: 0 0.25dvw 0 0.25dvw;
	max-height: 1.1dvw;
	white-space: nowrap;
	}

table td:has(.progressTextLong) {
	max-width: unset;
	}

.progressScore {
	color: #ffffff;
	text-align: center;
	font-weight: bolder;
	min-width: 3dvw;
	}

/* style for court selection */
#courtSel {
	background: #fcfcfc;
	border-width: unset;
	color: unset;
	padding: inherit;
}

#courtSel option{
	background: #fcfcfc;
	color: unset;
}

/* Persistent dark live results view; the unparameterized selection page keeps its existing design. */
body.results-live-view {
	--body-bg: #0b1118;
	--body-text: #eaf1f8;
	--highlight-text: #83c9ff;
	--rl-surface: #151f2a;
	--rl-surface-soft: #1d2a37;
	--rl-line: rgb(220 235 250 / 13%);
	--rl-muted: #a6b6c6;
	--rl-shadow: 0 16px 40px rgb(0 0 0 / 32%);
	margin: 0;
	padding: clamp(10px, 2vw, 28px);
	min-height: 100vh;
	color: var(--body-text);
	color-scheme: dark;
	background:
		radial-gradient(ellipse at 50% -18%, rgb(36 91 130 / 32%), transparent 56%),
		linear-gradient(160deg, #0b1118, #111a24 58%, #0d141c);
}

body.results-live-view > div {
	width: 100%;
}

.results-live-view .centerContainer {
	width: min(100%, 1500px);
	margin: 0 auto;
	padding: clamp(4px, 1vw, 12px);
	overflow-x: auto;
}

.results-live-view .centerContainer > span {
	display: block;
	text-align: center;
}

.results-live-view h3,
.results-live-view h4 {
	color: var(--body-text);
	text-align: center;
	line-height: 1.25;
}

.results-live-view .centerContainer h3 {
	margin: 0 0 18px;
	font-size: clamp(1.25rem, 2vw, 1.8rem);
	font-weight: 700;
	letter-spacing: -.025em;
}

.results-live-view .centerContainer h4 {
	margin: 22px 0 10px;
	color: var(--highlight-text);
	font-size: clamp(.95rem, 1.35vw, 1.2rem);
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.results-live-view table.fullWidth {
	width: 100%;
	margin: 0 auto 24px;
	border: 1px solid var(--rl-line);
	border-radius: 16px;
	border-spacing: 0;
	border-collapse: separate;
	overflow: hidden;
	background: var(--rl-surface);
	box-shadow: var(--rl-shadow);
	color: var(--body-text);
}

.results-live-view table.liveScoreTable {
	table-layout: fixed;
	font-size: clamp(12px, 2vw, 38px);
	line-height: 1.25;
	white-space: nowrap;
}

.results-live-view #liveScoreTable col.liveScoreColumn {
	width: 3em;
}

.results-live-view #liveScoreTable col.liveFinalColumn {
	width: calc(10ch + 1em);
}

.results-live-view .liveScoreTable td,
.results-live-view table.fullWidth td {
	padding: clamp(5px, .65vw, 9px) clamp(4px, .55vw, 8px);
	vertical-align: middle;
}

.results-live-view .teams {
	background: color-mix(in srgb, var(--menu-bg) 24%, var(--rl-surface));
	color: var(--body-text);
	font-weight: 700;
}

.results-live-view .league {
	background: var(--rl-surface-soft);
	color: var(--rl-muted);
	font-size: .9em;
	font-weight: 600;
}

.results-live-view .game {
	box-sizing: border-box;
	width: 3em;
	min-width: 3em;
	height: 3em;
	padding: 0 !important;
	background: color-mix(in srgb, var(--highlight-text) 12%, var(--rl-surface));
	color: var(--body-text);
	font-weight: 600;
}

.results-live-view .games {
	box-sizing: border-box;
	width: 3em;
	min-width: 3em;
	height: 3em;
	padding: 0 !important;
	background: color-mix(in srgb, var(--highlight-text) 18%, var(--rl-surface));
	color: var(--highlight-text);
	font-weight: 800;
}

.results-live-view .border,
.results-live-view .solidmiddle {
	border-color: var(--rl-line);
	border-width: 1px;
}

.results-live-view .solidmiddle {
	border-top-style: solid;
	border-bottom-style: solid;
}

.results-live-view .tdAnnouncementBig {
	box-sizing: border-box;
	width: 100%;
	min-width: 0 !important;
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	padding: 0 .5em !important;
}

.results-live-view .live-final-column {
	box-sizing: border-box;
	width: 100%;
	min-width: 0 !important;
	max-width: 100%;
	overflow: hidden;
	white-space: nowrap;
	padding: 0 .5em !important;
}

.results-live-view .announcement {
	border-radius: 999px;
	background: color-mix(in srgb, var(--menu-bg) 24%, var(--rl-surface));
	color: #ff8f9b;
	font-size: clamp(.8rem, 1.1vw, 1rem);
	padding: .45em 1em;
}

.results-live-view .bottom-element {
	max-width: min(90%, 680px);
	padding: 10px 16px;
	border: 1px solid var(--rl-line);
	border-radius: 14px;
	background: var(--rl-surface);
	box-shadow: var(--rl-shadow);
	color: var(--body-text);
}

.results-live-view .progressDotScored {
	box-shadow: 0 2px 6px rgb(0 0 0 / 35%);
}

.results-live-view .live-match-row {
	cursor: default;
}

.results-live-view .live-match-row td {
	transition: background-color .2s ease, color .2s ease, filter .2s ease, box-shadow .2s ease;
}

.results-live-view .live-match-row.match-hover td,
.results-live-view .live-match-row:hover td {
	filter: brightness(1.22);
	box-shadow: inset 0 1px 0 rgb(131 201 255 / 35%), inset 0 -1px 0 rgb(131 201 255 / 35%);
}

.results-live-view .announcement-active {
	color: #ffd5a1;
	text-shadow: 0 0 16px rgb(255 177 92 / 34%);
}

.results-live-view .announcement-pulse {
	animation: live-announcement-in .42s ease-out;
}

.results-live-view .timer-display {
	display: ruby;
	white-space: nowrap;
	color: var(--color-timer);
	padding: 0 2px;
}

.results-live-view .score-cylinder {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	overflow: hidden;
	pointer-events: none;
	white-space: nowrap;
}

.results-live-view span.score-cylinder {
	position: unset;
	inset: unset;
}

.results-live-view .score-cylinder-old,
.results-live-view .score-cylinder-new,
.results-live-view .score-cylinder-value {
	grid-area: 1 / 1;
	align-self: center;
	justify-self: center;

}

.results-live-view .score-cylinder-horizontal .score-cylinder-old {
	animation: score-cylinder-left .45s linear both;
}

.results-live-view .score-cylinder-horizontal .score-cylinder-new {
	animation: score-cylinder-right .45s linear both;
}

.results-live-view .score-cylinder-vertical .score-cylinder-old {
	animation: score-cylinder-up .45s linear both;
}

.results-live-view .score-cylinder-vertical .score-cylinder-new {
	animation: score-cylinder-down .45s linear both;
}
.service {
	display: inline-block;
	transform: translateY(-15px);
	background: var(--highlight-text);
	width: max(0.8dvw, 0.1dvh);
	height: max(0.8dvw, 0.1dvh);
	margin-left: max(0.5dvw, 2.5dvh);
	box-shadow: 2px 2px 2px var(--color-game-out);
	opacity: 0;
	border-radius: 500px;
	transition: opacity 1.0s ease-in-out;
}


.service-on {
	opacity: 1;
}

@keyframes score-cylinder-left {
	0% { opacity: 1; transform: translateX(0); }
	100% { opacity: 0; transform: translateX(-100%); }
}

@keyframes score-cylinder-right {
	0% { opacity: 0; transform: translateX(100%); }
	100% { opacity: 1; transform: translateX(0); }
}

@keyframes score-cylinder-up {
	0% { opacity: 1; transform: translateY(0); }
	100% { opacity: 0; transform: translateY(-100%); }
}

@keyframes score-cylinder-down {
	0% { opacity: 0; transform: translateY(100%); }
	100% { opacity: 1; transform: translateY(0); }
}
@keyframes live-announcement-in {
	0% { opacity: .35; transform: scale(.94); }
	70% { opacity: 1; transform: scale(1.04); }
	100% { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	.results-live-view .live-match-row td,
	.results-live-view .score-cylinder-old,
	.results-live-view .score-cylinder-new,
	.results-live-view .announcement-pulse {
		animation: none;
		transition: none;
	}
}

@media (max-width: 640px) {
	body.results-live-view {
		padding: 8px 4px;
	}

	.results-live-view .centerContainer {
		padding: 4px;
	}

	.results-live-view table.fullWidth {
		margin-bottom: 16px;
		border-radius: 12px;
	}

	.results-live-view table.liveScoreTable {
		font-size: clamp(11px, 3.1vw, 14px);
	}

	.results-live-view .liveScoreTable td,
	.results-live-view table.fullWidth td {
		padding: 5px 3px;
	}

	.results-live-view .game,
	.results-live-view .games {
		width: 3em;
		min-width: 3em;
		height: 3em;
	}

	.results-live-view .tdAnnouncementBig {
		width: 4ch;
		min-width: 4ch !important;
	}
}
