/* 들리는 영어 — 화면 디자인 (모험 섬 게임판)
   원칙: 학습 화면(지도·문제·테스트·보상)은 어느 기기든 스크롤 없는 한 화면.
   높이는 dvh 와 컨테이너 크기(cqh)로 줄었다 늘었다 한다. 설정·관리자·안내 글만 스크롤 허용. */
:root {
  --bg: #fff8ef;
  --card: #ffffff;
  --ink: #2a2140;
  --muted: #7a7192;
  --line: #efe3d3;
  --coral: #ff6b4a;
  --coral-d: #d9482a;
  --coral-soft: #ffe6df;
  --sun: #ffc93c;
  --sun-d: #e0a100;
  --mint: #2fc58c;
  --mint-d: #1f9a6b;
  --mint-soft: #d7f7e6;
  --sky: #4cb6ff;
  --sky-d: #2a8ad6;
  --sea: #2f9be0;
  --sea-d: #1f75b3;
  --grape: #9b6bff;
  --grape-d: #7646dd;
  --lock: #e6dfd5;
  --lock-d: #c9bfb1;
  --warn-soft: #fff3cf;
  --display: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --en: "Nunito", "Segoe UI", system-ui, sans-serif;
  --r: 20px;
  --tap: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
[lang="en"] { font-family: var(--en); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.25; margin: 0 0 0.4em; text-wrap: balance; }
h1 { font-size: clamp(1.5rem, 4.4vw, 2.3rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.7em; }
a { color: var(--sea-d); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.center { text-align: center; justify-content: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.error { color: var(--coral-d); min-height: 1em; }
.ok { color: var(--mint-d); }
.label { font-weight: 700; margin: 0.8em 0 0.4em; }
.eyebrow { font-size: 0.85rem; color: var(--sea-d); font-weight: 700; margin-bottom: 0.2em; }
.disp { font-family: var(--display); }
.charimg { width: 1.15em; height: 1.15em; object-fit: contain; display: inline-block; vertical-align: middle; user-select: none; -webkit-user-drag: none; }

/* ---------- 버튼 (입체 버튼) ---------- */
.btn {
  --c: #fff; --d: var(--line); --t: var(--ink);
  font: inherit; font-family: var(--display); font-size: 1.05rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 8px 18px; border-radius: 16px; border: 2px solid var(--d); background: var(--c); color: var(--t);
  box-shadow: 0 4px 0 var(--d); cursor: pointer; text-decoration: none; transition: transform 0.08s, box-shadow 0.08s; white-space: nowrap;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--d); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.primary { --c: var(--coral); --d: var(--coral-d); --t: #fff; border-color: var(--coral); }
.btn.mint { --c: var(--mint); --d: var(--mint-d); --t: #fff; border-color: var(--mint); }
.btn.sky { --c: var(--sky); --d: var(--sky-d); --t: #fff; border-color: var(--sky); }
.btn.grape { --c: var(--grape); --d: var(--grape-d); --t: #fff; border-color: var(--grape); }
.btn.big { min-height: var(--tap); padding: 10px 26px; font-size: 1.2rem; border-radius: 18px; box-shadow: 0 6px 0 var(--d); }
.btn.big:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--d); }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 4px 12px; font-size: 0.95rem; box-shadow: 0 3px 0 var(--d); }
.btn.ghost { box-shadow: none; background: transparent; }
.btn.sorry { border-style: dashed; }
.link { background: none; border: 0; color: var(--sea-d); font: inherit; cursor: pointer; text-decoration: underline; padding: 6px; }
.linkish { background: none; border: 0; font: inherit; text-decoration: none; color: var(--ink); text-align: left; padding: 6px 8px; border-radius: 8px; width: 100%; cursor: pointer; }
.linkish.on { background: var(--coral-soft); }
.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; flex: none; }
.icon-btn.small { width: 36px; height: 36px; font-size: 1rem; background: #fff; border: 2px solid var(--line); border-radius: 12px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 2px solid var(--line); background: #fff; color: var(--ink); padding: 3px 12px; border-radius: 999px; font: inherit; font-size: 0.9rem; cursor: pointer; }
.chip.quiet { cursor: default; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--sea); border-color: var(--sea); color: #fff; }

/* ---------- 앱 틀: 휴대폰은 아래 탭, 태블릿은 왼쪽 아이콘, PC는 왼쪽 메뉴 + 오른쪽 카드 ---------- */
#app.frame { height: 100vh; height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
#app.frame.scroll { height: auto; min-height: 100dvh; overflow: visible; }
.side { display: none; }
.right { display: none; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(8px + var(--safe-t)) 14px 8px; border-bottom: 2px solid var(--line); background: var(--bg); min-width: 0; }
.topbar .place-name { font-family: var(--display); font-size: 1.05rem; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 12px; flex: none; }
.stat { display: flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 1.1rem; text-decoration: none; }
.stat.fire { color: #ff8a1f; } .stat.star { color: var(--sun-d); } .stat.ear { color: var(--grape); }
.page { min-height: 0; overflow: hidden; position: relative; }
#app.frame.scroll .page { overflow: visible; padding: 16px 16px 40px; display: grid; gap: 16px; align-content: start; max-width: 860px; width: 100%; margin: 0 auto; }
.tabbar { display: grid; grid-template-columns: repeat(5, 1fr); background: #fff; border-top: 2px solid var(--line); padding: 4px 0 calc(4px + var(--safe-b)); }
#app.frame.scroll .tabbar { position: sticky; bottom: 0; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 0.72rem; color: var(--muted); text-decoration: none; padding: 3px; }
.tab b { font-size: 1.5rem; line-height: 1.1; font-weight: 400; padding: 1px 12px; border-radius: 12px; }
.tab.on { color: var(--coral); font-weight: 700; }
.tab.on b { background: var(--coral-soft); outline: 2px solid #ffc6b8; }
.foot-links { color: var(--muted); font-size: 0.82rem; text-align: center; }
.foot-links a { color: var(--muted); }

@media (min-width: 700px) {
  #app.frame { grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .side { display: flex; grid-row: 1 / 3; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-right: 2px solid var(--line); background: #fff; }
  #app.frame.scroll .side { position: sticky; top: 0; height: 100dvh; }
  .side .logo { font-family: var(--display); color: var(--coral); font-size: 1.7rem; margin-bottom: 10px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
  .side .logo span { display: none; }
  .side .tab { width: 72px; padding: 8px 2px; border-radius: 16px; font-size: 0.75rem; }
  .side .tab.on { background: var(--coral-soft); outline: 2px solid #ffc6b8; }
  .side .tab.on b { background: none; outline: 0; }
  .side .foot-links { margin-top: auto; font-size: 0.7rem; }
  .tabbar { display: none; }
}
@media (min-width: 1100px) {
  #app.frame { grid-template-columns: 230px minmax(0, 1fr) 330px; }
  #app.frame.scroll { grid-template-columns: 230px minmax(0, 1fr); }
  .side { align-items: stretch; padding: 18px 14px; }
  .side .logo { font-size: 1.5rem; }
  .side .logo span { display: inline; font-size: 1.35rem; }
  .side .tab { width: auto; flex-direction: row; gap: 12px; font-size: 1.1rem; font-family: var(--display); padding: 10px 14px; }
  .side .tab b { font-size: 1.6rem; }
  .side .foot-links { text-align: left; font-size: 0.78rem; }
  .topbar { grid-column: 2 / 4; }
  #app.frame.scroll .topbar { grid-column: 2; }
  .right { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 16px 4px; overflow: hidden; grid-row: 2; grid-column: 3; }
}

/* ---------- 카드 ---------- */
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card h2, .card h3 { margin-bottom: 8px; }
.goal { display: flex; align-items: center; gap: 12px; }
.ring { --p: 0; width: 68px; height: 68px; border-radius: 50%; background: conic-gradient(var(--mint) calc(var(--p) * 1%), #e8f6ef 0); display: grid; place-items: center; flex: none; }
.ring span { width: 52px; height: 52px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-family: var(--display); font-size: 1.05rem; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: 0.75rem; color: var(--muted); }
.week i { display: grid; place-items: center; height: 30px; border-radius: 50%; background: #f4ede3; font-style: normal; font-size: 1rem; margin-top: 2px; }
.week .on i { background: #ffe1c2; }
.week .today i { outline: 2px solid var(--coral); }
.badges { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.badge-slot { aspect-ratio: 1; border-radius: 16px; display: grid; place-items: center; background: #fff3d6; border: 2px solid #ffe2a3; font-size: 1.6rem; overflow: hidden; }
.badge-slot img { width: 86%; height: 86%; object-fit: contain; }
.badge-slot.off { filter: grayscale(1); opacity: 0.3; }

/* ---------- 모험 섬 지도 (한 화면에 맞춤) ---------- */
.mapview { height: 100%; display: flex; flex-direction: column; gap: 10px; padding: 10px 12px; max-width: 720px; margin: 0 auto; }
.isle-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--sea); color: #fff; border-radius: 18px; padding: 8px 14px; box-shadow: 0 5px 0 var(--sea-d); }
.isle-head small { font-size: 0.8rem; opacity: 0.95; display: block; }
.isle-head h1 { font-size: clamp(1.05rem, 3.4vw, 1.5rem); margin: 0; }
.isle-prog { font-family: var(--display); font-size: 0.95rem; background: rgba(255,255,255,0.22); border-radius: 12px; padding: 4px 10px; white-space: nowrap; }
.isle-prog b { font-weight: 400; font-size: 1.25rem; }
.sea { flex: 1 1 auto; min-height: 0; border-radius: 26px; padding: clamp(8px, 2dvh, 18px); background: #8ad3ff radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 3px, transparent 4px) 0 0 / 60px 60px; container-type: size; }
.island { position: relative; width: 100%; height: 100%; background: #9edc6c; border: clamp(5px, 1.2cqmin, 10px) solid #ffe3a3; border-radius: 46% 54% 42% 58% / 7% 6% 8% 7%; }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.trail polyline { fill: none; stroke: #f6d38c; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.deco { position: absolute; transform: translate(-50%, -50%); font-size: clamp(14px, 4cqmin, 30px); opacity: 0.9; pointer-events: none; }
.place { --s: clamp(40px, 8.4cqh, 96px); position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; z-index: 2; text-decoration: none; color: inherit; }
.spot { position: relative; width: var(--s); height: var(--s); border-radius: 28%; display: grid; place-items: center; font-size: calc(var(--s) * 0.5); background: #fff; border: 3px solid #fff; box-shadow: 0 5px 0 rgba(60,100,30,0.35); }
.spot img { width: 86%; height: 86%; object-fit: contain; }
.sign { font-family: var(--display); font-size: clamp(10px, 2.3cqmin, 15px); color: #fff; background: #b87a3f; border: 2px solid #8f5a29; border-radius: 8px; padding: 0 7px; white-space: nowrap; line-height: 1.5; }
.place.done .spot { background: #fff6d6; border-color: var(--sun); }
.place.done .spot::after { content: "⭐⭐⭐"; position: absolute; top: calc(var(--s) * -0.2); font-size: calc(var(--s) * 0.15); letter-spacing: -2px; }
.place.now .spot { background: var(--coral-soft); border-color: var(--coral); box-shadow: 0 5px 0 var(--coral-d), 0 0 0 8px rgba(255,107,74,0.25); }
.place.now .spot::before { content: ""; position: absolute; inset: -14px; border-radius: 34%; border: 4px solid rgba(255,107,74,0.45); animation: ring 1.6s ease-out infinite; }
.place.open .spot { border-color: var(--sky); }
.place.lock { pointer-events: none; }
.place.lock .spot { filter: grayscale(0.85); opacity: 0.65; }
.place.lock .sign { background: #a59a8b; border-color: #857b6e; }
.fog { position: absolute; top: calc(var(--s) * -0.25); right: calc(var(--s) * -0.3); font-size: calc(var(--s) * 0.55); animation: drift 4s ease-in-out infinite; }
.go-tip { position: absolute; bottom: calc(100% + 6px); background: #fff; color: var(--coral); font-family: var(--display); font-size: clamp(12px, 2.8cqmin, 18px); padding: 3px 10px; border-radius: 12px; border: 2px solid var(--line); white-space: nowrap; animation: bob 1.2s ease-in-out infinite; }
.walker { position: absolute; width: clamp(44px, 11cqh, 110px); transform: translate(-128%, -42%); z-index: 3; animation: walk 1s ease-in-out infinite; pointer-events: none; }
.boat { flex: none; text-align: center; font-family: var(--display); font-size: 0.95rem; color: var(--sea-d); background: #e3f4ff; border: 2px dashed #8ad3ff; border-radius: 14px; padding: 6px 10px; }
.boat b { font-weight: 400; color: var(--coral-d); }
.map-actions { flex: none; display: flex; gap: 10px; }
.map-actions .btn { flex: 1; }

/* ---------- 첫 방문 · 누가 배워요 · 레벨 결과 (한 화면) ---------- */
.solo { height: 100vh; height: 100dvh; overflow: hidden; display: grid; place-items: center; padding: calc(12px + var(--safe-t)) 18px calc(12px + var(--safe-b)); background: radial-gradient(circle at 50% 28%, #ffe2d3, var(--bg) 62%); }
.wbox { width: min(980px, 100%); max-height: 100%; display: grid; gap: clamp(8px, 2dvh, 18px); justify-items: center; text-align: center; }
.wbox .logo { font-family: var(--display); font-size: 1.2rem; color: var(--coral); }
.wbox h1 { font-size: clamp(1.8rem, min(7vw, 6dvh), 3.4rem); line-height: 1.2; margin: 0; }
.wbox h1 em { font-style: normal; color: var(--coral); }
.wbox .sub { color: var(--muted); font-size: clamp(0.92rem, 2.2dvh, 1.1rem); max-width: 28em; margin: 0; }
.wbuddy { position: relative; height: clamp(110px, 30dvh, 300px); aspect-ratio: 0.85; }
.wbuddy img { width: 100%; height: 100%; object-fit: contain; animation: bob2 2.4s ease-in-out infinite; }
.wbuddy .bub { position: absolute; top: 4%; right: -24%; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 4px 12px; font-family: var(--en); font-weight: 800; font-size: 1.1rem; color: var(--sky-d); animation: bob 1.4s ease-in-out infinite; }
.wbtns { display: grid; gap: 12px; width: min(420px, 100%); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pills span { background: #fff; border: 2px solid var(--line); border-radius: 99px; padding: 2px 10px; font-size: 0.82rem; color: var(--muted); }
.wbox .foot-links { margin: 0; }
@media (min-width: 900px) and (min-height: 560px) {
  .wbox.split { grid-template-columns: 1fr 1fr; text-align: left; justify-items: start; align-items: center; gap: 14px 48px; }
  .wbox.split .wbuddy { grid-row: 1 / 7; grid-column: 2; justify-self: center; height: clamp(200px, 52dvh, 420px); }
  .wbox.split .pills { justify-content: flex-start; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .wbox.split { grid-template-columns: 1fr 1.3fr; text-align: left; justify-items: start; align-items: center; gap: 6px 24px; }
  .wbox.split .wbuddy { grid-row: 1 / 7; grid-column: 1; justify-self: center; height: 70dvh; }
  .wbox.split .pills { justify-content: flex-start; }
}
.who-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(560px, 100%); }
.who-opt { font: inherit; display: grid; justify-items: center; gap: 2px; padding: clamp(8px, 1.6dvh, 14px) 6px; border-radius: 18px; border: 3px solid var(--line); background: #fff; box-shadow: 0 5px 0 var(--line); cursor: pointer; color: var(--ink); }
.who-opt .mi { font-size: clamp(1.6rem, 5dvh, 2.4rem); }
.who-opt strong { font-family: var(--display); font-weight: 400; font-size: 1.05rem; }
.who-opt small { color: var(--muted); font-size: 0.75rem; line-height: 1.3; }
.who-opt.on { border-color: var(--coral); background: var(--coral-soft); box-shadow: 0 5px 0 var(--coral-d); }
.name-row { display: grid; gap: 6px; width: min(420px, 100%); text-align: left; }
.name-row label { font-weight: 700; font-size: 0.95rem; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 48px; width: 100%; }
input:focus { border-color: var(--coral); outline: none; }

.lv-badge { width: clamp(100px, 22dvh, 170px); aspect-ratio: 1; border-radius: 50%; background: var(--grape); box-shadow: 0 8px 0 var(--grape-d), 0 0 0 10px #eadcff; display: grid; place-items: center; color: #fff; animation: pop 0.8s both; text-align: center; }
.lv-badge small { font-family: var(--display); font-size: clamp(0.8rem, 2dvh, 1.05rem); display: block; }
.lv-badge b { font-family: var(--display); font-weight: 400; font-size: clamp(2.2rem, 7dvh, 3.4rem); line-height: 1; }
.lv-name { font-family: var(--display); color: var(--grape-d); font-size: clamp(1rem, 2.6dvh, 1.3rem); }
.start-at { display: flex; align-items: center; gap: 12px; width: min(520px, 100%); background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: clamp(8px, 1.6dvh, 14px) 14px; text-align: left; }
.start-at .spot { --s: clamp(44px, 8dvh, 64px); flex: none; background: var(--coral-soft); border-color: var(--coral); box-shadow: 0 5px 0 var(--coral-d); }
.heard { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.heard span { background: #fff; border: 2px solid #d9c8ff; color: var(--grape-d); border-radius: 99px; padding: 2px 10px; font-family: var(--en); font-weight: 800; font-size: 0.9rem; }

/* ---------- 문제 화면: 항상 한 화면 ---------- */
#app.playing { height: 100vh; height: 100dvh; overflow: hidden; }
.play {
  height: 100%; max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: clamp(6px, 1.2dvh, 12px);
  padding: calc(8px + var(--safe-t)) max(12px, env(safe-area-inset-right, 0px)) calc(8px + var(--safe-b)) max(12px, env(safe-area-inset-left, 0px));
}
.play-top { flex: none; display: flex; align-items: center; gap: 10px; }
.bar { flex: 1; height: clamp(14px, 2.2dvh, 20px); border-radius: 99px; background: #efe5d8; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--mint); border-radius: 99px; box-shadow: inset 0 -5px 0 rgba(0,0,0,0.12), inset 0 4px 0 rgba(255,255,255,0.35); transition: width 0.5s cubic-bezier(.3,1.4,.5,1); }
.combo { font-family: var(--display); color: #ff8a1f; font-size: 1.1rem; white-space: nowrap; }
.combo.pop { animation: pop 0.6s; }
.stage-wrap { flex: 1 1 0; min-height: 70px; border-radius: 22px; overflow: hidden; border: 2px solid var(--line); container-type: size; }
.stage { position: relative; height: 100%; background: linear-gradient(180deg, var(--sky-c) 0 64%, var(--ground) 64% 100%); color: #1b2236; }
.stage .deco span { position: absolute; font-size: clamp(16px, 14cqh, 30px); opacity: 0.85; }
.stage .deco .d0 { left: 5%; bottom: 30%; }
.stage .deco .d1 { right: 5%; top: 8%; }
.prop { position: absolute; left: 20%; top: 10%; transform: translateX(-50%) scale(0); font-size: clamp(24px, 26cqh, 64px); transition: transform 0.35s cubic-bezier(.3,1.6,.5,1); z-index: 2; }
.prop.on { transform: translateX(-50%) scale(1); }
.cast { position: absolute; left: 0; right: 0; bottom: 6%; display: flex; justify-content: center; gap: clamp(2px, 3cqw, 28px); align-items: flex-end; }
.actor { position: relative; display: grid; justify-items: center; transition: opacity 0.25s, transform 0.25s; }
.actor .pic { font-size: clamp(26px, 42cqh, 120px); line-height: 1; }
.cast[data-n="4"] .actor .pic, .cast[data-n="5"] .actor .pic { font-size: clamp(22px, 32cqh, 90px); }
.actor .name { font-family: var(--en); font-weight: 800; font-size: clamp(10px, 6cqh, 13px); background: rgba(255,255,255,0.88); padding: 0 8px; border-radius: 99px; }
.actor.dim { opacity: 0.45; transform: scale(0.92); }
.actor.target { opacity: 1; transform: scale(1.06); }
.actor.target .name { background: var(--sun); }
.bubble { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 4px; white-space: nowrap; background: #fff; color: #1b2236; border-radius: 14px; padding: 4px 12px; box-shadow: 0 3px 10px rgba(0,0,0,0.15); z-index: 3; max-width: 78vw; }
.bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.bubble .txt { font-family: var(--en); font-weight: 800; font-size: clamp(0.85rem, 8cqh, 1.15rem); white-space: normal; display: block; min-width: 5em; text-align: center; }
.wave { display: inline-flex; gap: 3px; align-items: center; height: 20px; }
.wave i { width: 5px; height: 8px; border-radius: 3px; background: var(--coral); animation: wave 0.9s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: 0.15s; } .wave i:nth-child(3) { animation-delay: 0.3s; } .wave i:nth-child(4) { animation-delay: 0.45s; }
.actor:not(.talking) .wave i { animation-play-state: paused; }
.say { flex: none; display: flex; gap: 8px; align-items: center; background: #fff; border-radius: 16px; padding: 6px 10px; border: 2px solid var(--line); }
.say-text { margin: 0; font-weight: 700; font-size: clamp(0.9rem, 2.2dvh, 1.05rem); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.parent-tip { flex: none; background: var(--warn-soft); border-radius: 12px; padding: 4px 10px; margin: 0; font-size: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.panel { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; gap: clamp(6px, 1.2dvh, 12px); overflow-y: auto; scrollbar-width: none; }
.panel::-webkit-scrollbar { display: none; }
.panel > .row { flex: none; }
.counter { text-align: center; color: var(--muted); font-size: 0.8rem; margin: 0; flex: none; }
.options { display: grid; gap: clamp(8px, 1.4dvh, 14px); grid-template-columns: repeat(2, 1fr); flex: none; }
.options.n3 { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 700px) { .options.n4 { grid-template-columns: repeat(4, 1fr); } }
.option {
  position: relative; font: inherit; color: var(--ink); background: #fff; border: 3px solid var(--line); border-radius: 20px; box-shadow: 0 5px 0 var(--line);
  min-height: clamp(58px, 12.5dvh, 150px); padding: 6px; display: grid; place-items: center; align-content: center; gap: 2px; cursor: pointer; transition: transform 0.08s, box-shadow 0.08s;
}
.option:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.option:disabled { opacity: 0.4; }
.opic { font-size: clamp(1.8rem, 6dvh, 3.6rem); line-height: 1.05; }
.olabel { font-weight: 700; font-size: clamp(0.82rem, 1.9dvh, 1rem); text-align: center; line-height: 1.25; }
.option.right { border-color: var(--mint); background: var(--mint-soft); box-shadow: 0 5px 0 var(--mint-d); opacity: 1; }
.option.right::after { content: "✓"; position: absolute; top: 6px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #fff; font-size: 14px; display: grid; place-items: center; font-weight: 800; }
.option.reveal { animation: glow 1s ease-in-out 3; }
.option .num { position: absolute; top: 4px; left: 8px; font-weight: 800; color: var(--mint-d); }
.room { position: relative; height: clamp(150px, 30dvh, 260px); border-radius: 20px; background: linear-gradient(180deg, #fff 0 55%, #e3f4ff 55%); border: 2px solid var(--line); flex: none; }
.room .option { position: absolute; min-height: 0; width: clamp(54px, 10dvh, 80px); height: clamp(54px, 10dvh, 80px); padding: 0; border-radius: 18px; }
.room .option .olabel { display: none; }
.room .option .opic { font-size: clamp(1.6rem, 5dvh, 2.4rem); }
.room .option:nth-child(1) { left: 6%; top: 10%; } .room .option:nth-child(2) { left: 40%; top: 5%; } .room .option:nth-child(3) { right: 6%; top: 14%; }
.room .option:nth-child(4) { left: 12%; bottom: 8%; } .room .option:nth-child(5) { left: 44%; bottom: 12%; } .room .option:nth-child(6) { right: 10%; bottom: 6%; }
.hint { text-align: center; background: var(--warn-soft); border-radius: 12px; padding: 4px 10px; margin: 0; font-weight: 700; font-size: 0.92rem; flex: none; }
.feedback { text-align: center; font-family: var(--display); font-size: 1.2rem; margin: 0; flex: none; }
.feedback.good { color: var(--mint-d); } .feedback.soft { color: var(--muted); }
.sparkle { position: absolute; left: 50%; top: 20%; font-size: 2.2rem; pointer-events: none; animation: sparkle 0.9s ease-out forwards; z-index: 5; }
.meaning { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px; flex: none; }
.script { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 4px; }
.script li { display: grid; grid-template-columns: auto auto 1fr; gap: 8px; align-items: center; font-size: 0.92rem; }
.script .who { font-size: 1.5rem; }
.script .line { font: inherit; font-family: var(--en); font-weight: 800; background: #f4ede3; color: var(--ink); border: 0; border-radius: 10px; padding: 2px 10px; cursor: pointer; text-align: left; }
.script .kr { color: var(--muted); }
.explain { margin: 0; background: #e3f4ff; border-radius: 12px; padding: 8px 10px; font-size: 0.92rem; }
.chunk { background: #fff; border-radius: 18px; padding: clamp(8px, 2dvh, 16px); text-align: center; border: 2px solid var(--line); flex: none; }
.parts { display: flex; gap: 8px; justify-content: center; align-items: baseline; flex-wrap: wrap; }
.part { font-family: var(--en); font-weight: 600; font-size: 1.1rem; color: var(--muted); padding: 2px 8px; border-radius: 10px; transition: background 0.2s; }
.part.strong { font-size: clamp(1.4rem, 4dvh, 2rem); font-weight: 800; color: var(--ink); }
.part.lit { background: var(--sun); color: #1b2236; }
.chunk.hide-words .part { color: transparent; background: #f4ede3; min-width: 3em; }
.chunk.hide-words .part.strong { min-width: 4em; }
.chunk.hide-words .part.lit { background: var(--sun); }
.tone { font-size: 1.5rem; color: var(--coral); font-weight: 800; }
.note { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }
.tpr-pic { font-size: clamp(3rem, 12dvh, 6rem); text-align: center; animation: pop 0.4s both; flex: none; line-height: 1.1; }
.tpr-pic.small { font-size: clamp(2rem, 7dvh, 3.2rem); }
.model { font: inherit; display: flex; align-items: center; justify-content: center; gap: 12px; background: #fff; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--line); border-radius: 20px; padding: clamp(6px, 1.4dvh, 12px) 14px; color: var(--ink); cursor: pointer; flex: none; }
.mpic { font-size: clamp(1.8rem, 5dvh, 2.6rem); }
.mtext { font-family: var(--en); font-weight: 800; font-size: clamp(1.1rem, 3dvh, 1.5rem); }
.play:not(.show-text) .mtext { filter: blur(6px); }
.play:not(.show-text) .model:hover .mtext, .play:not(.show-text) .model:focus .mtext { filter: none; }
.mhint { font-size: 0.75rem; color: var(--muted); }
.mic { width: clamp(64px, 11dvh, 92px); height: clamp(64px, 11dvh, 92px); border-radius: 50%; border: 0; background: var(--coral); color: #fff; font-size: clamp(1.8rem, 5dvh, 2.6rem); cursor: pointer; box-shadow: 0 6px 0 var(--coral-d); }
.mic:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--coral-d); }
.mic.small { width: clamp(52px, 8dvh, 64px); height: clamp(52px, 8dvh, 64px); font-size: 1.6rem; }
.mic.listening { animation: micpulse 1s ease-in-out infinite; }
.mic:disabled { opacity: 0.6; }
.your-turn { text-align: center; font-family: var(--display); color: var(--coral); font-size: 1.05rem; margin: 0; animation: bob 1.2s ease-in-out infinite; }
.status { text-align: center; min-height: 1.4em; margin: 0; font-weight: 700; flex: none; font-size: 0.95rem; }
.badge { align-self: center; background: #e3f4ff; color: var(--ink); border-radius: 99px; padding: 2px 12px; margin: 0; font-weight: 700; font-size: 0.88rem; flex: none; }
.badge.ask { background: var(--coral-soft); }
.dlog { flex: none; max-height: clamp(44px, 12dvh, 140px); overflow-y: auto; display: grid; gap: 4px; padding: 2px; scrollbar-width: none; }
.dline { display: flex; gap: 6px; align-items: center; }
.dline.me { flex-direction: row-reverse; }
.dpic { font-size: 1.3rem; }
.dtext { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 1px 10px; font-weight: 700; font-size: 0.92rem; }
.dline.me .dtext { background: var(--coral-soft); }
.play:not(.show-text) .dtext { filter: blur(5px); }
.dzone { display: flex; flex-direction: column; gap: clamp(6px, 1.2dvh, 10px); flex: none; }
.cards { display: grid; gap: 8px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .cards { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } }
.cards .card { font: inherit; font-family: var(--en); font-weight: 800; font-size: clamp(1rem, 2.4dvh, 1.15rem); min-height: clamp(44px, 7dvh, 58px); padding: 6px 14px; border-radius: 16px; border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); background: #fff; color: var(--ink); cursor: pointer; }
.cards .card.right { border-color: var(--mint); background: var(--mint-soft); box-shadow: 0 4px 0 var(--mint-d); }
.cards .card:disabled { opacity: 0.4; }
.mic-row { gap: 12px; }
.consent { background: var(--warn-soft); border-radius: 18px; padding: 12px; display: grid; gap: 6px; font-size: 0.9rem; flex: none; }
.consent h3 { margin: 0; }
.consent p { margin: 0; }
.shake { animation: shake 0.45s; }

/* 가로로 눕힌 휴대폰: 왼쪽 장면, 오른쪽 문제 */
@media (orientation: landscape) and (max-height: 560px) {
  .play { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); grid-template-rows: auto auto auto minmax(0, 1fr); column-gap: 14px; max-width: none; }
  .play-top { grid-column: 1 / 3; }
  .stage-wrap { grid-column: 1; grid-row: 2 / 5; min-height: 0; }
  .say { grid-column: 2; grid-row: 2; }
  .parent-tip { grid-column: 2; grid-row: 3; }
  .panel { grid-column: 2; grid-row: 4; }
  .options { gap: 8px; }
  .option { min-height: clamp(50px, 18dvh, 110px); }
}

/* ---------- 칭찬 창 (아래에서 올라옴) ---------- */
.psheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--mint-soft); border-top: 3px solid #aeeccb; padding: 12px 16px calc(12px + var(--safe-b)); animation: up 0.35s cubic-bezier(.2,1.4,.4,1); }
.psheet.soft { background: #fff3d6; border-top-color: #ffe2a3; }
.psheet .in { max-width: 820px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.psheet img { width: clamp(52px, 9dvh, 76px); flex: none; animation: pop 0.5s; }
.psheet h3 { color: var(--mint-d); font-size: clamp(1.3rem, 3.4dvh, 1.7rem); margin: 0; }
.psheet.soft h3 { color: var(--sun-d); }
.psheet p { margin: 0; color: #22684a; font-size: 0.92rem; }
.psheet.soft p { color: #7a5a00; }
.psheet.out { animation: down 0.25s forwards; }

/* ---------- 미션 보상 (한 화면) ---------- */
.party { position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: #ffefc9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(4px, 1.2dvh, 12px); padding: calc(10px + var(--safe-t)) 16px calc(12px + var(--safe-b)); text-align: center; }
.party.soft { background: #e9f6ff; }
.rays { position: absolute; left: 50%; top: 32%; width: 1800px; height: 1800px; margin: -900px 0 0 -900px; background: repeating-conic-gradient(rgba(255,201,60,0.5) 0 10deg, transparent 10deg 20deg); border-radius: 50%; animation: spin 18s linear infinite; -webkit-mask: radial-gradient(circle, #000 18%, transparent 60%); mask: radial-gradient(circle, #000 18%, transparent 60%); pointer-events: none; }
.party.soft .rays { background: repeating-conic-gradient(rgba(76,182,255,0.28) 0 10deg, transparent 10deg 20deg); }
.party.lv .rays { background: repeating-conic-gradient(rgba(155,107,255,0.25) 0 10deg, transparent 10deg 20deg); }
.party.lv { background: #f3ebff; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear infinite; }
.party > *:not(.rays):not(.confetti) { position: relative; z-index: 1; }
.stars { display: flex; gap: 4px; align-items: flex-end; }
.stars b { font-size: clamp(2rem, 7dvh, 3.6rem); font-weight: 400; filter: drop-shadow(0 4px 0 var(--sun-d)); animation: starpop 0.7s both; }
.stars b:nth-child(2) { font-size: clamp(2.6rem, 9.5dvh, 4.8rem); animation-delay: 0.3s; }
.stars b:nth-child(3) { animation-delay: 0.6s; }
.stars b.off { filter: grayscale(1); opacity: 0.25; }
.hero-buddy { height: clamp(90px, 26dvh, 260px); width: auto; animation: jump 0.9s ease-in-out infinite; }
.party h1 { font-size: clamp(1.8rem, min(8vw, 6.5dvh), 3.4rem); color: var(--coral); text-shadow: 0 3px 0 #fff; margin: 0; }
.party.soft h1 { color: var(--sea-d); }
.praise { font-family: var(--display); font-size: clamp(1rem, 2.7dvh, 1.4rem); margin: 0; max-width: 30em; }
.cando { font-size: clamp(0.88rem, 2dvh, 1rem); color: var(--muted); margin: 0; max-width: 32em; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(520px, 100%); }
.tile { border-radius: 16px; border: 3px solid; overflow: hidden; background: #fff; }
.tile small { display: block; color: #fff; font-family: var(--display); font-size: 0.8rem; padding: 2px; }
.tile b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(1.2rem, 3.6dvh, 1.7rem); padding: clamp(2px, 0.8dvh, 8px) 2px; }
.tile.y { border-color: var(--sun); } .tile.y small { background: var(--sun); color: #6b4a00; } .tile.y b { color: var(--sun-d); }
.tile.g { border-color: var(--mint); } .tile.g small { background: var(--mint); } .tile.g b { color: var(--mint-d); }
.tile.p { border-color: var(--grape); } .tile.p small { background: var(--grape); } .tile.p b { color: var(--grape-d); }
.gift { font: inherit; display: flex; align-items: center; gap: 12px; width: min(520px, 100%); background: #fff; border: 3px solid #e7d3ff; border-radius: 20px; padding: clamp(4px, 1dvh, 10px) 14px; text-align: left; cursor: pointer; color: var(--ink); box-shadow: 0 5px 0 #e7d3ff; }
.gift img { height: clamp(40px, 7.5dvh, 64px); width: auto; flex: none; animation: shake 1.3s ease-in-out infinite; }
.gift.opened img { animation: pop 0.6s; }
.gift b { font-family: var(--display); font-weight: 400; font-size: 1.1rem; color: var(--grape-d); display: block; }
.gift span { font-size: 0.85rem; color: var(--muted); }
.party .actions { display: flex; gap: 10px; width: min(520px, 100%); }
.party .actions .btn { flex: 1; }
.party .foot-row { display: flex; gap: 14px; justify-content: center; font-size: 0.9rem; }

/* 아래에서 올라오는 시트(부모님께 등) — 시트 안에서만 스크롤 */
.sheet-bg { position: fixed; inset: 0; background: rgba(42,33,64,0.45); z-index: 80; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { background: #fff; width: min(640px, 100%); max-height: 86dvh; overflow-y: auto; border-radius: 24px 24px 0 0; padding: 18px 18px calc(18px + var(--safe-b)); animation: up 0.3s ease-out; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet-card { border-radius: 24px; } }

/* ---------- 스티커 ---------- */
.sticker-page { height: 100%; display: flex; flex-direction: column; gap: 12px; padding: 12px; max-width: 760px; margin: 0 auto; }
.sticker-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(5, 1fr); grid-auto-rows: 1fr; gap: clamp(6px, 1.4dvh, 14px); }
@media (max-width: 520px) { .sticker-grid { grid-template-columns: repeat(3, 1fr); } }
.sticker { border-radius: 20px; background: #fff3d6; border: 3px solid #ffe2a3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; min-height: 0; overflow: hidden; }
.sticker img { width: 70%; max-height: 70%; object-fit: contain; }
.sticker .em { font-size: clamp(1.6rem, 6dvh, 3rem); }
.sticker small { font-family: var(--display); font-size: clamp(0.7rem, 1.7dvh, 0.9rem); color: #8f5a29; text-align: center; }
.sticker.off { background: #f4ede3; border-color: var(--line); filter: grayscale(1); opacity: 0.45; }

/* ---------- 설정·안내·관리자 (스크롤 허용) ---------- */
.form { display: grid; gap: 8px; }
.form label { font-weight: 700; margin-top: 6px; }
textarea.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.85rem; line-height: 1.45; }
textarea.bad { border-color: var(--coral); }
.switch { display: flex; gap: 10px; align-items: flex-start; font-weight: 400 !important; cursor: pointer; }
.switch input { width: 22px; height: 22px; min-height: 0; margin-top: 3px; flex: none; accent-color: var(--coral); }
.note-box { background: var(--warn-soft); border-radius: 12px; padding: 8px 12px; }
.learners { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.learner { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; border: 2px solid var(--line); }
.learner.on { border-color: var(--coral); }
.lav { font-size: 1.8rem; }
.admin { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .admin { grid-template-columns: 240px 1fr; } }
.admin aside { background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 12px; align-self: start; }
.admin-list { list-style: none; padding: 0; margin: 0; }
.admin-edit { background: #fff; border: 2px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.step { border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.step summary { cursor: pointer; font-weight: 700; }
.admin-errors:not(:empty) { background: var(--coral-soft); border-radius: 14px; padding: 12px 16px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.2em; }
.ad { border: 2px solid var(--line); border-radius: 12px; padding: 8px; min-height: 100px; background: #fff; }
.ad.placeholder { display: grid; place-items: center; color: var(--muted); border-style: dashed; font-size: 0.9rem; }
.ad-label { font-size: 0.75rem; color: var(--muted); }
.mission-intro { max-width: 600px; margin: 0 auto; width: 100%; text-align: center; display: grid; gap: 10px; justify-items: center; }

/* ---------- 알림·창 ---------- */
#toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translate(-50%, 40px); opacity: 0; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 14px; transition: 0.25s; z-index: 90; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; background: rgba(42,33,64,0.5); display: grid; place-items: center; z-index: 95; padding: 16px; }
.modal-card { background: #fff; color: var(--ink); border-radius: 22px; padding: 20px; max-width: 420px; width: 100%; }

/* ---------- 움직임 ---------- */
.a-enter { animation: enter 0.7s both; } .a-leave { animation: leave 1.2s both; } .a-wave { animation: wavehand 0.6s 2; transform-origin: 50% 90%; }
.a-bounce { animation: bounce 0.6s 2; } .a-nod { animation: nod 0.45s 2; } .a-shake { animation: headshake 0.45s 2; } .a-look { animation: look 1.2s; }
.a-jump { animation: hop 0.55s 3; } .a-swim { animation: swim 0.8s 3; } .a-fly { animation: fly 1.6s; } .a-shrug { animation: shrug 0.9s; }
.a-clap { animation: clap 0.3s 5; } .a-sit { animation: sit 0.6s both; } .a-stand { animation: stand 0.6s both; } .a-freeze { animation: freeze 0.9s; }
.a-hungry { animation: hungry 0.8s 2; } .a-full { animation: full 0.7s 2; } .a-love { animation: love 0.8s 2; } .a-yuck { animation: yuck 0.7s 2; }
.a-point { animation: point 0.8s; } .a-shiver { animation: shiver 0.12s 8; }
@keyframes enter { from { transform: translateX(-120px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes leave { 0% { transform: none; } 60% { transform: translateX(60px); opacity: 0.4; } 100% { transform: none; opacity: 1; } }
@keyframes wavehand { 50% { transform: rotate(-14deg); } }
@keyframes bounce { 50% { transform: translateY(-14px); } }
@keyframes nod { 50% { transform: translateY(8px) rotate(4deg); } }
@keyframes headshake { 25% { transform: translateX(-8px) rotate(-6deg); } 75% { transform: translateX(8px) rotate(6deg); } }
@keyframes look { 30% { transform: rotate(-10deg); } 70% { transform: rotate(10deg); } }
@keyframes hop { 50% { transform: translateY(-30%); } }
@keyframes swim { 0%, 100% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(14px, 6px) rotate(12deg); } }
@keyframes fly { 40% { transform: translateY(-60%) rotate(-8deg); } 70% { transform: translateY(-40%) rotate(8deg); } }
@keyframes shrug { 30%, 70% { transform: translateY(-6px) scaleX(1.08); } }
@keyframes clap { 50% { transform: scale(1.12); } }
@keyframes sit { to { transform: translateY(12%) scaleY(0.88); } }
@keyframes stand { from { transform: translateY(12%) scaleY(0.88); } to { transform: none; } }
@keyframes freeze { 0%, 100% { filter: none; } 20%, 80% { filter: grayscale(1) brightness(1.1); transform: scale(1.04); } }
@keyframes hungry { 50% { transform: scaleY(0.92) translateY(6px); } }
@keyframes full { 50% { transform: scaleX(1.15); } }
@keyframes love { 50% { transform: scale(1.18); filter: drop-shadow(0 0 8px #ff6b8a); } }
@keyframes yuck { 25% { transform: rotate(-12deg) translateX(-6px); } 75% { transform: rotate(-12deg) translateX(-10px); } }
@keyframes point { 50% { transform: translateX(16px) rotate(8deg); } }
@keyframes shiver { 50% { transform: translateX(3px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes bob2 { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes walk { 0%, 100% { margin-top: 0; rotate: -4deg; } 50% { margin-top: -8px; rotate: 4deg; } }
@keyframes jump { 0%, 100% { transform: translateY(0) scaleY(1); } 40% { transform: translateY(-9%) scaleY(1.04); } 85% { transform: translateY(0) scaleY(0.95); } }
@keyframes pop { 0% { transform: scale(0.4); opacity: 0; } 70% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes starpop { 0% { transform: scale(0) rotate(-90deg); opacity: 0; } 70% { transform: scale(1.3) rotate(10deg); opacity: 1; } 100% { transform: scale(1); } }
@keyframes wave { 50% { height: 20px; } }
@keyframes shake { 20%, 60% { transform: translateX(-8px) rotate(-4deg); } 40%, 80% { transform: translateX(8px) rotate(4deg); } }
@keyframes glow { 50% { box-shadow: 0 0 0 6px var(--mint-soft); } }
@keyframes ring { from { transform: scale(0.85); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes micpulse { 50% { transform: scale(1.08); box-shadow: 0 0 0 12px rgba(255,107,74,0.25); } }
@keyframes sparkle { from { transform: translate(-50%, 0) scale(0.5); opacity: 1; } to { transform: translate(-50%, -40px) scale(1.4); opacity: 0; } }
@keyframes fall { to { transform: translateY(115dvh) rotate(720deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { 50% { transform: translateX(6px); } }
@keyframes up { from { transform: translateY(100%); } }
@keyframes down { to { transform: translateY(110%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- 보물상자 · 보석 · 라이노 옷장 ---------- */
.gift.gold { border-color: #ffd86b; box-shadow: 0 5px 0 #e0a100; background: #fffbea; }
.gift.opening img { animation: chestopen 0.7s ease-in-out; }
.gift.opened { cursor: default; flex-direction: column; align-items: stretch; gap: 6px; }
.loot-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.loot { display: flex; flex-direction: column; align-items: center; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 2px 10px; min-width: 74px; animation: pop 0.5s both; }
.loot:nth-child(2) { animation-delay: 0.2s; } .loot:nth-child(3) { animation-delay: 0.4s; }
.loot b { font-family: var(--display); font-weight: 400; font-size: clamp(1.1rem, 3.2dvh, 1.5rem); color: var(--grape-d); line-height: 1.3; }
.loot b img { height: clamp(26px, 4.5dvh, 40px); width: auto; animation: none; vertical-align: middle; }
.loot span { font-size: 0.75rem; color: var(--muted); }
.loot.new { border-color: var(--grape); background: #f3ebff; }
.gift .btn { align-self: center; }
.burst { position: relative; height: 0; width: 0; z-index: 3; }
.burst i { position: absolute; left: 0; top: -40px; font-style: normal; font-size: 1.3rem; animation: burst 1s ease-out forwards; }
@keyframes burst { from { transform: rotate(var(--a)) translateY(0) rotate(calc(-1 * var(--a))); opacity: 1; } to { transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) rotate(calc(-1 * var(--a))); opacity: 0; } }
@keyframes chestopen { 0%, 100% { transform: rotate(0) scale(1); } 20% { transform: rotate(-14deg) scale(1.1); } 40% { transform: rotate(14deg) scale(1.15); } 60% { transform: rotate(-10deg) scale(1.25); } 80% { transform: scale(1.4); } }

.dressed { position: relative; display: inline-block; }
.dressed img { display: block; height: 100%; width: auto; }
.dressed .wear-head { position: absolute; left: 50%; top: -6%; transform: translateX(-50%) rotate(-6deg); font-size: 2.2em; line-height: 1; }
.dressed .wear-face { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); font-size: 1.7em; line-height: 1; }
.walker.dressed { width: auto; height: clamp(54px, 13cqh, 130px); font-size: clamp(10px, 2.4cqh, 22px); }
.hero-buddy.dressed { height: clamp(90px, 26dvh, 260px); font-size: clamp(14px, 4.4dvh, 40px); animation: jump 0.9s ease-in-out infinite; }
.hero-buddy.dressed img { animation: none; }

.seg { flex: none; display: flex; gap: 6px; background: #f4ede3; padding: 4px; border-radius: 16px; align-self: center; }
.seg a { font-family: var(--display); text-decoration: none; color: var(--muted); padding: 6px 14px; border-radius: 12px; }
.seg a.on { background: #fff; color: var(--coral); box-shadow: 0 2px 0 var(--line); }
.closet { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 10px; align-items: center; justify-items: center; }
.closet-rhino { height: 100%; max-height: 40dvh; font-size: clamp(14px, 4.5dvh, 40px); }
.closet-grid { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(6px, 1.2dvh, 12px); }
.closet-item { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 0; padding: clamp(4px, 1dvh, 10px) 4px; border-radius: 16px; border: 3px solid var(--line); background: #fff; box-shadow: 0 4px 0 var(--line); cursor: pointer; color: var(--ink); }
.closet-item .ce { font-size: clamp(1.4rem, 4.5dvh, 2.4rem); line-height: 1.2; }
.closet-item small { font-size: clamp(0.68rem, 1.6dvh, 0.85rem); }
.closet-item .tag { font-family: var(--display); font-size: 0.8rem; color: var(--mint-d); }
.closet-item .tag.price { color: var(--grape-d); }
.closet-item.locked .ce { filter: grayscale(1); opacity: 0.5; }
.closet-item.on { border-color: var(--grape); background: #f3ebff; box-shadow: 0 4px 0 var(--grape-d); }
@media (min-width: 900px) and (min-height: 560px) { .closet { grid-template-columns: 1fr 1.3fr; grid-template-rows: minmax(0, 1fr); } .closet-rhino { max-height: 60dvh; } .closet-grid { grid-template-columns: repeat(2, 1fr); } }
@media (orientation: landscape) and (max-height: 560px) { .closet { grid-template-columns: 1fr 2fr; grid-template-rows: minmax(0, 1fr); } .closet-rhino { max-height: 70dvh; } }

/* 가로로 눕힌 휴대폰: 높이가 낮으니 문제 칸을 더 촘촘하게 */
@media (orientation: landscape) and (max-height: 560px) {
  .play { gap: 6px; padding-top: calc(4px + var(--safe-t)); padding-bottom: calc(4px + var(--safe-b)); }
  .panel { gap: 5px; }
  .panel .counter, .panel .your-turn, .chunk .note, .panel .mhint { display: none; }
  .panel .btn.big { min-height: 42px; padding: 4px 18px; font-size: 1.05rem; box-shadow: 0 4px 0 var(--d); }
  .panel .btn { min-height: 40px; padding: 4px 14px; }
  .mic { width: 52px; height: 52px; font-size: 1.5rem; }
  .mic.small { width: 46px; height: 46px; font-size: 1.3rem; }
  .model { padding: 4px 12px; }
  .status { min-height: 0; font-size: 0.85rem; }
  .badge { font-size: 0.8rem; padding: 0 10px; }
  .link { padding: 0 6px; font-size: 0.85rem; }
  .dlog { max-height: 54px; }
  .cards .card { min-height: 38px; padding: 2px 10px; font-size: 0.95rem; }
  .chunk { padding: 6px; }
  .part.strong { font-size: 1.3rem; }
  .say { padding: 4px 8px; }
  .say-text { font-size: 0.88rem; }
  .play-top .icon-btn { width: 36px; height: 36px; }
  .bar { height: 12px; }
}

/* 가로로 눕힌 휴대폰: 보상·레벨 화면은 왼쪽 라이노, 오른쪽 내용 */
@media (orientation: landscape) and (max-height: 560px) {
  .party { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); grid-auto-flow: row dense; align-content: center; justify-items: center; column-gap: 20px; row-gap: 5px; }
  .party > * { grid-column: 2; }
  .party > .stars, .party > .lv-badge { grid-column: 1; grid-row: 1; }
  .party > .hero-buddy, .party > .lv-name { grid-column: 1; grid-row: 2 / span 6; align-self: start; }
  .party .hero-buddy { height: 52dvh; }
  .party h1 { font-size: 1.6rem; }
  .stars b { font-size: 2rem; } .stars b:nth-child(2) { font-size: 2.6rem; }
  .tile b { padding: 0 2px; font-size: 1.2rem; }
  .gift { padding: 2px 12px; }
  .party .btn.big { min-height: 42px; padding: 4px 18px; }
  .lv-badge { width: 34dvh; }
  .start-at { padding: 4px 10px; }
  .heard span { font-size: 0.8rem; }
}

/* 키가 작은 화면: 보상 화면을 더 촘촘하게 */
@media (max-height: 720px) and (orientation: portrait) {
  .party { gap: 4px; justify-content: space-evenly; }
  .party .cando { display: none; }
  .hero-buddy.dressed, .hero-buddy { height: 19dvh; }
  .stars b { font-size: 5.5dvh; } .stars b:nth-child(2) { font-size: 7dvh; }
  .gift.opened { gap: 3px; }
  .loot { padding: 0 8px; }
  .party .btn.big { min-height: 48px; }
}

/* ---------- 지금 할 일 안내 (2026-11-30) ---------- */
.say-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.say-main .say-text { font-size: clamp(0.78rem, 1.8dvh, 0.92rem); font-weight: 600; color: var(--muted, #6b6b80); -webkit-line-clamp: 1; }
.cue { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 3px 14px 3px 6px; border-radius: 999px;
  background: var(--sun, #ffd54a); color: #3b2a00; font-family: var(--display); font-size: clamp(1.05rem, 2.8dvh, 1.4rem); line-height: 1.2; }
.cue .cue-i { font-size: 1.35em; line-height: 1; }
.cue.pop { animation: cuePop 0.35s ease-out; }
.cue-listen, .cue-watch { background: #dff1ff; color: #0b4a7a; }
.cue-listen .cue-i, .cue-watch .cue-i { animation: earWiggle 0.9s ease-in-out infinite; }
.cue-tap, .cue-order, .cue-talk { background: var(--coral, #ff6b5a); color: #fff; }
.cue-tap .cue-i, .cue-order .cue-i, .cue-talk .cue-i { animation: tapBob 0.8s ease-in-out infinite; }
.cue-speak, .cue-move { background: var(--grape, #8b5cf6); color: #fff; }
.cue-next, .cue-good { background: var(--mint, #34c98b); color: #fff; }
.cue-okay, .cue-wait { background: #eef0f4; color: #444; }
@keyframes cuePop { 0% { transform: scale(0.85); } 60% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes earWiggle { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-12deg); } 60% { transform: rotate(10deg); } }
@keyframes tapBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px) scale(0.92); } }

/* 듣는 동안은 보기를 흐리게 → 다 듣고 누르기 */
.listening .panel .option, .listening .panel .card { opacity: 0.45; filter: saturate(0.6); pointer-events: none; transition: opacity 0.2s; }
/* 눌러 달라는 곳 반짝 */
.nudge:not(.options):not(.cards):not(.room) { animation: nudgeRing 1.3s ease-out infinite; }
.options.nudge .option, .cards.nudge .card, .room.nudge .option { animation: nudgeRing 1.3s ease-out infinite; }
.options.nudge .option:nth-child(2), .cards.nudge .card:nth-child(2) { animation-delay: 0.15s; }
.options.nudge .option:nth-child(3), .cards.nudge .card:nth-child(3) { animation-delay: 0.3s; }
.options.nudge .option:nth-child(4), .cards.nudge .card:nth-child(4) { animation-delay: 0.45s; }
.option[disabled], .option.right { animation: none !important; }
@keyframes nudgeRing { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 90, 0.55); } 70% { box-shadow: 0 0 0 12px rgba(255, 107, 90, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 90, 0); } }

/* 레벨 테스트: 이렇게 해요 */
.how { display: flex; flex-direction: column; gap: clamp(6px, 1.4dvh, 14px); }
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.how-step { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: clamp(6px, 1.2dvh, 12px) 6px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.how-step .hs-i { font-size: clamp(1.6rem, 5dvh, 2.6rem); line-height: 1.1; }
.how-step b { font-family: var(--display); font-size: clamp(0.95rem, 2.3dvh, 1.15rem); }
.how-step small { color: var(--muted, #6b6b80); font-size: clamp(0.72rem, 1.6dvh, 0.85rem); line-height: 1.25; }
.how-note { margin: 0; text-align: center; font-weight: 700; font-size: clamp(0.85rem, 2dvh, 1rem); }
@media (orientation: landscape) and (max-height: 560px) {
  .cue { font-size: 0.98rem; padding: 2px 10px 2px 4px; }
  .how-step small { display: none; }
  .how-note { display: none; }
}
.cue-start { background: var(--coral, #ff6b5a); color: #fff; }

/* ---------- 앱처럼 설치 안내 ---------- */
.install-card { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 440px; margin: 0 auto; padding: 8px 8px 8px 10px; background: #fff; border: 2px dashed var(--coral, #f0603f); border-radius: 18px; text-align: left; flex: none; }
.install-card img { width: clamp(34px, 6dvh, 46px); height: auto; border-radius: 10px; flex: none; }
.install-card .ic-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.install-card .ic-text b { font-family: var(--display); font-size: clamp(0.95rem, 2.2dvh, 1.1rem); }
.install-card .ic-text small { color: var(--muted); font-size: 0.8rem; }
.install-card .btn.small { flex: none; padding: 6px 12px; }
.install-card .ic-x { flex: none; border: 0; background: none; color: var(--muted); font-size: 1rem; padding: 4px 6px; cursor: pointer; }
.install-guide h3 { margin: 0 0 10px; font-family: var(--display); }
.ig-steps { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 8px; }
.ig-step { display: flex; align-items: center; gap: 10px; background: #fff7ec; border-radius: 14px; padding: 8px 10px; font-weight: 700; }
.ig-n { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--coral, #f0603f); color: #fff; display: grid; place-items: center; font-size: 0.85rem; }
.ig-i { flex: none; font-size: 1.5rem; width: 30px; text-align: center; }
@media (max-height: 640px) { .install-card .ic-text small { display: none; } }

/* ---------- 섬 여러 개 ---------- */
.island { background: var(--isle, #9edc6c); }
.isle-head { gap: 6px; padding: 6px 8px; }
.isle-title { flex: 1; min-width: 0; }
.isle-title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isle-arrow { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.25); color: #fff; text-decoration: none; font-size: 0.95rem; }
.isle-arrow:hover { background: rgba(255,255,255,0.4); }
.isle-arrow.off { opacity: 0.25; }
.boat a { text-decoration: none; }
.isle-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; flex: none; }
.isle-chips a { padding: 4px 12px; border-radius: 99px; background: #fff; border: 2px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.9rem; }
.isle-chips a.on { background: var(--sea); border-color: var(--sea-d); color: #fff; }
/* 설치 안내가 있으면 작은 화면에선 알약 줄을 숨겨 한 화면에 맞춘다 */
@media (max-height: 760px) { .install-card ~ .pills { display: none; } }
@media (max-height: 600px) { .install-card { padding: 4px 6px; } .install-card img { width: 30px; } }

/* ---------- 기록 번호 ---------- */
.code-link { font-weight: 700; color: var(--sea-d, #1f7fbf); text-decoration: none; font-size: clamp(0.88rem, 2dvh, 1rem); flex: none; }
.code-big { font-family: var(--en); font-weight: 800; font-size: clamp(1.8rem, 8vw, 2.6rem); letter-spacing: 0.08em; text-align: center; background: #fff7ec; border: 3px dashed var(--coral, #f0603f); border-radius: 18px; padding: 10px 14px; margin: 8px 0; color: var(--ink); }
.code-input { width: min(320px, 100%); font-family: var(--en); font-weight: 800; font-size: 1.6rem; letter-spacing: 0.1em; text-align: center; text-transform: uppercase; padding: 10px; border: 3px solid var(--line); border-radius: 16px; }
.code-input:focus { outline: none; border-color: var(--coral, #f0603f); }
.wbuddy.small { height: clamp(90px, 20dvh, 180px); }
@media (max-height: 700px) { .wbox .code-link { font-size: 0.85rem; } }
/* 가로로 눕힌 폰: 왼쪽 메뉴 5개가 다 들어가게 */
@media (min-width: 700px) and (max-height: 500px) {
  .side { gap: 2px; }
  .side .tab { padding: 3px 2px; gap: 0; }
  .side .tab b { font-size: 1.05rem; }
  .side .foot-links { display: none; }
}
