/* 냥이 옛날이야기 3.0 이야기책 틀
   원화(컷)는 그대로 두고, 대사판·이름패·책갈피 선택지·나무 단추·안내 띠·책장만 손그림 조각(ui/*.webp)으로 바꾼다.
   조각 그림은 scripts/story3_art.py로 자른다. 글자·아이콘은 모두 코드가 얹는다(11개 언어). */
:root {
  --ink-brown: #3b2414;
  --ink-soft: #5a3a22;
  --paper: #f3e3c0;
  --wood: #7a4a26;
}

/* ---- 세 칸 늘이기: 양 끝 장식은 비율을 지키고 가운데만 늘인다.
   --img 그림, --ar 그림 가로/세로, --l 왼쪽 장식이 끝나는 곳, --r 오른쪽 장식이 시작하는 곳(0~1) */
.k3 { position: absolute; inset: 0; z-index: -1; display: flex; pointer-events: none; }
.k3 > i { flex: none; height: 100%; background-image: var(--img); background-repeat: no-repeat; }
.k3 > i:nth-child(1) { aspect-ratio: calc(var(--l) * var(--ar)); background-size: calc(100% / var(--l)) 100%; background-position: 0 0; }
.k3 > i:nth-child(2) { flex: 1; min-width: 0; margin: 0 -1px; background-size: calc(100% / (var(--r) - var(--l))) 100%; background-position: calc(var(--l) / (1 - var(--r) + var(--l)) * 100%) 0; }
.k3 > i:nth-child(3) { aspect-ratio: calc((1 - var(--r)) * var(--ar)); background-size: calc(100% / (1 - var(--r))) 100%; background-position: 100% 0; }
.k3.panel-now { --img: url(ui/panel-now.webp); --ar: 1.798; --l: .17; --r: .53; }
.k3.panel-past { --img: url(ui/panel-past.webp); --ar: 1.785; --l: .17; --r: .83; }
.k3.mark-moon { --img: url(ui/mark-moon.webp); --ar: 2.632; --l: .43; --r: .70; }
.k3.mark-seal { --img: url(ui/mark-seal.webp); --ar: 2.632; --l: .43; --r: .70; }
.k3.hint-strip { --img: url(ui/hint-strip.webp); --ar: 3.346; --l: .13; --r: .87; }
.k3.name-tag { --img: url(ui/name-tag.webp); --ar: 2.769; --l: .12; --r: .78; }
.k3.plaque { --img: url(ui/plaque.webp); --ar: 3.458; --l: .25; --r: .88; }
.k3.title-tag { --img: url(ui/title-tag.webp); --ar: 2.1; --l: .12; --r: .88; }
.k3.btn-pill { --img: url(ui/btn-pill.webp); --ar: 2.386; --l: .22; --r: .78; }
.k3.sign { --img: url(ui/sign.webp); --ar: 2.049; --l: .3; --r: .7; }

/* ---- 위쪽 나무 단추: 높이·자리는 공통 규칙(46px) 그대로, 모양만 나무 알약 */
.bar { gap: 6px; }
.bar .ibtn, .bar a.orak-home-button:not(.btn), .bar button.orak-tool,
.start .top .ibtn, .start .top a.orak-home-button:not(.btn), .start .top button.orak-tool {
  position: relative; isolation: isolate;
  height: 46px !important; min-height: 46px !important; border: 0 !important; border-radius: 0 !important;
  background: transparent !important; color: var(--ink-brown) !important; backdrop-filter: none; -webkit-backdrop-filter: none;
  font-family: var(--game); font-weight: 400 !important; font-size: 15px !important; text-shadow: 0 1px 0 #fff6;
  filter: drop-shadow(0 2px 3px #0008);
}
.bar .ibtn { padding: 0 14px; min-width: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
.bar a.orak-home-button:not(.btn) { padding: 0 14px 0 12px !important; }
.bar button.orak-tool { width: 52px !important; min-width: 52px !important; }
.bar button.orak-tool .orak-tool-state { font-size: 10px; }
.bar button.orak-tool.is-off { color: #6b5a4a !important; }
.bar .ibtn[aria-pressed="true"] { color: #8a2a12 !important; }
.bar .ibtn[aria-pressed="true"] .k3 { filter: sepia(.4) saturate(1.8) hue-rotate(-12deg) brightness(1.05); }
.bar .ibtn svg, .bar a.orak-home-button svg { width: 18px; height: 18px; }
.bar.tight .ibtn.list { padding: 0 12px; }

/* ---- 장면 이름: 단추 줄 아래 작은 한지 띠 */
.scene-tag { top: calc(env(safe-area-inset-top, 0px) + 64px); left: 12px; padding: 4px 14px 5px; color: var(--ink-brown); text-shadow: none;
  background: linear-gradient(#f7ead0, #ecd8b0); border-radius: 4px; box-shadow: 0 2px 8px #0007; font-size: 13px; letter-spacing: .04em; }
.scene-tag.on { opacity: .95; }

/* ---- 대사판: 한지 두루마리. 지금 장면은 맑은 한지, 옛날 장면은 바랜 세피아 */
.talk { isolation: isolate; left: 6px; right: 6px; bottom: calc(env(safe-area-inset-bottom, 0px) + 8px); min-height: 150px;
  padding: 30px 46px 28px 50px; border: 0; border-radius: 0; background: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none; filter: drop-shadow(0 6px 14px #000a); }
.talk > .k3.panel-past { display: none; }
.talk.past > .k3.panel-past { display: flex; }
.talk.past > .k3.panel-now { display: none; }
.talk .txt { color: var(--ink-brown); font-size: 18px; line-height: 1.6; min-height: 3.2em; }
.talk.narr .txt { color: var(--ink-soft); padding-top: 4px; }
.talk.has-face { padding-top: 34px; }
.talk.has-face .txt::before { width: 66px; height: 16px; }
.talk .more { right: 52px; bottom: 14px; border-top-color: #a8402a; }

/* 얼굴: 나무 둥근 액자 안 */
.talk .face { left: 14px; top: -46px; width: 82px; height: 82px; border: 0; border-radius: 50%; overflow: visible; background: none; box-shadow: none; }
.talk .face img { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); border-radius: 50%; background: #2a2440; }
.talk .face::after { content: ''; position: absolute; inset: 0; background: url(ui/face-frame.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 3px 4px #0008); pointer-events: none; }
.talk .face[class] { border-color: transparent; }

/* 이름패: 보라 나무 꼬리표(화자 색으로 물들임) */
.talk .who { isolation: isolate; top: -18px; left: 30px; height: 36px; min-width: 96px; padding: 0 30px 0 16px; display: inline-flex; align-items: center;
  background: none !important; border-radius: 0; color: #fff6e0; font-size: 16px; text-shadow: 0 1px 2px #0009; white-space: nowrap; }
.talk.has-face .who { left: 92px; }
.talk .who .k3 { filter: var(--tag, none); }
.talk .who.dosa, .talk .who.jumo, .talk .who.pat, .talk .who.neo, .talk .who.cub, .talk .who.master, .talk .who.dol, .talk .who.yeot { --tag: hue-rotate(118deg) saturate(1.25) brightness(1.15); }
.talk .who.kid, .talk .who.kong, .talk .who.yeolk, .talk .who.buk, .talk .who.hwang { --tag: hue-rotate(150deg) saturate(1.3) brightness(1.35); }
.talk .who.kkebi, .talk .who.boss, .talk .who.driver, .talk .who.wisp, .talk .who.mul { --tag: hue-rotate(-95deg) saturate(.9) brightness(1.1); }
.talk .who.halmae, .talk .who.suni, .talk .who.buni, .talk .who.halmi, .talk .who.nuna, .talk .who.yeol, .talk .who.mandu { --tag: hue-rotate(50deg) saturate(.9) brightness(1.3); }
.talk .who.oki, .talk .who.sailor, .talk .who.cloud, .talk .who.heug, .talk .who.hwal, .talk .who.yeong, .talk .who.guest, .talk .who.old, .talk .who.jang, .talk .who.sabu, .talk .who.mom { --tag: hue-rotate(-60deg) saturate(.35) brightness(1.15); }

/* ---- 선택지: 책갈피(달·부적 도장), 대사판 바로 위 */
.choices { left: 4px; right: 10px; gap: 6px; }
.choices button { position: relative; isolation: isolate; min-height: 64px; border: 0; border-radius: 0; background: none; color: var(--ink-brown);
  padding: 10px 56px 12px 74px; font-size: 18px; text-shadow: 0 1px 0 #fff8; filter: drop-shadow(0 4px 8px #0009); }
.choices button:active { transform: scale(.97); background: none; }
.choices button:active .k3 { filter: brightness(1.12); }

/* ---- 손 조작 안내: 아래 한지 띠(양끝 매듭) + 남은 개수 */
.hint { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); left: 6px; right: 6px; width: auto; max-width: none; transform: none;
  display: block; color: var(--ink-brown); text-shadow: none; font-size: 17px; transition: opacity .3s; }
.hint[class] { top: auto; }
.hint > span.strip { position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px;
  padding: 10px 48px 12px 52px; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; border-radius: 0; filter: drop-shadow(0 4px 10px #000a); }
.hint > span.strip b { font-weight: 400; text-align: center; font-size: 16px; line-height: 1.35; }
.hint > span.strip em { flex: none; font-style: normal; font-size: 15px; padding: 2px 10px; border-radius: 99px; border: 1.5px solid #b98a5a; background: #fff3dc; color: #7a2a14; }
.hint > span.strip em:empty { display: none; }
.hint .ico { position: absolute; left: 50%; bottom: calc(100% + 26vh); width: 92px; height: 92px; margin-left: -46px; border: 0; border-radius: 0; box-shadow: none;
  background: url(ui/tap-paw.webp) center / contain no-repeat; filter: drop-shadow(0 4px 8px #000a); transition: opacity .3s; }
.hint.trace .ico, .hint.flip .ico, .hint.gate .ico, .hint.grind .ico, .hint.cake .ico, .hint.pin .ico, .hint.hold .ico, .hint.strap .ico, .hint.beat .ico,
.hint.mold .ico, .hint.lid .ico, .hint.pleat .ico, .hint.flick .ico, .hint.stack .ico, .hint.key .ico, .hint.bow .ico, .hint.hang .ico { display: none; }
.stage .hint.used .ico { opacity: 0; }
.skip { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
/* 조작 쪽 개수 점은 안내 띠의 n/N으로 옮겼다 */
#over .beat-dots { display: none; }

/* 처음 한 번 뜨는 조작 안내도 한지 쪽지로 */
.tip { background: linear-gradient(#f8ecd2, #ecd7ad); color: var(--ink-brown); border: 2px solid #b98a5a; box-shadow: 0 8px 24px #000a; text-shadow: none; }
.tip span + span { border-top-color: #b98a5a66; }

/* ================================================================ 손 조작 소품: 컷 그림과 같은 손그림 */
.prop-img { position: absolute; background: center / contain no-repeat; pointer-events: none; filter: drop-shadow(0 8px 12px #000a); }
/* 손짓 소품(방울·카드·지붕 표시): 화면 위쪽 가운데에 떠서 손짓마다 흔들린다 */
.gesture-prop { position: absolute; left: 50%; top: 30%; width: 38%; max-width: 190px; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 6; }
.gesture-prop.bell { background-image: url(ui/bell.webp); transform-origin: 50% 0; }
.gesture-prop.cards { background-image: url(ui/card-back.webp); width: 30%; aspect-ratio: .62; }
.gesture-prop.cards::before, .gesture-prop.cards::after { content: ''; position: absolute; inset: 0; background: inherit; background-size: contain; transform: rotate(-12deg) translateX(-18%); z-index: -1; filter: brightness(.85); }
.gesture-prop.cards::after { transform: rotate(12deg) translateX(18%); }
.gesture-prop.roof { background-image: url(ui/roof-mark.webp); top: 26%; width: 52%; max-width: 240px; aspect-ratio: 1.92; }
.gesture-prop.go { animation: prop-swing .45s ease-out; }
@keyframes prop-swing { 0% { rotate: 0deg; } 30% { rotate: -14deg; } 65% { rotate: 10deg; } 100% { rotate: 0deg; } }
.gesture-prop.roof.go { animation: prop-hop .45s ease-out; }
@keyframes prop-hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -18%; } }
/* 효과 그림(검은 바탕) 터짐: 화면 합성 */
.burst { position: absolute; z-index: 7; width: 150px; height: 150px; margin: -75px 0 0 -75px; background: center / contain no-repeat; mix-blend-mode: screen; pointer-events: none; animation: burst .7s ease-out forwards; }
@keyframes burst { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .gesture-prop.go, .burst { animation-duration: .01s; } }

/* 문질러 닦기: 그림 속 창·유리 자리만 김이 서린다(통째로 하얀 막을 씌우지 않는다) */
#over .fog.region { background: none; }

/* 부적 그리기: 종이는 화면 아래쪽(얼굴을 가리지 않게) */

/* 안경알 갈기: 숫돌과 안경알 그림 */
.lens-grind .stone { inset: 30% 0; border-radius: 0; background: url(ui/whetstone.webp) center / contain no-repeat; box-shadow: none; transform: rotate(-24deg); }
.lens-grind .lens { inset: 24%; border: 0; border-radius: 50%; background: url(ui/lens.webp) 18% 50% / 200% auto no-repeat; box-shadow: none; filter: drop-shadow(0 4px 8px #0009) blur(.6px) contrast(.8); }
.lens-grind .lens.done { background: url(ui/lens.webp) 18% 50% / 200% auto no-repeat; filter: drop-shadow(0 0 18px #d6f2ff) brightness(1.15); }

/* 빗장: 나무 빗장 그림을 오른쪽으로 끌어 뽑는다 */
.wood-pin { height: 120px; }
.wood-pin .rod { top: 0; height: 120px; border: 0; border-radius: 0; background: url(ui/latch.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 6px 10px #000a); }
.wood-pin .hoop { display: none; }
.wood-pin .handle { left: 2%; width: 64px; height: 64px; border: 3px dashed #ffe7a6cc; border-radius: 50%; background: #ffe7a622; box-shadow: none; }

/* 우산·버스 손잡이: 길게 누르는 동그라미 안에 그림 */
.hold-umbrella { width: 156px; height: 156px; background: radial-gradient(circle, #20180fcc 55%, #20180f88 70%, transparent 72%); }
.hold-umbrella svg > g, .hold-umbrella svg > path { display: none; }
.hold-umbrella::before { content: ''; position: absolute; inset: 14%; background: url(ui/umbrella-closed.webp) center / contain no-repeat; transition: opacity .3s, transform .3s; }
.umbrella-hold.open .hold-umbrella::before { background-image: url(ui/umbrella-open.webp); inset: 4%; }
.strap-hold .hold-umbrella::before { background-image: url(ui/strap.webp); transform-origin: 50% 0; animation: strapSwing 1.1s ease-in-out infinite; }
.umbrella-hold.strap-hold.open .hold-umbrella::before { background-image: url(ui/strap.webp); animation: none; filter: drop-shadow(0 0 12px #ffe7a6); }
.hold-umbrella { position: relative; }

/* 놋방울 장단 */
.beat-bell .brass { inset: 6px; border: 0; border-radius: 0; background: url(ui/bell.webp) center / contain no-repeat; box-shadow: none; transform-origin: 50% 0; }
.beat-bell .brass::before, .beat-bell .brass::after { display: none; }
.beat-bell { width: 140px; height: 140px; }

/* 붕어빵 틀: 닫힌 무쇠 틀, 다 구우면 열려 황금 붕어빵 */
.fish-mold .mold { width: 190px; height: 210px; }
.fish-mold .iron { inset: 0; border: 0; border-radius: 0; background: url(ui/mold-closed.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 10px 14px #000a); transition: filter .25s; }
.fish-mold .iron::after, .fish-mold .fish { display: none; }
.fish-mold .mold.lit .iron { box-shadow: none; filter: drop-shadow(0 0 18px #ffc95a) drop-shadow(0 0 6px #ffc95a); }
.fish-mold .mold.done .iron { background-image: url(ui/mold-open.webp); filter: drop-shadow(0 0 16px #ffd66b); }

/* 항아리 뚜껑 */
.jar-lid .lid { left: 0; right: 0; top: -20px; height: 84px; border-radius: 0; background: url(ui/jar-lid.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 8px 10px #000a); }
.jar-lid .lid::before { display: none; }

/* 호떡: 반죽 → 노릇 */
.griddle .cake .bread { border: 0; border-radius: 50%; background: url(ui/hotteok-raw.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 5px 8px #0009); }
.griddle .cake .bread.golden { background-image: url(ui/hotteok-raw.webp); filter: drop-shadow(0 5px 8px #0009) sepia(.5) saturate(1.6) brightness(.95); }
.griddle .cake .bread.done { background: url(ui/hotteok-done.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 5px 8px #0009); }

/* 만두 주름: 만두피 그림이 주름 수에 따라 바뀐다 */
.dumpling .wrap { width: 200px; height: 200px; border-radius: 0; background: url(ui/dough-0.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 10px 14px #0009); }
.dumpling .wrap[data-stage="1"] { background-image: url(ui/dough-1.webp); }
.dumpling .wrap[data-stage="2"] { background-image: url(ui/dough-2.webp); }
.dumpling .wrap[data-stage="3"], .dumpling.done .wrap { background-image: url(ui/dough-3.webp); }
.dumpling .filling, .dumpling .fold { display: none; }
.dumpling.done .wrap { border-radius: 0; height: 200px; filter: drop-shadow(0 0 14px #fff3cf); }

/* 바둑알 튕기기 */
.flick-board .black, .flick-board .white { background: center / contain no-repeat; box-shadow: none; width: 62px; height: 62px; margin-left: -31px; }
.flick-board .black { background-image: url(ui/stone-black.webp); filter: drop-shadow(0 5px 6px #0009); }
.flick-board .white { background-image: url(ui/stone-white.webp); filter: drop-shadow(0 5px 6px #0009); }
.flick-board .white.held { box-shadow: none; filter: drop-shadow(0 0 10px #ffe7a6) drop-shadow(0 8px 10px #000a); }

/* 돌 쌓기: 담 위 홈(위에서 보이는 빈자리), 아래 돌무더기 */
.stack-wall .wall { height: 110px; padding: 0; gap: 0; background: none; box-shadow: none; align-items: stretch; }
.stack-wall .gap { top: 0; flex: 1; height: auto; border: 0; border-radius: 0; background: url(ui/wall-gap.webp) center bottom / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px #0009); }
.stack-wall .gap::after { content: ''; position: absolute; left: 22%; right: 22%; top: 4%; height: 38%; border: 3px dashed #ffe7a6cc; border-radius: 50%; }
.stack-wall .gap.near { background-color: transparent; filter: drop-shadow(0 0 10px #ffe7a6); transform: none; }
.stack-wall .gap.filled { background: url(ui/wall-gap.webp) center bottom / 100% 100% no-repeat; box-shadow: none; animation: none; }
.stack-wall .gap.filled::after { border: 0; left: 12%; right: 12%; top: -26%; height: 66%; border-radius: 0; background: url(ui/rock-1.webp) center / contain no-repeat; animation: stone-drop .25s ease-out; }
.stack-wall .gap.filled:nth-child(2)::after { background-image: url(ui/rock-2.webp); }
.stack-wall .gap.filled:nth-child(3)::after { background-image: url(ui/rock-3.webp); }
.stack-wall .stone-pile { width: 170px; height: 110px; margin-left: -85px; }
.stack-wall .stone-pile i, .stack-wall .carried { width: 70px; height: 56px; border-radius: 0; background: url(ui/rock-2.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 4px 6px #0009); }
.stack-wall .stone-pile i:nth-child(1) { left: 4px; background-image: url(ui/rock-1.webp); } .stack-wall .stone-pile i:nth-child(2) { left: 94px; } .stack-wall .stone-pile i:nth-child(3) { left: 50px; bottom: 44px; background-image: url(ui/rock-3.webp); }
.stack-wall .carried { margin: -28px 0 0 -35px; }

/* 열쇠와 자물쇠 */
.padlock .shackle { display: none; }
.padlock .body { top: 0; height: 210px; border-radius: 0; background: url(ui/padlock.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 12px 16px #000a); transition: transform .35s, filter .35s; }
.padlock.open .body { transform: translateY(-8px); filter: drop-shadow(0 0 16px #ffe7a6); }
.padlock .key { top: 150px; }
.padlock .key .shaft, .padlock .key .bow { display: none; }
.padlock .key::before { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 92px; margin: -12px 0 0 -23px; background: url(ui/key.webp) center / contain no-repeat; transform: rotate(180deg); filter: drop-shadow(0 4px 6px #000a); }
.padlock .key:not(.held)::after { content: ''; position: absolute; inset: 22px; border: 3px dashed #ffe7a6aa; border-radius: 50%; animation: stone-glow 1.4s ease-in-out infinite; }

/* 큰절: 소매 속 모은 두 손 그림 */
.bow-track .paws { width: 120px; height: 84px; margin-left: -60px; background: url(ui/bow-paws.webp) center / contain no-repeat; filter: drop-shadow(0 6px 10px #0009); }
.bow-track .paws i { display: none; }
.bow-track .rail { background: #2b1a0e99; }

/* 등불 걸기: 새끼줄 고리, 놋 등불과 방울 등 */
.hang-line .hook { width: 54px; height: 64px; margin-left: -27px; top: 0; border: 0; border-radius: 0; background: url(ui/hook-rope.webp) center / contain no-repeat; }
.hang-line .hook.near { filter: drop-shadow(0 0 10px #ffe7a6); transform: scale(1.15); }
.hang-line .hook.on { filter: drop-shadow(0 0 8px #ffe7a6); }
.hang-line .lamp { width: 76px; height: 120px; margin-left: -38px; }
.hang-line .lamp::before, .hang-line .lamp.bell::after { display: none; }
.hang-line .lamp i { inset: 0; border: 0 !important; border-radius: 0 !important; background: center / contain no-repeat !important; box-shadow: none; filter: drop-shadow(0 0 14px #ffd27a99) drop-shadow(0 8px 10px #0009); }
.hang-line .lamp.brass i { background-image: url(ui/lantern-brass.webp) !important; }
.hang-line .lamp.bell i { background-image: url(ui/lantern-round.webp) !important; }
.hang-line .lamp.lift { margin: -60px 0 0 -38px; }
.hang-line .lamp.hung { margin: 0 0 0 -38px; }
.hang-line.done .lamp i { filter: drop-shadow(0 0 30px #ffd27a) drop-shadow(0 0 60px #ffd27a88); }

/* 카드 뒷면 */
.tarot .face.back { background: url(ui/card-back.webp) center / 100% 100% no-repeat; }
.tarot .face.back svg { display: none; }

/* 별 잇기: 반짝임 그림 */
.chain-star.lit span, .chain-star.joined span { color: transparent; text-shadow: none; }
.star-chain { mix-blend-mode: screen; }
.chain-star span { width: 40px; height: 40px; color: transparent; background: url(ui/fx-sparkle.webp) center / 170% auto no-repeat; opacity: .55; }
.chain-star.lit span { opacity: 1; }
.chain-star.joined span { opacity: .9; filter: hue-rotate(-10deg) saturate(1.3); }

/* 눈 위 발자국 */
.chain-step svg { display: none; }
.chain-step::before { content: ''; position: absolute; inset: 2px; background: url(ui/pawprint.webp) center / contain no-repeat; opacity: 0; }
.chain-step.lit::before { opacity: .5; animation: step-breathe 1.4s ease-in-out infinite; filter: drop-shadow(0 0 7px #fff); }
.chain-step.joined::before { opacity: 1; animation: none; }
@media (prefers-reduced-motion: reduce) { .chain-step.lit::before { animation: none; } }

/* 안내 띠는 어느 조작이든 같은 자리(아래)·같은 폭. 옛 규칙의 가운데 정렬 이동을 끈다 */
#over .hint { left: 6px; right: 6px; top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); width: auto; max-width: none; transform: none; font-size: 17px; }
/* 소품은 얼굴을 가리지 않게 화면 아래쪽 절반(대사판 자리)에 둔다 */
#over .gesture-prop { top: 60%; }
#over .gesture-prop.roof { top: 58%; }
#over .tarot { top: 58%; width: 36%; }
#over .griddle { top: 62%; width: 58%; }
#over .lens-grind { top: 62%; width: 60%; }
#over .wood-pin { top: 64%; }
#over .fish-mold { top: 62%; }
#over .bell-beat { top: 60%; }
#over .lightgate { top: 52%; width: 40%; }
#over .dumpling { top: 62%; }
#over .padlock { top: 60%; }
#over .jar-lid { top: 40%; }

/* ================================================================ 이야기 책장 */
.panel.shelf { padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 24px); gap: 0; z-index: 8;
  background: #2a170b url(ui/shelf-wall.webp) center top / 100% auto repeat-y; }
.shelf-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: calc(env(safe-area-inset-top, 0px) + 8px) 10px 6px;
  background: linear-gradient(#1c0f07, #2b1709 70%, #2b170900); }
.shelf-x { flex: none; width: 46px; height: 46px; border: 0; padding: 0; display: grid; place-items: center; color: #5a2a14;
  background: url(ui/btn-close.webp) center / contain no-repeat; filter: drop-shadow(0 2px 3px #000a); }
.shelf-x svg { width: 20px; height: 20px; }
h1.sign { position: relative; isolation: isolate; flex: 1; height: 64px; margin: 0 52px 0 0; display: grid; place-items: center; padding: 12px 40px 6px;
  font-family: var(--game); font-weight: 400; font-size: 21px; color: var(--ink-brown); text-shadow: 0 1px 0 #fff8; filter: drop-shadow(0 3px 5px #000a); }
h1.sign span { line-height: 1.1; text-align: center; }
.season-index { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 78px); z-index: 2; display: flex; align-items: center; gap: 6px;
  margin: 0 8px; padding: 6px 10px 12px; background: url(ui/shelf-rail.webp) center bottom / 100% 26px no-repeat, linear-gradient(#3b220fee, #3b220fee) center top / 100% calc(100% - 14px) no-repeat;
  border-radius: 8px 8px 0 0; filter: drop-shadow(0 4px 6px #0009); }
.season-index .label { position: relative; isolation: isolate; height: 40px; padding: 0 16px; display: grid; place-items: center; font-family: var(--game); font-size: 16px; color: var(--ink-brown); margin-right: 4px; }
.season-index .tab { position: relative; flex: none; width: 44px; height: 44px; border: 0; padding: 0; display: grid; place-items: center;
  background: url(ui/tab-off.webp) center / contain no-repeat; font-family: var(--game); font-size: 20px; color: var(--ink-brown); filter: drop-shadow(0 2px 3px #0009); }
.season-index .tab[aria-pressed="true"] { background-image: url(ui/tab-on.webp); color: #5a2a00; }
.season-index .tab[aria-pressed="true"]::after { content: ''; position: absolute; left: 50%; bottom: -12px; width: 14px; height: 16px; margin-left: -7px; background: url(ui/ribbon.webp) center / contain no-repeat; }
.season-index .tab.locked { filter: grayscale(.6) brightness(.7) drop-shadow(0 2px 3px #0009); }
.season-index .tab .lock, .plaque-row .lock { position: absolute; right: -4px; bottom: -2px; width: 20px; height: 22px; background: url(ui/lock.webp) center / contain no-repeat; filter: drop-shadow(0 1px 2px #000); }

.season { position: relative; margin: 18px 8px 0; scroll-margin-top: 140px; }
.plaque-row { position: relative; display: flex; align-items: center; gap: 8px; min-height: 58px; padding: 0 6px 14px;
  background: url(ui/shelf-rail.webp) center bottom / 100% 24px no-repeat; }
h2.plaque { position: relative; isolation: isolate; flex: 1; min-width: 0; height: 46px; display: flex; align-items: center; padding: 0 18px 0 46px;
  font-family: var(--game); font-weight: 400; font-size: 17px; color: var(--ink-brown); filter: drop-shadow(0 3px 4px #0009); }
h2.plaque span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plaque-row .count { flex: none; font-family: var(--game); font-weight: 400; font-size: 17px; color: #ffe7b8; text-shadow: 0 1px 3px #000; }
.plaque-row .reward { position: relative; flex: none; width: 56px; height: 56px; background: center bottom / contain no-repeat; filter: grayscale(.7) brightness(.7) drop-shadow(0 3px 4px #000a); }
.plaque-row .reward.got { filter: drop-shadow(0 0 10px #ffd66b) drop-shadow(0 3px 4px #000a); }

.books { list-style: none; margin: 0; padding: 12px 4px 18px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px 6px;
  background: url(ui/shelf-board.webp) center calc(100% - 0px) / 100% 22px no-repeat; }
.books li { position: relative; }
/* 다섯 권째마다 선반 판 */
.books li:nth-child(5n+1)::before { content: ''; position: absolute; left: -4px; width: calc(500% + 24px + 8px); bottom: -14px; height: 18px; background: url(ui/shelf-board.webp) center / 100% 100% no-repeat; pointer-events: none; z-index: 0; }
.books li:nth-child(n+6):nth-last-child(-n+5)::before, .books li:nth-last-child(-n+5)::before { display: none; }
.book { position: relative; z-index: 1; display: block; width: 100%; border: 0; padding: 0; background: none; color: inherit; text-align: center; }
.book .cover { position: relative; display: block; aspect-ratio: .74; padding: 9% 9% 9% 18%; background: url(ui/book-frame.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 4px 5px #000c); }
.book .cover .story-thumb { display: block; width: 100%; height: 100%; border-radius: 2px; }
.book .cover .story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.book.current .cover { filter: drop-shadow(0 0 8px #ffd66b) drop-shadow(0 4px 5px #000c); }
.book .num { position: absolute; left: -4px; top: -6px; width: 26px; height: 26px; display: grid; place-items: center; background: url(ui/num-badge.webp) center / contain no-repeat;
  font-family: var(--game); font-size: 13px; color: var(--ink-brown); filter: drop-shadow(0 1px 2px #000a); }
.book .stamp { position: absolute; right: -4px; top: 44%; padding: 2px 6px 2px 20px; border: 2px solid #f6d2c4; border-radius: 99px; transform: rotate(-12deg);
  background: #b8261e url(ui/seal.webp) 2px center / 13px 13px no-repeat; color: #fff; font-family: var(--game); font-size: 12px; white-space: nowrap; box-shadow: 0 2px 4px #0009; }
.book .reading { position: absolute; left: 6%; right: 6%; top: 60%; padding: 2px 0; background: #b8261eee; color: #fff; font-family: var(--game); font-size: 12px; white-space: nowrap; border-radius: 3px; }
.book.open .cover::after { content: ''; position: absolute; left: 50%; bottom: -18px; width: 14px; height: 24px; margin-left: -7px; background: url(ui/ribbon.webp) center / contain no-repeat; }
.book .new { position: absolute; right: -2px; top: -4px; padding: 0 6px; border-radius: 99px; background: #ff5c7a; color: #fff; font-size: 12px; font-weight: 700; }
.book .ttl { position: relative; isolation: isolate; display: grid; place-items: center; min-height: 40px; margin-top: 6px; padding: 5px 5px 6px; }
.book .ttl b { font-family: var(--display); font-size: 12px; line-height: 1.25; color: var(--ink-brown); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
html:not([lang=ko]) .book .ttl b { word-break: normal; overflow-wrap: anywhere; }
.next-season { opacity: .75; padding-bottom: 20px; }

/* 고른 책: 아래에서 올라오는 한지 시트 */
.book-sheet { position: absolute; inset: 0; z-index: 12; }
.book-sheet .dim { position: absolute; inset: 0; background: #0009; opacity: 0; transition: opacity .25s; }
.book-sheet .sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86%; overflow-y: auto; padding: 26px 18px calc(env(safe-area-inset-bottom, 0px) + 18px);
  border-radius: 20px 20px 0 0; background: radial-gradient(ellipse at 30% 20%, #fbf2de, #f1e1bd 70%, #e8d3a6); color: var(--ink-brown);
  box-shadow: 0 -10px 30px #000a; transform: translateY(100%); transition: transform .26s ease-out; }
.book-sheet.on .dim { opacity: 1; } .book-sheet.on .sheet { transform: none; }
.book-sheet .handle { position: absolute; left: 50%; top: 8px; width: 64px; height: 18px; margin-left: -32px; border: 0; background: none; padding: 0; }
.book-sheet .handle::after { content: ''; position: absolute; left: 14px; right: 14px; top: 6px; height: 5px; border-radius: 3px; background: #b98a5a88; }
.book-sheet .deco { position: absolute; top: -6px; width: 92px; height: 80px; background: center / contain no-repeat; pointer-events: none; }
.book-sheet .deco.blossom { left: -8px; background-image: url(ui/deco-blossom.webp); }
.book-sheet .deco.bamboo { right: -6px; background-image: url(ui/deco-bamboo.webp); transform: scaleX(-1); opacity: .9; }
.sheet-top { display: grid; grid-template-columns: 40% 1fr; gap: 14px; align-items: center; margin-top: 18px; }
.big-book { position: relative; display: block; aspect-ratio: .74; padding: 9% 9% 9% 18%; background: url(ui/book-frame.webp) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 8px #0008); }
.big-book .story-thumb { display: block; width: 100%; height: 100%; }
.big-book .story-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sheet-top .info { display: grid; gap: 6px; }
.sheet-top .no { justify-self: start; padding: 2px 14px; border-radius: 99px; background: #f4c8c0; color: #7a2a14; font-family: var(--game); font-size: 18px; }
.sheet-top h2 { font-family: var(--display); font-size: 23px; line-height: 1.25; color: #3b1d0c; word-break: keep-all; padding-bottom: 8px;
  background: linear-gradient(90deg, #c0473a, #c0473a99 70%, transparent) left bottom / 90% 3px no-repeat; }
html:not([lang=ko]) .sheet-top h2 { word-break: normal; overflow-wrap: anywhere; }
.sheet-top p { font-size: 15px; line-height: 1.5; color: #4a2c18; word-break: keep-all; }
.book-sheet .chips { margin: 16px 0 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.book-sheet .chip { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 6px 10px; border-radius: 99px; border: 1.5px solid #c9a578;
  background: #fff8e8; color: var(--ink-brown); font-size: 14px; font-weight: 700; text-decoration: none; line-height: 1.25; text-align: center; }
.book-sheet .chip i { font-style: normal; }
.book-sheet .chip:only-child { grid-column: 1 / -1; }
.sheet-actions { display: grid; gap: 10px; }
.sheet-actions .btn { min-height: 54px; border-radius: 14px; }
.sheet-actions .btn.primary { background: linear-gradient(#ffd75a, #f2b532); border: 2px solid #c98a1a; color: #4a2a00; font-size: 22px; box-shadow: 0 4px 0 #b77812, 0 6px 12px #0005; }
.sheet-actions .btn:not(.primary) { background: #fff6e2; border: 2px solid #c9a578; color: var(--ink-brown); }

/* 3.0 소품 다듬기 2: 원화에 이미 있는 물건은 코드 그림 대신 자리 표시만 */
.jar-lid .jar { left: 20px; right: 20px; bottom: 30px; height: 46px; border-radius: 50%; background: radial-gradient(#ffd27a33, #0000 70%); border: 3px dashed #ffe7a6cc; box-shadow: 0 0 16px #ffd66b88; animation: stone-glow 1.4s ease-in-out infinite; }
.jar-lid .jar::before { display: none; }
.jar-lid .warm { top: 18px; }
.flick-board { background: linear-gradient(#1a0f0640, #1a0f0640); border: 2px dashed #ffe7a6aa; box-shadow: 0 0 0 1px #0004, inset 0 0 24px #0006; }
#over .bow-track { top: 47%; }
.bow-track .rail { background: #1a0f0666; }
.hint.long > span.strip b { font-size: 14.5px; line-height: 1.18; }
/* 호떡: 원화에 번철이 있으니 코드 번철 대신 은은한 열기 자리 */
.griddle { background: radial-gradient(#ffb04a2e, #0000 68%); border: 0; box-shadow: none; }
.griddle .cake { inset: 14%; }

/* 책장 머리: 기와 처마 + 휘장 + 등불(시안 m2b). 머리는 함께 올라가고, ✕와 시즌 색인만 붙어 있다 */
.shelf-xw { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 6px); z-index: 5; height: 0; }
.shelf-xw .shelf-x { position: absolute; left: 8px; top: 0; }
.shelf-head { position: relative; top: auto; z-index: 1; display: block; height: calc(min(100vw, 520px) / 2.245 * .84 + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 0 0;
  background: #1c0f07 url(ui/shelf-top.webp) center calc(env(safe-area-inset-top, 0px) + 0px) / 100% auto no-repeat; }
.shelf-head h1.sign { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 10px); width: min(64%, 280px); height: 62px; margin: 0; transform: translateX(-50%); padding: 14px 30px 4px;
  font-weight: 700; font-size: 21px; letter-spacing: .02em; }
.season-index { top: env(safe-area-inset-top, 0px); margin-top: -8px; padding-left: 62px; }
.season { scroll-margin-top: 70px; }
h2.plaque, .season-index .label, .book .ttl b { font-weight: 700; }
.shelf-xw, .shelf-head, .season-index, .season { flex: none; }
.book .stamp { right: -6px; top: 50%; padding: 1px 5px 1px 17px; font-size: 10.5px; transform: rotate(-14deg); }
.book .reading { left: auto; right: -6px; top: 50%; padding: 1px 6px; font-size: 10.5px; border: 2px solid #f6d2c4; border-radius: 99px; transform: rotate(-14deg); box-shadow: 0 2px 4px #0008; }
.shelf-head h1.sign { height: 74px; padding: 34px 30px 8px; font-size: 20px; line-height: 1; }
.shelf-head { height: calc(min(100vw, 520px) / 2.245 * .86 + env(safe-area-inset-top, 0px)); }
h2.plaque { font-size: clamp(14px, 4.3vw, 17px); padding-left: 40px; }

/* ================================================================ 시작 화면 3.0
   로고는 위(하늘 자리), 제목·소개는 한지 두루마리 위, 단추는 금빛 주 단추 + 한지 보조 단추 */
.panel.start { background: linear-gradient(rgba(5,6,14,.4), transparent 22%, transparent 48%, rgba(24,12,4,.5) 68%, rgba(24,12,4,.82)); }
.start .logo-wrap { margin: 0; line-height: 0; text-align: center; }
.start .logo-wrap .game-logo { width: auto; max-width: min(80vw, 340px); max-height: 23vh; margin: 0 auto; }
.start .logo-wrap .translated-title { font-family: var(--game); font-weight: 400; font-size: 30px; line-height: 1.2; color: #fff; text-shadow: 0 2px 10px #000, 0 0 2px #000; }
.start .title.book-title { position: relative; isolation: isolate; display: grid; align-content: center; gap: 3px; min-height: 124px; padding: 20px 80px 22px 44px; text-shadow: none; filter: drop-shadow(0 6px 10px #0009); }
.book-title .series { color: #a5402a; font-size: 15px; letter-spacing: .06em; }
.start .book-title h1 { color: var(--ink-brown); font-size: 25px; line-height: 1.2; }
.book-title p { color: #5a3a24; font-size: 14px; line-height: 1.45; max-width: none; }
.start .btn.primary { background: linear-gradient(#ffd75a, #f2b532); border: 2px solid #c98a1a; color: #4a2a00; box-shadow: 0 4px 0 #b77812, 0 6px 12px #0005; }
.start .btn:not(.primary) { background: linear-gradient(#fff6e2, #f0dfbd); border: 2px solid #c9a578; color: var(--ink-brown); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 3px 0 #a98257, 0 5px 10px #0005; }
.start .btn.ep-pick { gap: 8px; font-family: var(--game); font-weight: 400; font-size: 17px; }
.start .btn.ep-pick i:not(.shelf-ico) { color: #a5402a; font-size: 13px; }
.ep-pick .shelf-ico { flex: none; width: 22px; height: 28px; background: url(ui/book-frame.webp) center / contain no-repeat; }
.start .story-ready { color: #ffe7b8; text-shadow: 0 1px 3px #000; }
.start .next-ep { background: #1c0f07cc; border: 1px solid #c9a57866; }
@media (max-height: 700px) {
  .start .logo-wrap .game-logo { max-height: 19vh; max-width: min(64vw, 280px); }
  .start .title.book-title { min-height: 100px; padding: 14px 58px 16px 36px; }
  .start .book-title h1 { font-size: 21px; }
  .book-title p { display: none; }
}

.start .top button.orak-tool { width: 52px !important; min-width: 52px !important; }
.start .top button.orak-tool.is-off { color: #6b5a4a !important; }
.start .top a.orak-home-button:not(.btn) { padding: 0 14px 0 12px !important; display: inline-flex; align-items: center; gap: 4px; }
.start .top .chips { gap: 6px; }

/* ================================================================ 끝 화면 3.0
   숨은 컷이 위에 보이고, 한지 두루마리에 "n화 끝" + 붉은 다 읽음 도장, 작은 결과 카드 옆에 공유 */
.panel.end { background: linear-gradient(rgba(5,6,14,.3), transparent 18%, transparent 30%, rgba(24,12,4,.6) 48%, rgba(24,12,4,.9) 70%); }
.panel.end > * { flex-shrink: 0; }
.end .end-gap { height: max(8px, calc(24vh - 60px)); }
.end .top a.orak-home-button:not(.btn) { position: relative; isolation: isolate; height: 46px !important; min-height: 46px !important; border: 0 !important; border-radius: 0 !important; background: transparent !important;
  color: var(--ink-brown) !important; font-family: var(--game); font-weight: 400 !important; font-size: 15px !important; padding: 0 14px 0 12px !important; display: inline-flex; align-items: center; gap: 4px; filter: drop-shadow(0 2px 3px #0008); }
.end .end-title { min-height: 104px; padding: 16px 92px 18px 44px; }
.end .end-title h1 { font-size: 24px; }
.end-stamp { position: absolute; right: 70px; top: 50%; width: 64px; height: 64px; margin-top: -32px; display: grid; place-items: center; padding-top: 18px; box-sizing: border-box;
  background: url(ui/seal.webp) center / contain no-repeat; color: #fff; font-family: var(--game); font-size: 12px; text-shadow: 0 1px 2px #6a0d0a;
  transform: rotate(-12deg); opacity: 1; animation: end-stamp .5s .6s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes end-stamp { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: .92; } }
.season-reward { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 10px; border-radius: 14px; text-decoration: none; color: #4a2a00;
  background: linear-gradient(#fff3d0, #f3d58e); border: 2px solid #c98a1a; box-shadow: 0 0 18px #ffd66b88, 0 4px 10px #0007; animation: reward-in .6s 1s ease-out both; }
.season-reward .pic { flex: none; width: 54px; height: 54px; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px #0006); }
.season-reward .txt { display: grid; gap: 1px; min-width: 0; }
.season-reward b { font-family: var(--game); font-weight: 400; font-size: 18px; color: #a5402a; }
.season-reward small { font-size: 13px; color: var(--ink-brown); word-break: keep-all; }
.season-reward i { margin-left: auto; font-style: normal; font-size: 22px; color: #a5402a; }
@keyframes reward-in { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.share-row { display: flex; align-items: center; gap: 12px; }
.share-row .end-card { flex: none; width: 76px; max-width: none; margin: 0; border-radius: 8px; border: 2px solid #f0dfbd; box-shadow: 0 4px 10px #0008; }
.share-row .btn.primary { flex: 1; }
.end .btn.primary { min-height: 58px; background: linear-gradient(#ffd75a, #f2b532); border: 2px solid #c98a1a; color: #4a2a00; box-shadow: 0 4px 0 #b77812, 0 6px 12px #0005; }
.end .btn:not(.primary) { background: linear-gradient(#fff6e2, #f0dfbd); border: 2px solid #c9a578; color: var(--ink-brown); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 3px 0 #a98257, 0 5px 10px #0005; min-height: 48px; }
.end button.next-ep.go, .end .next-ep { background: linear-gradient(#fff6e2, #f0dfbd); border: 2px solid #c9a578; color: var(--ink-brown); }
.end button.next-ep.go small { color: #a5402a; }
.end button.next-ep.go b, .end .next-ep b { color: var(--ink-brown); }
.end button.next-ep.go i { color: #a5402a; }
.end .game-link { background: linear-gradient(#3a2412, #2a170b); border: 2px solid #c98a1a; }
.end .game-link small { color: #ffd27a; }
.end .game-link em { color: #f0dfbd; }
.end .game-link i { color: #ffd27a; }
@media (prefers-reduced-motion: reduce) { .end-stamp, .season-reward { animation: none; } }
@media (max-height: 700px) { .end .end-gap { height: 4px; } .end .end-title { min-height: 88px; } }
.title.book-title { position: relative; isolation: isolate; display: grid; align-content: center; gap: 3px; text-shadow: none; filter: drop-shadow(0 6px 10px #0009); }
.book-title h1 { color: var(--ink-brown); line-height: 1.2; }
.end .end-title { padding: 16px 64px 18px 48px; }
.end-stamp { right: 6px; top: -14px; width: auto; height: auto; margin: 0; padding: 3px 10px 3px 26px; border: 2px solid #f6d2c4; border-radius: 99px;
  background: #b8261e url(ui/seal.webp) 4px center / 18px 18px no-repeat; font-size: 15px; text-shadow: none; box-shadow: 0 3px 6px #0009; opacity: 1; }
@keyframes end-stamp { from { transform: rotate(-12deg) scale(2.4); opacity: 0; } to { transform: rotate(-12deg) scale(1); opacity: 1; } }

/* 다른 언어: 장면 이름표는 글자만큼만, 책 제목은 낱말 단위로 줄바꿈(긴 낱말은 하이픈) */
html:not([lang=ko]) .scene-tag { right: auto; max-width: calc(100% - 32px); }
html:not([lang=ko]) .book .ttl b { font-size: 11px; line-height: 1.15; word-break: normal; overflow-wrap: normal; hyphens: auto; -webkit-hyphens: auto; }
html:not([lang=ko]) .book .reading, html:not([lang=ko]) .book .stamp { font-size: 9px; max-width: 110%; overflow: hidden; text-overflow: ellipsis; }
html:not([lang=ko]) .shelf-head h1.sign span { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: clamp(13px, 4.4vw, 19px); }
html:not([lang=ko]) h2.plaque { font-size: clamp(12.5px, 3.8vw, 16px); }

/* 시안 대조 2차: 글자 굵기·크기(시안 m1·m3), 담 빈자리는 원화의 담 위에 */
.talk .txt { font-weight: 700; font-size: 18.5px; }
.choices button { font-weight: 700; font-size: 18px; }
.hint > span.strip { padding: 10px 40px 12px 44px; }
.hint > span.strip b { font-size: 18px; font-weight: 700; line-height: 1.3; }
.hint.long > span.strip b { font-size: 15.5px; line-height: 1.2; }
#over .stack-wall { top: 51%; height: 35%; }
@media (max-height: 700px) { .talk .txt { font-size: 17px; } .hint > span.strip b { font-size: 16px; } .hint.long > span.strip b { font-size: 14px; } }
/* 안내 띠: 종이 띠(그림 높이의 14~76%) 안에 글자가 들어가게 띠를 키우고 글자 중심을 띠 중심(45%)에 */
.hint > span.strip { min-height: 84px; padding: 8px 46px 22px 50px; }
#over .stack-wall { top: 55%; height: 31%; }
@media (max-height: 700px) { .hint > span.strip { min-height: 74px; padding: 6px 42px 18px 46px; } }
.stack-wall .wall { height: 96px; }
.stack-wall .gap { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent), linear-gradient(transparent, #000 10%); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }

/* 사용자 요청(2026-11-20 12:34): 시즌마다 한 줄, 좌우로 넘기고 세로 화면에 2.5권이 보이게(표지·제목을 크게) */
.books { display: flex; grid-template-columns: none; gap: 14px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-left: 16px;
  padding: 14px 16px 34px; margin: 0 -8px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  background: url(ui/shelf-board.webp) center bottom 4px / 100% 26px no-repeat; }
.books::-webkit-scrollbar { display: none; }
.books li { flex: none; width: calc((min(100vw, 520px) - 60px) / 2.5); scroll-snap-align: start; }
.books li::before, .books li:nth-child(5n+1)::before { display: none; }
.book .num { width: 36px; height: 36px; left: -6px; top: -8px; font-size: 18px; }
.book .stamp { font-size: 13px; padding: 2px 8px 2px 22px; background-size: 16px 16px; right: -8px; top: 54%; }
.book .reading { font-size: 13px; padding: 2px 8px; right: -8px; top: 54%; }
.book .new { font-size: 13px; padding: 1px 8px; }
.book.open .cover::after { width: 18px; height: 30px; margin-left: -9px; bottom: -22px; }
.book .ttl { min-height: 56px; margin-top: 10px; padding: 6px 10px 8px; }
.book .ttl b { font-size: 15px; line-height: 1.3; -webkit-line-clamp: 2; }
html:not([lang=ko]) .book .ttl b { font-size: 13px; line-height: 1.2; -webkit-line-clamp: 3; }
html:not([lang=ko]) .book .reading, html:not([lang=ko]) .book .stamp { font-size: 11px; }
.books { position: relative; }

/* ================================================================ 2차 수정 (2026-11-20 12:53 승인)
   실제 글꼴(고운바탕·주아)로 찍어 대조한 12곳. 이 블록이 앞의 같은 규칙을 덮는다. */
.k3.panel-plain { --img: url(ui/panel-plain.webp); --ar: 1.798; --l: .17; --r: .53; }
/* 1·3 대사: 굵은 먹색, 시안 m1 크기. 첫 줄 들여쓰기 대신 이름판 아래에서 같은 왼쪽 선으로 시작 */
.talk .txt { font-family: var(--display); font-weight: 700; color: #24140a; font-size: 20px; line-height: 1.55; -webkit-text-stroke: .25px #24140a; min-height: 3.1em; }
.talk.narr .txt { color: #24140a; padding-top: 6px; }
.talk.past .txt { text-shadow: 0 0 3px #f8ead0, 0 0 8px #f8ead0; }
.talk.has-face { padding-top: 46px; }
.talk.has-face .txt::before { content: none; display: none; }
/* 2 화자 이름: 꽃 장식을 뺀 판 몸통(왼쪽 0.125H ~ 오른쪽 0.485H 안쪽) 한가운데 */
.talk .who { justify-content: center; padding: 0 calc(.485 * 36px + 12px) 2px calc(.125 * 36px + 12px); font-size: 17px; }
/* 4 장면 이름표: 불투명 한지 띠 + 진한 굵은 글자 */
.scene-tag { background: linear-gradient(#fbf1dc, #efdcb6); border: 1.5px solid #a77a4c; border-radius: 6px; color: #24140a; font-family: var(--display); font-weight: 700;
  font-size: 15px; padding: 5px 14px 6px; letter-spacing: .02em; box-shadow: 0 2px 8px #0009; }
.scene-tag.on { opacity: 1; }
/* 5~7 안내 띠: 시안 m3 그림(넓은 종이, 작은 매듭). 글씨는 굵은 바탕체 먹색, 두 줄이어도 종이 안 */
.k3.hint-strip { --ar: 6.122; --l: .09; --r: .91; }
.hint > span.strip { min-height: 58px; padding: 11px 46px 11px 48px; gap: 8px; filter: drop-shadow(0 4px 8px #000b); }
.hint > span.strip b { font-family: var(--display); font-weight: 700; color: #24140a; font-size: 17.5px; line-height: 1.3; -webkit-text-stroke: .2px #24140a; }
.hint.long > span.strip b { font-size: 16px; line-height: 1.28; }
.hint > span.strip em { font-family: var(--display); font-weight: 700; font-size: 15px; padding: 1px 10px; }
/* 8 위 단추: 그림 + 글자(목록·홈·대사 보기·자동·소리) */
.bar { gap: 5px; }
.bar .ibtn, .bar a.orak-home-button:not(.btn), .bar button.orak-tool { font-size: 14.5px !important; }
.bar .ibtn { padding: 0 12px; gap: 3px; }
.bar a.orak-home-button:not(.btn) { padding: 0 12px 0 10px !important; }
.bar .ibtn svg, .bar a.orak-home-button svg { width: 17px; height: 17px; }
.bar button.orak-tool { flex-direction: row !important; width: auto !important; min-width: 0 !important; padding: 0 12px 0 10px !important; gap: 3px !important; }
.bar button.orak-tool svg { width: 18px !important; height: 18px !important; }
.bar button.orak-tool .orak-tool-state { font-size: 14.5px; font-weight: 400; max-width: none; }
.bar.snug .ibtn, .bar.snug button.orak-tool { padding: 0 9px !important; }
.bar.snug a.orak-home-button:not(.btn) { padding: 0 9px 0 8px !important; }
.bar.snug .ibtn.log > span, .bar.snug button.orak-tool .orak-tool-state { display: none !important; }
/* 9 시작 화면: 매화 없는 두루마리, '1화'는 위 테두리선 아래, 글은 매듭 사이 */
.start .title.book-title { padding: 30px 58px 26px 52px; }
.book-title .series { font-family: var(--display); font-weight: 700; font-size: 15px; color: #a5402a; }
.start .book-title h1 { font-weight: 700; color: #24140a; }
.book-title p { color: #3b2414; font-weight: 700; font-size: 14.5px; }
/* 10 시작 화면 소리·진동: 글자를 읽을 수 있게(켬/끔), '준비 끝!'은 잠깐 보였다 사라짐 */
.start .top button.orak-tool { flex-direction: row !important; width: auto !important; min-width: 0 !important; padding: 0 12px 0 10px !important; gap: 3px !important; }
.start .top button.orak-tool svg { width: 18px !important; height: 18px !important; }
.start .top button.orak-tool .orak-tool-state { font-size: 14.5px; font-weight: 400; max-width: none; }
.start .story-ready { transition: opacity .6s; }
.start .story-ready.gone { opacity: 0; }
/* 11 책장: 시즌 번호 줄 뒤도 책장 나무 벽(따로 노는 어두운 띠 없앰) */
.season-index { background: url(ui/shelf-rail.webp) center bottom / 100% 26px no-repeat, #2a170b url(ui/shelf-wall.webp) center top / 100% auto repeat-y; border-radius: 0; margin: -8px 0 0; padding-left: 70px; padding-right: 18px; }
/* 12 끝 화면: 그림 속 고양이가 보이게 판을 아래로(첫 화면에 제목판까지만) */
.end .end-gap { height: max(8px, calc(46vh - 90px)); }
.panel.end { background: linear-gradient(rgba(5,6,14,.25), transparent 14%, transparent 44%, rgba(24,12,4,.55) 58%, rgba(24,12,4,.9) 76%); }
.end .end-title { padding: 24px 56px 22px 52px; }
@media (max-height: 700px) {
  .talk .txt { font-size: 18px; }
  .talk.has-face { padding-top: 42px; }
  .hint > span.strip { min-height: 54px; padding: 9px 42px 9px 44px; }
  .hint > span.strip b { font-size: 16px; }
  .hint.long > span.strip b { font-size: 15px; }
  .end .end-gap { height: max(8px, calc(40vh - 90px)); }
  .start .title.book-title { padding: 24px 50px 20px 46px; }
}
@media (max-width: 370px) {
  .talk .txt { font-size: 18.5px; }
  .bar .ibtn, .bar a.orak-home-button:not(.btn), .bar button.orak-tool { font-size: 13.5px !important; }
}
/* 장면 이름표는 2.6초 보이고 빨리 사라진다(반쯤 흐린 상태로 오래 머물지 않게) */
.scene-tag { transition: opacity .35s; }
/* 대사 오른쪽 끝이 매듭 술에 닿지 않게, 선택지 글씨도 같은 먹색 굵은 바탕체 */
.talk { padding-right: 60px; }
.choices button { font-family: var(--display); font-weight: 700; color: #24140a; -webkit-text-stroke: .2px #24140a; }
.bar button.orak-tool.is-off, .start .top button.orak-tool.is-off { background: transparent !important; color: #6b5a4a !important; }
.hint > span.strip { width: 100%; box-sizing: border-box; }
#over .hint { display: block; }
/* 다른 언어: 긴 안내·선택지는 한 단계 작게(세 줄이 되어도 종이 안) */
html:not([lang=ko]) .hint.long > span.strip b { font-size: 14.5px; line-height: 1.22; }
html:not([lang=ko]) .hint > span.strip { padding-top: 12px; padding-bottom: 12px; }
html:not([lang=ko]) .choices button { font-size: 15.5px; line-height: 1.22; }
/* 대사 정렬(사용자 2026-11-20 13:33): 해설·대사 모두 왼쪽 정렬, 첫 줄만 한 글자 들여쓰기 */
.talk .txt, .talk.narr .txt { text-align: left; text-indent: 1em; }
.log-list li.narr p { text-align: left; }
.shelf-tail { flex: none; }
/* 숨은 컷 화면도 3.0 이야기책 틀: 매화 없는 두루마리 + 붉은 도장 띠 + 금빛 단추 */
.panel.unlock-panel { background: linear-gradient(transparent 46%, rgba(24,12,4,.55) 66%, rgba(24,12,4,.85)); }
.unlock.title.book-title { min-height: 150px; padding: 30px 56px 26px 52px; color: #24140a; filter: drop-shadow(0 6px 10px #0009); }
.unlock .badge { background: #b8261e url(ui/seal.webp) 5px center / 16px 16px no-repeat; color: #fff; padding: 3px 12px 3px 26px; border: 2px solid #f6d2c4; font-family: var(--game); font-size: 14px; box-shadow: 0 2px 4px #0007; }
.unlock h2 { font-family: var(--display); font-weight: 700; font-size: 24px; color: #24140a; margin: 2px 0 0; }
.unlock p { font-family: var(--display); font-weight: 700; font-size: 15.5px; line-height: 1.5; color: #3b2414; word-break: keep-all; margin: 0; }
.unlock-panel .btn.primary { background: linear-gradient(#ffd75a, #f2b532); border: 2px solid #c98a1a; color: #4a2a00; box-shadow: 0 4px 0 #b77812, 0 6px 12px #0005; min-height: 56px; }
@media (max-height: 700px) { .unlock.title.book-title { min-height: 120px; padding: 24px 48px 20px 46px; } .unlock h2 { font-size: 21px; } }
/* 원화 앨범·대사 다시 보기도 3.0 이야기책: 나무 벽 + 한지 카드, 먹색 글씨, 나무 ✕ 단추 */
.panel.album-panel { background: #2a170b url(ui/shelf-wall.webp) center top / 100% auto repeat-y; }
.album-panel .top b, .log-panel .top b { font-family: var(--display); font-weight: 700; color: #24140a; padding: 6px 16px; border-radius: 6px; background: linear-gradient(#fbf1dc, #efdcb6); border: 1.5px solid #a77a4c; box-shadow: 0 2px 6px #0008; }
.album-panel .top .ibtn, .log-panel .top .ibtn { width: 46px; height: 46px; min-width: 46px; border: 0; padding: 0; color: #5a2a14; background: url(ui/btn-close.webp) center / contain no-repeat; box-shadow: none; filter: drop-shadow(0 2px 3px #000a); }
.album-panel .album { gap: 10px; }
.album-panel .album button { border-radius: 4px; background: linear-gradient(#f3e3c3, #e6cfa3); border: 3px solid #8a5a32; box-shadow: 0 4px 8px #000a, inset 0 0 0 1px #f8ecd2; }
.album-panel .album .lock { color: #5a3a22; font-family: var(--display); font-weight: 700; font-size: 12px; }
.album-panel .album .lock::before { color: #a77a4c; }
.album-panel .album .hid { background: #b8261e; color: #fff; border: 1.5px solid #f6d2c4; font-family: var(--game); font-weight: 400; }
.album-panel .album .nm { background: linear-gradient(transparent, rgba(24,12,4,.85)); font-family: var(--display); font-weight: 700; }
.album-panel > p, .album-panel .note { color: #f6e9cc; text-shadow: 0 1px 3px #000; }
.log-panel { background: rgba(24, 12, 4, .9); }
.log-panel .log-list { margin: 4px 2px 16px; padding: 18px 18px 22px; gap: 12px; border-radius: 4px; background: linear-gradient(#fbf1dc, #efdcb6); border: 2px solid #a77a4c; box-shadow: 0 6px 16px #000b; }
.log-panel .log-list p { color: #24140a; font-weight: 700; text-indent: 1em; }
.log-panel .log-list li.narr p { color: #3b2414; }
.log-panel .log-list .who { box-shadow: 0 1px 2px #0005; }
.bar button.orak-tool.is-off { background: transparent !important; border-color: transparent !important; }
.album-panel .note { text-align: center; font-size: 13.5px; font-weight: 700; }
/* 위 단추 줄: 390 폭(대부분의 폰)에서도 글자가 다 보이게 여백을 줄인다 */
.bar { gap: 4px; padding-left: max(8px, env(safe-area-inset-left, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); }
.bar .ibtn { padding: 0 10px; }
.bar a.orak-home-button:not(.btn) { padding: 0 10px 0 9px !important; }
.bar button.orak-tool { padding: 0 10px 0 8px !important; }
@media (max-width: 375px) {
  .bar { gap: 3px; padding-left: 6px; padding-right: 6px; }
  .bar .ibtn { padding: 0 8px; }
  .bar a.orak-home-button:not(.btn) { padding: 0 8px 0 7px !important; }
  .bar button.orak-tool { padding: 0 8px 0 6px !important; }
  .bar .ibtn, .bar a.orak-home-button:not(.btn), .bar button.orak-tool { font-size: 13px !important; }
  .bar .ibtn svg, .bar a.orak-home-button svg, .bar button.orak-tool svg { width: 15px !important; height: 15px !important; }
}
/* 대사 양끝 정렬(사용자 2026-11-20): 오른쪽이 들쭉날쭉 비어 보이지 않게 양끝을 맞추고, 마지막 줄만 왼쪽. 오른쪽 여백은 왼쪽 매듭과 같게 */
.talk { padding-right: 50px; }
.talk .txt, .talk.narr .txt { text-align: justify; text-align-last: left; text-wrap: wrap; word-break: normal; line-break: strict; }
