:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.92);
  --text: #10213a;
  --muted: #4e5b70;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --danger: #b91c1c;
  /* Motion（Tween） */
  --motion-duration-instant: 0.01ms;
  --motion-duration-short: 0.4s;
  --motion-duration-medium: 0.6s;
  --motion-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --motion-ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overscroll-behavior: none;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
  max-height: 100dvh;
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: none;
  background-color: #00fff7;
  background-image: url("/images/landing/Landing_Background%202.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", sans-serif;
}

/* 條款頁：純白底，不載入 Landing 背景圖 */
body.terms-mode {
  background-image: none;
  background-color: #ffffff;
}

/* YT 人像：僅 landing 顯示；疊在主背景之上、漸層之下（不攔截點擊） */
body.landing-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("/images/landing/Landing_YT%201.png");
  background-position: center bottom;
  background-size: auto min(87vh, 87dvh);
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 0;
}

/* 底部漸層：僅 landing 顯示（不攔截點擊） */
body.landing-mode::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(55vh, 480px);
  background-image: url("/images/landing/Gradient.png");
  background-position: center bottom;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

body.ending-mode::before,
body.ending-mode::after {
  display: none;
}

/* 遊戲中：底層改單色，避免場景過場透出 Landing 圖（secretMessage 等獨立頁仍保留 Landing 背景） */
body.game-mode {
  background-image: none;
  background-color: #00fff7;
}

/* 防止 iOS/Safari 橡皮筋回彈造成整頁 overscroll。
   固定「主遊戲 shell（index.html）」而不是依 phase 切換，避免 iOS 在 ending <-> landing 間切換時偶發白畫面。 */
body:has(> main.app) {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.rotate-lock {
  display: none;
}

@media (orientation: landscape) and (pointer: coarse) and (max-width: 1024px) {
  .rotate-lock {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.96);
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 22px;
  }

  .rotate-lock__card {
    width: min(92vw, 420px);
    border-radius: 18px;
    padding: 18px 16px;
    background: rgba(17, 24, 39, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  }

  .rotate-lock__title {
    font-weight: 900;
    font-size: 20px;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
  }

  .rotate-lock__desc {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.92;
  }
}

.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  gap: 12px;
  overflow: hidden;
  overscroll-behavior: none;
}

/* 三個主畫面各自為捲動邊界，避免整頁（或 body 底圖）被向上/向下過捲拉出 */
.app > section:not(.hidden) {
  flex: 1 1 auto;
  align-self: stretch;
  min-height: 0;
  max-height: 100%;
  width: 100%;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.app > section#start-view:not(.hidden) {
  overflow-x: hidden;
  overflow-y: auto;
}

.app > section#game-view.game:not(.hidden) {
  overflow: hidden;
}

.app > section#ending-view.result-page:not(.hidden) {
  overflow-x: hidden;
  overflow-y: auto;
}

body.landing-mode .app {
  padding: 16px;
  justify-content: flex-start;
  align-items: center;
}

/* Mobile-first fullscreen game (web app style). Keep desktop card layout. */
@media (max-width: 480px) {
  .app {
    min-height: 100dvh;
    padding: 0;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
  }

  body.landing-mode .app {
    padding: 0;
  }

  .game {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

.panel {
  width: min(92vw, 480px);
  margin-left: auto;
  margin-right: auto;
  background: var(--panel);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.subtitle {
  margin: 0 0 14px;
  color: var(--muted);
}

.form {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 10px;
  font-size: 16px;
  background: #fff;
}

.btn {
  border: 0;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 16px;
  cursor: pointer;
  background: #e2e8f0;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.game {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border-radius: 0;
  overflow: hidden;
  overscroll-behavior: none;
  box-shadow: none;
}

.scene-bg {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #00fff7;
  ;
  overflow: hidden;
}

.scene-bg-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: none;
  transition: opacity var(--motion-duration-medium) var(--motion-ease-in-out);
}

.scene-bg-layer.scene-bg-layer--active {
  z-index: 1;
  opacity: 1;
}

.scene-bg-layer.scene-bg-layer--hidden {
  z-index: 0;
  opacity: 0;
}

.scene-bg-layer.scene-bg-layer--incoming {
  z-index: 2;
  opacity: 1;
}

.scene-bg-layer.scene-bg-layer--incoming.scene-bg-layer--incoming-prep {
  opacity: 0;
}

/* .overlay {
  display: none;  
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 33, 58, 0.12) 0%, rgba(16, 33, 58, 0.55) 100%);
} */

.scene-content {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0;
}

.finance-index {
  position: absolute;
  left: 6px;
  top: 14px;
  width: 18vw;
  max-width: 120px;
  z-index: 3;
  pointer-events: none;
}

.trendytoo-logo {
  position: absolute;
  right: 2px;
  top: 12px;
  width: 23vw;
  /* max-width: 120px; */
  z-index: 3;
  pointer-events: none;
}

.trendytoo-logo-img {
  width: 100%;
  height: auto;
  display: block;
}

.finance-index-img {
  width: 100%;
  height: auto;
  display: block;
}

.finance-index-score {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  width: 70%;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1;
}

.finance-index-score .digit-img {
  height: 32px;
  width: auto;
  display: block;
}

.turn-progress {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 55vw;
  max-width: 456px;
  top: 14px;
  display: grid;
  gap: 10px;
  justify-items: center;
  z-index: 2;
  pointer-events: none;
}

.turn-progress-bar {
  width: 100%;
  height: 46px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(90deg, rgba(251, 88, 158, 1) 0%, rgba(90, 196, 189, 1) 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  padding: 8px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.turn-progress-seg {
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(235, 235, 235, 0.85);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.turn-progress-seg.is-filled {
  border-color: rgba(255, 255, 255, 0.95);
  background: transparent;
}

.turn-progress-text {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.dialogue-box {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  width: min(95vw, 543px);
  aspect-ratio: 543 / 179;
  background: transparent;
  background-image: url("/images/Game/messageBubble.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  color: rgba(91, 55, 33, 1);
}
/* =========================================
   對話內容列：佔滿安全區，內容完美置中
   ========================================= */
   .dialogue-row {
    position: absolute;
    /* 透過百分比把上下左右定死，與背景圖的空間完全脫鉤 */
    top: 3%;    /* 完美避開右上角的箭咀 */
    bottom: 8%;  /* 避開底部的圓弧 */
    left: 2%;    /* 避開左側圓弧 */
    right: 5%;   /* 避開右側圓弧 */
    display: flex;
    align-items: center;
    gap: 12px;
  }

/* =========================================
   頭像：永遠保持 75% 高度，不出界且不變形
   ========================================= */
   .dialogue-avatar {
    height: 100%; /* 因為安全區已經精準劃出，這裡可以放心設定到 90% */
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 1);
    border: 3px solid rgba(255, 255, 255, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    flex-shrink: 0; /* ⚠️ 關鍵：嚴格禁止 Flexbox 在空間不夠時把頭像壓扁 */
  }

.dialogue-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* =========================================
   文字區：限制範圍，文字過長時自動滾動不出界
   ========================================= */
.dialogue-main {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* 讓對話文字整體置中 */
  position: relative; /* 供下方的指示小箭頭定位使用 */
}

.speaker {
  margin: 6px 0px 1px 0px;
  color: #166534;
  font-weight: 700;
  font-size: clamp(12px, 3.5vw, 16px); /* RWD：字型隨裝置縮放 */
  flex-shrink: 0;
}
.dialogue {
  margin: 0;
  line-height: 1.45;
  font-size: clamp(14px, 4vw, 16px);
  white-space: pre-wrap;
  flex: 1;
  min-height: 0;
  
  /* 【關鍵修改】把 overflow-y: auto 拿掉，改成 visible 允許溢出 */
  overflow: visible; 
  
  /* 預留右下角絕對定位的 dialogue-hint（26px） */
  padding-right: 30px;
}

.dialogue::-webkit-scrollbar {
  display: none;
}

/* =========================================
   對話指示小箭頭 (▼)
   ========================================= */
.dialogue-hint {
  position: absolute;
  right: 15%;
  bottom: 0; /* 鎖在 .dialogue-main（氣泡內文區）右下角，不受對話長度影響 */
  z-index: 2;
  margin: 0;
  width: 26px;
  height: 18px;
  background-image: url("/images/Game/Polygon.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  font-size: 0;
  line-height: 0;
  color: transparent;
  animation: hintBounce 1.5s ease-in-out infinite;
  pointer-events: none;
}

/* =========================================
   無說話者模式 (旁白) 覆寫
   ========================================= */
.dialogue-box.is-no-speaker .speaker,
.dialogue-box.is-no-speaker .dialogue-avatar {
  display: none;
}

.dialogue-box.is-no-speaker .dialogue-row {
  display: flex; /* 取消原來的 display: contents */
  gap: 0;
}

.dialogue-box.is-no-speaker .dialogue-main {
  padding-left: 42px;
  padding-right: 12px;
}

/* 無講者時不要讓 .dialogue 撐滿整欄，否則文字會貼頂；改為依內容高度並由父層 flex 垂直置中 */
.dialogue-box.is-no-speaker .dialogue {
  flex: 0 1 auto;
  overflow-y: auto;
}

.speaker {
  margin: 6px 0 1px;
  color: #166534;
  font-weight: 700;
}

.choices {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 85%;
  justify-content: center;
  align-content: start;
  gap: 10px;
  /* padding: clamp(18px, 8vh, 92px) 0 0; */
  padding-top: 18vh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 3;
}

.choice-prompt-box {
  position: relative;
  width: 100%;
  aspect-ratio: 543 / 179;
  background: transparent;
  background-image: url("/images/Game/messageBubble.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  color: rgba(91, 55, 33, 1);
}

/* 對話框同款：旁白模式（不顯示頭像與 speaker） */
.choice-prompt-box.is-no-speaker .speaker,
.choice-prompt-box.is-no-speaker .dialogue-avatar {
  display: none;
}

.choice-prompt-box.is-no-speaker .dialogue-row {
  display: flex;
  gap: 0;
}

.choice-prompt-box.is-no-speaker .dialogue-main {
  padding-left: 42px;
  padding-right: 12px;
}

.choice-prompt-box.is-no-speaker .dialogue {
  flex: 0 1 auto;
  overflow-y: auto;
}

.choice-btn {
  border: 2px solid transparent;
  border-radius: 12px;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.96)),
    linear-gradient(
      90deg,
      rgba(23, 205, 255, 0.996) 0%,
      rgb(255, 0, 217) 100%
    );
  background-origin: border-box;
  background-clip: padding-box, border-box;
  color: #1f2937;
  font-size: 17px;
  font-weight: 700;
  min-height: 58px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

.choice-btn:hover:enabled {
  background-image:
    linear-gradient(#fff, #fff),
    linear-gradient(
      90deg,
      rgba(255, 243, 23, 0.996) 0%,
      rgb(255, 149, 0) 100%
    );
}

.choice-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dialogue-log-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 6;
  pointer-events: auto;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.dialogue-log-btn:hover {
  filter: brightness(1.05);
}

.dialogue-log-btn-img {
  width: 56px;
  height: auto;
  display: block;
}

.dialogue-log-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.dialogue-log-panel:not(.hidden) {
  pointer-events: auto;
}

.dialogue-log-backdrop {
  flex: 1;
  min-height: 0;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  cursor: pointer;
}

.dialogue-log-sheet {
  flex-shrink: 0;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 14px 14px 0 0;
  box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.dialogue-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #dbe3ef;
  flex-shrink: 0;
}

.dialogue-log-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.dialogue-log-close {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 8px;
}

.dialogue-log-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

.dialogue-log-body {
  overflow-y: auto;
  padding: 12px 14px 16px;
  flex: 1;
  min-height: 0;
  font-size: 14px;
  line-height: 1.45;
}

.dialogue-log-entry {
  margin-bottom: 12px;
}

.dialogue-log-entry:last-child {
  margin-bottom: 0;
}

.dialogue-log-entry-scene {
  font-weight: 800;
  color: var(--primary);
  padding-bottom: 4px;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 10px;
}

.dialogue-log-entry-line .dialogue-log-speaker {
  font-weight: 700;
  color: #69C4C0;
  margin-bottom: 2px;
}

.dialogue-log-entry-line .dialogue-log-text {
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.dialogue-log-entry-choice {
  font-weight: 700;
  color: #EB4F95;
}

.error {
  width: min(92vw, 480px);
  margin: 0;
  font-size: 14px;
  text-align: center;
}

.error {
  color: #fecaca;
}

.ending-image {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
  margin: 10px 0 10px;
}

/* 結果頁（結局）：參考 Frame 4，全幅漸層 + 區塊圖垂直排列 */
.app > #ending-view.result-page {
  align-self: stretch;
  width: 100%;
  max-width: 100%;
}

.result-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-height: 100%;
  /* background: linear-gradient(
    180deg,
    #1a9e9a 0%,
    #3b82c4 35%,
    #8b5cf6 65%,
    #ec4899 100%
  ); */
  box-shadow: none;
  border-radius: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.result-page__inner {
  width: min(100%, 520px);
  margin: 0 auto;
  padding: clamp(12px, 3.5vw, 20px) clamp(12px, 4vw, 20px) clamp(20px, 5vw, 32px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 3vw, 20px);
}

.result-page__top {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.result-page__title-img {
  max-width: 58%;
  width: auto;
  height: auto;
  display: block;
  flex-shrink: 1;
}

.result-page__logo-img {
  max-width: 32%;
  width: auto;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.result-page__stack {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 2.5vw, 16px);
}

.result-page__block-img {
  width: 100%;
  height: auto;
  display: block;
}

.result-page__ig-link {
  display: block;
  width: 100%;
}

.result-page__block-link {
  display: block;
  width: 100%;
}

/* Result_congratz：底圖上的「理財經驗值」後方顯示 xx/20（位置可依設計稿微調 %） */
.result-page__congratz {
  position: relative;
  width: 100%;
}

.result-page__congratz-bg {
  width: 100%;
  height: auto;
  display: block;
}

.result-page__congratz-score {
  position: absolute;
  left: 35%;
  top: 78%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.98);
  font-weight: 800;
  font-size: clamp(13px, 4.8vw, 17px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-shadow:
    0 3px 17px rgba(0, 0, 0, 0.85),
    0 0 10px rgba(0, 0, 0, 1);
  white-space: nowrap;
  pointer-events: none;
}

.result-page__message {
  position: relative;
  width: 100%;
}

.result-page__message-bg {
  width: 100%;
  height: auto;
  display: block;
}

.result-page__message-body {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 25%;
  bottom: 7%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  overflow: hidden;
  pointer-events: auto;
}

.result-page__ending-text {
  margin: 0;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  color: rgba(255, 255, 255, 0.98);
  font-size: clamp(13px, 3.6vw, 16px);
  line-height: 1.5;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  white-space: pre-wrap;
  word-break: break-word;
}

.result-page__footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: stretch;
  gap: clamp(8px, 2vw, 14px);
}

.result-page__action-btn {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  display: block;
}

.result-page__action-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.result-page__action-link {
  flex: 1;
  min-width: 0;
  display: block;
  line-height: 0;
}

.result-page__action-link img {
  width: 100%;
  height: auto;
  display: block;
}

.result-page__tnc {
  display: flex;
  justify-content: center;
  align-items: center;
}

.result-page__tnc-link {
  display: inline-block;
  line-height: 0;
  max-width: min(100%, 360px);
}

.result-page__tnc-link img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.hidden {
  display: none !important;
}

.greetings-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(92vw, 520px);
  z-index: 9999;
  background: rgba(255, 255, 255, 1);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 14px 44px 14px 14px;
  backdrop-filter: blur(8px);
  color: var(--text);
}

.greetings-toast.is-entering {
  animation: greetingsSlideDown 1000ms ease-out both;
}

.greetings-toast.is-leaving {
  animation: greetingsSlideUp 520ms ease-in both;
}

.greetings-toast-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: pre-wrap;
}

.greetings-toast-title {
  font-size: 16px;
  font-weight: 900;
}

.greetings-toast-message {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  white-space: pre-wrap;
}

.greetings-toast-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.greetings-toast-close img {
  display: block;
  width: 22px;
  height: 22px;
  opacity: 0.9;
}

.greetings-toast-close:hover img {
  opacity: 1;
}

@keyframes greetingsSlideDown {
  from {
    transform: translate(-50%, -12px);
    opacity: 0;
  }
  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes greetingsSlideUp {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }
  to {
    transform: translate(-50%, -12px);
    opacity: 0;
  }
}

@keyframes hintBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(3px);
  }
}

/* ========== Motion UI（進場／Tween） ========== */
@keyframes motionLandingIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes motionLandingAnchorIn {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(8px);
  }
}

@keyframes motionChoicePromptIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

@keyframes dialogueBoxPop {
  from {
    opacity: 0.88;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

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

@keyframes dialogueLineTick {
  from {
    opacity: 0.45;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes motionSheetUp {
  from {
    opacity: 0.92;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#choices.choices--enter > .choice-prompt-box:not(.hidden) {
  animation: motionChoicePromptIn var(--motion-duration-medium) var(--motion-ease-out) both;
}

#choices.choices--enter > button.choice-btn {
  animation: motionChoiceBtnIn var(--motion-duration-medium) var(--motion-ease-out) both;
}

#choices.choices--enter > button.choice-btn:nth-of-type(1) {
  animation-delay: 0.08s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(2) {
  animation-delay: 0.16s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(3) {
  animation-delay: 0.24s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(4) {
  animation-delay: 0.32s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(5) {
  animation-delay: 0.4s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(6) {
  animation-delay: 0.48s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(7) {
  animation-delay: 0.56s;
}
#choices.choices--enter > button.choice-btn:nth-of-type(8) {
  animation-delay: 0.64s;
}

.dialogue-box.dialogue-box--pop {
  animation: dialogueBoxPop var(--motion-duration-medium) var(--motion-ease-out) both;
}

.dialogue.dialogue-line--tick {
  animation: dialogueLineTick var(--motion-duration-short) var(--motion-ease-out) both;
}

.dialogue-log-panel.dialogue-log-panel--open .dialogue-log-sheet {
  animation: motionSheetUp var(--motion-duration-medium) var(--motion-ease-out) both;
}

#ending-view.ending--enter .result-page__inner {
  animation: endingFadeUp var(--motion-duration-medium) var(--motion-ease-out) both;
}

#ending-view.ending--enter .result-page__top {
  animation: endingFadeUp var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.12s;
}

#ending-view.ending--enter .result-page__stack {
  animation: endingFadeUp var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.28s;
}

#ending-view.ending--enter .result-page__footer {
  animation: endingFadeUp var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.44s;
}

#ending-view.ending--enter .result-page__tnc {
  animation: endingFadeUp var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.56s;
}

/* Landing page */
body.landing-mode {
  color: #10213a;
}

#start-view.panel {
  background-color: rgba(255, 255, 255, 0);
  box-shadow: none;
  border-radius: 0;
  padding: 28px 18px 22px;
  text-align: center;
}

/* Landing：主區佔滿可視高度，底部區塊貼底 */
body.landing-mode #start-view.panel:has(#landing-screen:not(.hidden)) {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  max-width: min(92vw, 480px);
  overscroll-behavior: none;
}

/* 填資料：全版固定層（等同整頁切換，不依賴 main  flex 高度） */
body.landing-mode #start-view.panel.start-view--profile,
body.landing-mode #start-view.panel:has(#start-form:not(.hidden)) {
  position: fixed;
  inset: 0;
  z-index: 5;
  flex: none;
  width: 100%;
  max-width: none;
  margin: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  overflow-x: hidden;
  overscroll-behavior: none;
  box-sizing: border-box;
  border-radius: 0;
  padding: calc(12px + env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px))
    calc(12px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  background: transparent;
  text-align: center;
}

html.landing-profile-active,
body.landing-profile-active {
  overflow: hidden;
}

/* 填資料畫面不需要 landing 的人像/漸層疊圖 */
html.landing-profile-active body::before,
html.landing-profile-active body::after {
  content: none;
}

/* 必須用 :not(.hidden)，否則 #id 的 display 會蓋過 .hidden 的 display:none */
#landing-screen:not(.hidden) {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.landing-bottom-anchor {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 12px;
  /* 貼近畫面下緣；可調大數值讓整組再往下（較貼底） */
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
  transform: translateY(8px);
}

.landing-hero-title-img {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 4px auto 10px;
}

#landing-screen:not(.hidden) .landing-hero-title-img {
  animation: motionLandingIn var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.12s;
}

#landing-screen:not(.hidden) .landing-right-block {
  animation: motionLandingIn var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.28s;
}

#landing-screen:not(.hidden) .landing-bottom-anchor {
  animation: motionLandingAnchorIn var(--motion-duration-medium) var(--motion-ease-out) both;
  animation-delay: 0.44s;
}

.landing-right-block {
  width: min(100%, 420px);
  margin: 0 auto 14px;
  padding-right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

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

/* 名稱圖：約為視窗寬度 15%，不超出右欄 */
.landing-yt-name-img {
  width: 20vw;
  max-width: 100%;
  height: auto;
}

/* 優惠圖：寬度不超過視窗一半，且不超出右欄容器 */
.landing-promo-img {
  max-width: min(100%, 45vw);
}

.landing-howto-img {
  display: block;
  width: min(100%, 420px);
  height: auto;
  margin: 0 auto;
}

/* 同上：避免 .landing-actions 晚於 .hidden 載入而蓋掉 display:none */
#landing-actions:not(.hidden),
.landing-actions:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 0;
}

.landing-btn {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.landing-btn-primary {
  border: 1px solid #0b1020;
  background: #0b1020;
  color: #ffffff;
}

.landing-btn-primary:hover {
  background: #111a33;
}

.landing-btn-secondary {
  border: 1px solid rgba(15, 23, 42, 0.16);
  background: #ffffff;
  color: #0b1020;
}

.landing-btn-secondary:hover {
  background: #f8fafc;
}

.landing-btn.landing-btn-graphic {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  height: auto;
  min-height: 0;
  transition: transform var(--motion-duration-short) var(--motion-ease-out);
}

.landing-btn.landing-btn-graphic:active {
  transform: scale(0.98);
}

.landing-btn.landing-btn-graphic:hover {
  opacity: 0.94;
  background: transparent;
}

.landing-btn.landing-btn-secondary.landing-btn-graphic:hover {
  background: transparent;
}

.landing-btn.landing-btn-graphic:focus-visible {
  outline: 2px solid #0b1020;
  outline-offset: 4px;
}

.landing-btn-img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

.landing-footer-link {
  display: inline-block;
  margin-top: 18px;
  font-size: 14px;
  color: #0b1020;
  text-decoration: underline;
  opacity: 0.75;
}

/* Profile form (after "開始對話") */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.infoform {
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.infoform-panel {
  position: relative;
  width: 95%;
  max-width: 520px;
  height: min(92dvh, 980px);
  max-height: 92dvh;
  margin: 0 auto;
  background-image: url("/images/InfoForm/Panel.png");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  padding: 18px 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  box-sizing: border-box;
  touch-action: pan-y;
}

.infoform-header {
  position: relative;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.infoform-back-btn {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.infoform-back-btn img {
  width: 36px;
  height: 36px;
  display: block;
}

.infoform-title-img {
  width: min(100%, 360px);
  height: auto;
  display: block;
  margin: 8px auto 0;
}

.infoform-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.infoform-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.infoform-label-img {
  width: 120px;
  max-width: 45%;
  height: auto;
  display: block;
}

.infoform-textfield {
  position: relative;
  width: 100%;
  display: block;
}

.infoform-textfield-bg {
  width: 100%;
  height: auto;
  display: block;
}

.infoform-textfield input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  padding: 0 18px;
}

#nickname {
  color: rgba(255, 255, 255, 1);
}

.infoform-textfield input::placeholder {
  color: rgba(17, 24, 39, 0.35);
  font-weight: 800;
}

.infoform-gender {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.infoform-gender-option {
  position: relative;
  display: block;
  cursor: pointer;
  user-select: none;
}

.infoform-gender-option input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.infoform-gender-img {
  width: 100%;
  height: auto;
  display: block;
}

.infoform-dropdown {
  position: relative;
  width: 100%;
}

.infoform-dropdown-bg {
  width: 100%;
  height: auto;
  display: block;
}

.infoform-dropdown-text {
  position: absolute;
  left: 18px;
  right: 56px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 900;
  color: rgba(17, 24, 39, 0.8);
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.infoform-dropdown[data-state='selected'] .infoform-dropdown-text {
  color: rgba(255, 255, 255, 1);
}

.infoform-dropdown select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.infoform-submit-bar {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding-top: 4px;
  padding-bottom: 6px;
}

.infoform-submit-btn {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  width: min(100%, 420px);
  display: block;
}

.infoform-submit-btn img {
  width: 100%;
  height: auto;
  display: block;
}

.infoform-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.profile-form {
  width: min(95vw, 420px);
  max-width: 420px;
  margin: 18px auto 0;
  text-align: left;
  padding-bottom: 88px;
  box-sizing: border-box;
}

body.landing-mode #start-view.panel:has(#start-form:not(.hidden)) #start-form.profile-form,
body.landing-mode #start-view.panel.start-view--profile #start-form.profile-form {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.landing-mode #start-view.panel:has(#start-form:not(.hidden)) #start-form.infoform,
body.landing-mode #start-view.panel.start-view--profile #start-form.infoform {
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-header {
  position: relative;
  padding: 10px 0 14px;
}

.profile-back-btn {
  position: absolute;
  left: 0;
  top: 6px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #ffffff;
  color: #0b1020;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.profile-back-btn:hover {
  background: #f8fafc;
}

.profile-title {
  margin: 0;
  padding-left: 44px;
  padding-right: 10px;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  line-height: 1.25;
}

.profile-subtitle {
  margin: 8px 0 0;
  padding-left: 44px;
  padding-right: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
  line-height: 1.5;
}

.profile-section {
  margin-top: 14px;
}

.profile-section-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 900;
  color: #0b1020;
}

.profile-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.profile-field input {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
}

.profile-field select {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  outline: none;
  background: #ffffff;
}

.profile-field input:focus {
  border-color: rgba(29, 78, 216, 0.6);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

.profile-field select:focus {
  border-color: rgba(29, 78, 216, 0.6);
  box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
}

.choice-group {
  display: grid;
  gap: 10px;
}

.choice-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: #ffffff;
  padding: 12px 12px;
  cursor: pointer;
  user-select: none;
}

.choice-pill input {
  width: 16px;
  height: 16px;
  accent-color: #0b1020;
}

.choice-pill span {
  font-size: 16px;
  font-weight: 800;
  color: #111827;
}

.choice-pill:has(input:checked) {
  border-color: rgba(11, 16, 32, 0.85);
  box-shadow: 0 0 0 4px rgba(11, 16, 32, 0.08);
}

.profile-submit-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(95vw, 480px);
  padding: 14px 18px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-sizing: border-box;
}

.profile-terms {
  width: 100%;
  max-width: 420px;
  margin: 14px auto 0;
}

.profile-terms-box {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: #ffffff;
  padding: 16px 14px;
  cursor: pointer;
  user-select: none;
}

.profile-terms-box input {
  width: 22px;
  height: 22px;
  accent-color: #0b1020;
}

.profile-terms-text {
  font-size: 18px;
  font-weight: 900;
  color: #0b1020;
  line-height: 1.2;
}

.profile-terms-link {
  color: #0b1020;
  text-decoration: underline;
}

.profile-terms-link:hover {
  opacity: 0.85;
}

.profile-submit-btn {
  width: 100%;
  height: 56px;
  border: 1px solid #0b1020;
  border-radius: 12px;
  background: #0b1020;
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.profile-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.profile-submit-btn:hover:enabled {
  background: #111a33;
}

@media (min-width: 900px) {
  .app {
    padding: 20px;
  }
}

/* Secret message page */
.secret-message-mode {
  overflow: hidden;
}

.secret-message-page {
  width: min(92vw, 520px);
  margin: 0 auto;
  height: 100dvh;
  max-height: 100dvh;
  padding: 18px 0 26px;
  overflow-y: auto;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

.secret-message-header {
  position: relative;
  padding: 8px 0 10px;
  text-align: center;
}

.secret-message-back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.secret-message-back-btn:hover {
  filter: brightness(1.05);
}

.secret-message-back-img {
  width: 40px;
  height: 40px;
  display: block;
}

.secret-message-title-img {
  width: clamp(160px, 35vw, 320px);
  height: auto;
  display: block;
  margin: 0 auto;
  /* filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.42)); */
}

.secret-message-intro {
  margin-top: 10px;
  text-align: center;
  padding: 0 4px;
}

.secret-message-intro-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  /* filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.40)); */
}

.secret-message-form {
  margin-top: 14px;
  padding-bottom: 8px;
}

.secret-message-textarea-shell {
  width: 100%;
  aspect-ratio: 949 / 258;
  background-image: url("/images/SecretMessage/textarea.png");
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  /* filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35)); */
  position: relative;
}

.secret-message-textarea {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
  font-size: 17px;
  line-height: 1.65;
  color: #111827;
  font-family: inherit;
  padding: 35px 18px;
}

#secret-message {
  height: 182px;
}

.secret-message-textarea::placeholder {
  color: #9ca3af;
  font-weight: 700;
}

.secret-message-status {
  margin: 10px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

.secret-message-error {
  margin: 10px 0 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 900;
  font-size: 14px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
}

.secret-message-card-actions {
  margin-top: 12px;
}

.secret-message-submit-btn {
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.secret-message-submit-btn:hover:enabled {
  filter: brightness(1.04);
}

.secret-message-submit-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.secret-message-submit-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
}

.secret-message-note {
  margin-top: 14px;
}

.secret-message-note-img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  /* filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.35)); */
}

/* Terms and conditions page */
.terms-page {
  width: min(92vw, 480px);
  margin: 0 auto;
  padding: 8px 0 22px;
}

.terms-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 10px 0 10px;
  background: #ffffff;
  border: 0px;
  border-bottom: 0px;
  border-style: none;
  border-image: none;
  text-align: center;
}

.terms-back-btn {
  position: absolute;
  left: 0;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #ffffff;
  color: #0b1020;
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.terms-back-btn:hover {
  background: #f8fafc;
}

.terms-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
}

.terms-card {
  margin: 14px auto 0;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  padding: 16px 16px;
}

.terms-card-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  color: #111827;
  line-height: 1.25;
}

.terms-updated {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
  color: #6b7280;
}

.terms-scroll {
  margin-top: 14px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 6px;
}

.terms-section-title {
  margin: 16px 0 8px;
  font-size: 18px;
  font-weight: 900;
  color: #111827;
}

.terms-paragraph {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  color: #374151;
  line-height: 1.75;
}

/* 減少動態效果（無障礙） */
@media (prefers-reduced-motion: reduce) {
  :root {
    --motion-duration-short: var(--motion-duration-instant);
    --motion-duration-medium: var(--motion-duration-instant);
  }

  #landing-screen:not(.hidden) .landing-hero-title-img,
  #landing-screen:not(.hidden) .landing-right-block,
  #landing-screen:not(.hidden) .landing-bottom-anchor {
    animation: none !important;
    opacity: 1 !important;
  }

  #landing-screen:not(.hidden) .landing-hero-title-img,
  #landing-screen:not(.hidden) .landing-right-block {
    transform: none !important;
  }

  #landing-screen:not(.hidden) .landing-bottom-anchor {
    transform: translateY(8px) !important;
  }

  .landing-btn.landing-btn-graphic {
    transition: none;
  }

  .landing-btn.landing-btn-graphic:active {
    transform: none;
  }

  #choices.choices--enter > .choice-prompt-box:not(.hidden),
  #choices.choices--enter > button.choice-btn {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .dialogue-box.dialogue-box--pop,
  .dialogue.dialogue-line--tick,
  .dialogue-log-panel.dialogue-log-panel--open .dialogue-log-sheet {
    animation: none !important;
  }

  .scene-bg-layer {
    transition: none !important;
  }

  .greetings-toast.is-entering {
    animation: none !important;
  }

  .greetings-toast.is-leaving {
    animation: none !important;
  }

  .dialogue-hint {
    animation: none !important;
  }

  #ending-view.ending--enter .result-page__inner,
  #ending-view.ending--enter .result-page__top,
  #ending-view.ending--enter .result-page__stack,
  #ending-view.ending--enter .result-page__footer,
  #ending-view.ending--enter .result-page__tnc {
    animation: none !important;
  }
}
