@font-face {
  font-family: "MStiffHeiHK-UltraBold";
  src: url("fonts/6daafe4bf5f24958dc640da592c230c4.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 全域隱藏滾動條 */
html,
body,
#app-container,
.modal-content,
.terms-modal-content {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#app-container::-webkit-scrollbar,
.modal-content::-webkit-scrollbar,
.terms-modal-content::-webkit-scrollbar {
  display: none;
}

html,
body {
  width: 100%;
  height: 100%;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #2b2b2b;
  color: #333;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: flex-start;
}

/* 核心垂直容器：保證整體具有滿屏高度基準 */
#app-container {
  width: 100%;
  max-width: 480px;
  background-color: #ffffff;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0 auto;
  z-index: 3;
}

#app-container.capturing-share {
  box-shadow: none !important;
  overflow: visible !important;
  max-width: 480px !important;
  width: 480px !important;
}

/* 截圖執行時將頁面底部 padding 擴充至 13vh */
#app-container.capturing-share .page {
  padding-bottom: 13vh !important;
}

/* .page 彈性拉伸，並設置 padding-bottom 防止底部內容被背景遮蓋 */
.page {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0;
  width: 100%;
  flex: 1 0 auto;
  box-sizing: border-box;
  position: relative;
  z-index: 5;
  padding-bottom: 80px; /* 保留足夠空間，避免按鈕被置底文字遮住 */
}

.page.active {
  display: flex;
}

.header-logo {
  width: 85%;
  max-width: 380px;
  height: auto;
  margin-top: 10px;
  margin-bottom: 0px;
  position: relative;
  z-index: 5;
}

#page-6-header-logo {
  position: relative;
  z-index: 10;
  margin-bottom: 5px;
}

img.btn-img {
  cursor: pointer;
  transition: transform 0.1s ease;
  user-select: none;
}

img.btn-img:active {
  transform: scale(0.96);
}

/* 輪播樣式 */
.slider-container {
  width: 100%;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.slider-track {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease-in-out;
  width: 100%;
}

.slider-item {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
}

.slider-item.side {
  width: 42%;
  opacity: 0.55;
  z-index: 1;
}

.slider-item.side:first-child {
  margin-right: -10%;
}

.slider-item.side:last-child {
  margin-left: -10%;
}

.slider-item.center {
  width: 78%;
  opacity: 1;
  z-index: 2;
}

.slider-item img {
  width: 100%;
  height: auto;
  pointer-events: none;
}

.pagination-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 0px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ccc;
}

.dot.active {
  background-color: #d32f2f;
}

/* Page 1 特有樣式 */
.p1-text-prize {
  width: 45%;
  max-width: 330px;
  margin: 5px 0;
}

.p1-btn-play {
  width: 55%;
  max-width: 240px;
  margin-bottom: 12px;
}

.p1-btn-col {
  margin-bottom: 30px;
}

.p1-sub-btn {
  width: 48%;
  max-width: 200px;
}

/* Page 2: 表單區域 */
.form-container {
  width: 90%;
  border: 2px solid #d32f2f;
  border-radius: 12px;
  padding: 28px 16px 16px 16px;
  position: relative;
  margin-top: 25px;
  margin-bottom: 15px;
  background-color: #fff;
}

.form-header-img {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60%;
  max-width: 200px;
}

.form-group {
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #444;
}

.form-group input[type="text"],
.form-group input[type="tel"] {
  padding: 10px 12px;
  border: 1.5px solid #d32f2f;
  border-radius: 6px;
  font-size: 16px;
  outline: none;
  width: 100%;
}

.form-group input[type="text"]:focus,
.form-group input[type="tel"]:focus {
  border-color: #b71c1c;
  box-shadow: 0 0 4px rgba(211, 47, 47, 0.3);
}

.p2-form-group-spacing {
  margin-top: 15px;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #d32f2f;
}

.p2-submit-btn {
  width: 55%;
  max-width: 240px;
  margin-top: 10px;
  margin-bottom: 30px;
}

/* Page 3 特有樣式 */
.p3-photo-placeholder {
  width: 85%;
  max-width: 360px;
  margin: 10px 0;
}

/* 核心修正：避免使用 display: none，保證在 iOS 16 以下 WebKit 保持可觸發狀態 */
.camera-file-hidden {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

/* 相機按鈕的原生 Label 包裹容器 */
.camera-label-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  margin: 0;
  padding: 0;
}

.camera-label-wrapper .p3-btn-photo {
  pointer-events: none; /* 讓點擊事件直接冒泡給 label */
}

.p3-btn-col {
  margin-top: 10px;
  margin-bottom: 35px;
  gap: 12px;
}

.p3-btn-photo {
  width: 55%;
  max-width: 240px;
}

.p3-btn-home {
  width: 50%;
  max-width: 210px;
}

/* Page 4 收據核實專用樣式 */
.uploaded-text-img {
  width: 75%;
  max-width: 330px;
  margin-bottom: 10px;
}

.receipt-container-wrapper {
  position: relative;
  width: 90%;
  max-width: 380px;
  margin-top: 15px;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#uploaded-receipt-container {
  width: 100%;
  max-width: 380px;
  height: auto;
  min-height: 220px;
  border: 2px solid #d32f2f;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  overflow: hidden;
  position: relative;
}

#uploaded-receipt-container img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.receipt-preview-hidden {
  display: none;
}

.receipt-placeholder-text {
  font-size: 13px;
  color: #888;
  padding: 20px;
}

.overlay-hidden {
  display: none !important;
}

.p4-btn-col {
  margin-top: 15px;
  margin-bottom: 35px;
  gap: 12px;
}

.p4-btn-retake {
  width: 50%;
  max-width: 220px;
}

.p4-btn-home {
  width: 50%;
  max-width: 210px;
}

.verification-overlay-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 20px 15px;
  border-radius: 10px;
  text-align: center;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.overlay-msg-title {
  font-size: clamp(22px, 6vw, 32px);
  font-weight: bold;
  margin-bottom: 10px;
  line-height: 1.3;
}

.overlay-msg-info {
  font-size: clamp(16px, 4vw, 22px);
  font-weight: normal;
  line-height: 1.35;
}

/* 自訂風格提示彈窗樣式 */
.custom-alert-box {
  width: 85%;
  max-width: 380px;
  background: rgba(0, 0, 0, 0.85);
  color: #ffffff;
  padding: 30px 20px 25px 20px;
  border-radius: 12px;
  text-align: center;
  position: relative;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  font-family: "MStiffHeiHK-UltraBold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.custom-alert-title {
  font-size: clamp(20px, 5.5vw, 28px);
  font-weight: normal;
  line-height: 1.3;
  margin-bottom: 12px;
  color: #ffffff;
}

.custom-alert-msg {
  font-size: clamp(15px, 4vw, 19px);
  font-weight: normal;
  line-height: 1.4;
  color: #ffffff;
}

.custom-alert-close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 26px;
  line-height: 1;
  color: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.custom-alert-close-btn:active {
  transform: scale(0.9);
}

/* Page 5 核實收據展示容器及卡片 */
#page-5-receipt-container {
  width: 90%;
  max-width: 380px;
  height: auto;
  min-height: 180px;
  border: 2px solid #d32f2f;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 15px;
  background: #fafafa;
  display: flex;
  justify-content: center;
  align-items: center;
}

#page-5-receipt-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.voucher-code-card {
  width: 70%;
  max-width: 300px;
  background: url("images/11 - voucher code.png?v=4.2") no-repeat center center;
  background-size: 100% 100%;
  margin-top: 5px;
  margin-bottom: 15px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  text-align: center;
  box-sizing: border-box;
  font-family: "MStiffHeiHK-UltraBold", -apple-system, sans-serif;
}

.voucher-label {
  font-size: 18px;
  font-weight: bold;
  line-height: 1.2;
  color: #ffffff;
}

.voucher-count-wrap {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 1.5px;
  line-height: 1.3;
  color: #ffffff;
  margin-top: 4px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.voucher-draw-num {
  font-size: 38px;
  line-height: 1;
}

.voucher-unit {
  font-size: 18px;
}

.p5-btn-col {
  gap: 12px;
  margin-top: 5px;
  margin-bottom: 30px;
  width: 100%;
}

.p5-btn-draw {
  width: 55%;
  max-width: 240px;
}

.p5-btn-retake {
  width: 50%;
  max-width: 240px;
}

/* Page 6 特有樣式 */
.p6-page-container {
  padding-bottom: 30px;
}

/* ====================================================
   頁尾核心佈局：零高度結構，不佔據頁面高度，永遠靠底
   ==================================================== */
.page-footer-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 0;           /* 不佔據實體高度 */
  overflow: visible;   /* 允許背景與文字自然由底往上延伸 */
  margin-top: auto;    /* 在 flex 欄位排版中固定沉底 */
  line-height: 0;
  flex-shrink: 0;
  pointer-events: none; /* 穿透點擊，不阻擋上方其他區域 */
}

/* 貼底背景圖：不佔空間、純底層裝飾 */
.footer-bg-img {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  z-index: 1;
}

/* 頁尾文字及條款連結：浮在背景上方，單獨恢復點擊 */
.footer-text-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 480px;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  color: #000000;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
  padding: 4px 15px;
  box-sizing: border-box;
  z-index: 99;
  pointer-events: auto; /* 核心：僅文字與按鈕恢復接收點擊事件 */
}

.footer-text-container a {
  color: #000000;
  text-decoration: underline;
  cursor: pointer;
  font-weight: bold;
}

/* 彈窗遮罩 */
.overlay-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  touch-action: pan-y;
}

.overlay-modal.active {
  display: flex;
}

.modal-content {
  background-color: #ffffff;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow-y: auto;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.terms-modal-content {
  width: 90%;
  max-width: 440px;
  height: 70vh;
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  margin-top: 25px;
  border-radius: 8px;
}

.image-modal-content {
  width: 90%;
  max-width: 400px;
  padding: 0;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
  background-color: #ffffff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.image-modal-content img {
  display: block;
  width: 100%;
  height: 70vh;
  object-fit: contain;
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  line-height: 36px;
  text-align: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 26px;
  font-weight: 300;
  cursor: pointer;
  z-index: 50;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.85);
}

.modal-close-btn:active {
  transform: scale(0.92);
}

.btn-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  width: 100%;
  flex-wrap: wrap;
}

.btn-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* 第 6 頁：開罐抽獎 CSS */
.stage-anim-container {
  width: 100%;
  max-height: 560px;
  min-height: 440px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  margin-top: 0;
  z-index: 100;
}

.stage-anim-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("images/00 - ribbon bg.png?v=4.2") no-repeat center top;
  background-size: contain;
  pointer-events: none;
  z-index: 101;
}

.countdown-number {
  position: absolute;
  top: 15px;
  font-size: 75px;
  font-family: "MStiffHeiHK-UltraBold", -apple-system, sans-serif;
  font-weight: 900;
  color: #b71c26;
  z-index: 999;
  opacity: 0;
  transform: scale(0.4);
  line-height: 1;
  user-select: none;
}

.countdown-number:before {
  content: attr(title);
  position: absolute;
  -webkit-text-stroke: 0.11em #ffffff;
  stroke-linejoin: round;
  -webkit-text-stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
}

.countdown-number:after {
  content: attr(title);
  position: absolute;
  -webkit-text-stroke: 0.24em #caa86b;
  stroke-linejoin: round;
  -webkit-text-stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  left: 0;
  top: 0;
  z-index: -2;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

.countdown-number.animate {
  animation: countPulse 0.9s ease-out forwards;
}

@keyframes countPulse {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }

  30% {
    opacity: 1;
    transform: scale(1.15);
  }

  70% {
    opacity: 1;
    transform: scale(1.0);
  }

  100% {
    opacity: 0;
    transform: scale(1.3);
  }
}

.stage-bottom-flow {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 200;
  position: relative;
  margin-top: 140px;
  margin-bottom: 0;
  transition: margin-top 0.3s ease;
}

.stage-bottom-flow.show-result {
  margin-top: 10px;
}

.can-wrapper {
  position: relative;
  width: 65%;
  max-width: 280px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-bottom: 6px;
  transition: all 0.3s ease;
  z-index: 210;
}

.can-wrapper.collapsed {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

.can-body {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 211;
  transform-origin: bottom center;
  display: block;
  transition: opacity 0.65s ease-out;
}

.can-shaking {
  animation: canRattle 0.28s ease-in-out infinite alternate;
}

@keyframes canRattle {
  0% {
    transform: rotate(-3deg) translateY(0);
  }

  50% {
    transform: rotate(3deg) translateY(-3px);
  }

  100% {
    transform: rotate(-2deg) translateY(2px);
  }
}

.can-body.fade-out {
  opacity: 0;
  pointer-events: none;
}

.can-lid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 215;
  transform-origin: left top;
  opacity: 0;
  pointer-events: none;
  display: block;
}

.can-lid.open {
  animation: popLid 0.85s cubic-bezier(0.2, 0.8, 0.3, 1.2) forwards;
}

@keyframes popLid {
  0% {
    transform: rotate(0) translate(0, 0);
    opacity: 1;
  }

  40% {
    transform: rotate(-50deg) translate(-25px, -50px);
    opacity: 1;
  }

  70% {
    transform: rotate(-70deg) translate(-40px, -80px) scale(0.9);
    opacity: 0.6;
  }

  100% {
    transform: rotate(-85deg) translate(-50px, -100px) scale(0.8);
    opacity: 0;
  }
}

.milk-splash {
  position: absolute;
  bottom: 85%;
  left: 50%;
  width: 110%;
  max-width: 320px;
  opacity: 0;
  transform: translateX(-50%) scale(0.2);
  transform-origin: bottom center;
  z-index: 500;
  pointer-events: none;
}

.milk-splash.splash-out {
  animation: splashBlast 0.85s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes splashBlast {
  0% {
    opacity: 0;
    transform: translateX(-50%) scale(0.2);
  }

  35% {
    opacity: 1;
    transform: translateX(-50%) scale(1.15) translateY(-15px);
  }

  60% {
    opacity: 0.85;
    transform: translateX(-50%) scale(1.0) translateY(-5px);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) scale(0.95) translateY(0);
  }
}

.result-panel {
  position: absolute;
  top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  transform: scale(0.7);
  z-index: 300;
  pointer-events: none;
}

.result-panel.show {
  position: relative;
  top: 0;
  pointer-events: auto;
  animation: resultPop 0.75s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes resultPop {
  0% {
    opacity: 0;
    transform: scale(0.6) translateY(40px);
  }

  70% {
    opacity: 1;
    transform: scale(1.04) translateY(-5px);
  }

  100% {
    opacity: 1;
    transform: scale(1.0) translateY(0);
  }
}

.status-header-img {
  width: 160px;
  margin-bottom: 6px;
}

.single-prize-card {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 8px;
  z-index: 301;
}

.single-prize-card img {
  width: 90%;
  max-width: 360px;
  height: auto;
  display: block;
}

.notification-img-banner {
  display: none;
  width: 88%;
  max-width: 340px;
  height: auto;
  margin-top: 6px;
  margin-bottom: 10px;
  z-index: 303;
}

.anim-btn-continue {
  width: 45%;
  max-width: 165px;
  cursor: pointer;
  z-index: 350;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  margin-top: 10px;
}

.anim-btn-continue.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 第 7 頁：抽獎次數雙描邊樣式 */
.p7-header-logo {
  margin-bottom: 0;
}

.chance-counter-container {
  margin: 35px 0 25px 0;
  text-align: center;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
}

.stroke-double {
  position: relative;
  background: transparent;
  z-index: 0;
  color: #ffffff;
  font-family: "MStiffHeiHK-UltraBold", -apple-system, sans-serif;
  font-weight: 900;
  line-height: 1;
  display: inline-block;
}

.stroke-double:before {
  content: attr(title);
  position: absolute;
  -webkit-text-stroke: 0.11em #b71c26;
  stroke-linejoin: round;
  -webkit-text-stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  left: 0;
  top: 0;
  z-index: -1;
  pointer-events: none;
}

.stroke-double:after {
  content: attr(title);
  position: absolute;
  -webkit-text-stroke: 0.24em #caa86b;
  stroke-linejoin: round;
  -webkit-text-stroke-linejoin: round;
  stroke-linecap: round;
  paint-order: stroke fill;
  left: 0;
  top: 0;
  z-index: -2;
  filter: drop-shadow(0 6px 7px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}

#remaining-chances-text {
  font-size: clamp(65px, 20vw, 105px);
}

.chance-unit-text {
  font-size: clamp(40px, 12vw, 65px);
}

.p7-draw-again-btn {
  width: 65%;
  max-width: 280px;
  margin-top: 20px;
  margin-bottom: 35px;
}

/* 第 8 頁：拼圖網格組合樣式 */
.puzzle-group-box {
  width: 90%;
  max-width: 430px;
  border: 4px solid #c71b28;
  border-radius: 24px;
  position: relative;
  padding: 30px 14px 20px 14px;
  margin-top: 25px;
  margin-bottom: 25px;
  background-color: #ffffff;
  box-sizing: border-box;
}

.puzzle-header-img {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  max-width: 190px;
  z-index: 5;
}

.puzzle-content-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  position: relative;
  padding-right: 90px;
}

.stamps-grid-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.stamps-flex-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stamp-grid-item {
  position: relative;
  width: clamp(55px, 18%, 78px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stamp-grid-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  transition: filter 0.2s ease;
}

.stamp-grid-item.zero-stock img {
  filter: grayscale(100%) brightness(55%);
  opacity: 0.85;
}

.stamp-count-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background-color: #c71b28;
  color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  z-index: 6;
}

.puzzle-summary-info {
  width: 100%;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: #444;
  font-weight: bold;
  text-align: left;
}

.puzzle-summary-info .info-text {
  margin-bottom: 2px;
}

.puzzle-summary-info .highlight-num {
  color: #c71b28;
  font-size: 16px;
}

.gift-circle-visual-br {
  position: absolute;
  right: -5px;
  bottom: -10px;
  width: 40%;
  max-width: 170px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 7;
  pointer-events: none;
}

.gift-circle-visual-br img.gift-photo {
  width: 100%;
  height: auto;
  display: block;
}

.puzzle-bottom-action {
  display: flex;
  align-items: center;
  margin-top: 12px;
  width: 100%;
}

.btn-redeem-img {
  width: 60%;
  max-width: 135px;
  height: auto;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn-redeem-img.disabled {
  cursor: not-allowed;
  filter: grayscale(100%);
  opacity: 0.65;
}

.p8-btn-home {
  width: 55%;
  max-width: 220px;
  margin-top: 10px;
  margin-bottom: 35px;
}

/* Page 9 特有樣式 */
.p9-header-logo {
  margin-bottom: 0;
}

.p9-visual-img {
  width: 100%;
  max-width: 440px;
  height: auto;
  margin-bottom: 20px;
}

.p9-btn-col {
  gap: 15px;
  margin-bottom: 35px;
}

.p9-sub-btn {
  width: 50%;
  max-width: 210px;
}

/* Page 10: 獎品紀錄容器與清單樣式 */
.records-container {
  width: 90%;
  max-width: 420px;
  border: 2px solid #d32f2f;
  border-radius: 12px;
  padding: 35px 15px 15px 15px;
  position: relative;
  margin-top: 25px;
  margin-bottom: 20px;
  background-color: #ffffff;
  box-sizing: border-box;
  min-height: 250px;
}

.records-header-img {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 55%;
  max-width: 200px;
  z-index: 5;
}

.records-list {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.records-loading-placeholder {
  text-align: center;
  color: #999;
  padding: 30px 0;
}

.records-empty-placeholder {
  text-align: center;
  color: #888;
  padding: 30px 0;
}

.records-error-placeholder {
  text-align: center;
  color: red;
  padding: 30px 0;
}

.record-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 5px;
  border-bottom: none;
  position: relative;
}

.record-info-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding-right: 15px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid #c71b28;
}

.record-item-card:last-child .record-info-left {
  border-bottom: none;
  padding-bottom: 0;
}

.record-prize-title {
  color: #c71b28;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.record-meta-text {
  font-size: 13px;
  color: #222222;
  line-height: 1.5;
  font-weight: 500;
}

.record-action-right {
  flex-shrink: 0;
  width: 75px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 10;
}

.record-action-btn-img {
  width: 65px;
  height: auto;
  cursor: pointer;
  transition: transform 0.1s ease;
  user-select: none;
  touch-action: manipulation;
  pointer-events: auto;
}

.record-action-btn-img:active {
  transform: scale(0.92);
}

.p10-btn-row {
  margin-top: 10px;
  margin-bottom: 35px;
}

.p10-btn {
  width: 44%;
  max-width: 170px;
}

/* Page 11 & Page 12: 專屬二維碼外邊框容器及排版樣式 */
.p11-12-header-logo {
  margin-top: 15px;
}

.coupon-display-img {
  width: 90%;
  max-width: 380px;
  height: auto;
  margin-top: 15px;
  margin-bottom: 15px;
}

.coupon-qr-container {
  width: 210px;
  min-height: 210px;
  height: auto;
  border: 3px solid #C3AD53;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  margin: 20px auto;
  padding: 10px;
  box-sizing: border-box;
}

.coupon-code-text {
  color: #000000;
  font-size: 4vw;
  text-align: center;
  margin-top: 6px;
  width: 100%;
  word-break: break-all;
  line-height: 1.2;
}

.coupon-usage-img {
  width: 85%;
  max-width: 350px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.coupon-tc-img {
  width: 65%;
  max-width: 270px;
  margin-bottom: 4px;
}

.coupon-action-row {
  margin-bottom: 35px;
}

.coupon-nav-btn {
  width: 44%;
  max-width: 170px;
}

/* CSP Utility Classes (replaces inline el.style.display calls) */
.hidden {
  display: none !important;
}

.d-block {
  display: block !important;
}

.d-inline-block {
  display: inline-block !important;
}

.d-flex {
  display: flex !important;
}

/* 針對即將開始頁面的自訂微調樣式 */
.coming-soon-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  text-align: center;
  min-height: 55vh;
}

.coming-soon-title {
  font-family: "MStiffHeiHK-UltraBold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: clamp(24px, 6.5vw, 32px);
  font-weight: 900;
  color: #b71c26;
  line-height: 1.4;
  margin-bottom: 16px;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.coming-soon-desc {
  font-size: 15px;
  color: #555555;
  line-height: 1.6;
  margin-bottom: 25px;
}

.coming-soon-box {
  width: 80%;
  border: 2px solid #d32f2f;
  border-radius: 16px;
  padding: 35px 20px;
  background-color: #ffffff;
  box-shadow: 0 4px 15px rgba(211, 47, 47, 0.08);
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

/* 資料核對確認彈窗專屬樣式 (Page 2) */
.confirm-modal-box {
  width: 88%;
  max-width: 380px;
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  text-align: center;
  border: 2px solid #d32f2f;
  box-sizing: border-box;
}

.confirm-modal-title {
  color: #c71b28;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 8px;
}

.confirm-modal-subtitle {
  font-size: 20px;
  color: #666666;
  margin-bottom: 16px;
  line-height: 1.4;
}

.confirm-data-list {
  background-color: #fafafa;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.confirm-data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}

.confirm-data-label {
  color: #777777;
  font-weight: 500;
}

.confirm-data-val {
  color: #222222;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.confirm-btn-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.confirm-btn {
  flex: 1;
  padding: 11px 0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  text-align: center;
  user-select: none;
}

.btn-confirm-back {
  background-color: #f1f2f6;
  color: #555555;
  border: 1.5px solid #cccccc;
}

.btn-confirm-back:active {
  background-color: #e4e7ea;
  transform: scale(0.97);
}

.btn-confirm-submit {
  background-color: #c71b28;
  color: #ffffff;
  border: 1.5px solid #c71b28;
}

.btn-confirm-submit:active {
  background-color: #a3141f;
  transform: scale(0.97);
}