/* مولّد من album.json («بطاقة الألبوم») */
:root { --al-ratio: 0.75002; --al-r: 14% / 10.5%; --al-pad: 7cqw; --al-num: 20cqw; --al-flag: 14cqw; --al-name: 12cqw; --al-name-b: 6cqw; --al-shade: 0.75; --al-inset: 9%; }
/* هوية التطبيق: أسود عميق وأصفر ليموني، داكن وفاتح، SF Arabic من النظام. */
:root {
  --bg: #0A0A0B; --surface: #151517; --surface2: #1C1C1F; --surface3: #2A2A2E;
  --ink: #fff; --muted: #9A9AA0; --line: rgba(255,255,255,.11);
  --accent: #E6F23A; --on-accent: #0B0B0C; --gold: #F5B82E;
  --r: 22px; --r-sm: 16px; --gutter: 20px; --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "SF Arabic", "SF Pro Text", "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic", sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #F2F2F4; --surface: #fff; --surface2: #F6F6F8; --surface3: #E6E6EA; --ink: #0B0B0C; --muted: #6E6E73; --line: rgba(0,0,0,.08); --accent: #FFE94A; color-scheme: light; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 500 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 5vw, 52px); font-weight: 900; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
h3 { font-size: 18px; font-weight: 800; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sec { padding: 28px 0; }
.wrap .sec { padding-inline: 0; }
.lead { color: var(--muted); font-size: 17px; max-width: 720px; }
.kicker { color: var(--accent); font-weight: 800; font-size: 14px; margin-bottom: 8px; }
@media (prefers-color-scheme: light) { .kicker { color: #8A7A00; } }
.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 10px; z-index: 9; }
.skip:focus { inset-inline-start: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* الترويسة */
.head { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.head-in { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 17px; white-space: nowrap; }
.logo img { border-radius: 10px; }
.logo-txt { display: flex; flex-direction: column; line-height: 1.1; } .logo-txt b { font-weight: 900; letter-spacing: -0.01em; } .logo-txt small { color: var(--muted); font-size: 12px; font-weight: 700; }
.nav { display: flex; gap: 4px; margin-inline-start: 8px; }
.nav a { padding: 8px 12px; border-radius: 12px; color: var(--muted); font-weight: 700; font-size: 15px; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); background: var(--surface2); }
.head-end { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.lang { color: var(--muted); font-weight: 700; font-size: 14px; padding: 8px 10px; }
.lang:hover { color: var(--ink); }
@media (max-width: 760px) {
  .head-in { flex-wrap: wrap; height: auto; padding-block: 10px; gap: 8px 12px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .nav a { padding: 6px 10px; }
  .logo-txt b { font-size: 16px; }
  .hero { padding-top: 24px; }
  .hero-faces { max-width: 300px; }
}
@media (max-width: 440px) { .head-end .btn { display: none; } }

/* أزرار */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 24px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 800 16px var(--font); border: 0; cursor: pointer; transition: transform .15s ease; }
.btn:active { transform: scale(.97); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-ghost { background: var(--surface2); color: var(--ink); border: 1px solid var(--line); }
.store { display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 20px; border-radius: 14px; background: var(--ink); color: var(--bg); }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store small { font-size: 11px; font-weight: 600; opacity: .8; }
.store b { font-size: 19px; font-weight: 800; }

/* البطل */
.hero { padding: 48px 0 24px; overflow: hidden; }
.hero-in { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 28px; }
.stats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; text-align: center; }
.stats b { display: block; font-size: 24px; font-weight: 900; }
.stats span { color: var(--muted); font-size: 13px; }
.hero-faces { position: relative; aspect-ratio: 1; }
.hf { position: absolute; width: 34%; aspect-ratio: var(--al-ratio); border-radius: var(--al-r); overflow: hidden; background: linear-gradient(160deg, var(--surface3), var(--surface)); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.hf0 { inset-inline-start: 33%; top: 26%; width: 40%; z-index: 3; border: 3px solid var(--accent); }
.hf1 { inset-inline-start: 0; top: 8%; transform: rotate(-6deg); }
.hf2 { inset-inline-end: 0; top: 4%; transform: rotate(5deg); }
.hf3 { inset-inline-start: 4%; bottom: 2%; transform: rotate(4deg); }
.hf4 { inset-inline-end: 2%; bottom: 6%; transform: rotate(-4deg); }
.hf5, .hf6 { display: none; }
.hf0 img { filter: none; }
.hf1 img, .hf2 img, .hf3 img, .hf4 img { filter: brightness(0) contrast(1); opacity: .9; }
@media (prefers-color-scheme: light) { .hf1 img, .hf2 img, .hf3 img, .hf4 img { filter: brightness(0); opacity: .75; } }
@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-faces { max-width: 420px; width: 100%; margin: 0 auto; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* اللعبة */
.game { background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 24px; }
.game-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.game-head p { color: var(--muted); }
.game-score { display: flex; gap: 10px; }
.game-score span { background: var(--surface2); border-radius: 12px; padding: 8px 12px; color: var(--muted); font-size: 14px; }
.game-score b { color: var(--ink); font-size: 18px; margin-inline-start: 4px; }
.game-body { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; margin-top: 12px; }
.game-shadow { aspect-ratio: 4/5; border-radius: var(--r); background: radial-gradient(circle at 50% 30%, var(--surface3), var(--surface2)); overflow: hidden; }
.game-shadow img { width: 100%; height: 100%; object-fit: cover; object-position: top; filter: brightness(0); transition: filter .5s ease; }
.game-shadow.on img { filter: none; }
.clues { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.clues li { background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 15px; animation: rise .35s ease both; }
.clues li b { color: var(--muted); font-weight: 600; margin-inline-end: 6px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.choices button { min-height: 54px; border-radius: var(--r-sm); background: var(--surface2); border: 1px solid var(--line); color: var(--ink); font: 700 16px var(--font); cursor: pointer; padding: 8px 12px; }
.choices button:hover:not(:disabled) { border-color: var(--accent); }
.choices button.ok { background: #1FB25A; color: #fff; border-color: transparent; }
.choices button.no { background: #E5372C; color: #fff; border-color: transparent; }
.game-msg { min-height: 28px; margin: 14px 0 0; font-weight: 800; }
.game-msg a { color: var(--accent); text-decoration: underline; }
@media (prefers-color-scheme: light) { .game-msg a { color: #8A7A00; } }
.game-msg .btn { margin-inline-start: 8px; text-decoration: none; color: var(--on-accent); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 640px) { .game { padding: 18px; } .game-body { grid-template-columns: 1fr; } .game-shadow { max-width: 220px; margin: 0 auto; width: 100%; } .choices { grid-template-columns: 1fr; } }

/* أنماط ومزايا */
.modes, .feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.modes li, .feats li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.modes p, .feats p { color: var(--muted); margin: 0; }
.mode-n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); font-weight: 900; margin-bottom: 10px; }
@media (max-width: 860px) { .modes, .feats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .modes, .feats { grid-template-columns: 1fr; } }

/* بطاقات اللاعبين */
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sec-head a { color: var(--muted); font-weight: 700; white-space: nowrap; }
.sec-head a:hover { color: var(--ink); }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
/* «بطاقة الألبوم» — نفس PlayerCard بالتطبيق، وكل أرقامها متغيّرات --al-* مولّدة من album.json (build.mjs) — لا رقم هنا. */
.card { display: flex; flex-direction: column; gap: 8px; height: 100%; text-align: center; }
.al { position: relative; display: block; aspect-ratio: var(--al-ratio); container-type: inline-size; overflow: hidden; border-radius: var(--al-r); border: 1px solid var(--line); background: radial-gradient(120% 70% at 50% 0, color-mix(in srgb, var(--ink) 10%, transparent), transparent 70%), var(--surface2); transition: transform .15s ease, border-color .15s ease; }
.al::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 50%, rgb(0 0 0 / var(--al-shade))); }
.al img { position: absolute; display: block; max-width: none; height: auto; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--ft, 0%), #000 calc(100% - var(--fb, 0%)), transparent), linear-gradient(to right, transparent, #000 var(--fl, 0%), #000 calc(100% - var(--fr, 0%)), transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, transparent, #000 var(--ft, 0%), #000 calc(100% - var(--fb, 0%)), transparent), linear-gradient(to right, transparent, #000 var(--fl, 0%), #000 calc(100% - var(--fr, 0%)), transparent); mask-composite: intersect; }
.al.is-whole img { inset: var(--al-inset) 0 0; width: 100%; height: calc(100% - var(--al-inset)); object-fit: contain; object-position: bottom; -webkit-mask-image: none; mask-image: none; }
.al.is-bare { border-radius: inherit; border: 0; }
.al.is-bare::after { display: none; }
.hf .al, .p-photo .al { height: 100%; border: 0; border-radius: 0; }
.al-num, .al-flag, .al-name { position: absolute; z-index: 1; line-height: 1; }
.al-num { top: var(--al-pad); inset-inline-start: var(--al-pad); color: var(--ink); font-weight: 900; font-stretch: condensed; font-size: var(--al-num); letter-spacing: -.02em; }
.al-flag { top: var(--al-pad); inset-inline-end: var(--al-pad); font-size: var(--al-flag); }
.al-name { inset-inline: 4px; bottom: var(--al-name-b); color: #fff; font-weight: 800; font-size: max(11px, var(--al-name)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.card:hover .al { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.face-sm { display: block; width: 56px; flex: none; border-radius: 12px; overflow: hidden; }
.card-meta { color: var(--muted); font-size: 13px; line-height: 1.35; padding: 0 4px; }
@media (max-width: 520px) { .cards { grid-template-columns: repeat(3, 1fr); gap: 8px; } .card-meta { font-size: 12px; } }

/* بلاطات الأندية والمنتخبات */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 16px 10px; height: 100%; font-weight: 800; }
.tile:hover { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.tile small { color: var(--muted); font-weight: 600; }
.crest { object-fit: contain; display: inline-block; vertical-align: middle; }
.crest-none { display: inline-grid; place-items: center; background: var(--surface2); border-radius: 50%; font-size: 14px; }
.flag { font-size: 40px; line-height: 1; }
.flag-xl { font-size: 96px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.jump a { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.group { padding: 14px 0; scroll-margin-top: 80px; }
.group h3 small { color: var(--muted); font-weight: 600; }

/* مسار التنقل */
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0 0; margin: 0; color: var(--muted); font-size: 14px; }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; opacity: .5; }
.crumbs a:hover { color: var(--ink); }

/* صفحة اللاعب */
.p-hero { display: grid; grid-template-columns: 320px 1fr; gap: 32px; align-items: end; padding: 24px 0 8px; }
.p-photo { aspect-ratio: var(--al-ratio); border-radius: var(--al-r); overflow: hidden; border: 1px solid var(--line); }
.p-alt { color: var(--muted); font-size: 20px; font-weight: 700; margin-top: -6px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 20px 0 0; }
.facts div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; }
.facts dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 800; font-size: 17px; }
.facts dd a { display: inline-flex; align-items: center; gap: 6px; }
.facts dd a:hover { text-decoration: underline; }
@media (max-width: 760px) { .p-hero { grid-template-columns: 1fr; } .p-photo { max-width: 260px; } }
.career { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.career li { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; }
.career li > a, .career li > span:first-child { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.career li > a:hover .cr-name { text-decoration: underline; }
.cr-years { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tag { font-style: normal; font-size: 12px; background: var(--surface3); color: var(--muted); border-radius: 6px; padding: 1px 6px; margin-inline-start: 6px; }
.riddles { display: grid; gap: 10px; }
.riddle { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.riddle summary { list-style: none; cursor: pointer; padding: 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-weight: 700; }
.riddle summary::-webkit-details-marker { display: none; }
.riddle summary b { flex: none; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.riddle[open] summary b { display: none; }
.riddle-ans { display: flex; align-items: center; gap: 12px; padding: 0 16px 16px; font-weight: 900; font-size: 18px; }
.riddle-ans:hover span { text-decoration: underline; }
.ent-hero { display: flex; gap: 24px; align-items: center; padding: 20px 0; }
.ent-hero .crest { flex: none; }
@media (max-width: 600px) { .ent-hero { flex-direction: column; align-items: flex-start; } }

/* أسئلة شائعة */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 800; }
.faq p { color: var(--muted); }

/* الدعوة */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; background: var(--accent); color: var(--on-accent); border-radius: 28px; padding: 28px; margin: 28px 0; }
.cta h2 { margin: 0 0 4px; }
.cta p { margin: 0; opacity: .8; }
.cta .store { background: var(--on-accent); color: #fff; }

/* التنقل بين الصفحات */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 28px 0 8px; }
.pager a, .pager span { min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; }
.pager span { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* التذييل */
.foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 36px 0 24px; background: var(--surface); }
.foot-in { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 24px; }
.foot h2 { font-size: 15px; color: var(--muted); }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 15px; }
.foot ul a:hover { text-decoration: underline; }
.foot-brand p { color: var(--muted); margin: 10px 0 14px; }
.foot-end { display: flex; justify-content: space-between; color: var(--muted); font-size: 14px; margin-top: 28px; }
@media (max-width: 760px) { .foot-in { grid-template-columns: 1fr 1fr; } .foot-brand { grid-column: 1 / -1; } }
.foot-links { display: flex; gap: 16px; flex-wrap: wrap; }
.prose { max-width: 760px; } .prose h2 { margin-top: 28px; } .prose p { line-height: 1.8; } .prose a { text-decoration: underline; } .prose .muted { color: var(--muted); font-size: 14px; margin-top: 32px; }
.nf { text-align: center; } .nf .lead { margin-inline: auto; } .nf .cards { margin-top: 28px; text-align: start; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
