/* 1.5.16: PixGame-Emojis, Picker und Live-Anzeige im Eingabefeld */
img.pgc-emoji {
	display: inline-block !important;
	width: 1.4em !important;
	height: 1.4em !important;
	max-width: 1.4em !important;
	max-height: 1.4em !important;
	margin: 0 .08em !important;
	padding: 0 !important;
	vertical-align: -0.28em;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	background: none !important;
	object-fit: contain;
	image-rendering: auto;
}

.pgc-emoji-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
}
.pgc-emoji-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	background: #fff;
	color: #0f4c45;
	cursor: pointer;
	line-height: 0;
	box-shadow: none;
}
.pgc-emoji-toggle img,
.pgc-emoji-toggle svg {
	width: 22px;
	height: 22px;
	display: block;
	pointer-events: none;
}
.pgc-emoji-toggle:hover,
.pgc-emoji-toggle:focus {
	border-color: #7c4dff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(124, 77, 255, .25);
}
.pgc-emoji-toggle[aria-expanded="true"] {
	border-color: #0ea5b7;
	background: #e8f3f1;
}

.pgc-emoji-picker {
	position: absolute;
	z-index: 100050;
	width: min(320px, calc(100vw - 24px));
	padding: 10px;
	background: #171e2b;
	color: #f8fafc;
	border: 1px solid #2a3444;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, .28);
	font-family: "Work Sans", system-ui, -apple-system, sans-serif;
}
.pgc-emoji-picker[hidden] { display: none !important; }
.pgc-emoji-picker__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 2px 8px;
}
.pgc-emoji-picker__title {
	font-family: Montserrat, "Work Sans", system-ui, sans-serif;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: #f8fafc;
}
.pgc-emoji-picker__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #d1d5db;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.pgc-emoji-picker__close:hover,
.pgc-emoji-picker__close:focus {
	background: #2a3444;
	color: #fff;
	outline: none;
}
.pgc-emoji-picker__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.pgc-emoji-picker__btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: 52px;
	padding: 6px 4px 5px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #10151f;
	color: #e5e7eb;
	cursor: pointer;
}
.pgc-emoji-picker__btn img {
	width: 28px;
	height: 28px;
	display: block;
	pointer-events: none;
}
.pgc-emoji-picker__btn span {
	font-size: 10px;
	line-height: 1.2;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: #9ca3af;
}
.pgc-emoji-picker__btn:hover,
.pgc-emoji-picker__btn:focus,
.pgc-emoji-picker__btn.is-active {
	border-color: #0ea5b7;
	background: #0f4c45;
	outline: none;
}
.pgc-emoji-picker__btn:hover span,
.pgc-emoji-picker__btn:focus span,
.pgc-emoji-picker__btn.is-active span { color: #f8fafc; }

/* Placement next to common forms */
#whats-new-form .pgc-emoji-wrap,
#whats-new-submit .pgc-emoji-wrap,
form.ac-form .pgc-emoji-wrap,
#commentform .pgc-emoji-wrap,
.comment-form .pgc-emoji-wrap,
.asgaros-forum .editor-row-submit .pgc-emoji-wrap,
.asgaros-forum .editor-element .pgc-emoji-wrap {
	margin: 0 8px 0 0;
}
#whats-new-submit {
	display: flex !important;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}
form.ac-form .ac-reply-content,
form.ac-form .ac-textarea { position: relative; }

@media (max-width: 600px) {
	.pgc-emoji-picker {
		width: min(360px, calc(100vw - 16px));
		padding: 10px 10px 12px;
	}
	.pgc-emoji-picker__btn { min-height: 56px; }
	.pgc-emoji-picker__btn img { width: 32px; height: 32px; }
}


/* Live composer: visible contenteditable, hidden textarea keeps :pg-…: shortcodes */
.pgc-emoji-composer {
	position: relative;
	display: block;
	width: 100%;
	max-width: 100%;
}
.pgc-emoji-composer > textarea,
.pgc-emoji-composer > textarea#whats-new,
html body.pgc-style #buddypress #whats-new-form .pgc-emoji-composer textarea#whats-new,
html body.pgc-style #buddypress #whats-new-textarea .pgc-emoji-composer textarea {
	position: absolute !important;
	left: 0 !important;
	top: 0 !important;
	width: 1px !important;
	height: 1px !important;
	min-height: 0 !important;
	max-height: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border: 0 !important;
	opacity: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	pointer-events: none !important;
	resize: none !important;
	background: transparent !important;
	box-shadow: none !important;
}
.pgc-emoji-input {
	display: block;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	white-space: pre-wrap;
	word-wrap: break-word;
	overflow-wrap: break-word;
	overflow-y: auto;
}
.pgc-emoji-input:focus {
	outline: none;
}
.pgc-emoji-input.is-empty:before {
	content: attr(data-placeholder);
	color: #8b95a5;
	pointer-events: none;
}
.pgc-emoji-input img.pgc-emoji {
	cursor: default;
	-webkit-user-drag: none;
	user-select: none;
	pointer-events: none;
}

/* Match the Activity composer surface */
html body.pgc-style #buddypress #whats-new-form .pgc-emoji-input {
	display: block;
	width: 100% !important;
	min-height: 40px !important;
	height: auto;
	padding: 9px 16px !important;
	margin: 0 !important;
	box-sizing: border-box;
	border: 1px solid var(--pgc-line) !important;
	border-radius: 20px !important;
	background: var(--pgc-soft) !important;
	box-shadow: none !important;
	font: 15px/1.4 var(--pgc-font) !important;
	color: var(--pgc-text) !important;
	transition: border-color .15s, background .15s;
}
html body.pgc-style #buddypress #whats-new-form .pgc-emoji-input:focus {
	background: #fff !important;
	border-color: var(--pgc-violet) !important;
	outline: none !important;
}
html body.pgc-style #buddypress #whats-new-form.focus-in .pgc-emoji-input,
html body.pgc-style #buddypress #whats-new-form .pgc-emoji-input:not(.is-empty) {
	min-height: 88px !important;
	border-radius: 14px !important;
}

/* Activity comments / WP comments: inherit typical textarea look if styles were copied */
form.ac-form .pgc-emoji-input,
#commentform .pgc-emoji-input,
.comment-form .pgc-emoji-input {
	min-height: 64px;
}

.pgc-emoji-live-preview {
	margin: 8px 0 0;
	padding: 8px 10px;
	border: 1px dashed #d1d5db;
	border-radius: 10px;
	background: #f8fafc;
	color: #334155;
	font-size: 14px;
	line-height: 1.45;
	min-height: 1.6em;
}
.pgc-emoji-live-preview[hidden] { display: none !important; }
.pgc-emoji-live-preview__label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #6b7280;
	margin: 0 0 4px;
}
