html[data-km-language-pending] body{visibility:hidden}
/* Local fonts and normal word wrapping keep Thai marks and regional CJK glyphs readable offline. */
html[lang="th"]{--km-locale-font:"Leelawadee UI","Noto Sans Thai",Tahoma,system-ui,sans-serif}
html[lang="zh-Hant"]{--km-locale-font:"PingFang TC","Microsoft JhengHei","Noto Sans TC",system-ui,sans-serif}
html:is([lang="th"],[lang="zh-Hant"]) :is(body,button,input,select,textarea,.btn,.km-language,.km-feature-bar,.km-portal,h1,h2,h3){font-family:var(--km-locale-font)}
html[lang="th"] :is(p,li,small,label,.badge,.btn,.km-viewbar button,.km-language select){letter-spacing:normal;line-height:1.65;word-break:normal;overflow-wrap:break-word}
html[lang="th"] :is(h1,h2,h3){letter-spacing:normal;line-height:1.4;word-break:normal;overflow-wrap:break-word}
/* The native Indonesian language name needs room in the compact toolbar. */
html[lang="id"] .km-language select,html[lang="id"].km-playing .km-language-compact select{width:160px;max-width:160px}
/* Direction belongs to text; game cells keep the engines' coordinate order. */
.km-bidi-token,[dir="ltr"]:is(code,pre,input,textarea){unicode-bidi:isolate}
html[lang="ar"] body{font-family:system-ui,"Noto Sans Arabic","Noto Naskh Arabic",Tahoma,sans-serif}
html[lang="ar"] :is(button,input,select,textarea,.btn,.km-language){font-family:inherit;letter-spacing:normal}
html[lang="ar"] :is(.btn,.km-viewbar button,.km-language select){line-height:1.5}
html[dir="rtl"] .km-language-global{margin-left:0;margin-inline-start:auto}
html[dir="rtl"] :is(.chess-coach,.sudoku-coach,.km-options,.collection-dialog){text-align:start}
html[dir="rtl"] .km-language select{direction:rtl}
html[dir="rtl"] details p{margin-inline-start:0;margin-inline-end:30px}
@media(max-width:700px){html[dir="rtl"] .km-language-global{margin:0}}
.km-portal-header{flex-wrap:wrap}
.km-language{display:flex;align-items:center;gap:8px;color:#16354d;font:600 13px/1.35 system-ui,sans-serif;flex:0 0 auto}.km-language select{box-sizing:border-box;min-height:44px;max-width:148px;border:1px solid #a9c4d8;border-radius:9px;padding:8px;background:#fffdf4;color:#16354d;font:600 14px/1.3 system-ui,sans-serif;cursor:pointer}.km-language select:focus-visible{outline:3px solid #be7610;outline-offset:2px}.km-language-compact{display:none}html.km-playing .km-language-compact{display:flex}html.km-playing .km-language-compact>span{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}html.km-playing .km-language-compact select{width:108px;max-width:108px}.topbar,.game-header,.collection-header{flex-wrap:wrap}.chess-coach li,.chess-coach p,.game-info,.board-caption,.km-stop strong,.km-stop small{overflow-wrap:anywhere}.km-viewbar button{white-space:normal}.km-view-actions{min-width:0}.category-tabs a,.tile-top,.hero-actions,.collection-toolbar,.game-toolbar{flex-wrap:wrap}.km-language-global{margin-left:auto}@media(max-width:700px){.km-language-global{margin:0}.km-language-global>span{font-size:12px}.km-language select{max-width:130px}.km-game-menu .km-menu-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.km-viewbar .km-view-actions{gap:4px}html.km-playing .km-language-compact select{width:100px;max-width:100px}.collection-toolbar .btn,.game-toolbar .btn{white-space:normal}}
