/* Separate, scoped global layer. Existing Sakutio CSS and mobile navigation stay intact. */
#sakutioGlobalTrigger{font:inherit;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:44px;height:44px;padding:0 12px;white-space:nowrap;flex:0 0 auto;border:1px solid var(--line,#dce0ee);border-radius:13px;color:var(--text,#252843);background:var(--panel,#fff);cursor:pointer;box-shadow:0 2px 10px rgba(24,18,66,.07);font-size:14px;z-index:780}
#sakutioGlobalTrigger:focus-visible,#sakutioGlobalOverlay button:focus-visible{outline:3px solid #7a70ff;outline-offset:2px}
#sakutioGlobalTrigger .sakutio-global-trigger-label{font-size:12px;font-weight:750}
#sakutioGlobalTrigger.sakutio-global-floating{position:fixed;right:max(12px,env(safe-area-inset-right));top:max(12px,env(safe-area-inset-top));box-shadow:0 8px 30px rgba(10,12,55,.22)}
#sakutioGlobalOverlay[hidden]{display:none!important}
#sakutioGlobalOverlay{position:fixed;inset:0;z-index:999990;display:grid;place-items:center;padding:clamp(10px,3vw,24px);font-family:Inter,"Noto Sans", "Noto Sans JP",system-ui,-apple-system,"Segoe UI",sans-serif;box-sizing:border-box}
#sakutioGlobalOverlay *{box-sizing:border-box}
#sakutioGlobalOverlay .sakutio-global-scrim{position:absolute;inset:0;background:rgba(11,14,34,.58);backdrop-filter:blur(7px)}
#sakutioGlobalOverlay .sakutio-global-panel{position:relative;display:flex;flex-direction:column;width:min(680px,100%);max-height:calc(100dvh - 28px);max-height:calc(100svh - 28px);overflow:hidden;background:var(--panel,#fff);color:var(--text,#24243d);border:1px solid var(--line,#e1e4f0);border-radius:22px;box-shadow:0 26px 90px rgba(8,12,44,.33)}
#sakutioGlobalOverlay header{padding:25px 24px 18px;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex:none}
#sakutioGlobalOverlay header h2{margin:5px 0 6px;line-height:1.3;font-weight:850;font-size:clamp(21px,4.5vw,28px)}
#sakutioGlobalOverlay header p{margin:0;font-size:13px;color:var(--muted,#777a8d);line-height:1.6}
#sakutioGlobalOverlay .sakutio-global-kicker{font-size:10px;color:#655cff;font-weight:900;letter-spacing:.18em}
#sakutioGlobalOverlay .sakutio-global-close{flex:none;width:40px;height:40px;border:1px solid var(--line,#e1e4f0);border-radius:12px;background:var(--panel2,#f7f8fb);color:var(--text,#292b46);cursor:pointer;font-size:26px;line-height:1}
#sakutioGlobalOverlay .sakutio-global-options{padding:0 24px 14px;overflow-y:auto;overscroll-behavior:contain;min-height:0}
#sakutioGlobalOverlay .sakutio-global-auto{width:100%;margin-bottom:12px;justify-content:flex-start!important;gap:12px!important}
#sakutioGlobalOverlay .sakutio-global-auto>span:nth-child(2){display:flex;flex-direction:column;gap:3px;text-align:start;flex:1;min-width:0}
#sakutioGlobalOverlay .sakutio-global-auto small{color:var(--muted,#85859a);font-size:11px;line-height:1.35;white-space:normal}
#sakutioGlobalOverlay .sakutio-global-language-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#sakutioGlobalOverlay .sakutio-global-option{display:flex;align-items:center;justify-content:space-between;gap:8px;text-align:start;min-height:51px;padding:10px 13px;width:100%;border:1px solid var(--line,#dfe2ec);border-radius:13px;background:var(--panel2,#f7f8fc);color:var(--text,#202334);cursor:pointer;font:inherit;font-size:14px;font-weight:750;overflow-wrap:anywhere}
#sakutioGlobalOverlay .sakutio-global-option:hover{border-color:#8d87ff;background:color-mix(in srgb,#756bff 8%,var(--panel,#fff))}
#sakutioGlobalOverlay .sakutio-global-option[aria-pressed=true]{border-color:#655cff;background:color-mix(in srgb,#655cff 12%,var(--panel,#fff))}
#sakutioGlobalOverlay .sakutio-global-check{color:#6156eb;font-weight:900}
#sakutioGlobalOverlay .sakutio-global-notice{margin:0 24px 22px;padding:13px 14px;border:1px solid var(--line,#e2e4ee);border-radius:14px;background:var(--panel2,#f8f9fd);flex:none;max-height:22svh;overflow:auto}
#sakutioGlobalOverlay .sakutio-global-notice strong{font-size:13px}
#sakutioGlobalOverlay .sakutio-global-notice p{margin:7px 0 8px;font-size:12px;line-height:1.7}
#sakutioGlobalOverlay .sakutio-global-notice small{display:block;font-size:11px;color:var(--muted,#686e83)}
#sakutioGlobalSettings{min-width:0;overflow-wrap:anywhere}
#sakutioGlobalSettings button{cursor:pointer}
html[dir=rtl] #sakutioGlobalOverlay .sakutio-global-panel{direction:rtl}
html[dir=rtl] #app .code-editor,html[dir=rtl] #app pre,html[dir=rtl] #app code,html[dir=rtl] #app input[type=password],html[dir=rtl] #app textarea[data-editor],html[dir=rtl] #app canvas,html[dir=rtl] #app iframe{direction:ltr}
html[lang=th] #app,html[lang=hi] #app{line-height:1.65}
#app .topbar{min-width:0}
#app .topbar>div:first-child{min-width:0}
#app .top-actions{display:flex;gap:6px;align-items:center;flex:0 0 auto;min-width:0}
#app button,#app input,#app select,#app textarea{max-width:100%}
#app .modal-card{max-width:calc(100vw - 20px);overflow-wrap:anywhere}
@media(max-width:680px){
 #sakutioGlobalTrigger .sakutio-global-trigger-label{display:none}
 #sakutioGlobalTrigger{min-width:42px;width:42px;height:42px;padding:0;border-radius:12px}
 #sakutioGlobalTrigger.sakutio-global-floating{right:max(9px,env(safe-area-inset-right));top:max(9px,env(safe-area-inset-top))}
 #sakutioGlobalOverlay{padding:8px}
 #sakutioGlobalOverlay .sakutio-global-panel{width:100%;max-height:calc(100svh - 16px);border-radius:19px}
 #sakutioGlobalOverlay header{padding:18px 15px 13px}
 #sakutioGlobalOverlay .sakutio-global-options{padding:0 15px 12px}
 #sakutioGlobalOverlay .sakutio-global-notice{margin:0 15px 15px;max-height:22svh}
 #sakutioGlobalOverlay .sakutio-global-language-grid{gap:6px}
 #sakutioGlobalOverlay .sakutio-global-option{font-size:12.5px;min-height:46px;padding:9px 10px}
 #app .topbar h1{overflow-wrap:anywhere;font-size:clamp(21px,5.4vw,32px)}
 #app .top-actions{gap:4px}
}
@media(max-width:350px){
 #sakutioGlobalOverlay .sakutio-global-language-grid{grid-template-columns:1fr}
 #app .top-actions .connection-pill{display:none}
}
@media(prefers-reduced-motion:reduce){#sakutioGlobalOverlay *,#sakutioGlobalTrigger{transition:none!important;animation:none!important}}
@media(max-width:360px){
 #app .topbar{display:flex;flex-wrap:wrap;gap:6px;max-width:100%}
 #app .topbar>div:first-child{flex:1 1 130px;min-width:0}
 #app .top-actions{max-width:100%;flex-wrap:wrap;justify-content:flex-end}
}

/* r2: desktop / fold / small-phone copy fitting, without changing V2.1 core layouts. */
#app .v209-auth-panel,#app .v209-auth-shell,#app .v209-auth-choice-list,#app .v209-auth-hero{min-width:0}
#app .v209-auth-choice{min-width:0;max-width:100%;overflow-wrap:anywhere}
#app .v209-auth-choice>span:nth-child(2){min-width:0}
#app .v209-auth-choice b,#app .v209-auth-choice small{white-space:normal;overflow-wrap:anywhere;line-height:1.5}
#app .v209-auth-note,#app .v209-auth-sub{overflow-wrap:anywhere}
html:not([lang=ja]) #app .v209-auth-hero h1{font-size:clamp(30px,3.9vw,52px);line-height:1.14;letter-spacing:-.025em;overflow-wrap:normal;word-break:normal;hyphens:auto}
html:not([lang=ja]) #app .v209-auth-hero p{line-height:1.65;overflow-wrap:break-word;font-size:clamp(13px,1.1vw,15px)}
html[lang=ar] #app .v209-auth-hero,html[lang=ar] #app .v209-auth-choice,html[lang=ar] #app .v209-auth-panel{direction:rtl;text-align:start}
html[lang=ar] #app .v209-auth-note{unicode-bidi:plaintext}
html[lang=ar] #app input[type=email],html[lang=ar] #app input[autocomplete=username],html[lang=ar] #app input[autocomplete=one-time-code]{direction:ltr;text-align:left;unicode-bidi:isolate}
html[lang=ar] #sakutioGlobalTrigger.sakutio-global-floating{left:max(12px,env(safe-area-inset-left));right:auto}
@media(max-width:820px){#app .v209-auth-panel{overflow-x:hidden}}
@media(max-width:360px){
  #app .v209-auth-choice{grid-template-columns:42px minmax(0,1fr) 12px!important;gap:8px;padding:10px}
  #app .v209-auth-choice .v209-choice-icon{width:42px;height:42px}
  #app .v209-auth-choice b{font-size:13px}
  #app .v209-auth-choice small{font-size:11px}
  #app .v209-auth-note{font-size:11px}
  #sakutioGlobalTrigger.sakutio-global-floating{z-index:780}
  html[lang=ar] #sakutioGlobalTrigger.sakutio-global-floating{left:max(9px,env(safe-area-inset-left))}
}

/* R3: multilingual body after login. No changes to core game or Creator controls. */
#app .nav button,#app .mobile-nav button,#app .section-head,#app .v32-challenge-head{min-width:0}
#app .nav button span,#app .bottom-nav button span,#app .side-scroll nav button span{min-width:0;overflow-wrap:anywhere}
#app .hero-card .v20-hero-copy{min-width:0}
#app .hero-card .v20-hero-copy h2{overflow-wrap:break-word;hyphens:auto;font-size:clamp(24px,3.6vw,42px);line-height:1.21}
#app .hero-card .v20-hero-copy p{overflow-wrap:break-word;line-height:1.6}
#app .v20-level-card,#app .v32-challenge-head,#app .v32-challenge-list,#app .v20-level-card>div{min-width:0;overflow-wrap:anywhere}
#app .v32-challenge-head{display:flex;flex-wrap:wrap;gap:10px}
#app .v32-challenge-head>div{min-width:0;flex:1 1 230px}
#app .v32-challenge-head button{max-width:100%}
#app .v32-tabs{display:flex;flex-wrap:wrap;gap:6px}
#app .stat,#app .game-card,#app .setting-card,#app .card{min-width:0}
#app .stat small,#app .game-meta,#app .section-sub{overflow-wrap:break-word}
#app .game-title,#app .mini-title,#app .profile-name,#app .side-user .name{unicode-bidi:plaintext}
html[lang=th] #app,html[lang=hi] #app{line-height:1.55}
html[lang=ar] #app .hero-card{text-align:start}
@media(max-width:680px){
  #app .sak-home-main-hero .tool-row{display:flex;flex-wrap:wrap;gap:8px}
  #app .sak-home-main-hero .tool-row button{min-width:0;max-width:100%;white-space:normal;overflow-wrap:break-word}
  #app .v32-tabs button{min-height:42px;white-space:normal}
  #app .section-head{min-width:0;flex-wrap:wrap}
  #app .main{overflow-x:clip}
}
@media(max-width:360px){
  #app .sak-home-main-hero .tool-row{flex-direction:column;align-items:stretch}
  #app .sak-home-main-hero .tool-row button{width:100%}
}

/* R4: UI-only translated heading, original V2.1 Japanese textContent retained for close logic. */
#modal .modal-head h2.sakutio-global-safe-guest-heading{font-size:0!important;line-height:1.35!important;min-width:0;overflow-wrap:anywhere}
#modal .modal-head h2.sakutio-global-safe-guest-heading::after{content:attr(data-sakutio-local-heading);font-size:clamp(18px,3.2vw,24px);font-weight:inherit;line-height:1.35;white-space:normal;display:inline;unicode-bidi:plaintext}
#modal .modal-card{min-width:0;max-width:calc(100vw - 16px);overflow-wrap:anywhere}
#modal .notice,#modal p{overflow-wrap:anywhere;white-space:normal}
#modal .button-grid{min-width:0;max-width:100%}
#modal .button-grid button{min-width:0;white-space:normal;overflow-wrap:anywhere}
@media(max-width:540px){#modal .button-grid{grid-template-columns:1fr!important}#modal .button-grid button{width:100%;min-height:44px}}
html[lang=ar] #modal .modal-card{direction:rtl;text-align:start}

/* R5: guest label changes visually only, never changes account identity. */
#app .side-user .name.sakutio-global-guest-role{font-size:0!important;line-height:1.35}
#app .side-user .name.sakutio-global-guest-role::after{content:attr(data-sakutio-global-guest-label);font-size:14px;font-weight:inherit;line-height:1.35;display:inline;unicode-bidi:plaintext}

/* R8: safe visual localization of UI tokens inspected by original V2.1 logic. */
#app .sakutio-global-logic-label,#modal .sakutio-global-logic-label{font-size:0!important;line-height:1.45!important;overflow-wrap:anywhere}
#app .sakutio-global-logic-label::after,#modal .sakutio-global-logic-label::after{content:attr(data-sakutio-global-visual);font-size:var(--sakutio-logic-font,13px);font-weight:inherit;line-height:1.45;white-space:normal;unicode-bidi:plaintext}
#app .side-user .small.sakutio-global-logic-label{--sakutio-logic-font:12px}
#modal .player-status.sakutio-global-logic-label{--sakutio-logic-font:13px}
#modal .data-row>span.sakutio-global-logic-label{--sakutio-logic-font:13px}
#app .setting-card h3.sakutio-global-logic-label{--sakutio-logic-font:inherit}
#app button.sakutio-global-logic-label{--sakutio-logic-font:13px}

/* R13: legacy auth hero can contain line breaks and emphasized text. The
   translated full sentence is allowed to wrap naturally on narrow displays. */
html:not([lang="ja"]) #app .auth-shell > .hero h1{
  font-size:clamp(25px,4.2vw,46px)!important;
  line-height:1.18!important;
  min-width:0;
  overflow-wrap:anywhere;
  white-space:normal;
  hyphens:auto;
}
html:not([lang="ja"]) #app .auth-shell > .hero p{
  min-width:0;
  line-height:1.65;
  overflow-wrap:anywhere;
  white-space:normal;
}
html[lang="ar"] #app .auth-shell > .hero{direction:rtl;text-align:start}

/* R15: translated results summary without mutating original #resultCount or its updates. */
.result-bar .sakutio-global-result-summary{font-size:0!important;overflow-wrap:anywhere;min-width:0}
.result-bar .sakutio-global-result-summary > b{font-size:0!important}
.result-bar .sakutio-global-result-summary::after{
  content:attr(data-sakutio-global-caption);display:inline-block;
  font-size:13px;line-height:1.5;font-weight:600;max-width:100%;
  white-space:normal;overflow-wrap:anywhere;
}


/* R24: Arabic reading order and culturally appropriate bidirectional text.
   Do not mirror game canvases, player frames, images, or icons. */
html[lang="ar"] #app .shell{direction:rtl}
html[lang="ar"] #app .sidebar{border-right:0;border-left:1px solid var(--line)}
html[lang="ar"] #app .nav button,
html[lang="ar"] #app .side-scroll nav button,
html[lang="ar"] #app .report-choice,
html[lang="ar"] #app .setting-card,
html[lang="ar"] #app .account-security-card,
html[lang="ar"] #app .shop-card,
html[lang="ar"] #app .section-head,
html[lang="ar"] #modal .field,
html[lang="ar"] #modal .notice,
html[lang="ar"] #modal .data-row{text-align:start}
html[lang="ar"] #app .topbar,
html[lang="ar"] #app .provider-row,
html[lang="ar"] #modal .modal-head{direction:rtl}
html[lang="ar"] #app .shop-card .vf-price-row,
html[lang="ar"] #app .shop-card .v25-limited-stock{unicode-bidi:plaintext}
html[lang="ar"] #app .side-user .name,
html[lang="ar"] #app .game-title,
html[lang="ar"] #app .v209x-shop-title b,
html[lang="ar"] #app .vf-creator-line,
html[lang="ar"] #modal [data-user-content]{unicode-bidi:plaintext}
html[lang="ar"] #app input[type="email"],
html[lang="ar"] #modal input[type="email"],
html[lang="ar"] #app input[type="url"],
html[lang="ar"] #modal input[type="url"],
html[lang="ar"] #app input[type="password"],
html[lang="ar"] #modal input[type="password"],
html[lang="ar"] #app .email-mask,
html[lang="ar"] #modal .email-mask{direction:ltr;text-align:left;unicode-bidi:isolate}
html[lang="ar"] .toastbox{right:auto;left:18px}
/* R24: consistent wrapping without changing app data or component dimensions. */
html:not([lang="ja"]) #app .account-security-card,
html:not([lang="ja"]) #app .report-choice,
html:not([lang="ja"]) #app .shop-card,
html:not([lang="ja"]) #modal .modal-card{overflow-wrap:break-word;min-width:0}
html[lang="hi"] #app,html[lang="th"] #app,html[lang="ar"] #app{line-height:1.7}
#app .sakutio-global-report-language-note,
#modal .sakutio-global-report-language-note{
 margin:12px 0 16px;padding:12px 15px;border-radius:12px;
 border:1px solid var(--line,#e2e4ee);background:var(--panel2,#f8f9fd);
 color:var(--text,#232536);font-size:13px;font-weight:500;
 line-height:1.7;white-space:normal;overflow-wrap:break-word;text-align:start
}
@media(max-width:550px){
 #app .sakutio-global-report-language-note,
 #modal .sakutio-global-report-language-note{font-size:12px;padding:10px 12px;margin:8px 0 12px}
}

/* R30: Japanese game titles and player names still appear inside other
   languages. Chinese and Korean system fonts carry their own kana with wide,
   uneven spacing, so kana always use a Japanese face (unicode-range: kana only;
   Hangul, Hanzi and Latin keep the locale font). */
@font-face{font-family:"Sakutio Kana";font-weight:100 500;src:local("Noto Sans JP"),local("NotoSansJP-Regular"),local("Yu Gothic UI"),local("YuGothicUI-Regular"),local("Yu Gothic"),local("YuGothic-Regular"),local("Meiryo"),local("Hiragino Sans"),local("HiraginoSans-W3"),local("Hiragino Kaku Gothic ProN");unicode-range:U+3041-3096,U+3099-309F,U+30A0-30FF,U+31F0-31FF,U+FF65-FF9F}
@font-face{font-family:"Sakutio Kana";font-weight:600 1000;src:local("Noto Sans JP Bold"),local("NotoSansJP-Bold"),local("Yu Gothic UI Bold"),local("YuGothicUI-Bold"),local("Yu Gothic Bold"),local("YuGothic-Bold"),local("Meiryo Bold"),local("Meiryo-Bold"),local("Hiragino Sans W6"),local("HiraginoSans-W6");unicode-range:U+3041-3096,U+3099-309F,U+30A0-30FF,U+31F0-31FF,U+FF65-FF9F}
/* R30: native typography per script.
   The base app font is Inter + "Noto Sans JP". Without an override, Chinese and
   Korean text is drawn with Japanese glyph shapes, which looks wrong to native
   readers. Each locale gets its own system font stack (Latin still uses Inter). */
html[lang="zh-CN"] body,html[lang="zh-CN"] #sakutioGlobalOverlay{font-family:Inter,"Sakutio Kana","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC","Source Han Sans SC",system-ui,sans-serif}
html[lang="zh-TW"] body,html[lang="zh-TW"] #sakutioGlobalOverlay{font-family:Inter,"Sakutio Kana","PingFang TC","Microsoft JhengHei","Noto Sans TC","Source Han Sans TC",system-ui,sans-serif}
html[lang="ko"] body,html[lang="ko"] #sakutioGlobalOverlay{font-family:Inter,"Sakutio Kana","Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR","Source Han Sans K",system-ui,sans-serif}
html[lang="th"] body,html[lang="th"] #sakutioGlobalOverlay{font-family:Inter,"Noto Sans Thai","Leelawadee UI","Thonburi",Tahoma,system-ui,sans-serif}
html[lang="hi"] body,html[lang="hi"] #sakutioGlobalOverlay{font-family:Inter,"Noto Sans Devanagari","Nirmala UI","Kohinoor Devanagari",Mangal,system-ui,sans-serif}
html[lang="ar"] body,html[lang="ar"] #sakutioGlobalOverlay{font-family:"Noto Sans Arabic","Segoe UI","Geeza Pro","SF Arabic",Tahoma,Inter,system-ui,sans-serif}
html[lang="ru"] body,html[lang="vi"] body,html[lang="tr"] body{font-family:Inter,"Segoe UI",Roboto,"Noto Sans",system-ui,sans-serif}

/* Line breaking that follows each language's own rules. */
html[lang="ko"] #app,html[lang="ko"] #modal,html[lang="ko"] .toastbox{word-break:keep-all;overflow-wrap:anywhere}
html[lang^="zh"] #app,html[lang^="zh"] #modal,html[lang^="zh"] .toastbox{line-break:strict;overflow-wrap:anywhere}
html[lang="th"] #app,html[lang="th"] #modal{word-break:normal;line-break:auto;overflow-wrap:anywhere}
html:is([lang="de"],[lang="fr"],[lang="es"],[lang="pt-BR"],[lang="ru"],[lang="tr"],[lang="id"],[lang="vi"],[lang="en"]) #app :is(p,li,small,.notice,.muted,h1,h2,h3),
html:is([lang="de"],[lang="fr"],[lang="es"],[lang="pt-BR"],[lang="ru"],[lang="tr"],[lang="id"],[lang="vi"],[lang="en"]) #modal :is(p,li,small,.notice,.muted,h2,h3){hyphens:auto;-webkit-hyphens:auto}
/* German, Russian and French labels run 30-60% longer than Japanese. */
html:not([lang="ja"]) #app button,html:not([lang="ja"]) #modal button{overflow-wrap:anywhere}
html:is([lang="de"],[lang="ru"],[lang="fr"]) #app .nav button span,html:is([lang="de"],[lang="ru"],[lang="fr"]) #app .bottom-nav button span{hyphens:auto;-webkit-hyphens:auto;font-size:.95em}

/* Scripts with tall marks need room so vowels and tone marks are never clipped. */
html:is([lang="th"],[lang="hi"],[lang="vi"]) #app :is(h1,h2,h3,b,strong,button),
html:is([lang="th"],[lang="hi"],[lang="vi"]) #modal :is(h2,h3,b,strong,button){line-height:1.5}
html[lang="vi"] #app,html[lang="vi"] #modal{line-height:1.6}

/* Letter-spacing breaks Arabic cursive joining and Devanagari/Thai clusters. */
html:is([lang="ar"],[lang="hi"],[lang="th"]) #app *,html:is([lang="ar"],[lang="hi"],[lang="th"]) #modal *,
html:is([lang="ar"],[lang="hi"],[lang="th"]) #sakutioGlobalOverlay *{letter-spacing:normal!important}
/* These scripts have no true uppercase or italic forms. */
html:is([lang="ar"],[lang="hi"],[lang="th"],[lang^="zh"],[lang="ko"]) :is(#app,#modal,#sakutioGlobalOverlay) :is(em,i){font-style:normal;font-weight:700}
html:is([lang="ar"],[lang="hi"],[lang="th"],[lang^="zh"],[lang="ko"]) :is(#app,#modal) :is(.vf-eyebrow,.sakutio-global-kicker){text-transform:none}

/* R30: right-to-left layout for Arabic. The whole document already flows RTL
   (html[dir=rtl]); these rules mirror the remaining physical left/right parts. */
html[dir="rtl"] #app :is(.shortcut-card,.report-choice,.suggestion-chip,.chat-enter-hint,.auth-method,.v20-guide-choice,.v204b-maint-consent span,.nav button,.nav a),
html[dir="rtl"] #modal :is(.auth-method,.v20-guide-choice,.v204b-maint-consent span),
html[dir="rtl"] .friend-row b,html[dir="rtl"] .vf208-contact-checks label{text-align:right!important}
html[dir="rtl"] #app .favorite-btn{right:auto;left:9px}
html[dir="rtl"] #app .pinned-label{left:auto;right:9px}
html[dir="rtl"] #app .sidebar{border-right:0}
/* Directional icons (sign-out arrow) point the other way; play/media icons do not. */
html[dir="rtl"] svg.ui-icon:has(path[d^="M10 17l5-5-5-5"]){transform:scaleX(-1)}
/* Numbers, emails, URLs, codes and user names keep their own direction. */
html[dir="rtl"] :is(#app,#modal) :is(code,kbd,.email-mask,[data-user-content],bdi){unicode-bidi:isolate}
html[dir="rtl"] :is(#app,#modal) :is(input[type="number"],input[type="tel"],input[type="date"],input[type="datetime-local"]){direction:ltr;text-align:right}
html[dir="rtl"] .toastbox{right:auto;left:max(12px,env(safe-area-inset-left))}
html[dir="rtl"] #app .game-watermark{left:auto;right:max(12px,env(safe-area-inset-right))}
/* Game screens are authored left-to-right by their Creators; never mirror them. */
html[dir="rtl"] :is(#gameStage,#gameFrame,.game-frame,.player-frame,.player-overlay .game-content){direction:ltr}
html[lang="ar"] #app,html[lang="ar"] #modal{line-height:1.75}
html[lang="ar"] #app :is(h1,h2,h3),html[lang="ar"] #modal :is(h2,h3){line-height:1.45}
/* Chevrons and lone back arrows point the reading direction. */
html[dir="rtl"] #app .v209-choice-arrow,html[dir="rtl"] #app .auth-back-btn{display:inline-block;transform:scaleX(-1)}

/* R30: inside the header the language button is a flex item, where z-index
   takes effect and lifted it above the game player and every dialog.
   Only the floating variant needs to sit above the page. */
#sakutioGlobalTrigger:not(.sakutio-global-floating){z-index:auto}