/* ============= RESET CƠ BẢN ============= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background-color: #8c1e00; /* fallback */
}

/* ============= BACKGROUND DESKTOP ============= */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;

  background-image: url("img/bg-main.png");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;

  position: relative;
}

/* TẮT OVERLAY MÀU TỐI */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: transparent !important;
  z-index: -1;
}

/* ============= WRAPPER CHÍNH ============= */
.page {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 4% 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: transparent !important;
}

/* ============= KHỐI VÒNG QUAY ============= */
#spin-section {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* canh sang phải trên desktop */
}

/* KHUNG VÒNG QUAY */
.wheel-wrapper {
  position: relative;
  width: clamp(320px, 38vw, 480px);
  height: clamp(320px, 38vw, 480px);
  background: transparent !important;
}

/* ẢNH VÒNG QUAY PNG */
.wheel-img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  transition: transform 4.2s cubic-bezier(0.23, 1, 0.32, 1);
}

/* MŨI TÊN */
.pointer {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 32px solid transparent;
  border-right: 32px solid transparent;
  border-top: 56px solid #ffdf6c;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35));
  z-index: 10;
}

.pointer::after {
  content: "";
  position: absolute;
  bottom: 56px;
  left: -20px;
  width: 40px;
  height: 22px;
  border-radius: 40px 40px 12px 12px;
  background: radial-gradient(circle at top, #ffe9a2, #f7b33a);
}

/* NÚT QUAY TRONG SUỐT (CLICK VÀO VÒNG GIỮA) */
.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34%;
  height: 34%;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 5;
  color: transparent;
}

.spin-btn:focus {
  outline: none;
}

.spin-btn:disabled {
  opacity: 1;
  cursor: default;
}

/* TRẠNG THÁI TEXT DƯỚI VÒNG QUAY */
.status-bar {
  margin-top: 14px;
  font-size: 13px;
  color: #ffe4c4;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  background: transparent !important;
}

/* ============= POPUP ============= */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.show {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
}

.modal-box {
  position: relative;
  width: min(380px, 90%);
  background: #330000;
  border-radius: 18px;
  border: 2px solid #ffb85c;
  padding: 24px 18px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.65);
  z-index: 1;
}

.modal-title {
  font-size: 22px;
  color: #ffd28a;
  margin-bottom: 10px;
}

.modal-text {
  font-size: 15px;
  color: #ffe5c2;
  margin-bottom: 14px;
}

.modal-image {
  max-width: 140px;
  max-height: 130px;
  object-fit: contain;
  margin-bottom: 14px;
}

.modal-btn {
  margin-top: 4px;
}

/* ============= FOOTER – ĐÃ ẨN HOÀN TOÀN ============= */
.footer {
  display: none !important; /* xóa ©2025 */
}

/* ============= DESKTOP: ĐẨY VÒNG QUAY SANG PHẢI ============= */
@media (min-width: 769px) {
  #spin-section {
    padding-right: 8vw;   /* chỉnh 6vw / 10vw tùy ý */
    padding-top: 5vh;     /* nâng/hạ khối vòng quay */
  }
}

/* ============= MOBILE: NỀN bg-phone.png, VÒNG QUAY Ở GIỮA ============= */
@media (max-width: 768px) {
  body {
    background-image: url("img/bg-phone.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
  }

  #spin-section {
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 40px);
    padding-right: 0;
    padding-top: 0;
  }

  .wheel-wrapper {
    width: 82vw;
    height: 82vw;
    margin-top: 40px;  /* hạ xuống cho đẹp */
    margin-bottom: 8px;
  }

  .spin-btn {
    width: 38%;
    height: 38%;
  }

  .pointer {
    top: -22px;
    border-left-width: 18px;
    border-right-width: 18px;
    border-top-width: 36px;
  }

  .status-bar {
    font-size: 12px;
  }
}
