#lobby {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 15;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	padding: 3vmin 4vmin;
	background: #232A33;
	color: #fff;
	touch-action: manipulation;
	overflow: hidden;
}

#lobby .lsite {
	order: 1;
	font-size: 5vmin;
	font-weight: bold;
	line-height: 1.2;
	padding-bottom: 1.5vmin;
}

#lobby .lnote {
	order: 2;
	margin-bottom: 2vmin;
	padding: 1.4vmin 3vmin;
	font-size: 3.4vmin;
	font-weight: bold;
}

#lobby .lnote.warn {
	background: #F2B84B;
	color: #1A1400;
}

#lobby .lnote.info {
	background: #4A4F57;
}

#lobbyList {
	order: 2;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	touch-action: pan-y;
}

#lobbyFilters {
	order: 3;
	flex: 0 0 auto;
	padding-top: 2vmin;
}

#lobby .lgroup {
	margin-bottom: 2.5vmin;
}

#lobby .lfloor {
	margin-bottom: 1.2vmin;
	font-size: 3.4vmin;
	opacity: 0.8;
}

#lobby .lrows {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(36vmin, 1fr));
	gap: 1.8vmin;
}

/* Landscape: floors sit side by side when they fit, each as wide as its cards ask for
   (--cards, at most 4), so a few spaces per floor still fill the width. */
@media (orientation: landscape) {
	#lobbyList {
		display: flex;
		flex-wrap: wrap;
		align-content: flex-start;
		column-gap: 3vmin;
	}

	#lobby .lgroup {
		flex: var(--cards, 1) 1 calc(var(--cards, 1) * 37.8vmin - 1.8vmin);
		min-width: 0;
		max-width: 100%;
	}
}

.lrow {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.6vmin;
	width: 100%;
	min-height: max(48px, 13vmin);
	padding: 1.6vmin 2.6vmin;
	border: 0;
	border-radius: 2vmin;
	background: #1B6B3A;
	color: #fff;
	font-family: inherit;
	text-align: start;
	cursor: pointer;
	touch-action: manipulation;
}

.lrow:active {
	filter: brightness(1.25);
}

.lrow:disabled {
	background: #3A3E45;
	color: #B4BAC2;
	cursor: default;
}

.lrow .lname {
	font-size: 4.4vmin;
	font-weight: bold;
}

.lrow .lmeta {
	font-size: 2.8vmin;
	opacity: 0.85;
}

.lrow .lstate {
	font-size: 3.2vmin;
}

#lobby .lempty {
	padding: 6vmin 2vmin;
	font-size: 4.2vmin;
	text-align: center;
}

#lobby .lchips {
	display: flex;
	flex-wrap: wrap;
	gap: 1.4vmin;
	margin-top: 1.4vmin;
}

.lchip {
	box-sizing: border-box;
	min-height: max(48px, 7vmin);
	padding: 0.8vmin 2.8vmin;
	border: 0.3vmin solid #fff;
	border-radius: 4vmin;
	background: transparent;
	color: #fff;
	font-family: inherit;
	font-size: 3vmin;
	font-weight: bold;
	cursor: pointer;
	touch-action: manipulation;
}

.lchip.on {
	background: #fff;
	color: #232A33;
}

#lobbyFree.on {
	background: #1B6B3A;
	border-color: #1B6B3A;
	color: #fff;
}

#lobbyFree.on::before {
	content: "\2713\00a0";
}

#lobbySheet {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	z-index: 5;
	box-sizing: border-box;
	padding: 5vmin 6vmin;
	background: #4A4F57;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

#lobbySheet .lbody {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	max-width: 140vmin;
	margin: 0 auto;
	text-align: center;
}

#lobbySheet .lhead {
	font-size: 7vmin;
	font-weight: bold;
	line-height: 1.2;
}

#lobbySheet .lsub {
	margin: 1.4vmin 0;
	font-size: 4vmin;
	opacity: 0.9;
}

#lobbySheet .llabel {
	margin: 3vmin 0 1.6vmin;
	font-size: 4vmin;
}

#lobbySheet .lbtns {
	margin-top: 2vmin;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2.5vmin;
	margin-bottom: 3vmin;
}

#lobbySheet .lmsg {
	margin: 2vmin 0 3vmin;
	font-size: 4.8vmin;
	line-height: 1.35;
}

#lobbySheet .lmsg.warn {
	padding: 1.6vmin 3vmin;
	background: #F2B84B;
	color: #1A1400;
	font-weight: bold;
}

#lobbySheet .lmsg.done {
	font-size: 7vmin;
	font-weight: bold;
}

#lobbySheet .lqr {
	align-self: center;
	width: min(42vmin, 320px);
	height: min(42vmin, 320px);
	margin: 2vmin 0;
}

#lobbySheet .lqr svg {
	display: block;
	width: 100%;
	height: 100%;
}

.lbtn {
	box-sizing: border-box;
	align-self: center;
	min-width: 24vmin;
	min-height: max(48px, 13vmin);
	padding: 1.5vmin 4vmin;
	border: 0;
	border-radius: 2vmin;
	font-family: inherit;
	font-size: 5vmin;
	font-weight: bold;
	color: #fff;
	cursor: pointer;
	touch-action: manipulation;
}

.lbtn.go {
	background: #1B6B3A;
}

.lbtn.light {
	background: #fff;
	color: #232A33;
}

.lbtn.plain {
	background: transparent;
	border: 0.4vmin solid #fff;
}

.lbtn:active {
	filter: brightness(1.25);
}

.lbtn:disabled {
	background: #3A3E45;
	color: #9AA0A8;
	cursor: default;
}

#lobbySheet .lspin {
	align-self: center;
	width: 12vmin;
	height: 12vmin;
	box-sizing: border-box;
	border: 1.4vmin solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: lspin 1s linear infinite;
}

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

#lobbyIdle {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 6;
	padding: 2vmin 4vmin;
	background: #F2B84B;
	color: #1A1400;
	font-size: 3.6vmin;
	font-weight: bold;
	text-align: center;
}

@media (orientation: portrait) {
	#lobbyList {
		display: flex;
		flex-direction: column;
	}

	#lobby .lgroup:first-child {
		margin-top: auto;
	}

	#lobby .lrows {
		grid-template-columns: 1fr;
	}

	#lobbySheet {
		top: 33%;
		height: 67%;
		justify-content: flex-end;
		padding-bottom: 8vmin;
	}

	.lrow {
		min-height: max(48px, 9vmin);
	}
}
