/* Text flow follows the selected catalog; circuits and racing coordinates do not. */
[dir="rtl"] { --display: Arial, sans-serif; --mono: Arial, sans-serif; }
[dir="rtl"] .direction-arrow { transform: scaleX(-1); }
[dir="rtl"] .eyebrow, [dir="rtl"] .sc-kicker, [dir="rtl"] button { letter-spacing: normal; }
[dir="rtl"] #race .corner-card { left: auto; right: 24px; border-left: 0; border-right: 2px solid var(--orange); }
[dir="rtl"] .pause-btn { right: auto; left: 24px; }
[dir="rtl"] .race-location { left: auto; right: 24px; }
[dir="rtl"] .account-close { right: auto; left: 18px; }
[dir="rtl"] .featured-art { transform: none; }
.circuit-art, canvas, .hold-track, .deltaline, .lap-progress,
#timer, #cornerCount, #deltaVal, .award-rank b, .analysis-number,
.cl-row .pos, .cl-row .sc, .cl-row .pts, .mp-duel-score > b,
input[type="email"], input[type="url"], #mpShareUrl, #mpInvite { direction: ltr; unicode-bidi: isolate; }
.driver-card b, .dr-row .dn, .cl-row .dn, .mp-standing b, .mp-driver b,
.mp-duel-score p, .account-card strong { unicode-bidi: plaintext; }
.page-heading > div, .driver-card, .setting-row > label, .setting-row > div,
.featured-metrics > div, .edition-header nav { min-width: 0; }
.sc-title, .page-heading h1, .mp-duel-hero h1, .result-hero h1 { overflow-wrap: anywhere; }
.action-primary, .action-secondary, .sc-btn { white-space: normal; }
.action-primary svg, .action-secondary svg, .text-action svg { flex-shrink: 0; }
.setting-row select { max-width: 48%; }
@media (max-width: 600px) {
  [dir="rtl"] #race .corner-card { right: 14px; }
  [dir="rtl"] .pause-btn { left: 14px; }
  [dir="rtl"] .featured-art { right: auto; left: -32px; }
  .edition-header nav button { line-height: 1.4; text-align: center; }
  .difficulty-switch button, .tier-switch button { min-width: 0; overflow-wrap: anywhere; }
  .featured-metrics { gap: 18px; }
  .featured-metrics > div { flex: 1; }
  .result-actions button { min-width: 0; }
  .setting-row { gap: 12px; }
  .setting-language { align-items: stretch; flex-direction: column; }
  .setting-language select { width: 100%; max-width: 100%; }
}

/* Paint Shop labels must fit translated copy without changing physical previews. */
.shop-heading > div, .stage-top > span, .stage-identity > div { min-width: 0; }
.shop-heading h1, .shop-tabs button, .paint-presets b, .paint-color b,
.livery-styles button > span:last-of-type, .team-marks span,
.paint-options button, .stage-identity b { overflow-wrap: anywhere; }
.shop-tabs { padding-inline: 10px; }
.shop-tabs button { flex: 1 1 auto; min-width: 0; line-height: 1.4; padding-inline: 4px; }
.shop-label { flex-wrap: wrap; }
.stage-identity { flex-wrap: wrap; }
.stage-identity > div { flex: 1; }
.stage-edition { max-width: 100px; }
.stage-top, .preview-views { flex-wrap: wrap; }
.stage-top i { flex-shrink: 0; }
.paint-color small, #paintNumber, #stageNumber { direction: ltr; unicode-bidi: isolate; }
.stage-identity b, .stage-identity small, .identity-example b,
.identity-example > div > small, .equipped-id b { unicode-bidi: plaintext; }

/* Native script fonts work offline in both the browser and the native shell. */
:root:lang(ko) { --script-font: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; }
:root:lang(ja) { --script-font: 'Hiragino Sans', 'Yu Gothic', Meiryo, 'Noto Sans JP', sans-serif; }
:root:lang(zh) { --script-font: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif; }
:root:lang(ar) { --script-font: 'Noto Sans Arabic', 'Geeza Pro', Tahoma, Arial, sans-serif; }
:root:lang(ne) { --script-font: 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Devanagari Sangam MN', 'Nirmala UI', sans-serif; }
:root:is(:lang(ko), :lang(ja), :lang(zh), :lang(ar), :lang(ne)) {
  --display: var(--script-font); --mono: var(--script-font); --body: var(--script-font);
}
:is(:lang(ko), :lang(ja), :lang(zh), :lang(ar), :lang(ne)) body { font-family: var(--script-font); }
html:is(:lang(ar), :lang(ne)) :is(h1,h2,h3,p,span,small,b,strong,button,label,input,select,a,td) { letter-spacing: normal; }
html:is(:lang(ko), :lang(ja), :lang(zh), :lang(ar), :lang(ne)) :is(h1,h2,h3,.sc-title,.sc-btn,.action-primary,.action-secondary) { line-height: 1.3; }
html:is(:lang(ko), :lang(ja), :lang(zh)) :is(.eyebrow,.sc-kicker,button) { letter-spacing: normal; }
@media (max-width: 600px) {
  html:lang(ne) #briefTier { font-size: 20px; line-height: 1.4; }
}
