.gtn-lobby-chat-surface {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.gtn-lobby-chat-title {
  margin: 0 0 12px;
  padding: 0 0 8px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.gtn-lobby-chat-log {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .03);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 12px;
  line-height: 1.6;
}

.gtn-lobby-chat-log .chat-msg {
  color: var(--text-primary);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.gtn-lobby-chat-log .chat-nick {
  color: var(--text-muted);
  font-weight: 600;
  white-space: normal;
}

.gtn-lobby-chat-log .chat-nick.system-name {
  color: var(--guard);
  font-weight: 900;
}

.gtn-lobby-chat-log .chat-player-name,
.gtn-lobby-chat-log .player-title-inline,
.gtn-lobby-chat-log .player-name-value {
  display: inline;
  color: inherit;
}

.gtn-lobby-chat-log .chat-spectator-prefix {
  color: var(--text-muted);
}

.gtn-lobby-chat-log .chat-origin-prefix {
  margin-right: 2px;
  font-weight: 700;
}

.gtn-lobby-chat-log .chat-origin-multiplayer {
  color: #117d6e;
}

.gtn-lobby-chat-log .chat-origin-story {
  color: #94601a;
}

:root[data-theme='dark'] .gtn-lobby-chat-log .chat-origin-multiplayer {
  color: #62d8c0;
}

:root[data-theme='dark'] .gtn-lobby-chat-log .chat-origin-story {
  color: #e3ad60;
}

.gtn-lobby-chat-log .chat-time-separator {
  margin: 8px 0;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  opacity: .78;
  text-align: center;
}

.gtn-lobby-chat-log .chat-repeat-count {
  margin-left: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-mention-token {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #2e86de;
  background: transparent;
  font-weight: inherit;
}

:root[data-theme='dark'] .chat-mention-token {
  color: #74b9ff;
  background: transparent;
}

.chat-mention-token.mention-self {
  display: inline-block;
  padding: 0 2px;
  border: 1px solid currentColor;
  border-radius: 3px;
  background: rgba(46, 134, 222, .08);
  font-weight: 700;
}

:root[data-theme='dark'] .chat-mention-token.mention-self {
  background: rgba(116, 185, 255, .1);
}

.chat-mention-token.mention-flash {
  animation: mentionFlash 1.05s ease-in-out infinite;
}

@keyframes mentionFlash {
  0%, 100% { box-shadow: 0 0 0 rgba(46, 134, 222, 0); }
  50% { box-shadow: 0 0 0 3px rgba(46, 134, 222, .22); }
}

.mention-menu {
  position: fixed;
  z-index: 2800;
  display: grid;
  gap: 4px;
  max-height: 210px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, .2));
}

.mention-menu.hidden {
  display: none;
}

.mention-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: var(--radius-sm, 5px);
  color: var(--text-primary);
  background: transparent;
  font-family: var(--font-main);
  text-align: left;
  cursor: pointer;
}

.mention-menu-item:hover,
.mention-menu-item:focus-visible {
  outline: none;
  background: var(--magic-bg);
}

.mention-menu-item span {
  color: #2e86de;
  font-weight: 900;
}

.mention-menu-item small {
  color: var(--text-muted);
  font-size: 10px;
}

:root[data-theme='dark'] .gtn-lobby-chat-log {
  background: rgba(0, 0, 0, .15);
}

.gtn-lobby-chat-input-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.gtn-lobby-chat-input {
  min-width: 0;
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  outline: none;
  color: var(--text-primary);
  background: var(--bg-card);
  font-family: var(--font-main);
  font-size: 12px;
  transition: border-color 150ms ease;
}

.gtn-lobby-chat-input:focus {
  border-color: var(--magic);
}

.gtn-lobby-chat-input::placeholder {
  color: var(--text-muted);
}

.gtn-lobby-chat-send {
  flex: 0 0 auto;
  padding: 6px 12px;
  border: 1px solid rgba(52, 152, 219, .3);
  border-radius: 10px;
  color: var(--magic);
  background: var(--magic-bg);
  font-family: var(--font-main);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}

.gtn-lobby-chat-send:hover:not(:disabled) {
  background: rgba(52, 152, 219, .25);
}

.gtn-lobby-chat-send:disabled {
  opacity: .4;
  cursor: not-allowed;
}

@media (hover: none) and (pointer: coarse) {
  .gtn-lobby-chat-input {
    font-size: 16px;
  }
}
