.world-entry{position:relative;display:flex;flex-direction:column;gap:4px;padding:18px 50px 18px 22px;margin-top:12px;border-radius:14px;text-decoration:none;color:#fff8de;background:#294b3b;box-shadow:0 5px 20px #172d2330}.world-entry>span{font-family:var(--serif);font-size:22px;font-weight:700}.world-entry>small{font-size:14px;color:#e4e5c7}.world-entry>b{position:absolute;right:22px;top:25px;font-size:25px}
.shrine-world{width:min(1000px,calc(100% - 24px));margin:0 auto 30px;color:#293c31;background:#fffaf0;border:1px solid #cdb98d;border-radius:22px;overflow:hidden;box-shadow:0 16px 50px #10231630}
.shrine-world[hidden],.shrine-world [hidden]{display:none!important}
.world-heading{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:20px 22px 12px}.world-heading p{font-size:13px;letter-spacing:.06em;color:#646952;margin:0 0 4px}.world-heading h2{font-family:var(--serif);font-size:30px;margin:0;line-height:1.4}
.shrine-world button,.world-interaction a{font:inherit;font-size:14px;min-height:44px;border:1px solid #a9b29a;border-radius:10px;background:#fffaf0;color:#294b3b;padding:10px 14px;cursor:pointer;text-decoration:none;font-weight:700;touch-action:manipulation}.shrine-world button:focus-visible,.shrine-world a:focus-visible,.world-viewport:focus-visible{outline:3px solid #c66b2b;outline-offset:-3px}.shrine-world button:disabled{opacity:.6;cursor:wait}
.world-bar{padding:9px 22px;display:flex;flex-wrap:wrap;gap:10px;justify-content:space-between;background:#e6ebdc;font-size:14px}.world-bar a{color:#294b3b}.world-bar>span{overflow-wrap:anywhere;max-width:100%}
.world-viewport{position:relative;width:100%;height:clamp(360px,56svh,580px);background:#70854a;overflow:hidden;isolation:isolate;touch-action:none;user-select:none;-webkit-user-select:none}.world-plane{position:absolute;top:0;left:0;will-change:transform;transform-origin:top left}.world-map{position:absolute;inset:0;width:100%;height:100%;max-width:none;pointer-events:none;user-select:none}
.shrine-world .world-place{position:absolute;transform:translate(-50%,-100%);background:#fff8e8f2;border:1px solid #856743;box-shadow:0 3px 10px #30220d33;border-radius:8px;font-size:15px;line-height:1.4;padding:5px 12px;z-index:3;min-width:78px}.world-place span{display:block;font-size:12px;color:#796644}
.world-avatar{position:absolute;width:100px;height:100px;transform:translate(-50%,-97%);pointer-events:none;z-index:4;filter:drop-shadow(0 4px 2px #25311940)}.world-avatar-art{position:relative;width:100%;height:100%;transform-origin:50% 95%}.world-avatar-art i{position:absolute;inset:0;display:block;background-image:url('./assets/world-avatars.webp');background-size:300% 200%;background-repeat:no-repeat}.world-avatar-head{clip-path:inset(0 0 56% 0)}.world-avatar-body{clip-path:inset(44% 0 0 0)}.world-avatar-label{position:absolute;bottom:-15px;left:50%;transform:translateX(-50%);font-size:11px;padding:1px 8px;border-radius:20px;background:#fffdf0eb;color:#294b3b;white-space:nowrap}.is-walking .world-avatar-art{animation:worldWalk .33s infinite alternate ease-in-out}@keyframes worldWalk{from{transform:translateY(0) rotate(-2deg)}to{transform:translateY(-3px) rotate(2deg)}}
.world-target{position:absolute;width:18px;height:9px;transform:translate(-50%,-50%);border:2px solid #fff9db;border-radius:50%;box-shadow:0 0 0 2px #657840;pointer-events:none}.world-loading{position:absolute;bottom:12px;left:12px;right:12px;border-radius:10px;padding:12px;background:#fff8e8;color:#493d25;font-size:14px;pointer-events:none}
.world-interaction{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px 20px;background:#f1ead6;border-top:1px solid #d5c49c;min-height:88px}.world-interaction strong{font-family:var(--serif);font-size:20px}.world-interaction p{font-size:14px;line-height:1.6;margin:3px 0 0}.world-interaction a{background:#294b3b;color:white;flex-shrink:0;text-align:center}
.world-controls{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:16px 20px 4px}.world-dpad{display:grid;grid-template-columns:repeat(3,48px);grid-template-rows:repeat(2,44px);gap:4px;flex-shrink:0}.world-dpad button{padding:0;font-size:23px;touch-action:none;user-select:none;-webkit-user-select:none}.world-dpad button:first-child{grid-column:2}.world-dpad button:nth-child(2){grid-row:2;grid-column:1}.world-dpad button:nth-child(3){grid-row:2;grid-column:2}.world-dpad button:nth-child(4){grid-row:2;grid-column:3}.world-destinations{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.world-help,.world-footnote{font-size:13px;line-height:1.7;color:#65705f;margin:12px 20px 16px}.world-footnote{border-top:1px solid #e0d7bf;padding-top:12px}
.world-dress{margin:20px;padding:20px;border:1px solid #c7c9ad;border-radius:16px;background:#f5f3e7}.world-dress h3{font-family:var(--serif);font-size:23px;margin:0 0 12px}.world-dress-layout{display:flex;align-items:center;justify-content:center;gap:24px}.world-avatar-preview{width:180px;height:180px;flex-shrink:0;background:#e6eadb;border-radius:50%}.world-options{display:flex;flex-direction:column;gap:12px;flex:1;max-width:350px}.world-options label{display:flex;flex-direction:column;gap:5px;font-size:14px}.world-options select{width:100%;min-height:44px;font:inherit;font-size:16px;border-radius:8px;padding:7px;border:1px solid #a9b29a;background:#fff;color:#293c31}.world-dress #worldSave{display:block;margin:20px auto 0;background:#294b3b;color:#fff;width:min(100%,300px)}#worldSaveStatus{font-size:14px;line-height:1.7;text-align:center}.world-login{font-size:14px;text-align:center}.world-login .auth-status{font-size:13px}
@media(max-width:600px){.world-heading{padding:16px 14px 10px}.world-heading h2{font-size:25px}.world-heading p{font-size:12px}.world-bar{padding:8px 14px}.world-avatar{width:85px;height:85px}.world-interaction{padding:12px;flex-wrap:wrap}.world-interaction a{width:100%}.world-controls{padding:12px;gap:10px}.world-destinations{flex-direction:column}.world-destinations button{padding:6px 12px;min-height:38px}.world-dress{margin:12px;padding:14px}.world-dress-layout{gap:12px}.world-avatar-preview{width:120px;height:120px}.world-options{min-width:0}.world-help,.world-footnote{margin:12px;font-size:13px}}
@media(prefers-reduced-motion:reduce){.is-walking .world-avatar-art{animation:none}}


.world-avatar[data-facing="right"]{transform:translate(-50%,-97%) scaleX(-1)}
.world-avatar[data-facing="right"] .world-avatar-label{transform:translateX(-50%) scaleX(-1)}
/* Portrait-first map shell. Menus and destination pages stay in the same document. */
body[data-screen="shrineWorld"]{overflow:hidden}
body[data-screen="shrineWorld"] .shrine-world{position:fixed;inset:0;z-index:90;width:100%;height:100vh;height:100dvh;max-width:none;margin:0;border:0;border-radius:0;display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);box-sizing:border-box}
.shrine-world .world-heading{padding:8px 10px;gap:6px;min-width:0;background:#fffaf0;z-index:5}.world-heading>div{flex:1;min-width:0}.world-heading p{display:none}.world-heading h2{font-size:18px;white-space:nowrap}.world-heading button{padding:8px;font-size:13px}
.world-exit{display:flex;align-items:center;justify-content:center;min-height:44px;padding:0 10px;border:1px solid #a9b29a;border-radius:10px;background:#fffaf0;color:#294b3b;font-size:14px;font-weight:700;text-decoration:none;flex-shrink:0}
.shrine-world .world-bar{padding:7px 12px;gap:10px;flex-wrap:nowrap;z-index:5}.world-bar>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}.world-bar a{flex-shrink:0}
.shrine-world .world-viewport{position:relative;height:100%;min-height:0;width:100%;grid-row:3;z-index:0}
.shrine-world .world-interaction{position:relative;grid-row:4;min-height:100px;padding:12px;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;z-index:5;box-sizing:border-box}.world-interaction strong{font-size:18px}.world-interaction p{font-size:13px;line-height:1.5}.shrine-world #worldInteract{background:#294b3b;color:#fff;min-height:48px;max-width:170px}
.shrine-world .world-controls{position:absolute;z-index:4;left:10px;bottom:calc(116px + env(safe-area-inset-bottom));padding:0;pointer-events:none}.world-controls .world-destinations{display:none}.world-dpad{grid-template-columns:repeat(3,38px);grid-template-rows:repeat(2,38px);gap:3px;pointer-events:auto}.world-dpad button{background:#fffaf0df;min-height:38px;font-size:20px}
.shrine-world .world-help,.shrine-world .world-footnote{display:none}
.shrine-world .world-dress{position:absolute;z-index:8;top:64px;bottom:12px;left:12px;right:12px;margin:0;padding:16px;overflow:auto;box-sizing:border-box;overscroll-behavior:contain;box-shadow:0 10px 40px #172d2370}
.world-place-menu{position:fixed;inset:0;margin:auto;width:min(460px,calc(100% - 28px));max-height:80vh;max-height:80dvh;overflow:auto;box-sizing:border-box;padding:20px;border:1px solid #b9ac8b;border-radius:18px;background:#fffaf0;color:#293c31;z-index:120;box-shadow:0 12px 70px #10231655}
.world-place-menu::backdrop{background:#142a20a8}.world-menu-heading{display:flex;justify-content:space-between;align-items:center;gap:12px}.world-menu-heading h3{font-family:var(--serif);font-size:23px;margin:0}.world-place-menu p{font-size:14px;line-height:1.7}.world-place-items{display:grid;gap:10px;margin-top:16px}.world-place-items a,.world-place-items button{display:flex;align-items:center;justify-content:center;min-height:50px;text-decoration:none;font-size:16px;padding:12px;border:1px solid #b9ac8b;border-radius:10px;background:#fff;color:#294b3b;font-weight:700;text-align:center}.world-place-items a:focus-visible{outline:3px solid #a95827;outline-offset:2px}
@media(max-width:350px){.world-heading h2{font-size:15px}.world-heading button{font-size:12px;padding:6px}.world-exit{padding:0 6px}.world-interaction{grid-template-columns:1fr!important}}

/* Both views follow the same body[data-time] clock as the top page. */
#worldTimeLabel{font-size:12px;font-weight:400;color:#65705f;margin-left:3px}
.world-map{transition:filter 1.2s ease,opacity 1.2s ease}
.world-map-night{opacity:0}
.world-plane::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:1;transition:background 1.2s ease}
.world-target{z-index:2}
body[data-time="morning"] #worldMap{filter:brightness(1.06) saturate(.93)}
body[data-time="morning"] .world-plane::after{background:linear-gradient(120deg,#ffe7a425,transparent 65%)}
body[data-time="evening"] #worldMap{filter:brightness(.87) saturate(1.08) sepia(.14)}
body[data-time="evening"] .world-plane::after{background:linear-gradient(115deg,#ff913f30,#69367518)}
body[data-time="night"] #worldMap{filter:brightness(.55) saturate(.7)}
body[data-time="night"] .night-ready .world-map-night{opacity:1}
body[data-time="night"] .world-avatar-art{filter:brightness(.87)}
@media(prefers-reduced-motion:reduce){.world-map,.world-plane::after{transition:none}}

/* The cave remains visible to all visitors while entry is restricted. */
.shrine-world .world-cave-place{background:#f6eddbf5;border-color:#705e49;min-width:90px;transform:translate(-50%,24%)}
.world-cave-place span{color:#634d39}

/* The shrine and the town share one scrolling plane. */
.world-plane .world-shrine-map{top:0;bottom:auto;height:50%}.world-plane .world-town-map{top:50%;bottom:auto;height:50%}.world-town-map-night{opacity:0;filter:brightness(.55) saturate(.85) hue-rotate(12deg)}
body[data-time="night"] .night-ready .world-town-map-night{opacity:1}
.world-sacred-tree{position:absolute;left:10%;top:5%;width:32%;height:16%;object-fit:contain;pointer-events:none;z-index:2;filter:drop-shadow(0 8px 5px #17210b66)}
body[data-time="night"] .world-sacred-tree{filter:brightness(.65) drop-shadow(0 8px 5px #17210b66)}
.world-plane .world-unified-map{top:0;left:0;width:100%;height:100%;object-fit:fill}
body[data-time="night"] .night-ready .world-unified-map.world-map-night{opacity:1;filter:brightness(.5) saturate(.82)}

/* Four individually drawn directions for each Edo beastfolk and stray cat. */
.world-inhabitant{position:absolute;z-index:3;width:80px;height:100px;transform:translate(-50%,-92%);pointer-events:none;filter:drop-shadow(0 3px 2px #211a1855)}
.world-sprite{position:absolute;inset:0;background-image:var(--sprite);background-size:400% 100%;background-repeat:no-repeat;filter:hue-rotate(var(--tone,0deg))}
.world-cart{width:125px;height:105px}
.world-cat{width:51px;height:53px;transform:translate(-50%,-80%)}
.world-guard{width:92px;height:112px}
.world-drunk{width:85px;height:105px}
.world-inhabitant.is-roaming .world-sprite{animation:worldWalk .42s ease-in-out infinite alternate}
.world-drunk.is-roaming .world-sprite{animation:drunkWalk .8s ease-in-out infinite alternate}
.world-glow{display:none;position:absolute;z-index:-1;left:50%;top:67%;width:140px;height:115px;transform:translate(-50%,-50%);border-radius:50%;background:radial-gradient(circle,#ffe9a089 0%,#ffca545a 30%,#ffb43a00 70%);filter:blur(9px);animation:lanternGlow 2.6s ease-in-out infinite alternate}
.world-after-dark .world-guard .world-glow,.world-after-dark .world-drunk .world-glow{display:block}
@keyframes lanternGlow{to{opacity:.65;transform:translate(-50%,-50%) scale(1.14)}}
@keyframes drunkWalk{to{transform:rotate(6deg) translateY(-2px)}}
@media(prefers-reduced-motion:reduce){.world-inhabitant.is-roaming .world-sprite,.world-glow{animation:none!important}}

/* Mining-inspired walking cycle: subtle alternating feet at rest, longer strides in motion. */
.world-avatar-body{clip-path:inset(44% 0 12% 0)}
.world-avatar-leg-left{clip-path:inset(83% 50% 0 0);transform-origin:25% 84%;transform:translateX(var(--skin-offset,0%));animation:worldIdleLeft 1.4s ease-in-out infinite alternate}
.world-avatar-leg-right{clip-path:inset(83% 0 0 50%);transform-origin:75% 84%;transform:translateX(var(--skin-offset,0%));animation:worldIdleRight 1.4s ease-in-out infinite alternate}
.world-avatar.is-walking .world-avatar-leg-left{animation:worldStrideLeft .38s ease-in-out infinite alternate}
.world-avatar.is-walking .world-avatar-leg-right{animation:worldStrideRight .38s ease-in-out infinite alternate}
.world-avatar:not(.is-walking) .world-avatar-art{animation:worldBreathing 3s ease-in-out infinite alternate}
.world-avatar.is-walking .world-avatar-art{animation:worldWalk .38s ease-in-out infinite alternate}
@keyframes worldIdleLeft{to{transform:translateX(var(--skin-offset,0%)) translateY(-1px) rotate(-1.5deg)}}
@keyframes worldIdleRight{to{transform:translateX(var(--skin-offset,0%)) translateY(1px) rotate(1.5deg)}}
@keyframes worldStrideLeft{from{transform:translateX(var(--skin-offset,0%)) translateY(-4px) rotate(-6deg)}to{transform:translateX(var(--skin-offset,0%)) translateY(3px) rotate(6deg)}}
@keyframes worldStrideRight{from{transform:translateX(var(--skin-offset,0%)) translateY(3px) rotate(6deg)}to{transform:translateX(var(--skin-offset,0%)) translateY(-4px) rotate(-6deg)}}
@keyframes worldBreathing{to{transform:translateY(-1px) scaleY(1.005)}}

/* Residents share the visitor's scale; the handcart remains wider for its load. */
.world-inhabitant{width:70px;height:86px}
.world-guard{width:74px;height:90px}
.world-drunk{width:70px;height:86px}
.world-cart{width:104px;height:87px}
.world-cat{width:46px;height:46px}
@media(max-width:600px){.world-inhabitant{width:60px;height:73px}.world-guard{width:64px;height:78px}.world-drunk{width:60px;height:73px}.world-cart{width:91px;height:78px}.world-cat{width:40px;height:40px}}
@media(prefers-reduced-motion:reduce){.world-avatar-art,.world-avatar-leg{animation:none!important}}

/* Separate, full-sized shrine and town maps. */
.world-plane[data-map="town"] .world-place[data-world-destination]:not([data-world-destination^="town"]),.world-plane[data-map="shrine"] .world-place[data-world-destination^="town"]{display:none}
.world-map-gate{position:absolute;z-index:6;left:50%;bottom:9%;transform:translateX(-50%);border:2px solid #d5b36d;border-radius:999px;background:#60332eea;color:#fff7e5;font-size:19px;font-weight:800;white-space:nowrap;padding:13px 25px;box-shadow:0 4px 16px #27191288;cursor:pointer}
.world-plane[data-map="town"] .world-map-gate{top:5%;bottom:auto}
.world-map-gate:focus-visible{outline:3px solid #fff;outline-offset:4px}

/* A compact overview stays fixed as the large painting scrolls underneath. */
.world-minimap{position:absolute;z-index:7;top:10px;left:10px;width:138px;padding:7px 8px 5px;box-sizing:border-box;border:1px solid #dec798;border-radius:10px;background:#1f392ee8;color:#fff9e7;box-shadow:0 5px 18px #17281b66;pointer-events:none}
.world-minimap strong{display:block;font-size:13px;line-height:1.4;text-align:center}
.world-minimap svg{display:block;width:100%;height:218px;border-radius:5px;overflow:hidden}
.world-minimap-key{display:flex;align-items:center;justify-content:center;gap:5px;font-size:12px;line-height:1.2}
.world-minimap-key i{width:8px;height:8px;border:1px solid #fff;border-radius:50%;background:#e94c38}
.world-avatar{width:72px;height:72px}
.world-inhabitant{width:56px;height:69px}.world-guard{width:60px;height:73px}.world-drunk{width:56px;height:69px}.world-cart{width:85px;height:71px}.world-cat{width:38px;height:38px}
.shrine-world .world-place{font-size:13px;padding:4px 8px;min-width:62px}.shrine-world .world-place span{font-size:12px}
@media(max-width:600px){.world-minimap{top:8px;left:8px;width:116px;padding:5px 6px 4px}.world-minimap strong{font-size:12px}.world-minimap svg{height:181px}.world-avatar{width:62px;height:62px}.world-inhabitant{width:51px;height:62px}.world-guard{width:54px;height:66px}.world-drunk{width:51px;height:62px}.world-cart{width:78px;height:65px}.world-cat{width:34px;height:34px}}
