.friends-overlay {
  position: fixed;
  inset: 0;
  top: 32px;
  z-index: 550;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  will-change: opacity;
}
.friends-overlay.friends-window-visible {
  opacity: 1;
}
.friends-window {
  background: #111;
  border: 2px solid #222;
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.15s ease;
  will-change: transform;
}
.friends-overlay.friends-window-visible .friends-window {
  transform: scale(1);
}
.friends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid #222;
}
.friends-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}
.friends-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  color: #666;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.friends-close:hover {
  background: #1a1a1a;
  border-color: #555;
  color: #aaa;
}
.friends-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 28px 0;
  border-bottom: 1px solid #222;
}
.friends-tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #666;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.friends-tab:hover {
  color: #aaa;
}
.friends-tab-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.friends-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
}
.friends-content::-webkit-scrollbar {
  width: 6px;
}
.friends-content::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 3px;
}
.friends-content::-webkit-scrollbar-thumb:hover {
  background: #333;
}
.friends-search-box {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.friends-search-input {
  flex: 1;
  background: #0d0d0d;
  border: 2px solid #222;
  border-radius: 10px;
  padding: 12px 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.friends-search-input:focus {
  border-color: #2563eb;
}
.friends-search-input::placeholder {
  color: #444;
}
.friends-search-btn {
  width: 48px;
  height: 48px;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.friends-search-btn:hover {
  background: #1d4ed8;
  transform: scale(1.03);
}
.friends-search-btn:active {
  transform: scale(0.97);
}
.friends-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
}
.friends-list::-webkit-scrollbar {
  width: 6px;
}
.friends-list::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 3px;
}
.friends-player-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.friends-player-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border: 2px solid #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #60a5fa;
  flex-shrink: 0;
}
.friends-player-info {
  flex: 1;
  min-width: 0;
}
.friends-player-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friends-player-rating {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}
.friends-player-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.friends-player-status-online {
  background: rgba(74,222,128,0.15);
  color: #4ade80;
}
.friends-player-status-ingame {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}
.friends-player-status-away {
  background: rgba(156,163,175,0.15);
  color: #9ca3af;
}
.friends-player-status-offline {
  background: rgba(107,114,128,0.15);
  color: #6b7280;
}
.friends-player-action {
  width: 40px;
  height: 40px;
  background: #2563eb;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.friends-player-action:hover {
  background: #1d4ed8;
  transform: scale(1.05);
}
.friends-player-action:disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  transform: none;
}
.friends-friend-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s ease;
  position: relative;
}
.friends-friend-card:hover {
  background: #222;
  border-color: #333;
}
.friends-friend-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border: 2px solid #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #60a5fa;
  flex-shrink: 0;
}
.friends-friend-info {
  flex: 1;
  min-width: 0;
}
.friends-friend-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friends-friend-status {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.friends-friend-status-online {
  color: #4ade80;
}
.friends-friend-status-ingame {
  color: #f59e0b;
}
.friends-friend-status-away {
  color: #9ca3af;
}
.friends-friend-status-offline {
  color: #6b7280;
}
.friends-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.friends-unread-badge {
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.friends-friend-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.friends-friend-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 8px;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.friends-friend-btn-chat:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
  transform: scale(1.05);
}
.friends-friend-btn-duel:hover {
  background: #7c3aed;
  border-color: #7c3aed;
  color: #fff;
  transform: scale(1.05);
}
.friends-friend-btn-remove:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
  transform: scale(1.05);
}
.friends-requests-section {
  margin-bottom: 24px;
}
.friends-requests-section:last-child {
  margin-bottom: 0;
}
.friends-requests-title {
  font-size: 14px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.friends-request-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.15s ease;
}
.friends-request-card:hover {
  background: #222;
  border-color: #333;
}
.friends-request-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border: 2px solid #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  color: #60a5fa;
  flex-shrink: 0;
}
.friends-request-info {
  flex: 1;
  min-width: 0;
}
.friends-request-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.friends-request-rating {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}
.friends-request-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.friends-request-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.friends-request-btn-accept {
  background: #16a34a;
}
.friends-request-btn-accept:hover {
  background: #15803d;
  transform: scale(1.05);
}
.friends-request-btn-decline {
  background: #dc2626;
}
.friends-request-btn-decline:hover {
  background: #b91c1c;
  transform: scale(1.05);
}
.friends-request-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.friends-request-pending {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}
.friends-empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}
.friends-empty small {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: #555;
}
.friends-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 16px;
}
.friends-loading p {
  color: #666;
  font-size: 14px;
}
.friend-chat-overlay {
  position: fixed;
  inset: 0;
  top: 32px;
  z-index: 700;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.friend-chat-overlay.friend-chat-visible {
  opacity: 1;
}
.friend-chat-window {
  background: #111;
  border: 2px solid #222;
  border-radius: 18px;
  width: 100%;
  max-width: 480px;
  height: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.friend-chat-overlay.friend-chat-visible .friend-chat-window {
  transform: scale(1);
}
.friend-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid #222;
}
.friend-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.friend-chat-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.friend-chat-status-online {
  background: #4ade80;
}
.friend-chat-status-ingame {
  background: #f59e0b;
}
.friend-chat-status-away {
  background: #9ca3af;
}
.friend-chat-status-offline {
  background: #6b7280;
}
.friend-chat-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.friend-chat-close {
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid #333;
  border-radius: 6px;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
}
.friend-chat-close:hover {
  background: #1a1a1a;
  border-color: #555;
  color: #aaa;
}
.friend-chat-messages-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  scrollbar-width: thin;
  scrollbar-color: #222 transparent;
}
.friend-chat-messages-wrap::-webkit-scrollbar {
  width: 6px;
}
.friend-chat-messages-wrap::-webkit-scrollbar-thumb {
  background: #222;
  border-radius: 3px;
}
.friend-chat-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.friend-chat-message {
  display: flex;
  flex-direction: column;
}
.friend-chat-message-mine {
  align-items: flex-end;
}
.friend-chat-message-theirs {
  align-items: flex-start;
}
.friend-chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.friend-chat-message-mine .friend-chat-bubble {
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 4px;
}
.friend-chat-message-theirs .friend-chat-bubble {
  background: #1a1a1a;
  color: #fff;
  border-bottom-left-radius: 4px;
}
.friend-chat-time {
  font-size: 11px;
  color: #666;
  margin-top: 4px;
  padding: 0 4px;
}
.friend-chat-input-area {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid #222;
}
.friend-chat-input {
  flex: 1;
  background: #0d0d0d;
  border: 2px solid #222;
  border-radius: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.friend-chat-input:focus {
  border-color: #2563eb;
}
.friend-chat-input::placeholder {
  color: #444;
}
.friend-chat-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.friend-chat-send {
  width: 44px;
  height: 44px;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.friend-chat-send:hover {
  background: #1d4ed8;
  transform: scale(1.03);
}
.friend-chat-send:active {
  transform: scale(0.97);
}
.menu-friends-btn {
  position: absolute;
  top: 90px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0a0a0a;
  border: 1px solid #1e1e1e;
  border-radius: 24px;
  padding: 10px 18px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s ease;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  animation: settingsFadeIn 0.3s ease both;
  user-select: none;
  pointer-events: auto;
}
.menu-friends-btn:hover {
  background: #111;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(37,99,235,0.3);
}
.menu-friends-btn:active {
  transform: translateY(0);
  transition: all 0.1s;
  background: #2563eb;
}
.menu-friends-icon {
  font-size: 20px;
  line-height: 1;
}
.menu-friends-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.menu-friends-badge {
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  display: none;
  box-shadow: 0 2px 8px rgba(220,38,38,0.5);
}
#friends-unread-badge {
  display: none;
}
.theme-light .friends-overlay {
  background: rgba(200,210,230,0.95);
}
.theme-light .friends-window {
  background: #fff;
  border-color: #d0ddf0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.theme-light .friends-title {
  color: #1a1a40;
}
.theme-light .friends-close {
  border-color: #d0d8f0;
  color: #888;
}
.theme-light .friends-close:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #444;
}
.theme-light .friends-header {
  border-bottom-color: #e0e8f0;
}
.theme-light .friends-tabs {
  border-bottom-color: #e0e8f0;
}
.theme-light .friends-tab {
  color: #8896b0;
}
.theme-light .friends-tab:hover {
  color: #4060a0;
}
.theme-light .friends-tab-active {
  color: #2563eb;
}
.theme-light .friends-content {
  scrollbar-color: #d0ddf0 transparent;
}
.theme-light .friends-search-input {
  background: #f8faff;
  border-color: #d0d8f0;
  color: #1a1a40;
}
.theme-light .friends-search-input:focus {
  border-color: #2563eb;
}
.theme-light .friends-search-input::placeholder {
  color: #b0b8cc;
}
.theme-light .friends-list {
  scrollbar-color: #d0ddf0 transparent;
}
.theme-light .friends-player-card,
.theme-light .friends-friend-card,
.theme-light .friends-request-card {
  background: #f8faff;
  border-color: #e0e8f0;
}
.theme-light .friends-player-card:hover,
.theme-light .friends-friend-card:hover,
.theme-light .friends-request-card:hover {
  background: #f0f4ff;
  border-color: #c8d0f0;
}
.theme-light .friends-player-name,
.theme-light .friends-friend-name,
.theme-light .friends-request-name {
  color: #1a1a40;
}
.theme-light .friends-player-rating,
.theme-light .friends-request-rating {
  color: #8896b0;
}
.theme-light .friends-friend-btn {
  border-color: #d0d8f0;
  color: #8896b0;
}
.theme-light .friends-empty {
  color: #8896b0;
}
.theme-light .friends-empty small {
  color: #b0b8cc;
}
.theme-light .friends-loading p {
  color: #8896b0;
}
.theme-light .friends-requests-title {
  color: #8896b0;
}
.theme-light .friends-request-pending {
  color: #8896b0;
}
.theme-light .friend-chat-overlay {
  background: rgba(180,190,220,0.85);
}
.theme-light .friend-chat-window {
  background: #fff;
  border-color: #d0ddf0;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.theme-light .friend-chat-header {
  border-bottom-color: #e0e8f0;
}
.theme-light .friend-chat-name {
  color: #1a1a40;
}
.theme-light .friend-chat-close {
  border-color: #d0d8f0;
  color: #888;
}
.theme-light .friend-chat-close:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #444;
}
.theme-light .friend-chat-messages-wrap {
  scrollbar-color: #d0ddf0 transparent;
}
.theme-light .friend-chat-message-theirs .friend-chat-bubble {
  background: #f0f4ff;
  color: #1a1a40;
}
.theme-light .friend-chat-time {
  color: #8896b0;
}
.theme-light .friend-chat-input-area {
  border-top-color: #e0e8f0;
}
.theme-light .friend-chat-input {
  background: #f8faff;
  border-color: #d0d8f0;
  color: #1a1a40;
}
.theme-light .friend-chat-input:focus {
  border-color: #2563eb;
}
.theme-light .friend-chat-input::placeholder {
  color: #b0b8cc;
}
.theme-light .menu-friends-btn {
  background: #fff;
  border-color: #e0e8f0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  color: #1a1a40;
}
.theme-light .menu-friends-btn:hover {
  background: #f8faff;
  border-color: #2563eb;
  box-shadow: 0 4px 20px rgba(37,99,235,0.15);
}
.chat-window-overlay {
  position: fixed;
  inset: 0;
  top: 32px;
  z-index: 800;
  background: rgba(0,0,0,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
  will-change: opacity;
}
.chat-window-overlay.chat-window-visible {
  opacity: 1;
  pointer-events: auto;
}
.chat-window {
  background: #0d0d0d;
  border: 2px solid #1a1a1a;
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  height: 650px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0,0,0,0.7);
  transform: scale(0.92);
  transition: transform 0.15s ease;
  pointer-events: auto;
  will-change: transform;
}
.chat-window-overlay.chat-window-visible .chat-window {
  transform: scale(1);
}
.chat-window-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid #1a1a1a;
  flex-shrink: 0;
}
.chat-window-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a, #1e40af);
  border: 2px solid #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #60a5fa;
  flex-shrink: 0;
}
.chat-window-info {
  flex: 1;
  min-width: 0;
}
.chat-window-name {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}
.chat-window-status {
  font-size: 12px;
  color: #666;
  font-weight: 600;
}
.chat-window-close {
  width: 32px;
  height: 32px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #666;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-window-close:hover {
  background: #1a1a1a;
  border-color: #444;
  color: #aaa;
}
.chat-window-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: #1a1a1a transparent;
}
.chat-window-messages::-webkit-scrollbar {
  width: 6px;
}
.chat-window-messages::-webkit-scrollbar-thumb {
  background: #1a1a1a;
  border-radius: 3px;
}
.chat-window-messages::-webkit-scrollbar-thumb:hover {
  background: #2a2a2a;
}
.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 75%;
  position: relative;
  animation: messageSlideIn 0.2s ease;
}
@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-message-mine {
  align-self: flex-end;
  align-items: flex-end;
}
.chat-message-theirs {
  align-self: flex-start;
  align-items: flex-start;
}
.chat-message-reply-indicator {
  font-size: 11px;
  color: #666;
  margin-bottom: 4px;
  padding: 0 4px;
  font-weight: 600;
}
.chat-message-text {
  background: #1a1a1a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-message-mine .chat-message-text {
  background: #2563eb;
  border-bottom-right-radius: 4px;
}
.chat-message-theirs .chat-message-text {
  background: #1a1a1a;
  border-bottom-left-radius: 4px;
}
.chat-message-image {
  max-width: 100%;
  max-height: 300px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.2s;
}
.chat-message-image:hover {
  transform: scale(1.02);
}
.chat-message-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  max-width: 100%;
}
.chat-reaction-badge {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
  white-space: nowrap;
}
.chat-reaction-badge:hover {
  background: #2a2a2a;
  border-color: #3a3a3a;
  transform: scale(1.05);
}
.chat-message-actions {
  display: none;
}
.chat-context-menu {
  position: fixed;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 1000;
  min-width: 180px;
  animation: contextMenuSlideIn 0.15s ease;
}
@keyframes contextMenuSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
.chat-context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #aaa;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
}
.chat-context-menu-item:hover {
  background: #2a2a2a;
  color: #fff;
}
.chat-context-menu-item-delete {
  color: #ef4444;
}
.chat-context-menu-item-delete:hover {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
}
.chat-context-menu-divider {
  height: 1px;
  background: #2a2a2a;
  margin: 6px 0;
}
.chat-context-menu-reactions {
  display: flex;
  gap: 6px;
  padding: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.chat-context-menu-reaction {
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-context-menu-reaction:hover {
  background: #2a2a2a;
  border-color: #3a3a3a;
  transform: scale(1.1);
}
.chat-message-time {
  font-size: 11px;
  color: #555;
  margin-top: 4px;
  padding: 0 4px;
}
.chat-reply-preview {
  background: #1a1a1a;
  border-left: 3px solid #2563eb;
  padding: 10px 14px;
  margin: 0 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.chat-reply-preview.hidden {
  display: none;
}
.chat-reply-text {
  flex: 1;
  font-size: 13px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-reply-cancel {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-reply-cancel:hover {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #aaa;
}
.chat-window-input-area {
  display: flex;
  gap: 10px;
  padding: 16px;
  border-top: 1px solid #1a1a1a;
  flex-shrink: 0;
}
.chat-image-btn {
  width: 44px;
  height: 44px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: #666;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-image-btn:hover {
  background: #2a2a2a;
  border-color: #3a3a3a;
  color: #aaa;
  transform: scale(1.03);
}
.chat-window-input {
  flex: 1;
  background: #0a0a0a;
  border: 2px solid #1a1a1a;
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  transition: border-color 0.2s;
}
.chat-window-input:focus {
  border-color: #2563eb;
}
.chat-window-input::placeholder {
  color: #444;
}
.chat-window-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chat-window-send {
  width: 44px;
  height: 44px;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-window-send:hover {
  background: #1d4ed8;
  transform: scale(1.03);
}
.chat-window-send:active {
  transform: scale(0.97);
}
.theme-light .chat-window-overlay {
  background: rgba(200,210,230,0.95);
}
.theme-light .chat-window {
  background: #fff;
  border-color: #d0ddf0;
  box-shadow: 0 25px 70px rgba(0,0,0,0.2);
}
.theme-light .chat-window-header {
  border-bottom-color: #e0e8f0;
}
.theme-light .chat-window-name {
  color: #1a1a40;
}
.theme-light .chat-window-status {
  color: #8896b0;
}
.theme-light .chat-window-close {
  border-color: #d0d8f0;
  color: #888;
}
.theme-light .chat-window-close:hover {
  background: #f0f4ff;
  border-color: #b0b8cc;
  color: #444;
}
.theme-light .chat-window-messages {
  scrollbar-color: #d0ddf0 transparent;
}
.theme-light .chat-message-reply-indicator {
  color: #8896b0;
}
.theme-light .chat-message-theirs .chat-message-text {
  background: #f0f4ff;
  color: #1a1a40;
}
.theme-light .chat-message-time {
  color: #b0b8cc;
}
.theme-light .chat-reaction-badge {
  background: #f0f4ff;
  border-color: #d0d8f0;
}
.theme-light .chat-reaction-badge:hover {
  background: #e0e8f0;
  border-color: #c0c8e0;
}
.theme-light .chat-message-action-btn {
  background: #f0f4ff;
  border-color: #d0d8f0;
  color: #8896b0;
}
.theme-light .chat-message-action-btn:hover {
  background: #e0e8f0;
  border-color: #c0c8e0;
  color: #4060a0;
}
.theme-light .chat-reaction-picker {
  background: #fff;
  border-color: #d0d8f0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.theme-light .chat-reaction-picker-btn:hover {
  background: #f0f4ff;
  border-color: #d0d8f0;
}
.theme-light .chat-context-menu {
  background: #fff;
  border-color: #d0d8f0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.theme-light .chat-context-menu-item {
  color: #4060a0;
}
.theme-light .chat-context-menu-item:hover {
  background: #f0f4ff;
  color: #1a1a40;
}
.theme-light .chat-context-menu-item-delete {
  color: #dc2626;
}
.theme-light .chat-context-menu-item-delete:hover {
  background: rgba(220,38,38,0.1);
  color: #dc2626;
}
.theme-light .chat-context-menu-divider {
  background: #e0e8f0;
}
.theme-light .chat-context-menu-reaction:hover {
  background: #f0f4ff;
  border-color: #d0d8f0;
}
.theme-light .chat-reply-preview {
  background: #f0f4ff;
  border-left-color: #2563eb;
}
.theme-light .chat-reply-text {
  color: #4060a0;
}
.theme-light .chat-reply-cancel {
  border-color: #d0d8f0;
  color: #888;
}
.theme-light .chat-reply-cancel:hover {
  background: #e0e8f0;
  border-color: #c0c8e0;
  color: #444;
}
.theme-light .chat-window-input-area {
  border-top-color: #e0e8f0;
}
.theme-light .chat-image-btn {
  background: #f0f4ff;
  border-color: #d0d8f0;
  color: #8896b0;
}
.theme-light .chat-image-btn:hover {
  background: #e0e8f0;
  border-color: #c0c8e0;
  color: #4060a0;
}
.theme-light .chat-window-input {
  background: #f8faff;
  border-color: #d0d8f0;
  color: #1a1a40;
}
.theme-light .chat-window-input:focus {
  border-color: #2563eb;
}
.theme-light .chat-window-input::placeholder {
  color: #b0b8cc;
}
.friends-player-action.disabled {
  background: #333;
  color: #666;
  cursor: not-allowed;
  opacity: 0.4;
}
.friends-player-action.disabled:hover {
  background: #333;
  transform: none;
}
