/* ==========================================================================
   4. GENEL CHAT / SOHBET & İKRAM GÖNDERME PANELİ
   ========================================================================== */
/* Floating Trigger Button (Right side, absolute inside canvas) */
.floating-chat-trigger {
  position: absolute;
  right: 22px;
  bottom: 85px;
  z-index: 9995;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: 2px solid #38bdf8;
  border-radius: 30px;
  padding: 11px 18px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.45);
  display: flex !important;
  pointer-events: auto !important;
  align-items: center;
  gap: 9px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.floating-chat-trigger:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.6);
  border-color: #7dd3fc;
}

.fct-icon {
  font-size: 17px;
}

.fct-online-badge {
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: #4ade80;
}

/* Global Chat Overlay Backdrop */
.global-chat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9998;
}

/* Chat Drawer (Slides in from the left covering up to half the screen) */
.global-chat-drawer {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-105%);
  visibility: hidden;
  pointer-events: none;
  width: 580px;
  max-width: 55%;
  height: 100%;
  background: #0f172a;
  border-right: 2px solid rgba(56, 189, 248, 0.35);
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.global-chat-drawer.chat-open {
  transform: translateX(0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

@container game (max-width: 860px) {
  .global-chat-drawer {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Chat Header */
.gcd-header {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.25);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gcd-title-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gcd-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.gcd-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.gcd-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.gcd-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
}

.gcd-online-text {
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.gcd-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.gcd-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* Chat Messages List (Drag-to-scroll & Touch pan per Rule 11.3) */
.gcd-messages-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #090e1a;
  cursor: default;
  touch-action: pan-y;
}

/* Chat Message Bubble */
.chat-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: chatMsgFade 0.2s ease forwards;
  max-width: 90%;
}

@keyframes chatMsgFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cmr-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1e293b;
  border: 1.5px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.cmr-avatar:hover {
  transform: scale(1.08);
}

.cmr-body {
  flex: 1;
  min-width: 0;
}

.cmr-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.cmr-author {
  font-size: 12.5px;
  font-weight: 800;
  color: #38bdf8;
}

.cmr-club-tag {
  font-size: 10.5px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  color: #cbd5e1;
}

.cmr-time {
  font-size: 10.5px;
  color: #64748b;
  margin-left: auto;
}

.cmr-text {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 12px;
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
}

/* Kendi Mesajlarımız — Sağda */
.chat-msg-row.is-me {
  flex-direction: row-reverse;
  align-self: flex-end;
}

.chat-msg-row.is-me .cmr-body {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-msg-row.is-me .cmr-meta {
  justify-content: flex-end;
}

.chat-msg-row.is-me .cmr-text {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  color: #ffffff;
  border-radius: 14px 4px 14px 14px;
  text-align: left;
}

/* Başkalarının Mesajları — Solda */
.chat-msg-row.other {
  flex-direction: row;
  align-self: flex-start;
}

.chat-msg-row.other .cmr-body {
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.chat-msg-row.other .cmr-text {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-radius: 4px 14px 14px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-msg-row.other .cmr-text:hover {
  background: #27354f;
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.2);
}

.chat-msg-row.other .cmr-author {
  cursor: pointer;
}

.chat-msg-row.other .cmr-author:hover {
  text-decoration: underline;
}

/* Treat / Celebration Card inside Chat */
.chat-treat-card {
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  /* (pulse removed: a filter animation repainted every frame) */
  width: 100%;
}

@keyframes treatGlowPulse {
  from { filter: brightness(1); }
  to { filter: brightness(1.08); }
}

.chat-treat-card.treat-tea {
  background: linear-gradient(135deg, rgba(180, 83, 9, 0.3) 0%, rgba(120, 53, 15, 0.45) 100%);
  border: 1.5px solid #f59e0b;
}

.chat-treat-card.treat-ayran {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3) 0%, rgba(3, 105, 161, 0.45) 100%);
  border: 1.5px solid #38bdf8;
}

.chat-treat-card.treat-chocolate {
  background: linear-gradient(135deg, rgba(146, 64, 14, 0.35) 0%, rgba(67, 56, 202, 0.3) 100%);
  border: 1.5px solid #d97706;
}

.chat-treat-card.treat-victory {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3) 0%, rgba(245, 158, 11, 0.35) 100%);
  border: 2px solid #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.35);
}

.ctc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ctc-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.treat-tea .ctc-badge { background: #f59e0b; color: #78350f; }
.treat-ayran .ctc-badge { background: #38bdf8; color: #0c4a6e; }
.treat-chocolate .ctc-badge { background: #d97706; color: #ffffff; }
.treat-victory .ctc-badge { background: #fbbf24; color: #78350f; }

.ctc-sender {
  font-size: 11px;
  color: #e2e8f0;
  font-weight: 600;
}

.ctc-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctc-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.4));
}

.ctc-text {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.4;
}

/* Quick Emoji Bar */
.gcd-emoji-bar {
  background: #111a2e;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.gcd-emoji-bar::-webkit-scrollbar {
  display: none;
}

.emoji-chip {
  font-size: 16px;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 6px;
  transition: transform 0.15s;
}
.emoji-chip:hover {
  transform: scale(1.25);
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Input Row */
.gcd-input-row {
  background: #1e293b;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.gcd-input-field {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.gcd-input-field:focus {
  border-color: #38bdf8;
}

.gcd-send-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 1px solid #38bdf8;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.gcd-send-btn:hover {
  background: #0284c7;
  transform: translateY(-1px);
}

/* İkram & Kutlama Gönder Paneli (Below Input) */
.gcd-treats-panel {
  background: #0b132b;
  border-top: 2px solid #1e293b;
  padding: 10px 14px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.gcd-treats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gcd-treats-title-wrap {
  display: flex;
  flex-direction: column;
}

.gcd-treats-badge {
  font-size: 12px;
  font-weight: 800;
  color: #fbbf24;
}

.gcd-treats-sub {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.gcd-treats-wallet {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 4px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: #facc15;
}

.gcd-treats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gcd-treat-card {
  background: #162038;
  border: 1px solid #283758;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.gcd-treat-card:hover {
  background: #1e2d4f;
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.gcd-treat-card.treat-tea:hover { border-color: #f59e0b; }
.gcd-treat-card.treat-ayran:hover { border-color: #38bdf8; }
.gcd-treat-card.treat-chocolate:hover { border-color: #d97706; }
.gcd-treat-card.treat-victory:hover { border-color: #fbbf24; }

.gtc-icon {
  font-size: 22px;
}

.gtc-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.gtc-name {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gtc-desc {
  font-size: 10px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gtc-cost-pill {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 2px 8px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.gtc-cost-num {
  font-size: 12px;
  font-weight: 800;
  color: #facc15;
}

.gtc-cost-pill.cost-gold {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
}

.gtc-token-icon {
  font-size: 11px;
}

/* ==========================================================================
   KULLANICI ETKİLEŞİM MODALLARI (Pencere İçi Panel Kuralı §4.2 Uyumlu)
   1. chatUserActionModal
/* ==========================================================================
   KULLANICI ETKİLEŞİM MODALLARI (Pencere İçi Panel Kuralı §4.2 Uyumlu)
   1. chatUserActionModal
   2. chatReportModal
   3. chatFriendlyInviteModal
   ========================================================================== */

.chat-modal-overlay,
.chat-action-modal-overlay,
.chat-report-modal-overlay,
.chat-invite-modal-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.75);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2.5%, 24px);
  box-sizing: border-box;
}

.chat-modal-card,
.chat-action-modal-card,
.chat-report-modal-card,
.chat-invite-modal-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  padding: clamp(18px, 2.5%, 26px);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  color: #1e293b;
  max-width: 460px;
  width: 100%;
  max-height: 90%;
  position: relative;
  overflow: hidden;
}

.cuam-header,
.crm-header,
.cfim-header,
.chat-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
  flex-shrink: 0;
  position: relative;
}

.cuam-title-group,
.crm-title-group,
.cfim-title-group,
.cmh-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crm-icon,
.cfim-icon,
.cmh-icon {
  font-size: 26px;
}

.cuam-club-title,
.crm-title,
.cfim-title,
.cmh-title {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 900;
  color: #0f172a;
}

.cuam-author-sub,
.crm-sub,
.cfim-sub {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.cuam-close-btn,
.crm-close-btn,
.cfim-close-btn,
.chat-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 10;
}

.cuam-close-btn:hover,
.crm-close-btn:hover,
.cfim-close-btn:hover,
.chat-modal-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
}

.cuam-body,
.crm-body,
.cfim-body,
.chat-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* User Actions List */
.cuam-actions-list,
.cuam-buttons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cuam-action-btn,
.btn-cuam-action {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Rajdhani', sans-serif;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.cuam-action-btn:hover,
.btn-cuam-action:hover {
  background: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.2);
}

.cuam-action-btn.report:hover,
.btn-cuam-action.action-report:hover {
  border-color: #ef4444;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.2);
  background: #fff5f5;
}

.cuam-btn-icon,
.bca-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cuam-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cuam-btn-text strong {
  font-size: 15px;
  font-weight: 800;
}

.cuam-btn-text small {
  font-size: 11.5px;
  color: #64748b;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
}

/* Form Styling */
.crm-form-group,
.cfim-form-group,
.cm-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.crm-label,
.cfim-label,
.cm-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crm-select,
.cfim-select,
.crm-textarea,
.cm-select,
.cm-textarea {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13.5px;
  color: #0f172a;
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
}

.crm-select:focus,
.cfim-select:focus,
.crm-textarea:focus,
.cm-select:focus,
.cm-textarea:focus {
  border-color: #0284c7;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.crm-textarea {
  min-height: 80px;
  resize: vertical;
}

.crm-notice,
.cfim-info-banner,
.cm-info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.crm-footer,
.cfim-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}

.crm-btn-cancel,
.cfim-btn-cancel {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13.5px;
  font-weight: 800;
  color: #64748b;
  cursor: pointer;
  transition: all 0.15s ease;
}

.crm-btn-cancel:hover,
.cfim-btn-cancel:hover {
  background: #e2e8f0;
  color: #1e293b;
}

.crm-btn-submit,
.cfim-btn-submit,
.btn-cm-submit {
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13.5px;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.crm-btn-submit {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.crm-btn-submit:hover,
.cfim-btn-submit:hover,
.btn-cm-submit:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
