/* 냥도사 성 키우기: 세로 한 화면, 강화 목록만 스크롤한다. */
:root{--ink:#f6edd8;--orak-next-bg:#433329;--orak-next-ink:#fff1d8;--orak-next-sub:#dac7aa}
*{box-sizing:border-box}html,body{height:100%;overflow:hidden;overscroll-behavior:none}
body{margin:0;background:#151312;color:#f6edd8;font-family:"Apple SD Gothic Neo","Noto Sans KR","Malgun Gothic",system-ui,sans-serif}[hidden]{display:none!important}
#stage{height:var(--orak-h,100dvh);max-width:540px;margin:auto;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;background:#211a19;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)}
header{display:flex;align-items:center;padding:8px 12px;font-size:11px;gap:8px}header a{color:#f6edd8;text-decoration:none;font-size:14px}header b{color:#efbd70}header span{flex:1}header button{font-size:10px;padding:4px;min-height:32px;border-color:#594735}
.hud{display:flex;justify-content:space-between;gap:8px;padding:9px 14px;font-size:12px;border-block:1px solid #514036;background:#2b251d}.hud strong{color:#f0cb84}
.board{min-height:0;position:relative;overflow:hidden;background:#28352f}canvas{width:100%;height:100%;display:block;touch-action:none}
button,select{font:inherit;color:inherit;background:#47392e;border:1px solid #82664a;border-radius:10px;min-height:44px;padding:9px 10px;touch-action:manipulation}button{cursor:pointer}button:disabled{opacity:.4;cursor:default}button:focus-visible,select:focus-visible{outline:2px solid #ffe49e;outline-offset:2px}.primary{background:#e5b268;color:#302219;font-weight:800;box-shadow:0 4px 0 #80582f}
footer{padding:9px 12px 4px;background:#211a19}.skills,#ready{display:grid;grid-template-columns:1fr 1fr 52px;gap:8px}#ready{grid-template-columns:1fr 1fr}#ready:has(#farm[hidden]){grid-template-columns:1fr}
#hint{font-size:11px;text-align:center;color:#cfbea6;margin:7px 0}.play-options{display:flex;align-items:center;gap:7px;margin-top:8px}.play-options button{font-size:11px;min-height:32px;padding:5px 8px}#pause{margin-left:auto}#auto[aria-pressed="true"]{border-color:#e5b268;color:#ffe5ad}#upgrade-badge{font-size:10px;border-radius:20px;padding:4px 7px;background:#8b632d;color:#fff1c3}
.home{position:absolute;inset:0;pointer-events:none;text-align:center}.home-title{position:absolute;top:3%;width:100%;padding:12px 16px;background:linear-gradient(transparent,#18251ed9 25%,#18251ed9 80%,transparent)}.eyebrow{font-size:11px;color:#e2be78;letter-spacing:.08em}.home h1{font-size:clamp(28px,8vw,40px);line-height:1.12;margin:10px 0;text-shadow:0 3px 0 #1b241c,0 0 16px #101710}.home-title p{position:relative;font-size:12px;color:#e1d3b8;margin:10px 0}.speech{background:#fff1cf;color:#493528;border:2px solid #b89a69;border-radius:16px;padding:10px 14px;font-size:12px;line-height:1.4;box-shadow:0 3px 0 #0002}.home>.speech{position:absolute;left:50%;top:67%;width:max-content;max-width:90%;transform:translateX(-50%);margin:0}.home-actions{position:absolute;bottom:3%;width:100%;padding:0 24px;pointer-events:auto;display:grid;gap:12px}.home-actions>.primary{font-size:18px;min-height:54px}.home-actions>div{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.overlay{position:absolute;inset:0;background:#111b;display:grid;place-items:center;padding:16px;z-index:5}.panel{background:#2e2621;border:1px solid #82664a;border-radius:18px;padding:22px;text-align:center;width:min(100%,340px);max-height:100%;overflow-y:auto;overscroll-behavior:contain}.panel h1{font-size:24px;margin:12px 0}.panel p{font-size:12px;line-height:1.65;color:#dac7aa}.panel button{width:100%;margin-top:10px}.rice-count{display:block;font-size:30px;color:#ffe09a;margin:14px 0}.boss-result{border:2px solid #f6ce7f;box-shadow:0 0 40px #edb26844}.boss-result h1{font-size:30px}.boss-result .rice-count{font-size:40px}
#shop{position:absolute;inset:0;background:#29221df5;padding:14px;display:flex;flex-direction:column;min-width:0;overflow:hidden;z-index:2}#shop h1{font-size:20px;margin:0 0 6px}#summary,#notice{font-size:12px;color:#dac7aa;line-height:1.6;margin:6px 0}nav{display:flex;gap:8px;background:#29221d;padding:10px 0;flex-shrink:0}nav button{flex:1}nav button[aria-selected="true"]{background:#b48247;color:#fff}
#items{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;flex:1;align-content:start;padding:3px}
.item{display:flex;flex-direction:column;gap:8px;min-width:0;padding:10px;background:#3b2f26;border:1px solid #584636;border-radius:14px}.item>div{min-width:0}.item strong{display:block;font-size:13px;margin-top:6px}.item small{display:block;color:#d6c1a3;font-size:11px;margin-top:4px;line-height:1.5;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;word-break:keep-all}.item button{font-size:12px;width:100%;margin-top:auto}.item-picture{height:96px;display:grid;place-items:center;position:relative;background:#211a1966;border-radius:10px;overflow:hidden}.item-picture img{width:90%;height:90%;object-fit:contain}.hero-portrait{display:block;width:64px;height:64px;flex-shrink:0;background-repeat:no-repeat;background-size:165% auto;background-position:50% 45%;border-radius:50%;background-color:#5c4936}.item-picture .hero-portrait{width:90px;height:90px}.locked .hero-portrait{filter:grayscale(1);opacity:.55}.lock-badge{position:absolute;right:6px;bottom:5px;background:#211a19;border-radius:50%;padding:4px}#finish{width:100%;margin:8px 0 0;flex-shrink:0}

.tutorial{position:absolute;inset:0;pointer-events:none;z-index:3}.tutorial .speech{position:absolute;top:17%;left:50%;transform:translateX(-50%);max-width:92%;width:max-content}#finger{position:absolute;left:60%;top:62%;font-size:36px;text-shadow:0 2px 5px #000;animation:drag 1.8s ease-in-out infinite}#finger small{display:block;font-size:11px;color:#fff1cf}@keyframes drag{0%,100%{transform:translate(0,0);opacity:.4}25%{opacity:1}70%{transform:translate(-65px,-45px);opacity:1}}
.celebrate{position:absolute;inset:0;pointer-events:none;text-align:center;padding:35px 14px;background:linear-gradient(#191f23aa,transparent 45%);z-index:4}.celebrate h1{font-size:26px;line-height:1.3;color:#ffe6a1;text-shadow:0 3px 0 #271d19;margin:12px 0}
@media(prefers-reduced-motion:reduce){#finger{animation:none}*{scroll-behavior:auto!important}}
@media(max-height:600px){header{padding:4px 10px}.hud{padding:5px 12px}footer{padding:5px 12px}#hint{margin:3px}.home-title{top:2%}.home h1{font-size:24px}.home-actions{bottom:2%;gap:8px}.home-actions>.primary{min-height:44px;font-size:15px}.home>.speech{top:62%;font-size:11px}.home-title .eyebrow{display:none}}

.rice-grain{position:fixed;width:5px;height:10px;background:#fff3cc;border:1px solid #e9c77d;border-radius:60%;pointer-events:none;z-index:20;box-shadow:0 0 5px #ffe3a377}#session-note{white-space:pre-line}
.has-art::before{content:"";display:inline-block;width:20px;height:20px;margin-right:4px;vertical-align:middle;background:var(--icon) center/contain no-repeat}

.celebrate-actions{position:absolute;bottom:7%;left:24px;right:24px;display:grid;gap:12px;pointer-events:auto}.share-panel{padding:16px}.share-panel h1{font-size:20px;margin:0 0 12px}#share-image{display:block;width:100%;height:auto;border-radius:12px;touch-action:pan-y}.share-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}#share-panel{z-index:8}#loading{z-index:9}#session .panel{text-align:center}#next-games{text-align:left;margin-top:16px}

#session,#help-panel,#share-panel{position:fixed;inset:0}#help-panel a{color:#ffe09a}

.skills button,#farm{white-space:nowrap;font-size:12px;padding-left:6px;padding-right:6px}

/* 시작 로고는 원화 비율을 유지한다. */
.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}

.title-screen .hud,.title-screen footer{display:none}.title-screen header{padding:4px 10px;gap:6px}.title-screen header>span{display:none}.title-screen header button{font-size:10px;padding:5px;min-height:32px}.title-screen .home-title{left:3%;right:3%;top:3%}.title-screen .home-title .eyebrow{font-size:11px}.title-screen .home-actions{bottom:5%}

.title-screen .home-title{width:auto;padding:10px 0}
#stage.title-screen{grid-template-rows:auto minmax(0,1fr)}
/* 시작 화면 윗줄 글이 하늘 그림 위에서도 읽히게 */
.title-screen .home-title .eyebrow{display:inline-block;padding:3px 10px;border-radius:999px;background:#18251ecc;color:#f3d79a}

/* 망루 표시는 전장의 발 좌표와 같은 비율로 놓는다. */
#items.slots-view{display:flex;flex-direction:column;gap:12px}.slot-castle{position:relative;width:100%;flex-shrink:0;margin-top:12px}.slot-castle>img{display:block;width:100%;height:100%;object-fit:contain}.slot-marker{position:absolute;transform:translate(-50%,-70%);width:48px;height:48px;min-height:48px;padding:2px;border-radius:50%;border:2px solid #ffe09a;background:#302219e8;color:#ffe09a;font-size:28px;box-shadow:0 2px 8px #0008}.slot-marker .hero-portrait{width:40px;height:40px}.slot-marker[aria-expanded="true"]{outline:3px solid #fff}.slot-picker{display:flex;flex-wrap:wrap;gap:8px;padding:10px;background:#211a19;border-radius:14px}.slot-picker button{display:grid;justify-items:center;gap:4px;padding:5px;min-width:64px;font-size:12px}.slot-picker .hero-portrait{width:48px;height:48px}.slot-picker [aria-pressed="true"]{border-color:#ffe09a}.slot-hint{font-size:12px;line-height:1.6;margin:0;color:#dac7aa}

/* 긴 번역도 강화 설명과 재화 모으기 버튼에서 전부 읽을 수 있다. */
html:not([lang=ko]) .item small{display:block;overflow:visible;-webkit-line-clamp:unset;word-break:normal;overflow-wrap:anywhere}
html:not([lang=ko]) #farm{white-space:normal;overflow-wrap:anywhere}

/* 별점, 두목 러시와 기록장. */
header button,.title-screen header button,.play-options button{min-height:44px;min-width:44px}
.home-actions{gap:8px}.home-actions>div{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.home-actions button{word-break:normal;overflow-wrap:normal;hyphens:auto}
#rush{font-weight:700}#rush small{display:block;font-weight:400;font-size:11px;margin-top:3px}.home>.speech{top:auto;bottom:280px}
#result .panel{padding:14px}#result .panel h1{font-size:24px;margin:8px 0}#result .panel p{margin:6px 0}#result .rice-count{font-size:28px;margin:8px 0}
#result-stars{font-size:36px;line-height:1.2;letter-spacing:6px}.star{display:inline-block;color:#66584b}.star.earned{color:#ffd875;animation:castle-star .4s both;animation-delay:calc(var(--i)*.15s)}
@keyframes castle-star{from{opacity:0;transform:scale(.2) rotate(-18deg)}70%{transform:scale(1.2)}to{opacity:1;transform:scale(1)}}
#rush-panel{position:relative;padding:8px 12px;border:1px solid #82664a;border-radius:12px}#rush-panel>div{display:flex;justify-content:space-between;gap:12px;font-size:12px;margin:5px 0}.rush-total{display:block;font-size:30px;color:#ffd875;margin-top:8px}#rush-panel .osc-seal{opacity:1;transform:rotate(-8deg);position:static;display:inline-block;animation:none;font-size:13px}
#book-panel{position:absolute;inset:0;z-index:7;background:#2e2621;overflow:hidden;--osc-ink:#f6edd8;--osc-bg:#2e2621}#book-panel .osc-book{height:100%;max-height:100%;color:#f6edd8}#book-panel button{min-height:44px;min-width:44px}#book-panel .osc-label{word-break:normal;overflow-wrap:normal}
html:not([lang=ko]) .item small,html:not([lang=ko]) #farm{word-break:normal;overflow-wrap:normal;hyphens:auto}
@media(prefers-reduced-motion:reduce){.star.earned{animation:none}}
@media(max-height:760px){.title-screen .home-title{top:0}.title-screen .game-logo{width:270px}.title-screen .home-title .eyebrow{font-size:10px}.home-actions{padding:0 18px}.home>.speech{bottom:275px;font-size:11px}#result .panel button{margin-top:7px}}

#book-panel :is(.osc-title,.osc-sub,.osc-record-value){word-break:normal;overflow-wrap:normal;hyphens:auto}
#home-record{text-wrap:balance}

/* Round 2: banners stay inside the field, beneath the HUD. */
#wave-banner,#cart-prize{position:absolute;top:18px;left:12px;right:12px;padding:12px;text-align:center;background:#392c25ed;color:#ffe09a;border:1px solid #b59158;border-radius:12px;z-index:3;pointer-events:none;font-size:16px;font-weight:700}
#cart-prize{top:85px;left:25%;right:25%;background:#775026e8}
.shop-secondary{display:flex;gap:8px;margin-top:8px;flex-shrink:0}.shop-secondary button{flex:1;min-height:44px}#finish{margin:0;width:auto}
#perm-panel{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:10px;background:#24413a;border:1px solid #799c84;border-radius:12px}#perm-panel h2{grid-column:1/-1;font-size:14px;margin:0 0 4px}#perm-panel button{font-size:11px;min-height:44px}
#rebuild-dialog{z-index:8}
html[lang=ko] #begin,html[lang=ko] #farm{word-break:keep-all}

/* 44px touch area, independent of the drawing. */
#help-panel a{display:inline-flex;align-items:center;min-height:44px;min-width:44px}

/* 시작 화면에서도 소리·진동 단추는 다른 게임처럼 오른쪽 끝에 둔다. */
.title-screen header > a.orak-home-button:not(.btn){margin-right:auto!important}
/* 목록이 스크롤될 때 위아래 끝이 칼같이 잘려 보이지 않게 부드럽게 흐린다(맨 위·맨 아래에선 여백이라 티 안 남) */
#items{padding:10px 3px;-webkit-mask-image:linear-gradient(transparent,#000 10px,#000 calc(100% - 10px),transparent);mask-image:linear-gradient(transparent,#000 10px,#000 calc(100% - 10px),transparent)}

/* ===== 3.0 판 화면(시안 play-v1): 전장이 화면 전부, 나무 현판 HUD와 메달·칩이 전장 위에 뜬다. =====
   그림 안쪽 글자 칸은 잘라 낸 그림에서 잰 비율(scripts/castle_ui.py 뒤 측정):
   ui-hud 800x205 → 가로 9~91%, 세로 22~63% / ui-medal 240x248 → 글자 가로 18~80%, 세로 66~88%
   ui-btn-wood 240x130 → 가로 9~91%, 세로 13~83% / ui-chip 200x127 → 가로 9~91%, 세로 13~80% */
#stage.playing{grid-template-rows:auto auto minmax(0,1fr) auto}
#stage.playing>.board{grid-row:2/5;grid-column:1}
#stage.playing>.hud{grid-row:2;grid-column:1;z-index:4;position:relative;margin:4px auto 0;width:min(calc(100% - 12px),520px);aspect-ratio:800/205;background:url(sprites/ui-hud.webp) center/100% 100% no-repeat;border:0;
  padding:5.64% 9% 9.48%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;gap:0;font-size:clamp(14px,5.2vw,25px);font-weight:900;color:#fff4dc;text-shadow:0 2px 0 #3a1d12,0 0 3px #3a1d12;pointer-events:none}
#stage.playing>.hud>*{white-space:nowrap;overflow:hidden;min-width:0;text-align:center;padding:0 2.5%;line-height:1.1}
#stage.playing>.hud>#left{border-inline:2px solid #e3b866aa}
#stage.playing>.hud strong{color:#fff4dc}
#stage.playing>.hud #rice.has-art::before{width:1.45em;height:1.25em;margin-right:.2em;vertical-align:-.25em}
#stage.playing>footer{grid-row:4;grid-column:1;z-index:4;background:none;padding:0 10px 10px;pointer-events:none}
#stage.playing #hint{display:none}
#stage.playing #controls{display:flex;align-items:flex-end;justify-content:space-between;gap:6px}
#stage.playing #controls[hidden]{display:none}
#controls button{pointer-events:auto}
.playing .play-options{display:flex;align-items:center;gap:6px;margin:0;position:relative;flex-wrap:nowrap}
.playing .skills{display:flex;gap:8px;margin:0}
/* 그림 단추 공통: 바탕은 그림, 글자는 그림 안 칸에. */
#controls .wood,#controls .chip,#controls .medal{position:relative;border:0;border-radius:0;box-shadow:none;padding:0;background:center/100% 100% no-repeat;color:#fff4dc;font-weight:800;text-shadow:0 2px 0 #3a1d12,0 0 3px #3a1d12;min-height:0}
#controls .lbl{position:absolute;display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden;line-height:1}
#controls .wood{width:76px;height:41px;background-image:url(sprites/ui-btn-wood.webp);font-size:16px}
#controls .wood .lbl{left:9%;right:9%;top:13%;bottom:17%}
#controls .chip{width:58px;height:37px;background-image:url(sprites/ui-chip.webp);font-size:15px}
#controls .chip .lbl{left:9%;right:9%;top:13%;bottom:20%}
#controls #auto[aria-pressed="true"]{background-image:url(sprites/ui-chip-on.webp)}
#controls .medal{width:80px;height:83px;background-image:url(sprites/ui-medal-bolt.webp);font-size:17px;border-radius:50%}
#controls #bell.medal{background-image:url(sprites/ui-medal-bell.webp)}
#controls .medal .lbl{left:18%;right:20%;top:66%;bottom:12%}
#controls .medal:disabled{opacity:1}
/* 대기: 둥근 어둠 판(ui-medal-cover)을 남은 비율만큼 시계방향으로 덮고 가운데에 초. */
#controls .medal .cd{position:absolute;inset:0;background:url(sprites/ui-medal-cover.webp) center/100% 100% no-repeat;opacity:.72;-webkit-mask:conic-gradient(#000 calc(var(--cd,0)*360deg),transparent 0);mask:conic-gradient(#000 calc(var(--cd,0)*360deg),transparent 0);display:none}
#controls .medal.waiting .cd{display:block}
#controls .medal .cd-num{position:absolute;left:0;right:0;top:30%;font-size:26px;font-weight:900;color:#fff;text-shadow:0 2px 0 #000,0 0 4px #000;display:none}
#controls .medal.waiting .cd-num{display:block}
#controls #upgrade-badge{position:absolute;left:2px;bottom:calc(100% + 6px);font-size:11px;white-space:nowrap}
#controls button:focus-visible{outline:2px solid #ffe49e;outline-offset:2px}
@media(max-height:680px){#controls .medal{width:70px;height:72px;font-size:15px}#controls .medal .cd-num{font-size:22px}#controls .wood{width:66px;height:36px;font-size:14px}#controls .chip{width:52px;height:33px;font-size:13px}}
.playing #wave-banner{top:calc(min(100vw,540px)*.26 + 10px)}.playing #cart-prize{top:calc(min(100vw,540px)*.26 + 74px)}
/* B2·B3: 알림이 위 단추·아래 단추를 덮지 않게. 판에서는 나무 현판 바로 아래 전장에 띄운다. */
.orak-hub-toast{top:calc(env(safe-area-inset-top,0px) + 62px)!important}
.osc-toast{bottom:auto!important;top:calc(env(safe-area-inset-top,0px) + 112px)}
html:has(#stage.playing) .orak-hub-toast{top:calc(env(safe-area-inset-top,0px) + 70px + min(100vw,540px)*.27)!important}
html:has(#stage.playing) .osc-toast{top:calc(env(safe-area-inset-top,0px) + 122px + min(100vw,540px)*.27)!important;padding:8px 14px;font-size:13px}
/* 판 위 쉬기 글귀는 나무 현판 아래에서 시작한다. 튜토리얼 말풍선도 현판 아래. */
.playing .celebrate{padding-top:calc(min(100vw,540px)*.27 + 24px)}
.playing .tutorial .speech{top:calc(min(100vw,540px)*.27 + 14px)}
#finger{transform:translate(-30%,-10%)}
@keyframes drag{0%,100%{translate:0 0;opacity:.4}25%{opacity:1}70%{translate:55px -60px;opacity:1}}

/* ===== 3.0 첫 화면(시안 home-v1) =====
   글자 칸(잰 값): ui-scroll-s 가로 13~85% 세로 17~59% / ui-scroll-l 가로 8~92% 세로 18~52% / ui-plaque 가로 11~90% 세로 36~84%
   ui-wood-m 가로 3~96% 세로 13~86% / ui-stone 가로 4~94% 세로 7~82% */
.title-screen .home-title{background:none;top:6px;padding:0;container-type:inline-size}
.title-screen .home-actions{container-type:inline-size}
.title-screen .home-title .eyebrow{display:flex;align-items:center;justify-content:center;--w:min(70cqw,300px);width:var(--w);margin:0 auto;aspect-ratio:520/138;background:url(sprites/ui-scroll-s.webp) center/100% 100% no-repeat;border-radius:0;padding:0 calc(var(--w)*.13) calc(var(--w)*.265*.4);
  font-size:clamp(10px,3.1vw,14px);font-weight:800;color:#5a3a1e;letter-spacing:0;text-shadow:none;white-space:nowrap;overflow:hidden}
.title-screen .home-title .eyebrow>span{display:block;overflow:hidden;text-overflow:clip;white-space:nowrap;max-width:100%}
.title-screen .game-logo{width:min(84vw,360px,calc((var(--orak-h,100dvh) - 60px)*.42));margin-top:-4px}
#home-record{display:flex;align-items:center;justify-content:center;--w:min(96cqw,440px);width:var(--w);margin:-2px auto 0!important;aspect-ratio:720/189;background:url(sprites/ui-scroll-l.webp) center/100% 100% no-repeat;padding:calc(var(--w)*.262*.16) calc(var(--w)*.1) calc(var(--w)*.262*.5);
  font-size:clamp(11px,3.3vw,14px)!important;font-weight:800;color:#4a2f18!important;line-height:1.15;text-wrap:balance;text-shadow:none}
#home-record.has-art::before{display:none}
.title-screen .home-actions{bottom:10px;padding:0 12px;gap:6px}
.title-screen .home-actions button{border:0;border-radius:0;box-shadow:none;background:center/100% 100% no-repeat;font-weight:800;min-height:0}
#continue.primary b{color:#ffe14d;font-weight:900}
#continue.primary{--w:min(84cqw,340px);aspect-ratio:700/233;width:var(--w);justify-self:center;background-image:url(sprites/ui-plaque.webp);padding:calc(var(--w)*.333*.36) calc(var(--w)*.11) calc(var(--w)*.333*.16);font-size:clamp(16px,5.2vw,24px);color:#fff4dc;white-space:nowrap;overflow:hidden;text-shadow:0 3px 0 #3a1d12,0 0 4px #3a1d12;line-height:1.05}
.title-screen .home-actions>div.home-row{display:flex;gap:8px;justify-content:center}.title-screen .home-actions>div.home-row:not(:has(button:not([hidden]))){display:none}
#home-farm,#rush{flex:1;max-width:172px;overflow:hidden;white-space:nowrap;aspect-ratio:400/119;background-image:url(sprites/ui-wood-m.webp);color:#fff4dc;text-shadow:0 2px 0 #3a1d12;font-size:clamp(12px,3.6vw,15px);padding:0 8px 0 calc(min(47cqw,172px)*.3);position:relative;text-align:left;display:flex;flex-direction:column;justify-content:center;line-height:1.1}
#home-farm::before,#rush::before{content:"";position:absolute;left:5%;top:50%;width:24%;aspect-ratio:1;transform:translateY(-50%);background:center/contain no-repeat}
#home-farm::before{background-image:url(sprites/ic-ricebag.webp)}#rush::before{background-image:url(sprites/ic-oni.webp)}
#rush small{font-size:.68em!important;margin-top:2px!important;opacity:.92}
.title-screen .home-actions>div.home-stones{display:flex;gap:6px;justify-content:center}
.title-screen .home-actions .home-stones button{flex:1;max-width:118px;background-image:url(sprites/ui-stone.webp);aspect-ratio:280/88;background-image:url(sprites/ui-stone.webp);color:#3b2a1c;font-size:clamp(12px,3.6vw,15px);padding:0 6px 3px calc(min(31cqw,118px)*.4);position:relative;text-align:left;white-space:nowrap;overflow:hidden}
.home-stones button::before{content:"";position:absolute;left:7%;top:44%;width:30%;aspect-ratio:1;transform:translateY(-50%);background:center/contain no-repeat;margin:0}
#book.lbl-x,#book::before{background-image:url(sprites/ic-scroll.webp)}#home-shop::before{background-image:url(sprites/ic-anvil.webp)}#help::before{background-image:url(sprites/ic-book.webp)}
#home-shop.has-art::before{width:30%;height:auto;margin:0;vertical-align:baseline;background-image:url(sprites/ic-anvil.webp)!important}
.title-screen .home>.speech{bottom:auto;top:var(--say-top,60%);left:var(--say-left,62%);transform:none;max-width:42%;width:max-content;text-align:center;font-weight:700;font-size:12px;line-height:1.3;border-radius:18px;background:#fff8e6;border:2.5px solid #3a2414;color:#3a2414;padding:8px 12px}
.title-screen .home>.speech::after{content:"";position:absolute;left:-10px;top:46%;border:7px solid transparent;border-right:9px solid #3a2414}
html:not([lang=ko]) .title-screen .home-title .eyebrow>span{white-space:normal;line-height:1.08;font-size:clamp(9.5px,2.8vw,12px);text-wrap:balance}
/* 3.0 공방(시안 shop-v1): 나무 현판 지갑, 공방 마당(지금 성 → 다음 성, 망치 든 냥도사), 나무 꼬리표 탭, 한지 카드 2열, 쌀가마 값 단추, 붉은 전투 단추 + 돌 칩 둘 */
#stage.shopping>.hud,#stage.celebrating>.hud{margin:4px 6px 0;padding:0 18px;min-height:46px;align-items:center;justify-content:flex-start;gap:0;border:0;border-image:url(sprites/ui-wood-m.webp) 44 70 fill/16px 26px stretch;background:none;color:#fff4dc;font-size:clamp(15px,4.6vw,20px);font-weight:900;text-shadow:0 2px 0 #3a1d12,0 0 3px #3a1d12;white-space:nowrap;position:relative;z-index:1}
#stage.shopping>.hud strong,#stage.celebrating>.hud strong{color:#ffe7a6}
#stage.shopping>.hud>#left::before,#stage.celebrating>.hud>#left::before{content:"·";margin:0 .35em;color:#ffe7a6}
#stage.shopping>.hud>#rice,#stage.celebrating>.hud>#rice{margin-left:auto}
#stage.shopping>.hud #rice.has-art::before,#stage.celebrating>.hud #rice.has-art::before{width:1.5em;height:1.3em;margin-right:.25em;vertical-align:-.3em;background-image:url(sprites/ic-ricebag.webp)}
#stage.shopping>.hud>*,#stage.celebrating>.hud>*{overflow:hidden;min-width:0}
#shop{container-type:inline-size;padding:0;background:#5a3519 url(sprites/bg-shop-wood.webp) top center/100% auto repeat-y;color:#3b2a1c;gap:0}
#summary{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
.shop-scene{position:relative;flex:0 0 auto;height:min(50cqw,26vh,230px);margin-top:-8px;background:url(sprites/bg-shop-yard.webp) center 78%/cover no-repeat;border-bottom:3px solid #3a2414}
.shop-scene h1{position:absolute;left:50%;top:10px;transform:translateX(-50%);--w:min(58cqw,250px);width:var(--w);aspect-ratio:440/143;margin:0!important;display:flex;align-items:center;justify-content:center;padding:calc(var(--w)*.325*.1) calc(var(--w)*.13) calc(var(--w)*.325*.32);background:url(sprites/ui-shop-title.webp) center/100% 100% no-repeat;color:#4a2a12;font-size:clamp(15px,5.4cqw,22px)!important;font-weight:900;letter-spacing:.06em;line-height:1;z-index:1}
.shop-scene h1>span{display:block;white-space:nowrap;overflow:hidden;max-width:100%}
.shop-scene img{position:absolute;object-fit:contain;pointer-events:none}
#shop-now{left:21%;bottom:5%;height:66%;width:46%;object-position:center bottom}
#shop-next{right:1%;bottom:8%;height:56%;width:31%;object-position:center bottom;filter:drop-shadow(0 0 6px #ffd96a) drop-shadow(0 0 2px #fff3b0) saturate(1.05)}
.shop-arrow{position:absolute;left:62.5%;bottom:28%;width:8%;z-index:1;aspect-ratio:1.1;background:linear-gradient(#ffe46b,#f2a91e);clip-path:polygon(0 30%,52% 30%,52% 0,100% 50%,52% 100%,52% 70%,0 70%);filter:drop-shadow(0 0 1.5px #5a3110) drop-shadow(0 0 1px #5a3110)}
.shop-dosa{left:0;bottom:2%;height:66%;width:auto;aspect-ratio:358/360;animation:shop-hammer 1.6s ease-in-out infinite;transform-origin:50% 100%}
@keyframes shop-hammer{0%,60%,100%{transform:rotate(0) translateY(0)}72%{transform:rotate(-4deg) translateY(-2%)}84%{transform:rotate(3deg) translateY(1%)}}
#shop-next{animation:shop-glow 2.4s ease-in-out infinite}
@keyframes shop-glow{50%{filter:drop-shadow(0 0 10px #ffe58a) drop-shadow(0 0 3px #fff3b0) saturate(1.1)}}
#shop.top-stage #shop-now{left:30%;width:46%;height:62%}#shop.top-stage .shop-arrow{display:none}
@media (prefers-reduced-motion:reduce){.shop-dosa,#shop-next{animation:none}}
#shop nav{background:none;padding:8px 8px 4px;gap:6px}
#shop nav button{height:clamp(38px,11cqw,46px);min-height:0;border:0;border-radius:0;background:url(sprites/ui-tab-off.webp) center/100% 100% no-repeat;box-shadow:none;color:#fff4dc;font-size:clamp(14px,4.6cqw,19px);font-weight:900;text-shadow:0 2px 0 #3a1d12;padding:0 6px;display:flex;align-items:center;justify-content:center;white-space:nowrap;overflow:hidden}
#shop nav button>span{overflow:hidden;min-width:0}
#shop nav button[aria-selected="true"]{background-image:url(sprites/ui-tab-on.webp);color:#5a3010;text-shadow:0 1px 0 #fff3c4}
#shop nav button.has-art::before{width:1.35em;height:1.35em;flex:none;margin-right:.3em}
#items{padding:8px 8px 10px;gap:8px}
#items>.item{position:relative;border:0;border-radius:0;background:none;border-image:url(sprites/ui-card.webp) 64 fill/18px stretch;padding:9px 8px 10px;gap:6px;text-align:center;color:#3b2a1c}
#items>.item.reco{filter:drop-shadow(0 0 3px #ffcf3d) drop-shadow(0 0 1.5px #ffb400)}
.reco-stamp{position:absolute;left:-4px;top:2px;z-index:1;width:clamp(48px,16cqw,64px);aspect-ratio:150/109;display:flex;align-items:center;justify-content:center;background:url(sprites/ui-reco.webp) center/100% 100% no-repeat;color:#fff;font-size:clamp(11px,3.6cqw,15px);font-weight:900;transform:rotate(-10deg);text-shadow:0 1px 0 #7a0c0c;white-space:nowrap;padding:0 14% 2%}
#items .item-picture{height:clamp(56px,20cqw,84px);background:none;border-radius:0;overflow:visible}
#items .item-picture img{width:100%;height:clamp(56px,20cqw,84px);filter:drop-shadow(0 2px 1px #3a241444)}
#items .item-picture .hero-portrait{width:clamp(56px,20cqw,82px);height:clamp(56px,20cqw,82px);box-shadow:0 0 0 2.5px #8a5a2b}
#items .item strong{margin-top:2px;font-size:clamp(13px,4.1cqw,16px);font-weight:900;color:#3b2a1c;line-height:1.2;word-break:keep-all;overflow-wrap:anywhere}
#items .item small{color:#5e4127;font-size:clamp(10.5px,3.1cqw,12.5px);font-weight:700;margin-top:3px;line-height:1.35;-webkit-line-clamp:4}
#items .item.short small{color:#b3261e}
#items .item button.price{margin-top:auto;height:clamp(34px,10.5cqw,42px);min-height:0;border:0;border-radius:0;background:url(sprites/ui-price.webp) center/100% 100% no-repeat;box-shadow:none;color:#fff;font-size:clamp(14px,4.6cqw,19px);font-weight:900;text-shadow:0 2px 0 #6a3a0c,0 0 3px #6a3a0c;display:flex;align-items:center;justify-content:center;gap:.3em;padding:0 8% 2%;white-space:nowrap;overflow:hidden}
#items .item button.price::before{content:"";flex:none;width:1.45em;height:1.25em;background:url(sprites/ic-ricebag.webp) center/contain no-repeat}
#items .item button.price:disabled{background-image:url(sprites/ui-price-lock.webp);color:#f1ece4;text-shadow:0 2px 0 #3e3530;opacity:1}
#items .item button.price:disabled::before{width:1em;background-image:url(sprites/ic-lock.webp)}
#items .lock-badge{background:#fff7e6;box-shadow:0 0 0 2px #8a5a2b}
#shop #notice{margin:2px 10px 4px;font-size:12px;color:#fff1d6;text-shadow:0 1px 0 #2a160a;text-align:center;flex-shrink:0}
#shop .shop-secondary{margin:0 8px 6px}#shop .shop-secondary:not(:has(button:not([hidden]))){display:none}
#shop #perm-panel{grid-column:1/-1}
#shop .slot-hint{color:#fff1d6;text-shadow:0 1px 0 #2a160a}
#stage.shopping>footer{background:#3a2112 url(sprites/bg-shop-wood.webp) bottom center/100% auto;padding:8px 8px calc(6px + env(safe-area-inset-bottom));border-top:3px solid #2a170b}
#stage.shopping #hint{display:none}
#ready{grid-template-columns:minmax(0,2.3fr) minmax(0,1fr) minmax(0,1fr)!important;gap:6px;align-items:stretch}
#ready:has(#farm[hidden]){grid-template-columns:minmax(0,2.3fr) minmax(0,1fr)!important}
#ready button{border:0;border-radius:0;box-shadow:none;min-height:0;height:clamp(58px,17cqw,70px);background:center/100% 100% no-repeat;font-weight:900;padding:0;overflow:hidden}
#begin.primary{background-image:url(sprites/ui-btn-red.webp);color:#fff8e6;font-size:clamp(14px,4.9vw,21px);text-shadow:0 2px 0 #5c0c0c,0 0 3px #5c0c0c;display:flex;align-items:center;justify-content:center;gap:.2em;padding:2% 6% 3% 4%}
#begin.primary::before{content:"";flex:none;width:1.5em;height:1.5em;background:url(sprites/ic-swords.webp) center/contain no-repeat}
#begin .lbl{white-space:nowrap;overflow:hidden;min-width:0}
#farm,#finish{background-image:url(sprites/ui-stone-sq.webp)!important;color:#3b2a1c!important;font-size:clamp(10.5px,3.2vw,13px)!important;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;padding:0 4% 9%!important;white-space:nowrap!important;line-height:1.1}
#farm::before,#finish::before{content:"";width:46%;flex:1;max-height:56%;margin-bottom:2px;background:center/contain no-repeat}
#farm::before{background-image:url(sprites/ic-anvil.webp)}#finish::before{background-image:url(sprites/ic-pouch.webp)}
#farm .lbl,#finish .lbl{display:block;max-width:100%;overflow:hidden}
#ready{container-type:inline-size}
#shop #perm-panel{border:0;border-radius:0;background:none;border-image:url(sprites/ui-card.webp) 64 fill/18px stretch;padding:12px 10px;color:#3b2a1c}
#shop #perm-panel h2{color:#4a2a12;font-weight:900;text-align:center}
#shop #perm-panel button{border:0;border-radius:0;box-shadow:none;background:url(sprites/ui-tab-off.webp) center/100% 100% no-repeat;color:#fff4dc;font-weight:800;text-shadow:0 1px 0 #3a1d12;padding:4px 10px;line-height:1.2}
#shop #perm-panel button:not(:disabled){background-image:url(sprites/ui-tab-on.webp);color:#5a3010;text-shadow:none}
#shop #perm-panel button:disabled{opacity:.8}
#shop #rebuild{border:0;border-radius:0;box-shadow:none;background:url(sprites/ui-wood-m.webp) center/100% 100% no-repeat;color:#fff4dc;font-weight:900;text-shadow:0 2px 0 #3a1d12;min-height:46px}
@media (max-height:700px){
  .shop-scene{height:min(50cqw,17vh)}
  #shop nav{padding:5px 8px 2px}#shop nav button{height:36px;font-size:15px}
  #items{padding:5px 8px 6px;gap:6px}
  #items>.item{padding:6px 7px 7px;gap:3px}
  #items .item-picture,#items .item-picture img{height:42px}#items .item-picture .hero-portrait{width:42px;height:42px}
  #items .item strong{font-size:13px}#items .item small{font-size:10.5px;-webkit-line-clamp:2;margin-top:1px}
  #items .item button.price{height:30px;font-size:15px}
  #shop #notice{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
  #ready button{height:56px}
}
html:not([lang=ko]) #farm,html:not([lang=ko]) #finish{white-space:normal!important}
html:not([lang=ko]) #farm .lbl,html:not([lang=ko]) #finish .lbl{white-space:normal;line-height:1.05;text-wrap:balance;text-align:center;overflow-wrap:normal;hyphens:auto;max-height:2.2em}
html:not([lang=ko]) #farm::before,html:not([lang=ko]) #finish::before{max-height:44%}
#stage{grid-template-columns:minmax(0,1fr)}
html:not([lang=ko]) #stage.shopping>.hud,html:not([lang=ko]) #stage.celebrating>.hud{font-size:clamp(13px,3.9vw,17px);padding:0 14px}
html:not([lang=ko]) #farm .lbl,html:not([lang=ko]) #finish .lbl{max-height:3.2em;font-size:.95em}
html:not([lang=ko]) #farm::before,html:not([lang=ko]) #finish::before{max-height:38%}
/* 3.0 결과(시안 win-v1·lose-v1): 두루마리 + 위에 걸터앉은 냥이, 붓 글씨 제목, 별 조건 3줄, 쌀가마 줄, 현판 단추 */
#result.overlay{background:#0004;padding:8px 12px;align-content:center;overflow-y:auto}
#result.lost{background:#2a1f2a url(sprites/bg-lose.webp) center/cover no-repeat}
#result .panel{position:relative;width:min(100%,380px);max-height:none;overflow:visible;margin:clamp(70px,15vh,118px) auto 0;border-radius:0;background:none;border-style:solid;border-width:clamp(58px,16vw,74px) clamp(26px,7.5vw,32px) clamp(40px,11vw,48px);border-image:url(sprites/ui-scroll-big.webp) 150 64 96 64 fill stretch;padding:0 4px 2px;color:#3b2a1c;box-shadow:none;display:flex;flex-direction:column;align-items:center;gap:4px}
#result .res-cats{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(100% + clamp(12px,3.5vw,18px));width:min(86%,300px);height:clamp(96px,27vw,128px);display:flex;justify-content:center;align-items:flex-end;gap:2%;pointer-events:none}
#result .res-cats img{height:100%;width:auto;object-fit:contain;animation:res-cheer 1.1s ease-in-out infinite;transform-origin:50% 100%}
#result .res-cats #res-friend{animation-delay:.35s;height:92%}
#result.lost .res-cats img{animation:res-vow 2.2s ease-in-out infinite;height:118%}
@keyframes res-cheer{0%,100%{transform:translateY(0)}45%{transform:translateY(-7%) scaleY(1.02)}}
@keyframes res-vow{0%,100%{transform:scale(1)}50%{transform:scale(1.025) translateY(-1%)}}
@media (prefers-reduced-motion:reduce){#result .res-cats img{animation:none}}
#result #result-tag{display:inline-block;margin:0;padding:3px 26px 4px;background:#4a3127;color:#fff4dc;font-size:clamp(14px,4.4vw,18px);font-weight:900;letter-spacing:.02em;clip-path:polygon(4% 8%,30% 0,70% 6%,97% 0,100% 50%,96% 100%,60% 92%,25% 100%,0 90%,3% 50%);text-transform:none;max-width:100%;white-space:normal;line-height:1.2}
#result .panel h1{margin:2px 0 0;font-size:clamp(26px,8.6vw,38px);font-weight:900;color:#4a1a10;line-height:1.08;letter-spacing:-.01em;text-shadow:0 1px 0 #fff6;padding:0 6px 6px;background:linear-gradient(transparent 82%,#b8282888 82%,#b82828aa 92%,transparent 92%) no-repeat;text-wrap:balance}
#result.lost .panel h1{color:#6a1410;background:linear-gradient(transparent 70%,#ffd84a99 70%,#ffd84a99 90%,transparent 90%) no-repeat}
#result #result-note{margin:0;font-size:clamp(13px,3.8vw,16px);font-weight:800;color:#4a2a18;padding:2px 18px;background:linear-gradient(90deg,transparent,#d9c3a2 12%,#d9c3a2 88%,transparent)}
#result:not(.lost) #result-note{display:none}
#result #result-stars{font-size:clamp(40px,12vw,52px);letter-spacing:4px;line-height:1;margin:2px 0 0}
#result .star{color:#b8b2aa;-webkit-text-stroke:1.5px #6b6158;text-shadow:0 2px 0 #0002}
#result .star.earned{color:#ffcf2e;-webkit-text-stroke:1.5px #a8620a;text-shadow:0 0 10px #ffe58a}
#star-rows{list-style:none;margin:0;padding:4px 12px;width:100%;box-sizing:border-box;background:#e9d9bcaa;border-radius:10px}
#star-rows:empty{display:none}
#star-rows li{display:flex;align-items:center;gap:8px;padding:3px 2px;font-size:clamp(13px,3.9vw,16px);font-weight:800;color:#3b2a1c;text-align:left;line-height:1.2}
#star-rows li+li{border-top:1.5px dashed #b89a72}
#star-rows li::before{content:"★";flex:none;font-size:1.25em;color:#b8b2aa;-webkit-text-stroke:1px #6b6158}
#star-rows li.got::before{color:#ffcf2e;-webkit-text-stroke:1px #a8620a}
#result #star-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
#result .res-rice{display:flex;align-items:center;justify-content:center;gap:6px;width:100%;margin-top:2px}
#result .res-rice::before{content:"";flex:none;width:clamp(54px,16vw,72px);aspect-ratio:200/172;background:url(sprites/ic-ricebag.webp) center/contain no-repeat}
#result .rice-count{margin:0!important;font-size:clamp(24px,7.6vw,34px)!important;font-weight:900;color:#3b1d0c;padding:2px 12px;background:linear-gradient(90deg,transparent,#ffe08a 10%,#ffe08a 90%,transparent);white-space:nowrap}
#result.lost .rice-count{color:#ffe14d;background:linear-gradient(90deg,transparent,#7a1c1c 8%,#7a1c1c 92%,transparent);text-shadow:0 2px 0 #3a0a0a}
#result #result-pouch{margin:0;font-size:clamp(12.5px,3.7vw,15px);font-weight:800;color:#3b2a1c;display:flex;align-items:center;gap:5px}
#result #result-pouch::before{content:"";width:1.6em;height:1.6em;background:url(sprites/ic-pouch.webp) center/contain no-repeat}
#result #result-pouch[hidden]{display:none}
#result #result-reco{position:relative;display:grid;grid-template-columns:42% 1fr;grid-template-rows:1fr 1fr;align-items:center;width:100%;margin:4px 0 0;padding:10px 10px 8px;min-height:0;border:0;border-radius:0;box-shadow:none;background:none;border-image:url(sprites/ui-card.webp) 64 fill/16px stretch;color:#3b2a1c;text-align:center}
#result #result-reco[hidden]{display:none}
#result #result-reco .reco-pic{grid-row:1/3;display:grid;place-items:center;height:clamp(64px,19vw,84px)}
#result #result-reco .reco-pic img{height:100%;width:100%;object-fit:contain}
#result #result-reco .reco-pic .hero-portrait{width:clamp(60px,18vw,78px);height:clamp(60px,18vw,78px)}
#result #result-reco strong{font-size:clamp(15px,4.6vw,20px);font-weight:900;align-self:end;border-bottom:1.5px solid #8a6a4a;padding-bottom:3px;line-height:1.15}
#result #result-reco b{font-size:clamp(18px,5.6vw,24px);font-weight:900;color:#8a1414;align-self:start;display:flex;align-items:center;justify-content:center;gap:4px;padding-top:3px}
#result #result-reco b::before{content:"";width:1.4em;height:1.2em;background:url(sprites/ic-ricebag.webp) center/contain no-repeat}
#result #result-reco .reco-stamp{left:-6px;top:-6px}
#result #result-hint{margin:2px 0 0;font-size:12px;font-weight:700;color:#6a4a2c;line-height:1.35}
#result.lost #result-hint{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);margin:0}
#result #result-rank{margin:0;font-size:12px;font-weight:800;color:#6a3a14}#result #result-rank:empty{display:none}
#result .panel button{margin-top:4px;border:0;border-radius:0;box-shadow:none;background:center/100% 100% no-repeat;font-weight:900;min-height:0}
#result #upgrade{--w:min(100%,290px);width:var(--w);aspect-ratio:700/233;background-image:url(sprites/ui-plaque.webp);color:#fff4dc;font-size:clamp(17px,5.6vw,24px);padding:calc(var(--w)*.333*.3) 12% calc(var(--w)*.333*.12);text-shadow:0 3px 0 #3a1d12,0 0 4px #3a1d12;white-space:nowrap;overflow:hidden}
#result #upgrade{width:min(100%,290px);padding:6% 12% 2%}
#result #result-next,#result #result-farm,#result #boss-share{width:min(78%,230px);height:clamp(40px,11.5vw,48px);background-image:url(sprites/ui-wood-m.webp);color:#fff4dc;font-size:clamp(13px,4vw,17px);text-shadow:0 2px 0 #3a1d12;padding:0 10%;white-space:nowrap;overflow:hidden}
#result #result-ad:empty{display:none}
#stage.playing:has(#result:not([hidden])) .skills{display:none}
@media (max-height:700px){
  #result .panel{margin-top:clamp(60px,12vh,80px);gap:2px;border-width:52px 26px 36px}
  #result .res-cats{height:clamp(72px,20vw,92px)}
  #result #result-stars{font-size:34px}
  #star-rows li{padding:1px 2px;font-size:12.5px}
  #result .panel h1{font-size:clamp(22px,7vw,30px)}
  #result .res-rice::before{width:44px}
  #result .rice-count{font-size:24px!important}
  #result #result-reco .reco-pic{height:54px}
  #result #result-next,#result #result-farm,#result #boss-share{height:38px}
}
#stage.playing:has(#result:not([hidden]))>.hud{visibility:hidden}
html:has(#result:not([hidden])) .orak-hub-toast{top:calc(env(safe-area-inset-top,0px) + 60px)!important}
html:has(#result:not([hidden])) .osc-toast{top:calc(env(safe-area-inset-top,0px) + 104px)!important}
#result-rice.has-art::before{display:none}
#result .panel h1{font-weight:900!important}
html[lang=ko] #result .panel h1,html[lang=ja] #result .panel h1,html[lang=zh-TW] #result .panel h1{white-space:nowrap}
#result .panel h1{max-width:100%;min-width:0;overflow:hidden;box-sizing:border-box}
#result.overlay{grid-template-columns:minmax(0,1fr)}
#result .panel>*{max-width:100%;box-sizing:border-box}
html:not([lang=ko]) #result .rice-count{font-size:clamp(18px,5.6vw,26px)!important;white-space:normal;line-height:1.1;text-align:center}
#result #upgrade,#result #result-next,#result #result-farm,#result #boss-share{text-overflow:ellipsis}
html:not([lang=ko]) #result #result-farm,html:not([lang=ko]) #result #result-next{font-size:clamp(11px,3.4vw,14px)}
#result .panel h1{padding-inline:9%}
html:not([lang=ko]) #result #result-farm,html:not([lang=ko]) #result #result-next,html:not([lang=ko]) #result #boss-share{white-space:normal;height:auto;min-height:clamp(40px,11.5vw,48px);line-height:1.1;padding:6px 12%;background-size:100% 100%}
/* 3.0 기록장(시안 book-v1) */
#book-panel{background:#5a341a url(sprites/bg-book.webp) center top/100% auto no-repeat;container-type:inline-size}
#book-panel .osc-book{background:none}
#book-panel .osc-header{background:#211a19;position:relative;z-index:1}
#book-panel .osc-book-scroll{background:linear-gradient(#0000,#0000 0) ;padding-top:0}
.bk-scene{position:relative;height:min(58cqw,250px);flex:none;margin:0}
.bk-frame{position:absolute;left:3%;top:7%;width:47%;aspect-ratio:280/175;background:url(sprites/ui-tile.webp) center/100% 100% no-repeat;display:grid;place-items:center;padding:6% 7% 5%;box-sizing:border-box}
.bk-frame img{width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 2px 2px #0005)}
.bk-title{position:absolute;right:2%;top:5%;width:46%;aspect-ratio:360/183;background:url(sprites/ui-title-plaque.webp) center/100% 100% no-repeat;display:flex;align-items:center;justify-content:center;padding:0 13% 18%;box-sizing:border-box}
.bk-title strong{display:block;white-space:nowrap;overflow:hidden;max-width:100%;font-size:clamp(14px,5cqw,22px);font-weight:900;color:#4a2a12}
.bk-dosa{position:absolute;right:9%;bottom:2%;height:52%;width:auto;animation:bk-write 2s ease-in-out infinite;transform-origin:50% 100%}
@keyframes bk-write{0%,100%{transform:rotate(0)}50%{transform:rotate(-2deg) translateY(-1.5%)}}
@media (prefers-reduced-motion:reduce){.bk-dosa{animation:none}}
#book-panel .osc-book-scroll>.osc-heading:first-child{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#book-panel .osc-records{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;padding:6px 6px 2px}
#book-panel .osc-record{border:0;border-radius:0;background:url(sprites/ui-tile.webp) center/100% 100% no-repeat;box-shadow:none;min-height:clamp(70px,21cqw,92px);padding:22% 9% 12%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:#3b2a1c;text-align:center}
#book-panel .osc-record .osc-label{font-size:clamp(9.5px,2.8cqw,12px);font-weight:800;color:#3b2a1c;line-height:1.1;white-space:nowrap;overflow:hidden;max-width:100%}
html:not([lang=ko]) #book-panel .osc-record .osc-label{white-space:normal;text-wrap:balance}
#book-panel .osc-record-value{font-size:clamp(17px,5.6cqw,26px);font-weight:900;color:#ffd21e;-webkit-text-stroke:1px #3b2208;paint-order:stroke fill;text-shadow:0 2px 0 #3b2208;line-height:1.05;white-space:nowrap}
.bk-board{margin:8px 4px 4px;aspect-ratio:720/399;background:url(sprites/ui-stampboard.webp) center/100% 100% no-repeat;position:relative}
.bk-board .osc-heading{position:absolute;left:24%;right:24%;top:1.5%;height:12%;margin:0;display:flex;align-items:center;justify-content:center;font-size:clamp(13px,4.4cqw,19px);font-weight:900;color:#4a2a12;white-space:nowrap;overflow:hidden}
.bk-stamps{position:absolute;left:14%;right:14%;top:21%;bottom:15%;display:grid;grid-template-columns:repeat(5,1fr);align-content:space-evenly;justify-items:center}
.bk-stamps span{width:min(68%,52px);aspect-ratio:1;background:url(sprites/ui-paw-empty.webp) center/contain no-repeat}
.bk-stamps span.got{background-image:url(sprites/ui-paw.webp)}
#book-panel .osc-tier{color:#fff1d6;text-shadow:0 1px 0 #2a160a;margin:8px 10px 4px}
#book-panel .osc-challenges{padding:0 6px;gap:5px}
#book-panel .osc-challenge{display:flex;align-items:center;gap:10px;border:0;border-radius:0;background:none;border-image:url(sprites/ui-card.webp) 64 fill/14px stretch;padding:8px 10px;color:#3b2a1c;box-shadow:none;margin:0 0 5px}
#book-panel .osc-challenge .osc-label{color:#3b2a1c;font-weight:800}
#book-panel .osc-challenge .osc-sub{color:#6a4a2c}
#book-panel .osc-challenge-text{flex:1;min-width:0}
.bk-paw{flex:none;width:34px;height:34px;background:url(sprites/ui-paw-empty.webp) center/contain no-repeat}
#book-panel .osc-done .bk-paw{background-image:url(sprites/ui-paw.webp)}
#book-panel .osc-done-stamp{flex:none;background:url(sprites/ui-pill-green.webp) center/100% 100% no-repeat;color:#fff;border:0;border-radius:0;padding:5px 14px 6px;font-weight:900;text-shadow:0 1px 0 #1f4a0c;transform:none;display:flex;flex-direction:column;align-items:center;line-height:1.1}
#book-panel .osc-done-stamp .osc-date{color:#e8f5d8;font-size:9.5px;font-weight:700}
#stage:has(#book-panel:not([hidden]))>.hud,#stage:has(#book-panel:not([hidden]))>footer{visibility:hidden}
#book-panel .osc-record .osc-label{white-space:normal!important;word-break:keep-all;text-wrap:balance;max-height:2.3em}
.bk-board .osc-heading{top:3%;height:11%}
#book-panel{background:#211a19}
#book-panel .osc-book{background:#5a3519 url(sprites/bg-shop-wood.webp) center top/100% auto repeat-y}
.bk-scene{background:url(sprites/bg-book.webp) center top/100% auto no-repeat;height:min(58cqw,250px,27vh)}
.bk-title{padding:0}
.bk-title strong{position:absolute;left:14%;right:14%;top:27%;bottom:40%;display:flex;align-items:center;justify-content:center;font-size:clamp(14px,5cqw,22px)}
.bk-frame{padding:0;height:auto;max-height:84%}
.bk-frame img{position:absolute;left:9%;right:9%;top:16%;bottom:11%;width:82%;height:73%}
#book-panel .osc-record{aspect-ratio:1/1;min-height:0;padding:0;position:relative;display:block}
#book-panel .osc-record .osc-label{position:absolute;left:12%;right:12%;top:28%;height:30%;display:flex;align-items:center;justify-content:center;font-size:clamp(10px,2.9cqw,12.5px);max-height:none}
#book-panel .osc-record .osc-record-value{position:absolute;left:8%;right:8%;top:58%;bottom:12%;display:flex;align-items:center;justify-content:center}
#book-panel .osc-records{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:6px 8px 2px}
#book-panel .osc-record{aspect-ratio:280/190}
#book-panel .osc-record .osc-label{left:13%;right:13%;top:27%;height:24%;font-size:clamp(10.5px,3.4cqw,14px)}
#book-panel .osc-record .osc-record-value{top:50%;bottom:22%;font-size:clamp(20px,7cqw,30px)}
#book-panel .osc-record .osc-sub{position:absolute;left:12%;right:12%;bottom:12%;height:11%;margin:0;display:flex;align-items:center;justify-content:center;font-size:clamp(8.5px,2.5cqw,10.5px);font-weight:700;color:#6a4a2c;white-space:nowrap;overflow:hidden}
.bk-dosa{height:62%;right:7%}
#book-panel .osc-record{aspect-ratio:280/235}
#book-panel .osc-record .osc-label{top:29%;height:22%}
#book-panel .osc-record .osc-record-value{top:51%;bottom:21%}
#book-panel .osc-record .osc-sub{bottom:9%}
@media (max-height:700px){#book-panel .osc-record{aspect-ratio:280/205}}
#book-panel .osc-record{aspect-ratio:280/262}
#book-panel .osc-record .osc-label{top:31%;height:24%;font-size:clamp(10px,3.1cqw,13px);line-height:1.05}
#book-panel .osc-record .osc-record-value{top:55%;bottom:19%}
#book-panel .osc-record .osc-sub{bottom:8%}
@media (max-height:700px){#book-panel .osc-record{aspect-ratio:280/225}}
#book-panel .osc-record .osc-record-value{top:52%;bottom:25%}
#book-panel .osc-record .osc-sub{bottom:14%;height:10%}
.bk-board .osc-heading{top:4.5%;height:10%}
.bk-extra{margin:2px 12px 0;text-align:center;font-size:12px;font-weight:800;color:#fff1d6;text-shadow:0 1px 0 #2a160a}
#book-panel .osc-record .osc-record-value{top:54%;bottom:18%}
/* 3.0 두루마리 창: 쉬기(B11)·다시 쌓기·오늘은 여기까지·도움말 */
.scroll-dlg.overlay{background:#140c08b8;grid-template-columns:minmax(0,1fr);overflow-y:auto;padding:12px}
.scroll-dlg .panel{position:relative;width:min(100%,360px);max-height:none;overflow:visible;margin:auto;border-radius:0;background:none;box-shadow:none;border-style:solid;border-width:58px 26px 40px;border-image:url(sprites/ui-scroll-big.webp) 150 64 96 64 fill stretch;padding:0 6px 4px;color:#3b2a1c;display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.scroll-dlg .panel>*{max-width:100%;box-sizing:border-box}
.scroll-dlg .panel h1{margin:0;font-size:clamp(22px,6.6vw,28px);font-weight:900;color:#4a1a10;line-height:1.15;padding:0 8% 5px;background:linear-gradient(transparent 82%,#b8282877 82%,#b8282899 92%,transparent 92%) no-repeat;text-wrap:balance}
.scroll-dlg .panel p{margin:0;font-size:14px;font-weight:700;color:#4a2f1c;line-height:1.5;text-wrap:pretty}
#help-panel .panel a{color:#8a2a10;font-weight:800}
.scroll-dlg .panel .eyebrow{display:inline-block;background:#4a3127;color:#fff4dc;padding:3px 20px 4px;font-weight:900;clip-path:polygon(4% 8%,30% 0,70% 6%,97% 0,100% 50%,96% 100%,60% 92%,25% 100%,0 90%,3% 50%)}
.scroll-dlg .panel button{width:min(100%,270px);margin:2px 0 0;border:0;border-radius:0;box-shadow:none;min-height:0;height:46px;background:url(sprites/ui-wood-m.webp) center/100% 100% no-repeat;color:#fff4dc;font-weight:900;font-size:16px;text-shadow:0 2px 0 #3a1d12;padding:0 10%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.scroll-dlg .panel button.primary{height:auto;aspect-ratio:700/233;width:min(100%,280px);background-image:url(sprites/ui-plaque.webp);font-size:clamp(17px,5.4vw,22px);padding:6% 12% 2%;text-shadow:0 3px 0 #3a1d12,0 0 4px #3a1d12}
html:not([lang=ko]) .scroll-dlg .panel button{white-space:normal;height:auto;min-height:46px;line-height:1.1;padding:6px 12%}
.scroll-dlg .dlg-dosa{position:absolute;bottom:calc(100% + 14px);left:50%;transform:translateX(-50%);height:96px;width:auto;pointer-events:none;animation:res-cheer 1.6s ease-in-out infinite}
#pause-menu .panel{margin-top:110px}
.rebuild-art{width:62%;aspect-ratio:1.3;display:grid;place-items:end center;overflow:hidden;margin-top:-4px}
.rebuild-art img{width:100%;height:100%;object-fit:contain;object-position:center bottom;animation:rebuild 2.8s ease-in-out infinite}
@keyframes rebuild{0%,15%{transform:translateY(0);opacity:1;filter:none}40%{transform:translateY(55%) rotate(-2deg);opacity:.35;filter:grayscale(.8)}55%{transform:translateY(100%);opacity:0}70%{transform:translateY(30%);opacity:.8;filter:none}85%,100%{transform:translateY(0);opacity:1}}
@media (prefers-reduced-motion:reduce){.rebuild-art img,.scroll-dlg .dlg-dosa{animation:none}}
#rebuild-reward{font-weight:900!important;color:#8a1414!important;font-size:17px!important}
#help-panel .panel p{text-align:left;font-size:13.5px}
#session #next-games{width:100%}
.scroll-dlg .panel>p{padding:0 5%}
#help-panel .panel a,#help-panel .panel a span{color:#8a2a10!important;text-decoration:underline}
#stage:has(.scroll-dlg:not([hidden]))>footer,#stage:has(.scroll-dlg:not([hidden]))>.hud{filter:brightness(.32);pointer-events:none}
@keyframes rebuild{0%,20%{transform:translateY(0) rotate(0);filter:none}32%{transform:translateY(2%) rotate(-2deg)}44%{transform:translateY(16%) rotate(1.5deg);filter:grayscale(.7) brightness(.8)}56%{transform:translateY(16%);filter:grayscale(.7) brightness(.8)}76%,100%{transform:translateY(0);filter:none}}
.rebuild-art{position:relative}.rebuild-art::after{content:"";position:absolute;inset:auto 0 0;height:22%;background:radial-gradient(ellipse at 50% 100%,#c8a77a 0,#c8a77a00 70%);opacity:0;animation:rebuild-dust 2.8s ease-in-out infinite}
@keyframes rebuild-dust{38%{opacity:0}48%{opacity:.9}70%{opacity:0}}
@media (max-height:700px){.rebuild-art{width:44%}.scroll-dlg .panel{border-width:50px 24px 34px}}
#stage.dlg-open>footer,#stage.dlg-open>.hud{filter:brightness(.32);pointer-events:none}
#session #next-games>:not(a):not(div){color:#4a2f1c!important;text-shadow:none}
#result .res-cats #res-friend.boss-down{animation:none;height:86%;transform:scaleX(-1);filter:saturate(.85)}
/* 3.0 글씨: 시안의 굵고 둥근 글씨 = Jua(다른 3.0 게임과 같음). 한글·라틴 언어만, 나머지는 기본 굵은 글씨. */
:root{--game:"Jua",var(--orak-font,system-ui),sans-serif}
html:is([lang=ko],[lang=en],[lang=es],[lang=pt-BR],[lang=id],[lang=de],[lang=fr]) :is(#stage.playing>.hud,#stage.shopping>.hud,#stage.celebrating>.hud,.shop-scene h1,#shop nav button,#items .item strong,#items .price,#ready button,.reco-stamp,#result #result-tag,#result .panel h1,#result .rice-count,#result .panel button,#result #result-reco strong,#result #result-reco b,#star-rows li,#continue,#home-farm,#rush,.home-stones button,#home-record,.title-screen .home-title .eyebrow,.bk-title strong,.bk-board .osc-heading,#book-panel .osc-record-value,#book-panel .osc-record .osc-label,.scroll-dlg .panel h1,.scroll-dlg .panel button,#controls button,.title-screen .home>.speech,#wave-banner){font-family:var(--game)!important;font-weight:400!important}
/* 3.0 영웅 고비 레벨: 고비 바로 앞 카드엔 푸른 '고비' 도장(오른쪽 위), 넘은 고비는 그림 옆 매듭 띠 색(청·홍·금). */
.tier-stamp{position:absolute;right:-4px;top:2px;z-index:1;min-width:clamp(48px,16cqw,64px);max-width:62%;height:clamp(35px,11.6cqw,46px);display:flex;align-items:center;justify-content:center;background:url(sprites/ui-reco.webp) center/100% 100% no-repeat;filter:hue-rotate(205deg) saturate(1.2);color:#fff;font-size:clamp(10px,3.3cqw,14px);font-weight:900;transform:rotate(8deg);text-shadow:0 1px 0 #0c2a7a;white-space:nowrap;padding:0 12px 2px;overflow:hidden;text-overflow:ellipsis}
#items .item[data-tier] .item-picture{position:relative}
#items .item[data-tier] .item-picture::after{content:"";position:absolute;left:calc(50% + 14px);bottom:0;width:18px;height:18px;border-radius:50%;border:2px solid #3b2410;box-shadow:inset 0 0 0 3px #f3e6c4;background:var(--knot)}
#items .item[data-tier="1"]{--knot:#3d7bd8}
#items .item[data-tier="2"]{--knot:#d8423d}
#items .item[data-tier="3"]{--knot:#f2c230}
html:is([lang=ko],[lang=en],[lang=es],[lang=pt-BR],[lang=id],[lang=de],[lang=fr]) .tier-stamp{font-family:var(--game)!important;font-weight:400!important}
/* 축하 화면: 위 알림(도전 과제) 아래로 내리고, 꼬리표는 붉은 두루마리 띠처럼 또렷하게. */
#stage.celebrating .celebrate{padding-top:clamp(96px,16vh,130px)}
#stage.celebrating .celebrate .eyebrow{display:inline-block;padding:6px 18px;border-radius:999px;background:#7a1f12;border:2px solid #f2c230;color:#ffe9b0;font-size:clamp(14px,4.2vw,18px);font-weight:900;box-shadow:0 3px 0 #3b120a}
html:is([lang=ko],[lang=en],[lang=es],[lang=pt-BR],[lang=id],[lang=de],[lang=fr]) #stage.celebrating .celebrate :is(.eyebrow,h1){font-family:var(--game)!important;font-weight:400!important}
@media (max-height:700px){#stage.celebrating .celebrate{padding-top:74px}#stage.celebrating .celebrate h1{margin:6px 0}}

/* 냥도사 말풍선: 목소리와 같이 뜬다. 판에서는 냥도사 머리 위, 다른 화면에서는 그 화면의 냥도사 그림 위. */
.dosa-say{position:absolute;z-index:6;left:0;top:0;margin:0;pointer-events:none;transform:translate(-50%,-100%);width:max-content;max-width:min(64%,280px);text-align:center;font-weight:700;font-size:13px;line-height:1.3;border-radius:18px;background:#fff8e6;border:2.5px solid #3a2414;color:#3a2414;padding:7px 12px;animation:say-pop .18s ease-out}
.dosa-say::after{content:"";position:absolute;left:var(--tail,50%);bottom:-15px;transform:translateX(-50%);border:7px solid transparent;border-top:9px solid #3a2414}
.dosa-say.below::after{bottom:auto;top:-15px;border-top:7px solid transparent;border-bottom:9px solid #3a2414}
@keyframes say-pop{from{transform:translate(-50%,-100%) scale(.7);opacity:0}}
@media(prefers-reduced-motion:reduce){.dosa-say{animation:none}}
html:is([lang=ko],[lang=en],[lang=es],[lang=pt-BR],[lang=id],[lang=de],[lang=fr]) .dosa-say{font-family:var(--game)!important;font-weight:400!important}
/* 3.0 글자·판 재검수: 잉크(실제 칠해진 글자)를 판 안쪽 면 가운데에 — ui-plaque 면 세로 36~84%, ui-scroll-s 면 세로 17~59% */
.title-screen .home-title .eyebrow{padding-bottom:calc(var(--w)*.06)}
html:not([lang=ko]) .scroll-dlg .panel button.primary{padding:16px 12% 1px}
html[lang=th] .scroll-dlg .panel button.primary{padding:19px 12% 0}
html[lang=ko] .scroll-dlg .panel button.primary{padding:calc(6% + 3px) 12% calc(2% - 3px)}
html[lang=ko] #result #upgrade{padding-top:calc(var(--w)*.333*.3 + 3px);padding-bottom:calc(var(--w)*.333*.12 - 3px)}
/* 3.0 글자·판 재검수: 긴 이름(Livro de recordes 등)은 돌판 안에서 두 줄 */
.title-screen .home-actions .home-stones button:is(:lang(es),:lang(fr),:lang(pt-BR),:lang(de)){white-space:normal;line-height:1;font-size:12px;overflow-wrap:normal;word-break:keep-all}
#help-panel .panel{padding-left:22px!important;padding-right:22px!important} /* 글이 양쪽 술 장식 안쪽에서 */
html:not([lang=ko]):not([lang=de]) .item small{hyphens:manual}html[lang=de] .item small{hyphenate-limit-chars:10 5 5}.item small{text-wrap-style:balance} /* "Re-/gen."처럼 짧은 낱말이 끊기지 않게 */
/* 제목 밑줄: 제목이 세 줄이 되어도 글자를 지나지 않게 맨 아래에 4px 띠로 */
.scroll-dlg .panel h1{background:linear-gradient(#b8282877,#b8282899) left bottom/100% 4px no-repeat;padding-bottom:8px;margin-bottom:6px}
/* 낮은 화면(360x640 등): 성 다시 쌓기 창이 화면보다 길어 '돌아가기'가 아래로 숨던 것 → 그림·단추를 줄여 한 화면에 */
@media (max-height:720px){#rebuild-dialog .rebuild-art{width:30%}#rebuild-dialog #rebuild-confirm{min-height:0;height:64px;font-size:17px}#rebuild-dialog .panel{gap:4px}#rebuild-dialog .panel>p{font-size:13px;line-height:1.35}#rebuild-dialog #rebuild-cancel{min-height:40px}}
#help-panel .panel h1{padding-inline:6px}
html:not([lang=ko]):not([lang=de]) :is(#farm .lbl,#finish .lbl){hyphens:manual} html[lang=de] :is(#farm .lbl,#finish .lbl){hyphenate-limit-chars:10 5 5} /* "Recolec-/tar"처럼 낱말 중간 하이픈 없이 */
html:lang(ja) :is(#items .item small,#items .item strong,.slot-hint,#result p,#result small,.home-record,#home-record){word-break:auto-phrase!important;text-wrap-style:balance} /* "ダメ/ージ"처럼 낱말 중간에서 끊기지 않게 */
/* 일본어: 낱말(구) 단위로만 줄을 바꾸고, 짧은 글은 줄 길이를 고르게 ("ニャ！" "続/ける"만 홀로 남지 않게) */
html:lang(ja) body :is(p,span,small,strong,b,h1,h2,h3,li,button,div,a,em,label){word-break:auto-phrase!important;overflow-wrap:break-word}
html:lang(ja) body :is(p,span,small,strong,b,h1,h2,h3,li,button,label):not(#help-panel p){text-wrap-style:balance}
#items .item small .dp{display:inline-block;max-width:100%}
#items .item small{padding-inline:4px}
#items .item strong{text-wrap-style:balance}
.bk-board .osc-heading{left:33%;right:33%;top:8.6%;height:12.8%;line-height:1.35;overflow:hidden} /* 도전 과제 판: 그림 속 금빛 이름판 안쪽 면(잰 값 33~67%, 8.6~21.4%)에 글을 맞춘다 */
#session .panel{padding-left:14px!important;padding-right:14px!important} /* 다른 놀이 카드·제목이 두루마리 찢긴 가장자리에 닿지 않게 */
#session .panel :is(p,span,strong,b,small,em,h1,h2,h3,div){text-wrap-style:balance}
#home-record .dp,#rush-sub .dp{display:inline-block}
.dpw{text-align:center;text-wrap-style:balance}
#farm,#finish{padding-left:9%!important;padding-right:9%!important} /* 돌 단추 빗면 안쪽에만 글씨 */
html:is([lang=th],[lang=vi]) :is(#farm .lbl,#finish .lbl){line-height:1.3;max-height:2.7em;overflow:visible} /* 위아래 표시(ạ ỏ ้) 잘림 없이 */
#result-hint{padding-inline:12px;text-wrap-style:balance} /* 안내문이 두루마리 찢긴 가장자리에 닿지 않게 */
#result.lost .panel h1{background:none;text-wrap-style:balance}
#result.lost .panel h1 .hl{background:linear-gradient(transparent 66%,#ffd84a99 66%,#ffd84a99 90%,transparent 90%) no-repeat;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-inline:.12em}
/* 2026-12-02 결과 두루마리: 긴 웨이브 띠(Gelombang 56 · Kumpulkan / beras)가 두루마리 막대 위까지 넓어지고 낱말 하나만 다음 줄로 가던 것 → 종이 안쪽 폭에서 고르게 두 줄 */
#result #result-tag{max-width:84%;text-wrap:balance}
/* 추천 카드 이름(Burg-LP verbessern)이 카드 오른쪽 테두리 밖으로 나가던 것 → 칸 안에서 줄바꿈 */
#result #result-reco strong{min-width:0;overflow-wrap:break-word;text-wrap:balance;text-align:center}
/* 기록장: 도전 알림이 칭호 현판 글자를 덮던 것 → 작게, 현판 아래 책상·냥도사 몸 쪽으로 */
html:has(#book-panel:not([hidden])) .osc-toast{top:calc(env(safe-area-inset-top,0px) + min(56vw,236px))!important;padding:5px 12px!important;font-size:12px!important;line-height:1.25!important}
/* 두루마리 창이 떠 있을 때 도전 알림이 창 제목을 덮던 것 → 작게 맨 위(두루마리 윗막대 그림 위)로 */
html:has(.scroll-dlg:not([hidden])) .osc-toast{top:calc(env(safe-area-inset-top,0px) + 4px)!important;padding:4px 12px!important;font-size:12px!important;line-height:1.2!important}
#result .panel h1 .hl{font-family:inherit!important;font-weight:inherit!important;-webkit-text-stroke:inherit} /* 형광펜 span이 일반 글꼴로 바뀌어 제목이 가늘어지던 것 */
#begin.primary{padding-right:9.5%!important} /* "Mulai gelombang 56" 끝 글자가 오른쪽 금테에 닿던 것 */
/* 공방(강화) 화면: 도전 알림이 냥도사 말풍선·공방 현판을 덮던 것 → 작게 맨 위(홈·소리 단추 줄)로 잠깐 */
html:has(#stage.shopping) .osc-toast{top:calc(env(safe-area-inset-top,0px) + 4px)!important;padding:4px 12px!important;font-size:12px!important;line-height:1.2!important}

/* 2026-12-02 강화 화면 말풍선: 간판 아래·냥도사 오른쪽, 꼬리는 왼쪽 */
.dosa-say.side{transform:none}
.dosa-say.side::after{left:-16px;bottom:auto;top:var(--tail-y,50%);transform:translateY(-50%);border:7px solid transparent;border-right:9px solid #3a2414;border-top-color:transparent}
/* 2026-12-02 두목 러시 단추: 긴 이름(vi·pt-BR)이 나무판 오른쪽 끝을 넘던 것 → 글자를 판 안쪽에 맞춰 줄인다 */
html:is([lang=vi],[lang=pt-BR],[lang=es],[lang=fr],[lang=de],[lang=id]) #rush>span:first-child{display:block;font-size:.84em;letter-spacing:-.01em}
