.pp-app {
	padding: 16px;
	max-width: 980px;
	margin: 0 auto;
	overflow-x: hidden;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
}

body {
	margin: 0;
	background-color: #008080;
	background-image: url('./assets/clouds.png');
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	min-height: 100vh;
	overflow-y: auto;
	overflow-x: hidden;
}

.pp-splash {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 1000;
}

.progress-indicator {
	background: #fff;
	box-shadow:
		inset -1px -1px #fff,
		inset 1px 1px grey,
		inset -2px -2px #dfdfdf,
		inset 2px 2px #0a0a0a;
	box-sizing: border-box;
	height: 22px;
	overflow: hidden;
	padding: 2px;
	position: relative;
	width: 100%;
}

.progress-indicator-bar {
	background: navy;
	display: block;
	height: 100%;
	position: relative;
	z-index: 1;
	width: 0%;
}

.progress-indicator.segmented::after {
	content: '';
	position: absolute;
	left: 2px;
	right: 2px;
	top: 2px;
	bottom: 2px;
	pointer-events: none;
	background-image: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.55) 0 1px,
		rgba(255, 255, 255, 0) 1px 100%
	);
	background-size: 10% 100%;
	background-position: 10% 0;
	z-index: 2;
}

.pp-splash-body {
	padding: 6px 0 10px;
	text-align: center;
}

.pp-splash .window-body {
	display: flex;
	flex-direction: column;
	min-height: 220px;
}

.pp-splash-logo {
	font-weight: 700;
	font-size: 28px;
	line-height: 1.2;
}

.pp-splash-tag {
	margin-top: 6px;
}

.pp-splash-progress {
	width: 100%;
	margin-top: auto;
}

.pp-splash-copy {
	margin: 8px 0 0;
	font-size: 11px;
}

@media (min-width: 761px) {
	body {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.pp-app {
		width: min(980px, calc(100% - 32px));
	}

	.pp-auth-window {
		width: min(440px, calc(100% - 32px));
		max-width: 440px;
	}

	.pp-splash {
		width: min(980px, calc(100% - 32px));
	}

	.pp-app {
		margin: 0;
	}
}

.pp-window {
	width: 100%;
	max-width: 100%;
}

.pp-auth-window {
	margin: 0 auto;
	width: min(420px, calc(100% - 24px));
	max-width: 420px;
}

.pp-splash.pp-window {
	width: min(520px, calc(100% - 24px));
	max-width: 520px;
}

.pp-subtle {
	margin-top: 0;
}

.pp-credit {
	white-space: normal;
}

.pp-auth-help {
	margin: 4px 0 10px;
	font-size: 10px;
	font-style: italic;
}

.pp-auth-help.is-error {
	color: maroon;
	font-style: italic;
	font-weight: 700;
}

.pp-auth-footer {
	margin: 10px 0 8px;
}

.pp-afk-row .field-row {
	align-items: center;
}

.pp-afk-row input[type='color'] {
	align-self: center;
	box-sizing: border-box;
	display: block;
	height: 21px;
	min-height: 21px;
	padding: 0;
	margin: 0;
	transform: none;
}

.pp-afk-row #afkFg,
.pp-afk-row #afkFgMain {
	transform: translateY(4px);
}

.pp-auth-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 12px;
}

.pp-auth-tablist {
	margin: 12px 0 0;
}

.pp-auth-tabpanels {
	margin-top: 6px;
	width: 100%;
}

.pp-auth-tabpanel {
	width: 100%;
}

.pp-auth-tabpanel .window-body {
	padding: 12px;
}

.pp-fieldset {
	margin-top: 12px;
}

.pp-afk-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	align-items: center;
}

.pp-main {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.pp-toolbar {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pp-desktop {
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 12px;
	align-items: start;
}

.pp-panel {
	min-width: 0;
}

.pp-add-friend {
	display: flex;
	gap: 8px;
	align-items: flex-end;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.pp-friends {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.friend-row {
	display: grid;
	grid-template-columns: 1fr auto auto;
	gap: 6px;
	align-items: center;
}

.friend-row.is-selected {
	outline: 1px dotted black;
	outline-offset: 2px;
}

#friends li.is-unread .friend-row span {
	font-weight: 700;
}

#friends li.is-unread .friend-row span::after {
	content: ' ●';
	color: maroon;
	font-weight: 700;
}

.pp-dialog-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	z-index: 1999;
}

.pp-dialog {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 2000;
	width: min(420px, calc(100% - 24px));
}

.pp-dialog-message {
	margin: 0;
	white-space: pre-wrap;
}

.pp-dialog-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 12px;
}

#authStatus {
	white-space: pre-line;
}

.pp-status .status-bar-field.is-error {
	color: maroon;
}

.pp-chat {
	min-height: 360px;
	display: flex;
	flex-direction: column;
}

.pp-chat-header {
	margin-bottom: 8px;
}

.pp-chat-log {
	border: 1px inset;
	padding: 8px;
	background: white;
	flex: 1;
	overflow: auto;
	min-height: 240px;
}

.pp-chat-divider {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 10px 0;
	color: grey;
	font-weight: 700;
	user-select: none;
}

.pp-chat-divider::before,
.pp-chat-divider::after {
	content: '';
	flex: 1;
	border-top: 1px solid grey;
}

.pp-chat-divider > span {
	padding: 0 8px;
	background: white;
}

.pp-chat-compose {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 8px;
	margin-top: 8px;
}

.pp-chat-time {
	color: grey;
	font-weight: 700;
}

.pp-chat-from {
	font-weight: 700;
}

.pp-usercolor-0 {
	color: navy;
}

.pp-usercolor-1 {
	color: maroon;
}

.pp-usercolor-2 {
	color: #008080;
}

.pp-usercolor-3 {
	color: #222;
}

.pp-status {
	margin-top: 8px;
}

.pp-you {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pp-you-editor {
	margin-top: 8px;
}

.afk-bubble {
	border: 1px solid black;
	padding: 6px 8px;
	max-width: 100%;
	word-break: break-word;
}

@media (max-width: 760px) {
	.pp-app {
		padding: 10px;
		margin: 12px;
		width: min(100%, 560px);
	}

	.pp-desktop {
		grid-template-columns: 1fr;
	}

	.pp-friends {
		max-height: 26vh;
		overflow: auto;
	}

	.pp-chat {
		min-height: 320px;
	}

	.pp-chat-log {
		min-height: 200px;
		max-height: 40vh;
	}

	.pp-chat-compose {
		grid-template-columns: 1fr;
	}

	body {
		display: flex;
		justify-content: center;
		align-items: flex-start;
		overflow-y: auto;
	}
}
