/* ياسين وياقوت — الصفحة الرئيسية
   الهوية من الشعار: وردي #FC2F65 + سماوي + أصفر #FDC809 + كحلي #031B54 (كحلي كإطار زي الشعار)، وخلفية فاتحة. */

:root {
  --ink: #031b54;
  --ink-2: #02123a;
  --ruby: #fc2f65;
  --ruby-d: #d01c4e;
  --mint: #17d5f0;
  --sun: #fdc809;
  --cream: #f3faff;
  --cream-2: #e3f3fc;
  --white: #fff;
  --fg: var(--ink);          /* لون النص/العناوين على الأسطح */
  --line: var(--ink);        /* الإطارات والظلال الكرتونية */
  --on-dark: #f3faff;        /* النص على خلفية كحلي ثابتة */
  --header-bg: rgba(243, 250, 255, .92);
  --soft: #fff8dc;
  --good-bg: #e8fbf3;
  --bad-bg: #fff0f1;
  --hover-bg: #fff3d0;
  --muted2: #46567e;
  --danger: #8a0f2f;
  --ok: #138a5a;
  --track: #e6ecf7;
  --text: #1a2f66;
  --muted: #5b6c93;
  --radius: 22px;
  --shadow: 0 10px 0 rgba(3, 27, 84, .12), 0 24px 40px -18px rgba(3, 27, 84, .35);
  --font-display: "Baloo Bhaijaan 2", "Readex Pro", system-ui, sans-serif;
  --font-body: "Readex Pro", "Segoe UI", Tahoma, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; line-height: 1.25; margin: 0 0 .4em; color: var(--fg); }
p { margin: 0 0 1em; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 100; }
.skip:focus { top: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .75em 1.5em; border-radius: 999px; border: 3px solid var(--line);
  font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; text-decoration: none; line-height: 1.2;
  box-shadow: 0 5px 0 var(--line); transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--line); }
.btn:active { transform: translateY(5px); box-shadow: 0 0 0 var(--line); }
.btn-primary { background: var(--ruby); color: #fff; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--fg); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: blur(10px); border-bottom: 3px solid var(--line); }
.bar { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); white-space: nowrap; }
.brand-img { display: block; height: 46px; width: auto; transition: transform .3s; }
.brand:hover .brand-img { transform: rotate(-2deg) scale(1.04); }
.nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.nav a { padding: .4em .85em; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: .95rem; transition: background .2s; }
.nav a:hover { background: var(--cream-2); }
.nav .nav-cta { background: var(--sun); border: 2px solid var(--line); font-weight: 600; }
.nav-toggle { display: none; margin-inline-start: auto; width: 46px; height: 46px; border: 3px solid var(--line); border-radius: 14px; background: var(--sun); flex-direction: column; justify-content: center; align-items: center; gap: 5px; padding: 0; }
.nav-toggle span { width: 20px; height: 3px; background: var(--ink); border-radius: 3px; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.gem-counter { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--on-dark); padding: .3em .85em; border-radius: 999px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.gem-counter svg { width: 22px; height: 20px; color: var(--ruby); }
.gem-counter.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: scale(1.25) rotate(-4deg); } }

/* ---------- Hero ---------- */
.hero {
  position: relative; padding: 56px 0 0;
  background:
    radial-gradient(circle at 10% 15%, rgba(253, 200, 9, .35), transparent 38%),
    radial-gradient(circle at 92% 70%, rgba(23, 213, 240, .28), transparent 42%),
    var(--cream);
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 32px; padding-bottom: 70px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--white); border: 3px solid var(--line); padding: .25em 1em; border-radius: 999px; font-weight: 600; font-size: .95rem; box-shadow: 0 4px 0 var(--line); }
.pill-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ruby); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { transform: scale(1.7); opacity: .4; } }
.hero h1 { font-size: clamp(2.3rem, 5vw, 4.1rem); margin: .35em 0 .3em; line-height: 1.2; }
.ruby, .sky { position: relative; white-space: nowrap; -webkit-text-stroke: .07em var(--ink); paint-order: stroke fill; }
.ruby { color: var(--ruby); }
.sky { color: var(--mint); }
.lead { font-size: 1.18rem; max-width: 34em; }
.lead-en { color: var(--muted); font-style: italic; font-size: 1rem; text-align: right; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin: 26px 0 22px; }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 0; margin: 0; font-weight: 500; font-size: .95rem; }
.trust li::before { content: "✦"; color: var(--ruby); margin-inline-end: 6px; }

.hero-stage { position: relative; }
.hero-logo { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 22px rgba(3, 27, 84, .22)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-10px); } }

.float-gem, .hidden-gem { background: none; border: 0; padding: 0; line-height: 0; }
.float-gem { position: absolute; width: 54px; height: 49px; animation: drift 5s ease-in-out infinite; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, .2)); transition: transform .2s; }
.float-gem svg { width: 100%; height: 100%; }
.float-gem:hover { transform: scale(1.2) rotate(8deg); }
.g-a { top: -3%; right: 8%; } .g-b { bottom: 34%; left: -2%; animation-delay: 1.2s; width: 42px; height: 38px; } .g-c { top: 40%; right: -2%; animation-delay: 2.4s; width: 46px; height: 42px; }
@keyframes drift { 50% { transform: translateY(-12px) rotate(6deg); } }
.is-found { display: none !important; }
.wave { position: absolute; bottom: -1px; left: 0; width: 100%; height: 50px; display: block; }

/* ---------- Strip ---------- */
.strip { background: var(--cream-2); padding-bottom: 28px; }
.strip-inner { display: flex; align-items: center; gap: 18px; background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow); margin-top: -8px; }
.strip-icon { font-size: 2.4rem; }
.strip-title { font-weight: 600; margin: 0; }
.strip-sub { margin: 0; color: var(--muted); font-size: .95rem; }
.tag { background: var(--ruby); color: #fff; padding: .1em .6em; border-radius: 8px; font-size: .8rem; margin-inline-end: 6px; }
.strip .btn { margin-inline-start: auto; }

/* ---------- Sections ---------- */
.section { padding: 84px 0; position: relative; }
.section.tint { background: var(--cream-2); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 42px; position: relative; }
.section-head h2 { font-size: clamp(2rem, 4.2vw, 3.1rem); }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.kicker { display: inline-block; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ruby); background: rgba(224, 49, 75, .1); padding: .1em .9em; border-radius: 999px; margin-bottom: 8px; }
.kicker-sun { color: var(--sun); background: rgba(255, 201, 60, .15); }
.kicker-light { color: var(--ink); background: var(--sun); }
.note { text-align: center; color: var(--muted); margin-top: 34px; }
.hidden-gem { position: absolute; width: 26px; height: 23px; opacity: .55; transition: opacity .2s, transform .2s; }
.hidden-gem svg { width: 100%; height: 100%; }
.hidden-gem:hover { opacity: 1; transform: scale(1.5) rotate(10deg); }
.section-head .hidden-gem { top: 0; inset-inline-end: 0; }

/* ---------- Grades ---------- */
.group-title { font-size: 1.5rem; margin: 36px 0 18px; display: flex; align-items: center; gap: 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 20px; }
.grade {
  position: relative; background: var(--white); border: 3px solid var(--line); border-radius: var(--radius);
  padding: 74px 20px 20px; box-shadow: 0 7px 0 var(--line); transition: transform .2s, box-shadow .2s; overflow: hidden;
}
.grade:hover { transform: translateY(-5px) rotate(-.6deg); box-shadow: 0 12px 0 var(--line); }
.grade::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 58px; background: var(--gem); opacity: .22; }
.grade-gem { position: absolute; top: 10px; inset-inline-start: 16px; width: 50px; height: 45px; color: var(--gem); filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .18)); transition: transform .4s; }
.grade:hover .grade-gem { transform: rotate(-10deg) scale(1.12); }
.num { position: absolute; top: 8px; inset-inline-end: 18px; font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; color: var(--fg); opacity: .85; line-height: 1.2; }
.grade h4 { font-size: 1.45rem; margin-bottom: .1em; }
.grade p { color: var(--muted); font-size: .95rem; margin-bottom: .7em; min-height: 3.2em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chips span { background: var(--cream-2); border: 2px solid var(--line); border-radius: 999px; padding: 0 .75em; font-size: .85rem; font-weight: 500; }
.soon { display: inline-block; background: var(--ink); color: var(--on-dark); padding: .15em 1em; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.grade-live { display: block; text-decoration: none; color: inherit; cursor: pointer; }
.soon.live { background: var(--ruby); }
.grade-wide { grid-column: 1 / -1; padding-block-end: 22px; }
.grade-wide p { min-height: 0; }

/* ---------- Arcade (dark) ---------- */
.dark { background: var(--ink); color: var(--on-dark); overflow: hidden; }
.dark::before, .dark::after { content: ""; position: absolute; width: 380px; height: 380px; border-radius: 50%; filter: blur(70px); opacity: .35; pointer-events: none; }
.dark::before { background: var(--ruby); top: -120px; inset-inline-end: -80px; }
.dark::after { background: var(--mint); bottom: -140px; inset-inline-start: -100px; }
.dark h2, .dark h3 { color: var(--on-dark); }
.dark .section-head p { color: #b8c6ee; }
.dark .wrap { position: relative; z-index: 1; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.game { background: rgba(255, 255, 255, .06); border: 2px solid rgba(243, 250, 255, .25); border-radius: var(--radius); padding: 22px; transition: transform .25s, border-color .25s, background .25s; }
.game:hover { transform: translateY(-6px) rotate(.6deg); border-color: var(--c); background: rgba(255, 255, 255, .1); }
.game-ico { width: 64px; height: 64px; display: grid; place-items: center; font-size: 2rem; background: var(--c); border: 3px solid var(--on-dark); border-radius: 18px; margin-bottom: 14px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); transform: rotate(-4deg); }
.game h3 { font-size: 1.35rem; margin-bottom: .1em; }
.game p { margin: 0 0 .5em; color: #c4d0f2; font-size: .95rem; }
.game small { color: var(--sun); font-weight: 500; }
.note-dark { color: #97a8d9; }

/* ---------- Challenge ---------- */
.ruby-band { background: var(--ruby); color: #fff; padding: 64px 0; }
.ruby-band h2 { color: #fff; font-size: clamp(1.9rem, 4vw, 2.8rem); }
.challenge { display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; }
.challenge p { font-size: 1.1rem; }
.code-box { background: var(--white); color: var(--fg); border: 3px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: 0 8px 0 var(--line); }
.code-box label { font-weight: 600; display: block; margin-bottom: 8px; }
.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; font: inherit; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; text-align: center; padding: .6em; border: 3px solid var(--line); border-radius: 14px; background: var(--cream); }
.code-msg { min-height: 1.6em; margin: 10px 0 0; font-size: .95rem; color: var(--ruby-d); }

/* ---------- How ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 34px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; counter-reset: s; }
.steps li { position: relative; background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 40px 22px 22px; box-shadow: 0 7px 0 var(--line); }
.step-n { position: absolute; top: -22px; inset-inline-start: 22px; width: 48px; height: 48px; display: grid; place-items: center; background: var(--sun); border: 3px solid var(--line); border-radius: 50%; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; }
.steps h3 { font-size: 1.4rem; }
.steps p { margin: 0; color: var(--muted); }
.install { background: var(--white); border: 3px dashed var(--line); border-radius: var(--radius); padding: 6px 22px; }
.install summary { cursor: pointer; padding: 14px 0; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.install-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-bottom: 14px; }
.install h4 { font-size: 1.15rem; color: var(--ruby); }
.install p { margin: 0; color: var(--muted); }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.feature { background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: 0 6px 0 var(--line); }
.f-ico { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.8rem; background: var(--c); border: 3px solid var(--line); margin-bottom: 14px; transform: rotate(-5deg); }
.feature h3 { font-size: 1.35rem; }
.feature p { color: var(--muted); margin: 0; }

/* ---------- FAQ ---------- */
.faq details { background: var(--white); border: 3px solid var(--line); border-radius: 18px; margin-bottom: 12px; padding: 0 20px; transition: box-shadow .2s; }
.faq details[open] { box-shadow: 0 6px 0 var(--line); }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--ruby); transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Story ---------- */
.story { background: var(--ink); color: var(--on-dark); overflow: hidden; }
.story h2 { color: var(--on-dark); }
.story p { color: #cfdcff; font-size: 1.1rem; }
.story-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 40px; align-items: center; }
.story-art { position: relative; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.av { flex: 0 0 auto; height: auto; aspect-ratio: 1; border-radius: 50%; border: 5px solid var(--on-dark); background: var(--on-dark); box-shadow: 0 10px 0 rgba(0, 0, 0, .25); object-fit: cover; }
.av-a, .av-c { width: clamp(100px, 13vw, 170px); animation: bob 5s ease-in-out infinite; }
.av-b { width: clamp(130px, 17vw, 215px); margin-inline: clamp(-34px, -2.5vw, -16px); z-index: 2; animation: bob 4.2s ease-in-out infinite .5s; border-color: var(--sun); }
.av-c { animation-delay: 1s; }

/* ---------- Contact / footer ---------- */
.contact { text-align: center; }
.contact h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
.social { list-style: none; display: flex; justify-content: center; gap: 12px; padding: 0; margin: 26px 0 0; }
.social a { width: 48px; height: 48px; display: grid; place-items: center; border: 3px solid var(--line); border-radius: 50%; background: var(--sun); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; box-shadow: 0 4px 0 var(--line); transition: transform .15s; }
.social a:hover { transform: translateY(-3px) rotate(-6deg); }
.site-footer { background: var(--ink-2); color: #b8c6ee; padding: 38px 0; text-align: center; position: relative; }
.foot { position: relative; }
.brand-foot { justify-content: center; margin-bottom: 10px; }
.brand-foot .brand-img { height: 56px; }
.site-footer p { margin: 0 0 4px; }
.copy { font-size: .85rem; opacity: .7; }
.site-footer .hidden-gem { inset-inline-start: 0; bottom: 0; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; inset-inline: 16px; margin-inline: auto; width: fit-content; max-width: calc(100% - 32px); background: var(--ink); color: var(--on-dark); border: 3px solid var(--sun); border-radius: 16px; padding: .7em 1.3em; font-weight: 600; transform: translateY(140%); transition: transform .4s cubic-bezier(.2, 1.4, .4, 1); z-index: 80; text-align: center; }
.toast.show { transform: translateY(0); }
.pop { position: fixed; width: 14px; height: 14px; pointer-events: none; z-index: 90; color: var(--sun); animation: pop .8s ease-out forwards; }
@keyframes pop { to { transform: translate(var(--x), var(--y)) scale(.2) rotate(180deg); opacity: 0; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(26px) scale(.98); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .9, .3, 1.2); transition-delay: var(--d, 0s); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; top: 100%; inset-inline: 0; margin: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream); border-bottom: 3px solid var(--line); padding: 8px 16px 16px; display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: .8em 1em; }
  .hero-grid, .challenge, .story-grid { grid-template-columns: 1fr; }
  .hero-stage { order: -1; max-width: 420px; margin: 0 auto; width: 100%; }
  .hero { padding-top: 32px; }
  .steps { grid-template-columns: 1fr; gap: 34px; }
  .install-grid { grid-template-columns: 1fr; }
  .story-art { max-width: 380px; margin: 0 auto; width: 100%; }
  .grade-wide { grid-column: auto; }
}
@media (max-width: 560px) {
  .section { padding: 64px 0; }
  .strip-inner { flex-wrap: wrap; }
  .strip .btn { margin-inline-start: 0; width: 100%; justify-content: center; }
  .brand { font-size: 1.4rem; }
  .gem-counter { font-size: .95rem; }
  .code-row { flex-direction: column; }
  .cards { grid-template-columns: 1fr 1fr; gap: 14px; }
  .grade { padding: 70px 14px 16px; }
  .grade h4 { font-size: 1.2rem; }
  .grade-wide { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- شريط «ثبّت التطبيق» (assets/pwa.js) ---------- */
.pwa-banner { position: fixed; inset-inline: 12px; inset-block-end: 12px; z-index: 80; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; max-width: 560px; margin-inline: auto; padding: 12px 16px; background: var(--white, #fff); color: var(--fg); border: 3px solid var(--line); border-radius: 20px; box-shadow: 0 6px 0 var(--line); }
.pwa-banner p { flex: 1 1 220px; margin: 0; font-weight: 600; line-height: 1.5; }
.pwa-banner .btn { padding: .35em 1em; }
@media (display-mode: standalone) { .pwa-banner { display: none; } }

/* ---------- أماكن الإعلانات (assets/ads.js): بتفضل مخفية لو الإعلانات مقفولة ---------- */
.ad-slot { max-width: 920px; margin: 24px auto; text-align: center; overflow: hidden; min-height: 0; }
.ad-slot[hidden] { display: none; }

/* ألعاب جاهزة في ركن الألعاب */
a.game-ready { position: relative; text-decoration: none; color: inherit; }
.ready-tag { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; padding: 0 .6em; font-size: .78rem; font-weight: 700; background: var(--mint, #5ee3a1); color: #0b2a1a; border-radius: 999px; }

/* روابط التواصل أسفل الموقع (assets/site.js) */
.foot-social { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 6px; padding: 0; list-style: none; }
.foot-social a { display: inline-flex; align-items: center; gap: 6px; padding: .35em .9em; font-weight: 600; font-size: .95rem; color: inherit; text-decoration: none; background: rgba(255, 255, 255, .12); border: 2px solid currentColor; border-radius: 999px; }
.foot-social a:hover, .foot-social a:focus-visible { background: rgba(255, 255, 255, .25); }
