/* Big-screen bracket (designed for 1920x1080). */

:root {
	--card-bg: #151515;
	--line: #333;
	--winner: #2e7d32;
}

html {
	background-color: black;
	color: white;
}

body {
	min-width: 1600px;
	height: 100vh;
	min-height: 860px;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	padding: 12px 16px 16px;
	gap: 10px;
}

#bracket_header {
	display: flex;
	align-items: baseline;
	gap: 24px;
}

#bracket_back {
	color: var(--light-blue);
	text-decoration: none;
	font-size: 1.1rem;
}

#bracket_back:hover,
#bracket_back:focus-visible {
	text-decoration: underline;
}

#bracket_title {
	font-size: 1.6rem;
	font-weight: bold;
}

#champion {
	font-size: 1.6rem;
	font-weight: bold;
	color: var(--light-blue);
}

#bracket_countdown {
	padding: 2px 12px;
	font-size: 1.3rem;
	font-weight: bold;
	color: black;
	border-radius: 8px;
	background-color: #ffd54f;
	font-variant-numeric: tabular-nums;
}

#bracket_countdown[hidden] {
	display: none;
}

#bracket_status {
	margin-left: auto;
	color: #aaa;
}

#bracket_status.message_error {
	color: #ff6b6b;
}

/* 9 columns: rounds that are played around the same time share a column, so
   teams dropping from the upper bracket appear right below where they lost. */
#bracket {
	position: relative;
	flex: 1;
	min-height: 0;
	display: grid;
	grid-template-columns: repeat(9, minmax(0, 1fr));
	grid-template-rows: 1fr 1fr;
	/* room for the connecting lines between rounds */
	column-gap: 28px;
	row-gap: 18px;
}

/* Lines from each match to the match its winner moves on to (drawn by bracket.js). */
#bracket_lines {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

#bracket_lines path {
	fill: none;
	stroke: #444;
	stroke-width: 2;
}

/* the winner of the source match has moved on along this line */
#bracket_lines path.decided {
	stroke: #bbb;
}

.empty_hint {
	grid-column: 1 / -1;
	grid-row: 1 / -1;
	place-self: center;
	font-size: 1.5rem;
	color: #aaa;
}

.round {
	position: relative;
	z-index: 1; /* cards above the lines */
	min-height: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.round_title {
	padding: 4px 6px;
	font-size: 0.8rem;
	text-align: center;
	color: black;
	border-radius: 6px;
	background-color: var(--light-blue);
}

.round.lower .round_title {
	background-color: #8fd3ea;
}

.round.final .round_title {
	background-color: #ffd54f;
}

.round_matches {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-around;
	gap: 4px;
}

.match_card {
	display: grid;
	grid-template-columns: 2.4em 1fr;
	grid-template-rows: 1fr 1fr;
	font-size: 0.8rem;
	line-height: 1.2;
	border: 1px solid var(--line);
	border-radius: 6px;
	background-color: var(--card-bg);
	overflow: hidden;
}

.match_card.live {
	outline: 3px solid var(--light-blue);
	outline-offset: -1px;
}

.votes {
	display: flex;
	align-items: center;
	justify-content: center;
	border-right: 1px solid var(--line);
	font-variant-numeric: tabular-nums;
}

.votes.second,
.team.second {
	border-top: 1px solid var(--line);
}

.votes.winner {
	background-color: var(--winner);
	font-weight: bold;
}

.team {
	min-width: 0;
	padding: 3px 6px;
	display: flex;
	align-items: center;
	overflow: hidden;
	white-space: nowrap;
}

/* a name too long for the card ends in "…" (full name in the tooltip) */
.team_name {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

.team.winner {
	font-weight: bold;
}

.team.loser {
	color: #888;
}

/* place not decided yet: where its team will come from */
.team.pending {
	color: #666;
	font-style: italic;
}

/* winner decided by a coin toss (tie in votes) */
.team.coin_toss {
	color: #ffd54f;
}
