/* Language controls do not occupy the playable game viewport. */
.home-language{display:flex;align-items:center;gap:12px;margin:12px 0 2px}
.language-globe{display:grid;place-items:center;min-width:64px;min-height:64px;width:64px;height:64px;padding:10px;border:1px solid #d7c38b99;border-radius:50%;color:#f2dfb0;background:#ffffff0b;cursor:pointer}
.language-globe svg{width:38px;height:38px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.language-current{font-family:system-ui,'PingFang TC','PingFang SC','Hiragino Sans','Malgun Gothic',sans-serif;font-size:14px;line-height:1.4;letter-spacing:normal;text-transform:none;color:inherit}
.language-globe:focus-visible,.language-dialog button:focus-visible{outline:3px solid #ffe2a0;outline-offset:4px}
.language-overlay{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));background:#071b20c9;overscroll-behavior:contain}
.language-dialog{position:relative;width:min(100%,480px);max-height:86vh;max-height:86dvh;overflow:auto;padding:24px;border:1px solid #d6c18a88;border-radius:20px;background:#193631;color:#f6ecd0;box-shadow:0 20px 80px #0008;font-family:system-ui,'PingFang TC','PingFang SC','Hiragino Sans','Malgun Gothic',sans-serif}
.language-dialog h2{margin:0 50px 20px 0;font-size:25px;line-height:1.3;letter-spacing:normal;text-transform:none}
.language-close{position:absolute;top:12px;right:12px;width:48px;min-height:48px;padding:0;border:1px solid #d5c69a55;border-radius:50%;background:#ffffff08;color:inherit;font-size:28px;line-height:1}
.language-choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.language-choices button{position:relative;min-width:0;min-height:58px;padding:10px 29px 10px 12px;border:1px solid #d5c69a66;border-radius:12px;background:#ffffff08;color:inherit;font:inherit;font-size:16px;line-height:1.3;white-space:normal;overflow-wrap:break-word;letter-spacing:normal;text-transform:none;cursor:pointer;text-align:start}
.language-choices button[aria-pressed=true]{border-color:#f5d78a;background:#f5d78a20}
.language-choices button span{position:absolute;right:9px;top:50%;transform:translateY(-50%);font-size:16px}
html[lang^=zh] .eyebrow,html[lang=ja] .eyebrow,html[lang=ko] .eyebrow{letter-spacing:.05em}
@media(max-width:350px){.language-dialog{padding:20px 14px}.language-choices{gap:8px}.language-choices button{font-size:15px;padding-left:9px}}
@media(prefers-reduced-motion:reduce){.language-dialog,.language-globe{scroll-behavior:auto}}

/* Seeded opaque cabinets reveal only after keyed static copy is bound. */
html.jpanda-locale-preparing body{visibility:hidden}

/* Localised words may wrap; control identifiers and the playable viewport do not change. */
html:not([lang=en]) .hero-actions,html:not([lang=en]) .buttons{flex-wrap:wrap}
html:not([lang=en]) .hero-actions button,html:not([lang=en]) .buttons button{white-space:normal;overflow-wrap:break-word}
html[lang="zh-Hant"]{--jpanda-locale-font:"Noto Sans TC","Noto Sans CJK TC","PingFang TC","Microsoft JhengHei",sans-serif}
html[lang="zh-Hans"]{--jpanda-locale-font:"Noto Sans SC","Noto Sans CJK SC","PingFang SC","Microsoft YaHei",sans-serif}
html[lang=ja]{--jpanda-locale-font:"Noto Sans JP","Noto Sans CJK JP","Hiragino Sans","Yu Gothic",Meiryo,sans-serif}
html[lang=ko]{--jpanda-locale-font:"Noto Sans KR","Noto Sans CJK KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif}
html[lang^=zh] body,html[lang=ja] body,html[lang=ko] body{font-family:var(--jpanda-locale-font)}
html[lang^=zh] .language-dialog,html[lang=ja] .language-dialog,html[lang=ko] .language-dialog{font-family:var(--jpanda-locale-font)}
html:not([lang=en]) .dialog h2,html:not([lang=en]) .dialog h3{overflow-wrap:break-word}

/* Each autonym keeps its own script font, regardless of the currently selected language. */
.language-choices [lang="zh-Hant"],.language-current[lang="zh-Hant"]{font-family:"Noto Sans TC","Noto Sans CJK TC","PingFang TC","Microsoft JhengHei",sans-serif}
.language-choices [lang="zh-Hans"],.language-current[lang="zh-Hans"]{font-family:"Noto Sans SC","Noto Sans CJK SC","PingFang SC","Microsoft YaHei",sans-serif}
.language-choices [lang="ja"],.language-current[lang="ja"]{font-family:"Noto Sans JP","Noto Sans CJK JP","Hiragino Sans","Yu Gothic",Meiryo,sans-serif}
.language-choices [lang="ko"],.language-current[lang="ko"]{font-family:"Noto Sans KR","Noto Sans CJK KR","Apple SD Gothic Neo","Malgun Gothic",sans-serif}

/* Keep the original Latin heading face; choose the selected script's local fallback
   before a generic font. Restricted to CJK locales, so English geometry is unchanged. */
html:is([lang^=zh],[lang=ja],[lang=ko]) :where(h1,h2,.lede,.hero-caption,.hero-art p,.room-label>span:not(.floor-label),.room-label strong,.mission-card strong,.stats b,.postcard h3,.scrapbook-grid strong){font-family:Georgia,var(--jpanda-locale-font)!important}
html:is([lang^=zh],[lang=ja],[lang=ko]) :is(.room-label .floor-label,.rights-notice){font-family:Arial,Helvetica,var(--jpanda-locale-font)}

/* Long translated title words may wrap on narrow screens. Keep the designed
   type size instead of shrinking to fit; this does not match English. */
html:not([lang=en]) .home h1{max-width:100%;overflow-wrap:anywhere}
