/* AZNEEF Domino Club — Luxury Gaming Chat, Reaction Emojis & Voice System */

/* 1. Self Bar Communication Cluster (Bottom Left) */
.self-comm-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  z-index: 10;
}

.self-comm-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, #38244f, #1e132e);
  border: 1.5px solid rgba(212, 175, 55, 0.45);
  color: #f7eed7;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4), inset 0 1px rgba(255, 255, 255, 0.15);
  transition: transform 0.15s, border-color 0.18s, box-shadow 0.18s, background 0.2s;
  touch-action: manipulation;
  padding: 0;
}

.self-comm-btn:active {
  transform: scale(0.92);
}

.self-comm-btn svg.comm-svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* Microphone Button States */
.self-mic-btn {
  border-color: rgba(255, 71, 87, 0.5);
}

.self-mic-btn.active {
  background: linear-gradient(135deg, #107c41, #0c572e) !important;
  border-color: #2ed573 !important;
  color: #fff !important;
  box-shadow: 0 0 14px rgba(46, 213, 115, 0.55), inset 0 1px rgba(255, 255, 255, 0.3) !important;
  animation: micActiveGlow 1.8s infinite alternate;
}

@keyframes micActiveGlow {
  0% { box-shadow: 0 0 8px rgba(46, 213, 115, 0.4); }
  100% { box-shadow: 0 0 18px rgba(46, 213, 115, 0.85); }
}

.self-mic-btn.speaking {
  animation: micSpeakingBounce 0.4s infinite alternate;
}

@keyframes micSpeakingBounce {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

.mic-wave-bars {
  position: absolute;
  bottom: 3px;
  display: none;
  gap: 2px;
  align-items: flex-end;
  height: 8px;
}

.mic-wave-bars.active {
  display: flex;
}

.mic-wave-bars i {
  width: 2px;
  background: #2ed573;
  border-radius: 1px;
  animation: micBarPulse 0.45s infinite alternate;
}
.mic-wave-bars i:nth-child(1) { height: 3px; }
.mic-wave-bars i:nth-child(2) { height: 7px; animation-delay: 0.15s; }
.mic-wave-bars i:nth-child(3) { height: 4px; animation-delay: 0.3s; }

@keyframes micBarPulse {
  0% { height: 2px; }
  100% { height: 8px; }
}

/* Chat Button & Badge */
.self-chat-btn svg {
  width: 19px;
  height: 19px;
}

.comm-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  background: linear-gradient(135deg, #ff4757, #ff6b81);
  color: white;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 800;
  min-width: 17px;
  height: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  border: 1px solid #fff;
}

.comm-badge.hidden {
  display: none;
}

/* Emoji Quick Button */
.self-emoji-btn span {
  font-size: 19px;
  line-height: 1;
}

/* 2. Quick Floating Emoji Bar (Popup above bottom bar) */
.quick-emoji-bar {
  position: fixed;
  background: rgba(22, 12, 33, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid #d4af37;
  border-radius: 28px;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.65), 0 0 15px rgba(212, 175, 55, 0.25);
  z-index: 1050;
  animation: popUpBar 0.22s cubic-bezier(0.18, 1, 0.3, 1);
}

.quick-emoji-bar.hidden {
  display: none !important;
}

@keyframes popUpBar {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.q-emoji-btn {
  background: transparent;
  border: 0;
  font-size: 24px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.15s;
  padding: 0;
}

.q-emoji-btn:active {
  transform: scale(1.3);
}

/* 3. In-Game Floating Animated Speech Bubble */
.game-floating-bubble {
  position: fixed;
  z-index: 999;
  transform: translate(-50%, -100%);
  pointer-events: none;
  animation: floatUpAndFade 3.2s cubic-bezier(0.18, 0.9, 0.3, 1) forwards;
}

.game-floating-bubble.emoji-bubble {
  font-size: 34px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.6));
}

.game-floating-bubble.text-bubble {
  background: linear-gradient(135deg, #2f1d43, #190f25);
  color: #fff6df;
  border: 1.5px solid #e6c88c;
  border-radius: 14px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  position: relative;
}

.game-floating-bubble .bubble-tail {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #e6c88c;
}

@keyframes floatUpAndFade {
  0% { transform: translate(-50%, 0) scale(0.3); opacity: 0; }
  15% { transform: translate(-50%, -20px) scale(1.15); opacity: 1; }
  25% { transform: translate(-50%, -24px) scale(1); opacity: 1; }
  75% { transform: translate(-50%, -32px) scale(1); opacity: 1; }
  100% { transform: translate(-50%, -55px) scale(0.85); opacity: 0; }
}

/* 4. Gaming Chat Drawer (Mobile Bottom Sheet) */
.comm-chat-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: min(480px, 100vw);
  margin: 0 auto;
  box-sizing: border-box;
  height: 52dvh;
  min-height: 330px;
  max-height: 480px;
  background: linear-gradient(180deg, #241436, #12091d);
  border: 1.5px solid #d4af3777;
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 45px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  z-index: 1100;
  transform: translateY(105%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), bottom 0.2s ease-out;
  overflow: hidden;
  font-family: inherit;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.comm-chat-drawer.open {
  transform: translateY(0);
}

.chat-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(0, 0, 0, 0.25);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #efd294;
  font-size: 13.5px;
}

.chat-title-icon {
  width: 18px;
  height: 18px;
  color: #ffd700;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-target-select {
  background: linear-gradient(135deg, #2b173e, #180d26);
  color: #ffd700;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  min-height: 32px;
  outline: none;
}

.chat-close-btn {
  background: linear-gradient(135deg, rgba(235, 50, 75, 0.32), rgba(160, 20, 40, 0.6));
  border: 1.5px solid rgba(255, 100, 125, 0.65);
  color: #ffffff;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
  flex: none;
}

.chat-close-btn:hover {
  background: linear-gradient(135deg, rgba(255, 60, 85, 0.55), rgba(200, 30, 50, 0.85));
  border-color: #ff647d;
  color: #ffffff;
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 60, 85, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.chat-close-btn:active {
  transform: scale(0.92);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.chat-close-btn svg {
  display: block;
  stroke: currentColor;
}

/* Chat Navigation Tabs */
.chat-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
  padding: 4px 10px;
  gap: 8px;
}

.chat-tab-btn {
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: 12px;
  color: #bfaecf;
  font-size: 12px;
  font-weight: bold;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.chat-tab-btn.active {
  background: linear-gradient(135deg, #7c3aed, #581c87);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.chat-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Tab 1: Emojis & Quick Chips Content */
.emoji-grid-section, .chips-section {
  padding: 10px 14px;
}

.section-label {
  font-size: 11px;
  color: #d4af37;
  margin-bottom: 8px;
  font-weight: bold;
}

.emoji-matrix {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

@media (max-width: 380px) {
  .emoji-matrix {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
}

.matrix-emoji-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 12px;
  font-size: 26px;
  height: 44px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s;
  padding: 0;
}

.matrix-emoji-btn:active {
  transform: scale(1.2);
  background: rgba(212, 175, 55, 0.3);
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chat-chip {
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  color: #f7eed7;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.chat-chip:active {
  background: rgba(212, 175, 55, 0.35);
  border-color: #ffd700;
  transform: scale(0.97);
}

/* Tab 2: Custom Text Chat & History */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-empty {
  margin: auto;
  color: #9b8da9;
  font-size: 12px;
  text-align: center;
}

.chat-bubble {
  max-width: 82%;
  padding: 7px 11px;
  border-radius: 14px;
  font-size: 12.5px;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 3px;
  word-break: break-word;
}

.chat-bubble.other {
  align-self: flex-start;
  background: #2b1c3c;
  color: #f1ecf7;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom-right-radius: 3px;
}

.chat-bubble.self {
  align-self: flex-end;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
  border-bottom-left-radius: 3px;
}

.chat-bubble.private {
  border: 1.5px solid #d4af37 !important;
  background: linear-gradient(135deg, #44245c, #2b143d) !important;
}

.chat-bubble-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  color: #c9b9de;
}

.chat-avatar {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #ffd700;
  color: #1a0826;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
}

.chat-private-tag {
  background: #d4af37;
  color: #1a0826;
  padding: 1px 4px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 8px;
}

.chat-time {
  margin-inline-start: auto;
  opacity: 0.65;
  font-size: 8.5px;
}

.chat-bubble-text {
  font-size: 12.5px;
}

.chat-input-bar {
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(212, 175, 55, 0.15);
}

.chat-input-bar input {
  flex: 1;
  background: #281639;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 18px;
  padding: 7px 12px;
  color: #fff;
  font: inherit;
  font-size: 12.5px;
}

.chat-input-bar input:focus {
  outline: none;
  border-color: #ffd700;
}

.chat-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700, #d4af37);
  border: 0;
  color: #1a0826;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
}

.chat-send-btn svg {
  width: 18px;
  height: 18px;
  transform: rotate(180deg);
}

/* 5. Notification Toast */
.chat-notif-toast {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  max-width: 420px;
  margin: 0 auto;
  background: linear-gradient(135deg, rgba(43, 23, 61, 0.96), rgba(20, 8, 33, 0.98));
  border: 1.5px solid #d4af37;
  color: #fff4d6;
  padding: 8px 16px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 12px rgba(212, 175, 55, 0.25);
  font-size: 13px;
  font-weight: 600;
  z-index: 1005;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-80px) scale(0.95);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  direction: rtl;
  backdrop-filter: blur(8px);
}

.chat-notif-toast .notif-sender {
  color: #ffd700;
  font-weight: 700;
  flex: none;
}

.chat-notif-toast .notif-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-notif-toast.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* 6. Opponents Seats Comm Box */
.seat-comm-box {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: auto;
}

.seat-mute-btn, .seat-pm-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 13px;
  color: #efd294;
  transition: transform 0.15s, background 0.15s;
}

.seat-mute-btn:active, .seat-pm-btn:active {
  transform: scale(0.92);
}

.seat-mute-btn.muted {
  background: rgba(255, 56, 96, 0.25) !important;
  border-color: #ff3860 !important;
}

.comm-indicator {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.comm-indicator.speaking {
  animation: speakingBounce 0.5s infinite alternate;
}

@keyframes speakingBounce {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.wave-dots {
  display: inline-flex;
  gap: 2px;
  align-items: flex-end;
  height: 12px;
}

.wave-dots i {
  width: 2.5px;
  height: 4px;
  background: #55efc4;
  border-radius: 2px;
  animation: wavePulse 0.6s infinite alternate;
}

.wave-dots i:nth-child(2) { animation-delay: 0.2s; height: 8px; }
.wave-dots i:nth-child(3) { animation-delay: 0.4s; height: 12px; }

@keyframes wavePulse {
  from { height: 3px; }
  to { height: 12px; }
}

.comm-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(20, 10, 32, 0.95);
  border: 1px solid #ffd700;
  color: #ffd700;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  z-index: 2000;
  transition: transform 0.25s ease-out;
  pointer-events: none;
}

.comm-toast.show {
  transform: translateX(-50%) translateY(0);
}

/* Custom Avatar in Chat & Notification Toast */
.chat-avatar img, .chat-bubble-avatar-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}
.notif-avatar-img {
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: inline-block !important;
  vertical-align: middle !important;
  margin-inline-end: 6px !important;
}
