.chat {
  margin: 0.8em 1em 1.2em;
  background: #fff;
  border: 2px solid #000;
  box-shadow: 4px 4px 0 #000;
  font-family: vtFont, "Courier New", monospace;
  display: flex;
  flex-direction: column;
}

.chat__bar {
  background: #fff;
  color: #000;
  border-bottom: 2px solid #000;
  font-size: 0.85em;
  line-height: 1.6em;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0 0.5em;
}
.chat__bar::before,
.chat__bar::after {
  content: "";
  flex: 1;
  min-width: 0;
  height: 0.45em;
  background: repeating-linear-gradient(
    to bottom,
    #000 0 1px,
    transparent 1px 3px
  );
}

.chat__log {
  list-style: none;
  margin: 0;
  padding: 0.4em 0.6em;
  display: flex;
  flex-direction: column;
  height: 14em;
  overflow: hidden;
  font-size: 0.8em;
  line-height: 1.3;
}

.chat__log > li::before {
  content: none;
}

.chat__msg {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  padding: 0.1em 0;
  animation: chat-fade 260ms ease-out;
}

@keyframes chat-fade {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat__time {
  color: #666;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.chat__user {
  background: #000;
  color: #fff;
  padding: 0 0.35em;
  letter-spacing: 0.04em;
  flex: 0 0 auto;
  white-space: nowrap;
  max-width: 9em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat__body {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}

.chat__mention {
  color: #1a8a3a;
  font-weight: bold;
  margin-right: 0.25em;
}

@media (max-width: 640px) {
  .chat {
    margin: 0.6em 1em 1em;
    box-shadow: 3px 3px 0 #000;
  }
  .chat__log {
    height: 12em;
    font-size: 0.85em;
  }
  .chat__user {
    max-width: 7em;
  }
}
