/* 냥이 옛날이야기
   원화가 화면을 꽉 채우고, 아래에 대사 상자. 밤 이야기라 늘 어두운 화면을 쓴다. */
:root {
  --bg: #0f1222;
  --ink: #f4f1ea;
  --sub: #b9b6c9;
  --line: #2a2d45;
  --panel: rgba(14, 16, 32, 0.78);
  --dosa: #ff9b45;
  --sul: #b58cff;
  --gold: #ffcf6b;
  --display: "Gowun Batang", "AppleMyungjo", "Batang", serif;
  --game: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; text-wrap: balance; }
p { margin: 0; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.stage { max-width: 520px; margin: 0 auto; background: #05060c; }
.view { position: absolute; inset: 0; }
.noscript { padding: 24px; }

/* ---- 원화 층 */
.art { position: absolute; inset: 0; overflow: hidden; background: #05060c; }
#art.jolt { animation: jolt .4s ease-out; }
@keyframes jolt { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-1.5%, 1%); } 40% { transform: translate(1.5%, -1%); } 60% { transform: translate(-1%, .5%); } 80% { transform: translate(.8%, 0); } }
.art .layer { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.art .layer.on { opacity: 1; }
.art .layer.slow { transition-duration: 1.4s; }
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; will-change: transform; -webkit-user-drag: none; }
.art .ph { position: absolute; inset: 0; display: grid; place-items: center; color: #8a87a6; font-family: var(--game); font-size: 22px;
  background: radial-gradient(circle at 50% 35%, #2a2f55, #0b0d1a 70%); }
.art .ph.now { background: radial-gradient(circle at 50% 35%, #5a3d22, #160e08 70%); }
.layer.m-in img { animation: m-in 16s ease-out forwards; }
.layer.m-out img { animation: m-out 16s ease-out forwards; }
.layer.m-left img { animation: m-left 18s ease-in-out forwards; }
.layer.m-right img { animation: m-right 18s ease-in-out forwards; }
.layer.m-up img { animation: m-up 18s ease-out forwards; }
.layer.m-shake img { animation: m-shake .5s ease-out, m-in 16s .5s ease-out forwards; }
@keyframes m-in { from { transform: scale(1.03); } to { transform: scale(1.13); } }
@keyframes m-out { from { transform: scale(1.16); } to { transform: scale(1.04); } }
@keyframes m-left { from { transform: scale(1.12) translateX(2.5%); } to { transform: scale(1.12) translateX(-2.5%); } }
@keyframes m-right { from { transform: scale(1.12) translateX(-2.5%); } to { transform: scale(1.12) translateX(2.5%); } }
@keyframes m-up { from { transform: scale(1.12) translateY(3%); } to { transform: scale(1.12) translateY(-2%); } }
@keyframes m-shake { 0%, 100% { transform: scale(1.06); } 20% { transform: scale(1.06) translate(-1.5%, 1%); } 40% { transform: scale(1.06) translate(1.5%, -1%); } 60% { transform: scale(1.06) translate(-1%, .5%); } 80% { transform: scale(1.06) translate(.8%, 0); } }
/* 과거 장면으로 넘어갈 때 물결처럼 흐려졌다 맑아진다 */
.art .layer.dream { transition: opacity 1.6s ease, filter 1.6s ease; filter: blur(14px) brightness(1.6); }
.art .layer.dream.on { filter: none; }

.vignette { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 55%, rgba(0,0,0,.45) 100%), linear-gradient(to bottom, rgba(0,0,0,.35), transparent 16%, transparent 58%, rgba(5,6,14,.82) 100%); }
.candle { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: soft-light; opacity: 0; transition: opacity 1s;
  background: radial-gradient(circle at 50% 55%, rgba(255,170,80,.75), transparent 60%); }
.candle.on { opacity: 1; animation: flicker 2.6s infinite; }
@keyframes flicker { 0%, 100% { opacity: .85; } 30% { opacity: 1; } 45% { opacity: .7; } 60% { opacity: .95; } 80% { opacity: .78; } }
.flash { position: absolute; inset: 0; background: #e8f0ff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 1.1s ease-out; }
@keyframes flash { 0% { opacity: 0; } 6% { opacity: .9; } 14% { opacity: .1; } 22% { opacity: .7; } 100% { opacity: 0; } }
.blackout { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s; }
.blackout.on { opacity: 1; }
canvas.fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
canvas.fog { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; transition: opacity 1s; }

/* ---- 위쪽 막대 */
.bar { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 8px; z-index: 5; transition: opacity .3s; }
.bar .grow { flex: 1; }
.ibtn { height: 38px; min-width: 38px; padding: 0 10px; border-radius: 12px; border: 0; background: rgba(10,12,26,.55); color: #fff; display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.ibtn svg { width: 18px; height: 18px; }
.ibtn[aria-pressed="true"] { background: rgba(255,207,107,.9); color: #1a1426; }
.scene-tag { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 58px); left: 16px; z-index: 4; font-family: var(--display); font-size: 14px; color: #fff; opacity: 0; letter-spacing: .08em; text-shadow: 0 1px 6px rgba(0,0,0,.6); transition: opacity .8s; }
.scene-tag.on { opacity: .9; }
.progress { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(255,255,255,.08); z-index: 6; }
.progress i { display: block; height: 100%; background: var(--gold); width: 0; transition: width .4s; }

/* ---- 대사 상자 */
.talk { position: absolute; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); z-index: 5; min-height: 118px; padding: 16px 18px 20px; border-radius: 20px;
  background: var(--panel); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.08); box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: opacity .3s, transform .3s; }
.talk .who { position: absolute; top: -14px; left: 16px; padding: 3px 12px; border-radius: 99px; font-family: var(--game); font-size: 15px; color: #1a1426; background: #d9c8a4; }
.talk .who.pat, .talk .who.neo, .talk .who.cub, .talk .who.master { background: #e9a27a; }
.talk .who.driver { background: #8fd3a8; }
.talk .who.yeol, .talk .who.mandu { background: #f08a8e; }
.talk .who.sabu { background: #e0ae94; }
.talk .who.buni, .talk .who.halmi, .talk .who.nuna { background: #f4b6c8; }
.talk .who.oki, .talk .who.sailor { background: #b9d4f0; }
.talk .who.cloud, .talk .who.heug { background: #b9bec8; }
.talk .who.wisp { background: #8fb7e8; }
.talk .who.hwang { background: #ffcf6b; }
.talk .who.hwal { background: #b9bec8; }
.talk .who.mom { background: #b8d8a8; }
.talk .who.buk { background: #ffe08a; }
.talk .who.dol { background: #e9a27a; }
.talk .who.yeolk { background: #f2c45a; }
.talk .who.dosa { background: var(--dosa); }
.talk .who.sul { background: var(--sul); }
.talk .who.jang { background: #d9c8a4; }
.talk .who.kkebi, .talk .who.boss { background: #5fd6c8; }
.talk .who.mul { background: #8fb7e8; }
.talk .who.halmae { background: #f4b6c8; }
.talk .who.yeong { background: #b9bec8; }
.talk .who.jumo { background: #e9a27a; }
.talk .who.suni { background: #f4b6c8; }
.talk .who.old { background: #d9c8a4; }
.talk .who.guest { background: #b9bec8; }
.talk .who.kong, .talk .who.kid { background: #ffcf6b; }
.talk .who.yeot { background: #e9a27a; }
.talk .who.ttori { background: #f6a5a0; }
.talk .who.dung { background: #c9c4d6; }
.talk .who.ppal { background: #9fc8ea; }
.talk .who.alba { background: #a9b6d6; }
.talk .who.merchant { background: #8fa0d8; }
.talk .who.elder { background: #c8c2a6; }
/* 말하는 얼굴: 대사 상자 왼쪽 위 72px 동그라미, 첫 줄만 비켜 감 */
.talk .face { position: absolute; left: 10px; top: -40px; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); background: #2a2440; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.talk .face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.talk .face.dosa { border-color: var(--dosa); } .talk .face.sul { border-color: var(--sul); }
.talk .face.kkebi { border-color: #5fd6c8; } .talk .face.halmae, .talk .face.suni { border-color: #f4b6c8; }
.talk .face.jumo, .talk .face.pat, .talk .face.neo { border-color: #e9a27a; } .talk .face.driver { border-color: #8fd3a8; } .talk .face.yeol { border-color: #e2555a; } .talk .face.kong, .talk .face.kid { border-color: #ffcf6b; } .talk .face.mandu { border-color: #e2555a; } .talk .face.sabu { border-color: #c98a6a; } .talk .face.buni { border-color: #f2a3b8; } .talk .face.hwal { border-color: #b9bec8; } .talk .face.buk { border-color: #ffe08a; } .talk .face.dol { border-color: #e9a27a; } .talk .face.yeolk { border-color: #f2c45a; } .talk .face.ttori { border-color: #f6a5a0; } .talk .face.dung { border-color: #c9c4d6; } .talk .face.ppal { border-color: #9fc8ea; }
.talk.has-face .who { left: 90px; }
.talk.has-face .txt::before { content: ''; float: left; width: 70px; height: 18px; }
.talk .txt { font-family: var(--display); font-size: 19px; line-height: 1.6; word-break: keep-all; min-height: 3.2em; }
.talk.narr .txt { color: #e9e4d6; font-weight: 400; font-style: normal; text-align: center; padding-top: 6px; }
.talk .more { position: absolute; right: 16px; bottom: 8px; width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--gold); opacity: 0; }
.talk .more.on { opacity: 1; animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(4px); } }
.talk.hide, .hideui .talk, .hideui .bar, .hideui .scene-tag { opacity: 0; pointer-events: none; }

/* ---- 손으로 하는 순간, 선택 */
.hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none; text-align: center; color: #fff; font-family: var(--game); font-size: 19px; line-height: 1.4; text-shadow: 0 1px 4px rgba(0,0,0,.6); display: grid; gap: 10px; justify-items: center; width: calc(100% - 48px); max-width: 340px; word-break: keep-all; overflow-wrap: break-word; }
/* 안내 글은 밝은 그림(김 서린 창, 밤하늘 별) 위에서도 읽히게 어두운 알약 안에 둔다 */
.hint > span:not(.ico) { padding: 8px 16px; border-radius: 16px; background: rgba(8, 9, 22, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); box-shadow: 0 4px 14px rgba(0,0,0,.3); }
.hint .ico { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,.85); box-shadow: 0 0 20px rgba(255,255,255,.4); }
.hint.rub .ico { animation: rub 1.2s ease-in-out infinite; }
.hint.shake .ico { animation: down 1s ease-in infinite; }
.hint.leap .ico { animation: upward 1s ease-in infinite; }
.hint.swipe .ico { animation: side .8s ease-in-out infinite; }
.hint.ring .ico { animation: down 1s ease-in infinite; border-color: #ffcf6b; }
.hint.trace { top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 14px); transform: translateX(-50%); font-size: 17px; }
.hint.trace .ico { display: none; }
.hint.flip { top: 80%; }
.hint.flip .ico { display: none; }
.hint.gate { top: 84%; }
.hint.gate .ico { display: none; }
.hint.grind, .hint.cake { top: 78%; font-size: 18px; }
.hint.grind .ico, .hint.cake .ico { display: none; }
/* 안경알과 숫돌: 손가락이 닿는 둘레까지 스크롤을 막는다 */
.lens-grind { position: absolute; left: 50%; top: 42%; width: 68%; max-width: 300px; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 6; touch-action: none; }
.lens-grind .stone { position: absolute; inset: 23% 8%; border-radius: 18px; background: repeating-linear-gradient(165deg, #686d75 0 3px, #737984 4px 7px); box-shadow: 0 12px 0 #41454e, 0 20px 24px #0008; }
.lens-grind .lens { position: absolute; inset: 29%; border-radius: 50%; border: 3px solid #d6f2ff; background: linear-gradient(135deg, #e9faffaa, #9cc8df44 45%, #ffffff99 49%, #739eb744 55%); box-shadow: inset 0 0 18px #e0f7ff88, 0 3px 8px #0006; }
.lens-grind .lens.done { background: linear-gradient(135deg, #fff, #bdeaff 45%, #fff 50%, #d8f4ff); box-shadow: 0 0 38px #d6f2ff; }
.lens-grind .guide { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #e0f7ff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: .35; pointer-events: none; }
/* 나무 빗장과 쇠고리: 손잡이는 56px, 대사보다 위에 놓는다 */
.hint.pin { top: 62%; font-size: 18px; }
.hint.pin .ico { display: none; }
.wood-pin { position: absolute; left: 50%; top: 40%; width: 60%; max-width: 300px; height: 72px; transform: translate(-50%, -50%); z-index: 6; }
.wood-pin .rod { position: absolute; top: 16px; width: 100%; height: 40px; border: 3px solid #654022; border-radius: 9px; background: repeating-linear-gradient(3deg, #a86e39 0 6px, #98602f 7px 9px, #bb8149 10px 16px); box-shadow: inset 0 4px 5px #e9bb7d77, 0 7px 12px #0009; transition: transform .3s ease-out; }
.wood-pin .rod.dragging { transition: none; }
.wood-pin .handle { position: absolute; left: 4%; top: 50%; transform: translateY(-50%); width: 56px; height: 56px; padding: 0; border: 4px solid #5f391c; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e4b577, #a46b35 60%, #76451f); box-shadow: inset 0 2px 4px #ffe0aa88, 0 4px 7px #0008; touch-action: none; cursor: grab; }
.wood-pin .rod.dragging .handle { cursor: grabbing; }
.wood-pin .hoop { position: absolute; top: 6px; width: 22px; height: 60px; border: 4px solid #393e46; border-radius: 7px; background: linear-gradient(90deg, #707782, #b6bbc1 40%, #59616c); box-shadow: inset 2px 0 3px #e3e7eb88, 0 3px 5px #0009; pointer-events: none; }
.wood-pin .hoop.first { left: 38%; }
.wood-pin .hoop.second { left: 78%; }
.wood-pin .rod.done { animation: pin-out .42s ease-in forwards; pointer-events: none; }
@keyframes pin-out { from { transform: translateX(var(--pull)); opacity: 1; } to { transform: translateX(calc(var(--pull) + 120%)) rotate(8deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .wood-pin .rod { transition: none; }
  .wood-pin .rod.done { animation: none; opacity: 0; }
}
/* 빨간 우산: 아래쪽 가운데 버튼을 누르고 있는 동안 둘레 고리가 찬다 */
.hint.hold, .hint.strap { top: 80%; font-size: 18px; }
.hint.hold .ico, .hint.strap .ico { display: none; }
.umbrella-hold { position: absolute; left: 50%; top: 64%; transform: translate(-50%, -50%); z-index: 6; text-align: center; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hold-umbrella { display: block; width: 132px; height: 132px; padding: 0; border: 0; border-radius: 50%; background: #171b2dbb; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hold-umbrella svg { width: 100%; height: 100%; pointer-events: none; }
.hold-track, .hold-ring { fill: none; stroke-width: 4; }
.hold-track { stroke: #f9cf9733; }
.hold-ring { stroke: #ffd996; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; }
.umbrella-open, .umbrella-hold.open .umbrella-folded { display: none; }
.umbrella-hold.open .umbrella-open { display: inline; }
/* 13화 버스 손잡이: 잡기 전에는 덜컹거리며 흔들린다 */
.strap-swing { transform-origin: 60px 14px; animation: strapSwing 1.1s ease-in-out infinite; }
@keyframes strapSwing { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
@media (prefers-reduced-motion: reduce) { .strap-swing { animation: none; } }
.hold-status { display: block; position: absolute; width: 260px; left: 50%; transform: translateX(-50%); margin-top: 8px; color: #ffe3ba; font-size: 14px; }
/* 놋방울 장단: 고리가 켜질 때 한 번, 세 장단을 맞춘다 */
.hint.beat { top: 60%; font-size: 18px; }
.hint.beat .ico { display: none; }
.bell-beat { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 6; text-align: center; }
.beat-bell { position: relative; display: block; width: 112px; height: 112px; border: 0; padding: 0; background: none; touch-action: none; cursor: pointer; }
.beat-bell .brass { position: absolute; inset: 24px; border-radius: 50%; border: 3px solid #876222; background: radial-gradient(circle at 32% 25%, #fff0ad, #d5b255 40%, #9b782f 75%, #694d20); box-shadow: inset 0 2px 5px #fff4bf88, 0 5px 12px #0008; }
.beat-bell .brass::before { content: ''; position: absolute; width: 20px; height: 14px; left: 50%; top: -14px; transform: translateX(-50%); border: 4px solid #c3a04c; border-radius: 50%; }
.beat-bell .brass::after { content: ''; position: absolute; width: 26px; height: 4px; left: 50%; bottom: 13px; transform: translateX(-50%); border-radius: 50%; background: #513b1c; }
.beat-bell .halo { position: absolute; inset: 2px; border: 3px solid #ffe6a0; border-radius: 50%; box-shadow: 0 0 20px #ffd66b, inset 0 0 14px #ffd66b88; opacity: 0; pointer-events: none; }
.beat-bell.lit .halo { opacity: 1; }
.beat-bell.hit .halo { animation: beat-spread .42s ease-out forwards; }
.beat-bell.hit .brass { animation: beat-sway .4s ease-out; }
.beat-bell .number { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-size: 30px; color: #38250e; pointer-events: none; }
.beat-dots { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.beat-dots i { width: 9px; height: 9px; border: 1px solid #ffe2a0; border-radius: 50%; background: #403820; }
.beat-dots i.done { background: #ffe2a0; }
.bell-beat.reduced .number { display: flex; }
.bell-beat.reduced .halo { display: none; }
@keyframes beat-spread { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(1.55); } }
@keyframes beat-sway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(12deg); } 60% { transform: rotate(-9deg); } }
@media (prefers-reduced-motion: reduce) {
  .beat-bell.hit .halo, .beat-bell.hit .brass { animation: none; }
}
/* 철판과 호떡: 양면이 보이는 입체 뒤집기 */
.hint.mold, .hint.lid { top: 70%; font-size: 18px; }
.hint.mold .ico, .hint.lid .ico { display: none; }
/* 붕어빵 틀(11화): 무쇠 틀 하나, 빛날 때 누른다 */
.fish-mold { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 6; text-align: center; }
.fish-mold .mold { position: relative; display: block; width: 190px; height: 128px; border: 0; padding: 0; background: none; touch-action: none; cursor: pointer; perspective: 600px; }
.fish-mold .iron { position: absolute; inset: 10px 18px; border-radius: 46% / 54%; border: 5px solid #1d1f23; background: radial-gradient(ellipse at 40% 30%, #5b6068, #2c2f35 60%, #17191c); box-shadow: 0 8px 0 #101114, 0 14px 22px #000a, 0 0 0 0 #ffc95a00; transition: box-shadow .25s; }
.fish-mold .iron::after { content: ''; position: absolute; right: -40px; top: 50%; width: 44px; height: 12px; transform: translateY(-50%); border-radius: 6px; background: linear-gradient(#6b4a2b, #3e2914); box-shadow: 0 3px 4px #0008; }
.fish-mold .fish { position: absolute; left: 14%; right: 18%; top: 22%; bottom: 22%; background: radial-gradient(ellipse at 40% 35%, #f3e3bd, #d8bf8c 70%); clip-path: polygon(0 50%, 12% 18%, 38% 4%, 66% 8%, 82% 30%, 100% 6%, 96% 50%, 100% 94%, 82% 70%, 66% 92%, 38% 96%, 12% 82%); transition: background .3s; }
.fish-mold .mold.golden .fish { background: radial-gradient(ellipse at 40% 35%, #ffe7a3, #e7a43e 65%, #b06a1f); }
.fish-mold .mold.done .fish { background: radial-gradient(ellipse at 35% 30%, #fff1bf, #f2b44a 55%, #c27a24); filter: drop-shadow(0 0 10px #ffd66b); }
.fish-mold .mold.lit .iron { box-shadow: 0 8px 0 #101114, 0 14px 22px #000a, 0 0 26px 8px #ffc95acc; border-color: #b9842e; }
.fish-mold .mold.turn .iron { animation: mold-turn .5s ease-in-out; }
.fish-mold .smoke { position: absolute; left: 50%; top: 10px; width: 60px; height: 60px; margin-left: -30px; border-radius: 50%; background: radial-gradient(#cfd3d8cc, #cfd3d800 70%); opacity: 0; pointer-events: none; }
.fish-mold .smoke.puff { animation: mold-smoke .8s ease-out; }
.fish-mold.reduced .mold .iron { border-color: #b9842e; }
@keyframes mold-turn { 0%, 100% { transform: rotateX(0); } 50% { transform: rotateX(180deg); } }
@keyframes mold-smoke { 0% { opacity: .9; transform: translateY(0) scale(.6); } 100% { opacity: 0; transform: translateY(-50px) scale(1.5); } }
@media (prefers-reduced-motion: reduce) {
  .fish-mold .mold.turn .iron, .fish-mold .smoke.puff { animation: none; }
}
/* 항아리 뚜껑(12화): 뚜껑을 아래로 살살 끌어 덮는다 */
.jar-lid { position: absolute; left: 50%; top: 22%; width: 180px; height: 260px; transform: translateX(-50%); z-index: 6; }
.jar-lid .jar { position: absolute; left: 10px; right: 10px; bottom: 0; height: 150px; border-radius: 42% 42% 30% 30% / 30% 30% 22% 22%; background: radial-gradient(ellipse at 35% 30%, #a2643a, #6e3d1f 60%, #43230f); box-shadow: inset 0 -10px 18px #0006, 0 10px 18px #0009; }
.jar-lid .jar::before { content: ''; position: absolute; left: 22%; right: 22%; top: -10px; height: 22px; border-radius: 50%; background: radial-gradient(#140a04, #2d1709 70%); box-shadow: 0 0 0 5px #7a4523; }
.jar-lid .warm { position: absolute; left: 24%; right: 24%; top: -14px; height: 26px; border-radius: 50%; background: radial-gradient(#ffd27a, #ff9d3a88 50%, transparent 72%); opacity: 0; transition: opacity .6s; }
.jar-lid.done .warm { opacity: 1; animation: jar-warm 1.6s ease-in-out infinite; }
.jar-lid .lid { position: absolute; left: 18px; right: 18px; top: 0; height: 46px; padding: 0; border: 0; border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%; background: radial-gradient(ellipse at 40% 25%, #b4744a, #7b4423 60%, #4c2810); box-shadow: inset 0 3px 5px #e8b38a66, 0 6px 10px #0009; touch-action: none; cursor: grab; transition: transform .35s ease-out; }
.jar-lid .lid::before { content: ''; position: absolute; left: 50%; top: -12px; width: 28px; height: 16px; transform: translateX(-50%); border-radius: 50% 50% 30% 30%; background: #6a3a1c; box-shadow: inset 0 2px 3px #e8b38a55; }
.jar-lid .lid.dragging { transition: none; cursor: grabbing; }
.jar-lid .lid.jolt { animation: lid-jolt .4s ease-out; }
@keyframes lid-jolt { 0%, 100% { margin-left: 0; } 25% { margin-left: -8px; } 50% { margin-left: 7px; } 75% { margin-left: -4px; } }
@keyframes jar-warm { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .jar-lid .lid { transition: none; }
  .jar-lid .lid.jolt, .jar-lid.done .warm { animation: none; }
}
.griddle { position: absolute; left: 50%; top: 42%; width: 72%; max-width: 320px; aspect-ratio: 1; transform: translate(-50%, -50%); z-index: 6; border-radius: 50%; background: radial-gradient(ellipse at 40% 30%, #59616a, #24272c 60%, #131519); border: 7px solid #6b6f74; box-shadow: 0 12px 0 #15171b, 0 18px 28px #0009; }
.griddle .cake { position: absolute; inset: 18%; border: 0; padding: 0; background: none; perspective: 650px; touch-action: none; }
.griddle .cake .bread { position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(ellipse at 35% 30%, #ffe5a1, #edb44e 65%, #b77b25); border: 3px solid #ce9137; box-shadow: inset 0 0 14px #a8622477, 0 5px 8px #0009; }
.griddle .cake .bread.golden { background: radial-gradient(ellipse at 35% 30%, #ffdc8a, #d69332 65%, #a65c21); }
.griddle .cake .bread.done { background: radial-gradient(ellipse at 32% 25%, #fff1bfaa, transparent 24%), radial-gradient(ellipse at 65% 60%, #693312 4%, transparent 40%), radial-gradient(ellipse at 40% 35%, #e9b45b, #ac5e22 65%, #6e3314); box-shadow: inset 0 0 18px #68300e88, inset 4px 4px 8px #ffdc8a99, 0 5px 8px #0009; }
.griddle .cake .bread.turn { animation: cake-turn .65s ease-in-out; }
.steam { position: absolute; left: 44%; top: 12%; width: 12%; height: 18%; border-radius: 50%; background: #fff9; filter: blur(7px); opacity: 0; pointer-events: none; }
.steam::before, .steam::after { content: ''; position: absolute; width: 80%; height: 90%; border-radius: 50%; background: #fff8; left: -90%; top: 20%; }
.steam::after { left: 110%; top: 10%; }
.steam.go { animation: cake-steam 1s ease-out forwards; }
@keyframes cake-turn { 0% { transform: rotateX(0) translateY(0); } 50% { transform: rotateX(180deg) translateY(-18px); } 100% { transform: rotateX(360deg) translateY(0); } }
@keyframes cake-steam { 0% { opacity: 0; transform: translateY(0) scale(.6); } 25% { opacity: .8; } 100% { opacity: 0; transform: translateY(-65px) scale(1.5); } }
@media (prefers-reduced-motion: reduce) {
  .griddle .cake .bread.turn { animation: none; }
  .steam.go { animation: none; opacity: .5; }
}
.lightgate { position: absolute; left: 50%; top: 42%; width: 44%; aspect-ratio: 3 / 5; transform: translate(-50%, -50%); z-index: 6; border: 3px solid #ffd77a; border-radius: 48% 48% 8px 8px / 30% 30% 8px 8px; background: radial-gradient(ellipse at 50% 60%, rgba(255,240,190,.75), rgba(255,190,80,.35) 55%, rgba(255,160,60,.1)); box-shadow: 0 0 40px rgba(255,207,107,.7), inset 0 0 30px rgba(255,230,160,.6); color: #5a2a00; font-family: var(--game); display: grid; place-content: center; gap: 2px; animation: float 2.4s ease-in-out infinite; }
.lightgate b { font-size: 46px; line-height: 1; text-shadow: 0 0 12px #fff; }
.lightgate i { font-style: normal; font-size: 17px; }
.lightgate .glow { position: absolute; inset: -14%; border-radius: inherit; border: 2px solid rgba(255,215,120,.5); animation: pulse 1.4s ease-in-out infinite; pointer-events: none; }
.lightgate.hit b { animation: pop .35s ease-out; }
.lightgate.done { box-shadow: 0 0 80px rgba(255,220,130,1), inset 0 0 60px rgba(255,240,190,.9); }
.times { position: absolute; top: 30%; z-index: 7; pointer-events: none; font-family: var(--game); font-size: 30px; color: #fff3c4; text-shadow: 0 0 10px #ff9f2e, 0 2px 6px rgba(0,0,0,.6); animation: up .9s ease-out forwards; }
@keyframes pop { 40% { transform: scale(1.35); } }
@keyframes up { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-60px); } }
@keyframes rub { 0%, 100% { transform: translate(-30px, -8px); } 50% { transform: translate(30px, 8px); } }
@keyframes down { from { transform: translateY(-30px); opacity: 1; } to { transform: translateY(40px); opacity: 0; } }
@keyframes side { 0%, 100% { transform: translateX(-40px); } 50% { transform: translateX(40px); } }
@keyframes upward { from { transform: translateY(40px); opacity: 1; } to { transform: translateY(-30px); opacity: 0; } }
@keyframes pulse { 50% { transform: scale(.85); } }
.skip { position: absolute; right: 14px; bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); z-index: 7; }
.tarot { position: absolute; left: 50%; top: 44%; width: 46%; aspect-ratio: 100 / 172; transform: translate(-50%, -50%); z-index: 6; perspective: 900px; border: 0; padding: 0; background: none; animation: float 2.4s ease-in-out infinite; }
.tarot .in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .9s cubic-bezier(.3,1.4,.5,1); }
.tarot.flipped .in { transform: rotateY(180deg); }
.tarot .face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 10px; overflow: hidden; box-shadow: 0 0 40px rgba(255,207,107,.55); }
.tarot .face img, .tarot .face svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.tarot .front { transform: rotateY(180deg); }
@keyframes float { 50% { transform: translate(-50%, -53%); } }
.choices { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 150px); z-index: 7; display: grid; gap: 10px; }
.choices button { min-height: 56px; border-radius: 16px; border: 1px solid rgba(255,207,107,.5); background: rgba(16,14,34,.86); color: #fff; font-family: var(--display); font-size: 18px; font-weight: 700; padding: 10px 16px; animation: rise .35s ease-out backwards; }
.choices button:nth-child(2) { animation-delay: .12s; }
.choices button:active { transform: scale(.97); background: rgba(255,207,107,.25); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---- 시작, 끝, 앨범 화면 */
.panel { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px calc(env(safe-area-inset-bottom, 0px) + 18px); gap: 12px; }
.panel.scrollable { overflow-y: auto; }
/* 시작 화면: 밝은 원화 위에서도 제목과 소개 글이 읽히게 아래쪽을 어둡게 */
.panel.start { background: linear-gradient(rgba(5,6,14,.25), transparent 22%, transparent 40%, rgba(5,6,14,.82) 72%, rgba(5,6,14,.92)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.logo { font-family: var(--game); font-size: 18px; color: #fff; text-decoration: none; letter-spacing: .04em; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.logo b { color: #ff4867; font-weight: 400; }
.spacer { flex: 1; min-height: 0; }
.title { text-align: center; display: grid; gap: 8px; text-shadow: 0 2px 14px rgba(0,0,0,.75); }
.title .series { font-family: var(--game); color: var(--gold); font-size: 17px; letter-spacing: .1em; }
.title h1 { font-size: 38px; line-height: 1.15; color: #fff; word-break: keep-all; }
.title p { color: #e7e2f4; font-size: 15px; max-width: 30ch; margin: 0 auto; word-break: keep-all; }
.title.ink h1 { animation: ink 2.2s ease-out both; }
.title.ink .series { animation: ink 1.6s .3s ease-out both; }
.title.ink p { animation: ink 1.6s .9s ease-out both; }
@keyframes ink { from { opacity: 0; filter: blur(10px); letter-spacing: .3em; } to { opacity: 1; filter: none; } }
.actions { display: grid; gap: 10px; }
.btn { min-height: 54px; border-radius: 16px; border: 0; padding: 10px 16px; font-size: 16px; font-weight: 700; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; display: grid; place-items: center; text-align: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--gold); color: #24180a; font-family: var(--game); font-weight: 400; font-size: 21px; }
.btn small { display: block; font-family: var(--body); font-size: 12px; font-weight: 400; opacity: .8; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.chip { padding: 6px 12px; border-radius: 99px; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 13px; font-weight: 700; }
.chip[aria-pressed="false"] { opacity: .6; }
.next-ep { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: rgba(0,0,0,.35); font-size: 13px; color: var(--sub); }
.next-ep b { color: #fff; font-family: var(--display); }

.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.album button { position: relative; aspect-ratio: 2 / 3; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: #1b1d33; }
.album img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album .lock { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; font-size: 11px; color: var(--sub); line-height: 1.35; word-break: keep-all; text-align: center; }
.album .lock::before { content: '?'; display: block; font-family: var(--game); font-size: 28px; color: #4b4e72; }
.album .hid { position: absolute; top: 4px; right: 4px; padding: 1px 6px; border-radius: 99px; background: var(--sul); color: #1a1426; font-size: 10px; font-weight: 700; }
.album .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 5px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.viewer { position: absolute; inset: 0; z-index: 9; background: #000; display: grid; place-items: center; }
.viewer img { max-width: 100%; max-height: 100%; }
.viewer .cap { position: absolute; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom, 0px) + 18px); text-align: center; font-family: var(--display); font-size: 16px; color: #fff; text-shadow: 0 1px 8px #000; }

.end-card { width: 72%; max-width: 300px; margin: 0 auto; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.6); display: block; }
.unlock { text-align: center; font-family: var(--display); color: #fff; display: grid; gap: 8px; }
.unlock .badge { justify-self: center; padding: 4px 12px; border-radius: 99px; background: var(--sul); color: #1a1426; font-family: var(--game); font-size: 14px; }
.toast { position: absolute; left: 50%; bottom: 30%; transform: translateX(-50%); z-index: 20; padding: 10px 16px; border-radius: 12px; background: rgba(0,0,0,.8); color: #fff; font-size: 14px; animation: rise .25s; }

/* ---- 아래 설명 글 */
.guide { max-width: 520px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 28px; }
.guide section { display: flex; flex-direction: column; gap: 10px; }
.guide h2 { font-size: 24px; }
.guide p, .guide li { font-size: 15px; color: var(--ink); max-width: 65ch; }
.guide ul, .guide ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.guide a { color: var(--gold); }
.log { font-size: 14px; }
.site-foot { border-top: 1px solid var(--line); padding-top: 16px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.site-foot a { color: var(--sub); }

/* 화 고르기 */
.ep-pick { align-self: flex-start; min-height: 36px; padding: 4px 12px 4px 10px; border-radius: 99px; border: 1px solid rgba(255,255,255,.35); background: rgba(0,0,0,.4); color: #fff; font-family: var(--game); font-size: 15px; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ep-pick svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ep-pick i { font-style: normal; font-size: 12px; color: #ffcf6b; }
.season { margin: 4px 2px 0; font-family: var(--game); color: #ffcf6b; font-size: 15px; }
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ep-list button { width: 100%; display: grid; grid-template-columns: 56px 1fr auto; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 8px 12px 8px 8px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: #fff; }
.ep-list button[aria-current="true"] { border-color: #ffcf6b; background: rgba(255,207,107,.12); }
.ep-list img { grid-row: 1 / 3; width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: #1b1d33; }
.ep-list .no { grid-column: 2; font-size: 12px; color: var(--sub); }
.ep-list b { grid-column: 2; font-family: var(--display); font-size: 16px; font-weight: 600; word-break: keep-all; }
.ep-list i { grid-column: 3; grid-row: 1 / 3; font-style: normal; font-size: 11px; color: var(--sub); white-space: nowrap; }
.ep-list i.done { color: #9fe0b5; }
.ep-list i.new { padding: 1px 6px; border-radius: 99px; background: #ff5c7a; color: #fff; font-weight: 700; }
button.next-ep { width: 100%; border: 1px solid rgba(255,207,107,.45); color: var(--sub); text-align: left; cursor: pointer; }
button.next-ep i { margin-left: auto; font-style: normal; color: #ffcf6b; font-size: 20px; }
/* 이야기와 이어지는 게임 */
.game-link { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(95,214,200,.28), rgba(40,30,90,.6)); border: 1px solid rgba(95,214,200,.55); color: #fff; text-decoration: none; }
.game-link span { display: grid; gap: 2px; }
.game-link small { font-size: 12px; color: #9ff0e4; }
.game-link b { font-family: var(--display); font-size: 18px; }
.game-link em { font-style: normal; font-size: 13px; color: var(--sub); word-break: keep-all; }
.game-link i { margin-left: auto; font-style: normal; font-size: 22px; color: #9ff0e4; }

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

/* 별 잇기: 그림 위 가운데 위쪽에 국자 별자리 */
.star-chain { position: absolute; left: 20%; top: 12%; width: 60%; height: 32%; z-index: 6; pointer-events: none; }
.star-chain svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.star-chain line { stroke: #ffcf6b; stroke-width: 2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px #ffcf6b); }
.chain-star { position: absolute; width: 44px; height: 44px; transform: translate(-50%, -50%); display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #c9c6b7; font-size: 25px; pointer-events: auto; touch-action: none; }
.chain-star.lit { color: #fff4c5; text-shadow: 0 0 14px #ffcf6b; }
.chain-star span { display: block; }
.chain-star.lit span { animation: star-twinkle 1.1s ease-in-out infinite; }
.chain-star.joined { color: #ffcf6b; text-shadow: 0 0 8px #ffcf6b; }
.chain-star:focus-visible { outline: 2px solid #fff4c5; outline-offset: 2px; }
.chain-star .number { position: absolute; top: 32px; font: 18px var(--game); color: #fff4c5; }
.star-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.star-chain.complete { animation: constellation-flash .75s ease-out forwards; }
.star-chain.reduced .chain-star span { animation: none; }
.star-chain.reduced.complete { animation: none; opacity: .7; }
@keyframes star-twinkle { 50% { transform: scale(1.5); text-shadow: 0 0 22px #ffe6a0; } }
@keyframes constellation-flash { 35% { filter: brightness(2) drop-shadow(0 0 12px #ffe6a0); opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .chain-star.lit span, .star-chain.complete { animation: none; }
}

/* 첫눈 골목: 현재 자리만 빛나고, 누른 자리에는 고양이 발자국이 남는다. */
.step-chain { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.chain-step { position: absolute; width: 56px; height: 64px; padding: 4px; border: 0; border-radius: 50%; background: transparent; transform: translate(-50%, -50%); pointer-events: auto; touch-action: none; }
.chain-step svg { width: 100%; height: 100%; fill: #fff; opacity: 0; }
.chain-step.lit svg { opacity: .35; animation: step-breathe 1.4s ease-in-out infinite; filter: drop-shadow(0 0 7px #fff); }
.chain-step.joined svg { opacity: .65; }
.chain-step:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.chain-step .number { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 4px #25364d; }
.step-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.step-chain.reduced .chain-step svg { animation: none; }
@keyframes step-breathe { 50% { opacity: .65; } }
@media (prefers-reduced-motion: reduce) { .chain-step.lit svg { animation: none; } }
.ep-top { position: sticky; top: calc(-14px - env(safe-area-inset-top, 0px)); z-index: 1; margin: calc(-14px - env(safe-area-inset-top, 0px)) -18px 0; padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 8px; background: rgba(5,6,14,.96); }

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

.ep-top h1{flex:1;min-width:0}.ep-top .game-logo{width:100%;max-width:300px}.start .title h2{margin:0 0 8px}.start .title h1{font-size:26px}
.ep-top{flex-wrap:wrap}.ep-top h1{flex:0 0 100%;order:1}.ep-top .game-logo{max-width:400px}

/* 모션 감소에서도 컷을 따라 아주 천천히 옆으로 흐른다. 크기는 고정한다. */
.layer.m-gentle img{inset:0 auto 0 -1.5%;width:103%;animation:m-gentle var(--pan-duration,18s) ease-in-out forwards;animation-duration:var(--pan-duration,18s)!important}
@keyframes m-gentle{from{transform:translateX(-1.25%)}to{transform:translateX(1.25%)}}

/* 그림만 보는 중에도 홈 경로를 유지한다. 기존 bar 줄이므로 체험 조작과 겹치지 않는다. */
.hideui .bar { opacity: 1; pointer-events: auto; }

/* 번역은 언어별 글꼴로 읽고, 긴 제목·힌트·단어도 휴대폰 폭 안에서 줄바꿈한다. */
html:not([lang=ko]) {
  --display: var(--orak-font);
  --game: var(--orak-font);
  --body: var(--orak-font);
}
html:not([lang=ko]) :is(.title h1, .title p, .talk .txt, .ep-list b, .next-ep, .hint, .viewer .cap) { word-break: normal; overflow-wrap: anywhere; }
html:not([lang=ko]) .panel.start { overflow-y: auto; }
html:not([lang=ko]) .ep-list button { grid-template-columns: 56px minmax(0, 1fr) auto; }
html:not([lang=ko]) .next-ep > * { min-width: 0; }
html:not([lang=ko]) .toast { width: max-content; max-width: calc(100% - 32px); overflow-wrap: anywhere; }
html:not([lang=ko]) .scene-tag { right: 16px; overflow-wrap: anywhere; }
.translated-title { display: none; }
html:not([lang=ko]) .game-logo:not([data-l10n="ok"]) { display: none; }
html:not([lang=ko]) .game-logo[data-l10n="ok"] ~ .translated-title { display: none; }
html:not([lang=ko]) .translated-title { display: block; font: 700 clamp(24px, 7vw, 36px)/1.2 var(--display); overflow-wrap: anywhere; color: var(--gold); }

/* ---- 2026-10-30 시즌 1 손질 */
/* 한국어만 단어 단위로 줄을 바꾼다. 일본어·중국어·태국어는 글자 사이에서 바꿔야 화면 밖으로 넘치지 않는다 */
html:is([lang=zh-TW], [lang=th]) .stage * { word-break: normal !important; line-break: strict; }
html[lang=ja] .stage * { word-break: auto-phrase !important; line-break: strict; }
.stage * { overflow-wrap: break-word; }
/* 우산 길게 누르기: 보이는 안내는 하나만, 진행 상태는 화면 읽기 프로그램에만 */
.hold-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
/* 위쪽 막대: 목록으로, 대사 다시 보기, 자동 빠르기 */
.ibtn { height: 44px; min-width: 44px; }
.ibtn.list { gap: 2px; grid-auto-flow: column; padding: 0 12px 0 8px; font-size: 14px; }
.ibtn.auto { min-width: 52px; }
/* 처음 재생할 때 한 번 뜨는 조작 안내 */
.tip { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 7; display: grid; gap: 8px; width: calc(100% - 64px); max-width: 300px; padding: 16px 18px; border-radius: 18px; background: rgba(8, 9, 22, .84); color: #fff; font-size: 15px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: opacity .4s; animation: rise .35s ease-out; }
.tip span + span { padding-top: 8px; border-top: 1px solid rgba(255,255,255,.12); }
.tip.off { opacity: 0; }
/* 대사 다시 보기 */
.log-panel { z-index: 9; background: rgba(5, 6, 14, .95); }
.log-panel .top b { font-family: var(--display); }
.log-list { list-style: none; margin: 0; padding: 0 2px 12px; display: grid; gap: 14px; }
.log-list li { display: grid; gap: 4px; }
.log-list li.narr p { color: #cfcadb; text-align: center; }
.log-list p { font-family: var(--display); font-size: 17px; line-height: 1.6; word-break: keep-all; }
.log-list .who { justify-self: start; padding: 1px 10px; border-radius: 99px; font-family: var(--game); font-weight: 400; font-size: 13px; color: #1a1426; background: #d9c8a4; }
.log-list .who.dosa { background: var(--dosa); } .log-list .who.sul { background: var(--sul); }
.log-list .who.kid, .log-list .who.kong { background: #ffcf6b; } .log-list .who.kkebi, .log-list .who.boss { background: #5fd6c8; }
.log-list .who.halmae, .log-list .who.suni { background: #f4b6c8; } .log-list .who.jumo, .log-list .who.yeot { background: #e9a27a; }
/* 시작 화면: 다른 화 고르기는 버튼 줄로 */
.btn.ep-pick { align-self: auto; margin: 0; min-height: 48px; border-radius: 16px; border: 0; background: rgba(255,255,255,.12); font-family: var(--body); font-size: 15px; font-weight: 700; display: inline-flex; justify-content: center; }
.row2.one { grid-template-columns: 1fr; }
/* 시작 화면이 낮으면(긴 소개 글, 가로 화면) 로고를 줄이고, 그래도 넘치면 화면 안에서 내린다 */
.panel.start { overflow-y: auto; }
.panel.start > * { flex-shrink: 0; }
.start .title .game-logo { width: auto; max-width: min(90vw, 400px); max-height: 26vh; }
/* 회차 목록: 큰 로고 대신 작은 제목 줄, 시즌 탭 */
.ep-top h1 { flex: 1; order: 0; font-size: 18px; line-height: 1.3; text-align: center; color: var(--gold); }
.ep-top { flex-wrap: wrap; row-gap: 10px; }
.season-tabs { flex: 0 0 100%; order: 2; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.06); }
.season-tabs button { min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--sub); font-family: var(--game); font-size: 16px; }
.season-tabs button[aria-selected="true"] { background: rgba(255,207,107,.9); color: #1a1426; }
.ep-list .alb { grid-column: 3; grid-row: 2; justify-self: end; font-size: 11px; color: var(--sub); }
.ep-list i { grid-row: 1; }
/* 끝 화면: 다음 이야기를 표지가 있는 카드로 */
button.next-ep.go { padding: 8px 14px 8px 8px; gap: 12px; background: rgba(255,207,107,.12); }
button.next-ep.go img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex: none; }
button.next-ep.go span { display: grid; gap: 2px; text-align: left; }
button.next-ep.go small { font-size: 12px; color: var(--gold); }
button.next-ep.go b { font-size: 16px; word-break: keep-all; }
/* 가로 화면(높이가 낮은 폰) */
@media (orientation: landscape) and (max-height: 500px) {
  .start .title .game-logo { max-height: 22vh; }
  .title h1 { font-size: 24px; }
  .title p { display: none; }
  .talk { min-height: 84px; padding: 10px 16px 14px; }
  .talk .txt { font-size: 17px; min-height: 2.4em; }
  .choices { bottom: 110px; }
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.bar > * { flex-shrink: 0; }
.bar .ibtn { white-space: nowrap; }
/* 긴 언어에서 막대가 넘치면 홈 단추도 집 그림만 */
.bar.tight .orak-home-button span { display: none !important; }
.bar.tight .orak-home-button { padding: 0 !important; width: 46px !important; }
/* 긴 언어에서 막대가 넘치면 목록 단추는 화살표만 */
.bar.tight .ibtn.list span { display: none; }
.bar.tight .ibtn.list { padding: 0 10px; }
/* 만두 주름(15화): 동그란 만두피, 누를 때마다 가장자리에 주름 하나 */
.hint.pleat, .hint.flick { top: 74%; font-size: 18px; }
.hint.pleat .ico, .hint.flick .ico { display: none; }
.dumpling { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); z-index: 6; text-align: center; }
.dumpling .wrap { position: relative; display: block; width: 168px; height: 168px; border: 0; padding: 0; border-radius: 50%; touch-action: none; cursor: pointer; background: radial-gradient(circle at 40% 35%, #fffaf0, #f3e7cf 62%, #e2d1ae); box-shadow: 0 10px 22px #0009, inset 0 -6px 12px #c9b48a66; transition: border-radius .5s, height .5s, transform .5s; }
.dumpling .filling { position: absolute; left: 50%; top: 50%; width: 64px; height: 52px; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 40% 40%, #c66a4a, #8d4f37 55%, #6b8f4e); opacity: .9; transition: opacity .4s; }
.dumpling .fold { position: absolute; left: 50%; top: 50%; width: 14px; height: 30px; margin: -15px 0 0 -7px; border-radius: 7px; background: linear-gradient(#fffdf6, #e6d6b4); box-shadow: 0 1px 3px #8a734a88; transform: rotate(var(--a)) translateY(-74px) scale(.3); opacity: 0; transition: transform .25s, opacity .25s; }
.dumpling .fold.on { opacity: 1; transform: rotate(var(--a)) translateY(-70px); }
.dumpling .wrap.squish { animation: squish .25s ease-out; }
.dumpling.done .wrap { border-radius: 50% 50% 46% 46% / 70% 70% 30% 30%; height: 120px; filter: drop-shadow(0 0 10px #fff3cf); }
.dumpling.done .filling { opacity: 0; }
.dumpling .beat-dots { margin-top: 14px; }
@keyframes squish { 50% { transform: scale(.95, 1.04); } }
/* 알 튕기기(16화): 아래 흰 알을 위로 밀어 위쪽 검은 알을 맞힌다 */
.flick-board { position: absolute; left: 50%; top: 18%; width: 200px; height: 46%; transform: translateX(-50%); z-index: 6; border-radius: 14px; background: repeating-linear-gradient(0deg, #0000 0 39px, #5b3a1a66 39px 41px), repeating-linear-gradient(90deg, #0000 0 39px, #5b3a1a66 39px 41px), linear-gradient(#e2b56f, #c7924c); box-shadow: 0 12px 26px #000a, inset 0 0 0 6px #a7743b; }
.flick-board .stone { position: absolute; left: 50%; width: 54px; height: 54px; margin-left: -27px; border-radius: 50%; border: 0; padding: 0; }
.flick-board .black { top: 12%; background: radial-gradient(circle at 35% 30%, #6d717a, #1b1c20 55%, #050506); box-shadow: 0 5px 8px #0008; transition: transform .45s cubic-bezier(.2,.8,.3,1), opacity .45s; }
.flick-board .white { bottom: 8%; touch-action: none; cursor: grab; background: radial-gradient(circle at 35% 30%, #fff, #eceae4 55%, #bdb9b0); box-shadow: 0 5px 8px #0008, 0 0 0 4px #ffffff55; animation: stone-glow 1.4s ease-in-out infinite; }
.flick-board .white.held { cursor: grabbing; animation: none; box-shadow: 0 8px 14px #000a, 0 0 0 6px #ffe7a6aa; }
.flick-board .white.wobble { animation: stone-wobble .35s; }
.flick-board.hit .black { transform: translate(70px, -120px) rotate(40deg); opacity: 0; }
@keyframes stone-glow { 50% { box-shadow: 0 5px 8px #0008, 0 0 0 9px #ffffff22; } }
@keyframes stone-wobble { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) {
  .dumpling .wrap.squish, .flick-board .white, .flick-board .white.wobble { animation: none; }
  .flick-board .black, .dumpling .wrap, .dumpling .fold { transition: none; }
}

/* 돌 쌓기(17화): 담 위 빈자리 넷, 아래 돌무더기에서 끌어 올린다 */
.hint.stack, .hint.key { top: 12%; font-size: 18px; }
.hint.stack .ico, .hint.key .ico { display: none; }
.stack-wall { position: absolute; left: 50%; top: 26%; width: 280px; height: 52%; transform: translateX(-50%); z-index: 6; text-align: center; }
.stack-wall .wall { position: relative; display: flex; gap: 8px; justify-content: center; align-items: flex-end; height: 120px; padding: 0 12px 0; border-radius: 16px 16px 6px 6px; background: linear-gradient(#9b7650, #7a5a3a); box-shadow: 0 12px 24px #000a, inset 0 6px 0 #c9a77a66; }
.stack-wall .gap { position: relative; top: -28px; width: 54px; height: 44px; border-radius: 12px; border: 3px dashed #ffe7a6cc; background: #00000033; transition: background .2s, border-color .2s, transform .2s; }
.stack-wall .gap.near { background: #ffe7a644; transform: scale(1.08); }
.stack-wall .gap.filled { border: 0; background: radial-gradient(circle at 35% 30%, #c9c3b8, #8f877b 60%, #6a6358); box-shadow: 0 4px 6px #0008; animation: stone-drop .25s ease-out; }
.stack-wall .beat-dots { margin-top: 10px; }
.stack-wall .stone-pile { position: absolute; left: 50%; bottom: 0; width: 132px; height: 88px; margin-left: -66px; border: 0; padding: 0; background: none; touch-action: none; cursor: grab; animation: stone-glow 1.4s ease-in-out infinite; border-radius: 40px; }
.stack-wall .stone-pile i, .stack-wall .carried { position: absolute; width: 54px; height: 44px; border-radius: 45% 50% 42% 48%; background: radial-gradient(circle at 35% 30%, #d6d0c4, #948c80 60%, #6a6358); box-shadow: 0 4px 6px #0008; }
.stack-wall .stone-pile i:nth-child(1) { left: 6px; bottom: 4px; } .stack-wall .stone-pile i:nth-child(2) { left: 70px; bottom: 6px; } .stack-wall .stone-pile i:nth-child(3) { left: 38px; bottom: 34px; }
.stack-wall .carried { margin: -22px 0 0 -27px; pointer-events: none; z-index: 2; transform: scale(1.1); filter: drop-shadow(0 8px 10px #000a); }
.stack-wall .carried.back { transition: left .25s, top .25s, opacity .25s; opacity: 0; }
.stack-wall.done .wall { filter: drop-shadow(0 0 12px #ffe7a6); }
@keyframes stone-drop { from { transform: translateY(-14px) scale(1.1); } }

/* 열쇠 돌리기(18화): 놋쇠 자물쇠에 꽂힌 열쇠를 반 바퀴 돌린다 */
.padlock { position: absolute; left: 50%; top: 34%; width: 170px; height: 210px; transform: translate(-50%, -50%); z-index: 6; }
.padlock .shackle { position: absolute; left: 32px; top: 0; width: 106px; height: 110px; border: 16px solid #b88a3a; border-bottom: 0; border-radius: 60px 60px 0 0; box-shadow: inset 0 3px 0 #f0c66e88; transition: transform .35s cubic-bezier(.2,.8,.3,1); }
.padlock .body { position: absolute; left: 0; top: 80px; width: 170px; height: 130px; border-radius: 22px; background: radial-gradient(circle at 35% 25%, #f0c66e, #c08f3c 55%, #8a6224); box-shadow: 0 12px 24px #000a, inset 0 -6px 10px #6a4a1a88; }
.padlock .key { position: absolute; left: 50%; top: 145px; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 0; padding: 0; border-radius: 50%; background: none; touch-action: none; cursor: grab; transform: rotate(var(--turn, 0deg)); }
.padlock .key .shaft { position: absolute; left: 50%; top: 50%; width: 12px; height: 56px; margin: -8px 0 0 -6px; border-radius: 4px; background: linear-gradient(90deg, #6b6f78, #b7bcc6, #6b6f78); }
.padlock .key .bow { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: 40px 0 0 -22px; border-radius: 50%; border: 10px solid #9aa0aa; background: transparent; box-shadow: 0 4px 8px #0008; animation: stone-glow 1.4s ease-in-out infinite; }
.padlock .key.held { cursor: grabbing; } .padlock .key.held .bow { animation: none; border-color: #ffe7a6; }
.padlock.open .shackle { transform: translateY(-34px); }
.padlock.open .body { filter: drop-shadow(0 0 14px #ffe7a6); }
@media (prefers-reduced-motion: reduce) {
  .stack-wall .stone-pile, .stack-wall .gap.filled, .padlock .key .bow { animation: none; }
}

/* 세배(19화): 모은 두 손을 천천히 아래로 */
.hint.bow, .hint.hang { top: 12%; font-size: 18px; }
.hint.bow .ico, .hint.hang .ico { display: none; }
.bow-track { --bow: 0; position: absolute; left: 50%; top: 24%; width: 120px; height: 260px; transform: translateX(-50%); z-index: 6; }
.bow-track .rail { position: absolute; left: 50%; top: 30px; width: 14px; height: 200px; margin-left: -7px; border-radius: 7px; background: #0006; box-shadow: inset 0 2px 4px #000a; overflow: hidden; }
.bow-track .rail .fill { position: absolute; left: 0; top: 0; width: 100%; height: calc(var(--bow) * 100%); background: linear-gradient(#ffe7a6, #f2b84a); }
.bow-track .paws { position: absolute; left: 50%; top: calc(var(--bow) * 170px); width: 96px; height: 70px; margin-left: -48px; border: 0; padding: 0; background: none; touch-action: none; cursor: grab; border-radius: 40px; animation: stone-glow 1.4s ease-in-out infinite; }
.bow-track .paws i { position: absolute; top: 6px; width: 44px; height: 58px; border-radius: 50% 50% 46% 46%; background: radial-gradient(circle at 50% 30%, #fff, #e9e4dc 70%, #c9c1b4); box-shadow: 0 6px 10px #0008; }
.bow-track .paws i::before { content: ''; position: absolute; left: 50%; bottom: 10px; width: 18px; height: 14px; margin-left: -9px; border-radius: 50% 50% 45% 45%; background: #f2a7b3; }
.bow-track .paws i::after { content: ''; position: absolute; left: 50%; top: 12px; width: 7px; height: 8px; margin-left: -12px; border-radius: 50%; background: #f2a7b3; box-shadow: 9px -4px 0 #f2a7b3, 18px 0 0 #f2a7b3; }
.bow-track .paws i:first-child { left: 4px; transform: rotate(8deg); } .bow-track .paws i:last-child { right: 4px; transform: rotate(-8deg); }
.bow-track .paws.held { cursor: grabbing; animation: none; }
.bow-track.wobble .paws { animation: bow-wobble .4s ease-out; }
.bow-track.done .paws { filter: drop-shadow(0 0 14px #ffe7a6); animation: none; }
@keyframes bow-wobble { 0%, 100% { transform: none; } 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } }
/* 등불 걸기(20화): 등불을 끌어 줄 가운데 고리에 */
.hang-line { position: absolute; left: 50%; top: 18%; width: 300px; height: 62%; transform: translateX(-50%); z-index: 6; text-align: center; }
.hang-line .rope { position: absolute; left: 0; right: 0; top: 30px; height: 40px; border-top: 4px solid #d8c29a; border-radius: 50% 50% 0 0 / 100% 100% 0 0; transform: scaleY(-1); transform-origin: 50% 0; }
.hang-line .hook { position: absolute; top: 20px; width: 26px; height: 30px; margin-left: -13px; border: 4px solid #e8d7b0; border-top: 0; border-radius: 0 0 14px 14px; transition: transform .2s, border-color .2s; }
.hang-line .hook[data-k="0"] { left: 38%; } .hang-line .hook[data-k="1"] { left: 62%; }
.hang-line .hook.near { border-color: #ffe7a6; transform: scale(1.25); }
.hang-line .hook.on { border-color: #ffe7a6; }
.hang-line .beat-dots { position: absolute; left: 0; right: 0; top: 150px; }
.hang-line .lamp::before { content: ''; position: absolute; left: 50%; top: -2px; width: 14px; height: 14px; margin-left: -7px; border: 3px solid #b88a3a; border-radius: 50%; }
.hang-line .lamp { position: absolute; bottom: 0; width: 70px; height: 92px; margin-left: -35px; border: 0; padding: 0; background: none; touch-action: none; cursor: grab; animation: stone-glow 1.4s ease-in-out infinite; border-radius: 30px; }
.hang-line .lamp[data-k="0"] { left: 30%; } .hang-line .lamp[data-k="1"] { left: 70%; }
.hang-line .lamp i { position: absolute; inset: 10px 8px 6px; border-radius: 12px; box-shadow: 0 0 22px #ffd27a99, 0 8px 12px #0008; }
.hang-line .lamp.brass i { border: 5px solid #b88a3a; border-radius: 10px 10px 16px 16px; background: radial-gradient(circle at 50% 60%, #fff3c4, #ffc35a 40%, #b8742a 80%); }
.hang-line .lamp.bell i { border-radius: 50%; background: radial-gradient(circle at 50% 45%, #fffaf0, #ffe1a0 55%, #e6a95a); }
.hang-line .lamp.bell::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1b0, #e3b23c 60%, #9a6c14); }
.hang-line .lamp.lift { margin: -46px 0 0 -35px; bottom: auto; animation: none; z-index: 2; filter: drop-shadow(0 10px 12px #000a); }
.hang-line .lamp:not(.lift):not(.hung) { transition: left .25s, top .25s; }
.hang-line .lamp.hung { margin: 0 0 0 -35px; bottom: auto; animation: lamp-sway 2.4s ease-in-out infinite; transform-origin: 50% 0; cursor: default; }
.hang-line.done .lamp i { box-shadow: 0 0 40px #ffd27a, 0 0 80px #ffd27a88; }
@keyframes lamp-sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@media (prefers-reduced-motion: reduce) {
  .bow-track .paws, .hang-line .lamp, .hang-line .lamp.hung, .bow-track.wobble .paws { animation: none; }
}

/* 원격 원화가 없을 때 목록·앨범·본편에서도 안내를 읽을 수 있게 한다. */
.art-unavailable{display:grid;place-items:center;min-height:64px;padding:16px;color:#fff;background:#262b43;font-size:14px;line-height:1.5;text-align:center;white-space:normal}
.art-offline-banner{position:absolute;top:calc(env(safe-area-inset-top,0px) + 72px);left:18px;right:18px;z-index:12;min-height:0;border:1px solid #6c7190;border-radius:12px;pointer-events:none}
.ep-list .art-unavailable{grid-column:1/-1;grid-row:3;min-height:0;padding:8px;font-size:12px}
.album .art-unavailable{position:absolute;inset:0;padding:6px 6px 30px;font-size:11px}
.next-ep.go>.art-unavailable{flex:1;padding:8px;font-size:12px}
img[hidden]{display:none!important}
/* 작은 미리보기는 원화와 별도 층으로 유지한다. */
.story-opening{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:10px;background:radial-gradient(ellipse at 50% 35%,#3a2c4a,#141019);color:#eee0d1;font-family:var(--game)}
.story-lqip{position:absolute;inset:-4%;background:radial-gradient(ellipse at 45% 35%,#584567,#21172c);background-size:cover;background-position:center;filter:blur(8px);transform:scale(1.04)}
.art .story-full{opacity:0;transition:opacity .4s ease}.art .story-full.ready{opacity:1}
.story-art-loading{position:absolute;right:12px;top:calc(env(safe-area-inset-top,0px) + 104px);z-index:6;padding:6px 10px;border-radius:20px;background:#20172de8;font:13px var(--game);display:flex;gap:7px;align-items:center;pointer-events:none}
.story-art-loading .orak-loading-spinner,.story-start-load .orak-loading-spinner{width:13px;height:13px;flex-shrink:0}
.story-art-slow{position:absolute;z-index:7;top:calc(env(safe-area-inset-top,0px) + 145px);left:18px;right:18px;padding:14px;border:1px solid #f3c26270;border-radius:14px;background:#21192ef5;font:14px/1.6 var(--body);box-shadow:0 4px 20px #0005}
.story-art-slow p{margin:5px 0 10px}.story-art-slow button{font:inherit;color:#fff;background:#443251;border:1px solid #b89e78;border-radius:9px;padding:7px 12px;margin-right:7px}
.story-start-load{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:7px;margin:10px auto 0;width:min(280px,100%);font:13px var(--game)}
.story-start-load progress{width:100%;height:5px;accent-color:#f3c262}.story-start-load[hidden]{display:none}.story-ready{text-align:center;font:13px var(--game);color:#f3c262}
.story-thumb{display:inline-block;position:relative;overflow:hidden;background:#3a2c4a;background-size:cover;background-position:center;flex-shrink:0}
.story-thumb::before{content:'';position:absolute;inset:0;background:linear-gradient(110deg,transparent 25%,#ffffff18 50%,transparent 75%);background-size:200% 100%;animation:story-shimmer 2s linear infinite}
.story-thumb img{opacity:0;transition:opacity .4s ease}.story-thumb.ready img{opacity:1}.story-thumb.ready::before{display:none}
.ep-list .story-thumb{width:64px;height:86px;border-radius:9px}.ep-list .story-thumb img{width:100%;height:100%;object-fit:cover}
.next-ep .story-thumb{width:48px;height:64px;border-radius:7px}.next-ep .story-thumb img{width:100%;height:100%;object-fit:cover}
.album .story-thumb{position:absolute;inset:0;width:100%;height:100%}.album .story-thumb img{width:100%;height:100%;object-fit:cover}
.viewer .story-thumb{width:100%;height:100%}.viewer .story-thumb img{width:100%;height:100%;object-fit:contain}
@keyframes story-shimmer{to{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){.story-thumb::before{animation:none}.art .story-full,.story-thumb img{transition:none}}
.ep-list .story-thumb{grid-row:1 / 3;width:56px;height:56px;border-radius:10px}
button.next-ep.go .story-thumb{width:52px;height:52px}
button.next-ep.go .story-thumb img{width:100%;height:100%}
