/* =========================================================================
 * MODULE: TIẾN LÊN MIỀN NAM 4 NGƯỜI - GIAO DIỆN BÀN CHƠI 4 TỤ (tienlen4-game.css)
 * Tách riêng hoàn toàn khỏi 1v1 để bảo toàn 100% giao diện & luật 1v1 cũ.
 * ========================================================================= */

#tab-tienlen4.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

html:has(body.tienlen4-active),
html:has(body.in-match-mode.tienlen4-active),
body.tienlen4-active,
body.in-match-mode.tienlen4-active {
  overflow: hidden !important;
  height: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  position: fixed !important;
  width: 100% !important;
  touch-action: manipulation;
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: none !important;
  background: #031116 !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Ẩn triệt để badge đang tải & các nút float gây tràn viewport */
#onlineGiftBadge,
.gift-badge,
#onlineGiftModal + span,
body.tienlen4-active #onlineGiftBadge,
body.tienlen4-active .gift-badge {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.tienlen4-active header,
body.tienlen4-active .header,
body.tienlen4-active .site-header,
body.tienlen4-active .header-container,
body.tienlen4-active .header-profile-card,
body.tienlen4-active .card-profile-header,
body.tienlen4-active .profile-bar,
body.tienlen4-active .profile-card-3d,
body.tienlen4-active #userProfileCardUnified,
body.tienlen4-active .zic-buttons,
body.tienlen4-active .checkin-card,
body.tienlen4-active .wheel-strip,
body.tienlen4-active .nav-tabs,
body.tienlen4-active .game-marquee,
body.tienlen4-active .marquee-container,
body.tienlen4-active #matchArenaTopbar,
body.tienlen4-active .match-arena-topbar,
body.tienlen4-active #roomWaitingModal,
body.tienlen4-active .rooms-filter-container,
body.tienlen4-active .floating-hud,
body.tienlen4-active #btnOnlineGiftFloat,
body.tienlen4-active .daily-quest-floating-btn,
body.tienlen4-active #tacticalAlertBox,
body.tienlen4-active #friendsDrawer,
body.tienlen4-active #friendsDrawerOverlay,
body.tienlen4-active #incomingInviteOverlay,
body.tienlen4-active #incomingInvitePopup,
body.tienlen4-active .reward-toast-attendance,
body.tienlen4-active #rewardAttendanceToast,
body.tienlen4-active #globalInstallAppBtn,
body.tienlen4-active .global-install-app-btn,
body.tienlen4-active #tab-tienlen {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.tienlen4-active .container {
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.tienlen4-active #tab-tienlen4 {
  position: fixed !important;
  inset: 0 !important;
  z-index: 950 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  background: radial-gradient(circle at 50% 35%, #062822 0%, #020912 100%) !important;
}

.tl4-arena {
  position: relative;
  width: 100%;
  max-width: 1120px;
  min-height: 580px;
  max-height: calc(100dvh - 16px);
  box-sizing: border-box;
  margin: 0 auto;
  padding: 10px 12px 12px;
  border-radius: 20px;
  background: radial-gradient(ellipse at 50% 42%, #0f4c3a 0%, #072c25 60%, #031518 100%);
  border: 2px solid rgba(251, 191, 36, 0.38);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65), inset 0 0 60px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  color: #f8fafc;
  overflow: hidden;
  user-select: none;
}

.tl4-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(2, 16, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tl4-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tl4-mode-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0b1120;
  letter-spacing: 0.3px;
}

.tl4-bet-badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #6ee7b7;
}

.tl4-room-tag {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}

.tl4-actions-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl4-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Lưới 4 tụ: Trên + (Trái | Sân Giữa | Phải) */
.tl4-table-middle {
  position: relative;
  display: grid;
  grid-template-columns: 124px 1fr 124px;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "left top right"
    "left center right";
  align-items: center;
  gap: 8px;
  min-height: 290px;
}

.tl4-seat-top { grid-area: top; justify-self: center; }
.tl4-seat-left { grid-area: left; justify-self: start; align-self: center; }
.tl4-seat-right { grid-area: right; justify-self: end; align-self: center; }
.tl4-center-felt { grid-area: center; }

.tl4-opp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  box-shadow: none;
  text-align: center;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.tl4-opp-card.is-turn {
  transform: translateY(-2px);
}

.tl4-opp-card.is-passed {
  opacity: 0.65;
  filter: grayscale(30%);
}

/* Thẻ thông tin người chơi (Pill bo tròn giống hệt chế độ Solo 1v1) */
.tl4-opp-player-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(6, 20, 38, 0.88);
  border: 1px solid rgba(0, 242, 254, 0.35);
  border-radius: 40px;
  padding: 4px 14px 4px 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.25s ease;
}

.tl4-opp-card.is-turn .tl4-opp-player-pill {
  border-color: #ffd700;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.6);
  animation: tl4PulseTurnBorder 1.5s infinite;
}

@keyframes tl4PulseTurnBorder {
  0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 22px rgba(255, 215, 0, 0.8); }
  100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
}

.tl4-opp-card.is-finished .tl4-opp-player-pill {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.72);
}

.tl4-ava-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid #00f2fe;
  overflow: hidden;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.tl4-ava-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Triệt để không cho badge số bài màu đỏ che đè lên mặt Avatar người chơi */
.tl4-card-count-pill {
  display: none !important;
}

.tl4-opp-info-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
}

.tl4-opp-name {
  font-size: 12px;
  font-weight: 800;
  color: #f1f5f9;
  max-width: 95px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl4-opp-sub {
  font-size: 10px;
  color: #cbd5e1;
  font-weight: 700;
}

.tl4-opp-zcoin {
  font-size: 10.5px;
  font-weight: 800;
  color: #fde68a;
  white-space: nowrap;
}

/* Khu vực dãy bài úp & huy hiệu số lá chuẩn Tiến Lên Miền Nam Solo */
.tl4-opp-cards-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 3px;
  min-height: 38px;
  width: 100%;
}

.tl4-cards-fan {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl4-card-back {
  width: 26px;
  height: 36px;
  background: linear-gradient(135deg, #16222f 0%, #0d1b2a 100%);
  border: 1px solid rgba(0, 242, 254, 0.45);
  border-radius: 5px;
  margin-left: -13px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.tl4-card-back:first-child {
  margin-left: 0;
}

.tl4-card-back::after {
  content: '♦';
  color: #00f2fe;
  font-size: 9.5px;
  opacity: 0.65;
}

.tl4-cards-count-badge {
  position: static;
  margin-left: 4px;
  background: linear-gradient(135deg, #ff0844, #d90429);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.tl4-cards-count-badge.is-finished {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #6ee7b7;
}

.tl4-cards-count-badge.is-cong-pill {
  background: linear-gradient(135deg, #dc2626, #7f1d1d);
  border-color: #fca5a5;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

/* Định dạng riêng cho 2 ghế hai bên (Left & Right) để luôn cân đối và không tràn bàn */
.tl4-seat-left .tl4-opp-card, .tl4-seat-right .tl4-opp-card {
  max-width: 105px;
}

.tl4-seat-left .tl4-opp-player-pill, .tl4-seat-right .tl4-opp-player-pill {
  padding: 3px 8px 3px 4px;
  gap: 6px;
}

.tl4-seat-left .tl4-ava-wrap, .tl4-seat-right .tl4-ava-wrap {
  width: 32px;
  height: 32px;
}

.tl4-seat-left .tl4-opp-name, .tl4-seat-right .tl4-opp-name {
  font-size: 10.5px;
  max-width: 60px;
}

.tl4-seat-left .tl4-opp-zcoin, .tl4-seat-right .tl4-opp-zcoin {
  font-size: 9.5px;
}

.tl4-seat-left .tl4-opp-cards-stack, .tl4-seat-right .tl4-opp-cards-stack {
  flex-direction: column;
  gap: 2px;
}

.tl4-seat-left .tl4-card-back, .tl4-seat-right .tl4-card-back {
  width: 16px;
  height: 23px;
  margin-left: -10px;
  border-radius: 3px;
}

.tl4-seat-left .tl4-cards-count-badge, .tl4-seat-right .tl4-cards-count-badge {
  font-size: 10px;
  padding: 1px 6px;
  margin-left: 0;
}

.tl4-opp-status-chip {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.tl4-chip-pass { background: rgba(239, 68, 68, 0.24); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.5); }
.tl4-chip-rank1 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #0f172a; }
.tl4-chip-rank2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #0f172a; }
.tl4-chip-rank3 { background: linear-gradient(135deg, #d97706, #92400e); color: #fff; }
.tl4-chip-bot { color: #a78bfa; }

/* Bong bóng thoại cho 3 ghế đối thủ & bản thân */
.tl4-speech {
  position: absolute;
  z-index: 60;
  max-width: 175px;
  padding: 5px 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  animation: tl4PopIn 0.2s ease;
}

.tl4-seat-top .tl4-speech { top: 105%; left: 50%; transform: translateX(-50%); }
.tl4-seat-left .tl4-speech { left: 105%; top: 10px; }
.tl4-seat-right .tl4-speech { right: 105%; top: 10px; }

@keyframes tl4PopIn {
  0% { opacity: 0; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Sân giữa bàn */
.tl4-center-felt {
  min-height: 170px;
  border-radius: 999px;
  border: 2px dashed rgba(251, 191, 36, 0.28);
  background: radial-gradient(ellipse at center, rgba(16, 108, 82, 0.45), rgba(4, 34, 28, 0.55));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  gap: 8px;
  position: relative;
}

.tl4-trick-owner {
  font-size: 11.5px;
  font-weight: 800;
  color: #fde68a;
  background: rgba(2, 16, 20, 0.65);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.tl4-trick-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 76px;
}

.tl4-trick-row .tl4-card {
  width: 52px;
  height: 74px;
  margin-left: -18px;
  cursor: default;
}

.tl4-trick-row .tl4-card:first-child { margin-left: 0; }

.tl4-timer-bar-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-size: 12px;
  font-weight: 800;
}

.tl4-timer-sec {
  color: #fbbf24;
  min-width: 28px;
  text-align: right;
}

/* Khu vực bài & nút bản thân */
.tl4-self-zone {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

/* Nút Chat Chuẩn 4P - Đặt tại góc trái thoáng phía trên bài, đối xứng hoàn hảo với Biểu Cảm */
#tl4BtnChatTrigger.btn-inmatch-chat-trigger,
.tl4-chat-btn {
  position: absolute !important;
  left: 12px !important;
  top: 4px !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 120 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 3px 12px 3px 6px !important;
  border-radius: 24px !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95)) !important;
  border: 1.5px solid #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 12px rgba(56, 189, 248, 0.45) !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s, border-color 0.2s !important;
}

#tl4BtnChatTrigger.btn-inmatch-chat-trigger:hover,
.tl4-chat-btn:hover {
  transform: translateY(-2px) scale(1.06) !important;
  border-color: #7dd3fc !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(56, 189, 248, 0.75) !important;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98)) !important;
}

#tl4BtnChatTrigger.btn-inmatch-chat-trigger:active,
.tl4-chat-btn:active {
  transform: scale(0.95) !important;
}

.tl4-chat-icon {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.tl4-chat-text {
  font-size: 11.5px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* Nút Biểu Cảm Chuẩn 4P - Đặt tại góc phải thoáng phía trên bài */
.tl4-btn-emote-trigger {
  position: absolute;
  right: 12px;
  top: 4px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px 3px 4px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border: 1.5px solid #fbbf24;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), 0 0 12px rgba(251, 191, 36, 0.45);
  cursor: pointer;
  pointer-events: auto;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s, border-color 0.2s;
}

.tl4-btn-emote-trigger:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: #fef08a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.85), 0 0 18px rgba(251, 191, 36, 0.75);
}

.tl4-btn-emote-trigger:active {
  transform: scale(0.95);
}

.tl4-btn-emote-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  flex-shrink: 0;
}

.tl4-btn-emote-text {
  font-size: 11.5px;
  font-weight: 800;
  color: #fef08a;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

@media (max-width: 640px) {
  #tl4BtnChatTrigger.btn-inmatch-chat-trigger,
  .tl4-chat-btn {
    left: 8px !important;
    top: 4px !important;
    padding: 3px 10px 3px 5px !important;
    gap: 4px !important;
  }
  .tl4-chat-icon {
    font-size: 14px;
  }
  .tl4-chat-text {
    font-size: 10.5px;
  }
  .tl4-btn-emote-trigger {
    right: 8px;
    top: 4px;
    padding: 3px 10px 3px 3px;
    gap: 5px;
  }
  .tl4-btn-emote-img {
    width: 28px;
    height: 28px;
  }
  .tl4-btn-emote-text {
    font-size: 10.5px;
  }
  .tl4-self-dock {
    max-width: calc(100% - 170px);
  }
}

@media (max-width: 480px) {
  #tl4BtnChatTrigger.btn-inmatch-chat-trigger,
  .tl4-chat-btn {
    left: 6px !important;
    top: 3px !important;
    padding: 2px 8px 2px 4px !important;
    gap: 3px !important;
  }
  .tl4-chat-icon {
    font-size: 13px;
  }
  .tl4-chat-text {
    font-size: 10px;
    letter-spacing: 0.2px;
  }
  .tl4-btn-emote-trigger {
    right: 6px;
    top: 3px;
    padding: 2px 8px 2px 3px;
    gap: 4px;
  }
  .tl4-btn-emote-img {
    width: 25px;
    height: 25px;
  }
  .tl4-btn-emote-text {
    font-size: 10px;
    letter-spacing: 0.2px;
  }
  .tl4-self-dock {
    max-width: calc(100% - 150px);
    padding: 3px 10px 3px 5px;
  }
}

.tl4-self-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
  text-align: left;
}

.tl4-self-meta.is-turn .tl4-self-name {
  color: #fde68a;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}

.tl4-self-line1 {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl4-self-name {
  font-size: 12.5px;
  font-weight: 800;
  color: #f1f5f9;
}

.tl4-vip-pill {
  font-size: 9.5px;
  font-weight: 900;
  padding: 1px 6px;
  border-radius: 6px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #0f172a;
  letter-spacing: 0.5px;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.tl4-self-line2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #cbd5e1;
}

.tl4-self-zcoin {
  color: #fde68a;
  font-weight: 800;
}

.tl4-self-count {
  color: #94a3b8;
  font-size: 10.5px;
}

.tl4-self-status-badge {
  color: #34d399;
  font-weight: 800;
  font-size: 10.5px;
}

.tl4-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tl4-btn {
  padding: 9px 16px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.tl4-btn:active { transform: scale(0.96); }
.tl4-btn:disabled { opacity: 0.42; cursor: not-allowed; }
.tl4-btn-sort { background: linear-gradient(135deg, #475569, #334155); }
.tl4-btn-pass { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.tl4-btn-play { background: linear-gradient(135deg, #10b981, #059669); min-width: 112px; }
.tl4-btn-hint { background: linear-gradient(135deg, #f59e0b, #d97706); color: #0b1120; }

/* Quân bài 4P */
.tl4-hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 16px 8px 4px;
  min-height: 118px;
  max-width: 100%;
  overflow-x: auto;
}

.tl4-card {
  position: relative;
  width: 62px;
  height: 88px;
  margin-left: -24px;
  border-radius: 9px;
  background: linear-gradient(160deg, #ffffff 0%, #f1f5f9 100%);
  border: 1.5px solid #cbd5e1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42);
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  flex-shrink: 0;
}

.tl4-card:first-child { margin-left: 0; }
.tl4-card.red { color: #dc2626; }
.tl4-card.black { color: #0f172a; }
.tl4-card.selected {
  transform: translateY(-16px);
  border-color: #f59e0b;
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.55);
}

.tl4-card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 18px;
  line-height: 1;
  font-weight: 900;
  font-size: 13px;
}

.tl4-card-center-suit {
  align-self: center;
  font-size: 26px;
  line-height: 1;
}

.tl4-card.is-sm {
  width: 46px;
  height: 66px;
  margin-left: -18px;
}
.tl4-card.is-sm .tl4-card-corner { font-size: 11px; width: 14px; }
.tl4-card.is-sm .tl4-card-center-suit { font-size: 18px; }

/* Modal Tổng Kết 4 Người — Demo 3 (Thẻ Gọn + Bảng Vàng Live) */
.tl4-result-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(2, 10, 18, 0.88);
  backdrop-filter: blur(7px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  pointer-events: auto;
}

.tl4-result-card {
  width: 100%;
  max-width: 520px;
  max-height: 95%;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(175deg, #1a1f36 0%, #0b1120 100%);
  border: 2px solid rgba(167, 139, 250, 0.58);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.78);
  color: #f8fafc;
}

.tl4-result-card.is-win {
  border-color: rgba(251, 191, 36, 0.72);
}

.tl4-d3-top {
  padding: 13px 15px 11px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(139, 92, 246, 0.16));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tl4-d3-top.is-lose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.24), rgba(30, 41, 59, 0.45));
}

.tl4-d3-mode {
  font-size: 10.5px;
  font-weight: 800;
  color: #cbd5e1;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.tl4-result-title {
  margin: 0;
  text-align: left;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
  color: #fde047;
}

.tl4-d3-top.is-lose .tl4-result-title {
  color: #fda4af;
}

.tl4-d3-sub {
  font-size: 11.5px;
  color: #cbd5e1;
  margin-top: 3px;
  line-height: 1.3;
}

.tl4-d3-hero-kpi {
  text-align: right;
  background: rgba(0, 0, 0, 0.36);
  padding: 7px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  white-space: nowrap;
  flex-shrink: 0;
}

.tl4-d3-body {
  padding: 11px 13px 13px;
}

.tl4-podium-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.tl4-podium-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tl4-podium-row.is-me {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.11);
}

.tl4-podium-row.is-rank1 {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.13), rgba(255, 255, 255, 0.03));
  border-color: rgba(251, 191, 36, 0.45);
}

.tl4-podium-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.tl4-rank-tag {
  font-size: 11px;
  font-weight: 900;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tl4-d3-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
  background: #1e293b;
}

.tl4-d3-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tl4-me-badge {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 900;
  background: #0284c7;
  color: #fff;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 4px;
  vertical-align: middle;
}

.tl4-d3-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.tl4-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
}
.tl4-tag-win { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.35); }
.tl4-tag-cong { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.35); }
.tl4-tag-thoi { background: rgba(251, 113, 133, 0.18); color: #fda4af; border: 1px solid rgba(251, 113, 133, 0.35); }
.tl4-tag-chop { background: rgba(251, 191, 36, 0.18); color: #fde047; border: 1px solid rgba(251, 191, 36, 0.35); }

.tl4-mini-cards {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 3px;
}
.tl4-mc {
  display: inline-block;
  padding: 0 4px;
  border-radius: 3px;
  background: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  border: 1px solid #cbd5e1;
}
.tl4-mc.red { color: #dc2626; }
.tl4-mc.blk { color: #0f172a; }
.tl4-mc.heo { background: #fef2f2; border-color: #f87171; }

.tl4-podium-right {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.tl4-d3-detail-btn {
  width: 100%;
  padding: 7px 10px;
  margin-bottom: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tl4-d3-transfers {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 9px;
  font-size: 11px;
}

.tl4-d3-tx-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
}
.tl4-d3-tx-row:last-child { border-bottom: none; }

.tl4-d3-lb-card {
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  padding: 9px 11px;
  margin-bottom: 10px;
}

.tl4-d3-lb-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fde047;
  margin-bottom: 6px;
}

.tl4-d3-lb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  font-size: 11px;
}

.tl4-d3-lb-entry {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px 7px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
}

.tl4-d3-actions {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.85fr;
  gap: 7px;
}

@media (max-width: 440px) {
  .tl4-d3-top { padding: 11px 12px 9px; }
  .tl4-result-title { font-size: 16px; }
  .tl4-d3-hero-kpi { padding: 6px 9px; }
  .tl4-d3-body { padding: 9px 10px 11px; }
  .tl4-d3-lb-grid { grid-template-columns: 1fr; }
  .tl4-d3-actions { grid-template-columns: 1fr 1fr; }
  .tl4-d3-actions button:first-child { grid-column: span 2; }
}

/* Sảnh chờ 4 ghế trong modal Waiting Room */
.tl4-wait-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}

.tl4-wait-slot {
  position: relative;
  padding: 9px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.tl4-wait-slot.empty {
  border-style: dashed;
  border-color: rgba(148, 163, 184, 0.35);
}

.tl4-toast-cut {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 210;
  padding: 8px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #dc2626);
  border: 2px solid #fef08a;
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

@media (max-width: 640px) {
  body.tienlen4-active #tab-tienlen4 {
    padding: 4px !important;
  }
  .tl4-arena {
    padding: 6px 6px 8px;
    min-height: 520px;
    max-height: calc(100dvh - 8px);
    border-radius: 14px;
    gap: 6px;
  }
  .tl4-topbar {
    padding: 5px 8px;
  }
  .tl4-table-middle {
    grid-template-columns: 82px 1fr 82px;
    gap: 4px;
    min-height: 220px;
  }
  .tl4-opp-card {
    width: auto;
    max-width: 100%;
    padding: 2px;
  }
  .tl4-seat-left .tl4-opp-card, .tl4-seat-right .tl4-opp-card {
    max-width: 82px;
  }
  .tl4-seat-top .tl4-card-back {
    width: 22px;
    height: 32px;
    margin-left: -11px;
  }
  .tl4-seat-top .tl4-cards-count-badge {
    font-size: 10px;
    padding: 1.5px 6px;
  }
  .tl4-ava-wrap { width: 32px; height: 32px; font-size: 15px; }
  .tl4-opp-name { font-size: 10px; max-width: 70px; }
  .tl4-hand {
    width: 100%;
    padding: 14px 4px 4px;
    box-sizing: border-box;
    min-height: 98px;
    overflow: hidden;
  }
  .tl4-card { width: 48px; height: 70px; margin-left: -24px; padding: 3px 4px; }
  .tl4-card-corner { font-size: 10.5px; width: 15px; }
  .tl4-card-center-suit { font-size: 18px; }
  .tl4-btn { padding: 8px 10px; font-size: 11.5px; }
  .tl4-trick-row .tl4-card { width: 42px; height: 60px; margin-left: -16px; }
}

/* =========================================================================
   HIỆU ỨNG CHẶT HEO / CHẶT HÀNG & FLOATING COIN VFX REAL-TIME
   ========================================================================= */
.tl4-chop-banner {
  position: absolute;
  top: 36%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95), rgba(185, 28, 28, 0.98), rgba(217, 119, 6, 0.95));
  border: 2px solid #fef08a;
  box-shadow: 0 0 28px rgba(245, 158, 11, 0.9), 0 8px 32px rgba(0, 0, 0, 0.85);
  border-radius: 16px;
  padding: 12px 24px;
  color: #fff;
  text-align: center;
  z-index: 999;
  pointer-events: none;
  animation: tl4ChopPop 2.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.tl4-chop-banner .tl4-chop-title {
  font-size: 14.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fef08a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  margin-bottom: 4px;
}

.tl4-chop-banner .tl4-chop-sub {
  font-size: 11.5px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

@keyframes tl4ChopPop {
  0% { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  12% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  22% { transform: translate(-50%, -50%) scale(1.0); opacity: 1; }
  78% { transform: translate(-50%, -50%) scale(1.0); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(0.9); opacity: 0; }
}

.tl4-float-coin-vfx {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  font-weight: 900;
  font-size: 13.5px;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: tl4FloatUp 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.tl4-float-coin-vfx.plus {
  color: #fef08a;
  background: rgba(5, 150, 105, 0.95);
  border: 1.5px solid #6ee7b7;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.85);
}

.tl4-float-coin-vfx.minus {
  color: #fee2e2;
  background: rgba(220, 38, 38, 0.95);
  border: 1.5px solid #f87171;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.85);
}

@keyframes tl4FloatUp {
  0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; }
  15% { transform: translate(-50%, -12px) scale(1.15); opacity: 1; }
  30% { transform: translate(-50%, -22px) scale(1.0); opacity: 1; }
  80% { transform: translate(-50%, -50px) scale(1.0); opacity: 0.9; }
  100% { transform: translate(-50%, -75px) scale(0.85); opacity: 0; }
}

/* ========================================================
   CỔNG GHÉP TRẬN (COSMIC VORTEX MATCHMAKING) - MẪU 3
   Hỗ trợ hoàn toàn WebKit / iOS Safari / Android / PC
   ======================================================== */
@-webkit-keyframes tl4SpinFast {
  from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}
@keyframes tl4SpinFast {
  from { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@-webkit-keyframes tl4SpinRev {
  from { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
  to { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
}
@keyframes tl4SpinRev {
  from { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
  to { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
}

@-webkit-keyframes tl4DotBounce {
  0%, 80%, 100% { -webkit-transform: scale(0.6); transform: scale(0.6); opacity: 0.4; }
  40% { -webkit-transform: scale(1.3); transform: scale(1.3); opacity: 1; }
}
@keyframes tl4DotBounce {
  0%, 80%, 100% { -webkit-transform: scale(0.6); transform: scale(0.6); opacity: 0.4; }
  40% { -webkit-transform: scale(1.3); transform: scale(1.3); opacity: 1; }
}

.tl4-portal-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 12px 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tl4-vortex-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 3.5px solid transparent;
  border-top-color: #e879f9;
  border-bottom-color: #38bdf8;
  -webkit-transform-origin: center center;
  transform-origin: center center;
  -webkit-animation: tl4SpinFast 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  animation: tl4SpinFast 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite;
  will-change: transform;
  pointer-events: none;
}

.tl4-vortex-ring2 {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 122px;
  height: 122px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-left-color: #fbbf24;
  border-right-color: #a855f7;
  -webkit-transform-origin: center center;
  transform-origin: center center;
  -webkit-animation: tl4SpinRev 2.2s linear infinite;
  animation: tl4SpinRev 2.2s linear infinite;
  will-change: transform;
  pointer-events: none;
}

.tl4-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  -webkit-animation: tl4DotBounce 1.2s infinite ease-in-out;
  animation: tl4DotBounce 1.2s infinite ease-in-out;
}



/* ========================================================
   DOCK AVATAR BẢN THÂN VÀ CHẾ ĐỘ CÓNG / KHÁN GIẢ 4P
   ======================================================== */
.tl4-self-dock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 15;
  background: rgba(6, 20, 38, 0.88);
  border: 1.5px solid rgba(251, 191, 36, 0.75);
  border-radius: 40px;
  padding: 4px 16px 4px 6px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5), 0 0 14px rgba(251, 191, 36, 0.25);
  transition: all 0.25s ease;
}

.tl4-self-dock.is-turn {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.65);
}

.tl4-my-ava-wrap {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #fbbf24;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
  flex-shrink: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.tl4-my-ava-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tl4-hand-wrap {
  position: relative;
  max-width: 100%;
  display: flex;
  justify-content: center;
}

.tl4-hand.is-cong-hand {
  position: relative;
  pointer-events: none;
  filter: grayscale(60%) brightness(0.7);
}

.tl4-hand-cong-overlay {
  position: absolute;
  inset: -6px -10px;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.88) 0%, rgba(2, 6, 23, 0.95) 100%);
  border: 2px solid #ef4444;
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.75), inset 0 0 20px rgba(56, 189, 248, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  z-index: 60;
  padding: 10px 16px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: congOverlayPulse 2.5s infinite alternate ease-in-out;
}

.tl4-cong-overlay-title {
  font-family: 'Orbitron', 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  font-weight: 900;
  color: #ef4444;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.95), 0 2px 4px #000;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl4-cong-overlay-sub {
  font-size: 12px;
  color: #bae6fd;
  font-weight: 700;
  text-shadow: 0 1px 3px #000;
}

.tl4-spectator-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(153, 27, 27, 0.96));
  border: 1.5px solid #ef4444;
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.65), 0 4px 10px rgba(0, 0, 0, 0.6);
  font-weight: 800;
  font-size: 12.5px;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  animation: tl4SpectatorGlow 2s infinite alternate ease-in-out;
}

@keyframes tl4SpectatorGlow {
  0% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.5); }
  100% { box-shadow: 0 0 22px rgba(239, 68, 68, 0.9), 0 0 6px #fca5a5; }
}


/* ==========================================================================
   HIỆU ỨNG RUNG LẮC BÀN ĐẤU, BÁO ĐỘNG ĐỎ & MENU GIAO LƯU NHANH (QUICK CHAT)
   ========================================================================== */
@keyframes tableShakeAnim {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  15% { transform: translate(-8px, 5px) rotate(-1.2deg); }
  30% { transform: translate(8px, -5px) rotate(1.2deg); }
  45% { transform: translate(-6px, -3px) rotate(-0.8deg); }
  60% { transform: translate(6px, 3px) rotate(0.8deg); }
  75% { transform: translate(-3px, 2px) rotate(-0.4deg); }
  90% { transform: translate(3px, -2px) rotate(0.4deg); }
}

.table-shake {
  animation: tableShakeAnim 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
}

@keyframes alarmPulseAnim {
  0%, 100% { box-shadow: inset 0 0 10px rgba(239, 68, 68, 0); border-color: rgba(239, 68, 68, 0.2); }
  50% { box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.6), 0 0 30px rgba(239, 68, 68, 0.8); border-color: rgba(239, 68, 68, 1); }
}

.alarm-pulsing {
  animation: alarmPulseAnim 0.7s infinite alternate !important;
}

/* Nút Quick Voice Wheel Floating (Ẩn triệt để) */
.btn-quick-voice-trigger {
  display: none !important;
  pointer-events: none !important;
}

.btn-quick-voice-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.8);
}

.btn-quick-voice-trigger:active {
  transform: scale(0.95);
}

/* Modal Quick Voice Wheel */
.quick-voice-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.quick-voice-modal-overlay.active {
  display: flex;
}

.quick-voice-container {
  width: 90%;
  max-width: 460px;
  background: linear-gradient(165deg, #1e1e2f 0%, #11111b 100%);
  border: 2px solid #f59e0b;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(245, 158, 11, 0.3);
  text-align: center;
}

.quick-voice-title {
  font-size: 18px;
  font-weight: 900;
  color: #fbbf24;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-voice-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 15px;
}

.quick-voice-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #f3f4f6;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.quick-voice-btn:hover {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.quick-voice-btn:active {
  transform: scale(0.96);
}

.quick-voice-btn .qv-icon {
  font-size: 20px;
}

.quick-voice-close-btn {
  padding: 8px 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #9ca3af;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-voice-close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-color: #ef4444;
}

/* Banner MC Caster Announcement */
.mc-caster-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: linear-gradient(135deg, rgba(20, 20, 35, 0.95), rgba(40, 20, 60, 0.95));
  border: 2px solid #a855f7;
  border-radius: 999px;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4), 0 0 15px rgba(168, 85, 247, 0.6);
  color: #f3e8ff;
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mc-caster-banner.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.mc-caster-banner .mc-badge {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}


/* === BOT THINKING ANIMATION & INDICATOR (NGƯỜI THẬT SUY NGHĨ) === */
.bot-thinking-glow {
  position: relative !important;
  animation: botThinkingPulse 1.4s ease-in-out infinite alternate !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.9), inset 0 0 8px rgba(250, 204, 21, 0.6) !important;
  border-color: #facc15 !important;
}

@keyframes botThinkingPulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.22) drop-shadow(0 0 10px rgba(250, 204, 21, 0.95)); }
  100% { transform: scale(1); filter: brightness(1); }
}

.bot-thinking-badge {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  color: #fef08a;
  border: 1.5px solid #facc15;
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  animation: tlmnThinkingBadgePop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(8px);
}

.bot-thinking-badge .thinking-dots::after {
  content: '...';
  display: inline-block;
  width: 14px;
  text-align: left;
  animation: thinkingDotsAnim 1.4s infinite;
}

@keyframes thinkingDotsAnim {
  0% { content: '.'; }
  33% { content: '..'; }
  66% { content: '...'; }
}

@keyframes tlmnThinkingBadgePop {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* =========================================================================
   GALAXY GAME - V180 EXPANSION CSS
   1. IN-MATCH VOICE CHAT PANEL & SPEECH BUBBLES
   2. BOT BOUNTY & LUCKY DROP
   3. BOT MEMORY & HEAD-TO-HEAD
   4. LIVE EMOTIVE MICRO-REACTIONS (AVATAR FX)
   ========================================================================= */

/* 1. Nút mở Chat trong trận đấu */
.btn-inmatch-chat-trigger:not(.tl4-chat-btn):not(#tl4BtnChatTrigger) {
  position: absolute;
  bottom: 85px;
  right: 130px;
  z-index: 10050;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}
.btn-inmatch-chat-trigger:hover {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}
.btn-inmatch-chat-trigger:active {
  transform: scale(0.95);
}

/* 2. In-Match Chat Panel */
.inmatch-chat-panel {
  position: fixed;
  bottom: 95px;
  right: 25px;
  width: 320px;
  max-width: 90vw;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(59, 130, 246, 0.25);
  border-radius: 16px;
  padding: 12px;
  z-index: 10060;
  display: none;
  flex-direction: column;
  gap: 10px;
  animation: tlmnChatPanelSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.inmatch-chat-panel.active {
  display: flex !important;
}
@keyframes tlmnChatPanelSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 8px;
}
.chat-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 0.3px;
}
.chat-panel-close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.15s ease;
}
.chat-panel-close-btn:hover {
  background: rgba(239, 68, 68, 0.8);
  color: #ffffff;
}

.chat-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 110px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-quick-chip {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 5px 10px;
  color: #e2e8f0;
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.chat-quick-chip:hover {
  background: rgba(59, 130, 246, 0.4);
  border-color: #60a5fa;
  color: #ffffff;
  transform: translateY(-1px);
}

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.chat-input-row input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 12px;
  outline: none;
  transition: border-color 0.2s ease;
}
.chat-input-row input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}
.chat-input-row button {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-input-row button:hover {
  background: linear-gradient(135deg, #34d399, #10b981);
  transform: translateY(-1px);
}

/* 3. Bong bóng thoại Speech Bubble trên Avatar */
.tl-speech-chat-bubble {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #ffffff;
  border: 1.5px solid rgba(56, 189, 248, 0.6);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 14px rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: normal;
  max-width: 220px;
  min-width: 90px;
  text-align: center;
  z-index: 10040;
  pointer-events: none;
  animation: tlmnBubblePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  line-height: 1.35;
}
.tl-speech-chat-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
}
.tl-speech-chat-bubble.bubble-player {
  border-color: rgba(74, 222, 128, 0.8);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7), 0 0 14px rgba(74, 222, 128, 0.35);
  color: #f0fdf4;
}
.tl-speech-chat-bubble.bubble-player::after {
  border-color: #0f172a transparent transparent transparent;
}

@keyframes tlmnBubblePop {
  0% { opacity: 0; transform: translateX(-50%) translateY(10px) scale(0.85); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* 4. Head-to-Head & Bounty Badges */
.tl-h2h-badge {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(161, 98, 7, 0.35));
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #fef08a;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tl-bounty-badge {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 10020;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 12px rgba(251, 191, 36, 0.25);
  border-radius: 12px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  animation: tlmnBountyPulse 2.5s infinite;
}
@keyframes tlmnBountyPulse {
  0%, 100% { transform: scale(1); border-color: rgba(251, 191, 36, 0.5); }
  50% { transform: scale(1.02); border-color: rgba(251, 191, 36, 0.9); box-shadow: 0 4px 20px rgba(251, 191, 36, 0.4); }
}
.tl-bounty-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}
.tl-bounty-tag {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  padding: 2px 7px;
  border-radius: 6px;
  font-weight: 800;
  font-size: 10.5px;
}
.tl-bounty-desc {
  color: #cbd5e1;
  font-weight: 600;
}
.tl-bounty-reward {
  color: #fde047;
  font-weight: 800;
  background: rgba(250, 204, 21, 0.15);
  border: 1px solid rgba(250, 204, 21, 0.4);
  padding: 2px 6px;
  border-radius: 6px;
}

/* 5. Live Emotive Reactions Avatar Animation FX */
.avatar-shocked {
  animation: avatarShockShake 0.4s infinite !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.8) !important;
}
@keyframes avatarShockShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  20% { transform: translate(-2px, 0px) rotate(-1deg); }
  40% { transform: translate(2px, -1px) rotate(1deg); }
  60% { transform: translate(-1px, 2px) rotate(0deg); }
  80% { transform: translate(1px, -2px) rotate(1deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

.avatar-gold-glow {
  animation: avatarGoldPulse 1s infinite alternate !important;
  border-color: #facc15 !important;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.9), inset 0 0 12px rgba(250, 204, 21, 0.5) !important;
}
@keyframes avatarGoldPulse {
  from { filter: drop-shadow(0 0 6px #facc15); transform: scale(1); }
  to { filter: drop-shadow(0 0 16px #f59e0b); transform: scale(1.05); }
}

.avatar-sad {
  filter: grayscale(0.7) brightness(0.75) !important;
  border-color: #64748b !important;
}

.avatar-fire-glow {
  animation: avatarFirePulse 0.8s infinite alternate !important;
  border-color: #f97316 !important;
  box-shadow: 0 0 26px rgba(249, 115, 22, 0.9) !important;
}
@keyframes avatarFirePulse {
  from { transform: scale(1); filter: drop-shadow(0 0 6px #ea580c); }
  to { transform: scale(1.06); filter: drop-shadow(0 0 18px #ef4444); }
}

.tl-micro-reaction-badge {
  position: absolute;
  top: -12px;
  right: -10px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10055;
  pointer-events: none;
  animation: microReactionFloat 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}
@keyframes microReactionFloat {
  from { opacity: 0; transform: translateY(8px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}


/* ========================================================================= */
/* GHẾ TRỐNG CHỜ NGƯỜI CHƠI / BOT GÕ CỬA (BẢN V194) */
/* ========================================================================= */
.tl4-opp-card.is-empty-seat {
  opacity: 1 !important;
  pointer-events: auto !important;
  visibility: visible !important;
}
.tl4-opp-card.is-empty-seat .tl4-empty-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  border: 1.5px dashed rgba(251, 191, 36, 0.55);
  border-radius: 20px;
  padding: 6px 12px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.tl4-opp-card.is-empty-seat .tl4-empty-slot:hover {
  border-color: #fbbf24;
  background: rgba(30, 41, 59, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.3);
}
.tl4-opp-card.is-empty-seat .tl4-empty-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
  border: 1.5px dashed #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  color: #fde047;
  animation: tl4PulseEmpty 1.8s infinite ease-in-out;
}
@keyframes tl4PulseEmpty {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.1); opacity: 1; filter: drop-shadow(0 0 6px #f59e0b); }
}

/* ========================================================================= */
/* POPUP GÕ CỬA XIN VÀO PHÒNG (KNOCK MODAL) */
/* ========================================================================= */
.tl4-knock-overlay {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10080;
  pointer-events: auto;
  animation: tl4KnockSlideDown 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tl4KnockSlideDown {
  from { opacity: 0; transform: translate(-50%, -24px) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.tl4-knock-box {
  min-width: 330px;
  max-width: 420px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  border: 1.5px solid #f59e0b;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 20px rgba(245, 158, 11, 0.3);
  border-radius: 18px;
  padding: 12px 16px;
  backdrop-filter: blur(14px);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tl4-knock-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tl4-knock-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #fde047;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tl4-knock-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tl4-knock-avatar-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}
.tl4-knock-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fde047;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}
.tl4-knock-vip-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 1px 5px;
  border-radius: 8px;
  border: 1px solid #fde047;
}
.tl4-knock-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tl4-knock-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tl4-knock-name {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
}
.tl4-knock-loc {
  font-size: 11px;
  color: #94a3b8;
}
.tl4-knock-quote {
  font-size: 12px;
  font-style: italic;
  color: #fef08a;
  line-height: 1.35;
}
.tl4-knock-zcoin {
  font-size: 11px;
  color: #38bdf8;
  font-weight: 700;
}
.tl4-knock-timer-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}
.tl4-knock-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #f59e0b);
  border-radius: 4px;
  transition: width 0.1s linear;
}
.tl4-knock-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tl4-knock-btn-accept {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  transition: all 0.2s;
}
.tl4-knock-btn-accept:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}
.tl4-knock-btn-reject {
  padding: 8px 14px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.8);
  color: #fca5a5;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.tl4-knock-btn-reject:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
}

/* =========================================================================
   MODAL BOT TẶNG ZCOIN & XIN KẾT BẠN (GIAI ĐOẠN 2)
   ========================================================================= */
.tl4-bot-gift-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: tl4GiftFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tl4GiftFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.tl4-bot-gift-card {
  width: 100%;
  max-width: 420px;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 75%, #020617 100%);
  border: 1.8px solid #f59e0b;
  border-radius: 20px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 30px rgba(245, 158, 11, 0.35);
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tl4-bot-gift-card::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.35) 0%, transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.tl4-gift-badge-top {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.5);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 11.5px;
  font-weight: 800;
  color: #fde68a;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 14px;
}

.tl4-gift-bot-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 12px;
}

.tl4-gift-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2.5px solid #fbbf24;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.5);
  position: relative;
  margin-bottom: 8px;
}

.tl4-gift-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tl4-gift-bot-name {
  font-size: 16px;
  font-weight: 900;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl4-gift-bot-sub {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 2px;
}

.tl4-gift-amount-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(180, 83, 9, 0.25));
  border: 1px dashed rgba(245, 158, 11, 0.6);
  border-radius: 14px;
  padding: 12px 16px;
  margin: 12px 0 14px;
}

.tl4-gift-amount-num {
  font-size: 24px;
  font-weight: 900;
  color: #fde047;
  text-shadow: 0 0 15px rgba(253, 224, 71, 0.6);
  font-family: 'Orbitron', sans-serif, system-ui;
  letter-spacing: 1px;
}

.tl4-gift-amount-sub {
  font-size: 11px;
  color: #cbd5e1;
  font-weight: 600;
  margin-top: 2px;
}

.tl4-gift-quote-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12.5px;
  font-style: italic;
  color: #e2e8f0;
  line-height: 1.45;
  margin-bottom: 18px;
  position: relative;
}

.tl4-gift-quote-box::before {
  content: '“';
  font-size: 24px;
  color: #f59e0b;
  position: absolute;
  top: 2px;
  left: 6px;
  font-family: serif;
}

.tl4-gift-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tl4-btn-gift-accept {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #020617;
  font-weight: 900;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.45);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tl4-btn-gift-accept:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.6);
  filter: brightness(1.1);
}

.tl4-btn-gift-only {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.tl4-btn-gift-only:hover {
  background: rgba(51, 65, 85, 0.8);
  color: #ffffff;
}

.tl4-btn-gift-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.tl4-btn-gift-close:hover {
  background: rgba(239, 68, 68, 0.3);
  color: #ffffff;
}

/* =========================================================================
   MODAL HỒ SƠ NGƯỜI CHƠI & KHAY TẶNG ZCOIN / QUÀ TẶNG (BẢN V196)
   ========================================================================= */
.tl4-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  animation: tl4ProfileFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tl4ProfileFadeIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.tl4-profile-card {
  width: 100%;
  max-width: 440px;
  background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, #0f172a 70%, #020617 100%);
  border: 1.8px solid #fbbf24;
  border-radius: 22px;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.85), 0 0 35px rgba(251, 191, 36, 0.3);
  padding: 22px 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.tl4-profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 14px;
}

.tl4-profile-ava-wrap {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 3px solid #fbbf24;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.55);
  position: relative;
  margin-bottom: 8px;
}

.tl4-profile-ava-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tl4-profile-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 900;
  color: #f8fafc;
}

.tl4-profile-tag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tl4-tag-bot {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.tl4-tag-player {
  background: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.tl4-profile-sub {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
  margin-top: 3px;
}

.tl4-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
  padding: 10px 8px;
}

.tl4-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tl4-stat-val {
  font-size: 13.5px;
  font-weight: 900;
  color: #fde047;
  font-family: 'Orbitron', sans-serif, system-ui;
}

.tl4-stat-lbl {
  font-size: 9.5px;
  color: #94a3b8;
  font-weight: 700;
  margin-top: 2px;
  text-transform: uppercase;
}

/* Khay hành động */
.tl4-profile-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.tl4-btn-action-gift-zcoin {
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.6);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.15));
  color: #fde68a;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.25);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tl4-btn-action-gift-zcoin:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #020617;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.tl4-btn-action-gift-item {
  padding: 11px;
  border-radius: 12px;
  border: 1px solid rgba(236, 72, 153, 0.6);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(190, 24, 93, 0.15));
  color: #fbcfe8;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.25);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.tl4-btn-action-gift-item:hover {
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
}

/* Khung chọn mệnh giá tặng ZCoin */
.tl4-gift-picker-panel {
  display: none;
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(245, 158, 11, 0.5);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
  animation: tl4SlideDown 0.2s ease forwards;
}

.tl4-gift-picker-panel.active {
  display: block;
}

@keyframes tl4SlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.tl4-gift-denoms {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.tl4-denom-btn {
  padding: 7px 4px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(30, 41, 59, 0.7);
  color: #f8fafc;
  font-weight: 800;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.tl4-denom-btn.selected,
.tl4-denom-btn:hover {
  background: #f59e0b;
  color: #020617;
  border-color: #f59e0b;
  transform: scale(1.05);
}

.tl4-gift-input-note {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(2, 6, 23, 0.7);
  color: #ffffff;
  font-size: 12px;
  margin-bottom: 10px;
}

.tl4-gift-input-note:focus {
  outline: none;
  border-color: #f59e0b;
}

.tl4-btn-send-gift-submit {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 900;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.35);
  transition: all 0.2s;
}

.tl4-btn-send-gift-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* Khung chọn quà tặng vật phẩm */
.tl4-item-picker-panel {
  display: none;
  background: rgba(15, 23, 42, 0.85);
  border: 1px dashed rgba(236, 72, 153, 0.5);
  border-radius: 14px;
  padding: 12px;
  margin-top: 10px;
  animation: tl4SlideDown 0.2s ease forwards;
}

.tl4-item-picker-panel.active {
  display: block;
}

.tl4-item-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.tl4-item-chip {
  padding: 8px 4px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.6);
  color: #f8fafc;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tl4-item-chip.selected,
.tl4-item-chip:hover {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.2);
  transform: scale(1.04);
}

.tl4-item-icon {
  font-size: 22px;
}

.tl4-item-name {
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}

.tl4-item-price {
  font-size: 9.5px;
  color: #fde047;
  font-weight: 800;
}

/* Badge đố vui nhấp nháy trên nút Chat */
.tl4-chat-trivia-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
  animation: tl4TriviaPulse 1.2s infinite alternate;
}

@keyframes tl4TriviaPulse {
  from { transform: scale(0.95); box-shadow: 0 0 4px rgba(239, 68, 68, 0.6); }
  to { transform: scale(1.12); box-shadow: 0 0 14px rgba(239, 68, 68, 1); }
}

/* Banner câu đố nổi trên bàn cờ */
.tl4-trivia-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  background: linear-gradient(135deg, rgba(30, 27, 75, 0.94) 0%, rgba(15, 23, 42, 0.94) 100%);
  border: 1.5px solid #38bdf8;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 18px rgba(56, 189, 248, 0.35);
  padding: 10px 18px;
  max-width: 520px;
  width: 90%;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: tl4BannerSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tl4BannerSlideDown {
  from { opacity: 0; transform: translate(-50%, -15px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.tl4-trivia-timer-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: #38bdf8;
  flex-shrink: 0;
  font-family: 'Orbitron', sans-serif;
}

.tl4-trivia-content {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.tl4-trivia-bot-title {
  font-size: 11px;
  font-weight: 800;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 5px;
}

.tl4-trivia-question {
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 2px;
  line-height: 1.35;
}

.tl4-trivia-reward-tag {
  font-size: 10.5px;
  font-weight: 800;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  white-space: nowrap;
}
