/* Additions to jeopardy.css for the live game. */

.color-0 { --dark: var(--player-0-darkcolor); --light: var(--player-0-lightcolor); }
.color-1 { --dark: var(--player-1-darkcolor); --light: var(--player-1-lightcolor); }
.color-2 { --dark: var(--player-2-darkcolor); --light: var(--player-2-lightcolor); }
.color-3 { --dark: var(--player-3-darkcolor); --light: var(--player-3-lightcolor); }

/* ---- projector ---------------------------------------------------------- */

body.screen {
	margin: 0;
	height: 100vh;
	overflow: hidden;
	display: flex;
	align-items: center;
	cursor: default;
}

body.screen .jeopardy-container {
	position: relative;
}

.jeopardy-board .fields {
	min-height: 0;
}

.jeopardy-board .fields .categoryfields .field {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	font-weight: bold;
}

.jeopardy-board .fields .categoryfields .field.used {
	background: #57534e;
}

.jeopardy-board .categoryheadings .categoryname {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1.1;
	padding: 1cqh 0.5cqw;
	box-sizing: border-box;
}

/* Player chips; --chip-font is set by fitPlayers(). */
.chips {
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 0.5cqw;
	overflow: hidden;
	min-height: 0;
}

.chip {
	flex: 1 1 0;
	min-width: calc(var(--chip-font, 4cqh) * 7);
	font-size: var(--chip-font, 4cqh);
	padding: calc(var(--chip-font, 4cqh) * 0.35) calc(var(--chip-font, 4cqh) * 0.45);
	border: calc(var(--chip-font, 4cqh) * 0.2) solid var(--dark, #78716c);
	border-radius: 0.2cqw;
	background: var(--dark, #78716c);
	color: var(--light, #f5f5f4);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	line-height: 1.15;
}

.chip.active {
	border-color: #fff;
}

.chip.more {
	background: transparent;
	border-color: #78716c;
	flex: 0 0 auto;
	min-width: 0;
}

.chips.compact .chip {
	flex-direction: row;
	justify-content: space-between;
	gap: 0.5em;
}

.chipname {
	font-weight: bold;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.chippoints {
	margin-top: 0.3em;
	white-space: nowrap;
}

.chips.compact .chipname {
	flex: 1;
}

.chips.compact .chippoints {
	margin-top: 0;
}

.chiprank {
	opacity: 0.75;
	min-width: 1.8em;
}

.livebar {
	height: 15cqh;
	flex-shrink: 0;
	margin-top: 0.5cqw;
}

/* Lobby with the QR code. */
.lobby {
	container-type: size;
	width: 100%;
	height: 100%;
	background: var(--game-background);
	color: #f5f5f4;
	display: flex;
	gap: 4cqw;
	padding: 4cqw;
	box-sizing: border-box;
}

.lobby-qr {
	flex: 0 0 auto;
	height: 100%;
	aspect-ratio: 1;
	background: #fff;
	border-radius: 1cqw;
	padding: 1cqw;
	box-sizing: border-box;
}

.lobby-qr img {
	width: 100%;
	height: 100%;
	display: block;
	image-rendering: pixelated;
}

.lobby-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.lobby-info h1 {
	font-size: 9cqh;
	margin: 0 0 2cqh;
	line-height: 1.1;
}

.lobby-join {
	font-size: 3.2cqh;
	margin-bottom: 1cqh;
	overflow-wrap: anywhere;
}

.lobby-count {
	font-size: 3.2cqh;
	color: #d6d3d1;
	margin-bottom: 2cqh;
}

.lobby-players {
	flex: 1;
}

/* Clue and answer. */
.clue-stage {
	container-type: size;
	position: relative;
	width: 100%;
	height: 100%;
}

.clue-label {
	position: absolute;
	top: 0.3cqh;
	left: 2cqw;
	font-size: 2.4cqh;
	color: #d6d3d1;
	white-space: nowrap;
}

.clue-status {
	position: absolute;
	top: 4.5cqh;
	right: 4.5cqw;
	--chip-font: 4.5cqh;
}

.clue-status .chip {
	display: inline-block;
	min-width: 0;
	font-weight: bold;
}

.chip.buzz-open {
	--dark: #f5f5f4;
	--light: var(--game-background);
	animation: pulse 1s ease-in-out infinite alternate;
}

@keyframes pulse {
	from { transform: scale(1); }
	to { transform: scale(1.08); }
}

.jeopardy-clue .clue-text,
.jeopardy-clue .clue-answer {
	text-align: center;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.live-code {
	display: flex;
	gap: 1em;
	text-align: left;
	max-height: 100%;
	overflow: hidden;
}

.live-code pre {
	margin: 0;
}

.live-code .linenos {
	opacity: 0.45;
	text-align: right;
	user-select: none;
}

.live-code .hljs {
	background: transparent;
	padding: 0;
	font-family: inherit;
}

/* Final scores. */
.scores {
	container-type: size;
	width: 100%;
	height: 100%;
	background: var(--game-background);
	color: #f5f5f4;
	padding: 4cqh 4cqw;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
}

.scores h1 {
	font-size: 9cqh;
	margin: 0 0 3cqh;
	text-align: center;
}

.scores-list {
	flex: 1;
	flex-direction: column;
	align-content: center;
}

.scores-list .chip {
	flex: 0 0 auto;
	width: calc(var(--chip-font) * 14);
}

.screen-hint {
	position: fixed;
	bottom: 8px;
	right: 12px;
	font: 14px 'Inter', sans-serif;
	color: #a8a29e;
	background: rgba(0, 0, 0, 0.6);
	padding: 4px 8px;
	border-radius: 4px;
}

.screen-hint.offline {
	left: 12px;
	right: auto;
	color: #fecaca;
}

[hidden] {
	display: none !important;
}
