:root {
  --ink: #3d372e;
  --soft-ink: #756c5f;
  --paper: #fffaf0;
  --cream: #f5e9cf;
  --honey: #d89736;
  --honey-dark: #a96722;
  --sage: #6e8063;
  --sage-dark: #465841;
  --brick: #9f5f49;
  --line: rgba(69, 57, 43, .18);
  --shadow: 0 18px 50px rgba(61, 45, 26, .18);
  --world-width: 8200px;
  color-scheme: light;
  font-family: "Gowun Dodum", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #d7d1bd;
  color: var(--ink);
}

button, input { font: inherit; }
button { color: inherit; }
button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
[hidden] { display: none !important; }

.app { width: 100vw; height: 100dvh; overflow: hidden; }

.title-screen {
  position: relative;
  display: grid;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 600px;
  isolation: isolate;
  overflow: hidden;
  background: #d8c89e;
}

.title-art,
.title-shade {
  position: absolute;
  inset: 0;
}

.title-art {
  z-index: -3;
  background: url("assets/haru-neighborhood.webp?v=20260729r8") center / cover no-repeat;
  transform: scale(1.035);
  animation: breathe 12s ease-in-out infinite alternate;
}

.title-shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(255, 250, 237, .95) 0%, rgba(255, 249, 235, .82) 31%, rgba(250, 240, 216, .22) 59%, rgba(52, 45, 34, .08) 100%),
    linear-gradient(0deg, rgba(55, 47, 34, .2), transparent 35%);
}

.title-screen::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 18px;
  border: 1px solid rgba(255, 255, 255, .62);
  box-shadow: inset 0 0 0 1px rgba(90, 67, 39, .12);
  pointer-events: none;
}

.title-content {
  width: min(580px, 78vw);
  margin-left: clamp(42px, 9vw, 152px);
  padding: 48px 0 74px;
  animation: reveal-up .9s cubic-bezier(.2, .75, .25, 1) both;
}

.eyebrow,
.modal-kicker {
  margin: 0 0 17px;
  color: var(--honey-dark);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .24em;
  text-transform: uppercase;
}

.eyebrow { display: flex; align-items: center; gap: 12px; }
.eyebrow span { width: 30px; height: 1px; background: currentColor; opacity: .65; }

h1, h2, p { overflow-wrap: keep-all; }

h1 {
  margin: 0;
  font-family: "Gowun Batang", serif;
  font-size: clamp(64px, 8vw, 118px);
  font-weight: 400;
  line-height: .93;
  letter-spacing: -.075em;
  text-shadow: 0 2px 0 rgba(255, 255, 255, .45);
}

h1 strong { color: var(--honey-dark); font-weight: 700; }

.title-copy {
  margin: 32px 0;
  color: #5f574c;
  font-family: "Gowun Batang", serif;
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.8;
}

.title-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  min-width: 216px;
  min-height: 58px;
  padding: 16px 22px 16px 28px;
  border: 1px solid #3e4837;
  border-radius: 4px;
  background: var(--sage-dark);
  color: #fffdf4;
  box-shadow: 0 7px 18px rgba(44, 55, 40, .2);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.primary-button:hover { transform: translateY(-2px); background: #52654c; box-shadow: 0 11px 24px rgba(44, 55, 40, .24); }
.primary-button:active { transform: translateY(1px); }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.primary-button.small { min-width: 210px; min-height: 52px; }

/* When continue exists, start becomes the quieter secondary action */
.title-actions:has(#continueButton:not([hidden])) #startButton {
  min-height: 50px;
  min-width: 196px;
  padding: 12px 18px 12px 22px;
  border-color: rgba(62, 72, 55, .45);
  background: rgba(255, 250, 237, .72);
  color: var(--sage-dark);
  box-shadow: none;
  gap: 16px;
}
.title-actions:has(#continueButton:not([hidden])) #startButton:hover {
  background: #fffaf0;
  border-color: var(--sage-dark);
  box-shadow: 0 6px 14px rgba(44, 55, 40, .1);
}
.title-actions:has(#continueButton:not([hidden])) #startButton svg {
  width: 16px;
}

.continue-meta {
  margin: -4px 0 2px 4px;
  color: rgba(61, 55, 46, .72);
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: .02em;
}

.title-hint { margin: 13px 0 0 17px; color: rgba(61, 55, 46, .65); font-size: 11px; }

.time-badge {
  position: absolute;
  right: clamp(36px, 5vw, 78px);
  top: clamp(40px, 8vh, 82px);
  display: grid;
  grid-template-columns: 28px auto;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 10px;
  color: rgba(52, 48, 40, .72);
  font-family: ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .14em;
}

.time-badge .sun-mark { grid-row: 1 / 3; width: 25px; height: 25px; border: 1px solid currentColor; border-radius: 50%; box-shadow: 0 0 0 5px rgba(255,255,255,.16); }
.time-badge span:not(.sun-mark) { font-size: 9px; }
.time-badge strong { font-size: 18px; letter-spacing: .02em; }

.game-screen {
  display: grid;
  grid-template-rows: 82px 1fr;
  width: 100%;
  height: 100%;
  background: var(--paper);
}

.game-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 clamp(20px, 4vw, 58px);
  border-bottom: 1px solid rgba(71, 59, 45, .18);
  background: rgba(255, 251, 242, .93);
  box-shadow: 0 3px 18px rgba(55, 45, 30, .07);
  backdrop-filter: blur(14px);
}

.round-button,
.modal-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .58);
  cursor: pointer;
  transition: background .2s, transform .2s;
}

.round-button:hover,
.modal-close:hover { background: #fff; transform: rotate(3deg); }
.round-button svg,
.modal-close svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

.collection-button { position: relative; }
.collection-button span {
  position: absolute;
  right: -5px;
  bottom: -4px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid var(--paper);
  border-radius: 10px;
  background: var(--brick);
  color: #fff;
  font: 800 8px/1 ui-sans-serif, sans-serif;
}

.stage-heading span,
.quest-topline,
.clock-label {
  color: var(--soft-ink);
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
}

.stage-heading h2 { margin: 3px 0 0; font-family: "Gowun Batang", serif; font-size: 19px; line-height: 1.1; }

/* Floating remaining-time badge — top-right of playfield */
.clock {
  position: absolute;
  z-index: 12;
  top: 18px;
  right: clamp(16px, 2.8vw, 36px);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 148px;
  padding: 12px 18px 12px 14px;
  border: 1px solid rgba(72, 55, 35, .16);
  border-radius: 8px;
  background:
    linear-gradient(165deg, rgba(255, 252, 243, .96) 0%, rgba(255, 246, 228, .93) 55%, rgba(247, 234, 206, .9) 100%);
  box-shadow:
    0 10px 28px rgba(49, 38, 25, .14),
    inset 0 1px 0 rgba(255, 255, 255, .75);
  color: var(--ink);
  pointer-events: none;
  user-select: none;
  transition: color .25s, border-color .25s, box-shadow .25s, background .25s;
}
.clock::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(104, 78, 45, .1);
  border-radius: 5px;
  pointer-events: none;
}
.clock-sun {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1.5px solid rgba(169, 103, 34, .55);
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 38%, #ffe8a8 0%, #f0c15a 42%, #d89736 78%, #b87228 100%);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, .35),
    0 3px 8px rgba(168, 110, 34, .22);
}
.clock-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.clock-label {
  display: block;
  margin: 0;
  color: rgba(117, 108, 95, .92);
  letter-spacing: .12em;
}
.clock strong {
  font-family: "Gowun Batang", serif;
  font-size: clamp(26px, 3.2vw, 32px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}
.clock.expired {
  color: var(--brick);
  border-color: rgba(159, 95, 73, .35);
  background: linear-gradient(165deg, #fff6f1 0%, #f8e6dc 100%);
  box-shadow: 0 10px 28px rgba(120, 55, 40, .16), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.clock.expired .clock-sun {
  border-color: rgba(159, 95, 73, .55);
  background: radial-gradient(circle at 40% 38%, #ffd4c4 0%, #e8a07a 50%, #b86a4a 100%);
}
.clock.warning {
  color: var(--brick);
  border-color: rgba(159, 95, 73, .32);
  background: linear-gradient(165deg, #fff8f2 0%, #fbe9dc 100%);
  box-shadow: 0 10px 28px rgba(120, 55, 40, .14), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.clock.warning strong { animation: clock-warning .85s ease-in-out infinite alternate; }
.clock.warning .clock-label::after { content: " · 서둘러요"; }
.clock.warning .clock-sun {
  border-color: rgba(169, 103, 34, .7);
  animation: clock-warning .85s ease-in-out infinite alternate;
}

.scene {
  --bg-offset: 0px;
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #d7ccac;
  cursor: grab;
  touch-action: none;
}
.scene.dragging { cursor: grabbing; }

.scene-background {
  position: absolute;
  z-index: -5;
  inset: 0;
  right: auto;
  width: calc(var(--world-width) * var(--vs, 1));
  background-image: url("assets/neighborhood-long.jpg?v=20260729r8");
  background-position: 0 var(--bg-y, center);
  background-repeat: no-repeat;
  background-size: calc(var(--world-width) * var(--vs, 1)) auto;
  filter: saturate(.94) contrast(.98);
  transform: translate3d(var(--bg-offset), 0, 0);
  will-change: transform;
}

.scene::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: 0;
  background: linear-gradient(180deg, rgba(251, 239, 201, .12), transparent 42%, rgba(93, 66, 34, .08));
  pointer-events: none;
}

/* ── 계절: 배경 그림 자체를 갈아끼우고, 색조를 계절에 맞춘다 ───────── */
.scene[data-season="spring"] .scene-background { background-image: url("assets/bg-spring.jpg?v=20260803r61"); filter: saturate(1.02) brightness(1.03); }
.scene[data-season="summer"] .scene-background { background-image: url("assets/bg-summer.jpg?v=20260803r61"); filter: saturate(1.06) brightness(1.02); }
.scene[data-season="autumn"] .scene-background { background-image: url("assets/bg-autumn.jpg?v=20260803r61"); filter: saturate(.98) brightness(1); }
.scene[data-season="winter"] .scene-background { background-image: url("assets/bg-winter.jpg?v=20260803r61"); filter: saturate(.82) brightness(1.04); }

/* ── 시간대: 조명 오버레이 (::before 는 하늘빛, ::after 는 바닥 그늘) ── */
.scene::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  transition: opacity .6s ease;
}
.scene[data-time="morning"]::before { background: linear-gradient(180deg, rgba(255, 236, 194, .3), transparent 46%, rgba(120, 96, 60, .07)); }
.scene[data-time="day"]::before     { background: linear-gradient(180deg, rgba(251, 245, 214, .14), transparent 42%, rgba(93, 66, 34, .08)); }
.scene[data-time="evening"]::before { background: linear-gradient(180deg, rgba(248, 168, 104, .34), transparent 50%, rgba(96, 48, 56, .2)); }
.scene[data-time="night"]::before   { background: linear-gradient(180deg, rgba(38, 52, 96, .52), rgba(30, 40, 78, .34) 55%, rgba(14, 18, 40, .46)); }

.scene[data-time="evening"] .scene-background { filter: saturate(1.04) brightness(.9) sepia(.12); }
.scene[data-time="night"] .scene-background { filter: saturate(.6) brightness(.5) hue-rotate(-12deg); }
.scene[data-time="morning"] .scene-background { filter: saturate(.94) brightness(1.06); }

/* 밤에는 골목 등불이 켜진다 */
.scene[data-time="night"]::after {
  background:
    radial-gradient(circle 190px at 22% 42%, rgba(255, 214, 138, .3), transparent 70%),
    radial-gradient(circle 150px at 61% 38%, rgba(255, 224, 160, .24), transparent 70%),
    radial-gradient(circle 210px at 88% 45%, rgba(255, 210, 130, .26), transparent 70%);
  mix-blend-mode: screen;
}
.scene[data-time="evening"]::after {
  background: radial-gradient(circle 260px at 78% 30%, rgba(255, 190, 120, .3), transparent 72%);
  mix-blend-mode: screen;
}
.scene[data-time="night"] .sun-wash,
.scene[data-time="evening"] .sun-wash { opacity: .25; }

/* 은행나무는 노란 단풍으로 그려져 있어 봄·여름에는 초록으로 돌린다 */
/* 은행나무는 노란 단풍으로 그려져 있다. 봄·여름엔 초록으로 돌리되
   채도를 크게 낮춰야 형광색이 되지 않는다. */
.scene[data-season="spring"] .climb-platform.ginkgo img { filter: hue-rotate(34deg) saturate(.5) brightness(.92) contrast(1.04); }
.scene[data-season="summer"] .climb-platform.ginkgo img { filter: hue-rotate(30deg) saturate(.45) brightness(.8) contrast(1.06); }
.scene[data-season="winter"] .climb-platform.tree img { filter: saturate(.2) brightness(1.1); }

/* ── 날씨: 스테이지마다 눈·비·꽃잎·낙엽 ─────────────────────────── */
.weather { position: absolute; z-index: 6; inset: 0; overflow: hidden; pointer-events: none; }
.weather i { position: absolute; top: -24px; will-change: transform; }

.weather.snow i {
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  filter: blur(.5px);
  animation: fall-snow linear infinite;
}
.weather.rain i {
  width: 1.5px;
  border-radius: 1px;
  background: linear-gradient(180deg, rgba(198, 216, 236, 0), rgba(186, 208, 232, .95));
  animation: fall-rain linear infinite;
}
.weather.petal i {
  border-radius: 60% 20% 60% 20%;
  background: rgba(248, 208, 216, .9);
  animation: fall-drift linear infinite;
}
.weather.leaf i {
  border-radius: 55% 15% 55% 15%;
  background: rgba(226, 176, 72, .92);
  animation: fall-drift linear infinite;
}

@keyframes fall-snow { to { transform: translate3d(30px, 105vh, 0); } }
@keyframes fall-rain { to { transform: translate3d(-46px, 105vh, 0); } }
@keyframes fall-drift {
  0%   { transform: translate3d(0, -20px, 0) rotate(0deg); }
  50%  { transform: translate3d(46px, 52vh, 0) rotate(180deg); }
  100% { transform: translate3d(-14px, 105vh, 0) rotate(360deg); }
}

/* 비 오는 판은 하늘이 한 톤 어두워진다 */
.scene[data-weather="rain"] .scene-background { filter: saturate(.72) brightness(.82); }

.sun-wash {
  position: absolute;
  z-index: -1;
  top: -25%;
  left: 15%;
  width: 45vw;
  height: 70vh;
  background: radial-gradient(circle, rgba(255, 247, 204, .33), transparent 68%);
  pointer-events: none;
}

.world {
  position: absolute;
  inset: 0;
  width: 100%;
}

.haru {
  --jump-y: 0px;
  position: absolute;
  z-index: 7;
  bottom: var(--ground, 7.6%);
  left: 0;
  width: calc(133px * var(--vs, 1));
  height: calc(116px * var(--vs, 1));
  transform: translate3d(calc(var(--x, 0px) - 50%), var(--jump-y), 0);
  transform-origin: 50% 100%;
  will-change: transform;
}

.haru.facing-left .haru-sprite { transform: translateX(-50%) scaleX(-1); }
.haru-sprite {
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: calc(133px * var(--vs, 1));
  height: calc(111px * var(--vs, 1));
  background-image: url("assets/haru-idle.png?v=20260729r8");
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: auto 80%;
  filter: drop-shadow(0 8px 4px rgba(52, 38, 24, .17));
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
  will-change: auto;
}
/* 시트 프레임은 셀 아래쪽에 10px 여백이 있어, 발끝이 idle 스프라이트와 맞도록 3px 더 내린다 */
.haru.moving:not(.jumping) .haru-sprite {
  bottom: -3px;
  background-image: url("assets/haru-motion-sheet.png?v=20260729r8");
  background-size: 400% 200%;
  animation: haru-walk .48s steps(1, end) infinite;
}
.haru.jumping-long .haru-sprite {
  bottom: -3px;
  background-image: url("assets/haru-motion-sheet.png?v=20260729r8");
  background-size: 400% 200%;
  animation: haru-jump-long 1.08s steps(1, end) forwards;
}
.haru.jumping-vertical .haru-sprite {
  background-image: url("assets/haru-vertical-jump.png?v=20260729r8");
  background-position: center bottom;
  background-size: auto 80%;
  animation: none;
}
.cat-shadow { position: absolute; left: calc(19px * var(--vs, 1)); bottom: calc(2px * var(--vs, 1)); width: calc(95px * var(--vs, 1)); height: calc(11px * var(--vs, 1)); border-radius: 50%; background: rgba(52, 45, 32, .2); filter: blur(3px); transition: opacity .15s, scale .15s; }
.haru.jumping .cat-shadow { opacity: .45; scale: .72; }

.street-decoration {
  position: absolute;
  z-index: 2;
  bottom: calc(var(--ground, 7.6%) + var(--decor-y, 0px) * var(--vs, 1));
  left: 0;
  width: calc(var(--decor-width) * var(--vs, 1));
  transform: translate3d(var(--x, 0px), 0, 0) translateX(-50%);
  pointer-events: none;
}
.street-decoration img {
  display: block;
  width: 100%;
  height: auto;
  /* 바닥에 닿는 그림자가 없으면 물건이 공중에 뜬 것처럼 보인다 */
  filter: saturate(.88) contrast(.96) drop-shadow(0 5px 4px rgba(72, 56, 36, .3));
}
.street-decoration.shop { z-index: 1; opacity: .96; }
.street-decoration.shop img {
  filter: saturate(.86) contrast(.96) drop-shadow(0 7px 6px rgba(58, 44, 27, .22));
}
.street-decoration.prop { z-index: 3; opacity: .94; }

.npc-hotspot {
  position: absolute;
  z-index: 5;
  bottom: var(--ground, 7.6%);
  left: 0;
  width: calc(84px * var(--vs, 1));
  height: calc(150px * var(--vs, 1));
  padding: 0;
  border: 0;
  background: none;
  transform: translate3d(var(--x, 0px), 0, 0) translateX(-50%);
  cursor: pointer;
}
.npc-hotspot::after {
  content: "•••";
  position: absolute;
  top: 4px;
  left: 50%;
  padding: 5px 9px 6px;
  border: 1px solid rgba(72, 58, 41, .18);
  border-radius: 15px;
  background: rgba(255, 252, 242, .94);
  color: var(--honey-dark);
  font: 700 9px/1 ui-sans-serif, sans-serif;
  letter-spacing: 2px;
  box-shadow: 0 5px 14px rgba(55, 42, 26, .12);
  opacity: 0;
  transform: translate(-50%, 5px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
.npc-hotspot.near { z-index: 8; }
.npc-hotspot.near::after,
.npc-hotspot:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hotspot {
  position: absolute;
  z-index: 5;
  bottom: calc(var(--ground, 7.6%) + var(--clue-y, 0px) * var(--vs, 1));
  left: 0;
  width: calc(120px * var(--vs, 1));
  height: calc(105px * var(--vs, 1));
  padding: 0;
  border: 0;
  background: none;
  transform: translate3d(var(--x, 0px), 0, 0) translateX(-50%);
  cursor: pointer;
}

.hotspot-prop {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: calc(var(--prop-width, 130px) * var(--vs, 1));
  max-width: 100%;
  max-height: calc(92px * var(--vs, 1));
  object-fit: contain;
  object-position: center bottom;
  opacity: .86;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 58% 60% at 50% 52%, #000 54%, rgba(0, 0, 0, .88) 70%, rgba(0, 0, 0, .38) 86%, transparent 100%);
  mask-image: radial-gradient(ellipse 58% 60% at 50% 52%, #000 54%, rgba(0, 0, 0, .88) 70%, rgba(0, 0, 0, .38) 86%, transparent 100%);
  transform: translateX(-50%);
  filter: saturate(.82) contrast(.94);
  transition: filter .25s, opacity .25s, transform .25s;
  pointer-events: none;
}

.hotspot-label { display: none; }
.hotspot.near .hotspot-prop {
  opacity: .97;
  filter: saturate(.94) contrast(.98) drop-shadow(0 3px 2px rgba(90, 61, 32, .07));
}
.hotspot.found { pointer-events: none; }
.hotspot.found .hotspot-prop { opacity: .62; filter: saturate(.66) contrast(.94); }

.collectible {
  position: absolute;
  z-index: 6;
  bottom: calc(var(--ground, 7.6%) + var(--item-y, 0px) * var(--vs, 1));
  left: 0;
  width: calc(var(--item-width, 54px) * var(--vs, 1));
  height: calc(var(--item-height, 70px) * var(--vs, 1));
  padding: 0;
  border: 0;
  background: none;
  transform: translate3d(var(--x, 0px), 0, 0) translateX(-50%);
  cursor: pointer;
}
.collectible img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: saturate(.86) contrast(.96) drop-shadow(0 3px 2px rgba(58, 44, 27, .12));
  transition: filter .2s, transform .2s;
  pointer-events: none;
}
.collectible.near img {
  filter: saturate(1.04) contrast(1.02) drop-shadow(0 4px 3px rgba(72, 49, 25, .16));
  transform: translateY(-2px);
}
.collectible-label { display: none; }


.climb-platform,
.world-boundary {
  position: absolute;
  bottom: var(--ground, 7.6%);
  left: 0;
  transform: translate3d(var(--x, 0px), 0, 0) translateX(-50%);
  pointer-events: none;
}
.climb-platform { z-index: 4; width: calc(var(--platform-width) * var(--vs, 1)); filter: drop-shadow(0 8px 6px rgba(58, 44, 27, .13)); }
.climb-platform.tree { z-index: 3; filter: drop-shadow(0 10px 7px rgba(58, 44, 27, .14)); }
.climb-platform img,
.world-boundary img { display: block; width: 100%; height: auto; }
.world-boundary { z-index: 6; width: calc(410px * var(--vs, 1)); filter: drop-shadow(0 9px 7px rgba(58, 44, 27, .14)); }
.world-boundary.start { transform: translate3d(var(--x, 0px), 0, 0) translateX(-50%) scaleX(-1); }

.quest-card {
  position: absolute;
  z-index: 12;
  top: 24px;
  left: clamp(20px, 4vw, 58px);
  width: min(300px, calc(100vw - 40px));
  padding: 17px 20px 16px;
  border: 1px solid rgba(70, 57, 39, .18);
  border-radius: 5px;
  background: rgba(255, 251, 240, .89);
  box-shadow: 0 8px 25px rgba(68, 54, 35, .12);
  backdrop-filter: blur(9px);
}

.quest-card::before { content: ""; position: absolute; left: 12px; right: 12px; top: 5px; border-top: 1px dashed rgba(80, 63, 42, .16); }
.quest-topline { display: flex; justify-content: space-between; color: var(--honey-dark); }
.quest-card p { margin: 9px 0 11px; font-family: "Gowun Batang", serif; font-size: 14px; line-height: 1.45; }
.clue-pips { display: flex; gap: 7px; }
.clue-pips { flex-wrap: wrap; }
.clue-pips i { flex: 1 1 0; min-width: 14px; max-width: 24px; height: 3px; border-radius: 2px; background: #ddd2bc; transition: .35s; }
.clue-pips i.found { background: var(--brick); }
.solve-cta {
  width: 100%;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(73, 91, 67, .35);
  border-radius: 18px;
  background: var(--sage-dark);
  color: #fff;
  font: 800 10px/1 ui-sans-serif, sans-serif;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(54, 67, 49, .18);
  animation: quest-ready 1.2s ease-in-out infinite alternate;
}
.solve-cta[hidden] { display: none; }

.interaction-prompt {
  position: absolute;
  z-index: 13;
  left: 50%;
  bottom: 58%;          /* 화면 가운데보다 위 — 고양이·소품을 가리지 않는다 */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px 7px 7px;
  border-radius: 18px;
  background: rgba(56, 49, 39, .88);
  color: white;
  font-size: 11px;
  transform: translateX(-50%);
  box-shadow: 0 6px 20px rgba(0,0,0,.16);
}

kbd { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 5px; border: 1px solid rgba(61,52,40,.2); border-radius: 4px; background: #fffdf6; color: var(--ink); font-family: ui-monospace, monospace; font-size: 9px; box-shadow: 0 2px 0 rgba(66, 54, 38, .2); }

.dialogue {
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: 9%;
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 16px;
  width: min(600px, calc(100vw - 40px));
  min-height: 90px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 14px;
  /* 뒤 골목이 비치도록 반투명 + 블러. 글자는 아래 그림자로 대비를 지킨다 */
  background: linear-gradient(170deg, rgba(255, 252, 244, .72), rgba(252, 244, 228, .6));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .8),
    0 10px 30px rgba(52, 40, 26, .2);
  backdrop-filter: blur(9px) saturate(1.25);
  -webkit-backdrop-filter: blur(9px) saturate(1.25);
  transform: translateX(-50%);
  animation: dialogue-in .28s ease both;
}
.dialogue { cursor: pointer; }

.dialogue strong { display: block; margin-bottom: 4px; color: #8a5318; font-family: "Gowun Batang", serif; font-size: 13px; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.dialogue p { margin: 0; color: #332c23; font-size: 13px; line-height: 1.55; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.dialogue button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; }
.dialogue button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.portrait {
  position: relative;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(103, 78, 47, .22);
  border-radius: 50%;
  background: rgba(246, 230, 204, .85) url("assets/haru-idle.png?v=20260803r61") no-repeat -50px 2px;
  background-size: 96px auto;
  overflow: hidden;
}
.portrait-face, .portrait-ears { display: none; }

.dialogue.npc-speaker .portrait { display: grid; place-items: center; background: #d8c9a9; background-image: none; }
.dialogue.npc-speaker .portrait::after {
  content: attr(data-initial);
  color: #6e583e;
  font: 700 23px/1 "Gowun Batang", serif;
}

.keyboard-guide { position: absolute; z-index: 9; right: 28px; bottom: 20px; display: flex; gap: 18px; color: rgba(57, 49, 40, .66); font-size: 9px; }
.keyboard-guide span { display: flex; align-items: center; gap: 4px; }

.mobile-controls { position: absolute; z-index: 14; inset: auto 18px max(15px, env(safe-area-inset-bottom)); display: none; align-items: end; justify-content: space-between; pointer-events: none; }
.action-controls { display: flex; gap: 12px; pointer-events: auto; }
.mobile-drag-guide { max-width: 115px; padding: 7px 10px; border: 1px solid rgba(69, 55, 39, .16); border-radius: 18px; background: rgba(255, 251, 239, .68); color: rgba(58, 49, 38, .72); font: 700 9px/1.35 ui-sans-serif, sans-serif; text-align: center; backdrop-filter: blur(5px); }
.mobile-controls button {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  /* 위에서 빛이 들어오는 반투명 유리 구슬 느낌 */
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, .68), rgba(255, 255, 255, .1) 48%, rgba(255, 255, 255, 0) 64%),
    linear-gradient(165deg, rgba(255, 252, 244, .3), rgba(190, 172, 140, .2));
  color: #4a4034;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, .7),
    inset 0 -4px 9px rgba(97, 78, 52, .18),
    0 8px 18px rgba(48, 37, 24, .2),
    0 1px 2px rgba(48, 37, 24, .14);
  font: 800 9px/1 ui-sans-serif, sans-serif;
  letter-spacing: .06em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .7);
  backdrop-filter: blur(3px) saturate(1.2) brightness(1.04);
  -webkit-backdrop-filter: blur(3px) saturate(1.2) brightness(1.04);
  transition: transform .12s ease, box-shadow .12s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.mobile-controls button:active {
  transform: translateY(2px) scale(.96);
  box-shadow:
    inset 0 3px 7px rgba(97, 78, 52, .3),
    inset 0 -1px 2px rgba(255, 255, 255, .5),
    0 3px 8px rgba(48, 37, 24, .22);
}
.mobile-controls svg { filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .6)); }
.mobile-controls svg { width: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.modal-backdrop { position: fixed; z-index: 40; inset: 0; background: rgba(45, 39, 31, .42); backdrop-filter: blur(5px); animation: fade .2s ease both; }
.story-modal, .stage-modal, .collection-modal, .solve-modal, .complete-modal, .timeup-modal, .paywall-modal { position: fixed; z-index: 41; top: 50%; left: 50%; width: min(540px, calc(100vw - 36px)); padding: 45px 48px 42px; border: 1px solid rgba(72, 55, 35, .2); border-radius: 8px; background: var(--paper); box-shadow: 0 28px 90px rgba(49, 38, 25, .28); text-align: center; transform: translate(-50%, -50%); animation: modal-in .35s cubic-bezier(.16,.8,.32,1) both; }
.story-modal::before, .complete-modal::before, .timeup-modal::before, .paywall-modal::before { content: ""; position: absolute; inset: 9px; border: 1px solid rgba(104, 78, 45, .12); pointer-events: none; }
.modal-close { position: absolute; z-index: 2; top: 17px; right: 17px; width: 35px; height: 35px; background: rgba(255, 252, 244, .92); box-shadow: 0 2px 8px rgba(60, 46, 28, .18); }
.story-modal h2, .solve-modal h2, .complete-modal h2, .timeup-modal h2, .stage-modal h2, .collection-modal h2, .paywall-modal h2 { margin: 0; font-family: "Gowun Batang", serif; font-size: clamp(25px, 4vw, 34px); line-height: 1.3; }
.story-modal > p:not(.modal-kicker), .complete-modal > p:not(.modal-kicker), .timeup-modal > p:not(.modal-kicker), .solve-modal > p:not(.modal-kicker), .paywall-modal > p:not(.modal-kicker):not(.paywall-note) { margin: 22px auto 25px; color: var(--soft-ink); font-size: 14px; line-height: 1.8; }
.chapter-rule { display: flex; align-items: center; gap: 8px; width: 120px; margin: 19px auto; }
.chapter-rule span { flex: 1; height: 1px; background: #c7b99e; }
.chapter-rule i { width: 5px; height: 5px; background: var(--honey); transform: rotate(45deg); }

.stage-modal { width: min(710px, calc(100vw - 36px)); text-align: left; }
.stage-modal-header { display: flex; justify-content: space-between; align-items: start; }
.modal-close.inline { position: static; }
.stage-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 30px 0 23px; }
.stage-item { position: relative; min-height: 215px; padding: 20px 17px; overflow: hidden; border: 1px solid rgba(76, 61, 43, .17); border-radius: 6px; background: #f2e7d2; text-align: left; cursor: pointer; transition: transform .2s, box-shadow .2s, border .2s; }
.stage-item:nth-child(2) { background: #dce6df; }
.stage-item:nth-child(3) { background: #ead8ca; }
.stage-item:hover:not(:disabled), .stage-item.active { border-color: rgba(87, 66, 41, .5); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(62,49,32,.1); }
.stage-item:disabled { cursor: not-allowed; filter: grayscale(.55); opacity: .6; }
.stage-number { display: block; color: var(--honey-dark); font: 800 9px/1 ui-sans-serif, sans-serif; letter-spacing: .13em; }
.stage-item svg { width: 53px; height: 53px; margin: 25px 0 17px; fill: none; stroke: #806347; stroke-width: 1.4; }
.stage-item strong { display: block; margin-bottom: 5px; font-family: "Gowun Batang", serif; font-size: 16px; }
.stage-item small { color: var(--soft-ink); font-size: 10px; }
.stage-status { position: absolute; right: 14px; top: 14px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.6); color: var(--sage-dark); font-size: 10px; }
.text-button { display: block; margin: 0 auto; padding: 7px; border: 0; border-bottom: 1px solid currentColor; background: none; color: var(--soft-ink); font-size: 11px; cursor: pointer; }

.collection-modal { width: min(760px, calc(100vw - 36px)); text-align: left; }
.collection-copy { margin: 14px 0 20px; color: var(--soft-ink); font-size: 12px; }
.collection-progress { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; color: var(--soft-ink); font: 700 10px/1 ui-sans-serif, sans-serif; letter-spacing: .08em; }
.collection-progress strong { color: var(--brick); font-size: 13px; }
.collection-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.collection-card { min-height: 190px; padding: 12px; border: 1px solid rgba(76, 61, 43, .15); border-radius: 7px; background: #f4ead7; text-align: center; }
.collection-card:nth-child(3n + 2) { background: #e3ebe3; }
.collection-card:nth-child(3n) { background: #eadfd4; }
.collection-picture { display: grid; place-items: center; height: 92px; margin-bottom: 9px; }
.collection-picture img { display: block; width: 100%; height: 88px; object-fit: contain; filter: drop-shadow(0 5px 4px rgba(58, 44, 27, .13)); }
.collection-card strong { display: block; margin-bottom: 5px; font-family: "Gowun Batang", serif; font-size: 13px; }
.collection-card p { margin: 0; color: var(--soft-ink); font-size: 9px; line-height: 1.5; }
.collection-card.locked { border-style: dashed; background: rgba(232, 224, 207, .46); color: rgba(70, 61, 51, .45); }
.collection-card.locked .collection-picture { font: 400 42px/1 "Gowun Batang", serif; }

.solve-icon { display: grid; place-items: center; width: 74px; height: 74px; margin: -82px auto 25px; border: 1px solid rgba(81, 66, 47, .2); border-radius: 50%; background: var(--cream); box-shadow: 0 8px 20px rgba(55,43,28,.15); }
.solve-icon svg { width: 42px; fill: none; stroke: var(--brick); stroke-width: 1.6; stroke-linecap: round; }
.solve-clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; margin: -8px 0 19px; }
.solve-clue { min-width: 0; padding: 8px 7px 9px; border: 1px solid rgba(85, 67, 46, .14); border-radius: 5px; background: #f2ead9; }
.solve-clue img { display: block; width: 100%; height: 58px; margin-bottom: 5px; object-fit: contain; opacity: .9; mix-blend-mode: multiply; }
.solve-clue strong { display: block; overflow: hidden; color: var(--sage-dark); font-family: "Gowun Batang", serif; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.answer-list { display: grid; gap: 8px; }
.answer-list button { padding: 13px 16px; border: 1px solid rgba(74, 59, 41, .2); border-radius: 4px; background: #fffdf7; cursor: pointer; transition: .2s; }
.answer-list button:hover { border-color: var(--sage); background: #f4f6ee; transform: translateX(2px); }
.answer-list button.wrong { border-color: #b77765; background: #faede7; animation: shake .3s; }
.answer-feedback { min-height: 20px; margin: 13px 0 0 !important; color: var(--brick) !important; font-size: 11px !important; }

.complete-modal { overflow: hidden; }
.ending-art {
  margin: -20px -18px 20px;
  overflow: hidden;
  border-radius: 5px;
  background: #f2e8d5;
}
.ending-art img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
  animation: ending-in 1.1s ease both;
}
.ending-echo {
  margin: 18px auto 28px !important;
  max-width: 380px;
  color: var(--soft-ink) !important;
  font-family: "Gowun Batang", serif;
  font-size: 13px !important;
  font-style: italic;
  line-height: 1.85 !important;
  opacity: 0;
  animation: ending-echo-in 1.4s ease .5s both;
}
@keyframes ending-in { from { opacity: 0; transform: scale(1.04); } }
@keyframes ending-echo-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }
.complete-stars { display: flex; justify-content: center; gap: 24px; height: 35px; margin-bottom: 12px; }
.complete-stars i { width: 13px; height: 13px; background: var(--honey); clip-path: polygon(50% 0, 61% 36%, 100% 38%, 69% 60%, 80% 100%, 50% 76%, 20% 100%, 31% 60%, 0 38%, 39% 36%); animation: star-in .6s ease both; }
.complete-stars i:nth-child(2) { width: 21px; height: 21px; animation-delay: .12s; }
.complete-stars i:nth-child(3) { animation-delay: .24s; }
.found-stamp { display: grid; place-items: center; width: 94px; height: 55px; margin: 0 auto 25px; border: 3px double rgba(145, 76, 57, .66); color: rgba(145, 76, 57, .75); transform: rotate(-5deg); }
.found-stamp span { font: 700 7px/1 sans-serif; letter-spacing: .2em; }
.found-stamp strong { font: 800 14px/1 sans-serif; letter-spacing: .08em; }
.complete-modal .text-button { margin-top: 13px; }
.timeup-modal { overflow: hidden; }
.timeup-clock { display: grid; place-items: center; width: 86px; height: 86px; margin: 0 auto 22px; border: 2px solid rgba(159, 95, 73, .5); border-radius: 50%; background: #f4e5d7; color: var(--brick); box-shadow: inset 0 0 0 7px rgba(255, 250, 240, .72); }
.timeup-clock span { font: 800 8px/1 ui-sans-serif, sans-serif; letter-spacing: .18em; }
.timeup-clock strong { margin-top: -20px; font-family: "Gowun Batang", serif; font-size: 21px; font-variant-numeric: tabular-nums; }
.timeup-modal .text-button { margin-top: 13px; }

@keyframes breathe { to { transform: scale(1.055) translateX(-.3%); } }
@keyframes reveal-up { from { opacity: 0; transform: translateY(18px); } }
@keyframes modal-in { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
@keyframes fade { from { opacity: 0; } }
@keyframes dialogue-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes quest-ready { to { transform: translateY(-2px); box-shadow: 0 9px 20px rgba(54, 67, 49, .24); } }
@keyframes haru-walk {
  0%, 24.99% { background-position: 0% 0%; }
  25%, 49.99% { background-position: 33.333% 0%; }
  50%, 74.99% { background-position: 66.666% 0%; }
  75%, 100% { background-position: 100% 0%; }
}
@keyframes clock-warning { to { opacity: .58; transform: translateY(-1px); } }
@keyframes haru-jump-long {
  0%, 9% { background-position: 0% 100%; }
  10%, 40% { background-position: 33.333% 100%; }
  41%, 76% { background-position: 66.666% 100%; }
  77%, 100% { background-position: 100% 100%; }
}
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes star-in { from { opacity: 0; transform: scale(0) rotate(-30deg); } }

@media (max-width: 800px), (pointer: coarse) {
  .keyboard-guide { display: none; }
  /* 폰에는 E 키가 없다 — 안내 뱃지를 숨긴다 */
  .interaction-prompt kbd { display: none; }
  .interaction-prompt { padding-left: 14px; }
  .mobile-controls { display: flex; }
  .mobile-drag-guide { display: block; }
  .haru.moving:not(.jumping) .haru-sprite { animation-duration: .52s; }
  .quest-card { top: 15px; left: 15px; padding: 14px 16px; width: 250px; }
  .dialogue { bottom: 38%; }
}

@media (max-width: 680px) {
  .title-screen { align-items: end; min-height: 500px; }
  .title-art { background-position: 58% center; }
  .title-shade { background: linear-gradient(0deg, rgba(255, 250, 237, .98) 0%, rgba(255, 249, 235, .85) 42%, rgba(250, 240, 216, .08) 78%); }
  .title-content { width: auto; margin: 0; padding: 0 34px max(55px, calc(env(safe-area-inset-bottom) + 30px)); }
  h1 { font-size: clamp(57px, 18vw, 78px); }
  .title-copy { margin: 22px 0; font-size: 14px; }
  .time-badge { right: 30px; top: 38px; color: #524839; }
  .game-screen { grid-template-rows: 68px 1fr; }
  .game-header { gap: 11px; padding: 0 15px; }
  .round-button { width: 37px; height: 37px; }
  .stage-heading h2 { max-width: 52vw; overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
  .clock {
    top: 12px;
    right: 12px;
    min-width: 0;
    gap: 9px;
    padding: 9px 12px 9px 10px;
  }
  .clock-sun { width: 22px; height: 22px; box-shadow: 0 0 0 3px rgba(255, 255, 255, .32), 0 2px 6px rgba(168, 110, 34, .2); }
  .clock-label { font-size: 8px; letter-spacing: .08em; }
  .clock strong { font-size: 22px; }
  .quest-card p { margin: 7px 0; font-size: 12px; }
  .hotspot-prop { max-height: 82px; }
  .collection-button { width: 35px; height: 35px; }
  .stage-modal, .collection-modal, .story-modal, .solve-modal, .complete-modal, .timeup-modal, .paywall-modal { max-height: calc(100dvh - 30px); overflow-y: auto; padding: 38px 24px 30px; }
  .stage-list { grid-template-columns: 1fr; max-height: 52dvh; overflow-y: auto; }
  .collection-grid { grid-template-columns: repeat(2, 1fr); }
  .collection-card { min-height: 176px; }
  .stage-item { display: grid; grid-template-columns: 50px 1fr; align-items: center; min-height: 92px; }
  .stage-item svg { grid-row: 1 / 4; width: 38px; height: 38px; margin: 0; }
  .stage-number { grid-column: 2; }
  .stage-item strong, .stage-item small { grid-column: 2; }
  .dialogue { grid-template-columns: 42px 1fr auto; gap: 10px; padding: 12px; }
  .portrait { width: 42px; height: 42px; background-size: 75px auto; background-position: -39px 2px; }
}

/* ── 모바일 가독성: 본문 글자를 키우고 줄간격·대비를 올린다 ────────── */
@media (max-width: 800px), (pointer: coarse) {
  .dialogue { width: min(600px, calc(100vw - 24px)); padding: 15px 16px; }
  .dialogue strong { margin-bottom: 5px; font-size: 14px; }
  .dialogue p { color: #362f26; font-size: 15.5px; line-height: 1.72; letter-spacing: -.01em; }

  .quest-card { width: min(300px, calc(100vw - 30px)); padding: 15px 17px 14px; }
  .quest-topline { font-size: 10px; }
  .quest-card p { color: #362f26; font-size: 14.5px; line-height: 1.55; }
  .solve-cta { padding: 12px; font-size: 12px; }

  .story-modal > p:not(.modal-kicker),
  .complete-modal > p:not(.modal-kicker),
  .timeup-modal > p:not(.modal-kicker),
  .solve-modal > p:not(.modal-kicker) { color: #4b4238; font-size: 15.5px; line-height: 1.85; }
  .ending-echo { font-size: 14.5px !important; line-height: 1.9 !important; }
  .modal-kicker { font-size: 12px; letter-spacing: .18em; }

  .answer-list button { padding: 15px 16px; font-size: 15.5px; line-height: 1.5; }
  .answer-feedback { font-size: 13px !important; line-height: 1.6; }
  .solve-clue strong { font-size: 12.5px; }

  .stage-item strong { font-size: 17px; }
  .stage-item small { color: #5d5449; font-size: 12px; line-height: 1.5; }
  .stage-number { font-size: 10px; }

  .collection-copy { font-size: 13.5px; line-height: 1.6; }
  .collection-card strong { font-size: 14px; }
  .collection-card p { color: #5d5449; font-size: 11.5px; line-height: 1.6; }
  .collection-progress { font-size: 11px; }

  .interaction-prompt { bottom: 58%; font-size: 13px; padding: 8px 14px 8px 8px; }
  .text-button { font-size: 13px; padding: 9px; }
  .primary-button { font-size: 15.5px; }
}

/* ── 폰: UI 가 고양이를 가리지 않게 화면 가장자리로 밀어낸다 ────────── */
@media (max-width: 800px), (pointer: coarse) {
  /* 퀘스트 카드를 얇은 한 줄 띠로 (세로 공간을 크게 아낀다) */
  .quest-card {
    top: 8px;
    left: 8px;
    right: 112px;          /* 오른쪽 시계 배지 자리를 비워 둔다 */
    width: auto;
    padding: 9px 13px 10px;
    border-radius: 12px;
  }
  .quest-card::before { display: none; }
  .quest-card p { margin: 4px 0 7px; font-size: 13.5px; line-height: 1.4; }
  .quest-topline { font-size: 10px; }
  .clue-pips i { height: 4px; }
  .solve-cta { margin-top: 9px; padding: 11px; }

  /* 시계는 헤더 안에 얇게 */
  .clock { min-width: 62px; }
  .clock-label { display: none; }
  .clock strong { font-size: 19px; }

  /* 대화창은 화면 맨 아래에 붙여 고양이를 가리지 않게 */
  .dialogue { bottom: 38%; left: 8px; right: 8px; width: auto; transform: none; }

  /* 조작 안내는 상시 노출하지 않는다 */
  .mobile-drag-guide { display: none; }
  .keyboard-guide { display: none; }

  /* 조작 버튼은 오른쪽 아래 구석에 */
  .mobile-controls { inset: auto 12px max(12px, env(safe-area-inset-bottom)); justify-content: space-between; }
  .mobile-controls button { width: 58px; height: 58px; }
}

@media (max-height: 650px) {
  .title-content { padding-top: 25px; padding-bottom: 30px; }
  .title-copy { margin: 18px 0; }
  .game-screen { grid-template-rows: 64px 1fr; }
  .quest-card { top: 12px; }
  .dialogue { bottom: 34%; }
  .story-modal, .stage-modal, .solve-modal, .complete-modal, .timeup-modal, .paywall-modal { padding-top: 35px; padding-bottom: 30px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* ── 프롤로그: 여섯 컷을 천천히 밀며 교차 페이드해 짧은 영상처럼 보여 준다 ── */
.prologue {
  position: fixed;
  z-index: 60;
  inset: 0;
  overflow: hidden;
  background: #171310;
  transition: background .5s ease;
}
/* 영상이 화이트로 닫히면 레이어도 흰색이 되어, 게임 화면이 흰빛에서 떠오른다 */
.prologue.whiteout { background: #fffdf7; }
.prologue.whiteout .prologue-line,
.prologue.whiteout .prologue-skip,
.prologue.whiteout .prologue-sound { opacity: 0; transition: opacity .4s ease; }
.prologue[hidden] { display: none !important; }
.prologue-stage { position: absolute; inset: 0; }
.prologue-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 1.4s ease;
  will-change: transform, opacity;
}
.prologue-stage img.on { opacity: 1; animation: prologue-drift 7.5s linear both; }
@keyframes prologue-drift {
  from { transform: scale(1.02) translate3d(0, 0, 0); }
  to   { transform: scale(1.13) translate3d(-1.4%, -1%, 0); }
}
/* 위아래 가장자리를 어둡게 눌러 영화 같은 느낌 */
.prologue-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23,19,16,.5), transparent 26%, transparent 58%, rgba(23,19,16,.82));
  pointer-events: none;
}
.prologue-line {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 13%;
  width: min(620px, calc(100vw - 56px));
  margin: 0;
  color: #fdf6e8;
  font-family: "Gowun Batang", serif;
  font-size: clamp(16px, 2.1vw, 21px);
  line-height: 1.85;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity .9s ease;
}
.prologue-line.on { opacity: 1; }
.prologue-skip {
  position: absolute;
  z-index: 3;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 20px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .84);
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.prologue-skip:hover { background: rgba(255, 255, 255, .2); }
@media (max-width: 800px), (pointer: coarse) {
  .prologue-line { bottom: 15%; font-size: 15.5px; line-height: 1.8; }
}
@media (prefers-reduced-motion: reduce) {
  .prologue-stage img.on { animation: none; }
}

.prologue-sound {
  position: absolute;
  z-index: 3;
  left: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .86);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.prologue-sound svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.prologue-sound[data-on="0"] .wave { opacity: .2; }

.sound-button[data-on="0"] .wave { opacity: .18; }
.sound-button[data-on="0"] { opacity: .62; }

/* 오프닝 영상. 재생에 실패하면 아래 6컷 시퀀스가 그대로 보인다 */
.prologue-video {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  /* 세로 영상이라 폰에서는 꽉 차고, 넓은 화면에서는 가운데에 온전히 보이게 */
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  background: #171310;
}
.prologue-video.on { opacity: 1; }

@media (min-aspect-ratio: 1/1) {
  .prologue-video { object-fit: contain; }
  .prologue.whiteout { background: #fffdf7; }
}




/* 좌우 이동은 버튼이 아니라 밀어서 조작한다. 손잡이가 좌우로 따라 움직여
   "미는 것"임을 눈으로 알 수 있게 했다. */
.move-pad {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  width: 148px;
  height: 62px;
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 31px;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(255, 255, 255, .55), rgba(255, 255, 255, .08) 60%, rgba(255, 255, 255, 0) 74%),
    linear-gradient(165deg, rgba(255, 252, 244, .3), rgba(190, 172, 140, .2));
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, .6),
    inset 0 -4px 9px rgba(97, 78, 52, .18),
    0 8px 18px rgba(48, 37, 24, .2);
  backdrop-filter: blur(3px) saturate(1.2) brightness(1.04);
  -webkit-backdrop-filter: blur(3px) saturate(1.2) brightness(1.04);
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.move-pad.dragging { cursor: grabbing; }
.move-pad-arrow {
  color: rgba(74, 64, 52, .5);
  font: 700 22px/1 ui-sans-serif, sans-serif;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  transition: color .15s, transform .15s;
  pointer-events: none;
}
.move-pad.to-left .move-pad-arrow.left,
.move-pad.to-right .move-pad-arrow.right { color: rgba(60, 50, 38, .95); transform: scale(1.25); }
.move-pad-knob {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, .9), rgba(255, 255, 255, .25) 52%, rgba(255, 255, 255, .05) 70%),
    linear-gradient(165deg, rgba(255, 252, 244, .6), rgba(196, 178, 146, .45));
  box-shadow:
    inset 0 1px 2px rgba(255, 255, 255, .9),
    0 3px 8px rgba(48, 37, 24, .28);
  transition: transform .12s ease;
  pointer-events: none;
}


/* ── 3판부터의 결제 안내 ─────────────────────────────── */
.paywall-art { margin: 0 auto 6px; width: 118px; }
.paywall-art img { display: block; width: 100%; filter: drop-shadow(0 10px 16px rgba(120, 92, 52, .22)); }
.paywall-points {
  margin: 0 auto 26px; padding: 18px 22px; max-width: 340px;
  list-style: none; text-align: left;
  border: 1px solid rgba(104, 78, 45, .16); border-radius: 6px;
  background: rgba(255, 252, 244, .6);
  color: var(--soft-ink); font-size: 13.5px; line-height: 1.9;
}
.paywall-points li { position: relative; padding-left: 17px; }
.paywall-points li::before {
  content: ""; position: absolute; top: 11px; left: 2px;
  width: 5px; height: 5px; background: var(--honey); transform: rotate(45deg);
}
.paywall-note { margin: 14px auto 0; max-width: 340px; color: #a2553f; font-size: 13px; line-height: 1.7; }
.paywall-modal .text-button { margin-top: 12px; }
.paywall-modal .text-button + .text-button { margin-top: 4px; }
/* 결제로 잠긴 판은 자물쇠 대신 열쇠 느낌을 준다 */
.stage-item.pay-locked small { color: #a9762e; }
