/* ============================================================
   수리 마을 (examath) — 스타일
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Jua', 'Segoe UI', system-ui, -apple-system, 'Malgun Gothic', sans-serif;
  background: linear-gradient(180deg, #aee7ff 0%, #e8f9e0 65%, #d8f2c8 100%);
  color: #3a2e20;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
}
#app { height: 100dvh; display: flex; flex-direction: column; }

/* ---------- 화면 전환 ---------- */
.screen { display: none; flex: 1; flex-direction: column; overflow-y: auto; padding: 16px; }
.screen.active { display: flex; }
.hidden { display: none !important; }

/* ---------- 공통 버튼 ---------- */
.btn {
  border: 0; border-radius: 18px; padding: 12px 22px;
  font-family: inherit; font-size: 1.05rem; font-weight: 700;
  background: #fff; color: #3a2e20;
  box-shadow: 0 4px 0 rgba(0,0,0,.12); cursor: pointer;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.btn-primary { background: #ff8a3d; color: #fff; box-shadow: 0 4px 0 #d96a20; }
.btn-big { font-size: 1.5rem; padding: 16px 40px; background: #ff8a3d; color: #fff; box-shadow: 0 6px 0 #d96a20; border-radius: 26px; }
.btn-small { padding: 8px 14px; font-size: .95rem; border-radius: 14px; }
.btn-ghost { background: transparent; box-shadow: none; color: #6b5a45; text-decoration: underline; }
.btn-ghost:active { transform: none; }

/* ---------- 상단 바 ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; max-width: 660px; margin: 0 auto 12px; }
.bar h2 { font-size: 1.3rem; }
.bar-spacer { width: 52px; }

/* ---------- 타이틀 화면 ---------- */
#screen-title { align-items: center; justify-content: center; }
.title-box { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.title-box h1 { font-size: 3.4rem; color: #ff7a26; text-shadow: 0 3px 0 #fff, 0 6px 0 rgba(0,0,0,.08); letter-spacing: 2px; }
.tagline { font-size: 1.15rem; color: #6b5a45; margin-bottom: 8px; }
.tagline b { color: #2e7fd0; }
.logo-scene { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; animation: floatY 3s ease-in-out infinite; }
.logo-rod { cursor: default; }
.logo-cubes { display: grid; grid-template-columns: repeat(5, 26px); gap: 4px; }
.logo-cube { width: 26px; height: 26px; cursor: default; }
.logo-arrow { font-size: 2rem; color: #e04a3f; font-weight: 900; }
@keyframes floatY { 50% { transform: translateY(-8px); } }

/* ---------- 마을 지도 ---------- */
.world-list { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 560px; margin: 0 auto; }
.world-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: #fff; border: 0; border-radius: 22px; padding: 16px 22px;
  box-shadow: 0 4px 0 rgba(0,0,0,.1); font-family: inherit; cursor: pointer; text-align: left;
}
.world-card:active:not(.locked) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.1); }
.world-card.locked { opacity: .55; filter: grayscale(.8); cursor: default; }
.wc-emoji { font-size: 2.2rem; }
.wc-name { font-size: 1.45rem; font-weight: 900; }
.wc-desc { color: #7a6449; }
.wc-grade { font-size: .85rem; color: #a08a6a; background: #f7efe2; border-radius: 8px; padding: 2px 8px; }
.wc-stars { font-weight: 800; color: #e0a800; }
.wc-lock { font-size: .88rem; color: #a08a6a; }

/* ---------- 월드(관문) ---------- */
.world-desc { text-align: center; color: #7a6449; margin-bottom: 14px; }
.gate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; width: 100%; max-width: 640px; margin: 0 auto; }
.gate-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: #fff; border: 0; border-radius: 22px; padding: 18px 14px;
  box-shadow: 0 4px 0 rgba(0,0,0,.1); font-family: inherit; cursor: pointer; text-align: center;
}
.gate-card:active:not(.locked) { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.1); }
.gate-card.locked { opacity: .55; filter: grayscale(.8); cursor: default; }
.gc-emoji { font-size: 2.4rem; }
.gc-name { font-size: 1.3rem; font-weight: 900; }
.gc-desc { font-size: .92rem; color: #7a6449; }
.gc-stars { font-size: 1.2rem; color: #e0a800; letter-spacing: 3px; }
.gc-clear { color: #3d9a42; font-weight: 800; font-size: .95rem; }
.gc-lock { font-size: .85rem; color: #a08a6a; }

/* ---------- 플레이 화면 ---------- */
.dots { display: flex; gap: 7px; }
.dot { width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2.5px solid #c9b8a0; }
.dot-done { background: #57c15c; border-color: #57c15c; }
.dot-cur { border-color: #ff8a3d; background: #ffd9b8; }
.stage-badge { font-weight: 800; background: #fff; border-radius: 14px; padding: 6px 12px; box-shadow: 0 2px 0 rgba(0,0,0,.08); font-size: .95rem; }
.equation { text-align: center; font-size: 2.4rem; font-weight: 900; margin: 2px 0; }
.eq-q { color: #2e7fd0; }
.eq-ans { color: #3d9a42; }
.eq-op { color: #e04a3f; }
.play-msg { text-align: center; min-height: 1.7em; font-weight: 700; color: #8a6d3b; margin-bottom: 6px; font-size: 1.05rem; }
.play-body { flex: 1; display: flex; flex-direction: column; align-items: center; width: 100%; }
.boardwrap { width: 100%; display: flex; justify-content: center; }

/* ---------- 블록 보드 ---------- */
.board { display: flex; flex-direction: column; gap: 10px; align-items: center; width: 100%; max-width: 580px; }
.board-cols { display: flex; gap: 14px; justify-content: center; width: 100%; }
.col { flex: 1; background: rgba(255,255,255,.78); border-radius: 18px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 250px; }
.col-tens { border: 3px dashed #7db1e8; }
.col-ones { border: 3px dashed #f0a35e; }
.col-title { font-weight: 800; color: #5a86c5; }
.col-ones .col-title { color: #d97b2a; }
.zone { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-content: flex-start; flex: 1; width: 100%; }
.col-count { font-size: 1.15rem; font-weight: 800; }

.rod {
  width: 34px; height: 152px; border-radius: 8px;
  background: linear-gradient(#5b9ee0, #3f7fc4);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 3px 0 rgba(0,0,0,.15); cursor: pointer; position: relative;
}
.rod-seg { flex: 1; border-bottom: 2px solid rgba(255,255,255,.45); }
.rod-seg:last-child { border-bottom: 0; }
.cube {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(#ffb35c, #f28c2e);
  box-shadow: 0 3px 0 rgba(0,0,0,.15); cursor: pointer; position: relative;
}

/* 그림(Pictorial) 스킨 */
.skin-pictorial .rod { background: #fff; border: 3px solid #5b8fd0; box-shadow: none; overflow: visible; }
.skin-pictorial .rod-seg { border-bottom: 2px solid #b9cfec; }
.skin-pictorial .cube { background: #fff; border: 3px solid #e8913c; border-radius: 50%; box-shadow: none; }
.skin-pictorial .gone { opacity: .45; }
.skin-pictorial .gone::after {
  content: '✕'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #e04a3f; font-weight: 900; font-size: 1.5rem; opacity: 1;
}
.skin-pictorial .rod.gone::after { font-size: 2.2rem; }
.skin-pictorial .rod.split-gone::after { content: '✂'; color: #2e7fd0; }

/* 트레이 */
.tray {
  width: 100%; max-width: 580px; background: rgba(255,255,255,.65);
  border-radius: 14px; padding: 8px 14px;
  display: flex; align-items: center; gap: 10px; min-height: 58px; flex-wrap: wrap;
}
.tray-label { font-weight: 800; color: #7a6449; }
.tray-zone { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.mini-cube { width: 20px; height: 20px; cursor: default; border-radius: 5px; }
.mini-rod { width: 11px; height: 46px; background: linear-gradient(#5b9ee0, #3f7fc4); border-radius: 4px; }
.tray-cube { cursor: pointer; }

/* 미니 보드(도움 오버레이) */
.board.mini { max-width: 460px; }
.board.mini .rod { width: 24px; height: 104px; }
.board.mini .cube { width: 24px; height: 24px; }
.board.mini .col { min-height: 160px; padding: 7px; }
.board.mini .col-count { font-size: 1rem; }

/* ---------- 블록 애니메이션 ---------- */
@keyframes popIn { from { transform: scale(0); } 60% { transform: scale(1.25); } to { transform: scale(1); } }
.pop-in { animation: popIn .35s both; }
@keyframes breakingK { to { transform: rotate(25deg) scale(.1); opacity: 0; } }
.breaking { animation: breakingK .4s forwards; }
@keyframes leavingK { to { transform: translateY(70px) scale(.3); opacity: 0; } }
.leaving { animation: leavingK .25s forwards; }
@keyframes wiggleK { 25% { transform: translateX(-4px) rotate(-3deg); } 75% { transform: translateX(4px) rotate(3deg); } }
.wiggle { animation: wiggleK .3s 2; }
@keyframes pulseK { 50% { box-shadow: 0 0 0 7px rgba(91,158,224,.5); transform: scale(1.05); } }
.pulse { animation: pulseK 1s infinite; }
@keyframes burstK { to { transform: translate(calc(var(--dx) * 130px), -150px) scale(1.6); opacity: 0; } }
.burst { position: fixed; font-size: 1.7rem; z-index: 60; pointer-events: none; animation: burstK 1.3s forwards; }
@keyframes shakeK { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.shake { animation: shakeK .4s; }

/* ---------- 숫자 패드 ---------- */
.answer-panel { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 10px; }
.np-display {
  font-size: 2rem; font-weight: 900; background: #fff; border-radius: 14px;
  min-width: 120px; text-align: center; padding: 4px 16px; border: 3px solid #f0a35e; color: #2e7fd0;
}
.no-display .np-display { display: none; }
.np-grid { display: grid; grid-template-columns: repeat(3, 66px); gap: 9px; }
.np-key {
  height: 58px; font-size: 1.5rem; font-family: inherit; font-weight: 800;
  border: 0; border-radius: 16px; background: #fff; color: #3a2e20;
  box-shadow: 0 4px 0 rgba(0,0,0,.12); cursor: pointer;
}
.np-key:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.12); }
.np-ok { background: #57c15c; color: #fff; box-shadow: 0 4px 0 #3d9a42; }
.np-del { background: #f1e7d7; }

/* ---------- 세로셈 (A단계) ---------- */
.a-wrap { display: flex; gap: 30px; align-items: flex-start; justify-content: center; flex-wrap: wrap; padding-top: 12px; width: 100%; }
.vform {
  background: #fff; border-radius: 20px; padding: 26px 30px 20px;
  font-size: 2.3rem; font-weight: 900;
  display: inline-flex; flex-direction: column; align-items: flex-end;
  box-shadow: 0 5px 14px rgba(0,0,0,.09);
}
.vrow { display: flex; }
.vd { width: 46px; text-align: center; position: relative; }
.vop { width: 46px; text-align: center; color: #e04a3f; }
.vline { border-top: 4px solid #3a2e20; width: 100%; margin: 8px 0; border-radius: 2px; }
.vans .v-answer { min-width: 92px; text-align: right; color: #2e7fd0; }
.old-digit { color: #c0ab90; text-decoration: line-through; }
.borrow-sup { position: absolute; top: -20px; left: 0; right: 0; font-size: 1.1rem; color: #e04a3f; text-align: center; }
.borrow-ten { position: absolute; top: -17px; left: 3px; font-size: 1rem; color: #e04a3f; }
.btn-hint { flex-basis: 100%; text-align: center; margin-top: 4px; }

/* ---------- 오버레이 ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.overlay-card { background: #fdf7ec; border-radius: 22px; padding: 16px; max-width: 620px; width: 100%; max-height: 92dvh; overflow-y: auto; }
.overlay-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hint-msg { text-align: center; font-weight: 800; color: #8a6d3b; min-height: 1.6em; margin-top: 8px; }
.gate-q { font-size: 2rem; text-align: center; margin: 12px 0; font-weight: 900; }

/* ---------- 결과 화면 ---------- */
#screen-result { align-items: center; justify-content: center; }
.result-card {
  background: #fff; border-radius: 26px; padding: 34px 40px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); text-align: center; max-width: 460px; width: 100%;
}
.result-stars { display: flex; gap: 8px; }
.rstar { font-size: 3.4rem; filter: grayscale(1) opacity(.3); }
.rstar.lit { filter: none; animation: starPop .5s both; }
@keyframes starPop { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.45); } to { transform: scale(1); } }
.result-card h2 { font-size: 1.8rem; }
.result-banner { background: #fff3d6; border: 2px solid #ffd782; color: #b07800; border-radius: 14px; padding: 10px 18px; font-weight: 800; }
.result-btns { display: flex; gap: 12px; margin-top: 8px; }

/* ---------- 부모님 방 ---------- */
.parent-body { max-width: 660px; margin: 0 auto; width: 100%; }
.ptable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; margin: 8px 0 16px; }
.ptable th, .ptable td { border: 1px solid #eee2ce; padding: 9px 6px; text-align: center; font-size: .95rem; }
.ptable th { background: #ffe9d2; }
.ptable td small { color: #a08a6a; }
.parent-body h3 { margin-top: 8px; color: #6b5a45; }
.pnote { font-size: .9rem; color: #7a6449; margin-top: 10px; background: rgba(255,255,255,.6); border-radius: 12px; padding: 10px 14px; }
.parent-foot { text-align: center; margin-top: 14px; }

/* ============================================================
   아미고 캐릭터 (통통한 햄스터 — 월드마다 변신)
   ============================================================ */
.chara { position: relative; width: var(--cs, 130px); height: var(--cs, 130px); flex-shrink: 0; }
.chara .body {
  position: absolute; inset: 7% 1% 0 1%;
  background: radial-gradient(circle at 35% 26%, var(--c1), var(--c2));
  border-radius: 50% 50% 48% 48% / 52% 52% 48% 48%;
  border: 3px solid rgba(0,0,0,.12);
  animation: breatheK 3.2s ease-in-out infinite;
}
@keyframes breatheK { 50% { transform: scale(1.03, .97); } }

/* 귀 (햄스터 동글귀) */
.chara .ear {
  position: absolute; width: 27%; height: 26%; top: -7%;
  background: var(--c2); border: 3px solid rgba(0,0,0,.11);
  border-radius: 50%;
}
.chara .ear-l { left: 10%; } .chara .ear-r { right: 10%; }
.chara .ear-in { position: absolute; inset: 24% 22% 26% 26%; background: rgba(255,158,158,.6); border-radius: 50%; }

/* 주둥이(크림) · 볼주머니(빵빵) */
.chara .muzzle {
  position: absolute; left: 50%; top: 42%; transform: translateX(-50%);
  width: 44%; height: 36%; background: #fff3dd; border-radius: 50%;
}
.chara .pouch {
  position: absolute; bottom: 6%; width: 34%; height: 32%;
  background: radial-gradient(circle at 40% 30%, #ffefd2, var(--c1));
  border-radius: 50%; opacity: .9;
}
.chara .pouch-l { left: 2%; } .chara .pouch-r { right: 2%; }
/* 냠냠할 때 볼주머니가 더 빵빵 */
.chara.m-chew .pouch { animation: pouchK .3s ease-in-out 2; }
@keyframes pouchK { 50% { transform: scale(1.18); } }

/* 눈(크고 반짝) · 볼터치 · 수염 · 코 · 입 · 앞니 */
.chara .eye {
  position: absolute; width: 19%; height: 21%; background: #fff; border-radius: 50%;
  top: 24%; border: 2px solid rgba(0,0,0,.09); animation: blinkK 4.6s infinite;
}
.chara .eye-l { left: 19%; } .chara .eye-r { right: 19%; }
.chara .pupil { position: absolute; width: 56%; height: 56%; background: #2f2419; border-radius: 50%; left: 22%; top: 26%; }
.chara .pupil::after {
  content: ''; position: absolute; width: 42%; height: 42%;
  background: #fff; border-radius: 50%; left: 12%; top: 10%;
}
@keyframes blinkK { 0%, 91%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.12); } }
.chara .cheek { position: absolute; width: 15%; height: 9%; background: rgba(255,130,130,.45); border-radius: 50%; top: 46%; }
.chara .cheek-l { left: 8%; } .chara .cheek-r { right: 8%; }
.chara .wh { position: absolute; width: 16%; height: 3px; background: rgba(0,0,0,.2); border-radius: 2px; }
.chara .wh-l1 { left: -6%; top: 44%; transform: rotate(9deg); }
.chara .wh-l2 { left: -6%; top: 51%; transform: rotate(-5deg); }
.chara .wh-r1 { right: -6%; top: 44%; transform: rotate(-9deg); }
.chara .wh-r2 { right: -6%; top: 51%; transform: rotate(5deg); }
.chara .nose { position: absolute; left: 50%; top: 44%; transform: translateX(-50%); width: 8%; height: 6%; background: #ef8a8a; border-radius: 50%; }
.chara .mouth {
  position: absolute; left: 50%; top: 52%; transform: translateX(-50%);
  width: 18%; height: 9%; border-bottom: 4px solid #8a5a30; border-radius: 0 0 100% 100%;
}
/* 햄스터 앞니 2개 */
.chara .teeth {
  position: absolute; left: 50%; top: 60%; transform: translateX(-50%);
  width: 11%; height: 8%; background: #fff; border: 2px solid rgba(0,0,0,.1);
  border-top: 0; border-radius: 0 0 5px 5px;
}
.chara .teeth::after {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px;
  background: rgba(0,0,0,.1);
}
.chara.m-hungry .teeth, .chara.m-chew .teeth, .chara.m-sad .teeth { display: none; }
.chara .tongue { display: none; }

/* 표정 (mood) */
.chara.m-hungry .mouth, .chara.m-chew .mouth {
  width: 32%; height: 25%; top: 52%; border-bottom: 0;
  background: #8c3b2e; border-radius: 46% 46% 50% 50%;
}
.chara.m-hungry .tongue, .chara.m-chew .tongue {
  display: block; position: absolute; left: 50%; transform: translateX(-50%);
  top: 65%; width: 17%; height: 9%; background: #ff8f8f; border-radius: 50% 50% 40% 40%; z-index: 1;
}
.chara.m-chew .mouth { animation: chewK .22s ease-in-out 2; }
@keyframes chewK { 50% { transform: translateX(-50%) scaleY(.25); } }
.chara.m-happy .mouth { width: 34%; height: 13%; border-bottom: 5px solid #6b4326; background: transparent; }
.chara.m-happy .eye { animation: none; transform: scaleY(.8); }
.chara.m-sad .mouth { border-bottom: 0; border-top: 4px solid #6b4326; border-radius: 100% 100% 0 0; height: 8%; top: 58%; background: transparent; }
.chara.pop { animation: popCharaK .32s; }
@keyframes popCharaK { 40% { transform: scale(1.13); } }
.chara.jump { animation: jumpK .8s; }
@keyframes jumpK { 25% { transform: translateY(-13%); } 50% { transform: translateY(0); } 70% { transform: translateY(-6%); } }
.chara.transform-fx { animation: transformK .8s; }
@keyframes transformK {
  30% { transform: rotate(180deg) scale(.55); filter: brightness(2.2); }
  60% { transform: rotate(360deg) scale(1.18); filter: brightness(1.6); }
  100% { transform: rotate(360deg) scale(1); filter: none; }
}

/* 변신 폼별 장식 */
.chara .hat, .chara .horn, .chara .wing, .chara .scarf { display: none; position: absolute; }
.f-basic .scarf { display: block; bottom: 3%; left: 20%; right: 20%; height: 11%; background: #e85d5d; border-radius: 10px; border: 2px solid rgba(0,0,0,.1); }
.f-forest .hat {
  display: block; width: 38%; height: 24%; top: -12%; left: 31%;
  background: linear-gradient(#7cc75a, #5aa544); border: 3px solid rgba(0,0,0,.12);
  border-radius: 4% 100% 4% 100%; transform: rotate(-14deg);
}
.f-forest .scarf { display: block; bottom: 3%; left: 20%; right: 20%; height: 11%; background: #5aa544; border-radius: 10px; border: 2px solid rgba(0,0,0,.1); }
.f-dragon .horn { display: block; width: 12%; height: 17%; top: -8%; background: #fff; border: 3px solid rgba(0,0,0,.12); border-radius: 60% 60% 20% 20%; }
.f-dragon .horn-l { left: 30%; transform: rotate(-12deg); }
.f-dragon .horn-r { right: 30%; transform: rotate(12deg); }
.f-dragon .wing { display: block; width: 24%; height: 30%; top: 34%; background: #d8f0fc; border: 3px solid rgba(0,0,0,.12); transform-origin: center bottom; }
.f-dragon .wing-l { left: -12%; border-radius: 100% 20% 10% 60%; animation: flapLK 1.6s ease-in-out infinite; }
.f-dragon .wing-r { right: -12%; border-radius: 20% 100% 60% 10%; animation: flapRK 1.6s ease-in-out infinite; }
@keyframes flapLK { 50% { transform: rotate(14deg); } }
@keyframes flapRK { 50% { transform: rotate(-14deg); } }
/* (햄스터 동글귀는 아기 용 폼에서도 유지 — 뿔과 함께) */
/* 칼잡이 셰프 폼: 빨간 두건 질끈 + 결의의 눈썹 + 식칼 */
.chara .brow { display: none; position: absolute; width: 16%; height: 7%; background: #4a382a; border-radius: 4px; top: 19%; }
.chara .cleaver { display: none; position: absolute; z-index: 4; }
.f-chef .hat {
  display: block; width: 78%; height: 16%; top: 3%; left: 11%;
  background: linear-gradient(#f05a4e, #c93a30);
  border: 3px solid rgba(0,0,0,.14);
  border-radius: 12px; transform: rotate(-3deg);
}
.f-chef .hat::before { /* 두건 매듭 자락 */
  content: ''; position: absolute; right: -14%; top: 10%;
  width: 26%; height: 130%;
  background: #d94a3e; border: 2px solid rgba(0,0,0,.12);
  border-radius: 20% 80% 60% 90%; transform: rotate(24deg);
}
.f-chef .hat::after {
  content: ''; position: absolute; right: -8%; top: 60%;
  width: 20%; height: 110%;
  background: #c93a30; border: 2px solid rgba(0,0,0,.12);
  border-radius: 80% 20% 90% 60%; transform: rotate(48deg);
}
.f-chef .brow { display: block; }
.f-chef .brow-l { left: 19%; transform: rotate(14deg); }
.f-chef .brow-r { right: 19%; transform: rotate(-14deg); }
.f-chef .scarf { display: block; bottom: 3%; left: 20%; right: 20%; height: 11%; background: #e85d5d; border-radius: 10px; border: 2px solid rgba(0,0,0,.1); }
.f-chef .ear { top: -4%; }
.f-chef .cleaver {
  display: block; right: -22%; top: 38%; width: 42%; height: 40%;
  transform: rotate(-18deg);
  animation: cleaverK 2.6s ease-in-out infinite;
}
@keyframes cleaverK { 50% { transform: rotate(-30deg) translateY(-6%); } }
.f-chef .cl-blade {
  position: absolute; top: 0; left: 0; width: 100%; height: 62%;
  background: linear-gradient(160deg, #f4f7fa 0%, #c3cdd6 55%, #98a5b0 100%);
  border: 2px solid rgba(40,50,60,.4);
  border-radius: 8% 30% 45% 12%;
}
.f-chef .cl-handle {
  position: absolute; top: 56%; left: 34%; width: 26%; height: 48%;
  background: linear-gradient(#8a5a30, #5f3c1c);
  border: 2px solid rgba(0,0,0,.25);
  border-radius: 6px; transform: rotate(0deg);
}
/* 햄스터 꼬리 (앙증맞은 콩알) */
.chara .tail {
  position: absolute; width: 13%; height: 11%; right: -4%; top: 68%;
  background: var(--c2); border: 3px solid rgba(0,0,0,.12);
  border-radius: 50%;
  animation: tailK 2.4s ease-in-out infinite;
}
@keyframes tailK { 50% { transform: translateY(-3px); } }

/* 말풍선 */
.chara .bubble {
  position: absolute; bottom: 103%; left: 50%; transform: translateX(-50%);
  background: #fff; border-radius: 14px; padding: 8px 12px;
  min-width: 140px; max-width: 240px; width: max-content;
  font-size: .9rem; font-weight: 700; color: #5a4632; text-align: center;
  box-shadow: 0 3px 10px rgba(0,0,0,.14); z-index: 25;
}
.chara .bubble::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 8px solid transparent; border-top-color: #fff;
}

/* 캐릭터 행(보드 아래) */
.chara-row { width: 100%; max-width: 580px; display: flex; align-items: center; justify-content: center; gap: 18px; padding-top: 44px; }
.tummy { font-weight: 800; color: #7a6449; background: rgba(255,255,255,.7); padding: 10px 16px; border-radius: 16px; font-size: 1.05rem; }

/* 먹이 날아가는 애니메이션 */
.fly-feed { pointer-events: none; position: relative; z-index: 30; animation: flyFeedK .45s ease-in forwards; }
@keyframes flyFeedK { 60% { opacity: 1; } to { transform: translate(var(--fx), var(--fy)) scale(.2) rotate(25deg); opacity: 0; } }

/* ============================================================
   트렌드 요소: 콤보 / XP / 연출
   ============================================================ */
.combo {
  font-weight: 900; color: #fff; font-size: 1rem;
  background: linear-gradient(135deg, #ff8a3d, #ff5252);
  border-radius: 16px; padding: 6px 14px; box-shadow: 0 3px 0 rgba(0,0,0,.15);
  animation: comboPopK .4s;
}
@keyframes comboPopK { 40% { transform: scale(1.3) rotate(-4deg); } }

.xp-wrap { width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 5px; }
.xp-label { font-size: .95rem; font-weight: 800; color: #7a6449; display: flex; justify-content: space-between; }
.xp-bar { height: 16px; background: #efe6d5; border-radius: 10px; overflow: hidden; }
.xp-fill {
  height: 100%; width: 0; border-radius: 10px;
  background: linear-gradient(90deg, #ffc24d, #ff8a3d);
  transition: width .9s cubic-bezier(.2, .8, .3, 1.1);
}
.level-badge {
  display: inline-block; background: linear-gradient(135deg, #6ec1ff, #3f8fd8);
  color: #fff; font-weight: 900; border-radius: 14px; padding: 5px 14px;
  box-shadow: 0 3px 0 rgba(0,0,0,.14); font-size: 1rem;
}
.title-chara { display: flex; justify-content: center; padding-top: 60px; margin-bottom: 4px; }
.wc-chara { pointer-events: none; }
.world-card { position: relative; padding-right: 110px; }
.world-card .wc-chara { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
.world-card.locked .wc-chara { filter: grayscale(1) opacity(.6); }
.result-chara { display: flex; justify-content: center; padding-top: 40px; }
.transform-title { font-size: 1.6rem; font-weight: 900; text-align: center; color: #ff7a26; margin: 6px 0; }
.transform-sub { text-align: center; font-weight: 800; color: #6b5a45; min-height: 1.6em; }
.transform-stage { display: flex; justify-content: center; padding: 46px 0 10px; }

/* ============================================================
   계단길 (수직선 모델 미니게임)
   ============================================================ */
.stairs-wrap { width: 100%; max-width: 580px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.stairs-view {
  position: relative; width: 100%; height: 300px; overflow: hidden;
  background: linear-gradient(#c9ecff, #e8f9e0 78%, #cdeab5);
  border-radius: 20px; border: 3px dashed #9fc7e8;
}
.stair-track { position: absolute; left: 0; top: 0; transition: transform .25s ease-out; }
.step {
  position: absolute; width: 66px; height: 46px;
  background: linear-gradient(#8ad06b 0 30%, #a9743f 30%);
  border-radius: 8px; border: 2px solid rgba(0,0,0,.16);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
  box-shadow: 0 3px 0 rgba(0,0,0,.12);
}
.step-num { font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); font-size: 1.02rem; }
.step-start::after {
  content: '출발!'; position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: .72rem; color: #e04a3f; font-weight: 800; background: #fff; border-radius: 8px; padding: 1px 7px;
}
.stair-amigo { position: absolute; z-index: 5; width: 72px; height: 72px; }
.stair-amigo .bubble { display: none !important; }
.stair-amigo.falling { animation: fallK 1.15s ease-in forwards; }
@keyframes fallK {
  25% { transform: translateY(-34px) rotate(24deg); }
  100% { transform: translateY(440px) rotate(560deg); opacity: 0; }
}
.chara.hop { animation: hopK .22s; }
@keyframes hopK { 50% { transform: scaleY(.82) scaleX(1.1); } }
.stair-hud { display: flex; gap: 12px; font-weight: 800; color: #7a6449; flex-wrap: wrap; justify-content: center; }
.stair-cur { background: #fff; border-radius: 12px; padding: 7px 15px; box-shadow: 0 2px 0 rgba(0,0,0,.08); }
.stair-hops { background: rgba(255,255,255,.7); border-radius: 12px; padding: 7px 15px; }
.stair-ctrl { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stair-btn { font-size: 1.05rem; padding: 13px 18px; }
.btn-ten { background: #6ec1ff; color: #fff; box-shadow: 0 4px 0 #3f8fd8; }
.btn-stair-ok { background: #57c15c; color: #fff; box-shadow: 0 4px 0 #3d9a42; }

/* ============================================================
   구름 오르기 (난이도 중·상 하늘길)
   ============================================================ */
.clouds-wrap { width: 100%; max-width: 580px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.clouds-view {
  position: relative; width: 100%; height: 320px; overflow: hidden;
  background: linear-gradient(#7fc4f0, #b9e2f8 55%, #dff2ff);
  border-radius: 20px; border: 3px dashed #7fb4e0;
}
.clouds-track { position: absolute; left: 0; right: 0; top: 0; transition: transform .55s ease-out; }
.cloud-ground {
  position: absolute; left: -4%; width: 108%; height: 60px;
  background: linear-gradient(#8ad06b 0 34%, #a9743f 34%);
  border-radius: 16px 16px 0 0; border: 2px solid rgba(0,0,0,.14);
}
.cloud {
  position: absolute; transform: translateX(-50%);
  width: 98px; height: 52px; cursor: pointer;
  background: #fffaf0; border-radius: 40px; /* 크림 화이트 (아미고와 깔맞춤) */
  box-shadow: 0 4px 0 rgba(190,160,110,.3);
  display: flex; align-items: center; justify-content: center;
  animation: cloudBobK 3s ease-in-out infinite;
  opacity: .78;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
  box-shadow: none; z-index: -1;
}
.cloud::before { width: 44px; height: 44px; left: 12px; top: -16px; }
.cloud::after { width: 32px; height: 32px; right: 14px; top: -10px; }
@keyframes cloudBobK { 50% { margin-top: -6px; } }
.cloud-num { font-weight: 900; font-size: 1.25rem; color: #4a7cb5; z-index: 1; }
.cloud-active { opacity: 1; box-shadow: 0 4px 0 rgba(190,160,110,.3), 0 0 0 4px rgba(255,210,90,.55); }
.cloud-solid { opacity: 1; background: #ffe9b0; }
.cloud-solid .cloud-num { color: #d99a1b; }
.cloud-fade { pointer-events: none; opacity: .15 !important; transition: opacity .5s; }
.cloud.poof { pointer-events: none; animation: poofK .55s forwards; }
@keyframes poofK {
  30% { background: #b7bec7; transform: translateX(-50%) scale(1.15); }
  100% { transform: translateX(-50%) scale(1.8); opacity: 0; }
}
.cloud-summit { opacity: 1; background: linear-gradient(#ffe9a8, #ffd66b); width: 120px; }
.cloud-summit .cloud-num { font-size: 1.5rem; }
.cloud-amigo {
  position: absolute; z-index: 6; width: 70px; height: 70px;
  transform: translateX(-50%);
  transition: left .48s ease, top .48s cubic-bezier(.25, -0.55, .55, 1.2);
}
.cloud-amigo .bubble { display: none !important; }
.cloud-amigo.fall-anim { transition: left .6s ease-in, top .6s cubic-bezier(.5, -0.1, .8, 1); }
.cloud-amigo-live { transition: none !important; } /* 실시간 물리 이동 */

/* ============================================================
   놀이공원 (미니게임 아케이드)
   ============================================================ */
.arcade-body { max-width: 640px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 14px; }
.arcade-note { text-align: center; color: #7a6449; font-weight: 700; }
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.arcade-card { min-height: 140px; }
.arcade-entry { background: linear-gradient(135deg, #fff6e0, #ffe8f0); }

/* 알/도감 */
.egg-card { background: #fff; border-radius: 20px; padding: 14px 18px; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.egg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.egg-icon { font-size: 1.6rem; }
.egg-count { color: #b07800; font-weight: 800; margin-left: auto; }
.egg-bar { max-width: none; }
.egg-tip { font-size: .85rem; color: #a08a6a; margin-top: 6px; }
.dex-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dex-slot {
  background: #f5ecd9; border-radius: 16px; padding: 12px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.dex-owned { background: #fff3d6; box-shadow: 0 0 0 3px #ffd782; }
.dex-pet { font-size: 2.2rem; }
.dex-name { font-size: .85rem; font-weight: 800; color: #7a6449; }
.hatch-card { text-align: center; }
.hatch-pet { font-size: 4.6rem; margin: 10px 0; }
.hatch-egg { animation: eggWobbleK .5s ease-in-out infinite; display: inline-block; }
@keyframes eggWobbleK { 25% { transform: rotate(-10deg); } 75% { transform: rotate(10deg); } }

/* ---- 🐹 두더지 팡팡 ---- */
.mole-view {
  width: 100%; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 14px;
  background: linear-gradient(#d8f2c8, #b7e39b); border-radius: 20px;
  padding: 26px 18px 20px; border: 3px dashed #94c977;
}
.mole-hole { position: relative; height: 110px; overflow: hidden; }
.hole-lip {
  position: absolute; bottom: 0; left: 8%; right: 8%; height: 30px;
  background: #6b4a2e; border-radius: 50%;
}
.mole {
  position: absolute; left: 50%; bottom: -76px; transform: translateX(-50%);
  width: 66px; height: 76px; cursor: pointer; transition: bottom .18s ease-out; z-index: 1;
}
.mole-up { bottom: 6px; }
.mole-face {
  width: 60px; height: 52px; margin: 0 auto; position: relative;
  background: linear-gradient(#c99a68, #a97a4a); border-radius: 46% 46% 40% 40%;
  border: 2px solid rgba(0,0,0,.18);
}
.mole-face::before, .mole-face::after {
  content: ''; position: absolute; width: 9px; height: 9px; background: #2f2419;
  border-radius: 50%; top: 17px;
}
.mole-face::before { left: 14px; } .mole-face::after { right: 14px; }
.mole-sign {
  margin: 2px auto 0; width: 44px; height: 24px; background: #fff;
  border: 2px solid #c9b8a0; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #4a7cb5; font-size: 1rem;
}
.mole.bonk .mole-face { background: #e8b7b0; transform: rotate(14deg); }
.mole.giggle { animation: wiggleK .3s 2; }

/* ---- 🎈 풍선 팡! ---- */
.balloon-view {
  position: relative; width: 100%; max-width: 560px; height: 340px; margin: 0 auto;
  overflow: hidden; border-radius: 20px; border: 3px dashed #9fc7e8;
  background: linear-gradient(#c9ecff, #eaf8ff);
}
.balloon {
  position: absolute; bottom: -110px; width: 66px; height: 80px; cursor: pointer;
  background: radial-gradient(circle at 35% 28%, hsl(var(--hue), 90%, 78%), hsl(var(--hue), 75%, 58%));
  border-radius: 50% 50% 46% 46%;
  display: flex; align-items: center; justify-content: center;
  animation: balloonUpK linear forwards;
}
@keyframes balloonUpK { to { bottom: 380px; } }
.balloon-num { font-weight: 900; font-size: 1.3rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.balloon-string { position: absolute; top: 99%; left: 50%; width: 2px; height: 26px; background: rgba(0,0,0,.25); }
.balloon.popped { animation: balloonPopK .28s forwards; }
@keyframes balloonPopK { to { transform: scale(1.7); opacity: 0; } }

/* ---- 🎵 리듬 탭 ---- */
.rhythm-view { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 22px; padding-top: 8px; }
.rhythm-note { font-size: 3.4rem; color: #b07ad0; }
.rhythm-note.beat { animation: notePulseK .25s; }
@keyframes notePulseK { 40% { transform: scale(1.35) rotate(-8deg); } }
.rhythm-pads { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.rpad {
  width: 108px; height: 108px; border: 0; border-radius: 26px;
  background: linear-gradient(#e6d4f7, #cbaae8); color: #5a3a78;
  font-family: inherit; font-size: 2rem; font-weight: 900;
  box-shadow: 0 6px 0 #a985cc; cursor: pointer;
}
.rpad:active { transform: translateY(4px); box-shadow: 0 2px 0 #a985cc; }
.rpad.beat { animation: padBeatK .22s; }
@keyframes padBeatK { 45% { transform: scale(1.08); } }

/* ---- ⚔️ 몬스터 배틀 ---- */
.battle-view { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.battle-stage {
  position: relative; width: 100%; height: 190px;
  background: linear-gradient(#d3c4ef 0 68%, #8a795f 68%);
  border-radius: 20px; border: 3px dashed #b09ad8; overflow: hidden;
}
.battle-amigo { position: absolute; left: 8%; bottom: 14px; width: 96px; height: 96px; transition: left .3s ease-in; }
.battle-amigo .bubble { display: none !important; }
.battle-amigo.attack { left: 42%; }
.monster { position: absolute; right: 8%; bottom: 10px; width: 120px; height: 120px; transition: right .3s; }
.monster-body {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 35% 30%, #b98ae0, #7c4fb0);
  border-radius: 46% 46% 44% 44%; border: 3px solid rgba(0,0,0,.16);
  animation: breatheK 2.6s ease-in-out infinite;
}
.m-eye { position: absolute; width: 20%; height: 15%; background: #fff; border-radius: 50%; top: 28%; overflow: hidden; }
.m-eye::after { content: ''; position: absolute; width: 46%; height: 62%; background: #2b1a3d; border-radius: 50%; left: 28%; top: 20%; }
.m-eye-l { left: 18%; transform: rotate(12deg); } .m-eye-r { right: 18%; transform: rotate(-12deg); }
.m-mouth { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); width: 42%; height: 16%; background: #4a2a66; border-radius: 20% 20% 50% 50%; }
.m-mouth::after { content: ''; position: absolute; left: 12%; top: 0; width: 76%; height: 40%; background:
  linear-gradient(135deg, #fff 25%, transparent 25%) 0 0/8px 8px repeat-x; }
.m-horn { position: absolute; width: 16%; height: 22%; background: #ffd66b; top: -10%; border-radius: 50% 50% 20% 20%; border: 2px solid rgba(0,0,0,.15); }
.m-horn-l { left: 22%; transform: rotate(-16deg); } .m-horn-r { right: 22%; transform: rotate(16deg); }
.monster.hit { animation: monsterHitK .4s; }
@keyframes monsterHitK { 30% { transform: translateX(16px) rotate(6deg); filter: brightness(1.6); } }
.monster.lunge { right: 34%; }
.monster.defeated { animation: monsterDownK 1.2s forwards; }
@keyframes monsterDownK { to { transform: rotate(540deg) scale(.1) translateY(160px); opacity: 0; } }
.battle-hud { display: flex; gap: 18px; font-weight: 800; color: #5a4632; flex-wrap: wrap; justify-content: center; }
.battle-hud > div { background: rgba(255,255,255,.75); border-radius: 12px; padding: 6px 14px; }
.battle-answers { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.battle-btn { font-size: 1.5rem; padding: 14px 26px; font-weight: 900; }

/* 보스탑(A단계) — 세로셈 위 보스전 무대 */
.a-battle { width: 100%; }
.a-battle .battle-stage { height: 150px; }
.a-battle .monster { width: 96px; height: 96px; }
.a-battle .battle-amigo { width: 92px; height: 92px; bottom: 10px; }

/* ---- 🚀 로켓 슈팅 ---- */
.rocket-view {
  position: relative; width: 100%; max-width: 560px; height: 340px; margin: 0 auto;
  overflow: hidden; border-radius: 20px; border: 3px dashed #7a86c9;
  background:
    radial-gradient(2px 2px at 18% 24%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 66% 14%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 84% 44%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 34% 64%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 52% 38%, #fff 50%, transparent 51%),
    linear-gradient(#1c2550, #3a3f7d);
}
.rocket-ship { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%) rotate(-45deg); font-size: 2.6rem; z-index: 3; }
.asteroid {
  position: absolute; top: -70px; width: 56px; height: 56px; cursor: pointer;
  background: radial-gradient(circle at 34% 30%, #b7bec7, #757e8a);
  border-radius: 46% 54% 50% 50% / 52% 48% 52% 48%;
  display: flex; align-items: center; justify-content: center;
  animation: asteroidFallK linear forwards;
  border: 2px solid rgba(0,0,0,.25);
}
@keyframes asteroidFallK { to { top: 360px; } }
.asteroid span { font-weight: 900; font-size: 1.2rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.asteroid.boom { animation: boomK .35s forwards; }
@keyframes boomK { 40% { background: #ffd66b; } to { transform: scale(1.9); opacity: 0; background: #ff8a3d; } }
.laser-beam {
  position: absolute; bottom: 40px; top: 0; width: 5px;
  background: linear-gradient(#ff5252, #ffd66b); border-radius: 3px; z-index: 2;
  box-shadow: 0 0 10px #ff8a6b;
}

/* ---- 🏁 아미고 카트 ---- */
.kart-view {
  position: relative; width: 100%; max-width: 560px; height: 340px; margin: 0 auto;
  overflow: hidden; border-radius: 20px; border: 3px dashed #b0a08a;
  background:
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(255,255,255,.5) 34px 54px) 33.3% 0 / 3px 100% no-repeat,
    repeating-linear-gradient(180deg, transparent 0 34px, rgba(255,255,255,.5) 34px 54px) 66.6% 0 / 3px 100% no-repeat,
    linear-gradient(#8a8a92, #6e6e78);
  animation: roadK .7s linear infinite;
}
@keyframes roadK { to { background-position: 33.3% 54px, 66.6% 54px, 0 0; } }
.kart-lane-zone { position: absolute; top: 0; bottom: 0; width: 33.3%; z-index: 4; cursor: pointer; }
.kart-amigo { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); width: 74px; height: 74px; z-index: 3; }
.kart-amigo .bubble { display: none !important; }
.kart-amigo.boost { animation: boostK .5s 2; filter: drop-shadow(0 0 10px #ffd66b); }
@keyframes boostK { 50% { transform: translateX(-50%) translateY(-18px) scale(1.08); } }
.kart-amigo.mud { filter: sepia(1) brightness(.7); animation: wiggleK .3s 3; }
.gate-row {
  position: absolute; top: -80px; left: 0; right: 0; display: flex; z-index: 2;
  animation: gateRowK 3.8s linear forwards;
}
@keyframes gateRowK { to { top: 350px; } }
.gate {
  flex: 1; display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.gate span {
  background: linear-gradient(#ffe9a8, #ffd66b); border: 3px solid #d99a1b;
  border-radius: 14px; padding: 8px 14px; font-weight: 900; font-size: 1.3rem; color: #7a5200;
  box-shadow: 0 3px 0 rgba(0,0,0,.2);
}

/* ---- 🎣 아미고 낚시 ---- */
.fish-view {
  position: relative; width: 100%; max-width: 560px; height: 340px; margin: 0 auto;
  overflow: hidden; border-radius: 20px; border: 3px dashed #7fb4e0;
  background: linear-gradient(#cdeeff 0 18%, #6db4e8 18%, #3f8fd8);
}
.fish-boat { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-size: 2.4rem; z-index: 2; }
.fish { position: absolute; cursor: pointer; display: flex; align-items: center; gap: 3px; }
.fish-l { left: -90px; animation: fishSwimLK linear forwards; }
.fish-r { right: -90px; animation: fishSwimRK linear forwards; flex-direction: row-reverse; }
@keyframes fishSwimLK { to { left: 105%; } }
@keyframes fishSwimRK { to { right: 105%; } }
.fish-emoji { font-size: 2.2rem; }
.fish-num {
  background: rgba(255,255,255,.92); border-radius: 10px; padding: 2px 9px;
  font-weight: 900; color: #2e6ca8; font-size: 1.05rem;
}
.fish.caught { animation: fishCaughtK .9s forwards; }
@keyframes fishCaughtK { to { top: -10%; transform: rotate(-30deg) scale(.7); opacity: 0; } }
.fish.escape { animation: fishEscapeK .5s forwards; }
@keyframes fishEscapeK { to { transform: translateX(80px) rotate(20deg); opacity: 0; } }

/* ---- 🧊 얼음 깨기 ---- */
.ice-view {
  width: 100%; max-width: 480px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  background: linear-gradient(#dff2ff, #b9dcf5); border-radius: 20px;
  padding: 22px; border: 3px dashed #8ec3ea;
}
.ice-block {
  height: 96px; border: 0; border-radius: 18px; cursor: pointer; font-family: inherit;
  background: linear-gradient(145deg, #eaf7ff 0%, #bfe2f8 55%, #9fd0f0 100%);
  box-shadow: inset 0 2px 6px rgba(255,255,255,.9), 0 4px 0 rgba(90,140,190,.35);
  display: flex; align-items: center; justify-content: center;
}
.ice-block:active { transform: translateY(2px); }
.ice-num { font-weight: 900; font-size: 1.5rem; color: #2e6ca8; }
.ice-gem { font-size: 2rem; }
.ice-block.cracked {
  background:
    linear-gradient(25deg, transparent 47%, rgba(60,100,140,.5) 48%, transparent 52%),
    linear-gradient(-40deg, transparent 42%, rgba(60,100,140,.5) 44%, transparent 47%),
    linear-gradient(80deg, transparent 60%, rgba(60,100,140,.4) 62%, transparent 65%),
    linear-gradient(145deg, #d5ebfa, #a9d2ee);
  opacity: .75; cursor: default;
}
.ice-block.shatter { animation: shatterK .5s; background: #fff3d6; box-shadow: 0 0 0 4px #ffd782; }
@keyframes shatterK { 30% { transform: scale(1.15) rotate(-4deg); } 60% { transform: scale(.95) rotate(3deg); } }

/* ---- 🔪 과일 싹둑 (과일 닌자) ---- */
.fruit-wrap {
  position: relative; width: 100%; max-width: 580px; height: 420px; margin: 0 auto;
  border-radius: 20px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,240,200,.14), transparent 55%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 3px, transparent 3px 74px),
    linear-gradient(#5a3d28, #38251a);
  box-shadow: inset 0 0 60px rgba(0,0,0,.45);
  touch-action: none;
}
.fruit-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
/* 전체화면 모드 */
.fruit-full {
  position: fixed; inset: 0; max-width: none; height: 100dvh;
  border-radius: 0; z-index: 30; margin: 0;
}
.fruit-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: linear-gradient(rgba(0,0,0,.4), transparent);
}
.fruit-exit { flex-shrink: 0; }
.fruit-eq {
  flex: 1; text-align: center; color: #fff;
  font-size: 1.7rem; font-weight: 900; text-shadow: 0 2px 4px rgba(0,0,0,.6);
}
.fruit-round { color: #ffe9b0; font-weight: 800; }
.fruit-pieces { color: #8fe86b; font-weight: 900; background: rgba(0,0,0,.35); border-radius: 10px; padding: 4px 10px; }
.fruit-gauge { font-size: .95rem; letter-spacing: 1px; background: rgba(0,0,0,.35); border-radius: 10px; padding: 4px 8px; color: #888; }
.fruit-gauge.gauge-tired { animation: wiggleK .3s 3; filter: grayscale(1); }
/* DOUBLE! TRIPLE! 콜아웃 */
.fruit-callout {
  position: absolute; left: 50%; top: 34%; transform: translateX(-50%);
  z-index: 6; pointer-events: none;
  font-size: 3.2rem; font-weight: 900; font-style: italic; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff6c8, #ffb63d 55%, #ff7a26);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 3px 0 rgba(120,50,0,.65)) drop-shadow(0 0 18px rgba(255,180,60,.8));
  animation: calloutK 1s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
.fc-bonus { display: block; text-align: center; font-size: 1.3rem; -webkit-text-fill-color: #ffe9b0; font-style: normal; }
@keyframes calloutK {
  0% { transform: translateX(-50%) scale(0) rotate(-10deg); opacity: 0; }
  25% { transform: translateX(-50%) scale(1.25) rotate(2deg); opacity: 1; }
  45% { transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { transform: translateX(-50%) scale(1.05) translateY(-24px); opacity: 0; }
}
.fruit-full .fruit-lives { position: static; }
.fruit-msg {
  position: absolute; top: 62px; left: 0; right: 0; z-index: 5;
  text-align: center; color: #ffe9b0; font-weight: 800; font-size: 1rem;
  text-shadow: 0 2px 3px rgba(0,0,0,.55); min-height: 1.4em; pointer-events: none;
}
/* 보너스 문제 (썬 조각 + 깨진 재료로 뺄셈) — 숫자 크게! */
.fruit-bonus .overlay-card { text-align: center; }
.fb-story { font-weight: 700; color: #6b5a45; line-height: 1.6; margin-bottom: 10px; font-size: 1.05rem; }
.fb-num { font-size: 1.6rem; color: #e0552e; }
.fb-canvas { background: #fff; border-radius: 14px; padding: 6px; max-width: 100%; }
.fb-q { font-size: 1.4rem; font-weight: 900; margin-top: 10px; color: #3a2e20; }
.fb-eq { font-size: 2.3rem; font-weight: 900; margin: 4px 0; color: #2e7fd0; }
.fb-pad { margin-top: 4px; }
.fb-rank { font-weight: 800; color: #b07800; background: #fff3d6; border-radius: 12px; padding: 8px 14px; margin: 6px auto; display: inline-block; }
/* 🎫 아빠 슈퍼패스 — 화면 우측 상단 항상 보이는 티켓 버튼 */
.fb-pass-float {
  position: absolute; top: 14px; right: 14px; z-index: 60;
  background: linear-gradient(#ffe9a8, #ffc24d); color: #7a5200;
  border: 2px dashed #d99a1b; box-shadow: 0 4px 0 #b07800;
  font-size: 1rem; line-height: 1.25; padding: 10px 16px;
  animation: passPulseK 2s ease-in-out infinite;
}
.fb-pass-float small { font-size: .78rem; font-weight: 700; }
@keyframes passPulseK { 50% { transform: scale(1.06) rotate(-2deg); } }
/* 점검 카드 2단: 왼쪽 문제 / 오른쪽 숫자패드 (가로 화면에 딱!) */
.fruit-bonus .overlay-card { max-width: 920px; }
.fb-cols { display: flex; gap: 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.fb-left { flex: 1; min-width: 260px; }
.fb-right { flex-shrink: 0; }
/* 자동 정답 시연: 키가 저절로 눌리는 연출 */
.np-key-auto { background: #ffd66b !important; box-shadow: 0 1px 0 #b07800 !important; transform: translateY(3px) scale(1.1); }

/* 납작한 화면(패드 가로)에서 점검 카드 컴팩트하게 */
@media (max-height: 720px) {
  .fruit-bonus .overlay-card { padding: 10px 14px; }
  .fruit-bonus .transform-title { font-size: 1.25rem; }
  .fb-story { font-size: .88rem; line-height: 1.35; margin-bottom: 4px; }
  .fb-num { font-size: 1.2rem; }
  .fb-q { font-size: 1.1rem; margin-top: 4px; }
  .fb-eq { font-size: 1.7rem; margin: 2px 0; }
  .fruit-bonus .np-grid { grid-template-columns: repeat(3, 52px); gap: 6px; }
  .fruit-bonus .np-key { height: 44px; font-size: 1.15rem; }
  .fruit-bonus .np-display { font-size: 1.4rem; min-width: 90px; padding: 2px 10px; }
}

/* 🍲 요리 타임 (도마 썰기) */
.cook-formula {
  position: absolute; top: 96px; left: 0; right: 0; z-index: 5;
  text-align: center; font-size: 2rem; font-weight: 900; color: #ffe9b0;
  text-shadow: 0 2px 4px rgba(0,0,0,.6); pointer-events: none;
}
.cook-formula b { color: #fff; }
.cook-formula .cf-n { color: #8fe86b; font-size: 1.2em; }
.cook-formula small { font-size: .55em; color: #d9c9a8; }
.cook-ctrl { position: absolute; bottom: 16px; right: 16px; z-index: 6; }

/* 인트로 추가 요소 */
.title-math { font-size: .6em; color: #8fe86b; vertical-align: super; margin-left: 2px; letter-spacing: 0; }
.fi-parent { position: absolute; top: 12px; left: 12px; z-index: 7; }
.fi-slash2 { top: 58%; transform: rotate(10deg); animation-delay: .45s; }
.fi-emoji { letter-spacing: 6px; }
.fruit-chef { position: absolute; left: 8px; bottom: 4px; width: 84px; height: 84px; pointer-events: none; z-index: 3; }
.fruit-chef .bubble { min-width: 110px; font-size: .8rem; }
.fruit-lives {
  position: absolute; right: 12px; top: 10px; z-index: 3;
  font-size: 1.15rem; background: rgba(0,0,0,.35); border-radius: 12px; padding: 4px 10px;
}
.fruit-flash { position: absolute; inset: 0; pointer-events: none; z-index: 4; opacity: 0; }
.fruit-flash.on { animation: fruitFlashK .45s; }
@keyframes fruitFlashK { 20% { opacity: 1; box-shadow: inset 0 0 70px rgba(230,40,40,.75); } 100% { opacity: 0; } }

/* 인트로 */
.fruit-intro {
  position: absolute; inset: 0; z-index: 6;
  background: radial-gradient(circle at 50% 30%, rgba(90,60,35,.5), rgba(20,12,8,.93));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; overflow: hidden;
}
/* 가로모드(패드) 인트로: 납작한 화면에 맞게 2단 배치 */
@media (orientation: landscape) and (max-height: 640px) {
  .fruit-intro { gap: 4px; }
  .fruit-intro .fi-title { font-size: 1.9rem; }
  .fruit-intro .fi-emoji { font-size: 1.6rem; }
  .fruit-intro .fi-sub { font-size: .88rem; }
  .fruit-intro .fi-chef { padding-top: 34px; }
  .fruit-intro .fi-chef .chara { --cs: 96px !important; }
  .fruit-intro .fi-start { font-size: 1.25rem; padding: 12px 30px; }
}
.fi-title {
  color: #ffe9b0; font-size: 2.1rem; line-height: 1.2; letter-spacing: 1px;
  text-shadow: 0 3px 0 rgba(0,0,0,.5); animation: fiTitleK .7s cubic-bezier(.2,1.6,.4,1) both .25s;
}
@keyframes fiTitleK { from { transform: scale(0) rotate(-8deg); opacity: 0; } }
.fi-emoji { font-size: 2.2rem; animation: fiTitleK .6s both .1s; }
.fi-sub { color: #e8d9c2; font-weight: 700; font-size: .95rem; animation: fiTitleK .6s both .5s; }
.fi-chef { animation: fiTitleK .7s both .65s; padding-top: 30px; }
.fi-start { animation: fiTitleK .6s both .85s; }
.fi-slash {
  position: absolute; top: 30%; left: -30%; width: 160%; height: 4px;
  background: linear-gradient(90deg, transparent, #fff, transparent);
  box-shadow: 0 0 18px #aef; transform: rotate(-14deg);
  animation: fiSlashK .8s ease-out .15s both;
}
@keyframes fiSlashK { from { left: -160%; opacity: 1; } 70% { opacity: 1; } to { left: 60%; opacity: 0; } }

/* 화면 흔들림 (쨍그랑) */
.screen-shake { animation: screenShakeK .35s; }
@keyframes screenShakeK {
  20% { transform: translate(3px, -2px); } 40% { transform: translate(-3px, 2px); }
  60% { transform: translate(2px, 1px); } 80% { transform: translate(-2px, -1px); }
}

@media (prefers-reduced-motion: reduce) {
  .chara .body, .chara .tail, .f-dragon .wing-l, .f-dragon .wing-r { animation: none; }
}

/* ---------- 반응형 ---------- */
@media (max-width: 480px) {
  .equation { font-size: 1.9rem; }
  .rod { width: 28px; height: 128px; }
  .cube { width: 28px; height: 28px; }
  .np-grid { grid-template-columns: repeat(3, 58px); }
  .np-key { height: 52px; }
  .vform { font-size: 1.9rem; padding: 22px 22px 16px; }
  .vd, .vop { width: 38px; }
  .title-box h1 { font-size: 2.7rem; }
  .col { min-height: 210px; }
}
