/* Full-screen TV layout: the other home fills the screen, our own camera
   sits small in a corner. Text is large enough to read from a sofa. */

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	background: #0b0d10;
	color: #f2f4f7;
	font-family: system-ui, 'Segoe UI', Ubuntu, sans-serif;
	overflow: hidden;
	cursor: none;
}

video {
	position: fixed;
	background: #000;
	object-fit: contain;
}

#remote {
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Mirror our own picture, like a mirror. */
#local {
	right: 2vw;
	bottom: 2vw;
	width: 20vw;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transform: scaleX(-1);
	border-radius: 1vw;
	border: 2px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 0.5vw 2vw rgba(0, 0, 0, 0.5);
	transition: all 0.4s ease;
}

/* While not connected, our own camera fills the screen behind the status. */
body:not(.connected) #local {
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	border-radius: 0;
	border: 0;
	filter: brightness(0.35);
}

body:not(.connected) #remote {
	visibility: hidden;
}

#status {
	position: fixed;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 5vw;
	pointer-events: none;
}

body.connected #status {
	display: none;
}

#status-text {
	margin: 3vh 0 1vh;
	font-size: clamp(28px, 4.5vw, 96px);
	font-weight: 600;
	text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

#status-sub {
	margin: 0;
	font-size: clamp(16px, 2vw, 40px);
	opacity: 0.75;
}

.spinner {
	width: clamp(40px, 6vw, 110px);
	aspect-ratio: 1;
	border-radius: 50%;
	border: clamp(4px, 0.5vw, 10px) solid rgba(255, 255, 255, 0.2);
	border-top-color: #f2f4f7;
	animation: spin 1.1s linear infinite;
}

body.error .spinner {
	display: none;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

#unmute {
	position: fixed;
	left: 50%;
	top: 4vh;
	transform: translateX(-50%);
	padding: 1.2vw 2.4vw;
	font: 600 clamp(16px, 1.8vw, 36px) system-ui, sans-serif;
	color: #0b0d10;
	background: #ffd166;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
}

body:not(.connected) #unmute {
	display: none;
}

body.need-click.connected {
	cursor: pointer;
}

/* The synthetic test picture has text on it, so do not mirror it. */
body.test #local {
	transform: none;
}

#badge {
	position: fixed;
	left: 2vw;
	bottom: 2vw;
	padding: 0.5vw 1vw;
	font: 500 clamp(12px, 1.1vw, 22px) ui-monospace, Consolas, monospace;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 0.6vw;
	white-space: pre;
}
