/* NDJ LABS · 목장집 막내아들 — 랜딩 3판: 스크롤하면 목장의 하루가 흐른다 (docs/2026-10-31-landing-v3-design.md)
   기본 상태는 "다 끝난 모습"이다: JS가 없거나 움직임을 줄이면 이대로 보인다. 시작 상태는 app.js가 건다. */
:root {
  --sky-ink: #2c221e; --sky-muted: #6e6457; --sky-kicker: #2f7d4f;
  --cream: #fbf6ec; --cream2: #f3e9d6; --card: #fffdf8; --ink: #2c221e; --muted: #6e6457; --line: #eadfcb;
  --green: #2f7d4f; --green2: #e2f0e5; --sun: #f5b841; --wheat: #f2c14e; --red: #d9473d; --sky: #7cc0ea;
  --night: #161c3d; --night-ink: #f3ecdf; --night-muted: #b9b4c9;
  --brand-ink: #101417; --brand-pale: #f4f6f7;
  --shadow: 0 10px 30px rgba(60, 40, 10, .10);
  --hud-h: 64px;
  color-scheme: light;
}
@property --build { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --scaffold { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --groundwork { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --done { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --ring { syntax: "<number>"; inherits: true; initial-value: 1; }
* { box-sizing: border-box; }
main > section { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--hud-h); }
body {
  margin: 0; background: var(--cream); color: var(--ink); overflow-x: hidden;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 17px; line-height: 1.7; word-break: keep-all; overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
.wrap { width: min(1120px, 100% - 32px); margin: 0 auto; }
.display { font-family: "Jua", "Pretendard Variable", sans-serif; font-weight: 400; letter-spacing: -.01em; line-height: 1.3; }
h2.display { font-size: clamp(30px, 4.6vw, 48px); margin: 6px 0 16px; }
h3.display.small { font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 10px; }
.kicker { margin: 0; color: var(--sky-kicker); font-weight: 800; font-size: 14px; letter-spacing: .12em; }
/* (2.4.5) 일본어: 본문은 기기의 일본어 고딕으로 보통 줄바꿈(일본어는 글자 사이에서 줄을 바꾸고, 금칙은 엄격하게). 제목·리본·승급 띠는 게임과 같은
   Zen Maru Gothic, 편지는 손글씨 Yomogi — 일본어를 고를 때 app.js가 받는다. 큰 제목은 구절(U+200B) 사이에서만 줄을 바꾸고, 안 맞으면 어디서든. */
html[lang="ja"] body { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  word-break: normal; line-break: strict; }
html[lang="ja"] .display, html[lang="ja"] .toast .rib, html[lang="ja"] .promo { font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Hiragino Sans", "Yu Gothic", sans-serif; font-weight: 700; letter-spacing: 0; }
html[lang="ja"] .display { line-height: 1.38; }
html[lang="ja"] .display, html[lang="ja"] .hero-line, html[lang="ja"] .st, html[lang="ja"] .story h3, html[lang="ja"] .online-copy li { word-break: keep-all; overflow-wrap: anywhere; }
html[lang="ja"] .kicker { letter-spacing: .08em; }
.center { text-align: center; }
.muted { color: var(--sky-muted); }
main { color: var(--sky-ink); transition: color .45s; }
.kicker, .muted, .lead { transition: color .45s; }
.points li, .story, .neighbor, .recipe, .animals li, .fcard, .steps li, .studio-inner, .stats .stat, .st, .hire, .lot, .letter { color: var(--ink); }
.studio-inner .kicker { color: var(--green); } .studio-inner .muted { color: var(--muted); }
.small-text { font-size: 15px; }
.head { max-width: 760px; margin: 0 auto 28px; text-align: center; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 80; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- 하늘 ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.sky-l { position: absolute; inset: 0; opacity: 0; }
.l-dawn, .l-dusk, .l-night { visibility: hidden; }
.motion .l-dawn, .motion .l-dusk, .motion .l-night { will-change: opacity; }   /* (their own layers: the time of day only fades them, nothing is painted again; shown only while they show, so a phone keeps no screen-sized layer it cannot see) */
.l-day { opacity: 1; background: linear-gradient(180deg, #e9f4f8 0%, #f6f4ea 38%, var(--cream) 70%); }
.l-dawn { background: linear-gradient(180deg, #f6c7b6 0%, #f9dccb 35%, #fbefe2 70%, var(--cream) 100%); }
.l-dusk { background: linear-gradient(180deg, #f2a77e 0%, #f5c8a3 40%, #f8e3cf 75%, #fbf0e4 100%); }
.l-night { background: radial-gradient(1.6px 1.6px at 12% 18%, #fff 60%, transparent), radial-gradient(1.2px 1.2px at 28% 42%, #fff 60%, transparent),
    radial-gradient(1.8px 1.8px at 46% 12%, #fff8d0 60%, transparent), radial-gradient(1.1px 1.1px at 63% 33%, #fff 60%, transparent),
    radial-gradient(1.5px 1.5px at 78% 22%, #fff 60%, transparent), radial-gradient(1.2px 1.2px at 88% 48%, #fff 60%, transparent),
    radial-gradient(1.3px 1.3px at 8% 66%, #fff 60%, transparent), radial-gradient(1.7px 1.7px at 35% 76%, #fff8d0 60%, transparent),
    radial-gradient(1.1px 1.1px at 57% 62%, #fff 60%, transparent), radial-gradient(1.4px 1.4px at 71% 84%, #fff 60%, transparent),
    radial-gradient(1.2px 1.2px at 93% 74%, #fff 60%, transparent), radial-gradient(1.6px 1.6px at 20% 90%, #fff 60%, transparent),
    radial-gradient(120% 70% at 75% 10%, #2b3570 0%, transparent 60%), linear-gradient(180deg, #0f1430 0%, #18204a 55%, #232a5a 100%); }

/* ---------- HUD ---------- */
.hud { position: fixed; inset: 0 0 auto 0; z-index: 50; height: calc(var(--hud-h) + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px, calc((100% - 1180px) / 2)) 0;
  display: flex; align-items: center; gap: 14px; transition: background .35s, box-shadow .35s; }
.hud.solid { background: color-mix(in srgb, var(--cream) 94%, transparent); box-shadow: 0 1px 0 rgba(44, 34, 30, .08); }
.hud.dark.solid { background: rgba(16, 20, 46, .9); box-shadow: 0 1px 0 rgba(255, 255, 255, .08); }
@media (hover: hover) and (pointer: fine) {
  .hud.solid { background: color-mix(in srgb, var(--cream) 80%, transparent); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15); }
  .hud.dark.solid { background: rgba(16, 20, 46, .72); }
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: none; }
.hud.solid .brand { color: var(--brand-ink); }
.hud.dark .brand { color: var(--brand-pale); }
.hud:not(.solid) .brand { filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .28)); }   /* (white on the bright morning sky) */
.brand-mark { display: block; width: 46px; height: 24px; flex: none; }
.brand .word { display: block; width: 110px; height: 16px; background: currentColor; -webkit-mask: url(/img/brand/ndj-word.svg) center / contain no-repeat; mask: url(/img/brand/ndj-word.svg) center / contain no-repeat; }
.logo-defs { position: absolute; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hud-main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; justify-content: center; }
.hud-lv { position: relative; width: 46px; height: 46px; flex: none; }
.hud-lv img { width: 46px; height: 46px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.hud-lv b { position: absolute; inset: 2px 0 0; display: grid; place-items: center; font: 900 15px/1 "Pretendard Variable", sans-serif; color: #6b3f00; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.hud-lv.bump { animation: lvbump .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes lvbump { 0% { transform: scale(1); } 40% { transform: scale(1.35) rotate(-8deg); } 100% { transform: scale(1); } }
.hud-xp { position: relative; flex: 1 1 260px; max-width: 360px; min-width: 70px; }
.xp-track { display: block; height: 14px; border-radius: 999px; background: rgba(44, 34, 30, .62); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .25); overflow: hidden; }
.xp-fill { display: block; height: 100%; width: 100%; border-radius: inherit; transform-origin: left center; transform: scaleX(var(--xp, 0)); will-change: transform;
  background: linear-gradient(180deg, #b7f07c 0%, #6cc94a 55%, #3f9c32 100%); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .12); }
.xp-ticks a { position: absolute; top: -4px; left: calc(var(--at) * 100%); width: 10px; height: 22px; margin-left: -5px; display: grid; place-items: center; text-decoration: none; }
.xp-ticks a::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: rgba(255, 255, 255, .75); box-shadow: 0 0 0 1px rgba(44, 34, 30, .35); }
.xp-ticks a span { position: absolute; top: 24px; left: 50%; transform: translate(-50%, -4px); white-space: nowrap; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px;
  background: rgba(44, 34, 30, .88); color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.xp-ticks a:hover span, .xp-ticks a:focus-visible span { opacity: 1; transform: translate(-50%, 0); }
.hud-pill { position: relative; display: flex; align-items: center; height: 32px; padding: 0 12px 0 30px; margin-left: 12px; border-radius: 999px; flex: none;
  background: rgba(44, 34, 30, .76); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 2px 6px rgba(0, 0, 0, .18); }
.hud-pill img { position: absolute; left: -12px; top: 50%; width: 36px; height: 36px; margin-top: -18px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3)); }
.hud-pill b { font: 800 15px/1 "Pretendard Variable", sans-serif; font-variant-numeric: tabular-nums; min-width: 2ch; }
.hud-pill.pop { animation: pillpop .45s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pillpop { 40% { transform: scale(1.18); } }
.hud-clock b { min-width: 7.2ch; }
.lang { position: relative; display: flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px 0 9px; border-radius: 999px; flex: none; cursor: pointer;
  background: rgba(44, 34, 30, .76); color: #fff; font-weight: 800; font-size: 13px; line-height: 1; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); transition: background .25s; }
.lang:hover { background: rgba(44, 34, 30, .9); }
.lang-globe { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-cur { letter-spacing: .04em; }
.lang-cur::after { content: ""; display: inline-block; margin-left: 5px; vertical-align: 2px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }
/* 언어 고르기는 기기의 목록(한국어 · English · 日本語)으로: 투명한 select가 단추 전체를 덮는다. 16px는 iOS가 확대하지 않게 */
.lang select { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; font-size: 16px; border: 0; -webkit-appearance: none; appearance: none; }
.lang:focus-within { outline: 2px solid var(--sun); outline-offset: 2px; }
html:not(.js-sky) .lang { display: none; }   /* (app.js가 없으면 언어를 바꿀 수 없다: 단추도 감춘다) */

/* 알림(게임의 금빛 리본) · 떠오르는 숫자 */
.toasts { position: fixed; left: 0; right: 0; top: calc(var(--hud-h) + env(safe-area-inset-top) + 10px); z-index: 60; display: grid; justify-items: center; pointer-events: none; }
.toast { position: relative; display: grid; justify-items: center; }
.toast .rays { position: absolute; top: 50%; left: 50%; width: 300px; height: 300px; margin: -170px 0 0 -150px; opacity: .85; animation: spin 6s linear infinite; }
.toast .rib { position: relative; width: 300px; height: 90px; display: grid; place-items: center; padding-bottom: 12px; background: url("/img/ui/ribbon_gold.webp") center / 100% 100% no-repeat;
  font: 400 27px/1 "Jua", sans-serif; color: #6b3d00; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.toast .sub { position: relative; margin-top: -6px; background: rgba(44, 34, 30, .88); color: #fff; padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); }
@keyframes spin { to { rotate: 360deg; } }
.float-num { position: fixed; z-index: 70; pointer-events: none; font: 900 21px/1 "Pretendard Variable", sans-serif; color: #ffe066; text-shadow: 0 2px 0 #7a4a00, 0 0 10px rgba(0, 0, 0, .35); }
.crop-fly { position: fixed; z-index: 70; pointer-events: none; }
.plot.picked .crop { visibility: hidden; }
@keyframes regrow { from { scale: 0; } to { scale: 1; } }
.plot:focus-visible, .animals li:focus-visible { outline: 3px solid var(--green); outline-offset: 4px; border-radius: 18px; box-shadow: 0 0 0 7px rgba(255, 255, 255, .85); }
.fly-coin { position: fixed; z-index: 70; width: 30px; height: 30px; pointer-events: none; }

/* ---------- 첫 화면 (새벽) ---------- */
.hero { position: relative; color: #fff; }
.hero-stage { position: relative; min-height: max(520px, 100svh); overflow: hidden; display: grid; align-items: center; isolation: isolate; }
.hero-bg { position: absolute; inset: -4% 0 0 0; background: url("/img/hero_bg.webp") center 40% / cover no-repeat; transform: scale(1.06); z-index: -4; will-change: transform; }
.hero-sun { position: absolute; z-index: -1; width: clamp(84px, 9.5vw, 136px); left: 43%; top: 7%; will-change: transform, opacity; }
.hero-sun img { width: 100%; filter: drop-shadow(0 0 46px rgba(255, 205, 80, .85)); }
.hero-tint { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(20, 40, 70, .26) 0%, rgba(20, 40, 70, .04) 45%, transparent 70%), linear-gradient(90deg, rgba(25, 35, 20, .55) 0%, rgba(25, 35, 20, .14) 55%, transparent 100%); }
.hero-dawn { position: absolute; inset: 0; z-index: -2; opacity: 0; background: linear-gradient(180deg, rgba(44, 30, 92, .78) 0%, rgba(150, 70, 120, .5) 32%, rgba(240, 120, 96, .4) 58%, rgba(255, 180, 120, .22) 80%, rgba(255, 200, 150, .1) 100%); }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(180deg, transparent, rgba(251, 246, 236, .0)); pointer-events: none; }
.cloud { --cx: 0px; position: absolute; z-index: -2; left: 0; width: 260px; height: 80px; opacity: .7; transform: translateX(var(--cx)); animation: drift linear infinite; will-change: transform; }
.cloud i { position: absolute; inset: 0; border-radius: 80px; background: rgba(255, 255, 255, .75); filter: blur(10px); }
.cloud i::before, .cloud i::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud i::before { width: 120px; height: 120px; top: -60px; left: 40px; }
.cloud i::after { width: 90px; height: 90px; top: -40px; left: 130px; }
.c1 { top: 14%; animation-duration: 70s; animation-delay: -10s; }
.c2 { top: 26%; scale: .7; animation-duration: 95s; animation-delay: -50s; opacity: .5; }
.c3 { top: 8%; scale: .55; animation-duration: 120s; animation-delay: -80s; opacity: .45; }
@keyframes drift { from { translate: -320px 0; } to { translate: 110vw 0; } }   /* (moved, never laid out again) */
.hero-copy { will-change: transform, opacity; }
.hero-inner { width: min(1120px, 100% - 32px); margin: 0 auto; padding: calc(var(--hud-h) + 20px) 0 70px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 24px; }
.logo-wrap { position: relative; margin: 0; width: min(520px, 100%); }
.logo { width: 100%; height: auto; filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .35)); animation: pop .9s .2s cubic-bezier(.2, 1.4, .4, 1) both; }
.spark { position: absolute; width: 18px; height: 18px; background: #fff7c2; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 6px #ffe680); animation: twinkle 2.6s ease-in-out infinite; }
.s1 { top: 6%; right: 6%; } .s2 { top: 58%; left: -3%; width: 12px; height: 12px; animation-delay: .9s; } .s3 { bottom: 4%; right: 22%; width: 14px; height: 14px; animation-delay: 1.6s; }
@keyframes twinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: .2; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
.hero-line { font-size: clamp(19px, 2.3vw, 24px); font-weight: 650; line-height: 1.6; margin: 14px 0 24px; text-shadow: 0 2px 10px rgba(0, 0, 0, .45); animation: up .7s .45s both; }
/* 첫 화면: 1줄 [Google Play][App Store] 나란히 → 안내 문구 → [하루 시작하기]; 나타나는 순서도 같게 */
.hero-actions { display: flex; flex-direction: column; align-items: flex-start; }
.hero-badges { display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 12px; animation: up .7s .6s both; }
.hero-cta { margin-top: 18px; animation: up .6s .7s both; }   /* (끝나는 때는 옛 버튼 줄과 같은 1.3s) */
.btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; padding: 13px 26px; border-radius: 999px; transition: transform .2s, box-shadow .2s; }
.btn.primary { background: linear-gradient(180deg, #ffd765, #f5b335); color: #4a2f00; box-shadow: 0 5px 0 #c98a1c, 0 10px 22px rgba(242, 170, 60, .45); }
.btn.primary:hover { transform: translateY(-2px); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #c98a1c, 0 6px 14px rgba(242, 170, 60, .4); }
/* 스토어 배지(Google·Apple 공식 그림 그대로): 높이 Google 28px·Apple 40px 이상, 둘레 여백은 배지 높이의 1/4 이상(두 곳 가이드 같음) */
.store-badge { display: inline-block; line-height: 0; margin: 2px; border-radius: 9px; }
.store-badge[hidden] { display: none; }
.store-badge img { height: 54px; width: auto; }
/* (첫 화면 두 배지는 한 줄: 폰에선 폭에 맞춰 같이 줄되 40px(애플 화면 최소) 아래로는 안 내림; 6.61 = 두 배지 폭/높이 합(ko 3.24+3.37), 52 = 양옆 여백 32 + 사이 12 + 둘레 8) */
.hero-badges .store-badge img { height: var(--bh, 54px); }
.store-badge:focus-visible { outline: 3px solid #ffd765; outline-offset: 3px; }
.store-row { margin-top: 18px; }
.store-note { margin: 10px 0 0; font-size: 13px; font-weight: 650; }
.store-note:empty { display: none; }
.hero-copy .store-note { animation: up .7s .6s both; text-shadow: 0 1px 4px rgba(0, 0, 0, .55); }
.hero-art { --ax: 0%; --ay: 0%; position: relative; justify-self: center; width: min(520px, 100%); transform: translate(var(--ax), var(--ay)); will-change: transform; animation: bob 5s ease-in-out infinite; transform-origin: 50% 100%; }
.hero-char { width: 100%; height: auto; filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .35)); animation: fadein 1s .25s both; }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -12px; rotate: -1deg; } }   /* (the wrapper floats: the picture and its shadow are painted once) */
@keyframes up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.86) rotate(-3deg); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.scroll-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); will-change: opacity; margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); white-space: nowrap; }
.mouse { position: relative; width: 22px; height: 34px; border: 2px solid rgba(255, 255, 255, .85); border-radius: 12px; }
.mouse i { position: absolute; left: 50%; top: 6px; width: 4px; height: 7px; margin-left: -2px; border-radius: 2px; background: #fff; animation: cue 1.8s infinite; }
@keyframes cue { 0% { transform: translateY(0); opacity: 1; } 80% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

.motion .hero-dawn { opacity: 1; will-change: opacity; }   /* (a screen-sized layer only where it fades) */
.motion .hero-sun { opacity: 0; }

/* ---------- 소개 ---------- */
.intro { padding: 120px 0 20px; text-align: center; }
.intro .wrap { max-width: 860px; }
.intro h2.display { font-size: clamp(30px, 4.6vw, 50px); }
.words .w { display: inline-block; }
.words.split .w { --k: clamp(0, calc(var(--p, 1) * (var(--n) + 2) - var(--i) - 1), 1); opacity: calc(.14 + .86 * var(--k)); transform: translateY(calc((1 - var(--k)) * .5em)); will-change: transform, opacity; }
.lead { font-size: clamp(17px, 2vw, 20px); color: var(--sky-muted); max-width: 720px; margin: 0 auto; }

/* ---------- 장면 고정: .pin 안에서 sticky (스크립트가 자리를 정해 주면) ---------- */
.pin::after { content: ""; display: block; height: var(--room, 0px); }
.pin.on > :first-child { position: sticky; top: 0; }

/* ---------- 밭 (아침) ---------- */
.farm { padding: 0 0 60px; }
.stage { min-height: 100svh; display: grid; align-items: center; align-content: center; padding: calc(var(--hud-h) + 10px) 0 10px; }
.farm-stage { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
.steps { list-style: none; padding: 0; margin: 22px 0 14px; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 6px; padding: 5px 14px 5px 6px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); font-weight: 750; font-size: 15px; box-shadow: var(--shadow); transition: background .3s, border-color .3s, transform .3s, color .3s; }
.steps li img { width: 32px; height: 32px; object-fit: contain; }
.steps li.on { background: var(--green); border-color: var(--green); color: #fff; transform: translateY(-2px); }
.tap-hint { margin: 6px 0 0; font-weight: 700; color: var(--green); font-size: 15px; }
.tap-hint::before { content: "👆 "; }
.field { --pw: 31%; position: relative; width: min(560px, 100%); aspect-ratio: 560 / 470; justify-self: center; }
.plot { position: absolute; width: var(--pw); aspect-ratio: 360 / 258; left: calc(50% + (var(--c) - var(--r)) * 16.8% - var(--pw) / 2); top: calc(16% + (var(--c) + var(--r)) * 12.2%); z-index: calc(var(--c) + var(--r)); }
.plot .soil { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(70, 40, 10, .22)); }
.plot .seed, .plot .sprout, .plot .crop { position: absolute; transform-origin: 50% 100%; pointer-events: none; }
.plot .seed { width: 34%; left: 33%; bottom: 30%; opacity: 0; }
.plot .sprout { width: 44%; left: 28%; bottom: 36%; opacity: 0; }
.plot .crop { width: 64%; left: 18%; bottom: 36%; filter: drop-shadow(0 6px 5px rgba(60, 40, 10, .25)); }
.plot.ripe { cursor: pointer; }
.plot.ripe .crop { animation: ripe 1.6s ease-in-out infinite; }
.plot.regrow .crop, .plot.ripe.regrow .crop { animation: regrow .55s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes ripe { 0%, 100% { rotate: -2deg; } 50% { rotate: 2deg; translate: 0 -2px; } }
.can { position: absolute; width: 22%; left: -4%; top: 0; z-index: 9; opacity: 0; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .2)); pointer-events: none; }
.drops { position: absolute; left: 0; top: 0; z-index: 9; width: 14%; height: 18%; opacity: 0; pointer-events: none; }
.drops i { position: absolute; width: 8px; height: 12px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #7cc8f0; box-shadow: inset -2px -2px 0 rgba(0, 60, 120, .25); animation: drip .6s linear infinite; }
.drops i:nth-child(1) { left: 10%; animation-delay: 0s; } .drops i:nth-child(2) { left: 30%; animation-delay: .12s; } .drops i:nth-child(3) { left: 50%; animation-delay: .24s; } .drops i:nth-child(4) { left: 70%; animation-delay: .36s; } .drops i:nth-child(5) { left: 90%; animation-delay: .48s; }
@keyframes drip { from { translate: 0 0; opacity: 1; } to { translate: 0 70px; opacity: 0; } }
.pasture { padding: 70px 0 30px; }
.animals { list-style: none; padding: 0; margin: 10px auto 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; max-width: 920px; }
.animals li { transform: translateX(var(--ex, 0px)) rotate(var(--er, 0deg)); transition: translate .25s, rotate .25s, scale .15s; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 12px 6px 10px; text-align: center; box-shadow: var(--shadow); font-weight: 800; font-size: 15px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.animals li:hover { translate: 0 -6px; rotate: -2deg; }
.animals li:active { scale: .95; }
.animals .animal { width: 100%; aspect-ratio: 1; object-fit: contain; }
.say { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); white-space: nowrap; background: #fff; color: var(--ink); border-radius: 14px; padding: 4px 11px; font-weight: 800; font-size: 14px; box-shadow: 0 6px 14px rgba(0, 0, 0, .15); pointer-events: none; }
.say::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.heart-pop { position: absolute; width: 34px; height: 34px; pointer-events: none; z-index: 5; }
.shot { margin: 60px auto 0; max-width: 1000px; }
.shot-in { border-radius: 24px; overflow: hidden; box-shadow: 0 24px 50px rgba(60, 40, 10, .25); position: relative; border: 6px solid var(--card); }
.shot img { width: 100%; height: auto; }
.shot figcaption { position: absolute; left: 14px; bottom: 14px; background: rgba(0, 0, 0, .55); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; }

/* ---------- 공방 (한낮) ---------- */
.chain { padding: 40px 0 80px; }
.chain-stage { display: grid; align-content: center; }
.line { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; gap: 10px; max-width: 1060px; margin: 10px auto 26px; padding: 0 0 6px; }
.line::before { content: ""; position: absolute; left: 7%; right: 7%; bottom: 66px; height: 10px; border-radius: 6px; background: repeating-linear-gradient(90deg, #8b6a4a 0 14px, #a78260 14px 28px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), 0 3px 0 rgba(60, 40, 10, .25); opacity: .8; }
.st { position: relative; text-align: center; font-weight: 800; font-size: 15px; z-index: 1; }
.st .item { width: 98px; height: 98px; margin: 0 auto 6px; object-fit: contain; background: var(--card); border-radius: 26px; padding: 10px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.st .bld { width: 184px; height: 184px; margin: 0 auto -4px; object-fit: contain; filter: drop-shadow(0 12px 12px rgba(60, 40, 10, .22)); }
.bar { display: block; width: 76%; height: 12px; margin: 6px auto 4px; border-radius: 999px; background: rgba(44, 34, 30, .22); box-shadow: inset 0 2px 2px rgba(0, 0, 0, .25); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; transform: scaleX(var(--fill, 1)); transform-origin: left center; background: linear-gradient(180deg, #ffe07a, #f2a93b); border-radius: inherit; }
.st-mid { display: grid; justify-items: center; gap: 2px; }
.st-mid .item { width: 80px; height: 80px; border-radius: 22px; padding: 8px; }
.st-mid .plus { font-size: 24px; line-height: 1; color: var(--sky-muted); }
.st-bread .item { width: 128px; height: 128px; border-color: var(--sun); background: radial-gradient(circle, #fff6d6, var(--card)); box-shadow: 0 0 0 6px rgba(245, 184, 65, .28), var(--shadow); }
.st-bread .rays { max-width: none; scale: var(--rs, 1); position: absolute; left: 50%; top: 56px; width: 260px; height: 260px; margin: -130px 0 0 -130px; z-index: -1; opacity: .8; animation: spin 9s linear infinite; pointer-events: none; }
.tok { position: absolute; left: 0; top: 0; width: 62px; height: 62px; opacity: 0; z-index: 3; pointer-events: none; filter: drop-shadow(0 6px 6px rgba(60, 40, 10, .3)); }
.chain-body { max-width: 720px; margin: 0 auto; }
.recipes { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; margin: 40px auto 10px; perspective: 900px; }
.recipe { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 10px 18px; box-shadow: var(--shadow); }
.recipe img { width: 54px; height: 54px; object-fit: contain; }
.recipe i { font-style: normal; color: var(--muted); font-weight: 800; }

/* ---------- 일손 (오후) ---------- */
.staff { padding: 40px 0 60px; }
.staff-stage { display: grid; grid-template-columns: 1.05fr .95fr; gap: 50px; align-items: center; }
.board { position: relative; height: 430px; perspective: 1200px; }
.hire { position: absolute; top: 40px; left: 50%; width: 172px; height: 248px; margin-left: -86px; }
.board { --spread: 104; }
.hire.h1 { transform: translateX(calc(var(--spread) * -1%)) rotate(-7deg); }
.hire.h2 { transform: translateY(-14px); z-index: 2; }
.hire.h3 { transform: translateX(calc(var(--spread) * 1%)) rotate(7deg); }
.hire-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.face { position: absolute; inset: 0; border-radius: 22px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 16px 30px rgba(60, 40, 10, .2); }
.face.back { display: grid; place-items: center; transform: rotateY(180deg); background: repeating-linear-gradient(45deg, #3f8f5c 0 12px, #367f51 12px 24px); border: 6px solid #fffaf0; }
.face.back img { width: 46%; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .25)); }
.face.front { display: grid; justify-items: center; align-content: start; gap: 4px; padding: 16px 14px; background: var(--card); border: 1px solid var(--line); text-align: center; }
.face .pf { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--cream2); border: 4px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .12); }
.face b { font-size: 15px; margin-top: 4px; }
.stat { display: flex; justify-content: space-between; width: 100%; font-size: 14px; color: var(--muted); padding: 0 6px; }
.stat i { font-style: normal; font-weight: 700; }
.stat em { font-style: normal; color: #e5a51e; letter-spacing: 1px; }
.stamp { position: absolute; right: -16px; top: -16px; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font: 400 36px/1 "Jua", sans-serif; color: #d63a2f;
  border: 4px double #d63a2f; background: rgba(255, 250, 240, .9); transform: rotate(-14deg); box-shadow: 0 4px 10px rgba(214, 58, 47, .25); }
.promo { position: absolute; left: 50%; bottom: -18px; transform: translateX(-50%); white-space: nowrap; background: url("/img/ui/ribbon_gold.webp") center / 100% 100% no-repeat; padding: 10px 26px 16px; font: 400 16px/1 "Jua", sans-serif; color: #6b3d00; }
.review-cap { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; text-align: center; font-weight: 800; color: var(--sky-muted); }
.points { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; }
.points li { position: relative; padding: 13px 16px 13px 52px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.points li::before { content: ""; position: absolute; left: 16px; top: 16px; width: 22px; height: 22px; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

/* ---------- 읍내 (늦은 오후, 가로) ---------- */
.town { padding: 40px 0 40px; }
.town-stage { min-height: 100svh; display: grid; align-content: center; gap: 10px; padding-top: calc(var(--hud-h) + 6px); overflow: hidden; }
.town-head { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: end; }
.town-copy p:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-x, .stats .stat { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px; text-align: center; box-shadow: var(--shadow); color: var(--muted); }
.stats .stat b { display: block; font-family: "Jua", sans-serif; font-weight: 400; font-size: clamp(28px, 3.4vw, 40px); color: var(--green); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .stat span { font-weight: 700; font-size: 14px; }
.street { position: relative; margin-top: 18px; height: 300px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.street::-webkit-scrollbar { display: none; }
.street.run { overflow: hidden; }
.street-track { position: absolute; left: 0; bottom: 64px; display: flex; align-items: flex-end; gap: 34px; padding: 0 6vw 0 4vw; width: max-content; will-change: transform; }
.lot { width: 190px; flex: none; transform-origin: 50% 100%; }
.lot img { width: 100%; height: auto; filter: drop-shadow(0 12px 10px rgba(60, 40, 10, .2)); }
.lot.deco { width: 110px; }
.station { width: 280px; position: relative; display: grid; justify-items: center; }
.station-site { position: relative; width: 100%; }
.station-site img { width: 100%; transition: clip-path .5s; clip-path: inset(calc((1 - var(--build, 1)) * 100%) 0 0 0); }
.station-site::before { transition: opacity .4s; content: ""; position: absolute; left: 6%; right: 6%; bottom: 4%; height: 26%; border: 3px dashed rgba(110, 80, 50, .55); border-radius: 10px; opacity: var(--groundwork, 0); }
.scaffold { transition: opacity .4s; position: absolute; inset: 8% 10% 4%; border-radius: 6px; opacity: var(--scaffold, 0); pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 22px, #b07a3c 22px 26px), repeating-linear-gradient(0deg, transparent 0 26px, #c48a46 26px 30px); }
.station-steps { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 6px; }
.station-steps li { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 13px; background: var(--card); border: 2px solid var(--line); color: var(--muted); }
.station-steps li.on { background: var(--green); border-color: var(--green); color: #fff; }
.road { position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background: linear-gradient(180deg, #b8a98f, #a39275); box-shadow: inset 0 3px 0 rgba(255, 255, 255, .25); }
.road-lines { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: repeating-linear-gradient(90deg, #fff7e0 0 26px, transparent 26px 52px); opacity: .85; }
.truck { position: absolute; left: 14%; bottom: 8px; width: 124px; height: auto; z-index: 3; filter: drop-shadow(0 5px 4px rgba(0, 0, 0, .28)); animation: bump .45s ease-in-out infinite alternate; }
@keyframes bump { from { transform: translateY(0); } to { transform: translateY(-1.5px); } }
.town-note { margin: 14px auto 0; }

/* ---------- 이웃 (저녁) ---------- */
.people { padding: 40px 0 60px; }
.mail-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 40px; align-items: center; align-content: center; }
.mailbox { position: relative; width: min(300px, 80%); justify-self: center; aspect-ratio: 1; }
.mailbox .mb { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 16px 14px rgba(60, 40, 10, .25)); }
.mb-badge { position: absolute; right: 18%; top: 14%; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 18px; background: radial-gradient(circle at 35% 30%, #ff8a7a, #d93a2f); border: 3px solid #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .25); }
.env { position: absolute; width: 30%; left: 35%; top: 30%; opacity: 0; pointer-events: none; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .2)); }
.letter { grid-column: 1 / -1; position: relative; width: min(720px, 100%); justify-self: center; margin: 10px 0 0; padding: 34px 40px 26px; background: #fffaf0 repeating-linear-gradient(180deg, transparent 0 35px, #efe3cc 35px 36px); border-radius: 6px; box-shadow: 0 18px 40px rgba(60, 40, 10, .18); transform: rotate(-1.2deg); color: #3b3126; transform-origin: 50% 0; }
.letter blockquote { margin: 0; font-family: "Nanum Pen Script", cursive; font-size: clamp(25px, 3vw, 31px); line-height: 36px; }
.letter figcaption { margin-top: 8px; text-align: right; font-family: "Nanum Pen Script", cursive; font-size: 24px; color: #8a7a62; }
html[lang="ja"] .letter blockquote, html[lang="ja"] .letter figcaption { font-family: "Yomogi", "Hiragino Maru Gothic ProN", "Zen Maru Gothic", cursive; }
html[lang="ja"] .letter blockquote { font-size: clamp(19px, 2.2vw, 22px); }   /* (일본어 글자는 네모 한 칸을 다 써서, 같은 크기면 나눔펜보다 훨씬 커 보인다: 줄 간격 36px 그대로) */
html[lang="ja"] .letter figcaption { font-size: 17px; }
.letter .stamp-img { position: absolute; top: -26px; right: 24px; width: 64px; transform: rotate(12deg); filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
.stories-stage { padding: 50px 0 10px; }
.stories { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.story { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 18px; box-shadow: var(--shadow); }
.story img { width: 86px; height: 86px; border-radius: 50%; object-fit: cover; flex: none; background: var(--cream2); }
.story .duo { display: flex; flex: none; }
.story .duo img { width: 70px; height: 70px; margin-right: -18px; border: 3px solid var(--card); }
.story .duo img:last-child { margin-right: 0; }
.story .who { margin: 0; color: var(--green); font-weight: 800; font-size: 14px; }
.story h3 { margin: 2px 0 0; font-size: 19px; line-height: 1.4; }
.marquee { margin-top: 46px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.track { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; padding: 8px 16px 18px; }
.marquee.run .track { flex-wrap: nowrap; justify-content: flex-start; width: max-content; padding: 8px 0 18px; will-change: transform; }
.track .neighbor[aria-hidden="true"] { display: none; }
.marquee.run .track .neighbor[aria-hidden="true"] { display: flex; }
.neighbor { display: flex; align-items: center; gap: 12px; width: 330px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 12px 16px 12px 12px; box-shadow: var(--shadow); }
.neighbor img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex: none; background: var(--cream2); }
.neighbor b { display: block; font-size: 16px; }
.neighbor span { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }

/* ---------- 밤 (축제 · 명소) ---------- */
html:not(.js-sky) [data-theme="night"] { background: linear-gradient(180deg, #121836 0%, #1d2550 100%); color: #f3ecdf; }
html:not(.js-sky) [data-theme="night"] .kicker { color: #ffd866; }
html:not(.js-sky) [data-theme="night"] .muted { color: #c9c3d6; }
.festival { padding: 0; }
.fest-stage { position: relative; min-height: 100svh; display: grid; align-content: center; padding: calc(var(--hud-h) + 70px) 0 30px; overflow: hidden; text-align: center; }
.bunting { position: absolute; top: calc(var(--hud-h) + 6px); left: -2%; right: -2%; height: 46px; display: flex; justify-content: space-between; }
.bunting::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 2px; background: rgba(255, 255, 255, .55); border-radius: 50%; }
.bunting i { width: 34px; height: 40px; margin-top: 7px; clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top center; translate: 0 var(--by, 0px); animation: swing 2.4s ease-in-out infinite; }
.bunting i:nth-child(4n+1) { background: #f26b6b; } .bunting i:nth-child(4n+2) { background: #f2c14e; animation-delay: .3s; } .bunting i:nth-child(4n+3) { background: #6cc28f; animation-delay: .6s; } .bunting i:nth-child(4n) { background: #7cc0ea; animation-delay: .9s; }
@keyframes swing { 0%, 100% { rotate: -6deg; } 50% { rotate: 6deg; } }
.lanterns { position: absolute; top: calc(var(--hud-h) + 40px); left: 0; right: 0; display: flex; align-items: flex-start; justify-content: space-around; padding: 0 6%; pointer-events: none; }
.lanterns i { display: block; width: clamp(54px, 7vw, 92px); transform-origin: 50% 0; scale: var(--ls, 1); animation: swing 3.2s ease-in-out infinite; }   /* (the lantern swings; its glow is painted once inside it) */
.lanterns img { width: 100%; filter: drop-shadow(0 0 18px rgba(255, 170, 80, .75)); }
.lanterns i:nth-child(2n) { animation-delay: .8s; margin-top: 24px; }
.fest-copy { position: relative; z-index: 2; }
.fest-copy > p { max-width: 640px; margin-left: auto; margin-right: auto; }
.fests { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 8px; }
.fest { display: flex; align-items: center; gap: 8px; border: 1.5px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .1); color: #fff; border-radius: 999px; padding: 8px 18px 8px 10px; font: 800 16px/1 inherit; cursor: pointer; transition: transform .2s, background .2s; }
.fest img { width: 34px; height: 34px; object-fit: contain; }
.fest:hover, .fest:focus-visible { background: rgba(255, 255, 255, .22); transform: translateY(-3px); outline: none; }
.fest:active { transform: scale(.96); }
.fest-tap { font-size: 14px; margin: 6px 0 0; color: rgba(243, 236, 223, .8) !important; }
.crowd { position: relative; height: 210px; margin: 26px auto 0; width: min(760px, 100%); }
.crowd-stage { position: absolute; left: 50%; bottom: 10px; width: 230px; margin-left: -115px; filter: drop-shadow(0 0 30px rgba(255, 200, 120, .35)); }
.folk { position: absolute; bottom: 0; left: calc(50% + var(--x)); width: 66px; height: 66px; margin-left: -33px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .9); background: #2e3566; scale: var(--fs, 1); animation: hop 1.1s ease-in-out infinite; }
.folk:nth-child(2n) { animation-delay: .35s; }
.folk:nth-child(3n) { animation-delay: .7s; }
@keyframes hop { 0%, 100% { translate: 0 0; } 40% { translate: 0 -10px; } }
.goals { padding: 30px 0 70px; }
.goals-stage { display: grid; grid-template-columns: .9fr 1.1fr; gap: 50px; align-items: center; }
.dia-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); font-weight: 650; }
.dia-line img { width: 34px; height: 34px; flex: none; }
.landmarks { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: auto auto; gap: 12px; align-items: end; }
.lm { position: relative; margin: 0; }
.lm img { width: 100%; height: auto; clip-path: inset(calc((1 - var(--build, 1)) * 100%) 0 0 0); filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .35)) saturate(calc(.25 + .75 * var(--done, 1))); }
.lm.big { grid-column: 1 / 3; grid-row: 1 / 3; }
.lm.big.gold img { animation: glow 3s ease-in-out infinite; }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .35)); } 50% { filter: drop-shadow(0 0 26px rgba(255, 210, 90, .85)); } }
.lm .scaffold { inset: 10% 14% 6%; }
.lm-stage { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; }
.lm-stage:empty { display: none; }

/* ---------- 온라인 (다음 날 새벽) ---------- */
.online { padding: 40px 0 40px; }
.online-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; perspective: 1400px; }
.phone { margin: 0; position: relative; padding: 14px; background: #1c1c1e; border-radius: 34px; box-shadow: 0 26px 50px rgba(0, 0, 0, .3), inset 0 0 0 2px #3a3a3c; transform-style: preserve-3d; }
.phone .screen { border-radius: 22px; overflow: hidden; background: #000; }
.phone .screen img { width: 100%; height: auto; }
.backup { position: absolute; right: 26px; top: 26px; display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 18px rgba(0, 0, 0, .25); color: var(--ink); }
.ring { --ring: 1; width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--green) calc(var(--ring) * 360deg), #e4e0d6 0); display: grid; place-items: center; }
.ring::after { content: ""; width: 20px; height: 20px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%232f7d4f' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ring.busy::after { background-image: none; }
.ring-label { font-size: 13px; font-weight: 800; white-space: nowrap; }
.ticks { list-style: none; padding: 0; margin: 16px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ticks li { background: var(--green2); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-weight: 650; font-size: 15px; }
.friends { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 18px 0 12px; }
.fcard { display: grid; justify-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 10px 16px; box-shadow: var(--shadow); font-weight: 800; font-size: 14px; }
.fcard img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: var(--cream2); }
.hearts { position: relative; width: 120px; height: 56px; }
.hearts img { position: absolute; top: 12px; width: 30px; height: 30px; left: calc(50% - 15px); }
.hearts img:nth-child(1) { left: 6%; } .hearts img:nth-child(3) { left: calc(94% - 30px); }

/* ---------- 스튜디오 · 바닥 ---------- */
.studio { padding: 70px 0 60px; }
.studio-inner { display: flex; gap: 34px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 30px; padding: 36px; box-shadow: var(--shadow); }
.studio-mark { display: block; width: 210px; height: auto; flex: none; color: var(--brand-ink); overflow: visible; }
.studio p { margin: 0; }
.foot { border-top: 1px solid var(--line); padding: 26px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; background: var(--cream); }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.foot-brand { display: inline-flex; align-items: center; gap: 10px; }
.foot-mark { width: 31px; height: 16px; flex: none; color: var(--brand-ink); }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.foot a { text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot-tm { flex: 1 0 100%; margin: 0; font-size: 12px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 65; width: 100%; height: 100%; display: none; }
#confetti.on { display: block; }   /* (an idle full-screen canvas still costs a phone every frame) */

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1100px) and (min-width: 821px) { .board { transform: scale(.86); --spread: 88; } }
@media (max-width: 960px) {
  .hud-clock { display: none; }
  .town-head { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 820px) {
  :root { --hud-h: 58px; }
  .hud { gap: 8px; }
  .brand .word, .hud-dia { display: none; }
  .brand-mark { width: 40px; height: 21px; }
  .hud-main { gap: 8px; justify-content: flex-start; }
  .hud-lv { width: 40px; height: 40px; } .hud-lv img { width: 40px; height: 40px; }
  .hud-xp { flex: 1 1 auto; }
  .hud-pill { margin-left: 10px; padding: 0 10px 0 24px; height: 30px; }
  .hud-pill img { width: 32px; height: 32px; margin-top: -16px; left: -10px; }
  .xp-ticks { display: none; }
  .toast .rib { width: 220px; height: 66px; font-size: 21px; padding-bottom: 9px; }
  .toast .sub { font-size: 13px; padding: 5px 12px; }
  .toast .rays { width: 220px; height: 220px; margin: -125px 0 0 -110px; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; padding-bottom: 60px; gap: 4px; }
  .logo-wrap { margin: 0 auto; width: min(400px, 86%, 40svh); }
  .hero-line { margin: 8px 0 16px; font-size: 18px; }
  .hero-actions { align-items: center; }
  .store-badge img { height: 48px; }
  .hero-badges { --bh: clamp(40px, calc((100vw - 52px) / 6.61), 48px); }
  :root[lang="en"] .hero-badges { --bh: clamp(40px, calc((100vw - 52px) / 6.36), 48px); }
  :root[lang="ja"] .hero-badges { --bh: clamp(40px, calc((100vw - 52px) / 6.09), 48px); }
  .hero-art { width: min(300px, 62%, 30svh); order: -1; }
  .hero-sun { left: auto; right: 7%; top: calc(var(--hud-h) + 14px); }
  .hero-tint { background: linear-gradient(180deg, rgba(20, 30, 20, .12), rgba(20, 30, 20, .55) 55%, rgba(20, 30, 20, .35)); }
  .stage { padding-top: calc(var(--hud-h) + 6px); }
  .farm-stage, .staff-stage, .mail-stage, .goals-stage, .online-stage { grid-template-columns: 1fr; gap: 22px; align-content: center; }
  .farm-stage { gap: 4px; }
  .farm-copy h2.display { margin-bottom: 8px; }
  .farm-copy > p:not(.kicker):not(.tap-hint) { margin: 0; font-size: 16px; }
  .steps { margin: 12px 0 6px; }
  .steps li { font-size: 13px; padding: 3px 10px 3px 4px; }
  .steps li img { width: 26px; height: 26px; }
  .field { width: min(420px, 100%); }
  .line { gap: 4px; }
  .st { font-size: 12px; }
  .st .item { width: 56px; height: 56px; border-radius: 18px; padding: 7px; }
  .st .bld { width: 78px; height: 78px; }
  .st-mid .item { width: 48px; height: 48px; border-radius: 15px; padding: 5px; }
  .st-bread .item { width: 66px; height: 66px; }
  .st-bread .rays { width: 170px; height: 170px; margin: -85px 0 0 -85px; top: 34px; }
  .line::before { bottom: 44px; }
  .tok { width: 38px; height: 38px; }
  .board { height: 286px; order: 2; }
  .hire { width: 112px; height: 172px; margin-left: -56px; top: 22px; }
  .board { --spread: 100; }
  .face.front { padding: 8px 5px; gap: 1px; }
  .face .pf { width: 54px; height: 54px; border-width: 3px; }
  .face b { font-size: 11.5px; line-height: 1.3; }
  .stat { font-size: 11px; padding: 0 1px; }
  .stat em { letter-spacing: 0; }
  .stamp { width: 44px; height: 44px; font-size: 24px; right: -10px; top: -10px; border-width: 3px; }
  .promo { font-size: 12px; padding: 7px 14px 11px; bottom: -14px; }
  .points { gap: 8px; }
  .points li { padding: 10px 12px 10px 44px; font-size: 15px; }
  .points li::before { left: 12px; top: 13px; }
  .town-stage { gap: 4px; }
  .town-copy p:not(.kicker) { font-size: 15px; }
  .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stats .stat { padding: 8px 4px; border-radius: 14px; }
  .stats .stat b { font-size: 24px; }
  .stats .stat span { font-size: 11px; line-height: 1.35; display: block; }
  .street { height: 220px; margin-top: 10px; }
  .street-track { bottom: 50px; gap: 20px; }
  .lot { width: 130px; } .lot.deco { width: 74px; } .station { width: 190px; }
  .road { height: 50px; }
  .truck { width: 96px; bottom: 6px; left: 8%; }
  .mail-stage { gap: 14px; }
  .mailbox { width: min(220px, 62%); }
  .letter { padding: 26px 20px 18px; }
  .stories { grid-template-columns: 1fr; }
  .studio-inner { flex-direction: column; text-align: center; padding: 28px 20px; }
  .studio-mark { width: 168px; }
  .fest-stage { padding-top: calc(var(--hud-h) + 110px); }
  .crowd { height: 170px; }
  .crowd-stage { width: 170px; margin-left: -85px; }
  .folk { width: 48px; height: 48px; margin-left: -24px; }
  .goals-stage { gap: 26px; }
  .online-stage { gap: 26px; }
  .phone { padding: 10px; border-radius: 26px; }
  .backup { right: 16px; top: 16px; }
}
@media (max-width: 600px) {
  .animals { grid-template-columns: repeat(3, 1fr); }
  /* 공방: 3칸 두 줄 'ㄷ'자 — 밀 → 방앗간 → 밀가루·우유 → 빵집 → 우유빵 */
  .line { --ico: 64px; grid-template-columns: repeat(3, 1fr); grid-template-areas: "wheat mill mid" "bread bakery mid"; align-items: start; row-gap: 22px; column-gap: 6px; padding: 0; margin: 4px auto 18px; }
  .line::before { display: none; }
  .st-wheat { grid-area: wheat; } .st-mill { grid-area: mill; } .st-mid { grid-area: mid; align-self: center; } .st-bakery { grid-area: bakery; } .st-bread { grid-area: bread; }
  .st { font-size: 13px; line-height: 1.35; }
  .st .item, .st-bread .item { width: var(--ico); height: var(--ico); border-radius: 20px; padding: 8px; }
  .st .bld { width: 84px; height: 84px; margin: -10px auto -12px; }
  .st-mid .item { width: 58px; height: 58px; border-radius: 18px; padding: 6px; }
  .st-mid { gap: 0; }
  .st-bread .rays { width: 150px; height: 150px; margin: -75px 0 0 -75px; top: 32px; }
  .bar { width: 70%; height: 10px; margin: 6px auto 4px; }
  .st-wheat::after, .st-mill::after, .st-bread::after, .st-bakery::after { content: ""; position: absolute; z-index: -1; top: calc(var(--ico) / 2 - 4px); left: 62%; width: 76%; height: 8px; border-radius: 5px;
    background: repeating-linear-gradient(90deg, #8b6a4a 0 12px, #a78260 12px 24px); opacity: .75; }
  .st-wheat .item, .st-bread .item { margin-bottom: 18px; }   /* (labels on one line with the mill's and the bakery's: their bar takes that room) */
  .tok { width: 40px; height: 40px; }
  /* 축제: 초롱은 작게 제목 위로, 무대도 작게 */
  .lanterns { top: calc(var(--hud-h) + 30px); padding: 0 4%; }
  .lanterns i { width: 50px; }
  .lanterns i:nth-child(2n) { margin-top: 12px; }
  .fest-stage { padding-top: calc(var(--hud-h) + 96px); }
  .crowd { height: 150px; margin-top: 18px; }
  .crowd-stage { width: 128px; margin-left: -64px; bottom: 26px; }
  .folk { width: 42px; height: 42px; margin-left: -21px; }
}
@media (max-width: 400px) {
  .board { --spread: 88; }
  .hire { width: 104px; height: 166px; margin-left: -52px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 7px 8px; }
  .stats .stat b { font-size: 22px; }
  .stats .stat span { font-size: 12px; }
  .lanterns i:nth-child(2), .lanterns i:nth-child(4) { display: none; }
}
@media (max-width: 480px) {
  body { font-size: 16px; }
  .ticks { grid-template-columns: 1fr; }
  .neighbor { width: 280px; }
  .intro { padding: 90px 0 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .cloud, .spark, .drops, .can, .tok, .env { display: none; }
}
