/* 냥냥대군
   밤길 행진 게임. 퇴마록과 같은 남보라 밤 톤에, 포인트는 숫자 문 파랑과 츄르 분홍. */
:root {
  --bg: #15122f;
  --surface: #241e48;
  --surface-2: #2f2860;
  --ink: #f3f0ff;
  --sub: #aaa3d6;
  --line: #3a3270;
  --accent: #ffd23f;
  --accent-ink: #2a1d00;
  --red: #ff5a4e;
  --jade: #6fe3c8;
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.35);
  --game: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--game); font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.stage { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 6px; }
.logo { font-family: var(--game); font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: 0.04em; }
.logo b { color: #ff4867; font-weight: 400; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; }
.icon-btn svg { width: 20px; height: 20px; }

.screen { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; padding: 8px 16px calc(env(safe-area-inset-bottom, 0px) + 16px); }
.screen.measuring > * { flex-shrink: 0; }
.sub { color: var(--sub); }
.small { font-size: 13px; }
.center { text-align: center; }
.fine { font-size: 12px; color: var(--sub); text-align: center; }

.btn { min-height: 52px; border-radius: 16px; border: 0; padding: 10px 16px; font-size: 16px; font-weight: 700; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); transition: transform .08s ease; text-decoration: none; display: grid; place-items: center; text-align: center; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.primary { background: var(--accent); color: var(--accent-ink); font-family: var(--game); font-weight: 400; font-size: 22px; box-shadow: 0 6px 0 #b8860b, var(--shadow); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #b8860b, var(--shadow); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--sub); font-weight: 400; min-height: 44px; }
.actions { display: grid; gap: 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 12px; border-radius: 99px; background: var(--surface); border: 0; color: var(--ink); font-size: 13px; font-weight: 700; box-shadow: var(--shadow); }
.chip .ico { width: 18px; height: 18px; }
.chip.new { background: var(--accent); color: var(--accent-ink); animation: pop .5s ease-out both .9s; }
.ico { width: 28px; height: 28px; object-fit: contain; flex: none; }
.seg { display: flex; align-items: center; justify-content: center; gap: 2px; background: var(--surface); border-radius: 99px; padding: 4px; box-shadow: var(--shadow); align-self: center; }
.seg-lbl { font-size: 12px; color: var(--sub); padding: 0 6px 0 8px; }
.seg button { border: 0; background: transparent; border-radius: 99px; min-width: 38px; min-height: 34px; font-weight: 700; font-size: 14px; color: var(--sub); }
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 92px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 20; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }

/* ---- 살아 있는 행진(시작·결과) */
.parade { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 24px; overflow: hidden; background: #1b1440; box-shadow: var(--shadow); isolation: isolate; flex: none; }
.parade .bg { position: absolute; inset: 0; background: url("sprites/bg-start.webp") center 70% / cover no-repeat, linear-gradient(#1b1440, #563067); }
.parade.lose .bg { filter: saturate(.7) brightness(.75); }
.gate-deco { position: absolute; left: 66%; top: 5%; width: 46%; translate: -50% 0; filter: drop-shadow(0 0 14px rgba(110, 190, 255, .6)); }
.gate-num { position: absolute; left: 66%; top: 20%; translate: -50% 0; font: 34px/1 var(--game); color: #fff; -webkit-text-stroke: 6px #1b1440; paint-order: stroke; }
.gate-num.bad { color: #ffd7d3; }
.gate-deco.pass, .gate-num.pass { animation: gatepass 2.2s ease-in both; }
@keyframes gatepass { 0% { opacity: 0; transform: scale(.55); } 15% { opacity: 1; transform: scale(.8); } 40% { transform: scale(1.05); opacity: 1; } 55% { transform: scale(1.6); opacity: 0; } 100% { opacity: 0; transform: scale(.55); } }
.march { position: absolute; left: 50%; bottom: 3%; width: 78%; translate: -50% 0; display: grid; grid-template-columns: repeat(5, 1fr); justify-items: center; align-items: end; gap: 0 2px; }
.mc { width: 100%; max-width: 56px; margin-top: -42%; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .45)); animation: bob .26s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.07s); }
.march .mc:nth-child(5n+1), .march .mc:nth-child(5n) { translate: 0 -8%; }
@keyframes bob { to { transform: translateY(-5%); } }
.parade .hero-btn { position: absolute; left: 50%; bottom: 13%; width: 26%; transform: translateX(-50%); border: 0; background: none; padding: 0; z-index: 2; }
.count-badge { position: absolute; left: 50%; top: 47%; translate: -50% 0; background: #2f80ff; color: #fff; font: 26px/1 var(--game); padding: 7px 14px; border-radius: 14px; border: 3px solid #fff; box-shadow: var(--shadow); z-index: 3; font-variant-numeric: tabular-nums; }
.count-badge.pop { animation: pop .35s ease-out; }
.invite { background: #3b2a7a; border: 2px solid var(--accent); border-radius: 16px; padding: 10px 14px; text-align: center; font-size: 15px; word-break: keep-all; }
.invite b { color: var(--accent); }
.btn.daily { background: #2f80ff; color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0; line-height: 1.2; }
.btn.daily .sub { color: #dbe9ff; font-weight: 400; }
.btn.daily.hot { animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 4px var(--accent), var(--shadow); } }
b.hot { color: var(--accent); }
.result .march { width: 92%; }
.result .hero-pose.big { position: absolute; left: 50%; bottom: 4%; width: 36%; transform: translateX(-50%); animation: none; z-index: 2; }
.result .hero-pose.cheer { animation: cheer 1s ease-in-out infinite; }
.result .hero-pose.down { width: 40%; bottom: 0; }
@keyframes cheer { 50% { transform: translateX(-50%) translateY(-6%); } }
.runaway { position: absolute; bottom: 4%; width: 20%; animation: run 1.6s linear infinite; }
.runaway.r1 { left: 2%; }
.runaway.r2 { right: 2%; transform: scaleX(-1); animation-delay: -.8s; }
@keyframes run { 50% { translate: 0 -10%; } }
.result .bubble { animation: pop .4s ease-out .3s both; }
.stamp { position: absolute; right: 5%; top: 8%; border: 4px solid var(--red); color: var(--red); font-family: "Gowun Batang", serif; font-weight: 700; font-size: 20px; padding: 2px 10px; border-radius: 6px; transform: rotate(-10deg); background: rgba(255, 255, 255, .85); animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) .5s both; z-index: 3; }
@keyframes stamp { from { transform: rotate(-10deg) scale(2.4); opacity: 0; } }
.hero-pose { width: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); animation: idle 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes idle { 50% { transform: scaleY(.97) scaleX(1.02); } }
.bubble { position: absolute; left: 4%; top: 5%; max-width: 44%; background: #fff; color: #1d1838; border-radius: 16px 16px 16px 4px; padding: 7px 12px; font-family: var(--game); font-size: 15px; line-height: 1.35; box-shadow: var(--shadow); word-break: keep-all; z-index: 4; }
.bubble.sul { background: #efe6ff; }
.bubble.pop { animation: pop .3s ease-out; }
.hero-title { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.hero-title h1 { font-size: 44px; line-height: 1.05; letter-spacing: -0.01em; text-shadow: 0 3px 0 #000a; }
.hero-title h1 em { font-style: normal; color: var(--accent); }
.hero-title .lede { color: var(--sub); font-size: 15px; word-break: keep-all; }

.res-title { text-align: center; }
.res-title h2 { font-size: 30px; color: var(--accent); animation: pop .5s ease-out .6s both; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stats div { background: var(--surface); border-radius: 14px; padding: 8px 4px; text-align: center; display: flex; flex-direction: column; }
.stats b { font-family: var(--game); font-weight: 400; font-size: 22px; font-variant-numeric: tabular-nums; }
.stats span { font-size: 11px; color: var(--sub); }
.earn { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; flex-wrap: wrap; }
.earn b { font-family: var(--game); font-weight: 400; font-size: 22px; color: var(--accent); }
.unlocks { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

/* ---- 상점 */
.shop-head { display: flex; align-items: flex-end; gap: 8px; }
.shop-sul { width: 84px; height: 84px; object-fit: contain; flex: none; }
.say { flex: 1; background: var(--surface); border-radius: 18px 18px 18px 6px; padding: 10px 14px; margin-bottom: 12px; font-size: 15px; word-break: keep-all; }
.say .who { display: block; font-size: 11px; color: var(--sub); }
.purse { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; }
.purse b { font-family: var(--game); font-weight: 400; font-size: 26px; color: var(--accent); }
.shop-list, .dex-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shop-row { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 16px; padding: 8px 10px; }
.shop-row > .ico { width: 44px; height: 44px; }
.shop-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 3px; background: var(--line); }
.pips i.on { background: var(--accent); }
.btn.buy { min-height: 42px; min-width: 76px; padding: 4px 10px; font-family: var(--game); font-weight: 400; font-size: 17px; display: flex; gap: 2px; background: var(--surface-2); }
.btn.buy .ico { width: 20px; height: 20px; }

/* ---- 도감 */
.screen-title { font-size: 26px; text-align: center; }
.dex-grid { grid-template-columns: 1fr 1fr; }
.dex-grid li { display: contents; }
.dex-card { width: 100%; border: 2px solid transparent; color: var(--ink); font: inherit; background: var(--surface); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.dex-card img { width: 72px; height: 72px; object-fit: contain; }
.dex-card.unseen img { filter: brightness(0) opacity(.5); }
.dex-card.on { border-color: var(--accent); }
.dex-grid { grid-template-columns: 1fr 1fr 1fr; }
.dex-card b { font: 15px var(--game); }
.dex-card .cnt { font-size: 12px; color: var(--accent); font-weight: 700; }

/* ---- 판 */
.stage.playing .topbar { display: none; }
.stage.playing .screen { padding: 0; }
.play { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #221c40; touch-action: none; }
.play canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px 0; pointer-events: none; display: flex; flex-direction: column; gap: 6px; }
.hud-row { display: grid; grid-template-columns: 44px 1fr 92px; align-items: center; }
.hud .pause { pointer-events: auto; width: 40px; height: 40px; background: rgba(0, 0, 0, .45); box-shadow: none; }
.hud .pause svg { width: 18px; height: 18px; }
.where { text-align: center; font: 18px/1.1 var(--game); color: #fff; text-shadow: 0 2px 0 #000a; }
.peak { text-align: right; font: 14px/1.2 var(--game); color: #ffe14a; text-shadow: 0 1px 2px #000; }
.prog { height: 8px; margin: 0 6px; border-radius: 4px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7cc8ff, #ffe14a); }
.banner { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); white-space: nowrap; font: 24px/1.2 var(--game); color: #fff; text-shadow: 0 3px 0 #000, 0 0 12px #000; pointer-events: none; opacity: 0; }
.banner.on { animation: banner 1s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -50%) scale(1.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 1; } }
.overlay { position: absolute; inset: 0; background: rgba(10, 8, 30, .72); display: grid; place-items: center; padding: 16px; z-index: 5; backdrop-filter: blur(2px); }
.panel { width: 100%; max-width: 400px; background: var(--surface); border-radius: 22px; padding: 18px 14px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; box-shadow: var(--shadow); animation: pop .3s ease-out; }
.panel h2 { font-size: 24px; }
.kicker { font: 16px var(--game); color: var(--accent); }

.cardimg { width: 100%; border-radius: 18px; box-shadow: var(--shadow); -webkit-touch-callout: default; user-select: auto; }

/* ---- 아래 설명 글 */
.guide { max-width: 480px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 28px; }
.guide section { display: flex; flex-direction: column; gap: 10px; }
.guide h2 { font-size: 24px; }
.guide p, .guide li { font-size: 15px; max-width: 65ch; }
.guide a { color: var(--accent); }
.guide ul, .guide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.arcana { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; list-style: none; padding: 0 !important; }
.arcana li { background: var(--surface); border-radius: 14px; padding: 8px 12px; font-size: 13px; }
.arcana b { display: block; font-family: var(--game); font-weight: 400; font-size: 16px; }
.log { font-size: 14px; }
.site-foot { border-top: 1px solid var(--line); padding-top: 16px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.site-foot a { color: var(--sub); }

/* ---- 작은 화면 */
.stage.fit1 .parade { width: 86%; align-self: center; }
.stage.fit1 .hero-title h1 { font-size: 36px; }
.stage.fit1 .btn { min-height: 46px; }
.stage.fit1 .shop-sul { width: 60px; height: 60px; }
.stage.fit2 .parade { width: 66%; }
.stage.fit2 .hero-title .lede, .stage.fit2 .screen > .fine { display: none; }
.stage.fit2 .bubble { font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  .mc, .hero-pose, .runaway, .gate-deco, .gate-num { animation: none !important; }
}

/* ---- 냥도사 스킬 버튼: 게이지가 아래에서 차오르고, 다 차면 빛난다 */
.skill { position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); width: 76px; height: 76px; border-radius: 50%; border: 3px solid #fff; background: #2a2160; overflow: hidden; padding: 0; z-index: 4; box-shadow: var(--shadow); color: #fff; touch-action: manipulation; }
.skill img { position: absolute; inset: 4px 6px 14px; width: calc(100% - 12px); height: calc(100% - 18px); object-fit: contain; z-index: 2; filter: grayscale(.6) brightness(.8); }
.skill i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#ffe14a, #ff9f1c); z-index: 1; transition: height .2s; }
.skill b { position: absolute; left: 0; right: 0; bottom: 6px; z-index: 3; font: 12px/1 var(--game); font-weight: 400; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.skill:disabled { opacity: .85; }
.skill.ready { animation: skillglow .8s ease-in-out infinite alternate; }
.skill.ready img { filter: none; }
.skill.waiting { border-color: #92909a; }
.skill.waiting i { background: #66616e; }
.skill.waiting b { font-size: 11px; }
@keyframes skillglow { from { box-shadow: 0 0 0 0 rgba(255, 225, 74, .9), var(--shadow); transform: scale(1); } to { box-shadow: 0 0 0 10px rgba(255, 225, 74, 0), var(--shadow); transform: scale(1.06); } }
/* ---- 디펜스 바리케이드 체력 */
.wallbar { display: flex; align-items: center; gap: 8px; margin-top: 6px; font: 13px/1 var(--game); color: #fff; text-shadow: 0 1px 2px #000; }
.wallbar[hidden] { display: none; }
.wallbar div { flex: 1; height: 10px; border-radius: 99px; background: rgba(0, 0, 0, .45); overflow: hidden; border: 1.5px solid rgba(255, 255, 255, .7); }
.wallbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #6fe38a, #b8f36a); transition: width .2s; }
.wallbar i.low { background: linear-gradient(90deg, #ff5a4e, #ff9f6a); }
/* ---- 마을 지도 */
.vmap { background: var(--surface); border-radius: 18px; padding: 10px 12px; box-shadow: var(--shadow); }
.vmap ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; position: relative; }
.vmap li { text-align: center; font-size: 11px; color: var(--sub); line-height: 1.25; word-break: keep-all; }
.vmap li::before { content: ""; display: block; width: 22px; height: 22px; margin: 0 auto 4px; border-radius: 50%; background: #3a3270; border: 2px solid #4b4290; }
.vmap li.won { color: var(--ink); }
.vmap li.won::before { background: radial-gradient(circle, #ffe9a8, #ffb03a); border-color: #ffd23f; box-shadow: 0 0 10px rgba(255, 200, 80, .7); }
.vmap li.now { color: var(--accent); font-weight: 700; }
.vmap li.now::before { background: #2f80ff; border-color: #fff; animation: pop 1s ease-in-out infinite alternate; }
.vstep { margin: 8px 0 0; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.vstep .dots { display: inline-flex; gap: 3px; }
.vstep .dots i { width: 10px; height: 10px; border-radius: 3px; background: #3a3270; }
.vstep .dots i.defense { background: #5a2f4e; }
.vstep .dots i.boss { width: 14px; background: #6a2a2a; }
.vstep .dots i.done { background: #6fe3c8; }
.vstep .dots i.now { background: var(--accent); box-shadow: 0 0 0 2px #fff; }
.village-won { text-align: center; background: linear-gradient(90deg, #4a2a10, #7a4a14); border: 2px solid var(--accent); border-radius: 16px; padding: 10px 14px; margin: 0; word-break: keep-all; animation: pop .5s ease-out both .6s; }
.village-won b { color: var(--accent); }
b.stars { color: var(--accent); letter-spacing: 2px; }

/* 행운 부적 안내 */
.lucky-tip { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 0; padding: 9px 12px; border-radius: 14px; background: rgba(255,255,255,.08); border: 1px dashed rgba(255,255,255,.35); color: inherit; text-decoration: none; font-size: 14px; line-height: 1.4; text-align: center; word-break: keep-all; }
.lucky-tip i { width: 12px; height: 12px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(0,0,0,.25); }
.lucky-tip span { flex-basis: 100%; }
.lucky-tip b { color: var(--accent); }
.lucky-tip u { color: #ffe14a; text-underline-offset: 3px; }
.lucky-tip.known { border-style: solid; }
.lucky-tip.known i { margin-right: 4px; }
/* 냥술사 응원 */
.cameo { position: absolute; left: 10px; right: 10px; top: 64px; display: flex; align-items: center; gap: 8px; pointer-events: none; z-index: 6; animation: cameoIn .45s cubic-bezier(.3, 1.4, .5, 1) both; }
.cameo.out { animation: cameoOut .4s ease-in both; }
.cameo img, .sul-say img { width: 72px; height: 72px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 6px rgba(0,0,0,.4)); }
.cameo p, .sul-say p { margin: 0; background: #efe6ff; color: #1d1838; border-radius: 16px 16px 16px 4px; padding: 8px 12px; font-family: var(--game); font-size: 15px; line-height: 1.35; word-break: keep-all; box-shadow: var(--shadow); }
.cameo .who, .sul-say .who { display: block; font-size: 11px; color: #7a5bd0; }
.sul-say { display: flex; align-items: center; gap: 8px; animation: pop .5s ease-out both .9s; }
@keyframes cameoIn { from { transform: translateX(-110%); opacity: 0; } }
@keyframes cameoOut { to { transform: translateX(-110%); opacity: 0; } }

/* 공통 추천 카드: 게임의 밝기·테마를 따른다. */
:root { --orak-next-bg: var(--surface, #24263d); --orak-next-ink: var(--ink); --orak-next-sub: var(--sub); }

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

/* 시작은 화면을 채운 행진 원화와 아래 네 메뉴에 집중한다. */
.stage.title-screen{background:url('sprites/bg-start.webp') center/cover no-repeat}.title-screen .screen{position:relative;gap:8px;padding:8px 14px calc(env(safe-area-inset-bottom,0px) + 12px);background:linear-gradient(#16122e22,#16122e55 65%,#16122ecc)}
.title-screen .parade,.stage.title-screen.fit1 .parade,.stage.title-screen.fit2 .parade{flex:1;min-height:220px;width:100%;aspect-ratio:auto;border-radius:0;background:transparent;box-shadow:none}.title-screen .parade .bg{background:none}
.title-screen .hero-title{order:-1}.title-screen .actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;flex:none}.title-screen .actions .row2{display:contents}.title-screen .actions .btn{min-width:0;min-height:60px;font-size:13px;padding:8px 3px;box-shadow:0 2px 8px #0005}.title-screen .actions small{font-size:9px}.title-screen .vmap,.title-screen .lucky-tip,.title-screen .fine{display:none}.title-screen .chips{font-size:11px}.title-screen .hero-title .lede{font-size:12px}
/* 원정 버튼은 글자가 길어 한 칸을 더 넓게, 낱말 중간에서 줄이 바뀌지 않게 */
.title-screen .actions{grid-template-columns:1.35fr 1fr 1fr 1fr}.title-screen .actions .btn{word-break:keep-all;line-height:1.25}
/* 시작 화면 원정 버튼은 오늘의 길처럼 두 줄: 단계 숫자가 커져도 모양이 그대로다 */
.btn.go2 { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0; line-height: 1.2; }
.btn.go2 .sub { font-family: var(--font, inherit); font-weight: 700; color: var(--accent-ink); opacity: .8; white-space: nowrap; }
.title-screen .actions .btn.go2 { font-size: 15px; }
/* 긴 고양이 이름과 번역 문장이 카드/버튼 폭을 늘리지 않게 한다. */
html:not([lang=ko]) :is(.btn,.dex-card,.shop-txt,.bubble){min-width:0;overflow-wrap:anywhere}
html:not([lang=ko]) .btn.go2 .sub{white-space:normal}

/* Campaign map and records */
.icon-btn { min-width:44px; min-height:44px; }
.btn, html:not([lang=ko]) .btn { word-break:keep-all; overflow-wrap:normal; hyphens:none; }
.title-screen .actions { grid-template-columns:repeat(2,minmax(0,1fr)); }
.title-screen .actions .row2 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); grid-column:1/-1; gap:6px; }
.title-screen .actions .btn { min-height:44px; }
.title-screen .actions .go2,.title-screen .actions .daily { min-height:52px; }
.title-screen .vmap { display:block; flex:none; }
.title-screen .parade,.stage.title-screen.fit1 .parade,.stage.title-screen.fit2 .parade { min-height:120px; }
.vmap ol { gap:0; }
.vmap li { min-width:0; flex:1; }
.vmap li button { width:100%; min-height:44px; border:0; padding:2px; color:var(--ink); background:transparent; font-size:11px; word-break:keep-all; }
.vmap li button:disabled { color:var(--sub); }
.vstep { gap:0; margin:0; }
.vstep > b { font-size:11px; }
.vstep .dots,.dots { display:grid; grid-template-columns:repeat(5,minmax(44px,1fr)); gap:0; width:100%; }
.stage-dot { min-width:44px; min-height:44px; padding:6px; border:0; background:transparent; color:var(--sub); }
.stage-dot span { display:grid; place-items:center; min-height:32px; min-width:32px; background:var(--surface-2); border-radius:8px; font-weight:700; }
.stage-dot.done { color:var(--jade); }
.stage-dot.now span { background:var(--accent); color:var(--accent-ink); }
.stage-dot:disabled { opacity:.4; }
.village-sheet { background:var(--bg); color:var(--ink); border:1px solid var(--line); border-radius:20px; width:min(90vw,400px); max-height:80dvh; overflow:auto; }
.village-sheet::backdrop { background:#0009; }
.village-sheet h2 { text-align:center; }
.campaign-result { display:flex; gap:12px; align-items:center; }
.campaign-result [data-breakdown] { flex:1; min-width:0; }
.grade-stamp { font:60px/1 var(--game); color:var(--accent); border:4px solid currentColor; border-radius:12px; padding:4px 12px; transform:rotate(-10deg); animation:grade-seal .45s ease-out both; }
.grade-A { color:var(--jade); } .grade-B { color:#a5bbff; }
@keyframes grade-seal { from { opacity:0; transform:scale(1.8) rotate(-18deg); } to {opacity:1;transform:scale(1) rotate(-10deg);} }
.replay-label,.campaign-rank { text-align:center; font-size:12px; color:var(--jade); }
.result-screen .screen { gap:6px; }
.result-screen .parade,.result-screen.fit1 .parade,.result-screen.fit2 .parade { width:100%; height:130px; aspect-ratio:auto; }
.result-screen .result .hero-pose.big { width:90px; }
.result-screen .result .march { width:65%; }
.result-screen .res-title h2 { font-size:23px; }
.result-screen .stats { padding:6px; }
.result-screen .stats b { font-size:23px; }
.result-screen .earn { font-size:14px; }
.result-screen .actions { gap:6px; }
.result-screen .btn { min-height:44px; padding:7px 10px; }
.result-screen .village-won { font-size:12px; }
.result-screen .sul-say img { width:36px; height:36px; }
.result-screen .sul-say p { font-size:11px; padding:4px 8px; }
.result-screen .unlocks .chip { font-size:11px; padding:2px 7px; }
.screen:has(> .osc-book) { padding:0; overflow:hidden; }
.osc-book { flex:1; min-height:0; }
@media(max-height:760px) {
  .title-screen .hero-title .lede { display:none; }
  .title-screen .game-logo { width:240px; }
  .result-screen .parade,.result-screen.fit1 .parade,.result-screen.fit2 .parade { height:95px; }
  .result-screen .screen { gap:4px; }
  .result-screen .bubble { font-size:11px; }
}
@media(prefers-reduced-motion:reduce) { .grade-stamp { animation:none; } }

.result-screen .orak-next { margin-top:0; gap:4px; grid-template-columns:repeat(2,minmax(0,1fr)); }
.result-screen .orak-next-title { grid-column:1/-1; font-size:12px; }
.result-screen .orak-next-card { min-height:44px; padding:4px 6px; gap:5px; border-radius:10px; }
.result-screen .orak-next-icon,.result-screen .orak-next-icon img { width:30px; height:30px; flex-basis:30px; }
.result-screen .orak-next-text strong { font-size:11px; }
.result-screen .orak-next-sub { font-size:9px; }
.result-screen .orak-next-arrow { font-size:16px; }
.result-screen .osc-compact .osc-total { flex-direction:row; justify-content:space-between; padding:4px 0 0; }
.result-screen .osc-compact .osc-seal { position:static; margin:0 5px; }
.result-screen .osc-compact .osc-number { font-size:28px; }
.result-screen .osc-compact { padding:8px 12px; }
@media(prefers-reduced-motion:reduce) { .result-screen .res-title h2,.result-screen .stamp,.result-screen .chip.new,.result-screen .sul-say {animation:none;} }

.result-screen .screen > * { flex-shrink:0; }
.result-screen .res-title { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:0 8px; }
.result-screen .res-title h2 { font-size:20px; line-height:1.2; }
.result-screen .stats { gap:4px; padding:4px; }
.result-screen .stats > div { padding:4px; }
.result-screen .stats b { font-size:20px; line-height:1.15; }
.result-screen .stats span { font-size:10px; }
.result-screen .earn { line-height:1.3; }
.result-screen .earn .ico { width:20px; height:20px; }
.result-screen .osc-total .osc-delta { margin:0; font-size:11px; }
.result-screen .unlocks { display:flex; flex-wrap:wrap; gap:3px; justify-content:center; }
.result-screen .parade,.result-screen.fit1 .parade,.result-screen.fit2 .parade { height:90px; }
.result-screen .sul-say { min-height:32px; }
.result-screen .sul-say img { width:32px; height:32px; }
.result-screen .campaign-result { gap:8px; }
.result-screen .grade-stamp { font-size:45px; padding:3px 9px; }
.result-screen .osc-compact .osc-total { flex-wrap:nowrap; }
.result-screen .osc-compact .osc-seal { flex:none; }
.result-screen .osc-compact .osc-label { font-size:12px; }
.result-screen .osc-compact .osc-number { font-size:26px; }
.result-screen .screen { gap:4px; }
@media(max-height:760px) {
 .result-screen .parade,.result-screen.fit1 .parade,.result-screen.fit2 .parade {height:72px;}
 .result-screen .screen {gap:3px;padding-top:4px;padding-bottom:8px;}
 .result-screen .village-won {font-size:11px;line-height:1.2;}
 .result-screen .sul-say p {font-size:10px;line-height:1.15;}
}

.result-screen.fit1 .parade {height:60px;}
.result-screen.fit2 .parade {height:44px;}
.result-screen.fit1 .result .hero-pose.big {width:55px;}
.result-screen.fit1 .result .march {width:40%;}
.result-screen.fit1 .bubble {font-size:10px;padding:3px 6px;}
.result-screen .osc-label,.osc-book .osc-label,.osc-book .osc-sub {word-break:keep-all;overflow-wrap:normal;}

/* Challenge notifications leave the two header controls exposed. */
.osc-toast { max-width:calc(100% - 140px); padding:8px 10px; font-size:11px; }
body:has(.osc-book) .osc-toast { top:72px; bottom:auto; }

html:not([lang=ko]) .vmap ol { grid-template-columns:repeat(6,minmax(0,1fr)); gap:2px; }
html:not([lang=ko]) .vmap li button { font-size:10px; padding:2px 0; hyphens:auto; overflow-wrap:break-word; }
@media(prefers-reduced-motion:reduce) { .vmap li.now::before { animation:none; } }

@media(prefers-reduced-motion:reduce) { .village-won { animation:none; } }

.result-screen.fit2 .village-won { padding:4px 8px; font-size:11px; line-height:1.2; }
.result-screen.fit2 .sul-say p { padding:3px 6px; }

.result-screen.fit2 .screen { gap:2px; }
.result-screen.fit2 .unlocks { flex-wrap:nowrap; overflow-x:auto; justify-content:flex-start; min-height:24px; }
.result-screen.fit2 .unlocks .chip { flex:none; }
.result-screen.fit2 .res-title h2 { font-size:16px; }
.result-screen.fit2 .btn.primary { font-size:18px; line-height:1.15; }
.result-screen.fit2 .stamp { font-size:16px; max-width:48%; right:3%; top:6px; }
.result-screen .btn { word-break:keep-all; overflow-wrap:normal; }

.banner { width:max-content; max-width:calc(100% - 24px); white-space:normal; word-break:keep-all; overflow-wrap:normal; text-align:center; font-size:clamp(16px,5vw,24px); }
.result-screen.fit2 .village-won ~ .sul-say { display:none; }

.stage.title-screen .screen>.drag-instruction{display:block;font-size:11px;line-height:1.35;margin:2px 0}
.drag-hint{position:absolute;inset:auto 12% 20%;z-index:7;pointer-events:none;display:grid;justify-items:center;gap:7px;color:#fff3cd;text-align:center;text-shadow:0 2px 4px #000}
.drag-hint span{font-size:44px;animation:finger-drag 1.6s ease-in-out infinite}.drag-hint b{font-size:13px;line-height:1.4;background:#241b42d9;border-radius:12px;padding:8px}
@keyframes finger-drag{0%,100%{transform:translateX(-45px) rotate(-15deg)}50%{transform:translateX(45px) rotate(15deg)}}
@media(prefers-reduced-motion:reduce){.drag-hint span{animation:none}}

@media(max-height:690px){.stage.title-screen .screen{gap:5px}.stage.title-screen .parade,.stage.title-screen.fit1 .parade,.stage.title-screen.fit2 .parade{min-height:88px}}
/* 시작 화면 행진 칸이 낮으면 말풍선이 숫자 배지와 냥이를 덮으니 숨긴다. */
.title-screen .parade { container-type: size; }
.parade .bubble { text-wrap: balance; }
@container (max-height: 210px) { .title-screen .parade .bubble { display: none; } }
/* 숫자 배지는 냥도사 머리 위에 띄운다(가운데에 고정하면 칸 높이에 따라 냥도사 얼굴을 덮는다). */
.title-screen .parade .hero-btn { width: min(26cqw, 52cqh); bottom: 6cqh; }
.title-screen .parade .count-badge { top: auto; bottom: calc(6cqh + min(25cqw, 50cqh) + 2px); }

/* 끌기 안내는 무리 숫자 배지를 덮지 않게 무리 아래, 부적 단추 왼쪽에 띄운다. */
.drag-hint{inset:auto 26% 2.5% 4%}
.drag-hint b{text-wrap:balance}

/* 행진 칸이 아주 낮으면 숫자 배지가 로고와 냥도사를 덮으니 숨긴다. */
@container (max-height: 110px) { .title-screen .parade .count-badge { display: none; } }
/* 결과 행진 띠: 남는 높이를 채우고, 내용이 많을 때만 줄어든다(잘린 듯 납작한 띠 방지) */
.stage.result-screen .parade,.stage.result-screen.fit1 .parade,.stage.result-screen.fit2 .parade { flex:1 1 150px; height:auto; min-height:76px; max-height:170px; }
.stage.result-screen .unlocks { flex-wrap:wrap; overflow:visible; justify-content:center; }
.result-screen.fit3 .orak-next { display:none; }
.result-screen.fit3 .unlocks { flex-wrap:nowrap; }
.result-screen.fit3 .unlocks .chip { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.result-screen.fit3 .unlocks .chip.more { flex:none; }
.result-screen.fit3 .campaign-rank { font-size:11px; margin:0; }
.result-screen.fit3 .res-title h2 { font-size:19px; }
/* 작은 화면·긴 언어: 첫 화면 칩은 한 줄, 마을 이름은 작게 */
.stage.title-screen.fit2 .chips { flex-wrap:nowrap; gap:4px; }
.stage.title-screen.fit2 .chips > * { min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:11px; padding:4px 8px; }
.stage.title-screen.fit2 .vmap { padding:8px 10px; }
.stage.title-screen.fit2 .vmap li { font-size:10px; line-height:1.15; hyphens:auto; }
.stage.title-screen.fit2 .vmap li::before { width:18px; height:18px; margin-bottom:3px; }

/* ---- 3.0: 판 위쪽 나무 띠 (퇴마록 나무·금테 부품을 같이 씀) */
.hud-row { grid-template-columns: 48px 1fr 84px; gap: 4px; }
.hud .pause { width: 46px; height: 46px; border-radius: 50%; background: url(../toemarok/sprites/ui-medal.webp) center / contain no-repeat; color: #ffe9b8; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.hud .pause svg { width: 16px; height: 16px; }
.where { justify-self: center; min-width: 62%; max-width: 100%; padding: 9px 22px 10px; background: url(../toemarok/sprites/k-chip.webp) center / 100% 100% no-repeat; font: 16px/1.15 var(--game); color: #fff4da; text-shadow: 0 1px 0 #3a1a08, 0 0 4px #3a1a08; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.peak { justify-self: end; padding: 7px 10px 8px; background: url(../toemarok/sprites/k-paper.webp) center / 100% 100% no-repeat; font: 13px/1.1 var(--game); color: #5a2a0a; text-shadow: none; white-space: nowrap; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.prog { height: 12px; margin: 0 10px; border-radius: 99px; background: #2a1408; border: 2px solid #c99a4a; box-shadow: 0 1px 0 #5a3010, inset 0 1px 3px rgba(0, 0, 0, .6); position: relative; overflow: visible; }
.prog i { border-radius: 99px; background: linear-gradient(90deg, #ffb03a, #ffe14a); position: relative; }
.prog i::after { content: ""; position: absolute; right: -9px; top: -15px; width: 18px; height: 22px; background: url(sprites/flag.webp) center / contain no-repeat; }
.bossbar { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 2px auto 0; width: 76%; }
.bossbar[hidden] { display: none; }
.bossbar b { font: 15px/1.1 var(--game); font-weight: 400; color: #fff; padding: 6px 22px 7px; background: url(../toemarok/sprites/ui-band-red.webp) center / 100% 100% no-repeat; text-shadow: 0 1px 0 #3a0808; white-space: nowrap; }
.bossbar div { width: 100%; height: 14px; border-radius: 99px; background: #2a0a0a; border: 2px solid #c99a4a; overflow: hidden; }
.bossbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff3b2e, #ff8a4a); transition: width .15s; }
.wallbar div { border: 2px solid #c99a4a; background: #2a1408; }
.skill { border: 0; background: url(../toemarok/sprites/ui-medal.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); }
.skill i { left: 9px; right: 9px; bottom: 9px; border-radius: 0 0 40px 40px; opacity: .85; }
.skill img { inset: 8px 10px 18px; width: calc(100% - 20px); height: calc(100% - 26px); }
.skill b { bottom: 9px; }
.skill.ready { animation: skillglow2 .8s ease-in-out infinite alternate; }
@keyframes skillglow2 { from { filter: drop-shadow(0 0 2px #ffe14a) drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); transform: scale(1); } to { filter: drop-shadow(0 0 12px #ffe14a) drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); transform: scale(1.06); } }
.drag-hint.small span{font-size:30px;opacity:.8}
.where { font-size: clamp(13px, 3.9vw, 16px); }

/* ================================================================ 3.0 원정 진영: 나무·종이·부적 소재 (퇴마록 부품 함께 씀) */
.stage:not(.playing) { background: linear-gradient(rgba(21, 14, 44, .55), rgba(21, 14, 44, .82)), url(sprites/bg-start.webp) center top / cover no-repeat; min-height: 100dvh; }
.stage:not(.playing) .topbar .logo, .stage:not(.playing) .topbar .icon-btn { width: 46px; height: 46px; border-radius: 50%; background: url(../toemarok/sprites/ui-medal.webp) center / contain no-repeat; box-shadow: none; color: #ffe9b8; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.stage:not(.playing) .topbar .logo { font-size: 0; display: grid; place-items: center; }
.stage:not(.playing) .topbar .logo::before { content: ""; width: 20px; height: 20px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 11.5h3V21h5v-6h4v6h5v-9.5h3z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 11.5h3V21h5v-6h4v6h5v-9.5h3z'/%3E%3C/svg%3E") center / contain no-repeat; }
.stage:not(.playing) .topbar .icon-btn svg { width: 18px; height: 18px; }

/* 나무 현판 버튼 */
.wood-cta { position: relative; border: 0; padding: 12px 34px 16px; min-height: 76px; background: url(../toemarok/sprites/k-cta.webp) center / 100% 100% no-repeat; color: #fff4da; font-family: var(--game); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .5)); transition: transform .08s; text-shadow: 0 2px 0 #3a1a08; }
.wood-cta b { font-weight: 400; font-size: 27px; line-height: 1.1; white-space: nowrap; }
.wood-cta small { font-size: 14px; color: #ffe6a8; line-height: 1.2; white-space: nowrap; }
.wood-cta:active, .wood-btn:active, .charm:active, .paper-chip:active { transform: scale(.96); }
.wood-cta.small { min-height: 60px; padding: 10px 30px 13px; }
.wood-cta.small b { font-size: 21px; }
.wood-btn { border: 0; min-height: 56px; padding: 8px 10px 10px; background: url(../toemarok/sprites/k-btn.webp) center / 100% 100% no-repeat; color: #fff4da; font: 15px/1.15 var(--game); display: flex; align-items: center; justify-content: center; gap: 5px; text-shadow: 0 1px 0 #3a1a08, 0 0 3px #3a1a08; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .45)); word-break: keep-all; text-align: center; }
.wood-btn .ico { width: 26px; height: 26px; }
.wood-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.charm { border: 0; width: 92px; flex: none; min-height: 96px; padding: 26px 6px 14px; background: url(../toemarok/sprites/ui-talisman.webp) center / 100% 100% no-repeat; color: #7a1a08; font-family: var(--game); display: flex; flex-direction: column; align-items: center; justify-content: center; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.charm b { font-weight: 400; font-size: 15px; line-height: 1.15; word-break: keep-all; text-align: center; }
.charm small { font-size: 17px; line-height: 1.2; }
.charm:disabled { filter: grayscale(.6) brightness(.8); }
.charm.hot { animation: glow2 1.4s ease-in-out infinite; }
@keyframes glow2 { 50% { filter: drop-shadow(0 0 10px #ffd23f); } }
.go-row { display: flex; align-items: center; gap: 8px; }
.go-row .wood-cta { flex: 1; min-width: 0; }
.paper-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.paper-chip { border: 0; display: inline-flex; align-items: center; gap: 4px; padding: 8px 18px 9px; min-height: 40px; background: url(../toemarok/sprites/k-paper.webp) center / 100% 100% no-repeat; color: #5a2a0a; font: 15px/1.1 var(--game); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); margin: 0; white-space: nowrap; }
.paper-chip .ico { width: 20px; height: 20px; }
.link-btn { border: 0; background: none; color: #fff4da; font: 16px var(--game); text-decoration: underline; text-underline-offset: 4px; min-height: 40px; padding: 4px 16px; text-shadow: 0 1px 3px #000; }
.plaque-title { background: url(../toemarok/sprites/k-title.webp) center / 100% 100% no-repeat; padding: 16px 44px 20px; font-size: 24px; color: #fff4da; text-shadow: 0 2px 0 #3a1a08; text-align: center; white-space: nowrap; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); }

/* 시작 화면 */
.title-screen .hero-title h1 { margin: -6px 0 -4px; }
.title-screen .game-logo { width: 78%; max-width: 330px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.title-screen .parade { aspect-ratio: 16 / 11; border-radius: 20px; border: 3px solid #c99a4a; box-shadow: 0 0 0 2px #5a3010, var(--shadow); }
.title-screen .parade .bg { background-position: center 62%; }
.title-screen .gate-deco { left: 50%; top: 4%; width: 34%; }
.title-screen .gate-num { left: 50%; top: 17%; font-size: 24px; padding: 2px 10px 4px; background: url(../toemarok/sprites/k-chip.webp) center / 100% 100% no-repeat; -webkit-text-stroke: 0; color: #fff4da; min-width: 64px; text-align: center; }
.title-screen .march { position: absolute; inset: auto 0 0 0; height: 46%; display: block; width: auto; translate: none; left: 0; }
.title-screen .mc { position: absolute; left: var(--x); bottom: var(--b); width: var(--w); max-width: none; margin: 0; translate: -50% 0; }
.title-screen .march .mc:nth-child(5n+1), .title-screen .march .mc:nth-child(5n) { translate: -50% 0; }
.title-screen .parade .hero-btn { left: 50%; bottom: 34%; width: 17%; z-index: 3; }
.title-screen .hero-flag { position: absolute; left: 52%; bottom: 38%; width: 92%; transform-origin: 20% 95%; animation: flagwave 1.2s ease-in-out infinite alternate; }
@keyframes flagwave { from { rotate: 4deg; } to { rotate: 14deg; } }
.title-screen .hero-pose { position: relative; animation: none; }
.title-screen .count-badge { top: auto; bottom: 61%; left: 36%; font-size: 20px; padding: 4px 10px; }
.title-screen .bubble { top: 5%; left: 3%; max-width: 38%; font-size: 13px; }
.title-screen .lucky-tip { font-size: 13px; }

/* 원정 지도 */
.map-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.map-wrap { position: relative; flex: 1 1 auto; min-height: 260px; max-height: 58vh; overflow-y: auto; border-radius: 14px; overscroll-behavior: contain; }
.vspot { position: absolute; left: var(--x); top: var(--y); width: calc(var(--w) + 4%); height: 6%; translate: -50% -50%; border: 0; background: none; padding: 0; display: grid; place-items: center; font: clamp(12px, 3.6vw, 15px)/1.1 var(--game); color: #4a2408; word-break: keep-all; }
.vspot span { position: relative; z-index: 2; max-width: 100%; text-align: center; }
.vspot .fog { position: absolute; left: 50%; bottom: 40%; width: 150%; aspect-ratio: 1.3; translate: -50% 0; border-radius: 50%; background: radial-gradient(closest-side, rgba(40, 14, 70, .62), rgba(40, 14, 70, .35) 60%, transparent); pointer-events: none; }
.vspot.won .fog, .vspot.now .fog { display: none; }
.vspot .vflag { position: absolute; left: 66%; bottom: 120%; width: 40%; z-index: 2; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.vspot.now span { color: #b0300a; }
.vspot.sel::after { content: ""; position: absolute; inset: -18% -8%; border: 3px solid #ffd23f; border-radius: 12px; box-shadow: 0 0 10px #ffd23f; animation: pop 1s ease-in-out infinite alternate; }
.vspot:disabled span { color: #6a5a4a; }
.map-panel { background: url(../toemarok/sprites/ui-paper.webp) center / 100% 100% no-repeat; padding: 14px 18px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: #4a2408; }
.map-panel h3 { font-size: 20px; }
.map-cells .dots { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.map-stats { display: flex; gap: 12px; font-size: 13px; color: #6a3a10; font-weight: 700; }
.stage-dot { border: 0; width: 46px; height: 46px; background: url(../toemarok/sprites/ui-slot-empty.webp) center / contain no-repeat; font: 16px var(--game); color: #6a3a10; display: grid; place-items: center; }
.stage-dot.done { background-image: url(../toemarok/sprites/ui-slot-done.webp); color: transparent; position: relative; }
.stage-dot.done span { position: absolute; inset: 0; display: grid; place-items: center; color: #c4161c; font: 22px "Gowun Batang", serif; font-weight: 700; background: rgba(255, 244, 218, .78); border-radius: 10px; margin: 6px; }
.stage-dot.now { background-image: url(../toemarok/sprites/ui-slot.webp); color: #fff4da; animation: pop 1s ease-in-out infinite alternate; }
.stage-dot:disabled { opacity: .55; }

/* ================================================================ 3.0 시작 화면 (시안 1-start 맞춤)
   장터 밤거리 그림을 화면 폭에 맞춰 깔고(cqw 기준), 그림 속 성문 현판·돌길 위에 숫자와 행진 무리를 얹는다. */
.stage.title-screen { container-type: inline-size; position: relative; background: url(sprites/bg-title-foot.webp) 0 calc(100cqw * 1672 / 941 - 2px) / 100% auto repeat-y, #2b1f4f; }
.stage.title-screen::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 941 / 1672; background: url(sprites/bg-title.webp) center top / 100% auto no-repeat; pointer-events: none; }
.stage.title-screen > * { position: relative; z-index: 1; }
.stage.title-screen .screen { gap: 8px; padding-top: 0; background: none; }
.stage.title-screen > .topbar { position: absolute; left: 0; right: 0; top: 0; }
.title-screen .hero-title { position: absolute; left: 0; right: 0; top: 1cqw; pointer-events: none; }
.title-screen .hero-title h1 { margin: 0; }
.title-screen .game-logo { width: 66cqw; max-width: none; margin: 0 auto; }
.title-scene { position: absolute; left: 0; top: 0; width: 100cqw; height: 0; z-index: 0; pointer-events: none; }
.title-scene .gate-num { position: absolute; left: 80.6cqw; top: 53.6cqw; translate: -50% -50%; min-width: 0; padding: 0; background: none; font: 400 9.2cqw/1 var(--game); color: #5a2a0a; -webkit-text-stroke: 0; text-shadow: 0 1px 0 #fff2c8; z-index: 2; }
.title-scene .gate-num.bad { color: #b3160c; }
.title-scene .gate-num.pass { animation: gnpop .5s ease-out; }
@keyframes gnpop { 0% { transform: scale(.75); } 70% { transform: scale(1.08); } 100% { transform: scale(1); } }
.title-scene .parade-btn { position: absolute; left: 3cqw; top: 61cqw; width: 70cqw; padding: 0; border: 0; background: none; pointer-events: auto; animation: hop .32s ease-in-out infinite alternate; }
.title-scene .title-parade { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 5px rgba(0, 0, 0, .45)); }
@keyframes hop { from { translate: 0 0; } to { translate: 1.2cqw -1.4cqw; } }
.title-scene .count-badge { position: absolute; left: 40cqw; top: 55cqw; bottom: auto; translate: -50% 0; font-size: 7cqw; padding: .6cqw 3cqw; z-index: 3; }
.title-scene .bubble { position: absolute; left: 4cqw; top: 46cqw; max-width: 52cqw; font-size: 14px; pointer-events: none; }
.title-scene .bubble[hidden] { display: none; }
.title-screen .scene-space { flex: none; height: 99cqw; margin-bottom: -8px; }
.stage.title-screen .screen { gap: 2cqw; }
@media (prefers-reduced-motion: reduce) { .title-scene .parade-btn { animation: none; } }

/* 나무 간판(시안 그림) 버튼 */
.title-screen .wood-cta, .stage:not(.playing) .wood-cta { background-image: url(sprites/ui-sign-big.webp); aspect-ratio: 640 / 299; min-height: 0; padding: 9% 17% 9.5%; color: #5a2a0a; text-shadow: 0 1px 0 #fff2c8; }
.stage:not(.playing) .wood-cta b { font-size: clamp(24px, 8.6cqw, 40px); }
.stage:not(.playing) .wood-cta small { color: #7a4a1a; font-size: clamp(13px, 4cqw, 18px); }
.stage:not(.playing) .wood-btn { background-image: url(sprites/ui-sign.webp); aspect-ratio: 407 / 351; min-height: 0; padding: 26% 9% 30%; flex-direction: column; gap: 0; color: #5a2a0a; text-shadow: 0 1px 0 #fff2c8; font-size: clamp(15px, 5.2cqw, 23px); white-space: nowrap; position: relative; }
.stage:not(.playing) .wood-btn .ico { position: absolute; left: 50%; top: -24%; translate: -50% 0; width: 50%; height: auto; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.stage:not(.playing) .wood-btn span { display: block; margin-top: 4%; }
.stage:not(.playing) .wood-row { gap: 2.5cqw; margin-top: 0; }
.stage:not(.playing) .charm { background-image: url(sprites/ui-charm.webp); width: 21cqw; aspect-ratio: 254 / 396; min-height: 0; padding: 14% 8% 30%; gap: 0; color: #8a1a08; }
.stage:not(.playing) .charm .paw { display: block; width: 7cqw; height: 7cqw; flex: none; background: #c4161c; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='10' r='2.6'/%3E%3Ccircle cx='9.2' cy='5.2' r='2.7'/%3E%3Ccircle cx='14.8' cy='5.2' r='2.7'/%3E%3Ccircle cx='19' cy='10' r='2.6'/%3E%3Cpath d='M12 11c-3.6 0-7 4.4-7 7.2C5 20.4 7 21 8.6 21c1.4 0 2.2-.8 3.4-.8s2 .8 3.4.8c1.6 0 3.6-.6 3.6-2.8C19 15.4 15.6 11 12 11z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='5' cy='10' r='2.6'/%3E%3Ccircle cx='9.2' cy='5.2' r='2.7'/%3E%3Ccircle cx='14.8' cy='5.2' r='2.7'/%3E%3Ccircle cx='19' cy='10' r='2.6'/%3E%3Cpath d='M12 11c-3.6 0-7 4.4-7 7.2C5 20.4 7 21 8.6 21c1.4 0 2.2-.8 3.4-.8s2 .8 3.4.8c1.6 0 3.6-.6 3.6-2.8C19 15.4 15.6 11 12 11z'/%3E%3C/svg%3E") center / contain no-repeat; }
.stage:not(.playing) .charm b { font-size: clamp(11px, 3.7cqw, 16px); white-space: nowrap; }
.stage:not(.playing) .charm small { font-size: clamp(16px, 6cqw, 26px); }
.stage:not(.playing) .paper-chip { background-image: url(sprites/ui-scroll.webp); aspect-ratio: 640 / 215; min-height: 0; padding: 0 9% 1%; justify-content: center; font-size: clamp(15px, 5.4cqw, 23px); gap: 6px; }
.stage:not(.playing) .paper-chip .ico { width: 1.6em; height: 1.6em; object-fit: contain; }
.stage:not(.playing) .paper-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5cqw; }
.stage.title-screen .topbar { padding-top: calc(env(safe-area-inset-top, 0px) + 8px); z-index: 3; }
.stage:not(.playing) .topbar a.orak-home-button:not(.btn) { width: 74px !important; height: 64px !important; min-height: 0 !important; padding: 2px 0 14px !important; border: 0 !important; border-radius: 0 !important; background: url(sprites/ui-sign.webp) center / 100% 100% no-repeat !important; color: #5a2a0a !important; font-family: var(--game) !important; font-weight: 400 !important; font-size: 17px !important; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); align-self: flex-start !important; }
.stage:not(.playing) .topbar button.orak-tool { width: 50px !important; height: 78px !important; min-height: 0 !important; padding: 0 0 27px !important; border: 0 !important; border-radius: 0 !important; background: url(sprites/ui-medal-wood.webp) center top / 100% auto no-repeat !important; color: #fff1c8 !important; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); align-self: flex-start !important; }
.stage:not(.playing) .topbar button.orak-tool.is-off { color: #cfc6b8 !important; }
.stage:not(.playing) .topbar button.orak-tool .orak-tool-state { font-size: 9px; }
/* 도전 과제 알림은 아래 버튼을 가리지 않게 위쪽에 */
.osc-toast { bottom: auto !important; top: calc(env(safe-area-inset-top, 0px) + 92px); }
/* 9:16 안팎 짧은 화면: 무리·버튼을 조금 올려 아래 두루마리까지 한 화면에 */
@media (min-aspect-ratio: 10/19) {
  .title-scene .parade-btn { top: 57cqw; width: 66cqw; }
  .title-scene .count-badge { top: 51cqw; }
  .title-screen .scene-space { height: 93cqw; }
}

/* ================================================================ 3.0 원정 지도 (시안 2-map 맞춤) */
.stage:not(.playing) { container-type: inline-size; }
.stage.map-screen { background: linear-gradient(rgba(26, 16, 52, .55), rgba(26, 16, 52, .8)), url(sprites/bg-title.webp) center top / 100% auto no-repeat, #2b1f4f; }
.stage.map-screen > .topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; }
.stage.map-screen .screen { gap: 0; padding-top: calc(env(safe-area-inset-top, 0px) + 6px); align-items: center; }
.map-head { position: relative; z-index: 2; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 0; }
.sign-title { width: 56cqw; aspect-ratio: 640 / 299; background: url(sprites/ui-sign-big.webp) center / 100% 100% no-repeat; display: grid; place-items: center; padding: 0 12cqw 6%; font: 400 clamp(22px, 7.6cqw, 34px)/1 var(--game); color: #5a2a0a; text-shadow: 0 1px 0 #fff2c8; white-space: nowrap; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .5)); margin: 0; }
.map-sub { margin-top: -3cqw !important; aspect-ratio: auto !important; padding: 1.6cqw 8cqw 2cqw !important; font-size: clamp(13px, 3.8cqw, 17px) !important; }
.map-square { position: relative; width: 100cqw; margin: -2cqw -16px 0; aspect-ratio: 1; flex: none; container-type: inline-size; }
.map-square::before { content: ""; position: absolute; inset: 0; background: url(sprites/map-square.webp) center / 100% 100% no-repeat; -webkit-mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 5%, #000 95%, transparent); -webkit-mask-composite: source-in; mask: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent), linear-gradient(transparent, #000 5%, #000 95%, transparent); mask-composite: intersect; }
.map-square .vspot { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: 12%; translate: -50% -50%; border: 0; background: none; padding: 0; display: grid; place-items: center; font: 4.3cqw/1 var(--game); color: #3a1a04; word-break: keep-all; white-space: nowrap; }
.map-square .vspot span { position: relative; z-index: 2; }
.map-square .vspot:disabled { opacity: 1; }
.map-square .vspot:disabled span { color: #7a5a3a; }
.map-square .vspot .vflag { position: absolute; left: 50%; bottom: 55%; width: 58%; z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.map-square .vspot .vdosa { position: absolute; left: -34%; bottom: 56%; width: 56%; z-index: 3; filter: drop-shadow(0 0 6px #ffe36a) drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); animation: hop .5s ease-in-out infinite alternate; }
.map-square .vspot.sel::after { content: ""; position: absolute; inset: 16% -5%; border: 3px solid #ffd23f; border-radius: 10px; box-shadow: 0 0 10px #ffd23f, inset 0 0 8px #ffd23f88; animation: selglow 1s ease-in-out infinite alternate; pointer-events: none; }
.map-board { position: relative; width: 84cqw; margin: -1cqw 0 0 12cqw; aspect-ratio: 640 / 371; background: url(sprites/map-board.webp) center / 100% 100% no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 9cqw 5cqw 5cqw; flex: none; }
.map-vname { position: absolute; left: 50%; top: -6cqw; translate: -50% 0; width: 50cqw; aspect-ratio: 460 / 179; background: url(sprites/map-head.webp) center / 100% 100% no-repeat; display: grid; place-items: center; padding-bottom: 1%; font: 400 clamp(16px, 5.4cqw, 24px)/1 var(--game); color: #4a2408; white-space: nowrap; margin: 0; }
.mtiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.6cqw; width: 100%; }
.mtile { position: relative; border: 0; padding: 0; aspect-ratio: 263 / 255; background: url(sprites/tile.webp) center / 100% 100% no-repeat; font-family: var(--game); color: #6a3a10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; }
.mtile small { font-size: clamp(11px, 3.4cqw, 15px); line-height: 1; }
.mtile.done small, .mtile.boss small { position: absolute; left: 0; right: 0; top: 7%; text-align: center; }
.mtile.done .gstamp, .mtile.boss .bface { margin-top: 34%; }
.mtile.done, .mtile.boss { justify-content: flex-start; }
.mtile.lock { background-image: url(sprites/tile-lock.webp); }
.mtile.lock small { position: absolute; left: 0; right: 0; top: 7%; text-align: center; }
.mtile.boss.lock { background-image: url(sprites/tile.webp); filter: brightness(.9); }
.mtile .bface { width: 58%; aspect-ratio: 1; background: var(--f) center / contain no-repeat; border-radius: 50%; }
.mtile.now { background-image: url(sprites/tile-now.webp); aspect-ratio: 263 / 255; background-size: 105% auto; background-position: center 86%; }
.mtile.now .num { font-size: clamp(18px, 6cqw, 26px); font-weight: 400; color: #5a2a0a; }
.mtile.done .gstamp { width: 46%; aspect-ratio: 1; display: grid; place-items: center; border: 2px solid #c4161c; border-radius: 50%; color: #c4161c; font: 700 clamp(13px, 4.2cqw, 19px)/1 "Gowun Batang", serif; margin-top: 34%; }
.map-locked { color: #6a3a10; font-size: 14px; }
.map-foot { position: relative; width: 100%; display: flex; justify-content: flex-end; margin-top: 1cqw; flex: none; }
.map-dosa { position: absolute; left: -2cqw; bottom: 0; width: 28cqw; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); pointer-events: none; z-index: 2; }
.red-cta { width: 72cqw; aspect-ratio: 632 / 193; border: 0; background: url(sprites/red-cta.webp) center / 100% 100% no-repeat; display: grid; place-items: center; padding: 0 12cqw 1%; color: #fff4da; font: 400 clamp(18px, 6.6cqw, 30px)/1 var(--game); text-shadow: 0 2px 0 #5a0a0a; white-space: nowrap; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .5)); }
.red-cta b { font-weight: 400; }
.red-cta:active { transform: scale(.96); }
.map-back { margin-top: 0; min-height: 36px; font-size: 14px; }
@media (min-aspect-ratio: 10/19) {
  .map-square { width: 82cqw; margin-left: 0; margin-right: 0; }
  .map-board { width: 76cqw; margin-left: 16cqw; padding: 8cqw 4.5cqw 4.5cqw; }
  .map-dosa { width: 24cqw; }
  .red-cta { width: 66cqw; }
}

/* ================================================================ 3.0 츄르 상점 (시안 9-shop 맞춤): 천막 선반 칸마다 강화 하나 */
.stage.shop-screen { background: url(sprites/shop-tent.webp) center top / 100% auto no-repeat, #3a2440; }
.stage.shop-screen > .topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; }
.stage.shop-screen .screen { padding: 0; }
.shop-scene { position: relative; width: 100cqw; height: calc(100cqw * 1672 / 941); margin: 0 auto; }
.shop-scene > * { position: absolute; }
.shop-title { left: 50%; top: 1.5cqw; translate: -50% 0; z-index: 2; }
.shop-sul { left: 1cqw; top: 22cqw; width: 34cqw; height: auto; max-height: none; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.shop-bubble { left: 34cqw; top: 22cqw; width: 34cqw; margin: 0; background: #fff; color: #2a1a10; border-radius: 16px 16px 16px 4px; padding: 2cqw 3cqw; font: clamp(13px, 4.2cqw, 19px)/1.35 var(--game); text-align: center; word-break: keep-all; box-shadow: 0 3px 6px rgba(0, 0, 0, .35); }
.shop-purse { right: 2cqw; top: 33cqw; width: 30cqw; aspect-ratio: 407 / 351; margin: 0; background: url(sprites/ui-sign.webp) center / 100% 100% no-repeat; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 7.5cqw 0 8cqw; gap: .4cqw; color: #5a2a0a; font-family: var(--game); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.shop-purse small { font-size: clamp(11px, 3.4cqw, 15px); line-height: 1; }
.shop-purse span { display: flex; align-items: center; gap: 1cqw; }
.shop-purse .ico { width: 6cqw; height: 6cqw; }
.shop-purse b { font-weight: 400; font-size: clamp(17px, 5.8cqw, 26px); line-height: 1; color: #a8200c; }
.shelf-item { left: var(--x); top: calc(var(--y) - 5.5cqw); width: 23cqw; height: 33cqw; translate: -50% 0; border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; border-radius: 8px; }
.shelf-ico { position: absolute; left: 50%; top: 0; translate: -50% 0; width: 18cqw; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.shelf-card { position: relative; width: 22cqw; background: #fbe9c4; border: 2px solid #8a5a2a; border-radius: 7px; box-shadow: 0 2px 0 #5a3412, 0 3px 6px rgba(0, 0, 0, .4); display: flex; flex-direction: column; align-items: center; gap: .6cqw; padding: 1.2cqw .6cqw 1cqw; color: #4a2408; font-family: var(--game); }
.shelf-card b { font-weight: 400; font-size: clamp(12px, 3.9cqw, 18px); line-height: 1.05; white-space: nowrap; }
.shelf-card .pips { display: flex; gap: .7cqw; }
.shelf-card .pips i { width: 2cqw; height: 2cqw; border-radius: 50%; background: #c9b48e; }
.shelf-card .pips i.on { background: #f2c21b; box-shadow: 0 0 0 1px #9a6a0a; }
.shelf-card .price { display: flex; align-items: center; gap: .6cqw; font-size: clamp(12px, 3.8cqw, 17px); line-height: 1; border-top: 1px solid #d8bb88; padding-top: .6cqw; width: 100%; justify-content: center; }
.shelf-card .price .ico { width: 4cqw; height: 4cqw; }
.shelf-item.sel .shelf-card { border-color: #f2c21b; box-shadow: 0 0 0 2px #ffe36a, 0 0 12px #ffd23f; }
.shelf-item.sel .shelf-ico { animation: selbob .6s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px #ffe36a); }
.shelf-item.maxed .shelf-card { background: #efe2c0; }
.shelf-item:active { transform: scale(.95); }
.shop-desc { left: 2cqw; right: 2cqw; top: 119.5cqw; height: 24cqw; margin: 0; background: url(sprites/ui-scroll.webp) center / 100% 100% no-repeat; display: flex; align-items: center; gap: 3cqw; padding: 0 9cqw; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); }
.shop-desc img { width: 15cqw; flex: none; }
.shop-desc p { margin: 0; color: #4a2408; font: clamp(12px, 3.5cqw, 16px)/1.3 var(--game); word-break: keep-all; display: flex; flex-direction: column; border-left: 2px solid #d0b080; padding-left: 3cqw; }
.shop-desc p b { font-weight: 400; color: #a8200c; font-size: 1.1em; }
.shop-desc p small { font-size: .8em; color: #8a6a4a; }
.stage:not(.playing) .shop-buy { left: 50%; top: 143.5cqw; translate: -50% 0; width: 68cqw; aspect-ratio: 640 / 250; padding: 2.7cqw 11.5cqw 4.8cqw; }
.stage:not(.playing) .shop-buy b { font-size: clamp(18px, 6.2cqw, 28px); display: flex; align-items: center; gap: 1.5cqw; }
.shop-buy .ico { width: 7cqw; height: 7cqw; }
.shop-buy:disabled { filter: grayscale(.5) brightness(.85); }
.shop-links { left: 0; right: 0; top: 168cqw; display: flex; justify-content: center; gap: 4cqw; }
.shop-links .link-btn:disabled { opacity: .5; }
.shop-note { left: 0; right: 0; top: 179cqw; margin: 0; text-align: center; color: #e8d8f0; font-size: 12px; }
@keyframes selbob { from { translate: -50% 0; } to { translate: -50% -1.2cqw; } }
@keyframes selglow { from { opacity: .55; } to { opacity: 1; } }

/* ================================================================ 3.0 냥이 병적부 (시안 10-dex 맞춤): 낡은 장부 책 위 카드 12장 */
.stage.dex-screen { background: url(sprites/dex-book.webp) center top / 100% auto no-repeat, #2b1f4f; }
.stage.dex-screen > .topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; }
.stage.dex-screen .screen { padding: 0; }
.dex-scene { position: relative; width: 100cqw; height: calc(100cqw * 1672 / 941); margin: 0 auto; }
.dex-scene > * { position: absolute; margin: 0; }
.dex-title { left: 50%; top: 24.6cqw; translate: -50% -50%; font: 400 clamp(22px, 7.4cqw, 34px)/1 var(--game); color: #4a2408; white-space: nowrap; text-shadow: 0 1px 0 #fff2c8; }
.dex-grid { left: 9cqw; right: 9cqw; top: 38cqw; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 26.6cqw; gap: 1.4cqw 2.2cqw; }
.dex-card { position: relative; border: 1.5px solid #c8a878; border-radius: 2cqw; background: rgba(255, 246, 226, .55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); padding: .6cqw 1cqw 1.2cqw; display: flex; flex-direction: column; align-items: center; justify-content: space-between; font-family: var(--game); color: #4a2408; }
.dex-card img { width: 74%; height: auto; flex: none; margin-top: .4cqw; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.dex-card .dex-name { width: 96%; min-height: 8cqw; margin-top: -3cqw; position: relative; display: grid; place-items: center; background: #fff3d8; border: 1.5px solid #c8a070; border-radius: 4cqw; font-size: clamp(11px, 3.5cqw, 16px); line-height: 1.1; text-align: center; word-break: keep-all; padding: .6cqw 1.6cqw; }
.dex-card.unseen img { filter: brightness(0) opacity(.62) blur(.3px); }
.dex-card.unseen .dex-name { background: radial-gradient(closest-side, rgba(70, 60, 55, .22), rgba(70, 60, 55, .08) 70%, transparent); border-color: transparent; color: #3a2a20; font-size: clamp(10px, 3.2cqw, 15px); }
.dex-card.on { border-color: #f2c21b; background: radial-gradient(circle at 50% 40%, #fff3b0, #ffd76a 70%, #f0b030); box-shadow: 0 0 0 2px #ffe36a, 0 0 14px #ffd23f; }
.dex-card .lead { position: absolute; right: -1cqw; top: -1.2cqw; rotate: 8deg; font: 700 clamp(12px, 3.8cqw, 17px)/1 "Gowun Batang", serif; font-style: normal; color: #c4161c; background: #fff4e0; border: 2px solid #c4161c; border-radius: 1.4cqw; padding: .8cqw 1.4cqw; box-shadow: 0 2px 3px rgba(0, 0, 0, .25); }
.dex-card:active { transform: scale(.96); }
.dex-foot { left: 8cqw; right: 8cqw; top: 149cqw; text-align: center; font: clamp(11px, 3.4cqw, 15px)/1.2 var(--game); color: #5a3412; background: #fff3d8; border: 1.5px solid #d8b080; border-radius: 4cqw; padding: 1.2cqw 2cqw; }
.dex-stat { left: 8cqw; right: 8cqw; top: 156.5cqw; text-align: center; font-size: clamp(10px, 2.9cqw, 13px); color: #7a5a3a; }
.stage:not(.playing) .dex-home { left: 50%; top: 158.5cqw; translate: -50% 0; width: 52cqw; }
.stage:not(.playing) .dex-home b { font-size: clamp(18px, 6.4cqw, 28px); }
.dex-card.unseen .dex-name { margin-top: -1cqw; font-size: clamp(11px, 3.7cqw, 17px); line-height: 1.15; }

/* ================================================================ 3.0 결과 화면 (시안 8-result 맞춤): 위 그림 + 두루마리 판 + 나무 간판 버튼 */
.stage.res-screen { background: url(sprites/bg-title-foot.webp) 0 0 / 100% auto repeat-y, #2b1f4f; }
.stage.res-screen > .topbar { position: absolute; left: 0; right: 0; top: 0; z-index: 3; }
.stage.res-screen .screen { padding-top: 0; gap: 1.6cqw; align-items: center; }
.res-scene { position: relative; width: 100cqw; flex: none; margin: 0 -16px; display: flex; flex-direction: column; align-items: center; }
.res-art { width: 100cqw; aspect-ratio: 1; background: center / cover no-repeat; -webkit-mask: linear-gradient(#000 85%, transparent); mask: linear-gradient(#000 85%, transparent); }
.res-bubble { position: absolute; left: 3cqw; top: 25cqw; max-width: 40cqw; font-size: clamp(12px, 3.6cqw, 16px); z-index: 2; }
.res-scene.win .res-bubble { top: 44cqw; }
.res-panel { position: relative; width: 96cqw; margin-top: -21cqw; border: solid transparent; border-width: 9cqw 3cqw; border-image: url(sprites/ui-scroll-v.webp) 72 26 fill / 9cqw 3cqw stretch; padding: 3cqw 4cqw; display: grid; grid-template-columns: 25cqw 1fr; grid-template-areas: "g w" "g t" "s s" "e e"; gap: 1.6cqw 2.4cqw; align-items: center; color: #4a2408; font-family: var(--game); filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .45)); }
.res-grade { grid-area: g; width: 24cqw; aspect-ratio: 1; border-radius: 50%; border: 1.4cqw solid #c4161c; outline: .5cqw solid #c4161c; outline-offset: -3cqw; display: grid; place-items: center; color: #c4161c; rotate: -8deg; background: rgba(255, 240, 220, .6); animation: stamp .5s cubic-bezier(.2, 1.6, .4, 1) .4s both; }
.res-grade b { font: 400 16cqw/1 var(--game); text-shadow: 0 0 1px #c4161c; }
.res-grade.word b { font: 400 4.6cqw/1.1 var(--game); text-align: center; word-break: keep-all; padding: 0 2cqw; }
.res-grade.g-B { color: #7a4a1a; border-color: #7a4a1a; box-shadow: inset 0 0 0 .6cqw #fff4e0, inset 0 0 0 1.1cqw #7a4a1a; }
.res-where { grid-area: w; margin: 0; justify-self: center; background: #fff3d8; border: 1.5px solid #c8a070; border-radius: 4cqw; padding: 1.2cqw 3cqw; font-size: clamp(12px, 3.8cqw, 17px); white-space: nowrap; }
.res-title { grid-area: t; margin: 0; justify-self: center; background: linear-gradient(#b3201a, #8a1210); color: #ffe9b8; border: 2px solid #e0a030; border-radius: 2cqw; padding: 1.2cqw 4cqw 1.4cqw; font: 400 clamp(15px, 5cqw, 22px)/1.1 var(--game); text-align: center; word-break: keep-all; box-shadow: 0 2px 0 #5a0a0a; }
.res-stats { grid-area: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2cqw; }
.rstat { background: #fff3d8; border: 1.5px solid #c8a070; border-radius: 2.4cqw; padding: 1.2cqw 1cqw; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i l" "i v"; align-items: center; column-gap: 1cqw; min-width: 0; }
.rstat .rico { grid-area: i; width: 8cqw; display: grid; place-items: center; }
.rstat .rico img { width: 8cqw; height: 8cqw; object-fit: contain; }
.rstat .rico i { font-style: normal; font-size: 7cqw; line-height: 1; color: #f2b21b; text-shadow: 0 1px 0 #8a5a0a; }
.ri-stairs { width: 7cqw; height: 6cqw; background: linear-gradient(#e2a64a, #b8742a); clip-path: polygon(0 100%, 0 70%, 33% 70%, 33% 40%, 66% 40%, 66% 10%, 100% 10%, 100% 100%); }
.rstat .rlab { grid-area: l; font-size: clamp(10px, 3cqw, 13px); line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rstat b { grid-area: v; font-weight: 400; font-size: clamp(16px, 5.6cqw, 25px); line-height: 1.05; color: #8a1210; white-space: nowrap; }
.res-earn { grid-area: e; margin: 0; justify-self: stretch; display: flex; align-items: center; justify-content: center; gap: 1.6cqw; background: #ffe0e6; border-radius: 6cqw; padding: 1.2cqw 3cqw; font-size: clamp(15px, 5cqw, 22px); }
.res-earn .ico { width: 8cqw; height: 8cqw; }
.res-earn b { font-weight: 400; color: #a8200c; }
.stage:not(.playing) .res-go { width: 70cqw; aspect-ratio: 640 / 250; padding: 2.8cqw 11.9cqw 4.9cqw; flex: none; }
.stage:not(.playing) .res-go b { font-size: clamp(18px, 6.6cqw, 30px); }
.res-row { display: grid; grid-template-columns: 1fr 1fr; gap: 3cqw; width: 92cqw; }
.stage:not(.playing) .wood-btn.side { background-image: url(sprites/ui-sign-big.webp); aspect-ratio: 640 / 260; padding: 3% 16% 9%; flex-direction: row; gap: 1.4cqw; font-size: clamp(13px, 4.2cqw, 19px); }
.stage:not(.playing) .wood-btn.side .ico { position: static; translate: none; width: 6.4cqw; height: 6.4cqw; flex: none; }
.stage:not(.playing) .wood-btn.side span { margin: 0; }
.res-screen .link-btn { margin-top: -1cqw; }
.res-note, .res-total { margin: 0; text-align: center; font-size: 13px; color: #e8d8f0; }
.res-camp { width: 100%; }
.res-screen .sul-say { width: 100%; }
.res-earn[hidden] { display: none; }
@media (min-aspect-ratio: 10/19) {
  .res-art { aspect-ratio: 100 / 74; background-position: center 38%; }
  .res-panel { margin-top: -15cqw; }
  .res-scene.win .res-bubble { top: 32cqw; }
}
.stage:not(.playing) .cardimg { width: 86cqw; align-self: center; margin-top: calc(env(safe-area-inset-top, 0px) + 84px); flex: none; }
.stage:not(.playing) .screen:has(> .cardimg) { align-items: center; }

/* 3.0 잠깐 멈춤 창: 두루마리 종이 + 나무 버튼 */
.overlay { container-type: inline-size; }
.overlay .panel { background: none; box-shadow: none; border: solid transparent; border-width: 11cqw 4cqw; border-image: url(sprites/ui-scroll-v.webp) 72 26 fill / 11cqw 4cqw stretch; border-radius: 0; padding: 2cqw 6cqw; color: #4a2408; gap: 2.4cqw; width: min(100%, 92cqw); filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .5)); }
.overlay .panel h2 { font: 400 clamp(22px, 7cqw, 30px)/1.1 var(--game); color: #5a2a0a; }
.overlay .panel .sub { color: #6a4a2a; }
.overlay .panel .btn { background: url(sprites/ui-sign-big.webp) center / 100% 100% no-repeat; border: 0; box-shadow: none; color: #5a2a0a; font-family: var(--game); font-weight: 400; min-height: 0; aspect-ratio: 640 / 230; padding: 2% 15% 8%; font-size: clamp(14px, 4.4cqw, 19px); text-shadow: 0 1px 0 #fff2c8; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .4)); }
.overlay .panel .btn.primary { font-size: clamp(17px, 5.6cqw, 24px); }
.overlay .panel .btn.ghost { background: none; aspect-ratio: auto; padding: 8px; text-decoration: underline; text-underline-offset: 4px; filter: none; }
.overlay .panel .row2 { gap: 2cqw; }
.overlay .panel a.orak-home-button.btn { background: none !important; border: 0 !important; color: #5a2a0a !important; aspect-ratio: auto; padding: 8px !important; }

/* ---- 첫 디펜스 냥도사 안내, 디펜스 패배 뒤 목책 바로 사기 ---- */
.cameo.dosa { top: 100px; }
.cameo.dosa p { background: #fff3cd; }
.cameo.dosa .who { color: #b4462a; }
/* 두루마리 그림은 양 끝 막대가 그림 폭의 15%씩이라, 폭을 정해 두고 글은 가운데 판 안에만 놓는다(여백은 fitBoards가 그림 크기에서 잰다) */
.stage.res-screen .wall-buy { display: flex; flex: none; width: min(84cqw, 360px); min-height: 0; font-size: clamp(14px, 4.2cqw, 17px); margin: 2px auto 8px; gap: 5px; white-space: nowrap; max-width: 92%; }
.stage.res-screen .wall-buy .tx { display: block; min-width: 0; overflow: hidden; white-space: nowrap; }
.stage.res-screen .wall-buy img { width: 1.7em; height: 1.7em; object-fit: contain; flex: none; }
.stage.res-screen .wall-buy.done { opacity: .85; }

/* ---- 판 안 말풍선(목소리와 함께): 냥도사는 무리 위, 두목은 두목 체력 아래 ---- */
.say { position: absolute; left: 50%; bottom: 31%; z-index: 6; margin: 0; max-width: min(78%, 330px); width: max-content; transform: translateX(-50%); pointer-events: none;
  background: #fffaf0; color: #3a2414; border: 2px solid #5a3a1a; border-radius: 16px; padding: 7px 13px 8px; font: 16px/1.3 var(--game); text-align: center; word-break: keep-all; box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.3); }
.say::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 14px; height: 14px; background: #fffaf0; border: 2px solid #5a3a1a; border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
.say.on { animation: sayIn .28s cubic-bezier(.3, 1.5, .5, 1) both; }
.say.out { animation: sayOut .28s ease-in both; }
.say.boss { bottom: auto; top: 128px; background: #2a1030; color: #ffe9f4; border-color: #ff8fa8; }
.say.boss::after { bottom: auto; top: -10px; background: #2a1030; border-color: #ff8fa8; transform: translateX(-50%) rotate(225deg); }
.say .who { display: block; font-size: 11px; opacity: .8; }
@keyframes sayIn { from { opacity: 0; transform: translateX(-50%) scale(.6); } to { opacity: 1; transform: translateX(-50%) scale(1); } }
@keyframes sayOut { to { opacity: 0; transform: translateX(-50%) translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .say.on, .say.out { animation: none; } }
/* 판 안에서는 도전 과제 알림을 냥술사·두목 말풍선 아래로 */
body:has(.stage.playing) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + 200px) !important; }

/* ---- 3.0 판 화면 위·아래 장식(시안 3·5·7): 홈·소리 버튼은 시작 화면과 같은 나무 버튼, 가운데 나무 현판, 금테 막대 ---- */
.stage.playing .topbar { display: flex; position: absolute; left: 0; right: 0; top: 0; z-index: 6; pointer-events: none; padding: calc(env(safe-area-inset-top, 0px) + 6px) 10px 0; }
.stage.playing .topbar > * { pointer-events: auto; }
.stage .topbar a.orak-home-button:not(.btn) { width: 62px !important; height: 54px !important; min-height: 0 !important; padding: 2px 0 12px !important; border: 0 !important; border-radius: 0 !important; background: url(sprites/ui-sign.webp) center / 100% 100% no-repeat !important; color: #5a2a0a !important; font-family: var(--game) !important; font-weight: 400 !important; font-size: 15px !important; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); align-self: flex-start !important; }
.stage.playing .topbar button.orak-tool { width: 44px !important; height: 68px !important; min-height: 0 !important; padding: 0 0 24px !important; border: 0 !important; border-radius: 0 !important; background: url(sprites/ui-medal-wood.webp) center top / 100% auto no-repeat !important; color: #fff1c8 !important; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); align-self: flex-start !important; }
.stage.playing .topbar .logo, .stage.playing .topbar .icon-btn { width: 44px; height: 44px; }
.hud { padding: calc(env(safe-area-inset-top, 0px) + 6px) 8px 0; gap: 4px; z-index: 5; }
.hud-row { display: flex; justify-content: center; padding: 0 54px 0 66px; }
.hud .where { pointer-events: auto; justify-self: auto; min-width: 0; max-width: 100%; width: auto; height: 60px; min-height: 0; padding: 0 8px 5px; display: grid; place-items: center;
  border-style: solid; border-color: transparent; border-width: 14px 30px 16px; border-image: url(sprites/ui-sign-big.webp) 66 136 76 fill / 14px 30px 16px stretch; background: none;
  font: 400 clamp(14px, 4.9vw, 20px)/1.05 var(--game); color: #5a2a0a; text-shadow: 0 1px 0 #fff2c8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.prog-row { display: flex; align-items: center; gap: 8px; padding: 0 4px 0 8px; }
.prog { flex: 1; height: 15px; margin: 0; border-radius: 99px; background: #241433; border: 3px solid #c48a3a; box-shadow: 0 0 0 1.5px #5a3010, inset 0 2px 3px rgba(0, 0, 0, .6); }
.prog i { background: linear-gradient(#ffe98a, #ffc21a 55%, #e89a10); box-shadow: inset 0 -2px 0 rgba(150, 80, 0, .35); }
.prog i::after { right: -8px; top: -20px; width: 20px; height: 24px; }
.hud .peak { flex: none; padding: 5px 12px 6px; border-radius: 10px; background: linear-gradient(#fff4d6, #f1d79c); border: 2.5px solid #b87a32; box-shadow: 0 0 0 1.5px #5a3010, 0 2px 3px rgba(0, 0, 0, .4); font: 400 14px/1.1 var(--game); color: #5a2a0a; filter: none; }
.stage.playing .wallbar { margin: 2px 6px 0; padding: 5px 10px 5px 12px; border-radius: 14px; background: linear-gradient(#fff4d6, #f1d79c); border: 3px solid #b87a32; box-shadow: 0 0 0 1.5px #5a3010, 0 2px 4px rgba(0, 0, 0, .45); color: #5a2a0a; text-shadow: none; font-size: 15px; }
.stage.playing .wallbar div { position: relative; height: 18px; border: 2px solid #5a3a1a; background: #241433; overflow: hidden; }
.stage.playing .wallbar i { background: linear-gradient(#b8ff6a, #4ccf2a 60%, #2f9a18); }
.stage.playing .wallbar em, .stage.playing .bossbar em { position: absolute; right: 8px; top: 50%; translate: 0 -50%; font: 400 13px/1 var(--game); font-style: normal; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.stage.playing .bossbar { width: 82%; margin-top: 4px; }
.stage.playing .bossbar div { position: relative; height: 18px; border: 3px solid #c48a3a; box-shadow: 0 0 0 1.5px #3a0808; background: #241433; }
.stage.playing .bossbar em { right: auto; left: 50%; translate: -50% -50%; }
/* 부적 폭발: 금빛 게이지 고리 + 냥도사 얼굴 + 나무 이름표 */
.skill { width: 96px; height: 96px; right: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); border-radius: 50%; background: radial-gradient(circle, #5a3a8a 0 55%, transparent 56%), radial-gradient(circle, #8a5a1a 0 64%, #e0a640 65% 68%, #6a3a10 69% 72%, transparent 73%); overflow: visible; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .55)); }
.skill i { position: absolute; inset: 9%; height: auto !important; border-radius: 50%; background: conic-gradient(#ffd23a var(--p, 0%), rgba(40, 20, 10, .85) 0); -webkit-mask: radial-gradient(circle, transparent 0 74%, #000 75%); mask: radial-gradient(circle, transparent 0 74%, #000 75%); z-index: 1; transition: none; }
.skill img { inset: 20% 19% 24%; width: 62%; height: auto; border-radius: 50%; filter: grayscale(.2) brightness(.92); }
.skill.ready img { filter: none; }
.skill b { left: 50%; right: auto; bottom: -4px; translate: -50% 0; white-space: nowrap; padding: 3px 10px 4px; border-radius: 99px; background: linear-gradient(#fff4d6, #f1d79c); border: 2px solid #8a5420; color: #5a2a0a; text-shadow: none; font-size: 13px; }
.skill.waiting { border: 0; }
.skill.waiting i { background: conic-gradient(#9a96a8 var(--p, 0%), rgba(40, 20, 10, .85) 0); }
.skill.waiting b { font-size: 11px; }
.cameo { top: 128px; }
.cameo.dosa { top: 150px; }
.say.boss { top: 176px; }
/* 판 안 말풍선은 문 숫자를 가리지 않게 위쪽(막대 아래)에, 말하는 얼굴과 함께 */
.say, .say.boss { top: 124px; bottom: auto; display: flex; align-items: center; gap: 8px; text-align: left; padding: 6px 14px 7px 6px; max-width: min(88%, 360px); }
.say::after, .say.boss::after { display: none; }
.say .sayface { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #f3e2c0; border: 2px solid #c48a3a; object-fit: cover; }
.say.boss .sayface { background: #3a1a40; border-color: #ff8fa8; }
.say .who { color: #b4462a; }
.say.boss .who { color: #ffb0c8; }
.stage.playing:has(#bossbar:not([hidden])) .say { top: 172px; }
.stage.playing:has(#wallbar:not([hidden])) .say { top: 150px; }

/* ---- 긴 언어: 그림 위 글은 상자 안에서만(넘치면 game.js fitTexts가 글자를 줄인다) ---- */
.wood-cta > b, .wood-cta > small, .wood-btn > span, .charm > b, .charm > small, .sign-title, .map-sub, .vspot > span, .map-vname, .red-cta > b, .mtile small,
.shelf-card > b, .shop-purse small, .shop-links .link-btn, .dex-title, .res-where, .res-title, .rlab, .rstat > b, .res-earn, .res-row .wood-btn > span,
.hud .where, .hud .peak, .wallbar > span, .bossbar > b, .skill > b, .overlay .panel .btn { min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; }
.wood-cta, .wood-btn, .charm, .red-cta { overflow: hidden; }
.wood-cta > b, .wood-cta > small, .red-cta > b, .vspot > span, .shelf-card > b, .res-where, .res-title, .rlab, .dex-title { display: block; }
.paper-row { flex-wrap: nowrap; width: 100%; }
.paper-row .paper-chip { min-width: 0; max-width: 48%; flex: 0 1 auto; min-height: 40px; overflow: hidden; white-space: nowrap; }
.paper-row .paper-chip .ico { flex: none; }
.dex-name, .dex-foot, .shop-bubble { --fit-lines: 2; overflow: hidden; }
.res-row .wood-btn > span { display: block; }
.res-panel { min-width: 0; max-width: 100%; box-sizing: border-box; grid-template-columns: 25cqw minmax(0, 1fr); }
.res-panel > * { min-width: 0; }
.res-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.res-where { max-width: 100%; }
#stage > header a.orak-home-button span, #stage > header button.orak-tool span { display: block; max-width: 100%; overflow: hidden; white-space: nowrap; }
.shelf-card { overflow: hidden; }
.res-grade.word b { --fit-lines: 2; overflow: hidden; max-width: 100%; }
.stage:not(.playing) .paper-row .paper-chip { max-width: 100%; }
.skill > b { max-width: 128px; }
.stage:not(.playing) .go-row .wood-cta { padding-left: 11.5cqw; padding-right: 11.5cqw; }
#stage > header a.orak-home-button.long svg { display: none !important; }
#stage > header a.orak-home-button.long { padding-left: 8px !important; padding-right: 8px !important; }
.skill > b { max-width: 104px; }
.stage:not(.playing) .dex-home { padding-left: 8.8cqw; padding-right: 8.8cqw; }
/* 일본어·중국어는 띄어쓰기가 없어 keep-all이면 한 덩어리가 된다: 글자 단위로 줄을 바꾼다 */
:lang(ja) #stage *, :lang(zh) #stage * { word-break: normal; line-break: strict; }
/* 부적 단추 이름: 긴 언어는 두 줄로(단추 아래 알약 안에서) */
.skill > b { white-space: normal; width: max-content; max-width: 100px; line-height: 1.05; text-align: center; border-radius: 12px; overflow-wrap: anywhere; }
:lang(es) .skill > b, :lang(fr) .skill > b, :lang(de) .skill > b, :lang(pt) .skill > b, :lang(id) .skill > b, :lang(vi) .skill > b { font-size: 11.5px; }
/* 냥도사 말풍선이 떠 있으면 큰 글씨 알림은 그 아래로 */
.stage.playing:has(#say:not([hidden])) .banner { top: 46%; }
/* 멈춤 창 작은 간판 둘: % 여백은 부모 폭 기준이라 반쪽 간판엔 너무 컸다 */
.overlay .panel .row2 .btn { padding: 1% 6% 4%; }
/* 2차 수정 C1: 결과 두루마리는 위 말림·가운데 종이·아래 말림 세 조각. 가운데 종이만 늘어나 말림과 술 장식이 찌그러지지 않는다 */
.res-panel { border: 0; border-image: none; background: url(sprites/ui-result-top.webp) top center / 100% auto no-repeat, url(sprites/ui-result-bot.webp) bottom center / 100% auto no-repeat, url(sprites/ui-result-mid.webp) center / 100% calc(100% - 30cqw) no-repeat; padding: 10cqw 7.5cqw 14cqw; min-height: 62cqw; }
/* 2차 수정 B1: 홈은 크림 판 없는 나무 간판에 집 그림과 굵은 글. 글 무리의 한가운데가 간판 나무판 한가운데(세로 30%)에 온다 */
#stage .topbar a.orak-home-button:not(.btn) { background: url(sprites/ui-home.webp) center top / 100% auto no-repeat !important; width: 80px !important; height: 61px !important; padding: 1px 7px 25px !important; display: flex !important; align-items: center !important; justify-content: center !important; gap: 3px !important; color: #3a1a06 !important; -webkit-text-stroke: .45px #3a1a06; font-size: 18px !important; }
#stage.playing .topbar a.orak-home-button:not(.btn), .stage.playing .topbar a.orak-home-button:not(.btn) { width: 68px !important; height: 52px !important; padding: 1px 6px 21px !important; font-size: 15.5px !important; }
#stage .topbar a.orak-home-button:not(.btn) svg { width: 1.05em !important; height: 1.05em !important; flex: none; color: #3a1a06; }
/* B2: 소리는 둥근 메달 가운데에 스피커만(켬/끔 글자는 빼고 화면 읽기에는 남긴다) */
#stage .topbar button.orak-tool .orak-tool-state { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.stage:not(.playing) .topbar button.orak-tool { padding: 16px 0 29px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
.stage.playing .topbar button.orak-tool { padding: 14px 0 26px !important; display: flex !important; align-items: center !important; justify-content: center !important; }
#stage .topbar button.orak-tool svg { width: 22px !important; height: 22px !important; }
.stage.playing .topbar button.orak-tool svg { width: 19px !important; height: 19px !important; }
/* C2: 단추 위에 얹힌 그림이 잘리지 않게(넘침 막기는 글에만) */
.wood-cta, .wood-btn, .charm, .red-cta { overflow: visible; }
/* B4: 시작 화면 칩은 금 꼭지 이름표, 그림은 왼쪽에 걸치고 글은 그림 오른쪽 판 가운데 */
.stage:not(.playing) .paper-row .paper-chip.tag-chip { position: relative; background: url(sprites/ui-tag.webp) center / 100% 100% no-repeat; aspect-ratio: 640 / 107; padding: 0 7% 0 23%; justify-content: center; overflow: visible; max-width: 100%; font-size: clamp(15px, 5cqw, 22px); color: #3a1a06; -webkit-text-stroke: .35px #3a1a06; }
.stage:not(.playing) .paper-row .paper-chip.tag-chip .ico { position: absolute; left: 1%; top: 50%; translate: 0 -54%; width: auto; height: 170%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45)); }
.stage:not(.playing) .paper-row .paper-chip.tag-chip .tx { display: block; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; }
.stage:not(.playing) .paper-row { gap: 4cqw; padding: 0 2cqw; box-sizing: border-box; }
/* B8: 결과 화면 아래 두 단추는 금테 단추, 그림은 왼쪽, 글은 판 가운데 */
.res-row .gold-btn { position: relative; border: 0; background: url(sprites/ui-goldbtn.webp) center / 100% 100% no-repeat; aspect-ratio: 640 / 173; padding: 0 7% 0 24%; display: flex; align-items: center; justify-content: center; color: #3a1a06; -webkit-text-stroke: .35px #3a1a06; font: 400 clamp(14px, 4.6cqw, 20px)/1.1 var(--game); filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); min-width: 0; }
.res-row .gold-btn:active { transform: scale(.96); }
.res-row .gold-btn .ico { position: absolute; left: 4%; top: 50%; translate: 0 -52%; height: 120%; width: auto; aspect-ratio: 1; object-fit: contain; }
.res-row .gold-btn > span { display: block; min-width: 0; max-width: 100%; overflow: hidden; white-space: nowrap; }
/* D2: 도전 과제 알림은 왼쪽 위 작은 금색 리본(제목·로고를 가리지 않게) */
body:has(#stage.stage) .osc-toast { left: 8px !important; right: auto !important; transform: none !important; top: calc(env(safe-area-inset-top, 0px) + 74px) !important; width: min(74vw, 300px) !important; max-width: none !important; bottom: auto !important; animation: none !important; min-height: 0; aspect-ratio: 640 / 144; box-sizing: border-box; padding: 0 5% 2.6% 22% !important; background: url(/g/daegun/sprites/ui-ribbon.webp) left center / 100% 100% no-repeat !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; color: #4a2408 !important; font: 400 13px/1.1 var(--game) !important; display: flex !important; align-items: center; justify-content: center; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
body:has(#stage.stage) .osc-toast .osc-toast-icon { display: none !important; }
body:has(#stage.stage) .osc-toast .osc-toast-text { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
body:has(#stage.stage.playing) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + 128px) !important; }
/* 오늘의 길 부적: 안쪽 여백을 부적 너비(21cqw) 기준으로. 노란 판(세로 16~65%) 가운데에 발바닥·글·남은 횟수 */
.stage:not(.playing) .charm { padding: 5cqw 3.4cqw 11.6cqw; justify-content: center; gap: .4cqw; }
.stage:not(.playing) .charm b { font-size: clamp(11px, 3.6cqw, 16px); color: #7a1a08; -webkit-text-stroke: .3px #7a1a08; }
.stage:not(.playing) .charm small { font-size: clamp(15px, 5.4cqw, 24px); color: #7a1a08; -webkit-text-stroke: .4px #7a1a08; }
/* B3: 출발 간판 아랫줄은 ◆ 장식이 붙은 작은 크림색 알약 */
.stage:not(.playing) .go-row .wood-cta small { display: inline-flex; align-items: center; gap: 1.4cqw; margin-top: .8cqw; padding: .5cqw 3cqw .7cqw; border-radius: 99px; background: #fff1cf; border: 1.5px solid #c99a5a; box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset; color: #5a2a0a; max-width: 100%; }
.stage:not(.playing) .go-row .wood-cta small::before, .stage:not(.playing) .go-row .wood-cta small::after { content: '◆'; font-size: .6em; color: #b07a2a; flex: none; }
/* B10: 그림 위 글씨는 시안처럼 굵고 진한 갈색 */
.stage:not(.playing) .wood-cta b, .stage:not(.playing) .wood-btn > span, .sign-title { color: #3a1a06; -webkit-text-stroke: .5px #3a1a06; }
.stage:not(.playing) .wood-cta small { -webkit-text-stroke: .25px #5a2a0a; }
/* 칩 글은 이름표 판 한가운데(위로 뜨지 않게) */
.stage:not(.playing) .paper-row .paper-chip.tag-chip { padding-top: 1.4%; }
/* D2 시작 화면: 알림 리본은 로고 아래 */
body:has(#stage.stage:not(.playing)) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + 72px) !important; width: min(60vw, 250px) !important; font-size: 12px !important; }
body:has(#stage.stage.playing) .osc-toast { width: min(60vw, 250px) !important; font-size: 12px !important; }
/* B6·B7: 지도·상점 제목은 큰 간판 나무판(세로 27~68%) 한가운데, 상점 말풍선·지갑·설명 두루마리 글은 판 안 가운데 */
.sign-title { padding: 0 12cqw 1.4cqw; }
.shop-bubble { left: 33cqw; top: 19cqw; width: 40cqw; font-size: clamp(14px, 4.6cqw, 21px); line-height: 1.3; }
.shop-purse { width: 33cqw; right: 1cqw; padding: 8.4cqw 4cqw 8.8cqw; gap: .2cqw; }
.shop-purse small { font-size: clamp(11px, 3.3cqw, 15px); }
.shop-purse b { font-size: clamp(17px, 5.6cqw, 25px); }
.shop-desc { padding: 0 16cqw 0 15.5cqw; }
.shop-desc img { width: 13cqw; }
/* B9: 판 위 마을 이름표·멈춤 창 단추 글은 판 한가운데 */
.hud .where { height: 64px; padding: 0 10px 2px; font-size: clamp(13px, 4.4vw, 18px); }
.overlay .panel .btn:not(.ghost) { aspect-ratio: 640 / 299; width: 76%; align-self: center; margin-inline: auto; padding: 0 11% 1.8%; display: flex; align-items: center; justify-content: center; }
.map-sub { padding: 2.3cqw 8cqw 1.3cqw !important; }
.stage:not(.playing) .dex-home { padding: 0 8.8cqw 1.2cqw; display: flex; align-items: center; justify-content: center; }
.shop-desc { justify-content: center; }
.stage:not(.playing) .shop-buy { top: 139cqw; width: 70cqw; aspect-ratio: 640 / 299; padding: 0 13.5cqw 1.7cqw; display: flex; align-items: center; justify-content: center; }
.stage:not(.playing) .shop-buy b { font-size: clamp(17px, 5.4cqw, 25px); }
.shop-links { top: 172.5cqw; }
/* C1: 등급 도장은 월계수·발바닥이 든 붉은 도장, 칭호는 금 월계수 붉은 띠(시안 8) */
.res-grade { border: 0; outline: 0; background: url(sprites/ui-stamp.webp) center / 100% 100% no-repeat; box-shadow: none !important; padding-bottom: 5cqw; box-sizing: border-box; }
.res-grade b { font-size: 13cqw; }
.res-grade.g-B { border: 0; box-shadow: none; filter: sepia(.6) saturate(.7); }
.res-title { background: url(sprites/ui-titleband.webp) center / 100% 100% no-repeat; border: 0; box-shadow: none; border-radius: 0; aspect-ratio: 640 / 160; width: 54cqw; max-width: 100%; box-sizing: border-box; padding: 0 14cqw .4cqw; display: flex !important; align-items: center; justify-content: center; font-size: clamp(14px, 4.6cqw, 21px); color: #ffe9b8; text-shadow: 0 1px 0 #5a0a0a; }
.res-where { font-size: clamp(13px, 4.1cqw, 18px); padding: 1.3cqw 3.4cqw; }
.rstat b { font-size: clamp(18px, 6.4cqw, 28px); }
.rstat .rlab { font-size: clamp(11px, 3.3cqw, 14px); }
.res-earn { font-size: clamp(16px, 5.6cqw, 25px); padding: 1.6cqw 3cqw; }
.res-earn .ico { width: 10cqw; height: 10cqw; }
body:has(#stage.title-screen) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + 138px) !important; }
.res-grade b { font-size: 15cqw; -webkit-text-stroke: .5cqw currentColor; }
/* D1: 긴 화면(390x844 등)에서 장면 그림 아래가 맨 보라색으로 비지 않게, 돌바닥을 아래로 이어 깐다 */
.stage.shop-screen { background: url(sprites/shop-tent.webp) center top / 100% auto no-repeat, linear-gradient(rgba(20, 10, 36, .55), rgba(20, 10, 36, 0) 60px) 0 calc(100cqw * 1672 / 941 - 2px) / 100% 100% no-repeat, url(sprites/bg-title-foot.webp) 0 calc(100cqw * 1672 / 941 - 2px) / 100% auto repeat-y, #3a2440; }
.stage.dex-screen { background: url(sprites/dex-book.webp) center top / 100% auto no-repeat, linear-gradient(rgba(20, 10, 36, .55), rgba(20, 10, 36, 0) 60px) 0 calc(100cqw * 1672 / 941 - 2px) / 100% 100% no-repeat, url(sprites/bg-title-foot.webp) 0 calc(100cqw * 1672 / 941 - 2px) / 100% auto repeat-y, #2b1f4f; }
.stage.map-screen { background: linear-gradient(rgba(26, 16, 52, .55), rgba(26, 16, 52, .8)), url(sprites/bg-title.webp) center top / 100% auto no-repeat, url(sprites/bg-title-foot.webp) 0 calc(100cqw * 1672 / 941 - 2px) / 100% auto repeat-y, #2b1f4f; }
/* B6: 병적부 제목 글 윗부분이 잘리지 않게 */
.dex-title { line-height: 1.3; padding: .1em .2em; color: #3a1a06; -webkit-text-stroke: .5px #3a1a06; }
.dex-card.unseen .dex-name { font-size: clamp(12px, 4cqw, 18px); }
.shop-purse b { font-size: clamp(16px, 5.1cqw, 23px); }
.shop-purse { padding-top: 8cqw; padding-bottom: 9.2cqw; }
.shop-desc p { flex: 0 1 auto; }
.shop-desc p { text-align: center; align-items: center; }

/* 판 맞춤(2차): 여백은 game.js fitBoards가 그림 크기에서 잰다. 글은 판 가운데, 두 줄이 되면 가운데 정렬 */
.stage:not(.playing) .wood-btn:not(.side) > span { position: static; margin: 0; text-align: center; line-height: 1.05; }
.boarded > b, .boarded > small, .boarded > span, .sign-title, .map-sub { text-align: center; }
.overlay .panel .row2 .btn:not(.ghost) { width: 100%; aspect-ratio: 640 / 260; font-size: clamp(13px, 4cqw, 17px); }
.overlay .panel .row2 { gap: 1cqw; }
/* 한 줄로만 두는 글(판이 한 줄 높이): 줄 바꾸지 않고 글자만 줄인다 */
.vspot > span, .map-vname, .red-cta > b, .tag-chip > .tx, .gold-btn > span, .wood-cta > small { --fit-wrap: no; white-space: nowrap; }
.map-square .vspot > span { max-width: 92%; overflow: hidden; }
/* 지도 화면: 도전 과제 리본은 제목·부제 아래, 지도 두루마리 윗단에 걸친다(제목을 가리지 않게) */
body:has(#stage.stage:not(.playing) .map-square) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + min(33vw, 160px)) !important; }
.wood-cta > b { --fit-wrap: no; }
.stage:not(.playing) .charm .paw { width: 5.6cqw; height: 5.6cqw; }
.stage:not(.playing) .charm > b { line-height: 1.05; }
.res-go > b { --fit-wrap: yes; }
body:has(#stage.stage:not(.playing) .map-square) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + min(33vw, 160px) + 16px) !important; }
.shop-buy > b { --fit-wrap: yes; }
/* 지도 이름판: 자리를 그림 속 판 안쪽에 맞춘 뒤, 깃발·냥도사·선택 테두리는 판 바깥 크기에 맞춘다 */
.map-square .vspot > span { max-width: 100%; }
.map-square .vspot .vflag { width: 72%; }
.map-square .vspot .vdosa { width: 70%; left: -44%; }
.map-square .vspot.sel::after { inset: 18% -14%; }
/* 판 중: 도전 과제 리본은 왼쪽 아래(숫자 알약 아래, 부적 단추 왼쪽)로. 위쪽 냥도사 말풍선과 문을 가리지 않게 */
body:has(#stage.stage.playing) .osc-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important; width: min(54vw, 210px) !important; }
/* 금 꼭지 칩: 그림은 그대로, 누르는 자리만 32px 이상 */
.stage:not(.playing) .paper-row .paper-chip.tag-chip { aspect-ratio: auto; height: max(32px, 7.7cqw); min-height: 0; background-size: 100% auto; }
.boarded { min-width: 0; box-sizing: border-box; }
.map-square .vspot > span { --fit-min: 8.5px; }
.stage:not(.playing) .paper-row .paper-chip.tag-chip .ico { height: 13cqw; }
/* 긴 화면(19.5:9 등): 시안(16:9) 아래로 남는 높이를 메뉴 줄 사이에 나눠, 바닥에 빈 돌길만 남지 않게 */
.stage.title-screen .screen { min-height: 100%; box-sizing: border-box; }
.stage.title-screen .go-row, .stage.title-screen .wood-row, .stage.title-screen .paper-row { margin-top: auto; }
.stage.title-screen .scene-space { margin-bottom: 0; }
@media (max-aspect-ratio: 10 / 19) { .stage.title-screen .wood-row { gap: 1cqw; } .stage.title-screen .wood-btn { font-size: clamp(16px, 5.6cqw, 25px); } }
/* 상점 지갑: 두 줄(이름·숫자)이 판에 들어가게 조금 크게 */
.stage:not(.playing) .shop-purse { width: 38cqw; right: 0; }
.shop-purse small { font-size: clamp(12px, 3.6cqw, 16px) !important; }
/* 멈춤 창: 소리·진동 단추를 한 줄에 하나씩(긴 언어도 글씨가 작아지지 않게) */
.overlay .panel .row2 { grid-template-columns: 1fr; justify-items: center; }
.overlay .panel .row2 .btn:not(.ghost) { width: 70%; aspect-ratio: 640 / 230; font-size: clamp(14px, 4.4cqw, 18px); }
.stage:not(.playing) .go-row .charm { width: 22.5cqw; }
.map-sub { font-size: clamp(12px, 3.5cqw, 16px) !important; }
/* 시작 화면 무리 숫자: 시안처럼 꼬리 달린 파란 말풍선 + 반짝 선 */
.title-scene .count-badge { padding: .8cqw 3.6cqw 1cqw !important; border-radius: 99px; border: .8cqw solid #fff; background: linear-gradient(#4a9bff, #1f63e0); box-shadow: 0 1cqw 1.6cqw rgba(0, 0, 0, .4); text-shadow: 0 .4cqw 0 #123a8a; overflow: visible; }
.title-scene .count-badge::after { content: ""; position: absolute; left: 22%; bottom: -2.6cqw; width: 4cqw; height: 4cqw; background: #1f63e0; border-right: .8cqw solid #fff; border-bottom: .8cqw solid #fff; transform: skewX(18deg) rotate(45deg); border-bottom-right-radius: 1cqw; z-index: -1; }
.title-scene .count-badge::before { content: ""; position: absolute; right: -4.4cqw; top: -2.4cqw; width: 5cqw; height: 5cqw; background: linear-gradient(60deg, transparent 42%, #ffd43a 42% 58%, transparent 58%) 0 0 / 2.2cqw 100% no-repeat, linear-gradient(90deg, transparent 40%, #ffd43a 40% 60%, transparent 60%) 2.4cqw 0 / 2.2cqw 80% no-repeat; }
/* 3차: 큰 알림은 위 제목 판 글을 잠깐 바꿔 보인다 */
.hud .where.flash { color: #9a2a10; animation: whereFlash .5s ease-out; }
@keyframes whereFlash { 0% { transform: scale(1.18); filter: drop-shadow(0 0 10px #ffd34a) brightness(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .hud .where.flash { animation: none; } }
.drag-hint .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; padding: 0; background: none; }
.drag-hint { inset: auto 30% 4% 30%; }
/* 3차: 위 단추는 시안처럼 둥근 진갈색 나무 메달 + 흰 아이콘(시작 화면의 '홈'만 시안대로 나무 판) */
#stage .topbar button.orak-tool, #stage.stage .topbar button.orak-tool { width: 52px !important; height: 52px !important; padding: 0 !important; background: url(sprites/ui-medal-round.webp) center / contain no-repeat !important; color: #fff !important; display: flex !important; align-items: center !important; justify-content: center !important; align-self: flex-start !important; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
#stage .topbar button.orak-tool svg, #stage.stage.playing .topbar button.orak-tool svg { width: 25px !important; height: 25px !important; filter: drop-shadow(0 1px 0 rgba(40, 16, 4, .8)); }
#stage .topbar button.orak-tool.is-off { color: #d9cbb8 !important; }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn), #stage.stage.playing .topbar a.orak-home-button:not(.btn) { width: 52px !important; height: 52px !important; padding: 7px 4px 8px !important; background: url(sprites/ui-medal-round.webp) center / contain no-repeat !important; display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 0 !important; color: #fff !important; -webkit-text-stroke: 0 !important; font-size: 11px !important; line-height: 1 !important; text-shadow: 0 1px 0 #3a1a06, 0 0 3px #3a1a06; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn) svg, #stage.stage.playing .topbar a.orak-home-button:not(.btn) svg { display: block !important; width: 21px !important; height: 21px !important; color: #fff !important; filter: drop-shadow(0 1px 0 rgba(40, 16, 4, .8)); }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn) span { max-width: 40px; overflow: hidden; text-overflow: clip; white-space: nowrap; }
/* 3차: 말풍선은 말하는 인물 머리 위에(꼬리로 가리킴) */
.stage.playing .say.anch { top: var(--sy) !important; left: var(--sx) !important; bottom: auto !important; transform: translate(-50%, -100%); display: block; text-align: center; padding: 8px 14px 9px !important; max-width: min(70%, 290px); background: #fffaf0; color: #3a2414; border: 2.5px solid #5a3a1a; border-radius: 18px; font: 16px/1.3 var(--game); }
.stage.playing .say.anch .sayface { display: none; }
.stage.playing .say.anch .who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.stage.playing .say.anch::after { display: block !important; left: var(--tx, 50%); top: auto; bottom: -9px; background: #fffaf0; border: 2.5px solid #5a3a1a; border-top: 0; border-left: 0; transform: translateX(-50%) rotate(45deg); }
.stage.playing .say.boss.anch { background: #fff; color: #2a1410; border: 3px solid #2a1410; border-radius: 22px 22px 22px 22px; font-size: 18px; box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(0,0,0,.35); }
.stage.playing .say.boss.anch::after { background: #fff; border-color: #2a1410; }
.stage.playing .say.anch.on { animation: sayInA .28s cubic-bezier(.3, 1.5, .5, 1) both; }
.stage.playing .say.anch.out { animation: sayOutA .28s ease-in both; }
@keyframes sayInA { from { opacity: 0; transform: translate(-50%, -100%) scale(.6); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
@keyframes sayOutA { to { opacity: 0; transform: translate(-50%, -100%) scale(.85); } }
@media (prefers-reduced-motion: reduce) { .stage.playing .say.anch.on, .stage.playing .say.anch.out { animation: none; } }
/* 3차: 시작 화면 성문을 화면 안으로 옮긴 배경에 맞춘 현판 자리 */
.title-scene .gate-num { left: 73.9cqw; top: 54cqw; white-space: nowrap; }
/* 3차: 출발 판 두 줄 사이를 띄우고, 오늘의 길 부적은 시안처럼 크게·종이 가운데에 */
.stage:not(.playing) .wood-cta { gap: 1.4cqw !important; }
.stage:not(.playing) .wood-cta b { line-height: 1 !important; }
.stage:not(.playing) .wood-cta small { margin-top: .6cqw; }
.stage:not(.playing) .charm { width: 24.5cqw !important; gap: .8cqw !important; justify-content: center !important; }
.stage:not(.playing) .charm .paw { width: 6cqw; height: 6cqw; }
.stage:not(.playing) .charm b { font-size: clamp(12px, 4.1cqw, 18px) !important; }
.stage:not(.playing) .charm small { font-size: clamp(18px, 6.8cqw, 30px) !important; line-height: 1 !important; }
/* 3차: 시작 화면의 도전 과제 리본은 제목을 가리지 않게 맨 아래(안내 글 자리)에 잠깐 */
body:has(#stage.stage.title-screen) .osc-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 4px) !important; left: 50% !important; transform: translateX(-50%) !important; }
/* 3차: 상점 말풍선은 제목 판 아래로, 아래 단추·안내 글은 겹치지 않게 */
.shop-bubble { top: 24cqw !important; z-index: 3; }
.shop-links { top: 173cqw !important; }
.shop-links .link-btn { font-size: 15px; }
.shop-note { top: 186cqw !important; font-size: 13px !important; }
/* 3차: 결과 아래 점수판·다른 놀이, 기록장도 두루마리·나무판 그림체로(그림 없는 검은 상자 없앰) */
.stage.res-screen .osc-breakdown, .stage .osc-book .osc-record, .stage .osc-book .osc-challenge, .stage.res-screen .orak-next-card {
  background: linear-gradient(#fbf0d6, #f1dcb0) !important; border: 3px solid #8a5a2a !important; border-radius: 16px !important; color: #4a2408 !important;
  box-shadow: inset 0 0 0 2px #fff6df, 0 3px 0 #5a3414, 0 6px 10px rgba(0, 0, 0, .35) !important; font-family: var(--game); }
.stage.res-screen .osc-breakdown *, .stage .osc-book .osc-record *, .stage .osc-book .osc-challenge *, .stage.res-screen .orak-next-card * { color: inherit; }
.stage.res-screen .osc-breakdown .osc-number, .stage .osc-book .osc-record-value, .stage.res-screen .osc-breakdown .osc-total { color: #9a2a10 !important; }
.stage .osc-book .osc-sub, .stage.res-screen .osc-breakdown .osc-sub, .stage .osc-book .osc-date, .stage.res-screen .orak-next-card small, .stage.res-screen .orak-next-card p { color: #7a4a1a !important; }
.stage .osc-book .osc-done-stamp { color: #c4161c !important; }
.stage.res-screen .orak-next-title, .stage .osc-book .osc-heading, .stage .osc-book .osc-tier { color: #ffe6a8 !important; font-family: var(--game); text-shadow: 0 2px 0 #2a1440, 0 0 6px #2a1440; }
.stage .osc-book { background: url(sprites/bg-title-foot.webp) 0 0 / 100% auto repeat-y, #2b1f4f !important; font-family: var(--game); }
.stage .osc-book .osc-header { border-bottom: 0; justify-content: center; position: relative; padding: 10px 12px 6px; }
.stage .osc-book .osc-title { background: url(sprites/ui-sign-big.webp) center / 100% 100% no-repeat; color: #5a2a0a; padding: 12px 40px 16px; font-size: 24px; text-shadow: 0 1px 0 #fff2c8; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.stage .osc-book .osc-back { position: absolute; left: 10px; top: 10px; width: 52px; height: 52px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: url(sprites/ui-medal-round.webp) center / contain no-repeat; color: #fff; font-size: 24px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
/* 3차: 결과 화면 대사는 흰 상자 대신 냥도사를 가리키는 말풍선 */
.stage.res-screen .res-bubble { background: #fffaf0 !important; color: #3a2414 !important; border: 2.5px solid #5a3a1a !important; border-radius: 18px !important; padding: 7px 13px 8px !important; font: 400 clamp(13px, 3.9cqw, 17px)/1.3 var(--game) !important; box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 6px 12px rgba(0,0,0,.3) !important; overflow: visible !important; }
.stage.res-screen .res-bubble::after { content: ""; position: absolute; right: -9px; top: 9px; width: 14px; height: 14px; background: #fffaf0; border: 2.5px solid #5a3a1a; border-left: 0; border-bottom: 0; transform: rotate(45deg) skew(10deg, 10deg); }
/* 부적: 이름은 한 줄로만(일본어·중국어가 두 줄로 나뉘어 숫자를 덮지 않게) */
.stage:not(.playing) .charm > b { --fit-wrap: no; white-space: nowrap !important; }
.stage:not(.playing) .charm .paw { width: 5.2cqw; height: 5.2cqw; }
.stage:not(.playing) .charm { gap: .3cqw !important; }
/* 메달 홈 단추: 긴 언어(Trang chủ 등)는 한 줄로 줄여 메달 안에 */
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn) span { --fit-wrap: no; --fit-min: 10.5px; max-width: 38px; }
#stage .topbar a.orak-home-button span.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%); }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn):has(span.sr-only) { padding: 0 !important; justify-content: center !important; }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn):has(span.sr-only) svg { width: 25px !important; height: 25px !important; }
/* 3차 P11: 부적 폭발은 시안처럼 크고 두꺼운 금테 + 금빛 게이지 */
.stage.playing .skill { width: 108px; height: 108px; right: 8px; background: radial-gradient(circle, #4b2f7d 0 52%, transparent 53%), radial-gradient(circle, #3a2410 0 60%, #ffe08a 61% 63%, #e0a23a 64% 69%, #8a5418 70% 73%, transparent 74%); }
.stage.playing .skill i { inset: 7%; background: conic-gradient(#ffd23a var(--p, 0%), #ffb21a var(--p, 0%), rgba(40, 20, 10, .85) 0); -webkit-mask: radial-gradient(circle, transparent 0 66%, #000 67%); mask: radial-gradient(circle, transparent 0 66%, #000 67%); }
.stage.playing .skill img { inset: 21% 20% 25%; width: 60%; }
/* 3차 S10: B 도장도 붉은 도장(회색 빼고 조금만 옅게) */
.res-grade.g-B { filter: saturate(.85) !important; color: #b3261a !important; }
/* 3차 S9: 상점 아래 단추는 시안처럼 나무판 단추로, 글은 진하고 크게 */
.shop-links { display: flex; gap: 3cqw; justify-content: center; }
.shop-links .link-btn { min-height: 40px; padding: 6px 16px 8px; border: 2px solid #8a5420 !important; border-radius: 12px; background: linear-gradient(#fff1c8, #e9c98a) !important; color: #5a2a0a !important; text-decoration: none !important; font: 400 16px/1.1 var(--game) !important; box-shadow: 0 3px 0 #6a3a10, 0 4px 6px rgba(0, 0, 0, .4); opacity: 1 !important; text-shadow: none !important; }
.shop-note { color: #fff4d6 !important; text-shadow: 0 1px 2px #000; }
.shop-links .link-btn:disabled { opacity: .5 !important; box-shadow: none; }
.shop-note { top: 188cqw !important; }
/* 3차: 상점·도감에서는 도전 과제 리본을 화면 맨 아래로(말풍선·제목을 가리지 않게) */
body:has(#stage.stage .dex-scene) .osc-toast, body:has(#stage.stage .shop-bubble) .osc-toast { top: auto !important; bottom: calc(env(safe-area-inset-bottom, 0px) + 4px) !important; left: 50% !important; transform: translateX(-50%) !important; }
/* 결과 말풍선: 글은 가운데, 줄은 고르게 나누고 상자는 글 폭에 맞춘다 */
.stage.res-screen .res-bubble { text-align: center; text-wrap: balance; width: max-content; box-sizing: border-box; }
/* 출발 판 큰 글: 줄 상자가 눌려 글자 아래(받침)가 잘리던 것 → 줄 높이를 지키고 넘치면 글씨를 줄인다 */
.stage:not(.playing) .wood-cta > b, .stage:not(.playing) .wood-cta > small { flex: none !important; overflow: visible !important; }
.stage:not(.playing) .wood-cta > b { line-height: 1.12 !important; }
.topbar a.orak-home-button span { line-height: 1.25 !important; }
.stage:not(.playing) .go-row .wood-cta small { font-size: clamp(12px, 3.3cqw, 15px) !important; line-height: 1.15 !important; padding: .2cqw 2.6cqw .3cqw !important; margin-top: .3cqw !important; }
.stage:not(.playing) .wood-cta { gap: .4cqw !important; }
.stage:not(.playing) .wood-cta > b { line-height: 1.06 !important; }
/* 시작 화면 홈 판자: 시안처럼 집 그림과 글을 조금 크게, 판 가운데에 */
#stage.title-screen .topbar a.orak-home-button span { font-size: 21px !important; line-height: 1.25 !important; }
#stage.title-screen .topbar a.orak-home-button svg { width: 21px !important; height: 21px !important; }
/* 도감 이름: 두 줄 안에 들도록 줄인다(긴 언어에서 셋째 줄이 잘리던 것) */
.dex-name { --fit-lines: 2; }
.dex-card .dex-name { flex: none; }
/* 도감: 제목은 이름띠의 밝은 판 안에서 줄이고, 이름은 낱말 중간에서 끊지 않으며 세 줄까지(그림을 조금 줄여 자리 확보) */
.dex-title { max-width: 56cqw; }
.dex-card .dex-name { overflow-wrap: normal !important; word-break: keep-all !important; --fit-lines: 3; }
.dex-card.unseen img { width: 62%; }
.dex-title { max-width: 52cqw; --fit-wrap: no; }
.dex-card.unseen img { width: 56%; }
.dex-card.unseen .dex-name { font-size: clamp(10px, 3.3cqw, 14px) !important; line-height: 1.1 !important; }
#stage.title-screen .topbar a.orak-home-button span { max-width: 46px; --fit-wrap: no; --fit-min: 12px; overflow: hidden; }
/* 멈춤 창: 결과 화면과 같은 두루마리(위 막대+술, 종이, 아래 막대). 좁은 세로 두루마리를 넓게 늘이면 끝 막대와 테두리가 찌그러진다 */
.overlay .panel { border: 0; border-image: none; background: url(sprites/ui-result-top.webp) top center / 100% auto no-repeat, url(sprites/ui-result-bot.webp) bottom center / 100% auto no-repeat, url(sprites/ui-result-mid.webp) center / 100% calc(100% - 30cqw) no-repeat; padding: 13cqw 8cqw 15cqw; width: min(100%, 94cqw); }
.overlay { z-index: 50; }
.overlay .panel.ask { min-height: 0; padding: 14cqw 9cqw 16cqw; }
.overlay .panel.ask .ask-msg { margin: 2cqw 0 1cqw; font: 400 clamp(17px, 5.2cqw, 22px)/1.4 var(--game); color: #5a2a0a; text-align: center; word-break: keep-all; text-wrap: balance; }
/* 판 밖 화면(시작 화면처럼 자식들을 relative로 쌓는 곳)에서도 묻는 창은 화면 한가운데를 덮는다 */
.stage > #overlay.overlay { position: fixed !important; top: 0 !important; bottom: 0 !important; left: 50% !important; right: auto !important; width: min(100vw, 480px); translate: -50% 0; z-index: 60; }
.overlay .panel .ask-actions { display: grid; gap: 10px; } /* 시작 화면의 .actions 배치 규칙을 받지 않게 따로 이름을 둔다 */
/* 지도: 특별 단계·고비 칸은 자물쇠 대신 그 판을 알리는 그림을 둔다 */
.mtile.flav { justify-content: flex-start; }
.mtile.flav.lock { background-image: url(sprites/tile.webp); filter: brightness(.9); }
.mtile.flav small { position: absolute; left: 0; right: 0; top: 7%; text-align: center; }
.mtile.flav .ficon { margin-top: 32%; width: 54%; border-radius: 0; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
/* 3.0 글자·판 재검수: 둥근 메달 '홈'은 글자가 메달 밖으로 넘쳐서(태국어·독일어·영어) 다른 메달 단추처럼 아이콘만. 글자는 읽기 프로그램용으로 남김 */
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn) span, #stage.stage.playing .topbar a.orak-home-button:not(.btn) span { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap; }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn) svg, #stage.stage.playing .topbar a.orak-home-button:not(.btn) svg { display: block !important; width: 25px !important; height: 25px !important; }
#stage:not(.title-screen) .topbar a.orak-home-button:not(.btn), #stage.stage.playing .topbar a.orak-home-button:not(.btn) { padding: 0 !important; justify-content: center !important; position: relative; }
html[lang="th"] #stage.title-screen .topbar a.orak-home-button:not(.btn) { padding-top: 5px !important; padding-bottom: 21px !important; }
/* 3.0 전체 조합 검수: 긴 언어의 금빛 단추 이름이 왼쪽 그림 밑으로 들어가지 않게 */
html:not([lang="ko"]) .res-row .gold-btn { font-size: clamp(12px, 3.9cqw, 16px); }
/* 2026-12-02 업적 알림 띠: 긴 언어에서 '…'로 잘리던 것 → 두 줄까지, 글자를 조금 줄여 띠 안에 */
body:has(#stage.stage) .osc-toast .osc-toast-text { white-space: normal !important; text-overflow: clip !important; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.08; text-align: center; overflow-wrap: normal; text-wrap-style: balance; }
html:not([lang=ko]) body:has(#stage.stage) .osc-toast { font-size: 10.5px !important; }
.rstat .rlab { text-overflow: clip; }
html:not([lang=ko]) body:has(#stage.stage) .osc-toast { padding-right: 8% !important; padding-left: 20% !important; font-size: 9.5px !important; }
/* 2026-12-02 일본어: 낱말 가운데 줄바꿈(ゲ/ート, 行/くニャ, バー/スト) → 구 단위 줄바꿈 */
html[lang=ja] #stage :is(p, span, b, small, .say, .bubble) { word-break: auto-phrase !important; }
html[lang=ja] .guide :is(p, span, b) { word-break: auto-phrase !important; text-wrap-style: balance; }
/* 시작 화면 맨 아래 조작 안내가 화면 끝에서 잘리던 것(긴 언어) → 두 줄까지 고르게 */
/* 결과 칸 이름(Multiplicador de Churu 등)이 아이콘 옆 좁은 칸에서 잘리던 것 → 긴 언어는 이름을 칸 위쪽 전체 폭에, 아이콘·숫자는 아래 줄에 */
html:not([lang=ko]) .rstat { grid-template-areas: "l l" "i v"; row-gap: .6cqw; text-align: center; }
html:not([lang=ko]) .rstat .rlab { justify-self: stretch; text-align: center; --fit-lines: 2; white-space: normal !important; line-height: 1.05; text-wrap-style: balance; }
html:not([lang=ko]) .rstat .rico { width: 6.5cqw; }
html:not([lang=ko]) .rstat .rico img { width: 6.5cqw; height: 6.5cqw; }
html:not([lang=ko]) .rstat b { justify-self: start; }
html[lang=ja] .skill > b, html[lang=zh-TW] .skill > b { white-space: nowrap !important; word-break: keep-all !important; }
/* 일본어·중국어 상점 이름이 모두 8px로 줄던 것: 이 글꼴은 글자 잉크가 줄 높이(1.05)보다 커서 '넘침'으로 잡혔다 → 줄 높이를 글자에 맞춘다 */
html:is([lang=ja],[lang=zh-TW],[lang=th],[lang=vi]) :is(.shelf-card > b, .dex-title, .dex-foot, .sign-title, .map-sub, .rstat .rlab, .dex-name, .res-title) { line-height: 1.3 !important; }
html[lang=th] .shelf-card > b { line-height: 1.45 !important; }
/* 결과 칭호 띠: 긴 칭호(Eiserner Wächter 9.7px 등)가 한 줄에 우겨 넣어져 작아지던 것 → 두 줄까지 */
html:not([lang=ko]):not([lang=ja]):not([lang=zh-TW]) .res-title { --fit-lines: 2; white-space: normal !important; line-height: 1.02; text-wrap-style: balance; padding: 3.3cqw 16.5cqw 2.3cqw !important; }
html[lang=vi]:not([lang=ko]):not([lang=ja]):not([lang=zh-TW]) .res-title { padding: 2.4cqw 16.5cqw 3cqw !important; }
/* 첫 화면 맨 아래 조작 안내: 돌바닥 무늬에 묻혀 안 읽혔다 → 밝은 글자 + 어두운 반투명 띠 */
.stage.title-screen .screen>.drag-instruction { color: #fbefd6 !important; text-shadow: 0 1px 2px #000c, 0 0 4px #000a; background: linear-gradient(90deg, #0000, #1a0f2ab3 18%, #1a0f2ab3 82%, #0000); padding: 2px 18px; border-radius: 0; opacity: 1 !important; }
.dex-card .dex-name { text-wrap-style: balance !important; }
.stage:not(.playing) .charm small { font-size: clamp(15px, 5.4cqw, 22px); } /* 부적 아래 숫자가 바닥 무늬에 닿지 않게 */
.map-square .vspot .vdosa { z-index: 1; } /* 지도 위 냥도사가 마을 이름 첫 글자를 덮던 것 → 이름판이 앞 */
.map-square .vspot > span { max-width: 88% !important; padding-block: .2em; } /* 이름판 테두리 안쪽까지만, 아래로 내려가는 글자(g·태국어 모음)는 안 잘리게 */
.title-scene .bubble, .say { text-wrap-style: balance; } /* 말풍선 끝줄에 한두 글자만 남지 않게 */
.title-scene:has(.bubble:not([hidden])) #cbadge { visibility: hidden; }
html:is([lang=zh-TW],[lang=ja]) .result-screen .res-title, html:is([lang=zh-TW],[lang=ja]) .res-title { padding-left: 16cqw !important; padding-right: 16cqw !important; --fit-wrap: no; white-space: nowrap !important; } /* 칭호 글자가 양쪽 발바닥 무늬에 닿지 않게 */
#stage.title-screen .topbar a.orak-home-button span { max-width: 58px; --fit-min: 10px; } /* 베트남어 "Trang chủ"가 잘리던 것 */
html[lang=vi] .dex-card.unseen .dex-name { line-height: 1.2 !important; --fit-lines: 2; } /* 세 줄로 늘어 칸 밑에서 잘리던 것 → 두 줄 안에서 줄인다 */
html[lang=th] .dex-card .dex-name { line-height: 1.42 !important; } /* 태국어 글자 상자가 줄 높이보다 커서 "넘침"으로 잡혀 최소 크기로 줄던 것 */
.shop-bubble { text-wrap-style: balance; }
/* 2026-12-02 결과 칭호 띠: 두 줄 칭호가 붉은 판 위아래 금테에 닿던 것 → 한 줄에 안 들어가는 칭호는 띠를 도장 아래 온 폭으로 넓혀 한 줄로(그림 비율 그대로, 양쪽 발바닥 무늬 안쪽에) */
.res-panel.wide-title { grid-template-areas: "g w" "t t" "s s" "e e"; }
html body .res-panel.wide-title .res-title:not(#_) { width: 82cqw; max-width: 100%; padding: .5cqw 22.5cqw 0 !important; --fit-lines: 1 !important; --fit-wrap: no; white-space: nowrap !important; line-height: 1.2 !important; font-size: clamp(15px, 4.8cqw, 21px); }
/* 일본어 ホーム처럼 그림 아이콘+글이 나무 간판보다 길면 글이 간판 밖으로 나가던 것 → 글 칸이 줄어들어 글자를 줄인다 */
#stage .topbar a.orak-home-button:not(.btn) span { min-width: 0 !important; flex: 0 1 auto !important; }
/* 태국어 아래 모음(ุ ู)·베트남어 성조가 종이 띠 글 칸(overflow hidden)에 잘리던 것 → 줄 높이를 글자 잉크만큼 */
html:is([lang=th],[lang=vi]) .stage:not(.playing) .paper-row .paper-chip.tag-chip .tx { line-height: 1.55; }
/* 도전 알림 띠: 60vw 띠에 긴 알림이 두 줄에서 '…'로 잘리던 것 → 그림 비율 그대로 띠를 넓힌다(머리띠 아래라 단추를 가리지 않는다) */
html body:has(#stage.stage:not(.playing)) .osc-toast { width: min(80vw, 310px) !important; font-size: 11.5px !important; }
/* 시작 화면 홈 간판: 긴 글(Home, Início)이 나무판 테두리에 닿던 것 → 양옆 여백을 판 안쪽 나무결까지 */
#stage.title-screen .topbar a.orak-home-button:not(.btn) { padding-left: 11px !important; padding-right: 11px !important; }
#stage.title-screen .topbar a.orak-home-button.long:not(.btn) span { font-size: 18px !important; }
/* 2026-12-02 결과 화면 알림 띠: 머리띠 아래(72px)에 두면 냥도사 말풍선 윗줄을 가렸다 → 홈·소리 단추 사이 머리띠 자리로 */
html body:has(#stage.stage.res-screen) .osc-toast { top: calc(env(safe-area-inset-top, 0px) + 12px) !important; left: 66px !important; width: calc(100% - 132px) !important; height: 48px !important; aspect-ratio: auto !important; padding: 2px 10px !important; background: #3a2414 !important; border: 2px solid #e0b24a !important; border-radius: 14px !important; color: #fff1cf !important; filter: none !important; font: 400 11px/1.12 var(--game) !important; }
html body:has(#stage.stage.res-screen) .osc-toast .osc-toast-text { line-height: 1.12 !important; -webkit-line-clamp: 3 !important; }
