/* ==========================================================================
   Right-to-left overrides for the WinSphere components.

   Loaded ONLY by Arabic/MasterPage.master, after css/styles.css, so the
   English folder is completely unaffected by anything in this file. Every
   rule is scoped to [dir="rtl"], which the Arabic <html> tag sets.

   Most of the layout mirrors itself for free: the components are flexbox,
   and flex-direction: row follows the document direction. What needs fixing
   here is everything that hardcodes a physical side -- left/right offsets,
   one-sided padding, directional icons and the skewed buttons.
   ========================================================================== */

/* Arabic text needs a font stack that actually has Arabic glyphs; Segoe UI
   does on Windows, Tahoma is the usual fallback elsewhere. */
[dir="rtl"] body,
[dir="rtl"] .winsphere-page,
[dir="rtl"] .wp-search-bar,
[dir="rtl"] .wp-subopts-outer,
[dir="rtl"] .wp-lang-bar {
    font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Droid Arabic Naskh", Arial, sans-serif;
}

/* ---------- Directional icons ----------
   The glyphs themselves point the wrong way once the page is mirrored:
   a "back" chevron must point right, a "forward" arrow must point left. */
[dir="rtl"] .wp-back-btn .fa,
[dir="rtl"] .wp-menu-arrow,
[dir="rtl"] .wp-search-submit .fa,
[dir="rtl"] .wp-nav-arrow .fa {
    transform: scaleX(-1);
}

/* ---------- Search bar ---------- */
[dir="rtl"] .wp-search-bar {
    padding: 6px 16px 6px 8px;
}

/* ---------- Terms & Conditions list ----------
   The check bullet is absolutely positioned against the left edge. */
[dir="rtl"] .wp-tnc-content .wp-tc-list li {
    padding: 12px 26px 12px 0;
}

[dir="rtl"] .wp-tc-list li::before {
    left: auto;
    right: 0;
}

[dir="rtl"] .wp-tnc-content ul,
[dir="rtl"] .wp-tnc-content ol {
    padding-right: 18px;
    padding-left: 0;
}

/* ---------- Glossy slanted buttons ----------
   The skew has to lean the other way in a mirrored layout, and the inner
   span counter-skews by the same amount to keep the label upright. */
[dir="rtl"] .wp-viewall-btn,
[dir="rtl"] .wp-play-btn {
    transform: skewX(10deg);
}

[dir="rtl"] .wp-viewall-btn:hover,
[dir="rtl"] .wp-play-btn:hover {
    transform: skewX(10deg) translateY(-1px);
}

[dir="rtl"] .wp-viewall-btn:active,
[dir="rtl"] .wp-play-btn:active,
[dir="rtl"] .wp-game-list-item:active .wp-play-btn {
    transform: skewX(10deg) translateY(2px);
}

[dir="rtl"] .wp-viewall-btn .wp-btn-text,
[dir="rtl"] .wp-viewall-btn span,
[dir="rtl"] .wp-play-btn .wp-btn-text,
[dir="rtl"] .wp-play-btn span {
    transform: skewX(-10deg);
}

/* ---------- "Check your score" banner: keep the English layout ----------
   css/spin-win.css builds .banner as a two-column grid (mascot | copy) and
   anchors the artwork with physical offsets: .banner-mascot img left: -26%,
   .mascot-stage left: max(-5.5%, -24px), .mascot-glow left: 4%, with
   .banner-copy set to text-align: left.

   Mirroring this block would swap the grid columns -- mascot to the right,
   copy to the left -- while those left-anchored offsets kept pulling the
   artwork the other way. Pinning the banner back to LTR keeps every position
   exactly as it is in English; only the words inside change, and the Arabic
   still shapes and orders correctly as a right-to-left run within it. */
[dir="rtl"] .banner {
    direction: ltr;
}

/* ---------- Horizontal scrollers ----------
   Carousels start from the right edge in RTL; the browser handles the
   scroll origin, this just keeps the first card off the screen edge. */
[dir="rtl"] .winsphere-page .wp-game-row {
    direction: rtl;
}

/* ---------- FAQ / numbers ----------
   Keep digits and the Latin-cased pieces (URLs, UNSUB, 1907) running
   left-to-right inside otherwise right-to-left sentences. */
[dir="rtl"] .wp-faq-num,
[dir="rtl"] .wp-lb-rank,
[dir="rtl"] .wp-lb-score,
[dir="rtl"] .wp-win-count,
[dir="rtl"] .wp-faq-prize-amount {
    direction: ltr;
    unicode-bidi: embed;
}

[dir="rtl"] .wp-tnc-content a {
    direction: ltr;
    unicode-bidi: embed;
    display: inline-block;
}

/* ---------- Account info rows ---------- */
[dir="rtl"] .wp-account-info {
    text-align: right;
}

/* The .wp-lang-* switcher itself is styled in css/styles.css, since the
   English master renders the same component and never loads this file. */
