.shoutbox {
	overflow: hidden;
}

.shoutbox__head {
	display: flex;
	align-items: center;
	gap: .7em;
	padding: .75em 1em;
	border-bottom: 1px solid var(--border);
	background: color-mix(in srgb, var(--bg) 45%, var(--panel));
}

.shoutbox__icon {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 80%, #fff), color-mix(in srgb, var(--primary) 80%, #000));
	color: var(--on-primary);
}

.shoutbox__head h3 {
	flex: 1;
	font-size: .95em;
	font-style: italic;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.shoutbox__live {
	display: flex;
	align-items: center;
	gap: .4em;
	color: var(--muted);
	font-size: .8em;
}

.shoutbox__live span {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--success);
	box-shadow: 0 0 8px var(--success);
}

.shoutbox__tool {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 7px;
	background: none;
	color: var(--muted);
	cursor: pointer;
}

.shoutbox__tool:hover,
.shoutbox__tool.is-active {
	background: color-mix(in srgb, var(--text) 7%, transparent);
	color: var(--text);
}

.shoutbox.is-collapsed .shoutbox__body {
	display: none;
}

.shoutbox.is-collapsed [data-shoutbox-collapse] i {
	transform: rotate(180deg);
}

.shoutbox__messages {
	display: flex;
	flex-direction: column;
	height: 330px;
	padding: .35em .35em;
	overflow-y: auto;
	scrollbar-width: thin;
}

.shoutbox__empty {
	margin: 0;
	padding: 1em;
	color: var(--muted);
}

.shoutbox__message {
	position: relative;
	display: grid;
	grid-template-columns: 34px minmax(0, 1fr);
	column-gap: .65em;
	row-gap: .05em;
	padding: .4em .55em;
	border-radius: 8px;
}

.shoutbox__message:hover {
	background: color-mix(in srgb, var(--text) 5%, transparent);
}

.shoutbox__message.is-mention {
	background: color-mix(in srgb, var(--primary) 10%, transparent);
	box-shadow: inset 3px 0 var(--primary);
}

.shoutbox__message.is-target {
	animation: shoutbox-target 2s ease-out;
}

@keyframes shoutbox-target {
	from {
		background: color-mix(in srgb, var(--primary) 25%, transparent);
	}
}

.shoutbox__message .avatar {
	--size: 34px;
	grid-row: 1 / span 2;
	border-radius: 8px;
}

.shoutbox__who {
	display: flex;
	align-items: baseline;
	gap: .5em;
	min-width: 0;
	grid-column: 2;
}

.shoutbox__message .username {
	font-weight: 700;
	font-size: .88em;
}

.shoutbox__time {
	flex: none;
	color: var(--muted);
	font-size: .72em;
}

.shoutbox__tagged {
	display: inline-flex;
	align-items: center;
	gap: .3em;
	padding: .05em .45em;
	border-radius: 5px;
	background: color-mix(in srgb, var(--primary) 16%, transparent);
	color: var(--primary);
	font-size: .64rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .03em;
}

.shoutbox__text {
	grid-column: 2;
	color: color-mix(in srgb, var(--text) 86%, transparent);
	font-size: .92em;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.shoutbox__meta {
	position: absolute;
	top: .3em;
	right: .45em;
	display: flex;
	align-items: center;
	gap: .1em;
	padding: .1em .2em;
	border: 1px solid var(--border);
	border-radius: 7px;
	background: var(--panel);
	opacity: 0;
	transition: opacity .12s;
}

.shoutbox__message:hover .shoutbox__meta {
	opacity: 1;
}

.shoutbox__delete {
	display: grid;
	width: 24px;
	height: 24px;
	place-items: center;
	border: 0;
	border-radius: 5px;
	background: none;
	color: var(--muted);
	font-size: .82em;
	cursor: pointer;
}

.shoutbox__delete:hover {
	background: color-mix(in srgb, var(--text) 8%, transparent);
	color: var(--text);
}

.shoutbox__form {
	position: relative;
	display: flex;
	gap: .5em;
	padding: .8em 1em;
	border-top: 1px solid var(--border);
}

.shoutbox__input {
	position: relative;
	flex: 1;
}

.shoutbox__input input {
	padding-right: 3em;
}

.shoutbox__input button {
	position: absolute;
	top: 50%;
	right: .5em;
	border: 0;
	background: none;
	font-size: 1.2em;
	cursor: pointer;
	transform: translateY(-50%);
}

.shoutbox__send {
	width: 44px;
	border: 0;
	border-radius: calc(var(--radius) - 2px);
	background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 80%, #fff), color-mix(in srgb, var(--primary) 80%, #000));
	color: var(--on-primary);
	cursor: pointer;
}

.shoutbox__emoji {
	position: absolute;
	z-index: 5;
	right: 4.5em;
	bottom: calc(100% + 4px);
	display: flex;
	flex-direction: column;
	gap: .55em;
	width: 300px;
	max-height: 320px;
	padding: .6em .7em;
	overflow-y: auto;
	scrollbar-width: thin;
	border: 1px solid var(--border);
	border-radius: 10px;
	background: var(--panel);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

.shoutbox__emoji[hidden] {
	display: none;
}

.shoutbox__emoji-label {
	display: block;
	margin-bottom: .35em;
	color: var(--muted);
	font-size: .66rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .05em;
}

.shoutbox__emoji-label--premium {
	color: #f0b429;
}

.shoutbox__emoji-grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: .15em;
}

.shoutbox__emoji-btn {
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	border: 0;
	border-radius: 6px;
	background: none;
	font-size: 1.25em;
	cursor: pointer;
}

.shoutbox__emoji-btn:hover {
	background: color-mix(in srgb, var(--text) 8%, transparent);
}

.shoutbox__emoji-btn--img img {
	width: 26px;
	height: 26px;
	object-fit: contain;
}

.shoutbox__login {
	margin: 0;
	padding: .9em 1.2em;
	border-top: 1px solid var(--border);
	color: var(--muted);
}

.shoutbox__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: .6em 1.5em;
	padding: .6em 1em;
	border-top: 1px solid var(--border);
	font-size: .82em;
}

.shoutbox__stats {
	display: flex;
	flex-wrap: wrap;
	color: var(--muted);
}

.shoutbox__stat + .shoutbox__stat::before {
	margin: 0 .55em;
	content: "·";
	opacity: .6;
}

.shoutbox__stat b {
	color: var(--text);
	font-weight: 700;
}

.shoutbox__leaders {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .5em .9em;
}

.shoutbox__label {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	color: var(--muted);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.shoutbox__label i {
	color: #f5c542;
}

.shoutbox__top {
	display: flex;
	flex-wrap: wrap;
	gap: .5em 1em;
}

.shoutbox__rank {
	display: inline-flex;
	align-items: center;
	gap: .45em;
}

.shoutbox__medal {
	position: relative;
	display: inline-flex;
}

.shoutbox__medal .avatar {
	--size: 24px;
}

.shoutbox__place {
	position: absolute;
	right: -4px;
	bottom: -3px;
	display: grid;
	width: 13px;
	height: 13px;
	place-items: center;
	border: 2px solid var(--panel);
	border-radius: 50%;
	background: var(--muted);
	color: var(--bg);
	font-size: .55rem;
	font-weight: 800;
	line-height: 1;
	box-sizing: content-box;
}

.shoutbox__rank--1 .shoutbox__place {
	background: #f5c542;
	color: #1a1300;
}

.shoutbox__rank--2 .shoutbox__place {
	background: #cbd5e1;
	color: #111;
}

.shoutbox__rank--3 .shoutbox__place {
	background: #d97706;
	color: #fff;
}

.shoutbox__rank .username {
	max-width: 110px;
	overflow: hidden;
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.shoutbox__rank .username i {
	display: none;
}

.shoutbox__count {
	color: var(--muted);
	font-weight: 600;
}

.shoutbox__none {
	color: var(--muted);
}

.shoutbox__notice {
	margin: 0 1em .6em;
	padding: .6em .9em;
	border-radius: 8px;
	font-size: .88em;
	font-weight: 600;
}

.shoutbox__notice--error {
	background: color-mix(in srgb, #ef4444 16%, transparent);
	color: #fca5a5;
}

.shoutbox__notice--success {
	background: color-mix(in srgb, #22c55e 16%, transparent);
	color: #86efac;
}

.shoutbox__banned {
	display: flex;
	gap: .9em;
	align-items: center;
	margin: 0 1em 1em;
	padding: .9em 1em;
	border: 1px solid color-mix(in srgb, #ef4444 45%, var(--border));
	border-radius: 10px;
	background: color-mix(in srgb, #ef4444 10%, transparent);
}

.shoutbox__banned[hidden],
.shoutbox__notice[hidden],
.shoutbox__bans[hidden],
.shoutbox__form[hidden] {
	display: none;
}

.shoutbox__banned > i {
	color: #ef4444;
	font-size: 1.4rem;
}

.shoutbox__banned div {
	display: grid;
	gap: .15em;
}

.shoutbox__bans {
	display: grid;
	gap: .4em;
	padding: .9em 1em;
	border-top: 1px solid var(--border);
}

.shoutbox__bans .shoutbox__label i {
	color: #ef4444;
}

.shoutbox__ban {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: .8em;
	padding: .45em .6em;
	border-radius: 8px;
	background: color-mix(in srgb, #ef4444 7%, transparent);
	font-size: .88em;
}

.shoutbox__dialog {
	width: min(420px, 92vw);
	padding: 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--panel);
	color: var(--text);
	box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
}

.shoutbox__dialog::backdrop {
	background: rgba(0, 0, 0, .6);
	backdrop-filter: blur(3px);
}

.shoutbox__dialog form {
	display: grid;
	gap: .8em;
	padding: 1.3em;
}

.shoutbox__dialog h4 {
	margin: 0;
	font-size: 1rem;
}

.shoutbox__dialog h4 i {
	color: #ef4444;
}

.shoutbox__dialog-actions {
	display: flex;
	justify-content: flex-end;
	gap: .5em;
}

.shoutbox__gate {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .8em 1em;
	padding: 1.4em;
	background: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in srgb, var(--text) 3%, transparent) 10px 20px);
}

.shoutbox__gate > i {
	display: grid;
	width: 46px;
	height: 46px;
	place-items: center;
	border-radius: 12px;
	background: color-mix(in srgb, var(--primary) 16%, transparent);
	color: var(--primary);
	font-size: 1.2rem;
}

.shoutbox__gate > div {
	flex: 1;
	min-width: 200px;
}

.shoutbox__gate p {
	margin: .2em 0 0;
}

.shoutbox__text .emo {
	height: 2.4em;
	max-width: 3em;
	vertical-align: middle;
	object-fit: contain;
}

.shoutbox__edited {
	color: var(--muted);
	font-size: .75em;
	font-style: italic;
}

.chat-archive {
	display: grid;
	gap: 1em;
	padding: 1.4em;
}

.chat-archive__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 1em;
	align-items: center;
}

.chat-archive__head h1 {
	margin: 0;
	font-size: 1.4rem;
}

.chat-archive__head p {
	margin: .2em 0 0;
}

.chat-archive__filters {
	display: flex;
	flex-wrap: wrap;
	gap: .4em;
	align-items: center;
}

.chat-archive__filters input {
	width: 160px;
}

.chat-archive__list {
	display: grid;
	gap: .2em;
}

.chat-archive__day {
	display: flex;
	align-items: center;
	margin: .8em 0 .3em;
	color: var(--muted);
	font-size: .75rem;
	font-weight: 700;
}

.chat-archive__day::before,
.chat-archive__day::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--border);
}

.chat-archive__day span {
	padding: 0 .8em;
}

.chat-archive__row {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: .7em;
	align-items: start;
	padding: .45em .6em;
	border-radius: 8px;
}

.chat-archive__row:hover {
	background: color-mix(in srgb, var(--text) 3%, transparent);
}

.chat-archive__body {
	display: grid;
	gap: .1em;
}

.chat-archive__meta {
	font-size: .85rem;
}

.chat-archive__meta time {
	margin-left: .3em;
	color: var(--muted);
	font-size: .78rem;
}

.chat-archive__text {
	overflow-wrap: anywhere;
}

.chat-archive__text .emo {
	height: 1.5em;
}
