/* ===== المجلس — code shop ===== */
@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("fonts/almarai-400-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Almarai"; font-weight: 400; font-display: swap; src: url("fonts/almarai-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Almarai"; font-weight: 700; font-display: swap; src: url("fonts/almarai-700-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Almarai"; font-weight: 700; font-display: swap; src: url("fonts/almarai-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Almarai"; font-weight: 800; font-display: swap; src: url("fonts/almarai-800-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Almarai"; font-weight: 800; font-display: swap; src: url("fonts/almarai-800-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: "Reem Kufi"; font-weight: 700; font-display: swap; src: url("fonts/reem-kufi-700-arabic.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Reem Kufi"; font-weight: 700; font-display: swap; src: url("fonts/reem-kufi-700-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --mud: #d6b48a; --clay: #8b5a3c; --clay-dark: #5e3a24; --ink: #2b1b12;
  --cream: #f8eedb; --cream-2: #efe0c2; --sand: #e8d2ae; --gold: #c99a3b; --gold-2: #e9bf62;
  --teal: #1d6b70; --teal-2: #2a8a90; --teal-d: #11474b; --red: #9a2a1f; --red-2: #bb4231;
  --muted: #7a5a44; --radius: 18px;
  --shadow: 0 18px 40px rgba(60, 30, 10, .22), 0 2px 6px rgba(60, 30, 10, .16);
  --font: "Almarai", "Segoe UI", Tahoma, sans-serif; --deco: "Reem Kufi", "Almarai", sans-serif;
  --sadu: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='40' height='22'><rect width='40' height='22' fill='%23982a1e'/><rect width='40' height='2.5' fill='%23241510'/><rect y='19.5' width='40' height='2.5' fill='%23241510'/><path d='M0 2.5h40v1.5H0zM0 18h40v1.5H0z' fill='%23f3e6cc'/><polygon points='20,5 28,11 20,17 12,11' fill='%23f3e6cc'/><polygon points='20,8 24,11 20,14 16,11' fill='%23241510'/><polygon points='0,5 6,11 0,17' fill='%23241510'/><polygon points='40,5 34,11 40,17' fill='%23241510'/><rect x='19' y='10' width='2' height='2' fill='%23e0a43a'/></svg>");
  --crenel: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='16'><path d='M0 16V12H4V8H8V4H11V1H17V4H20V8H24V12H28V16Z' fill='%235e3a24'/></svg>");
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; font-family: var(--font); color: var(--ink); background: var(--cream);
  background-image: radial-gradient(circle at 15% 10%, rgba(201,154,59,.10), transparent 40%), radial-gradient(circle at 90% 80%, rgba(29,107,112,.08), transparent 45%);
  line-height: 1.6; }
html[dir="ltr"] body { letter-spacing: .01em; }
a { color: var(--teal); }
.icon-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--gold-2); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(43, 27, 18, .92); backdrop-filter: blur(6px); color: var(--cream); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font-family: var(--deco); font-size: 1.45rem; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--sadu) center/40px; box-shadow: inset 0 0 0 2px var(--gold); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.top-link { color: var(--cream); text-decoration: none; font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.top-link:hover { background: rgba(255,255,255,.08); }
.lang-btn { background: transparent; color: var(--gold-2); border: 1.5px solid rgba(233,191,98,.6); border-radius: 10px; padding: 6px 12px; cursor: pointer; font-weight: 700; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: 340px; display: flex; align-items: flex-end; color: #fff;
  background: url("shop/hero.jpg") center 30% / cover no-repeat, var(--clay-dark); }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(43,27,18,.15) 0%, rgba(43,27,18,.55) 55%, rgba(43,27,18,.9) 100%); }
.hero-text { position: relative; width: min(1080px, 100%); margin: 0 auto; padding: 56px 20px 30px; }
.kicker { margin: 0 0 6px; color: var(--gold-2); font-weight: 700; letter-spacing: .04em; }
.hero h1 { margin: 0; font-family: var(--deco); font-size: clamp(2rem, 5.4vw, 3.4rem); line-height: 1.2; text-shadow: 0 3px 14px rgba(0,0,0,.45); }
.lead { margin: 10px 0 18px; max-width: 560px; font-size: 1.08rem; color: #f3e6cc; }
.perks { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.perks li { display: flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(248,238,219,.14);
  border: 1px solid rgba(248,238,219,.28); backdrop-filter: blur(4px); font-weight: 700; font-size: .93rem; }
.perks .ic { color: var(--gold-2); }
.sadu { height: 22px; background: var(--sadu) center/40px 22px repeat-x; }

.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 28px 16px 40px; }
.wrap.narrow { width: min(560px, 100%); padding-top: 40px; }
.closed { text-align: center; padding: 30px 16px; font-size: 1.1rem; color: var(--muted); }

/* ---------- packages ---------- */
.packages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.pkg { position: relative; display: flex; flex-direction: column; text-align: start; padding: 0; border: 0; border-radius: var(--radius);
  background: #fffaf0; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; color: inherit;
  transition: transform .18s ease, box-shadow .18s ease; outline: 3px solid transparent; outline-offset: -3px; }
.pkg:hover { transform: translateY(-4px); }
.pkg[aria-checked="true"] { outline-color: var(--teal); box-shadow: 0 0 0 4px rgba(29,107,112,.18), var(--shadow); }
.pkg-photo { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.pkg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pkg:hover .pkg-photo img { transform: scale(1.05); }
.pkg-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(43,27,18,.55)); }
.pkg-games { position: absolute; z-index: 1; bottom: 10px; inset-inline-start: 12px; color: #fff; font-weight: 800; font-size: 1.05rem; text-shadow: 0 2px 6px rgba(0,0,0,.5); }
.ribbon { position: absolute; z-index: 1; top: 12px; inset-inline-end: 12px; padding: 4px 11px; border-radius: 999px; background: var(--red);
  color: #fff; font-size: .8rem; font-weight: 800; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.pkg-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.pkg-name { margin: 0; font-family: var(--deco); font-size: 1.5rem; color: var(--clay-dark); line-height: 1.25; }
.pkg-sub { margin: 0; color: var(--muted); font-size: .92rem; min-height: 1.5em; }
.pkg-price { margin: 8px 0 0; display: flex; align-items: baseline; gap: 6px; }
.pkg-price b { font-size: 1.9rem; font-weight: 800; color: var(--ink); }
.pkg-price span { color: var(--muted); font-weight: 700; }
.pkg-pick { margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-radius: 12px;
  background: var(--cream-2); color: var(--clay-dark); font-weight: 800; }
.pkg[aria-checked="true"] .pkg-pick { background: var(--teal); color: #fff; }

/* ---------- checkout ---------- */
.checkout { margin: 26px auto 0; max-width: 620px; padding: 22px; border-radius: var(--radius); background: #fffaf0; box-shadow: var(--shadow);
  border-top: 6px solid var(--teal); animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.co-summary { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px dashed var(--mud); }
.co-summary img { width: 84px; height: 64px; object-fit: cover; border-radius: 12px; flex: none; }
.co-summary > div { flex: 1; min-width: 0; }
.co-label { margin: 0; color: var(--muted); font-size: .85rem; }
.co-name { margin: 0; font-family: var(--deco); font-size: 1.35rem; color: var(--clay-dark); line-height: 1.3; }
.co-detail { margin: 0; color: var(--muted); font-size: .92rem; }
.co-price { margin: 0; font-size: 1.5rem; font-weight: 800; white-space: nowrap; }
.field { display: block; font-weight: 700; color: var(--clay-dark); }
.field input, .rc-form input { display: block; width: 100%; margin-top: 7px; padding: 13px 14px; border: 2px solid var(--sand); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 1.05rem; transition: border-color .15s; }
.field input:focus, .rc-form input:focus { border-color: var(--teal); outline: none; }
.agree { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0 4px; cursor: pointer; color: var(--ink); }
.agree input { width: 19px; height: 19px; margin-top: 3px; accent-color: var(--teal); flex: none; }
.form-err { min-height: 1.4em; margin: 6px 0; color: var(--red); font-weight: 700; }
.pay-btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 15px 18px; border: 0; border-radius: 14px;
  background: linear-gradient(180deg, var(--teal-2), var(--teal)); color: #fff; font-size: 1.15rem; font-weight: 800; cursor: pointer;
  box-shadow: 0 8px 18px rgba(17,71,75,.35); text-decoration: none; transition: filter .15s, transform .1s; }
.pay-btn:hover { filter: brightness(1.07); }
.pay-btn:active { transform: translateY(1px); }
.pay-btn:disabled { opacity: .65; cursor: wait; }
.methods { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin: 14px 0 6px; direction: ltr; }
.m { padding: 4px 10px; border: 1px solid var(--sand); border-radius: 8px; background: #fff; color: var(--muted); font: 800 .78rem/1.5 "Segoe UI", Arial, sans-serif; letter-spacing: .02em; }
.m-mada { color: #2a6db5; } .m-apple { color: #111; } .m-stc { color: #4f008c; }
.fine { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: .86rem; }

/* ---------- recover + terms ---------- */
.recover, .terms { margin: 40px auto 0; max-width: 620px; }
.recover h2, .terms h2 { font-family: var(--deco); color: var(--clay-dark); margin: 0 0 4px; font-size: 1.45rem; }
.recover p, .terms li { color: var(--muted); }
.rc-form { display: flex; gap: 10px; margin-top: 8px; }
.rc-form input { margin-top: 0; }
.ghost-btn { flex: none; padding: 0 18px; border: 2px solid var(--clay); border-radius: 12px; background: transparent; color: var(--clay-dark); font-weight: 800; cursor: pointer; }
.ghost-btn:hover { background: var(--clay); color: #fff; }
.rc-msg { min-height: 1.4em; font-weight: 700; }
.rc-msg.ok { color: var(--teal); } .rc-msg.err { color: var(--red); }
.terms ul { margin: 8px 0 0; padding-inline-start: 20px; }
.terms li { margin-bottom: 6px; }

/* ---------- order result ---------- */
.card { background: #fffaf0; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.result { padding: 34px 24px 28px; text-align: center; border-top: 6px solid var(--gold); }
.result h1 { margin: 10px 0 6px; font-family: var(--deco); color: var(--clay-dark); font-size: 1.8rem; line-height: 1.3; }
.result p { color: var(--muted); }
.spinner { width: 54px; height: 54px; margin: 6px auto; border-radius: 50%; border: 5px solid var(--sand); border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.badge { width: 70px; height: 70px; margin: 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; }
.badge .ic { width: 38px; height: 38px; }
.badge.ok { background: var(--teal); box-shadow: 0 0 0 8px rgba(29,107,112,.15); animation: pop .35s ease; }
.badge.bad { background: var(--red); box-shadow: 0 0 0 8px rgba(154,42,31,.13); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pkg-line { font-weight: 700; }
.code-box { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; padding: 14px; border-radius: 14px; background: var(--ink);
  border: 2px solid var(--gold); direction: ltr; }
.code-box code { flex: 1; min-width: 0; color: var(--gold-2); font: 800 clamp(.82rem, 3.9vw, 1.4rem)/1.3 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .04em; white-space: nowrap; overflow-x: auto; user-select: all; text-align: center; }
.copy-btn { display: flex; align-items: center; gap: 6px; flex: none; padding: 9px 12px; border: 0; border-radius: 10px; background: var(--gold); color: var(--ink); font-weight: 800; cursor: pointer; }
.copy-btn.done { background: var(--teal); color: #fff; }
.expiry, .mailed { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0; }
.expiry { color: var(--clay-dark) !important; font-weight: 700; }
#play-btn { margin-top: 18px; }

/* ---------- fake gateway (sandbox) ---------- */
.mockgw { min-height: calc(100vh - 120px); display: grid; place-items: center; padding: 30px 16px; background: #eef1f5; }
.gw { width: min(430px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 20px 50px rgba(20,30,50,.18); overflow: hidden;
  font-family: "Segoe UI", Arial, sans-serif; direction: ltr; text-align: left; color: #1d2433; }
.gw-warn { padding: 9px 14px; background: #fff4d6; color: #7a5200; font: 700 .85rem/1.5 var(--font); direction: rtl; text-align: center; }
.gw-head { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 20px 4px; }
.gw-brand { font-weight: 800; font-size: 1.25rem; color: #1a3a8f; }
.gw-brand em { font-style: normal; font-size: .75rem; color: #b26b00; background: #fff4d6; padding: 2px 6px; border-radius: 6px; margin-left: 4px; }
.gw-amount { font-weight: 800; font-size: 1.25rem; }
.gw-desc { margin: 0; padding: 0 20px 12px; color: #5b6475; font-size: .9rem; }
.gw-tabs { display: flex; gap: 6px; padding: 0 20px; }
.gw-tab { flex: 1; padding: 9px 4px; border: 1.5px solid #d6dbe4; border-radius: 10px; background: #fff; font-weight: 700; font-size: .85rem; cursor: pointer; color: #1d2433; }
.gw-tab.on { border-color: #1a3a8f; background: #eef2ff; color: #1a3a8f; }
.gw-card { padding: 14px 20px 4px; }
.gw-card label { display: block; font-size: .8rem; color: #5b6475; margin-bottom: 10px; }
.gw-card input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1.5px solid #d6dbe4; border-radius: 10px; background: #f7f8fb; color: #1d2433; }
.gw-row { display: flex; gap: 10px; } .gw-row label { flex: 1; }
.gw-pay { display: block; width: calc(100% - 40px); margin: 6px 20px 8px; padding: 13px; border: 0; border-radius: 10px; background: #1a3a8f; color: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer; }
.gw-decline { display: block; width: calc(100% - 40px); margin: 0 20px 18px; padding: 9px; border: 0; background: transparent; color: #a33; font: 700 .88rem var(--font); cursor: pointer; }

/* ---------- footer ---------- */
.foot { margin-top: 20px; padding: 0 16px 26px; text-align: center; color: var(--muted); }
.foot .crenel { height: 16px; margin: 0 -16px 16px; background: var(--crenel) center bottom/28px 16px repeat-x; }
.foot a { color: var(--clay-dark); }
.credits { max-width: 760px; margin: 10px auto 0; font-size: .74rem; line-height: 1.7; opacity: .85; direction: ltr; }
.credits a { color: inherit; }

/* ---------- responsive ---------- */
@media (max-width: 920px) { .packages { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) {
  .hero { min-height: 300px; }
  .hero-text { padding: 40px 16px 22px; }
  .packages { gap: 12px; }
  .pkg-body { padding: 11px 12px 13px; }
  .pkg-name { font-size: 1.2rem; }
  .pkg-price b { font-size: 1.45rem; }
  .pkg-pick { padding: 8px; font-size: .9rem; }
  .checkout { padding: 16px; }
  .co-summary img { width: 64px; height: 50px; }
  .co-price { font-size: 1.2rem; }
  .rc-form { flex-direction: column; }
  .code-box { padding: 12px 10px; gap: 8px; }
  .copy-btn span { display: none; }
  .copy-btn { padding: 9px; }
  .ghost-btn { padding: 12px; }
  .top-link { padding: 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

.pkg-save { margin: 2px 0 0; color: var(--teal); font-weight: 800; font-size: .88rem; }
.ribbon { background: var(--teal); }

/* promo code */
.co-price { display: grid; justify-items: end; line-height: 1.2; }
.co-price s { color: var(--muted); font-size: .95rem; font-weight: 700; }
.promo { margin-top: 12px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--teal); font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.promo-row { display: flex; gap: 8px; margin-top: 8px; }
.promo-row input { flex: 1; min-width: 0; padding: 11px 12px; border: 2px solid var(--sand); border-radius: 12px; background: #fff; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.promo-row input:focus { border-color: var(--teal); outline: none; }
.promo-msg { min-height: 1.3em; margin: 6px 0 0; font-weight: 700; font-size: .92rem; }
.promo-msg.ok { color: var(--teal); } .promo-msg.err { color: var(--red); }

/* receipt on the success page */
.receipt { width: 100%; margin: 4px 0 10px; border-collapse: collapse; font-size: .93rem; text-align: start; }
.receipt td { padding: 7px 4px; border-bottom: 1px solid var(--cream-2); color: var(--muted); }
.receipt td:last-child { text-align: end; color: var(--ink); font-weight: 700; }
.receipt tr.total td { color: var(--ink); font-weight: 800; font-size: 1.02rem; border-bottom: 0; }
.receipt .mono { direction: ltr; unicode-bidi: isolate; font-family: ui-monospace, Consolas, monospace; }
