/* 과자 저택 테마: 빼빼로 버튼 · 편지지 창 · 하트 화면 전환 · 층 시작 리본 · 축포.
   style.css(호박 저택에서 가져온 틀) 뒤에 불러서 덮어쓴다. */
:root {
  --straw: #ff7fab; --straw-2: #ff4f8b; --straw-hi: #ffc2d7;
  --choco: #6b3a24; --choco-2: #4a2416; --choco-hi: #9a5a38;
  --biscuit: #f2c27a; --biscuit-2: #d99a4c; --cream: #fff7ee;
  --letter: #fff8fb; --lace: #ffd0df;
  --ease-pop: cubic-bezier(.2, 1.6, .4, 1);
}

/* ===== 버튼: 딸기 코팅 빼빼로(기본) · 초콜릿(보조) · 비스킷(도구) ===== */
.big, .btn-ink, .grade-grid button, .seg button, .costumes button, .tool, .chip, .pbtn, #actBtn, .choice, .comic-skip, .note-head .x, #throwBtn, #detector, .room-chip {
  transition: transform .16s var(--ease-pop), box-shadow .16s, filter .16s, background-color .16s;
  -webkit-tap-highlight-color: transparent;
}
.big, .btn-ink {
  position: relative; overflow: hidden; border: 0; border-radius: 999px; color: #fff; font-family: var(--f-display); font-weight: 400; letter-spacing: .02em;
  background: linear-gradient(180deg, var(--straw-hi) 0%, var(--straw) 38%, var(--straw-2) 100%);
  box-shadow: 0 6px 0 var(--choco), 0 9px 16px rgba(110, 40, 60, .35), inset 0 -3px 0 rgba(160, 30, 80, .25);
  text-shadow: 0 2px 0 rgba(150, 30, 70, .55);
}
/* 위쪽 반짝 띠 + 스프링클 */
.big::after, .btn-ink::after { content: ""; position: absolute; left: 12%; right: 12%; top: 5px; height: 32%; border-radius: 999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0)); }
.big::before, .btn-ink::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .55;
  background-image:
    linear-gradient(35deg, transparent 46%, #fff 46% 54%, transparent 54%), linear-gradient(-30deg, transparent 46%, #ffe066 46% 54%, transparent 54%),
    linear-gradient(80deg, transparent 46%, #8fe0ff 46% 54%, transparent 54%), linear-gradient(10deg, transparent 46%, #fff 46% 54%, transparent 54%);
  background-size: 14px 14px; background-repeat: no-repeat;
  background-position: 9% 62%, 22% 30%, 82% 66%, 91% 32%; }
.big:hover:not(:disabled), .btn-ink:hover:not(:disabled) { transform: translateY(-3px) rotate(-1deg); filter: brightness(1.05); }
.big:active:not(:disabled), .btn-ink:active:not(:disabled) { transform: translateY(4px) scale(.98); box-shadow: 0 2px 0 var(--choco), 0 3px 8px rgba(110, 40, 60, .3); }
.big:focus-visible, .btn-ink:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.big.alt, .btn-ink.ghost {
  color: #ffe3ec; background: linear-gradient(180deg, var(--choco-hi) 0%, var(--choco) 45%, var(--choco-2) 100%);
  box-shadow: 0 6px 0 #2a120a, 0 9px 16px rgba(60, 20, 10, .35), inset 0 -3px 0 rgba(0, 0, 0, .2); text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.btn-ink.ghost::before, .big.alt::before { opacity: .35; }
.big.start { font-size: 40px; padding: 16px 52px; animation: startBeat 2.6s ease-in-out infinite; }
@keyframes startBeat { 0%, 100% { transform: scale(1); } 8% { transform: scale(1.05); } 16% { transform: scale(1); } 24% { transform: scale(1.04); } 32% { transform: scale(1); } }

/* 비스킷 버튼(설정·전체 화면 등): 구멍 송송 */
.tool, .title-btns .tool {
  color: var(--choco-2); font-family: var(--f-display); border-radius: 18px; border: 3px solid var(--biscuit-2);
  background-color: var(--biscuit);
  background-image: radial-gradient(circle, rgba(140, 80, 30, .45) 1.6px, transparent 2.2px), linear-gradient(180deg, #ffd99a, var(--biscuit) 60%, #e6ad62);
  background-size: 22px 18px, 100% 100%; background-position: 6px 5px, 0 0;
  box-shadow: 0 5px 0 var(--biscuit-2), 0 8px 14px rgba(110, 60, 20, .3);
}
.tool:hover { transform: translateY(-2px) rotate(1deg); border-color: var(--biscuit-2); }
.tool:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--biscuit-2); }

/* 학년: 둥근 쿠키 */
.grade-grid button { position: relative; border-radius: 50% / 44%; border: 4px solid #c88a46; color: var(--choco-2); font-family: var(--f-display); padding: 16px 0 14px;
  background: radial-gradient(circle at 30% 30%, rgba(90, 40, 20, .9) 0 3.5px, transparent 4.5px), radial-gradient(circle at 72% 64%, rgba(90, 40, 20, .9) 0 4px, transparent 5px),
    radial-gradient(circle at 64% 24%, rgba(90, 40, 20, .9) 0 3px, transparent 4px), radial-gradient(circle at 26% 74%, rgba(90, 40, 20, .9) 0 3px, transparent 4px),
    radial-gradient(ellipse at 50% 35%, #ffe0a6, #f0b866 70%, #d9933f);
  box-shadow: 0 6px 0 #a8692e, 0 10px 18px rgba(110, 60, 20, .3); }
.grade-grid button small { color: #7a4a24; }
.grade-grid button:nth-child(odd) { --tilt: -3deg; } .grade-grid button:nth-child(even) { --tilt: 3deg; }
.grade-grid button:hover, .grade-grid button:focus-visible { transform: translateY(-4px) rotate(var(--tilt)); border-color: var(--straw-2); }
.grade-grid button:active { transform: translateY(3px) scale(.97); }

/* 고르기(층·아이템·빼빼로): 작은 사탕 알 */
.seg button, .costumes button { border-radius: 999px; border: 2px solid #f1a7c0; background: #fff0f5; color: var(--choco-2); font-weight: 700; }
.seg button[aria-pressed="true"], .costumes button[aria-pressed="true"] { background: linear-gradient(180deg, var(--straw-hi), var(--straw)); color: #fff; border-color: var(--straw-2);
  box-shadow: 0 3px 0 var(--choco), 0 0 0 2px #fff inset; text-shadow: 0 1px 0 rgba(150, 30, 70, .5); }
.seg span, .field span { color: #ffe3ec; }
.costumes button { padding: 8px 16px 8px 10px; display: inline-flex; align-items: center; gap: 6px; }
.costumes button::before { content: ""; width: 10px; height: 26px; border-radius: 5px; background: linear-gradient(180deg, var(--c) 0 72%, #f2c27a 72%); box-shadow: 0 0 0 1.5px rgba(80, 30, 20, .35); }
.costumes button:hover { transform: translateY(-2px) rotate(-2deg); }
input { background: #fff; color: var(--choco-2); border: 3px solid #f1a7c0; border-radius: 14px; }
input:focus { outline: none; border-color: var(--straw-2); box-shadow: 0 0 0 4px rgba(255, 127, 171, .3); }
.link { color: #fff; text-shadow: 0 1px 2px rgba(120, 30, 60, .6); }

/* 게임 화면 단추: 초콜릿 판 + 딸기 테두리 */
.chip, .pbtn { color: #fff3f7; border: 3px solid var(--straw); background: linear-gradient(180deg, var(--choco-hi), var(--choco) 55%, var(--choco-2));
  box-shadow: 0 5px 0 #2a120a, 0 8px 14px rgba(40, 10, 10, .35), inset 0 2px 0 rgba(255, 255, 255, .18); }
.chip:hover:not(:disabled), .pbtn:hover:not(:disabled) { border-color: #fff; transform: translateY(-2px); }
.pbtn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #2a120a; }
.pbtn.ready, .chip.ready { border-color: #ffe066; box-shadow: 0 5px 0 #2a120a, 0 0 22px rgba(255, 224, 102, .7); animation: readyWiggle 1.6s ease-in-out infinite; }
@keyframes readyWiggle { 0%, 70%, 100% { transform: rotate(0); } 76% { transform: rotate(-6deg); } 84% { transform: rotate(5deg); } 92% { transform: rotate(-3deg); } }
.pbtn kbd { background: var(--straw-2); color: #fff; border-radius: 6px; padding: 0 5px; }
#actBtn { color: var(--choco-2); font-family: var(--f-display); border-radius: 999px; border: 3px solid #fff;
  background: repeating-linear-gradient(-45deg, #ffe066 0 14px, #fff3b0 14px 28px);
  box-shadow: 0 5px 0 #c48a1a, 0 0 24px rgba(255, 224, 102, .6); animation: actIn .35s var(--ease-pop); }
#actBtn:active { transform: translateY(3px); box-shadow: 0 2px 0 #c48a1a; }
#actBtn .how { background: var(--choco); color: #ffe066; }
@keyframes actIn { from { transform: scale(.6); opacity: 0; } }
#throwBtn { border: 4px solid #fff; background: radial-gradient(circle at 35% 30%, #ffd0e2, var(--straw) 60%, var(--straw-2)); box-shadow: 0 6px 0 var(--choco), 0 0 24px rgba(255, 127, 171, .55); }
#throwBtn small { color: #fff; text-shadow: 0 1px 3px var(--choco); }
#detector { background: linear-gradient(180deg, rgba(107, 58, 36, .95), rgba(74, 36, 22, .95)); border: 3px solid var(--straw); border-radius: 999px; box-shadow: 0 4px 0 #2a120a, 0 0 18px var(--detGlow, transparent); }
#detector small { color: #ffd0df; }
.room-chip { background: rgba(107, 58, 36, .92); border-color: var(--straw); }

/* ===== 창: 레이스 테두리 편지지 ===== */
.sheet, #note, #quiz { background: var(--letter); color: var(--choco-2); border-radius: 22px;
  box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--lace), 0 18px 50px rgba(120, 30, 60, .45);
  background-image: radial-gradient(circle at 12px 12px, rgba(255, 143, 179, .12) 0 5px, transparent 6px); background-size: 34px 34px; }
#note, #quiz { border-radius: 22px 22px 0 0; }
.sheet h2, .note-head h2 { color: var(--straw-2); font-family: var(--f-display); text-shadow: 0 2px 0 #ffe0ea; }
.sheet .lead, .note-head span { color: #8a4a5a; }
.note-head .x { border: 3px solid var(--straw); color: var(--straw-2); background: #fff; border-radius: 50%; }
.note-head .x:hover { transform: rotate(90deg); }
.modal { background: rgba(120, 40, 70, .45); backdrop-filter: blur(3px); }
.modal:not([hidden]) .sheet { animation: sheetPop .5s var(--ease-pop); }
@keyframes sheetPop { from { transform: translateY(30px) scale(.85) rotate(-2deg); opacity: 0; } }
#note:not([hidden]), #quiz:not([hidden]) { animation: noteUp .4s var(--ease-pop); }
@keyframes noteUp { from { transform: translate(-50%, 60px); opacity: 0; } }
.problem { background: #fff; border: 3px dashed #f1a7c0; border-radius: 14px; color: var(--choco-2); }
.choice { border: 3px solid var(--biscuit-2); border-radius: 16px; color: var(--choco-2);
  background: linear-gradient(90deg, rgba(200, 130, 60, .14) 1px, transparent 1px) 0 0 / 12px 12px, linear-gradient(rgba(200, 130, 60, .14) 1px, transparent 1px) 0 0 / 12px 12px, #fff4dc;
  box-shadow: 0 4px 0 var(--biscuit-2); }
.choice:hover:not(:disabled) { transform: translateY(-2px); background-color: #ffe9c4; }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--biscuit-2); }
.choice.right { background: #d4f5df; border-color: #2e9a66; box-shadow: 0 4px 0 #2e9a66; animation: rightPop .45s var(--ease-pop); }
.choice.wrong { background: #ffd6dc; border-color: #d23a5a; box-shadow: 0 4px 0 #d23a5a; animation: shake .4s; }
@keyframes rightPop { 40% { transform: scale(1.06); } }
.hint { background: #fff0f5; border-left-color: var(--straw-2); }
.read { border: 2px solid var(--straw); background: #fff; color: var(--straw-2); border-radius: 999px; }
.stat { border: 3px solid #f1a7c0; border-radius: 16px; background: #fff; }
.stat span { color: #8a4a5a; }
.stars span.on { color: #ffb52e; text-shadow: 0 2px 0 #c06a10, 0 0 12px rgba(255, 200, 80, .7); }
.stars span.on { animation: starPop .5s var(--ease-pop) backwards; }
.stars span:nth-child(2) { animation-delay: .15s; } .stars span:nth-child(3) { animation-delay: .3s; }
@keyframes starPop { from { transform: scale(0) rotate(-90deg); } }

/* 대사창·만화 대사: 초콜릿 말풍선 + 분홍 리본 */
#dialog, .comic-say { background: linear-gradient(180deg, rgba(107, 58, 36, .96), rgba(74, 36, 22, .96)); border: 3px solid var(--straw); border-radius: 22px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 12px 30px rgba(60, 20, 20, .4); color: #fff3f7; }
#dialog .face, .comic-say .face { border-color: #fff; background: #ffe3ec; box-shadow: 0 0 0 3px var(--straw); }
#dialog .next, .comic-say .next { color: #ffd0df; }
.comic-say.narr { border-color: #ffd0df; }
.comic-say.narr .line { color: #ffe9a8; }
.comic { background: radial-gradient(ellipse at 50% 30%, #5a2c3c, #2a1820 70%); animation: comicOpen .7s ease-out; }
@keyframes comicOpen { from { clip-path: circle(0% at 50% 50%); } to { clip-path: circle(75% at 50% 50%); } }
.comic-frame::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 60px rgba(42, 24, 32, .55); }
.comic-img.in { animation: pageIn .6s cubic-bezier(.2, .9, .3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateX(6%) rotate(1.2deg) scale(.98); filter: brightness(1.15); } }
.comic-skip { border-color: var(--straw); color: #fff; border-radius: 999px; }
.comic-skip:hover { background: rgba(255, 127, 171, .2); }
.comic-bar { color: #ffd0df; }

/* HUD */
#hud { background: linear-gradient(rgba(107, 58, 36, .82), rgba(107, 58, 36, 0)); }
#hud .stage-name { font-family: var(--f-display); color: #fff; text-shadow: 0 2px 0 var(--straw-2), 0 0 10px rgba(255, 127, 171, .6); }
#timer { color: #fff; text-shadow: 0 3px 0 var(--straw-2); }
#timer.low { color: #ffe066; text-shadow: 0 3px 0 #d23a5a; }
.mate { background: rgba(107, 58, 36, .9); border-color: var(--straw); }
.toast { background: rgba(255, 248, 251, .96); color: var(--choco-2); border: 3px solid var(--straw); border-radius: 999px; box-shadow: 0 4px 0 rgba(107, 58, 36, .5); animation: toastIn .35s var(--ease-pop); }
@keyframes toastIn { from { transform: translateY(-14px) scale(.9); opacity: 0; } }
#banner { background: rgba(255, 248, 251, .96); color: var(--choco-2); border-color: var(--straw); }
#compass { background: rgba(255, 248, 251, .96); color: var(--choco-2); border-color: var(--straw); }
#compassArrow { background: var(--straw); box-shadow: 0 0 14px rgba(255, 127, 171, .8); }
#compassArrow svg { fill: #fff; }
#cineText { color: #fff; text-shadow: 0 0 22px rgba(255, 160, 200, .9), 0 4px 0 var(--straw-2); animation: cinePop .7s var(--ease-pop); }
@keyframes cinePop { from { transform: scale(.4); opacity: 0; } }
.lobby-card { background: linear-gradient(180deg, rgba(107, 58, 36, .95), rgba(74, 36, 22, .95)); border: 3px solid var(--straw); border-radius: 26px; box-shadow: 0 0 0 5px rgba(255, 255, 255, .7), 0 18px 40px rgba(80, 20, 40, .4); }
.lobby-card .code { color: #fff; text-shadow: 0 3px 0 var(--straw-2); }
.members li { background: rgba(255, 255, 255, .1); }

/* ===== 타이틀(호박 저택과 같은 구성: 왼쪽 하늘에 제목·단추, 오른쪽 그림, 아래 만든 곳) ===== */
#title { background: radial-gradient(circle at 18% 18%, #fff6fa 0, transparent 46%), linear-gradient(180deg, #ffd9e8 0%, #ffc7dc 50%, #ffb8d0 85%, #f7a8c4 100%); }
#title::before { opacity: .9;
  background-image: radial-gradient(2px 2px at 8% 14%, #fff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 21% 33%, #fff 50%, transparent 51%),
    radial-gradient(2.4px 2.4px at 31% 9%, #fff3a8 50%, transparent 51%), radial-gradient(1.6px 1.6px at 14% 58%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 38% 46%, #fff 50%, transparent 51%), radial-gradient(1.6px 1.6px at 4% 82%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 27% 71%, #fff3a8 50%, transparent 51%), radial-gradient(1.6px 1.6px at 44% 24%, #fff 50%, transparent 51%);
  animation: twinkle 3.6s ease-in-out infinite; }
@keyframes twinkle { 50% { opacity: .35; } }
#title .title-shade { background: linear-gradient(90deg, rgba(255, 214, 230, .55) 0%, rgba(255, 214, 230, .2) 30%, transparent 46%), linear-gradient(0deg, rgba(150, 50, 90, .35) 0%, transparent 14%); }
.title-art { animation: artDrift 26s ease-in-out infinite alternate; transform-origin: 70% 60%; }
@keyframes artDrift { from { transform: scale(1); } to { transform: scale(1.045) translateX(-1%); } }
h1.logo span { background: linear-gradient(180deg, #fff 0%, #ffd0e0 30%, #ff7fab 62%, #e8456f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1.logo span::before { color: var(--choco-2); -webkit-text-stroke: .11em var(--choco-2); text-shadow: 0 .07em 0 #2a120a, 0 0 .3em rgba(255, 255, 255, .9); }
h1.logo span:first-child { animation: logoDrop .9s var(--ease-pop) backwards; }
h1.logo span:last-child { animation: logoDrop .9s var(--ease-pop) .18s backwards; }
@keyframes logoDrop { from { transform: translateY(-60px) scale(.6) rotate(-6deg); opacity: 0; } }
.orn { position: absolute; z-index: 1; height: auto; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(120, 40, 60, .35)); }
.orn.o1 { left: -.22em; top: -.02em; width: .5em; transform: rotate(-18deg); transform-origin: 50% 90%; animation: stickSway 3.4s ease-in-out infinite, ornIn .8s var(--ease-pop) .35s backwards; }
.orn.o2 { left: 100%; bottom: .06em; width: .62em; margin-left: .02em; transform: rotate(10deg); animation: letterFloat 3s ease-in-out infinite, ornIn .8s var(--ease-pop) .5s backwards; }
@keyframes stickSway { 50% { transform: rotate(-8deg); } }
@keyframes letterFloat { 50% { transform: rotate(4deg) translateY(-8px); } }
@keyframes ornIn { from { opacity: 0; scale: .2; } }
.title-kicker { display: inline-block; position: relative; padding: 6px 30px; color: #fff; letter-spacing: .1em; font-family: var(--f-display); font-weight: 400; font-size: 24px;
  background: linear-gradient(180deg, var(--straw), var(--straw-2)); border-radius: 6px; box-shadow: 0 4px 0 var(--choco); text-shadow: 0 2px 0 rgba(140, 20, 60, .5);
  animation: kickIn .7s var(--ease-pop) .5s backwards; }
.title-kicker::before, .title-kicker::after { content: ""; position: absolute; top: 8px; width: 22px; height: 100%; background: #e8456f; z-index: -1; }
.title-kicker::before { left: -14px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 40% 50%); }
.title-kicker::after { right: -14px; clip-path: polygon(0 0, 100% 0, 60% 50%, 100% 100%, 0 100%); }
@keyframes kickIn { from { transform: scaleX(0); opacity: 0; } }
.title-btns > * { animation: btnIn .6s var(--ease-pop) backwards; }
.title-btns > :nth-child(1) { animation-delay: .7s, 1.6s; } .title-btns > :nth-child(2) { animation-delay: .82s; }
.title-btns .big.start { animation: btnIn .6s var(--ease-pop) .7s backwards, startBeat 2.6s ease-in-out 1.6s infinite; }
@keyframes btnIn { from { transform: translateY(24px) scale(.8); opacity: 0; } }
.title-foot { text-shadow: none; }
.title-foot b { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; background: rgba(255, 255, 255, .78); color: var(--choco-2); font-family: var(--f-display); font-size: 18px; box-shadow: 0 3px 0 rgba(107, 58, 36, .35); }
.title-foot b::before { content: ""; width: 7px; height: 20px; border-radius: 4px; background: linear-gradient(180deg, var(--choco) 0 70%, var(--biscuit) 70%); transform: rotate(18deg); }
.title-foot span { color: #7a3048; font-size: 12px; }
.tool.corner { font-size: 15px; }
#grade, #mode { background: radial-gradient(ellipse at 50% 20%, rgba(255, 220, 235, .55), transparent 60%), rgba(150, 60, 95, .55); backdrop-filter: blur(4px); }
.screen-title { color: #fff; font-family: var(--f-display); text-shadow: 0 4px 0 var(--straw-2), 0 0 18px rgba(255, 255, 255, .6); }
.tagline, .keys { color: #fff; text-shadow: 0 1px 3px rgba(120, 30, 60, .6); }
/* 화면이 바뀔 때 안쪽 요소가 톡 튀어나온다 */
.screen:not([hidden]) .title-wrap > *, .screen:not([hidden]) .lobby-card { animation: btnIn .5s var(--ease-pop) backwards; }
.screen:not([hidden]) .title-wrap > :nth-child(2) { animation-delay: .06s; } .screen:not([hidden]) .title-wrap > :nth-child(3) { animation-delay: .12s; }
.screen:not([hidden]) .title-wrap > :nth-child(4) { animation-delay: .18s; } .screen:not([hidden]) .title-wrap > :nth-child(5) { animation-delay: .24s; }
.grade-grid button { animation: btnIn .5s var(--ease-pop) backwards; }
.grade-grid button:nth-child(2) { animation-delay: .05s; } .grade-grid button:nth-child(3) { animation-delay: .1s; } .grade-grid button:nth-child(4) { animation-delay: .15s; }
.grade-grid button:nth-child(5) { animation-delay: .2s; } .grade-grid button:nth-child(6) { animation-delay: .25s; }
#loading .logo { animation: startBeat 1.8s ease-in-out infinite; }

/* ===== 하트 화면 전환: 분홍 막이 하트 구멍으로 닫혔다가 열린다 ===== */
@property --hs { syntax: '<length>'; inherits: false; initial-value: 0px; }
#wipe { position: absolute; inset: 0; z-index: 60; pointer-events: none; visibility: hidden;
  background: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, .35) 0 6px, transparent 7px) 0 0 / 60px 60px, linear-gradient(135deg, #ff9cc0, #ff6f9f);
  --hs: 300vmax;
  -webkit-mask: linear-gradient(#000 0 0), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 90 C20 68 0 50 0 27 C0 11 12 0 27 0 C38 0 46 7 50 15 C54 7 62 0 73 0 C88 0 100 11 100 27 C100 50 80 68 50 90Z'/%3E%3C/svg%3E") center / var(--hs) var(--hs) no-repeat;
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 90 C20 68 0 50 0 27 C0 11 12 0 27 0 C38 0 46 7 50 15 C54 7 62 0 73 0 C88 0 100 11 100 27 C100 50 80 68 50 90Z'/%3E%3C/svg%3E") center / var(--hs) var(--hs) no-repeat;
  mask-composite: exclude; }
#wipe.close { visibility: visible; pointer-events: auto; animation: wipeClose .42s cubic-bezier(.6, 0, .9, .5) forwards; }
#wipe.open { visibility: visible; animation: wipeOpen .55s cubic-bezier(.2, .6, .3, 1) forwards; }
@keyframes wipeClose { from { --hs: 300vmax; } to { --hs: 0px; } }
@keyframes wipeOpen { from { --hs: 0px; } to { --hs: 300vmax; } }
#wipe::after { content: "♥"; position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 64px; color: #fff; opacity: 0; text-shadow: 0 4px 0 var(--straw-2); }
#wipe.close::after { animation: wipeHeart .42s ease-in forwards; }
@keyframes wipeHeart { 70% { opacity: 0; scale: .4; } 100% { opacity: 1; scale: 1; } }

/* ===== 층 시작 리본 카드 ===== */
#stageCard { position: absolute; z-index: 22; left: 0; right: 0; top: 28%; display: grid; justify-items: center; gap: 4px; pointer-events: none; }
#stageCard .no { font-family: var(--f-display); font-size: 26px; color: #fff; background: var(--choco); padding: 2px 18px; border-radius: 999px; box-shadow: 0 3px 0 #2a120a; }
#stageCard .nm { position: relative; font-family: var(--f-display); font-size: clamp(42px, 7vw, 80px); color: #fff; padding: 8px 56px 4px;
  background: linear-gradient(180deg, var(--straw), var(--straw-2)); box-shadow: 0 6px 0 var(--choco), 0 14px 30px rgba(120, 30, 60, .35); text-shadow: 0 3px 0 rgba(140, 20, 60, .5); border-radius: 10px; }
#stageCard .nm::before, #stageCard .nm::after { content: ""; position: absolute; top: 14px; width: 46px; height: 100%; background: #d23a68; z-index: -1; }
#stageCard .nm::before { left: -30px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 36% 50%); }
#stageCard .nm::after { right: -30px; clip-path: polygon(0 0, 100% 0, 64% 50%, 100% 100%, 0 100%); }
#stageCard .sb { font-size: 18px; font-weight: 700; color: var(--choco-2); background: rgba(255, 255, 255, .9); padding: 4px 16px; border-radius: 999px; }
#stageCard.show .no { animation: cardIn 2.8s var(--ease-pop) both; }
#stageCard.show .nm { animation: cardIn 2.8s var(--ease-pop) .08s both; }
#stageCard.show .sb { animation: cardIn 2.8s var(--ease-pop) .16s both; }
@keyframes cardIn { 0% { transform: translateX(-60vw) rotate(-8deg); opacity: 0; } 16% { transform: translateX(0) rotate(-2deg); opacity: 1; } 22% { transform: rotate(1deg); } 80% { transform: translateX(0) rotate(0); opacity: 1; } 100% { transform: translateX(60vw) rotate(6deg); opacity: 0; } }

/* ===== 축포: 하트·스프링클 ===== */
.confetti { position: absolute; inset: 0; z-index: 61; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -30px; width: 10px; height: 18px; border-radius: 3px; animation: fall var(--d, 2.4s) cubic-bezier(.3, .4, .5, 1) var(--w, 0s) forwards; }
.confetti i.h { width: auto; height: auto; background: none !important; font-style: normal; font-size: var(--fs, 22px); color: var(--c); }
.confetti i.h::before { content: "♥"; }
@keyframes fall { to { transform: translate(var(--x, 0), 110vh) rotate(var(--r, 540deg)); } }

.still .big.start, .still .title-art, .still #title::before, .still .orn, .still .title-kicker, .still .title-btns > *, .still h1.logo span, .still .pbtn.ready, .still .chip.ready,
.still .stars span.on, .still .screen:not([hidden]) .title-wrap > *, .still .grade-grid button, .still .hearts i, .still .comic, .still .comic-img.in, .still #stageCard.show * { animation: none !important; }
.still #wipe, .still .confetti, .still .hearts { display: none; }
/* 운영체제의 '애니메이션 줄이기'와 상관없이 게임 움직임은 켠다(설정 > 움직임에서 따로 줄인다) */
.hearts i { display: block; }

#stageCard:not(.show) { display: none; }
.orn.o1 { left: -.08em; }
.grade-grid button { background:
    radial-gradient(circle at 12% 34%, rgba(90, 40, 20, .9) 0 3.5px, transparent 4.5px), radial-gradient(circle at 88% 30%, rgba(90, 40, 20, .9) 0 4px, transparent 5px),
    radial-gradient(circle at 18% 80%, rgba(90, 40, 20, .9) 0 3px, transparent 4px), radial-gradient(circle at 84% 78%, rgba(90, 40, 20, .9) 0 3px, transparent 4px),
    radial-gradient(ellipse at 50% 35%, #ffe0a6, #f0b866 70%, #d9933f); }
.still #dialog.in, .still .comic-say.in, .still .toast, .still .correct, .still #cineText, .still #detector .dicon, .still #timer.low { animation: none !important; }

/* ===== 글꼴: 동글동글 과자 글꼴(Bagel Fat One)을 제목·리본·큰 단추에 ===== */
:root { --f-display: "Bagel Fat One", "Jua", "Gowun Dodum", cursive; }
h1.logo, .logo { font-family: "Bagel Fat One", "Jua", cursive; letter-spacing: .01em; }
h1.logo { font-size: clamp(70px, 10.5vw, 156px); line-height: 1.1; }
h1.logo span::before { -webkit-text-stroke: .09em var(--choco-2); }
.title-kicker { font-family: "Bagel Fat One", "Jua", cursive; font-size: 23px; letter-spacing: .06em; }
.big, .btn-ink, .tool, .title-btns .tool { font-family: "Bagel Fat One", "Jua", cursive; letter-spacing: .03em; }
.big.start { font-size: 38px; }
.title-btns .tool { font-size: 26px; }
.tool .e { font-family: var(--f-emoji); }


/* ===== 두근 하트 감지기: 편지 조각에 가까울수록 하트가 아래부터 차오른다 ===== */
#detector { gap: 10px; padding: 6px 18px 6px 8px; }
#detector .bars, #detector .dicon { display: none; }
#detector .dheart { position: relative; width: 44px; height: 42px; flex: none; animation: detBeat var(--beat, 1.4s) ease-in-out infinite; filter: drop-shadow(0 0 var(--hglow, 0px) rgba(255, 120, 170, .9)); }
#detector .dheart svg { width: 100%; height: 100%; display: block; overflow: visible; }
#detector .hb { fill: #fff3f7; }
#detector .hf, #detector .hw { fill: var(--hcol, #ff7fab); transition: fill .3s; }
#detector .hl { fill: none; stroke: #fff; stroke-width: 2; }
#detector .hs { fill: none; stroke: rgba(255, 255, 255, .85); stroke-width: 1.6; stroke-linecap: round; }
#detector .dtext { display: grid; text-align: left; line-height: 1.15; }
#detector b { font-family: var(--f-display); font-size: 20px; color: var(--det, #ffd0df); min-width: 5em; }
#detector small { font-size: 12px; color: #ffd0df; }
#detector[data-lv="0"] { --det: #ffd0df; --hcol: #ffb3cc; }
#detector[data-lv="1"] { --det: #ffc2d8; --hcol: #ff9cc0; }
#detector[data-lv="2"] { --det: #ffa8c8; --hcol: #ff7fab; --hglow: 4px; --detGlow: rgba(255, 127, 171, .3); }
#detector[data-lv="3"] { --det: #ff8fb8; --hcol: #ff5c95; --hglow: 7px; --detGlow: rgba(255, 92, 149, .45); }
#detector[data-lv="4"] { --det: #fff; --hcol: #ff3d7f; --hglow: 11px; --detGlow: rgba(255, 61, 127, .6); }
#detector[data-lv="4"] b { text-shadow: 0 0 10px #ff5c95; }
.still #detector .dheart { animation: none; }

/* 화면 확대 알림·되돌리기 단추 */
#zoomChip { position: fixed; z-index: 70; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 10px 18px; border-radius: 999px;
  border: 3px solid #fff; background: linear-gradient(180deg, var(--straw-hi), var(--straw)); color: #fff; font-family: var(--f-display); font-size: 17px; box-shadow: 0 4px 0 var(--choco), 0 8px 18px rgba(120, 30, 60, .35); cursor: pointer; }
input, textarea, select { font-size: max(16px, 1em); }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
