/* A small floating companion, independent of the game canvas and its scaled rem units. */
.room-chat { position: fixed; z-index: 30; width: 176px; max-width: var(--chat-width); color: var(--text-hi);
  background: #141b18; border: 1px solid #476258; border-radius: 8px; box-shadow: 0 4px 18px #0008;
  font: 14px/1.5 "Noto Sans SC", sans-serif; box-sizing: border-box; overflow: hidden; }
.room-chat--open { width: 312px; max-height: var(--chat-height); display: flex; flex-direction: column; }
.room-chat--preview { width: 288px; }
.room-chat__header { display: flex; align-items: center; flex: 0 0 44px; min-width: 0; height: 44px; background: #1a2922; }
.room-chat button { min-width: 44px; min-height: 44px; height: 44px; flex-shrink: 0; padding: 0 8px; border: 0;
  border-radius: 0; background: transparent; color: var(--text-hi); font: inherit; cursor: pointer; }
.room-chat button:hover:not(:disabled) { background: #2c4237; }
.room-chat button:focus-visible, .room-chat input:focus-visible { outline: 2px solid var(--mint-400); outline-offset: -3px; }
.room-chat button:disabled { color: #a2aba6; cursor: default; }
.room-chat__move { cursor: grab !important; touch-action: none; user-select: none; font-size: 24px !important; color: var(--mint-400) !important; }
.room-chat__move:active { cursor: grabbing !important; }
.room-chat__title { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; }
.room-chat__title small { color: #b5c9bd; font-size: 11px; display: block; line-height: 1.1; }
.room-chat__toggle { flex: 1; display: flex; gap: 8px; align-items: center; justify-content: space-between; font-weight: 700 !important; }
.room-chat__summary { min-width: 0; flex: 1; text-align: left; }
.room-chat__label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-chat--preview .room-chat__header, .room-chat--empty .room-chat__header { height: auto; min-height: 44px; align-items: flex-start; }
.room-chat--preview .room-chat__toggle, .room-chat--empty .room-chat__toggle { min-width: 0; height: auto; padding: 7px 8px; }
.room-chat--preview .room-chat__label { font-size: 12px; color: #b5c9bd; }
.room-chat__placeholder { display: block; font-size: 12px; font-weight: 400; color: #b5c9bd; }
.room-chat__preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; font-weight: 400; font-size: 14px; line-height: 20px; }
.room-chat__badge { min-width: 24px; padding: 0 4px; font-size: 12px; border-radius: 12px; background: var(--mint-400); color: #06110d; }
.room-chat__body { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.room-chat__log { height: min(180px, calc(var(--chat-height) * .28)); min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 10px 12px;
  scrollbar-width: thin; flex: 1 1 auto; }
.room-chat__message { margin-bottom: 12px; overflow-wrap: anywhere; }
.room-chat__message:last-child { margin-bottom: 0; }
.room-chat__meta { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: 12px; color: #c3cbc7; }
.room-chat__meta strong { color: #c3cbc7; font-weight: 700; }
.room-chat__message--own .room-chat__meta strong { color: var(--mint-400); }
.room-chat__meta time { color: #a5b2ab; font-size: 11px; white-space: nowrap; }
.room-chat__message p { margin: 2px 0 0; white-space: pre-wrap; font-size: 14px; line-height: 1.5; }
.room-chat__empty { margin: 24px 0; font-size: 13px; color: #bac6be; line-height: 1.7; }
.room-chat__form { display: flex; gap: 6px; padding: 8px 8px 0; flex-shrink: 0; }
.room-chat__form input { box-sizing: border-box; flex: 1; min-width: 0; height: 44px; padding: 0 9px; border: 1px solid #526a5e;
  border-radius: 4px; color: var(--text-hi); background: #0e1511; font: 16px/1.5 "Noto Sans SC", sans-serif; }
.room-chat__form input::placeholder { color: #aab8af; }
.room-chat__form button { border-radius: 4px; color: #06110d; background: var(--mint-400); font-size: 14px; font-weight: 700; }
.room-chat__form button:hover:not(:disabled) { background: #89ffdc; }
.room-chat__form button:disabled { background: #303e35; color: #b6c0ba; }
.room-chat__hint { padding: 5px 10px 8px; color: #b6c6bc; font-size: 11px; line-height: 1.5; flex-shrink: 0; }
.room-chat__jump { font-size: 12px !important; flex-shrink: 0; border-top: 1px solid #476258 !important; color: var(--mint-400) !important; }
.room-chat__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
