/* The chat panel's look: client/style.css's .chat-* rules, copied (the native page loads no legacy
   stylesheet). The panel itself is client/chat.ts, bundled by build.sh into assets/chat.js. */
.chat-layer {
  position: absolute;
  left: 24px;
  bottom: 168px;
  /* Options > Chat writes --mc-chat-width, --mc-chat-scale and --mc-chat-opacity (client/settings.ts). */
  width: calc(min(460px, 46 * var(--vw)) * var(--mc-chat-width, 1));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  z-index: 6;
}
.chat-log {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: calc(34 * var(--vh));
  overflow-y: auto;
  padding: 2px 2px 0;
  opacity: 0;
  transition: opacity 0.25s ease;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.chat-layer.recent .chat-log,
.chat-layer.active .chat-log {
  opacity: 1;
}
.chat-layer.active .chat-log {
  pointer-events: auto;
  background: #f3f6e8d9;
  border: 1px solid #ffffffb3;
  border-radius: 7px;
  padding: 9px 11px;
  box-shadow: 0 5px 25px #1e362529;
}
.chat-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: calc(12px * var(--mc-chat-scale, 1));
  line-height: 1.45;
  color: #2f4234;
  word-break: break-word;
}
.chat-layer:not(.active) .chat-line {
  background: rgb(243 246 232 / calc(0.816 * var(--mc-chat-opacity, 1)));
  border-radius: 5px;
  padding: 2px 7px;
  width: fit-content;
  max-width: 100%;
}
.chat-line > time {
  flex: none;
  font-size: calc(9px * var(--mc-chat-scale, 1));
  letter-spacing: 0.4px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.75;
}
.chat-line > b {
  flex: none;
  font-weight: 500;
  color: var(--green);
}
.chat-line > b::after {
  content: ':';
  color: var(--muted);
}
.chat-line.chat-own > b {
  color: #7a5c2e;
}
.chat-line.chat-system {
  color: #5c6a56;
  font-style: italic;
}
.chat-line.chat-pending {
  opacity: 0.6;
}
.chat-line.chat-rejected {
  color: #965b42;
}
.chat-note {
  flex: none;
  font-size: calc(9px * var(--mc-chat-scale, 1));
  font-style: normal;
  letter-spacing: 0.3px;
  color: #8a8f7d;
  text-transform: uppercase;
}
.chat-entry {
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
  background: #f3f6e8f5;
  border: 1px solid #ffffffcc;
  border-radius: 7px;
  padding: 9px 12px;
  box-shadow: 0 5px 25px #1e362529;
}
.chat-prompt {
  flex: none;
  font-size: 9px;
  letter-spacing: 1.2px;
  color: var(--muted);
}
.chat-entry input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: calc(13px * var(--mc-chat-scale, 1));
  color: var(--ink);
  outline: none;
}
.chat-count {
  flex: none;
  font-size: 9px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.chat-count.over {
  color: #965b42;
}
/* vmon's chat channels (lane L9): a label and colour per channel, a tap on a name to whisper, and
   Report on other players' lines. */
button.chat-prompt {
  border: 1px solid #c9cfb8;
  border-radius: 5px;
  background: #fff8;
  padding: 3px 6px;
  font: inherit;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
}
.chat-channel {
  flex: none;
  font-size: calc(10px * var(--mc-chat-scale, 1));
  font-style: normal;
  font-weight: 600;
  color: var(--muted);
}
.chat-ch-trade .chat-channel,
.chat-ch-trade > span {
  color: #8a5a12;
}
.chat-ch-local .chat-channel,
.chat-ch-local > span {
  color: #2d5f8a;
}
.chat-ch-club .chat-channel,
.chat-ch-club > span {
  color: #3d7a3a;
}
.chat-ch-whisper .chat-channel,
.chat-ch-whisper > span {
  color: #8a3a7a;
  font-style: italic;
}
.chat-layer.active .chat-name {
  cursor: pointer;
  text-decoration: underline dotted;
}
.chat-report {
  flex: none;
  margin-left: auto;
  border: 0;
  background: none;
  padding: 0 2px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
}
.chat-layer.active .chat-report {
  opacity: 0.6;
}
.chat-layer:not(.active) .chat-report {
  display: none;
}
/* With a channel label the line is longer: the text takes the rest, or its own row when narrow. */
.chat-line:has(> .chat-channel) {
  flex-wrap: wrap;
  column-gap: 5px;
  row-gap: 0;
}
.chat-line:has(> .chat-channel) > span {
  flex: 1 1 10em;
  min-width: 0;
}
/* vmon: a line from a staff account (the server sets `staff`). */
.chat-staff {
  flex: none;
  padding: 0 5px;
  border-radius: 4px;
  background: #965b42;
  color: #fff;
  font-size: calc(9px * var(--mc-chat-scale, 1));
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.6px;
}
