.chat-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 17px;
  color: #3a1f08;
  line-height: 1.32;
  scrollbar-width: thin;
  scrollbar-color: rgba(140, 95, 45, 0.5) transparent;
  padding-right: 2px;
}

.chat-ec-notifier-strip {
  position: absolute;
  left: -42px;
  bottom: 6px;
  transform: none;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  width: 36px;
  align-items: center;
  justify-content: flex-start;
  z-index: 12;
  pointer-events: auto;
}

.chat-ec-notifier-strip.hidden {
  display: none !important;
}

.chat-ec-notifier-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 182, 182, 0.52);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 112, 112, 0.34), rgba(255, 112, 112, 0) 58%),
    linear-gradient(180deg, rgba(68, 10, 18, 0.96), rgba(34, 6, 12, 0.96));
  color: #f3f7ff;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 1px rgba(92, 8, 20, 0.65),
    0 0 8px rgba(255, 76, 76, 0.38),
    0 0 18px rgba(168, 18, 40, 0.34),
    0 8px 18px rgba(0, 0, 0, 0.28);
  animation: chat-ec-notifier-pulse 1.8s ease-in-out infinite;
}

.chat-ec-notifier-btn:hover {
  border-color: rgba(255, 214, 214, 0.86);
  transform: translateY(-1px) scale(1.06);
  box-shadow:
    0 0 0 1px rgba(125, 12, 26, 0.72),
    0 0 12px rgba(255, 90, 90, 0.58),
    0 0 28px rgba(190, 18, 50, 0.42),
    0 10px 20px rgba(0, 0, 0, 0.32);
}

.chat-ec-notifier-btn-patchnote {
  border-color: rgba(179, 216, 255, 0.64);
  background:
    radial-gradient(circle at 50% 42%, rgba(124, 176, 255, 0.34), rgba(124, 176, 255, 0) 58%),
    linear-gradient(180deg, rgba(12, 34, 70, 0.96), rgba(8, 22, 44, 0.96));
  box-shadow:
    0 0 0 1px rgba(20, 55, 108, 0.62),
    0 0 8px rgba(93, 155, 255, 0.36),
    0 0 18px rgba(42, 112, 240, 0.34),
    0 8px 18px rgba(0, 0, 0, 0.28);
}

.chat-ec-notifier-btn-patchnote-pinned {
  border-color: rgba(255, 214, 120, 0.74);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 214, 104, 0.36), rgba(255, 214, 104, 0) 58%),
    linear-gradient(180deg, rgba(82, 44, 8, 0.96), rgba(48, 26, 6, 0.96));
  box-shadow:
    0 0 0 1px rgba(128, 78, 16, 0.66),
    0 0 10px rgba(255, 200, 72, 0.42),
    0 0 22px rgba(214, 140, 22, 0.38),
    0 8px 18px rgba(0, 0, 0, 0.3);
}

.chat-ec-notifier-btn-patchnote .chat-ec-notifier-badge {
  border-color: rgba(218, 235, 255, 0.92);
  background: linear-gradient(180deg, #9bc5ff, #2b63be);
  color: #f5faff;
  text-shadow: 0 1px 0 rgba(12, 42, 88, 0.75);
  box-shadow: 0 0 8px rgba(101, 167, 255, 0.6);
}

.chat-ec-notifier-btn-patchnote-pinned .chat-ec-notifier-badge {
  border-color: rgba(255, 236, 191, 0.96);
  background: linear-gradient(180deg, #ffe194, #d88e1f);
  color: #4a2a0c;
  text-shadow: none;
  box-shadow: 0 0 8px rgba(255, 188, 75, 0.6);
}

.chat-ec-notifier-btn-patchnote img,
.chat-ec-notifier-btn-patchnote-pinned img {
  filter:
    drop-shadow(0 0 1px rgba(247, 252, 255, 0.92))
    drop-shadow(0 0 4px rgba(88, 156, 255, 0.65));
}

.chat-ec-notifier-btn img {
  width: 28px;
  height: 28px;
  pointer-events: none;
  image-rendering: pixelated;
  filter:
    drop-shadow(0 0 1px rgba(255, 248, 248, 0.92))
    drop-shadow(0 0 4px rgba(255, 80, 80, 0.7));
}

.chat-ec-notifier-badge {
  position: absolute;
  right: -5px;
  top: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border: 1px solid rgba(255, 227, 227, 0.92);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff8f8f, #b71428);
  color: #fff8f8;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 0 rgba(86, 0, 14, 0.65);
  box-shadow: 0 0 8px rgba(255, 92, 92, 0.52);
  pointer-events: none;
}

.chat-ec-notifier-btn::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  box-shadow: inset 0 0 10px rgba(255, 124, 124, 0.16);
  pointer-events: none;
}

@keyframes chat-ec-notifier-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(92, 8, 20, 0.65),
      0 0 8px rgba(255, 76, 76, 0.32),
      0 0 18px rgba(168, 18, 40, 0.28),
      0 8px 18px rgba(0, 0, 0, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(125, 12, 26, 0.72),
      0 0 12px rgba(255, 98, 98, 0.5),
      0 0 24px rgba(196, 22, 48, 0.4),
      0 8px 18px rgba(0, 0, 0, 0.3);
  }
}

body.game-active .chat-log,
body.game-active .chat-log * {
  user-select: text;
  -webkit-user-select: text;
}

.chat-channel-group {
  margin-bottom: 6px;
  border: 1px solid rgba(120, 78, 36, 0.45);
  border-radius: 4px;
  background: rgba(248, 227, 184, 0.55);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-channel-head {
  position: relative;
  text-align: center;
  font-weight: 700;
  color: #6a3d12;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 13px;
  line-height: 1;
  padding: 4px 6px 4px 24px;
  border-bottom: 1px solid rgba(120, 78, 36, 0.35);
  background: linear-gradient(180deg, rgba(238, 205, 152, 0.8), rgba(224, 182, 120, 0.72));
}

.chat-channel-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.chat-channel-btn {
  border: 0;
  border-right: 1px solid rgba(120, 78, 36, 0.18);
  border-bottom: 1px solid rgba(120, 78, 36, 0.22);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(255, 247, 224, 0.55);
  color: #4a2a0c;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.chat-channel-btn:nth-child(2n) {
  border-right: 0;
}

.chat-channel-btn:last-child,
.chat-channel-btn:nth-last-child(2) {
  border-bottom: 0;
}

.chat-channel-btn:hover {
  background: rgba(255, 244, 205, 0.85);
}

.chat-channel-btn.is-active {
  background: rgba(232, 187, 118, 0.45);
  color: #3f2209;
}

.chat-channel-count {
  color: rgba(74, 42, 12, 0.78);
  font-weight: 700;
  font-size: 11px;
}

.chat-hauschat-close-btn {
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  color: #8a2a12;
  cursor: pointer;
}

.chat-line {
  margin-bottom: 2px;
  word-break: break-word;
  position: relative;
  padding-left: 3px;
  padding-right: 46px;
}

.chat-line-admin-notice {
  background: rgba(255, 235, 120, 0.8);
  border: 1px solid rgba(176, 140, 20, 0.65);
  border-radius: 4px;
  padding: 3px 6px;
}

.chat-line-mentioned {
  background: rgba(255, 243, 147, 0.92);
  border: 1px solid rgba(174, 138, 20, 0.72);
  border-radius: 4px;
  padding: 3px 6px;
}

.chat-message {
  padding-left: 3px;
}

.chat-message-admin-notice {
  color: #0c3ea8;
  font-weight: 800;
}

.chat-message-red {
  color: #b3261e;
  font-weight: 800;
}

.chat-message-bold {
  font-weight: 800;
}

.chat-message-owner-announcement {
  color: #1c4fa0;
  font-weight: 700;
}

.chat-line-deleted {
  background: #ffffff;
  border: 1px solid rgba(120, 82, 44, 0.28);
  border-radius: 4px;
  padding: 3px 6px;
}

.chat-message-deleted {
  color: #782a0c;
  font-weight: 400;
  font-style: italic;
  font-size: inherit;
  text-decoration: none;
}

.chat-message-delete-btn {
  display: none !important;
}

.chat-message-delete-btn:hover {
  background: rgba(255, 214, 206, 0.98);
}

/* Large Delete Button - Double size with adjacent checkbox */
.chat-message-delete-btn-lg {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 1px solid rgba(120, 20, 20, 0.55);
  background: rgba(255, 238, 232, 0.92);
  color: #8f1616;
  border-radius: 4px;
  font-size: 18px;
  font-weight: bold;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.chat-message-delete-btn-lg:hover {
  background: rgba(255, 214, 206, 0.98);
}

.chat-message-delete-checkbox {
  position: absolute;
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  accent-color: #8f1616;
  cursor: pointer;
  margin: 0;
}

.chat-message-evidence-checkbox {
  display: none !important;
}

.chat-user-role-badge {
  color: #ff0000;
  font-weight: bold;
  margin-left: 4px;
}

.chat-moderation-backdrop {
  position: fixed;
  inset: 0;
  z-index: 11999;
}

.chat-moderation-dialog {
  position: fixed;
  z-index: 12000;
  width: 340px;
  background: linear-gradient(180deg, rgba(255, 248, 226, 0.98), rgba(245, 222, 182, 0.98));
  border: 1px solid rgba(120, 78, 36, 0.62);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 10px;
  color: #3f2209;
}

.chat-moderation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-moderation-title {
  font-weight: 800;
  margin-bottom: 0;
}

.chat-moderation-close {
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 3px;
  background: rgba(255, 241, 210, 0.9);
  color: #4a2a0c;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 8px;
  cursor: pointer;
}

.chat-moderation-close:hover {
  background: rgba(237, 204, 143, 0.94);
}

.chat-moderation-preset-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-bottom: 6px;
}

.chat-moderation-preset,
.chat-moderation-btn {
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 3px;
  background: rgba(255, 241, 210, 0.9);
  color: #4a2a0c;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
}

.chat-moderation-btn.is-selected {
  background: rgba(237, 204, 143, 0.94);
}

.chat-moderation-preset.is-active {
  background: rgba(237, 204, 143, 0.94);
}

.chat-moderation-minutes,
.chat-moderation-reason {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 3px;
  background: rgba(255, 250, 235, 0.96);
  color: #3f2209;
  padding: 5px 6px;
  font-size: 12px;
}

.chat-moderation-minutes {
  margin-bottom: 6px;
}

.chat-moderation-reason {
  min-height: 52px;
  resize: vertical;
  margin-bottom: 8px;
}

.chat-moderation-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.chat-moderation-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.chat-moderation-warning {
  display: block;
  width: 100%;
  margin: 0 auto 8px;
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 3px;
  background: rgba(255, 241, 210, 0.9);
  color: #4a2a0c;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  text-align: center;
}

.chat-moderation-warning:hover {
  background: rgba(237, 204, 143, 0.94);
}

.chat-moderation-timeout-section {
  margin-bottom: 8px;
}

.chat-moderation-other-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.chat-moderation-profession-section {
  margin-bottom: 8px;
}

.chat-moderation-profession-label {
  font-size: 12px;
  font-weight: 700;
  color: #4a2a0c;
  margin-bottom: 4px;
  text-align: center;
}

.chat-moderation-profession-select {
  width: 100%;
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 3px;
  background: rgba(255, 250, 235, 0.96);
  color: #3f2209;
  padding: 5px 6px;
  font-size: 12px;
  font-family: 'Georgia', serif;
}

.chat-moderation-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.chat-moderation-confirm {
  min-width: 82px;
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 3px;
  background: rgba(237, 204, 143, 0.94);
  color: #4a2a0c;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
}

.chat-moderation-confirm:hover {
  background: rgba(225, 188, 120, 0.98);
}

.chat-form {
  display: flex;
  align-items: end;
  gap: 4px;
  padding-top: 5px;
  flex-shrink: 0;
}

.chat-form input,
.chat-form textarea {
  background: rgba(255, 240, 200, 0.65);
  border: 1px solid rgba(100, 60, 20, 0.35);
  border-radius: 3px;
  padding: 3px 6px;
  font-size: 12px;
  color: #3a1f08;
  font-family: 'Georgia', serif;
}

.chat-form textarea {
  flex: 1 1 auto;
  min-width: 0;
  resize: none;
  overflow-y: auto;
  line-height: 16px;
  height: 26px;
  min-height: 26px;
  max-height: 146px;
}

.chat-form > button {
  flex: 0 0 auto;
}

/* Bild-Upload-Button (nur Nicht-Spieler-Rollen, siehe chatController.js) --
   soll direkt neben dem Eingabefeld sitzen statt in eigener Zeile darueber
   (Bugreport: Grid-Layout mit nur zwei definierten Spalten liess den dritten
   Button in eine eigene Zeile umbrechen). Hoehe an die Textarea angeglichen,
   damit beide auf gleicher Grundlinie sitzen. */
.chat-form #chat-btn-image-upload {
  align-self: end;
  width: 26px;
  height: 26px;
  font-size: 14px;
}

.chat-form input:focus,
.chat-form textarea:focus {
  outline: 1px solid rgba(100, 60, 20, 0.55);
  background: rgba(255, 248, 220, 0.85);
}

.chat-form input::placeholder,
.chat-form textarea::placeholder {
  color: rgba(58, 31, 8, 0.5);
}

.chat-form button[type="submit"] {
  padding: 3px 8px;
  font-size: 13px;
  background: rgba(140, 95, 45, 0.45);
  color: #3a1f08;
  border: 1px solid rgba(100, 60, 20, 0.45);
  border-radius: 3px;
  cursor: pointer;
  font-family: sans-serif;
  line-height: 1;
}

.chat-form button[type="submit"]:hover {
  background: rgba(140, 95, 45, 0.75);
}

.chat-mention-suggestions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 48px;
  z-index: 5;
  border: 1px solid rgba(174, 138, 20, 0.78);
  border-radius: 4px;
  background: rgba(255, 247, 208, 0.98);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  padding: 4px;
  max-height: 160px;
  overflow: auto;
}

.chat-mention-suggestions.hidden {
  display: none;
}

.chat-mention-suggestions-title {
  font-size: 11px;
  font-weight: 700;
  color: #8a6a10;
  padding: 0 4px 4px;
}

.chat-mention-suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-mention-suggestion {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 3px;
  background: rgba(255, 243, 182, 0.95);
  color: #4a2a0c;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}

.chat-mention-suggestion.is-active,
.chat-mention-suggestion:hover {
  border-color: rgba(174, 138, 20, 0.92);
  background: rgba(247, 224, 123, 0.98);
}

/* Chat Widget */
.chat-widget {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 10;
  image-rendering: pixelated;
}

.chat-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-sizing: border-box;
}

.chat-widget[data-state="normal"] .chat-frame {
  width: 324px;
  height: 440px;
  background-image: url('/res/ui/interface_right_bottom.gif');
  padding: 22px 14px 28px 14px;
}

.chat-widget[data-state="normal"][data-wide="true"] .chat-frame {
  width: 468px;
  height: 440px;
  background-image: url('/res/ui/interface_right_bottom2.gif');
  padding: 22px 14px 28px 14px;
}

.chat-widget[data-state="maxi"] .chat-frame {
  width: 324px;
  height: 619px;
  background-image: url('/res/ui/interface_right_bottom_maxi.gif');
  padding: 22px 14px 28px 14px;
}

.chat-widget[data-state="maxi"][data-wide="true"] .chat-frame {
  width: 468px;
  height: 619px;
  background-image: url('/res/ui/interface_right_bottom_maxi2.gif');
  padding: 22px 14px 28px 14px;
}

.chat-widget[data-state="mini"] .chat-frame {
  width: 270px;
  height: 75px;
  background-image: url('/res/ui/interface_right_bottom_mini.gif');
  padding: 4px 14px;
  justify-content: center;
}

.chat-controls {
  position: absolute;
  top: 2px;
  right: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 2;
}

.chat-ctrl {
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
  background: rgba(140, 95, 45, 0.35);
  color: #3a1f08;
  border: 1px solid rgba(100, 60, 20, 0.45);
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: sans-serif;
  overflow: hidden;
}

.chat-ctrl:hover {
  background: rgba(140, 95, 45, 0.65);
}

.chat-ctrl-icon {
  background: rgba(140, 95, 45, 0.25);
  border: 1px solid rgba(100, 60, 20, 0.4);
}

.chat-lang-select {
  width: auto;
  height: 18px;
  padding: 0 2px;
  font-size: 9px;
  line-height: 1;
  background: rgba(140, 95, 45, 0.25);
  color: #3a1f08;
  border: 1px solid rgba(100, 60, 20, 0.4);
  border-radius: 2px;
  cursor: pointer;
  font-family: sans-serif;
}

.chat-lang-select:hover {
  background: rgba(140, 95, 45, 0.5);
}

.chat-ctrl-icon img {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  display: block;
  image-rendering: pixelated;
}

.chat-widget[data-state="maxi"] #chat-btn-expand {
  display: none;
}

.chat-widget[data-view="menu"] #chat-btn-close {
  display: none;
}

.chat-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 2px;
}

.chat-channel-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-active-channel-head {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 2px 46px 4px 24px;
  margin-bottom: 3px;
  border-bottom: 1px solid rgba(120, 78, 36, 0.28);
  color: #5a2f0c;
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.65);
  flex-shrink: 0;
}

.chat-active-channel-name {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.chat-active-channel-count {
  font-family: "Trebuchet MS", sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  color: rgba(90, 47, 12, 0.84);
}

.chat-active-close,
.chat-active-rules,
.chat-head-wide,
#chat-btn-shrink,
#chat-btn-expand {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(106, 74, 38, 0.72);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(235, 214, 167, 0.96), rgba(193, 161, 107, 0.96)),
    url('/res/bg/map.txt');
  background-color: rgba(215, 185, 140, 0.9);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.chat-active-close {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
}

.chat-active-rules {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.chat-active-close img,
.chat-active-rules img {
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  image-rendering: pixelated;
}

.chat-active-close:hover,
.chat-active-rules:hover,
.chat-head-wide:hover,
#chat-btn-shrink:hover,
#chat-btn-expand:hover {
  border-color: rgba(128, 90, 45, 0.78);
  box-shadow:
    0 3px 7px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.chat-active-close:active,
.chat-active-rules:active,
.chat-head-wide:active,
#chat-btn-shrink:active,
#chat-btn-expand:active {
  box-shadow:
    0 1px 4px rgba(0, 0, 0, 0.3),
    inset 0 2px 4px rgba(0, 0, 0, 0.18);
}

.chat-expand-bottom {
  position: absolute;
  left: -1px;
  bottom: -1px;
  z-index: 2;
}

.chat-head-wide {
  position: absolute;
  left: -1px;
  top: 50%;
  transform: translateY(-50%);
}

.chat-channel-head-simple {
  padding: 4px 6px;
}

.chat-username {
  font-weight: 700;
  cursor: pointer;
  color: #5a2a0c;
}

.chat-username:hover {
  text-decoration: underline;
  color: #8a3a0c;
}

.chat-player-menu {
  position: fixed;
  z-index: 9999;
  background: linear-gradient(180deg, rgba(248, 227, 184, 0.98), rgba(224, 182, 120, 0.98));
  border: 1px solid rgba(120, 78, 36, 0.65);
  border-radius: 4px;
  box-shadow: 2px 2px 6px rgba(0, 0, 0, 0.35);
  min-width: 130px;
  padding: 2px 0;
  font-family: "Trebuchet MS", sans-serif;
}

.chat-player-menu-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 6px 12px;
  font-size: 12px;
  color: #4a2a0c;
  cursor: pointer;
  font-family: inherit;
}

.chat-player-menu-btn:hover {
  background: rgba(232, 187, 118, 0.65);
}

.chat-player-menu-btn-admin {
  color: #143e88;
  font-weight: 700;
}

.chat-player-menu-btn-admin:hover {
  background: rgba(193, 214, 255, 0.72);
}

.chat-friend-request-buttons {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  margin-left: 20px;
}

.chat-friend-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(120, 78, 36, 0.4);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(248, 227, 184, 0.85), rgba(224, 182, 120, 0.85));
  color: #4a2a0c;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: "Trebuchet MS", sans-serif;
}

.chat-friend-btn:hover {
  background: linear-gradient(180deg, rgba(256, 240, 200, 0.95), rgba(232, 200, 140, 0.95));
  border-color: rgba(120, 78, 36, 0.7);
  transform: scale(1.05);
}

.chat-friend-btn.accept {
  color: #228800;
}

.chat-friend-btn.reject {
  color: #cc0000;
}

.chat-friend-btn.accept:hover {
  background: rgba(200, 255, 150, 0.3);
}

.chat-friend-btn.reject:hover {
  background: rgba(255, 150, 150, 0.3);
}

.chat-dm-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.chat-dm-entry {
  display: flex;
  align-items: stretch;
  border-right: 1px solid rgba(120, 78, 36, 0.18);
  border-bottom: 1px solid rgba(120, 78, 36, 0.22);
}

.chat-dm-entry:nth-child(2n) {
  border-right: 0;
}

.chat-dm-entry:last-child,
.chat-dm-entry:nth-last-child(2) {
  border-bottom: 0;
}

.chat-dm-channel-btn {
  flex: 1;
  border: 0;
  border-right: 1px solid rgba(120, 78, 36, 0.18);
  border-radius: 0;
  display: flex;
  align-items: center;
  padding: 4px 8px;
  background: rgba(255, 247, 224, 0.55);
  color: #4a2a0c;
  font-family: "Trebuchet MS", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: left;
}

.chat-dm-channel-btn:hover {
  background: rgba(255, 244, 205, 0.85);
}

.chat-dm-channel-btn.is-active {
  background: rgba(232, 187, 118, 0.45);
  color: #3f2209;
}

.chat-dm-close {
  flex-shrink: 0;
  width: 20px;
  background: rgba(140, 95, 45, 0.2);
  border: none;
  cursor: pointer;
  color: #4a2a0c;
  font-size: 13px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-dm-close:hover {
  background: rgba(180, 60, 30, 0.55);
  color: #fff;
}

.chat-widget[data-view="menu"] .chat-channel-group {
  margin-bottom: 0;
}

.chat-widget[data-view="menu"] .chat-channel-view {
  display: none;
}

.chat-widget[data-view="channel"] .chat-channel-group {
  display: none;
}

.chat-widget[data-state="mini"] .chat-body {
  display: none;
}

.chat-warning-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.chat-warning-popup {
  background: linear-gradient(180deg, rgba(255, 248, 226, 0.98), rgba(245, 222, 182, 0.98));
  border: 1px solid rgba(120, 78, 36, 0.62);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 20px;
  min-width: 280px;
  max-width: 90vw;
  text-align: center;
  color: #3f2209;
}

.chat-warning-popup-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 8px;
}

.chat-warning-popup-text {
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.chat-warning-popup-ok {
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 4px;
  background: rgba(237, 204, 143, 0.94);
  color: #4a2a0c;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  cursor: pointer;
}

.chat-warning-popup-ok:hover {
  background: rgba(225, 188, 120, 0.98);
}

.chat-rules-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.chat-rules-popup {
  background: linear-gradient(180deg, rgba(255, 248, 226, 0.98), rgba(245, 222, 182, 0.98));
  border: 1px solid rgba(120, 78, 36, 0.62);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 20px;
  width: min(480px, 90vw);
  max-height: 80vh;
  overflow-y: auto;
  color: #3f2209;
}

.chat-rules-popup-title {
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-align: center;
}

.chat-rules-popup-body {
  font-size: 0.85rem;
  line-height: 1.5;
}

.chat-rules-popup-section-title {
  margin: 14px 0 6px;
  font-size: 0.95rem;
  color: #5c3410;
}

.chat-rules-popup-section-title:first-child {
  margin-top: 0;
}

.chat-rules-popup-list {
  margin: 0;
  padding-left: 20px;
}

.chat-rules-popup-list li {
  margin-bottom: 6px;
}

.chat-rules-popup-close {
  display: block;
  margin: 16px auto 0;
  border: 1px solid rgba(110, 72, 34, 0.46);
  border-radius: 4px;
  background: rgba(237, 204, 143, 0.94);
  color: #4a2a0c;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  cursor: pointer;
}

.chat-rules-popup-close:hover {
  background: rgba(225, 188, 120, 0.98);
}