:root {
	color-scheme: dark;
	font-family: "Pixelon", sans-serif;
	background: #181828;
	color: #f5edff;
}

body {
	display: grid;
	min-height: 100vh;
	padding: 24px;
	place-items: center;
	background: #181828;
}

body::before {
	inset: -15px;
	background: url("../images/backgrounds/valenberg/space.gif") center/cover no-repeat;
	filter: blur(5px);
}

.guestbook-shell {
	display: flex;
	width: min(100%, 720px);
	min-height: min(720px, calc(100vh - 48px));
	flex-direction: column;
	margin: 0 auto;
	padding: clamp(18px, 4vw, 30px);
	border: 1px solid rgba(224, 184, 255, .24);
	border-radius: 15px;
	background:
		radial-gradient(ellipse at 100% 100%, rgba(116, 49, 171, .22), transparent 58%),
		linear-gradient(145deg, rgba(42, 16, 69, .92), rgba(17, 15, 36, .9));
	box-shadow: inset 0 1px rgba(255, 255, 255, .08), 0 12px 30px rgba(12, 4, 25, .3);
	backdrop-filter: blur(9px);
}

.guestbook-header {
	display: flex;
	min-height: 38px;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid rgba(224, 184, 255, .18);
	color: rgba(238, 232, 247, .72);
	font-size: .66rem;
	letter-spacing: .06em;
}

.guestbook-menu {
	color: inherit;
	text-decoration: none;
}

.guestbook-menu span {
	margin-right: 4px;
	color: #c397ff;
}

.guestbook-label,
.guestbook-footer,
.guestbook-count,
.guestbook-message-count,
.guestbook-status {
	font-family: "Pixelon", monospace;
}

.guestbook-label {
	letter-spacing: .12em;
}

.guestbook-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 16px 0 0;
}

.guestbook-content h1 {
	margin: 0;
	color: #f5edff;
	font-size: clamp(1.35rem, 4vw, 1.8rem);
	font-weight: 400;
	line-height: 1.5;
	text-shadow: 0 0 20px rgba(141, 90, 255, .18);
}

.guestbook-count {
	min-height: 16px;
	margin: 3px 0 14px;
	color: rgba(238, 232, 247, .62);
	font-size: .58rem;
	font-family: "Pixelon", monospace;
}

.guestbook-list {
	display: flex;
	max-height: min(56vh, 360px);
	flex-direction: column;
	gap: 7px;
	overflow-y: auto;
	margin: 0;
	padding: 0 5px 8px 4px;
	list-style: none;
	scrollbar-color: rgba(224, 184, 255, .42) transparent;
	scrollbar-width: thin;
}

.guestbook-entry {
	flex: 0 0 auto;
	padding: 10px 11px 11px;
	border: 1px solid rgba(224, 184, 255, .16);
	border-radius: 9px;
	background: rgba(255, 255, 255, .045);
	transition: border-color 160ms ease, background-color 160ms ease;
}

.guestbook-entry:hover {
	border-color: rgba(224, 184, 255, .34);
	background: rgba(141, 90, 255, .08);
}

.guestbook-entry-header {
	display: flex;
	min-height: 15px;
	align-items: center;
	gap: 10px;
}

.guestbook-name {
	overflow: hidden;
	color: #f5edff;
	font-family: Arial, Helvetica, sans-serif;
	font-size: .82rem;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.guestbook-name-link {
	text-decoration: underline;
	text-underline-offset: 2px;
}

.guestbook-entry-meta {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-left: auto;
	color: rgba(238, 232, 247, .56);
	font-size: .58rem;
	font-family: "Pixelon", monospace;
	white-space: nowrap;
}

.guestbook-like {
	display: inline-flex;
	min-width: 24px;
	min-height: 24px;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 2px;
	border: 0;
	background: transparent;
	color: rgba(238, 232, 247, .68);
	font: inherit;
	cursor: pointer;
}

.guestbook-like:disabled {
	cursor: default;
}

.guestbook-like[aria-pressed="true"] {
	color: #e6d5ff;
}

.guestbook-heart {
	font-size: .8rem;
	line-height: 1;
}

.guestbook-message {
	margin: 5px 0 0;
	color: rgba(238, 232, 247, .82);
	font-size: .79rem;
	line-height: 1.5;
	overflow-wrap: anywhere;
	white-space: pre-wrap;
}

.guestbook-status {
	margin: 0;
	color: rgba(238, 232, 247, .64);
	font-size: .62rem;
	font-family: "Pixelon", monospace;
	line-height: 1.6;
}

.guestbook-list + .guestbook-status:not(:empty) {
	padding: 4px 4px 12px;
}

.guestbook-open-form {
	width: 100%;
	min-height: 46px;
	margin-top: auto;
	padding: 12px 2px 10px;
	border: 0;
	border: 1px solid rgba(224, 184, 255, .28);
	border-radius: 8px;
	background: rgba(141, 90, 255, .14);
	color: #e6d5ff;
	font: inherit;
	font-size: .76rem;
	text-align: left;
	cursor: pointer;
}

.guestbook-open-form:hover,
.guestbook-cancel:hover {
	color: #fff;
}

.guestbook-open-form:hover {
	border-color: rgba(224, 184, 255, .55);
	background: rgba(141, 90, 255, .28);
}

.guestbook-compose {
	margin: 0 0 8px;
}

.guestbook-compose[hidden],
.guestbook-website-field[hidden] {
	display: none;
}

.guestbook-form {
	display: grid;
	gap: 8px;
}

.guestbook-field-label {
	margin-top: 5px;
	color: rgba(238, 232, 247, .82);
	font-size: .67rem;
}

.guestbook-field-label span {
	color: rgba(238, 232, 247, .52);
}

.guestbook-form input[type="text"],
.guestbook-form input[type="url"],
.guestbook-form textarea {
	width: 100%;
	border: 1px solid rgba(224, 184, 255, .2);
	border-radius: 7px;
	background: rgba(9, 8, 24, .32);
	color: #f5edff;
	font: inherit;
	font-size: .78rem;
}

.guestbook-form input[type="text"],
.guestbook-form input[type="url"] {
	min-height: 40px;
	padding: 9px;
}

.guestbook-form textarea {
	min-height: 82px;
	resize: vertical;
	padding: 10px;
	line-height: 1.5;
}

.guestbook-form input::placeholder,
.guestbook-form textarea::placeholder {
	color: rgba(238, 232, 247, .42);
	opacity: 1;
}

.guestbook-form input:focus-visible,
.guestbook-form textarea:focus-visible {
	outline: 1px solid #c397ff;
	outline-offset: 1px;
	border-color: rgba(195, 151, 255, .76);
}

.website-toggle {
	display: inline-flex;
	width: fit-content;
	align-items: center;
	gap: 8px;
	margin: 2px 0 1px;
	color: rgba(238, 232, 247, .66);
	font-size: .62rem;
	cursor: pointer;
}

.website-toggle input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.checkbox-mark {
	display: grid;
	width: 18px;
	height: 18px;
	place-items: center;
	border: 1px solid rgba(224, 184, 255, .28);
	border-radius: 3px;
	color: #e6d5ff;
}

.website-toggle input:checked + .checkbox-mark {
	border-color: #c397ff;
	background: rgba(141, 90, 255, .2);
}

.website-toggle input:checked + .checkbox-mark::after {
	content: "✓";
	font-size: .75rem;
}

.website-toggle input:focus-visible + .checkbox-mark {
	outline: 2px solid #c397ff;
	outline-offset: 2px;
}

.guestbook-message-count {
	margin-top: -3px;
	color: rgba(238, 232, 247, .6);
	font-size: .58rem;
	font-family: "Pixelon", monospace;
}

.guestbook-form-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 5px;
}

.guestbook-submit {
	min-height: 36px;
	padding: 8px 12px;
	border: 1px solid rgba(224, 184, 255, .28);
	border-radius: 7px;
	background: rgba(141, 90, 255, .14);
	color: #e6d5ff;
	font: inherit;
	font-size: .62rem;
	cursor: pointer;
}

.guestbook-submit:disabled {
	color: rgba(238, 232, 247, .36);
	cursor: not-allowed;
}

.guestbook-cancel {
	padding: 8px 0;
	border: 0;
	background: transparent;
	color: rgba(238, 232, 247, .72);
	font: inherit;
	font-size: .64rem;
	cursor: pointer;
}

.guestbook-form-status:not(:empty) {
	margin-top: 2px;
}

.guestbook-honeypot {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
}

.guestbook-footer {
	display: flex;
	min-height: 38px;
	align-items: center;
	justify-content: flex-end;
	gap: 6px;
	color: rgba(238, 232, 247, .64);
	font-size: .61rem;
	letter-spacing: .07em;
}

.guestbook-version {
	color: rgba(195, 151, 255, .6);
}

@media (max-width: 480px) {
	.guestbook-shell {
		min-height: calc(100vh - 32px);
		padding: 16px;
	}

	.guestbook-content h1 {
		font-size: 1.08rem;
	}

	.guestbook-list {
		max-height: 50vh;
	}
}

@media (prefers-reduced-motion: reduce) {
	.guestbook-list {
		scroll-behavior: auto;
	}
}
