/* Noud Games — shared design system (ب١٤٩) */
:root {
  --navy-990: #050B1D;
  --navy-950: #08112A;
  --navy: #0E1A3A;
  --navy-850: #13224A;
  --navy-800: #182B5A;
  --navy-700: #22396F;
  --gold: #E5B94E;
  --gold-hi: #F6DA8E;
  --gold-lo: #B98A2A;
  --ivory: #F7F1E3;
  --text: #EEF2FB;
  --muted: #AAB6D3;
  --faint: #7C88A8;
  --line: rgba(229, 185, 78, .18);
  --glass: rgba(20, 34, 74, .55);
  --glass-hi: rgba(255, 255, 255, .06);
  --emerald: #1FB58F;
  --turquoise: #2BB3D9;
  --coral: #FF7A6B;
  --amber: #FFB547;
  --violet: #7C5CFF;
  --silver: #C9D3EA;
  --r-sm: 12px;
  --r: 20px;
  --r-lg: 28px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .25), 0 4px 12px rgba(3, 8, 24, .25);
  --shadow-2: 0 2px 4px rgba(0, 0, 0, .2), 0 12px 28px rgba(3, 8, 24, .35), 0 30px 60px -20px rgba(3, 8, 24, .55);
  --shadow-3: 0 4px 10px rgba(0, 0, 0, .25), 0 24px 48px rgba(3, 8, 24, .45), 0 60px 100px -30px rgba(3, 8, 24, .7);
  --f-display: "Fraunces", "Playfair Display", Georgia, serif;
  --f-body: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-quran: "Amiri Quran", "Amiri", serif;
  --f-ar: "Amiri", "Amiri Quran", serif;
  --ease: cubic-bezier(.22, .9, .3, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23E5B94E' stroke-width='1'%3E%3Cpath d='M48 14 58 38 82 48 58 58 48 82 38 58 14 48 38 38Z'/%3E%3Cpath d='M24 24h48v48H24z' transform='rotate(45 48 48)' opacity='.6'/%3E%3Cpath d='M24 24h48v48H24z' opacity='.6'/%3E%3Cpath d='M0 0 24 24M96 0 72 24M0 96l24-24M96 96 72 72M48 0v14M48 96V82M0 48h14M96 48H82'/%3E%3Ccircle cx='48' cy='48' r='6'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font-family: var(--f-body); font-size: 16px; line-height: 1.6; color: var(--text);
  background: var(--navy-950);
  -webkit-font-smoothing: antialiased;
}
body::before { /* deep night backdrop + faint girih pattern */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1100px 600px at 82% -10%, rgba(43, 179, 217, .13), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(124, 92, 255, .12), transparent 60%),
    radial-gradient(800px 500px at 50% 110%, rgba(229, 185, 78, .08), transparent 60%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-950) 55%, var(--navy-990) 100%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--pattern); background-size: 96px; opacity: .045;
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0,0,0,.4) 60%, #000);
          mask-image: linear-gradient(180deg, #000, rgba(0,0,0,.4) 60%, #000);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
::selection { background: rgba(229, 185, 78, .35); }

.wrap { width: min(1200px, 100% - 32px); margin-inline: auto; }
.ar { font-family: var(--f-ar); direction: rtl; unicode-bidi: isolate; }
.quran { font-family: var(--f-quran); direction: rtl; unicode-bidi: isolate; font-feature-settings: "calt", "liga"; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold);
}
.eyebrow::before { content: ""; width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg); border-radius: 2px; box-shadow: 0 0 12px rgba(229,185,78,.8); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.08; letter-spacing: -.015em; margin: 0; font-optical-sizing: auto; }
h1 em, h2 em { font-style: italic; color: var(--gold); font-weight: 500; }
.lead { color: var(--muted); font-size: clamp(16px, 1.6vw, 19px); max-width: 56ch; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--glass); position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12);
  background: var(--bg); color: var(--text); font-weight: 700; font-size: 15.5px; letter-spacing: .01em;
  text-decoration: none; cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
  transition: transform .25s var(--spring), box-shadow .25s var(--ease), background .25s, border-color .25s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.24); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(0) scale(.97); transition-duration: .08s; }
.btn-gold {
  --bg: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #D9A73A);
  color: #1A1405; border-color: rgba(255, 236, 180, .7);
  box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 0 rgba(140, 96, 10, .35) inset, 0 10px 28px -8px rgba(229,185,78,.65);
}
.btn-gold:hover { box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 0 rgba(140, 96, 10, .35) inset, 0 16px 36px -8px rgba(229,185,78,.8); }
.btn-lg { min-height: 58px; padding: 16px 30px; font-size: 17px; }
.btn-sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); color: var(--text);
  cursor: pointer; transition: transform .2s var(--spring), background .2s, border-color .2s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: rgba(255,255,255,.1); border-color: rgba(229,185,78,.45); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn[aria-pressed="true"] { color: var(--gold); border-color: rgba(229,185,78,.5); }

/* ---------- header / footer ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; min-height: 68px;
  background: linear-gradient(180deg, rgba(8, 17, 42, .82), rgba(8, 17, 42, .55));
  backdrop-filter: blur(16px) saturate(140%); -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid rgba(229,185,78,.12);
}
.nav { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; margin-inline-end: auto; }
.brand svg { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(229,185,78,.35)); }
.brand-name { font-family: var(--f-display); font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1; }
.brand-name small { display: block; font-family: var(--f-body); font-size: 10.5px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); margin-top: 4px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 15px; transition: color .2s, background .2s; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); background: rgba(255,255,255,.06); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.brand-name, .nav-actions .btn { white-space: nowrap; }
@media (max-width: 760px) { .nav-links { display: none; } .nav { gap: 10px; } }
@media (max-width: 480px) { .nav-actions .btn .lbl { display: none; } .nav-actions .btn:has(.lbl) { width: 44px; padding: 0; } }
@media (max-width: 380px) { .nav-actions .btn { padding-inline: 14px; } .brand-name { font-size: 20px; } }

.site-footer { margin-top: 96px; border-top: 1px solid var(--line); background: linear-gradient(180deg, transparent, rgba(5,11,29,.7)); }
.footer-in { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; padding: 56px 0 28px; }
.footer-in p { color: var(--muted); margin: 14px 0 0; max-width: 38ch; font-size: 15px; }
.footer-in h4 { margin: 4px 0 12px; font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.footer-in ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-in li a { color: var(--muted); text-decoration: none; font-size: 15px; }
.footer-in li a:hover { color: var(--text); }
.tagline { font-family: var(--f-ar); font-size: 20px; color: var(--ivory); direction: rtl; margin-top: 14px; display: inline-flex; gap: 10px; align-items: center; }
.tagline i { width: 8px; height: 8px; background: var(--gold); transform: rotate(45deg); display: inline-block; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 18px 0 30px; border-top: 1px solid rgba(255,255,255,.06); color: var(--faint); font-size: 13.5px; }
@media (max-width: 760px) { .footer-in { grid-template-columns: 1fr 1fr; } .footer-in > :first-child { grid-column: 1 / -1; } }

/* embed mode: only the game/content */
html.embed .site-header, html.embed .site-footer, html.embed [data-hide-embed] { display: none !important; }
html.embed body::after { opacity: .03; }

/* ---------- surfaces ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(14px) saturate(130%); -webkit-backdrop-filter: blur(14px) saturate(130%);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, var(--shadow-2);
}
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.chip svg { width: 14px; height: 14px; }

/* ---------- motion ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
@keyframes twinkle { 0%, 100% { opacity: var(--o, .9); transform: scale(1); } 50% { opacity: .15; transform: scale(.6); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.twinkle { animation: twinkle var(--t, 3s) ease-in-out infinite; animation-delay: var(--dl, 0s); transform-box: fill-box; transform-origin: center; }
.noud-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
