/* ==========================================================================
   墨池遊戲館 · 夜色硯池
   給 3–8 歲的遊戲層：大按鈕、大字、低刺激、清楚的回饋。
   配色與主站（app/styles.css）同一套：深墨綠硯池、宣紙卡、金、朱砂、玉。
   遊戲館不再自成一套「日光」色票；畫面只是把硯池的燈點亮一點。
   ========================================================================== */

:root {
  /* 硯池夜色 */
  --g-night: #071a1c;
  --g-night-2: #0d2b2e;
  --g-night-3: #123b3d;
  --g-text: #f3ead6;
  --g-text-muted: rgba(243, 234, 214, 0.64);
  --g-text-dim: rgba(243, 234, 214, 0.4);

  /* 宣紙 */
  --g-paper: #f6ecd6;
  --g-paper-2: #efe1c2;
  --g-paper-3: #e5d2a9;

  /* 深色面上的預設；宣紙卡在下面「紙面」區塊覆寫 */
  --g-ink: #f3ead6;
  --g-ink-2: rgba(243, 234, 214, 0.84);
  --g-muted: rgba(243, 234, 214, 0.64);
  --g-line: rgba(243, 234, 214, 0.14);
  --g-line-strong: rgba(243, 234, 214, 0.3);
  --g-jade-deep: #a9d5c4;
  --g-gold-deep: #e8c47a;
  --g-link-color: var(--g-gold);

  /* 五色：金、朱砂、玉（與主站同一組） */
  --g-gold: #e8c47a;
  --g-gold-2: #f5e3b0;
  --g-cinnabar: #b3453a;
  --g-cinnabar-2: #8e2f28;
  --g-jade: #7fb7a3;
  --g-jade-2: #a9d5c4;

  --g-white: #f8efd9;
  --g-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  --g-shadow-lg: 0 34px 80px rgba(0, 0, 0, 0.42);
  --g-radius: 22px;
  --g-font-kai: "Kaiti TC", "Kaiti SC", "KaiTi", "STKaiti", "DFKai-SB", "BiauKai", "Noto Serif TC", serif;
  --g-font-song: "Songti TC", "Songti SC", "SimSun", "Noto Serif TC", serif;
  --g-font-ui: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--g-night);
}

body {
  font-family: var(--g-font-ui);
  color: var(--g-text);
  background:
    radial-gradient(72% 56% at 80% -6%, rgba(232, 196, 122, 0.14), transparent 62%),
    radial-gradient(60% 52% at 4% 10%, rgba(127, 183, 163, 0.1), transparent 64%),
    radial-gradient(130% 90% at 50% 108%, rgba(18, 59, 61, 0.66), transparent 72%),
    linear-gradient(180deg, #071a1c 0%, #0a2427 52%, #071a1c 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 硯池的墨點與金塵：和主站首頁同一種空氣。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    radial-gradient(circle at 22% 28%, rgba(232, 196, 122, 0.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 64%, rgba(243, 234, 214, 0.32) 0 1px, transparent 1.5px),
    radial-gradient(circle at 44% 82%, rgba(169, 213, 196, 0.28) 0 1px, transparent 1.4px);
  background-size: 180px 200px, 260px 280px, 320px 340px;
  z-index: 0;
}

/* 右上角的月量：固定的一層暖光，不擋任何操作。 */
body::after {
  content: "";
  position: fixed;
  top: -20vh;
  right: -10vw;
  width: 54vw;
  height: 54vw;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(245, 227, 176, 0.14), rgba(232, 196, 122, 0.05) 46%, transparent 70%);
  z-index: 0;
}

button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.g-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.g-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 60px;
  flex: 1;
}

.g-muted { color: var(--g-muted); }
.g-muted.small, .small { font-size: 0.86rem; line-height: 1.6; }

.g-kicker {
  margin: 0 0 6px;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--g-gold-deep);
  font-weight: 700;
}

/* ---------------- 紙面：與主站 .paper 同一張宣紙 ----------------
   紙面上的文字、線、連結、玉色全部換成紙用的一組；
   深色面（硯池）沿用 :root 的預設，不必逐一覆盖。 */
.g-today, .g-daily, .g-card, .g-panel, .g-sticker-card, .g-board-full,
.g-challenge-card, .g-modal, .g-result-stats, .g-result-sentence,
.g-result-sticker, .g-login-cta, .g-chest-note, .g-role,
.g-challenge-compare, .g-psych-game, .g-promptbar, .g-koi-bubble,
.echo-card, .bubble-sentence, .bubble-target-char, .mcard-front,
.bridge-tile, .bridge-slot, .fill-scroll, .fill-option,
.dragon-dialogue, .dragon-slot, .dragon-tile, .dragon-fill,
.dragon-speak-text, .dragon-opt, .dragon-hp {
  --g-ink: #2b2620;
  --g-ink-2: #4a3b28;
  --g-muted: #6b5d48;
  --g-line: rgba(70, 52, 30, 0.18);
  --g-line-strong: rgba(70, 52, 30, 0.32);
  --g-jade-deep: #3f6f5f;
  --g-gold-deep: #8a6a22;
  --g-link-color: #8e2f28;
  color: var(--g-ink);
}

/* ---------------- 頂欄 ---------------- */

.g-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(7, 26, 28, 0.74);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--g-line);
}

.g-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.g-seal {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #bd4a3e, #8e2f28);
  color: #fff4dd;
  font-family: var(--g-font-kai);
  font-size: 24px;
  border: 2px solid rgba(255, 236, 200, 0.38);
  box-shadow: 0 6px 14px rgba(142, 47, 40, 0.32);
  transform: rotate(-3deg);
}

.g-brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.g-brand-copy b { font-size: 1.05rem; letter-spacing: 0.08em; color: var(--g-text); }
.g-brand-copy i { font-style: normal; font-size: 0.7rem; color: var(--g-text-muted); letter-spacing: 0.06em; }

.g-top-actions { display: flex; align-items: center; gap: 8px; }

.g-star-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(232, 196, 122, 0.12);
  border: 1px solid rgba(232, 196, 122, 0.34);
  color: var(--g-gold-2);
  font-size: 0.9rem;
}
.g-star-chip b { font-size: 1rem; color: var(--g-gold-2); }
.g-star-chip i { color: var(--g-text-muted); font-style: normal; font-size: 0.75rem; }

.g-icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--g-line);
  background: rgba(243, 234, 214, 0.06);
  color: var(--g-text);
  font-size: 1.1rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.g-icon-btn:hover { background: rgba(243, 234, 214, 0.12); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); }
.g-icon-btn:active { transform: scale(0.94); }

.g-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(127, 183, 163, 0.16);
  color: var(--g-jade-2);
  font-size: 0.75rem;
  font-weight: 700;
}
.g-chip.offline { background: rgba(232, 196, 122, 0.14); color: var(--g-gold-2); }
.g-me { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(127, 183, 163, 0.18); color: var(--g-jade-2); }

/* ---------------- 按鈕 ---------------- */

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(70, 52, 30, 0.26);
  background: linear-gradient(160deg, #f8efd9, #efe1c2);
  color: #2b2620;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}
.g-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28); }
.g-btn:active { transform: translateY(0) scale(0.97); }
.g-btn.primary {
  background: linear-gradient(155deg, #bd4a3e, #8e2f28);
  border-color: rgba(255, 226, 170, 0.22);
  color: #fff4dd;
  box-shadow: 0 12px 26px rgba(142, 47, 40, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}
.g-btn.primary:hover { box-shadow: 0 16px 34px rgba(142, 47, 40, 0.48); }
.g-btn.ghost {
  background: rgba(243, 234, 214, 0.05);
  border-color: var(--g-line-strong);
  color: var(--g-text);
  box-shadow: none;
}
.g-btn.ghost:hover { background: rgba(243, 234, 214, 0.1); }
.g-btn.danger { color: #e8a6a0; border-color: rgba(179, 69, 58, 0.5); background: rgba(179, 69, 58, 0.12); }
.g-btn.lg { min-height: 58px; padding: 0 26px; font-size: 1.08rem; border-radius: 999px; }
.g-btn.small { min-height: 38px; padding: 0 14px; font-size: 0.86rem; border-radius: 999px; }
.g-btn.full { width: 100%; }
.g-btn:disabled { opacity: 0.5; pointer-events: none; }
.g-btn-ico { font-size: 1.2em; }

/* 紙面上的次要鈕：不要再用一張紙疊一張紙。 */
.g-daily .g-btn:not(.primary), .g-today .g-btn:not(.primary),
.g-panel .g-btn:not(.primary), .g-modal .g-btn:not(.primary),
.g-board-full .g-btn:not(.primary),
.g-challenge-card .g-btn:not(.primary), .g-result-sentence .g-btn:not(.primary) {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(70, 52, 30, 0.24);
  color: #3b3124;
  box-shadow: none;
}
.g-daily .g-btn.ghost, .g-modal .g-btn.ghost,
.g-board-full .g-btn.ghost, .g-challenge-card .g-btn.ghost {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(70, 52, 30, 0.28);
  color: #3b3124;
}
.g-daily .g-btn.danger, .g-panel .g-btn.danger, .g-modal .g-btn.danger {
  color: #8e2f28;
  border-color: rgba(142, 47, 40, 0.4);
  background: rgba(179, 69, 58, 0.08);
}

.g-link {
  border: 0;
  background: none;
  padding: 4px;
  color: var(--g-link-color);
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.g-back {
  border: 0;
  background: none;
  color: var(--g-text-muted);
  font-size: 0.9rem;
  padding: 6px 0;
  margin-bottom: 12px;
}

/* ---------------- 大廳 ---------------- */

.g-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  padding: clamp(16px, 3vw, 36px) 0 10px;
}

.g-eyebrow {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--g-gold);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.g-eyebrow span { color: var(--g-jade-2); margin-left: 8px; }

.g-hero h1 {
  margin: 0 0 14px;
  font-family: var(--g-font-kai);
  font-size: clamp(2.05rem, 5vw, 3.6rem);
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: var(--g-text);
}
.g-hero h1 em {
  font-style: normal;
  color: var(--g-gold-2);
}

.g-hero-sub {
  margin: 0 0 22px;
  max-width: 34em;
  color: var(--g-text-muted);
  line-height: 1.8;
  font-size: 0.98rem;
}

.g-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.g-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.g-hero-chips span {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(243, 234, 214, 0.05);
  border: 1px solid var(--g-line);
  font-size: 0.8rem;
  color: var(--g-text-muted);
}
.g-hero-chips b { color: var(--g-text); font-size: 0.95rem; }

.g-hero-koi { position: relative; }
.g-pond {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(232, 196, 122, 0.28);
  background: var(--g-night);
}
.g-pond .pond-garden { display: block; width: 100%; height: auto; }
.g-pond-koi {
  position: absolute;
  left: 6%;
  bottom: 2%;
  width: 46%;
  transform: rotate(-4deg);
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.35));
}
.g-pond-koi::before {
  content: "";
  position: absolute;
  inset: 8% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 196, 122, 0.28), rgba(232, 196, 122, 0) 70%);
  z-index: 0;
}
.g-pond-koi .koi-svg { position: relative; z-index: 1; }
.g-petals { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.g-petals i {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 7px;
  border-radius: 50% 0 50% 0;
  background: rgba(199, 109, 114, 0.65);
  animation: petalFall 9s linear infinite;
}
.g-petals i:nth-child(1) { left: 12%; animation-delay: -1s; animation-duration: 8s; }
.g-petals i:nth-child(2) { left: 32%; animation-delay: -4s; animation-duration: 10s; }
.g-petals i:nth-child(3) { left: 56%; animation-delay: -2.5s; animation-duration: 11s; }
.g-petals i:nth-child(4) { left: 74%; animation-delay: -6s; animation-duration: 9s; }
.g-petals i:nth-child(5) { left: 88%; animation-delay: -3s; animation-duration: 12s; }
@keyframes petalFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translate(-40px, 360px) rotate(420deg); opacity: 0; }
}
.g-pond-koi .koi-svg { width: 100%; height: auto; display: block; }

.g-koi-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(243, 234, 214, 0.05);
  border: 1px solid var(--g-line);
  font-size: 0.86rem;
  color: var(--g-text-muted);
  line-height: 1.5;
}
.g-koi-tag {
  flex: 0 0 auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(127, 183, 163, 0.16);
  color: var(--g-jade-2);
  font-weight: 800;
  font-size: 0.78rem;
}

.g-star-meter { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.g-star-meter-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: rgba(243, 234, 214, 0.12);
  overflow: hidden;
}
.g-star-meter-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8c47a, #a9822f);
}
.g-star-meter span { font-size: 0.78rem; color: var(--g-text-muted); }

/* 今天的一句（用正式課文的分鏡圖） */
.g-today {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 0;
  padding: 12px 16px 12px 12px;
  border-radius: 18px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.9), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}
.g-today-img {
  flex: 0 0 auto;
  width: 128px;
  height: 84px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  background-color: #d9c7a0;
  box-shadow: inset 0 0 0 1px rgba(70, 52, 30, 0.14);
}
.g-today-copy { flex: 1; min-width: 0; }
.g-today-line { margin: 0 0 2px; font-family: var(--g-font-kai); font-size: clamp(1.05rem, 2.4vw, 1.32rem); line-height: 1.5; color: var(--g-ink); }
.g-today .g-btn { flex: 0 0 auto; }

/* 每日任務 */
.g-daily {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 18px 0 26px;
  padding: 18px 22px;
  border-radius: var(--g-radius);
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.9), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}
.g-daily.ready { border-color: #c9a06a; box-shadow: 0 0 0 4px rgba(232, 196, 122, 0.18), 0 22px 60px rgba(0, 0, 0, 0.26); }
.g-daily-icon { font-size: 2.1rem; flex: 0 0 auto; }
.g-daily-copy { flex: 1; min-width: 0; }
.g-daily-copy h2 { margin: 0 0 4px; font-size: 1.18rem; color: var(--g-ink); }
.g-daily-copy p { margin: 0 0 10px; color: var(--g-muted); font-size: 0.85rem; }
.g-daily-bar { height: 9px; border-radius: 999px; background: rgba(70, 52, 30, 0.14); overflow: hidden; }
.g-daily-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--g-jade), var(--g-gold)); border-radius: inherit; transition: width 0.4s ease; }
.g-daily-count { text-align: center; font-size: 1.1rem; color: var(--g-muted); flex: 0 0 auto; }
.g-daily-count b { font-size: 1.8rem; color: var(--g-ink); }
.g-daily-count span { font-size: 0.9rem; }

/* 年齡分頁：硯池上的三盞小燈 */
.g-bands {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 34px;
}
.g-band {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1.5px solid var(--g-line);
  background: rgba(243, 234, 214, 0.045);
  text-align: left;
  color: var(--g-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.g-band:hover { transform: translateY(-3px); background: rgba(243, 234, 214, 0.08); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); }
.g-band.on {
  border-color: var(--band, var(--g-gold));
  background: rgba(232, 196, 122, 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}
.g-band-age { font-size: 0.76rem; color: var(--g-text-muted); letter-spacing: 0.08em; }
.g-band-name { font-size: 1.22rem; font-weight: 800; font-family: var(--g-font-kai); color: var(--g-text); }
.g-band-stars { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--g-gold); font-weight: 700; }
.g-band-note { font-size: 0.78rem; color: var(--g-text-muted); }

/* 遊戲卡 */
.g-section { margin-bottom: 34px; }
.g-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.g-section-head h2 { margin: 0; font-family: var(--g-font-kai); font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--g-text); }

.g-games {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.g-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 1px solid rgba(99, 74, 42, 0.22);
  border-radius: 20px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  overflow: hidden;
  text-align: left;
  color: var(--g-ink);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.g-card:hover { transform: translateY(-5px); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4); }
.g-card:active { transform: translateY(-1px) scale(0.99); }

.g-card-art {
  position: relative;
  display: block;
  height: 118px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--c, #7fb7a3), var(--g-night-2));
}
.g-card-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 78% 20%, rgba(245, 227, 176, 0.5), transparent 40%);
}
.g-card-art.art-cave { background: linear-gradient(160deg, #17494a, #071a1c); }
.g-card-art.art-pond { background: linear-gradient(160deg, #2f6f66, #0d2b2e); }
.g-card-art.art-study { background: linear-gradient(160deg, #8a6a44, #2b2620); }
.g-card-art.art-river { background: linear-gradient(160deg, #3f6f5f, #0d2b2e); }
.g-card-art.art-lantern { background: linear-gradient(160deg, #6f241f, #1a1210); }
.g-card-art.art-arena { background: linear-gradient(160deg, #6f2a24, #1a1210); }
.g-card-art.art-gate { background: linear-gradient(160deg, #123b3d, #071a1c); }

.g-card-hills {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -26%;
  height: 80%;
  border-radius: 50% 50% 0 0;
  background: rgba(243, 234, 214, 0.14);
}
.g-card-sun {
  position: absolute;
  right: 14%;
  top: 14%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(245, 227, 176, 0.92);
  box-shadow: 0 0 24px rgba(232, 196, 122, 0.75);
}
.g-card-icon {
  position: absolute;
  left: 16px;
  bottom: 10px;
  z-index: 2;
  font-size: 2.4rem;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.3));
}

.g-card-body { display: flex; flex-direction: column; gap: 5px; padding: 14px 16px 16px; }
.g-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.g-card-top b { font-family: var(--g-font-kai); font-size: 1.28rem; color: var(--g-ink); }
.g-new {
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 800;
  color: #8e2f28;
  background: #f3e4c6;
  border-radius: 999px;
  padding: 3px 9px;
}
.g-played { font-style: normal; font-size: 0.72rem; color: var(--g-muted); }
.g-card-skill { font-size: 0.82rem; color: var(--g-muted); }
.g-card-stars { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.g-card-stars em { font-style: normal; font-size: 0.76rem; color: var(--g-muted); }

/* 星星列 */
.star-row { display: inline-flex; align-items: center; gap: 4px; }
.star-slot { display: inline-flex; opacity: 0.55; transform: scale(0.96); }
.star-slot.on { opacity: 1; }
.star-slot.star-in { animation: starIn 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both; animation-delay: calc(var(--i) * 0.16s); }
@keyframes starIn {
  0% { transform: scale(0.2) rotate(-30deg); opacity: 0; }
  70% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

/* 大廳下方三欄 */
.g-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 10px 0 26px;
}
.g-panel {
  padding: 18px;
  border-radius: var(--g-radius);
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.86), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}
.g-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.g-panel-head h2 { margin: 0; font-size: 1.08rem; color: var(--g-ink); }
.g-panel-head span { font-size: 0.78rem; color: var(--g-muted); }
.g-panel-note { margin: 10px 0 0; font-size: 0.8rem; line-height: 1.65; color: var(--g-muted); }
.g-garden { border-radius: 14px; overflow: hidden; border: 1px solid var(--g-line); }
.g-garden .pond-garden { display: block; width: 100%; height: auto; }
.g-gifts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.g-gift {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px dashed var(--g-line-strong);
  color: #8a7a5c;
}
.g-gift.on { color: var(--g-jade-deep); border-style: solid; background: #e7e6d2; }
.g-gift i { font-style: normal; opacity: 0.6; margin-left: 3px; }

.g-sticker-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.g-sticker-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border: 0;
  border-radius: 12px;
  background: #efe1c2;
  color: var(--g-muted);
}
.g-sticker-mini.on { background: #f8efd9; }
.g-sticker-mini i { font-style: normal; font-size: 0.64rem; text-align: center; line-height: 1.25; }
.g-unknown {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #e5d2a9;
  color: #8a7a5c;
  font-weight: 800;
}
.g-unknown.big { width: 64px; height: 64px; font-size: 1.4rem; }

.g-board-mini { display: flex; flex-direction: column; gap: 6px; }
.g-board-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--g-line); font-size: 0.86rem; }
.g-board-row:last-child { border-bottom: 0; }
.g-rank { flex: 0 0 24px; text-align: center; font-weight: 800; }
.g-board-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-board-name i, .g-demo { font-style: normal; font-size: 0.62rem; color: #8a5a1d; background: #f0e3c4; border-radius: 6px; padding: 1px 4px; margin-left: 4px; }
.g-board-stars { display: inline-flex; align-items: center; gap: 3px; font-size: 0.78rem; color: #8a6a22; }
.g-board-row b { min-width: 34px; text-align: right; }

.g-parent-note {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px;
  border-radius: var(--g-radius);
  background: rgba(243, 234, 214, 0.05);
  border: 1px solid var(--g-line);
}
.g-parent-note-icon { font-size: 1.5rem; }
.g-parent-note b { display: block; margin-bottom: 4px; color: var(--g-text); }
.g-parent-note p { margin: 0; font-size: 0.84rem; line-height: 1.7; color: var(--g-text-muted); }
.g-parent-note .g-link { margin-left: auto; flex: 0 0 auto; }

.g-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(16px, 4vw, 40px) 34px;
  color: var(--g-text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--g-line);
}
.g-foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.g-foot-links button, .g-foot-links a { border: 0; background: none; color: var(--g-text-muted); padding: 0; font-size: 0.78rem; text-decoration: none; }
.g-foot-links button:hover, .g-foot-links a:hover { color: var(--g-gold); }

/* ---------------- 內頁共用 ---------------- */

.g-page-head { margin: 8px 0 26px; }
.g-page-head h1 { margin: 0 0 8px; font-family: var(--g-font-kai); font-size: clamp(1.9rem, 4vw, 2.8rem); color: var(--g-text); }
.g-page-sub { margin: 0; color: var(--g-text-muted); line-height: 1.7; max-width: 46em; }

.g-sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.g-sticker-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 22px 16px;
  border-radius: 20px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
}
.g-sticker-card.locked { background: linear-gradient(150deg, #efe1c2, #e5d2a9); border-color: rgba(99, 74, 42, 0.18); }
.g-sticker-card.on { background: linear-gradient(165deg, #f8efd9, #f3e7c8); border-color: #c9a06a; }
.g-sticker-art { display: grid; place-items: center; min-height: 76px; }
.g-sticker-card b { font-size: 1rem; color: var(--g-ink); }
.g-sticker-card span { font-size: 0.76rem; color: var(--g-muted); line-height: 1.5; }
.g-sticker-card.locked b, .g-sticker-card.locked span { color: #8a7a5c; }

.g-board-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.g-seg-row { display: flex; flex-wrap: wrap; gap: 8px; }
.g-seg {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid var(--g-line);
  background: rgba(243, 234, 214, 0.05);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--g-text);
}
.g-seg:hover { background: rgba(243, 234, 214, 0.1); }
.g-seg.on { background: var(--g-gold); color: #2b2620; border-color: var(--g-gold); }

/* 紙面卡裡的分頁籤：同一顆元件，換成紙用配色。 */
.g-panel .g-seg { background: rgba(255, 255, 255, 0.42); border-color: rgba(70, 52, 30, 0.22); color: #4a3b28; }
.g-panel .g-seg:hover { background: rgba(255, 255, 255, 0.66); }
.g-panel .g-seg.on { background: #e8c47a; border-color: #c9a06a; color: #2b2620; }

.g-board-full {
  padding: 18px 20px;
  border-radius: var(--g-radius);
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.86), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}
.g-board-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--g-line); }
.g-board-title b { font-family: var(--g-font-kai); font-size: 1.2rem; color: var(--g-ink); }
.g-board-title span { color: var(--g-muted); font-size: 0.8rem; }
.g-board-list { list-style: none; margin: 0; padding: 0; }
.g-board-list li { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px dashed var(--g-line); }
.g-board-list li:last-child { border-bottom: 0; }
.g-board-list li.me { background: #e7e6d2; border-radius: 12px; padding-left: 10px; padding-right: 10px; }
.g-board-list li.demo { opacity: 0.85; }
.g-board-list .g-board-name { font-size: 0.95rem; }
.g-board-list b { min-width: 44px; text-align: right; }
.g-board-list.compact li { padding: 8px 4px; }
.g-board-me { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: #e7e6d2; font-size: 0.9rem; }
.g-board-note { margin: 14px 0 0; font-size: 0.76rem; color: var(--g-muted); line-height: 1.6; }
.g-login-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 16px; padding: 16px 20px; border-radius: 18px; background: linear-gradient(150deg, #f8efd9, #f3e7c8); border: 1px dashed #c9a06a; }
.g-login-cta p { margin: 0; font-size: 0.86rem; color: #6b5426; }

.g-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.g-role-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.g-role {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border-radius: 14px;
  border: 1.5px solid var(--g-line);
  background: #efe1c2;
  text-align: left;
}
.g-role.on { border-color: var(--g-jade); background: #e7e6d2; }
.g-role b { font-size: 0.92rem; color: var(--g-ink); }
.g-role span { font-size: 0.72rem; color: var(--g-muted); }
.g-toggle { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; padding: 6px 0; cursor: pointer; color: var(--g-ink); }
.g-toggle input { width: 20px; height: 20px; accent-color: var(--g-cinnabar); }
.g-offline-progress { margin-top: 10px; font-size: 0.8rem; color: var(--g-muted); }

/* 挑戰書 */
.g-challenge-loading { display: grid; place-items: center; gap: 14px; min-height: 50vh; color: var(--g-text-muted); }
.g-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(243, 234, 214, 0.14);
  border-top-color: var(--g-gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.g-challenge-card {
  max-width: 720px;
  margin: 10px auto;
  padding: clamp(22px, 4vw, 40px);
  border-radius: 26px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.9), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.42);
}
.g-challenge-card h1 { margin: 6px 0 16px; font-family: var(--g-font-kai); font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.3; color: var(--g-ink); }
.g-challenge-card h1 em { font-style: normal; color: var(--g-cinnabar); }
.g-challenge-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.g-challenge-meta span { padding: 5px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.5); border: 1px solid var(--g-line); font-size: 0.8rem; }
.g-challenge-target { padding: 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.42); font-size: 0.9rem; }
.g-challenge-target b { color: var(--g-jade-deep); }
.g-challenge-actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 14px; }

.g-challenge-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px;
  border-radius: 18px;
  background: #e7e6d2;
  margin: 10px 0;
}
.g-challenge-compare.win { background: #f3e7c8; }
.g-challenge-compare > div:not(.g-vs) { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.g-challenge-compare span { font-size: 0.76rem; color: var(--g-muted); }
.g-challenge-compare b { font-size: 1.2rem; }
.g-challenge-compare i { font-style: normal; font-size: 0.78rem; color: var(--g-muted); }
.g-vs { font-family: var(--g-font-kai); font-size: 1.2rem; color: var(--g-cinnabar); }

/* ---------------- 彈窗 ---------------- */

body.g-modal-open { overflow: hidden; }
.g-modal-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 14, 15, 0.66);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.g-modal-back.in { opacity: 1; }
.g-modal-back.closing { opacity: 0; }
.g-modal {
  position: relative;
  width: min(520px, 100%);
  max-height: min(86dvh, 720px);
  overflow: auto;
  padding: 26px 24px 20px;
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.92), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.24);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s ease;
}
.g-modal-back.in .g-modal { transform: none; }
.g-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(70, 52, 30, 0.08);
  font-size: 1.3rem;
  line-height: 1;
  color: var(--g-muted);
}
.g-modal-icon { font-size: 2rem; margin-bottom: 6px; }
.g-modal-title { margin: 0 0 10px; font-family: var(--g-font-kai); font-size: 1.5rem; line-height: 1.35; color: var(--g-ink); }
.g-modal-body { font-size: 0.94rem; line-height: 1.7; color: var(--g-ink-2); }
.g-modal-body p { margin: 0 0 10px; }
.g-modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.g-modal-actions .g-btn { flex: 1 1 auto; }

.g-form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.g-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--g-muted); }
.g-form input, .g-input, .g-textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--g-line-strong);
  background: #fbf3df;
  font-size: 1rem;
  color: var(--g-ink);
}
.g-textarea { min-height: 120px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.g-form input:focus, .g-input:focus, .g-textarea:focus { outline: 2px solid rgba(232, 196, 122, 0.55); border-color: var(--g-gold-deep); }
.g-form-error { margin: 0; min-height: 1.2em; color: #8e2f28; font-size: 0.8rem; }
.g-copy-row { display: flex; gap: 8px; }
.g-copy-row .g-input { font-size: 0.82rem; }

.g-chest-note { font-family: var(--g-font-kai); font-size: 1.12rem; line-height: 1.8; color: var(--g-ink); padding: 14px 16px; border-radius: 14px; background: #f3e7c8; border: 1px dashed #c9a06a; }
.g-chest-sticker { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.g-chest-sticker b { display: block; font-size: 1.05rem; }
.g-chest-sticker span { font-size: 0.8rem; color: var(--g-muted); }
.g-psych-list { margin: 8px 0 0; padding-left: 20px; font-size: 0.88rem; line-height: 1.8; }
.g-psych-list b { color: var(--g-jade-deep); }
.g-psych-games { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.g-psych-game { padding: 10px 12px; border-radius: 12px; background: #efe1c2; border: 1px solid var(--g-line); }
.g-psych-game b { display: block; font-size: 0.9rem; margin-bottom: 2px; }
.g-psych-game p { margin: 0; font-size: 0.8rem; line-height: 1.6; color: var(--g-muted); }

/* 吐司 */
.g-toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 300;
  transform: translate(-50%, 20px);
  max-width: min(90vw, 460px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(7, 26, 28, 0.94);
  border: 1px solid rgba(232, 196, 122, 0.24);
  color: var(--g-text);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.g-toast.show { opacity: 1; transform: translate(-50%, 0); }
body:has(.g-play) .g-toast { bottom: max(132px, env(safe-area-inset-bottom)); }

/* ---------------- 結算 ---------------- */

.g-result {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: auto;
  padding: 40px 16px 60px;
  color: var(--g-text);
  background:
    radial-gradient(circle at 50% 0%, rgba(232, 196, 122, 0.18), transparent 55%),
    radial-gradient(110% 80% at 50% 110%, rgba(18, 59, 61, 0.7), transparent 72%),
    linear-gradient(180deg, #071a1c, #0a2427 58%, #071a1c);
}
.g-result-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 12%, rgba(232, 196, 122, 0.1) 0deg 6deg, transparent 6deg 14deg);
  mask-image: radial-gradient(circle at 50% 10%, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at 50% 10%, #000 0%, transparent 62%);
}
.g-result-inner {
  position: relative;
  width: min(640px, 100%);
  margin: 0 auto;
  text-align: center;
}
.g-result-inner h1 { margin: 4px 0 8px; font-family: var(--g-font-kai); font-size: clamp(1.7rem, 5vw, 2.6rem); color: var(--g-text); }
.g-result-stars { margin: 12px 0 18px; }
.g-result-stars .star-slot { opacity: 1; }
.g-result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  border: 1px solid rgba(99, 74, 42, 0.22);
}
.g-result-stats > div { display: flex; flex-direction: column; gap: 2px; }
.g-result-stats b { font-size: 1.4rem; color: var(--g-ink); }
.g-result-stats span { font-size: 0.74rem; color: var(--g-muted); }
.g-result-stage { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 16px 0; padding: 10px 16px; border-radius: 16px; background: rgba(127, 183, 163, 0.1); border: 1px solid var(--g-line); }
.g-result-stage .koi-svg { width: 110px; height: auto; }
.g-result-stage p { margin: 0; font-size: 0.92rem; color: var(--g-text); }
.g-result-sticker {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px auto;
  padding: 16px 20px;
  max-width: 460px;
  border-radius: 20px;
  background: linear-gradient(150deg, #f8efd9, #f3e7c8);
  border: 1px solid #c9a06a;
  text-align: left;
  animation: stickerIn 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.g-result-sticker b { display: block; font-size: 1.1rem; color: var(--g-ink); }
.g-result-sticker span { font-size: 0.8rem; color: var(--g-muted); }
@keyframes stickerIn {
  from { transform: scale(0.7) rotate(-6deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.g-result-sentence {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 18px 0;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.3);
  text-align: left;
}
.g-result-scene { flex: 0 0 42%; min-height: 150px; background-size: cover; background-position: center; }
.g-result-scene-copy { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; justify-content: center; }
.g-result-line { margin: 2px 0 4px; font-family: var(--g-font-kai); font-size: clamp(1.05rem, 2.6vw, 1.42rem); line-height: 1.6; color: var(--g-ink); }
.g-result-online { min-height: 24px; margin: 6px 0; }
.g-online-rank { margin: 6px 0; font-size: 0.9rem; color: var(--g-gold); }
.g-result-daily {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 12px 0 18px;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(243, 234, 214, 0.05);
  border: 1px dashed var(--g-line-strong);
  font-size: 0.84rem;
}
.g-result-daily .g-daily-bar { flex: 1 1 120px; min-width: 100px; background: rgba(243, 234, 214, 0.14); }
.g-result-daily b { font-size: 0.84rem; }
.g-result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0 16px; }
.g-result-home { font-size: 0.86rem; }
.g-result-links { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; align-items: center; }
.g-result-links a { text-decoration: none; }

/* 大廳右上角「回背書」：筆記本樣式，手機只留圖示。
   遊戲館是附屬功能，回書桌的路要一眼看得到，不要藏在頁尾。 */
.g-desk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(127, 183, 163, 0.4);
  background: rgba(127, 183, 163, 0.14);
  color: var(--g-jade-2);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.g-desk-btn:hover { background: rgba(127, 183, 163, 0.24); transform: translateY(-2px); box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3); }
.g-desk-btn:active { transform: scale(0.96); }
.g-desk-txt { font-weight: 700; }
.g-desk-ico {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(127, 183, 163, 0.26);
  font-family: var(--g-font-kai);
  font-size: 0.95rem;
  line-height: 1;
}
@media (max-width: 760px) {
  .g-desk-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }
  .g-desk-txt { display: none; }
  /* 手機標頭很擠（品牌＋回背書＋星星＋三顆圖示）：品牌副標先讓位，不要折成兩行。 */
  .g-brand-copy i { display: none; }
  .g-brand-copy b { font-size: 0.98rem; }
}

.g-result > .g-result-inner > .g-muted { color: var(--g-text-muted); }

/* 遊戲結算的墨鯉 */
.koi-stageup { animation: koiUp 1.2s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes koiUp {
  from { transform: translateY(30px) scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ==========================================================================
   遊戲進行中
   ========================================================================== */

.g-play {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--g-text);
  background: var(--g-night);
}
.band-34 { --band: #7fb7a3; }
.band-56 { --band: #e8c47a; }
.band-78 { --band: #b3453a; }

.g-play-scene { position: absolute; inset: 0; z-index: 0; background: var(--g-night); }
.g-play-scene .scene-svg { display: block; width: 100%; height: 100%; }
.g-play-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(7, 26, 28, 0.42), rgba(7, 26, 28, 0) 26%, rgba(7, 26, 28, 0.42));
}
.scene-bg-cave .g-play-veil { background: linear-gradient(180deg, rgba(4, 14, 15, 0.55), rgba(4, 14, 15, 0.08) 40%, rgba(4, 14, 15, 0.55)); }
.scene-bg-lantern .g-play-veil { background: linear-gradient(180deg, rgba(4, 14, 15, 0.5), rgba(4, 14, 15, 0.06) 40%, rgba(4, 14, 15, 0.55)); }

.g-hud {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(9px + env(safe-area-inset-top)) clamp(10px, 3vw, 22px) 9px;
  background: rgba(7, 26, 28, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--g-line);
}
.g-hud-back {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--g-line);
  background: rgba(243, 234, 214, 0.06);
  font-size: 1.2rem;
  color: var(--g-text);
}
.g-hud-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.g-hud-title b { font-family: var(--g-font-kai); font-size: 1.18rem; color: var(--g-text); }
.g-hud-title span { font-size: 0.7rem; color: var(--g-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-hud-progress { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 5px; }
.g-hud-progress i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(243, 234, 214, 0.2);
  transition: all 0.3s ease;
}
.g-hud-progress i.done { background: var(--g-jade); }
.g-hud-progress i.now { background: var(--g-gold); transform: scale(1.5); box-shadow: 0 0 0 4px rgba(232, 196, 122, 0.22); }
.g-hud-sound {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--g-line);
  background: rgba(243, 234, 214, 0.06);
  color: var(--g-text);
  font-size: 1rem;
}

.g-board {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow: auto;
  padding: 14px 14px 170px;
  -webkit-overflow-scrolling: touch;
}

.g-promptbar {
  position: absolute;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  width: min(780px, calc(100% - 20px));
  padding: 10px 14px;
  border-radius: 20px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.9), transparent 55%),
    linear-gradient(145deg, #f8efd9, #eddfc0);
  border: 1px solid rgba(99, 74, 42, 0.24);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.4);
}
.g-listen {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(160deg, #bd4a3e, #8e2f28);
  color: #fff4dd;
  box-shadow: 0 10px 22px rgba(142, 47, 40, 0.4);
}
.g-listen:active { transform: scale(0.95); }
.g-listen-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(232, 196, 122, 0.45);
  animation: listenPulse 2.6s ease-out infinite;
}
@keyframes listenPulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  70% { transform: scale(1.15); opacity: 0; }
  100% { opacity: 0; }
}
.g-listen-icon { font-size: 1.4rem; line-height: 1; }
.g-listen-label { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.04em; }
.g-prompt-copy { flex: 1; min-width: 0; }
.g-prompt-main { font-family: var(--g-font-kai); font-size: 1.18rem; line-height: 1.35; color: var(--g-ink); }
.g-prompt-main b { color: var(--g-cinnabar); }
.g-prompt-main.empty { display: none; }
.g-prompt-sub { font-size: 0.8rem; color: var(--g-muted); margin-top: 2px; line-height: 1.4; }

.g-koi-corner {
  position: absolute;
  right: 16px;
  bottom: 104px;
  z-index: 4;
  width: clamp(96px, 13vw, 150px);
  pointer-events: none;
}
.koi-games { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.4)); }
.g-koi-name {
  text-align: center;
  font-size: 0.62rem;
  color: var(--g-text-muted);
  letter-spacing: 0.2em;
  margin-top: -4px;
}
.g-koi-bubble {
  position: absolute;
  right: 86%;
  bottom: 58%;
  min-width: 120px;
  max-width: 220px;
  padding: 9px 12px;
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  border: 1px solid rgba(99, 74, 42, 0.24);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  font-size: 0.76rem;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.g-koi-bubble.show { opacity: 1; transform: none; }

.g-combo {
  position: absolute;
  top: 84px;
  right: 18px;
  z-index: 6;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(150deg, #f8efd9, #f3e7c8);
  border: 1px solid #c9a06a;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}
.g-combo b { font-size: 1.3rem; color: var(--g-cinnabar); }
.g-combo span { font-size: 0.68rem; color: #6b5426; }
.g-combo.bump { animation: comboBump 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes comboBump { 0% { transform: scale(0.7); } 60% { transform: scale(1.16); } 100% { transform: none; } }

.g-feedback {
  position: absolute;
  top: 78px;
  left: 50%;
  transform: translate(-50%, -8px);
  z-index: 7;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.g-feedback.show { opacity: 1; transform: translate(-50%, 0); }
.g-feedback.ok { background: rgba(127, 183, 163, 0.95); color: #0b2420; }
.g-feedback.try { background: rgba(232, 196, 122, 0.95); color: #3a2a10; }

/* ---------------- 墨鯉動畫 ---------------- */

.koi-svg { display: block; overflow: visible; }
.koi-bob { animation: koiBob 3.6s ease-in-out infinite; transform-origin: 120px 80px; }
.koi-tail { animation: koiTail 2.2s ease-in-out infinite; transform-origin: 168px 82px; }
.koi-fin { animation: koiFin 2.8s ease-in-out infinite; transform-origin: 120px 60px; }
.koi-fin.p2 { animation-delay: -1.2s; }
.koi-eye .koi-pupil { animation: koiPupil 5s ease-in-out infinite; }
.koi-eyelid { transform-origin: 80px 70px; transform: scaleY(0); animation: koiBlink 6.4s infinite; }
.koi-whisker { animation: koiWhisker 3.4s ease-in-out infinite; transform-origin: 58px 92px; }
.koi-whisker.w2 { animation-delay: -1.6s; }
.koi-bubbles circle { animation: koiBubble 3.4s ease-in infinite; }
.koi-bubbles circle:nth-child(2) { animation-delay: -1.1s; }
.koi-bubbles circle:nth-child(3) { animation-delay: -2.2s; }
.koi-glow { animation: koiGlow 3s ease-in-out infinite; }
.koi-svg.talking .koi-bob { animation-duration: 1.5s; }
.koi-svg.talking .koi-tail { animation-duration: 0.7s; }
.koi-svg[data-mood="sleepy"] .koi-eyelid { transform: scaleY(1); animation: none; }
.koi-svg[data-mood="excited"] .koi-bob { animation-duration: 1.9s; }
.koi-svg[data-mood="thinking"] .koi-bob { animation-duration: 4.8s; }

@keyframes koiBob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-7px) rotate(1.4deg); }
}
@keyframes koiTail {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(8deg); }
}
@keyframes koiFin {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(7deg); }
}
@keyframes koiPupil {
  0%, 44%, 100% { transform: translate(0, 0); }
  52%, 66% { transform: translate(2.5px, -0.6px); }
  74%, 88% { transform: translate(-1.4px, 0.8px); }
}
@keyframes koiBlink {
  0%, 92%, 100% { transform: scaleY(0); }
  94%, 96% { transform: scaleY(1); }
}
@keyframes koiWhisker {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(5deg); }
}
@keyframes koiBubble {
  0% { transform: translate(0, 0) scale(0.7); opacity: 0; }
  30% { opacity: 0.8; }
  100% { transform: translate(-10px, -34px) scale(1.1); opacity: 0; }
}
@keyframes koiGlow {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.65; }
}

/* ---------------- 場景動態 ---------------- */

.scene-clouds .cloud { animation: cloudDrift 18s ease-in-out infinite alternate; }
.scene-clouds .c2 { animation-duration: 24s; animation-delay: -6s; }
@keyframes cloudDrift { from { transform: translateX(-18px); } to { transform: translateX(22px); } }

.scene-ripples .rip { animation: rippleFade 4.2s ease-in-out infinite; }
.scene-ripples .r2 { animation-delay: -1.1s; }
.scene-ripples .r3 { animation-delay: -2.2s; }
.scene-ripples .r4 { animation-delay: -3.1s; }
@keyframes rippleFade { 0%, 100% { opacity: 0.15; transform: translateX(0); } 50% { opacity: 0.5; transform: translateX(8px); } }

.scene-fireflies .fly { animation: flyFloat 6s ease-in-out infinite; }
.scene-fireflies .f2 { animation-delay: -1.4s; }
.scene-fireflies .f3 { animation-delay: -2.8s; }
.scene-fireflies .f4 { animation-delay: -4.2s; }
@keyframes flyFloat {
  0%, 100% { transform: translate(0, 0); opacity: 0.4; }
  50% { transform: translate(12px, -18px); opacity: 1; }
}

.scene-pads .pad { animation: padBob 5s ease-in-out infinite; transform-origin: center; }
.scene-pads .p2 { animation-delay: -1.7s; }
.scene-pads .p3 { animation-delay: -3.2s; }
@keyframes padBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.scene-lanterns .scene-lantern { animation: lanternSway 5.4s ease-in-out infinite; transform-origin: top center; }
.scene-lanterns .scene-lantern:nth-child(2) { animation-delay: -1.3s; }
.scene-lanterns .scene-lantern:nth-child(3) { animation-delay: -2.2s; }
.scene-lanterns .scene-lantern:nth-child(4) { animation-delay: -3.1s; }
@keyframes lanternSway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2.5deg); } }

.scene-fall rect { animation: fallShimmer 3s ease-in-out infinite; }
@keyframes fallShimmer { 0%, 100% { opacity: 0.75; } 50% { opacity: 0.98; } }
.scene-gate-rays path { animation: rayPulse 4s ease-in-out infinite; }
@keyframes rayPulse { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.55; } }
.scene-drum { animation: drumPulse 6s ease-in-out infinite; transform-origin: 400px 400px; }
@keyframes drumPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
.scene-scrolls rect { animation: scrollFloat 7s ease-in-out infinite; }
.scene-scrolls rect:nth-child(2) { animation-delay: -2.5s; }
@keyframes scrollFloat { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }

.dragon-float { animation: dragonFloat 6s ease-in-out infinite; transform-origin: 200px 140px; }
@keyframes dragonFloat { 0%, 100% { transform: translateY(0) rotate(-0.6deg); } 50% { transform: translateY(-10px) rotate(0.8deg); } }
.dragon-svg.hurt .dragon-float { animation: dragonHurt 0.5s ease; }
@keyframes dragonHurt {
  0%, 100% { transform: translateX(0); filter: none; }
  25% { transform: translateX(-8px); filter: brightness(1.6); }
  75% { transform: translateX(8px); }
}

/* ==========================================================================
   回聲洞
   ========================================================================== */

.echo-screen {
  width: min(880px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 8px;
}
.echo-crystals { display: flex; gap: 10px; }
.echo-crystal {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(243, 234, 214, 0.16);
  border: 1px solid rgba(243, 234, 214, 0.3);
  color: rgba(243, 234, 214, 0.7);
  font-size: 1rem;
  transition: all 0.3s ease;
}
.echo-crystal.lit { background: #f5e3b0; color: #8a6a22; box-shadow: 0 0 18px rgba(232, 196, 122, 0.75); transform: translateY(-2px); }
.echo-crystal.now { outline: 2px solid rgba(232, 196, 122, 0.7); }

.echo-card {
  position: relative;
  width: min(700px, 100%);
  padding: 30px 24px 22px;
  border-radius: 24px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.92), transparent 55%),
    linear-gradient(145deg, #f8efd9, #efe1c2);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.42);
}
.echo-seal {
  position: absolute;
  top: -14px;
  left: 24px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(150deg, #bd4a3e, #8e2f28);
  color: #fff4dd;
  font-family: var(--g-font-kai);
  font-size: 1.2rem;
  border: 2px solid rgba(255, 236, 200, 0.38);
  transform: rotate(-4deg);
}
.echo-text {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.04em;
  font-family: var(--g-font-kai);
  font-size: clamp(1.5rem, calc((min(100vw, 760px) - 130px) / var(--n, 9)), 3.1rem);
  line-height: 1.7;
  word-break: keep-all;
  color: var(--g-ink);
}
.echo-char {
  display: inline-block;
  transition: color 0.12s ease, transform 0.12s ease, background 0.12s ease;
  border-radius: 8px;
  padding: 0 0.03em;
}
.echo-char.speaking { color: var(--g-cinnabar); background: rgba(179, 69, 58, 0.12); transform: translateY(-3px) scale(1.06); }
.echo-meta { text-align: center; margin-top: 10px; font-size: 0.8rem; color: var(--g-muted); }

.echo-controls { display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(440px, 100%); }
.echo-mic {
  position: relative;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(160deg, #f5e3b0, #e8c47a);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35), inset 0 -4px 0 rgba(160, 120, 40, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #4a3312;
  touch-action: none;
  transition: transform 0.15s ease, background 0.2s ease;
}
.echo-mic.holding { transform: scale(0.94); background: linear-gradient(160deg, #e8c47a, #c9a06a); }
.echo-mic.ready { animation: micReady 2.4s ease-in-out infinite; }
.echo-mic.listening { background: linear-gradient(160deg, #bd4a3e, #8e2f28); color: #fff4dd; }
.echo-mic-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px solid rgba(232, 196, 122, 0.55);
  animation: listenPulse 2.4s ease-out infinite;
}
.echo-mic-icon { font-size: 2rem; line-height: 1; }
.echo-mic-label { font-size: 0.72rem; font-weight: 800; }
@keyframes micReady { 0%, 100% { box-shadow: 0 16px 34px rgba(0, 0, 0, 0.35); } 50% { box-shadow: 0 16px 34px rgba(232, 196, 122, 0.5), 0 0 0 8px rgba(232, 196, 122, 0.2); } }

.echo-meter {
  position: relative;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: rgba(243, 234, 214, 0.18);
  overflow: hidden;
}
.echo-meter-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #a9d5c4, #7fb7a3);
  transition: width 0.08s linear;
}
.echo-meter-fill.hot { background: linear-gradient(90deg, #e8c47a, #b3453a); }
.echo-meter-target {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 62%;
  width: 2px;
  background: rgba(243, 234, 214, 0.5);
}
.echo-hint { margin: 0; font-size: 0.84rem; color: rgba(243, 234, 214, 0.9); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); text-align: center; line-height: 1.6; }
.echo-skip { border: 0; background: rgba(243, 234, 214, 0.12); color: var(--g-text); border-radius: 999px; padding: 8px 16px; font-size: 0.82rem; }

/* ==========================================================================
   泡泡尋字
   ========================================================================== */

.bubble-game { width: min(920px, 100%); display: flex; flex-direction: column; gap: 12px; min-height: calc(100dvh - 260px); }
.bubble-head { text-align: center; color: var(--g-text); }
.bubble-lead { font-size: 0.92rem; letter-spacing: 0.06em; color: var(--g-text-muted); }
.bubble-target-char {
  display: inline-grid;
  place-items: center;
  width: 1.9em;
  height: 1.9em;
  margin-left: 10px;
  border-radius: 16px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  color: var(--g-ink);
  font-family: var(--g-font-kai);
  font-size: clamp(2rem, 5vw, 2.9rem);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.35);
}
.bubble-sentence {
  min-height: 58px;
  display: grid;
  place-items: center;
  padding: 10px 14px;
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 12% 0%, rgba(255, 252, 242, 0.9), transparent 55%),
    linear-gradient(145deg, #f8efd9, #efe1c2);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
}
.bubble-sentence-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  font-family: var(--g-font-kai);
  font-size: clamp(1.4rem, 4.4vw, 2.2rem);
  line-height: 1.7;
  color: var(--g-ink);
}
.bubble-char { padding: 0 1px; }
.bubble-blank {
  display: inline-grid;
  place-items: center;
  min-width: 1.3em;
  border-bottom: 3px solid var(--g-cinnabar);
  border-radius: 6px 6px 0 0;
  color: var(--g-cinnabar);
  background: rgba(179, 69, 58, 0.08);
}
.bubble-blank.filled { color: var(--g-jade-deep); background: #e7e6d2; border-color: var(--g-jade); animation: pop 0.4s ease; }
.bubble-audio-only { display: flex; align-items: center; gap: 8px; color: var(--g-text-muted); font-size: 0.9rem; }

.bubble-field { position: relative; flex: 1; height: auto; min-height: 300px; }
.bubble {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(232, 196, 122, 0.8);
  background:
    radial-gradient(circle at 32% 26%, #fffaf0, #f6ecd6 38%, #e3e6cf 70%, #b9d3c2);
  box-shadow: inset -8px -10px 20px rgba(63, 111, 95, 0.16), 0 14px 28px rgba(0, 0, 0, 0.35);
  animation: bubbleBob 4.6s ease-in-out infinite;
  animation-delay: var(--delay);
  transition: transform 0.15s ease;
  touch-action: manipulation;
}
.bubble span { font-family: var(--g-font-kai); font-size: clamp(1.7rem, 5vw, 2.5rem); color: #2b2620; text-shadow: none; }
.bubble:active { transform: scale(0.93); }
.bubble.popped { animation: bubblePop 0.45s ease forwards; }
.bubble.wrong { animation: shake 0.45s ease; }
.bubble.hint { box-shadow: 0 0 0 6px rgba(232, 196, 122, 0.65), 0 14px 28px rgba(0, 0, 0, 0.35); }
@keyframes bubbleBob {
  0%, 100% { transform: translateY(0) translateX(0); }
  33% { transform: translateY(-12px) translateX(6px); }
  66% { transform: translateY(-4px) translateX(-6px); }
}
@keyframes bubblePop {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.28); opacity: 0.8; }
  100% { transform: scale(0.2); opacity: 0; }
}
.bubble-burst-char {
  position: fixed;
  z-index: 120;
  transform: translate(-50%, -50%);
  font-family: var(--g-font-kai);
  font-size: 3rem;
  color: var(--g-gold-2);
  pointer-events: none;
  animation: burstChar 0.9s ease-out forwards;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
@keyframes burstChar {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; }
  35% { transform: translate(-50%, -80%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -180%) scale(0.9); opacity: 0; }
}
.bubble-foot { text-align: center; font-size: 0.84rem; color: var(--g-text-muted); }

/* ==========================================================================
   字卡翻翻
   ========================================================================== */

.memory-game { width: min(840px, 100%); display: flex; flex-direction: column; justify-content: center; gap: 14px; min-height: calc(100dvh - 250px); }
.memory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.memory-title { font-family: var(--g-font-kai); font-size: 1.3rem; color: var(--g-text); }
.memory-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); }
.memory-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.memory-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.mcard { position: relative; aspect-ratio: 1 / 1.12; border: 0; background: none; padding: 0; perspective: 900px; }
.mcard-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.45s cubic-bezier(0.2, 1.1, 0.4, 1); }
.mcard.open .mcard-inner, .mcard.peek .mcard-inner { transform: rotateY(180deg); }
.mcard-back, .mcard-front {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 15px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.mcard-back {
  background: linear-gradient(150deg, #2f5f54, #123b3d);
  border: 2px solid rgba(232, 196, 122, 0.32);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
}
.mcard-back i { font-family: var(--g-font-kai); font-style: normal; font-size: 2rem; color: rgba(245, 227, 176, 0.78); }
.mcard-front {
  transform: rotateY(180deg);
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  border: 2px solid #c9b48c;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.mcard-front b { font-size: clamp(1.8rem, 6vw, 3rem); line-height: 1; font-weight: 500; color: #2b2620; }
.mcard.kai .mcard-front b { font-family: var(--g-font-kai); }
.mcard.song .mcard-front b { font-family: var(--g-font-song); font-weight: 700; }
.mcard.done .mcard-front { background: #f3e7c8; border-color: #c9a06a; box-shadow: 0 0 0 3px rgba(232, 196, 122, 0.35); }
.mcard:active { transform: scale(0.97); }
.memory-foot { text-align: center; font-size: 0.86rem; color: var(--g-text-muted); }
.memory-foot b { font-family: var(--g-font-kai); font-size: 1.15rem; color: var(--g-text); }
.memory-tools .g-btn { background: linear-gradient(150deg, #f8efd9, #efe1c2); color: #2b2620; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); }

/* ==========================================================================
   搭橋過河
   ========================================================================== */

.bridge-game { width: min(920px, 100%); display: flex; flex-direction: column; justify-content: center; gap: 22px; min-height: calc(100dvh - 250px); }
.bridge-top { position: relative; display: flex; flex-direction: column; align-items: center; }
.bridge-track { position: relative; width: max-content; max-width: 100%; margin: 0 auto; padding-top: 82px; }
.bridge-koi {
  position: absolute;
  top: 0;
  left: calc(var(--p, 0) * (100% - 96px));
  width: clamp(72px, 11vw, 100px);
  transition: left 0.6s cubic-bezier(0.2, 1.2, 0.4, 1);
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.4));
  z-index: 2;
}
.bridge-koi .koi-svg { width: 100%; height: auto; }
.bridge-koi.crossing { animation: koiHop 0.6s ease 2; }
@keyframes koiHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px) rotate(-4deg); } }
.bridge-slots { display: flex; gap: clamp(6px, 2vw, 16px); justify-content: center; flex-wrap: wrap; }
.bridge-slot {
  position: relative;
  min-width: clamp(62px, 9vw, 86px);
  min-height: 62px;
  display: grid;
  place-items: center;
  padding: 4px 10px;
  border-radius: 50%;
  border: 3px solid #8a7756;
  background: radial-gradient(circle at 40% 32%, #efe1c2, #c9b48c 72%);
  box-shadow: inset 0 -5px 10px rgba(120, 100, 60, 0.2), 0 8px 16px rgba(0, 0, 0, 0.3);
  font-family: var(--g-font-kai);
  font-size: 1.5rem;
  color: #5a4a33;
}
.bridge-slot i { position: absolute; top: 4px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 0.66rem; color: rgba(70, 52, 30, 0.55); }
.bridge-slot.filled { border-style: solid; background: radial-gradient(circle at 40% 32%, #f8efd9, #e5d2a9 74%); animation: slotIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes slotIn { from { transform: scale(0.7) translateY(8px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.bridge-banks { display: flex; justify-content: space-between; padding: 10px 4px 0; font-size: 0.7rem; letter-spacing: 0.2em; color: var(--g-text-muted); }
.bridge-tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.bridge-tile {
  min-width: 76px;
  min-height: 66px;
  padding: 8px 14px;
  border-radius: 15px;
  border: 2px solid #c9b48c;
  background: linear-gradient(160deg, #f8efd9, #efe1c2);
  font-family: var(--g-font-kai);
  font-size: 1.7rem;
  color: var(--g-ink);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.bridge-tile.long { font-size: 1.22rem; }
.bridge-tile:hover { transform: translateY(-3px); }
.bridge-tile.used { opacity: 0.28; transform: scale(0.94); pointer-events: none; }
.bridge-tile.hint { box-shadow: 0 0 0 5px rgba(232, 196, 122, 0.55), 0 10px 20px rgba(0, 0, 0, 0.3); }
.bridge-tile.wrong { animation: shake 0.42s ease; }
.bridge-caption { text-align: center; color: var(--g-text-muted); font-size: 0.88rem; }
.bridge-caption b { font-family: var(--g-font-kai); font-size: 1.1rem; color: var(--g-text); }

/* ==========================================================================
   燈籠聽句
   ========================================================================== */

.lantern-game { width: min(1020px, 100%); position: relative; display: flex; flex-direction: column; justify-content: center; gap: 18px; padding-top: 4px; min-height: calc(100dvh - 260px); }
.lantern-moon {
  position: absolute;
  top: -30px;
  right: 4%;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #f5e3b0, #e8c47a);
  box-shadow: 0 0 60px rgba(232, 196, 122, 0.55);
  pointer-events: none;
}
.lantern-strings { display: flex; gap: clamp(8px, 2vw, 22px); justify-content: center; align-items: flex-start; flex-wrap: wrap; padding-top: 20px; }
.lantern-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(240px, 30%);
  min-width: 180px;
  border: 0;
  background: none;
  padding: 0;
}
.lantern-string { display: block; width: 2px; height: 34px; background: linear-gradient(#6b5426, #c9b48c); }
.lantern-body {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 30px;
  border-radius: 26px 26px 30px 30px;
  background: linear-gradient(160deg, #bd4a3e, #8e2f28);
  border: 2px solid rgba(255, 236, 190, 0.4);
  color: #fff4dd;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.4);
  animation: sway 5.2s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.8s);
  transform: rotate(var(--tilt, 0deg));
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.lantern-body::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 54px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 6px;
  background: #6f241f;
  box-shadow: inset 0 2px 0 rgba(255, 220, 160, 0.3);
}
.lantern-body::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 22px;
  pointer-events: none;
  opacity: 0.55;
  background: repeating-linear-gradient(90deg, transparent 0 16px, rgba(255, 224, 160, 0.14) 16px 18px);
}
.lantern-text { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; font-family: var(--g-font-kai); font-size: clamp(1.02rem, 2.2vw, 1.42rem); line-height: 1.55; text-shadow: 0 2px 4px rgba(60, 20, 16, 0.4); }
.lantern-text i { font-style: normal; }
.lantern-tassel { position: absolute; bottom: -20px; width: 3px; height: 20px; background: #e8c47a; border-radius: 2px; }
.lantern-opt.lit .lantern-body {
  background: linear-gradient(160deg, #f5e3b0, #e8c47a);
  color: #4a3312;
  box-shadow: 0 0 0 5px rgba(245, 227, 176, 0.38), 0 0 60px rgba(232, 196, 122, 0.7);
  animation: lanternRise 0.8s ease forwards;
}
@keyframes lanternRise { from { transform: translateY(0) rotate(var(--tilt, 0deg)); } to { transform: translateY(-14px) rotate(0deg); } }
.lantern-opt.wrong .lantern-body { animation: shake 0.42s ease; }
.lantern-opt.hint .lantern-body { outline: 4px solid rgba(245, 227, 176, 0.7); outline-offset: 3px; }
.lantern-caption { text-align: center; color: var(--g-text); font-size: 0.9rem; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65); }
.lantern-caption b { font-family: var(--g-font-kai); font-size: 1.12rem; }
@keyframes sway { 0%, 100% { transform: rotate(calc(var(--tilt, 0deg) - 1.2deg)); } 50% { transform: rotate(calc(var(--tilt, 0deg) + 1.6deg)); } }

/* ==========================================================================
   填空擂台
   ========================================================================== */

.fill-game { width: min(900px, 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; position: relative; min-height: calc(100dvh - 260px); }
.fill-banner { display: flex; gap: 6px; }
.fill-banner span {
  font-family: var(--g-font-kai);
  font-size: 1.2rem;
  padding: 6px 12px;
  border-radius: 8px;
  background: linear-gradient(160deg, #bd4a3e, #8e2f28);
  color: #fff4dd;
  border: 1px solid rgba(255, 236, 190, 0.3);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  transform: rotate(-2deg);
}
.fill-banner span:nth-child(2) { transform: rotate(1.5deg) translateY(3px); }
.fill-banner span:nth-child(3) { transform: rotate(-1deg) translateY(1px); }
.fill-banner span:nth-child(4) { transform: rotate(2deg) translateY(4px); }
.fill-combo {
  position: absolute;
  top: -8px;
  right: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 999px;
  background: linear-gradient(150deg, #f8efd9, #f3e7c8);
  border: 1px solid #c9a06a;
  z-index: 3;
}
.fill-combo b { font-size: 1.4rem; color: var(--g-cinnabar); }
.fill-combo span { font-size: 0.68rem; color: #6b5426; }
.fill-combo.bump { animation: comboBump 0.4s cubic-bezier(0.2, 1.6, 0.4, 1); }
.fill-scroll {
  width: 100%;
  padding: 26px 18px 18px;
  border-radius: 18px;
  background:
    repeating-linear-gradient(0deg, rgba(140, 110, 60, 0.06) 0 1px, transparent 1px 30px),
    linear-gradient(160deg, #f8efd9, #efe1c2);
  border: 2px solid #c9b48c;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.4);
}
.fill-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; font-family: var(--g-font-kai); font-size: clamp(1.6rem, 4.6vw, 2.5rem); line-height: 1.8; color: var(--g-ink); }
.fill-char { padding: 0 1px; }
.fill-blank {
  min-width: 1.2em;
  margin: 0 2px;
  border: 0;
  border-bottom: 3px solid var(--g-cinnabar);
  border-radius: 8px 8px 0 0;
  background: rgba(179, 69, 58, 0.1);
  font: inherit;
  color: var(--g-cinnabar);
  line-height: 1.2;
}
.fill-blank.active { animation: blankPulse 1.4s ease-in-out infinite; }
.fill-blank.filled { color: var(--g-ink); background: #e7e6d2; border-color: var(--g-jade); animation: blankIn 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
@keyframes blankPulse { 0%, 100% { background: rgba(232, 196, 122, 0.12); } 50% { background: rgba(232, 196, 122, 0.34); } }
@keyframes blankIn { from { transform: scale(0.6); opacity: 0.4; } to { transform: none; opacity: 1; } }
.fill-from { margin-top: 12px; text-align: center; font-size: 0.78rem; color: var(--g-muted); }
.fill-options { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.fill-option {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  border: 2px solid #c9b48c;
  background: linear-gradient(160deg, #f8efd9, #efe1c2);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.14s ease;
}
.fill-option span { font-family: var(--g-font-kai); font-size: 2.1rem; color: var(--g-ink); }
.fill-option:hover { transform: translateY(-3px); }
.fill-option.used { opacity: 0.25; transform: scale(0.9); pointer-events: none; }
.fill-option.wrong { animation: shake 0.42s ease; }
.fill-caption { text-align: center; font-size: 0.88rem; color: var(--g-text-muted); }
.fill-caption b { font-family: var(--g-font-kai); font-size: 1.1rem; color: var(--g-text); }

/* ==========================================================================
   龍門試煉
   ========================================================================== */

.dragon-game { width: min(980px, 100%); display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; position: relative; min-height: calc(100dvh - 250px); }
.dragon-top { position: relative; height: min(32vh, 250px); }
.dragon-hp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 3;
  width: max-content;
  margin: 0 auto;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(7, 26, 28, 0.66);
  border: 1px solid var(--g-line);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}
.dragon-hp-label { font-size: 0.7rem; color: var(--g-text-muted); letter-spacing: 0.12em; margin-right: 4px; }
.dragon-scale {
  width: 17px;
  height: 21px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(160deg, #a9d5c4, #2f5f54);
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.35s ease;
}
.dragon-scale.broken { opacity: 0.18; filter: grayscale(1); transform: rotate(45deg) scale(0.8); }
.dragon-stage { position: absolute; inset: 22px 0 0; display: grid; place-items: center; }
.dragon-svg { width: min(430px, 76%); height: auto; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.45)); }
.dragon-dialogue {
  align-self: center;
  max-width: min(640px, 100%);
  padding: 10px 18px;
  border-radius: 15px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  border: 1px solid rgba(99, 74, 42, 0.22);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
  font-size: 0.92rem;
  line-height: 1.6;
  text-align: center;
  color: var(--g-ink-2);
}
.dragon-dialogue.speak { animation: dialoguePop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1); }
@keyframes dialoguePop { from { transform: scale(0.94); opacity: 0.5; } to { transform: none; opacity: 1; } }
.dragon-task { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dragon-order-slots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dragon-slot {
  min-width: 60px;
  min-height: 50px;
  display: grid;
  place-items: center;
  padding: 4px 10px;
  border-radius: 11px;
  border: 2px dashed rgba(70, 52, 30, 0.3);
  background: rgba(246, 236, 214, 0.9);
  font-family: var(--g-font-kai);
  font-size: 1.3rem;
  color: var(--g-ink-2);
}
.dragon-slot.filled { border-style: solid; background: #f8efd9; color: var(--g-ink); animation: slotIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.dragon-order-tiles { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dragon-tile {
  min-width: 70px;
  min-height: 58px;
  padding: 6px 12px;
  border-radius: 13px;
  border: 2px solid #c9b48c;
  background: linear-gradient(160deg, #f8efd9, #efe1c2);
  font-family: var(--g-font-kai);
  font-size: 1.5rem;
  color: var(--g-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.dragon-tile.used { opacity: 0.25; transform: scale(0.92); pointer-events: none; }
.dragon-tile.wrong { animation: shake 0.4s ease; }
.dragon-hint { font-size: 0.78rem; color: var(--g-text-muted); text-align: center; }
.dragon-fill { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px; padding: 14px 18px; border-radius: 15px; background: linear-gradient(150deg, #f8efd9, #efe1c2); font-family: var(--g-font-kai); font-size: clamp(1.5rem, 4.2vw, 2.2rem); line-height: 1.8; color: var(--g-ink); }
.dragon-char { padding: 0 1px; }
.dragon-blank { min-width: 1.2em; border: 0; border-bottom: 3px solid var(--g-cinnabar); background: rgba(179, 69, 58, 0.08); font: inherit; color: var(--g-cinnabar); border-radius: 6px 6px 0 0; }
.dragon-blank.active { background: rgba(232, 196, 122, 0.28); animation: blankPulse 1.3s infinite; }
.dragon-blank.filled { color: var(--g-ink); background: #e7e6d2; border-color: var(--g-jade); }
.dragon-options { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.dragon-opt {
  width: 66px;
  height: 66px;
  border-radius: 15px;
  border: 2px solid #c9b48c;
  background: linear-gradient(160deg, #f8efd9, #efe1c2);
  font-family: var(--g-font-kai);
  font-size: 1.9rem;
  color: var(--g-ink);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.dragon-opt.used { opacity: 0.25; pointer-events: none; transform: scale(0.9); }
.dragon-opt.wrong { animation: shake 0.4s ease; }
.dragon-speak { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.dragon-speak-text {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1px;
  padding: 12px 18px;
  border-radius: 15px;
  background: linear-gradient(150deg, #f8efd9, #efe1c2);
  font-family: var(--g-font-kai);
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.7;
  color: var(--g-ink);
}
.dragon-speak-text .speaking { color: var(--g-cinnabar); background: rgba(179, 69, 58, 0.12); border-radius: 6px; }
.dragon-mic {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #f5e3b0, #e8c47a);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #4a3312;
  touch-action: none;
}
.dragon-mic.holding { transform: scale(0.95); }
.dragon-mic.voiced { background: linear-gradient(160deg, #e8c47a, #c9a06a); }
.dragon-mic-fill { position: absolute; left: 0; bottom: 0; height: 6px; width: 0; background: var(--g-jade); transition: width 0.1s linear; }
.dragon-mic-icon { font-size: 2rem; }
.dragon-mic-label { font-size: 0.66rem; font-weight: 800; }
.dragon-skip {
  border: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(243, 234, 214, 0.12);
  color: var(--g-text);
  font-size: 0.76rem;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}
.dragon-koi { position: absolute; left: 0; bottom: 0; width: 92px; opacity: 0.9; }
.dragon-koi .koi-svg { width: 100%; height: auto; }

/* ==========================================================================
   特效
   ========================================================================== */

#games-fx { position: fixed; inset: 0; z-index: 400; pointer-events: none; overflow: hidden; }
.fx-spark { position: absolute; width: 9px; height: 9px; margin: -4px; border-radius: 50%; background: currentColor; animation: sparkOut 1s ease-out forwards; }
.fx-char { position: absolute; font-family: var(--g-font-kai); font-size: 1.3rem; font-weight: 700; animation: sparkOut 1.1s ease-out forwards; }
@keyframes sparkOut {
  0% { transform: translate(0, 0) scale(0.6) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2) rotate(var(--rot)); opacity: 0; }
}
.fx-confetti {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 16px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
.fx-confetti.round { border-radius: 50%; width: 9px; height: 9px; }
@keyframes confettiFall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--drift), 108vh) rotate(var(--spin)); opacity: 0.9; }
}
.fx-float {
  position: fixed;
  z-index: 410;
  transform: translate(-50%, -50%);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--g-gold);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  animation: floatUp 1.1s ease-out forwards;
  pointer-events: none;
}
.fx-float.good { color: var(--g-jade-2); }
@keyframes floatUp {
  0% { transform: translate(-50%, -30%); opacity: 0; }
  25% { transform: translate(-50%, -70%); opacity: 1; }
  100% { transform: translate(-50%, -170%); opacity: 0; }
}
.fx-shake { animation: shake 0.42s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-1deg); }
  40% { transform: translateX(6px) rotate(1deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.fx-pop { animation: pop 0.42s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pop { 0% { transform: scale(0.86); } 60% { transform: scale(1.06); } 100% { transform: none; } }
.fx-ripple { position: fixed; width: 10px; height: 10px; margin: -5px; border: 2px solid var(--g-gold-2); border-radius: 50%; animation: rippleOut 0.9s ease-out forwards; }
@keyframes rippleOut { to { transform: scale(7); opacity: 0; } }

/* ==========================================================================
   響應式
   ========================================================================== */

@media (max-width: 980px) {
  .g-hero { grid-template-columns: 1fr; }
  .g-hero-koi { max-width: 560px; margin: 0 auto; width: 100%; }
  .g-hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g-settings { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .g-main { width: calc(100% - 24px); }
  .g-brand-copy i { display: none; }
  .g-star-chip i { display: none; }
  .g-me { display: none; }
  .g-hero h1 { font-size: clamp(1.85rem, 8vw, 2.5rem); }
  .g-bands { gap: 8px; }
  .g-band { padding: 12px 10px; }
  .g-band-name { font-size: 1rem; }
  .g-band-note { display: none; }
  .g-hub-grid, .g-games { grid-template-columns: 1fr; }
  .g-section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .g-daily { flex-wrap: wrap; }
  .g-daily .g-btn { width: 100%; }
  .g-today { flex-wrap: wrap; }
  .g-today-img { width: 96px; height: 70px; }
  .g-today .g-btn { width: 100%; }
  .g-result-sentence { flex-direction: column; }
  .g-result-scene { min-height: 170px; }
  .g-result-stats b { font-size: 1.15rem; }
  .g-koi-corner { display: none; }
  .g-board { padding-bottom: 180px; }
  .g-promptbar { gap: 10px; padding: 9px 10px; }
  .g-listen { width: 62px; height: 62px; }
  .g-listen-label { display: none; }
  .g-prompt-main { font-size: 1rem; }
  .g-prompt-sub { font-size: 0.72rem; }
  .lantern-opt { width: 100%; min-width: 0; }
  .lantern-strings { flex-direction: column; align-items: center; }
  .lantern-string { height: 16px; }
  .bubble-field { height: 44vh; }
  .bubble { width: calc(var(--size) * 0.9); height: calc(var(--size) * 0.9); }
  .memory-grid { gap: 7px; }
  .mcard-back i { font-size: 1.4rem; }
  .dragon-koi { display: none; }
  .fill-option { width: 62px; height: 62px; }
  .dragon-opt { width: 56px; height: 56px; font-size: 1.6rem; }
}

@media (max-width: 460px) {
  .g-top { padding: 8px 10px; gap: 8px; }
  .g-top-actions [data-action="open-board"] { display: none; }
  .g-brand-copy b { font-size: 0.92rem; }
  .g-top-actions { gap: 4px; }
  .g-icon-btn { width: 38px; height: 38px; }
  .g-star-chip { padding: 5px 8px; font-size: 0.8rem; }
  /* 手機：兩顆主鈕（繼續玩／我的貼紙簿）並排，不要各佔一整列；
     高度 58 → 46，字級縮一級，「繼續玩 · 回聲洞」才放得進半個畫面。 */
  .g-hero-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .g-hero-actions .g-btn { width: 100%; }
  .g-hero-actions .g-btn.lg { min-height: 46px; padding: 0 10px; font-size: .88rem; }
  .g-hero-actions .g-btn-ico { font-size: 1em; }
  .g-band-stars { font-size: 0.68rem; }
  .g-bands { grid-template-columns: 1fr; }
  .g-band { flex-direction: row; align-items: center; gap: 10px; }
  .g-band-age { width: 48px; }
  .g-result { padding-top: 24px; }
  .echo-text { font-size: clamp(1.6rem, 9vw, 2.4rem); }
  .echo-card { padding: 24px 14px 18px; }
}

/* 320px：頂欄五顆鈕要放得下，不讓橫向溢出。 */
@media (max-width: 380px) {
  .g-top { padding: 8px; gap: 6px; }
  .g-hero-actions { grid-template-columns: 1fr; }
  .g-seal { width: 36px; height: 36px; font-size: 20px; }
  .g-brand { gap: 6px; }
  .g-brand-copy b { font-size: 0.78rem; letter-spacing: 0.02em; white-space: nowrap; }
  .g-top-actions { gap: 3px; }
  .g-desk-btn { width: 32px; height: 32px; }
  .g-icon-btn { width: 32px; height: 32px; border-radius: 50%; font-size: 0.95rem; }
  .g-star-chip { padding: 4px 6px; font-size: 0.78rem; gap: 2px; }
  .g-hero h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}

body[data-reduced-motion="1"] *, body[data-reduced-motion="1"] *::before, body[data-reduced-motion="1"] *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
}

/* 2026-11-29 方案未解鎖的遊戲卡 */
.g-card.locked{opacity:.58;filter:saturate(.55)}
.g-card.locked .g-card-stars{color:#8a6a22;font-weight:700}
