/* ============================================================
   زخرفة أسماء — تصميم داكن متجاوب (RTL)
   ============================================================ */
:root {
  --bg: #0a0e17;
  --bg-soft: #0e1422;
  --card: #131b2e;
  --card-2: #182238;
  --border: #223052;
  --text: #eef2fa;
  --muted: #9aa7c4;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --gold: #f5c542;
  --green: #34d399;
  --danger: #f87171;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --font: "Tajawal", "Segoe UI", Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

html {
  overflow-x: hidden;
  overflow-x: clip; /* clip لا يكسر position:sticky ولا ينشئ حاوية تمرير */
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.9;
  overflow-x: hidden;
  overflow-x: clip;
}

/* إخفاء بصري يحافظ على الوصولية — بدون إزاحة خارج الشاشة تسبب فيضاناً أفقياً */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

::selection { background: rgba(34, 211, 238, .3); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; }

.container { width: min(1140px, 92%); margin-inline: auto; }

/* ---------- الترويسة ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10, 14, 23, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: .8rem 0; gap: 1rem;
}
.logo { font-size: 1.35rem; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: .5rem; }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #04121a; font-weight: 900; font-size: 1.1rem;
}
.nav-links { display: flex; gap: 1.2rem; list-style: none; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-toggle {
  display: none; background: var(--card); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: .4rem .8rem; font-size: 1.2rem; cursor: pointer;
}

/* ---------- البطل ---------- */
.hero { text-align: center; padding: 3.5rem 0 2rem; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 50% -50px, rgba(34, 211, 238, .12), transparent 70%),
    radial-gradient(500px 260px at 85% 20%, rgba(167, 139, 250, .1), transparent 70%);
}
.hero h1 { font-size: clamp(1.6rem, 4.5vw, 2.7rem); font-weight: 800; line-height: 1.5; margin-bottom: .8rem; }
.hero h1 .hl {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { color: var(--muted); max-width: 640px; margin: 0 auto 1.6rem; font-size: 1.05rem; }

/* ---------- المولد ---------- */
.tool-card {
  background: linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--border); border-radius: 20px;
  padding: 1.6rem; box-shadow: var(--shadow);
  position: relative;
}
.tool-input-row { display: flex; gap: .7rem; margin-bottom: 1rem; }
#nameInput {
  flex: 1; background: #0b1120; border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: .9rem 1.1rem; font-size: 1.15rem; font-family: inherit;
  outline: none; transition: border-color .2s, box-shadow .2s; min-width: 0;
}
#nameInput:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
#nameInput::placeholder { color: #5b6a8c; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121a; border: none; border-radius: var(--radius);
  padding: .9rem 1.4rem; font-weight: 800; font-size: 1rem; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: transform .15s, opacity .15s;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; }
.tool-meta { display: flex; align-items: center; justify-content: space-between; gap: .8rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; }
.filter-bar button {
  background: var(--card-2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: .35rem .95rem; font-family: inherit; font-size: .88rem;
  cursor: pointer; transition: all .2s;
}
.filter-bar button.active, .filter-bar button:hover {
  background: rgba(34, 211, 238, .12); border-color: var(--accent); color: var(--text);
}
#styleCount { color: var(--muted); font-size: .9rem; }

.results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; }
.style-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .2s, transform .15s;
}
.style-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.style-meta { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.style-name { font-size: .82rem; color: var(--muted); font-weight: 700; }
.badge-alters, .badge-game {
  font-size: .68rem; border-radius: 999px; padding: .1rem .6rem; font-weight: 700;
}
.badge-alters { background: rgba(248, 113, 113, .12); color: var(--danger); border: 1px solid rgba(248, 113, 113, .35); }
.badge-game { background: rgba(52, 211, 153, .12); color: var(--green); border: 1px solid rgba(52, 211, 153, .35); }
.style-out {
  font-size: 1.25rem; font-weight: 600; word-break: break-word; line-height: 1.7;
  min-height: 2.2em;
}
.copy-btn {
  align-self: flex-start; background: var(--card-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 9px; padding: .35rem 1rem; font-family: inherit;
  font-size: .85rem; cursor: pointer; transition: all .2s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { border-color: var(--green); color: var(--green); }
.empty-hint {
  grid-column: 1 / -1; text-align: center; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius); padding: 2.5rem 1rem;
}
.tool-note { margin-top: 1rem; font-size: .85rem; color: var(--muted); text-align: center; }

/* ---------- الأقسام ---------- */
section.block { padding: 3rem 0; }
.section-head { text-align: center; margin-bottom: 2rem; }
.kicker {
  display: inline-block; font-size: .8rem; font-weight: 700; color: var(--accent);
  background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .25);
  border-radius: 999px; padding: .2rem 1rem; margin-bottom: .7rem;
}
.section-head h2 { font-size: clamp(1.3rem, 3.5vw, 2rem); font-weight: 800; margin-bottom: .5rem; }
.section-head p { color: var(--muted); max-width: 620px; margin: 0 auto; }
.divider { border: none; border-top: 1px solid var(--border); margin: 0; }

/* شبكة البطاقات */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.info-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; transition: transform .15s, border-color .2s;
}
.info-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.info-card h3 { font-size: 1.05rem; margin-bottom: .5rem; color: var(--text); }
.info-card p { font-size: .92rem; color: var(--muted); }
.info-card .icon { font-size: 1.6rem; margin-bottom: .5rem; display: block; }

/* رقائق */
.chips { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.chip {
  background: var(--card); border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: .5rem 1.2rem; font-size: .95rem;
}

/* خطوات */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; counter-reset: step; }
.step {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.3rem; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #06121a;
  font-weight: 800; margin-bottom: .7rem;
}
.step h3 { font-size: 1rem; margin-bottom: .4rem; }
.step p { font-size: .9rem; color: var(--muted); }

/* نصوص المقال */
.article { max-width: 780px; margin: 0 auto; }
.article h2 { font-size: 1.5rem; margin: 2.2rem 0 .8rem; font-weight: 800; }
.article h3 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; color: var(--accent); font-weight: 700; }
.article p { color: #c9d3e8; margin-bottom: 1rem; }
.article ul, .article ol { margin: 0 1.4rem 1.2rem 0; color: #c9d3e8; }
.article li { margin-bottom: .5rem; }
.article li::marker { color: var(--accent); }
.tip-box {
  background: rgba(34, 211, 238, .06); border: 1px solid rgba(34, 211, 238, .25);
  border-radius: var(--radius); padding: 1rem 1.3rem; margin: 1.2rem 0;
}
.tip-box strong { color: var(--accent); }

/* مكتبة الرموز */
.symbol-group { margin-bottom: 1.6rem; }
.symbol-group h3 { font-size: 1.05rem; margin-bottom: .7rem; color: var(--text); }
.symbol-grid { display: flex; flex-wrap: wrap; gap: .5rem; }
.symbol-btn {
  width: 52px; height: 52px; font-size: 1.5rem; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; cursor: pointer; color: var(--text);
  transition: all .15s;
}
.symbol-btn:hover { border-color: var(--accent); transform: scale(1.08); background: var(--card-2); }

/* الأحرف المخفية */
.invisible-wrap { display: flex; gap: .8rem; flex-wrap: wrap; }
.invisible-btn {
  flex: 1; min-width: 220px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem; cursor: pointer; color: var(--text);
  font-family: inherit; display: flex; flex-direction: column; gap: .2rem; text-align: right;
  transition: border-color .2s;
}
.invisible-btn:hover { border-color: var(--accent); }
.inv-label { font-weight: 700; }
.inv-hint { font-size: .8rem; color: var(--muted); }

/* الأسئلة الشائعة */
.faq-list { max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: .7rem; }
.faq-item { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.faq-q {
  width: 100%; background: none; border: none; color: var(--text); font-family: inherit;
  font-size: 1rem; font-weight: 700; padding: 1rem 1.3rem; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; text-align: right;
}
.faq-q .plus { color: var(--accent); font-size: 1.3rem; transition: transform .25s; flex-shrink: 0; }
.faq-item.open .faq-q .plus { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-item.open .faq-a { max-height: 400px; }
.faq-a p { padding: 0 1.3rem 1.2rem; color: var(--muted); font-size: .95rem; }

/* التذييل */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 2.5rem 0 1.2rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 1.8rem; }
.footer-grid h4 { font-size: 1rem; margin-bottom: .8rem; }
.footer-grid p, .footer-grid a { font-size: .9rem; color: var(--muted); }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: .4rem; }
.footer-bottom { text-align: center; color: #5b6a8c; font-size: .82rem; border-top: 1px solid var(--border); padding-top: 1.2rem; }

/* التنبيه */
#toast {
  position: fixed; bottom: 24px; right: 50%; transform: translateX(50%) translateY(20px);
  background: var(--green); color: #04120c; font-weight: 700; padding: .7rem 1.6rem;
  border-radius: 999px; opacity: 0; pointer-events: none; transition: all .3s; z-index: 100;
  box-shadow: var(--shadow);
}
#toast.show { opacity: 1; transform: translateX(50%) translateY(0); }

/* ---------- التجاوب ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    background: var(--bg-soft); flex-direction: column; padding: 1rem 4%;
    border-bottom: 1px solid var(--border); gap: .2rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: .6rem 0; display: block; border-bottom: 1px solid var(--border); }
  .footer-grid { grid-template-columns: 1fr; gap: 1.4rem; }
  .tool-input-row { flex-direction: column; }
  .btn-primary { width: 100%; }
}

@media (max-width: 520px) {
  .results-grid,
  .cards,
  .cards-grid,
  .related-grid,
  .blog-grid,
  .names-list { grid-template-columns: 1fr; }
  .hero { padding: 2.2rem 0 1.2rem; }
  section.block { padding: 2rem 0; }
  .tool-card { padding: 1.1rem; border-radius: 16px; }
  .page-hero h1 { overflow-wrap: break-word; }
}

/* منع أي بطاقة شبكية من توسيع العمود بمحتواها */
.style-card, .related-card, .blog-card, .info-card,
.name-row, .step, .design-card { min-width: 0; }
.style-out, .font-output { overflow-wrap: anywhere; }
.design-meta { flex-wrap: wrap; }
img, svg, video { max-width: 100%; height: auto; }

/* تقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* التركيز المرئي */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ============================================================
   مكوّنات الصفحات الداخلية
   ============================================================ */

/* مسار التنقل */
.breadcrumb { padding: 1.1rem 0 0; font-size: .85rem; color: var(--muted); }
.breadcrumb ol { list-style: none; display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; padding: 0; }
.breadcrumb li::after { content: "‹"; margin-right: .5rem; color: #5b6a8c; }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--muted); }
.breadcrumb [aria-current] { color: var(--text); }

/* بطل الصفحات الداخلية */
.page-hero { text-align: center; padding: 2.2rem 0 1.6rem; }
.page-hero h1 { font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 800; margin-bottom: .7rem; line-height: 1.6; }
.page-hero .intro { color: var(--muted); max-width: 700px; margin: 0 auto 1rem; }
.page-hero .intro p { margin-bottom: .7rem; }

/* ناتج محوّل الخط */
.font-output {
  background: #0b1120; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem 1rem; font-size: 1.7rem; font-weight: 600; text-align: center;
  word-break: break-word; line-height: 1.8; min-height: 5rem; margin-bottom: 1rem;
}
.font-output.placeholder { color: #5b6a8c; font-size: 1.05rem; font-weight: 400; }

/* جدول الأنماط */
.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--border); border-radius: var(--radius); }
table.style-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 520px; }
.style-table th, .style-table td { padding: .75rem 1rem; text-align: right; border-bottom: 1px solid var(--border); }
.style-table th { background: var(--card-2); color: var(--text); font-weight: 700; white-space: nowrap; }
.style-table tr:last-child td { border-bottom: none; }
.style-table td.example { font-size: 1.15rem; white-space: nowrap; }
.style-table tbody tr:hover { background: rgba(34, 211, 238, .04); }

/* بطاقات الصفحات المرتبطة */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin-top: 1.4rem; }
.related-card {
  display: block; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.2rem; transition: all .2s; color: var(--text);
}
.related-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-2px); }
.related-card h3 { font-size: 1rem; margin-bottom: .3rem; }
.related-card p { font-size: .85rem; color: var(--muted); margin: 0; }
.related-card .go { color: var(--accent); font-size: .85rem; font-weight: 700; }

/* بطاقات المدونة */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.blog-card {
  display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.4rem; color: var(--text); transition: all .2s;
}
.blog-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-3px); }
.blog-card .date { font-size: .78rem; color: var(--muted); margin-bottom: .4rem; }
.blog-card h3 { font-size: 1.1rem; margin-bottom: .5rem; line-height: 1.7; }
.blog-card p { font-size: .9rem; color: var(--muted); flex: 1; }

/* قائمة أسماء جاهزة */
.names-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; margin: 1.2rem 0; }
.name-row {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: .7rem 1rem;
}
.name-row .nm { font-size: 1.15rem; font-weight: 600; word-break: break-word; }
.name-row button {
  flex-shrink: 0; background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .3rem .9rem; font-family: inherit; font-size: .82rem; cursor: pointer;
}
.name-row button:hover { border-color: var(--accent); color: var(--accent); }

/* نموذج الاتصال */
.contact-form { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; }
.contact-form label { font-weight: 700; font-size: .92rem; }
.contact-form input, .contact-form textarea, .contact-form select {
  background: #0b1120; border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius); padding: .8rem 1rem; font-family: inherit; font-size: 1rem; width: 100%;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--accent); outline: none; }
.contact-form textarea { min-height: 140px; resize: vertical; }

/* تنبيه داخلي */
.notice {
  background: rgba(245, 197, 66, .07); border: 1px solid rgba(245, 197, 66, .3);
  border-radius: var(--radius); padding: 1rem 1.3rem; margin: 1.2rem 0; font-size: .92rem;
}
.notice strong { color: var(--gold); }

/* ---------- معرض التصاميم الجاهزة ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.design-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: border-color .2s, transform .15s;
}
.design-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.design-card canvas { width: 100%; height: auto; display: block; }
.design-meta { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; }
.design-title { font-weight: 700; font-size: .95rem; }
.dl-btn {
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: .35rem .9rem; font-family: inherit; font-size: .82rem;
  cursor: pointer; white-space: nowrap; transition: all .2s;
}
.dl-btn:hover { border-color: var(--accent); color: var(--accent); }
.cards-cta { text-align: center; margin-top: 1.2rem; }
.btn-link {
  display: inline-block; background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121a; border-radius: var(--radius); padding: .8rem 1.8rem;
  font-weight: 800; text-decoration: none;
}
.btn-link:hover { text-decoration: none; transform: translateY(-2px); }
@media (max-width: 520px) { .cards-grid { grid-template-columns: 1fr; } }
