/*
   Signing in, the profile's picture and pencil, and the line saying where a game
   is saved.
   Loaded in order with the others (see index.html): a later rule wins. */

/* Sign-in and account */
.account-section {
	display: flex;
	flex-direction: column;
	gap: calc(1.5 * var(--m));
	width: 44%;
}

.account-step {
	display: flex;
	flex-direction: column;
	gap: calc(1.5 * var(--m));
}

.account-check:empty,
.account-wait[hidden],
.account-step[hidden],
.account-error[hidden],
.start-account[hidden] {
	display: none;
}

.account-panel .confirm-detail {
	margin: 0;
}

/* Google's G, on a white disc as its buttons have it (its colours each a step of the ladder). */
.google-g {
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.45em;
	padding: 0.2em;
	vertical-align: -0.38em;
	background: #ffffff;
	border-radius: 50%;
}

/* PROFILE: its picture (or first letter) on a circle, in the menu's head and
   bigger in its settings, where deleting it is a quiet link at the bottom. */
.profile-pic {
	display: grid;
	flex: none;
	place-items: center;
	width: calc(6.5 * var(--m));
	height: calc(6.5 * var(--m));
	margin-right: calc(1.5 * var(--m));
	padding: 0;
	overflow: hidden;
	font-family: var(--font-condensed);
	font-weight: 600;
	color: var(--text);
	background: var(--button-disabled);
	border: var(--border-muted);
	border-radius: 50%;
}

.profile-pic img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.profile-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.profile-name.is-me {
	color: var(--checkout);
}

.profile-head .menu-title {
	flex-direction: column;
	gap: 0;
}

/* The players menu's heading: signed in, a button opening the profile menu, its arrow on the right. */
button.profile-head {
	width: 100%;
	gap: calc(1.5 * var(--m));
	border: none;
	border-radius: var(--radius);
	background: none;
	text-align: left;
	cursor: pointer;
}

button.profile-head:disabled {
	cursor: default;
}

button.profile-head:not(:disabled):active {
	background: var(--button-pressed);
}

.menu-signed-in {
	font-size: calc(2.2 * var(--m));
	font-weight: normal;
	color: var(--text-muted);
}

.profile-go {
	flex: none;
	font-size: calc(4.5 * var(--m));
	font-weight: normal;
	line-height: 1;
	color: var(--text-soft);
}

.profile-head [hidden] {
	display: none;
}

.profile-settings-section {
	display: flex;
	flex-direction: column;
	gap: calc(1.5 * var(--m));
	width: min(calc(62 * var(--m)), 90%);
}

.profile-edit {
	display: flex;
	align-items: center;
	gap: calc(2 * var(--m));
}

.profile-pic-wrap {
	position: relative;
	flex: none;
}

/* The pencil on the picture's top right corner. */
.profile-pic-edit {
	position: absolute;
	top: calc(-0.5 * var(--m));
	right: calc(-0.5 * var(--m));
	display: grid;
	place-items: center;
	width: calc(5.5 * var(--m));
	height: calc(5.5 * var(--m));
	padding: 0;
	color: var(--text);
	background: var(--button);
	border: var(--border);
	border-radius: 50%;
	cursor: pointer;
}

.profile-pic-edit .icon {
	width: 62%;
	height: 62%;
	filter: none;
}

.profile-pic-edit:active {
	background: var(--button-pressed);
}

/* Change and Remove, dropping from the pencil over what's below. */
.profile-pic-menu {
	position: absolute;
	top: calc(5.5 * var(--m));
	left: calc(10 * var(--m));
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: calc(1 * var(--m));
	width: max-content;
	padding: calc(1 * var(--m));
	background: var(--panel);
	border: var(--border);
	border-radius: var(--radius);
	box-shadow: 0 calc(0.5 * var(--m)) calc(2 * var(--m)) rgba(0, 0, 0, 0.5);
	animation: menu-in var(--fast) var(--ease-out);
	transform-origin: top left;
}

.profile-pic-big {
	width: calc(16 * var(--m));
	height: calc(16 * var(--m));
	margin: 0;
	font-size: calc(7 * var(--m));
	cursor: pointer;
}

.profile-edit-side {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: calc(1 * var(--m));
	min-width: 0;
}

.profile-name-big {
	margin: 0;
	font-size: calc(4.4 * var(--m));
	font-weight: 600;
	color: var(--checkout);
	overflow-wrap: anywhere;
}

.profile-email {
	margin: 0;
	font-family: var(--font-condensed);
	font-size: calc(2.8 * var(--m));
	color: var(--text-soft);
	overflow-wrap: anywhere;
}

/* A popup's title with its close (×) on the right. */
.dialog-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: calc(2 * var(--m));
}

.dialog-head .confirm-title {
	margin: 0;
	margin-right: auto; /* the cog and × together on the right */
}

.dialog-x .cog-icon {
	stroke-width: 1.8; /* its teeth are fine: a lighter line keeps them apart */
	stroke-linejoin: round;
}

.dialog-x {
	flex: none;
	display: grid;
	place-items: center;
	width: calc(6.5 * var(--m));
	height: calc(6.5 * var(--m));
	padding: 0;
	color: var(--text);
	background: var(--button);
	border: var(--border);
	border-radius: var(--radius);
	cursor: pointer;
}

.dialog-x .icon {
	width: 60%;
	height: 60%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
}

.dialog-x:active {
	background: var(--button-pressed);
}

.profile-field {
	display: flex;
	flex-direction: column;
	gap: calc(0.5 * var(--m));
}

.profile-field .confirm-detail {
	margin: 0;
}

/* Where the profile is from: a dropdown like the Username field, a chevron on its right (as Game history's dates). */
.country-pick {
	position: relative;
	display: flex;
}

.profile-country {
	appearance: none;
	-webkit-appearance: none;
	padding-right: calc(5.5 * var(--m));
	color-scheme: dark;
	cursor: pointer;
}

.country-pick .icon {
	position: absolute;
	right: calc(1.5 * var(--m));
	top: 50%;
	width: calc(3 * var(--m));
	height: calc(3 * var(--m));
	margin-top: calc(-1.5 * var(--m));
	stroke: var(--text-soft);
	stroke-width: 2.5;
	filter: none;
	pointer-events: none;
}

.banner-choice button[hidden] {
	display: none;
}

.profile-edit-status:empty {
	display: none;
}

.profile-edit-status {
	margin: 0;
}

.profile-status:empty,
.profile-settings-section [hidden] {
	display: none;
}

.profile-status {
	margin: 0;
}

.profile-delete {
	align-self: center;
	padding: calc(0.5 * var(--m)) calc(2 * var(--m));
	font-family: var(--font-condensed);
	font-size: calc(2.6 * var(--m));
	color: var(--text-muted);
	background: none;
	border: none;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.account-or {
	margin: 0;
	font-family: var(--font-condensed);
	font-size: calc(2.8 * var(--m));
	text-align: center;
	color: var(--text-muted);
}

.account-input {
	box-sizing: border-box;
	width: 100%;
	padding: calc(1 * var(--m));
	font-family: var(--font-condensed);
	font-size: calc(3.6 * var(--m));
	color: var(--text);
	background: var(--button-disabled);
	border: var(--border);
	border-radius: var(--radius);
}

.account-error {
	color: var(--text);
}

/* Signed in, during a game: beside This game, right-aligned, that it's saved after
   each leg, with Sync now to send it at once (taller to tap than it shows). */
.menu-sync {
	flex: none;
	margin-left: auto;
	font-family: var(--font-condensed);
	font-size: calc(2.5 * var(--m));
	font-weight: normal;
	color: var(--text-soft);
	white-space: nowrap;
}

.menu-sync[hidden] {
	display: none;
}

.menu-sync-now {
	margin: calc(-1.4 * var(--m)) 0;
	padding: calc(1.4 * var(--m)) 0;
	color: var(--text);
}


@media (orientation: portrait) {
	.account-section {
		width: 90%;
	}
}

/* The flag of the country picked, before its name. */
.country-flag {
	position: absolute;
	left: calc(1.5 * var(--m));
	top: 50%;
	height: calc(2.6 * var(--m));
	aspect-ratio: 4 / 3;
	margin-top: calc(-1.3 * var(--m));
	border-radius: calc(0.3 * var(--m));
	pointer-events: none;
}

.country-pick.flagged .profile-country {
	padding-left: calc(6 * var(--m));
}

/* On the profile menu the picture is only shown: it's changed in Edit profile. */
span.profile-pic-big {
	cursor: default;
}

/* Only while saving, or when it couldn't. */
.profile-edit-status:empty {
	display: none;
}
