/* Reset mặc định và cài đặt chung */

.thap-nhan-duyen--full {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Container chính */

.thap-nhan-duyen__container {
  position: relative;
  width: clamp(320px, 75vw, 700px);
  height: clamp(320px, 75vw, 700px);
  margin: 0 auto;
}

/* Vòng tròn viền */

.thap-nhan-duyen__circle-border {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 85%;
  height: 85%;
  border: 10px solid #39433d;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Trung tâm vòng tròn */

.thap-nhan-duyen__wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

/* Tiêu đề */

.thap-nhan-duyen__title {
  font-size: clamp(24px, 5vw, 38px);
  color: #3d2c13;
  font-weight: 700;
  text-align: center;
  margin-top: 10px;
  letter-spacing: 2px;
  line-height: 1.2;
  font-family: "Noto Serif", serif;
}

/* Hình hoa sen */

.thap-nhan-duyen__lotus img {
  height: auto;
}

/* Container bao quanh các segment */

.thap-nhan-duyen__segments-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Segment (mỗi nhánh) */

.thap-nhan-duyen__segment {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
}

/* Wrapper của segment */

.thap-nhan-duyen__segment-wrapper {
  width: 110px;
  height: 110px;
  background: #f7c948;
  color: #3d2c13;
  font-family: "Noto Serif", serif;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  /* Thay thế polygon bằng path có bo tròn */
  clip-path: path(
    "M27.5,10 Q30,5 35,5 L75,5 Q80,5 82.5,10 L105,55 Q107.5,60 105,65 L82.5,100 Q80,105 75,105 L35,105 Q30,105 27.5,100 L5,65 Q2.5,60 5,55 Z"
  );
  position: relative;
  overflow: visible;
}

.thap-nhan-duyen__segment-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  /* bo nhẹ, có thể thử 8px, 10px, 12px */
  box-shadow: 0 0 0 1.5px #fffbe6;
  /* tạo hiệu ứng sáng nhẹ ở cạnh */
  pointer-events: none;
  z-index: 2;
}

.thap-nhan-duyen__segment-wrapper:hover {
  transform: scale(1.08) rotate(-3deg);
  filter: brightness(1.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.13);
}

/* Màu sắc cho từng segment */

.thap-nhan-duyen__segment:nth-child(1) .thap-nhan-duyen__segment-wrapper {
  background: #f7c948;
}

.thap-nhan-duyen__segment:nth-child(2) .thap-nhan-duyen__segment-wrapper {
  background: #f9d56e;
}

.thap-nhan-duyen__segment:nth-child(3) .thap-nhan-duyen__segment-wrapper {
  background: #fbe29d;
}

.thap-nhan-duyen__segment:nth-child(4) .thap-nhan-duyen__segment-wrapper {
  background: #fbe8b6;
}

.thap-nhan-duyen__segment:nth-child(5) .thap-nhan-duyen__segment-wrapper {
  background: #fbe8b6;
}

.thap-nhan-duyen__segment:nth-child(6) .thap-nhan-duyen__segment-wrapper {
  background: #fbe29d;
}

.thap-nhan-duyen__segment:nth-child(7) .thap-nhan-duyen__segment-wrapper {
  background: #e2c16b;
}

.thap-nhan-duyen__segment:nth-child(8) .thap-nhan-duyen__segment-wrapper {
  background: #c9a14a;
  color: #fff;
}

.thap-nhan-duyen__segment:nth-child(9) .thap-nhan-duyen__segment-wrapper {
  background: #a88a3a;
  color: #fff;
}

.thap-nhan-duyen__segment:nth-child(10) .thap-nhan-duyen__segment-wrapper {
  background: #7c6a2c;
  color: #fff;
}

.thap-nhan-duyen__segment:nth-child(11) .thap-nhan-duyen__segment-wrapper {
  background: #5c4a1e;
  color: #fff;
}

.thap-nhan-duyen__segment:nth-child(12) .thap-nhan-duyen__segment-wrapper {
  background: #3d2c13;
  color: #fff;
}

/* Tooltip */

.thap-nhan-duyen__tooltip {
  position: fixed;
  background: #fffbe6;
  color: #3d2c13;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: clamp(12px, 2vw, 15px);
  max-width: 260px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
  border: 1px solid #e2c16b;
}

.thap-nhan-duyen__tooltip--visible {
  opacity: 1;
  transform: translateY(-5px);
}

/* Modal */

.thap-nhan-duyen__modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.thap-nhan-duyen__modal--visible {
  display: flex;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.thap-nhan-duyen__modal-content {
  background: #fffbe6;
  padding: clamp(12px, 4vw, 30px);
  border-radius: 18px;
  max-width: clamp(400px, 98vw, 900px);
  width: 100%;
  font-family: "Noto Serif", serif;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
  border: 1px solid #e2c16b;
  text-align: center;
  position: relative;
}

.thap-nhan-duyen__modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 32px;
  cursor: pointer;
  color: #3d2c13;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.3s, background 0.3s, transform 0.3s;
}

.thap-nhan-duyen__modal-close:hover {
  color: #fff;
  background: #e2c16b;
  transform: rotate(90deg);
}

.thap-nhan-duyen__modal-title {
  font-size: clamp(16px, 3vw, 26px);
  color: #3d2c13;
  margin-bottom: 18px;
  border-bottom: 2px solid #e2c16b;
  padding-bottom: 10px;
}

.thap-nhan-duyen__modal-description {
  font-size: clamp(12px, 2vw, 16px);
  color: #4a5568;
  margin-bottom: 18px;
  line-height: 1.7;
}

.thap-nhan-duyen__modal-quote {
  font-style: italic;
  font-size: clamp(11px, 2vw, 15px);
  color: #3d2c13;
  text-align: right;
  padding: clamp(6px, 2vw, 12px) 0 clamp(6px, 2vw, 12px) clamp(10px, 2vw, 20px);
  border-right: 3px solid #e2c16b;
  background: rgba(226, 193, 107, 0.07);
  border-radius: 0 8px 8px 0;
  position: relative;
}

.thap-nhan-duyen__modal-quote::before {
  content: '"';
  font-size: clamp(20px, 5vw, 36px);
  color: #e2c16b;
  position: absolute;
  top: -10px;
  left: 10px;
  font-family: serif;
}

.thap-nhan-duyen__modal-action {
  display: block;
  margin: 16px auto 0;
  padding: 0px clamp(0px, 3vw, 24px);
  /* giảm padding trên/dưới */
  background: #7c4d13;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: clamp(12px, 2vw, 16px);
  cursor: pointer;
  transition: background 0.2s;
}

.thap-nhan-duyen__modal-action:hover {
  background: #a97c3f;
}

/* Responsive: Desktop lớn (≥1200px) */

@media (min-width: 1200px) {
  .thap-nhan-duyen__container {
    width: 700px;
    height: 700px;
  }
  .thap-nhan-duyen__segment-wrapper {
    width: 110px;
    height: 110px;
    font-size: 16px;
  }
  .thap-nhan-duyen__title {
    font-size: 38px;
  }
}

/* Responsive: Tablet landscape (769px – 1199px) */

@media (max-width: 1199px) and (min-width: 769px) {
  .thap-nhan-duyen__container {
    width: clamp(400px, 90vw, 600px);
    height: clamp(400px, 90vw, 600px);
  }
  .thap-nhan-duyen__segment-wrapper {
    font-size: 13px;
  }
  .thap-nhan-duyen__title {
    font-size: 28px;
  }
}

/* Responsive: Tablet & Mobile (≤768px) */

@media (max-width: 768px) {
  .thap-nhan-duyen__container {
    width: 100vw;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 2vw;
  }
  .thap-nhan-duyen__lotus img {
    width: 200px;
    object-fit: contain;
  }
  .thap-nhan-duyen__circle-border {
    display: none;
  }
  .thap-nhan-duyen__wheel-center {
    position: static;
    transform: none;
    margin: 20px 0;
    text-align: center;
  }
  .thap-nhan-duyen__segments-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
  .thap-nhan-duyen__segment {
    position: static;
    margin: 8px 0;
    width: 100%;
    display: flex;
    justify-content: center;
  }
  .thap-nhan-duyen__segment-wrapper {
    width: clamp(200px, 96vw, 420px);
    height: auto;
    min-height: 48px;
    font-size: clamp(14px, 3vw, 18px);
    border-radius: 12px;
    clip-path: none;
    border: 1.5px solid #e2c16b;
    background: #fffbe6;
    color: #3d2c13;
    transition: background 0.2s, box-shadow 0.2s;
  }
  .thap-nhan-duyen__segment-wrapper:hover {
    background: #f7c948;
    transform: none;
    filter: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  }
  .thap-nhan-duyen__segment-wrapper::after {
    border: none;
  }
  .thap-nhan-duyen__segment-text {
    padding: 12px 0;
    white-space: normal;
  }
  .thap-nhan-duyen__segment-text br {
    display: none;
  }
  .thap-nhan-duyen__modal-content {
    padding: clamp(12px, 3vw, 18px);
  }
}

/* Responsive: Mobile nhỏ (≤400px) */

@media (max-width: 400px) {
  .thap-nhan-duyen__title {
    font-size: clamp(10px, 3vw, 12px);
  }
  .thap-nhan-duyen__lotus img {
    width: clamp(24px, 8vw, 32px);
  }
  .thap-nhan-duyen__segment-wrapper {
    min-height: 36px;
    font-size: clamp(10px, 2.5vw, 12px);
    border-radius: 8px;
  }
  .thap-nhan-duyen__modal-content {
    padding: clamp(8px, 2vw, 12px);
  }
  .thap-nhan-duyen__modal-title {
    font-size: clamp(12px, 2.5vw, 14px);
  }
  .thap-nhan-duyen__modal-description {
    font-size: clamp(9px, 2vw, 10px);
  }
  .thap-nhan-duyen__modal-quote {
    font-size: clamp(8px, 2vw, 9px);
    padding: clamp(3px, 1vw, 5px) 0 clamp(3px, 1vw, 5px) clamp(5px, 1.5vw, 10px);
  }
  .thap-nhan-duyen__modal-action {
    font-size: clamp(10px, 2vw, 12px);
    padding: clamp(4px, 1vw, 6px) clamp(6px, 2vw, 12px);
  }
  .thap-nhan-duyen__segment-text br {
    display: none;
  }
}
