/* 詞語尋寶王：藏寶島、海圖紙張、羅盤與寶箱的視覺主題。 */
:root {
  --bg: #f7efdb;
  --bg-2: #e9d8b4;
  --ink: #07293b;
  --muted: #4d6a73;
  --accent: #f4b942;
  --accent-2: #2ec4b6;
  --accent-3: #ff6b57;
  --good: #1f9d6b;
  --bad: #d64a3b;
  --card: #fffaf0;
  --line: #07293b;
  --line-soft: rgba(7, 41, 59, 0.16);
  --shadow: 0 8px 0 rgba(7, 41, 59, 0.14), 0 20px 40px rgba(7, 41, 59, 0.16);
  --shadow-sm: 0 4px 0 rgba(7, 41, 59, 0.18);
  --parchment: linear-gradient(180deg, #fffaf0 0%, #f6e7c5 100%);
  --treasure-grain:
    repeating-linear-gradient(0deg, rgba(7, 41, 59, 0.035) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(7, 41, 59, 0.035) 0 1px, transparent 1px 28px);
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 8% 0%, rgba(46, 196, 182, 0.28) 0, transparent 32%),
    radial-gradient(circle at 92% 6%, rgba(244, 185, 66, 0.4) 0, transparent 34%),
    radial-gradient(circle at 48% 108%, rgba(255, 107, 87, 0.2) 0, transparent 44%),
    var(--treasure-grain),
    radial-gradient(rgba(7, 41, 59, 0.08) 1px, transparent 1px);
  background-size: auto, auto, auto, auto, 22px 22px;
}

::selection {
  background: color-mix(in srgb, var(--accent) 55%, white);
  color: var(--ink);
}

/* ---------- 船長羅盤頂欄 ---------- */
.topbar {
  background:
    radial-gradient(circle at 16% 10%, rgba(46, 196, 182, 0.32), transparent 38%),
    linear-gradient(180deg, #07293b 0%, #0a374a 68%, #0d4457 100%);
  border-bottom: 3px solid var(--accent);
  box-shadow: 0 8px 22px rgba(7, 41, 59, 0.34);
}

.topbar .brand-name {
  color: #fff7e3;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}

.topbar .brand-dot {
  background:
    conic-gradient(from 45deg, var(--accent) 0 12.5%, #0d4457 12.5% 25%, var(--accent-3) 25% 37.5%, #0d4457 37.5% 50%, var(--accent) 50% 62.5%, #0d4457 62.5% 75%, var(--accent-3) 75% 87.5%, #0d4457 87.5% 100%);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244, 185, 66, 0.22);
}

.topbar .icon-btn {
  background: #fff7e3;
  border-color: #04202e;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
}

.topbar .icon-btn:hover {
  background: color-mix(in srgb, var(--accent-3) 28%, #fff7e3);
}

/* ---------- 首頁藏寶圖 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  padding: clamp(18px, 3.2vw, 34px) clamp(14px, 3vw, 30px);
  border: 3px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(100deg, rgba(255, 250, 240, 0.97) 0 36%, rgba(255, 250, 240, 0.8) 58%, rgba(255, 250, 240, 0.16) 100%),
    url("../assets/img/hero.webp") center / cover no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: -1;
  border: 2px dashed rgba(7, 41, 59, 0.24);
  border-radius: 22px;
  pointer-events: none;
}

.hero::after {
  content: "✦";
  position: absolute;
  top: 16px;
  right: 22px;
  color: var(--accent);
  font-size: clamp(26px, 4vw, 40px);
  text-shadow: 0 2px 0 var(--line);
  opacity: 0.9;
  pointer-events: none;
}

.hero-title {
  color: var(--ink);
  text-shadow: 0 2px 0 #fffdf6, 0 5px 0 rgba(244, 185, 66, 0.6);
}

.hero-title::after {
  content: "";
  display: block;
  width: min(240px, 70%);
  height: 9px;
  margin-top: 12px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  box-shadow: 0 3px 0 rgba(7, 41, 59, 0.16);
}

.hero-desc {
  max-width: 34em;
  padding: 10px 14px;
  border-left: 5px solid var(--accent-2);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 250, 240, 0.78);
  color: #224a58;
}

.hero-blob {
  border: 3px solid var(--line);
  border-radius: 46% 54% 58% 42% / 52% 44% 56% 48%;
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.8) 0, transparent 36%),
    linear-gradient(150deg, rgba(46, 196, 182, 0.55), rgba(244, 185, 66, 0.72));
  box-shadow: inset 0 0 0 8px rgba(255, 250, 240, 0.36), var(--shadow);
}

.hero-art img {
  filter: drop-shadow(0 18px 20px rgba(7, 41, 59, 0.26));
}

.hero-sticker {
  border-color: var(--line);
  background: linear-gradient(180deg, #ffe7a3, var(--accent));
  box-shadow: 0 5px 0 rgba(7, 41, 59, 0.22);
  color: var(--ink);
  transform: rotate(-5deg);
}

.eyebrow {
  color: #0f7a72;
  letter-spacing: 0.2em;
}

/* ---------- 地圖紙張卡片 ---------- */
.card,
.howto,
.question-host,
.result-card,
.dialog-panel {
  background: var(--parchment);
  border-color: var(--line);
  box-shadow:
    inset 0 0 0 6px rgba(244, 185, 66, 0.16),
    var(--shadow);
}

.howto {
  position: relative;
  border-style: dashed;
  border-width: 3px;
}

.howto::after {
  content: "✦";
  position: absolute;
  right: clamp(14px, 3vw, 26px);
  bottom: clamp(8px, 2vw, 18px);
  color: var(--accent);
  font-size: 30px;
  text-shadow: 0 2px 0 var(--line);
  opacity: 0.6;
  pointer-events: none;
}

.howto-list li::marker {
  color: var(--accent-3);
  font-weight: 900;
}

/* ---------- 按鈕與金幣 ---------- */
.btn {
  border-color: var(--line);
  background: var(--card);
  box-shadow: 0 5px 0 var(--line);
  color: var(--ink);
}

.btn-primary {
  background: linear-gradient(180deg, #ffd978, var(--accent));
  color: #2a1c00;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-soft {
  background: color-mix(in srgb, var(--accent-2) 22%, var(--card));
}

.btn-danger {
  background: color-mix(in srgb, var(--bad) 16%, var(--card));
  color: #8f1f14;
}

.btn-link {
  color: var(--muted);
}

/* ---------- 關卡選單：寶箱卡 ---------- */
.level-grid {
  perspective: 900px;
}

.level-card {
  border-radius: 18px 18px 24px 24px;
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(243, 226, 189, 0.98)),
    var(--treasure-grain);
  box-shadow:
    inset 0 -9px 0 rgba(7, 41, 59, 0.08),
    var(--shadow-sm);
  overflow: hidden;
}

.level-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 16%;
  right: 16%;
  height: 9px;
  border: 2px solid var(--line);
  border-top: 0;
  border-radius: 0 0 9px 9px;
  background: linear-gradient(90deg, #d79d24, #ffe08a 45%, #d79d24);
}

.level-card::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--accent-2);
  transform: translateX(-50%);
  box-shadow: 0 2px 0 rgba(7, 41, 59, 0.2);
}

.level-card:not(:disabled):hover {
  transform: translateY(-4px) rotate(-0.5deg);
  box-shadow: inset 0 -9px 0 rgba(7, 41, 59, 0.08), 0 9px 0 rgba(7, 41, 59, 0.16);
}

.level-card[data-current="true"] {
  background:
    linear-gradient(180deg, #fff4d2, #ffe3a1),
    var(--treasure-grain);
  outline: 3px solid var(--accent-3);
  outline-offset: -6px;
}

.level-num {
  width: 44px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, #0d4457, var(--ink));
  color: var(--accent);
  border-color: var(--accent);
  letter-spacing: 0.04em;
}

.level-name {
  color: var(--ink);
}

.level-stars .on {
  color: #e9a400;
  filter: drop-shadow(0 1px 0 var(--line));
}

.level-lock {
  filter: drop-shadow(0 2px 0 rgba(7, 41, 59, 0.2));
}

.levels-foot {
  padding: 10px 16px;
  border: 2px dashed rgba(7, 41, 59, 0.25);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.7);
}

/* ---------- 遊戲進行中 ---------- */
.play-kicker {
  color: #0f7a72;
}

.hud-item {
  background: linear-gradient(180deg, #fff9e9, #f3dfb4);
  border-color: var(--line);
  box-shadow: inset 0 -4px 0 rgba(7, 41, 59, 0.08), 0 3px 0 rgba(7, 41, 59, 0.16);
}

.hud-item strong {
  color: #8a5a00;
}

.timer {
  height: 22px;
  background:
    repeating-linear-gradient(90deg, rgba(7, 41, 59, 0.14) 0 2px, transparent 2px 12px),
    #fff7e0;
  box-shadow: inset 0 2px 4px rgba(7, 41, 59, 0.16);
}

.timer-fill {
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 58%, var(--accent-3));
}

.q-dot {
  height: 8px;
  background: rgba(7, 41, 59, 0.12);
}

.q-dot.done {
  background: var(--accent-2);
}

.q-dot.now {
  background: var(--accent-3);
  box-shadow: 0 0 0 2px rgba(255, 107, 87, 0.25);
}

.question-host {
  position: relative;
  background:
    radial-gradient(circle at 10% 6%, rgba(46, 196, 182, 0.14), transparent 34%),
    radial-gradient(circle at 92% 96%, rgba(244, 185, 66, 0.24), transparent 36%),
    var(--treasure-grain),
    var(--parchment);
  border-radius: 26px;
  box-shadow:
    inset 0 0 0 6px rgba(244, 185, 66, 0.18),
    var(--shadow);
}

.question-host::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(7, 41, 59, 0.2);
  border-radius: 20px;
  pointer-events: none;
}

.question-host::after {
  content: "✦";
  position: absolute;
  right: 16px;
  bottom: 10px;
  color: var(--accent);
  font-size: 26px;
  text-shadow: 0 2px 0 rgba(7, 41, 59, 0.4);
  opacity: 0.55;
  pointer-events: none;
}

.question-host > * {
  position: relative;
  z-index: 1;
}

.q-prompt {
  color: #103d4d;
}

.q-passage {
  border-color: rgba(7, 41, 59, 0.3);
  background:
    repeating-linear-gradient(115deg, rgba(7, 41, 59, 0.03) 0 2px, transparent 2px 10px),
    #fff3ce;
}

/* 一般選項：藏寶木牌 */
.choice {
  background:
    linear-gradient(180deg, #fffdf6, #f7e8c6);
  border-color: var(--line);
  box-shadow: inset 0 -5px 0 rgba(7, 41, 59, 0.07), 0 5px 0 rgba(7, 41, 59, 0.18);
  color: #103d4d;
}

.choice:hover:not(:disabled) {
  background: linear-gradient(180deg, #fff8df, #ffe6a6);
}

.choice .key {
  top: 7px;
  left: 8px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--accent);
  font-size: 10px;
  line-height: 1;
}

.choice.correct {
  background: linear-gradient(180deg, #d8f7e6, #a8e8c8);
  border-color: #0c6b48;
  box-shadow: 0 5px 0 #0c6b48;
}

.choice.wrong {
  background: linear-gradient(180deg, #ffe2dd, #ffc0b6);
  border-color: #a32b1d;
  box-shadow: 0 5px 0 #a32b1d;
}

/* ---------- 自訂題型共用 ---------- */
.wt-scene {
  display: grid;
  gap: clamp(14px, 2.4vw, 20px);
}

.wt-grid {
  display: grid;
  gap: clamp(8px, 1.6vw, 12px);
}

.wt-tile {
  min-height: 76px;
}

.wt-count-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.wt-count-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wt-count-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.wt-choice-label {
  display: block;
  text-wrap: balance;
}

/* 選詞卡 */
.wt-map {
  position: relative;
  padding: clamp(18px, 3.6vw, 34px) clamp(14px, 3vw, 30px);
  border: 3px solid var(--line);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 18%, rgba(244, 185, 66, 0.2), transparent 38%),
    radial-gradient(circle at 84% 84%, rgba(46, 196, 182, 0.16), transparent 40%),
    repeating-linear-gradient(115deg, rgba(7, 41, 59, 0.04) 0 2px, transparent 2px 11px),
    #fffaf0;
  box-shadow: inset 0 0 0 7px rgba(244, 185, 66, 0.2), 0 6px 0 rgba(7, 41, 59, 0.12);
  text-align: center;
  overflow: hidden;
}

.wt-map::before,
.wt-map::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border: 2px dashed rgba(7, 41, 59, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

.wt-map::before {
  top: 10px;
  left: 10px;
}

.wt-map::after {
  right: 10px;
  bottom: 10px;
}

.wt-map-spark {
  position: absolute;
  top: 12px;
  right: 18px;
  color: var(--accent);
  font-size: 22px;
  text-shadow: 0 2px 0 var(--line);
  opacity: 0.75;
}

.wt-card-prompt {
  position: relative;
  margin: 4px 0 0;
  padding: 0;
  color: var(--ink);
  font-size: clamp(34px, 8.5vw, 66px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-shadow: 0 3px 0 rgba(244, 185, 66, 0.5);
}

.wt-card-foot {
  position: relative;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.wt-card-choice {
  min-height: 92px;
  font-size: clamp(24px, 4.6vw, 34px);
}

/* 詞語分類寶箱 */
.wt-classify {
  justify-items: stretch;
}

.wt-chest {
  position: relative;
  padding: clamp(20px, 4vw, 34px) clamp(14px, 3vw, 28px);
  border: 3px solid var(--line);
  border-radius: 18px 18px 26px 26px;
  background:
    linear-gradient(180deg, #f7d98b 0 16%, #b56a2c 16% 22%, #8f4d1f 22% 100%);
  box-shadow: inset 0 0 0 7px rgba(255, 231, 163, 0.28), var(--shadow);
  text-align: center;
  overflow: hidden;
}

.wt-chest-lid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 18%;
  border-bottom: 3px solid var(--line);
  background:
    repeating-linear-gradient(90deg, rgba(7, 41, 59, 0.14) 0 2px, transparent 2px 18px),
    linear-gradient(180deg, #d79d24, #a9611f);
}

.wt-chest-lock {
  position: absolute;
  top: 12%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 3px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffe7a3, var(--accent));
  color: #6d4700;
  font-size: 18px;
  transform: translateX(-50%);
  box-shadow: 0 3px 0 rgba(7, 41, 59, 0.22);
}

.wt-chest-prompt {
  position: relative;
  margin: clamp(18px, 4vw, 30px) 0 0;
  padding: 16px 14px;
  border: 2px dashed rgba(255, 247, 227, 0.7);
  border-radius: 14px;
  background: rgba(7, 41, 59, 0.42);
  color: #fff7e3;
  font-size: clamp(20px, 3.6vw, 28px);
  font-weight: 900;
  line-height: 1.5;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.24);
}

.wt-cat-choice {
  min-height: 84px;
  font-size: clamp(19px, 2.8vw, 24px);
}

.wt-cat-choice::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 12px;
  height: 8px;
  border: 2px solid rgba(7, 41, 59, 0.35);
  border-radius: 2px;
  background: rgba(244, 185, 66, 0.5);
}

/* 成語卷軸 */
.wt-scroll {
  position: relative;
  padding: clamp(26px, 5vw, 44px) clamp(18px, 4vw, 38px);
  border: 3px solid var(--line);
  border-radius: 10px;
  background:
    repeating-linear-gradient(0deg, rgba(7, 41, 59, 0.04) 0 1px, transparent 1px 30px),
    linear-gradient(180deg, #fff8e2, #f3e0b7);
  box-shadow: inset 0 0 0 7px rgba(244, 185, 66, 0.22), 0 7px 0 rgba(7, 41, 59, 0.14);
  text-align: center;
}

.wt-scroll-rod {
  position: absolute;
  top: -3px;
  left: -10px;
  right: -10px;
  height: 16px;
  border: 3px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, #d79d24, #8f4d1f);
  box-shadow: 0 3px 0 rgba(7, 41, 59, 0.16);
}

.wt-scroll-rod.bottom {
  top: auto;
  bottom: -3px;
}

.wt-scroll-prompt {
  position: relative;
  margin: 0;
  color: var(--ink);
  font-size: clamp(32px, 7.5vw, 58px);
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1.35;
}

.wt-idiom-choice {
  min-height: 86px;
  font-size: clamp(30px, 5.4vw, 44px);
  letter-spacing: 0.02em;
}

.wt-idiom-choice::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(255, 107, 87, 0.45);
  border-radius: 12px;
  pointer-events: none;
}

/* 詞語接龍 */
.wt-chain-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 16px);
  padding: clamp(12px, 2.4vw, 20px);
  border: 3px solid var(--line);
  border-radius: 20px;
  background:
    repeating-linear-gradient(115deg, rgba(7, 41, 59, 0.04) 0 2px, transparent 2px 12px),
    #fff7e0;
  box-shadow: inset 0 0 0 6px rgba(46, 196, 182, 0.16), var(--shadow-sm);
}

.wt-chain-node {
  position: relative;
  display: grid;
  place-items: center;
  min-width: clamp(96px, 24vw, 160px);
  min-height: clamp(64px, 12vw, 86px);
  padding: 8px 14px;
  border: 3px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fffdf6, #f7e8c6);
  box-shadow: 0 4px 0 rgba(7, 41, 59, 0.16);
}

.wt-chain-node::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 18px;
  height: 18px;
  border: 3px solid var(--line);
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.wt-chain-word {
  color: var(--ink);
  font-size: clamp(24px, 4.6vw, 34px);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.wt-chain-arrow {
  color: var(--accent-3);
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 900;
  text-shadow: 0 2px 0 var(--line);
}

.wt-chain-blank {
  border-style: dashed;
  background: rgba(255, 250, 240, 0.7);
  color: var(--accent-3);
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 900;
}

.wt-chain-prompt {
  margin: 0;
  font-size: clamp(17px, 2.5vw, 21px);
  font-weight: 800;
  line-height: 1.6;
}

.wt-chain-choice {
  min-height: 78px;
  background: linear-gradient(180deg, #fffdf6, #e9f7f3);
}

/* ---------- 回饋、結果與對話框 ---------- */
.feedback-burst {
  border-color: var(--line);
  background:
    radial-gradient(circle at 20% 12%, rgba(244, 185, 66, 0.24), transparent 36%),
    var(--parchment);
  box-shadow: inset 0 0 0 6px rgba(244, 185, 66, 0.2), var(--shadow);
}

.feedback-burst.bad {
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 107, 87, 0.22), transparent 36%),
    #fff3ef;
}

.feedback-emoji {
  filter: drop-shadow(0 4px 0 rgba(7, 41, 59, 0.18));
}

.feedback-text {
  color: var(--ink);
}

.feedback-explain {
  color: #345864;
}

.result-card {
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 185, 66, 0.28), transparent 42%),
    var(--treasure-grain),
    var(--parchment);
  border-radius: 28px 28px 22px 22px;
  overflow: hidden;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 11px;
  border: 3px solid var(--line);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(90deg, #d79d24, #ffe08a, #d79d24);
}

.star.on {
  color: #f2a900;
  filter: drop-shadow(0 3px 0 rgba(7, 41, 59, 0.2));
}

.result-stats div {
  background: linear-gradient(180deg, #fffaf0, #f2e1bc);
  border-color: rgba(7, 41, 59, 0.24);
}

.dialog::backdrop {
  background: rgba(4, 24, 34, 0.55);
}

.dialog-panel {
  border-radius: 22px;
}

.dialog-head h2 {
  color: var(--ink);
}

.switch:checked {
  background: var(--accent-2);
}

.toast {
  background: linear-gradient(180deg, #0d4457, var(--ink));
  border-color: var(--accent);
  color: #fff7e3;
}

/* ---------- 頁尾 ---------- */
.site-footer {
  border-top: 3px solid var(--accent);
  background:
    repeating-linear-gradient(90deg, rgba(7, 41, 59, 0.04) 0 2px, transparent 2px 16px),
    #fff6e0;
  color: #49656d;
}

.site-footer a {
  color: #0b4a5d;
}

/* ---------- 注音與動畫 ---------- */
body.zhuyin-on .wt-card-prompt[data-zy] {
  line-height: 1.75;
}

body.zhuyin-on .wt-chest-prompt[data-zy] {
  line-height: 1.95;
}

body.zhuyin-on .wt-scroll-prompt[data-zy] {
  line-height: 1.8;
}

body.zhuyin-on .wt-chain-prompt[data-zy] {
  line-height: 2.05;
}

body.zhuyin-on .wt-chain-word[data-zy] {
  line-height: 1.8;
}

.hero-art img,
.wt-chest-lock,
.wt-map-spark {
  animation: treasure-bob 4.8s ease-in-out infinite;
}

@keyframes treasure-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

@keyframes treasure-shine {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.9;
  }
}

.hero::after,
.howto::after,
.question-host::after {
  animation: treasure-shine 3.6s ease-in-out infinite;
}

/* ---------- 響應式 ---------- */
@media (max-width: 900px) {
  .hero {
    background:
      linear-gradient(180deg, rgba(255, 250, 240, 0.95) 0 42%, rgba(255, 250, 240, 0.78) 70%, rgba(255, 250, 240, 0.34) 100%),
      url("../assets/img/hero.webp") center / cover no-repeat;
  }

  .wt-count-4,
  .wt-count-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .wt-count-3 {
    grid-template-columns: 1fr;
  }

  .wt-card-choice,
  .wt-cat-choice,
  .wt-chain-choice {
    min-height: 66px;
    font-size: clamp(18px, 4.6vw, 22px);
  }

  .wt-card-choice {
    font-size: clamp(22px, 6vw, 28px);
  }

  .wt-idiom-grid.wt-count-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wt-idiom-grid.wt-count-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .wt-idiom-choice {
    min-height: 68px;
    font-size: clamp(24px, 7vw, 34px);
  }

  .wt-chain-track {
    flex-wrap: wrap;
  }
}

@media (max-width: 520px) {
  .hero {
    border-radius: 22px;
  }

  .hero-title::after {
    margin-inline: auto;
  }

  .hero-desc {
    border-left-width: 0;
    border-top: 4px solid var(--accent-2);
    border-radius: 0 0 12px 12px;
  }

  .wt-card-prompt {
    font-size: clamp(28px, 11vw, 42px);
  }

  .wt-scroll-prompt {
    font-size: clamp(26px, 10vw, 40px);
  }

  .wt-idiom-choice,
  .wt-idiom-choice {
    min-height: 60px;
  }

  .wt-grid.wt-count-4,
  .wt-grid.wt-count-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-host {
    padding: 14px;
  }

  .wt-chest-prompt {
    font-size: 18px;
  }

  .wt-chain-node {
    min-width: 88px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-art img,
  .wt-chest-lock,
  .wt-map-spark,
  .hero::after,
  .howto::after,
  .question-host::after {
    animation: none;
  }
}
