@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+TC:wght@400;700&family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
  --color-bg: #F5F0E8;
  --color-card-warm: #D4A843;
  --color-text-main: #2C1810;
  --color-text-sub: #6B4423;
  --color-accent: #C0392B;
  --color-gold: #B8860B;
  --color-gold-light: #F0D080;
}

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

html, body {
  width: 100%;
  background-color: var(--color-bg);
  color: var(--color-text-main);
  font-family: 'Noto Sans TC', sans-serif;
  scroll-behavior: smooth;
}

/* 網頁滾動條美化 */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--color-text-sub);
  border-radius: 3px;
}

/* 區塊一：頂部導覽列（均勻排列三個入口） */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.05);
}

.nav-group {
  display: flex;
  gap: 12px;
  flex: 1;
  align-items: center;
}

.nav-group-left {
  justify-content: flex-start;
}

.nav-group-right {
  justify-content: flex-end;
}

header .nav-btn {
  background: none;
  border: none;
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-sub);
  cursor: pointer;
  padding: 8px 4px;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
  white-space: nowrap;
}

header .nav-btn:hover {
  color: var(--color-gold);
}

header h1.logo {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.05em;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  margin: 0 8px;
  flex: 0 0 auto;
}

/* SPA 頁面切換控制 */
.page-view {
  display: none; /* 預設全部隱藏 */
  width: 100%;
  min-height: calc(100vh - 56px);
  padding: 24px 16px;
  background-color: var(--color-bg);
}

.page-view.active {
  display: block;
  animation: fadeInView 0.35s ease-out forwards;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 容器與垂直區塊佈局 */
main {
  padding-top: 56px; /* 避開固定導覽列 */
}

section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* 區塊二：翻牌主體 */
#draw-section {
  min-height: calc(100vh - 56px - 60px); /* 扣除 padding 與 header */
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* 翻牌動畫 */
.card-scene {
  perspective: 1000px;
  width: 280px;
  height: 420px;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.card-scene:hover {
  transform: translateY(-6px);
}

.card {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-watermark {
  position: absolute;
  right: 16px;
  bottom: 16px;
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.3);
  pointer-events: none;
  z-index: 10;
}

.card.is-flipped {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 12px;
  border: 3px solid var(--color-gold);
  box-shadow: 0 8px 24px rgba(44, 24, 16, 0.15);
}

/* 牌面正面（翻開後顯示，對應 CSS 類為 --back） */
.card-face--back {
  transform: rotateY(180deg);
  background-image: url('../images/crane_back_v2.png');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* 牌面背面（預設顯示，對應 CSS 類為 --front） */
.card-face--front {
  background-color: var(--color-card-warm);
  background-image: url('../images/crane_front_v2.jpg');
  background-size: cover;
  background-position: center;
}

/* 背面直書文字：心靈鶴湯 */
.card-back-text {
  font-family: 'Noto Serif TC', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-main);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.6em;
  margin-left: -0.6em;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.15);
}

/* 翻開後牌面文字 (方案 A：直式卡片，文字橫書排版) */
.card-back-content {
  width: 100%;
  height: 100%;
  padding: 32px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  color: #000000;
  text-align: center;
}

.card-top-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.card-bottom-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin-top: auto;
}

.card-fortune-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  color: #000000;
  margin: 0;
  letter-spacing: 0.12em;
}

.card-fortune-quote {
  font-family: 'Noto Serif TC', serif;
  font-size: 21px;
  font-weight: 700;
  color: #000000;
  margin: 8px 0;
  line-height: 1.5;
  flex-grow: 0;
}

.card-fortune-divider {
  font-family: 'Noto Serif TC', serif;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  opacity: 0.95;
  margin: 4px 0;
  letter-spacing: 0.1em;
}

.card-fortune-interpretation {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.6;
  color: #000000;
  margin: 0;
  text-align: justify;
  flex-grow: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-fortune-ending {
  font-size: 14px;
  color: #000000;
  font-weight: 700;
  margin-top: 8px;
  letter-spacing: 0.15em;
}

/* 提示文字 */
.tip-container {
  margin-top: 24px;
  text-align: center;
  padding: 0 20px;
}

.tip-text {
  font-size: 16px;
  color: var(--color-text-sub);
  letter-spacing: 0.1em;
  font-weight: 500;
  transition: color 0.3s ease;
}

.tip-text.pulse {
  animation: pulseOpacity 2s infinite ease-in-out;
}

@keyframes pulseOpacity {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* 區塊三：解籤區塊（翻牌後顯示） */
#interpretation-section {
  min-height: 100vh;
  padding: 60px 24px;
  background-color: #FAF6F0;
  border-top: 1px solid rgba(184, 134, 11, 0.15);
  display: none;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

#interpretation-section.show {
  display: flex;
  opacity: 1;
}

.interpretation-container {
  max-width: 520px;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 16px;
  padding: 48px 32px;
  box-shadow: 0 4px 20px rgba(44, 24, 16, 0.03);
  text-align: center;
  position: relative;
}

/* 裝飾性金線角框 */
.interpretation-container::before,
.interpretation-container::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-gold-light);
}
.interpretation-container::before {
  top: 16px;
  left: 16px;
  border-right: none;
  border-bottom: none;
}
.interpretation-container::after {
  bottom: 16px;
  right: 16px;
  border-left: none;
  border-top: none;
}

.fortune-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 24px;
  letter-spacing: 0.15em;
}

.fortune-quote {
  font-family: 'Noto Serif TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.8;
  margin-bottom: 36px;
  padding: 0 10px;
  letter-spacing: 0.05em;
  position: relative;
  display: inline-block;
}

.divider {
  font-family: 'Noto Serif TC', serif;
  font-size: 14px;
  color: var(--color-gold);
  margin: 36px 0;
  letter-spacing: 0.3em;
  display: flex;
  align-items: center;
  justify-content: center;
}
.divider::before,
.divider::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-gold-light), transparent);
  margin: 0 16px;
}

.fortune-interpretation {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 16px;
  line-height: 2;
  color: var(--color-text-sub);
  text-align: justify;
  letter-spacing: 0.06em;
  margin-bottom: 36px;
}

.fortune-ending {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.25em;
  margin-top: 16px;
}

/* 收藏這句話 愛心按鈕樣式 */
.fav-action-wrap {
  margin-top: 36px;
  display: flex;
  justify-content: center;
}

.fav-action-btn {
  background-color: transparent;
  border: 1.5px solid var(--color-text-sub);
  color: var(--color-text-sub); /* 未收藏為 --color-text-sub */
  border-radius: 24px;
  padding: 10px 28px;
  font-size: 15px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.05em;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fav-action-btn:hover {
  transform: translateY(-2px);
}

/* 已收藏狀態：心變實心，字色變為 --color-accent，按鈕框架與底色變為深褐色 --color-text-main */
.fav-action-btn.is-saved {
  color: var(--color-accent); /* 已收藏文字變為 --color-accent */
  border-color: var(--color-text-main); /* 按鈕顏色變為深褐色 (邊框) */
  background-color: var(--color-text-main); /* 按鈕本體底色變為深褐色 */
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.2);
}

/* 已收藏滑鼠懸停文字效果微調 */
.fav-action-btn.is-saved:hover {
  background-color: #3b2015; /* 懸停時稍亮一點的深褐 */
  border-color: #3b2015;
}

.fav-action-btn .heart-icon {
  font-size: 16px;
}

/* 子頁面通用頁首樣式 */
.subpage-header {
  max-width: 600px;
  margin: 0 auto 28px auto;
  display: flex;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.15);
}

.back-btn {
  background: none;
  border: none;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-sub);
  cursor: pointer;
  transition: color 0.2s ease;
}

.back-btn:hover {
  color: var(--color-accent);
}

.subpage-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-left: 20px;
  letter-spacing: 0.05em;
}

/* 收藏頁面樣式 */
.favorites-container {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

/* 收藏卡片：圓角、細金邊（--color-gold） */
.fav-card {
  background-color: #FFFFFF;
  border: 1px solid var(--color-gold);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.03);
  position: relative;
  animation: cardFadeIn 0.3s ease-out forwards;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fav-card-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 10px;
  letter-spacing: 0.1em;
}

.fav-card-quote {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-main);
  line-height: 1.6;
  margin-bottom: 14px;
  border-left: 2px solid var(--color-accent);
  padding-left: 10px;
  letter-spacing: 0.05em;
}

.fav-card-interpretation {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text-sub);
  text-align: justify;
  margin-bottom: 44px; /* 保留移除按鈕的空間 */
}

/* 收藏卡片底部列 */
.fav-card-footer {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fav-card-date {
  font-size: 12px;
  color: rgba(107, 68, 35, 0.4);
}

.fav-card-remove-btn {
  background: none;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fav-card-remove-btn:hover {
  background-color: var(--color-accent);
  color: #FFFFFF;
}

.empty-favorites {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-sub);
  font-size: 15px;
  line-height: 1.8;
}

/* 地圖頁面樣式 */
.map-container {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.map-article {
  background-color: #FFFFFF;
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.03);
}

.article-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #B8860B 0%, #D4AF37 50%, #AA771C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-gold-light);
  padding-bottom: 6px;
  display: inline-block;
}

.article-content {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text-sub);
  text-align: justify;
}

.article-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 16px;
  display: block;
}

/* RWD 響應式 */
.card-scene {
  width: 280px;
  height: 420px;
}

@media (max-height: 667px) {
  .card-scene {
    width: 220px;
    height: 330px;
  }
  .card-back-content {
    padding: 16px 14px;
  }
  .card-fortune-title {
    font-size: 14px;
  }
  .card-fortune-quote {
    font-size: 14px;
    margin: 8px 0;
  }
  .card-fortune-interpretation {
    font-size: 11.5px;
    line-height: 1.4;
  }
  .card-fortune-ending {
    font-size: 11px;
    margin-top: 8px;
  }
  .interpretation-container {
    padding: 32px 20px;
  }
}

@media (min-width: 768px) {
  .card-scene {
    width: 320px;
    height: 480px;
  }
  .card-fortune-title {
    font-size: 18px;
  }
  .card-fortune-quote {
    font-size: 18px;
  }
  .card-fortune-interpretation {
    font-size: 14.5px;
  }
}

/* ==========================================================================
   2.0 升級版新增樣式
   ========================================================================== */

/* 首頁引言與金色分割線 */
.intro-section {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  background-color: var(--color-bg);
}
.intro-panorama-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.fine-gold-divider {
  width: 80px;
  height: 1px;
  background-color: var(--color-gold);
  margin: 16px auto 24px auto;
  opacity: 0.6;
}

/* 連續打卡累積 */
.streak-container {
  max-width: 600px;
  margin: 0 auto 16px auto;
  padding: 16px;
  background-color: #FFFFFF;
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.02);
}
.streak-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 6px;
}
.streak-icon {
  margin-right: 4px;
}
.streak-days {
  color: var(--color-accent);
}
.streak-subtitle {
  font-size: 13px;
  color: var(--color-text-sub);
}

/* 小鶴的日常能量池互動小遊戲 */
#game-section {
  padding: 40px 16px;
  background-color: var(--color-bg);
  width: 100%;
}
.game-container {
  max-width: 520px;
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--color-gold);
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 0 8px 24px rgba(44, 24, 16, 0.05);
  margin: 0 auto;
  position: relative;
  text-align: center;
}
.game-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 24px;
  letter-spacing: 0.1em;
}
.crane-status-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.crane-avatar-container {
  perspective: 600px;
}
.crane-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--color-gold);
  background-image: url('../images/crane_front_v2.jpg');
  background-size: cover;
  background-position: center;
  animation: breathe 3s ease-in-out infinite;
  transition: transform 0.6s ease-in-out;
}
.crane-avatar.spin {
  animation: spinY 0.6s ease-in-out;
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes spinY {
  0% { transform: scale(1) rotateY(0deg); }
  100% { transform: scale(1) rotateY(360deg); }
}
.dialog-bubble-wrap {
  flex: 1;
  min-width: 200px;
  position: relative;
}
.dialog-bubble {
  background-color: #FAF6F0;
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--color-text-main);
  text-align: left;
  line-height: 1.5;
  position: relative;
}
.dialog-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 14px;
  height: 14px;
  background-color: #FAF6F0;
  border-left: 1px solid rgba(184, 134, 11, 0.2);
  border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}
@media (max-width: 480px) {
  .dialog-bubble::before {
    display: none;
  }
}
.game-btn {
  background-color: var(--color-card-warm);
  color: var(--color-text-main);
  border: 1px solid var(--color-gold);
  border-radius: 20px;
  padding: 8px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.05em;
  font-family: 'Noto Sans TC', sans-serif;
}
.game-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212, 168, 67, 0.3);
}
.game-btn:disabled {
  background-color: #D3D3D3;
  border-color: #C0C0C0;
  color: #808080;
  cursor: not-allowed;
}
.game-subtitle {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-sub);
  margin: 28px 0 12px 0;
  text-align: left;
  border-left: 3px solid var(--color-gold);
  padding-left: 8px;
}
.chance-text {
  font-size: 12px;
  font-weight: normal;
  color: var(--color-text-sub);
  margin-left: 8px;
}
.chests-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 16px 0;
}
.chest-box {
  width: 60px;
  height: 60px;
  font-size: 32px;
  background-color: #FAF6F0;
  border: 1.5px solid rgba(184, 134, 11, 0.25);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}
.chest-box:hover:not(.opened):not(.disabled) {
  transform: scale(1.1) rotate(5deg);
  border-color: var(--color-gold);
  background-color: #FFFFFF;
}
.chest-box.opened {
  background-color: #E8F5E9;
  border-color: #81C784;
  opacity: 0.8;
  cursor: default;
}
.chest-box.disabled {
  cursor: default;
  opacity: 0.6;
}
.treasure-toast {
  min-height: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent);
  margin-top: 8px;
}
.collection-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}
.grid-item {
  background-color: #FAF6F0;
  border: 1px solid rgba(107, 68, 35, 0.1);
  border-radius: 8px;
  padding: 12px 4px;
  font-size: 12px;
  color: var(--color-text-sub);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  transition: all 0.3s ease;
}
.grid-item.empty {
  color: rgba(107, 68, 35, 0.2);
  font-size: 20px;
}
.grid-item.collected {
  background-color: #FFFFFF;
  border-color: var(--color-gold);
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.1);
  font-weight: 500;
}
.grid-item-emoji {
  font-size: 24px;
  margin-bottom: 4px;
}
.grid-item-name {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.medal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(44, 24, 16, 0.7);
  border-radius: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.3s ease-out forwards;
  padding: 16px;
}
.medal-card {
  background-color: #FFFFFF;
  border: 2px solid var(--color-gold);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 320px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.medal-emoji {
  font-size: 64px;
  margin-bottom: 16px;
  animation: pulse 1.5s infinite;
}
.medal-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--color-gold);
  margin-bottom: 8px;
}
.medal-desc {
  font-size: 14px;
  color: var(--color-text-main);
  margin-bottom: 24px;
  line-height: 1.5;
}
.medal-close-btn {
  background-color: var(--color-gold);
  color: #FFFFFF;
  border: none;
  border-radius: 20px;
  padding: 8px 32px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
.medal-close-btn:hover {
  background-color: #996F08;
}

/* 今日幸運指數 */
.luck-index-container {
  margin: 28px 0;
  border-top: 1px dashed rgba(184, 134, 11, 0.2);
  border-bottom: 1px dashed rgba(184, 134, 11, 0.2);
  padding: 20px 0;
}
.luck-index-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.luck-row {
  display: flex;
  justify-content: space-between;
  max-width: 240px;
  margin: 6px auto;
  font-size: 14px;
}
.luck-label {
  color: var(--color-text-sub);
}
.luck-stars {
  color: var(--color-accent);
  letter-spacing: 0.1em;
  font-weight: 700;
}

/* 分享好運 */
.share-action-wrap {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.share-btn {
  background-color: transparent;
  border: 1.5px solid var(--color-gold);
  color: var(--color-gold);
  border-radius: 24px;
  padding: 10px 28px;
  font-size: 15px;
  font-family: 'Noto Sans TC', sans-serif;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.05em;
  transition: all 0.3s ease;
  width: 100%;
  max-width: 280px;
}
.share-btn:hover {
  background-color: var(--color-gold-light);
  color: var(--color-text-main);
  transform: translateY(-2px);
}
.share-options {
  background-color: #FAF6F0;
  border: 1px solid rgba(184, 134, 11, 0.2);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  display: none;
  flex-direction: column;
  align-items: center;
  animation: slideDown 0.3s ease-out forwards;
  width: 100%;
  max-width: 280px;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.share-options-title {
  font-size: 13px;
  color: var(--color-text-sub);
  margin-bottom: 12px;
}
.share-radio-group {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.share-radio-label {
  font-size: 14px;
  color: var(--color-text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.share-confirm-btn {
  background-color: var(--color-gold);
  color: #FFFFFF;
  border: none;
  border-radius: 16px;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
.share-confirm-btn:hover {
  background-color: #996F08;
}
.share-toast {
  font-size: 12px;
  color: #4CAF50;
  font-weight: 500;
  margin-top: 8px;
  min-height: 16px;
}

/* 今日小行動 */
.action-container {
  margin: 24px 0;
  text-align: center;
}
.action-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}
.action-card {
  background-color: #FAF6F0;
  border: 1px solid rgba(184, 134, 11, 0.25);
  border-radius: 12px;
  padding: 16px;
  max-width: 320px;
  margin: 0 auto;
  transition: all 0.5s ease;
}
.action-card.completed {
  background-color: #FFF9E6;
  border-color: var(--color-gold);
}
.action-text-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-text-main);
}
.checkbox-icon {
  font-size: 16px;
  font-family: monospace;
  font-weight: bold;
  color: var(--color-gold);
}
.action-btn {
  background-color: var(--color-text-sub);
  color: #FFFFFF;
  border: none;
  border-radius: 18px;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Sans TC', sans-serif;
}
.action-btn:hover {
  background-color: var(--color-text-main);
}
.action-btn:disabled {
  background-color: #D3D3D3;
  color: #808080;
  cursor: default;
}
/* 金色光暈特效 */
.glow-effect {
  box-shadow: 0 0 20px 5px rgba(212, 168, 67, 0.6);
  filter: drop-shadow(0 0 10px rgba(212, 168, 67, 0.4));
  animation: glowPulse 2s ease-in-out;
}
@keyframes glowPulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0); }
  30% { box-shadow: 0 0 25px 8px rgba(212, 168, 67, 0.8); }
  100% { box-shadow: 0 0 0 0 rgba(212, 168, 67, 0); }
}

/* 有好地圖 - 連環滑動繪本 */
.pb-slider-article {
  padding: 24px 16px !important;
}
.slider-viewport {
  width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  margin-top: 16px;
}
/* 美化隱藏滑動滾動條 */
.slider-viewport::-webkit-scrollbar {
  display: none;
}
.slider-viewport {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.slider-container {
  display: flex;
  width: 400%; /* 4頁 */
}
.slider-page {
  width: 25%; /* 每頁佔 1/4 (即 viewports 寬度) */
  flex-shrink: 0;
  scroll-snap-align: start;
  padding: 0 4px;
  box-sizing: border-box;
}
.slider-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.08);
}
.slider-content {
  font-family: 'Noto Serif TC', serif;
  font-size: 14px;
  color: var(--color-text-sub);
  line-height: 1.8;
  padding: 16px 8px;
  text-align: justify;
}
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}
.slider-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(184, 134, 11, 0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}
.slider-dots .dot.active {
  background-color: var(--color-gold);
  transform: scale(1.3);
}

/* ==========================================================================
   新增商品廣告頁面與小螢幕導覽列優化樣式
   ========================================================================== */

/* 小螢幕 (如 iPhone SE 375px) 導覽列適配 */
@media (max-width: 380px) {
  header {
    padding: 0 8px !important;
  }
  header .nav-btn {
    font-size: 11.5px !important;
    padding: 8px 2px !important;
    letter-spacing: 0.01em !important;
  }
  header h1.logo {
    font-size: 14px !important;
    margin: 0 4px !important;
  }
  .nav-group {
    gap: 6px !important;
  }
}

/* 廣告好物頁面 */
.ad-container {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.ad-section {
  position: relative;
  background-color: #FFFFFF;
  border: 1px solid rgba(184, 134, 11, 0.12);
  border-radius: 12px;
  padding: 24px 20px 20px 20px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.02);
}

.ad-section-badge {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.badge-active {
  background-color: rgba(212, 168, 67, 0.15);
  color: var(--color-gold);
}

.badge-upcoming {
  background-color: rgba(44, 24, 16, 0.08);
  color: var(--color-text-sub);
}

.badge-planning {
  background-color: rgba(74, 85, 104, 0.08);
  color: #4A5568;
}

.ad-section-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-main);
  margin-top: 0;
  margin-bottom: 16px;
  border-left: 3px solid var(--color-gold);
  padding-left: 8px;
}

.product-card {
  display: flex;
  gap: 16px;
  background-color: #FDFBF7;
  border: 1px solid rgba(184, 134, 11, 0.08);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.05);
}

.main-product {
  flex-direction: column;
}

/* 圖片容器：淡色底、統一高度、contain 排版 */
.product-img-wrapper {
  width: 100%;
  height: 180px; /* 統一小卡片容器高度 */
  background-color: #FAF6ED; /* 溫暖的米金淡色底 */
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(184, 134, 11, 0.06);
}

.main-product-img-wrapper {
  height: 240px; /* 書封大卡片容器高度較高 */
}

.product-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain; /* 完整呈現圖片，不裁切任何部分 */
  display: block;
  transition: transform 0.3s ease;
}

.product-card:hover .product-img {
  transform: scale(1.03); /* 滑鼠懸停時微縮放動畫 */
}

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text-main);
  margin: 0 0 8px 0;
}

.product-desc {
  font-size: 13px;
  color: var(--color-text-sub);
  line-height: 1.6;
  margin: 0;
}

.product-status {
  font-size: 12px;
  color: var(--color-gold);
  font-weight: 700;
  margin: 0;
}

.products-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.products-grid .product-card {
  flex-direction: column;
}

.planning-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.plan-tag {
  background-color: #F7FAFC;
  border: 1px solid #E2E8F0;
  color: #4A5568;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 20px;
  transition: all 0.2s ease;
  cursor: default;
}

.plan-tag:hover {
  background-color: #FFFDF5;
  border-color: var(--color-gold);
  color: var(--color-gold);
  transform: scale(1.05);
}

/* 產品雙圖垂直堆疊樣式 */
.tag-img-wrapper {
  height: 260px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background-color: #FAF6ED;
}
.tag-img-wrapper .product-img {
  height: 110px !important;
  width: auto;
  object-fit: contain;
}

/* 勳章累計徽章樣式 */
.medal-count-badge {
  display: inline-flex;
  align-items: center;
  background-color: rgba(212, 168, 67, 0.15);
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  margin-left: 8px;
  vertical-align: middle;
}

/* 聯絡我們區塊樣式 */
.contact-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  border: 1px solid rgba(184, 134, 11, 0.08);
  box-shadow: 0 2px 8px rgba(44, 24, 16, 0.03);
}

/* 舞鶴文庫入口卡片 */
.library-card-link {
  text-decoration: none;
  display: block;
  color: inherit;
}

.library-card {
  background-color: #FAF7F2 !important;
  border: 1px solid rgba(212, 175, 55, 0.25) !important;
  border-radius: 16px !important;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.library-card-link:hover .library-card {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08) !important;
}

.library-img {
  width: 100%;
  border-radius: 8px;
  margin-top: 16px;
  display: block;
  object-fit: contain;
  height: auto;
}

.library-preface-label {
  font-size: 12px;
  color: #999999;
  margin-top: 16px;
  font-weight: 700;
}

.library-preface-content {
  font-size: 14px;
  line-height: 1.8;
  color: #333333;
  text-align: justify;
  margin-top: 6px;
}

/* ==========================================================================
   側邊滑出選單 (Drawer) 與新頁面樣式
   ========================================================================== */

/* 漢堡按鈕樣式 */
.menu-toggle-btn {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--color-gold);
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  outline: none;
  transition: opacity 0.2s ease;
}

.menu-toggle-btn:active {
  opacity: 0.7;
}

/* 側邊選單背景遮罩 */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(44, 24, 16, 0.4);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

/* 側邊滑出選單面板 */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background-color: var(--color-bg);
  box-shadow: 4px 0 20px rgba(44, 24, 16, 0.12);
  z-index: 1001;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: flex-end;
  padding: 16px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.15);
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--color-text-sub);
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.drawer-close-btn:hover {
  color: var(--color-accent);
}

.drawer-nav {
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.drawer-item {
  background: none;
  border: none;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-sub);
  text-align: left;
  padding: 16px 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-item:hover {
  background-color: rgba(184, 134, 11, 0.08);
  color: var(--color-gold);
  border-left-color: var(--color-gold);
}

.drawer-item.active {
  background-color: rgba(184, 134, 11, 0.12);
  color: var(--color-gold);
  border-left-color: var(--color-gold);
}

/* 聯絡小鶴與作文頁面專用樣式 */
.contact-card-container {
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.contact-detail-card {
  background-color: #FFFFFF;
  border: 1px solid rgba(184, 134, 11, 0.15);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.03);
}

.contact-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0 0;
}

.contact-list li {
  margin-bottom: 18px;
  line-height: 1.6;
  font-size: 15px;
  color: var(--color-text-main);
  border-bottom: 1px dashed rgba(184, 134, 11, 0.1);
  padding-bottom: 12px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
}

.contact-list li:last-child {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.contact-label {
  font-weight: 700;
  color: var(--color-text-sub);
  display: inline-block;
  min-width: 110px;
  flex-shrink: 0;
}

.contact-link {
  color: var(--color-gold);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-bottom-color 0.2s;
  word-break: break-all;
}

.contact-link:hover {
  border-bottom-color: var(--color-gold);
}

.contact-text {
  font-weight: 500;
}

/* 精選隨筆摘要樣式 */
.essay-summary {
  font-size: 14px;
  line-height: 1.8;
  color: #333333;
  text-align: justify;
  margin-top: 12px;
}

/* ==========================================
   收藏分頁籤 & 我的獎牌 樣式
   ========================================== */
.favorites-tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(184, 134, 11, 0.2);
  padding-bottom: 8px;
}

.fav-tab-btn {
  background: none;
  border: none;
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text-sub);
  padding: 8px 24px;
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.fav-tab-btn:hover {
  color: var(--color-accent);
}

.fav-tab-btn.active {
  color: var(--color-accent);
}

.fav-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--color-accent);
  border-radius: 2px 2px 0 0;
}

.medals-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 40px;
}

.medal-badge-item {
  background-color: #FFFFFF;
  border: 1px solid var(--color-gold);
  border-radius: 12px;
  padding: 20px 10px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.03);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cardFadeIn 0.3s ease-out forwards;
}

.medal-badge-icon {
  font-size: 40px;
  margin-bottom: 12px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.medal-badge-name {
  font-family: 'Noto Serif TC', serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.medal-badge-desc {
  font-size: 12px;
  color: var(--color-text-sub);
  margin-bottom: 6px;
}

.medal-badge-date {
  font-size: 10px;
  color: rgba(107, 68, 35, 0.4);
}

.empty-medals {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-sub);
  font-size: 15px;
  line-height: 1.8;
}

/* ==========================================
   小鶴拼圖 樣式
   ========================================== */
.puzzle-container {
  max-width: 500px;
  margin: 0 auto;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puzzle-selector {
  display: flex;
  width: 100%;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: 20px;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.puzzle-selector::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.puzzle-sel-btn {
  flex: 0 0 52px;
  background-color: #FFFFFF;
  border: 1px solid var(--color-gold);
  border-radius: 8px;
  padding: 8px 2px;
  font-family: 'Noto Serif TC', serif;
  color: var(--color-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  box-shadow: 0 2px 6px rgba(44, 24, 16, 0.02);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  min-height: 95px;
  box-sizing: border-box;
}

.puzzle-sel-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.puzzle-sel-btn.active {
  background-color: var(--color-accent);
  border-color: var(--color-accent);
  color: #FFFFFF;
}

.puzzle-name {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  word-break: break-all;
}

/* Dynamic Font Sizes based on name length */
.puzzle-sel-btn.len-8-up .puzzle-name {
  font-size: 9.5px;
}

.puzzle-sel-btn.len-7 .puzzle-name {
  font-size: 10.5px;
}

.puzzle-sel-btn.len-5-6 .puzzle-name {
  font-size: 12px;
}

.puzzle-badge {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-sub);
  margin-top: 2px;
  flex-shrink: 0;
}

.puzzle-sel-btn.active .puzzle-badge {
  color: rgba(255, 255, 255, 0.9);
}

.puzzle-info-card {
  width: 100%;
  background-color: #FFFFFF;
  border: 1px solid var(--color-gold);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(44, 24, 16, 0.03);
  text-align: center;
}

.puzzle-info-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.puzzle-info-progress {
  font-size: 14px;
  color: var(--color-text-sub);
  margin-bottom: 8px;
  font-weight: bold;
}

.puzzle-game-area {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.puzzle-board {
  position: relative;
  background-color: #F7F5F0;
  border: 2px solid var(--color-gold);
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 24px;
  overflow: visible; /* 允許碎片拖出 board 的邊界 */
}

.puzzle-cell {
  position: absolute;
  box-sizing: border-box;
  border: 1px dashed rgba(184, 134, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
}

.puzzle-cell.locked {
  background-color: #E2DDD5;
  color: #A8A095;
  font-weight: 700;
  font-size: 18px;
  border: 1px solid rgba(0,0,0,0.05);
}

.puzzle-cell.locked::after {
  content: '🔒';
  font-size: 14px;
  position: absolute;
  bottom: 4px;
  right: 4px;
  opacity: 0.6;
}

.puzzle-tray-title {
  font-size: 14px;
  color: var(--color-text-sub);
  margin-bottom: 8px;
  align-self: flex-start;
  font-weight: bold;
}

.puzzle-tray {
  width: 100%;
  min-height: 110px;
  background-color: rgba(184, 134, 11, 0.02);
  border: 1px dashed var(--color-gold);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  margin-bottom: 24px;
}

.puzzle-piece {
  box-sizing: border-box;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.25));
  cursor: grab;
  touch-action: none; /* 重要：防止觸控螢幕拖曳時網頁也跟著捲動 */
  user-select: none;
  background-repeat: no-repeat;
}

.puzzle-piece:active {
  cursor: grabbing;
}

.puzzle-piece.snapped {
  border: none;
  border-radius: 0;
  filter: none;
  cursor: default;
  pointer-events: none;
}

.puzzle-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.puzzle-btn {
  flex: 1;
  background-color: var(--color-text-sub);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease;
  box-shadow: 0 4px 10px rgba(107, 68, 35, 0.15);
  text-align: center;
}

.puzzle-btn:hover {
  background-color: var(--color-accent);
}

.puzzle-btn.secondary {
  background-color: #FFFFFF;
  color: var(--color-text-sub);
  border: 1px solid var(--color-text-sub);
  box-shadow: none;
}

.puzzle-btn.secondary:hover {
  background-color: rgba(107, 68, 35, 0.05);
}

/* 恭喜彈窗樣式 */
.puzzle-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.puzzle-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.puzzle-celebration-card {
  background-color: #FFFFFF;
  border-radius: 16px;
  width: 90%;
  max-width: 360px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.puzzle-overlay.show .puzzle-celebration-card {
  transform: scale(1);
}

.celebration-icon {
  font-size: 60px;
  margin-bottom: 16px;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

.celebration-title {
  font-family: 'Noto Serif TC', serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: 10px;
}

.celebration-desc {
  font-size: 15px;
  color: var(--color-text-main);
  line-height: 1.6;
  margin-bottom: 20px;
}

.celebration-medal-box {
  background-color: rgba(184, 134, 11, 0.06);
  border: 1px solid var(--color-gold);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.celebration-medal-icon {
  font-size: 32px;
}

.celebration-medal-name {
  font-family: 'Noto Serif TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-accent);
}


