:root {
  --bg: #ffffff; --ink: #1c2330; --sub: #6b7480; --line: #e6e9ee;
  --pri: #2f6df6; --good: #1f9d63; --bad: #d8493f; --soft: #f4f6f9; --warn: #fff6dc;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overscroll-behavior: none; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Hiragino Sans", "Noto Sans KR", "Noto Sans JP", "Malgun Gothic", "Yu Gothic", sans-serif;
  -webkit-text-size-adjust: 100%;
}
#app { max-width: 520px; margin: 0 auto; height: 100dvh; overflow-y: auto; }
button, input, textarea { font: inherit; color: inherit; }

/* 학습 화면 */
.screen { min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 6px; }
.x { border: 0; background: none; font-size: 20px; color: var(--sub); width: 40px; height: 40px; margin-left: -10px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--pri); border-radius: 3px; transition: width .3s; }
.tag { font-size: 13px; color: var(--sub); min-width: 52px; text-align: right; }
/* 어느 언어를 묻는 카드인지 */
.lang { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.lw { font-weight: 800; font-size: 1.2em; }
.lw-ja { color: #d92d20; }
.lw-en { color: #1d4ed8; }
.lang-ja { background: #fde8e8; color: #b42318; }
.lang-en { background: #e3ecff; color: #1d4ed8; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 8px 20px 20px; gap: 10px; }
.actions {
  position: sticky; bottom: 0; display: flex; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 78%, rgba(255,255,255,0));
}
.btn {
  flex: 1; min-height: 62px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--bg);
  font-size: 19px; font-weight: 700; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none;
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.bad { background: #fff; border-color: var(--bad); color: var(--bad); }
.btn.big { min-height: 72px; font-size: 22px; flex: none; width: 100%; }
.link { border: 0; background: none; color: var(--sub); font-size: 15px; text-decoration: underline; padding: 10px; }

/* 그림 */
.figbox { width: min(64vw, 270px); aspect-ratio: 1; }
.fig { width: 100%; height: 100%; display: block; }
.nofig { font-size: 14px; color: var(--sub); border: 1.5px dashed var(--line); border-radius: 999px; padding: 6px 16px; margin-bottom: 8px; }
.ln { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.far { opacity: .34; }
.head { fill: var(--bg); stroke: var(--ink); stroke-width: 4; }
.hand, .eye { fill: var(--ink); }
.eyew { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.fl, .fl2, .fl3 { fill: none; stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; }
.fl { stroke-width: 2; } .fl2 { stroke-width: 3; } .fl3 { stroke-width: 4; }
.gr { stroke: #dde1e7; stroke-width: 3; stroke-linecap: round; }
.prop { fill: none; stroke: #b9c0ca; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.ball { fill: #fff; stroke: var(--ink); stroke-width: 3; }
/* 소품과 효과 */
.prop2 { fill: none; stroke: #b9c0ca; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.propf { fill: #fff; stroke: #b9c0ca; stroke-width: 4; stroke-linejoin: round; }
.refl { fill: none; stroke: #d5dae1; stroke-width: 3; stroke-linecap: round; }
.pr { fill: none; stroke: var(--pri); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.pr2 { fill: none; stroke: var(--pri); stroke-width: 2.2; stroke-linecap: round; }
.prf { fill: #dbe7ff; stroke: var(--pri); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.wt { fill: none; stroke: #59b4f0; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 6; }
.wtf { fill: #cfeaff; }
.bub { fill: #fff; stroke: #59b4f0; stroke-width: 2; }
.twl { fill: none; stroke: #9fc3ff; stroke-width: 8; stroke-linecap: round; }
.foam { fill: #fff; stroke: #c3cad4; stroke-width: 2.5; stroke-linejoin: round; }
.floss { stroke: var(--pri); stroke-width: 3; stroke-linecap: round; }
.wind { fill: none; stroke: #9aa5b3; stroke-width: 2.5; stroke-linecap: round; }
.mouthO { fill: #5b2a2f; stroke: var(--ink); stroke-width: 3; }
.mouth { fill: #f3a6a6; stroke: var(--ink); stroke-width: 3; }
.teeth { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }
.tongue { fill: #f08a9b; stroke: var(--ink); stroke-width: 2.5; }
.tear { fill: #59b4f0; }
.lips, .lipf { fill: #e8607a; }
.lipf { stroke: #b9405a; stroke-width: 2; }
.lit { fill: #ffe38a; stroke: #e7b93c; stroke-width: 2; }
.ray { fill: none; stroke: #e7b93c; stroke-width: 3; stroke-linecap: round; }

/* 글자 */
.ja { font-size: clamp(28px, 8.6vw, 40px); font-weight: 700; line-height: 2.1; letter-spacing: .02em; cursor: pointer; }
.ja rt, .alts rt, .sja rt, .mja rt, .mates rt { font-size: .42em; font-weight: 500; color: var(--sub); letter-spacing: 0; }
.spk { font-size: .45em; margin-left: 8px; vertical-align: middle; opacity: .7; }
/* 영어는 글자가 길고 읽기 표시가 없어서 조금 작게, 줄 간격을 좁게 */
.ja.L-en { font-size: clamp(24px, 7.2vw, 34px); line-height: 1.4; letter-spacing: 0; margin: 12px 0 6px; }
.sja.L-en { font-size: clamp(19px, 5.4vw, 23px); line-height: 1.6; }
.mja.L-en { line-height: 1.5; padding-top: 6px; }
.ja.L-en + .alts { margin-top: 0; line-height: 1.6; }
.slot { border-bottom: 2px dotted var(--sub); padding-bottom: 1px; }
.slotnote { font-size: 13px; color: var(--sub); margin-top: -4px; }
.more small { display: block; font-size: 13px; color: var(--sub); line-height: 1.5; margin: -4px 0 6px; }
.alts { font-size: 18px; color: var(--sub); line-height: 2; margin-top: -10px; }
.ko { font-size: 19px; color: var(--sub); }
.ko.big { font-size: clamp(24px, 7vw, 30px); font-weight: 700; color: var(--ink); margin-top: 6px; }
.prompt { font-size: 15px; color: var(--sub); margin: 12px 0 0; line-height: 1.6; }
.note { background: var(--warn); border-radius: 12px; padding: 10px 14px; font-size: 15px; line-height: 1.5; max-width: 420px; }
.mates { background: var(--soft); border-radius: 12px; padding: 10px 14px; font-size: 17px; line-height: 2; max-width: 420px; width: 100%; }
.mates b { display: block; font-size: 13px; color: var(--sub); line-height: 1.4; }
.mates span { font-size: 14px; color: var(--sub); }
.sent { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; max-width: 440px; width: 100%; cursor: pointer; }
.sent.q { border: 0; cursor: default; }
.sja { font-size: clamp(20px, 5.8vw, 25px); line-height: 2.2; }
.sko { font-size: 15px; color: var(--sub); margin-top: 2px; }
.sko.big { font-size: clamp(22px, 6.4vw, 27px); color: var(--ink); font-weight: 700; line-height: 1.5; }
.hit { color: var(--pri); font-weight: 700; }
.hole { border-bottom: 3px solid var(--pri); margin: 0 3px; }
.hint { min-height: 44px; display: flex; align-items: center; }
.listen { width: 150px; height: 150px; border-radius: 50%; border: 0; background: var(--soft); font-size: 60px; }
.type { width: 100%; max-width: 420px; height: 58px; border: 2px solid var(--line); border-radius: 14px; padding: 0 16px; font-size: 22px; text-align: center; outline: none; margin-top: 8px; }
.type:focus { border-color: var(--pri); }
.judge { font-size: 16px; font-weight: 700; padding: 8px 14px; border-radius: 12px; }
.judge.ok { color: var(--good); background: #e9f7f0; }
.judge.ng { color: var(--bad); background: #fdeeed; }
.memo { width: 100%; max-width: 420px; min-height: 64px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 15px; resize: none; }

/* 홈 */
.home { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center;
  padding: calc(24px + env(safe-area-inset-top)) 24px calc(24px + env(safe-area-inset-bottom)); }
.home h1 { font-size: 30px; margin: 0; }
.lead { margin: -8px 0 8px; color: var(--sub); font-size: 16px; }
.today { display: flex; gap: 12px; width: 100%; }
.today div { flex: 1; background: var(--soft); border-radius: 18px; padding: 18px 8px; }
.today b { display: block; font-size: 38px; line-height: 1.1; }
.today span { font-size: 14px; color: var(--sub); }
.prog { width: 100%; margin-top: 8px; }
.pbar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; display: flex; }
.pbar .m { background: var(--good); } .pbar .l { background: #a9c4ff; }
.prog p { font-size: 13px; color: var(--sub); margin: 8px 0 0; }
.quiet { color: var(--sub); font-size: 15px; line-height: 1.6; margin: 4px 0; }
.mission { width: 100%; background: var(--soft); border-radius: 18px; padding: 16px; }
.mission b { font-size: 14px; color: var(--sub); }
.mi { padding: 8px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.mja { font-size: 24px; font-weight: 700; line-height: 2; }
.mko { font-size: 15px; color: var(--sub); }
.home .btn { flex: none; width: 100%; }
/* 진도 번호 */
.pos { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 20px; font-size: 16px; margin-top: -6px; }
.pos b { font-size: 22px; color: var(--pri); margin: 0 2px; }
.posnum b { font-size: 72px; line-height: 1; color: var(--pri); }
.posnum span { font-size: 22px; color: var(--sub); margin-left: 8px; }
.setpos { width: 100%; background: var(--soft); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.setpos b { font-size: 15px; }
.setpos .type { margin-top: 0; background: #fff; }
.quiet.small { font-size: 13px; }
.quiet b { color: var(--ink); }
/* 끝 화면: 더 하기 버튼까지 한 화면에 들어오게 조금 촘촘히 */
.done { gap: 10px; }
.done .mission { padding: 12px 16px; }
.done .mi { padding: 2px 0 6px; margin-top: 6px; }
.done .mja { font-size: 21px; line-height: 1.8; }
.done .btn.big { min-height: 58px; font-size: 19px; }
.done .quiet { margin: 0; font-size: 14px; }
