.game-chat {
  position: absolute;
  inset-inline-start: clamp(.55rem, 1.4vw, 1.5rem);
  bottom: 3rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: min(25rem, calc(50% - 17rem));
  min-width: 13rem;
  border: 1px solid #ac947365;
  border-radius: .3rem;
  color: #eee9dc;
  color-scheme: dark;
  background: #0d151ddc;
  box-shadow: 0 8px 28px #0005;
  font: 12px/1.4 Arial, sans-serif;
}
.game-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 2rem;
  padding: .2rem .5rem .2rem .65rem;
  color: #e6d0a0;
  border-bottom: 1px solid #ac94733e;
}
.game-chat button, .game-chat input, .game-chat select { font: inherit; color: inherit; }
.game-chat button {
  border: 1px solid #8695a45f;
  border-radius: .2rem;
  background: #1d2832;
  padding: .26rem .45rem;
}
.game-chat button:enabled:hover { border-color: #e6d0a0; }
.game-chat button:disabled { cursor: default; opacity: .52; }
.game-chat__open kbd { padding: .12rem .25rem; }
.game-chat__history {
  height: clamp(4.5rem, 22vh, 14rem);
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  touch-action: pan-y;
  margin: 0;
  padding: .5rem .65rem;
  list-style: none;
}
.game-chat__entry { overflow-wrap: anywhere; color: var(--chat-color, #eee9dc); }
.game-chat__entry + .game-chat__entry { margin-top: .22rem; }
.game-chat__channel-tag { margin-inline-end: .32rem; opacity: .82; }
.game-chat__sender { font-weight: 600; }
.game-chat__compose { padding: .45rem; border-top: 1px solid #ac94733e; }
.game-chat__controls { display: flex; flex-wrap: wrap; align-items: stretch; gap: .32rem; }
.game-chat__controls :is(input, select) {
  min-width: 0;
  min-height: 1.9rem;
  border: 1px solid #8695a47a;
  border-radius: .2rem;
  background: #111922;
  padding: .26rem .38rem;
}
.game-chat__controls select { width: min(8.4rem, 45%); color: var(--chat-color, #eee9dc); }
.game-chat__controls select option { color: var(--chat-color, #eee9dc); }
#game-chat-recipient { flex-basis: calc(100% - min(8.4rem, 45%) - .32rem); }
#game-chat-message { flex: 1 1 6rem; }
.game-chat__status { color: #ecd8ad; margin: .3rem 0 0; overflow-wrap: anywhere; }
.game-chat [data-chat-channel="party"] { --chat-color: #ffabc9; }
.game-chat [data-chat-channel="guild"] { --chat-color: #8ce979; }
.game-chat [data-chat-channel="trade"] { --chat-color: #ffbd66; }
.game-chat [data-chat-channel="private-channel"] { --chat-color: #f0e480; }
.game-chat [data-chat-channel="whisper"] { --chat-color: #c2a8ff; }
.game-chat [data-chat-channel="shout"] { --chat-color: #70bfff; }
.game-chat [data-chat-channel="megaphone"] { --chat-color: #79f0f7; }
.game-chat [data-chat-channel="nation-megaphone"] { --chat-color: #ff917d; }
@media (max-width: 1020px) {
  .game-chat { width: min(24rem, calc(100% - 1.1rem)); bottom: calc(var(--ep39-hud-inset, 8.5rem) + .35rem); }
  .game-chat__history { height: clamp(3.2rem, 15vh, 7rem); }
}
