/* Language selection belongs to the entrance; rooms retain the selected language. */
.garden-language{position:fixed;top:12px;right:14px;z-index:180;display:flex;align-items:flex-end;flex-direction:column;gap:3px;color:#f6e8cc;font-family:system-ui,sans-serif;pointer-events:auto;}
body:has(.scene.active) .garden-language{display:none;}
.language-options{display:flex;align-items:center;gap:1px;padding:2px 4px;background:#142017ed;border:1px solid #d6bd83;border-radius:24px;box-shadow:0 4px 20px #0005;}
.language-options button{min-height:44px;min-width:64px;padding:7px 10px;border:0;border-radius:21px;color:#f1e0bd;background:transparent;font:inherit;font-size:.82rem;cursor:pointer;}
.language-options button[aria-pressed="true"]{background:#ddc28b;color:#1c291c;font-weight:700;}
.language-options>span{font-size:.72rem;opacity:.6;}
.language-about{font:inherit;font-size:.65rem;padding:4px 8px;min-height:24px;border:1px solid #d6bd8370;border-radius:12px;background:#142017ed;color:#f2e2bf;cursor:pointer;}
.language-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;}
.top-menu{top:102px;max-width:min(52vw,540px);}
.palace-exit,.theater-exit{top:104px;}
.i18n-original-note{font-family:system-ui,sans-serif;font-size:.74rem;line-height:1.55;color:#d4c3a5;background:#ffffff06;border-left:2px solid #b9a16c;padding:8px 10px;margin:8px 0 14px;}
.i18n-original-note[hidden]{display:none!important;}
#newContentBody>.i18n-original-note{font-size:.61rem;padding:2px 0;border:0;background:none;margin:4px 0;}
#languageDialog{box-sizing:border-box;width:min(620px,calc(100vw - 28px));max-height:88svh;overflow:auto;padding:24px;color:#f4ead7;background:#172117;border:1px solid #cbb17a;border-radius:16px;box-shadow:0 20px 80px #0009;}
#languageDialog::backdrop{background:#071008b8;backdrop-filter:blur(5px);}
#languageDialog h2{margin:0 0 18px;color:#f1dca9;font-weight:500;font-size:1.35rem;}
#languageDialog p{font-size:.92rem;line-height:1.8;}
#languageDialog .choice{min-height:44px;width:100%;text-align:center;}
html[lang="en"] .tooltip{white-space:normal;min-width:190px;max-width:min(250px,70vw);}
html[lang="en"] .tooltip small{line-height:1.4;}
html[lang="en"] .speech{line-height:1.65;}
html[lang="en"] .choice,html[lang="en"] .menu-btn{overflow-wrap:break-word;line-height:1.45;}
html[lang="en"] #informationPanel .news-item{grid-template-columns:66px 49px 1fr;}
html[lang="en"] #informationPanel .news-list{max-height:150px;}
html[lang="en"] #informationPanel.is-collapsed{width:218px;}
html[lang="en"] #informationPanel .card-header{gap:8px;}
html[lang="en"] .garden-counter details{font-size:8px;}
html[lang="en"] .counter-face small{font-size:9px;}
html[lang="en"] .floating-hint{width:max-content;max-width:calc(100vw - 28px);text-align:center;}
html[lang="en"] .new-dialog-header{flex-wrap:wrap;}
html[lang="en"] .garden-welcome span{font-size:min(8.5vw,24vh);}
@media(max-width:700px){
 .garden-language{top:10px;right:10px;}
 .language-options button{min-width:60px;padding:7px 8px;font-size:.78rem;}
 .top-menu{top:auto;bottom:14px;right:12px;max-width:calc(100vw - 24px);gap:6px;}
 #informationPanel,#informationPanel.is-collapsed,html[lang="en"] #informationPanel.is-collapsed{width:calc(100vw - 164px);max-width:245px;left:10px;top:10px;padding:8px 10px;}
 #informationPanel .card-header{gap:4px;flex-wrap:wrap;}
 #informationPanel .card-header h2{font-size:1rem;}
 #informationPanel .info-toggle{font-size:.7rem;padding:5px 7px;}
 html[lang="en"] #informationPanel .news-item{grid-template-columns:auto 1fr;}
 .palace-exit,.theater-exit{top:12px;left:12px;right:auto;max-width:calc(100vw - 170px);}
 html[lang="en"] .scene-title{max-width:calc(100vw - 170px);padding:10px 12px;}
 html[lang="en"] .scene-title .t1{font-size:1.2rem;}
 html[lang="en"] .scene-title .t2{font-size:.8rem;}
 html[lang="en"] .top-menu .menu-btn{font-size:.73rem;padding:8px 10px;}
 html[lang="en"] .floating-hint{bottom:74px;font-size:.68rem;}
 html[lang="en"] .theater-choices{grid-template-columns:1fr;}
 html[lang="en"] #newContentWindow.is-collapsed{width:196px;}
 html[lang="en"] .garden-welcome span{font-size:min(16vw,22vh);}
 #languageDialog{padding:18px;}
}
@media(max-width:370px){
 #informationPanel .card-header h2{font-size:.86rem;}
 html[lang="en"] .top-menu{max-width:calc(100vw - 24px);}
 html[lang="en"] .floating-hint{bottom:106px;}
}

/* Keep the Research Room title clear of the upper-right language switch. */
#researchScene .scene-title{left:24px;right:auto;max-width:calc(100vw - 196px);}
@media(max-width:850px){
 #researchScene .scene-title{left:12px;right:auto;top:max(12px,env(safe-area-inset-top));max-width:calc(100vw - 178px);padding:9px 12px;}
}

/* The language help button must not cover the mobile news-window controls. */
@media(max-width:700px){#newContentWindow{top:max(var(--new-top,80px),96px);}}
/* On narrow screens, keep Takumi's face below the persistent controls. */
@media(max-width:700px){#theaterScene{padding-top:96px;}#theaterScene::after{top:96px;}}
@media(max-width:370px){
 .floating-hint{bottom:106px;text-align:center;}
 html[lang="en"] #researchScene .scene-title .t1{font-size:1rem;}
 html[lang="en"] #researchScene .scene-title .t2{font-size:.72rem;}
}
