/* BG-I18N-R1.360: compact shared locale picker; existing header, rail and navigation keep their geometry. */
.page>.header,.page>.bottom,.home-content .lobby{direction:ltr}
.page>.bottom b[data-i18n]{max-width:100%;text-align:center;overflow-wrap:anywhere}
.auth-input input{direction:ltr;text-align:left}
html[dir="rtl"] :is(.auth-title-login,.auth-title-register){text-align:right}
[data-bg-language-open]>svg,[data-bg-language-open]>img{display:block;width:1.8125rem;height:1.8125rem;flex:none}
.bg-language-popover{box-sizing:border-box;position:fixed;z-index:1100;display:flex;flex-direction:column;width:7.5rem;max-height:11rem;max-height:min(11rem,var(--bg-language-space,11rem));padding:0;border:1px solid #e1e9f3;border-radius:.875rem;background:#fff;color:#7187a8;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;font-size:.875rem;font-weight:500;box-shadow:0 5px 16px rgba(29,55,90,.08);overflow:hidden;direction:ltr;-webkit-tap-highlight-color:transparent}
.bg-language-options{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:.375rem;scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch}
.bg-language-options::-webkit-scrollbar{display:none}
.bg-language-option{box-sizing:border-box;display:grid;grid-template-columns:1rem minmax(0,1fr);align-items:center;gap:.5rem;width:100%;min-height:2.5rem;padding:.375rem;border:0;border-radius:.375rem;background:#fff;color:inherit;font-family:inherit;font-size:inherit;font-weight:500;line-height:1.4;text-align:start;cursor:pointer;direction:ltr;-webkit-tap-highlight-color:transparent}
.bg-language-option>img,.bg-language-option>svg{display:block;width:1rem;height:1rem;flex:none}
.bg-language-name{min-width:0;overflow-wrap:anywhere;text-align:start}
.bg-language-option.is-selected{color:#2584f4}
.bg-language-option:focus-visible{outline:2px solid #397df8;outline-offset:-2px}
/* Foreign captions may need two lines; icons and column widths stay unchanged. */
html:not([lang="zh-CN"]) .home-content .rail{max-height:calc(100vh - 3.75rem - var(--nav) - env(safe-area-inset-bottom) - .875rem);max-height:calc(100dvh - 3.75rem - var(--nav) - env(safe-area-inset-bottom) - .875rem);margin-inline:-.25rem;padding-inline:.25rem;overflow-x:hidden;overflow-y:auto;scrollbar-width:none;overscroll-behavior-y:contain}
html:not([lang="zh-CN"]) .home-content .rail::-webkit-scrollbar{display:none}
html:not([lang="zh-CN"]) .rail>button[data-cat]{flex:none;grid-template-rows:2.625rem auto;padding-block:.1875rem}
html:not([lang="zh-CN"]) .rail b[data-i18n^="home.rail"]{height:auto;min-height:.9375rem;font-size:.6875rem;line-height:1.15;white-space:normal;overflow-wrap:anywhere}
html:not([lang="zh-CN"]) .page>.header .actions{min-width:0;flex:1;justify-content:flex-end}
html:not([lang="zh-CN"]) .page>.header :is(.login,.register){min-width:0;max-width:6rem;height:auto;min-height:2rem;padding:.2rem .45rem;flex-shrink:1;white-space:normal;overflow-wrap:anywhere;font-size:.75rem;font-weight:500;line-height:1.15}
