/* ---------- 말하기 · 손글씨 놀이 ---------- */

/* 마이크 단추 (sayKit) */
.mic-panel { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 150px; }
.mic-label { margin: 0; font-family: var(--font-display); font-size: 18px; color: var(--ink-soft); }
.mic-btn {
  position: relative; width: 96px; height: 96px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--sub); box-shadow: 0 var(--press) 0 var(--sub-deep); transition: transform .15s, background .25s, opacity .25s;
}
.mic-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sub-deep); }
.mic-icon { position: relative; font-size: 46px; line-height: 1; }
.mic-ring { position: absolute; inset: -6px; border-radius: 50%; border: 4px solid var(--sub); opacity: 0; pointer-events: none; }
.mic-panel[data-state="ready"] .mic-ring, .mic-panel[data-state="retry"] .mic-ring { animation: mic-call 1.4s ease-out infinite; }
.mic-panel[data-state="listening"] .mic-btn { background: #F0506A; box-shadow: 0 var(--press) 0 #B72A42; }
.mic-panel[data-state="listening"] .mic-ring { opacity: 1; border-color: #F0506A; animation: mic-listen 1s ease-in-out infinite; }
.mic-panel.voice .mic-ring { animation-duration: .45s; border-width: 7px; }
.mic-panel[data-state="pass"] .mic-btn { background: var(--success); box-shadow: 0 var(--press) 0 var(--success-deep); }
.mic-panel[data-state="wait"] .mic-btn, .mic-panel[data-state="idle"] .mic-btn { opacity: .4; pointer-events: none; }
.mic-panel[data-state="blocked"] .mic-btn { opacity: .35; pointer-events: none; }
@keyframes mic-call { 0% { opacity: .9; scale: 1; } 100% { opacity: 0; scale: 1.45; } }
@keyframes mic-listen { 50% { scale: 1.18; opacity: .55; } }
.mic-status { margin: 0; min-height: 1.3em; font-family: var(--font-display); font-size: 20px; color: var(--ink); text-align: center; }
.mic-heard { margin: 0; max-width: 90vw; font-size: 18px; color: var(--ink-soft); text-align: center; }
.mic-heard:empty { display: none; }
.mic-heard::before { content: "👂 "; }
.mic-extra { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mic-extra:empty { display: none; }
.mic-done, .mic-skip { min-height: 48px; font-size: 18px; }

/* 따라 말하기 · 받아쓰기 · 따라서 읽어보기 (sayAfter) */
.sayafter { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.sa-stage { display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap; gap: 18px 28px; }
.sa-who { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sa-friend { padding: 0; border: 0; background: none; cursor: pointer; font-size: 112px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .12)); transition: rotate .3s; }
.sa-friend.talk { animation: bob .45s ease-in-out infinite; }
.sa-friend.happy { animation: sa-jump .6s var(--spring) 2; }
.sa-friend.puzzled { rotate: -14deg; }
@keyframes sa-jump { 40% { translate: 0 -26px; scale: 1.06; } }
.sa-bubble {
  position: relative; max-width: 260px; min-height: 44px; padding: 8px 16px; border-radius: 18px; background: #fff;
  font-family: var(--font-display); font-size: 22px; color: var(--ink); text-align: center; box-shadow: var(--shadow-card);
  opacity: 0; translate: 0 8px; transition: opacity .25s, translate .25s;
}
.sa-bubble.show { opacity: 1; translate: 0 0; }
.sa-bubble::after { content: ""; position: absolute; left: 50%; bottom: -10px; translate: -50% 0; border: 10px solid transparent; border-bottom: 0; border-top-color: #fff; }
.sa-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 210px; max-width: min(520px, 92vw);
  padding: 18px 28px 20px; border-radius: var(--r-lg); background: #fff; border: 4px solid var(--line); box-shadow: var(--shadow-card);
}
.sa-card.deal { animation: pop .45s var(--spring); }
.sa-pic { font-size: 74px; line-height: 1.1; }
.sa-card.no-pic .sa-pic { display: none; }
.sa-text { font-family: var(--font-display); font-size: 38px; line-height: 1.25; color: var(--ink); text-align: center; }
.sa-text.latin { font-family: var(--font-latin); font-weight: 700; }
.sa-hint { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--sub-soft); font-size: 20px; cursor: pointer; }
.sa-pad {
  position: relative; width: 230px; min-height: 130px; padding: 18px 16px 14px 28px; border-radius: 6px 18px 18px 6px; rotate: -2deg;
  background: repeating-linear-gradient(#FFFDF4 0 33px, #BFD8F5 33px 35px); box-shadow: var(--shadow-card), inset 6px 0 0 #F28DB5;
  font-family: var(--font-body); font-size: 30px; line-height: 35px; color: #2D4C9B;
}
.sa-pad.latin { font-family: var(--font-latin); }
.sa-pad::before { content: "📝"; position: absolute; top: -18px; left: -12px; font-size: 30px; rotate: -10deg; }
.sa-pad span { display: inline-block; animation: sa-ink .3s both; }
.sa-pad:not(.ok) span { color: #9A7A8E; }
@keyframes sa-ink { from { opacity: 0; translate: 0 -6px; } }
.sa-stamp { position: absolute; right: -12px; bottom: -14px; font-size: 52px; animation: sa-stamp .5s var(--spring) .3s both; }
@keyframes sa-stamp { from { scale: 2.4; opacity: 0; rotate: -30deg; } }
.sayafter.mode-dictate .mic-heard { display: none; }

/* 전구 켜기 · 읽고 답해요 (lightUp) */
.lightup { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.lu-room { display: grid; place-items: center; width: min(360px, 80vw); height: 110px; border-radius: var(--r-lg); background: #2A2440; box-shadow: inset 0 0 30px rgba(0, 0, 0, .4); transition: background .6s; }
.lu-room.lit { background: radial-gradient(circle at 50% 40%, #FFF8D2, #FFD86B 70%); }
.lu-art { font-size: 62px; filter: brightness(.4) saturate(.4); transition: filter .6s; }
.lu-room.lit .lu-art { filter: none; animation: pop .5s var(--spring); }
.lu-board { display: flex; flex-direction: column; gap: 14px; max-width: min(780px, 94vw); padding: 18px 24px; border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow-card); }
.lu-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 0; font-family: var(--font-display); font-size: 32px; color: var(--ink); opacity: .55; transition: opacity .3s; }
.lu-line.now, .lu-line:has(.on) { opacity: 1; }
.lightup.passage .lu-line { justify-content: flex-start; font-size: 28px; }
.lu-word { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lu-bulb { position: relative; width: 24px; height: 30px; border-radius: 50% 50% 42% 42%; background: #D9D3E3; transition: background .3s, box-shadow .3s; }
.lu-bulb::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: -6px; height: 7px; border-radius: 2px 2px 4px 4px; background: #9C93AE; }
.lu-word.on .lu-bulb { background: #FFD84A; box-shadow: 0 0 16px 4px rgba(255, 216, 74, .85); animation: pop .4s var(--spring); }
.lu-line.now .lu-word:not(.on) .lu-w { text-decoration: underline 3px color-mix(in srgb, var(--sub) 40%, transparent); text-underline-offset: 6px; }
.lu-below { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lu-below:empty { display: none; }
.lu-q { margin: 0; font-family: var(--font-display); font-size: 24px; color: var(--ink); text-align: center; }
.lu-choice { display: flex; flex-direction: column; gap: 4px; font-family: var(--font-display); font-size: 22px; }
.lu-ce { font-size: 44px; line-height: 1; }

/* 단어 그리기 (paintWord) */
.paintword { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.pw-easel { padding: 12px; border-radius: 18px; background: linear-gradient(#C68A52, #A06A38); box-shadow: 0 8px 0 #7A4F28; }
.pw-paper { position: relative; width: min(560px, 86vw); aspect-ratio: 16 / 10; overflow: hidden; border-radius: 8px; background: linear-gradient(#E3F3FF 0 56%, #E8F6D6 56%); }
.pw-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: linear-gradient(#BFE4FF, #9BD2FA); }
.pw-art { position: absolute; translate: -50% -50%; font-size: calc(clamp(34px, 8vw, 54px) * var(--s, 1)); line-height: 1; animation: pw-paint 1.1s var(--spring) both; }
@keyframes pw-paint { 0% { clip-path: circle(0% at 30% 40%); opacity: .2; scale: .7; } 100% { clip-path: circle(80% at 50% 50%); opacity: 1; scale: 1; } }
.pw-brush { position: absolute; left: 50%; top: 40%; font-size: 40px; animation: pw-brush 1.1s ease-in-out both; pointer-events: none; }
@keyframes pw-brush { 0% { translate: -120px -40px; rotate: -20deg; } 50% { translate: 60px 30px; rotate: 20deg; } 100% { translate: 140px -60px; opacity: 0; } }
.pw-paper.done { box-shadow: 0 0 0 6px var(--sun); }
.pw-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.pw-choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 110px; min-height: 96px; padding: 8px 14px; border-radius: var(--r-md); border: 4px solid var(--line); background: #fff; cursor: pointer; }
.pw-ce { font-size: 42px; line-height: 1; }
.pw-cw { font-size: 20px; font-weight: 700; color: var(--ink); }
.pw-choice.chosen { border-color: var(--success); background: var(--success-soft); }

/* 따라 말하기 (sayHo) */
.sayho { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.sh2-lights { display: flex; gap: 18px; }
.sh2-lights i { width: 20px; height: 20px; border-radius: 50%; background: hsl(calc(var(--i) * 60) 90% 62%); opacity: .3; }
.sayho.hooray .sh2-lights i { opacity: 1; animation: sh2-flash .35s calc(var(--i) * .06s) alternate infinite; }
@keyframes sh2-flash { to { opacity: .3; scale: .7; } }
.sh2-stage { display: flex; align-items: center; justify-content: center; gap: 22px; width: min(580px, 94vw); min-height: 150px; padding: 16px 24px; border-radius: var(--r-lg); background: linear-gradient(#5B2A86, #2B1650); box-shadow: 0 10px 0 #1C0E36; }
.sh2-singer { position: relative; font-size: 86px; line-height: 1; }
.sh2-mic { position: absolute; right: -14px; bottom: 4px; font-size: 36px; }
.sh2-singer.sing { animation: bob .3s ease-in-out infinite; }
.sh2-shout { margin: 0; max-width: 330px; font-size: 32px; font-weight: 700; color: #fff; text-shadow: 0 0 14px rgba(255, 210, 90, .8); }
.sh2-meter { display: flex; gap: 8px; }
.sh2-meter i { width: 34px; height: 12px; border-radius: 6px; background: rgba(0, 0, 0, .14); }
.sh2-meter i.on { background: var(--sun); box-shadow: 0 0 10px var(--sun); }
.sh2-crowd { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 38px; }
.sh2-crowd span { animation: sh2-jump .5s calc(var(--i) * .07s) ease-in-out infinite alternate; animation-play-state: paused; }
.sayho.hooray .sh2-crowd span { animation-play-state: running; }
@keyframes sh2-jump { to { translate: 0 -14px; } }

/* 외계인 챗 (alienChat) */
.alienchat { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.ac-call { width: min(560px, 94vw); }
.ac-screen { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 11; overflow: hidden; border: 8px solid #2B2B3A; border-radius: 26px; background: radial-gradient(circle at 50% 35%, #4B3B98, #120D2E 75%); }
.ac-live { position: absolute; top: 10px; left: 14px; font-size: 14px; font-weight: 700; color: #FF5F6D; }
.ac-name { position: absolute; top: 8px; right: 14px; font-size: 18px; color: #fff; }
.ac-alien { position: relative; width: 132px; height: 150px; margin-bottom: 54px; border-radius: 50% 50% 44% 44%; background: #7BE07B; box-shadow: inset -12px -12px 0 rgba(0, 0, 0, .1); }
.ac-alien.happy { animation: sa-jump .6s var(--spring) 2; }
.ac-ant { position: absolute; left: 50%; top: -34px; width: 6px; height: 36px; translate: -50% 0; background: #5DBB63; }
.ac-ant::after { content: ""; position: absolute; left: 50%; top: -12px; width: 18px; height: 18px; translate: -50% 0; border-radius: 50%; background: #FFCB3D; box-shadow: 0 0 12px #FFCB3D; }
.ac-eye { position: absolute; left: 50%; top: 30px; width: 58px; height: 58px; translate: -50% 0; border-radius: 50%; background: #fff; }
.ac-eye::after { content: ""; position: absolute; left: 20px; top: 20px; width: 22px; height: 22px; border-radius: 50%; background: #241B45; }
.ac-mouth { position: absolute; left: 50%; bottom: 26px; width: 40px; height: 12px; translate: -50% 0; border-radius: 0 0 20px 20px; background: #2E5E2E; }
.ac-alien.talk .ac-mouth { animation: ac-talk .22s ease-in-out infinite alternate; }
@keyframes ac-talk { to { height: 22px; border-radius: 10px 10px 22px 22px; } }
.ac-say { position: absolute; left: 12px; right: 108px; bottom: 12px; margin: 0; padding: 8px 12px; border-radius: 14px; background: #fff; font-size: 21px; line-height: 1.3; color: var(--ink); }
.ac-say:empty { display: none; }
.ac-me { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 86px; height: 68px; border: 3px solid #fff; border-radius: 12px; background: #FFEEDD; font-size: 42px; }
.ac-answers { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.ac-chip { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 18px; border: 3px solid var(--line); border-radius: var(--r-pill); background: #fff; font-size: 20px; color: var(--ink); cursor: pointer; }
.ac-chip.chosen { border-color: var(--success); background: var(--success-soft); }

/* 손글씨 (writeKit · handWrite) */
:root { --wp-ink: #3B2A1A; }
.handwrite { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.hw-top, .hw-show { display: flex; justify-content: center; }
.hw-top:empty, .hw-show:empty { display: none; }
.hw-row { display: flex; justify-content: center; max-width: 100%; }
.wp-pad { position: relative; width: min(300px, 72vw); aspect-ratio: 1; border-radius: 18px; border: 4px solid #EBD6B2; background: #FFFDF6; box-shadow: var(--shadow-card); touch-action: none; transition: border-color .3s, box-shadow .3s; }
.wp-canvas { display: block; width: 100%; height: 100%; border-radius: 14px; touch-action: none; cursor: crosshair; }
.wp-pad.ok { border-color: var(--success); box-shadow: 0 0 0 5px var(--success-soft); }
.wp-pad.given { border-color: var(--sun); box-shadow: 0 0 0 5px var(--sun-soft); }
.hw-grid { display: flex; gap: 8px; }
.hw-grid .wp-pad { width: min(180px, 29vw); }
.hw-tip { min-height: 1.4em; margin: 0; font-family: var(--font-display); font-size: 19px; color: var(--hangul-deep); text-align: center; }
.hw-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hw-tools[hidden], .hw-tool[hidden] { display: none; }
.hw-tool { min-height: 48px; padding: 6px 16px; font-size: 17px; }
.hw-sample { display: flex; align-items: center; gap: 12px; padding: 6px 18px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-card); }
.hw-sample-ch { font-family: var(--font-display); font-size: 54px; line-height: 1.1; color: var(--ink); }
.hw-sample-name { font-family: var(--font-display); font-size: 20px; color: var(--ink-soft); }
.hw-sample.small { padding: 4px 14px; }
.hw-shirt { position: relative; width: 170px; height: 150px; }
.hw-shirt-cloth { position: absolute; inset: 0; background: linear-gradient(var(--hangul-soft), #fff); clip-path: polygon(30% 0, 40% 6%, 60% 6%, 70% 0, 100% 16%, 90% 40%, 80% 34%, 80% 100%, 20% 100%, 20% 34%, 10% 40%, 0 16%); filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .1)); }
.hw-prints { position: absolute; inset: 22% 22% 6% 22%; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 1px; }
.hw-print svg { display: block; width: 30px; height: 30px; rotate: var(--r); animation: pop .45s var(--spring); }
.hw-wear { display: flex; align-items: center; gap: 12px; }
.hw-tori { font-size: 84px; line-height: 1; }
.hw-tori .char-img { width: 110px; height: auto; }
.hw-wear .hw-shirt { width: 240px; height: 212px; }
.hw-wear .hw-print svg { width: 44px; height: 44px; }
.hw-done { margin: 0; font-family: var(--font-display); font-size: 26px; color: var(--ink); }
.hw-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 8px 20px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-card); }
.hw-pic { font-size: 64px; line-height: 1.1; }
.hw-ear { width: 52px; height: 52px; border: 0; border-radius: 50%; background: var(--sub-soft); font-size: 24px; cursor: pointer; }
.hw-deck { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hw-mini { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-card); }
.hw-mini-pic { font-size: 26px; }
.hw-mini-word { display: flex; }
.hw-mini-word svg { width: 28px; height: 28px; }
.hw-sentence { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; margin: 0; padding: 14px 18px; border-radius: 20px; background: #fff; box-shadow: var(--shadow-card); font-family: var(--font-display); font-size: 30px; color: var(--ink); }
.hw-blank { display: inline-flex; gap: 6px; }
.hw-blank .wp-pad { width: min(124px, 29vw); }
.hw-sentence.done { box-shadow: 0 0 0 5px var(--success-soft), var(--shadow-card); }

/* 강아지 먹이 주기(한글): 그림과 낱말이 함께 있는 간식 */
.bone.ko { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: auto; min-width: 128px; padding: 0 12px; font-family: var(--font-display); font-weight: 400; font-size: 26px; }
.bone-pic { font-style: normal; font-size: 26px; line-height: 1; }

/* 영어판: 나를 찾아줘 · 별자리 맞히기 */
.ip-cell.latin, .ip-letter.latin, .ip-fly.latin { font-family: var(--font-latin); font-weight: 700; }
.ip-known.wide { display: flex; align-items: center; gap: 6px; width: auto; min-width: 96px; padding: 0 8px; font-size: 40px; white-space: nowrap; }
.ip-known.wide .ip-e { font-size: .8em; }
.ss-grid.latin .ss-letter { font-family: var(--font-latin); font-weight: 700; }
.ss-grid.words .ss-letter { font-size: 24px; }

@media (max-width: 700px) {
  .mic-btn { width: 84px; height: 84px; }
  .mic-icon { font-size: 40px; }
  .sa-friend { font-size: 84px; }
  .sa-text { font-size: 30px; }
  .sa-pic { font-size: 58px; }
  .sa-pad { width: 190px; font-size: 26px; }
  .lu-line { font-size: 26px; gap: 6px 10px; }
  .lightup.passage .lu-line { font-size: 22px; }
  .lu-bulb { width: 20px; height: 25px; }
  .lu-room { height: 84px; }
  .lu-art { font-size: 48px; }
  .sh2-singer { font-size: 64px; }
  .sh2-shout { font-size: 24px; }
  .ac-alien { width: 104px; height: 118px; margin-bottom: 64px; }
  .ac-eye { width: 46px; height: 46px; top: 24px; }
  .ac-eye::after { left: 15px; top: 15px; width: 18px; height: 18px; }
  .ac-say { font-size: 17px; right: 92px; }
  .ac-me { width: 72px; height: 58px; font-size: 34px; }
  .hw-sentence { font-size: 22px; padding: 10px 12px; }
  .ip-known.wide { flex-direction: column; gap: 0; min-width: 0; padding: 0 2px; font-size: 19px; line-height: 1.05; }
  .bone.ko { min-width: 104px; font-size: 22px; }
}
