/* 이비터짐 놀이터 공용 키트 — 앱(app-skin.css)과 같은 그림 9-slice 버튼·패널·리본. CSS 기본 모양(흰 카드·단색 버튼) 금지. */
@font-face { font-family: 'Jua'; src: url('/assets/jua.woff2') format('woff2'); font-display: swap; }
:root {
  --brown: #5b3416; --pink: #ff5d8f; --pink-ink: #b8245b; --cream: #fff8ec; --muted: #8a6a4e; --teal-ink: #0b6c63; --bad-ink: #c0262d;
  --veil: rgba(255, 248, 236, .18); --floor: drop-shadow(0 10px 12px rgba(80, 40, 10, .25));
  --outline: 0 2px 0 #fff, 2px 0 0 #fff, -2px 0 0 #fff, 0 -2px 0 #fff, 1.5px 1.5px 0 #fff, -1.5px 1.5px 0 #fff, 1.5px -1.5px 0 #fff, -1.5px -1.5px 0 #fff, 0 4px 6px rgba(90, 50, 20, .35);
  --bg-img: url('/play/bg/sea.webp'); --bg-base: #9fdcf5;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --veil: rgba(20, 12, 50, .28); --bg-base: #1a1240; } }
:root[data-theme="dark"] { --veil: rgba(20, 12, 50, .28); --bg-base: #1a1240; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { min-height: 100dvh; background: var(--bg-base) var(--bg-img) center top / cover no-repeat fixed; font-family: 'Jua', 'Apple SD Gothic Neo', system-ui, sans-serif; color: var(--brown); display: flex; justify-content: center; }
body::before { content: ""; position: fixed; inset: 0; background: var(--veil); pointer-events: none; }
.k-wrap { position: relative; width: 100%; max-width: 440px; padding: calc(12px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.k-scr { display: none; flex-direction: column; gap: 14px; animation: kIn .35s cubic-bezier(.3,1.4,.5,1); }
.k-scr.on { display: flex; }
@keyframes kIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }

/* 리본 제목 */
.k-ribbon { position: relative; width: 100%; aspect-ratio: 820 / 180; background: url('/play/ui/ribbon.webp') center / contain no-repeat; display: flex; align-items: center; justify-content: center; padding: 0 20% 7px; filter: var(--floor); text-align: center; font-size: clamp(19px, 5.6vw, 25px); line-height: 1.1; color: var(--brown); }
.k-title { text-align: center; font-size: clamp(28px, 8.4vw, 38px); line-height: 1.15; color: #fff; text-shadow: 0 3px 0 var(--pink-ink), 0 -2px 0 var(--pink-ink), 2px 0 0 var(--pink-ink), -2px 0 0 var(--pink-ink), 2px 2px 0 var(--pink-ink), -2px 2px 0 var(--pink-ink), 0 8px 14px rgba(90, 30, 50, .4); margin: 4px 0 0; }
.k-title em { font-style: normal; color: #ffe066; }
.k-out { text-shadow: var(--outline); }

/* 9-slice 공통 */
.k-panel, .k-btn, .k-opt, .k-choice, .k-bubble { position: relative; isolation: isolate; }
.k-panel::before, .k-btn::before, .k-opt::before, .k-choice::before, .k-bubble::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-style: solid; border-color: transparent; filter: var(--floor); }
.k-panel { padding: 18px 20px 20px; font-size: 18px; line-height: 1.5; }
.k-panel::before { border-width: 26px; border-image: url('/play/ui/panel-cream.webp') 55 fill stretch; }
.k-btn { appearance: none; border: 0; background: none; font: inherit; color: #fff; font-size: 22px; padding: 16px 18px 22px; min-height: 66px; width: 100%; cursor: pointer; text-shadow: 0 2px 0 rgba(40, 90, 10, .55); transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.k-btn::before { border-width: 24px 30px 26px; border-image: url('/play/ui/btn-green.webp') 80 95 95 95 fill stretch; }
.k-btn.pink { text-shadow: 0 2px 0 rgba(140, 20, 60, .55); }
.k-btn.pink::before { border-image-source: url('/play/ui/btn-pink.webp'); }
.k-btn.cream { color: var(--brown); text-shadow: none; font-size: 18px; min-height: 56px; padding: 12px 16px 18px; }
.k-btn.cream::before { border-image: url('/play/ui/btn-cream.webp') 75 90 90 90 fill stretch; border-width: 20px 26px 24px; }
.k-btn:active { transform: translateY(4px) scale(.98); }
.k-opt { appearance: none; border: 0; background: none; font: inherit; color: var(--brown); font-size: 21px; padding: 18px 18px 22px; min-height: 66px; width: 100%; cursor: pointer; text-align: center; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.k-opt::before { border-width: 18px 18px 20px; border-image: url('/play/ui/tile-cream.webp') 50 50 55 50 fill stretch; }
.k-opt:active { transform: scale(.97); }
.k-opt.ok { color: var(--teal-ink); }
.k-opt.ok::before { filter: drop-shadow(0 0 0 #fff) hue-rotate(70deg) saturate(1.6) drop-shadow(0 8px 10px rgba(16, 120, 100, .35)); }
.k-opt.no { color: var(--bad-ink); animation: kShake .35s; }
.k-opt.no::before { filter: hue-rotate(-30deg) saturate(2.2) drop-shadow(0 8px 10px rgba(190, 40, 40, .35)); }
@keyframes kShake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.k-choice { appearance: none; border: 0; background: none; font: inherit; color: var(--brown); font-size: 18px; line-height: 1.35; text-align: left; padding: 18px 50px 20px 70px; min-height: 72px; width: 100%; cursor: pointer; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.k-choice::before { border-width: 30px 34px 30px 62px; border-image: url('/play/ui/choice-pink.webp') 82 90 82 165 fill stretch; }
.k-choice:nth-child(2)::before { border-image-source: url('/play/ui/choice-blue.webp'); }
.k-choice:nth-child(3)::before { border-image-source: url('/play/ui/choice-yellow.webp'); }
.k-choice:nth-child(4)::before { border-image-source: url('/play/ui/choice-pink.webp'); }
.k-choice b { position: absolute; left: 22px; top: 50%; transform: translateY(-50%); width: 32px; text-align: center; color: var(--pink-ink); font-size: 22px; }
.k-choice:active { transform: scale(.97); }
.k-bubble { padding: 14px 18px 16px 30px; font-size: 18px; line-height: 1.45; }
.k-bubble::before { border-width: 18px 22px 18px 34px; border-image: url('/play/ui/bubble-l.webp') 60 60 60 95 fill stretch; }

/* 캐릭터·하트·바 */
.k-char { width: 140px; height: 140px; object-fit: contain; filter: var(--floor); animation: kBob 2s ease-in-out infinite; }
@keyframes kBob { 50% { transform: translateY(-6px); } }
.k-hearts { display: flex; gap: 4px; }
.k-hearts i { width: 30px; height: 28px; background: url('/play/ui/heart.webp') center / contain no-repeat; }
.k-hearts i.off { background-image: url('/play/ui/heart-gray.webp'); }
.k-bar { position: relative; height: 22px; background: url('/play/ui/bar-track.webp') center / 100% 100% no-repeat; }
.k-bar i { position: absolute; left: 3%; top: 14%; bottom: 22%; width: 94%; background: url('/play/ui/bar-fill.webp') left center / 100% 100% no-repeat; transform-origin: left; transition: transform .25s linear; }
.k-speaker { width: 96px; height: 92px; margin: 0 auto; border: 0; background: url('/play/ui/btn-speaker.webp') center / contain no-repeat; filter: var(--floor); cursor: pointer; transition: transform .12s cubic-bezier(.3,1.6,.5,1); }
.k-speaker:active { transform: scale(.92); }
.k-row { display: flex; gap: 10px; align-items: center; }
.k-center { text-align: center; }
.k-small { font-size: 15px; color: var(--muted); }
.k-hide { display: none !important; }
.k-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.k-tags span { font-size: 15px; padding: 5px 11px 6px; border-radius: 999px; background: #ffe7ef; color: var(--pink-ink); border: 2px solid #fff; box-shadow: 0 3px 0 #f3b8cb; transform: rotate(var(--r, -2deg)); }
.k-tags span:nth-child(2n) { --r: 2deg; background: #e6f6ff; color: #1e5f8f; box-shadow: 0 3px 0 #a9d3ef; }
.k-tags span:nth-child(3n) { --r: -1deg; background: #fff3c4; color: #7a5600; box-shadow: 0 3px 0 #e8cf74; }
.k-toast { position: fixed; left: 50%; bottom: calc(30px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); background: var(--brown); color: var(--cream); padding: 10px 18px; border-radius: 30px; opacity: 0; transition: .25s; pointer-events: none; z-index: 20; font-size: 16px; }
.k-toast.on { opacity: 1; transform: translateX(-50%); }
.k-pop { position: fixed; inset: 0; z-index: 10; display: none; align-items: center; justify-content: center; padding: 20px; background: rgba(40, 20, 10, .45); }
.k-pop.on { display: flex; animation: kIn .25s; }
.k-burst { position: absolute; width: 120px; height: 110px; background: url('/play/ui/burst.webp') center / contain no-repeat; pointer-events: none; animation: kBurst .6s ease-out forwards; }
@keyframes kBurst { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.k-home { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; width: 42px; height: 42px; background: url('/play/ui/circle-close.webp') center / contain no-repeat; filter: var(--floor); z-index: 3; }
.k-reward { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.k-code { appearance: none; border: 2px dashed #e7a9bf; background: #fff6f9; color: var(--pink-ink); font: inherit; font-size: 20px; letter-spacing: .5px; border-radius: 14px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; max-width: 100%; word-break: break-all; }
.k-code i { font-style: normal; font-size: 14px; color: #fff; background: var(--pink); border-radius: 999px; padding: 2px 9px 3px; flex: none; }

/* 앱 안: 「앱 받기/구경하기」 버튼 숨김 */
.in-app .k-app-only-web, .in-app a[href^="/?from"], .in-app #app { display: none !important; }
