/* 적성 한입 — 폰 우선 화면 (v0.2 디자인: 2026-11-21) */
:root {
  --green: #4aa8e0;
  --green-dark: #2f88c0;
  --green-deep: #1d6a99;
  --green-soft: #e7f3fc;
  --mint: #d5ebfa;
  --red: #f07a86;
  --red-dark: #c9505e;
  --red-soft: #fff0f2;
  --gold: #ffc94a;
  --gold-soft: #fff6d9;
  --blue-soft: #f1f6ff;
  --bg: #fff8ef;
  --ok: #46b97a;
  --ok-soft: #e8f8ee;
  --pink-soft: #ffeef3;
  --butter: #fff3c4;
  --card: #ffffff;
  --text: #2b2a33;
  --sub: #7a7684;
  --line: #efe6da;
  --shadow: 0 1px 2px rgba(20, 50, 35, .05), 0 6px 18px rgba(20, 50, 35, .07);
  --shadow-lift: 0 2px 4px rgba(20, 50, 35, .06), 0 10px 24px rgba(20, 50, 35, .10);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  /* 러블리 배경 (11/21): 파스텔 구름빛 그라데이션 + 연한 하트·별·점 무늬 */
  background:
    url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'><path d='M28 34c-3-5-11-4-11 3 0 5 6 9 11 13 5-4 11-8 11-13 0-7-8-8-11-3z' fill='%23ffc9d9' opacity='.55'/><path d='M118 104c-2.4-4-8.8-3.2-8.8 2.4 0 4 4.8 7.2 8.8 10.4 4-3.2 8.8-6.4 8.8-10.4 0-5.6-6.4-6.4-8.8-2.4z' fill='%23ffd6e2' opacity='.5'/><path d='M120 26l2.6 6.2 6.4.6-4.9 4.2 1.5 6.3-5.6-3.4-5.6 3.4 1.5-6.3-4.9-4.2 6.4-.6z' fill='%23ffe08a' opacity='.6'/><path d='M40 118l2 4.6 4.8.5-3.6 3.1 1.1 4.7-4.3-2.5-4.3 2.5 1.1-4.7-3.6-3.1 4.8-.5z' fill='%23bfe0f7' opacity='.7'/><circle cx='80' cy='70' r='3' fill='%23d9c9f5' opacity='.6'/><circle cx='146' cy='66' r='2.2' fill='%23bfe0f7' opacity='.7'/><circle cx='76' cy='144' r='2.4' fill='%23ffc9d9' opacity='.6'/><circle cx='10' cy='88' r='2' fill='%23ffe08a' opacity='.7'/></svg>"),
    radial-gradient(520px 420px at 0% 0%, rgba(255, 205, 222, .75) 0%, rgba(255, 205, 222, 0) 70%),
    radial-gradient(560px 460px at 100% 12%, rgba(196, 226, 250, .8) 0%, rgba(196, 226, 250, 0) 70%),
    radial-gradient(600px 520px at 12% 78%, rgba(255, 236, 170, .55) 0%, rgba(255, 236, 170, 0) 70%),
    radial-gradient(620px 520px at 95% 95%, rgba(222, 206, 250, .6) 0%, rgba(222, 206, 250, 0) 70%),
    linear-gradient(180deg, #fff5f8 0%, #fffaf0 50%, #f6f4ff 100%);
  background-size: 160px 160px, auto, auto, auto, auto, auto;
  background-attachment: fixed;
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  -webkit-text-size-adjust: 100%;
}
.view {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(96px + env(safe-area-inset-bottom));
}
h2 { font-size: 1.25rem; margin: 0 0 4px; letter-spacing: -0.02em; }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
h3:first-child { margin-top: 0; }
p { margin: 6px 0; }
.sub { color: var(--sub); font-size: .92rem; }
.foot { text-align: center; color: var(--sub); font-size: .82rem; margin: 20px 0; }
.center { text-align: center; }

/* 카드: 화면이 바뀔 때 아래에서 살짝 떠오름 */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 18px;
  margin: 14px 0;
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 233, 228, .7);
  animation: rise .35s var(--ease) both;
}
.view > .card:nth-child(2) { animation-delay: .04s; }
.view > .card:nth-child(3) { animation-delay: .08s; }
.view > .card:nth-child(n+4) { animation-delay: .12s; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 홈 위쪽 캐릭터 카드 */
.card.hero {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #ffffff 0%, #fff6e8 100%);
  border: 1px solid var(--mint);
}
.hello { font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.xp {
  display: inline-block; color: #8a5a00; font-weight: 700;
  background: var(--gold-soft); border-radius: 999px; padding: 1px 10px; font-size: .88rem;
}

/* 버튼: 누르면 살짝 눌리고, 물결이 퍼짐 */
.btn, .opt, .chip, .mpick, .qlist button, .nav button {
  position: relative; overflow: hidden;
  transition: transform .12s var(--ease), box-shadow .18s var(--ease), background-color .18s, border-color .18s, color .18s;
}
.btn {
  display: block;
  width: 100%;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: #fff;
  color: var(--text);
  border-radius: 16px;
  padding: 12px 14px;
  margin: 8px 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}
.btn:active:not(:disabled) { transform: translateY(2px) scale(.985); border-bottom-width: 2px; margin-bottom: 10px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn b { color: var(--green-dark); margin-left: 4px; }
.btn.primary {
  background: linear-gradient(180deg, #6cbcec 0%, var(--green) 100%);
  border-color: var(--green-dark);
  color: #fff;
  box-shadow: 0 6px 14px rgba(74, 168, 224, .28);
}
.btn.primary b { color: #fff; }
.btn.big { padding: 16px; font-size: 1.1rem; border-radius: 18px; }
.btn.small { display: inline-block; width: auto; padding: 8px 13px; font-size: .9rem; margin: 6px 6px 0 0; border-radius: 12px; }
.btn.small:active:not(:disabled) { margin-bottom: 0; }
.btn.danger { border-color: #f3c4c4; color: var(--red-dark); }
.row { display: flex; flex-wrap: wrap; }

@media (hover: hover) {
  .btn:hover:not(:disabled) { border-color: #e3d6c6; }
  .btn.primary:hover:not(:disabled) { filter: brightness(1.04); box-shadow: 0 8px 18px rgba(74, 168, 224, .36); }
  .opt:hover:not(:disabled) { border-color: #bcdcf3; transform: translateY(-1px); box-shadow: var(--shadow); }
  .chip:hover { border-color: #bcdcf3; }
  .mpick:hover, .qlist button:hover { border-color: #bcdcf3; }
}

/* 물결 효과 (app.js 의 addRipple 이 넣음) */
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .16;
  transform: scale(0); animation: ripple .5s var(--ease) forwards;
}
.btn.primary .ripple { background: #fff; opacity: .35; }
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 7px 15px;
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--green-soft); border-color: var(--green); color: var(--green-deep); animation: pop .25s var(--ease); }

/* 캐릭터 */
.mascot { display: inline-flex; align-items: center; justify-content: center; font-size: 2.4rem; width: 60px; height: 60px; flex: none; filter: drop-shadow(0 4px 6px rgba(20, 50, 35, .12)); }
.mascot img { width: 100%; height: 100%; object-fit: contain; }
.mascot.big { font-size: 4rem; width: 104px; height: 104px; }
.hero { display: flex; align-items: center; gap: 14px; }
.jump { animation: jump .6s var(--ease); }
.shake { animation: shake .45s ease; }
@keyframes jump { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-14px) rotate(-4deg); } 60% { transform: translateY(0) scale(1.05, .95); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-3deg); } 75% { transform: translateX(6px) rotate(3deg); } }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.04); } 100% { transform: scale(1); } }

/* 문제 화면 */
.qtop { display: flex; justify-content: space-between; color: var(--sub); font-size: .88rem; font-weight: 600; }
.bar { height: 12px; background: #f1e8dc; border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.bar i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd36b, #ffb44a);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .08);
  transition: width .5s var(--ease);
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tag { background: var(--green-soft); color: var(--green-deep); border-radius: 999px; padding: 2px 10px; font-size: .78rem; font-weight: 700; }
.tag.warn { background: var(--gold-soft); color: #8a5a00; }
.passage { background: #fffbf4; border: 1px solid var(--line); border-left: 4px solid #bcdcf3; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; white-space: pre-wrap; font-size: .96rem; }
.qtext { font-weight: 700; font-size: 1.06rem; white-space: pre-wrap; letter-spacing: -0.015em; }
.qimg { display: block; max-width: 100%; height: auto; margin: 12px 0; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.tablewrap { overflow-x: auto; margin: 12px 0; border-radius: 12px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
caption { text-align: left; color: var(--sub); font-size: .84rem; padding: 8px 10px 4px; }
th, td { border-bottom: 1px solid var(--line); padding: 7px 9px; text-align: center; }
th { background: #eef6fd; font-weight: 700; color: var(--green-deep); }
tr:last-child td { border-bottom: 0; }
.opts { margin-top: 12px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start;
  width: 100%; text-align: left;
  border: 2px solid var(--line); border-bottom-width: 4px;
  background: #fff; color: var(--text);
  border-radius: 16px; padding: 12px 14px; margin: 9px 0;
  font: inherit; font-size: 1rem; cursor: pointer;
}
.opt:active:not(:disabled) { transform: translateY(2px) scale(.99); border-bottom-width: 2px; margin-bottom: 11px; }
.opt .num {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px; border-radius: 9px;
  background: #f6f0e8; font-weight: 800; color: var(--sub); font-size: .95rem;
}
.opt.right { background: var(--ok-soft); border-color: var(--ok); animation: pop .35s var(--ease); }
.opt.right .num { background: var(--ok); color: #fff; }
.opt.wrong { background: var(--red-soft); border-color: var(--red); animation: shake .4s ease; }
.opt.wrong .num { background: var(--red); color: #fff; }
.opt:disabled { color: var(--text); cursor: default; }
.hint { background: var(--gold-soft); border-radius: 12px; padding: 10px 12px; margin-top: 8px; font-size: .95rem; animation: rise .3s var(--ease) both; }

/* 결과·풀이 */
.result.ok { background: linear-gradient(135deg, #f1fbf4, #fff7dc); border-color: #cdebd6; }
.result.no { background: linear-gradient(135deg, #f3f6ff, #ffeef3); border-color: #dfe3f5; }
.react { display: flex; gap: 12px; align-items: center; }
.steps { padding-left: 22px; margin: 6px 0; }
.steps li { margin: 9px 0; white-space: pre-wrap; }
.steps li::marker { color: var(--green-dark); font-weight: 800; }
.steps li.hide { display: none; }
.mistakes { padding-left: 20px; margin: 4px 0; }
.mistakes li { margin: 5px 0; }
.src { color: var(--sub); font-size: .78rem; margin-top: 14px; }
.concept { background: var(--blue-soft); border-radius: 14px; padding: 12px 14px; margin-top: 10px; }
.concept .formula { font-family: ui-monospace, Menlo, monospace; background: #fff; border-radius: 10px; padding: 8px 10px; white-space: pre-wrap; margin: 6px 0; font-size: .9rem; }

/* 목록 */
.qlist { list-style: none; padding: 0; margin: 6px 0; }
.qlist button { width: 100%; text-align: left; background: #fffcf7; border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; margin: 6px 0; font: inherit; font-size: .95rem; color: var(--text); cursor: pointer; }
.qlist button:active { transform: scale(.985); }
.qlist small { color: var(--sub); margin-left: 6px; }
.preview { color: var(--sub); font-size: .85rem; margin-top: 2px; }

/* 통계 */
.stat { margin: 12px 0; }
.stat-h { display: flex; justify-content: space-between; font-size: .92rem; gap: 8px; }
.stat-h span:last-child { color: var(--sub); white-space: nowrap; }
.meter { height: 12px; background: #f1e8dc; border-radius: 999px; overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #7fd3a0, var(--ok)); animation: grow .7s var(--ease) both; transform-origin: left; }
.meter.low i { background: linear-gradient(90deg, #ff8a8a, var(--red)); }
.meter.mid i { background: linear-gradient(90deg, #ffd27a, var(--gold)); }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 캐릭터 고르기 */
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.mpick { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 4px; display: flex; flex-direction: column; align-items: center; font: inherit; font-size: .9rem; color: var(--text); cursor: pointer; }
.mpick:active { transform: scale(.96); }
.mpick.on { border-color: var(--green); background: var(--green-soft); animation: pop .3s var(--ease); }

/* 계산 메모장 */
.memo {
  position: fixed; left: 0; right: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  height: 45vh; max-width: 640px; margin: 0 auto;
  background: #fffdf6; border-top: 2px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .10);
  display: flex; flex-direction: column; z-index: 20;
  animation: slideup .25s var(--ease);
}
@keyframes slideup { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.memo-bar { display: flex; align-items: center; gap: 6px; padding: 6px 12px; }
.memo-bar span { flex: 1; font-weight: 700; }
.memo-bar .btn.small { margin: 0; }
.memo canvas { flex: 1; width: 100%; touch-action: none; }

/* 아래 메뉴 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 4px 6px env(safe-area-inset-bottom);
  z-index: 30;
}
.nav button { flex: 1; border: 0; background: none; padding: 7px 0 6px; margin: 2px; border-radius: 14px; font: inherit; font-size: .72rem; color: var(--sub); display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.nav button:active { transform: scale(.93); }
.nav button.on { color: var(--green-deep); font-weight: 800; background: var(--green-soft); }
.nav-ico { font-size: 1.3rem; line-height: 1.2; transition: transform .2s var(--ease); }
.nav button.on .nav-ico { transform: translateY(-1px) scale(1.08); }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, 8px); background: rgba(29, 43, 36, .94); color: #fff;
  padding: 10px 16px; border-radius: 14px; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .25s var(--ease); z-index: 40; max-width: 90vw;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ───────── 캐릭터 6마리 (v0.3) ───────── */
.pal { display: inline-flex; align-items: flex-end; justify-content: center; flex: none; width: 64px; height: 76px; }
.pal img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 5px rgba(80, 60, 40, .14)); }
.pal .emo { font-size: 2.6rem; line-height: 1; }

/* 홈 무대: 6마리가 차례로 톡톡 등장 → 숨 쉬듯 둥실 */
.stage { background: linear-gradient(160deg, #ffffff 0%, #fff4e4 55%, #ffeef3 100%); border-color: #f6e3d2; padding-bottom: 12px; }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hello { font-weight: 800; font-size: 1.12rem; letter-spacing: -0.02em; }
.cast { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin: 12px -6px 2px; align-items: end; }
.castbtn { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; display: flex; flex-direction: column; align-items: center; color: var(--text); }
.castbtn .pal { width: 100%; height: 84px; animation: popIn .5s cubic-bezier(.3, 1.6, .5, 1) both, bob 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * .09s), calc(.6s + var(--i) * .23s); transform-origin: 50% 100%; }
.castname { font-size: .72rem; font-weight: 700; color: var(--sub); margin-top: 2px; }
.castbtn.hop .pal { animation: hop .55s cubic-bezier(.3, 1.5, .5, 1); }
.stage-say { min-height: 52px; margin-top: 8px; display: flex; align-items: center; justify-content: center; text-align: center; }
@keyframes popIn { 0% { opacity: 0; transform: translateY(26px) scale(.6); } 100% { opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes hop { 0% { transform: none; } 35% { transform: translateY(-20px) rotate(-6deg); } 65% { transform: translateY(0) scale(1.08, .92); } 100% { transform: none; } }

/* 말풍선 */
.bubble {
  position: relative; background: #fff; border: 2px solid #f1e4d4; border-radius: 16px;
  padding: 9px 12px; font-size: .95rem; line-height: 1.5; box-shadow: 0 3px 10px rgba(120, 90, 60, .08);
  animation: bubbleIn .35s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: .15s; text-align: left;
}
.bubble .who { display: block; font-size: .76rem; color: var(--green-deep); margin-bottom: 1px; }
.bubble.up::before { content: ""; position: absolute; top: -8px; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top: 0; border-bottom-color: #f1e4d4; }
.bubble.pop { animation: bubbleIn .3s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: 0s; }
@keyframes bubbleIn { 0% { opacity: 0; transform: scale(.85) translateY(6px); } 100% { opacity: 1; transform: none; } }

/* 캐릭터 + 말풍선 한 줄 */
.buddy { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0; }
.buddy .bubble { flex: 1; }
.buddy .bubble::before { content: ""; position: absolute; left: -9px; bottom: 16px; border: 8px solid transparent; border-left: 0; border-right-color: #f1e4d4; }
.buddy .pal { width: 66px; height: 80px; }
/* 등장 방식 */
.buddy.spring .pal { animation: spring .5s cubic-bezier(.3, 1.6, .5, 1) both, wag .3s ease-in-out .5s 1; transform-origin: 50% 100%; }
.buddy.waddle .pal { animation: waddleIn .8s ease-out both; transform-origin: 50% 100%; }
.buddy.peek .pal { animation: peek .5s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: 50% 100%; }
.buddy.rise .pal { animation: popIn .5s cubic-bezier(.3, 1.5, .5, 1) both; transform-origin: 50% 100%; }
.buddy.stretch .pal { animation: stretchUp .7s cubic-bezier(.3, 1.4, .5, 1) both; transform-origin: 50% 100%; }
@keyframes spring { 0% { opacity: 0; transform: translateY(40px) scale(.7); } 60% { opacity: 1; transform: translateY(-12px) scale(1.05); } 100% { transform: none; } }
@keyframes wag { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-5deg); } 75% { transform: rotate(5deg); } }
@keyframes waddleIn { 0% { opacity: 0; transform: translateX(-60px) rotate(-8deg); } 25% { opacity: 1; transform: translateX(-40px) rotate(8deg); } 50% { transform: translateX(-20px) rotate(-8deg); } 75% { transform: translateX(-6px) rotate(6deg); } 100% { transform: none; } }
@keyframes peek { 0% { opacity: 0; transform: translateX(-30px) rotate(-14deg); } 100% { opacity: 1; transform: none; } }
@keyframes stretchUp { 0% { opacity: 0; transform: scaleY(.6); } 70% { opacity: 1; transform: scaleY(1.06); } 100% { transform: none; } }

/* 정답 별가루 */
.buddy.sparkle { position: relative; }
.buddy.sparkle::after {
  content: "✦ ✧ ✦"; position: absolute; left: 6px; top: -6px; font-size: .9rem; color: #ffbf3f; letter-spacing: 6px;
  animation: sparkle .6s ease-out .2s both; pointer-events: none;
}
@keyframes sparkle { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px) scale(1.1); } }

.hint-buddy { margin: 8px 0 2px; }
.hint-buddy .bubble { background: #fffaf0; border-color: #f7e1b5; }
.hint-buddy .bubble::before { border-right-color: #f7e1b5; }
.hint-n { display: inline-block; background: var(--butter); color: #8a5a00; border-radius: 8px; padding: 0 7px; font-size: .78rem; font-weight: 800; margin-right: 4px; }
.teacher .bubble { background: #f6fbf3; border-color: #d9ecd0; min-height: 56px; }
.teacher .bubble::before { border-right-color: #d9ecd0; }
.step-n { display: inline-block; background: #e5f3dc; color: #3f7a2b; border-radius: 8px; padding: 0 7px; font-size: .78rem; font-weight: 800; margin-right: 4px; }
.result-line { margin-top: 2px; padding-left: 74px; }

/* 세트 끝: 6마리 모두 모여서 */
.party { background: linear-gradient(160deg, #ffffff, #fff4e4 60%, #eaf5fd); }
.cast.gather { margin: 4px -6px 6px; }
.cast.gather .pal { height: 92px; animation: popIn .45s cubic-bezier(.3, 1.6, .5, 1) both, hop .6s cubic-bezier(.3, 1.5, .5, 1) both; animation-delay: calc(var(--i) * .08s), calc(.55s + var(--i) * .1s); }
.party-line { font-weight: 700; color: var(--green-deep); }

/* 설정: 친구들 소개 */
.castlist { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.castlist li { display: flex; align-items: center; gap: 10px; background: #fffcf7; border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; }
.castlist .pal { width: 46px; height: 56px; }

/* 배경 장식: 화면 구석에 떠다니는 큰 하트·구름 (내용 뒤, 누르기 방해 없음) */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none;
  background-repeat: no-repeat; background-size: contain; opacity: .55;
}
body::before {
  width: 150px; height: 150px; left: -36px; top: 38%;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><path d='M50 88C22 68 8 52 8 34 8 20 19 10 32 10c8 0 14 4 18 10 4-6 10-10 18-10 13 0 24 10 24 24 0 18-14 34-42 54z' fill='%23ffc2d4'/></svg>");
  animation: floaty 9s ease-in-out infinite;
}
body::after {
  width: 190px; height: 110px; right: -50px; top: 64%;
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 110'><path d='M48 96c-22 0-38-14-38-32s16-32 36-32c6-18 24-30 44-30 24 0 43 16 46 37 3-1 7-1 10-1 20 0 36 13 36 29s-16 29-36 29z' fill='%23d7ebfb'/></svg>");
  animation: floaty 11s ease-in-out -3s infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-16px) rotate(3deg); } }
.view { position: relative; z-index: 0; }

/* 움직임 줄이기 설정을 켠 기기에서는 효과를 끔 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ripple { display: none; }
  .buddy.sparkle::after { display: none; }
  .castbtn.hop .pal { transform: none !important; }
  /* 누를 때·마우스를 올릴 때 크기·위치가 바뀌는 것도 끔 */
  .btn:active, .opt:active, .chip:active, .mpick:active, .qlist button:active, .nav button:active,
  .opt:hover, .nav button.on .nav-ico { transform: none !important; }
  .btn:active:not(:disabled), .opt:active:not(:disabled) { border-bottom-width: 4px !important; margin-bottom: 8px !important; }
  .opt:active:not(:disabled) { margin-bottom: 9px !important; }
  .btn.small:active:not(:disabled) { margin-bottom: 0 !important; }
}
