html, body {
  font-family: 'Noto Sans TC', sans-serif;
  margin: 0;
  padding: 0;
  box-sizing: content-box;
  
  width: 100%;
  height: 100%;
  overflow: hidden;
}
h1,h2,h3,p{
  margin: 0;
}
a{
  text-decoration: none;
}
img {
  object-fit: cover;
}
button {
  border: none;
  background-color: transparent;
  cursor: pointer;
  outline: none;
  box-shadow: none;
  padding: 0;
}

.w-100 {
  width: 100%;
}

.container{
  width: 100%;
  height: 100%;        /* 舊瀏覽器後備 */
  height: 100dvh;      /* 動態視窗高度：會跟著手機工具列伸縮，避免底部被裁切 */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  position: relative;
  max-width: 500px;
  border: 1px solid #527ACC;
  background: linear-gradient(180deg, #C5E7FA 0%, #FFFFFF 100%);;
}


.header{
  width: 100%;
  min-height: 60px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fff;
  box-shadow: 0px 4px 4px 0px #0000001F;
  display: flex;
  justify-content: center;
  align-items: center;
}
.header img.logo-1{
  height: 32px;
  position: absolute;
  left: 13px;
  top: 14px;
}
.header img.logo-2{
  height: 40px;
}
.footer{
  width: 100%;
}
.footer-buttons{
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.usage-button{
  width: 60px;
  height: 60px;
  padding: 8px;
  padding-right: 23px;
}
.privacy-button{
  width: 75px;
  height: 56px;
  padding: 8px;
}
.scan-button, .gift-button{
  width: 128px;
  height: 103px;
}
.footer-line{
  width: 100%;
  height: 24px;
  min-height: 24px;
  background-color: #389D38;
}
.main{
  width: 100%;
  flex: 1;
  min-height: 0;   /* 允許內部捲動區縮小，長內容才不會把 footer 頂出畫面 */
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 2;
}
.event-title{
  color: #527ACC;
  font-weight: 700;
  text-align: center;
  font-size: 28px;
  margin: 16px 0 0;
}
.event-text{
  margin: 16px 0 34px 0;
  width: 317px;
  padding: 0 calc(50% - 158.5px);
  color: #666;
  font-size: 14px;
}
.event-container{
  width: 90%;
  max-width: 272px;
  height: 288px;
  margin: 0 auto;
  position: relative;
}
.event-container div{
  position: absolute;
}
.event-container .event-item img{
  width: 96px;
  height: 104px;
}
.event-item-1{
  top: 0;
  left: 64px;
}
.event-item-2{
  top: 64px;
  right: 0;
}
.event-item-3{
  bottom: 64px;
  left: 0;
}
.event-item-4{
  bottom: 0;
  right: 64px;
}

.common-button{
  width: 100%;
  height: 48px;
  background-color: #527ACC;
  color: #FFFBF8;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  line-height: 48px;
  border-radius: 40px;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.12);
}

.rewarded{
  position: absolute;
  width: 200px;
  left: calc(50% - 100px);
  top: 20px;
}

/* 兌換獎品彈窗樣式 */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background-color: #F2FBFF;
  border-radius: 8px;
  padding: 32px 16px 24px;
  margin: 20px;
  max-width: 320px;
  width: 90%;
  position: relative;
  box-shadow: 0px 8px 24px rgba(0, 0, 0, 0.15);
  min-height: 277px;
  display: flex;
  flex-direction: column;
}

.popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 24px;
  height: 24px;
  font-size: 40px;
  color: #666;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-title {
  font-size: 28px;
  font-weight: 700;
  color: #527ACC;
  text-align: center;
  margin: 0 0 16px 0;
}

.popup-title.yellow {
  color: #FABE00;
}
.popup-content-box{
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.popup-message {
  font-size: 18px;
  color: #666;
  text-align: center;
  line-height: 1.5;
  margin: 0 0 20px 0;
}
.popup-input-group{
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 4px solid #0000000D;
  box-shadow: 0px 4px 4px 0px #0000001F;
  background: #FFFFFF;
  padding: 16px;
  margin-bottom: 63px;
  gap: 8px;
}
.popup-label{
  color: #4D6699;
  font-size: 20px;
  font-weight: 700;
}
.popup-input{
  border: 1px solid #00000033;
  padding: 0 8px;
  color: #666666;
  height: 39px;
  width: 100%;
  border-radius: 4px;
  outline: none;
  font-size: 18px;
}
.popup-error{
  color: #DA3700;
  font-size: 14px;
  text-align: center;
  margin: 0;
}
.popup-notice {
  padding: 0px 16px;
  margin: 0 0 32px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.notice-label {
  display: inline-block;
  color: #D61518;
  border: 2px solid #D61518;
  font-size: 14px;
  font-weight: 600;
  padding: 0px 6px;
  min-width: fit-content;
}

.notice-text {
  font-size: 16px;
  color: #D61518;
  margin: 0;
  line-height: 1.4;
}

.popup-button {
  width: 100%;
  height: 48px;
  background-color: #527ACC;
  color: white;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  box-shadow: 0px 4px 4px 0px #0000001F;
  transition: background-color 0.2s ease;
}

.popup-button:hover {
  background-color: #527ACC;
}

.popup-button:active {
  transform: translateY(1px);
}

/* 圖章收集彈窗樣式 */
.stamp-popup {
  text-align: center;
  
}

.stamp-icon {
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.stamp-icon img {
  width: 256px;
  height: 310px;
  object-fit: contain;
}

.stamp-subtitle {
  font-size: 32px;
  font-weight: 700;
  margin: 0 0 24px 0;
}

.stamp-subtitle.orange{
  color: #C65A01;
}
.stamp-subtitle.blue{
  color: #0164B4;
}
.stamp-subtitle.green{
  color: #0C9950;
}
.stamp-subtitle.pink{
  color: #A43C6E;
}

.stamp-message {
  font-size: 20px;
  color: #333;
  line-height: 1.5;
  margin: 0 0 24px 0;
  text-align: left;
}

.ok-highlight {
  color: #527ACC;
  font-weight: bold;
}

.stamp-ok-button {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* Loading 樣式 */
#loadingScreen {
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  animation: loadingBreath 2s ease-in-out infinite;
}

.loading-text {
  font-size: 15px;
  letter-spacing: 2px;
  font-weight: 700;
  color: #527ACC;
  text-align: center;
}
.loading-svg {
  width: 240px;
  animation: textFade 1.5s ease-in-out infinite;
}

/* 進度條容器 */
.progress-container {
  display: flex;
  justify-content: center;
  width: 240px;
}

/* 進度條背景 */
.progress-bar {
  width: 100%;
  height: 12px;
  background-color: #FFFBF8;
  border: 2px solid #527ACC;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

/* 進度條填充 */
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #527ACC 0%, rgba(218, 55, 0, 0) 100%);
  border-radius: 4px;
  width: 0%;
  transition: width 0.3s ease;
  position: relative;
}

/* 進度條流動效果 */
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: shimmer 1.5s ease-in-out infinite;
}


/* Loading 動畫效果 */
@keyframes loadingBreath {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.95;
  }
}

/* Loading 文字淡入淡出動畫 */
@keyframes textFade {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* 進度條閃爍效果 */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* 進度條完成時的脈衝效果 */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 85, 17, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 85, 17, 0);
  }
}

/* 當進度達到100%時的樣式 */
.progress-fill.completed {
  animation: pulse 1s ease-in-out infinite;
}

/* 主要內容樣式 */
#mainContent {
  /* display: none; */
}

.banner{
  width: 100%;
}

/* 橫向提示彈窗樣式 */
#upright {
  background-color: rgba(0, 0, 0, 1);
}

#upright img {
  max-width: 80%;
  max-height: 80%;
  width: auto;
  height: auto;
}

/* 行動裝置橫向時：只顯示橫向提示，其餘內容隱藏（由 Orientation.check 切換） */
body.landscape-locked .container {
  display: none;
}

body.landscape-locked #upright {
  display: flex;
}

/* Cookie 同意區塊樣式 */
.cookie-consent {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #FFFFFF;
  box-shadow: 0px 4px 4px 0px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  padding: 16px 32px;
  box-sizing: border-box;
  transform: translateY(-100%);
  transition: transform 0.4s ease-in-out, opacity 0.3s ease-in-out;
  opacity: 0;
}

/* Cookie 顯示動畫 */
.cookie-consent.showing {
  transform: translateY(0);
  opacity: 1;
}

/* Cookie 關閉動畫 */
.cookie-consent.hiding {
  transform: translateY(-100%);
  opacity: 0;
}

/* 當 Cookie 顯示時，調整 header 位置 */
body.has-cookie-consent .header {
  position: sticky;
  top: auto;
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cookie-text {
  font-size: 16px;
  line-height: 1.5;
  color: #000000CC;
  margin: 0;
}

.cookie-link {
  color: #666666;
  font-weight: 700;
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.cookie-button {
  width: 120px;
  height: 48px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.cookie-button-disagree {
  background-color: #fff;
  color: #527ACC;
  border: 1px solid #527ACC;
}

.cookie-button-disagree:hover {
  background-color: #fff;
}

.cookie-button-accept {
  background-color: #527ACC;
  color: #fff;
}

.cookie-button-accept:hover {
  background-color: #527ACC;
}

.cloud-bg{
  position: absolute;
  left: 0;
  top: calc(50% - 169px);
  width: 100%;
  height: 338px;
  max-width: 500px;
}
.cloud-bg .cloud-1{
  position: absolute;
  height: 106px;
  bottom: 0;
  right: 8px;
}
.cloud-bg .cloud-2{
  position: absolute;
  height: 106px;
  left: 0;
  top: 58px;
}
.cloud-bg .cloud-3{
  position: absolute;
  height: 106px;
  right: 0;
}

/* ---------- 內容頁共用（原本重複散落在各頁的 <style>） ---------- */

/* 一般內容頁的 main 內距與間距 */
.page-main{
  padding: 16px 24px;
  gap: 16px;
  align-items: center;
}

/* 標題底下的短橫線 */
.org-line{
  width: 38px;
  height: 4px;
  background-color: #78B2DA;
}

.back-button{
  width: 240px;
}

/* ---------- 嵌入表單彈窗（event-4 尋寶圖） ---------- */

.form-open-button{
  width: 100%;
  max-width: 280px;
  margin-top: 16px;
  font-size: 18px;
}

/* 表單需要空間，這個彈窗鋪滿整個畫面 */
.popup-content.form-popup{
  width: 100%;
  height: 100%;
  max-width: 500px;
  margin: 0;
  padding: 0;
  border-radius: 0;
  min-height: 0;
  background-color: #FFFFFF;
  overflow: hidden;
}

.form-popup-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background-color: #527ACC;
}

.form-popup-title{
  font-size: 20px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
}

.form-popup-close{
  width: 32px;
  height: 32px;
  font-size: 32px;
  line-height: 1;
  color: #FFFFFF;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 表單本身在 iframe 內捲動，頁面外框保持不動 */
.form-popup-frame{
  flex: 1;
  width: 100%;
  border: 0;
  display: block;
}

/* ---------- 關卡內頁（event-1~4） ---------- */
.event-main{
  padding: 0 24px;
  align-items: center;
}
.event-detail{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 327px;
}
.event-detail-img{
  width: 30vh;
  height: auto;
}
.event-detail-step{
  border: 1px solid #0373BC33;
  background: #82CFF433;
  padding: 8px;
  border-radius: 8px;
}
.event-detail-step .step-item{
  display: flex;
  gap: 4px;
  align-items: flex-start;
}
.event-detail-step .step-item .step-number{
  display: flex;
  align-items: center;
  padding: 2px 4px;
  gap: 4px;
  color: #666;
  font-weight: 700;
  font-size: 18px;
}
.event-detail-step .step-item .step-text{
  font-size: 14px;
  font-weight: 500;
  color: #666;
  flex: 1;
  padding: 1.5px 0;
}
.event-detail-step .step-item .step-text span{
  color: #D61518;
}
