/* ============================================================
   嬨嬨寬寬的小天地　全站設計系統
   一份 CSS 管全站。顏色、字體、按鈕、卡片、動畫都在這裡。
   要換配色，改最上面的變數就好。
   ============================================================ */

/* ---------- 基本歸零 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- 全站色彩與尺寸變數 ---------- */
:root {
  /* 底色與文字 */
  --cream: #FFF7EE;
  --cream-2: #FFEFE0;
  --paper: #FFFFFF;
  --ink: #3B322E;
  --ink-soft: #6B5D55;
  --line: #F0E2D2;

  /* 全站主色（總站入口用的暖陽藍天） */
  --sun: #FFC53D;
  --sun-deep: #F5A623;
  --sky: #35BDCB;
  --sky-deep: #1E9AA8;
  --coral: #FF7A59;
  --grass: #58C08A;

  /* 每個分區進來會被下面 data-zone 覆蓋 */
  --accent: var(--sky);
  --accent-deep: var(--sky-deep);
  --accent-soft: #E6F7F9;
  --zone-bg-1: #FFF7EE;
  --zone-bg-2: #EAF8FA;

  /* 形狀 */
  --r-lg: 30px;
  --r-md: 22px;
  --r-sm: 14px;
  --shadow-1: 0 6px 0 rgba(0,0,0,.06), 0 12px 26px rgba(0,0,0,.10);
  --shadow-2: 0 3px 0 rgba(0,0,0,.06), 0 8px 18px rgba(0,0,0,.10);
  --shadow-soft: 0 10px 30px rgba(0,0,0,.08);

  --wrap: 1100px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, sans-serif;
}

/* ---------- 分區主題：在 body 上加 data-zone ---------- */
body[data-zone="english"] {
  --accent: #12B3A6; --accent-deep: #0E8F86; --accent-soft: #E3F7F4;
  --zone-bg-1: #FFFDF4; --zone-bg-2: #E7F8F3;
}
body[data-zone="jump"] {
  --accent: #FF77B0; --accent-deep: #E85A97; --accent-soft: #FFEAF3;
  --zone-bg-1: #FFF6FB; --zone-bg-2: #F1EBFF;
}
body[data-zone="wushu"] {
  --accent: #E5484D; --accent-deep: #C13438; --accent-soft: #FDE9E7;
  --zone-bg-1: #FFF8F1; --zone-bg-2: #FBEBD9;
}
body[data-zone="family"] {
  --accent: #7B61FF; --accent-deep: #5F45E0; --accent-soft: #EEEAFF;
  --zone-bg-1: #FBFAFF; --zone-bg-2: #EEEBFF;
}

/* ---------- 全站底 ---------- */
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -8%, var(--zone-bg-2), transparent 60%),
    radial-gradient(900px 480px at -6% 6%, #FFF0DA, transparent 55%),
    var(--zone-bg-1);
  min-height: 100vh;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background .5s ease;
}

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.stack > * + * { margin-top: 16px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- 字級（會隨螢幕大小自動縮放） ---------- */
h1, .h1 { font-size: clamp(28px, 6vw, 52px); font-weight: 900; line-height: 1.15; letter-spacing: .5px; }
h2, .h2 { font-size: clamp(23px, 4vw, 34px); font-weight: 800; line-height: 1.25; }
h3, .h3 { font-size: clamp(19px, 3vw, 24px); font-weight: 800; }
.lead { font-size: clamp(16px, 2.4vw, 20px); color: var(--ink-soft); }
.eyebrow { font-weight: 800; letter-spacing: 3px; color: var(--accent-deep); font-size: 14px; }
.muted { color: var(--ink-soft); }

/* 注音小字（ruby） */
ruby rt { font-size: .5em; color: var(--ink-soft); font-weight: 700; }
body:not(.show-zhuyin) rt { display: none; }

/* ---------- 頁首導覽列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(8px);
  background: color-mix(in srgb, var(--cream) 82%, transparent);
  border-bottom: 2px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; }
.brand .logo { width: 40px; height: 40px; flex: 0 0 auto; }
.topbar-spacer { flex: 1; }

.iconbtn {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--paper); box-shadow: var(--shadow-2);
  font-size: 20px; transition: transform .12s ease;
}
.iconbtn:active { transform: translateY(2px); }
.iconbtn.on { background: var(--accent); color: #fff; }

.profile-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); box-shadow: var(--shadow-2);
  border-radius: 999px; padding: 5px 12px 5px 6px; font-weight: 800;
}
.profile-pill .ava { width: 34px; height: 34px; border-radius: 999px; overflow: hidden; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 54px; padding: 0 26px; border-radius: 999px;
  font-weight: 900; font-size: 18px; color: #fff;
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  box-shadow: 0 5px 0 color-mix(in srgb, var(--accent-deep) 75%, #000 12%), 0 10px 20px rgba(0,0,0,.12);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent-deep) 75%, #000 12%), 0 4px 10px rgba(0,0,0,.12); }
.btn.ghost {
  color: var(--accent-deep); background: var(--paper);
  box-shadow: 0 4px 0 var(--line), 0 8px 16px rgba(0,0,0,.08);
}
.btn.sun { background: linear-gradient(180deg, var(--sun), var(--sun-deep)); box-shadow: 0 5px 0 #d8891a, 0 10px 20px rgba(0,0,0,.12); }
.btn.big { min-height: 64px; font-size: 20px; padding: 0 34px; }
.btn.block { width: 100%; }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--paper); border-radius: var(--r-md);
  box-shadow: var(--shadow-1); padding: 22px;
  border: 2px solid #fff;
}
.panel {
  background: color-mix(in srgb, var(--paper) 88%, var(--accent-soft));
  border: 2px solid var(--line); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 30px);
}
.badge-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent-deep);
  font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px;
}

/* ---------- Hero 區 ---------- */
.hero { padding: clamp(24px, 5vw, 56px) 0 20px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(20px, 4vw, 44px); align-items: center; }
.hero-copy .eyebrow { margin-bottom: 10px; }
.hero-copy h1 { margin-bottom: 14px; }
.hero-art {
  /* Hero 圖片等比縮放，但不會比文字區還寬 */
  width: 100%; max-width: 460px; margin-inline: auto;
  animation: floaty 6s ease-in-out infinite;
}
/* 角色的柔和落地陰影（輪廓改用 SVG 內的實線描邊處理） */
[data-art] svg, .who-card .art svg, .profile-pill .ava svg {
  filter: drop-shadow(0 7px 9px rgba(0,0,0,.13));
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* ---------- 三個大門（首頁） ---------- */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 8px; }
.door {
  position: relative; overflow: hidden; text-align: center;
  border-radius: var(--r-lg); padding: 26px 18px 24px; color: #fff;
  box-shadow: var(--shadow-1); border: 3px solid rgba(255,255,255,.5);
  transition: transform .15s ease, box-shadow .15s ease;
  min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
}
.door:hover { transform: translateY(-6px) rotate(-.4deg); box-shadow: 0 12px 0 rgba(0,0,0,.06), 0 22px 40px rgba(0,0,0,.18); }
.door .door-art { width: 132px; height: 132px; margin-bottom: 6px; animation: floaty 5s ease-in-out infinite; }
.door h3 { font-size: 24px; text-shadow: 0 2px 0 rgba(0,0,0,.12); }
.door p { font-weight: 700; opacity: .95; font-size: 15px; }
.door .go { margin-top: 6px; background: rgba(255,255,255,.95); color: var(--ink); font-weight: 900; padding: 8px 18px; border-radius: 999px; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.door.d-jump { background: linear-gradient(160deg, #FF9CC6, #A66BFF); }
.door.d-wushu { background: linear-gradient(160deg, #FF6F61, #C1272D); }
.door.d-english { background: linear-gradient(160deg, #35D6C4, #1E9AA8); }

/* ---------- 底部四個小入口 ---------- */
.mini-entries { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.mini {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--paper); border-radius: var(--r-md); padding: 18px 10px;
  box-shadow: var(--shadow-2); font-weight: 800; transition: transform .12s ease;
}
.mini:hover { transform: translateY(-4px); }
.mini .emoji { font-size: 30px; }
.mini small { font-weight: 700; color: var(--ink-soft); }

/* ---------- 分區小標題 ---------- */
.section-head { display: flex; align-items: center; gap: 14px; margin: 8px 0 18px; }
.section-head .dot { width: 14px; height: 14px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }

/* ---------- 單字翻卡（英文區） ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.flip { perspective: 1000px; aspect-ratio: 3/4; }
.flip-inner { position: relative; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; }
.flip.open .flip-inner { transform: rotateY(180deg); }
.flip-face {
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px; text-align: center;
  background: var(--paper); border: 2px solid #fff;
}
.flip-front { background: linear-gradient(160deg, var(--accent-soft), #fff); }
.flip-front .word-art { width: 74px; height: 74px; }
.flip-front .tapword { font-weight: 800; color: var(--accent-deep); font-size: 14px; }
.flip-back { transform: rotateY(180deg); }
.flip-back .en { font-size: 22px; font-weight: 900; color: var(--accent-deep); }
.flip-back .zh { font-weight: 800; }
.flip-back .ex { font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.flip-back .say { margin-top: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; }
.flip.done .flip-front::after {
  content: "★"; position: absolute; top: 8px; right: 10px; color: var(--sun-deep); font-size: 18px;
}
.tier { display: inline-flex; gap: 2px; font-size: 12px; color: var(--sun-deep); }

.tier-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.tier-tab { padding: 8px 16px; border-radius: 999px; font-weight: 800; background: var(--paper); box-shadow: var(--shadow-2); }
.tier-tab.on { background: var(--accent); color: #fff; }
.topic-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.topic-tab { padding: 7px 14px; border-radius: 999px; font-weight: 800; background: #fff; box-shadow: var(--shadow-2); font-size: 15px; }
.topic-tab.on { background: var(--ink); color: #fff; }

/* ---------- 聽力尋寶 ---------- */
.treasure-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 14px; }
.treasure-choices .pick { background: var(--paper); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-2); display: grid; place-items: center; gap: 6px; border: 3px solid transparent; transition: transform .12s ease; }
.treasure-choices .pick:active { transform: scale(.96); }
.treasure-choices .pick.right { border-color: var(--grass); animation: pop .4s ease; }
.treasure-choices .pick.wrong { border-color: #F0A; animation: shake .4s ease; }
.treasure-choices .pick svg { width: 84px; height: 84px; }

/* ---------- 技能樹 / 技巧卡（跳繩、武術） ---------- */
.skilltree { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: 16px; }
.skill {
  position: relative; background: var(--paper); border-radius: var(--r-md); padding: 16px;
  box-shadow: var(--shadow-2); border: 2px solid #fff; display: flex; gap: 12px; align-items: flex-start;
}
.skill .s-art { width: 56px; height: 56px; flex: 0 0 auto; }
.skill h4 { font-size: 17px; font-weight: 900; }
.skill .req { font-size: 13.5px; color: var(--ink-soft); }
.skill .stars { color: var(--sun-deep); font-size: 13px; }
.skill .lock-btn { margin-top: 8px; font-size: 14px; padding: 7px 14px; border-radius: 999px; font-weight: 800; background: var(--accent-soft); color: var(--accent-deep); }
.skill.done { background: linear-gradient(160deg, #fff, var(--accent-soft)); }
.skill.done .lock-btn { background: var(--grass); color: #fff; }
.skill.done::after { content: "✓"; position: absolute; top: 10px; right: 12px; color: var(--grass); font-weight: 900; font-size: 20px; }

/* ---------- 日誌 / 打卡表單 + 長條圖 ---------- */
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 800; font-size: 14px; }
.field input, .field select, .field textarea {
  font: inherit; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .bar { flex: 1; background: linear-gradient(180deg, var(--accent), var(--accent-deep)); border-radius: 10px 10px 6px 6px; position: relative; min-height: 6px; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.bars .bar span { position: absolute; top: -22px; left: 0; right: 0; text-align: center; font-weight: 800; font-size: 12px; }
.bars .bar small { position: absolute; bottom: -24px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--ink-soft); }

.log-list { display: flex; flex-direction: column; gap: 8px; }
.log-item { display: flex; justify-content: space-between; gap: 10px; background: var(--paper); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-2); font-size: 14px; }

/* ---------- 倒數 ---------- */
.countdown { display: flex; gap: 10px; justify-content: center; }
.count-box { background: var(--ink); color: #fff; border-radius: 18px; padding: 14px 8px; min-width: 74px; text-align: center; box-shadow: var(--shadow-2); }
.count-box b { font-size: 30px; display: block; line-height: 1; }
.count-box small { font-size: 12px; opacity: .8; }

/* ---------- 武德小語 / 每日一句 ---------- */
.quote {
  text-align: center; font-size: clamp(20px, 3.4vw, 30px); font-weight: 900; line-height: 1.5;
  padding: clamp(20px, 4vw, 40px); border-radius: var(--r-lg);
  background: linear-gradient(160deg, var(--accent-soft), #fff);
  border: 2px dashed var(--accent);
}

/* ---------- 許願池 ---------- */
.wish-input { display: flex; gap: 10px; flex-wrap: wrap; }
.wish-input textarea { flex: 1; min-width: 220px; min-height: 58px; resize: vertical; }
.wish-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; margin-top: 16px; }
.wish {
  background: linear-gradient(160deg, #fff, var(--accent-soft)); border-radius: var(--r-md); padding: 16px;
  box-shadow: var(--shadow-2); border: 2px solid #fff; position: relative;
}
.wish .who { font-weight: 800; font-size: 13px; color: var(--accent-deep); }
.wish .when { font-size: 12px; color: var(--ink-soft); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-2); font-weight: 800; font-size: 14px; }
.chip.on { background: var(--accent); color: #fff; }

/* ---------- 榮譽牆 ---------- */
.honor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); gap: 16px; }
.medal { text-align: center; }
.medal .disc {
  width: 92px; height: 92px; margin: 0 auto 8px; border-radius: 999px; display: grid; place-items: center;
  font-size: 40px; background: radial-gradient(circle at 35% 30%, #fff, var(--accent-soft));
  box-shadow: var(--shadow-2); border: 3px solid #fff;
}
.medal.locked .disc { filter: grayscale(1); opacity: .45; }
.medal b { font-size: 14px; }
.medal small { display: block; font-size: 12px; color: var(--ink-soft); }

/* ---------- 訪客計數器 ---------- */
.counter {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--paper); border-radius: 999px; padding: 10px 20px 10px 14px; box-shadow: var(--shadow-2); font-weight: 800;
}
.counter .odo { display: flex; gap: 3px; }
.counter .digit {
  background: var(--ink); color: #fff; font-weight: 900; border-radius: 8px; padding: 4px 8px; min-width: 24px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.counter .lbl small { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 700; }

/* ---------- 角色選擇 / 密碼 遮罩 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(1000px 600px at 50% 0%, var(--zone-bg-2), #FFE7CE 70%);
}
.overlay .box { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: clamp(24px, 5vw, 44px); max-width: 560px; width: 100%; text-align: center; }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
.who-card { border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-2); background: linear-gradient(160deg,#fff,var(--cream-2)); border: 3px solid #fff; transition: transform .12s ease; }
.who-card:active { transform: scale(.96); }
.who-card svg { width: 120px; height: 120px; margin: 0 auto 6px; }
.who-card b { font-size: 20px; }

/* ---------- 慶祝特效 ---------- */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; }
.toast {
  background: var(--ink); color: #fff; font-weight: 800; padding: 12px 22px; border-radius: 999px;
  box-shadow: var(--shadow-1); animation: toastin .3s ease; max-width: 90vw;
}
.toast.good { background: linear-gradient(90deg, var(--grass), #3AA76D); }

/* ---------- 影片框（16:9 自適應） ---------- */
.video16 { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-2); background: #000; }
.video16 iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.vwrap { display: flex; flex-direction: column; gap: 6px; }
.vnote { font-size: 13px; margin-left: 4px; }
.vcard { display: flex; align-items: stretch; gap: 12px; width: 100%; text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: 16px; padding: 8px; cursor: pointer; box-shadow: var(--shadow-2); transition: transform .1s ease; }
.vcard:hover { border-color: var(--accent); }
.vcard:active { transform: scale(.99); }
.vthumb { position: relative; flex: 0 0 auto; width: 150px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; background: linear-gradient(150deg, var(--accent), var(--accent-deep)); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vplay { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 40px; height: 40px; border-radius: 999px; background: rgba(255,255,255,.94); color: #E5484D; display: grid; place-items: center; font-size: 15px; padding-left: 3px; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
.vinfo { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; padding-right: 6px; }
.vtitle { font-weight: 800; font-size: 15px; line-height: 1.35; }
.vhint { font-size: 12.5px; color: var(--accent-deep); font-weight: 700; }
@media (max-width: 480px) { .vthumb { width: 120px; } .vtitle { font-size: 14px; } }

/* ---------- 你買的線上課程大按鈕 ---------- */
.course-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(120deg, #fff, var(--accent-soft));
  border: 2px solid var(--accent); border-radius: var(--r-lg); padding: 18px 22px; box-shadow: var(--shadow-2);
}
.course-card .ci { font-size: 40px; }
.course-card .ct { flex: 1; min-width: 180px; }
.course-card .ct b { font-size: 18px; }
.course-card .ct small { display: block; color: var(--ink-soft); font-weight: 700; }

/* ---------- 好玩暖身/卡通 ---------- */
.motivation-card { background: var(--paper); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-2); }

/* ---------- 闖關關卡 ---------- */
.stage-progress { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.stage-dot { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; background: var(--paper); box-shadow: var(--shadow-2); color: var(--ink-soft); }
.stage-dot.done { background: var(--grass); color: #fff; }
.stage-dot.now { background: var(--accent); color: #fff; outline: 4px solid var(--accent-soft); }
.stage-line { flex: 1; height: 4px; border-radius: 4px; background: var(--line); min-width: 10px; }

.stage-map { display: flex; flex-direction: column; gap: 18px; }
.stage {
  background: var(--paper); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1);
  border: 3px solid #fff; position: relative;
}
.stage.done { border-color: var(--grass); }
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.stage-head .em { font-size: 34px; }
.stage-head h3 { font-size: 20px; }
.stage-goal { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; padding: 8px 14px; border-radius: 999px; margin-bottom: 14px; }
.stage .steps { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.stage .steps li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.stage .steps .n { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 900; display: grid; place-items: center; font-size: 14px; }
.stage .diagram { margin: 12px 0; }
.stage .clearbtn { margin-top: 14px; }
.stage.done .clearbtn { background: var(--grass); box-shadow: 0 5px 0 #3a8f5f, 0 10px 20px rgba(0,0,0,.12); }
.stage .vlabel { font-weight: 800; margin: 4px 0 8px; display: flex; align-items: center; gap: 8px; }
.stage .ytlink { display: inline-block; margin-top: 8px; font-weight: 800; color: var(--accent-deep); }

/* ---------- 英雄牆 ---------- */
.hero-row { display: flex; gap: 10px; overflow-x: auto; padding: 12px 2px 4px; }
.hero-pick {
  flex: 0 0 auto; max-width: 220px; text-align: left; white-space: normal;
  background: var(--paper); border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow-2);
  font-weight: 800; font-size: 14px; line-height: 1.3; border: 2px solid transparent;
}
.hero-pick.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.heroNote { margin-top: 8px; }

/* ---------- 每天給孩子的一句話 ---------- */
.encourage {
  display: flex; align-items: center; gap: 16px; margin: 4px 0 26px;
  background: linear-gradient(120deg, #fff, var(--accent-soft));
  border: 2px solid var(--accent); border-radius: var(--r-lg); padding: 16px 20px; box-shadow: var(--shadow-2);
}
.encourage .ava2 { width: 84px; height: 84px; flex: 0 0 auto; }
.encourage .enc-quote { font-size: clamp(17px, 2.6vw, 21px); font-weight: 800; line-height: 1.5; margin-top: 4px; }
@media (max-width: 560px) { .encourage { flex-direction: column; text-align: center; } }

/* ---------- 節拍器 ---------- */
.metro-dot { width: 54px; height: 54px; border-radius: 999px; background: var(--accent-soft); border: 3px solid var(--accent); flex: 0 0 auto; }
.metro-dot.beat { animation: metrobeat .18s ease; }
@keyframes metrobeat { 0% { transform: scale(1); } 40% { transform: scale(1.28); background: var(--accent); } 100% { transform: scale(1); } }
input[type="range"] { accent-color: var(--accent); }

/* ---------- 英文玩法選單 ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; }
.mode-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--r-md); padding: 14px 8px; box-shadow: var(--shadow-2); font-weight: 800; transition: transform .1s ease; }
.mode-btn:hover { transform: translateY(-3px); border-color: var(--accent); }
.mode-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.mode-btn .me { font-size: 30px; }
.mode-btn small { font-weight: 700; opacity: .85; font-size: 12px; }

/* ---------- 翻牌配對 ---------- */
.mem-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 520px; margin: 0 auto; }
.mem-card { position: relative; aspect-ratio: 3/4; border: none; background: none; cursor: pointer; padding: 0; }
.mem-face, .mem-back { position: absolute; inset: 0; border-radius: 14px; display: grid; place-items: center; box-shadow: var(--shadow-2); font-weight: 900; transition: opacity .25s; }
.mem-back { background: linear-gradient(150deg, var(--accent), var(--accent-deep)); color: #fff; font-size: 26px; }
.mem-face { background: var(--paper); border: 2px solid var(--accent-soft); color: var(--accent-deep); font-size: 15px; padding: 4px; text-align: center; opacity: 0; }
.mem-card.flip .mem-back { opacity: 0; }
.mem-card.flip .mem-face { opacity: 1; }
.mem-card.matched { opacity: .5; }
@media (max-width: 480px) { .mem-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- 頁尾 ---------- */
.footer { margin-top: 40px; padding: 30px 0 60px; color: var(--ink-soft); text-align: center; font-size: 14px; }
.footer .privacy { display: inline-flex; align-items: center; gap: 8px; background: #fff; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-2); font-weight: 700; }

/* ---------- 動畫 ---------- */
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-12px) rotate(1deg); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
@keyframes toastin { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes sparkle { 0%,100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.view { animation: viewin .35s ease; }
@keyframes viewin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 響應式（手機、平板） ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .hero-cta { justify-content: center; }
  .hero-art { order: -1; max-width: 320px; }
  .doors { grid-template-columns: 1fr; }
  .door { min-height: 210px; flex-direction: row; justify-content: flex-start; text-align: left; padding: 20px; }
  .door .door-art { width: 96px; height: 96px; margin: 0; }
}
@media (max-width: 620px) {
  .mini-entries { grid-template-columns: 1fr 1fr; }
  .who-pick { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .hero-cta { flex-direction: column; }
  .brand span.full { display: none; }
}

/* ---------- 尊重「減少動態」的裝置設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
