.site-language{display:inline-flex;align-items:center;gap:.35rem;flex:0 0 auto;color:#ffcc55;margin:0;white-space:nowrap}.site-language svg{width:1.05rem;height:1.05rem;fill:none;stroke:currentColor;stroke-width:1.6}.site-language select{width:auto;min-width:4.8rem;min-height:36px;margin:0;padding:.35rem .28rem;border:1px solid #415365;border-radius:7px;background:#17232e;color:#f4f6f8;font:inherit;font-size:.86rem;cursor:pointer;color-scheme:dark}.site-language select:focus-visible{outline:2px solid #ffcb49;outline-offset:2px}.site-language-notice:not([hidden]){position:fixed;left:50%;bottom:1rem;transform:translateX(-50%);width:max-content;max-width:90vw;z-index:1000;background:#182734;border:1px solid #ffd05a;border-radius:.6rem;padding:.7rem 1rem;color:white}.account-security>.site-language{display:flex;justify-content:flex-end}.profile-nav,.admin-top-actions{flex-wrap:wrap}.account-bar>.site-language{order:0}@media(max-width:760px){.top .account-bar{flex-wrap:wrap}.profile-nav{gap:.5rem}}

/* Flag picker: native select remains available until enhancement succeeds. */
.site-language.language-enhanced>svg,.language-enhanced>.language-native{display:none}
.language-button{display:inline-flex;align-items:center;gap:9px;min-height:40px;margin:0;padding:7px 11px;border:1px solid #625234;border-radius:10px;background:linear-gradient(130deg,#202b35,#141e27);color:#f8f4e8;font:inherit;font-size:13px;cursor:pointer;white-space:nowrap}
.language-button:hover,.language-button[aria-expanded=true]{border-color:#f1c462;background:#26323d}
.language-button:focus-visible,.language-option:focus-visible{outline:2px solid #ffcc55;outline-offset:3px}
.language-flag,.language-option img{object-fit:cover;border-radius:3px;box-shadow:0 0 0 1px #ffffff24;flex:none}
.language-chevron{color:#f3cb74;margin-inline-start:3px}
.language-menu{position:fixed;z-index:12000;box-sizing:border-box;overflow-y:auto;overscroll-behavior:contain;padding:6px;background:#15212c;border:1px solid #98783b;border-radius:13px;box-shadow:0 12px 40px #0009;color-scheme:dark;scrollbar-width:thin}
.language-menu[hidden]{display:none}
.language-option{box-sizing:border-box;display:flex;align-items:center;gap:13px;width:100%;min-height:41px;border:0;border-radius:8px;padding:9px 12px;margin:0;background:transparent;color:#f5f6f8;font:inherit;font-size:14px;text-align:start;cursor:pointer}
.language-option:hover,.language-option:focus-visible{background:#263746}
.language-option[aria-selected=true]{background:#ffcc5519;color:#ffda83}
.language-check{margin-inline-start:auto;opacity:0}.language-option[aria-selected=true] .language-check{opacity:1}
html[lang=ja],html[lang=ko],html[lang=zh]{font-family:system-ui,-apple-system,"Segoe UI",sans-serif}
html[dir=rtl] body{direction:rtl}html[dir=rtl] :is(input[type=email],input[type=url],input[type=password],input[inputmode=numeric],.game-canvas,.screen-wrap,canvas,.controls,.game-controls,.score,.match-score){direction:ltr}
html[dir=rtl] :is(.quicknav,.footer-links,.account-bar){text-align:start}
html[dir=rtl] :is(.chat-message p,.chat-messages p){text-align:start;unicode-bidi:plaintext}
html[dir=rtl] :is(progress,meter){direction:rtl}
@media(max-width:540px){.language-button{min-height:42px;padding:7px 9px;gap:7px}.language-menu{border-radius:11px}.language-option{min-height:44px}}
/* Shared header: explicit rows keep longer translations aligned. */
header.top {
 display:grid;grid-template-columns:200px minmax(0,1fr) auto;
 grid-template-areas:"brand nav account";align-items:center;
 min-height:90px;height:auto;gap:8px 14px;padding:8px 32px;
}
header.top>.brand--crest{grid-area:brand;width:min(100%,200px);min-width:0}
header.top>.quicknav{grid-area:nav;min-width:0;width:auto;height:auto;min-height:44px;margin:0;gap:8px;justify-content:center;align-self:stretch}
header.top>.quicknav>:is(a,button){display:flex;align-items:center;justify-content:center;min-width:0;padding:6px;font-size:12px;line-height:1.35;text-align:center;white-space:normal;overflow-wrap:anywhere;text-decoration:none}
header.top>.account-bar{grid-area:account;display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;gap:8px;min-width:0;max-width:100%;width:auto;margin:0}
header.top .member-tools{flex:0 0 auto;flex-wrap:nowrap;gap:6px;min-width:0}
header.top .member-tools>a{padding:9px 10px;font-size:12px;line-height:1.3}
header.top .account-bar>#account-summary[data-member]{display:flex;flex:0 1 220px;min-width:160px;max-width:220px;white-space:normal;text-align:start;padding:8px 10px;gap:8px}
header.top .member-progress{min-width:0;flex:1}
header.top .member-progress small{overflow-wrap:anywhere;line-height:1.35}
header.top .member-progress progress{min-width:0}
header.top .account-bar>:is(#account-open,#logout){min-height:40px;line-height:1.3}
@media(min-width:901px) and (max-width:1439px){
 header.top{grid-template-columns:200px minmax(0,1fr);grid-template-areas:"brand nav" "account account";padding-inline:24px}
 header.top>.quicknav{justify-content:flex-end;gap:18px}
 header.top>.account-bar{width:100%;justify-content:flex-end;flex-wrap:wrap}
}
@media(max-width:900px){
 header.top{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"brand language" "online signin" "nav nav";gap:7px 10px;padding:8px max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left))}
 header.top:is([data-member-layout],:has(#account-summary[data-member])){grid-template-areas:"brand language" "summary summary" "tools logout" "nav nav";grid-template-rows:minmax(55px,auto) minmax(68px,auto) minmax(44px,auto) minmax(44px,auto)}
 header.top>.brand--crest{width:min(100%,172px)}
 header.top>.account-bar{display:contents}
 header.top .account-bar>.site-language{grid-area:language;justify-self:end;min-width:0;max-width:100%;margin:0}
 header.top .site-language select{min-height:40px;font-size:16px;max-width:100%}
 header.top .account-bar>#account-open{grid-area:signin;justify-self:end;max-width:100%;white-space:normal}
 header.top .account-bar>#logout{grid-area:logout;justify-self:end;max-width:100%;white-space:normal}
 header.top .account-bar>.online-pill{grid-area:online;justify-self:start;font-size:11px;color:#bfcbc5}
 header.top .account-bar>#account-summary[data-member]{grid-area:summary;width:100%;max-width:none;min-width:0;margin:0;padding:7px 10px;gap:9px}
 header.top .member-level{flex:0 0 31px;width:31px;height:35px;font-size:16px}
 header.top .member-progress{gap:2px}
 header.top .member-progress strong{padding-inline-end:96px;font-size:13px;line-height:17px}
 header.top .member-progress progress{height:4px}
 header.top:is([data-member-layout],:has(#account-summary[data-member])) .online-pill{grid-area:summary;align-self:start;justify-self:end;margin:8px 11px 0;line-height:17px;font-size:10px;gap:4px}
 header.top .account-bar>.member-tools{display:none}
 header.top:is([data-member-layout],:has(#account-summary[data-member])) .member-tools{display:flex;grid-area:tools;justify-self:start;align-items:center;flex-wrap:wrap;min-width:0;max-width:100%;gap:6px}
 header.top .member-tools>:is(a,button):not([hidden]),header.top .account-bar>:is(#account-open,#logout):not([hidden]){display:inline-flex;align-items:center;justify-content:center;min-height:40px;min-width:0;max-width:100%;padding:5px 9px;border-radius:8px;font-size:12px;line-height:1.3;white-space:normal;overflow-wrap:anywhere;text-align:center}
 header.top .member-tools>#notifications-toggle:not([hidden]){flex:none;width:40px;height:40px;padding:0}
 header.top>.quicknav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;margin:0;gap:4px;min-height:44px;justify-content:normal}
 header.top>.quicknav>:is(a,button){min-height:44px;padding:5px 2px;font-size:12px}
 header.top[data-member-layout]:not(:has(#account-summary[data-member])) :is(#account-open,.online-pill){display:none}
}
@media(max-width:540px){header.top{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Long translated matchmaking labels must not cover the CPU button. */
.hero-actions{flex-wrap:wrap;row-gap:14px}
#hero-play{white-space:normal;overflow-wrap:anywhere;gap:10px;max-width:100%}
#hero-play>span{flex:0 0 auto}

.arena-stats>div,.arena-stats p{min-width:0}
.arena-stats p{flex-wrap:wrap}
.arena-stats p>span{white-space:normal;overflow-wrap:anywhere}

/* Stable native/enhanced picker and numeric slots before scripts/account data. */
.site-language{width:142px;max-width:100%;height:42px;position:relative}
.site-language>svg{display:none}
.site-language select,.site-language .language-button{box-sizing:border-box;width:100%;min-width:0;height:42px;min-height:42px;font-size:13px;line-height:20px}
.site-language .language-button{justify-content:flex-start}
.site-language .language-chevron{margin-inline-start:auto}
header.top:not([data-member-layout]) .member-tools:not(:has(>:not([hidden]))){display:none}
#online-count{display:inline-block;min-width:3ch;text-align:center;font-variant-numeric:tabular-nums}
header.top:not([data-member-layout]) #account-summary{max-width:190px;white-space:normal}
