/* Language switcher, "View in <language>" bar and script-specific type rules. Loaded by every page (link in the <!-- i18n:head --> block).
   Hand-written; the markup it styles is written by scripts/i18n/lib/decorate.mjs and /i18n/langbar.js. System fonts only (no downloads). */

/* ---- header dropdown (details/summary: works without JavaScript) ---- */
.lang-switch{position:relative;display:inline-block;flex:none;font:500 13px/1 Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;letter-spacing:0;text-transform:none;color:rgba(255,255,255,.8)}
.lang-switch>summary{list-style:none;display:inline-flex;align-items:center;gap:7px;min-height:40px;box-sizing:border-box;padding:0 12px;border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(12,16,18,.35);color:inherit;cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}
.lang-switch>summary::-webkit-details-marker{display:none}
.lang-switch>summary::marker{content:""}
.lang-switch>summary::after{content:"";width:6px;height:6px;margin-left:1px;border-right:1.6px solid currentColor;border-bottom:1.6px solid currentColor;transform:rotate(45deg) translateY(-2px);opacity:.7;transition:transform .15s ease}
.lang-switch[open]>summary::after{transform:rotate(-135deg) translateY(-1px)}
.lang-switch>summary:hover,.lang-switch[open]>summary{background:rgba(255,255,255,.08);color:#fff}
.lang-switch>summary:focus-visible,.lang-list a:focus-visible,.lang-footer a:focus-visible,.lang-bar a:focus-visible,.lang-bar button:focus-visible{outline:2px solid #6ae9a4;outline-offset:2px}
.lang-globe{width:16px;height:16px;flex:none}
.lang-code{font-weight:600;letter-spacing:.04em}
.lang-list{position:absolute;right:0;top:calc(100% + 8px);z-index:90;min-width:190px;max-height:min(70vh,440px);overflow:auto;margin:0;padding:6px;list-style:none;background:#12181b;border:1px solid rgba(255,255,255,.14);border-radius:12px;box-shadow:0 18px 40px rgba(0,0,0,.5)}
.lang-list li{margin:0;padding:0}
.lang-list a{display:block;padding:10px 12px;border-radius:8px;color:rgba(255,255,255,.84);font:500 14px/1.2 Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Nirmala UI","Microsoft YaHei","Yu Gothic",sans-serif;text-decoration:none;white-space:nowrap}
.lang-list a:hover{background:rgba(255,255,255,.08);color:#fff}
.lang-list a[aria-current]{color:#6ae9a4;font-weight:700}
/* home page: the switcher sits next to the menu button on a phone and after the button on a desktop */
nav>.lang-switch{margin-left:16px}
@media(max-width:767px){nav>.lang-switch{margin-left:auto;margin-right:10px}}
/* the demo / game page headers are flex rows */
.showcase-header>.lang-switch{margin:0 0 0 auto}
.showcase-header>.lang-switch+.header-play,.showcase-header>.lang-switch+button{margin-left:12px}
.site-header .wrap>.lang-switch,.bar>.lang-switch{margin-left:14px}
@media(max-width:560px){.lang-switch>summary{padding:0 10px;min-height:38px}.lang-list{min-width:176px}}

/* ---- footer row ---- */
.lang-footer{display:flex;flex-wrap:wrap;align-items:center;gap:8px 18px;box-sizing:border-box;flex:1 1 100%;grid-column:1/-1;width:100%;margin:22px 0 0;padding:16px 0 0;border-top:1px solid rgba(255,255,255,.12);font:500 13px/1.5 Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Nirmala UI","Microsoft YaHei","Yu Gothic",sans-serif;letter-spacing:0;text-transform:none;color:rgba(255,255,255,.7)}
.lang-footer .lang-globe{opacity:.7}
.lang-footer a{color:inherit;text-decoration:none;white-space:nowrap}
.lang-footer a:hover{color:#fff;text-decoration:underline;text-underline-offset:3px}
.lang-footer a[aria-current]{color:#6ae9a4;font-weight:700}
.showcase-footer .lang-footer{order:4}

/* ---- "View this page in <language>" bar (English page, browser prefers one of our languages) ---- */
.lang-bar{position:fixed;z-index:95;left:16px;bottom:16px;display:flex;align-items:center;gap:12px;box-sizing:border-box;max-width:min(460px,calc(100vw - 32px));padding:10px 10px 10px 16px;background:#12181b;color:#f0f5f1;border:1px solid rgba(255,255,255,.16);border-radius:14px;box-shadow:0 14px 34px rgba(0,0,0,.5);font:500 14px/1.35 Inter,system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Nirmala UI","Microsoft YaHei","Yu Gothic",sans-serif;letter-spacing:0;text-transform:none}
.lang-bar-text{flex:1 1 auto;min-width:0}
.lang-bar-go{flex:none;display:inline-flex;align-items:center;min-height:36px;box-sizing:border-box;padding:0 14px;border-radius:10px;background:#6ae9a4;color:#06130c;font-weight:700;text-decoration:none;white-space:nowrap}
.lang-bar-go:hover{background:#8bf0b9}
.lang-bar-close{flex:none;width:34px;height:34px;padding:0;border:0;border-radius:8px;background:transparent;color:rgba(255,255,255,.72);font:400 22px/1 system-ui,sans-serif;cursor:pointer}
.lang-bar-close:hover{background:rgba(255,255,255,.1);color:#fff}
@media(max-width:760px){.lang-bar{left:12px;right:12px;bottom:auto;top:78px;max-width:none}}
@media(prefers-reduced-motion:no-preference){.lang-bar{animation:lang-bar-in .28s ease-out}@keyframes lang-bar-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}}

/* ---- note on translated legal pages: the English text is the binding one ---- */
.lang-notice{margin:18px 0 0;padding:12px 14px;max-width:64ch;box-sizing:border-box;border:1px solid rgba(255,255,255,.14);border-left:3px solid #6ae9a4;border-radius:10px;background:rgba(255,255,255,.04);color:rgba(255,255,255,.84);font-size:14px;line-height:1.55}
.lang-notice a{color:#6ae9a4;text-decoration:underline;text-underline-offset:3px}

/* ---- scripts without a bundled web font: system fonts, no negative letter-spacing, correct line breaking ---- */
html:lang(hi) body,html:lang(hi) button,html:lang(hi) input,html:lang(hi) select,html:lang(hi) textarea{font-family:Inter,"Nirmala UI","Mangal","Kohinoor Devanagari","Noto Sans Devanagari",system-ui,sans-serif}
html:lang(zh-Hans) body,html:lang(zh-Hans) button,html:lang(zh-Hans) input,html:lang(zh-Hans) select,html:lang(zh-Hans) textarea{font-family:Inter,"PingFang SC","Microsoft YaHei","Noto Sans SC","Hiragino Sans GB","WenQuanYi Micro Hei",system-ui,sans-serif}
html:lang(ja) body,html:lang(ja) button,html:lang(ja) input,html:lang(ja) select,html:lang(ja) textarea{font-family:Inter,"Hiragino Kaku Gothic ProN","Hiragino Sans","Yu Gothic","Meiryo","Noto Sans JP",system-ui,sans-serif}
html:lang(hi) *,html:lang(zh-Hans) *,html:lang(ja) *{letter-spacing:normal!important}
html:lang(zh-Hans) body,html:lang(ja) body{line-break:strict;overflow-wrap:anywhere}
html:lang(hi) body{line-height:1.7}
html:lang(hi) :is(h1,h2,h3,.hero-tagline){line-height:1.32!important}
html:lang(vi) body{line-height:1.65}
/* long words (German, Turkish, Polish, Vietnamese compounds) must never push the page sideways */
html:lang(de) body,html:lang(tr) body,html:lang(pl) body,html:lang(fi) body{overflow-wrap:break-word;hyphens:auto;hyphenate-limit-chars:10 4 4}
