:root {
  --ink: #3d3360;
  --ink-soft: #6d6492;
  --paper: #fffdf8;
  --sky: #ddf3ff;
  --lumi: #8e7cf0;
  --jelly: #ff9ecf;
  --watery: #6ec6ff;
  --oily: #ffc24b;
  --germ: #5dae3c;
  --mark: #fff1a8;
  --shadow: 0 10px 30px rgba(61, 51, 96, 0.18);
  --radius: 28px;
  --font: 'Baloo 2', 'Jua', system-ui, sans-serif;
  --font-ko: 'Jua', 'Baloo 2', system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); color: var(--ink); font-family: var(--font); }
body { -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#fade { position: fixed; inset: 0; background: linear-gradient(160deg, #e7f6ff, #fdeaf5); pointer-events: none; opacity: 1; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui > * , #layer > * { pointer-events: auto; }
#layer { position: absolute; inset: 0; pointer-events: none; }
#layer > .chapter-title, #layer > .letter-bubble, #layer > .say-it, #layer > .toast, #layer > .word-pop { pointer-events: none; }

/* ------------------------------------------------ top bar */
#topbar { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#progress { display: flex; gap: 8px; list-style: none; margin: 0; padding: 6px 10px; background: rgba(255, 255, 255, 0.75); border-radius: 999px; box-shadow: var(--shadow); }
#progress li { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: #ece8fb; color: var(--ink-soft); transition: all 0.3s; }
#progress li.done { background: var(--watery); color: #fff; }
#progress li.now { background: var(--lumi); color: #fff; transform: scale(1.15); }
.tools { display: flex; gap: 8px; }
.chip { white-space: nowrap; border: 0; background: rgba(255, 255, 255, 0.85); border-radius: 999px; min-height: 44px; min-width: 44px; padding: 0 14px; font-weight: 800; box-shadow: var(--shadow); }
.chip.icon { padding: 0; display: grid; place-items: center; }
#mute-btn .x { display: none; }
#mute-btn.off .x { display: inline; }
#mute-btn.off .waves { display: none; }

/* ------------------------------------------------ subtitles */
#subtitle {
  position: absolute; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translate(-50%, 30px);
  width: min(760px, calc(100vw - 32px)); padding: 14px 22px 16px; border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.94); box-shadow: var(--shadow); border: 4px solid var(--speaker, var(--lumi));
  opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none;
}
#subtitle.show { opacity: 1; transform: translate(-50%, 0); }
#subtitle .speaker { position: absolute; top: -18px; left: 22px; background: var(--speaker, var(--lumi)); color: #fff; padding: 2px 14px; border-radius: 999px; font-family: var(--font-ko); font-size: 17px; }
#subtitle p { margin: 4px 0; line-height: 1.35; transition: opacity 0.2s; opacity: 0.55; }
#subtitle p.active { opacity: 1; }
#subtitle .ko { font-family: var(--font-ko); font-size: clamp(20px, 3.2vw, 30px); }
#subtitle .en { font-size: clamp(17px, 2.6vw, 25px); font-weight: 700; }
mark { background: var(--mark); color: inherit; border-radius: 8px; padding: 0 4px; }

/* ------------------------------------------------ word cards */
.word-card {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); opacity: 0;
  width: min(300px, 70vw); padding: 18px 18px 14px; border: 0; border-radius: 34px; background: var(--paper);
  box-shadow: 0 0 0 8px #fff, 0 0 0 14px var(--oily), var(--shadow); text-align: center;
  transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.3s;
}
.word-card.in { transform: translate(-50%, -50%) scale(1) rotate(0); opacity: 1; }
.word-card.in:not(.tapped):not(.chant) { animation: wobble 1.6s ease-in-out 0.5s infinite; }
.word-card.flip { box-shadow: 0 0 0 8px #fff, 0 0 0 14px var(--watery), 0 0 60px 20px rgba(255, 241, 168, 0.9); }
.word-card.out { transform: translate(-50%, -80%) scale(0.6); opacity: 0; }
.word-card .icon { width: 46%; margin: 0 auto 4px; }
.word-card .icon svg { width: 100%; height: auto; display: block; }
.word-card .en { font-size: clamp(36px, 6vw, 54px); font-weight: 800; line-height: 1; color: var(--ink); }
.word-card .ko { font-family: var(--font-ko); font-size: clamp(32px, 5vw, 46px); color: var(--lumi); margin-top: 4px; }
.word-card .hint { margin-top: 8px; font-family: var(--font-ko); font-size: 20px; color: #fff; background: var(--jelly); border-radius: 999px; display: inline-block; padding: 2px 16px; }
.word-card.chant { top: 36%; }
@keyframes wobble { 0%, 100% { transform: translate(-50%, -50%) rotate(0) scale(1); } 25% { transform: translate(-50%, -50%) rotate(-3deg) scale(1.04); } 75% { transform: translate(-50%, -50%) rotate(3deg) scale(1.04); } }

/* ------------------------------------------------ chapter title, prompt, toast, say-it */
.chapter-title { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.8); opacity: 0; text-align: center; padding: 22px 40px; border-radius: var(--radius); background: rgba(255, 253, 248, 0.92); box-shadow: var(--shadow); transition: all 0.4s; width: max-content; max-width: calc(100vw - 32px); }
.chapter-title.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.chapter-title .ko { font-family: var(--font-ko); font-size: clamp(28px, 5vw, 44px); color: var(--lumi); }
.chapter-title .en { font-size: clamp(18px, 3vw, 26px); font-weight: 700; color: var(--ink-soft); }

.big-prompt { position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%) scale(0.5); opacity: 0; border: 0; border-radius: 999px; padding: 14px 34px; background: var(--oily); color: var(--ink); box-shadow: 0 8px 0 #e0a12d, var(--shadow); display: flex; flex-direction: column; align-items: center; transition: all 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.big-prompt.in { opacity: 1; transform: translateX(-50%) scale(1); animation: bob 1.2s ease-in-out infinite; }
.big-prompt .ko { font-family: var(--font-ko); font-size: 30px; }
.big-prompt .en { font-weight: 800; font-size: 18px; }
@keyframes bob { 50% { transform: translateX(-50%) translateY(-6px); } }

.toast { position: absolute; left: 50%; top: 80px; transform: translate(-50%, -20px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 22px; border-radius: 999px; font-family: var(--font-ko); font-size: 20px; text-align: center; transition: all 0.3s; max-width: calc(100vw - 32px); }
.toast small { display: block; font-family: var(--font); font-size: 14px; opacity: 0.85; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

.say-it { position: absolute; left: 50%; top: 70%; transform: translate(-50%, -50%) scale(0.8); opacity: 0; transition: all 0.3s; text-align: center; font-family: var(--font-ko); font-size: 30px; background: var(--paper); padding: 10px 28px; border-radius: var(--radius); box-shadow: var(--shadow); }
.say-it.in { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.say-it b { font-family: var(--font); color: var(--jelly); }
.say-it .dots { display: flex; gap: 10px; justify-content: center; margin-top: 6px; }
.say-it i { width: 20px; height: 20px; border-radius: 50%; background: #ece8fb; transition: all 0.2s; }
.say-it i.on { background: var(--watery); transform: scale(1.2); }

/* ------------------------------------------------ letters HUD + bubbles (mini game 2) */
#letters { position: absolute; top: 70px; left: 50%; transform: translate(-50%, -20px); display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; opacity: 0; transition: all 0.4s; pointer-events: none; width: calc(100vw - 32px); }
#letters.show { opacity: 1; transform: translate(-50%, 0); }
#letters .word { display: flex; gap: 5px; background: rgba(255, 255, 255, 0.75); padding: 6px 10px; border-radius: 20px; box-shadow: var(--shadow); }
#letters .slot { width: 38px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 26px; background: #ece8fb; color: transparent; transition: all 0.3s; }
#letters .slot.hangul { font-family: var(--font-ko); font-weight: 400; }
#letters .slot.lit { background: var(--watery); color: #fff; animation: pop 0.4s; }
@keyframes pop { 50% { transform: scale(1.35); } }
.letter-bubble { position: absolute; transform: translate(-50%, -50%) scale(0.2); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; font-family: var(--font); color: #fff; background: radial-gradient(circle at 35% 30%, #fff 0 10%, var(--watery) 40%, #3fa7e0); box-shadow: 0 0 24px rgba(110, 198, 255, 0.9); transition: transform 0.3s cubic-bezier(0.3, 1.8, 0.5, 1), left 0.6s ease-in, top 0.6s ease-in, opacity 0.6s; }
.letter-bubble.pop { transform: translate(-50%, -50%) scale(1.3); }
.letter-bubble.fly { transform: translate(-50%, -50%) scale(0.6); opacity: 0.4; }

/* ------------------------------------------------ touch playground */
#letters .finds { display: flex; gap: 6px; background: rgba(255, 255, 255, 0.8); padding: 6px 10px; border-radius: 20px; box-shadow: var(--shadow); }
#letters .find { width: 44px; height: 44px; border-radius: 14px; background: #ece8fb; display: grid; place-items: center; padding: 5px; filter: grayscale(1); opacity: 0.45; transition: all 0.3s; }
#letters .find svg { width: 100%; height: 100%; }
#letters .find.lit { filter: none; opacity: 1; background: #fff7d6; box-shadow: 0 0 0 3px var(--oily); animation: pop 0.45s; }
.word-pop { position: absolute; transform: translate(-50%, -100%) scale(0.3); opacity: 0; pointer-events: none; background: var(--paper); border: 4px solid var(--oily); border-radius: 22px; padding: 4px 16px 6px; text-align: center; box-shadow: var(--shadow); transition: transform 0.35s cubic-bezier(0.3, 1.8, 0.5, 1), opacity 0.3s, top 0.6s; white-space: nowrap; }
.word-pop.in { transform: translate(-50%, -130%) scale(1); opacity: 1; }
.word-pop.out { transform: translate(-50%, -220%) scale(0.8); opacity: 0; }
.word-pop b { display: block; font-size: 30px; line-height: 1.1; color: var(--ink); }
.word-pop span { display: block; font-family: var(--font-ko); font-size: 24px; color: var(--lumi); }
@media (max-width: 520px) { #letters .find { width: 38px; height: 38px; } }

/* ------------------------------------------------ blink button */
#blink-btn {
  position: absolute; right: max(24px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom));
  width: 132px; height: 132px; border-radius: 50%; border: 0; touch-action: manipulation;
  background: radial-gradient(circle at 40% 30%, #ffe1ef, var(--jelly) 55%, #ef6faa);
  box-shadow: 0 10px 0 #d65792, 0 16px 30px rgba(214, 87, 146, 0.45); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
#blink-btn:active, #blink-btn.press { animation: press 0.25s; }
#blink-btn .ko { font-family: var(--font-ko); font-size: 34px; }
#blink-btn .en { font-weight: 800; font-size: 18px; letter-spacing: 1px; }
#blink-btn .count { position: absolute; right: -6px; top: -6px; background: var(--paper); color: var(--ink); border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 16px; box-shadow: var(--shadow); }
@keyframes press { 40% { transform: translateY(8px) scale(0.94); box-shadow: 0 2px 0 #d65792, 0 6px 14px rgba(214, 87, 146, 0.4); } }
#subtitle { z-index: 2; }
/* During Mini Game 2 the subtitle shrinks to the bottom-left so the eye stays visible. */
#ui:has(#blink-btn:not([hidden])) #subtitle { left: 16px; transform: none; width: min(480px, calc(100vw - 200px)); padding: 10px 16px 12px; }
#ui:has(#blink-btn:not([hidden])) #subtitle .ko { font-size: clamp(17px, 2.2vw, 22px); }
#ui:has(#blink-btn:not([hidden])) #subtitle .en { font-size: clamp(15px, 1.9vw, 19px); }

#cam { position: absolute; right: 16px; bottom: 16px; width: 132px; border-radius: 18px; overflow: hidden; border: 4px solid #fff; box-shadow: var(--shadow); outline: calc(var(--blink, 0) * 8px) solid var(--watery); }
#cam video { width: 100%; display: block; transform: scaleX(-1); }

/* ------------------------------------------------ start / end screens */
.screen { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, rgba(231, 246, 255, 0.9), rgba(253, 234, 245, 0.9)); overflow-y: auto; }
.panel { width: min(520px, 100%); background: var(--paper); border-radius: 36px; padding: 28px 24px 22px; text-align: center; box-shadow: var(--shadow); }
.logo h1 { font-family: var(--font-ko); font-weight: 400; font-size: clamp(40px, 9vw, 58px); margin: 6px 0 0; color: var(--lumi); }
.logo .sub { margin: -4px 0 0; font-weight: 800; font-size: 22px; color: var(--ink-soft); }
.drops { display: flex; gap: 10px; justify-content: center; }
.drops i { width: 34px; height: 34px; border-radius: 50% 0 50% 50%; transform: rotate(-45deg); animation: hop 1.4s ease-in-out infinite; }
.drops .j { background: var(--jelly); }
.drops .w { background: var(--watery); animation-delay: 0.15s; }
.drops .o { background: var(--oily); animation-delay: 0.3s; }
@keyframes hop { 50% { transform: rotate(-45deg) translate(6px, -6px); } }
.ep { font-family: var(--font-ko); font-size: 22px; margin: 14px 0; }
.ep small { font-family: var(--font); font-size: 16px; color: var(--ink-soft); }
.big { border: 0; border-radius: 999px; padding: 14px 40px; font-family: var(--font-ko); font-size: 30px; background: var(--watery); color: #fff; box-shadow: 0 8px 0 #3fa7e0, var(--shadow); display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; }
.big small, .ghost small { font-family: var(--font); font-weight: 800; font-size: 16px; }
.big:active { transform: translateY(6px); box-shadow: 0 2px 0 #3fa7e0; }
.ghost { margin-top: 12px; border: 3px solid var(--lumi); background: transparent; border-radius: 999px; padding: 8px 22px; font-family: var(--font-ko); font-size: 20px; color: var(--lumi); display: inline-flex; flex-direction: column; align-items: center; }
#mode-select { display: flex; width: max-content; margin: 18px auto 0; background: #ece8fb; border-radius: 999px; padding: 4px; }
#mode-select button { border: 0; background: transparent; padding: 8px 14px; border-radius: 999px; font-weight: 800; min-height: 40px; }
#mode-select button.on { background: var(--lumi); color: #fff; }
.teacher { margin-top: 16px; text-align: left; font-size: 15px; color: var(--ink-soft); }
.teacher summary { cursor: pointer; font-family: var(--font-ko); font-size: 17px; }
.cam-opt { display: block; margin: 10px 0; }
.cam-opt small { display: block; margin-left: 24px; }
#chapters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
#chapters button { border: 2px solid #ece8fb; background: #fff; border-radius: 12px; padding: 4px 10px; font-family: var(--font-ko); }
#voice-note code { background: #ece8fb; padding: 0 4px; border-radius: 4px; }
#end h2 { font-family: var(--font-ko); font-weight: 400; font-size: 40px; margin: 0; color: var(--lumi); }
#end h2 small { display: block; font-family: var(--font); font-size: 22px; color: var(--ink-soft); }

@media (max-width: 520px) {
  #blink-btn { width: 112px; height: 112px; }
  #ui:has(#blink-btn:not([hidden])) #subtitle { top: 128px; bottom: auto; width: calc(100vw - 32px); }
  #letters .slot { width: 30px; height: 38px; font-size: 21px; }
  #letters { top: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* Landscape phones (short screens): smaller cards and subtitles so nothing is clipped or covered. */
@media (max-height: 500px) {
  .word-card { width: min(210px, 52vh); padding: 10px 12px 10px; top: 40%; border-radius: 26px; }
  .word-card.chant { top: 40%; }
  .word-card .icon { width: 36%; }
  .word-card .en { font-size: 30px; }
  .word-card .ko { font-size: 26px; margin-top: 0; }
  .word-card .hint { margin-top: 4px; font-size: 16px; }
  #subtitle { padding: 8px 16px 10px; bottom: 10px; }
  #subtitle .ko { font-size: 19px; }
  #subtitle .en { font-size: 16px; }
  #subtitle .speaker { font-size: 14px; top: -14px; }
  .say-it { top: 76%; font-size: 22px; padding: 6px 20px; }
  .chapter-title { padding: 12px 24px; }
  .big-prompt { bottom: 110px; }
}

.ai-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-soft); }

/* ------------------------------------------------ word card actions (🔊 replay + next) */
.word-card { cursor: pointer; }
.card-actions { display: none; gap: 10px; justify-content: center; margin-top: 10px; }
.word-card.tapped .card-actions, .info-card .card-actions { display: flex; }
.word-card.tapped .hint { display: none; }
.card-say { border: 0; width: 52px; height: 52px; border-radius: 50%; background: var(--oily); font-size: 24px; box-shadow: 0 4px 0 #e0a12d; }
.card-next { border: 0; min-height: 52px; padding: 0 20px; border-radius: 999px; background: #e3def5; color: var(--ink-soft); font-family: var(--font-ko); font-size: 22px; transition: all 0.25s; }
.card-next small { font-family: var(--font); font-size: 14px; font-weight: 800; }
.ready .card-next { background: var(--watery); color: #fff; box-shadow: 0 4px 0 #3fa7e0; animation: nextPulse 1.4s ease-in-out infinite; }
@keyframes nextPulse { 50% { transform: scale(1.07); } }

/* ------------------------------------------------ fun fact / safety cards */
.info-card { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(0.4); opacity: 0; width: min(480px, calc(100vw - 32px));
  background: var(--paper); border-radius: 30px; padding: 16px 20px 16px; box-shadow: 0 0 0 7px #fff, 0 0 0 12px var(--lumi), var(--shadow); text-align: center;
  transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1), opacity 0.3s; }
.info-card.safety { box-shadow: 0 0 0 7px #fff, 0 0 0 12px var(--jelly), var(--shadow); }
.info-card.in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.info-card.out { transform: translate(-50%, -70%) scale(0.7); opacity: 0; }
.info-head { font-family: var(--font-ko); font-size: 22px; color: var(--lumi); }
.info-card.safety .info-head { color: #d65792; }
.info-head small { font-family: var(--font); font-weight: 800; font-size: 15px; color: var(--ink-soft); }
.info-icon { font-size: 30px; margin-right: 6px; vertical-align: -4px; }
.info-card .ko { font-family: var(--font-ko); font-size: clamp(20px, 3vw, 26px); margin: 10px 0 4px; line-height: 1.35; }
.info-card .en { font-size: clamp(16px, 2.4vw, 20px); font-weight: 700; color: var(--ink-soft); margin: 0 0 4px; }

/* ------------------------------------------------ choice */
.choice { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%) scale(0.6); opacity: 0; display: flex; gap: 16px; transition: all 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); width: max-content; max-width: calc(100vw - 32px); }
.choice.in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.choice-btn { border: 0; width: min(220px, 42vw); padding: 16px 10px; border-radius: 28px; background: var(--paper); box-shadow: 0 8px 0 #cfc8ea, var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.choice-btn.a { box-shadow: 0 8px 0 #f0b8d3, var(--shadow); }
.choice-btn.b { box-shadow: 0 8px 0 #a9dcf5, var(--shadow); }
.choice-btn .choice-icon { font-size: 54px; line-height: 1.1; }
.choice-btn .ko { font-family: var(--font-ko); font-size: clamp(20px, 3vw, 26px); }
.choice-btn .en { font-weight: 800; font-size: 16px; color: var(--ink-soft); }
.choice-btn.picked { transform: scale(1.12); }
.choice-btn:active { transform: translateY(5px); }

/* ------------------------------------------------ promises */
.promises { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%) scale(0.6); opacity: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(720px, calc(100vw - 32px)); transition: all 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
.promises.in { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.promises.out { opacity: 0; transform: translate(-50%, -60%) scale(0.8); }
.promise { position: relative; border: 0; border-radius: 24px; padding: 14px 8px; background: var(--paper); box-shadow: 0 6px 0 #cfc8ea, var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.promise .p-icon { font-size: 40px; }
.promise .ko { font-family: var(--font-ko); font-size: clamp(16px, 2.4vw, 21px); line-height: 1.3; }
.promise .en { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.promise .check { position: absolute; top: -10px; right: -6px; width: 34px; height: 34px; border-radius: 50%; background: var(--ok, #3a9d5d); color: #fff; display: none; place-items: center; font-weight: 800; }
.promise.done { background: #f1fbf3; }
.promise.done .check { display: grid; animation: pop 0.4s; }
.promise.speaking { transform: scale(1.06); box-shadow: 0 0 0 4px var(--oily), var(--shadow); }
@media (max-width: 560px) { .promises { grid-template-columns: 1fr; top: 46%; } .promise { flex-direction: row; text-align: left; } .promise .p-icon { font-size: 32px; } }

/* ------------------------------------------------ word book */
#wordbook-btn { margin-left: 8px; }
#wordbook-btn .wb-count { color: var(--lumi); }
#wordbook-btn.bump { animation: pop 0.5s; }
#topbar { justify-content: flex-start; }
#topbar .tools { margin-left: auto; }
#wordbook { position: absolute; inset: 0; background: rgba(61, 51, 96, 0.35); display: grid; place-items: center; padding: 16px; z-index: 5; }
.wb-panel { width: min(560px, 100%); background: var(--paper); border-radius: 28px; padding: 16px 18px 20px; box-shadow: var(--shadow); }
.wb-top { display: flex; align-items: center; justify-content: space-between; }
.wb-top h2 { font-family: var(--font-ko); font-weight: 400; margin: 0; color: var(--lumi); font-size: 26px; }
.wb-top h2 small { font-family: var(--font); font-size: 15px; color: var(--ink-soft); }
.wb-close { border: 0; width: 44px; height: 44px; border-radius: 50%; background: #ece8fb; font-size: 20px; }
.wb-help { margin: 4px 0 12px; color: var(--ink-soft); font-size: 14px; }
.wb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wb-word { border: 0; border-radius: 20px; background: #fff7d6; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; box-shadow: 0 4px 0 #f0dc9a; }
.wb-word .icon { width: 54px; height: 54px; display: grid; place-items: center; font-size: 30px; color: var(--ink-soft); }
.wb-word .icon svg { width: 100%; height: 100%; }
.wb-word b { font-size: 20px; }
.wb-word span:last-child { font-family: var(--font-ko); color: var(--lumi); font-size: 18px; }
.wb-word.locked { background: #f1eff8; box-shadow: none; opacity: 0.7; }
.wb-word.speaking { box-shadow: 0 0 0 4px var(--watery); }
@media (max-width: 520px) { .wb-label { display: none; } .wb-grid { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------ finger hint */
#finger { position: absolute; left: 0; top: 0; z-index: 6; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(61, 51, 96, 0.35)); }
#finger.tap { animation: fingerTap 1s ease-in-out infinite; }
#finger.drag { animation: fingerDrag 1.8s ease-in-out infinite; }
@keyframes fingerTap {
  0%, 100% { transform: translate(calc(var(--x) - 20px), calc(var(--y) - 4px)) scale(1); }
  50% { transform: translate(calc(var(--x) - 20px), calc(var(--y) + 8px)) scale(0.9); }
}
@keyframes fingerDrag {
  0% { transform: translate(calc(var(--x) - 20px), calc(var(--y) - 4px)); opacity: 0; }
  12% { opacity: 1; transform: translate(calc(var(--x) - 20px), calc(var(--y) + 4px)) scale(0.92); }
  75% { opacity: 1; transform: translate(calc(var(--x2) - 20px), calc(var(--y2) + 4px)) scale(0.92); }
  100% { opacity: 0; transform: translate(calc(var(--x2) - 20px), calc(var(--y2) - 4px)); }
}
@media (max-height: 500px) {
  .info-card { padding: 10px 14px; top: 44%; }
  .info-card .ko { font-size: 18px; margin: 6px 0 2px; }
  .info-card .en { font-size: 14px; }
  .card-say { width: 42px; height: 42px; font-size: 20px; }
  .card-next { min-height: 42px; font-size: 18px; }
  .word-card .card-actions { margin-top: 4px; }
  .choice-btn .choice-icon { font-size: 36px; }
  .promise { padding: 8px 6px; }
}
