/* ========================================================
   🎲 BẦU CUA TÔM CÁ - MINIGAME TIỆM TÀ TỮA
   ======================================================== */

.baucua-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 15, 10, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 12px;
  overflow-y: auto;
}

.baucua-modal[hidden] {
  display: none !important;
}

.baucua-card {
  background: #fffdf8;
  border: 4px solid #8a5a3b;
  border-radius: 26px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.35);
  max-width: 500px;
  width: 100%;
  padding: 16px 14px;
  box-sizing: border-box;
  font-family: inherit;
  color: #3a2317;
  position: relative;
  animation: bcPop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

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

.bc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #ead7bd;
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.bc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #8a3a50;
  margin: 0;
}

.bc-close-btn {
  background: #fdf3e4;
  border: 2px solid #ead7bd;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7a5a48;
  font-weight: 800;
  transition: all 0.15s;
}
.bc-close-btn:hover {
  background: #ef6f8e;
  color: #fff;
  border-color: #ef6f8e;
}

/* Thanh tiền két */
.bc-wallet-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #1b382b;
  background: radial-gradient(circle at 50% 35%, #24523b 0%, #133022 70%, #0c2016 100%);
  border: 2px solid #d4af37;
  border-radius: 14px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: #f7d56b;
  box-shadow: inset 0 0 12px rgba(0,0,0,0.3);
}
.bc-wallet-bar .bc-money {
  color: #fbbf24;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}
.bc-wallet-bar .bc-bet-total {
  color: #fed7aa;
  font-weight: 800;
}

/* Khu vực bàn cược và đĩa lắc */
.bc-main-layout {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  align-items: center;
}

@media (max-width: 440px) {
  .bc-main-layout {
    grid-template-columns: 1fr;
  }
}

/* Bàn cược 2 cột x 3 hàng chuẩn theo ảnh */
.bc-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #fbf3e6;
  border: 3px solid #8a5a3b;
  border-radius: 18px;
  padding: 8px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.06);
}

.bc-tile {
  background: #fff;
  border: 2px solid #ead7bd;
  border-radius: 14px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
  min-height: 86px;
}

.bc-tile:hover {
  transform: translateY(-2px);
  border-color: #ef7f98;
}

.bc-tile:active {
  transform: scale(0.97);
}

.bc-tile.winner {
  border-color: #f59e0b !important;
  background: #fef9c3 !important;
  box-shadow: 0 0 0 3px #f59e0b, 0 4px 12px rgba(245, 158, 11, 0.45);
  animation: bcPulseWin 0.6s infinite alternate;
}

@keyframes bcPulseWin {
  from { transform: scale(1); }
  to { transform: scale(1.04); }
}

.bc-tile-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.12));
}

.bc-tile-name {
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  margin-top: 3px;
  color: #5a3d28;
}

.bc-tile-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  display: none;
  white-space: nowrap;
}
.bc-tile-badge.show {
  display: block;
}

/* Đĩa xóc và xúc xắc */
.bc-plate-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.bc-plate {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, #e6f3fa 40%, #c4e1ed 70%, #9bc7db 100%);
  border: 5px solid #8ab8ce;
  box-shadow: 0 6px 14px rgba(0,0,0,0.15), inset 0 3px 6px rgba(255,255,255,0.8);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Bát úp dùng ảnh xocdia.png */
.bc-bowl {
  position: absolute;
  inset: -6px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s;
}

.bc-bowl img {
  width: 140px;
  height: auto;
  max-height: 130px;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,0.3));
}

.bc-bowl.open {
  transform: translateY(-120px) scale(0.85);
  opacity: 0;
  pointer-events: none;
}

.bc-bowl.shaking {
  animation: bcShake 0.12s infinite;
}

@keyframes bcShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-4px, 3px) rotate(-4deg); }
  50% { transform: translate(3px, -3px) rotate(4deg); }
  75% { transform: translate(-3px, -2px) rotate(-2deg); }
  100% { transform: translate(3px, 2px) rotate(3deg); }
}

/* 3 viên xúc xắc */
.bc-dice-box {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
  width: 90px;
  height: 90px;
}

.bc-die {
  width: 38px;
  height: 38px;
  background: #fff;
  border: 2px solid #8a5a3b;
  border-radius: 8px;
  box-shadow: 0 3px 0 #ead7bd;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-sizing: border-box;
}

.bc-die img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Chip chọn mức cược */
.bc-chips-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.bc-chip {
  min-width: 44px;
  height: 34px;
  border-radius: 17px;
  border: 2px solid #8a5a3b;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 10px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.12);
  transition: transform 0.1s, box-shadow 0.1s;
}

.bc-chip:active {
  transform: translateY(2px);
  box-shadow: none;
}

.bc-chip.selected {
  outline: 3px solid #ef6f8e;
  outline-offset: 2px;
  transform: translateY(-2px);
}

.bc-chip-10k  { background: #e0e7ff; color: #3730a3; border-color: #6366f1; }
.bc-chip-50k  { background: #fef3c7; color: #92400e; border-color: #f59e0b; }
.bc-chip-100k { background: #dcfce7; color: #166534; border-color: #22c55e; }
.bc-chip-500k { background: #ffe4e6; color: #9f1239; border-color: #f43f5e; }
.bc-chip-1m   { background: #fef08a; color: #854d0e; border-color: #eab308; }
.bc-chip-all  { background: #fbcfe8; color: #831843; border-color: #ec4899; }

/* Các nút hành động */
.bc-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.bc-roll-btn {
  grid-column: span 2;
  background: linear-gradient(135deg, #ef6f8e, #e0476a);
  border: 3px solid #b83554;
  color: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a243c;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.1s;
}

.bc-roll-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8a243c;
}

.bc-roll-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: 0 4px 0 #8a243c;
}

.bc-sub-btn {
  background: #fbf5ec;
  border: 2px solid #8a5a3b;
  border-radius: 12px;
  padding: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #5a3d28;
  cursor: pointer;
}
.bc-sub-btn:hover {
  background: #fdf3e4;
}

/* Kết quả hiển thị */
.bc-result-banner {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  display: none;
}
.bc-result-banner.show {
  display: block;
}
.bc-result-banner.win {
  background: #dcfce7;
  color: #15803d;
  border: 2px solid #86efac;
}
.bc-result-banner.lose {
  background: #fee2e2;
  color: #b91c1c;
  border: 2px solid #fca5a5;
}
.bc-result-banner.tie {
  background: #fef9c3;
  color: #854d0e;
  border: 2px solid #fde047;
}

/* Nút Bầu Cua trên giao diện chính */
#bcBtn {
  display: none;
}
body:not(.selling) #bcBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff3e6;
  border-color: #f59b7c;
  cursor: pointer;
  animation: bcPulseBtn 2s infinite ease-in-out;
  padding: 0;
  overflow: hidden;
}
#bcBtn .ico, #bcBtn img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

@keyframes bcPulseBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); box-shadow: 0 0 10px rgba(245, 155, 124, 0.6); }
}

/* ===== CẢNH BÁO ĐOÀN LIÊN NGÀNH & BIÊN BẢN KIỂM TRA ===== */
.police-raid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(18, 12, 10, 0.95);
  border-radius: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
  box-sizing: border-box;
  text-align: center;
  animation: bcRaidFlash 0.6s infinite alternate;
}

@keyframes bcRaidFlash {
  0% { box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.6); }
  100% { box-shadow: inset 0 0 70px rgba(239, 68, 68, 0.95); }
}

.police-badge-icon {
  font-size: 3rem;
  margin-bottom: 8px;
  animation: policePulse 0.5s infinite alternate;
}
@keyframes policePulse {
  from { transform: scale(1); }
  to { transform: scale(1.15); }
}

.police-title {
  color: #ff5252 !important;
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  margin: 0 0 10px !important;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  line-height: 1.25;
}

.police-sub {
  color: #fef08a !important;
  font-size: 0.95rem !important;
  font-weight: 700 !important;
  margin-bottom: 16px !important;
  line-height: 1.4;
  max-width: 420px;
}

.police-timer-bar-wrap {
  width: 100%;
  max-width: 320px;
  height: 14px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.4);
}

.police-timer-bar {
  height: 100%;
  background: linear-gradient(90deg, #ef4444, #f59e0b);
  border-radius: 8px;
  transition: width 0.1s linear;
}

.police-hide-btn {
  background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
  color: #1a1a1a !important;
  border: 2px solid #fff !important;
  border-radius: 16px !important;
  padding: 12px 20px !important;
  font-size: 1rem !important;
  font-weight: 900 !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.6) !important;
  transition: transform 0.1s !important;
}
.police-hide-btn:active {
  transform: scale(0.96) !important;
}

/* Thẻ biên bản xử phạt */
.police-fine-card {
  background: #ffffff !important;
  color: #1e293b !important;
  border: 3px solid #ef4444 !important;
  border-radius: 20px !important;
  padding: 20px 18px !important;
  box-shadow: 0 14px 40px rgba(0,0,0,0.6) !important;
  max-width: 440px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: center !important;
}

.police-fine-header {
  font-size: 1.25rem !important;
  font-weight: 900 !important;
  color: #dc2626 !important;
  border-bottom: 2px dashed #fca5a5 !important;
  padding-bottom: 10px !important;
  margin-bottom: 14px !important;
}

.police-fine-body {
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  color: #334155 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  text-align: left !important;
}

.police-fine-amt {
  font-size: 1.6rem !important;
  font-weight: 900 !important;
  color: #dc2626 !important;
  text-align: center !important;
  margin: 6px 0 !important;
}

.police-fine-confirm-btn {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #cbd5e1 !important;
  border-radius: 14px !important;
  padding: 12px 24px !important;
  font-weight: 900 !important;
  font-size: 1rem !important;
  cursor: pointer !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  margin-top: 14px !important;
  display: inline-block !important;
  transition: transform 0.15s, background 0.15s !important;
}
.police-fine-confirm-btn:hover {
  background: #f8fafc !important;
  transform: translateY(-2px) !important;
}
