/* 퇴마록 3.0 — 골목, 두루마리와 목판 */
:root {
  --bg: #171427;
  --ink: #422410;
  --cream: #fff1cf;
  --gold: #ffdc79;
  --red: #991c15;
  --game: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --shadow: 0 3px 8px #22110980;
  /* 시안과 같은 금테 UI(k-*) */
  --plaque: url("sprites/k-cta.webp");
  --chip: url("sprites/k-chip.webp");
  --sign: url("sprites/k-cta.webp");
  --kbtn: url("sprites/k-btn.webp");
  --medal: url("sprites/ui-medal.webp");
  --red-button: url("sprites/ui-btn-red.webp");
  --talisman: url("sprites/ui-talisman.webp");
  --slot: url("sprites/ui-slot.webp");
  --seal: url("sprites/k-seal.webp");
  --moon: url("sprites/ui-moon.webp");
  --bar: url("sprites/ui-bar.webp");
}
html:lang(th) { --game: "Noto Sans Thai", sans-serif; --body: var(--game); }
html:lang(ja) { --game: "Noto Sans JP", sans-serif; --body: var(--game); }
html:lang(zh-TW) { --game: "Noto Sans TC", sans-serif; --body: var(--game); }
html:lang(vi) { --game: "Noto Sans", sans-serif; --body: var(--game); }
body { margin: 0; background: var(--bg); color: var(--cream); font: 16px/1.45 var(--body); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font: 24px/1.17 var(--game); }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button:not(:disabled):active, .btn:active { scale: .96; filter: brightness(.87); }
[hidden] { display: none !important; }
[data-fit] {
  display: block; min-width: 0; width: 100%; line-height: 1.24; overflow-wrap: anywhere; hyphens: auto;
  transition-property: none; /* 공통 모션 감소 설정에서도 글자 크기를 즉시 측정한다. */
}
.ico { width: 28px; height: 28px; object-fit: contain; flex: none; }
.actor { display: block; object-fit: contain; object-position: center bottom; }
.center { text-align: center; }
.sub, .small { font-size: 14px; }
.stage {
  max-width: 480px; margin: 0 auto; display: flex; flex-direction: column;
  isolation: isolate; background: #4b3022 url("sprites/bg-start.webp") center bottom / cover no-repeat;
}
.stage[data-scene="shop"] { background-image: url("sprites/bg-shop.webp"); background-position: center top; }
.stage[data-scene="win"] { background-image: url("sprites/bg-dawn.webp"); }
.stage[data-scene="lose"] { background-image: url("sprites/bg-night-lose.webp"); }
.stage > .topbar {
  position: absolute; z-index: 7; inset: env(safe-area-inset-top, 0px) 0 auto;
  display: flex; align-items: center; justify-content: space-between; padding: 6px 8px;
  pointer-events: none;
}
.stage > .topbar > :is(.orak-home-button,.icon-btn), .icon-btn { pointer-events: auto; }
.stage .topbar > .orak-home-button, .stage .topbar > .icon-btn, .icon-btn, .medal {
  display: grid; place-items: center; padding: 0; width: 48px; height: 48px;
  border: 0; border-radius: 50%; color: var(--cream); background: var(--medal) center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 3px #160b08a0);
}
.stage .topbar :is(a.orak-home-button,button.orak-tool) {
  width: 48px !important; height: 48px !important; padding: 0 !important;
  border: 0 !important; color: var(--cream) !important; border-radius: 50% !important;
  background: var(--medal) center / 100% 100% no-repeat !important;
}
.stage .topbar :is(.orak-home-button span,.orak-tool-state) { display: none !important; }
.topbar svg, .icon-btn svg { width: 22px; height: 22px; }
.stage.playing .topbar { display: none; }
.screen {
  flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 10px calc(env(safe-area-inset-bottom, 0px) + 12px);
  overflow: auto; scrollbar-width: none;
}
.screen > * { flex-shrink: 0; }
.stage.playing .screen { padding: 0; overflow: hidden; }
.wood, .btn, .medal {
  --fit-min: 18;
  min-width: 0; color: var(--cream); text-align: center;
  background: var(--plate, var(--chip)) center / 100% 100% no-repeat;
  text-shadow: 0 1px 2px #2e1308;
}
.medal { --plate: var(--medal); }
.wood:not(.purse) { display: grid; align-content: center; }
.plaque { --plate: var(--plaque); min-height: 60px; padding: 10px 50px 12px; color: var(--cream); }
.chip { min-height: 30px; padding: 4px 24px 5px; font: 18px/1.15 var(--game); }
.btn {
  min-height: 48px; display: grid; place-items: center; border: 0; padding: 8px 22px;
  font: 19px/1.15 var(--game); text-decoration: none; transition: scale .08s ease;
}
.btn.primary {
  --plate: var(--sign); --fit-min: 28; min-height: 70px;
  padding: 10px 18%; font-size: 34px; color: var(--gold); text-shadow: 0 2px 2px #361209;
}
.btn.red { --plate: var(--red-button); }
.wood, .btn:not(.tonight) { position: relative; isolation: isolate; background: none; }
.wood::before, .btn:not(.tonight)::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: var(--plate, var(--chip)) var(--board-slice, 51 73) fill / var(--board-edges, 11px 19px) stretch;
}
.wood, .btn { --board-slice: 32 72; --board-edges: 10px 22px; }
.btn:not(.primary):not(.red) { --plate: var(--kbtn); --board-slice: 54 62; --board-edges: 14px 17px; }
.plaque { --board-slice: 52 122; --board-edges: 20px 46px; }
.btn.primary { --board-slice: 52 122; --board-edges: 26px 60px; }
.btn.red { --board-slice: 47 62; --board-edges: 14px 21px; }
.btn:disabled { filter: saturate(.4) brightness(.82); }
.actions { display: grid; gap: 5px; min-width: 0; }
.row2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
.purse {
  --fit-min: 13; display: flex; align-items: center; gap: 5px; min-width: 104px; max-width: 150px; min-height: 36px;
  padding: 4px 16px 5px 10px; font: 18px/1 var(--game); color: var(--cream);
}
.purse .ico { width: 24px; height: 24px; }
.purse-label { flex: none; font-size: 15px; opacity: .92; }
.purse { justify-content: center; gap: 4px; min-width: 0; padding-inline: 12px 16px; }
.purse b { font-weight: 400; width: auto; flex: 0 1 auto; text-align: left; }
.parchment {
  position: relative; isolation: isolate; color: var(--ink);
  margin-block: 22px 24px; padding: 4px 22px;
  background: url("sprites/ui-scroll-mid.webp") center / 119% auto repeat-y;
}
.parchment::before, .parchment::after {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; height: 33px; pointer-events: none;
  background: center / 100% 100% no-repeat;
}
.parchment::before { top: -27px; background-image: url("sprites/ui-scroll-top.webp"); }
.parchment::after { bottom: -27px; background-image: url("sprites/ui-scroll-bottom.webp"); }
.bubble, .toast, .orb-guide, .speech {
  color: var(--ink); background: #fff1cf; border: 1px solid #86522a; border-radius: 18px;
  padding: 7px 10px; font: 700 15px/1.17 var(--body); text-align: center; box-shadow: var(--shadow);
}
.bubble::after {
  content: ""; position: absolute; top: calc(100% - 3px); left: 24%;
  width: 10px; height: 10px; background: #fff1cf; rotate: 45deg; border-right: 1px solid #86522a; border-bottom: 1px solid #86522a;
}
.bob { animation: bob 2s ease-in-out infinite alternate; }
@keyframes bob { to { translate: 0 -5px; } }
@keyframes pop { 0% { scale: .93; } 65% { scale: 1.04; } }
.toast {
  position: fixed; z-index: 20; bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  left: 50%; translate: -50%; width: max-content; max-width: min(420px, calc(100% - 24px)); pointer-events: none;
}
/* 도전 과제 알림: 나무 칩 그림을 9칸으로 늘려 양 끝 금장식은 그대로 두고, 글자는 가운데 나무 면 안에만 */
body:has(.stage) .osc-toast {
  background: none; color: var(--cream); border: 1px solid transparent; border-radius: 0; box-shadow: none;
  border-image: var(--kbtn) 54 62 fill / 14px 17px stretch;
  min-height: 46px; padding: 10px 20px 11px; max-width: min(400px, calc(100% - 24px));
  filter: drop-shadow(0 4px 6px #0007); text-shadow: 0 1px 2px #2e1308;
}
body:has(.stage) .osc-toast-text { overflow-wrap: normal; word-break: keep-all; text-align: center; }

/* 시작과 오늘 밤 준비 */
.stage { container-type: size; }
.stage[data-scene="start"] { background: #1b1631; }
/* 시작 장면: 배경 그림을 화면에 꽉 차게(cover) 깔고, 그 위 같은 좌표계에 창가 냥술사·담장 요괴·앞가림 층을 겹친다 */
.start-scene {
  --bw: max(100cqw, 56.25cqh);
  position: absolute; z-index: -1; bottom: 0; left: calc((100cqw - var(--bw)) * .45);
  width: var(--bw); aspect-ratio: 720 / 1280; pointer-events: none;
}
.start-scene img { position: absolute; display: block; }
.scene-bg, .scene-layer { inset: 0; width: 100%; height: 100%; }
.scene-sul { left: 67.4%; bottom: 53.9%; width: 25%; height: auto; }
.scene-kkebi { left: 4.5%; bottom: 67.5%; width: 21%; height: auto; }
.scene-egg { left: 21.5%; bottom: 64.2%; width: 11%; height: auto; }
.scene-wisp { left: 9%; bottom: 43%; width: 10%; height: auto; filter: drop-shadow(0 0 8px #6fd3ff); }
.setup-open .start-scene { filter: brightness(.55); }
.start-art { position: relative; flex: 1 0 360px; }
.game-logo {
  display: block; position: absolute; top: 50px; left: 15%; width: 64%; height: auto;
  filter: drop-shadow(0 3px 3px #170e17aa);
}
.start-art .purse, .shop-purse { position: absolute; right: 2px; top: 52px; z-index: 2; }
.start-hero {
  position: absolute; z-index: 1; bottom: 0; left: 47%; translate: -50% 0;
  height: min(266px, max(160px, calc(100% - 128px))); aspect-ratio: 402 / 455;
}
.start-hero .bubble {
  position: absolute; z-index: 1; bottom: calc(94% - 22px); left: 17%; width: max-content; max-width: 124px; min-width: 96px;
  padding: 7px 11px; font-size: 16px; line-height: 1.2; --fit-min: 12; --fit-lines: 3; text-wrap: balance;
}
.start-hero .bubble::after { left: 58%; right: auto; }
.start-hero .bubble:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { left: 6%; max-width: 168px; }
.hero-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; }
.hero-pose { width: 100%; height: 100%; filter: drop-shadow(0 6px 4px #1d0e0ba0); }
/* 시안처럼 발끝이 두루마리 위에 살짝 걸치게 그림만 내린다(누르는 자리는 두루마리와 겹치지 않게) */
.start-hero .hero-pose { translate: 0 22px; pointer-events: none; }
.tonight {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: none; color: var(--ink); text-shadow: none;
  --fit-min: 12; padding: 19px 46px 6px; --fit-lines: 2; --fit-one: 1;
  font: 700 14px/1.14 var(--body);
}
.tonight::before {
  /* 술(두루마리 아래 늘어진 부분)은 버튼 상자 밖으로 그려서 누르는 자리는 종이 띠만 */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/ui-scroll.webp") 24 58 97 62 fill / 15px 37px 0 40px stretch;
}
.tonight::after {
  content: ""; position: absolute; inset: 0 0 -63px; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/ui-scroll.webp") 24 58 97 62 / 15px 37px 63px 40px stretch;
}
/* 시안: 두루마리 바로 아래에 퇴마 시작 현판이 붙고, 두루마리 양 끝 술이 현판 옆으로 늘어진다 */
#view .tonight + .setup-sheet + .start-actions { margin-top: -3px; position: relative; z-index: 2; pointer-events: none; }
#view .tonight + .setup-sheet + .start-actions > * { pointer-events: auto; }
#view .tonight + .setup-sheet + .start-actions::before, #view .tonight + .setup-sheet + .start-actions::after {
  content: ""; position: absolute; z-index: 1; top: -12px; left: 22%; width: 11px; height: 28px; border-radius: 6px; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, #e0503a 0 3.5px, #8d1d16 4.5px, transparent 5px) 0 0 / 9px 10px repeat-y, #b72d22;
  box-shadow: 0 1px 2px #2a0b06aa, inset -2px 0 0 #7d1812;
}
#view .tonight + .setup-sheet + .start-actions::after { left: auto; right: 22%; }
.start-actions { padding-inline: 2%; }
#view .tonight { min-height: 54px; }
.tonight > [data-fit] { min-width: 0; flex: 0 1 auto; }
.tonight > [aria-hidden] { flex: none; }
#view .start-actions .btn.primary { padding-inline: 15%; }
#view .start-actions .btn.primary > [data-fit] { --fit-min: 24; --fit-lines: 2; --fit-one: 1; --fit-one-min: 24; }
#view .start-actions .btn.primary { justify-self: center; width: min(calc(100% - 28px), 356px); min-height: 98px; font-size: 46px; }
.start-menu { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); justify-items: center; }
/* 동그란 메달: 아이콘은 안쪽 나무 원에, 이름은 메달 아래쪽에 걸친 나무 띠 안에 둔다(긴 언어도 두 줄로 들어감) */
.start-menu .medal {
  position: relative; width: min(100%, 98px); height: auto; aspect-ratio: 1; padding: 0; margin-bottom: 14px;
  display: block; font: 16px/1.08 var(--game); --fit-min: 12; --fit-lines: 2; color: var(--gold);
}
.start-menu .ico { position: absolute; left: 19%; top: 11%; width: 62%; height: 58%; filter: drop-shadow(0 2px 2px #2a1206aa); }
.start-menu .medal > [data-fit] {
  position: absolute; left: -15%; right: -15%; bottom: -16%; width: auto; min-height: 31px; padding: 5px 12px 6px;
  display: grid; align-content: center; text-align: center; overflow-wrap: normal; word-break: keep-all; hyphens: manual;
  background: none; isolation: isolate; text-shadow: 0 1px 0 #2e1206, 0 0 3px #2e1206;
}
.start-menu .medal > [data-fit]::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent;
  border-image: var(--chip) 32 72 fill / 10px 22px stretch;
}
.start-menu .medal, .curse-card { overflow-wrap: normal; }
.setup-open :is(.start-art,.start-actions) { display: none; }
.setup-open { padding-top: calc(env(safe-area-inset-top, 0px) + 24px); }
.setup-open .tonight { display: none; }
.setup-head { position: relative; display: flex; padding: 6px 36% 0 3%; z-index: 2; }
.setup-head .plaque { width: 100%; min-height: 60px; padding-inline: 26px 22px; font-size: 28px; --fit-min: 16; }
.setup-dosa { position: absolute; right: 0; bottom: -44px; width: 32%; height: auto; pointer-events: none; filter: drop-shadow(0 4px 3px #1d0e0b90); }
#night-setup { position: relative; }
/* 닫기는 두루마리 아래 말린 종이 위에 얹어 높이를 늘리지 않는다 */
.setup-close { border: 0; background: none; position: absolute; z-index: 2; left: 50%; bottom: 10px; translate: -50% 0; width: min(120px, 36%); font: 15px/1 var(--game); color: var(--cream); }
.setup-scroll { display: grid; gap: 4px; margin: -22px 0 0; padding: 38px 30px 62px; background: none; }
.depth-selector { gap: 2px; }
@media (max-width: 370px) { .setup-scroll { padding-inline: 24px; } }
/* 시안: 위 막대 양끝에 붉은 술, 아래는 말린 종이인 큰 두루마리 한 장 */
.setup-scroll::before {
  inset: 0; height: auto; top: 0; bottom: 0; background: none; border: 1px solid transparent;
  border-image: url("sprites/ui-frame.webp") 260 70 120 70 fill / 141px 38px 65px 38px stretch;
}
.setup-scroll::after { display: none; }
.setup-scroll h3 { position: relative; width: min(130px, 46%); justify-self: center; min-height: 30px; margin-top: 2px; font-size: 18px; }
/* 소제목 양옆 금 구름 장식 */
.setup-scroll h3::after {
  content: ""; position: absolute; inset: 2px -48px; z-index: -2; pointer-events: none;
  background: url("sprites/ui-cloud-l.webp") left center / 44px auto no-repeat, url("sprites/ui-cloud-r.webp") right center / 44px auto no-repeat;
}
.map-selector, .companion-selector, .depth-selector { display: grid; gap: 5px; }
.map-selector { grid-template-columns: repeat(2,minmax(0,1fr)); }
.companion-selector { grid-template-columns: repeat(4,minmax(0,1fr)); }
.depth-selector { grid-template-columns: repeat(6,minmax(0,1fr)); }
.map-selector button, .companion-selector button, .depth-selector button {
  min-width: 0; position: relative; color: var(--ink); text-align: center; padding: 0 3px;
  border: 0; border-radius: 8px; background: transparent; line-height: 1.15;
}
.map-selector button {
  isolation: isolate; padding: 5px; color: var(--cream); text-shadow: 0 1px 2px #2e1308, 0 0 3px #2e1308;
  display: grid; align-content: start;
}
/* 이름(과 잠금 조건)은 그림 아래쪽 어두운 띠 위에 얹는다 */
.map-selector button > :is(b, small) { grid-area: 1 / 1; align-self: end; z-index: 1; }
.map-selector button > img { grid-area: 1 / 1; }
.map-selector button > .map-label {
  grid-area: 1 / 1; align-self: end; z-index: 1; display: grid; gap: 0; padding: 12px 3px 3px;
  border-radius: 0 0 5px 5px; background: linear-gradient(#22100800, #221008d8 40%);
}
.map-selector button::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: var(--slot) 34 fill / 8px stretch;
}
.map-selector img { width: 100%; height: clamp(62px,9.8cqh,100px); object-fit: cover; border-radius: 5px; }
.map-selector [aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -5px; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/k-glow.webp") 70 fill / 16px stretch; mix-blend-mode: screen;
}
.map-selector b { padding: 0 2px; font: 15px/1.12 var(--game); --fit-min: 12; --fit-lines: 2; text-wrap: balance; overflow-wrap: normal; hyphens: manual; }
.map-selector small { padding: 0 2px; font-size: 12px; line-height: 1.1; --fit-min: 10; --fit-lines: 2; color: #ffe7b3; }
.selection {
  position: absolute; right: 5px; top: 5px; display: none; place-items: center;
  width: 23px; height: 23px; border-radius: 50%; border: 1px solid #dfab53;
  background: #56301c; color: var(--gold); font-size: 15px; font-weight: 700;
}
[aria-pressed="true"] > .selection, :not(.depth-selector) > :disabled > .selection { display: grid; }
/* 시안: 잠긴 지도·동료는 어둡게 하지 않고 자물쇠만. 잠긴 깊이만 살짝 흐리게 */
.depth-selector button:disabled .phase { filter: saturate(.5) brightness(.6); }
[aria-checked="true"] > .selection { display: grid; }
.depth-selector .selection { right: -3px; top: -6px; width: 20px; height: 20px; font-size: 13px; }
.companion-selector img {
  display: block; width: min(100%,72px); aspect-ratio: 1; margin: 0 auto 1px; object-fit: cover;
  border: 2px solid #9e5c24; border-radius: 50%; background: #663517;
}
.companion-selector [aria-pressed="true"] img { border-color: #ffd659; box-shadow: 0 0 0 2px #ffe189, 0 0 12px 4px #ffc94acc; }
.companion-selector b {
  display: block; margin-inline: 1px; padding: 4px 10px 5px; text-align: center;
  background: url("sprites/k-lv.webp") center / 100% 100% no-repeat; color: var(--cream); text-shadow: 0 1px 1px #2e1308;
  font: 14px/1.1 var(--game); --fit-min: 12; white-space: nowrap; hyphens: none;
}
.companion-selector b:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { font: 700 13px/1.17 var(--body); letter-spacing: -.3px; padding-inline: 4px; }
.companion-selector { gap: 3px; }
.companion-selector button { padding-inline: 0; }
.companion-desc {
  /* 시안: 금빛 끝을 단 종이 띠 위에 별 그림 + 효과 한 줄 */
  position: relative; isolation: isolate; justify-self: center; display: flex; align-items: center; justify-content: center; gap: 4px;
  max-width: 100%; margin: 1px 0 0; padding: 4px 16px 5px; font: 700 14px/1.2 var(--body); color: var(--ink);
}
.companion-desc::before {
  content: ""; position: absolute; inset: -2px -6px; z-index: -1; border: 1px solid transparent;
  border-image: url("sprites/ui-band-cream.webp") 40 70 fill / 13px 24px stretch;
}
.companion-desc { padding-inline: 26px; }
.companion-desc .ico { flex: none; width: 20px; height: 20px; object-fit: contain; }
.companion-desc > span { min-width: 0; --fit-min: 12; --fit-lines: 2; text-align: center; }
.map-hint { display: flex; justify-content: center; align-items: baseline; gap: 3px; margin: -1px 0 0; font: 700 12px/1.2 var(--body); color: #6a3416; text-align: center; }
.map-hint > [data-fit] { min-width: 0; --fit-min: 12; --fit-lines: 2; }
.curse-name { font-style: normal; color: #b8231a; }
.depth-selector button { isolation: isolate; display: grid; place-items: center; background: none; padding-block: 5px 4px; color: var(--cream); text-shadow: 0 1px 2px #2e1308; }
.depth-selector button::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent; pointer-events: none;
  border-image: url("sprites/k-stat.webp") 52 fill / 9px stretch;
}
.depth-selector [aria-checked="true"]::after {
  content: ""; position: absolute; inset: -5px; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/k-glow.webp") 70 fill / 14px stretch; mix-blend-mode: screen;
}
.phase { display: block; width: 36px; height: 36px; object-fit: contain; }
.curse-card {
  --fit-min: 14; position: relative; isolation: isolate; display: flex; align-items: center; gap: 4px; text-align: left; width: 100%;
  color: #fff3dc; text-shadow: 0 1px 2px #2a0e3a; padding: 6px 30px; border: 0; background: none;
}
/* 시안: 보라 구름 띠 */
.curse-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/ui-band-purple.webp") 44 76 fill / 15px 26px stretch;
}
.curse-card .curse-name { color: #ff9c86; }
.curse-card[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -5px; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/k-glow.webp") 70 fill / 14px stretch; mix-blend-mode: screen;
}
.curse-card > span { flex: 1; min-width: 0; }
.curse-card small { font-size: 13px; }
.curse-card:not([aria-pressed="true"]) small { display: none; }
.curse-card { justify-content: center; }
.curse-card > span { flex: 0 1 auto; }
.curse-card .ico { width: 30px; height: 34px; object-fit: contain; }
#view button { min-height: 44px; }
.setup-scroll .btn.primary { min-height: 70px; }
@media (max-height: 680px) {
  .start-art { flex-basis: 300px; }
  .start-menu .medal { width: min(100%, 76px); font-size: 13px; margin-bottom: 12px; }
  .start-menu .medal > [data-fit] { left: -24%; right: -24%; padding-inline: 10px; }
  .game-logo { top: 40px; left: 19%; width: 56%; }
  #view .start-actions .btn.primary { min-height: 76px; font-size: 38px; }
  .setup-head { padding-top: 4px; }
  .setup-dosa { height: 84px; }
  .map-selector img { height: 62px; }
  .start-hero { height: min(184px, max(150px, calc(100% - 150px))); left: 50%; }
  .start-hero .bubble { font-size: 14px; padding: 5px 9px; }
  .map-selector b { padding-block: 2px; }
  .companion-selector img { width: 46px; }
  .setup-scroll { gap: 3px; }
  .setup-scroll h3 { min-height: 23px; padding-block: 3px; }
  .setup-scroll .btn.primary { min-height: 66px; }
}

/* 전투 화면 */
.play { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #221c40; touch-action: none; }
#cv { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.hud {
  position: absolute; inset: 0 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 5px) 7px 0;
  pointer-events: none; display: grid; gap: 2px;
}
.hud-row { display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 4px; align-items: center; }
.hud .pause { pointer-events: auto; width: 44px; height: 44px; }
/* 시안: Lv 금테 패와 긴 경험치 줄, 그 아래 가운데 달 시계와 오른쪽 한 줄 퇴치·엽전 */
.experience { display: flex; align-items: center; min-width: 0; }
.lv-badge {
  position: relative; z-index: 1; flex: none; display: grid; place-items: center; min-width: 62px; height: 34px; padding: 0 12px 1px;
  background: url("sprites/k-lv.webp") center / 100% 100% no-repeat; color: #ffd043; white-space: nowrap;
  font: 17px/1 var(--game); text-shadow: 0 1px 0 #2a0f05, 0 0 3px #2a0f05;
}
.xpbar {
  position: relative; flex: 1; height: 20px; margin-left: -8px; padding: 5px 9px 5px 14px;
  background: url("sprites/k-xp.webp") center / 100% 100% no-repeat;
}
.xpbar i, .bossbar i {
  display: block; width: 0; height: 100%; border-radius: 5px;
  background: linear-gradient(90deg, #59b5f1, #b7f3ff); transition: width .15s;
}
.hud-row2 { display: grid; grid-template-columns: minmax(0, .95fr) auto minmax(0, 1.05fr); align-items: center; gap: 4px; margin-top: -9px; }
.clock {
  grid-column: 2; display: grid; place-items: center; width: 108px; height: 44px; padding: 5px 10px 8px 34px;
  background: url("sprites/k-clock.webp") center / 100% 100% no-repeat; color: var(--cream); font: 21px/1 var(--game);
  --fit-min: 12; text-align: center; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 #2a0f05;
}
.clock .late, .clock.late { color: #ffe291; }
.tally {
  grid-column: 3; justify-self: end; display: grid; place-items: center; width: 100%; max-width: 150px; min-width: 0; min-height: 34px; padding: 4px 13px 5px;
  background: url("sprites/k-tally.webp") center / 100% 100% no-repeat; color: var(--cream);
  font: 14px/1.1 var(--game); --fit-min: 12; --fit-lines: 2; --fit-one: 1; text-shadow: 0 1px 0 #2a0f05;
}
.tally > [data-fit] { display: block; width: 100%; text-align: center; text-wrap: balance; }
.tally:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { max-width: none; }
.owned { display: flex; flex-wrap: wrap; gap: 4px; padding-left: 50px; margin-top: -3px; }
.own {
  position: relative; display: grid; place-items: center; width: min(48px, 12.5vw); aspect-ratio: 1;
  margin-bottom: 10px; background: var(--slot) center / 100% 100% no-repeat;
}
.own .ico { width: 37px; height: 37px; }
.own b {
  position: absolute; top: 83%; min-width: 29px; padding: 2px 3px; border-radius: 7px;
  background: #4f2114; border: 1px solid #daa24d; color: var(--cream);
  text-align: center; white-space: nowrap; font: 12px/1 var(--game);
}
.own.pas .ico { filter: drop-shadow(0 0 3px #b0e7ff); }
.own.evo .ico { filter: drop-shadow(0 0 4px #ffd166); }
.bossbar {
  position: relative; display: grid; align-items: center; height: 25px;
  margin: 0 16px; padding: 4px 20px 6px;
  background: var(--bar) center / 100% 100% no-repeat, radial-gradient(ellipse 45% 40% at center, #4c2117 98%, transparent);
}
.bossbar span {
  position: absolute; z-index: 1; justify-self: center; width: auto; max-width: 83%; padding: 2px 8px;
  border-radius: 7px; background: #4c2117; text-align: center; font: 14px/1 var(--game);
}
.bossbar i { background: linear-gradient(90deg,#bd211c,#f98442); }
.banner {
  position: absolute; z-index: 3; inset: 21% 7% auto; font: 22px/1.17 var(--game);
  pointer-events: none; opacity: 0; visibility: hidden;
}
.banner.on { opacity: 1; visibility: visible; animation: pop .3s ease-out; }
.cutin {
  position: absolute; top: 25%; left: 8px; right: 8px; z-index: 4; min-height: 102px;
  display: grid; grid-template-columns: 76px minmax(0,1fr) 76px; gap: 3px; align-items: center;
  padding: 8px; border: 3px double #f1b751; border-radius: 16px;
  background: #542311 var(--plaque) center / 100% 100% no-repeat;
  box-shadow: var(--shadow); color: var(--cream); pointer-events: none;
}
.cutin strong { font: 22px/1.17 var(--game); text-align: center; text-shadow: 0 2px 2px #371507; --fit-min: 14; }
.cutin img { width: 100%; height: 76px; object-fit: contain; }
.cutin[data-kind="boss"] { grid-template-columns: minmax(64px,.62fr) minmax(108px,1fr) 122px; }
.cutin[data-kind="boss"] img { height: 122px; }
.cutin[data-kind="boss"] .cutin-subject { border: 2px solid #de9b3d; border-radius: 7px; background: #512617; }
.cutin .cutin-hero { filter: drop-shadow(0 0 7px #ffca6b); }
.orb-guide {
  position: absolute; bottom: calc(176px + env(safe-area-inset-bottom)); left: 50%; translate: -50%; z-index: 2;
  width: max-content; max-width: 72%; pointer-events: none;
}
.speech {
  position: absolute; z-index: 4; width: min(205px, calc(100% - 16px)); padding: 5px 8px;
  transform: translate(-50%, -100%); pointer-events: none; --fit-min: 14;
}

/* 판 위 두루마리와 레벨업 부적 */
.overlay {
  position: absolute; inset: 0; display: grid; place-items: safe center; z-index: 5;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 9px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: #130d19ac; overflow: auto; scrollbar-width: none;
}
.stage.is-locked:has(.overlay:not([hidden])), .play:has(.overlay:not([hidden])) { touch-action: pan-y; }
.play:has(.overlay:not([hidden])) .speech { visibility: hidden; }
.panel {
  width: 100%; max-width: 410px; display: grid; gap: 8px;
  text-align: center; color: var(--ink);
}
.panel:not(.lvup) {
  background: url("sprites/ui-scroll-panel.webp") center / 100% 100% no-repeat;
  padding: 48px 26px 42px;
}
.panel .btn.primary { min-height: 62px; }
.panel .desc { font-size: 15px; }
.panel > .ico { width: 90px; height: 90px; margin-inline: auto; }
.panel .orak-home-button { width: 100%; min-height: 44px; display: flex; justify-content: center; padding: 6px 26px; }
.panel .orak-home-button span { width: auto; }
.pausep .row2 .btn { padding-inline: 9px; }
/* 3.0: 준비 화면과 같은 큰 두루마리(위 막대와 붉은 술, 아래 말린 종이) */
.panel.pausep { position: relative; isolation: isolate; background: none; padding: 34px 36px 70px; gap: 6px; }
.panel.pausep::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/ui-frame.webp") 260 70 120 70 fill / 141px 38px 65px 38px stretch;
}
.pausep > .plaque { width: 78%; justify-self: center; margin-top: -10px; }
.pausep > p { text-align: center; }
.pause-dosa { width: 98px; height: 104px; margin-inline: auto; }
.lvup { gap: 4px; }
.lvup > .plaque { justify-self: center; width: 88%; font-size: 31px; --plate: url("sprites/k-chip.webp"); --board-slice: 30 74; --board-edges: 16px 40px; padding-inline: 44px; }
.lvup > .chip { justify-self: center; width: auto; min-width: 60%; max-width: 86%; --plate: url("sprites/k-lv.webp"); --board-slice: 40 52; --board-edges: 13px 18px; padding: 6px 24px 7px; color: var(--cream); }
.level-hero { position: relative; height: 200px; }
.level-hero canvas { display: block; width: auto; height: 100%; margin-inline: auto; }
.level-hero .bubble { position: absolute; z-index: 1; right: 3%; top: 12px; max-width: 44%; }
.level-hero .friend-line { right: auto; left: 0; }
.cards { display: grid; width: 98%; justify-self: center; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.cards-four { width: min(100%, 241px); grid-template-columns: repeat(2,minmax(0,1fr)); }
#view .pick {
  --talisman-bottom: 12px;
  --card-min-height: 204px;
  position: relative; isolation: isolate; min-width: 0; min-height: var(--card-min-height); overflow: visible;
  padding: 10px 0 calc(var(--talisman-bottom) + 6px); margin-bottom: 40px;
  display: grid; grid-template-rows: minmax(32px, auto) minmax(min-content,1fr);
  background: none; border: 0; border-radius: 8px;
  color: #301608; text-align: center; font: 19px/1.13 var(--game);
  filter: drop-shadow(0 3px 4px #241009bb);
}
/* 시안처럼 곧은 부적 종이 카드에, 아래로 붉은 매듭 술을 단다 */
.pick::before {
  content: ""; position: absolute; z-index: -1; inset: 0; border: solid transparent; pointer-events: none;
  border-image: url("sprites/k-card.webp") 52 fill / 15px stretch;
}
.pick:active::before { border-image-source: url("sprites/k-card-on.webp"); border-image-slice: 74; border-image-width: 21px; border-image-outset: 6px; }
.pick::after {
  content: ""; position: absolute; z-index: -2; left: 50%; top: calc(100% - 26px); width: 22px; height: 66px; translate: -50% 0;
  background: url("sprites/k-tassel.webp") center top / contain no-repeat; pointer-events: none;
}
.pick-badges {
  display: grid; grid-template-columns: minmax(0,1fr) 42px; align-items: start; gap: 2px;
  margin-inline: 4px;
}
/* 레벨이 오를 때: [빛바랜 지금 도장] → [붉은 오를 도장] */
.pick-badges:has(.tag-old) { grid-template-columns: 40px minmax(12px,1fr) 42px; }
.pick .lv-arrow { align-self: center; justify-self: center; width: 100%; max-width: 20px; aspect-ratio: 128/108; margin-top: 6px;
  background: url("sprites/k-arrow.webp") center / contain no-repeat; filter: drop-shadow(0 1px 1px #5a2a0a88); }
.pick-safe {
  /* Bounds follow the red vertical strokes and stop above the lower red frame. */
  display: grid; grid-template-rows: minmax(20px,1fr) auto auto; gap: 5px; justify-items: center;
  margin-inline: 9px 10px; padding: 8px 8px 10px;
}
.pick .ico { width: min(88px, 100%); height: 100%; min-height: 64px; max-height: 88px; align-self: center; contain: size; filter: drop-shadow(0 2px 2px #87511777); }
.pick-safe > b { --fit-min: 12; --fit-one: 1; --fit-one-min: 15; font-weight: 700; line-height: 1.23; }
.pick .desc { font: 700 14px/1.22 var(--body); --fit-min: 12; }
/* 이름과 효과 사이 금빛 장식선: 위쪽 여백에 그림으로 깐다(글자 맞춤이 여백은 줄 높이로 세지 않는다) */
.pick .desc { padding-top: 12px; background: url("sprites/k-divider.webp") center top / min(86px, 92%) 9px no-repeat; }
.pick-safe > b, .pick .desc {
  --fit-lines: 2; text-wrap: balance; hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; word-break: keep-all;
  text-shadow: 0 1px #ffdf89, 0 -1px #ffdf89, 1px 0 #ffdf89, -1px 0 #ffdf89;
}
.pick .tag {
  /* 시안의 끈 달린 붉은 밀랍 도장: 글자는 아래 둥근 몸통 안에만 둔다 */
  grid-column: -2; display: grid; align-content: center; height: 55px; margin-top: -10px; margin-bottom: 2px;
  background: url("sprites/k-lvseal.webp") center top / 100% 100% no-repeat; padding: 20px 4px 4px; color: #fff3ce;
  font: 14px/1 var(--game); --fit-min: 12; --fit-lines: 2; text-shadow: 0 1px 0 #5a0d08;
}
.pick .fresh {
  justify-self: start; align-self: center; max-width: 100%; padding: 2px 3px;
  border: 1px solid #c57937; border-radius: 3px 7px 7px 3px; background: #ffdf81;
  font: 700 12px/1.06 var(--body); color: #761a0e; --fit-lines: 3; hyphens: manual; overflow-wrap: normal;
}
.pick-badges [data-fit] { line-height: inherit; }
.pick-safe > b:lang(th), .pick .desc:lang(th) { line-height: 1.38; }
.pick .tag-level { --fit-lines: 1; padding-inline: 1px; white-space: nowrap; }
.pick .tag-old { grid-column: 1; height: 52px; margin-top: -10px; background-image: url("sprites/k-lvseal-old.webp"); color: #fff0d8; text-shadow: 0 1px 0 #3c2414; font-size: 13px; }
#view .cards-four .pick { --card-min-height: 196px; margin-bottom: 18px; }
.cards-four .pick::after { height: 36px; width: 14px; top: calc(100% - 16px); }
.cards-four .pick .tag { height: 48px; margin-top: -8px; padding-top: 17px; font-size: 13px; }
.cards-four .pick .tag-old { height: 46px; }
.lvup:has(.cards-four) .level-hero { height: 184px; }
.cards-four .pick .desc { padding-top: 10px; background-size: min(76px, 88%) 8px; }
.lvup > [data-reroll] { width: min(85%,240px); justify-self: center; }
/* 3.0 시안 맞춤: 카드를 크게, 이름·그림 크게, 도장 하나, 추천 카드 금빛 테두리 */
.lvup > .plaque { position: relative; width: 74%; }
.pick .tag { height: 60px; margin-top: -12px; padding-top: 22px; }
.lvup > .plaque::after {
  content: ""; position: absolute; inset: 6px -34px; z-index: -2; pointer-events: none;
  background: url("sprites/ui-cloud-l.webp") left center / 52px auto no-repeat, url("sprites/ui-cloud-r.webp") right center / 52px auto no-repeat;
}
.cards { width: 100%; gap: 5px; }
#view .cards:not(.cards-four) .pick { --card-min-height: 236px; }
.cards:not(.cards-four) .pick-safe > b { font-size: 23px; --fit-one-min: 16; }
.cards:not(.cards-four) .pick .ico { max-height: 100px; min-height: 72px; }
.cards:not(.cards-four) .pick .desc { font-size: 15px; }
.pick .tag { font-size: 15px; }
.pick .tag-new { font-size: 12px; line-height: 1.02; padding-top: 18px; --fit-lines: 2; }
.pick-best { z-index: 1; }
.pick-best .card-glow {
  position: absolute; inset: -10.1% -14.9%; z-index: 1; pointer-events: none; mix-blend-mode: screen;
  background: url("sprites/card-glow.webp") center / 100% 100% no-repeat;
  animation: card-glow 1.6s ease-in-out infinite alternate;
}
@keyframes card-glow { from { opacity: .75; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .pick-best .card-glow { animation: none; } }
@media (max-height: 760px) {
  .lvup:has(.cards-four) .level-hero { height: 110px; }
  #view .cards-four .pick { --card-min-height: 180px; margin-bottom: 14px; }
  .cards-four .pick::after { height: 28px; width: 11px; top: calc(100% - 13px); }
}
@media (max-height: 690px) {
  .lvup > .plaque { min-height: 48px; }
  .lvup:has(.cards-four) .level-hero { height: 92px; }
  .cards-four { gap: 3px 7px; }
}

/* 정산: 위는 화면 너비를 다 쓰는 골목 장면, 가운데 칭호 현판, 아래는 양피지 한 장 */
.result-screen { padding-top: 0; }
.result-art {
  isolation: isolate; position: relative; flex: none; margin: 0 -10px;
  height: clamp(176px, 29cqh, 290px); overflow: hidden;
}
/* 새로 열린 것이 없는 판은 시안처럼 장면을 더 크게 */
.result-screen:not(:has(.unlocks)) .result-art { height: clamp(200px, 33cqh, 320px); }
.result-art { -webkit-mask: linear-gradient(#000 82%, transparent); mask: linear-gradient(#000 82%, transparent); }
/* 3.0 시안: 냥도사가 앞에 크게 서고 뒤에 어지러운 도깨비·달걀귀신이 있는 장면 한 장 */
.result-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 38% 62%; }
.result-art .actor { position: absolute; filter: drop-shadow(0 5px 3px #261509a6); }
.result-dosa { left: 25%; bottom: 23%; width: 42%; height: 69%; object-fit: contain; object-position: bottom; }
.result-friend { left: 0%; bottom: 23%; width: 28%; height: 40%; object-fit: contain; object-position: bottom; }
.result-enemy { right: 1%; bottom: 22%; width: 24%; height: 33%; object-fit: contain; object-position: bottom; }
.result-fallen { right: 18%; bottom: 20%; width: 26%; height: 27%; object-fit: contain; object-position: bottom; }
[data-scene="lose"] .result-enemy { right: 1%; bottom: 23%; width: 26%; height: 36%; }
[data-scene="lose"] .result-fallen { right: 27%; bottom: 23%; width: 16%; height: 22%; }
.result-art .bubble {
  position: absolute; z-index: 3; left: 17%; right: 17%; top: calc(env(safe-area-inset-top, 0px) + 7px);
  display: grid; place-items: center; min-height: 40px; padding: 5px 10px; font-size: 15px; --fit-min: 12;
}
.result-art .bubble span { --fit-lines: 2; }
.result-art .bubble { min-height: 36px; }
.result-art .friend-line { left: 17%; right: 17%; top: calc(env(safe-area-inset-top, 0px) + 7px); bottom: auto; }
.result-art .friend-line::after { left: 12%; }
.stamp {
  position: absolute; z-index: 1; top: calc(env(safe-area-inset-top, 0px) + 40px); right: 3%;
  display: grid; place-items: center; width: clamp(98px, 26cqw, 108px); aspect-ratio: 1; padding: 6px;
  /* 시안의 붉은 인주 도장(그림): 흰 종이에 번진 붉은 테두리, 글자도 인주색 */
  padding: 14px; color: #c8141b; background: url("sprites/k-stamp.webp") center / 100% 100% no-repeat;
  filter: drop-shadow(0 2px 3px #3a120a55);
  font: clamp(26px, 8cqw, 32px)/1.02 var(--game); text-align: center; word-break: keep-all;
  rotate: -9deg; animation: stamp .48s ease-out .25s both; --fit-min: 12;
}
.stamp span { --fit-lines: 2; display: block; width: 100%; padding: 2px; white-space: normal; overflow-wrap: break-word; hyphens: manual; }
@keyframes stamp { from { opacity: 0; scale: 2; } 70% { scale: .92; } }
.res-title { position: relative; z-index: 1; display: grid; justify-items: center; margin-top: -46px; }
.res-title .res-kicker {
  min-width: 46%; max-width: 76%; min-height: 32px; margin-bottom: -9px; padding: 4px 24px 6px;
  font-size: 17px; color: var(--cream); --fit-min: 13;
}
.res-title h2 {
  /* 시안처럼 양쪽 붉은 족자 막대에 술이 달린 금테 현판 */
  width: 100%; min-height: 64px; padding: 8px 58px 21px; font-size: 31px; --fit-min: 20;
  --plate: url("sprites/k-title.webp"); --board-slice: 40 125 75 125; --board-edges: 14px 48px 27px;
}
.result-sheet { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; margin: -14px 6px 0; padding: 22px 36px 50px; background: none; }
/* 칭호 현판 아래로 이어지는 종이(막대·술은 현판 쪽에), 아래는 말린 종이 */
.result-sheet::before {
  top: 0; bottom: 0; left: 0; right: 0; height: auto; background: none; border: 1px solid transparent;
  border-image: url("sprites/ui-paper.webp") 40 70 120 70 fill / 22px 38px 65px 38px stretch;
}
.result-sheet::after { display: none; }
.stats { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1.1fr); gap: 4px; }
.stat {
  position: relative; isolation: isolate; min-width: 0; display: grid;
  grid-template: "i v" auto "l l" auto / 23px minmax(0, 1fr); align-items: center; column-gap: 2px;
  min-height: 46px; padding: 4px 6px 5px; color: var(--cream); text-shadow: 0 1px 2px #2e1308;
}
.stat::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent;
  border-image: url("sprites/k-stat.webp") 52 fill / 12px stretch;
}
.stat .ico { grid-area: i; width: 23px; height: 26px; object-fit: contain; filter: drop-shadow(0 1px 1px #2e1308); }
.stat b { grid-area: v; justify-self: center; font: 400 18px/1.05 var(--game); color: var(--gold); --fit-min: 12; white-space: nowrap; }
.stat > span { grid-area: l; font: 12px/1.1 var(--body); --fit-min: 12; --fit-lines: 2; opacity: .95; text-align: center; overflow-wrap: normal; hyphens: manual; }
.result-sheet .osc-breakdown { position: relative; border: 0; padding: 0 5px; border-radius: 0; background: transparent; }
.result-sheet .osc-row { gap: 4px; padding: 0 4px; color: var(--ink); }
.result-sheet .osc-row .ico { flex: none; width: 27px; height: 25px; object-fit: contain; }
.result-sheet .osc-row .osc-label { width: auto; flex: 0 1 auto; font: 17px/1.18 var(--game); }
.result-sheet .osc-row::after { content: ""; flex: 1 0 8px; border-bottom: 1px dotted #8d633a; order: 2; }
.result-sheet .osc-value { order: 3; font: 18px/1.18 var(--game); }
.stat.solo { grid-template: "i" 20px "v" auto / minmax(0, 1fr); justify-items: center; row-gap: 1px; padding-inline: 6px; }
.stat.solo .ico { width: 30px; height: 20px; }
.result-sheet .osc-total {
  position: relative; display: flex; flex-flow: row wrap; gap: 2px 10px; justify-content: center; align-items: baseline; margin-top: 8px;
  padding: 1px 40px; border-radius: 0;
  background: url("sprites/ui-cloud-l.webp") 2px center / 38px auto no-repeat, url("sprites/ui-cloud-r.webp") calc(100% - 2px) center / 38px auto no-repeat,
    linear-gradient(90deg, #f3c34a00, #f6cf5c 14% 86%, #f3c34a00), linear-gradient(#fff3b0, #e5a52a);
  background-blend-mode: normal, normal, multiply; box-shadow: 0 -1px 0 #c98a2a80, 0 1px 0 #c98a2a80;
}
.result-sheet .osc-total .osc-label { width: auto; font: 22px/1.1 var(--game); }
.result-sheet .osc-number { color: #941e17; font: clamp(28px,8.4vw,34px)/1.02 var(--game); }
.result-sheet .osc-unit { margin-left: -9px; color: #941e17; font: 20px/1.1 var(--game); }
.result-sheet .osc-seal {
  position: absolute; right: -4px; top: 0; rotate: 6deg; transform: none; padding: 1px 6px; font-size: 12px; border-color: #a22d22;
  background: #fff0c9; color: #851d16; white-space: nowrap; text-align: center;
}
.result-sheet .osc-finished .osc-seal { transform: none; }
.result-sheet .osc-delta { display: none; }
.rank-line, .balance { font-size: 14px; text-align: center; }
.rank-line:empty, .result-screen [data-ad-slot]:not(:has(> :not([hidden]))) { display: none; }
.earn { position: relative; display: flex; justify-content: center; align-items: center; gap: 6px; font: 19px/1.2 var(--game); }
.earn .ico { width: 50px; height: 40px; object-fit: contain; }
/* 반짝이: 엽전 더미 위로 */
.earn::before { content: ""; position: absolute; left: calc(50% - 116px); top: -10px; width: 26px; height: 26px; background: url("sprites/fx-sparkles.webp") center / contain no-repeat; pointer-events: none; }
/* 시안: 받은 엽전 줄 양옆에 엽전 더미 */
.earn::after { content: ""; order: 9; width: 50px; height: 40px; background: url("sprites/item-coins3.webp") center / contain no-repeat; transform: scaleX(-1); }
.earn > span { width: auto; font: 19px/1.2 var(--game); --fit-min: 12; }
.earn b { font: 27px/1 var(--game); color: #8f2018; }
.balance { margin-top: 0; }
/* 새로 열린 것: 한 줄 금빛 칩(그림 + 짧은 이름). 긴 문장은 title/aria-label로 */
.unlocks { display: flex; flex-wrap: nowrap; justify-content: center; gap: 6px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.unlocks li {
  display: flex; align-items: center; gap: 3px; flex: 0 1 auto; min-width: 0; padding: 1px 8px 1px 3px;
  border: 1.5px solid #c58a2c; border-radius: 99px; background: linear-gradient(#fff4c4, #f3cf6e);
  color: #7a1c12; font: 700 13px/1.15 var(--body); --fit-min: 12; box-shadow: 0 1px 0 #8c5a2266;
}
.unlocks .ico { flex: none; width: 20px; height: 20px; object-fit: contain; }
.unlocks li[hidden] { display: none; }
.unlocks .more { flex: none; padding-right: 9px; }
.unlocks li > span { min-width: 0; --fit-lines: 2; --fit-one: 1; overflow-wrap: normal; hyphens: manual; text-align: center; }
.recommendation {
  display: grid; grid-template-columns: 40px minmax(0,1fr) minmax(96px,37%); align-items: center; gap: 5px;
  padding: 2px 5px 2px 6px; background: #f6dca4; border: 1.5px solid #aa7135; border-radius: 12px;
}
.recommendation[hidden] { display: none; }
.recommendation .ico { width: 40px; height: 40px; object-fit: contain; }
.recommendation > span { font: 17px/1.2 var(--game); --fit-min: 12; }
#view .recommendation .btn { min-height: 36px; padding-inline: 9px; font-size: 17px; white-space: nowrap; }
.recommendation .btn > [data-fit] { --fit-min: 12; }
.result-actions { gap: 4px; margin-top: -26px; position: relative; z-index: 2; }
#view .result-actions .primary { justify-self: center; width: min(100%, 350px); min-height: 70px; font-size: 34px; }
.result-sheet .balance { display: none; }
body:has(.result-screen) .osc-toast.folded { display: none; }
.result-actions .row2 .btn { min-height: 46px; padding-inline: 10px; }
.result-actions .ibtn { display: flex; align-items: center; justify-content: center; gap: 3px; }
.result-actions .ibtn > span { width: auto; flex: 0 1 auto; }
.result-actions .ibtn .ico { flex: none; width: 34px; height: 30px; object-fit: contain; filter: drop-shadow(0 1px 1px #2e1308); }
.result-actions .ibtn > span { min-width: 0; }
.result-back { justify-self: center; width: min(100%, 160px); padding-inline: 12px; }
.cardimg { display: block; width: min(100%,400px); margin: 45px auto 0; border-radius: 14px; user-select: auto; -webkit-touch-callout: default; }
.fine { margin-inline: 6px; text-align: center; }
/* 3.0: 카드 아래 안내 글은 배경 위 맨 글자가 아니라 종이 띠 위에 */
.cardimg + .fine { position: relative; isolation: isolate; justify-self: center; align-self: center; width: fit-content; max-width: 94%; margin-top: 6px; padding: 6px 26px; color: var(--ink); font: 700 14px/1.25 var(--body); }
.cardimg + .fine::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent; border-image: url("sprites/ui-band-cream.webp") 40 70 fill / 13px 24px stretch; }
.cardimg { margin-top: 30px; }

/* 상점: 위는 가게 그림(카운터 뒤 냥술사), 아래는 진열장 틀 안의 칸들 */
[data-scene="dex"] .screen > .plaque {
  align-self: center; width: min(72%, 285px); padding-inline: 22px; font-size: 28px;
}
.stage[data-scene="shop"] { background: #2b150c; }
.shop-head {
  position: relative; margin: calc(-12px - env(safe-area-inset-top, 0px)) -10px 0;
  /* 배경 그림 위쪽 선반을 조금 잘라 올려, 시안처럼 진열장 네 줄과 시작 버튼까지 한 화면에 들어오게 한다 */
  --lift: calc(min(100cqw, 480px) * .02);
  height: calc(min(100cqw, 480px) * .52);
  background: url("sprites/bg-shop.webp") center calc(-1 * var(--lift)) / 100% auto no-repeat;
}
.shop-head > .plaque {
  position: absolute; z-index: 2; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; translate: -50% 0;
  width: min(58%, 250px); min-height: 56px; font-size: 28px; padding-inline: 30px;
}
.shop-head .shop-purse { position: absolute; z-index: 2; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 60px); }
.shop-sul { position: absolute; left: 15%; bottom: calc(min(100cqw, 480px) * .02); width: 38%; height: auto; }
.shop-counter { position: absolute; left: 0; top: calc(-1 * var(--lift)); width: 100%; height: auto; pointer-events: none; }
.shop-head .bubble {
  position: absolute; z-index: 1; left: 52%; top: 52%; width: max-content; max-width: 46%; min-width: 112px;
  padding: 8px 11px; font-size: 16px; line-height: 1.2; --fit-min: 12; --fit-lines: 2; text-wrap: balance;
}
.shop-head .bubble::after { left: -6px; top: 42%; rotate: 135deg; }
.shop-list, .dex-grid, .sk-list, .map-records { margin: 0; padding: 0; list-style: none; }
.shop-list {
  position: relative; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0;
  margin: -14px -4px 0; padding: 11px 16px 13px; border: 1px solid transparent;
  border-image: url("sprites/ui-cabinet.webp") 34 30 40 fill / 16px 14px 18px stretch;
}
.shop-row { border-bottom: 8px solid #6d3b1c; box-shadow: 0 2px 0 #2b1209; padding: 3px 3px 1px; }
.shop-row:nth-child(odd) { border-right: 6px solid #6d3b1c; }
#view .shop-item {
  position: relative; display: grid; grid-template-columns: 38% minmax(0,1fr); align-items: center; gap: 2px;
  width: 100%; height: 100%; min-height: 80px; padding: 2px 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink);
}
.shop-item > .ico { width: 128%; max-width: none; margin-left: -24%; height: auto; max-height: 100px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 3px 2px #120602cc); }
/* 글자가 긴 언어는 이름표를 넓히고 그림 칸을 조금 줄인다(그림은 여전히 칸보다 크게) */
#view .shop-item:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { grid-template-columns: 31% minmax(0,1fr); }
.shop-item:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) > .ico { width: 140%; margin-left: -32%; }
.shop-item.suggested::after {
  content: ""; position: absolute; inset: -6px -5px -4px; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/k-glow.webp") 70 fill / 20px stretch; mix-blend-mode: screen;
}
.shop-item[data-purchase="bought"] { box-shadow: 0 0 0 2px #f9e480, 0 0 12px #ffd76a; }
.shop-item[data-purchase="poor"] { box-shadow: 0 0 0 2px #d0452c; }
/* 종이 이름표(ui-label) 안쪽에만 이름·효과·점·가격을 둔다 */
.shop-txt {
  position: relative; isolation: isolate; display: grid; justify-items: center; gap: 2px; min-width: 0;
  padding: 7px 8px 5px;
}
.shop-txt::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent;
  border-image: url("sprites/ui-label.webp") 22 22 22 22 fill / 9px stretch;
}
.shop-txt b { justify-self: stretch; min-width: 0; padding-inline: 3px; font: 16px/1.15 var(--game); --fit-min: 12; --fit-lines: 2; --fit-one: 1; --fit-one-min: 12; letter-spacing: -.2px; text-align: center; }
.shop-txt .effect { justify-self: stretch; min-width: 0; padding-inline: 0; font: 700 12px/1.15 var(--body); --fit-min: 12; --fit-lines: 2; --fit-one: 1; text-wrap: balance; text-align: center; }
.pips { display: flex; gap: 3px; margin-block: -1px; }
.pips i { border-radius: 50%; border: 1px solid #86552a; width: 8px; height: 8px; background: #f4dfb0; }
.pips i.on { background: #e6a91d; border-color: #94600f; }
.shop-txt .price {
  position: relative; isolation: isolate; display: flex; align-items: center; gap: 4px; width: 100%; max-width: 92px;
  min-height: 25px; padding: 2px 12px 3px 4px; color: var(--cream); font: 16px/1 var(--game); --fit-min: 12;
}
.shop-txt .price::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent;
  border-image: url("sprites/ui-price2.webp") 0 60 0 60 fill / 0 13px 0 13px stretch;
}
.price .ico { width: 21px; height: 21px; opacity: 0; }
.price > [data-fit] { text-align: center; }
.shop-actions { grid-template-columns: minmax(0, 66fr) minmax(0, 34fr); align-items: center; }
.shop-actions .btn { padding-inline: 10px; }
#view .shop-actions .btn.primary { padding-inline: 26px; }
.shop-actions .primary { font-size: 32px; }
.shop-actions [data-refund] { min-height: 54px; font-size: 16px; --fit-lines: 2; --fit-min: 13; }
/* 시안: 금테 두 줄 버튼, 앞에 되돌리기(↺) 그림 */
#view .shop-actions .refund { display: flex; align-items: center; justify-content: center; gap: 3px; padding-inline: 9px 8px; }
.shop-actions .refund .ico { flex: none; width: 24px; height: 25px; object-fit: contain; }
.shop-actions .refund > span { min-width: 0; --fit-lines: 2; line-height: 1.1; text-align: center; word-break: keep-all; }
#view .shop-actions .btn.primary { min-height: 64px; }
.shop-actions .primary > span { --fit-min: 18; --fit-lines: 2; --fit-one: 1; --fit-one-min: 18; }
.shop-actions .refund:disabled { filter: saturate(.8) brightness(.9); }
/* 3.0: 진열장이 화면 아래까지 늘어나고, 처음으로는 진열장 아래 띠 위의 작은 버튼 */
.shop-shelf { position: relative; flex: 1 0 auto; display: grid; margin-bottom: 6px; }
.shop-shelf > .shop-list { grid-auto-rows: 1fr; padding-bottom: 30px; }
#view .shop-back { position: absolute; z-index: 2; left: 50%; bottom: 0; translate: -50% 0; min-width: 0; width: min(130px, 40%); min-height: 40px;
  border: 0; background: none; font: 15px/1 var(--game); color: var(--cream); }
.price .ico { opacity: 1; position: relative; z-index: 1; width: 24px; height: 24px; margin-left: -1px; filter: drop-shadow(0 1px 1px #3a1a06); }
.shop-txt .price { max-width: 100px; min-height: 28px; font-size: 17px; }
.flying-coin { position: fixed; pointer-events: none; z-index: 10; width: 31px; height: 31px; }
@media (max-height: 680px) {
  #view .shop-item { min-height: 72px; }
  #view .shop-actions .btn.primary { min-height: 56px; font-size: 28px; }
  .shop-actions [data-refund] { min-height: 48px; }
  .shop-txt { gap: 1px; padding-block: 6px 4px; }
  .shop-head { height: calc(min(100cqw, 480px) * .47); }
  .shop-sul { width: 34%; }
  .shop-item > .ico { max-height: 74px; }
}

/* 도감과 기록장 */
.dex-sheet { display: grid; gap: 8px; }
.dex-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.dex-card, .sk, .map-record {
  min-width: 0; border: 1px solid #a16d3c; border-radius: 10px; background: #f5d69e; text-align: center;
}
.dex-card { padding: 5px; display: grid; justify-items: center; gap: 3px; }
.dex-card img { width: 76px; height: 74px; }
.dex-card:not(.unseen) {
  grid-column: 1 / -1; grid-template-columns: 76px minmax(0,1fr);
  align-content: center; align-items: center; column-gap: 9px; text-align: left;
}
.dex-card:not(.unseen) img { grid-row: span 2; }
.dex-card:not(.unseen) .cnt { grid-area: 2 / 2; }
.dex-card:not(.unseen) .small { grid-area: 3 / 1 / auto / -1; }
.dex-card.unseen img { filter: sepia(1) brightness(.24); opacity: .8; }
.dex-card b { font: 18px/1.17 var(--game); }
.dex-card .cnt { color: #811e17; font-weight: 700; }
.sk-list { display: grid; gap: 5px; }
.sk { display: grid; text-align: left; grid-template-columns: 44px minmax(0,1fr); padding: 6px; gap: 3px 7px; }
.sk .ico { grid-row: span 2; align-self: center; width: 40px; height: 40px; }
.sk.locked .ico { filter: grayscale(1) brightness(.6); }
.sk.locked .ico { grid-row: auto; }
.sk.locked .small { grid-column: 1 / -1; }
.screen .osc-book { position: static; color: var(--ink); background: transparent; overflow: visible; z-index: auto; }
.screen .osc-header { margin: 0 38px 0 46px; padding: 0; gap: 3px; border: 0; }
.screen .osc-header .osc-title {
  color: var(--cream); min-height: 57px; padding: 12px;
  display: grid; align-content: center; background: var(--plaque) center / 100% 100% no-repeat;
  text-align: center; font-family: var(--game);
}
.screen .osc-back {
  width: 44px; padding: 0; border: 0; color: var(--cream); background: var(--medal) center / 100% 100% no-repeat;
}
.screen .osc-book-scroll { flex: none; max-width: none; overflow: visible; margin: 22px 0; padding: 4px 22px; }
.screen .osc-heading { margin: 5px 0; font: 20px/1.17 var(--game); }
.map-records { display: grid; gap: 5px; }
.map-record { display: grid; grid-template-columns: 38% minmax(0,1fr); gap: 7px; padding: 5px; text-align: left; }
.map-record img { width: 100%; height: 64px; object-fit: cover; border-radius: 5px; }
.map-record h3 { font-size: 19px; }
.map-record p { font: 14px/1.17 var(--body); }
.screen .osc-records { grid-template-columns: minmax(0,1fr); margin-top: 7px; gap: 5px; }
.screen .osc-record, .screen .osc-challenge { background: #f1d299; color: var(--ink); padding: 7px; border-radius: 9px; border-color: #a16d3c; }
.screen .osc-record { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; }
.screen :is(.osc-record-value,.osc-sub,.osc-tier,.osc-date,.osc-done-stamp) { color: #713717; }
.screen .osc-label { font-size: 15px; }
.screen .osc-record .osc-label[data-fit] { word-break: normal; overflow-wrap: anywhere; }

/* 본문 게임 안내 */
.guide { max-width: 480px; margin: 0 auto; padding: 32px 16px 64px; display: grid; gap: 28px; }
.guide section { display: grid; gap: 9px; }
.guide section p, .guide section li { font-size: 15px; }
.guide a { color: var(--gold); }
.arcana { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; list-style: none; padding: 0; }
.arcana li { background: #432719; padding: 8px 12px; border-radius: 8px; }
.arcana b { display: block; }
.site-foot { display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .bob, .stamp, .banner.on { animation: none; }
  .xpbar i, .bossbar i, .btn { transition: none; }
}

/* 현판·큰 버튼 글씨: 시안처럼 금빛 글자에 짙은 밤색 테두리 */
.plaque, .btn.primary {
  color: #ffd043;
  text-shadow: 1px 1px 0 #2a0f05, -1px 1px 0 #2a0f05, 1px -1px 0 #2a0f05, -1px -1px 0 #2a0f05,
    0 2px 0 #2a0f05, 2px 0 0 #2a0f05, -2px 0 0 #2a0f05, 0 3px 3px #1a0803b0;
}
/* 시안의 금빛 그라데이션 글자: 글자 모양으로 칠하고 테두리는 그림자 필터로 두른다 */
.plaque > [data-fit], .btn.primary > [data-fit] {
  background: linear-gradient(180deg, #fffbd0 0%, #ffe36a 38%, #ffb320 70%, #e7780c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none;
  filter: drop-shadow(1.5px 0 0 #2a0f05) drop-shadow(-1.5px 0 0 #2a0f05) drop-shadow(0 1.5px 0 #2a0f05) drop-shadow(0 -1.5px 0 #2a0f05) drop-shadow(0 3px 2px #1a0803b0);
  font-weight: 900;
}

@media (max-width: 370px) {
  #view .shop-item { grid-template-columns: 34% minmax(0,1fr); }
  #view .shop-item:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { grid-template-columns: 29% minmax(0,1fr); }
  .shop-txt { padding-inline: 6px; }
}

@media (max-width: 380px) {
  /* 좁은 폰도 시안처럼 네 칸 한 줄: 아이콘을 줄이고 안쪽 여백을 줄인다 */
  .result-sheet { padding-inline: 30px; margin-inline: 2px; }
  .result-sheet .osc-row .osc-label, .result-sheet .osc-value { font-size: 16px; }
  .stats { gap: 3px; }
  .stat { grid-template-columns: 19px minmax(0, 1fr); column-gap: 1px; padding-inline: 4px; }
  .stat > span { letter-spacing: -.2px; }
  .stat .ico { width: 19px; height: 26px; }
  .stat.solo { grid-template-columns: minmax(0, 1fr); }
  .stat b { font-size: 16px; }
}

@media (max-width: 370px) {
  .pick-safe { margin-inline: 6px 7px; }
}

/* 정산 4차: 시안처럼 한 줄 큰 도전 버튼(긴 언어는 글자를 줄여 한 줄 먼저), 깊이 칸은 두 줄까지 */
#view .result-actions .primary { padding-inline: 15%; }
#view .result-actions .primary > span { --fit-min: 18; --fit-lines: 2; --fit-one: 1; --fit-one-min: 18; }
.stat.solo b { --fit-lines: 2; --fit-one: 1; white-space: normal; text-align: center; overflow-wrap: normal; hyphens: manual; }

/* 3.0: 360×640 같은 낮은 화면도 정산이 한 화면에 들어가게 */
@media (max-height: 680px) {
  .result-screen .result-art, .result-screen:not(:has(.unlocks)) .result-art { height: 150px; }
  .result-screen .stamp { width: 84px; font-size: 24px; top: calc(env(safe-area-inset-top, 0px) + 36px); }
  .res-title { margin-top: -34px; }
  .res-title h2 { min-height: 52px; font-size: 26px; padding-block: 5px 16px; }
  .result-sheet { gap: 2px; padding-block: 18px 40px; }
  .result-sheet .osc-row .osc-label, .result-sheet .osc-value { font-size: 15px; line-height: 1.08; }
  .result-sheet .osc-total { margin-top: 3px; }
  .result-sheet .osc-number { font-size: 27px; }
  .stat { min-height: 40px; padding-block: 2px 3px; }
  .earn .ico, .earn::after { width: 40px; height: 30px; }
  .earn b { font-size: 22px; }
  .recommendation .ico { width: 32px; height: 32px; }
  #view .recommendation .btn { min-height: 32px; }
  #view .result-actions .primary { min-height: 58px; font-size: 28px; }
  .result-actions { margin-top: -22px; }
  .result-actions .row2 .btn { min-height: 44px; }
}

/* 3.0 도감: 금테 액자 칸(밤하늘) 3줄, 못 만난 요괴는 부적 봉인 칸. 아래 고른 요괴 설명 판 */
.dex-head { position: relative; display: grid; justify-items: center; }
.dex-head > .plaque { width: min(66%, 270px); min-height: 58px; font-size: 30px; }
.dex-tally { position: relative; isolation: isolate; margin: -6px 0 0; padding: 3px 26px 5px; min-width: 110px; text-align: center; font: 20px/1.1 var(--game); color: #4a1a0a; }
.dex-tally::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent; border-image: url("sprites/ui-band-cream.webp") 40 70 fill / 12px 22px stretch; }
.dex-cabinet { position: relative; padding: 10px; border: 3px solid #d79a32; border-radius: 12px; background: linear-gradient(#5b2d14, #3e1d0c); box-shadow: inset 0 0 0 2px #6e3a17, 0 3px 6px #12081ecc; }
.dex-cabinet .dex-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#view .dex-cell {
  position: relative; display: block; width: 100%; aspect-ratio: 257 / 260; padding: 0; border: 0;
  background: url("sprites/dex-frame.webp") center / 100% 100% no-repeat; color: #4a1a0a;
}
#view .dex-cell.unseen { background-image: url("sprites/dex-sealed.webp"); opacity: 1; }
.dex-face { position: absolute; left: 14%; right: 14%; top: 9%; height: 62%; width: 72%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 2px 2px #0a0618aa); }
#view .dex-cell > b { position: absolute; width: auto; left: 18%; right: 18%; bottom: 5%; height: 14%; display: block; padding-top: .18em; text-align: center; font: 15px/1 var(--game); --fit-min: 10; --fit-lines: 1; --fit-one: 1; overflow-wrap: normal; word-break: keep-all; }
.dex-stars { position: absolute; right: 9%; top: 6%; color: #ffd648; font-size: 13px; letter-spacing: -2px; text-shadow: 0 1px 1px #3a1606, 0 0 3px #3a1606; }
.dex-cell[aria-pressed="true"]::after {
  content: ""; position: absolute; inset: -6px; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/k-glow.webp") 70 fill / 16px stretch; mix-blend-mode: screen;
}
.dex-detail {
  position: relative; isolation: isolate; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; align-items: center;
  margin-top: 8px; padding: 14px 36px 16px 30px; color: var(--ink);
}
.dex-detail[hidden] { display: none; }
.dex-detail::before { content: ""; position: absolute; inset: 0; z-index: -1; border: 1px solid transparent; border-image: url("sprites/ui-paper.webp") 40 70 120 70 fill / 12px 28px 34px 28px stretch; }
.dex-detail-face { width: 96px; height: 96px; object-fit: contain; padding: 6px; background: url("sprites/dex-frame.webp") center / 100% 100% no-repeat; }
.dex-detail > div { display: grid; gap: 4px; min-width: 0; }
.dex-detail-name { font: 24px/1.1 var(--game); --fit-min: 14; color: #5a1c0c; }
.dex-detail-desc { font: 700 14px/1.25 var(--body); --fit-lines: 2; --fit-min: 12; }
.dex-detail-cnt { justify-self: start; padding: 3px 12px; border-radius: 99px; background: #6b2a14; color: #ffe08a; font: 17px/1.1 var(--game); }
.dex-total { color: var(--cream); font-size: 14px; text-shadow: 0 1px 2px #12081e; }

/* 3.0 기록장: 펼친 책 틀 안에서만 스크롤, 위 버튼은 '‹' 하나(홈 자리), 도전 과제는 도장 칸 */
.stage[data-scene="book"] .topbar .orak-home-button { visibility: hidden; }
.stage[data-scene="book"] #view { overflow: hidden; }
.stage[data-scene="book"] .osc-book { display: flex; flex-direction: column; flex: 1 1 0; flex-shrink: 1; min-height: 0; }
.stage[data-scene="book"] .osc-header { position: relative; margin: 0 46px 0 0; }
.stage[data-scene="book"] .osc-back { position: absolute; left: 0; top: 4px; width: 44px; height: 44px; font: 26px/1 var(--game); }
.stage[data-scene="book"] .osc-header .osc-title { margin-left: 52px; }
.stage[data-scene="book"] .book-frame {
  display: flex; flex: 1 1 0; min-height: 0; margin: 8px -4px 0; padding: 24px 28px 40px; border: 1px solid transparent;
  border-image: url("sprites/ui-bookframe.webp") 270 64 90 64 fill / 127px 30px 42px 30px stretch;
}
.stage[data-scene="book"] .osc-book-scroll { flex: 1; min-height: 0; overflow: auto; scrollbar-width: none; margin: 0; padding: 2px 2px 8px; background: none; border: 0; }
.stage[data-scene="book"] .osc-book-scroll::before, .stage[data-scene="book"] .osc-book-scroll::after { display: none; }
.stage[data-scene="book"] .osc-heading {
  position: relative; justify-self: center; width: fit-content; margin: 8px auto 6px; padding: 2px 50px; text-align: center; color: #5a1c0c;
  background: url("sprites/ui-cloud-l.webp") left center / 40px auto no-repeat, url("sprites/ui-cloud-r.webp") right center / 40px auto no-repeat;
}
.stage[data-scene="book"] .osc-records { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stage[data-scene="book"] .osc-record { grid-template-columns: minmax(0,1fr); gap: 2px; text-align: center; background: #f6e2b4; border: 1.5px solid #c49048; }
.stage[data-scene="book"] .osc-record-value { font: 22px/1.1 var(--game); color: #8f2018; }
.stage[data-scene="book"] .osc-record .osc-label { font: 700 13px/1.2 var(--body); }
.stage[data-scene="book"] .osc-tier { margin: 6px 0 2px; font: 15px/1.2 var(--game); text-align: center; }
.stage[data-scene="book"] .osc-challenges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; padding: 0; list-style: none; }
.stage[data-scene="book"] .osc-challenge {
  position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 3px 7px; text-align: center;
  background: #f6e2b4; border: 1.5px solid #c49048; border-radius: 10px;
}
.stage[data-scene="book"] .osc-challenge::before {
  content: ""; width: 54px; height: 54px; background: url("sprites/ui-slot-empty.webp") center / contain no-repeat;
}
.stage[data-scene="book"] .osc-challenge.osc-done::before { background-image: url("sprites/ui-slot-done.webp"); }
.stage[data-scene="book"] .osc-challenge-text { display: grid; gap: 1px; min-width: 0; }
.stage[data-scene="book"] .osc-challenge .osc-label { font: 13px/1.15 var(--game); overflow-wrap: anywhere; word-break: keep-all; }
.stage[data-scene="book"] .osc-challenge .osc-sub { font-size: 11px; }
.stage[data-scene="book"] .osc-done-stamp { position: absolute; top: 3px; right: 3px; font-size: 0; }
.stage[data-scene="book"] .osc-done-stamp .osc-date { display: none; }
.stage[data-scene="book"] .map-record { background: #f6e2b4; border: 1.5px solid #c49048; }

/* 3.0 검수(11개 언어): 긴 말이 판·도장 밖으로 나가지 않게 */
.setup-scroll h3 { width: min(200px, 62%); }
.setup-scroll h3 > [data-fit] { --fit-lines: 1; --fit-one: 1; --fit-min: 12; white-space: nowrap; }
.stage[data-scene="book"] .osc-challenge .osc-sub { font-size: 12px; }
/* 글자가 긴 언어(한·중·일 말고)는 도전 과제를 두 칸으로 놓아 이름이 두 줄 안에 든다 */
.stage[data-scene="book"] .osc-challenges:not(:lang(ko)):not(:lang(ja)):not(:lang(zh)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-screen .stamp { padding: 10px; }
.result-screen .stamp span { --fit-lines: 3; }
#view .recommendation .btn { padding-inline: 6px; }
.stat.solo { padding-inline: 2px; }
@media (max-width: 380px) {
  .res-title h2 { padding-inline: 46px; }
  #view .dex-cell > b { left: 11%; right: 11%; }
}
.cardimg + .fine { padding-inline: 18px; max-width: 98%; }
/* '새 기술' 도장: 긴 언어도 글자가 도장 몸통에 들도록 조금 넓게 */
.pick-badges { grid-template-columns: minmax(0,1fr) 56px; }
.cards-four .pick-badges { grid-template-columns: minmax(0,1fr) 54px; }
.pick .tag-new { padding-inline: 3px; }
.pick-safe > b { padding-inline: 2px; max-width: 100%; box-sizing: border-box; }
/* 검수 2차 */
.stats { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, .8fr) minmax(0, 1.2fr); }
.stat.solo b { --fit-one-min: 14; }
.res-title h2 > [data-fit] { --fit-min: 14; }
.setup-scroll h3 > [data-fit] { white-space: normal; --fit-lines: 2; --fit-one-min: 14; }
#view .recommendation .btn { padding-inline: 10px; }
#view .recommendation .btn > [data-fit] { padding-inline: 2px; }
.stage[data-scene="book"] .osc-record .osc-label[data-fit] { --fit-lines: 3; }
.stats { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, .85fr) minmax(0, 1fr); }
.recommendation { grid-template-columns: 40px minmax(0,1fr) auto; }
#view .recommendation .btn { padding-inline: 12px; }
@media (max-height: 680px) { .res-title h2 { padding-block: 9px 13px; } }
/* 도감 칸 이름: 긴 언어는 두세 줄로 접고, 이름판(크림색)이 위로 늘어난다 */
#view .dex-cell > b {
  left: 12%; right: 12%; bottom: 4.5%; top: auto; height: auto; min-height: 15%;
  display: flex; align-items: center; justify-content: center; padding: 2px 3px 1px;
  font-size: 15px; line-height: 1.05; --fit-min: 12; --fit-lines: 3; --fit-one: 1; --fit-one-min: 12;
  background: #f3dfae; border-radius: 7px; box-shadow: 0 0 0 1px #d2a85a66;
}
#view .dex-cell > b { left: 7%; right: 7%; }
#view .dex-cabinet:not(:lang(ko)):not(:lang(ja)):not(:lang(zh)) .dex-cell > b { font-size: 13px; }
.stage[data-scene="book"] .osc-challenge .osc-label[data-fit] { --fit-lines: 3; }
/* 정산: 키 큰 화면은 시안처럼 칭호·점수를 크게 */
@media (min-height: 760px) {
  .res-title h2 { min-height: 76px; font-size: 38px; padding-block: 10px 22px; }
  .res-title .res-kicker { font-size: 19px; }
  .stat { min-height: 54px; }
  .stat b { font-size: 21px; }
  .stat > span { font-size: 13px; }
  .result-sheet { gap: 7px; }
  .result-sheet .osc-row .osc-label, .result-sheet .osc-value { font-size: 19px; }
  .earn > span { font-size: 21px; }
  .earn b { font-size: 31px; }
}
/* 도감: 시안처럼 종이 장(금테)에 칸을 담고, 칸이 많으면 장 안에서만 스크롤. 아래 설명 칸은 늘 보인다 */
.dex-cabinet {
  background: none; box-shadow: none; border-radius: 0; padding: 4px 6px;
  border: solid transparent; border-width: 16px 22px 30px;
  border-image: url("sprites/ui-paper.webp") 40 70 120 70 fill / 16px 22px 30px stretch;
  max-height: max(250px, calc(100svh - 330px)); overflow-y: auto; scrollbar-width: none; overscroll-behavior: contain;
}
.dex-cabinet::-webkit-scrollbar { display: none; }
.dex-cabinet .dex-grid { gap: 5px; }
.dex-detail { margin-top: 4px; }
/* 기록장: 위쪽 큰 칸 넷은 그림과 함께 크게 */
.stage[data-scene="book"] .osc-record.main { grid-template-columns: 40px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; column-gap: 6px; text-align: center; padding: 6px 6px 6px 4px; }
.stage[data-scene="book"] .osc-record.main > .ico { grid-row: span 2; width: 40px; height: 40px; object-fit: contain; filter: drop-shadow(0 1px 1px #6a3a1288); }
.stage[data-scene="book"] .osc-record.main .osc-record-value { font-size: 26px; }
.stage[data-scene="book"] .osc-record.main .osc-label { font-size: 14px; }
.stage[data-scene="book"] .osc-record:not(.main) .osc-record-value { font-size: 18px; }
.cardimg + .fine { padding: 6px 30px; font-size: 13px; max-width: 96%; text-wrap: balance; }
/* 검수 3차(긴 이름표) */
@media (min-height: 760px) { .stat.solo b { font-size: 18px; } }
.stage[data-scene="book"] .osc-record.main .osc-label[data-fit] { --fit-min: 12; }
.result-actions .row2 .btn > [data-fit] { --fit-min: 12; --fit-lines: 2; }
.setup-scroll [data-setup-start] > [data-fit] { --fit-min: 16; }
.dex-head > .plaque > [data-fit] { --fit-min: 14; }
.start-menu .medal > [data-fit]:lang(ja), .start-menu .medal > [data-fit]:lang(zh) { word-break: normal; --fit-lines: 2; }
/* 긴 언어: 큰 칸의 그림을 작게 해서 이름이 세 줄 안에 든다 */
.stage[data-scene="book"] .osc-record.main:not(:lang(ko)):not(:lang(ja)):not(:lang(zh)) { grid-template-columns: 30px minmax(0,1fr); column-gap: 4px; }
.stage[data-scene="book"] .osc-record.main:not(:lang(ko)):not(:lang(ja)):not(:lang(zh)) > .ico { width: 30px; height: 30px; }

/* 4차: 글자와 배경 어우러짐 */
/* 시계·퇴치 판: 같은 크림 글자 + 짙은 밤색 테두리 */
.clock, .tally {
  color: #fff0c8;
  text-shadow: 0 1px 0 #2a0f05, 0 -1px 0 #2a0f05, 1px 0 0 #2a0f05, -1px 0 0 #2a0f05, 1px 1px 0 #2a0f05, -1px 1px 0 #2a0f05, 0 2px 2px #0009;
}
/* 시계판 그림에서 달과 금테 사이 나무판 한가운데(가로 52%)에 두고, 세로는 사용자 눈맞춤으로 판 중심보다 3~4px 아래 */
.clock { font-size: 20px; padding: 5px 14px 4px 18px; letter-spacing: .5px; }
.clock { position: relative; }
.clock > .ot-tag {
  position: absolute; left: 52%; top: calc(100% - 6px); transform: translateX(-50%); max-width: 120px;
  padding: 2px 9px 3px; border: 1.5px solid #e9b85a; border-radius: 9px; background: linear-gradient(#7a2a12, #4a1a0a);
  font: 12px/1.1 var(--game); font-style: normal; color: #ffe291; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 0 #2a0f05; box-shadow: 0 2px 3px #0007; --fit-min: 10;
}
.clock > .ot-tag[hidden] { display: none; }
/* 상자·진화 창: 멈춤 창과 같은 두루마리, 이름은 붉은 밤색 게임 글꼴, 설명은 장식선 아래 두 줄 */
.panel.chest { position: relative; isolation: isolate; background: none; padding: 30px 40px 72px; gap: 6px; }
.panel.chest::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border: 1px solid transparent;
  border-image: url("sprites/ui-frame.webp") 260 70 120 70 fill / 141px 38px 65px 38px stretch;
}
.panel.chest > .plaque { width: 78%; justify-self: center; margin-top: -8px; }
.panel.chest .evo-name { margin: 2px 0 0; font: 26px/1.15 var(--game); color: #7a1d10; text-shadow: 0 1px 0 #ffe6a8; }
.panel.chest .chest-desc {
  justify-self: center; max-width: 92%; margin: 0; padding-top: 14px;
  background: url("sprites/k-divider.webp") center top / min(120px, 70%) 10px no-repeat;
  font: 17px/1.35 var(--game); color: #4a1a0a; text-wrap: balance; word-break: keep-all;
}
.panel.chest .chest-desc > [data-fit] { --fit-lines: 3; --fit-min: 13; }
/* 정산 기록 칸 넷: 모두 [그림 → 큰 숫자 → 이름] 같은 모양, 이름은 테에서 띄운다 */
.stats .stat { grid-template: "i" 22px "v" auto "l" auto / minmax(0, 1fr); justify-items: center; row-gap: 1px; padding: 5px 4px 8px; }
.stats .stat > .ico { grid-area: i; width: 26px; height: 22px; object-fit: contain; }
.stats .stat > b { grid-area: v; font-size: 19px; }
.stats .stat > span { grid-area: l; color: #fbe6bd; font: 12px/1.1 var(--game); }
@media (min-height: 760px) { .stats .stat > b { font-size: 21px; } .stats .stat > span { font-size: 13px; } }
.stats .stat > b, .stats .stat > span { text-align: center; justify-self: stretch; }
/* 멈춤 창 기록 줄: 종이 위 글은 게임 글꼴·짙은 밤색, 아래 금빛 장식선 */
.panel.pausep > .pause-stat { font-family: var(--game); font-weight: 800; font-size: 16px; color: #4a1a0a; text-align: center;
  margin: 2px 18px 0; padding-bottom: 12px; background: url(sprites/k-divider.webp) center bottom / min(220px, 80%) 10px no-repeat; --fit-min: 12; }
/* 3.0 글자·판 재검수: 레벨 업 판의 구름 장식이 뒤쪽 '퇴치·엽전' 줄 글자를 반쯤 가려 보이던 것 → 판이 떠 있는 동안 그 줄은 숨김 */
body:has(.panel.lvup) .hud .tally { visibility: hidden; }
/* 동료 이름 작은 Lv 판: 긴 로마자 이름('Nyangsulsa')이 판 밖으로 → 판 안쪽 면 기준으로 줄임 */
.companion-selector b:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { font-size: 12px; --fit-min: 11; padding-inline: 9px; letter-spacing: -.4px; }
/* 3.0 글자·판 재검수: 긴 언어 퇴치·엽전 줄은 한 단계 작게, 동료 이름은 11px까지 */
.tally:is(:lang(es),:lang(pt-BR),:lang(fr),:lang(de),:lang(vi),:lang(id)) { font-size: 12px; --fit-min: 11; padding-inline: 10px; }
.companion-selector b:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { font-size: 11px; letter-spacing: -.6px; padding-inline: 6px; }
/* 3.0 전체 조합 검수: 좁은 화면에서 긴 제목(Carnet de records)이 구름 장식에 닿지 않게, 두 줄 퇴치 줄은 판을 키워 안에 */
@media (max-width: 370px) { .screen .osc-header .osc-title:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { font-size: 22px; } }
.tally:not(:lang(ko)):not(:lang(ja)):not(:lang(zh-TW)) { line-height: 1.05; padding-block: 8px 9px; }
/* 2026-12-02 엽전 칩: 큰 수(2.400)가 두 줄로 끊기던 것(main 부터), 오늘 두루마리 이름이 하이픈으로 끊기던 것 */
.purse b, .purse-label { white-space: nowrap; }
.purse { padding-inline: 9px 27px; gap: 3px; align-items: center; }
.purse b { line-height: 1; translate: 0 1px; }
.btn.tonight span { hyphens: manual; -webkit-hyphens: manual; text-wrap-style: balance; }
.start-art .purse, .shop-purse { max-width: 172px; width: auto; }
html:is([lang="de"],[lang="fr"],[lang="pt-BR"],[lang="es"],[lang="id"]) .purse-label { font-size: 14px; }
/* 2026-12-02 결과 실패 도장: 낱말 가운데(Gesc/heite/rt, Cacer/ía)에서 끊기던 것(main 부터) → 낱말 단위로만 접고 글자를 줄인다 */
html:not([lang="ko"]) .result-screen .stamp span { overflow-wrap: normal !important; word-break: keep-all !important; hyphens: manual; line-height: 1.02; }
html:not([lang="ko"]) .result-screen .stamp { padding: 15px 13px; }
@media (min-height: 681px) { html:not([lang="ko"]) .result-screen .stamp { padding: 21px 18px; font-size: 24px; } }
html:not([lang="ko"]) .result-screen .stamp span { --fit-min: 11px; }
/* 2026-12-02 시작 화면 지갑이 제목 그림 오른쪽을 덮던 것(main 부터, 모든 언어) → 맨 위 집·소리 단추 사이 가운데로 옮긴다 */
.start-art .purse { top: calc(env(safe-area-inset-top, 0px) + 5px); right: auto; left: 50%; translate: -50% 0; max-width: min(172px, calc(100% - 136px)); }
/* 2026-12-02 390x693 같은 중간 높이에서 말풍선이 제목 그림을 덮던 것(main 부터) → 작은 화면처럼 제목·주인공을 줄여 말풍선을 제목 아래에 둔다 */
@media (min-height: 681px) and (max-height: 760px) {
  .game-logo { top: 44px; left: 19%; width: 56%; }
  .start-hero { height: min(196px, max(150px, calc(100% - 150px))); left: 50%; }
  .start-hero .bubble { font-size: 14px; padding: 5px 9px; }
}
/* 2026-12-02 메뉴 메달 이름이 나무 띠 양 끝 구름 장식 위까지 번지던 것(긴 언어) → 글자는 장식 안쪽 판에만, 넘치면 글자를 줄인다 */
.start-menu .medal > [data-fit] { padding-inline: 25px; --fit-min: 11; --fit-one: 1; --fit-one-min: 12px; text-wrap-style: balance; }
@media (max-height: 680px) { .start-menu .medal > [data-fit] { left: -27%; right: -27%; padding-inline: 24px; } }
/* 2026-12-02 준비 화면 긴 언어: 잠금 안내가 두루마리 종이 오른쪽 끝을 넘고, 동료 효과·저주 띠 글자가 양 끝 구름 장식에 닿던 것 → 장식 안쪽으로 여백을 잰 값만큼 준다 */
.map-hint { padding-inline: 16px; }
.map-hint > [data-fit] { text-wrap-style: balance; }
.companion-desc { padding-inline: 34px; }
.companion-desc > span { text-wrap-style: balance; }
.curse-card { padding-inline: 40px; }
.curse-card > span { text-wrap-style: balance; }
.companion-desc { padding-inline: 40px; }
.setup-scroll h3 { padding-inline: 33px; }
.setup-scroll h3 > [data-fit] { text-wrap-style: balance; }
/* 2026-12-02 전투 화면 퇴치·엽전 칸: 긴 언어에서 둘째 줄이 "· Monedas"로 시작하던 것 → 접히면 점 없이 한 줄씩 */
#kills, #coins { white-space: nowrap; }
.tally .stack .sep { display: none; }
.tally .stack #kills, .tally .stack #coins { display: block; }
/* 상점 칸 이름: 한 줄로 우겨 넣느라 12~13px로 작아지던 것 → 15px 아래로는 두 줄로 */
.shop-txt b { --fit-one-min: 15; }
/* 2026-12-02 신기록 도장이 위 줄 점수(+200)를 덮던 것(main 부터) → 합계 띠 위에 틈을 벌려 그 자리에 찍는다 */
.result-sheet .osc-total.sealed { margin-top: 11px !important; }
@media (max-height: 680px) { .result-sheet .stats .stat { padding-bottom: 6px; } }
.result-sheet .osc-total.sealed ~ .osc-seal { right: 4px; rotate: 4deg; }
/* 결과 화면 추천 강화 줄: "Gran alcance n. 1 · / 25"처럼 숫자만 따로 떨어지던 것 → 한 줄이 안 되면 이름 / 단계·값으로 고르게 두 줄 */
.recommendation > span { --fit-lines: 2; --fit-one: 1; --fit-one-min: 13; text-wrap-style: balance; line-height: 1.12; }
html:not([lang="ko"]) .recommendation > span { font-size: 15px; }
/* 2026-12-02 일본어: 낱말 가운데 줄바꿈(挑/戦, ふと/ころ, 引き寄/せ, 星明/かり)과 외톨이 끝 줄(ます) → 구 단위 줄바꿈 + 고른 줄 */
html[lang="ja"] :is([data-fit], .bubble, .bubble span, p) { word-break: auto-phrase; text-wrap-style: pretty; }
html[lang="ja"] .shop-txt b { --fit-one-min: 14; }
html:is([lang="ja"],[lang="zh-TW"],[lang="ko"]) .curse-card { padding-inline: 32px; }
html[lang="ja"] .curse-card > span { text-wrap-style: balance; }
.shop-txt b { padding-inline: 7px; }
html:is([lang="ja"],[lang="zh-TW"],[lang="th"],[lang="ko"]) .shop-txt b { padding-inline: 3px; --fit-one-min: 12; }
.shop-txt .effect { padding-inline: 1px; hyphens: manual; -webkit-hyphens: manual; overflow-wrap: normal; }
html[lang="ja"] .screen .osc-record .osc-label[data-fit] { word-break: auto-phrase; overflow-wrap: normal; }
/* 레벨업 카드 '새 기술/새 보조' 밀랍 도장: 긴 언어 글자가 도장 몸통 밖으로 나가던 것 → 글자를 줄여 몸통 안에 */
html:not([lang="ko"]):not([lang="ja"]):not([lang="zh-TW"]) .pick .tag-new { font-size: 10px; padding-inline: 7px; line-height: 1.02; }
.pick .tag-new [data-fit] { overflow-wrap: normal; hyphens: manual; word-break: keep-all; }
.pick-safe > b:lang(th), .pick .desc:lang(th) { word-break: normal; }
/* 2026-12-02 한국어 기록장 이름이 '퇴/치', '깊/이'처럼 글자 하나만 다음 줄로 가던 것 → 어절 단위 + 고른 줄 */
html[lang="ko"] .screen .osc-record .osc-label[data-fit], html[lang="zh-TW"] .screen .osc-record .osc-label[data-fit] { word-break: keep-all; overflow-wrap: normal; }
html[lang="zh-TW"] .screen .osc-record .osc-label[data-fit] { word-break: normal; }
html[lang="ko"] .shop-txt b { padding-inline: 7px; --fit-one-min: 13; }
/* 2026-12-02 준비 화면 제목 글자가 현판 양 끝 발바닥 장식 위까지 나가던 것(태국어·일본어) → 장식 안쪽만 쓴다 */
.setup-head .plaque { padding-inline: 38px 34px; }
/* 태국어 저주 띠: 두 줄일 때 윗줄 성조 부호가 띠 위로 잘리던 것 → 줄 간격과 위아래 여백 */
html[lang="th"] .curse-card { padding-block: 9px 8px; }
html[lang="th"] .curse-card strong { line-height: 1.42; }
/* 저주 띠 글자는 두 줄까지만(세 줄이면 띠 금테 위로 넘침), 넘치면 줄인다 */
.curse-card strong { --fit-lines: 2; --fit-min: 11; }
.curse-card { padding-block: 8px; }
.curse-card strong.stack .sep { display: none; }
.curse-card strong.stack .curse-name { display: block; }
html[lang="th"] .result-screen .stamp span { --fit-lines: 2; line-height: 1.2; }
@media (min-height: 701px) { #view .start-actions .btn.primary { padding-inline: 19%; } }
@media (max-height: 700px) {
  #view .start-actions .btn.primary { padding-inline: 18%; }
  #view .start-actions .btn.primary > [data-fit] { --fit-one-min: 20; --fit-min: 20; }
}
/* 상점 아래 '퇴마 시작' 판: 글자가 양 끝 발바닥 장식에 닿던 것 → 장식 안쪽까지 여백 */
#view .shop-actions .btn.primary { padding-inline: 54px; }
/* 라틴 문자 상점 이름은 13px까지 한 줄 먼저(두 줄+두 줄이면 효과·동그라미가 값 판에 닿음) */
html:not([lang="ja"]):not([lang="zh-TW"]):not([lang="th"]):not([lang="ko"]) .shop-txt b { --fit-one-min: 13; }
/* 상점 이름표: 한 줄 이름이 종이 위 말린 테두리에 붙던 것 → 내용을 종이 가운데로, 위 여백을 테두리만큼 */
.shop-txt { align-content: center; padding-top: 9px !important; }
/* 효과 줄은 한 줄로(두 줄이면 동그라미·값 판과 겹침): 넘치면 10px까지 줄인다 */
.shop-txt .effect { --fit-lines: 1; --fit-one: 0; --fit-min: 9.5; --fit-floor: 9.5; white-space: nowrap; letter-spacing: -.2px; }

/* 기록장 목록이 책 아래 구름 장식·종이 곡선 위로 올라와 반쯤 겹치지 않게: 장식 위에서 끝내고 끝을 흐린다 */
.stage[data-scene="book"] .book-frame { padding-bottom: 94px; }
.stage[data-scene="book"] .osc-book-scroll { -webkit-mask-image: linear-gradient(#000 calc(100% - 18px), transparent); mask-image: linear-gradient(#000 calc(100% - 18px), transparent); }
