/* The chat is a pager: it slides in with a message or when Enter opens it, then fades away; text on a green LCD. */
#chat {
  position: absolute;
  left: 16px;
  top: 50%;
  width: min(330px, calc(100% - 32px));
  pointer-events: none;
  opacity: 0;
  transform: translate(-120%, -50%);
  transition:
    opacity 0.8s ease-out,
    transform 0s 0.8s;
}
#chat.on {
  opacity: 1;
  transform: translateY(-50%);
  transition:
    transform 0.25s ease-out,
    opacity 0.2s;
}
#chat .pbody {
  background: linear-gradient(#3b3936, #24231f);
  border: 2px solid #55514b;
  border-radius: 18px;
  padding: 8px 10px 12px;
  box-shadow: 0 6px 0 #0005;
}
#chat .phead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font:
    600 10px/1 system-ui,
    sans-serif;
  letter-spacing: 3px;
  color: #9a948a;
}
#chat .led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5a2420;
}
#chat .led.new {
  animation: pagerled 0.3s 6;
}
@keyframes pagerled {
  50% {
    background: var(--red);
    box-shadow: 0 0 8px var(--red);
  }
}
#chat .lcd {
  background: #a9b88a;
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 64px;
  box-shadow: inset 0 2px 5px #0006;
  color: #27301f;
  font:
    13px/1.3 ui-monospace,
    'Courier New',
    monospace;
  text-transform: uppercase;
  text-shadow: 1px 1px 0 #27301f33;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
#chatlog {
  display: flex;
  flex-direction: column;
  max-height: 118px;
  overflow: hidden;
}
#chatlog .msg:first-child {
  margin-top: auto;
}
#chatlog .msg {
  overflow-wrap: anywhere;
  padding: 1px 0;
}
#chatlog .msg b {
  font-weight: 700;
}
#chatlog .msg b::after {
  content: ':';
}
#chat .pbtns {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}
#chat .pbtns button {
  pointer-events: auto;
  width: 54px;
  padding: 3px 0;
  border-radius: 6px;
  background: #15140f;
  color: #c9c3b7;
  font-size: 10px;
  line-height: 1;
  box-shadow: 0 2px 0 #fff2;
}
#chat:not(.on) .pbtns button {
  pointer-events: none;
}
@media (pointer: fine) and (min-width: 641px) {
  body:not(.touch) #chat.on .pbody {
    pointer-events: auto;
    cursor: grab;
  }
  body:not(.touch) #chat.drag .pbody {
    cursor: grabbing;
  }
}
#chat .pbtns button:active {
  transform: translateY(1px);
  box-shadow: none;
}
#chatin {
  pointer-events: auto;
  width: 100%;
  margin-top: 4px;
  padding: 0;
  border: 0;
  border-top: 1px dashed #27301f66;
  background: none;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  text-shadow: inherit;
  outline: 0;
  user-select: text;
  -webkit-user-select: text;
}
#chatin::placeholder {
  color: #27301f88;
}
