/**
 * Thành phần giao diện trang Quà Tri Ân Tháng.
 * Trạng thái ẩn ban đầu cho hiệu ứng chỉ áp khi <html> có class .js-anim
 * (main.js chỉ gắn class này khi GSAP đã tải và người dùng không bật reduced-motion).
 */

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsla(30, 12%, 4%, 0.82);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--surface-border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: 68px;
}

.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}

.nav-links a:hover {
  color: var(--gold-200);
}

@media (max-width: 900px) {
  .nav-links {
    display: none;
  }
}

/* ---------- Nút ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    filter var(--transition-fast), background var(--transition-fast);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.btn-primary {
  background: var(--gold-gradient);
  color: hsl(30, 30%, 8%);
  box-shadow: var(--gold-glow);
}

.btn-primary:hover {
  color: hsl(30, 30%, 8%);
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: var(--gold-glow-intense);
}

.btn-secondary {
  background: var(--surface-glass);
  border-color: var(--surface-border);
  color: var(--text-1);
}

.btn-secondary:hover {
  color: var(--text-1);
  border-color: var(--surface-border-hover);
  transform: translateY(-2px);
}

.btn-telegram {
  /* Xanh Telegram đậm hơn để chữ trắng đạt tương phản 4.5:1 */
  background: #16739f;
  color: #fff;
}

.btn-telegram:hover {
  color: #fff;
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-sm {
  min-height: 44px;
  padding: 8px 18px;
  font-size: 15px;
}

.btn[aria-disabled='true'] {
  opacity: 0.5;
  pointer-events: none;
}

.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-300);
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  padding: 80px 0 100px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 60% 50% at 75% 40%, rgba(245, 197, 66, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(110, 200, 170, 0.08), transparent 70%),
    var(--bg-0);
}

.hero-shapes-back,
.hero-shapes-mid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shape {
  position: absolute;
  border-radius: 50%;
}

.hero-shapes-back .shape-a {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: rgba(245, 197, 66, 0.10);
  filter: blur(80px);
  animation: hero-drift 28s ease-in-out infinite alternate;
}

.hero-shapes-back .shape-b {
  width: 340px;
  height: 340px;
  bottom: -120px;
  left: -100px;
  background: rgba(110, 200, 170, 0.10);
  filter: blur(80px);
  animation: hero-drift-b 36s ease-in-out infinite alternate;
}

.hero-shapes-mid .shape-c {
  width: 14px;
  height: 14px;
  top: 22%;
  left: 8%;
  background: var(--gold-300);
  opacity: 0.5;
  animation: none;
}

.hero-shapes-mid .shape-d {
  width: 8px;
  height: 8px;
  top: 70%;
  left: 46%;
  background: var(--tier-m2);
  opacity: 0.6;
  animation: none;
}

.hero-shapes-mid .shape-e {
  width: 60px;
  height: 60px;
  top: 14%;
  left: 52%;
  border: 1px solid var(--surface-border-hover);
  background: transparent;
  opacity: 0.4;
  animation: none;
}

@keyframes floatA {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(20px, -30px) rotate(8deg); }
}

@keyframes floatB {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-24px, 18px) rotate(-6deg); }
}

@keyframes floatC {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(12px, 22px); }
}

.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: var(--space-12);
}

.hero .subtitle {
  max-width: 560px;
  font-size: 19px;
  color: var(--text-2);
  margin-bottom: var(--space-8);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.scroll-down {
  position: absolute;
  bottom: 28px;
  left: 50%;
  margin-left: -22px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--gold-300);
  animation: none;
}

.scroll-down svg {
  width: 26px;
  height: 26px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero .subtitle {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .stage {
    order: -1;
  }
}

@media (max-width: 580px) {
  .hero {
    padding: 48px 0 88px;
  }

  .hero-ctas .btn {
    width: 100%;
  }
}

/* ---------- Sân khấu quà 3D (hero) ----------
 * .stage (perspective) > .stage-scroll (GSAP theo cuộn) > .stage-camera (GSAP intro + nghiêng theo chuột)
 *   > .stage-floor (mặt sàn nghiêng)  + .stage-slot (vị trí nghỉ) > .stage-lift (GSAP theo cuộn) > .stage-card
 * Trạng thái nghỉ dựng hoàn toàn bằng CSS: thiếu GSAP hay bật reduced-motion vẫn thấy bố cục đầy đủ.
 */
.stage {
  --card-w: 228px;
  --gap-x: 212px;
  position: relative;
  height: 520px;
  perspective: 1300px;
  perspective-origin: 50% 30%;
}

.stage-scroll,
.stage-camera,
.stage-items {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  /* Lớp khung trong suốt không được chặn chuột: trong 3D chúng nằm trước thẻ lùi sau */
  pointer-events: none;
}

.stage-slot,
.stage-lift {
  pointer-events: none;
}

.stage-card {
  pointer-events: auto;
}

.stage-camera {
  transform-origin: 50% 70%;
}

/* Mặt sàn studio: lưới vàng mờ theo phối cảnh + vầng sáng dưới chân thẻ */
.stage-floor {
  position: absolute;
  left: 50%;
  bottom: 40px;
  width: 860px;
  height: 560px;
  margin-left: -430px;
  transform-origin: 50% 100%;
  transform: rotateX(74deg);
  border-radius: 50%;
  background:
    radial-gradient(ellipse 45% 40% at 50% 55%, rgba(245, 197, 66, 0.30), transparent 70%),
    repeating-linear-gradient(90deg, rgba(245, 197, 66, 0.20) 0 1px, transparent 1px 52px),
    repeating-linear-gradient(0deg, rgba(245, 197, 66, 0.20) 0 1px, transparent 1px 52px);
  -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 35%, transparent 72%);
  mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 35%, transparent 72%);
  pointer-events: none;
}

.stage-slot {
  position: absolute;
  left: 50%;
  bottom: 96px;
  width: var(--card-w);
  margin-left: calc(var(--card-w) / -2);
  transform-style: preserve-3d;
}

.stage-slot--center { transform: translateZ(60px); z-index: 3; }
.stage-slot--left { --card-w: 184px; transform: translateX(calc(var(--gap-x) * -1)) translateZ(-70px) rotateY(16deg); z-index: 1; }
.stage-slot--right { --card-w: 184px; transform: translateX(var(--gap-x)) translateZ(-70px) rotateY(-16deg); z-index: 1; }

.stage-lift {
  transform-style: preserve-3d;
}

.stage-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: var(--bg-2);
  box-shadow: 0 30px 50px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  cursor: pointer;
  /* Nổi nhẹ bằng thuộc tính `translate` riêng để không giành `transform` với GSAP */
  animation: stage-float 6.5s ease-in-out infinite;
  will-change: transform;
}

.stage-slot--left .stage-card { animation-delay: -2.2s; }
.stage-slot--right .stage-card { animation-delay: -4.1s; }

/* Lớp xa: hơi mờ và tối như độ sâu trường ảnh của ống kính */
.stage-slot[data-depth='2'] .stage-card {
  filter: blur(0.7px) brightness(0.78) saturate(0.9);
  transition: filter 0.3s ease;
}

.stage-card:hover,
.stage-card:focus-visible {
  filter: none !important;
  border-color: var(--c);
}

.stage-card:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 4px;
}

.stage-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage-card-label {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: hsla(30, 12%, 6%, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-2);
}

.stage-card-label strong {
  display: block;
  font-size: 13px;
  color: var(--c);
}

/* Bóng mềm đổ xuống sàn */
.stage-shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.6), transparent 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* Chip lơ lửng quanh thẻ */
.stage-chip-slot {
  width: auto;
  margin: 0;
  bottom: auto;
}

.stage-chip-slot--a { left: -4%; top: 12%; transform: translateZ(30px); }
.stage-chip-slot--b { left: auto; right: -6%; top: 20%; transform: translateZ(90px); }
.stage-chip-slot--c { left: 8%; top: auto; bottom: 40px; transform: translateZ(120px); }

.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--surface-border-hover);
  background: hsla(30, 12%, 8%, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  animation: stage-float 8s ease-in-out infinite;
}

.stage-chip-slot--b .stage-chip { animation-delay: -3s; }
.stage-chip-slot--c .stage-chip { animation-delay: -5.5s; }

.stage-chip i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-gradient);
  box-shadow: 0 0 10px rgba(245, 197, 66, 0.7);
}

@keyframes stage-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

/* Mobile: bố cục quạt tĩnh, nhỏ gọn, không làm mờ lớp xa */
@media (max-width: 900px) {
  .stage {
    --card-w: 150px;
    --gap-x: 112px;
    height: 330px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    text-align: left;
  }

  /* Thẻ hai bên quá hẹp cho tên mốc: chỉ giữ tên quà ngắn */
  .stage-slot--left .stage-card-label strong,
  .stage-slot--right .stage-card-label strong { display: none; }

  .stage-slot { bottom: 64px; }
  .stage-slot--left,
  .stage-slot--right { --card-w: 120px; }
  .stage-floor { width: 460px; height: 340px; margin-left: -230px; bottom: 24px; }
  .stage-slot[data-depth='2'] .stage-card { filter: brightness(0.8); }
  .stage-card-label { font-size: 10px; padding: 6px 8px; }
  .stage-card-label strong { font-size: 11px; }
  .stage-chip { font-size: 11px; padding: 6px 10px; }
  .stage-chip-slot--a { left: 0; top: 2%; }
  .stage-chip-slot--b { left: auto; right: 0; top: 12%; }
  .stage-chip-slot--c { left: 6%; bottom: 14px; }
}

@media (max-width: 580px) {
  .stage { height: 300px; --card-w: 132px; --gap-x: 96px; }
  .stage-slot--left,
  .stage-slot--right { --card-w: 104px; }
}

/* Ánh sáng nền: vàng và xanh trôi rất chậm, biên độ nhỏ */
@keyframes hero-drift {
  to { transform: translate(-40px, 26px) scale(1.08); opacity: 0.85; }
}

@keyframes hero-drift-b {
  to { transform: translate(36px, -22px) scale(1.06); }
}

/* Hạt sáng tiết chế: vài chấm vàng bay lên rồi tắt */
.hero-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero-sparks span {
  position: absolute;
  bottom: 12%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold-200);
  box-shadow: 0 0 8px rgba(245, 197, 66, 0.7);
  opacity: 0;
  animation: spark-rise 13s linear infinite;
}

.hero-sparks span:nth-child(1) { left: 58%; animation-delay: 0s; }
.hero-sparks span:nth-child(2) { left: 66%; animation-delay: 2.6s; animation-duration: 15s; }
.hero-sparks span:nth-child(3) { left: 74%; animation-delay: 5.1s; }
.hero-sparks span:nth-child(4) { left: 82%; animation-delay: 7.4s; animation-duration: 16s; }
.hero-sparks span:nth-child(5) { left: 62%; animation-delay: 9.8s; animation-duration: 14s; }
.hero-sparks span:nth-child(6) { left: 78%; animation-delay: 11.5s; }

@keyframes spark-rise {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.55; }
  70% { opacity: 0.35; }
  100% { transform: translateY(-320px) translateX(14px); opacity: 0; }
}

@keyframes content-arrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ---------- Thẻ mốc quà ---------- */
.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  align-items: end;
  perspective: 1200px;
}

.tier-card {
  --c: var(--gold-300);
  position: relative;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.tier-card.is-revealing {
  transition: none;
}

.tier-card:hover {
  transform: translateY(-3px);
  border-color: var(--c);
  box-shadow: var(--glass-shadow), 0 0 28px color-mix(in srgb, var(--c) 22%, transparent);
}

.tier-card {
  --photo-h: 150px;
}

.tier-card:nth-child(2) {
  --photo-h: 174px;
}

.tier-card:nth-child(3) {
  --photo-h: 198px;
  border-color: transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--gold-gradient) border-box;
  box-shadow: var(--glass-shadow), var(--gold-glow);
}

.tier-step {
  display: inline-block;
  margin-bottom: var(--space-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c);
}

.tier-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: var(--space-4);
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.tier-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--c);
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tier-gift {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--space-5);
}

.tier-conds {
  list-style: none;
  margin: 0;
  padding: var(--space-4) 0 0;
  border-top: 1px solid var(--surface-border);
  font-size: 15px;
  color: var(--text-2);
}

.tier-conds li {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 4px 0;
}

.tier-conds strong {
  color: var(--text-1);
  font-weight: 600;
  text-align: right;
}

@media (max-width: 900px) {
  .tier-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tier-card:nth-child(n) {
    --photo-h: 170px;
  }
}

@media (max-width: 580px) {
  .tier-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Công cụ tính mốc ---------- */
.calc {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: var(--space-8);
  padding: var(--space-10);
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  border: 1px solid var(--surface-border);
  box-shadow: var(--glass-shadow);
}

.field {
  margin-bottom: var(--space-5);
}

.field label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
}

.input-wrap {
  position: relative;
}

.input-wrap .unit {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.input,
.select {
  width: 100%;
  min-height: 52px;
  padding: 12px 44px 12px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--bg-2);
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--transition-fast);
}

.select {
  padding-right: 18px;
  font-size: 16px;
  font-weight: 500;
}

.input:focus,
.select:focus {
  border-color: var(--gold-400);
  outline: none;
}

.input.is-invalid {
  border-color: var(--danger);
}

.field-error {
  margin: var(--space-2) 0 0;
  font-size: 14px;
  color: var(--danger);
}

.calc-result {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.chip {
  --c: var(--gold-300);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: var(--bg-2);
  text-align: center;
  font-size: 14px;
  color: var(--text-2);
  transition: border-color 0.35s ease, background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

.chip strong {
  display: block;
  font-size: 15px;
  color: var(--text-2);
}

.chip.is-reached {
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--text-1);
  box-shadow: 0 0 22px color-mix(in srgb, var(--c) 30%, transparent);
}

.chip.is-reached strong {
  color: var(--c);
}

/* Thanh 3 nấc: track chia 3 đoạn bằng nhau, chip mốc nằm dưới đoạn của nó */
.ladder {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.ladder-track {
  position: relative;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
}

.progress-bar {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gold-gradient);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* Vạch cuối mỗi đoạn (33%, 66%, 100%) */
.ladder-tick {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  border: 2px solid var(--surface-border-hover);
  background: var(--bg-1);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.ladder-tick:nth-of-type(1) { left: 33.333%; }
.ladder-tick:nth-of-type(2) { left: 66.666%; }
.ladder-tick:nth-of-type(3) { left: calc(100% - 8px); }

.ladder-tick.is-reached {
  border-color: var(--gold-200);
  background: var(--gold-400);
  box-shadow: 0 0 12px rgba(245, 197, 66, 0.6);
}

/* Thẻ quà tương ứng trong kết quả: chưa đạt thì mờ (mốc kế tiếp), đạt thì sáng theo màu mốc */
.calc-reward {
  --c: var(--gold-300);
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: var(--space-4);
  align-items: center;
  min-height: 112px; /* đủ chỗ cho tên quà 2 dòng + dòng "kèm quà", để bố cục không nhảy */
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px dashed var(--surface-border);
  background: var(--bg-2);
  transition: border-color 0.35s ease, background-color 0.35s ease, box-shadow 0.35s ease;
}

.calc-reward-img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  filter: grayscale(1) brightness(0.7);
  transition: filter 0.4s ease;
}

.calc-reward-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.calc-reward-gift {
  display: block;
  font-size: 16px;
  line-height: 1.35;
  color: var(--text-2);
}

.calc-reward-more {
  display: block;
  font-size: 13px;
  color: var(--text-2);
}

.calc-reward.is-reached {
  border-style: solid;
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, var(--bg-2));
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 22%, transparent);
}

.calc-reward.is-reached .calc-reward-img { filter: none; }
.calc-reward.is-reached .calc-reward-label { color: var(--c); }
.calc-reward.is-reached .calc-reward-gift { color: var(--text-1); }

.calc-status {
  min-height: 3em;
  margin: 0;
  font-size: 17px;
  color: var(--text-1);
}

.calc-status.is-updating {
  animation: result-arrive 220ms ease-out both;
}

@keyframes result-arrive {
  from { opacity: 0.45; }
  to { opacity: 1; }
}

.calc-status strong {
  color: var(--gold-200);
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.calc-note {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

@media (max-width: 900px) {
  .calc {
    grid-template-columns: 1fr;
    padding: var(--space-6);
  }
}

@media (max-width: 580px) {
  .calc {
    padding: var(--space-5);
  }

  .calc-actions .btn {
    width: 100%;
  }
}

/* ---------- Ba bước ---------- */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
  counter-reset: step;
}

.step-card {
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  border: 1px solid var(--surface-border);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.step-card:hover {
  border-color: var(--surface-border-hover);
}

.step-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-4);
  border-radius: 50%;
  background: var(--gold-gradient);
  color: hsl(30, 30%, 8%);
  font-weight: 800;
}

.step-card p {
  margin: 0;
  color: var(--text-2);
}

@media (max-width: 900px) {
  .steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .steps {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .hero-shapes-back .shape-a,
  .hero-shapes-back .shape-b,
  .stage-card,
  .stage-chip { animation: none !important; }

  .hero-sparks { display: none; }
}

/* ---------- Thể lệ ---------- */
.rules {
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  counter-reset: rule;
}

.rules li {
  counter-increment: rule;
  position: relative;
  padding: var(--space-4) 0 var(--space-4) 52px;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-2);
}

.rules li::before {
  content: counter(rule, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: var(--space-4);
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold-400);
}

.rules li.is-key {
  color: var(--text-1);
  font-weight: 600;
}

/* ---------- FAQ ---------- */
.faq-list {
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  border-bottom: 1px solid var(--surface-border);
}

.faq-item summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
  min-height: 56px;
  padding: var(--space-4) 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 24px;
  color: var(--gold-300);
  transition: transform var(--transition-fast);
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  margin: 0 0 var(--space-5);
  color: var(--text-2);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: var(--space-10) 0;
  border-top: 1px solid var(--surface-border);
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}

.site-footer p {
  max-width: 760px;
  margin: 0 auto var(--space-2);
}

/* ---------- Thanh CTA dính đáy (mobile) ---------- */
.sticky-cta {
  display: none;
}

@media (max-width: 768px) {
  .sticky-cta {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
    background: hsla(30, 12%, 4%, 0.94);
    border-top: 1px solid var(--surface-border);
    transition: transform var(--transition-base);
  }

  .sticky-cta.is-hidden {
    transform: translateY(110%);
  }

  .sticky-cta .btn {
    min-height: 48px;
    padding: 10px 12px;
    font-size: 15px;
  }

  body {
    padding-bottom: 76px;
  }
}

/* ---------- Trạng thái ban đầu cho hiệu ứng (chỉ khi GSAP sẵn sàng) ---------- */
.js-anim .hero .eyebrow,
.js-anim .hero h1,
.js-anim .hero .subtitle,
.js-anim .hero-ctas,
.js-anim .scroll-down {
  opacity: 0;
}

/* ---------- Ảnh đầu thẻ mốc: chiều cao tăng dần theo mốc để giữ dáng bậc thang ---------- */
.tier-photo {
  position: relative;
  height: var(--photo-h);
  margin: calc(var(--space-8) * -1) calc(var(--space-8) * -1) var(--space-5);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.tier-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Ảnh hòa dần vào nền thẻ */
.tier-photo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, var(--bg-card) 100%);
}

.tier-card:hover .tier-photo img {
  transform: scale(1.05);
}


/* ---------- Thẻ mốc bấm được ---------- */
.tier-card.is-clickable {
  cursor: pointer;
}

.tier-card.is-clickable:focus-visible {
  outline: 2px solid var(--c);
  outline-offset: 4px;
}

.tier-view {
  display: inline-block;
  margin-top: var(--space-5);
  font-size: 15px;
  font-weight: 600;
  color: var(--c);
  transition: transform var(--transition-fast);
}

.tier-card:hover .tier-view {
  transform: translateX(4px);
}

/* ---------- Trình xem ảnh coverflow ---------- */
.gallery {
  --w: min(360px, 62vw);
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: var(--space-12) 0 var(--space-6);
  border: 0;
  background: transparent;
  color: var(--text-1);
  overflow: hidden;
}

.gallery[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
}

.gallery::backdrop {
  background: hsla(30, 12%, 4%, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gallery-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--surface-border);
  background: var(--surface-glass);
  cursor: pointer;
}

.gallery-close svg,
.gallery-nav svg {
  width: 22px;
  height: 22px;
}

.gallery-stage {
  position: relative;
  width: 100%;
  height: calc(var(--w) * 4 / 3);
  touch-action: pan-y;
  user-select: none;
}

.gallery-slide {
  /* Khoảng cách tới tâm theo độ sâu: sát bên 0.89w, ngoài cùng 0.795w mỗi bước (đã tính phần thu nhỏ) */
  --k: 0px;
  --s: 1;
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--w);
  margin: 0 0 0 calc(var(--w) / -2);
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform: translateX(calc(var(--o) * var(--k))) scale(var(--s));
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), filter 0.5s ease, opacity 0.5s ease;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  cursor: pointer;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gallery-slide[data-depth='0'] {
  z-index: 3;
  cursor: default;
}

.gallery-slide[data-depth='1'] {
  --k: calc(var(--w) * 0.89 + 16px);
  --s: 0.78;
  z-index: 2;
  filter: grayscale(1);
  opacity: 0.9;
}

.gallery-slide[data-depth='2'] {
  --k: calc(var(--w) * 0.795 + 16px);
  --s: 0.62;
  z-index: 1;
  filter: grayscale(1) blur(1px);
  opacity: 0.45;
}

.gallery-slide[data-depth='3'] {
  --k: calc(var(--w) * 0.8 + 16px);
  --s: 0.5;
  opacity: 0;
  pointer-events: none;
}

.gallery-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  width: var(--w);
  font-size: 15px;
}

.gallery-caption-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-300);
}

.gallery-controls {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.gallery-nav {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--surface-border-hover);
  background: var(--surface-glass);
  color: var(--gold-200);
  cursor: pointer;
  transition: opacity var(--transition-fast);
}

.gallery-nav:disabled {
  opacity: 0.3;
  cursor: default;
}

.gallery-counter {
  min-width: 52px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--text-2);
}

.gallery-note {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .hero-shapes-back .shape-a,
  .hero-shapes-back .shape-b,
  .stage-card,
  .stage-chip,
  .scroll-down { animation: none !important; }

  .hero-sparks { display: none; }

  .tier-card,
  .step-card,
  .rules li,
  .calc-status.is-updating,
  .progress-bar,
  .chip { transition: none !important; animation: none !important; }

  .gallery-slide {
    transition: none;
  }
}

/* Khoá cuộn trang nền khi trình xem ảnh đang mở */
html:has(dialog.gallery[open]) {
  overflow: hidden;
}

/* ---------- Khung chat Telegram mô phỏng (bước 2) ---------- */
.tg-mock {
  margin-top: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: hsl(210, 22%, 9%);
  overflow: hidden;
  font-size: 13px;
}

.tg-mock-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: hsl(210, 22%, 12%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tg-mock-head small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.tg-mock-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: hsl(30, 30%, 8%);
  font-size: 12px;
  font-weight: 800;
}

.tg-mock-body {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: var(--space-4) var(--space-3);
  min-height: 150px;
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 158, 217, 0.08), transparent 60%),
    hsl(210, 22%, 8%);
}

.step-card .tg-bubble {
  max-width: 92%;
  margin: 0;
  padding: 8px 12px;
  border-radius: 14px 14px 4px 14px;
  background: #2b5278;
  color: #fff;
  line-height: 1.5;
  white-space: pre-line;
  transition: opacity 0.2s ease;
}

.tg-attach {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(43, 82, 120, 0.6);
  color: #dbe8f5;
  font-size: 11px;
}

.tg-mock-link {
  display: block;
  padding: var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  text-align: center;
}

/* ---------- Ảnh chụp lịch sử mô phỏng (bước 1) ---------- */
.shot-mock {
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--surface-border);
  background: hsl(30, 8%, 9%);
  font-size: 13px;
}

.shot-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-3);
}

.shot-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--bg-2);
}

.shot-tabs b,
.shot-tabs i {
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-style: normal;
  font-weight: 600;
  color: var(--text-muted);
}

.shot-tabs b {
  background: var(--surface-border-hover);
  color: var(--text-1);
}

.shot-tag {
  font-size: 11px;
  color: var(--text-muted);
}

/* Khoanh vàng nét đứt: thông tin bắt buộc phải thấy trong ảnh */
.shot-id,
.shot-mark {
  outline: 1.5px dashed var(--gold-400);
  outline-offset: 3px;
  border-radius: 6px;
}

.shot-id {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 4px 4px var(--space-4);
  padding: 6px 8px;
  background: rgba(245, 197, 66, 0.06);
}

.shot-id span { color: var(--text-muted); }
.shot-id strong { color: var(--text-1); letter-spacing: 0.06em; }

.shot-id em {
  margin-left: auto;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  color: var(--gold-300);
}

.shot-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.shot-rows li {
  display: flex;
  justify-content: space-between;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-2);
}

.shot-rows span { color: var(--text-muted); letter-spacing: 0.1em; }
.shot-mark { padding: 0 4px; color: var(--text-1); }

.step-card .shot-note {
  margin: var(--space-3) 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- Voucher mô phỏng (bước 3): vé có hai khía tròn ở đường xé ---------- */
.voucher-mock {
  --c: var(--tier-m1);
  position: relative;
  margin-top: var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background:
    radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--c) 22%, transparent), transparent 60%),
    hsl(30, 8%, 9%);
  overflow: hidden;
  transition: border-color 0.35s ease;
}

.voucher-top {
  padding: var(--space-5) var(--space-4) var(--space-4);
}

.voucher-kicker {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--c);
}

.voucher-gift {
  display: block;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1.3;
  color: var(--text-1);
}

.voucher-tier {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.voucher-bottom {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  padding: var(--space-4);
  border-top: 1.5px dashed color-mix(in srgb, var(--c) 45%, transparent);
  font-size: 13px;
}

/* Hai khía tròn ở hai đầu đường xé, cùng màu nền thẻ bước */
.voucher-bottom::before,
.voucher-bottom::after {
  content: '';
  position: absolute;
  top: -10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: hsl(30, 10%, 11%);
}

.voucher-bottom::before { left: -11px; }
.voucher-bottom::after { right: -11px; }

.voucher-bottom small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.voucher-bottom b {
  color: var(--text-1);
  font-weight: 600;
}
