/* ============================================================
   波波熊學園 — 全站樣式
   設計：場景式背景、照片卡片、厚實圓角與層次陰影、幼兒友善大按鈕
   ============================================================ */

:root {
  color-scheme: light;
  --sky-1: #8fd3f4;
  --sky-2: #d6f0ff;
  --hill-1: #9fd67a;
  --hill-2: #7cc45c;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-line: #f0e6d8;
  --text: #3b3028;
  --text-soft: #8a7a68;
  --primary: #ff8f00;
  --primary-d: #ef6c00;
  --primary-soft: #ffe6c2;
  --correct: #2e7d32;
  --correct-bg: #dff5e1;
  --wrong: #c62828;
  --wrong-bg: #ffe3e3;
  --shadow-sm: 0 2px 0 rgba(120, 90, 50, .12), 0 4px 12px rgba(120, 90, 50, .12);
  --shadow: 0 6px 0 rgba(120, 90, 50, .14), 0 12px 24px rgba(120, 90, 50, .16);
  --ring: rgba(255, 143, 0, .5);
  --topbar-bg: linear-gradient(180deg, #ffc84d, #ffb703);
  --topbar-text: #4a3200;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --sky-1: #171a33;
  --sky-2: #262a52;
  --hill-1: #2c3a5c;
  --hill-2: #223050;
  --bg-soft: #232746;
  --card: #2b2f52;
  --card-line: #3b4070;
  --text: #f1ecff;
  --text-soft: #aeb0d4;
  --primary: #ffb74d;
  --primary-d: #ffa726;
  --primary-soft: #4a3a6b;
  --correct: #a5d6a7;
  --correct-bg: #1d3a26;
  --wrong: #ef9a9a;
  --wrong-bg: #45202a;
  --shadow-sm: 0 2px 0 rgba(0, 0, 0, .35), 0 4px 12px rgba(0, 0, 0, .35);
  --shadow: 0 6px 0 rgba(0, 0, 0, .4), 0 12px 24px rgba(0, 0, 0, .4);
  --ring: rgba(255, 183, 77, .6);
  --topbar-bg: linear-gradient(180deg, #333863, #2b2f52);
  --topbar-text: #ffd54f;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "Yuanti TC", "YouYuan", "PingFang TC", "Microsoft JhengHei",
    "Noto Sans TC", system-ui, sans-serif;
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 46%, var(--bg-soft) 78%);
  background-attachment: fixed;
}

/* 場景：遠山草地 */
body::after {
  content: "";
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 34vh;
  z-index: -1;
  background:
    radial-gradient(120% 100% at 18% 100%, var(--hill-1) 0 42%, transparent 43%),
    radial-gradient(120% 100% at 82% 100%, var(--hill-2) 0 46%, transparent 47%),
    linear-gradient(180deg, transparent 0 55%, var(--hill-2) 100%);
  opacity: .55;
  pointer-events: none;
}

.ui-ico { width: 1.5rem; height: 1.5rem; display: block; }

/* ---------- 頂部列 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--topbar-bg);
  color: var(--topbar-text);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 4px 16px rgba(90, 60, 10, .22);
  border-bottom: 3px solid rgba(255, 255, 255, .35);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; min-width: 0; }
.brand-mark {
  width: 44px; height: 44px; flex: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22));
  transition: transform .25s;
}
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-name { font-size: clamp(1.05rem, 4.2vw, 1.5rem); font-weight: 800; letter-spacing: .05em; white-space: nowrap; }
.topbar-actions { display: flex; gap: 8px; }
.topbar-btn {
  min-width: 48px; min-height: 48px; border: none; border-radius: 15px;
  background: rgba(255, 255, 255, .45); color: var(--topbar-text);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform .12s, background .2s;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}
:root[data-theme="dark"] .topbar-btn { background: rgba(255, 255, 255, .14); }
.topbar-btn:hover { transform: scale(1.08); }
.topbar-btn:active { transform: scale(.94); }
.topbar-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.topbar-btn.muted { opacity: .55; }

/* ---------- 版面 ---------- */
.app { flex: 1; width: 100%; max-width: 900px; margin: 0 auto; padding: 18px 16px 44px; }
.screen { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- 首頁 ---------- */
.hero { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0 22px; flex-wrap: wrap; }
.hero-bear { position: relative; flex: none; }
.mascot-img {
  width: clamp(96px, 24vw, 132px); height: auto; display: block;
  animation: bob 2.6s ease-in-out infinite;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .18));
}
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
.hero-sparkle {
  position: absolute; width: 12px; height: 12px; border-radius: 50%;
  background: #fff36b; box-shadow: 0 0 10px #ffe14d;
  animation: twinkle 1.8s infinite;
}
.hero-sparkle.s1 { top: 4px; right: -2px; }
.hero-sparkle.s2 { bottom: 18px; left: -8px; width: 9px; height: 9px; animation-delay: .8s; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }

.speech {
  position: relative; background: var(--card); border: 3px solid var(--card-line);
  border-radius: 22px; padding: 16px 20px; box-shadow: var(--shadow-sm);
  font-size: clamp(1rem, 3.6vw, 1.2rem); line-height: 1.6; color: var(--text-soft);
}
.speech b { color: var(--text); font-size: clamp(1.15rem, 4.4vw, 1.5rem); }
.speech::before {
  content: ""; position: absolute; left: -13px; top: 50%; transform: translateY(-50%);
  border: 11px solid transparent; border-right-color: var(--card-line);
}
@media (max-width: 430px) { .speech::before { display: none; } }

/* 主題卡片 */
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.topic-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  border: none; border-radius: 26px; padding: 18px 16px;
  font-family: inherit; color: #fff; cursor: pointer; text-align: left;
  box-shadow: var(--shadow);
  transition: transform .16s, filter .2s;
}
.topic-card::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 88% 12%, rgba(255, 255, 255, .3), transparent 55%);
  pointer-events: none;
}
.topic-card:hover { transform: translateY(-4px) scale(1.015); filter: brightness(1.06); }
.topic-card:active { transform: translateY(2px); }
.topic-card:focus-visible { outline: 4px solid var(--ring); outline-offset: 3px; }
.topic-mark {
  flex: none; display: grid; place-items: center;
  width: 76px; height: 76px; border-radius: 22px;
  background: rgba(255, 255, 255, .95); color: #4a3a2a;
  font-size: 1.32rem; font-weight: 900; letter-spacing: .02em;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .18);
}
.topic-body { flex: 1; min-width: 0; }
.t-name { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: .05em; }
.t-desc { display: block; font-size: .92rem; opacity: .95; margin-top: 3px; }
.topic-thumbs { display: flex; flex-direction: column; gap: 5px; flex: none; }
.topic-thumbs img {
  width: 40px; height: 40px; border-radius: 12px; object-fit: cover;
  border: 2.5px solid rgba(255, 255, 255, .9); box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
}
.c-zhuyin { background: linear-gradient(140deg, #ff7aa8, #e0407b); }
.c-math { background: linear-gradient(140deg, #57b0f2, #2b7fc9); }
.c-english { background: linear-gradient(140deg, #5fc57a, #359355); }
.c-world { background: linear-gradient(140deg, #b478d8, #8241b4); }

/* ---------- 頁首標題 ---------- */
.page-head {
  display: flex; align-items: center; gap: 12px;
  border-radius: 22px; padding: 14px 18px; margin-bottom: 18px;
  color: #fff; box-shadow: var(--shadow-sm);
}
.page-mark {
  flex: none; display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 17px;
  background: rgba(255, 255, 255, .95); color: #4a3a2a;
  font-size: 1rem; font-weight: 900;
}
.page-head h2 { font-size: clamp(1.2rem, 4.6vw, 1.6rem); letter-spacing: .04em; }

/* ---------- 模式選擇 ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; max-width: 620px; margin: 0 auto; }
.mode-card {
  border: 3px solid var(--card-line); border-radius: 24px;
  background: var(--card); color: var(--text); font-family: inherit;
  padding: 22px 16px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .16s, border-color .2s;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.mode-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.mode-card:active { transform: translateY(2px); }
.mode-card:focus-visible { outline: 4px solid var(--ring); outline-offset: 3px; }
.mode-name { font-size: 1.35rem; font-weight: 800; }
.mode-card small { font-size: .92rem; color: var(--text-soft); }
.mode-thumbs { display: flex; gap: -10px; margin-bottom: 4px; }
.mode-thumbs img {
  width: 56px; height: 56px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--card); margin-left: -14px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
}
.mode-thumbs img:first-child { margin-left: 0; }
.mode-badge {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, #ffc44d, #ff8f00); color: #fff; margin-bottom: 4px;
  box-shadow: 0 4px 10px rgba(255, 143, 0, .45);
}
.mode-badge svg { width: 30px; height: 30px; }

/* ---------- 認識世界分類 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; max-width: 720px; margin: 0 auto; }
.cat-card {
  border: 3px solid var(--card-line); border-radius: 24px; background: var(--card);
  color: var(--text); font-family: inherit; padding: 16px 10px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .16s, border-color .2s;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--primary); }
.cat-card:active { transform: translateY(2px); }
.cat-card:focus-visible { outline: 4px solid var(--ring); outline-offset: 3px; }
.cat-media { width: 84px; height: 84px; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .16); background: var(--primary-soft); }
.cat-media img { width: 100%; height: 100%; object-fit: cover; }
.cat-media .shape { width: 58px; height: 58px; }
.cat-swatch { width: 100%; height: 100%; display: block; }
.cat-name { font-size: 1.2rem; font-weight: 800; }

/* ---------- 學一學 ---------- */
.learn-hint {
  text-align: center; color: var(--text-soft); font-size: 1rem; margin-bottom: 14px;
  background: var(--card); border: 2px solid var(--card-line); border-radius: 999px;
  padding: 8px 16px; display: inline-block; box-shadow: var(--shadow-sm);
}
.learn-hint b { color: var(--text); }
.flash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(134px, 1fr)); gap: 14px; }
.flash-card {
  border: 3px solid var(--card-line); border-radius: 22px; background: var(--card);
  color: var(--text); font-family: inherit; padding: 0; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .16s, border-color .2s;
  display: flex; flex-direction: column;
}
.flash-card:hover { transform: translateY(-4px) scale(1.02); border-color: var(--primary); }
.flash-card:active { transform: scale(.96); }
.flash-card:focus-visible { outline: 4px solid var(--ring); outline-offset: 2px; }
.flash-card.pop { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-2deg); } 100% { transform: scale(1); } }
.flash-media { position: relative; display: block; }
.flash-badge {
  position: absolute; left: 8px; top: 8px; min-width: 40px; height: 40px; padding: 0 8px;
  display: grid; place-items: center; border-radius: 13px;
  background: rgba(255, 255, 255, .95); color: var(--primary-d);
  font-size: 1.35rem; font-weight: 900; box-shadow: 0 3px 8px rgba(0, 0, 0, .22);
}
.flash-label {
  padding: 9px 6px 11px; font-size: 1.05rem; font-weight: 800; text-align: center;
  background: var(--card);
}
.flash-label small { display: block; font-size: .82rem; font-weight: 500; color: var(--text-soft); margin-top: 1px; }

/* ---------- 圖像共用 ---------- */
.pic { display: block; overflow: hidden; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic-card { width: 100%; aspect-ratio: 1 / 1; background: var(--primary-soft); display: grid; place-items: center; }
.pic-card .shape { width: 62%; height: 62%; }
.color-fill { aspect-ratio: 1 / 1; }
.shape { display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .18)); }

.pic-q {
  width: clamp(150px, 42vw, 210px); aspect-ratio: 1 / 1; margin: 0 auto;
  border-radius: 24px; border: 4px solid #fff; background: var(--primary-soft);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2); display: grid; place-items: center;
}
.pic-q .shape { width: 66%; height: 66%; }
.pic-choice { width: clamp(78px, 22vw, 100px); aspect-ratio: 1/1; border-radius: 18px; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.pic-choice .shape { width: 100%; height: 100%; }
.pic-row { display: inline-flex; flex-wrap: wrap; gap: 7px; justify-content: center; align-items: center; max-width: 100%; }
.pic-count { width: clamp(34px, 8.4vw, 52px); aspect-ratio: 1 / 1; border-radius: 13px; box-shadow: 0 2px 5px rgba(0, 0, 0, .18); }

/* ---------- 測驗 ---------- */
.quiz-bar { margin-bottom: 14px; }
.progress {
  position: relative; height: 14px; border-radius: 999px; background: var(--card);
  border: 2px solid var(--card-line); overflow: visible; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .08);
}
.progress > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffc44d, #ff8f00); transition: width .45s ease;
}
.progress-bear {
  position: absolute; top: -20px; width: 38px; height: 38px; transform: translateX(-50%);
  transition: left .45s ease; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .25));
}
.quiz-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.quiz-progress { font-size: 1rem; color: var(--text-soft); font-weight: 800; }
.quiz-stars { display: inline-flex; gap: 2px; }
.star { width: 20px; height: 20px; display: block; color: var(--card-line); }
.star.on { animation: starPop .4s ease; }
@keyframes starPop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }

.quiz-prompt {
  background: var(--card); border: 3px solid var(--card-line);
  border-radius: 28px; box-shadow: var(--shadow); text-align: center;
  padding: 22px 16px; margin-bottom: 18px;
}
.q-display { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.q-sub { font-size: clamp(1.2rem, 4.6vw, 1.6rem); font-weight: 800; }
.q-letter { font-size: clamp(3rem, 12vw, 4.6rem); font-weight: 900; line-height: 1; color: var(--primary-d); }
.q-add { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.q-op { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 900; color: var(--primary); }
.q-eq { font-size: clamp(1.7rem, 6vw, 2.3rem); font-weight: 900; margin-top: 6px; }
.q-swatch { display: block; width: clamp(110px, 30vw, 150px); aspect-ratio: 1/1; border-radius: 50%;
  border: 5px solid #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, .22); margin: 0 auto; }
.listen-box {
  width: clamp(110px, 30vw, 140px); aspect-ratio: 1/1; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center; color: var(--primary-d);
  background: var(--primary-soft); box-shadow: inset 0 3px 10px rgba(0, 0, 0, .1);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.listen-ico { width: 52%; height: 52%; }
.quiz-prompt .q-text { font-size: 1.12rem; color: var(--text-soft); margin-top: 12px; font-weight: 600; }

.btn-speak {
  margin-top: 14px; border: none; border-radius: 999px;
  background: var(--primary); color: #fff; font-family: inherit;
  font-size: 1.05rem; font-weight: 800; padding: 12px 24px; min-height: 50px;
  cursor: pointer; transition: transform .15s; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 0 var(--primary-d), 0 8px 16px rgba(255, 143, 0, .35);
}
:root[data-theme="dark"] .btn-speak { color: #2a1a00; }
.btn-speak .ui-ico { width: 1.25rem; height: 1.25rem; }
.btn-speak:hover { transform: translateY(-2px); }
.btn-speak:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-d); }
.btn-speak:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .choice-grid { grid-template-columns: repeat(4, 1fr); } }
.choice-btn {
  border: 3px solid var(--card-line); border-radius: 22px; background: var(--card);
  color: var(--text); font-family: inherit; min-height: 108px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .15s, background .2s, border-color .2s;
  display: flex; align-items: center; justify-content: center; padding: 10px;
}
.c-text { font-size: clamp(2rem, 7vw, 2.6rem); font-weight: 900; line-height: 1; }
.choice-btn:hover:not(:disabled) { transform: translateY(-4px); border-color: var(--primary); }
.choice-btn:active:not(:disabled) { transform: translateY(2px); }
.choice-btn:focus-visible { outline: 4px solid var(--ring); outline-offset: 2px; }
.choice-btn .c-swatch { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }
.choice-btn.correct { background: var(--correct-bg); border-color: var(--correct); animation: pop .5s ease; }
.choice-btn.correct .c-text { color: var(--correct); }
.choice-btn.wrong { background: var(--wrong-bg); border-color: var(--wrong); animation: shake .4s ease; }
.choice-btn.wrong .c-text { color: var(--wrong); }
.choice-btn:disabled { cursor: default; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.quiz-feedback { text-align: center; min-height: 2.4rem; margin-top: 16px; font-size: 1.3rem; font-weight: 900; }
.quiz-feedback.good { color: var(--correct); animation: pop .45s ease; }
.quiz-feedback.bad { color: var(--wrong); }

/* ---------- 結算 ---------- */
.result {
  text-align: center; background: var(--card); border: 3px solid var(--card-line);
  border-radius: 30px; box-shadow: var(--shadow); padding: 32px 22px; max-width: 500px; margin: 0 auto;
}
.result-bear img { width: 110px; height: auto; animation: bob 2s ease-in-out infinite; }
.result-bear.cheer img { animation: cheer .7s ease-in-out infinite; }
@keyframes cheer { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-14px) rotate(6deg); } }
.result h2 { font-size: clamp(1.3rem, 5vw, 1.7rem); margin-top: 10px; }
.r-stars { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.r-stars .star { width: 32px; height: 32px; }
.result p { color: var(--text-soft); margin-top: 12px; font-size: 1.05rem; }
.result p b { color: var(--primary-d); font-size: 1.3rem; }

.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.btn-big {
  border: none; border-radius: 999px; font-family: inherit; font-size: 1.12rem; font-weight: 800;
  padding: 15px 30px; cursor: pointer; min-height: 56px; transition: transform .15s;
}
.btn-big.primary { background: var(--primary); color: #fff; box-shadow: 0 5px 0 var(--primary-d), 0 10px 20px rgba(255, 143, 0, .35); }
:root[data-theme="dark"] .btn-big.primary { color: #2a1a00; }
.btn-big.ghost { background: var(--card); color: var(--text); border: 3px solid var(--card-line); box-shadow: var(--shadow-sm); }
.btn-big:hover { transform: translateY(-2px); }
.btn-big:active { transform: translateY(3px); }
.btn-big:focus-visible { outline: 4px solid var(--ring); outline-offset: 3px; }

/* ---------- 返回鈕 ---------- */
.back-row { margin-bottom: 14px; }
.btn-back {
  border: 2px solid var(--card-line); border-radius: 999px; background: var(--card);
  color: var(--text); font-family: inherit; font-size: 1rem; font-weight: 800;
  padding: 9px 18px 9px 12px; min-height: 46px; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: transform .15s;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-back .ui-ico { width: 1.2rem; height: 1.2rem; }
.btn-back:hover { transform: translateX(-3px); }
.btn-back:active { transform: scale(.96); }
.btn-back:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* ---------- 彩帶 ---------- */
#confetti-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 50; }
.confetti-piece {
  position: absolute; top: -24px; width: 12px; height: 16px; border-radius: 3px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall { to { transform: translateY(110vh) rotate(720deg); opacity: .5; } }

/* ---------- 頁尾 ---------- */
.footer { text-align: center; padding: 16px 12px calc(16px + env(safe-area-inset-bottom)); color: var(--text-soft); font-size: .85rem; }
.footer .credit { font-size: .74rem; margin-top: 4px; opacity: .85; }
.footer .credit a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; }
}
