/* 봉인 항아리: 오래된 옹기와 손끝의 작은 봉인 놀이 */
:root{color-scheme:dark;--ink:#fff1dc;--sub:#cbb49c;--gold:#f6cf78;--bg:#211a19}
html,body{margin:0;background:var(--bg);color:var(--ink);overscroll-behavior:none}
body{font-family:"Apple SD Gothic Neo","Malgun Gothic",system-ui,sans-serif}
.stage{width:min(100%,480px);margin:auto;display:flex;flex-direction:column;padding:env(safe-area-inset-top,0px) 8px env(safe-area-inset-bottom,0px);background:radial-gradient(ellipse at 50% 25%,#40312b,var(--bg) 75%)}
.topbar{height:44px;display:flex;align-items:center;justify-content:space-between;padding:0 6px;flex-shrink:0}
.topbar a{font-size:14px;color:var(--ink);text-decoration:none;letter-spacing:1px}.topbar b{color:var(--gold)}
.settings{display:flex;gap:4px}.settings button,#pause{width:40px;height:40px;padding:8px;background:transparent;color:var(--sub);border:0;border-radius:10px}.settings svg{width:22px;height:22px}
button{min-height:46px;border:1px solid #866748;border-radius:14px;background:#463329;color:var(--ink);font-weight:700;padding:10px 16px;touch-action:manipulation;transition:transform .08s}
button:active{transform:scale(.97)}button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}button:disabled{opacity:.38;cursor:default}
.primary{background:var(--gold);color:#3b281e;border-color:#ffe0a0;box-shadow:0 4px 0 #956732;font-size:20px}
.screen{flex:1;min-height:0;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:13px;padding:16px 20px 28px}.screen>*{flex-shrink:0}.screen button{width:100%;max-width:300px}.screen h1{margin:0;font-size:38px;letter-spacing:-2px}.screen p{margin:0}.kicker{font-size:12px;color:var(--gold);letter-spacing:2px}.lede{font-size:14px;line-height:1.6;word-break:keep-all;color:var(--sub)}.best{font-size:13px;color:var(--sub)}.best b{color:var(--ink)}
.how{padding:0;list-style:none;text-align:left;color:var(--sub);font-size:13px;line-height:2;margin:10px 0 0}.how li::before{content:'✦';margin-right:8px;color:var(--gold)}
.start-art{width:250px;height:210px;position:relative;margin-bottom:8px}.start-art img{position:absolute;width:130px;left:0;top:0;z-index:1;filter:drop-shadow(0 6px 5px #0006)}.mini-jar{position:absolute;right:0;bottom:0;width:165px;height:160px;border:7px solid #9d754f;border-top:12px solid #c2996a;border-radius:16px 16px 60px 60px;background:radial-gradient(ellipse at 30% 20%,#9a704e,#4d3327 80%);box-shadow:inset -12px 0 20px #21151080,0 10px 30px #0005;overflow:hidden}.mini-jar i{position:absolute;border-radius:50%;width:68px;height:68px;background:#eec877;bottom:7px;left:3px;border:3px solid #fff4}.mini-jar i:nth-child(2){background:#ade4c4;left:65px;width:52px;height:52px;bottom:12px}.mini-jar i:nth-child(3){background:#eba6b0;left:46px;bottom:63px;width:46px;height:46px}.mini-jar span{position:absolute;right:3px;top:7px;background:#e4bd71;color:#8c352a;padding:5px;transform:rotate(9deg);font:20px serif}
#play{display:flex;flex-direction:column;flex:1;min-height:0;gap:4px}.hud{display:flex;align-items:center;gap:12px;height:44px;flex-shrink:0;padding:0 7px}.scores{flex:1;display:flex;align-items:baseline;gap:9px;min-width:0}.scores strong{font-size:26px;font-variant-numeric:tabular-nums}.scores small{font-size:10px;color:var(--sub);white-space:nowrap}.next{display:flex;align-items:center;gap:2px}.next small{font-size:10px;color:var(--sub)}#next{width:36px;height:36px}.board{flex:1;min-height:0;position:relative;display:flex;align-items:center;justify-content:center}#canvas{display:block;width:100%;height:100%;touch-action:none;user-select:none}
.talisman{background:#352720;border:1px solid #69503a;border-radius:17px;padding:8px;flex-shrink:0;margin:0 4px}.gauge{display:flex;align-items:center;gap:8px;font-size:10px;margin:0 3px 7px}.gauge label{color:var(--gold);white-space:nowrap}.gauge span{min-width:51px;text-align:right;font-variant-numeric:tabular-nums}progress{flex:1;min-width:0;height:7px;accent-color:var(--gold);border:0;border-radius:8px;overflow:hidden}progress::-webkit-progress-bar{background:#201814}progress::-webkit-progress-value{background:linear-gradient(90deg,#ae713b,var(--gold))}.skills{display:flex;gap:6px}.skills button{flex:1;padding:4px;font-size:12px;min-height:44px;display:flex;justify-content:center;align-items:center;gap:5px}.skills button{min-width:0}.skills span{font-size:24px;color:var(--gold);line-height:1;min-width:0;overflow:hidden;text-overflow:ellipsis}html:not([lang="ko"]) .skills span{font-size:15px;white-space:nowrap}html:not([lang="ko"]) .skills img{width:26px;height:26px}.skills button.selected{outline:2px solid #ffa4a4;background:#6b4135}.talisman.ready{border-color:var(--gold);box-shadow:0 0 14px #f6cf7844}.ready .skills button{animation:glow 1.2s ease-in-out infinite alternate}@keyframes glow{to{box-shadow:inset 0 0 16px #f6cf7830,0 0 5px #f6cf7860}}
#hint{margin:0;height:22px;text-align:center;font-size:11px;color:var(--sub);flex-shrink:0;line-height:22px}#banner,#chain{position:absolute;left:50%;top:45%;transform:translate(-50%,-50%);margin:0;max-width:96%;width:max-content;padding:13px 20px;border:1px solid #f3cd78;border-radius:14px;background:#2d211cf0;color:var(--gold);font-size:21px;font-weight:700;text-align:center;pointer-events:none;text-shadow:0 2px #0008;z-index:2}#chain{top:24%;border:0;background:transparent;font-size:32px;color:#fff2c5;padding:0;text-shadow:0 3px 0 #3c1e18,0 0 14px #f5c970}
.overlay{position:absolute;inset:44px 0 0;background:#150f0de0;z-index:4;display:grid;place-items:center;padding:20px}.panel{width:100%;max-width:300px;display:flex;flex-direction:column;gap:16px;text-align:center;background:#3a2a22;border:1px solid #8d6b46;border-radius:24px;padding:28px}.panel h2{margin:0;font-size:27px}#result h1{font-size:26px;letter-spacing:-1px}#result-score{font-size:48px;color:var(--gold)}#new-best{color:#ffe7a5;font-weight:700}#result-yokai{width:100px;height:100px}#result-stage{font-size:14px}#result-seals{color:var(--sub);font-size:14px}#title{color:var(--gold);font-size:18px;margin-bottom:8px}
@media(max-height:700px){.screen{gap:9px;padding:10px 18px 18px}.start-art{height:170px;width:220px;margin-bottom:0}.start-art img{width:110px}.mini-jar{width:145px;height:140px}.screen h1{font-size:34px}.topbar{height:40px}.hud{height:40px}.scores strong{font-size:23px}.talisman{padding:6px}.gauge{margin-bottom:5px}#result-yokai{width:84px;height:84px}#result-score{font-size:40px}}
@media(prefers-reduced-motion:reduce){.ready .skills button{animation:none}}

/* 플레이는 기록·설정까지 한 줄로 모아 작은 폰의 항아리 높이를 확보한다. */
.stage.playing .topbar{display:none}.hud{gap:6px;padding:0 4px}.hud .settings{gap:0}.hud .settings button,#pause{width:30px;min-height:36px;height:36px;padding:5px}.hud .settings svg{width:20px;height:20px}.scores{gap:5px}.scores small{font-size:9px}

/* 도감과 강화 가게는 작은 화면에서도 세로로 넘겨 본다. */
.menu-row{display:flex;gap:8px;width:100%;max-width:300px}.menu-row button{flex:1;padding:8px}
.meta-screen{justify-content:flex-start;padding:18px 12px 24px;gap:12px}.meta-screen h1{font-size:28px;letter-spacing:-1px}
.shopkeeper{display:flex;align-items:center;gap:12px;width:100%}.shopkeeper img{width:84px;height:84px;object-fit:contain}.shopkeeper p{position:relative;flex:1;background:#f3d7a8;color:#4c3021;border-radius:16px;padding:16px 10px;font-size:14px}
#shop-list{width:100%;display:grid;gap:12px}.upgrade-row{background:#3c2c24;border:1px solid #79583e;border-radius:16px;padding:14px;text-align:left;display:grid;grid-template-columns:1fr auto;gap:7px 8px}.upgrade-row h2{margin:0;font-size:18px;grid-column:1/-1}.upgrade-row p{grid-column:1/-1;margin:0;color:var(--sub);font-size:12px}.upgrade-row .upgrade-effect{color:var(--gold);font-size:14px}.upgrade-marks{font-size:15px;letter-spacing:1px;color:var(--gold);align-self:center}.upgrade-row button{width:auto;font-size:13px;padding:8px 12px}.bought{animation:celebrate .6s ease-out}@keyframes celebrate{50%{box-shadow:0 0 22px #ffd88180;border-color:#ffe3a0}}
#dex-grid{width:100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}.dex-cell{display:flex;flex-direction:column;align-items:center;gap:5px;padding:9px 5px;min-width:0;max-width:none!important}.dex-cell b{font-size:12px}.dex-cell small{font-size:10px;font-weight:400;color:var(--sub);line-height:1.4;word-break:keep-all}.yokai-art{display:inline-flex;width:65px;height:65px;align-items:center;justify-content:center;flex-shrink:0}.yokai-art img{width:100%;height:100%;object-fit:contain}.yokai-art.unknown{filter:brightness(0)}.color-art{border-radius:50%;background:var(--yokai-color);color:#7b3a24;font-size:26px;box-shadow:inset 0 0 0 3px #fff4}
#dex-records{line-height:1.7;word-break:keep-all}#dex-detail{width:min(280px,calc(100% - 56px));border:1px solid #ba8b58;border-radius:22px;background:#3b2c24;color:var(--ink);text-align:center;padding:18px}#dex-detail::backdrop{background:#100b08cc}#detail-close{display:block;margin-left:auto;min-height:38px;padding:6px 12px}#detail-art .yokai-art{width:180px;height:180px}#detail-name{font-size:23px}#detail-desc{font-size:14px;color:var(--sub);line-height:1.6}#detail-toggle{width:100%}
#result{justify-content:flex-start;gap:9px;padding:18px 12px 24px}#result-base{color:var(--sub)}#result-coins{font-size:13px;color:var(--gold);line-height:1.6;word-break:keep-all}#result-new{font-size:12px;color:var(--sub);width:100%}#result-new p{margin-bottom:5px}.new-yokai{display:inline-flex;align-items:center;gap:3px;margin:3px 5px}.new-yokai .yokai-art{width:30px;height:30px}#next-games{width:100%;text-align:left}#boost{color:var(--gold)}
@media(prefers-reduced-motion:reduce){.bought{animation:none;border-color:var(--gold)}}

/* 오늘 기록과 순위는 작은 화면에서도 줄을 바꿔 읽는다. */
.daily-info{font-size:12px;color:var(--sub);line-height:1.6;word-break:keep-all}#daily-tag{color:var(--gold)}#begin{min-height:56px}#start .start-art{height:190px;margin-bottom:0}

/* 그림 위에서도 글자는 같은 따뜻한 밤색 대비를 유지한다. */
#start{background:linear-gradient(#211a1926,#211a1966),url('art/bg-start.webp') center/cover no-repeat;border-radius:22px}
.board{background:linear-gradient(#211a1926,#211a1959),url('art/bg-play.webp') center/cover no-repeat;border-radius:18px;overflow:hidden}
.skills img{width:32px;height:32px;object-fit:contain;flex-shrink:0}
.gauge label{display:flex;align-items:center;gap:3px}.gauge img{width:24px;height:28px;object-fit:contain}
#purse::before,#result-coins::before,.upgrade-row button::before{content:'';display:inline-block;width:23px;height:23px;background:url('art/prop-coin.webp') center/contain no-repeat;vertical-align:middle;margin-right:4px}
.share-image{display:block;width:100%;max-width:300px;height:auto;border-radius:18px}
#share-toast{position:fixed;bottom:calc(env(safe-area-inset-bottom,0px) + 24px);left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 32px);box-sizing:border-box;z-index:10;margin:0;padding:12px 16px;border-radius:14px;background:#150f0df2;color:#fff1dc;font-size:13px;text-align:center;pointer-events:none}
@media(prefers-reduced-motion:reduce){button{transition:none}button:active{transform:none}}

.share-image{-webkit-touch-callout:default;-webkit-user-select:auto;user-select:auto;touch-action:pan-y}
/* 점수가 커져도 한 줄을 지킨다. 좁으면 '최고'가 먼저 줄어든다. */
.scores strong{white-space:nowrap;flex-shrink:0}.scores small{min-width:0;overflow:hidden;text-overflow:ellipsis}#daily-tag,#boost{flex-shrink:0}
@media(max-width:380px){.scores strong{font-size:22px}}
/* 시작 화면 작은 항아리에는 진짜 요괴를 담는다. */
.mini-jar i{border:0;border-radius:0;background:center/contain no-repeat url(art/kkebi-idle.webp)}.mini-jar i:nth-child(2){background:center/contain no-repeat url(art/egg-idle.webp)}.mini-jar i:nth-child(3){background:center/contain no-repeat url(art/wisp-idle.webp)}

/* 한 화면 기록 카드: 기록과 발견은 짧은 줄, 행동은 두 칸에 모은다. */
#result.result-card{justify-content:center;gap:5px;padding:12px 14px;max-width:360px;width:100%;align-self:center;background:#3a2a22;border:1px solid #8d6b46;border-radius:22px;margin:8px 0;flex:0 1 auto}
#result.result-card h1{font-size:22px}#result.result-card #result-score{font-size:46px;line-height:1.1}#result.result-card #result-yokai{width:130px;height:130px}#result.result-card #title{font-size:14px;margin:0}
#result.result-card #result-new{font-size:10px;line-height:1.3}#result.result-card #result-new p{display:inline;margin:0 4px 0 0}.result-card .new-yokai{margin:1px 3px}.result-card .new-yokai .yokai-art{display:none}
#result.result-card #result-coins{line-height:1.3;font-size:12px}.result-actions{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:7px}.result-actions #retry{grid-column:1;grid-row:1}.result-actions #share-card{grid-column:2;grid-row:1}.result-actions #home{grid-column:1 / -1;font-size:12px;min-height:32px;padding:3px}.result-actions button{padding:6px;min-height:42px;font-size:14px}
#result .orak-next-title{font-size:12px;margin:5px 0}#result .orak-next-sub{display:none}#result .orak-next-card{padding:7px;min-height:44px}#result .orak-next-icon,#result .orak-next-icon img{width:34px;height:34px}
#result .orak-next{margin-top:4px;gap:3px}#result .orak-next-icon{flex-basis:34px}

/* 시작 로고는 원화 비율을 유지한다. */
.game-logo{display:block;width:min(90vw,400px);max-width:100%;height:auto;margin:0 auto;filter:drop-shadow(0 4px 7px #0008)}
h1:has(>.game-logo){width:100%;margin:0;line-height:0}.hero-title:has(.game-logo){width:100%}.hero-title:has(.game-logo) .lede{font-size:13px}

/* 원화는 밝게 두고 글자 주변만 어둡게 받친다. */
#start{gap:8px;padding:12px 8px 16px;overflow:hidden}#start .start-art{height:170px;width:250px}#start .lede,#start .best,#start .how,#start .daily-info{color:#fff1dc;text-shadow:0 1px 4px #000,0 0 8px #000}#start .how{margin:0;font-size:12px;line-height:1.65;background:#211a1977;padding:4px 10px;border-radius:12px}#start .mini-jar i{background:transparent;border:0;border-radius:0;background-size:contain;background-repeat:no-repeat;background-position:center}
@media(max-height:740px){#start{gap:5px}#start .start-art{height:130px}#start .start-art>img{width:105px}#start .mini-jar{height:115px;width:140px}#start .game-logo{width:76vw}#start button{min-height:40px;padding:6px}#start #begin{min-height:46px}#start .kicker{display:none}}

/* Daily orders occupy their own band above the aiming canvas. */
#orders-card{width:100%;max-width:300px;text-align:left;border:1px solid #aa8658;background:#211a19dc;border-radius:12px;padding:6px 12px;font-size:12px;line-height:1.5}#orders-card b{color:var(--gold)}#orders-list{list-style:none;margin:2px 0 0;padding:0}
#orders-hud{display:flex;gap:4px;padding:3px 4px;flex-shrink:0;min-height:38px;align-items:stretch}.order-chip{flex:1;min-width:0;border:1px solid #987245;border-radius:9px;background:#34251f;padding:4px;font-size:10px;text-align:center;display:flex;align-items:center;justify-content:center;word-break:keep-all}.order-chip.done{border-color:#e7b76d;color:#ffe1a2;background:#59402c}
#result-score{width:100%;font-size:inherit}#result .osc-breakdown{box-sizing:border-box}#result.result-card #result-yokai{width:64px;height:64px}#result.result-card{gap:4px;padding:10px 12px;margin:3px 0}#result #new-best{display:none}#result .kicker{display:none}#result .best{font-size:11px}#result .osc-label{overflow-wrap:normal;word-break:normal}#result .osc-compact .osc-row{padding:0}#result .osc-compact .osc-label{font-size:12px}#result .osc-compact .osc-value{font-size:14px}#result .osc-compact .osc-total{padding:3px 0 0;margin-top:3px}#result .osc-compact .osc-number{font-size:28px}.result-actions #home{grid-column:2;grid-row:2;min-height:44px}.result-actions button{min-height:44px}.settings button,#pause,.hud .settings button,.hud #pause{width:44px;min-width:44px;height:44px;min-height:44px;padding:8px}.hud{height:44px}.hud .scores{gap:3px}.hud .scores small:last-child{display:none}#detail-close{min-height:44px}#start button{min-height:44px}#start .menu-row{gap:5px}#start .menu-row button{padding:6px;font-size:13px}#start .start-art{height:110px}#start .start-art>img{width:95px}#start .mini-jar{height:100px;width:130px}#start .game-logo{width:240px}#start .how{font-size:11px;line-height:1.5}#start{gap:5px}.osc-book .osc-label,.osc-book .osc-sub{overflow-wrap:normal;word-break:normal}
@media(max-height:740px){#start .start-art{height:72px}#start .start-art>img{width:70px}#start .mini-jar{height:64px;width:100px}#start .game-logo{width:210px}#start .kicker{display:none}#start{padding:6px 8px;gap:4px}#result.result-card #result-yokai{width:44px;height:44px}#result.result-card{gap:3px}#result.result-card h1{font-size:19px}#result .orak-next-title{margin:2px 0}#result .daily-info{font-size:10px;line-height:1.3}}

@media(max-height:740px){#result.result-card{gap:2px;padding:8px 12px}#result.result-card>.best{display:none}#result.result-card #result-yokai{width:36px;height:36px}#result.result-card #title{font-size:12px}#result #result-new{font-size:9px}#result .osc-breakdown.osc-compact{padding:7px 12px}}

#result.result-card>.best{display:none}.result-spirit{width:100%;display:grid;grid-template-columns:56px 1fr;column-gap:8px;align-items:center;text-align:left}.result-spirit canvas{grid-column:1;grid-row:1/4;justify-self:center}.result-spirit p{grid-column:2}#result.result-card .result-spirit #result-yokai{width:48px;height:48px}#result .result-spirit #result-stage,#result .result-spirit #result-seals,#result .result-spirit #title{font-size:12px;line-height:1.3;margin:0}#result .orak-ad-slot{margin:2px 0}#result .orak-ad-btn{min-height:44px;padding:5px 8px;font-size:12px}.osc-book .osc-record-value,.osc-book .osc-title{overflow-wrap:normal;word-break:normal}.osc-book .osc-record-value{font-size:clamp(16px,5.5vw,25px)}

#result.result-card #result-score{font-size:14px;line-height:1.35}#result .osc-delta{font-size:12px}
/* 좁은 화면에서 '흔들기'가 '흔들/기'로 끊기지 않게 */
.skills span{white-space:nowrap;word-break:keep-all}
html[lang="ko"] .skills span{font-size:clamp(15px,5vw,22px)}
@media(max-width:400px){html:not([lang="ko"]) .skills img{width:22px;height:22px}html:not([lang="ko"]) .skills span{font-size:13px}.skills button{gap:3px;padding:4px 3px}}

/* Weekly help floats above the card without moving the start actions. */
.week-card{position:relative;width:100%;max-width:300px}#start #week-chip{min-height:44px;padding:4px 8px;font-size:12px;border-radius:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-break:keep-all;color:var(--gold)}
#week-help{position:absolute;z-index:3;left:0;right:0;bottom:48px;background:#211a19;border:1px solid #aa8658;border-radius:12px;padding:12px;font-size:12px;word-break:keep-all;box-shadow:0 4px 18px #0009}
#rule-badge{flex-shrink:0;align-self:flex-start;max-width:100%;box-sizing:border-box;padding:1px 8px;border:1px solid #aa8658;border-radius:8px;font-size:10px;line-height:16px;color:var(--gold);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;word-break:keep-all}
#result-rule{font-size:11px;line-height:16px;color:var(--gold);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;word-break:keep-all}
@media(max-height:800px){#result-rule{display:none}}

/* 공통 단추(46px)가 들어가도록 위쪽 줄을 키운다 */
.topbar,.hud{height:56px}
.settings,.hud .settings{gap:8px;align-items:center}
#start.fs1{gap:3px}#start.fs1 .how{line-height:1.35;padding:3px 10px}#start.fs1 .kicker{display:none}
#start.fs2 .how li:nth-child(n+3){display:none}#start.fs2 .start-art{height:60px}
#start.fs3 .how{display:none}
#start.fs4 .start-art{display:none}
#result.rf1 .result-spirit{gap:2px}#result.rf1 #result-yokai{width:36px;height:36px}#result.rf1 #result-seals,#result.rf1 #title{font-size:11px;margin:0}#result.rf1 #result-coins{margin:0;font-size:12px}
#result.rf2 #next-games{display:none}
