* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  background: linear-gradient(#bfe6ff 0%, #e8f7ff 55%, #c8ecb0 55%, #a8db8c 100%);
  color: #3d3350;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
#app { position: fixed; inset: 0; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
button { font-family: inherit; color: inherit; cursor: pointer; border: none; }

.center-col { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 20px; text-align: center; }

/* 按鈕 */
.big-btn {
  width: 92px; height: 92px; border-radius: 28px; font-size: 46px;
  background: #fff; box-shadow: 0 6px 0 #d6cbe6, 0 10px 20px rgba(80, 60, 120, 0.15);
  transition: transform .1s;
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #d6cbe6; }
.icon-btn { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; background: rgba(255,255,255,.85); box-shadow: 0 3px 0 #d6cbe6; }
.parent-btn.pressing { background: #ffe4a8; }
.pulse { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

/* 設定頁 */
.setup h1 { margin: 0; font-size: 34px; }
.parent-note { font-size: 18px; margin: 0; color: #5b4a6b; }
.parent-note.small { font-size: 14px; opacity: .75; max-width: 420px; }
.age-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.age-btn { font-size: 28px; padding: 22px 30px; border-radius: 24px; background: #fff; box-shadow: 0 6px 0 #d6cbe6; font-weight: bold; }

/* 蛋 */
.egg-wrap { width: min(80vw, 380px); cursor: pointer; }
.egg-svg { width: 100%; display: block; }
.wobble { animation: wobble .45s; }
@keyframes wobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.hatching { animation: glow .9s forwards; }
@keyframes glow { to { filter: brightness(2.2) drop-shadow(0 0 40px #fff6b0); transform: scale(1.08); } }
.hint-hand { font-size: 48px; animation: tapHint 1.2s infinite; }
@keyframes tapHint { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
.pop { animation: pop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* 主畫面 */
.scene { height: 100%; display: flex; flex-direction: column; }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; gap: 10px; }
.top-right { display: flex; gap: 10px; }
.orbs { display: flex; gap: 6px; background: rgba(255,255,255,.7); padding: 10px 14px; border-radius: 22px; }
.orbs i { width: 18px; height: 18px; border-radius: 50%; background: #e3dcef; display: block; }
.orbs i.on { background: radial-gradient(circle at 35% 35%, #fff, #ffd84d 45%, #f5a524); box-shadow: 0 0 8px #ffd84d; }
.pet-stage { flex: 1; position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 0; }
.pet-wrap { width: min(92vw, 58vh, 600px); }
.pet-wrap.small { width: min(60vw, 40vh, 320px); }
.pet-stage .pet-wrap { cursor: pointer; }
.pet-svg { width: 100%; display: block; overflow: visible; }
.bottom-bar { display: flex; justify-content: center; gap: 22px; padding: 14px 14px 22px; }
.fx { position: absolute; inset: 0; pointer-events: none; }
.heart { position: absolute; bottom: 55%; font-size: 36px; animation: floatUp 1.5s ease-out forwards; }
@keyframes floatUp { from { transform: translateY(0) scale(.6); opacity: 1; } to { transform: translateY(-160px) scale(1.2); opacity: 0; } }
.fly-food { position: absolute; left: 50%; bottom: -20px; font-size: 56px; animation: flyFood .7s ease-in forwards; }
@keyframes flyFood { from { transform: translate(-50%, 0) scale(1.2); } to { transform: translate(-50%, -45vh) scale(.5); opacity: .4; } }

/* 小龍動畫 */
.breathe { animation: breathe 3s ease-in-out infinite; transform-origin: 200px 392px; }
@keyframes breathe { 0%,100% { transform: scaleY(1); } 50% { transform: scaleY(1.025); } }
.wing-flap { animation: flap 2.6s ease-in-out infinite; transform-origin: 0 0; }
@keyframes flap { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
.eye { animation: blink 4.5s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink { 0%,94%,100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.zzz { animation: zzz 2s infinite; }
@keyframes zzz { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

/* 題目 */
.quiz { height: 100%; display: flex; flex-direction: column; background: rgba(255,255,255,.35); }
.quiz-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; gap: 10px; }
.round-dots { display: flex; gap: 10px; }
.round-dots i { width: 20px; height: 20px; border-radius: 50%; background: #e3dcef; display: block; }
.round-dots i.now { background: #a78bfa; transform: scale(1.2); }
.round-dots i.done { background: #ffd84d; }
.mini-pet { width: 110px; }
.quiz-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 10px 16px 24px; min-height: 0; }
.replay { width: 96px; height: 96px; border-radius: 50%; font-size: 48px; background: #fff; box-shadow: 0 6px 0 #d6cbe6; animation: pulse 1.6s infinite; flex-shrink: 0; }
.stem-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,.8); border-radius: 24px; padding: 12px 18px; max-width: 94vw; }
.stem-item { font-size: 48px; line-height: 1; display: inline-flex; }
.stem-row.many .stem-item { font-size: 38px; }
.stem-item.gift { filter: drop-shadow(0 0 6px #ffd84d); }
.stem-item.q { font-size: 44px; font-weight: bold; color: #a78bfa; }
.stem-item.big .opt-svg { width: 120px; height: 120px; }
.stem-row.balloons .opt-svg { width: 44px; height: 66px; }
.arrow { font-size: 30px; color: #a78bfa; }
.options { display: grid; gap: 16px; width: 100%; max-width: 640px; grid-template-columns: repeat(3, 1fr); }
.options.n2 { grid-template-columns: repeat(2, 1fr); max-width: 460px; }
.opt {
  aspect-ratio: 1; border-radius: 28px; background: #fff; box-shadow: 0 6px 0 #d6cbe6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px;
  transition: transform .1s, opacity .2s;
}
.opt:active { transform: translateY(4px); }
.opt.locked { opacity: .55; }
.opt.reading { opacity: 1; outline: 5px solid #a78bfa; transform: scale(1.05); }
.opt.picked { outline: 5px solid #a78bfa; }
.opt.right { background: #dcfce7; outline: 5px solid #22c55e; opacity: 1; }
.opt.hint { animation: pulse 1s infinite; }
.opt.wrong { background: #fee2e2; animation: shake .4s; }
.opt .emoji { font-size: min(16vw, 72px); line-height: 1; }
.opt .opt-svg { width: 80%; height: 80%; }
.opt .num { font-size: min(13vw, 56px); font-weight: bold; color: #5b4a6b; line-height: 1; }
.num-dots { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; max-width: 80%; margin-top: 6px; }
.num-dots i { width: 10px; height: 10px; border-radius: 50%; background: #f59e0b; display: block; }
.swatch { width: 70%; height: 70%; border-radius: 50%; border: 4px solid #5b4a6b; }
.hanzi { font-size: min(15vw, 68px); font-weight: bold; color: #3d3350; }
.plate { width: 88%; aspect-ratio: 1; border-radius: 50%; background: #f8f3ea; border: 4px solid #e2d6c3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; align-content: center; gap: 2px; padding: 12%; font-size: min(7vw, 32px); }
.speaker-opt { font-size: 52px; display: flex; flex-direction: column; align-items: center; }
.speaker-opt b { font-size: 32px; }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.shake { animation: shake .4s; }

/* 分類題 */
.sort-items { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.sort-item { width: 96px; }
.sort-item.placed { visibility: hidden; }
.buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 560px; }
.bucket { min-height: 150px; border-radius: 28px; box-shadow: 0 6px 0 #c3cfe6; display: flex; flex-direction: column; align-items: center; padding: 12px; gap: 6px; }
.bucket.locked { opacity: .6; }
.bucket-label { font-size: 52px; }
.bucket-in { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; font-size: 36px; }
.bucket-in .emoji { font-size: 40px; }

/* 打扮 */
.wardrobe { height: 100%; display: flex; flex-direction: column; }
.w-pet { display: flex; justify-content: center; }
.w-pet .pet-wrap { width: min(70vw, 38vh, 360px); }
.w-grid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 12px 16px 24px; align-content: start; max-width: 640px; margin: 0 auto; width: 100%; }
.w-item { aspect-ratio: 1; border-radius: 22px; background: #fff; box-shadow: 0 5px 0 #d6cbe6; padding: 6px; }
.w-item svg { width: 100%; height: 100%; }
.w-item.on { outline: 5px solid #22c55e; background: #dcfce7; }
.w-item.silhouette svg { filter: brightness(0) opacity(.18); }

/* 覆蓋層 */
.overlay { position: fixed; inset: 0; background: rgba(40, 30, 70, .45); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.reward-card { background: #fff; border-radius: 36px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.reward-card .item-big { width: 200px; height: 200px; }
.reward-card .pet-wrap { width: min(70vw, 50vh, 360px); }
.gift-burst { font-size: 48px; animation: pop .5s; }
.night { background: linear-gradient(#2b2d6e, #4b4a9c); color: #fff; }
.night .parent-note { color: #e5e1ff; }

/* 家長頁 */
.parent-card { background: #fff; border-radius: 24px; padding: 20px 22px; width: min(560px, 100%); max-height: 92vh; overflow: auto; user-select: text; font-size: 15px; }
.parent-card h2 { margin: 0 0 8px; }
.parent-card .small { font-size: 12.5px; color: #6b6280; }
.ptable { width: 100%; border-collapse: collapse; margin: 8px 0; }
.ptable th, .ptable td { border-bottom: 1px solid #eee; padding: 7px 6px; text-align: left; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pbtn { padding: 10px 14px; border-radius: 12px; background: #f1edf8; font-size: 15px; }
.pbtn.primary { background: #a78bfa; color: #fff; }
.pbtn.danger { background: #fee2e2; color: #b91c1c; }

/* 測試面板 */
.testpanel { position: fixed; left: 6px; top: 78px; z-index: 100; background: rgba(20,20,40,.85); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 10px; max-width: 330px; display: flex; flex-direction: column; gap: 5px; }
.testpanel button { font-size: 12px; padding: 3px 7px; margin: 1px; border-radius: 6px; background: #4b4a7a; color: #fff; }
.testpanel button.on { background: #f59e0b; }
.testpanel.mini > *:not(b):not(div:last-child) { display: none; }

@media (orientation: landscape) and (max-height: 520px) {
  .pet-wrap { width: min(50vw, 62vh, 400px); }
  .options { max-width: 520px; }
  .opt .emoji { font-size: 48px; }
  .quiz-body { gap: 12px; }
  .replay { width: 72px; height: 72px; font-size: 36px; }
}

.export-box { width: 100%; height: 120px; margin-top: 10px; font-size: 11px; }

/* 多個孩子 */
.profiles { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; }
.profile-btn { position: relative; width: 150px; height: 170px; border-radius: 30px; background: #fff; box-shadow: 0 6px 0 #d6cbe6; padding: 8px; }
.profile-pet { display: block; width: 100%; height: 120px; }
.profile-pet .pet-svg { width: 100%; height: 100%; }
.egg-emoji { font-size: 80px; line-height: 120px; }
.profile-avatar { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); font-size: 40px; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.avatar-btn { width: 84px; height: 84px; border-radius: 24px; font-size: 52px; background: #fff; box-shadow: 0 5px 0 #d6cbe6; }

/* 快進化發光 */
.pet-wrap.glow-soon .pet-svg { animation: glowSoon 1.8s ease-in-out infinite; }
@keyframes glowSoon { 0%,100% { filter: drop-shadow(0 0 4px #fff3b0); } 50% { filter: drop-shadow(0 0 26px #ffd84d); } }
.orbs.soon { box-shadow: 0 0 14px #ffd84d; }

/* 小遊戲 */
.round-dots .game-dot { width: auto; height: auto; background: none; font-style: normal; font-size: 18px; opacity: .5; }
.game { height: 100%; display: flex; flex-direction: column; }
.game-area { flex: 1; position: relative; min-height: 0; }
.game-area canvas { display: block; touch-action: none; }
.game-score { font-size: 26px; font-weight: bold; background: rgba(255,255,255,.85); padding: 6px 14px; border-radius: 18px; }
.game-time { flex: 1; height: 14px; border-radius: 8px; background: rgba(255,255,255,.7); overflow: hidden; max-width: 320px; }
.game-time i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #86efac, #22c55e); transition: width .2s linear; }
.game-result { font-size: 44px; font-weight: bold; }

/* 家長頁 */
.today-box { background: #fef9c3; border-radius: 14px; padding: 10px 12px; margin: 6px 0 10px; line-height: 1.6; }
.stats { margin-top: 10px; background: #f6f3fb; border-radius: 12px; padding: 8px 12px; }
.stats summary { cursor: pointer; font-weight: bold; }

/* ─── 睡前儀式與睡覺畫面 ─── */
.bedtime { position: relative; min-height: 100%; background: linear-gradient(#ffe9c7, #f7c9a8); transition: background 1.2s; gap: 18px; }
.bedtime.dark { background: linear-gradient(#2b2d6e, #4b4a9c); }
.bedtime .pet-wrap { position: relative; }
.bed-pet { position: relative; }
.blanket { position: absolute; left: 50%; bottom: 4%; transform: translateX(-50%); width: 92%; height: 0; border-radius: 40px 40px 16px 16px;
  background: repeating-linear-gradient(45deg, #b9d7ff 0 14px, #d6e7ff 14px 28px); transition: height .9s ease; z-index: 2; }
.blanket.on { height: 32%; }
.bed-steps { display: flex; gap: 16px; }
.bed-step.wait { opacity: .35; pointer-events: none; }
.bed-step.next { animation: bedPulse 1.2s infinite; }
.bed-step.done { opacity: .5; pointer-events: none; }
@keyframes bedPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }

.sleep-scene { min-height: 100%; background: linear-gradient(#1f2160, #3d3c86); }
.sleep-pet { position: relative; }
.sleep-pet .pet-wrap { filter: brightness(.82) saturate(.85); cursor: pointer; }
.breathe { animation: breathe 4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes breathe { 0%,100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.03); } }
.stir { animation: stir .7s ease, breathe 4s ease-in-out .7s infinite; }
@keyframes stir { 0%,100% { transform: rotate(0); } 30% { transform: rotate(-3deg); } 65% { transform: rotate(2deg); } }
.zs { position: absolute; right: 18%; top: 4%; color: #e5e1ff; font-weight: 700; z-index: 3; }
.zs span { position: absolute; opacity: 0; animation: zfloat 4.5s infinite; font-size: 22px; }
.zs span:nth-child(2) { animation-delay: 1.5s; font-size: 28px; }
.zs span:nth-child(3) { animation-delay: 3s; font-size: 36px; }
@keyframes zfloat { 0% { opacity: 0; transform: translate(0, 0); } 25% { opacity: .9; } 100% { opacity: 0; transform: translate(30px, -70px); } }
.dream { position: absolute; left: 8%; top: 0; z-index: 3; width: 74px; height: 74px; border-radius: 50%;
  background: rgba(255,255,255,.88); display: grid; place-items: center; font-size: 36px;
  box-shadow: 0 0 22px rgba(255,255,255,.5); animation: dreamFloat 3s ease-in-out infinite; }
.dream::after { content: ''; position: absolute; right: -14px; bottom: -12px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.75); }
@keyframes dreamFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.yawn { animation: yawn 2.4s ease; }
@keyframes yawn { 0%,100% { transform: scale(1); } 40% { transform: scale(1.04, .96); } 60% { transform: scale(.98, 1.03); } }

/* 白天睡午覺：維持亮色，拉上窗簾 */
.bedtime.nap.dark { background: linear-gradient(#ffe2b8, #f3c7a2); }
.nap-scene { background: linear-gradient(#ffe7c2, #f6caa6); color: #6b4a3a; position: relative; overflow: hidden; }
.nap-scene .parent-note { color: #6b4a3a; }
.nap-scene .sleep-pet .pet-wrap { filter: none; }
.nap-scene .zs { color: #b78a6e; }
.curtain { position: absolute; top: 0; height: 100%; width: 0; background: repeating-linear-gradient(90deg, #f6a5a5 0 18px, #f9bcbc 18px 36px);
  opacity: .55; transition: width 1s ease; z-index: 1; pointer-events: none; }
.curtain.l { left: 0; } .curtain.r { right: 0; }
.bedtime.nap.dark .curtain, .curtain.closed { width: 26%; }
.bedtime.nap .bed-steps, .bedtime.nap .bed-pet { z-index: 2; }
.nap-scene .parent-note, .nap-scene .sleep-pet, .nap-scene .parent-btn, .nap-scene .pbtn { position: relative; z-index: 2; }

/* 護眼休息 */
.eye-break { min-height: 100%; background: linear-gradient(#cfeaff, #e9f7e4); gap: 14px; }
.far-view { font-size: 54px; letter-spacing: 18px; opacity: .85; animation: dreamFloat 4s ease-in-out infinite; }
.eye-count { font-size: 56px; font-weight: 800; color: #4a7bd0; }

/* ─── 美術圖版小龍 ─── */
.pet-art { position: relative; width: 100%; aspect-ratio: 1; isolation: isolate; transform-origin: 50% 96%; }
.pet-art .pa-body, .pet-art .pa-items, .pet-art .pa-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pet-art .pa-img { display: block; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.pet-art .pa-items { overflow: visible; pointer-events: none; }
/* 光澤層：身體金色、金龍的金屬反光（2026-11-21：取消彩虹龍的珍珠光） */
.pet-art .pa-sheen { position: absolute; inset: 0; pointer-events: none; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; background-size: 300% 300%; }
.pet-art .pa-sheen.gold { mix-blend-mode: overlay; background-image: linear-gradient(115deg, rgba(255,255,255,0) 35%, rgba(255,252,225,.85) 50%, rgba(255,255,255,0) 65%); background-size: 250% 100%; animation: sheenSweep 4.5s ease-in-out infinite; }
/* 金龍完成：金光＋閃光 */
.pet-art.golden .pa-body { filter: saturate(1.15) contrast(1.06) drop-shadow(0 0 7px rgba(255,214,90,.75)); }
.pet-art .pa-sparks { position: absolute; inset: 0; pointer-events: none; }
.pet-art .pa-sparks i { position: absolute; width: 7%; aspect-ratio: 1; margin: -3.5% 0 0 -3.5%; transform: scale(0); animation: sparkTw 2.6s ease-in-out infinite;
  background: radial-gradient(circle, #fff 0 16%, transparent 19%), conic-gradient(from 45deg, transparent 0 10%, #fff8d0 12%, transparent 14% 35%, #fff8d0 37%, transparent 39% 60%, #fff8d0 62%, transparent 64% 85%, #fff8d0 87%, transparent 89%);
  filter: drop-shadow(0 0 4px #fff3a0); }
@keyframes sparkTw { 0%, 100% { transform: scale(0) rotate(0); opacity: 0; } 45% { transform: scale(var(--s, 1)) rotate(25deg); opacity: 1; } 70% { transform: scale(0) rotate(45deg); opacity: 0; } }
@keyframes sheenFlow { from { background-position: 0% 50%; } to { background-position: 150% 50%; } }
@keyframes sheenSweep { 0% { background-position: 120% 0; } 60%, 100% { background-position: -20% 0; } }
@media (prefers-reduced-motion: reduce) { .pet-art .pa-sheen, .pet-art .pa-sparks i { animation: none; } .pet-art .pa-sparks i { transform: scale(var(--s, 1)); opacity: .8; } }
.pet-art .pa-shadow { position: absolute; left: 30%; right: 30%; bottom: 2%; height: 4%; border-radius: 50%; background: radial-gradient(rgba(0,0,0,.22), rgba(0,0,0,0) 70%); }
.pet-art.hop { animation: artHop .8s ease 2; }
@keyframes artHop { 0%,100% { transform: translateY(0) scale(1); } 30% { transform: translateY(-6%) scale(1.02, .98); } 60% { transform: translateY(0) scale(1.03, .97); } }
.pet-art.droop { filter: saturate(.8) brightness(.96); transform: scale(.98); }
.pet-wrap.glow-soon .pet-art { animation: glowSoon 1.8s ease-in-out infinite; }
.profile-pet .pet-art { width: 100%; height: 100%; }
#app.has-scene { background-size: cover; background-position: center 62%; }
#app.has-scene .scene, #app.has-scene .egg-screen { background: none; }
.egg-img { width: min(88vw, 58vh, 540px); display: block; margin: 0 auto; filter: drop-shadow(0 8px 10px rgba(0,0,0,.14)); }
.hatched { position: relative; display: flex; flex-direction: column; align-items: center; }
.hatched .egg-shell { width: min(88vw, 58vh, 540px); display: block; position: relative; z-index: 0; }
.hatched .pet-wrap { position: relative; z-index: 1; width: min(62vw, 40vh, 380px); margin-bottom: calc(-0.42 * min(88vw, 58vh, 540px)); }
.emo-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scene-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(94vw, 720px); }
.scene-btn { aspect-ratio: 3/4; border: 4px solid #fff; border-radius: 22px; background-size: cover; background-position: center; display: flex; align-items: flex-end; justify-content: center; padding: 10px; box-shadow: 0 6px 16px rgba(0,0,0,.15); cursor: pointer; }
.scene-btn span { background: rgba(255,255,255,.9); border-radius: 14px; padding: 6px 10px; font-size: 18px; font-weight: 700; color: #4a3b5c; }
#app.has-scene .pet-stage .pet-wrap { width: min(94vw, 64vh, 680px); }

/* 選小龍是男生還是女生 */
.gender-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: min(90vw, 560px); }
.gender-btn { border: 5px solid #fff; border-radius: 26px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; box-shadow: 0 6px 16px rgba(0,0,0,.15); cursor: pointer; }
.gender-btn.boy { background: #dbeafe; }
.gender-btn.girl { background: #fce7f3; }
.gender-btn img { width: 70%; aspect-ratio: 1; object-fit: contain; }
.gender-btn span { font-size: 20px; font-weight: 700; color: #4a3b5c; }
.gender-btn.on { border-color: #a78bfa; transform: scale(1.04); }
.big-ok { margin-top: 18px; width: 92px; height: 92px; border-radius: 50%; background: #a78bfa; color: #fff; font-size: 46px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }

/* 孵蛋畫面（2026-11-21 改成平躺的蛋＋小窩）：蛋放在空地中間偏下 */
#app.has-scene .egg-screen { justify-content: flex-end; padding-bottom: max(9vh, 56px); gap: 4px; }
.egg-wrap { width: auto; display: flex; justify-content: center; }
/* 點擊提示的手指疊在蛋的右下角，不佔蛋下面的空間（2026-11-21），蛋才能坐在跟主畫面小龍一樣的地面上 */
.egg-box { position: relative; }
.egg-box .hint-hand { position: absolute; right: 10%; bottom: 8%; pointer-events: none; z-index: 2; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }

/* 進化挑戰（2026-11-21） */
.round-dots { align-items: center; }
.round-dots i.miss { background: #cfc8da; }
.quiz.challenge .quiz-top { background: linear-gradient(90deg, rgba(255,216,77,.35), rgba(255,255,255,0)); border-radius: 16px; }
.challenge-btn { background: linear-gradient(#ffe27a, #ffc93c); animation: chPulse 1.6s ease-in-out infinite; }
.challenge-btn.wait { animation: none; filter: grayscale(.6); opacity: .7; }
@keyframes chPulse { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,201,60,.6); } 50% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(255,201,60,0); } }
/* 情緒題答對：小龍的表情跳出來 */
.quiz-body { position: relative; }
.emo-feel { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); width: min(42vw, 200px); background: #fff; border-radius: 24px; padding: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); z-index: 5; }
.emo-feel img, .emo-feel svg { width: 100%; height: auto; display: block; }
.emo-feel .pop { position: relative; }
.emo-feel .emo-heart { position: absolute; right: -8px; top: -12px; font-size: 40px; animation: heartBeat .7s ease-in-out infinite alternate; }
@keyframes heartBeat { from { transform: scale(.9); } to { transform: scale(1.15); } }
/* 家長報告：還不會清單 */
.need-list { margin: 6px 0 10px; padding: 0; list-style: none; }
.need-list li { background: #fff7e6; border-radius: 12px; padding: 8px 10px; margin: 6px 0; line-height: 1.5; }
.need-list li .tip { display: block; font-size: 13px; color: #6b5a3a; }
.need-list.learned li { background: #eaf8ef; }
.notice { background: #eef6ff; border-radius: 12px; padding: 8px 10px; font-size: 14px; }

/* 試玩密碼頁 */
.gate h1 { margin: 0; font-size: 26px; }
.gate p { margin: 0; max-width: 300px; line-height: 1.6; }
.gate-logo { width: 180px; height: 180px; object-fit: contain; margin-bottom: -10px; }
.gate form { display: flex; gap: 8px; }
.gate input { font-size: 18px; padding: 10px 14px; border-radius: 14px; border: 2px solid #d8cfe8; width: 180px; }
.gate-msg { color: #d0453b; min-height: 1.4em; }
