@charset "UTF-8";
/* ==========================================================
   機車安全記憶搜查隊：全站樣式入口
   - 設計稿為 1680px 版，內容區最寬 1200px
   - utilities：重置、變數、基礎；layout：頁首頁尾；page：各頁；component：彈窗
   ========================================================== */
/* http://meyerweb.com/eric/tools/css/reset/ 
   v2.0 | 20110126
   License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video, img {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: "";
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

a {
  text-decoration: none;
}

/* ==========================================
   共用變數
   ========================================== */
:root {
  color-scheme: dark;
  /* 顏色依 PSD 圖層設定值 */
  --slate: #415A65; /* 頁面底色 */
  --navy: #1C3642; /* 頁首、手機選單底色 */
  --panelLine: #4b6373; /* 手機選單的分隔線 */
  --teal: #284F60; /* 說明彈窗底色（格紋圖載入前） */
  --yellow: #FFD202; /* 主色黃：頁首黃線、選單字、關卡字、倒數「秒」 */
  --goldDeep: #B9893A; /* 表單勾選框、焦點框 */
  --paper: #E8D6AB; /* 手機版抽獎紙底色 */
  --text: #FFFFFF; /* 深底上的主要文字 */
  --errorText: #B3281D; /* 表單錯誤訊息 */
  --focus: #FFE45C; /* 鍵盤焦點框 */
  /* 內文字型 */
  --fontBody: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  /* 左右留白：至少 16px，iPhone 橫向時讓出瀏海區 */
  --gutterLeft: max(16px, env(safe-area-inset-left, 0px));
  --gutterRight: max(16px, env(safe-area-inset-right, 0px));
}

/* ==========================================
   斷點 mixin：在元素裡用 @include grid.mobile { ... } 套用
   ========================================== */
/* 「字壓在背景圖上」的區塊（填資料紙張、說明彈窗）改成一般排版的斷點。
   用 em 而不是 px：使用者在瀏覽器把預設字級調大時，斷點會跟著變寬，
   字放不進背景圖時就提早換成一般排版。預設字級（16px）下跟傳入的 px 斷點完全相同。
   用法：@include grid.textFit(820px) { ... } */
/* 有滑鼠的裝置才套用 hover，避免觸控後卡在 hover 狀態 */
/* ==========================================
   基礎設定
   ========================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* iOS 網址列會遮住 100vh，支援 dvh 的瀏覽器改用 dvh */
  /* 上下排：主內容區撐滿剩餘高度，內容不夠高時頁尾也會貼在畫面底部 */
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--fontBody);
  font-size: 0.9375rem;
  line-height: 1.6;
  /* 設計稿底紋：#415A65 底、每 10px 一條 1px 斜線（從 PSD 取樣） */
  background: var(--slate) url("../images/bg/bgTile.jpg") 0 0/10px 10px repeat;
  -webkit-text-size-adjust: 100%;
}
body.isScrollLocked {
  /* 開彈窗時鎖住背景捲動（iOS 背景會跟著滑） */
  overflow: hidden;
}
body::before {
  /* iPhone 瀏海區補上頁首的深藍色 */
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--navy);
}

/* 去掉 iOS 按鈕、輸入框的系統預設外觀，改自訂樣式 */
button,
input {
  -webkit-appearance: none;
  -moz-appearance: none;
       appearance: none;
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* 只給螢幕閱讀器讀的文字 */
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 圖片按鈕的 hover 圖：疊在原圖上，滑過或鍵盤聚焦時淡入 */
.hoverImage {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.startButton:focus-visible .hoverImage,
.closeButton:focus-visible .hoverImage,
.nextButton:focus-visible .hoverImage,
.sendButton:focus-visible .hoverImage {
  opacity: 1;
}

/* hover 只在有滑鼠的裝置生效，避免觸控後卡在 hover 狀態 */
@media (hover: hover) {
  .startButton:hover .hoverImage,
  .closeButton:hover .hoverImage,
  .nextButton:hover .hoverImage,
  .sendButton:hover .hoverImage {
    opacity: 1;
  }
}

/* 自訂勾選框（iOS 原生勾選框外觀不一致） */
.checkBox {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  border: 2px solid var(--goldDeep);
  border-radius: 3px;
  background: #fff center/80% no-repeat;
  cursor: pointer;
}
.checkBox:checked {
  background-color: var(--goldDeep);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* 範本的 _reset.scss 會把表格儲存格改成 baseline 對齊，這裡補回置中 */
td,
th {
  vertical-align: middle;
}

/* ==========================================
   頁首：固定在頂部，下緣黃線＋波浪
   ========================================== */
.siteHeader {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--navy);
  padding-left: var(--gutterLeft);
  padding-right: var(--gutterRight);
}
.siteHeader::after {
  /* 下緣裝飾：設計提供的 navStrip.png（30×90，上 73px 深藍、2px 黃線、下方波浪），
     頁首本身用深藍底，這裡只顯示圖的下半段（第 73px 起） */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 17px;
  background: url("../images/header/navStrip.png") 0 -73px/30px 90px repeat-x;
}

/* 頁首高度 73px 依 PSD */
.siteHeaderInner {
  max-width: 1680px;
  margin: 0 auto;
  height: 73px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand {
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.brandLink {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  color: inherit;
  text-decoration: none;
}

/* 交通部 Logo：PSD 170×46，距左 22px；小螢幕等比縮，最小 130px 保持文字可讀 */
.brandLogo {
  /* 原圖 300×81：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 300/81;
  width: clamp(130px, 10.12vw, 170px);
  margin-left: clamp(0px, 0.36vw, 6px);
}

/* 右側留白：PSD 房子圖示右緣在 x1635 */
.mainNav {
  margin-left: auto;
  margin-right: clamp(0px, 1.4vw, 23px);
}
.hasJs .mainNav {
  /* 選單面板：放在頁首波浪下方，整排寬度 */
}
@media screen and (max-width: 767px) {
  .hasJs .mainNav {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 17px);
    margin: 0;
    padding: 0 var(--gutterRight) 0 var(--gutterLeft);
    border-bottom: 2px solid var(--yellow);
    background: var(--navy);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  }
}
@media screen and (max-width: 767px) {
  .hasJs .mainNav:not(.isOpen) {
    display: none;
  }
}

.mainNavLink {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-radius: 6px;
  color: var(--yellow);
  font-weight: 500;
  font-size: clamp(1rem, 1.5vw, 1.5625rem);
  letter-spacing: 0.05em;
  text-decoration: none;
}
.mainNavLink.isHome {
  /* 房子與「活動辦法」間距比其他項目多 12px（PSD） */
  margin-left: clamp(0px, 0.7vw, 12px);
}
.mainNavLink.isHome .mainNavIcon {
  width: clamp(30px, 2.6vw, 44px);
}
@media (hover: hover) {
  .mainNavLink:hover {
    background: rgba(255, 255, 255, 0.06);
  }
}
@media screen and (max-width: 767px) {
  .hasJs .mainNavLink, .hasJs .mainNavLink.isHome {
    gap: 14px;
    margin: 0;
    padding: 14px 4px;
    border-radius: 0;
    font-size: 1.0625rem;
  }
}
@media screen and (max-width: 767px) {
  .hasJs .mainNavLink[aria-current=page] {
    background: rgba(255, 209, 1, 0.1);
  }
}

.mainNavList {
  display: flex;
  align-items: center;
  gap: clamp(4px, 2.4vw, 40px);
  margin: 0;
  padding: 0;
  list-style: none;
}
@media screen and (max-width: 767px) {
  .hasJs .mainNavList {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
}
@media screen and (max-width: 767px) {
  .hasJs .mainNavList li + li {
    border-top: 1px solid var(--panelLine);
  }
}

/* 選單圖示寬度依 PSD（腳掌 31px、房子 44px），小螢幕等比縮 */
.mainNavIcon {
  width: clamp(22px, 1.85vw, 31px);
  /* 原圖 150×173：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 150/173;
}

/* 房子圖示：原圖 90×74 */
.homeIcon {
  aspect-ratio: 90/74;
}

/* 桌機版的房子只有圖示（PSD），「回首頁」文字只給螢幕閱讀器與手機選單 */
.homeLabel {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media screen and (max-width: 767px) {
  .hasJs .homeLabel {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
  }
}

/* 漢堡按鈕：桌機隱藏 */
.menuToggle {
  display: none;
}
.hasJs .menuToggle {
  /* 手機版（767px 以下）：選單收進漢堡按鈕
     只在 JS 有載入時（html.hasJs）才收合，JS 失效時仍保留原本的圖示選單 */
}
@media screen and (max-width: 767px) {
  .hasJs .menuToggle {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 0 9px;
    border: 0;
    border-radius: 6px;
    background: none;
    cursor: pointer;
  }
}
.menuToggle.isOpen .menuToggleBar:nth-child(1) {
  /* 展開時三條線變成 X */
}
@media screen and (max-width: 767px) {
  .menuToggle.isOpen .menuToggleBar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
  }
}
@media screen and (max-width: 767px) {
  .menuToggle.isOpen .menuToggleBar:nth-child(2) {
    opacity: 0;
  }
}
@media screen and (max-width: 767px) {
  .menuToggle.isOpen .menuToggleBar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
  }
}

@media screen and (max-width: 767px) {
  .menuToggleBar {
    display: block;
    height: 3px;
    border-radius: 2px;
    background: var(--yellow);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
}

/* 圖示固定同一欄寬，文字才會對齊 */
@media screen and (max-width: 767px) {
  .hasJs .mainNavIcon,
  .hasJs .mainNavLink.isHome .mainNavIcon {
    width: 28px;
  }
}

html:not(.hasJs) .mainNavLabel {
  /* JS 沒載入時的備案：小螢幕選單只留圖示 */
}
@media screen and (max-width: 450px) {
  html:not(.hasJs) .mainNavLabel {
    display: none;
  }
}

/* ==========================================
   主內容區與頁尾
   ========================================== */
.siteMain {
  /* 撐滿頁首與頁尾之間的高度，把頁尾推到底 */
  flex: 1 0 auto;
  padding: 19px var(--gutterRight) 0 var(--gutterLeft);
  /* 遊戲頁的配對光暈會超出最外側的牌：只裁橫向，上下不裁、也不會變成捲動區 */
  overflow-x: clip;
}

/* 設計稿 1680 版，內容區最寬 1200px */
.view {
  max-width: 1200px;
  margin: 0 auto;
}

/* 各頁內容到頁尾的距離依 PSD 不同：遊戲頁 103px、填寫資料 125px、活動辦法／得獎名單 34px。
   頁尾本身留 34px，其餘由各頁的下方留白補足 */
#viewGame {
  padding-bottom: clamp(0px, 4.1vw, 69px);
}

.siteFooter {
  padding: clamp(24px, 2vw, 34px) var(--gutterRight) 22px var(--gutterLeft);
  text-align: center;
  font-size: clamp(0.8125rem, 1.1vw, 1.125rem);
  font-weight: 200;
  letter-spacing: 0.03em;
}

/* ==========================================
   首頁：主視覺＋腳掌動態＋開始按鈕
   ========================================== */
/* 首頁主內容區：平板、手機畫面偏高，主視覺靠上會顯得下方很空，改成在頁首與頁尾之間垂直置中。
   桌機維持設計稿位置（距頁首 19px） */
@media screen and (max-width: 1024px) {
  .homeMain {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
.homeMain .view {
  width: 100%;
}

.homeHero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  background: radial-gradient(ellipse 50% 46% at 50% 44%, rgba(170, 214, 236, 0.55), transparent 75%);
}

.homeHeroTitle {
  position: relative;
  width: 100%;
  /* 寬度也受畫面高度限制：平板橫式、筆電等「寬但不高」的螢幕，主視覺加開始按鈕要在一屏內看完。
     230px = 頁首與上方間距 92 + 開始按鈕 77 + 間距 14 + 下方留白約 47；1.4 = 主視覺寬高比 1099／785。
     最小 320px，避免橫拿手機時主視覺縮得太小；100vh 給不支援 dvh 的瀏覽器當備援 */
  max-width: clamp(320px, (100vh - 230px) * 1.4, 1099px);
  max-width: clamp(320px, (100dvh - 230px) * 1.4, 1099px);
  margin: 0;
}

.homeHeroImage {
  /* 原圖 1099×785：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 1099/785;
  width: 100%;
}

/* 腳掌動態：位置對齊設計稿 main_L（以 1099×785 為基準的百分比） */
.homePaws {
  /* 原圖 179×324：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 179/324;
  position: absolute;
  left: 82.53%;
  top: 32.48%;
  width: 16.29%;
  pointer-events: none;
}

/* 圖片按鈕共用：按鈕本身無外觀，圖片鋪滿 */
.startButton,
.closeButton,
.nextButton,
.sendButton {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.startButton img,
.closeButton img,
.nextButton img,
.sendButton img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.startButton:active,
.nextButton:active,
.sendButton:active {
  transform: translateY(1px);
}

/* 開始按鈕原圖 266×77：跟主視覺等比縮放（設計稿 266／1099 ≈ 24.2%，% 相對主視覺區寬度），最小 160px 保留手指點擊範圍 */
.startButton {
  width: clamp(160px, 24.2%, 266px);
  aspect-ratio: 266/77;
  border-radius: 40px;
}

/* ==========================================
   遊戲頁：關卡標題列
   ========================================== */
.levelHead {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(10px, 2.9vw, 35px);
  margin: 0 auto clamp(10px, 1.17vw, 14px);
}

.levelBear {
  /* 原圖 256×242：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 256/242;
  width: clamp(72px, 11.9vw, 143px);
}

.levelTitle {
  position: relative;
  /* PSD 熊圖裁得比較緊，置中後標題偏高 5px，往下補回（距頁首黃線 59px） */
  top: min(0.42vw, 5px);
  display: flex;
  gap: clamp(2px, 0.3vw, 4px);
  margin: 0;
}
.levelTitle span {
  /* 「第一關」每個字放在一個黃框方塊裡（PSD 65×65） */
  width: clamp(40px, 5.4vw, 65px);
  height: clamp(40px, 5.4vw, 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  background: url("../images/game/gameLevel.png") center/contain no-repeat;
  color: var(--yellow);
  font-size: clamp(1.375rem, 3.1vw, 2.3125rem);
  font-weight: 900;
  line-height: 1;
}

/* 倒數：靠右，數字 53px Arial Black 依 PSD */
.timer {
  position: relative;
  /* 依 PSD 時鐘頂端 y142，往下補 7px */
  top: min(0.58vw, 7px);
  display: flex;
  align-items: center;
  gap: clamp(6px, 0.9vw, 11px);
  margin-left: auto;
  margin-right: clamp(0px, 4vw, 48px);
  color: var(--yellow);
  font-weight: 900;
}

.timerIcon {
  /* 原圖 100×100：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 100/100;
  width: clamp(28px, 4vw, 49px);
}

.timerNumber {
  color: #fff;
  font-family: "Arial Black", "Archivo Black", "Arial Bold", Arial, sans-serif;
  font-size: clamp(1.875rem, 4.4vw, 3.3125rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
}

.timerUnit {
  font-size: clamp(1.25rem, 2.75vw, 2.0625rem);
  letter-spacing: 0.03em;
  line-height: 1;
}

/* ==========================================
   遊戲頁：牌區
   PSD：每張牌 251×323，欄距 65、列距 46，三關都是 4 欄往下延伸
   ========================================== */
.boardWrap {
  max-width: 1200px;
  margin: 0 auto;
}

.board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 3.8vw, 46px) clamp(8px, 5.4vw, 65px);
}
@media screen and (max-width: 767px) {
  .board {
    /* 手機版 4 欄牌很小，間距縮小把寬度留給牌面（390 寬約 10／8px） */
    gap: max(8px, 2.6vw) max(6px, 2vw);
  }
}

/* 一張牌：外層按鈕負責點擊，container-type 讓牌面文字跟著牌寬縮放 */
.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 250/321;
  padding: 0;
  border: 0;
  background: none;
  container-type: inline-size;
  perspective: 900px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card:disabled {
  cursor: default;
}
.card.isFaceUp .cardFlip {
  transform: rotateY(180deg);
}
.card.isMatched {
  /* 配對成功：整張牌浮到鄰牌上面，背後光暈才不會被蓋住 */
  z-index: 1;
  /* 牌底發亮：金色光暈＋放射光芒，先爆開再收成柔和的常亮光，光芒慢慢轉 */
}
.card.isMatched::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: -1;
  width: 200%;
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
  /* closest-side：光暈半徑＝牌寬，最亮的地方剛好落在牌邊，往外漸淡 */
  background: radial-gradient(circle closest-side, rgb(255, 253, 235) 0, rgb(255, 242, 170) 46%, rgba(255, 214, 40, 0.6) 64%, rgba(255, 209, 1, 0) 100%), repeating-conic-gradient(rgba(255, 244, 190, 0.9) 0 4deg, rgba(255, 244, 190, 0) 8deg 20deg, rgba(255, 244, 190, 0.9) 24deg 30deg);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 45%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 45%, transparent 100%);
  opacity: 0.8;
  scale: 0.9;
  animation: matchGlowBurst 1.1s cubic-bezier(0.2, 0.8, 0.3, 1), matchGlowSpin 14s linear infinite;
}
.card.isMatched {
  /* 牌邊散出的小星星：跟著光暈爆開後淡出 */
}
.card.isMatched::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 165%;
  aspect-ratio: 1;
  translate: -50% -50%;
  pointer-events: none;
  background: url("../images/game/matchStars.svg") center/100% 100% no-repeat;
  opacity: 0;
  animation: matchStars 1.6s ease-out;
}
.card.isMatched .cardFront {
  /* 配對成功：牌面彈一下＋黃框光暈 */
  animation: cardPop 0.55s ease-out;
}
.card.isMatched .cardFront::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
  pointer-events: none;
  box-shadow: inset 0 0 0 3px var(--yellow);
  animation: cardGlow 1s ease-out forwards;
}
.card.isWrong {
  /* 配錯：兩張牌左右震動 */
  animation: cardShake 0.45s ease-in-out;
}

/* 翻轉層：正反兩面疊在一起，轉 180 度看到正面 */
.cardFlip {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.4, 0.1, 0.3, 1);
}

.cardFace {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 6px;
  /* iOS Safari 需要 -webkit- 前綴才會隱藏背面 */
  backface-visibility: hidden;
  /* PSD 陰影：#152F3D 色彩增值 35%、角度 143°、間距 6、尺寸 6 */
  box-shadow: 4.8px 3.6px 6px rgba(21, 47, 61, 0.35);
}

.cardBack img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

/* 牌面：只放插圖（PM 確認不放文字）。底框 faceUnder＋插圖＋上下放射線＋四角花紋 faceCorner 三層 */
.cardFront {
  transform: rotateY(180deg);
  border-radius: 4px;
  background: url("../images/card/faceUnder.png") 0 0/100% 100% no-repeat;
}

.cardIllust {
  /* 插圖放在 faceCorner 上下兩條金線之間（底圖 500×642，金線 y=100～542）：
     高 442px → 68.85%，依題目圖 800×783 比例寬 451.6px → 90.32%，左右置中 → 4.84% */
  position: absolute;
  left: 4.84%;
  top: 15.58%;
  width: 90.32%;
  height: 68.85%;
  -o-object-fit: cover;
     object-fit: cover;
}

.cardFrame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

@keyframes cardPop {
  0% {
    transform: rotateY(180deg) scale(1);
  }
  40% {
    transform: rotateY(180deg) scale(1.08);
  }
  100% {
    transform: rotateY(180deg) scale(1);
  }
}
@keyframes cardGlow {
  0% {
    opacity: 1;
    box-shadow: inset 0 0 0 3px var(--yellow), 0 0 0 0 rgba(246, 210, 27, 0.9);
  }
  100% {
    opacity: 0.85;
    box-shadow: inset 0 0 0 3px var(--yellow), 0 0 0 14px rgba(246, 210, 27, 0);
  }
}
@keyframes matchGlowBurst {
  0% {
    opacity: 0;
    scale: 0.3;
  }
  35% {
    opacity: 1;
    scale: 1.1;
  }
  100% {
    opacity: 0.8;
    scale: 0.9;
  }
}
@keyframes matchGlowSpin {
  to {
    rotate: 360deg;
  }
}
@keyframes matchStars {
  0% {
    opacity: 0;
    scale: 0.45;
    rotate: -12deg;
  }
  30% {
    opacity: 1;
    scale: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.15;
    rotate: 8deg;
  }
}
@keyframes cardShake {
  0%, 100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px) rotate(-2deg);
  }
  40% {
    transform: translateX(7px) rotate(2deg);
  }
  60% {
    transform: translateX(-5px);
  }
  80% {
    transform: translateX(4px);
  }
}
/* ==========================================
   填寫抽獎資料：09_填寫資料.psd
   紙張 1152×712（不含陰影），以下 cqw 都是相對紙張寬度（1cqw = 11.52px），
   位置照 PSD 換算；字級用 clamp(rem 下限, cqw, rem 上限)：
   cqw 讓字跟紙張等比縮放，rem 下限讓使用者調大字級或放大瀏覽器時字一定會變大（無障礙）
   ========================================== */
#viewForm {
  /* 窄於 1280px（miniLaptop）時右側留白不夠放紙張陰影，往內縮一點避免出現水平捲軸 */
  max-width: 1152px;
  padding: clamp(16px, 6.5vw, 110px) 0 clamp(16px, 3.3vw, 55px);
}
@media screen and (max-width: 1280px) {
  #viewForm {
    padding-right: 2.4%;
  }
}
@media screen and (max-width: 51.25em) {
  #viewForm {
    padding-right: 0;
  }
}

.paper {
  /* 820px（padAir）以下紙張底圖放不下表單，欄位改上下排；
     紙張改用裁掉破邊與陰影的 paperMobile.webp，靠右上對齊，讓地圖紋路留在畫面裡 */
  position: relative;
  aspect-ratio: 1152/712;
  container-type: inline-size;
  color: #2A3F54;
}
@media screen and (max-width: 51.25em) {
  .paper {
    aspect-ratio: auto;
    padding: 30px 20px;
    border: 2px solid #7F663C;
    border-radius: 6px;
    background: var(--paper) url("../images/form/paperMobile.webp") right top/cover no-repeat;
  }
}
.paper::before {
  /* 紙張圖右下含陰影（原圖 1600×1004，紙張本體 1563×969），用偽元素放大讓紙張本體剛好貼齊外框 */
  content: "";
  position: absolute;
  left: 0;
  top: -0.256cqw;
  width: 102.37%;
  aspect-ratio: 1600/1004;
  background: url("../images/form/paper.webp") 0 0/100% 100% no-repeat;
  pointer-events: none;
}
@media screen and (max-width: 51.25em) {
  .paper::before {
    display: none;
  }
}

/* 路燈＋坐著的熊 */
.paperLamp {
  /* 原圖 300×923：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 300/923;
  position: absolute;
  left: 8.59cqw;
  top: 4.6cqw;
  width: 16.93cqw;
}
@media screen and (max-width: 51.25em) {
  .paperLamp {
    display: none;
  }
}

/* 表單區塊：左緣對齊 PSD 標題 x580，右緣到信箱欄 x1185 */
.entryForm {
  position: absolute;
  left: 27.24cqw;
  top: 8.39cqw;
  width: 52.53cqw;
}
@media screen and (max-width: 51.25em) {
  .entryForm {
    position: static;
    width: auto;
  }
}

/* 標題：30px 思源黑 Medium #2A3F54 */
.paperTitle {
  margin: 0 0 6.45cqw;
  font-size: clamp(1.125rem, 2.6cqw, 1.875rem);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
@media screen and (max-width: 51.25em) {
  .paperTitle {
    margin-bottom: 24px;
    font-size: 1.125rem;
    line-height: 1.5;
    white-space: normal;
    text-align: center;
  }
}

/* 欄位：左標籤（含冒號，右對齊到 x717）、右輸入框（x734 起） */
.formField {
  display: grid;
  grid-template-columns: 11.91cqw minmax(0, 1fr);
  align-items: center;
  gap: 1.48cqw;
  margin-bottom: 2.69cqw;
}
@media screen and (max-width: 51.25em) {
  .formField {
    grid-template-columns: 1fr;
    gap: 6px;
    margin-bottom: 26px;
  }
}

.formLabel {
  font-size: clamp(1rem, 2.6cqw, 1.875rem);
  font-weight: 500;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
@media screen and (max-width: 51.25em) {
  .formLabel {
    font-size: 1rem;
    text-align: left;
  }
}
.formLabel::after {
  /* 冒號：PSD 為半形冒號，離文字約 10px */
  content: ":";
  margin-left: 0.3cqw;
}

/* 輸入框外層：錯誤訊息浮在下方的間距裡，不推動版面 */
.formControl {
  position: relative;
}
.formControl.isName {
  width: 29.51cqw;
}
.formControl.isEmail {
  width: 39.15cqw;
}
.formControl.isCode {
  width: 100%;
}
@media screen and (max-width: 51.25em) {
  .formControl.isName, .formControl.isEmail {
    width: 100%;
  }
}

/* 輸入框：PSD 高 55～57px、米白底＋細框。字級至少 1rem，iOS 才不會自動放大 */
.formInput {
  display: block;
  width: 100%;
  height: 4.86cqw;
  min-height: 36px;
  padding: 0 1cqw;
  border: 1px solid #96895F;
  border-radius: 0;
  background: #F2EEE5;
  color: #2A3F54;
  font-size: clamp(1rem, 2.1cqw, 1.5rem);
}
@media screen and (max-width: 51.25em) {
  .formInput {
    height: 44px;
    padding: 0 12px;
  }
}
.formInput:focus-visible {
  outline: 3px solid var(--goldDeep);
  outline-offset: 1px;
}

.fieldError {
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 2px;
  color: var(--errorText);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}
.fieldError:empty {
  display: none;
}

/* 驗證碼：輸入框 272px，右側放驗證碼與「換一組」 */
.captchaRow {
  display: flex;
  align-items: center;
  gap: 1cqw;
}
@media screen and (max-width: 51.25em) {
  .captchaRow {
    flex-wrap: wrap;
    gap: 8px;
  }
}
.captchaRow .formInput {
  flex: none;
  width: 23.61cqw;
}
@media screen and (max-width: 51.25em) {
  .captchaRow .formInput {
    flex: 1 1 100px;
    width: auto;
    min-width: 0;
  }
}

/* 驗證碼：斜紋底＋斜體數字，模擬圖形驗證碼 */
.captchaCode {
  padding: 3px 4px 3px 12px;
  background: repeating-linear-gradient(-30deg, #d8c79e 0 3px, #e8dbbb 3px 7px);
  color: #3b2a14;
  font-family: "Courier New", monospace;
  font-size: clamp(1rem, 2cqw, 1.25rem);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.32em;
  -moz-user-select: none;
       user-select: none;
  -webkit-user-select: none;
}
@media screen and (max-width: 51.25em) {
  .captchaCode {
    font-size: 1.25rem;
  }
}

.captchaRefresh {
  padding: 4px;
  border: 0;
  background: none;
  color: #2A3F54;
  font-size: 0.8125rem;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
}

/* 同意隱私權：勾選框對齊輸入框左緣（x734），文字 24px */
.agreeWrap {
  position: relative;
  margin: 3.39cqw 0 0 13.39cqw;
}
@media screen and (max-width: 51.25em) {
  .agreeWrap {
    margin: 8px 0 28px;
  }
}

.agreeRow {
  display: flex;
  align-items: center;
  gap: 1.81cqw;
  font-size: clamp(0.9375rem, 2.08cqw, 1.5rem);
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
@media screen and (max-width: 51.25em) {
  .agreeRow {
    gap: 8px;
    font-size: 0.9375rem;
    line-height: 1.5;
  }
}
.agreeRow .checkBox {
  width: max(18px, 2.17cqw);
  height: max(18px, 2.17cqw);
  border: 1px solid #96895F;
  border-radius: 0;
  background-color: #F2EEE5;
}
.agreeRow .checkBox:checked {
  background-color: #2A3F54;
}
.agreeRow a {
  /* 隱私權連結：PSD 底線 2px */
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.3em;
}

.agreeError {
  position: absolute;
  left: 0;
  top: 100%;
  margin: 4px 0 0;
  color: var(--errorText);
  font-size: 0.8125rem;
  font-weight: 700;
}
.agreeError:empty {
  display: none;
}

/* 送出鈕：PSD 中心 x894、上緣 y768，寬 209px；原圖 428×150 */
.sendButton {
  position: absolute;
  left: 18.25cqw;
  top: 40.74cqw;
  width: 18.14cqw;
  aspect-ratio: 428/150;
  border-radius: 40px;
}
@media screen and (max-width: 51.25em) {
  .sendButton {
    position: relative;
    left: auto;
    top: auto;
    display: block;
    /* 跟桌機最窄時（821px 約 140px）接續縮小，最小 126px 讓按鈕高度保留 44px 點擊範圍 */
    width: clamp(126px, 32vw, 140px);
    margin: 0 auto;
  }
}

/* ==========================================
   活動辦法／得獎名單共用：標題列與內容底
   內容寬 1200px，以下 cqw 相對內容寬（1cqw = 12px），位置照 PSD 換算
   ========================================== */
.infoPage {
  container-type: inline-size;
}

/* 標題列：設計提供的整張標題圖，置中、絕對定位；高度到內容底上緣為止 */
.pageHead {
  position: relative;
  z-index: 1;
}
.pageHead.isRules {
  /* 活動辦法：標題圖 680×201，上緣在 y99、下緣壓進內容底 52px */
  height: 12.42cqw;
  margin-top: 0.58cqw;
}
.pageHead.isRules .pageHeadImage {
  left: 21.67cqw;
  width: 56.67cqw;
}
.pageHead.isWinners {
  /* 得獎名單：標題圖 584×148，上緣在 y98，下緣貼齊內容底 */
  height: 12.5cqw;
  margin-top: 0.5cqw;
}
.pageHead.isWinners .pageHeadImage {
  left: 25.67cqw;
  width: 48.67cqw;
}

.pageHeadImage {
  position: absolute;
  top: 0;
  margin: 0;
}
.pageHeadImage img {
  width: 100%;
}

/* 標題圖原圖：活動辦法 680×201、得獎名單 584×148。
   HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
.rulesTitleImage {
  aspect-ratio: 680/201;
}

.winnersTitleImage {
  aspect-ratio: 584/148;
}

/* 內容底：#324852 實色 */
.sheet {
  background: #324852;
}
.sheet.isRules {
  padding: 8.58cqw 3cqw 7.42cqw 5.92cqw;
  /* 右側少留一點，避免「回家～」被擠到下一行 */
}

/* ==========================================
   活動辦法內容
   ========================================== */
/* 每一段：左邊小熊（79px），右邊標題與內文，熊與文字間距 22px */
.ruleSection {
  display: grid;
  grid-template-columns: 6.58cqw minmax(0, 1fr);
  align-items: center;
  -moz-column-gap: 1.83cqw;
       column-gap: 1.83cqw;
  margin-bottom: 5cqw;
}
.ruleSection:nth-child(3) {
  /* 各段上方間距依 PSD 微調（獎項、公佈、注意事項前的留白較大） */
  padding-top: 0.58cqw;
}
.ruleSection:nth-child(4) {
  padding-top: 1.17cqw;
}
.ruleSection:nth-child(5) {
  padding-top: 2.92cqw;
}
.ruleSection:last-child {
  margin-bottom: 0;
}
.ruleSection:last-child .ruleList {
  /* 注意事項的清單離標題較近 */
  margin-top: 1.1cqw;
}
.ruleSection:last-child .ruleList li {
  margin-bottom: 3.33cqw;
}
.ruleSection .ruleList li:last-child {
  margin-bottom: 0;
}

.ruleIcon {
  aspect-ratio: 160/145;
  width: 100%;
}

.ruleTitle {
  margin: 0;
  color: #62CFFF;
  font-size: clamp(1.25rem, 2.92cqw, 2.1875rem);
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1;
}

.ruleBody {
  grid-column: 2;
  margin: 0.2cqw 0 0;
  font-size: clamp(1rem, 2.5cqw, 1.875rem);
  font-weight: 500;
  letter-spacing: 2px;
  line-height: 1.5;
}

.highlight {
  margin: 0 0.03em;
  color: #FFD202;
  font-family: Arial, sans-serif;
  font-size: 1.266em;
  line-height: 1;
}

/* 星期幾：白色圓（40px）深色字 */
.weekday {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.333em;
  height: 1.333em;
  margin: 0 0.2em 0 0.25em;
  border-radius: 50%;
  background: #fff;
  color: #324852;
  font-weight: 900;
  font-size: 1em;
  letter-spacing: 0;
  line-height: 1;
  padding-bottom: 0.15em;
}

/* 獎項清單：每行 49px */
.prizeList {
  margin-top: 2.6cqw;
  padding: 0;
  list-style: none;
  line-height: 1.633;
}

/* 有序清單：白色圓形編號（35px），內文從編號右邊 69px 開始 */
/* 清單寬度：PSD 每行約 28 個字就換行 */
.ruleList {
  max-width: 75.67cqw;
  margin-top: 3.2cqw;
  padding: 0;
  list-style: none;
  counter-reset: ruleItem;
}
.ruleList li {
  position: relative;
  margin-bottom: 4.2cqw;
  padding-left: 5.67cqw;
  counter-increment: ruleItem;
}
.ruleList li::before {
  content: counter(ruleItem);
  position: absolute;
  left: 0;
  top: 0.2em;
  width: 1.167em;
  height: 1.167em;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: #324852;
  font-family: Arial, sans-serif;
  font-weight: 700;
  font-size: 1em;
  line-height: 1;
}

/* 聯絡方式：黃色，信箱有底線 */
.contact {
  display: inline-block;
  padding-top: 0.2em;
  /* PSD 聯絡方式兩行行距較大 */
  color: #FFD202;
  overflow-wrap: anywhere;
}

a.contact {
  text-decoration: underline;
  /* 範本 reset 會拿掉連結底線 */
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.sheet.isWinners {
  /* 得獎名單內容 */
  padding: 9.67cqw 8.33cqw 6cqw;
}
@media screen and (max-width: 767px) {
  .sheet.isWinners {
    padding: 36px 16px 32px;
  }
}
.sheet.isWinners {
  /* 預設顯示名單、隱藏敬請期待；名單公布前在 #winnersSheet 加上 isPending（由後端輸出），只留提示 */
}
.sheet.isWinners:not(.isPending) .winnersPending, .sheet.isWinners.isPending .prize {
  display: none;
}
.sheet.isRules {
  /* 手機：cqw 換算後字太小，改用固定 rem 字級與間距 */
}
@media screen and (max-width: 767px) {
  .sheet.isRules {
    padding: 48px 18px 40px;
  }
}

/* 名單尚未公布時的提示 */
.winnersPending {
  margin: 0;
  padding: 4cqw 0;
  text-align: center;
  font-size: clamp(1rem, 2.5cqw, 1.875rem);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.prize {
  margin-bottom: 10cqw;
  text-align: center;
}
@media screen and (max-width: 767px) {
  .prize {
    margin-bottom: 40px;
  }
}
.prize:nth-child(2) {
  /* PSD 第二、三個獎項間距較小 */
  margin-bottom: 7cqw;
}
.prize:last-child {
  margin-bottom: 0;
}

/* 獎項名稱：黃框膠囊（高 68px），38px Heavy 白字，字距 260 */
.prizeTitle {
  display: inline-flex;
  align-items: center;
  height: 5.67cqw;
  margin: 0;
  padding: 0 4.47cqw 0 calc(4.47cqw + 0.26em);
  border: 3px solid #FFD200;
  border-radius: 999px;
  font-size: clamp(1.125rem, 3.17cqw, 2.375rem);
  font-weight: 900;
  letter-spacing: 0.26em;
  line-height: 1;
  white-space: nowrap;
}
@media screen and (max-width: 767px) {
  .prizeTitle {
    height: auto;
    padding: 8px 16px 8px calc(16px + 0.26em);
    font-size: 1.0625rem;
    white-space: normal;
  }
}

.prizeDivider {
  font-size: 0.79em;
  margin: 0 0.1em;
}

/* 共 3 名：30px Heavy，數字 Arial Black 40px #FFF000 */
.prizeCount {
  margin: 1.75cqw 0 0;
  font-size: clamp(1rem, 2.5cqw, 1.875rem);
  font-weight: 900;
  letter-spacing: 0.26em;
  line-height: 1;
  padding-left: 0.26em;
}
@media screen and (max-width: 767px) {
  .prizeCount {
    margin-top: 10px;
    font-size: 1rem;
  }
}
.prizeCount b {
  color: #FFF000;
  font-family: "Arial Black", "Archivo Black", "Arial Bold", Arial, sans-serif;
  font-size: 1.333em;
  letter-spacing: 0;
  margin: 0 0.26em 0 0;
}

/* 名單：每列 78px，底線 2px #587886，姓名左縮 75px、信箱從 x899 開始 */
.winnerTable {
  width: 100%;
  margin-top: 3.07cqw;
  border-collapse: collapse;
  font-size: clamp(1rem, 2.5cqw, 1.875rem);
  font-weight: 500;
  line-height: 1;
  text-align: left;
}
@media screen and (max-width: 767px) {
  .winnerTable {
    margin-top: 16px;
    font-size: 0.9375rem;
  }
}
.winnerTable td {
  padding: 2.25cqw 0 1.5cqw;
  border-bottom: 2px solid #587886;
  overflow-wrap: anywhere;
}
@media screen and (max-width: 767px) {
  .winnerTable td {
    padding: 14px 0 12px;
  }
}
.winnerTable td:first-child {
  width: 55.9%;
  padding-right: 10px;
  padding-left: 7.5%;
}
@media screen and (max-width: 767px) {
  .winnerTable td:first-child {
    width: 40%;
    padding-left: 4px;
  }
}
.winnerTable td {
  /* 信箱靠左對齊 */
}
.winnerTable td + td {
  text-align: left;
}
.winnerTable tr:last-child td {
  border-bottom: 0;
}

@media screen and (max-width: 767px) {
  .ruleSection {
    grid-template-columns: 40px minmax(0, 1fr);
    -moz-column-gap: 10px;
         column-gap: 10px;
    margin-bottom: 32px;
  }
}
@media screen and (max-width: 767px) {
  .ruleSection:nth-child(n) {
    padding-top: 0;
  }
}

@media screen and (max-width: 767px) {
  .ruleTitle {
    font-size: 1.25rem;
  }
}

@media screen and (max-width: 767px) {
  .ruleBody {
    grid-column: 1/-1;
    margin-top: 10px;
    font-size: 1rem;
  }
}

@media screen and (max-width: 767px) {
  .prizeList,
  .ruleList {
    margin-top: 12px;
  }
}

@media screen and (max-width: 767px) {
  .ruleList {
    max-width: none;
  }
}

@media screen and (max-width: 767px) {
  .ruleList li,
  .ruleSection:last-child .ruleList li {
    margin-bottom: 16px;
    padding-left: 32px;
  }
}

/* ==========================================
   彈窗共用遮罩
   z-index 50：蓋過頁首（30）與瀏海色塊（40）
   ========================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) var(--gutterRight) max(16px, env(safe-area-inset-bottom, 0px)) var(--gutterLeft);
  background: rgba(76, 105, 118, 0.65);
  overflow-y: auto;
}

@keyframes rise {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
/* 關閉鈕原圖 77×77 */
.closeButton {
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(40px, 4.6vw, 77px);
  aspect-ratio: 1;
}

/* 繼續鈕原圖 348×130（@2x） */
.nextButton {
  aspect-ratio: 348/130;
  border-radius: 40px;
}

/* ==========================================
   說明彈窗：04_說明_LightBox.psd，框 1050×570
   以下 % 都是相對這個框，整個框等比縮放
   ========================================== */
.explainBox {
  /* 窄螢幕：橫向排放不下，改成上下排 */
  position: relative;
  width: 100%;
  max-width: 1050px;
  aspect-ratio: 1050/570;
  container-type: inline-size;
  background: var(--teal) url("../images/dialog/plaid.png") 0 0/156px 140px repeat;
  box-shadow: inset 0 0 0 5px #EDC26D;
  animation: rise 0.28s ease-out;
}
@media screen and (max-width: 47.9375em) {
  .explainBox {
    aspect-ratio: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 30px 18px 20px;
  }
}
.explainBox .closeButton {
  right: 5.8%;
  top: -6.8%;
  width: 7.33%;
}
@media screen and (max-width: 47.9375em) {
  .explainBox .closeButton {
    top: -14px;
    right: 10px;
    width: 44px;
  }
}
.explainBox .nextButton {
  position: absolute;
  right: 6.76%;
  bottom: 8.95%;
  width: 16.57%;
}
@media screen and (max-width: 47.9375em) {
  .explainBox .nextButton {
    position: relative;
    right: auto;
    bottom: auto;
    /* 跟著螢幕寬縮放：390 寬約 101px，767 寬接回平板版的大小（約 124px） */
    width: clamp(96px, 26vw, 124px);
    align-self: flex-end;
  }
}

/* 郵票框＋題目插圖 */
.explainStamp {
  position: absolute;
  left: 6.1%;
  top: 20%; /* 正方形郵票比舊版矮，往下移維持與原本相同的垂直中心 */
  width: 36%;
  aspect-ratio: 1/1;
  background: url("../images/dialog/stamp.webp") center/100% 100% no-repeat;
}
@media screen and (max-width: 47.9375em) {
  .explainStamp {
    position: relative;
    left: auto;
    top: auto;
    width: 62%;
    max-width: 220px;
  }
}
.explainStamp img {
  /* 郵票框 420×420（2026-11-27 換正方形版），題目圖 800×783 依原比例完整顯示、置中 */
  position: absolute;
  left: 5.5%;
  top: 50%;
  width: 89%;
  aspect-ratio: 800/783;
  transform: translateY(-50%);
  -o-object-fit: cover;
     object-fit: cover;
  background: #fff;
}

.explainAvatar {
  position: absolute;
  left: 63.4%;
  top: 6.1%;
  width: 16%;
}
@media screen and (max-width: 47.9375em) {
  .explainAvatar {
    display: none;
  }
}
.explainAvatar img {
  /* 原圖 236×260：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  width: 100%;
  aspect-ratio: 236/260;
}

/* 說明文字：PSD 31px Medium。用 cqw 跟框等比縮放（框 1050px 時 31px），rem 為上下限：下限確保使用者調大字級或放大瀏覽器時字會變大 */
.explainText {
  /* 題目文字裡的 \n 要換行（例如載貨規定分三行） */
  white-space: pre-line;
  position: absolute;
  left: 47.8%;
  top: 45.4%;
  width: 47.2%;
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 2.95cqw, 1.9375rem);
  font-weight: 500;
  line-height: 1.61;
}
@media screen and (max-width: 47.9375em) {
  .explainText {
    position: static;
    width: auto;
    font-size: 1rem;
    line-height: 1.7;
  }
}

/* ==========================================
   成功過關：05_下一關_LightBox.psd，內容框 818×420
   以下 % 都是相對這個框；字級用 cqw 跟框等比縮放（框 818px 時等於 PSD 字級），rem 為上下限（下限確保調大字級時字會變大）
   ========================================== */
.nextBox {
  position: relative;
  width: 100%;
  max-width: 818px;
  aspect-ratio: 818/420;
  container-type: inline-size;
  animation: rise 0.3s ease-out;
}
.nextBox .closeButton {
  /* 關閉鈕在框外右側（PSD x1307，框右邊再多 144px）；
     1280px（miniLaptop）以下右邊放不下，改放到框的右上方，避免蓋到熊和星星 */
  left: 108.19%;
  top: 7.38%;
  width: 9.41%;
  min-width: 36px;
}
@media screen and (max-width: 1280px) {
  .nextBox .closeButton {
    left: auto;
    right: 0;
    top: auto;
    bottom: 100%;
  }
}

.nextBlob {
  /* 原圖 658×384：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 658/384;
  position: absolute;
  left: 0;
  top: 8.57%;
  width: 80.44%;
}

.nextBear {
  /* 原圖 346×376：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 346/376;
  position: absolute;
  left: 57.7%;
  top: 0;
  width: 42.3%;
  animation: nextBob 1.4s ease-in-out infinite;
}

/* 熊上下輕晃 */
@keyframes nextBob {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2.5%);
  }
}
/* 五個箭頭：PSD 每個 32px、間距 11px，依序閃動指向熊 */
.nextArrows {
  position: absolute;
  left: 45.6%;
  top: 82.14%;
  width: 24.94%;
  display: flex;
  justify-content: space-between;
}
.nextArrows img {
  width: 15.7%;
  /* 原圖 32×29：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 32/29;
  animation: nextNudge 1s ease-in-out infinite;
}
.nextArrows img:nth-child(2) {
  animation-delay: 0.1s;
}
.nextArrows img:nth-child(3) {
  animation-delay: 0.2s;
}
.nextArrows img:nth-child(4) {
  animation-delay: 0.3s;
}
.nextArrows img:nth-child(5) {
  animation-delay: 0.4s;
}

@keyframes nextNudge {
  0%, 100% {
    transform: none;
    opacity: 0.6;
  }
  50% {
    transform: translateX(20%);
    opacity: 1;
  }
}
/* 文字三行各自依 PSD 基線定位 */
.nextTitle,
.nextCount,
.nextHint {
  position: absolute;
  left: 22.45%;
  margin: 0;
  line-height: 1;
  white-space: nowrap;
  /* 最窄的手機（320px）：字的下限 1rem 讓「進入下一關繼續挑戰」碰到滑板，整組往左移 */
}
@media screen and (max-width: 22.5em) {
  .nextTitle,
  .nextCount,
  .nextHint {
    left: 16%;
  }
}

/* 成功過關：60px 思源黑 Heavy #FFD200 */
.nextTitle {
  top: 29.2%;
  color: #FFD200;
  font-size: clamp(1.5rem, 7.33cqw, 3.75rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  /* PSD 字距 100 */
}

/* 3 秒後：數字 60px Arial Black，「秒後」30px Medium，底部對齊 */
.nextCount {
  top: 49.6%;
  display: flex;
  align-items: baseline;
  gap: 1.22cqw;
  font-size: clamp(1rem, 3.67cqw, 1.875rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  /* PSD 字距 50 */
}

.nextCountNumber {
  font-family: "Arial Black", "Archivo Black", "Arial Bold", Arial, sans-serif;
  font-size: 2em;
  font-weight: 900;
}

/* 進入下一關繼續挑戰：30px Medium */
.nextHint {
  top: 66.6%;
  font-size: clamp(1rem, 3.67cqw, 1.875rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  /* PSD 字距 50 */
}

/* ==========================================
   挑戰成功：08_挑戰成功_LightBox.psd，內容框 894×406
   以下 % 都是相對這個框；字級用 cqw 跟框等比縮放（框 894px 時等於 PSD 字級），rem 為上下限（下限確保調大字級時字會變大）
   ========================================== */
.winBox {
  position: relative;
  width: 100%;
  max-width: 894px;
  aspect-ratio: 894/406;
  container-type: inline-size;
  animation: rise 0.3s ease-out;
}
.winBox .closeButton {
  /* 關閉鈕在框的右上方（PSD x1177、比框高出 50px） */
  left: 86.58%;
  top: -12.32%;
  width: 8.61%;
  min-width: 36px;
  z-index: 2;
}
@media screen and (max-width: 47.9375em) {
  .winBox .closeButton {
    left: auto;
    right: 0;
    top: 0;
    width: 11%;
  }
}
@media screen and (max-width: 47.9375em) {
  .winBox {
    max-width: 400px;
    aspect-ratio: 100/103;
  }
}

.winBlob {
  /* 原圖 621×362：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 621/362;
  position: absolute;
  left: 0;
  top: 10.84%;
  width: 69.46%;
}
@media screen and (max-width: 47.9375em) {
  .winBlob {
    top: auto;
    bottom: 0;
    width: 100%;
  }
}

/* 煙火：一閃一閃地放大縮小 */
.winFire {
  /* 原圖 471×283：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 471/283;
  position: absolute;
  left: 47.32%;
  top: 0;
  width: 52.68%;
  animation: winSparkle 1.2s ease-in-out infinite;
}
@media screen and (max-width: 47.9375em) {
  .winFire {
    left: 12%;
    width: 76%;
  }
}

@keyframes winSparkle {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.75;
  }
}
/* 熊：開心地上下跳 */
.winBear {
  position: absolute;
  /* 原圖 278×346：HTML 不寫 width／height，用比例在圖片載入前先佔好高度，避免版面跳動 */
  aspect-ratio: 278/346;
  left: 57.27%;
  top: 14.78%;
  width: 31.1%;
  animation: nextBob 0.9s ease-in-out infinite;
}
@media screen and (max-width: 47.9375em) {
  .winBear {
    left: 29%;
    top: 0;
    width: 42%;
  }
}

/* 恭喜／擁有神之記憶力的你：30px 思源黑 Heavy 白色，字距 100，行高 36px */
.winGreeting {
  position: absolute;
  left: 15.4%;
  top: 36.4%;
  margin: 0;
  font-size: clamp(1rem, 3.36cqw, 1.875rem);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  white-space: nowrap;
  /* 直排：字級改相對整個寬度（底圖從 69.46% 放大到 100%，所以 ×1.44） */
}
@media screen and (max-width: 47.9375em) {
  .winGreeting {
    left: 22%;
    top: 59.6%;
    font-size: clamp(1rem, 4.84cqw, 1.5rem);
  }
}

/* 挑戰成功！：60px 思源黑 Heavy #FFD200，字距 100 */
.winTitle {
  position: absolute;
  left: 15.4%;
  top: 62%;
  margin: 0;
  color: #FFD200;
  font-size: clamp(1.5rem, 6.71cqw, 3.75rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.1em;
  white-space: nowrap;
}
@media screen and (max-width: 47.9375em) {
  .winTitle {
    left: 22%;
    top: 75.9%;
    font-size: clamp(1.5rem, 9.66cqw, 2.5rem);
  }
}

/* 驚嘆號在 PSD 有旋轉約 17 度 */
.winBang {
  display: inline-block;
  margin-left: 0.1em;
  transform: rotate(16.7deg);
}/*# sourceMappingURL=all.css.map */
