/*
Theme Name: SoftVault AR
Theme URI: #
Author: SoftVault Team
Description: قالب عربي احترافي لمواقع تحميل البرامج والألعاب. تصميم داكن متجاوب مع دعم كامل للغة العربية واتجاه RTL.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: softvault-ar
Tags: arabic, rtl, dark, gaming, software, responsive, custom-post-types
*/

/* ============================================================
   CSS VARIABLES
============================================================ */
:root {
  --bg:           #0d0e11;
  --surface:      #16171a;
  --surface-2:    #1c1d21;
  --surface-3:    #222328;
  --border:       #2a2b30;
  --border-light: #333440;

  --primary:      #e53935;
  --primary-dark: #b71c1c;
  --primary-dim:  rgba(229,57,53,0.15);

  --text:         #ffffff;
  --text-muted:   #9a9b9c;
  --text-dim:     #55565f;

  --badge-update:  #c62828;
  --badge-free:    #1565c0;
  --badge-premium: #e65100;
  --badge-new:     #2e7d32;

  --font-ar: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
  --radius:    6px;
  --radius-lg: 10px;
  --transition: 0.18s ease;
  --max-width:  1300px;
  --header-h:   54px;
}

/* ============================================================
   RESET
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px;
  scroll-behavior: smooth;
  direction: rtl;
}
body {
  font-family: var(--font-ar);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
  direction: rtl;
  text-align: right;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #ff5252; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
h1,h2,h3,h4,h5,h6 { color: var(--text); line-height: 1.3; font-weight: 700; font-family: var(--font-ar); }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }
input, select, textarea, button { font-family: var(--font-ar); font-size: inherit; direction: rtl; }
button { cursor: pointer; }

/* ============================================================
   LAYOUT
============================================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   HEADER
============================================================ */
#masthead {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #0d0e11;
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-direction: row;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  font-family: var(--font-ar);
}
.site-logo .part1 { color: var(--primary); }
.site-logo .part2 { color: var(--text); }

/* Primary Nav */
.primary-nav { flex: 1; }
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  flex-direction: row;
}
.primary-nav ul li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
  font-family: var(--font-ar);
}
.primary-nav ul li a:hover,
.primary-nav ul li.current-menu-item a {
  color: var(--text);
  background: var(--surface-2);
}

/* Search toggle */
.header-search-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  margin-right: auto;
  flex-shrink: 0;
}
.header-search-toggle:hover { color: var(--text); background: var(--surface-2); }

/* Search overlay */
.search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 1100;
  align-items: flex-start;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-overlay-inner {
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 0 20px;
}
.search-overlay-form {
  display: flex;
  flex-direction: row-reverse;
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.search-overlay-form input {
  flex: 1;
  background: none;
  border: none;
  padding: 16px 20px;
  font-size: 1.1rem;
  color: var(--text);
  text-align: right;
  direction: rtl;
  font-family: var(--font-ar);
}
.search-overlay-form input:focus { outline: none; }
.search-overlay-form input::placeholder { color: var(--text-dim); }
.search-overlay-form button {
  background: var(--primary);
  border: none;
  padding: 0 22px;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-ar);
  transition: background var(--transition);
}
.search-overlay-form button:hover { background: var(--primary-dark); }
.search-overlay-close {
  display: block;
  margin: 14px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-ar);
}
.search-overlay-close:hover { color: var(--text); }

/* Mobile hamburger */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.mobile-toggle:hover { color: var(--text); background: var(--surface-2); }

/* ============================================================
   SECTION HEADER — RTL: border on the RIGHT side
============================================================ */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-direction: row;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
  line-height: 1.3;
  font-family: var(--font-ar);
}
.section-title small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 3px;
}
.section-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-ar);
}
.section-link:hover { color: var(--primary); }

/* ============================================================
   CAROUSEL
============================================================ */
.carousel-wrap { position: relative; }
.carousel-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding-bottom: 4px;
  flex-direction: row;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(22,23,26,0.92);
  border: 1px solid var(--border-light);
  color: var(--text);
  width: 34px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: background var(--transition);
  font-size: 1rem;
}
.carousel-btn:hover { background: var(--primary); border-color: var(--primary); }
/* RTL: flip prev/next positions */
.carousel-btn.prev { left: auto; right: -14px; }
.carousel-btn.next { right: auto; left: -14px; }

.carousel-card {
  flex: 0 0 150px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  display: block;
  background: var(--surface);
  transition: transform var(--transition);
}
.carousel-card:hover { transform: scale(1.03); color: inherit; }
.carousel-card img {
  width: 150px;
  height: 200px;
  object-fit: cover;
  display: block;
}
.carousel-card .no-img {
  width: 150px;
  height: 200px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 2rem;
}
.carousel-card .type-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: var(--font-ar);
}
.carousel-card-info {
  padding: 8px 8px 10px;
  background: var(--surface);
}
.carousel-card-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  direction: rtl;
  font-family: var(--font-ar);
}
.carousel-card-size {
  font-size: 0.68rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 3px;
  flex-direction: row-reverse;
  justify-content: flex-end;
}

/* ============================================================
   MAIN CONTENT
============================================================ */
#main-content { min-height: 50vh; }
.home-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.home-section:last-child { border-bottom: none; }

/* ============================================================
   NEW ITEMS GRID (homepage 2-col)
============================================================ */
.new-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.new-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  border-bottom: 1px solid var(--border);
  flex-direction: row;
}
.new-item:hover { background: var(--surface-2); }
.new-item:nth-last-child(-n+2) { border-bottom: none; }

.new-item-thumb {
  width: 48px;
  height: 64px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}
.new-item-thumb-placeholder {
  width: 48px;
  height: 64px;
  border-radius: 4px;
  background: var(--surface-3);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 1.2rem;
}

.new-item-body { flex: 1; min-width: 0; }
.new-item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 5px; flex-direction: row; }

.sv-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-ar);
  color: #fff;
}
.sv-badge.update   { background: var(--badge-update); }
.sv-badge.free     { background: var(--badge-free); }
.sv-badge.premium  { background: var(--badge-premium); }
.sv-badge.new-item { background: var(--badge-new); }
.sv-badge.cat      { background: var(--surface-3); color: var(--text-muted); border: 1px solid var(--border-light); }

.new-item-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
  font-family: var(--font-ar);
  direction: rtl;
  transition: color var(--transition);
}
.new-item:hover .new-item-title { color: var(--primary); }
.new-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.new-item-date {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-family: var(--font-ar);
}
.new-item-size {
  font-size: 0.7rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
  white-space: nowrap;
}

.new-items-more {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.new-items-more a {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-ar);
}
.new-items-more a:hover { color: var(--primary); }

/* ============================================================
   ABOUT BLOCK
============================================================ */
.about-block {
  padding: 36px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.9;
  border-top: 1px solid var(--border);
  font-family: var(--font-ar);
  direction: rtl;
  text-align: right;
}
.about-block h2, .about-block h3 {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  margin: 20px 0 8px;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
}
.about-block h2:first-child, .about-block h3:first-child { margin-top: 0; }
.about-block p { margin-bottom: 12px; }
.about-block strong { color: var(--primary); }

/* ============================================================
   LISTING PAGE
============================================================ */
.listing-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  flex-direction: row;
}
.listing-title {
  font-size: 1.05rem;
  font-weight: 700;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
  font-family: var(--font-ar);
}
.listing-controls { display: flex; align-items: center; gap: 8px; }
.view-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  transition: all var(--transition);
}
.view-toggle-btn:hover,
.view-toggle-btn.active { background: var(--surface-2); color: var(--text); border-color: var(--border-light); }

.listing-desc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.9;
  direction: rtl;
  font-family: var(--font-ar);
}
.listing-desc h2, .listing-desc h3 {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 16px 0 6px;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 8px;
  padding-left: 0;
}
.listing-desc h2:first-child, .listing-desc h3:first-child { margin-top: 0; }
.listing-desc strong { color: var(--primary); }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  flex-direction: row;
}
.filter-tab {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-ar);
}
.filter-tab:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-light); }
.filter-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.results-count {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 16px;
  font-family: var(--font-ar);
  direction: rtl;
}

/* ============================================================
   GAME/SOFTWARE CARD (grid)
============================================================ */
.games-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.games-grid.list-view { grid-template-columns: 1fr; gap: 6px; }

.game-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid transparent;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  color: inherit;
}
.game-card-img {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: var(--surface-3);
}
.game-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.game-card:hover .game-card-img img { transform: scale(1.05); }
.game-card-img .no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 2.5rem;
}
.game-card-badges {
  position: absolute;
  top: 6px;
  right: 6px;
  left: auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
}
.game-card-body { padding: 8px 10px 10px; }
.game-card-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
  direction: rtl;
  font-family: var(--font-ar);
  transition: color var(--transition);
}
.game-card:hover .game-card-title { color: var(--primary); }
.game-card-developer {
  font-size: 0.7rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
  font-family: var(--font-ar);
}
.game-card-stats {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: var(--text-muted);
  flex-direction: row;
}
.game-card-stat { display: flex; align-items: center; gap: 2px; }
.game-card-size {
  margin-right: auto;
  margin-left: 0;
  font-size: 0.68rem;
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

/* ============================================================
   CARD (list view)
============================================================ */
.game-card-list {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  border: 1px solid transparent;
  flex-direction: row;
}
.game-card-list:hover { background: var(--surface-2); border-color: var(--border); color: inherit; }
.game-card-list-thumb {
  width: 44px;
  height: 58px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
}
.game-card-list-info { flex: 1; min-width: 0; }
.game-card-list-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
  font-family: var(--font-ar);
  direction: rtl;
  transition: color var(--transition);
}
.game-card-list:hover .game-card-list-title { color: var(--primary); }
.game-card-list-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-direction: row;
}
.game-card-list-badges { display: flex; gap: 4px; flex-direction: row; }
.game-card-list-right { flex-shrink: 0; text-align: left; }
.game-card-list-size { font-size: 0.8rem; color: var(--primary); font-weight: 600; }
.game-card-list-date { font-size: 0.7rem; color: var(--text-dim); margin-top: 2px; font-family: var(--font-ar); }

/* ============================================================
   BREADCRUMBS
============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 0 16px;
  font-size: 0.78rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  direction: rtl;
  font-family: var(--font-ar);
  flex-direction: row;
}
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { color: var(--text-dim); }
.breadcrumbs .current { color: var(--text-muted); }

/* ============================================================
   SINGLE PAGE
============================================================ */
.game-single-wrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.game-sidebar { display: flex; flex-direction: column; gap: 20px; }

.game-header-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.game-header-box-inner { padding: 20px; }
.game-header-top {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  flex-direction: row;
}
.game-cover-wrap { flex-shrink: 0; }
.game-cover-img {
  width: 120px;
  height: 160px;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-3);
  border: 2px solid var(--border-light);
}
.game-cover-placeholder {
  width: 120px;
  height: 160px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 2.5rem;
}
.game-header-info { flex: 1; min-width: 0; direction: rtl; }
.game-header-info h1 {
  font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  font-family: var(--font-ar);
}
.game-version-badge {
  display: inline-block;
  background: #1b5e20;
  color: #69f0ae;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 6px;
  font-family: monospace;
}
.game-developer-link { font-size: 0.82rem; color: var(--primary); }
.game-developer-link:hover { text-decoration: underline; }

.game-rating { display: flex; align-items: center; gap: 6px; margin: 10px 0; flex-direction: row; }
.stars { display: flex; gap: 1px; flex-direction: row; }
.star { color: #ffd600; font-size: 1rem; }
.star.empty { color: var(--border-light); }
.game-rating-score { font-size: 0.85rem; font-weight: 700; color: var(--text); }
.game-rating-count { font-size: 0.75rem; color: var(--text-dim); font-family: var(--font-ar); }

/* Info table — RTL */
.game-info-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; direction: rtl; }
.game-info-table td { padding: 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; font-family: var(--font-ar); }
.game-info-table tr:last-child td { border-bottom: none; }
.game-info-table td:first-child { color: var(--text-muted); width: 140px; font-weight: 500; text-align: right; }
.game-info-table td:last-child { color: var(--text); font-weight: 500; padding-right: 14px; padding-left: 0; }
.game-info-table td a { color: var(--primary); }

/* Download buttons */
.game-download-wrap { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; flex-direction: row; }
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-ar);
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-download-primary { background: var(--primary); color: #fff; }
.btn-download-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-download-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text); }
.btn-download-outline:hover { border-color: var(--primary); color: var(--primary); }

/* Description */
.game-description-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.9;
  direction: rtl;
  font-family: var(--font-ar);
}

/* Screenshots */
.game-screenshots-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.game-screenshots-box .box-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 14px;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
  font-family: var(--font-ar);
}
.screenshots-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.screenshot-item { border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; cursor: pointer; }
.screenshot-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.screenshot-item:hover img { transform: scale(1.04); }

/* Problem report */
.problem-report-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  gap: 12px;
  flex-direction: row;
  font-family: var(--font-ar);
}
.btn-report {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-ar);
  border: none;
  white-space: nowrap;
  text-decoration: none;
}
.btn-report:hover { background: var(--primary-dark); color: #fff; }

/* FAQ */
.faq-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 20px; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-item:last-child { border-bottom: none; }
.faq-question {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 15px 18px;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-ar);
  flex-direction: row;
}
.faq-question:hover { background: var(--surface-2); }
.faq-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  transition: transform var(--transition), background var(--transition);
}
.faq-item.open .faq-icon { background: var(--primary); border-color: var(--primary); color: #fff; transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 18px 16px; font-size: 0.85rem; color: var(--text-muted); line-height: 1.8; direction: rtl; font-family: var(--font-ar); }
.faq-item.open .faq-answer { display: block; }

/* Comments */
.comments-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}
.comments-box .box-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
  font-family: var(--font-ar);
}
.comments-note { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 16px; font-family: var(--font-ar); direction: rtl; }
.comment-form-wrap textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  resize: vertical;
  min-height: 90px;
  margin-bottom: 10px;
  font-size: 0.875rem;
  direction: rtl;
  font-family: var(--font-ar);
}
.comment-form-wrap textarea:focus { outline: none; border-color: var(--border-light); }
.comment-form-wrap textarea::placeholder { color: var(--text-dim); }
.comment-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.comment-form-fields input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  width: 100%;
  font-size: 0.875rem;
  direction: rtl;
  font-family: var(--font-ar);
  text-align: right;
}
.comment-form-fields input:focus { outline: none; border-color: var(--border-light); }
.comment-form-fields input::placeholder { color: var(--text-dim); }
.btn-submit-comment {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-ar);
  transition: background var(--transition);
}
.btn-submit-comment:hover { background: var(--primary-dark); }
.comments-list { margin-top: 20px; border-top: 1px solid var(--border); padding-top: 16px; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; direction: rtl; }
.comment-item:last-child { border-bottom: none; }
.comment-author { font-weight: 600; color: var(--text); margin-bottom: 4px; font-family: var(--font-ar); }
.comment-date { font-size: 0.72rem; color: var(--text-dim); font-family: var(--font-ar); }
.comment-body { color: var(--text-muted); margin-top: 6px; font-family: var(--font-ar); }

/* Related */
.related-box { margin-bottom: 20px; }
.related-box .box-title {
  font-size: 1rem;
  font-weight: 700;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-ar);
}
.related-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }

/* Sidebar */
.sidebar-widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.sidebar-widget-title {
  padding: 12px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  border-right: 3px solid var(--primary);
  border-left: none;
  background: var(--surface-2);
  font-family: var(--font-ar);
  direction: rtl;
}
.sidebar-widget-body { padding: 8px 0; }
.sidebar-game-item {
  display: flex;
  gap: 10px;
  padding: 8px 14px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  transition: background var(--transition);
  flex-direction: row;
}
.sidebar-game-item:hover { background: var(--surface-2); color: inherit; }
.sidebar-game-item img { width: 36px; height: 48px; border-radius: 3px; object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.sidebar-game-info { flex: 1; min-width: 0; }
.sidebar-game-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  margin-bottom: 3px;
  font-family: var(--font-ar);
  direction: rtl;
  transition: color var(--transition);
}
.sidebar-game-item:hover .sidebar-game-title { color: var(--primary); }
.sidebar-game-meta { font-size: 0.68rem; color: var(--text-dim); font-family: var(--font-ar); }

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin: 32px 0;
  flex-wrap: wrap;
  flex-direction: row;
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font-ar);
}
.pagination a:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-light); }
.pagination .current, .pagination span.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ============================================================
   SEARCH PAGE
============================================================ */
.search-page-header { margin-bottom: 20px; direction: rtl; }
.search-page-title {
  font-size: 1.3rem;
  font-weight: 800;
  border-right: 3px solid var(--primary);
  border-left: none;
  padding-right: 10px;
  padding-left: 0;
  margin-bottom: 6px;
  font-family: var(--font-ar);
}
.search-page-count { font-size: 0.8rem; color: var(--text-muted); padding-right: 13px; font-family: var(--font-ar); }

/* ============================================================
   NO RESULTS / 404
============================================================ */
.no-results-wrap { text-align: center; padding: 80px 20px; font-family: var(--font-ar); }
.no-results-wrap h2 { font-size: 1.4rem; margin-bottom: 10px; }
.no-results-wrap p { color: var(--text-muted); font-size: 0.9rem; }

/* ============================================================
   GENERIC PAGE
============================================================ */
.page-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.9;
  direction: rtl;
  font-family: var(--font-ar);
}
.page-content h1, .page-content h2, .page-content h3 { color: var(--text); margin-bottom: 10px; margin-top: 20px; }
.page-content h1:first-child { margin-top: 0; }
.page-content a { color: var(--primary); }
.page-content a:hover { text-decoration: underline; }
.page-content ul { list-style: disc; padding-right: 20px; padding-left: 0; margin-bottom: 12px; }
.page-content ol { list-style: decimal; padding-right: 20px; padding-left: 0; margin-bottom: 12px; }

/* ============================================================
   FOOTER
============================================================ */
#colophon {
  background: #0d0e11;
  border-top: 1px solid var(--border);
  padding: 32px 0 20px;
  margin-top: 48px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  margin-bottom: 24px;
  direction: rtl;
}
.footer-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 1.2rem;
  font-weight: 900;
  font-family: var(--font-ar);
}
.footer-logo .part1 { color: var(--primary); }
.footer-logo .part2 { color: var(--text); }
.footer-desc { font-size: 0.82rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 14px; font-family: var(--font-ar); direction: rtl; }
.footer-social { display: flex; gap: 8px; flex-direction: row; }
.footer-social a {
  width: 32px; height: 32px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: all var(--transition);
  text-decoration: none;
}
.footer-social a:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.footer-col-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 14px; font-family: var(--font-ar); direction: rtl; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-size: 0.85rem; color: var(--text-dim); text-decoration: none; transition: color var(--transition); font-family: var(--font-ar); direction: rtl; }
.footer-links a:hover { color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; font-size: 0.75rem; color: var(--text-dim); text-align: center; font-family: var(--font-ar); }
.footer-bottom a { color: var(--text-dim); }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1200px) {
  .games-grid { grid-template-columns: repeat(5, 1fr); }
  .related-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1024px) {
  .games-grid { grid-template-columns: repeat(4, 1fr); }
  .related-grid { grid-template-columns: repeat(4, 1fr); }
  .game-single-wrap { grid-template-columns: 1fr 240px; }
}
@media (max-width: 860px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
  .new-items-grid { grid-template-columns: 1fr; }
  .game-single-wrap { grid-template-columns: 1fr; }
  .game-sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .primary-nav { display: none; }
  .primary-nav.open {
    display: block;
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--bg);
    z-index: 998;
    overflow-y: auto;
    padding: 12px;
  }
  .primary-nav.open ul { flex-direction: column; }
  .primary-nav.open ul li a { padding: 12px 14px; }
  .mobile-toggle { display: flex; }
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(3, 1fr); }
  .game-header-top { flex-direction: column; }
  .screenshots-grid { grid-template-columns: repeat(2, 1fr); }
  .game-sidebar { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .comment-form-fields { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .carousel-card { flex: 0 0 130px; }
  .carousel-card img { width: 130px; height: 174px; }
}

/* WP Core */
.aligncenter, div.aligncenter { display: block; margin: 5px auto; }
.alignright { float: left; margin: 5px 20px 20px 0; }
.alignleft  { float: right; margin: 5px 0 20px 20px; }
.screen-reader-text { clip: rect(1px,1px,1px,1px); height: 1px; overflow: hidden; position: absolute !important; width: 1px; }

/* ============================================================
   FONT AWESOME 6 — HELPERS (RTL)
============================================================ */

/* Carousel chevron sizing */
.carousel-btn i { font-size: 0.85rem; pointer-events: none; }

/* View toggle icon sizing */
.view-toggle-btn i { font-size: 0.8rem; pointer-events: none; }

/* Header search & mobile toggle sizing */
.header-search-toggle i,
.mobile-toggle i { font-size: 1rem; }

/* Footer social icon */
.footer-social a i { font-size: 1.1rem; }

/* Game card stats icons */
.game-card-stat i,
.game-card-size i,
.game-card-list-meta i,
.game-card-list-size i { vertical-align: middle; }

/* FAQ open icon: rotate + to − */
.faq-item.open .faq-icon i { display: none; }
.faq-icon { position: relative; }
.faq-item.open .faq-icon::after {
  content: '\f068'; /* fa-minus */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.75rem;
  color: #fff;
}

/* No-image placeholders */
.no-img i,
.game-cover-placeholder i,
.new-item-thumb-placeholder i { pointer-events: none; }

/* Problem report bar icons */
.problem-report-bar i { vertical-align: middle; }
.btn-report i { vertical-align: middle; }

/* Download button icons — RTL: margin on left */
.btn-download i { vertical-align: middle; margin-left: 6px; margin-right: 0; }
