/*
   Linking a player to a profile (That's me, the code and QR, the mark in a
   player's row) and joining someone's game with their code.
   Loaded in order with the others (see index.html): a later rule wins. */

/* Linking a player to a profile: That's me, or a code to scan from another phone. */
.link-section {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: min(calc(64 * var(--m)), 90%);
}

.link-me {
	width: auto;
	margin: calc(1 * var(--m)) 0;
	padding: calc(1 * var(--m)) calc(3 * var(--m));
}

.link-scan {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.link-scan[hidden] {
	display: none;
}

.link-scan-lead {
	margin-bottom: calc(1 * var(--m));
}

/* Dark on white, whatever the theme: what cameras read best. */
.link-qr {
	width: calc(30 * var(--m));
	height: calc(30 * var(--m));
	background: #ffffff;
	border-radius: var(--radius);
	fill: #000000;
}

.link-qr.waiting {
	opacity: 0.16;
}

.link-code {
	margin: calc(1.5 * var(--m)) 0 0;
	font-family: var(--font-condensed);
	font-size: calc(5 * var(--m));
	font-weight: 600;
	letter-spacing: 0.15em;
	color: var(--text);
}

.link-status {
	margin-bottom: calc(0.5 * var(--m));
}

.link-again {
	margin-bottom: calc(1 * var(--m));
}

/* The mark in a player's row: a link to tap, or a linked profile's picture or letter. */
.link-btn {
	display: grid;
	place-items: center;
	color: var(--text-muted);
}

.link-btn .icon {
	width: 55%;
	height: 55%;
	filter: none;
}

.link-btn.linked > * {
	display: grid;
	place-items: center;
	width: calc(3.4 * var(--m));
	height: calc(3.4 * var(--m));
	overflow: hidden;
	font-family: var(--font-condensed);
	font-size: calc(2 * var(--m));
	font-weight: 600;
	color: var(--text);
	background: var(--button-disabled);
	border: 1px solid var(--checkout);
	border-radius: 50%;
	object-fit: cover;
}

.players-list .linked-player input {
	cursor: default;
}

/* Joining someone's game: their code typed in. */
.join-section {
	max-width: min(calc(64 * var(--m)), 90%);
}

.settings-section .join-code {
	display: block;
	width: calc(30 * var(--m));
	height: calc(7 * var(--m));
	margin: 0 auto calc(1 * var(--m));
	box-sizing: border-box;
	font-family: var(--font-condensed);
	font-size: calc(4.4 * var(--m));
	font-weight: 600;
	letter-spacing: 0.15em;
	text-align: center;
	text-transform: uppercase;
	color: var(--text);
	background: var(--field);
	border: 1px solid var(--text-muted);
	border-radius: var(--radius);
	outline: none;
}

.join-code:focus {
	border-color: var(--text);
}

.join-code[hidden],
.link-me[hidden] {
	display: none;
}
