/* 遊戲頁共用樣式：遊戲頁在 site.css 之後載入 */
.game-page { padding: 8px 0; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 18px; }
.game-top h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }
.back-link { font-weight: 700; text-decoration: none; border-bottom: 2.5px solid var(--ink); }
.back-link:hover { color: var(--coral); border-color: var(--coral); }

.stage {
  background: var(--white);
  border: var(--line); border-radius: 26px; box-shadow: var(--pop-lg);
  padding: clamp(16px, 4vw, 32px);
  min-height: 360px;
}
.kids .stage { background: var(--kids-pale); }
.hud { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.hud-item {
  font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 3px 14px; border: var(--line); border-radius: 999px; background: var(--sun-pale);
}

.game-about { max-width: 760px; padding: 28px 0 0; }
.game-about h2 { font-size: 1.35rem; margin: 1.2em 0 .3em; }
.game-about p { color: var(--ink-soft); margin: 0; }

.result { text-align: center; padding: 28px 0; }
.result .big { font-size: 4rem; line-height: 1; }
.result h2 { margin: 14px 0 4px; font-size: 1.8rem; }
.result p { color: var(--ink-soft); margin: 0 0 22px; font-size: 1.1rem; }

/* 教學說明區 */
.lesson { max-width: 760px; }
.lesson h2 { font-size: 1.35rem; margin: 1.4em 0 .3em; }
.lesson p, .lesson li { color: var(--ink-soft); }
.lesson table { border-collapse: collapse; margin: 8px 0; }
.lesson td, .lesson th { border-collapse: collapse; border: 2px solid var(--ink); padding: 4px 12px; text-align: center; background: var(--white); }
.lesson b { color: var(--ink); }
.lesson ul ul { margin: 4px 0; }
.btn.small { font-size: 1rem; padding: 6px 14px; border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); }

/* 兒童區：字更大、按鈕更大 */
.kids .btn { font-size: 1.5rem; padding: 14px 28px; border-radius: 18px; }
.kids .stage { font-size: 1.15rem; }

/* ── 兒童遊戲回饋（kidkit.js）：彩紙、彈跳、開始畫面、靜音鍵、過關星星 ── */
.kid-confetti { position: fixed; z-index: 9999; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 3px; pointer-events: none; font-size: 18px; line-height: 10px; animation: kid-fly .85s cubic-bezier(.2, .7, .3, 1) forwards; }
.kid-confetti.star { width: auto; height: auto; }
@keyframes kid-fly { 0% { transform: translate(0, 0) rotate(0) scale(.6); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 40px)) rotate(var(--rot)) scale(1); opacity: 0; } }
.kid-bounce { animation: kid-bounce .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes kid-bounce { 0% { transform: scale(1); } 35% { transform: scale(1.18) rotate(-3deg); } 70% { transform: scale(.96); } 100% { transform: scale(1); } }
.kid-start { text-align: center; padding: 34px 10px 40px; }
.kid-start-icon { width: 88px; height: 88px; margin: 0 auto 10px; display: grid; place-items: center; font-size: 2.4rem; border-radius: 50%; background: var(--sun); border: var(--line); box-shadow: var(--pop); animation: kid-breathe 1.8s ease-in-out infinite; }
@keyframes kid-breathe { 50% { transform: scale(1.08); } }
.kid-start h2 { margin: 6px 0; font-size: 1.8rem; }
.kid-start p { color: var(--ink-soft); margin: 0 0 18px; }
.kid-start-btn { font-size: 1.5rem !important; padding: 12px 34px !important; }
.hud-spacer { flex: 1; }
.kid-mute { font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--ink); padding: 3px 12px; border: var(--line); border-radius: 999px; background: var(--white); }
.kid-star-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px; margin: 10px 0 0; font-size: 1.8rem; color: #d8cfbf; }
.kid-star-row .on { color: #f0b400; animation: kid-pop-in .4s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes kid-pop-in { from { transform: scale(0) rotate(-90deg); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .kid-start-icon, .kid-star-row .on, .kid-bounce { animation: none; } }
