/* v56.13 聊天 (chat.js). Between games: a 💬 in the lobby's bar beside START and SHARE, and in the top corner of the round-end card (out of the
   card's flow, so the card still fits a phone with REMATCH on screen), a line that came in shown next to it for a moment, and the sheet at the
   bottom with the room's lines and the phrases. On the floor: 💬 over the 無雙 button at the right edge (chat.js places it: the stick's zone is the
   left half, and the minimap has the gap beside ♫) and the six phrases to its left, two to a row upright and three in a short landscape phone. */
#chat-open {
	position: absolute;
	z-index: 7;
	top: var(--top);
	right: var(--right);
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid #6d9a94;
	border-radius: 50%;
	background: #0c2733ee;
	color: #f6f0d6;
	font-size: 19px;
	box-shadow: 0 4px 12px #0007;
}
/* In the bar SHARE gives up some width (its words may take two lines), so START's stay on one. */
#room .room-bar.with-chat #room-share {
	flex: 0.8;
	padding-inline: 4px;
}
#room .room-bar #chat-open {
	position: relative;
	top: auto;
	right: auto;
	flex: none;
	width: 44px;
	height: auto;
	min-height: 56px;
	border-radius: 14px;
	box-shadow: none;
}
@media (orientation: landscape) and (max-height: 550px) {
	#room .room-bar #chat-open {
		min-height: 48px;
	}
}
#chat-open[aria-expanded='true'] {
	border: 2px solid #ffe397;
	background: #29494b;
}
#chat-open .n {
	position: absolute;
	top: -5px;
	right: -5px;
	display: none;
	min-width: 18px;
	height: 18px;
	padding: 0 4px;
	box-sizing: border-box;
	border-radius: 999px;
	background: #ffcf4d;
	color: #07171f;
	font: 900 11px/18px system-ui;
}
#chat-open.new .n {
	display: block;
}
#chat-peek {
	position: absolute;
	z-index: 7;
	top: calc(var(--top) + 50px);
	right: var(--right);
	max-width: min(80vw, 320px);
	margin: 0;
	padding: 7px 12px;
	overflow: hidden;
	border: 1px solid #7fa3a3;
	border-radius: 14px;
	background: #0b2530f2;
	color: #f6f0d6;
	font-size: 13px;
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
	box-shadow: 0 4px 12px #0007;
	cursor: pointer;
}
#chat {
	position: absolute;
	z-index: 8;
	left: 50%;
	bottom: var(--bottom);
	display: flex;
	flex-direction: column;
	gap: 6px;
	box-sizing: border-box;
	width: min(calc(100% - 24px), 440px);
	max-height: min(420px, calc(100dvh - var(--top) - var(--bottom) - 52px));
	padding: 8px 10px 10px;
	transform: translateX(-50%);
	border: 1px solid #6d9a94;
	border-radius: 16px;
	background: #081d26f7;
	box-shadow: 0 10px 30px #000a;
	touch-action: pan-y;
	text-align: left;
}
#chat .chat-head {
	display: flex;
	align-items: center;
	gap: 8px;
}
#chat .chat-head strong {
	flex: 1;
	color: #ffe397;
	font-size: 15px;
}
#chat .chat-head button {
	min-width: 44px;
	min-height: 40px;
	padding: 4px 10px;
	border: 1px solid #6d9a94;
	border-radius: 10px;
	background: #12333c;
	color: #e1efe4;
	font: 700 13px system-ui;
}
#chat .chat-mute[aria-pressed='false'] {
	color: #93a39f;
}
#chat-log {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0;
	padding: 4px 6px;
	overflow-y: auto;
	list-style: none;
	border-radius: 10px;
	background: #06151d99;
	font-size: 14px;
	line-height: 1.45;
	overflow-wrap: anywhere;
	user-select: text;
	-webkit-user-select: text;
}
#chat-log li {
	padding: 2px 0;
	color: #f6f0d6;
}
#chat-log li b {
	margin-right: 6px;
	color: #cfe9e3;
	white-space: nowrap;
}
#chat-log li.me b {
	color: #ffcf4d !important;
}
#chat-log .chat-quiet {
	color: #86a7a6;
	font-size: 13px;
	text-align: center;
}
#chat .chat-quick {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}
#chat .chat-quick button,
#chat-pop button {
	flex: none;
	min-height: 44px;
	padding: 4px 12px;
	border: 1px solid #72d7d2;
	border-radius: 999px;
	background: #082630;
	color: #e7f9ed;
	font: 800 14px system-ui;
	white-space: nowrap;
}
#chat .chat-quick button:active,
#chat-pop button:active {
	background: #29494b;
}
#chat-tool {
	position: absolute;
	z-index: 3;
	font-size: 19px;
}
#chat-tool[aria-expanded='true'] {
	border: 2px solid #ffe397;
	background: #29494b;
}
#chat-pop {
	position: absolute;
	z-index: 4;
	display: grid;
	grid-template-columns: repeat(2, minmax(84px, auto));
	gap: 6px;
	padding: 6px;
	border: 1px solid #6d9a94;
	border-radius: 14px;
	background: #0a2129f0;
	box-shadow: 0 6px 18px #0008;
	pointer-events: auto;
	touch-action: manipulation;
}
@media (orientation: landscape) and (max-height: 550px) {
	#chat-pop {
		grid-template-columns: repeat(3, minmax(84px, auto));
	}
}
