/* ================= HỆ THỐNG ANIMATION HƯỚNG DẪN GAMEPLAY & SPOTLIGHT HINT TƯƠNG TÁC (GỌN ĐẸP) ================= */
/* Làm mờ vùng ngoài bằng 4 tấm chắn, chiếu sáng duy nhất 1 mục tiêu kèm Bàn tay hoạt họa & Thẻ Hint siêu gọn.    */

.lop-phu-huong-dan-gameplay {
  position: fixed;
  inset: 0;
  z-index: 9850;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: var(--font-game-chinh, 'Nunito', 'Be Vietnam Pro', sans-serif);
}

.lop-phu-huong-dan-gameplay.dang-an {
  display: none !important;
}

/* 4 tấm chắn làm mờ xung quanh vùng Spotlight — khóa thao tác bấm nhầm bên ngoài */
.tam-chan-mo-hint {
  position: fixed;
  z-index: 9851;
  background: rgba(16, 9, 4, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: auto;
  transition:
    left 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Khung viền Spotlight chiếu sáng đúng mục tiêu cần bấm */
.khung-vien-spotlight-hint {
  position: fixed;
  z-index: 9855;
  border-radius: 12px;
  border: 3px solid #fde047;
  box-shadow:
    0 0 0 2px rgba(120, 53, 15, 0.9),
    0 0 0 5px rgba(250, 204, 21, 0.32),
    0 0 24px 5px rgba(250, 204, 21, 0.55),
    inset 0 0 14px rgba(254, 240, 138, 0.32);
  pointer-events: none;
  transition:
    left 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    height 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  animation: nhipThoSpotlightVang 1.5s ease-in-out infinite;
}

.khung-vien-spotlight-hint.cho-phep-bam-qua-buoc {
  pointer-events: auto;
  cursor: pointer;
}

@keyframes nhipThoSpotlightVang {
  0%, 100% {
    border-color: #fde047;
    box-shadow:
      0 0 0 2px rgba(120, 53, 15, 0.9),
      0 0 0 4px rgba(250, 204, 21, 0.28),
      0 0 20px 4px rgba(250, 204, 21, 0.5),
      inset 0 0 12px rgba(254, 240, 138, 0.25);
  }
  50% {
    border-color: #ffffff;
    box-shadow:
      0 0 0 2px rgba(146, 64, 14, 0.95),
      0 0 0 8px rgba(253, 224, 71, 0.42),
      0 0 30px 8px rgba(250, 204, 21, 0.75),
      inset 0 0 18px rgba(254, 249, 195, 0.45);
  }
}

/* 4 Góc kim loại vàng Pixel Art bám quanh khung Spotlight */
.goc-pixel-spotlight {
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: #fffbeb;
  border-style: solid;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
}

.goc-pixel-spotlight.goc-tren-trai {
  top: -3px;
  left: -3px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 5px;
}

.goc-pixel-spotlight.goc-tren-phai {
  top: -3px;
  right: -3px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 5px;
}

.goc-pixel-spotlight.goc-duoi-trai {
  bottom: -3px;
  left: -3px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 5px;
}

.goc-pixel-spotlight.goc-duoi-phai {
  bottom: -3px;
  right: -3px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 5px;
}

/* ================= CON TRỎ BÀN TAY HOẠT HỌA (TAP & DRAG TRAJECTORY) ================= */

.cum-con-tro-ban-tay-hint {
  position: fixed;
  z-index: 9860;
  width: 48px;
  height: 48px;
  margin-left: -24px;
  margin-top: -24px;
  pointer-events: none;
  transition:
    left 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    top 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.vong-song-ban-tay-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  margin-top: -15px;
  border-radius: 50%;
  border: 2.5px solid #fde047;
  background: rgba(254, 240, 138, 0.22);
  opacity: 0;
  pointer-events: none;
}

.cum-con-tro-ban-tay-hint.che-do-cham .vong-song-ban-tay-hint.vong-1 {
  animation: songChamBanTayHint 1.3s ease-out infinite;
}

.cum-con-tro-ban-tay-hint.che-do-cham .vong-song-ban-tay-hint.vong-2 {
  animation: songChamBanTayHint 1.3s ease-out 0.32s infinite;
}

@keyframes songChamBanTayHint {
  0% {
    transform: scale(0.45);
    opacity: 0.95;
  }
  75% {
    transform: scale(1.8);
    opacity: 0;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.bieu-tuong-ban-tay-svg {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38px;
  height: 38px;
  margin-left: -9px;
  margin-top: -5px;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.65));
  transform-origin: 25% 15%;
}

.cum-con-tro-ban-tay-hint.che-do-cham .bieu-tuong-ban-tay-svg {
  animation: banTayTapLienTuc 1.3s ease-in-out infinite;
}

@keyframes banTayTapLienTuc {
  0%, 100% {
    transform: translate(9px, 11px) rotate(-12deg) scale(1.06);
  }
  32% {
    transform: translate(0px, 0px) rotate(-22deg) scale(0.9);
  }
  52% {
    transform: translate(3px, 4px) rotate(-18deg) scale(0.96);
  }
}

/* Chế độ Kéo Lên Bàn (Tap + Swipe Up Trajectory) */
.cum-con-tro-ban-tay-hint.che-do-keo-len .bieu-tuong-ban-tay-svg {
  animation: banTayKeoLenBan 2s cubic-bezier(0.25, 1, 0.4, 1) infinite;
}

.cum-con-tro-ban-tay-hint.che-do-keo-len .vong-song-ban-tay-hint.vong-1 {
  animation: songChamKeoBanTay 2s ease-out infinite;
}

@keyframes banTayKeoLenBan {
  0% {
    transform: translate(10px, 12px) rotate(-10deg) scale(1.05);
    opacity: 0.95;
  }
  18% {
    transform: translate(0px, 0px) rotate(-22deg) scale(0.88);
    opacity: 1;
  }
  68% {
    transform: translate(var(--keo-dx, 0px), var(--keo-dy, -110px)) rotate(-8deg) scale(1);
    opacity: 1;
  }
  86% {
    transform: translate(var(--keo-dx, 0px), calc(var(--keo-dy, -110px) - 8px)) rotate(0deg) scale(1.1);
    opacity: 0;
  }
  100% {
    transform: translate(10px, 12px) rotate(-10deg) scale(1.05);
    opacity: 0;
  }
}

@keyframes songChamKeoBanTay {
  0%, 12% {
    transform: scale(0.4);
    opacity: 0;
  }
  20% {
    transform: scale(0.6);
    opacity: 0.95;
  }
  55%, 100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.vet-sao-keo-len-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: #fde047;
  box-shadow: 0 0 8px #f59e0b;
  opacity: 0;
  pointer-events: none;
}

.cum-con-tro-ban-tay-hint.che-do-keo-len .vet-sao-keo-len-hint.hat-1 {
  animation: hatSaoVetKeo1 2s ease-out infinite;
}

.cum-con-tro-ban-tay-hint.che-do-keo-len .vet-sao-keo-len-hint.hat-2 {
  animation: hatSaoVetKeo2 2s ease-out infinite;
}

.cum-con-tro-ban-tay-hint.che-do-keo-len .vet-sao-keo-len-hint.hat-3 {
  animation: hatSaoVetKeo3 2s ease-out infinite;
}

@keyframes hatSaoVetKeo1 {
  0%, 20% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  35% { opacity: 0.95; transform: translate(calc(var(--keo-dx, 0px) * 0.28), calc(var(--keo-dy, -110px) * 0.28)) scale(1.1); }
  75%, 100% { opacity: 0; transform: translate(calc(var(--keo-dx, 0px) * 0.35), calc(var(--keo-dy, -110px) * 0.35)) scale(0.2); }
}

@keyframes hatSaoVetKeo2 {
  0%, 30% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  48% { opacity: 0.95; transform: translate(calc(var(--keo-dx, 0px) * 0.58), calc(var(--keo-dy, -110px) * 0.58)) scale(1.2); }
  82%, 100% { opacity: 0; transform: translate(calc(var(--keo-dx, 0px) * 0.65), calc(var(--keo-dy, -110px) * 0.65)) scale(0.2); }
}

@keyframes hatSaoVetKeo3 {
  0%, 42% { opacity: 0; transform: translate(0, 0) scale(0.4); }
  62% { opacity: 0.95; transform: translate(calc(var(--keo-dx, 0px) * 0.88), calc(var(--keo-dy, -110px) * 0.88)) scale(1.3); }
  90%, 100% { opacity: 0; transform: translate(var(--keo-dx, 0px), var(--keo-dy, -110px)) scale(0.2); }
}

/* ================= THẺ BẢNG HINT SIÊU GỌN (COMPACT MICRO-CARD) ================= */

.the-bang-hint-gameplay {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: min(88vw, 314px);
  z-index: 9865;
  background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
  border: 2.5px solid #78350f;
  border-radius: 14px;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.65),
    0 0 0 2px #fde047,
    inset 0 1.5px 0 #ffffff;
  padding: 8px 11px 9px;
  color: #3b1c0a;
  pointer-events: auto;
  transition: top 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  animation: bungTheBangHint 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes bungTheBangHint {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.94) translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1) translateY(0);
  }
}

.the-bang-hint-gameplay.rung-nhac-bam-vung-sang {
  animation: rungNhacTheHint 0.34s ease;
}

/* Khi ở Chợ Đầu Hẻm: Đưa bảng Hint sang cạnh bên phải để không bao giờ che mặt Ông Chủ Đại Lý Sỉ */
.the-bang-hint-gameplay.hint-canh-ben-cho-si {
  transform: none !important;
  width: 152px !important;
  max-width: 39vw !important;
  padding: 6px 8px 7px !important;
  border-radius: 10px !important;
}

.the-bang-hint-gameplay.hint-canh-ben-cho-si .dau-the-bang-hint {
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 3px;
}

.the-bang-hint-gameplay.hint-canh-ben-cho-si .khung-avatar-ba-hoang-hint {
  width: 20px;
  height: 20px;
}

.the-bang-hint-gameplay.hint-canh-ben-cho-si .tieu-de-chinh-bang-hint {
  font-size: 10px;
}

.the-bang-hint-gameplay.hint-canh-ben-cho-si .noi-dung-chu-bang-hint {
  font-size: 9.8px;
  line-height: 1.24;
  margin: 0 0 5px;
}

.the-bang-hint-gameplay.hint-canh-ben-cho-si .chan-the-bang-hint {
  gap: 4px;
}

.the-bang-hint-gameplay.hint-canh-ben-cho-si .nhan-nhac-bam-truc-tiep-hint {
  font-size: 8.8px;
}

@keyframes rungNhacTheHint {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  25% { transform: translateX(calc(-50% - 5px)) rotate(-1deg); }
  50% { transform: translateX(calc(-50% + 5px)) rotate(1deg); }
  75% { transform: translateX(calc(-50% - 3px)) rotate(-0.6deg); }
}

/* Đầu thẻ Hint gọn 1 hàng */
.dau-the-bang-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.cum-nhan-vat-tieu-de-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.khung-avatar-ba-hoang-hint {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 100%);
  border: 1.5px solid #78350f;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tieu-de-chinh-bang-hint {
  font-size: 12.8px;
  font-weight: 900;
  color: #451a03;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Thanh chấm tiến độ 8 bước (Progress Dots) */
.day-cham-tien-do-hint {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.cham-buoc-hint {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(180, 83, 9, 0.25);
  transition: all 0.2s ease;
}

.cham-buoc-hint.da-xong {
  background: #16a34a;
}

.cham-buoc-hint.dang-active {
  width: 12px;
  background: #d97706;
}

/* Nội dung văn bản giải thích ngắn gọn (1 câu) */
.noi-dung-chu-bang-hint {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.34;
  color: #451a03;
  margin: 0 0 7px;
}

/* Chân thẻ Hint gọn 1 dòng */
.chan-the-bang-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.nut-bo-qua-trong-the-hint {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1.5px solid #b45309;
  background: rgba(254, 243, 199, 0.9);
  color: #78350f;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
}

.nut-bo-qua-trong-the-hint:hover,
.nut-bo-qua-trong-the-hint:active {
  background: #fde68a;
  color: #451a03;
}

.nut-tiep-theo-bang-hint {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1.5px solid #14532d;
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: #052e16;
  font-size: 11.8px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 2px 0 #14532d;
}

.nut-tiep-theo-bang-hint:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 #14532d;
}

.nhan-nhac-bam-truc-tiep-hint {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: #fef08a;
  border: 1.5px dashed #b45309;
  color: #78350f;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
