/* الواجهة الجديدة «موسم القمرة» (body.nu-on — ما تشتغل إلا مع الموسم ٣، أو /?nu محلّي) — js/nu-home.js
   صفحة الألعاب بس: شاشات اللعب ما تنلمس (body.playing يرجّع كلّ شي مثل قبل) */
body.nu-on{--nu-ink:#eef2ff;--nu-dim:#9fb0d8;--nu-sil:#c9d6f2;--nu-gold:#ffd24a;--nu-glass:#0b1030cc;--nu-line:#c9d6f22e;background:#050817!important}
body.nu-on .nu-sky{position:fixed;inset:0;width:100vw;height:100vh;z-index:0;pointer-events:none}
body.nu-on::before{content:'';position:fixed;inset:0;z-index:0;pointer-events:none;background:radial-gradient(ellipse 55% 45% at 12% 6%,#3b3a9a44,transparent 70%),radial-gradient(ellipse 50% 40% at 92% 80%,#5a2a8a33,transparent 70%)}
body.nu-on.playing .nu-sky,body.nu-on.playing::before{display:none}
body.nu-on:not(.playing) #bgfx{display:none!important}
body.nu-on #layout,body.nu-on #topbar,body.nu-on #toolrail{position:relative;z-index:2}

/* الشريط فوق والجانبي: زجاج ليلي (نفس الأزرار كلّها) */
body.nu-on:not(.playing) #topbar{background:linear-gradient(180deg,#070b22e6,#070b2299)!important;border-bottom:1px solid var(--nu-line)!important;backdrop-filter:blur(10px)}
body.nu-on:not(.playing) #toolrail{background:#070b22d9!important;border-inline-end:1px solid var(--nu-line)!important;backdrop-filter:blur(10px)}
body.nu-on:not(.playing) #stage[data-game="home"]{background:transparent!important}

/* الرأس */
.nu-hero{position:relative;display:grid;grid-template-columns:minmax(220px,340px) 1fr minmax(260px,340px);gap:clamp(16px,3vw,40px);align-items:center;margin:8px 0 14px;padding:clamp(16px,2.4vw,30px);border-radius:28px;
  background:linear-gradient(135deg,#10173fdd,#0a0f2ccc);border:1px solid var(--nu-line);box-shadow:0 30px 80px #000a,inset 0 1px 0 #ffffff14;overflow:hidden;color:var(--nu-ink)}
.nu-hero::after{content:'';position:absolute;inset:auto -10% -60% -10%;height:80%;background:radial-gradient(ellipse at 50% 0,#8e9cff22,transparent 60%);pointer-events:none}
.nu-moon{position:relative;aspect-ratio:1;width:100%;max-width:300px;justify-self:center;border-radius:50%;
  background:radial-gradient(circle at 36% 32%,#fffdf2,#ebe5d1 44%,#bcb398 76%,#8a8264);box-shadow:0 0 50px #fff5,0 0 130px #8e9cff66,inset -18px -22px 40px #0003;animation:nuFloat 8s ease-in-out infinite}
.nu-moon>i:not(.nu-halo):not(.nu-mf){position:absolute;border-radius:50%;background:#0b10301c;box-shadow:inset 3px 3px 8px #0003}
.nu-moon .c1{width:22%;height:22%;left:20%;top:26%}.nu-moon .c2{width:15%;height:15%;left:58%;top:56%}.nu-moon .c3{width:10%;height:10%;left:62%;top:20%}
.nu-halo{position:absolute;inset:-26%;border-radius:50%;background:radial-gradient(circle,transparent 50%,#c9d6f21c 56%,transparent 70%);animation:nuHalo 6s ease-in-out infinite}
@keyframes nuFloat{50%{transform:translateY(-8px)}}
@keyframes nuHalo{50%{transform:scale(1.05);opacity:.7}}
.nu-kick{display:inline-flex;align-items:center;gap:8px;padding:6px 14px;border-radius:99px;background:#c9d6f214;border:1px solid #c9d6f244;font-weight:800;font-size:14px;color:#dfe6ff}
.nu-kick svg{width:15px;height:15px;color:#ffe29a}
.nu-txt h1{margin:12px 0 8px;font:900 clamp(40px,5vw,76px)/1.04 Cairo,Tajawal,sans-serif;color:#fff}
.nu-txt h1 b{background:linear-gradient(180deg,#fff,#c9d6f2 45%,#8e9cff);-webkit-background-clip:text;background-clip:text;color:transparent}
.nu-txt p{margin:0 0 16px;max-width:560px;font-size:clamp(15px,1.2vw,18px);line-height:1.9;font-weight:700;color:#c9d2ee}
.nu-stats{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:16px}
.nu-stats>div{padding:10px 16px;border-radius:14px;background:#ffffff0a;border:1px solid #ffffff16;min-width:110px}
.nu-stats b{display:block;font:900 26px/1.1 Cairo,sans-serif;color:#ffe29a}.nu-stats span{font-size:13px;font-weight:800;color:var(--nu-dim)}
.nu-cta{display:flex;gap:10px;flex-wrap:wrap}
.nu-btn{display:inline-flex;align-items:center;gap:8px;height:50px;padding:0 22px;border-radius:14px;border:1px solid #ffffff26;background:#ffffff10;color:#fff;font:900 16px Tajawal,Cairo,sans-serif;text-decoration:none;cursor:pointer;transition:transform .2s,box-shadow .2s}
.nu-btn svg{width:18px;height:18px}
.nu-btn:hover{transform:translateY(-2px);box-shadow:0 10px 30px #0008}
.nu-btn.pri{background:linear-gradient(90deg,#ffe29a,#ffb35c);color:#1a1340;border:0;box-shadow:0 12px 40px #ffb35c44}
.nu-hall{position:relative;z-index:1;padding:16px;border-radius:20px;background:#070b22b3;border:1px solid #ffd24a33}
.nu-hall h3{display:flex;align-items:center;gap:8px;margin:0 0 10px;font:900 18px Cairo,sans-serif;color:#ffe29a}
.nu-hall h3 svg{width:24px;color:var(--nu-gold)}
.nu-ch{display:grid;grid-template-columns:auto auto 1fr auto;align-items:center;gap:10px;padding:8px 10px;border-radius:14px;background:#ffffff08;margin-top:6px}
.nu-ch em{font:900 18px Cairo,sans-serif;font-style:normal;width:26px;text-align:center}
.nu-ch.r1 em{color:#ffd24a}.nu-ch.r2 em{color:#dfe6f2}.nu-ch.r3 em{color:#e0a070}
.nu-chav{width:42px;height:42px;border-radius:50%;overflow:hidden;display:grid;place-items:center;background:#22306a;box-shadow:0 0 0 2px #ffffff33}
.nu-ch.r1 .nu-chav{box-shadow:0 0 0 3px #ffd24a,0 0 18px #ffd24a88}
.nu-chav img{width:100%;height:100%;object-fit:cover}.nu-chav i{font:900 18px Cairo,sans-serif;font-style:normal}
.nu-ch b{font-weight:900;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.nu-ch>span:last-child{font-size:12px;font-weight:800;color:var(--nu-dim);white-space:nowrap}
.nu-empty{margin:0;color:var(--nu-dim);font-weight:700}

/* التبويبات */
.nu-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 16px}
.nu-tabs>*{display:inline-flex;align-items:center;gap:8px;height:44px;padding:0 18px;border-radius:12px;border:1px solid var(--nu-line);background:#0b1030b3;color:#dfe6ff;font:800 15px Tajawal,sans-serif;text-decoration:none;cursor:pointer}
.nu-tabs svg{width:17px;height:17px}
.nu-tabs .on{background:var(--nu-sil);color:#0b1030;border-color:transparent}
.nu-tabs>*:hover:not(.on){background:#ffffff14}

/* أماكن الموسم ٣ */
.nu-places{margin-bottom:10px}
.nu-pl{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}
.nu-plc{position:relative;display:flex;flex-direction:column;justify-content:flex-end;aspect-ratio:16/10;padding:16px;border-radius:20px;overflow:hidden;color:#fff;text-decoration:none;border:1px solid var(--nu-line);transition:transform .25s,box-shadow .25s}
.nu-plc>i{position:absolute;inset:0;background:var(--img) center/cover;transition:transform .5s}
.nu-plc::after{content:'';position:absolute;inset:0;background:linear-gradient(180deg,transparent 35%,#050817ee)}
.nu-plc b,.nu-plc small{position:relative;z-index:1}.nu-plc b{font:900 20px Cairo,sans-serif}.nu-plc small{font-size:13px;font-weight:700;color:#c9d2ee}
.nu-plc:hover{transform:translateY(-4px);box-shadow:0 16px 40px #000c,0 0 0 2px var(--nu-sil)}.nu-plc:hover>i{transform:scale(1.06)}

/* الصفوف والبطاقات بلون الليل */
body.nu-on #stage[data-game="home"] .hr-rowh b{color:#fff}
body.nu-on #stage[data-game="home"] .hr-rowh small{color:var(--nu-dim)}
body.nu-on #stage[data-game="home"] .hr-rowh i{background:#c9d6f21c;color:var(--nu-sil)}
body.nu-on #stage[data-game="home"] .hr-row[data-row="fresh"]{background:linear-gradient(180deg,#ffd24a12,transparent);border-color:#ffd24a44}
body.nu-on #stage[data-game="home"] .gcard.has-art{background:linear-gradient(180deg,#141b48,#0a0f2c)!important;border:1px solid var(--nu-line)!important;box-shadow:0 14px 34px #0009!important}
body.nu-on #stage[data-game="home"] .gcard.has-art:hover{box-shadow:0 0 0 2px var(--nu-sil),0 18px 44px #000c,0 0 34px #8e9cff44!important}
body.nu-on #stage[data-game="home"] .gcard.has-art .gc-go{background:linear-gradient(90deg,#ffe29a,#ffb35c)!important;color:#1a1340!important}
body.nu-on #stage[data-game="home"] .gcard.has-art .gc-d{color:#c9d2ee!important}
body.nu-on #stage[data-game="home"] .gcard .gc-new{background:#ffd24a!important;color:#1a1340!important}
body.nu-on #stage[data-game="home"] :is(.dq,.bpb,.st-bar,.tw-card,.lv-wrap,.t3x,.lk-bar){background:#0b1030cc!important;border-color:var(--nu-line)!important}

@media (max-width:1180px){.nu-hero{grid-template-columns:minmax(180px,260px) 1fr}.nu-hall{grid-column:1/-1}.nu-pl{grid-template-columns:repeat(2,1fr)}}
@media (max-width:720px){.nu-hero{grid-template-columns:1fr;text-align:center}.nu-moon{max-width:200px}.nu-stats,.nu-cta{justify-content:center}.nu-txt p{margin-inline:auto}.nu-tabs{justify-content:center}.nu-pl{grid-template-columns:1fr 1fr}}
html.perf-lite .nu-moon,html.perf-lite .nu-halo{animation:none}
/* عدّاد الموسم القديم (خسوف القمر) وشريحته ما يطلعون فوق الواجهة الجديدة — القمر الجديد مكانهم */
body.nu-on:not(.playing) :is(.sm-wrap,.sm-moon,.sm-gl,#seChip,#hubStrip){display:none!important}
/* زينة المواسم القديمة (الصقر/القمرة القديمة) ورا الصفحة تنشال — السما الجديدة مكانها */
html body.nu-on:not(.playing)::before{background:radial-gradient(ellipse 55% 45% at 12% 6%,#3b3a9a44,transparent 70%),radial-gradient(ellipse 50% 40% at 92% 80%,#5a2a8a33,transparent 70%)!important;opacity:1!important}
html body.nu-on:not(.playing)::after{display:none!important}
html body.nu-on:not(.playing) #stage[data-game="home"]{background:none!important;box-shadow:none!important;border-color:transparent!important}
html body.nu-on:not(.playing) #stage[data-game="home"]::before,html body.nu-on:not(.playing) #stage[data-game="home"]::after{display:none!important}
html body.nu-on:not(.playing) #layout::before{background:linear-gradient(#050817f0,#05081700)!important}
html body.nu-on:not(.playing) #brandmark{display:none!important}
.nu-hero{margin-top:var(--nu-top,84px)}
/* (أقوى من sky-theme: body:not(.playing):has(#stage[data-game=home]) #stage) — خلفيّة المسرح القديمة تنشال */
html body.nu-on:not(.playing):has(#stage[data-game="home"]) #stage#stage{background:none!important;box-shadow:none!important}
html body.nu-on:not(.playing):has(#stage[data-game="home"]) #stage#stage::before,html body.nu-on:not(.playing):has(#stage[data-game="home"]) #stage#stage::after{display:none!important}
/* الانتقال للموسم ٣ (js/season-shift.js): القمر يكبر ويغطّي الشاشة و«موسم القمرة» ثمّ تتحدّث الصفحة */
.ss-wrap{position:fixed;inset:0;z-index:99990;display:grid;place-items:center;background:#050817;opacity:0;transition:opacity .7s ease;color:#eef2ff;overflow:hidden}
.ss-wrap.on{opacity:1}
.ss-moon{position:absolute;left:50%;top:50%;width:160px;height:160px;margin:-80px 0 0 -80px;border-radius:50%;
  background:radial-gradient(circle at 36% 32%,#fffdf2,#ebe5d1 44%,#bcb398 76%,#8a8264);box-shadow:0 0 80px #fff6,0 0 200px #8e9cff88;transform:scale(.2);opacity:0}
.ss-wrap.on .ss-moon{animation:ssMoon 3s cubic-bezier(.6,.05,.2,1) forwards}
@keyframes ssMoon{0%{transform:scale(.2);opacity:0}25%{opacity:1}70%{transform:scale(2.4);opacity:1}100%{transform:scale(14);opacity:.9}}
.ss-t{position:relative;text-align:center;opacity:0;transform:translateY(14px)}
.ss-wrap.on .ss-t{animation:ssT 2.8s ease .35s forwards}
@keyframes ssT{0%{opacity:0;transform:translateY(14px)}30%,75%{opacity:1;transform:none}100%{opacity:0}}
.ss-t small{display:block;font:800 20px Tajawal,sans-serif;color:#ffe29a}
.ss-t b{display:block;font:900 clamp(46px,7vw,96px)/1.1 Cairo,Tajawal,sans-serif;color:#fff;text-shadow:0 4px 40px #000c}
.ss-t span{display:block;margin-top:8px;font:700 18px Tajawal,sans-serif;color:#c9d2ee}
/* بعد التحديث: الرأس والقطع تطلع وحدة وحدة */
html.nu-arrive body.nu-on .nu-hero{animation:nuIn .9s cubic-bezier(.2,.8,.2,1) both}
html.nu-arrive body.nu-on .nu-moon{animation:nuMoonIn 1.4s cubic-bezier(.2,.8,.2,1) both}
html.nu-arrive body.nu-on .nu-tabs{animation:nuIn .8s ease .35s both}
html.nu-arrive body.nu-on .nu-places{animation:nuIn .8s ease .55s both}
html.nu-arrive body.nu-on #hgrid .hr-row{animation:nuIn .8s ease .8s both}
@keyframes nuIn{from{opacity:0;transform:translateY(26px)}to{opacity:1;transform:none}}
@keyframes nuMoonIn{from{opacity:0;transform:scale(2.2)}to{opacity:1;transform:none}}
html.perf-lite.nu-arrive body.nu-on :is(.nu-hero,.nu-moon,.nu-tabs,.nu-places,#hgrid .hr-row){animation-duration:.01s}
.ss-moon{z-index:0}.ss-t{z-index:2}
/* «المدار» فوق الموقع (js/h4-host.js) — نوافذ الموقع (٨٠٠٠+) تطلع فوقه */
#h4wrap{position:fixed;inset:0;z-index:5000;display:none;background:#050817;max-width:none!important;margin:0!important;padding:0!important}
#h4wrap.on{display:block}
#h4wrap iframe{display:block;width:100%;height:100%;border:0}
body.h4-on{overflow:hidden}
/* (٢٠٢٦/١١/١٠ أداء) صفحة الألعاب القديمة تحت «المدار» كانت تنرسم كلّ إطار وهي مخفيّة — نوقف رسمها (ترجع أوّل ما يختفي الإطار) */
body.h4-on #stage{content-visibility:hidden}
@media (max-width:820px){body.h4-on .dg.mini,body.h4-on .dg-pill{bottom:86px!important}}
/* الإطار يطلع فوراً بصفحة الألعاب بلا انتظار (كانت الواجهة القديمة تبان لحظة بعد الرجوع من لعبة) */
body.h4-mode:not(.playing):not(.on-landing):has(#stage[data-game="home"]):not(:has(#stage .gi2, #stage .ns2)) #h4wrap{display:block}
body.h4-mode:not(.playing):has(#stage[data-game="home"]) #stage{visibility:hidden}

/* ══ شريط الأدوات الجديد بالموسم ٣ (المالك: «ابي شريط جديد بالأدوات الجديدة يكون لكل الألعاب») ══
   نفس الأزرار ونفس شغلها — الشكل بلون «المدار»: زجاج ليلي، أيقونات فضّيّة موحّدة، والمفعّل بتوهّج القمر */
body.h4-mode #toolrail{background:linear-gradient(180deg,rgba(7,11,34,.96),rgba(5,8,23,.94))!important;border-inline-end:1px solid rgba(201,214,242,.14)!important;box-shadow:6px 0 30px rgba(0,0,0,.45)!important}
body.h4-mode #toolrail::after{background:linear-gradient(180deg,transparent,rgba(201,214,242,.5) 30%,rgba(142,156,255,.5) 70%,transparent)!important}
body.h4-mode #toolrail .brand-logo{background:radial-gradient(circle at 35% 30%,#2a3270,#0b1030)!important;box-shadow:0 0 0 1px rgba(201,214,242,.25),0 0 18px rgba(142,156,255,.35)!important}
body.h4-mode #toolrail .brand-text b{color:#eef2ff}
body.h4-mode #toolrail .btn{width:44px;height:44px;min-width:0;padding:0;border-radius:14px!important;display:grid;place-items:center;
  background:rgba(201,214,242,.06)!important;border:1px solid rgba(201,214,242,.14)!important;color:#c9d6f2!important;box-shadow:none!important;transition:background .2s,border-color .2s,transform .2s}
body.h4-mode #toolrail .btn:hover{background:rgba(201,214,242,.14)!important;border-color:rgba(201,214,242,.32)!important;transform:translateY(-1px)}
body.h4-mode #toolrail .btn.on{background:radial-gradient(circle at 50% 30%,rgba(255,226,154,.28),rgba(255,226,154,.06))!important;border-color:rgba(255,226,154,.55)!important;color:#ffe29a!important;box-shadow:0 0 16px rgba(255,210,74,.25)!important}
body.h4-mode #toolrail .btn .ico,body.h4-mode #toolrail .btn svg{width:20px;height:20px;color:inherit;stroke:currentColor}
/* الأزرار الملوّنة القديمة (الساحة/الرسم/الباس/شخصيتي/حسابي) نفس الشكل الموحّد */
body.h4-mode #toolrail :is(.btn-draw-top,.btn-lobby-top,.btn-pass-top,.btn-char-top,.btn-upd-top,.btn-acct,#btnFb){display:grid;place-items:center;padding:0!important;border-radius:14px!important;box-shadow:none!important;width:44px!important;height:44px!important;background:rgba(201,214,242,.06)!important;color:#c9d6f2!important;border:1px solid rgba(201,214,242,.14)!important}
body.h4-mode #toolrail :is(.btn-draw-top,.btn-lobby-top,.btn-pass-top,.btn-char-top,.btn-upd-top,#btnFb) :is(span:not(.ico-e):not(.ph-ring),.fb-lbl,b){display:none!important}
body.h4-mode #toolrail :is(.btn-pass-top,.btn-char-top,.btn-upd-top) svg{width:20px;height:20px;color:#c9d6f2}
body.h4-mode #toolrail .btn-pass-top{color:#ffe29a!important}
body.h4-mode #toolrail .btn-acct img,body.h4-mode #toolrail .btn-acct .acct-ic{border-radius:12px}
body.h4-mode #toolrail .tools{gap:8px}
/* الشريط فوق وقت اللعب بنفس الطابع */
body.h4-mode:not(:has(#h4wrap.on)) #topbar{background:linear-gradient(180deg,rgba(7,11,34,.94),rgba(7,11,34,.78))!important;border-bottom:1px solid rgba(201,214,242,.14)!important}
body.h4-mode:not(:has(#h4wrap.on)) #topbar .btn-primary{background:linear-gradient(180deg,#fff3c8,#ffd24a)!important;color:#241a00!important;border:0!important}
/* غطاء التحميل (قبل ما تجهز «المدار») — نفس خلفيّتها، فما تبان الواجهة القديمة أبداً */
#h4wrap .h4-boot{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:14px;color:#c9d6f2;font:900 18px Cairo,Tajawal,sans-serif;
  background:radial-gradient(ellipse 55% 45% at 12% 6%,#3b3a9a44,transparent 70%),radial-gradient(ellipse 50% 40% at 92% 80%,#5a2a8a33,transparent 70%),#050817;transition:opacity .4s}
#h4wrap .h4-boot-moon{width:84px;height:84px;border-radius:50%;background:radial-gradient(circle at 36% 32%,#fffdf2,#ebe5d1 44%,#bcb398 76%,#8a8264);box-shadow:0 0 40px #fff5,0 0 100px #8e9cff55;animation:h4bm 1.6s ease-in-out infinite}
@keyframes h4bm{50%{transform:scale(.92);opacity:.75}}
#h4wrap.h4-ld .h4-boot{opacity:0;pointer-events:none}
#h4wrap iframe{position:absolute;inset:0}
/* الغطاء يطلع حتى قبل ما ينعرف الحساب، بس مو فوق الصفحة العامّة للزوّار */
body.h4-mode:not(.playing):not(.on-landing):not(:has(#stage .gi2, #stage .ns2)):has(#stage[data-game="home"]) #h4wrap,
body.h4-mode:not(.playing):not(.on-landing):not(:has(#stage[data-game])) #h4wrap{display:block}
/* الصفحة العامّة الجديدة للزوّار (js/h4-host.js) */
#h4land{position:fixed;inset:0;z-index:9450;display:none;background:#050817}
#h4land.on{display:block}
#h4land iframe{display:block;width:100%;height:100%;border:0}
body:has(#h4land.on){overflow:hidden}
/* (٢٠٢٦/١١/١١) الجوال وقت اللعب: الشعار وأزرار الساحة/هدهد رسم/التحديثات كانت طالعة برّا الشاشة بالشريط العلوي (ما تبان أصلاً) ⇒ تنخفي وقت اللعب بس */
@media (max-width:640px){
  body.playing #brandHome,body.playing .btn-draw-top,body.playing .btn-upd-top{display:none!important}
}
