/* MH Studios — shared styles */
:root {
  --walnut: #5C3A28;
  --walnut-deep: #3E2619;
  --walnut-night: #2E1C12;
  --walnut-soft: #6E4733;
  --cream: #E6CFA8;
  --tan: #CBA77C;
  --ink: #F4E8D3;
  --muted: #C9B08C;
  --line: rgba(230, 207, 168, .16);
  --card: rgba(92, 58, 40, .5);
  --radius: 18px;
  --head-h: 68px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--head-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -5%, var(--walnut-soft) 0%, transparent 70%),
    var(--walnut-deep);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Tahoma, "Noto Sans Arabic", sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
}
[dir="rtl"] body { font-family: Tahoma, "Segoe UI", "Noto Sans Arabic", system-ui, sans-serif; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cream); }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; border-radius: 6px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--cream); color: var(--walnut-deep);
        padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { inset-inline-start: 8px; }

/* Bilingual content: both languages live in the HTML, the inactive one is hidden */
html[lang="ar"] [data-l="en"], html:not([lang="ar"]) [data-l="ar"] { display: none !important; }

/* ---------- Header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 40; height: var(--head-h);
  background: rgba(46, 28, 18, .72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.site-head.scrolled { border-bottom-color: var(--line); background: rgba(46, 28, 18, .9); }
.site-head .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none;
         font-weight: 700; letter-spacing: .18em; font-size: 14px; white-space: nowrap; }
.brand svg { width: 34px; height: 34px; flex: none; }
.top-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.top-nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 8px 12px; border-radius: 999px; transition: color .2s, background .2s; }
.top-nav a:hover, .top-nav a.active { color: var(--cream); background: rgba(230, 207, 168, .08); }
.head-actions { display: flex; align-items: center; gap: 8px; }
.top-nav + .head-actions { margin-inline-start: 4px; }
.lang-btn { background: none; border: 1px solid var(--tan); color: var(--cream); border-radius: 999px;
            padding: 6px 14px; font: inherit; font-size: 14px; cursor: pointer; transition: background .2s; }
.lang-btn:hover { background: rgba(230, 207, 168, .1); }
.menu-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(92, 58, 40, .6);
            color: var(--cream); cursor: pointer; display: grid; place-items: center; }
.menu-btn svg { width: 22px; height: 22px; }
@media (max-width: 900px) {
  .top-nav { display: none; }
  .head-actions { margin-inline-start: auto; }
}

/* ---------- Side drawer ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20, 12, 7, .6); z-index: 50; opacity: 0; pointer-events: none; transition: opacity .3s; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: 60; width: min(320px, 86vw);
  background: linear-gradient(180deg, var(--walnut) 0%, var(--walnut-deep) 100%);
  border-inline-start: 1px solid var(--line); box-shadow: -20px 0 60px rgba(0, 0, 0, .4);
  transform: translateX(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
  display: flex; flex-direction: column; padding: 18px 18px 24px; overflow-y: auto; visibility: hidden;
}
[dir="rtl"] .drawer { transform: translateX(-105%); box-shadow: 20px 0 60px rgba(0, 0, 0, .4); }
body.menu-open .drawer { transform: none; visibility: visible; }
body.menu-open .scrim { opacity: 1; pointer-events: auto; }
body.menu-open { overflow: hidden; }
.drawer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.drawer-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: none; color: var(--cream); font-size: 22px; cursor: pointer; }
.drawer nav { display: flex; flex-direction: column; gap: 2px; }
.drawer nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; color: var(--ink);
                text-decoration: none; font-size: 16px; transition: background .2s; }
.drawer nav a:hover, .drawer nav a.active { background: rgba(230, 207, 168, .1); }
.drawer nav a .i { width: 26px; text-align: center; font-size: 18px; }
.drawer .group { color: var(--tan); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 18px 14px 6px; }
[dir="rtl"] .drawer .group { letter-spacing: 0; }
.drawer-games { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 4px 8px; }
.drawer-games a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); transition: transform .2s; }
.drawer-games a:hover { transform: translateY(-2px); }
.drawer-foot { margin-top: auto; padding: 18px 14px 0; color: var(--muted); font-size: 13px; }
.drawer-foot a { color: var(--cream); }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.eyebrow { display: flex; align-items: center; gap: 14px; color: var(--tan); font-size: 13px; letter-spacing: .2em;
           text-transform: uppercase; margin-bottom: 14px; }
[dir="rtl"] .eyebrow { letter-spacing: 0; }
.eyebrow::after { content: ""; flex: 1; height: 1px; background: rgba(203, 167, 124, .3); }
h2 { font-size: clamp(26px, 4vw, 38px); color: var(--cream); line-height: 1.25; margin-bottom: 12px; }
.lead { color: var(--muted); font-size: clamp(16px, 2vw, 18px); max-width: 640px; }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 64px 0 56px; overflow: hidden; }
.hero .logo { width: min(230px, 56vw); height: auto; margin: 0 auto; animation: rise .9s ease-out both; }
.hero .logo .diamond { animation: glow 4s ease-in-out infinite; }
.hero h1 { margin-top: 16px; font-size: clamp(32px, 6.4vw, 60px); letter-spacing: .14em; color: var(--cream);
           line-height: 1.15; animation: rise .9s .1s ease-out both; }
[dir="rtl"] .hero h1 { letter-spacing: 0; }
.hero .tagline { margin: 14px auto 0; max-width: 620px; color: var(--tan); font-size: clamp(17px, 2.4vw, 21px);
                 animation: rise .9s .2s ease-out both; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 30px; animation: rise .9s .3s ease-out both; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font: inherit;
       font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .2s, background .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--cream); color: var(--walnut-deep); box-shadow: 0 8px 28px rgba(230, 207, 168, .18); }
.btn-primary:hover { background: #F0DDBB; }
.btn-ghost { border: 1px solid var(--tan); color: var(--cream); }
.btn-ghost:hover { background: rgba(230, 207, 168, .08); }
.icon-strip { display: flex; justify-content: center; gap: 12px; margin-top: 44px; flex-wrap: wrap; animation: rise .9s .4s ease-out both; }
.icon-strip a { width: 64px; height: 64px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
                box-shadow: 0 10px 24px rgba(0, 0, 0, .3); transition: transform .25s; }
.icon-strip a:nth-child(odd) { animation: bob 5s ease-in-out infinite; }
.icon-strip a:nth-child(even) { animation: bob 5s 2.5s ease-in-out infinite; }
.icon-strip a:hover { transform: translateY(-6px) scale(1.06); }
.sparkle { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--cream); opacity: .0;
           animation: twinkle 6s ease-in-out infinite; pointer-events: none; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 0 0 8px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat b { display: block; font-size: clamp(26px, 4vw, 34px); color: var(--cream); line-height: 1.1; }
.stat span { color: var(--muted); font-size: 14px; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Games ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 30px; }
.filter { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 999px; padding: 7px 16px;
          font: inherit; font-size: 14px; cursor: pointer; transition: all .2s; }
.filter:hover { color: var(--cream); }
.filter.on { background: var(--cream); color: var(--walnut-deep); border-color: var(--cream); }
.games { display: grid; gap: 22px; }
.game {
  --accent: var(--tan);
  display: grid; grid-template-columns: 1fr 230px; gap: 28px; align-items: center;
  background: linear-gradient(135deg, rgba(92, 58, 40, .7), rgba(62, 38, 25, .55));
  border: 1px solid var(--line); border-radius: 24px; padding: 28px; position: relative; overflow: hidden;
  transition: border-color .3s, transform .3s;
}
.game::before { content: ""; position: absolute; inset: auto -20% -60% auto; width: 60%; aspect-ratio: 1; border-radius: 50%;
                background: radial-gradient(circle, var(--accent) 0%, transparent 65%); opacity: .14; pointer-events: none; }
[dir="rtl"] .game::before { inset: auto auto -60% -20%; }
.game:hover { border-color: rgba(230, 207, 168, .35); }
.game.hidden { display: none; }
.game-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.game-icon { width: 76px; height: 76px; border-radius: 20px; flex: none; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); overflow: hidden; }
.game h3 { font-size: 24px; color: var(--cream); line-height: 1.2; }
.game .alt { color: var(--muted); font-size: 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(230, 207, 168, .1); color: var(--cream); border: 1px solid var(--line); }
.tag.status { background: none; border-style: dashed; border-color: var(--accent); }
.game p.desc { color: var(--ink); font-size: 16px; margin-bottom: 12px; max-width: 620px; }
.game ul { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; color: var(--muted); font-size: 14.5px; }
.game li { position: relative; padding-inline-start: 18px; }
.game li::before { content: "◆"; position: absolute; inset-inline-start: 0; top: 1px; font-size: 9px; color: var(--accent); line-height: 2.2; }
.phone { width: 200px; margin: 0 auto; border-radius: 30px; padding: 8px; background: #1b110b; border: 1px solid rgba(230, 207, 168, .22);
         box-shadow: 0 24px 50px rgba(0, 0, 0, .45); transform: rotate(3deg); transition: transform .4s; position: relative; z-index: 1; }
[dir="rtl"] .phone { transform: rotate(-3deg); }
.game:hover .phone { transform: rotate(0) translateY(-4px); }
.phone img { border-radius: 23px; aspect-ratio: 480 / 1000; object-fit: cover; object-position: top; width: 100%; }
.feature-art { border-radius: 18px; overflow: hidden; box-shadow: 0 20px 44px rgba(0, 0, 0, .4); position: relative; z-index: 1; }
.game.wide { grid-template-columns: 1fr 340px; }
@media (max-width: 820px) {
  .game, .game.wide { grid-template-columns: 1fr; padding: 22px; }
  .phone { width: 170px; }
  .game ul { grid-template-columns: 1fr; }
}
.game.teaser { grid-template-columns: 1fr; text-align: center; border-style: dashed; background: rgba(46, 28, 18, .5); }
.game.teaser .lock { font-size: 34px; }

/* ---------- Pillars / steps ---------- */
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 28px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; transition: transform .25s, border-color .25s; }
.card:hover { transform: translateY(-3px); border-color: rgba(230, 207, 168, .4); }
.card .ico { font-size: 28px; }
.card h3 { color: var(--cream); margin: 8px 0 4px; font-size: 18px; }
.card p { color: var(--muted); font-size: 15px; }
.steps { counter-reset: s; }
.steps .card { position: relative; }
.steps .card::after { counter-increment: s; content: "0" counter(s); position: absolute; top: 14px; inset-inline-end: 18px;
                      font-size: 30px; font-weight: 800; color: rgba(230, 207, 168, .12); }

/* ---------- Contact ---------- */
.contact { display: grid; grid-template-columns: 1.2fr 1fr; gap: 22px; align-items: stretch; }
.contact .card { display: flex; flex-direction: column; gap: 10px; }
.mail-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: rgba(46, 28, 18, .6);
             border: 1px solid var(--line); text-decoration: none; color: var(--cream); transition: border-color .2s; word-break: break-all; }
.mail-link:hover { border-color: var(--tan); }
.mail-link small { display: block; color: var(--muted); font-size: 13px; word-break: normal; }
@media (max-width: 760px) { .contact { grid-template-columns: 1fr; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--line); padding: 34px 0 40px; color: var(--muted); font-size: 14px; margin-top: 40px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--cream); }

.to-top { position: fixed; bottom: 22px; inset-inline-end: 22px; width: 46px; height: 46px; border-radius: 50%; z-index: 30;
          background: var(--cream); color: var(--walnut-deep); border: none; font-size: 20px; cursor: pointer;
          box-shadow: 0 10px 26px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(16px); pointer-events: none; transition: all .3s; }
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Legal pages ---------- */
.legal { max-width: 800px; margin: 0 auto; padding: 48px 20px 24px; }
.legal h1 { font-size: clamp(30px, 5vw, 42px); color: var(--cream); line-height: 1.2; }
.legal .updated { color: var(--muted); margin: 8px 0 24px; font-size: 14px; }
.legal .summary { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 28px; }
.legal .summary h2 { font-size: 19px; margin-bottom: 8px; }
.legal h2 { font-size: 21px; margin: 30px 0 8px; }
.legal p, .legal li { color: var(--ink); opacity: .92; margin-bottom: 10px; }
.legal ul { padding-inline-start: 22px; }
.legal .toc { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.legal .toc a { font-size: 13px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); }
.legal .note { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 32px; }

.center-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 40px 20px; }
.center-page .big { font-size: clamp(70px, 18vw, 140px); font-weight: 800; color: rgba(230, 207, 168, .16); line-height: 1; }

/* ---------- Motion ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: .55; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Per-game accents & decorations (kept in CSS for a strict CSP) ---------- */
.g-ammo { --accent: #CBA77C; }
.g-glow { --accent: #4FC3F7; }
.g-bloom { --accent: #E85D9B; }
.g-loose { --accent: #8FA3C9; }
.g-word { --accent: #E8A15A; }
.g-burrow { --accent: #7BC24A; }
.g-rune { --accent: #F2B13C; }
.sparkle:nth-of-type(1) { top: 18%; left: 12%; animation-delay: 0s; }
.sparkle:nth-of-type(2) { top: 30%; left: 84%; animation-delay: 1.4s; }
.sparkle:nth-of-type(3) { top: 62%; left: 8%; animation-delay: 2.6s; width: 4px; height: 4px; }
.sparkle:nth-of-type(4) { top: 12%; left: 66%; animation-delay: 3.4s; width: 4px; height: 4px; }
.sparkle:nth-of-type(5) { top: 70%; left: 90%; animation-delay: 4.2s; }
.sparkle:nth-of-type(6) { top: 46%; left: 24%; animation-delay: 5s; width: 3px; height: 3px; }
.art-ammo { width: 100%; aspect-ratio: 480 / 1000; border-radius: 23px; display: block; }
.mt { margin-top: 14px; }
.mt-xl { margin-top: 56px; }
.lead.center { margin: 8px auto 0; }
.btn.push { align-self: flex-start; margin-top: auto; }
.legal-h { font-size: clamp(24px, 4vw, 32px); color: var(--cream); margin: 8px 0 6px; }
