/* ستايل اللعبة: ورق كريمي، حرف خيامية فوق، وأزرار كحلي. الألوان الأساسية بتيجي من الثيم (js/theme.js).
   الخطوط (css/fonts.css): Rakkas لاسم اللعبة والأرقام بس. العناوين اللي فيها كلام Changa 800 (ملاحظة مراجعة تلاهي ١٤/١١:
   Rakkas بيرسم ح وج وخ في أول الكلمة شبه ص، فـ«احفظ» كانت بتتقري «اصفظ» و«حسابك» «صابك») */

.dk{
  position:relative;
  width:100%; height:100%;
  display:flex; flex-direction:column; align-items:stretch; gap:8px;
  padding:calc(8px + env(safe-area-inset-top, 0px)) 12px calc(10px + env(safe-area-inset-bottom, 0px));
  box-sizing:border-box;
  overflow:hidden;
  font-family:'Changa', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif;
  color:#2A1B10;
  direction:rtl;
  background:
    repeating-linear-gradient(45deg, #C8102E 0 8px, #F6EBD0 8px 10px, #F2B705 10px 18px, #F6EBD0 18px 20px, #1C4FA0 20px 28px, #F6EBD0 28px 30px, #176B3A 30px 38px, #F6EBD0 38px 40px) top / 100% 7px no-repeat,
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 55%),
    #F1E3C2;
  user-select:none; -webkit-user-select:none;
  touch-action:manipulation;
}
.dk *{ box-sizing:border-box; }
.dk button{ font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.dk button:focus-visible{ outline:3px solid #FFB730; outline-offset:2px; }

/* ---------- الشريط اللي فوق ---------- */
.dkTop{ display:grid; grid-template-columns:44px 1fr 44px; align-items:center; gap:8px; min-height:48px; padding-top:4px; flex:none; }
.dkSq{
  width:44px; height:44px; border:none; border-radius:12px;
  background:#0F1437; color:#F6EBD0; box-shadow:0 3px 0 #070A1C;
  display:flex; align-items:center; justify-content:center;
}
.dkSq svg{ width:24px; height:24px; }
.dkSq:active{ transform:translateY(2px); box-shadow:0 1px 0 #070A1C; }
.dkTitle{ display:flex; flex-direction:column; align-items:center; gap:1px; min-width:0; }
.dkLvl{ font-family:'Changa', sans-serif; font-weight:800; font-size:22px; line-height:1.35; color:#C8102E; white-space:nowrap; text-shadow:0 2px 0 rgba(15,20,55,0.15); }
.dkTags{ display:flex; gap:6px; align-items:center; min-height:0; }
.dkDiff, .dkSub{ display:inline-flex; align-items:center; gap:3px; font-size:13px; font-weight:800; line-height:1; border-radius:999px; padding:3px 9px 4px 10px; white-space:nowrap; }
.dkDiff{ background:#7A1606; color:#FFE2A8; box-shadow:0 2px 0 #3A0A03; }
.dkDiff svg{ width:15px; height:15px; margin-top:-2px; }
.dkSub{ background:rgba(15,20,55,0.08); color:#5A3D22; }
.dkSub svg{ width:14px; height:14px; }
.dkDiff[hidden], .dkSub[hidden]{ display:none; }
.dkScore{
  display:flex; align-items:center; gap:4px;
  background:#0F1437; color:#FFE14A; border-radius:12px; padding:5px 10px 5px 9px;
  box-shadow:inset 0 0 0 2px #0F1437, inset 0 0 0 3.5px rgba(246,235,208,0.55), 0 3px 0 #070A1C;
  font-family:'Rakkas', 'Changa', sans-serif; font-size:19px; line-height:1;
}
.dkScore svg{ width:20px; height:20px; }
.dkScore b{ font-weight:400; font-variant-numeric:tabular-nums; min-width:14px; text-align:center; }

/* ---------- المحاولات ---------- */
.dkStatus{ display:flex; justify-content:center; align-items:center; gap:12px; flex:none; margin-top:-4px; }
.dkLives{ display:flex; justify-content:center; gap:6px; }
.dkClock{ display:inline-flex; align-items:center; gap:4px; font-size:15px; font-weight:800; color:#5A3D22; background:rgba(15,20,55,0.07); border-radius:999px; padding:2px 10px 3px 8px; font-variant-numeric:tabular-nums; }
.dkClockI{ display:flex; width:16px; height:16px; }
.dkClockI svg{ width:100%; height:100%; }
.dkClock b{ direction:rtl; unicode-bidi:isolate; min-width:40px; text-align:center; font-size:16px; white-space:nowrap; }   /* «١ د ٥ ث» (Meta.fmtTime) */
.dkLife{ width:30px; height:25px; transition:filter 0.3s, opacity 0.3s, transform 0.3s; }
.dkLife.lost{ filter:grayscale(1) brightness(0.9); opacity:0.32; transform:scale(0.86); }
.dkLife.drop{ animation:dkDrop 0.55s ease-out; }
@keyframes dkDrop{ 0%{ transform:scale(1.35) rotate(0); opacity:1; filter:none; } 40%{ transform:scale(1) rotate(-14deg); } 100%{ transform:scale(0.86) rotate(0); } }

/* ---------- كروت القواعد: رسمة صغيرة وتحتها الجملة ---------- */
.dkRules{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; flex:none; }
.dkRule{
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start; gap:3px;
  background:#FFF8E6; border:2px solid #0F1437; border-radius:10px;
  padding:6px 5px 5px; box-shadow:0 2px 0 #0F1437;
  text-align:center;
}
.dkRuleCv{ width:34px; height:34px; flex:none; }
.dkRule span{ font-size:12px; font-weight:800; line-height:1.3; color:#2A1B10; }
.dk.tight .dkRuleCv{ display:none; }
.dk.tight .dkRule{ padding:4px 5px; justify-content:center; }
.dk.tight .dkRule span{ font-size:11.5px; }
/* الفراغ الزيادة بيتوزع فوق الشبكة وتحتها */
.dkSp{ flex:1 1 0; min-height:0; }
.dkSp.last{ flex-grow:1.4; }
.dk.measure .dkSp{ display:none; }

/* ---------- سطر الدوسات في المرحلة ١ ---------- */
.dkTip{ align-self:center; flex:none; font-size:14px; font-weight:800; line-height:1.3; color:#F6EBD0; background:#0F1437; border-radius:999px; padding:4px 14px 5px; box-shadow:0 2px 0 #070A1C; }
.dkTip[hidden]{ display:none; }

/* ---------- دليل الألوان: كل لون بيبقى صورة القطعة لما يتحط فيه ---------- */
.dkLegend{ display:flex; justify-content:center; flex-wrap:nowrap; gap:4px; flex:none; min-height:22px; }
.dkChip{
  width:22px; height:22px; border-radius:7px; flex:0 1 22px; min-width:0;
  border:2px solid #0F1437;
  background-size:118% auto; background-position:center; background-repeat:no-repeat;
  transition:transform 0.2s;
}
/* لما اللون يتقفل: القطعة فوق لونه نفسه، أصغر سنة عشان اللون يبان حواليها */
.dkChip.on{ background-size:84% auto; border-color:#0F1437; }
.dkChip.pop{ animation:dkChip 0.4s cubic-bezier(0.34,1.6,0.64,1); }
@keyframes dkChip{ from{ transform:scale(0.4); } to{ transform:scale(1); } }

/* ---------- الشبكة ---------- */
.dkWrap{ position:relative; flex:1 1 auto; min-height:0; display:flex; align-items:center; justify-content:center; }
.dkBoard{ display:block; touch-action:none; filter:drop-shadow(0 4px 0 rgba(15,20,55,0.16)) drop-shadow(0 10px 18px rgba(15,20,55,0.16)); }
.dkWrap.shake .dkBoard{ animation:dkShake 0.38s; }
@keyframes dkShake{ 0%,100%{ transform:translateX(0); } 20%{ transform:translateX(-7px); } 40%{ transform:translateX(6px); } 60%{ transform:translateX(-4px); } 80%{ transform:translateX(2px); } }
.dkLoading{
  position:absolute; inset:0; display:none; align-items:center; justify-content:center; gap:10px;
  font-size:17px; font-weight:800; color:#5A3D22;
}
.dkLoading.show{ display:flex; }
.dkSpin{ width:22px; height:22px; border-radius:50%; border:3px solid rgba(15,20,55,0.2); border-top-color:#C8102E; animation:dkSpin 0.8s linear infinite; }
@keyframes dkSpin{ to{ transform:rotate(360deg); } }
.dkToast{
  position:absolute; bottom:calc(100% + 4px); left:50%; transform:translate(-50%, 8px);
  background:#0F1437; color:#F6EBD0; font-size:15px; font-weight:800; line-height:1.3;
  border-radius:999px; padding:6px 16px; white-space:nowrap; max-width:96%;
  opacity:0; pointer-events:none; transition:opacity 0.18s, transform 0.18s;
  box-shadow:0 3px 0 #070A1C; z-index:2;
}
.dkToast.show{ opacity:1; transform:translate(-50%, 0); }

/* ---------- الأدوات تحت ---------- */
.dkTools{ display:grid; grid-template-columns:repeat(4, 1fr); gap:7px; flex:none; }
.dkTool{
  position:relative;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  height:58px; border:none; border-radius:14px;
  background:#0F1437; color:#F6EBD0; box-shadow:0 4px 0 #070A1C;
  font-size:14px; font-weight:800; padding:4px 4px 3px; line-height:1.15;
}
.dkTool:active{ transform:translateY(3px); box-shadow:0 1px 0 #070A1C; }
.dkIco{ display:flex; width:25px; height:25px; flex:none; color:#0F1437; }
.dkIco svg{ width:100%; height:100%; }
.dkTool .dkIco{ color:#070A1C; }
.dkLbl{ white-space:nowrap; }
.dkBadge{
  position:absolute; top:-7px; left:-5px;
  min-width:24px; height:24px; padding:0 5px; border-radius:12px;
  background:#FFB730; color:#2A1B10; border:2px solid #0F1437;
  font-size:14px; font-weight:800; line-height:20px; text-align:center;
}
.dkTool.empty .dkBadge{ background:#C9C2B0; color:#5A5246; }
.dkTool.empty .dkIco{ opacity:0.55; }
.dkUndoB.empty{ opacity:0.6; }
/* ---------- التلميح (زي Meowdoku): سطر قصير فوق الشبكة مكان دليل الألوان، و«طبّق»/«تمام» مكان الأدوات بنفس الارتفاع،
   فالشبكة مابتتغطاش ولا بتصغر. الشبكة نفسها بتغمق غير خانات الشرح (board.js) ---------- */
.dkHint{
  position:absolute; z-index:3; bottom:calc(100% + 6px); left:0; right:0; margin:0 auto; width:max-content; max-width:100%;
  display:none; align-items:center; gap:7px;
  background:#FFF8E6; border:2px solid #0F1437; border-radius:14px; padding:5px 12px 6px 10px;
  box-shadow:0 3px 0 #0F1437, 0 8px 18px rgba(15,20,55,0.18);
  animation:dkPop 0.2s ease-out;
}
.dkHint.show{ display:flex; }
.dkHint .dkIco{ width:22px; height:22px; }
.dkHint p{ margin:0; font-size:15.5px; font-weight:800; line-height:1.35; color:#2A1B10; text-wrap:balance; }
/* مكان الكارت: الدليل والسطر بيستخبوا من غير ما يسيبوا مكانهم، والتوست بيروح تحت الشبكة */
.dk.hinting .dkLegend, .dk.hinting .dkTip{ visibility:hidden; }
.dk.hinting .dkToast{ bottom:auto; top:calc(100% + 8px); transform:translate(-50%, -8px); }
.dk.hinting .dkToast.show{ transform:translate(-50%, 0); }
.dkHintBar{ display:none; gap:8px; flex:none; height:58px; padding-bottom:4px; }
.dk.hinting .dkHintBar{ display:flex; }
.dk.hinting .dkTools{ display:none; }
.dkHintBar .dkBtn{ height:100%; flex:1; padding:0 12px; font-size:18px; }
.dkHintBar .dkBtn.primary{ flex:1.7; font-size:20px; }
@keyframes dkPop{ from{ transform:translateY(6px) scale(0.96); opacity:0; } to{ transform:none; opacity:1; } }
@keyframes dkUp{ from{ transform:translateY(30px); opacity:0; } to{ transform:none; opacity:1; } }

/* ---------- الشرح بالخطوات (المرحلة ١ و٢) ---------- */
.dkCoach{
  position:relative; z-index:3; flex:none;
  display:none; flex-direction:column; gap:6px;
  background:#0F1437; color:#F6EBD0; border-radius:16px; padding:10px 12px 9px;
  box-shadow:0 4px 0 #070A1C, 0 10px 26px rgba(15,20,55,0.3);
}
.dkCoach.show{ display:flex; }
.dkCoach.in{ animation:dkUp 0.28s cubic-bezier(0.34,1.4,0.64,1); }
.dkCoach.nudge{ animation:dkNudge 0.42s; }
@keyframes dkNudge{ 0%,100%{ transform:none; } 25%{ transform:translateX(-6px); } 50%{ transform:translateX(5px); } 75%{ transform:translateX(-3px); } }
.dkCoachTop{ display:flex; align-items:flex-start; gap:9px; }
.dkCoachTop .dkIco{ width:30px; height:30px; margin-top:1px; }
.dkCoachTop p{ margin:0; font-size:16.5px; font-weight:800; line-height:1.45; min-height:calc(16.5px * 1.45 * 3); }   /* ٣ سطور ثابتين: الشبكة ماتتنططش بين الخطوات */
.dkCoachBot{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.dkCoachStep{ font-size:13px; font-weight:800; color:#FFD23F; letter-spacing:1px; }
.dkCoachBtns{ display:flex; gap:8px; }
.dkCoach .dkBtn.small{ font-size:15px; padding:5px 14px 6px; }
.dkCoach .dkBtn.ghost{ background:transparent; color:#C9C2B0; box-shadow:inset 0 0 0 2px rgba(246,235,208,0.35); }
.dkCoach .dkBtn.primary{ min-width:96px; }
/* كارت القاعدة اللي الخطوة بتشرحها بينبض */
.dkRule.pulse{ border-color:#C8102E; background:#FFF1B8; animation:dkPulse 1.1s ease-in-out infinite; }
@keyframes dkPulse{ 0%,100%{ transform:scale(1); box-shadow:0 2px 0 #0F1437; } 50%{ transform:scale(1.05); box-shadow:0 2px 0 #0F1437, 0 0 0 4px rgba(255,210,63,0.75); } }
/* الأدوات مقفولة وقت الخطوة، غير «علّم X» لما تكون هي الخطوة */
.dk.coachLock .dkTool:not(.coachPulse){ opacity:0.38; }
.dkTool.coachPulse{ animation:dkToolPulse 1s ease-in-out infinite; box-shadow:0 4px 0 #070A1C, 0 0 0 4px #FFD23F; }
@keyframes dkToolPulse{ 0%,100%{ box-shadow:0 4px 0 #070A1C, 0 0 0 3px #FFD23F; } 50%{ box-shadow:0 4px 0 #070A1C, 0 0 0 7px #FFD23F, 0 0 18px 6px rgba(255,210,63,0.7); } }
@media (prefers-reduced-motion: reduce){ .dkRule.pulse, .dkTool.coachPulse, .dkCoach.nudge{ animation:none; } }

/* ---------- الاحتفال والكروت ---------- */
.dkFx{ position:absolute; inset:0; width:100%; height:100%; pointer-events:none; z-index:4; }
.dkModal{
  position:absolute; inset:0; z-index:5;
  display:none; align-items:center; justify-content:center; padding:20px;
  background:rgba(12,9,29,0.55);
}
.dkModal.show{ display:flex; }
.dkCard{
  width:100%; max-width:360px;
  background:
    linear-gradient(#F6EBD0, #F6EBD0) 10px 10px / calc(100% - 20px) calc(100% - 20px) no-repeat padding-box,
    repeating-linear-gradient(45deg, #C8102E 0 8px, #F6EBD0 8px 10px, #F2B705 10px 18px, #F6EBD0 18px 20px, #1C4FA0 20px 28px, #F6EBD0 28px 30px, #176B3A 30px 38px, #F6EBD0 38px 40px) padding-box;
  border:4px solid #0F1437; border-radius:18px;
  padding:24px 22px 22px;
  display:flex; flex-direction:column; align-items:stretch; gap:12px;
  box-shadow:0 6px 0 #070A1C, 0 14px 40px rgba(0,0,0,0.5);
  animation:dkIn 0.32s cubic-bezier(0.34,1.4,0.64,1);
  max-height:100%; overflow-y:auto;
}
@keyframes dkIn{ from{ transform:translateY(24px) scale(0.9); opacity:0; } to{ transform:none; opacity:1; } }
.dkCard h2{ font-family:'Changa', sans-serif; font-weight:800; font-size:25px; line-height:1.45; color:#C8102E; text-align:center; margin:0; }
.dkWinArt{ align-self:center; width:180px; height:74px; margin:-6px 0 -4px; }
.dkWinRow{ display:grid; grid-template-columns:repeat(2, 1fr); gap:6px; }
.dkStat{ display:flex; flex-direction:column; align-items:center; background:#FFF8E6; border:2px solid #0F1437; border-radius:10px; padding:5px 4px 4px; }
.dkStat b{ direction:rtl; unicode-bidi:isolate; white-space:nowrap; font-family:'Rakkas', 'Changa', sans-serif; font-weight:400; font-size:22px; line-height:1.3; color:#0F1437; font-variant-numeric:tabular-nums; }
.dkStat span{ font-size:12px; font-weight:800; color:#7D5A3A; }
.dkReward{ text-align:center; font-size:17px; font-weight:800; color:#176B3A; margin:0; }
.dkNote{ text-align:center; font-size:14px; font-weight:700; color:#6B4A2A; margin:0; line-height:1.5; }
.dkBtn{
  min-height:44px;   /* كل حاجة بتتداس ٤٤×٤٤ على الأقل (مراجعة تلاهي، tap.min44 في page-test) */
  border:none; border-radius:12px; padding:11px 18px;
  font-size:19px; font-weight:800; line-height:1.4;
  color:#F6EBD0; background:#0F1437; box-shadow:0 4px 0 #070A1C;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.dkBtn:active{ transform:translateY(3px); box-shadow:0 1px 0 #070A1C; }
.dkBtn.primary{ background:#C8102E; box-shadow:inset 0 0 0 2px #C8102E, inset 0 0 0 4px #F6EBD0, 0 4px 0 #070A1C; font-size:21px; }
.dkBtn.ghost{ background:transparent; color:#6B4A2A; box-shadow:none; font-size:16px; text-decoration:underline; padding:4px; }
.dkBtn.small{ font-size:16px; padding:8px 16px; flex:none; }
.dkBtnIco{ display:flex; width:22px; height:22px; }
.dkBtnIco svg{ width:100%; height:100%; }
@media (prefers-reduced-motion: reduce){
  .dk *, .dk *::after{ animation:none !important; transition:none !important; }
}
/* شاشات قصيرة جدًا (٣٦٠×٦٤٠): كل حاجة أصغر شوية */
@media (max-height:680px){
  .dk{ gap:6px; }
  .dkLvl{ font-size:22px; }
  .dkTool{ height:52px; font-size:13px; }
  .dkHintBar{ height:52px; }
  .dkTop{ min-height:44px; }
}


/* ---------- الخرز والمشاركة في كارت الكسب ---------- */
.dkStars{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
.dkStarBox{ display:flex; flex-direction:column; align-items:center; gap:2px; animation:dkStar 0.45s cubic-bezier(0.34,1.6,0.64,1) both; }
.dkStarBox.on{ opacity:1; }
.dkStarI{ display:block; width:50px; height:50px; -webkit-user-drag:none; }
.dkStarBox span{ font-size:12.5px; font-weight:800; color:#7D5A3A; text-align:center; line-height:1.2; }
.dkStarBox.on span{ color:#2A1B10; }
@keyframes dkStar{ from{ transform:scale(0.2) rotate(-30deg); opacity:0; } }
.dkBtn.share{ background:#176B3A; box-shadow:inset 0 0 0 2px #176B3A, inset 0 0 0 4px #F6EBD0, 0 4px 0 #0A3A1E; font-size:19px; }
.dkShareTxt{ width:100%; resize:none; font-family:inherit; font-size:14px; font-weight:700; line-height:1.5; color:#0F1437; background:#FFFBEF; border:2px dashed rgba(15,20,55,0.35); border-radius:10px; padding:6px 8px; user-select:text; -webkit-user-select:text; }
.dkShareTxt[hidden]{ display:none; }

/* ---------- الإعدادات: سويتشات ---------- */
.dkSet{ display:flex; align-items:center; justify-content:space-between; gap:12px; background:#FFF8E6; border:2px solid #0F1437; border-radius:12px; padding:8px 10px; }
.dkSetTxt{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.dkSetTxt b{ font-size:16px; font-weight:800; color:#2A1B10; line-height:1.3; }
.dkSetTxt small{ font-size:12.5px; font-weight:600; color:#6B4A2A; line-height:1.4; }
.dkSwitch::after{ content:''; position:absolute; inset:-9px -2px; }   /* الدوسة ٤٤ من غير ما الشكل يكبر */
.dkSwitch{ position:relative; flex:none; width:52px; height:30px; border-radius:999px; border:2px solid #0F1437; background:#D9CCB0; padding:0; transition:background 0.18s; }
.dkSwitch i{ position:absolute; top:2px; right:2px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 2px 0 rgba(15,20,55,0.35); transition:transform 0.18s; }
.dkSwitch.on{ background:#24A148; }
.dkSwitch.on i{ transform:translateX(-22px); }

/* ============================================================
   الغلاف: الرئيسية والمراحل والأرشيف
   ============================================================ */
.ap{ position:relative; width:100%; height:100%; overflow:hidden; font-family:'Changa', 'Noto Naskh Arabic', 'Segoe UI', Tahoma, sans-serif; direction:rtl; color:#2A1B10;
  background:
    repeating-linear-gradient(45deg, #C8102E 0 8px, #F6EBD0 8px 10px, #F2B705 10px 18px, #F6EBD0 18px 20px, #1C4FA0 20px 28px, #F6EBD0 28px 30px, #176B3A 30px 38px, #F6EBD0 38px 40px) top / 100% 7px no-repeat,
    radial-gradient(circle at 20% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 55%),
    #F1E3C2;
  user-select:none; -webkit-user-select:none; }
.ap *{ box-sizing:border-box; }
.ap button{ font-family:inherit; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.ap button:focus-visible{ outline:3px solid #FFB730; outline-offset:2px; }
.apScr{ position:absolute; inset:0; display:none; }
.apScr.on{ display:flex; }
.apHome, .apList{ flex-direction:column; gap:10px; padding:calc(14px + env(safe-area-inset-top, 0px)) 16px calc(14px + env(safe-area-inset-bottom, 0px)); overflow-y:auto; overscroll-behavior:contain; }
.apList{ gap:12px; }
.apPlay .dk{ background:transparent; }
.apIco{ display:flex; flex:none; }
.apIco svg{ width:100%; height:100%; }
.dkSq{ width:44px; height:44px; border:none; border-radius:12px; background:#0F1437; color:#F6EBD0; box-shadow:0 3px 0 #070A1C; display:flex; align-items:center; justify-content:center; padding:0; flex:none; }
.dkSq svg{ width:24px; height:24px; }
.dkSq.off{ opacity:0.3; pointer-events:none; }

/* ---------- الرئيسية (طلب زكي ٩/١١): «كمّل المرحلة» هي الأساس ---------- */
.apHome{ gap:12px; }
/* الشريط اللي فوق: الاسم يمين، والأيقونات شمال (رأيك، ورسايل اللاعيبة للأدمن، والإعدادات) */
.apTop{ display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:48px; flex:none; }
.apTop .apBrand{ flex-direction:row; align-items:center; gap:4px; min-width:0; }
.apTop .apArt{ margin:0; flex:none; }
.apTop .apBrand h1{ font-size:31px; line-height:1.2; white-space:nowrap; }
.apTools{ display:flex; gap:7px; flex:none; }
.dkSq.apIcoBtn{ position:relative; background:#FFF8E6; color:#0F1437; border:2px solid #0F1437; box-shadow:0 3px 0 #0F1437; }
.dkSq.apIcoBtn:active{ transform:translateY(2px); box-shadow:0 1px 0 #0F1437; }
@media (max-width:359px){ .apTop.many .apArt{ display:none; } .apTop.many .apBrand h1{ font-size:27px; } }
.apHeadSp{ width:44px; }
.apBrand{ display:flex; flex-direction:column; align-items:center; gap:0; text-align:center; }
.apBrand h1{ margin:0; font-family:'Rakkas', 'Changa', sans-serif; font-weight:400; font-size:38px; line-height:1.3; color:#C8102E; text-shadow:0 2px 0 rgba(15,20,55,0.15); }
.apBrand p{ margin:0; font-size:14px; font-weight:700; color:#6B4A2A; }

/* الستريك: علامة النار والرقم بس */
.apStat{ display:flex; align-items:center; flex-wrap:wrap; gap:6px 8px; margin-top:-2px; flex:none; }
.apStreak{ display:inline-flex; align-items:center; gap:5px; min-height:30px; background:#0F1437; color:#F6EBD0; border-radius:999px; padding:2px 12px 3px 10px; box-shadow:0 2px 0 #070A1C; font-size:13.5px; font-weight:800; line-height:1.2; white-space:nowrap; }
.apStreak b{ font-family:'Rakkas', 'Changa', sans-serif; font-weight:400; font-size:20px; line-height:1; color:#FFD23F; margin-top:2px; }
.apFlame{ width:19px; height:19px; }
.apStreak.zero{ background:rgba(255,248,230,0.7); color:#5A3D22; box-shadow:inset 0 0 0 2px rgba(15,20,55,0.18); }
.apStreak.zero b{ color:#7D5A3A; }

/* الكارت الكبير: «كمّل المرحلة N»، ولمحة من الشبكة، ونقط العشرة لحد المرحلة الصعبة، و«العب» */
.apHero{
  position:relative; flex:none; display:flex; flex-direction:column; gap:12px; width:100%;
  border:3px solid #0F1437; border-radius:20px; padding:14px 15px 15px; text-align:start; color:#FFF8E6; font:inherit; overflow:hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(255,214,120,0.30), rgba(255,214,120,0) 46%),
    repeating-linear-gradient(45deg, rgba(255,248,230,0.045) 0 10px, rgba(255,248,230,0) 10px 20px),
    linear-gradient(165deg, #D9223F, #B30D29 70%);
  box-shadow:inset 0 0 0 2px #C8102E, inset 0 0 0 4px rgba(246,235,208,0.85), 0 5px 0 #0F1437, 0 14px 26px rgba(122,10,30,0.22);
}
.apHero:active{ transform:translateY(3px); box-shadow:inset 0 0 0 2px #C8102E, inset 0 0 0 4px rgba(246,235,208,0.85), 0 2px 0 #0F1437; }
.apHero.hard{ background:
    radial-gradient(circle at 12% 18%, rgba(255,160,60,0.35), rgba(255,160,60,0) 46%),
    repeating-linear-gradient(45deg, rgba(255,248,230,0.045) 0 10px, rgba(255,248,230,0) 10px 20px),
    linear-gradient(165deg, #B5122B, #7A1606 75%); }
.apHeroMain{ display:flex; align-items:center; gap:12px; }
.apHeroTxt{ flex:1; min-width:0; display:flex; flex-direction:column; align-items:flex-start; gap:2px; }
.apHeroKick{ font-size:13.5px; font-weight:800; color:#FFDCA8; line-height:1.3; }
.apHeroT{ font-family:'Changa', sans-serif; font-weight:800; font-size:28px; line-height:1.3; color:#FFF8E6; text-shadow:0 2px 0 rgba(15,20,55,0.35); }
.apHeroTags{ display:flex; flex-wrap:wrap; gap:5px; margin-top:5px; }
.apTag{ display:inline-flex; align-items:center; gap:4px; font-size:12.5px; font-weight:800; line-height:1.2; white-space:nowrap; border-radius:999px; padding:3px 9px 4px; background:rgba(15,20,55,0.3); color:#FFF8E6; }
.apTag .apIco{ width:14px; height:14px; }
.apTag.hard{ background:#4A0C03; color:#FFE2A8; }
.apHeroPic{ flex:none; display:flex; transform:rotate(-5deg); filter:drop-shadow(0 4px 0 rgba(15,20,55,0.5)); margin:2px 2px 0 0; }
.apHeroPath{ display:flex; flex-direction:column; align-items:flex-start; gap:6px; }
.apDots{ display:flex; align-items:center; gap:4px; flex:none; }
.apDot{ width:10px; height:10px; border-radius:50%; background:rgba(15,20,55,0.32); box-shadow:inset 0 0 0 1.5px rgba(255,248,230,0.3); }
.apDot.on{ background:#FFD23F; box-shadow:none; }
.apDot.cur{ background:#FFF8E6; box-shadow:0 0 0 3px rgba(255,210,63,0.55); }
.apDot.hard{ width:18px; height:18px; background:none; box-shadow:none; opacity:0.6; display:flex; }
.apDot.hard.on, .apDot.hard.cur{ opacity:1; }
.apDot.hard svg{ width:100%; height:100%; }
.apHeroPath small{ font-size:13.5px; font-weight:800; line-height:1.35; color:#FFE9C7; }
.apHeroGo{ display:flex; align-items:center; justify-content:center; gap:8px; min-height:50px; border-radius:14px; background:#FFF8E6; color:#C8102E; border:2px solid #0F1437; box-shadow:0 3px 0 #0F1437; font-size:21px; font-weight:800; line-height:1.3; }
.apHeroGo .apIco{ width:17px; height:17px; }
.apHero.hard .apHeroGo{ color:#7A1606; }

/* لغز اليوم وتحدي الأسبوع جنب بعض */
.apPair{ display:grid; grid-template-columns:1fr 1fr; gap:10px; flex:none; }
.apCard.apTileC{ gap:2px; padding:10px 11px 11px; min-width:0; text-align:start; font:inherit; color:inherit; width:100%; }
button.apTileC{ cursor:pointer; }
button.apTileC:active{ transform:translateY(2px); box-shadow:0 2px 0 #0F1437; }
.apTileTop{ display:flex; align-items:flex-start; justify-content:space-between; gap:6px; min-height:34px; }
.apTileIco{ width:32px; height:32px; }
.apTileTop .apTag{ background:rgba(15,20,55,0.08); color:#0F1437; margin-top:4px; }
.apTileTop .apTag.hard{ background:#7A1606; color:#FFE2A8; }
.apTileT{ font-family:'Changa', sans-serif; font-weight:800; font-size:18px; line-height:1.35; color:#0F1437; white-space:nowrap; margin-top:3px; }
.apTileSub{ font-size:12.5px; font-weight:700; color:#6B4A2A; line-height:1.4; margin-bottom:8px; }
.apGo{ margin-top:auto; display:flex; align-items:center; justify-content:center; gap:6px; min-height:42px; border-radius:11px; font-size:17px; font-weight:800; line-height:1.3; color:#F6EBD0; background:#0F1437; box-shadow:0 3px 0 #070A1C; }
.apGo.primary{ background:#C8102E; box-shadow:inset 0 0 0 2px #C8102E, inset 0 0 0 3.5px #F6EBD0, 0 3px 0 #070A1C; }
.apGo .apIco{ width:13px; height:13px; }
.apTileC .apDone{ font-size:14px; gap:5px; margin:2px 0 7px; }
.apTileC .apDone .apIco{ width:20px; height:20px; }
.apTileC .apBead{ width:17px; height:17px; }
.apDoneT{ font-variant-numeric:tabular-nums; }
.apNext.apTileNext{ margin-top:auto; align-self:stretch; justify-content:flex-start; font-size:12.5px; padding:3px 8px 4px 7px; gap:4px; line-height:1.35; white-space:nowrap; }
@media (max-width:359px){ .apNext.apTileNext{ font-size:12px; padding:3px 7px 4px; } .apTileNext .apNextIco{ display:none; } }
.apTileNext .apNextIco{ width:14px; height:14px; }
.apShare{ position:relative; flex:none; width:40px; height:40px; margin:-3px -3px 0 0; border:2px solid #0F1437; border-radius:50%; background:#176B3A; color:#fff; box-shadow:0 2px 0 #0A3A1E; display:flex; align-items:center; justify-content:center; padding:0; }
.apShare::after{ content:''; position:absolute; inset:-4px; }
.apShare svg{ width:19px; height:19px; }
.apShare:active{ transform:translateY(2px); box-shadow:none; }

/* الصف الصغير: كل المراحل، والأرشيف، ولوحة الشرف */
.apMore{ display:grid; grid-template-columns:repeat(3, 1fr); gap:8px; flex:none; }
.apMini{ position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px; min-width:0; min-height:76px; padding:9px 4px 8px; border:2px solid #0F1437; border-radius:14px; background:#FFF8E6; color:#0F1437; box-shadow:0 3px 0 #0F1437; text-align:center; font:inherit; }
.apMini:active{ transform:translateY(2px); box-shadow:0 1px 0 #0F1437; }
.apMiniIco{ width:28px; height:28px; margin-bottom:3px; }
.apMini b{ font-size:14.5px; font-weight:800; line-height:1.3; white-space:nowrap; }

/* اللي ببلاش النهارده */
.apFree{ display:flex; justify-content:center; margin:0; }
.apFreeV{ display:inline-flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:4px 10px; }
.apFreeI{ display:inline-flex; align-items:center; gap:3px; }
.apFreeI .apIco{ width:18px; height:18px; }
.apFreeI b{ font-weight:800; color:#0F1437; }
.apSr{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); clip-path:inset(50%); white-space:nowrap; }

.apRepair{ display:flex; align-items:center; gap:10px; background:#FFE9C7; border:2px dashed #C8102E; border-radius:14px; padding:9px 12px; }
.apRepairTxt{ flex:1; display:flex; flex-direction:column; gap:1px; min-width:0; }
.apRepairTxt b{ font-size:16px; font-weight:800; color:#A10E26; }

/* «نزّل اللعبة كتطبيق» (js/dl.js): شريط صغير تحت الاسم */
.apDl{ display:flex; align-items:center; gap:10px; background:#E7F3E2; border:2px solid #176B3A; border-radius:14px; padding:8px 10px 8px 12px; }
.apDlIco{ width:34px; height:34px; flex:none; }
.apDlTxt{ flex:1; display:flex; flex-direction:column; gap:1px; min-width:0; }
.apDlTxt b{ font-size:15.5px; font-weight:800; color:#0F1437; line-height:1.35; }
.apDlTxt span{ font-size:12.5px; font-weight:700; color:#4A5A3A; line-height:1.4; }
.apDlAct{ display:flex; flex-direction:column; align-items:stretch; gap:2px; flex:none; }
.apBtn.apDlGo{ text-decoration:none; min-width:72px; padding:6px 14px; background:#176B3A; box-shadow:0 3px 0 #0A3A1E; }
.apBtn.apDlGo:active{ box-shadow:0 1px 0 #0A3A1E; }
.apBtn.apDlLater{ background:none; box-shadow:none; color:#4A5A3A; font-size:13px; font-weight:700; padding:3px 6px; text-decoration:underline; text-underline-offset:3px; }
.apBtn.apDlLater:active{ transform:none; box-shadow:none; }
.apDl.went .apDlGo{ opacity:0.7; }

.apCard{ display:flex; flex-direction:column; gap:8px; background:#FFF8E6; border:3px solid #0F1437; border-radius:16px; padding:11px 13px; box-shadow:0 4px 0 #0F1437; }
.apDaily{ background:linear-gradient(#FFF8E6, #FFF1D0); }
.apWeekly{ background:linear-gradient(#EAF6F7, #D7EEF0); }
.apCardHead{ display:flex; align-items:center; gap:10px; }
.apCardIco{ width:38px; height:38px; }
.apCardT{ display:flex; flex-direction:column; min-width:0; }
.apCardT b{ font-family:'Changa', sans-serif; font-weight:800; font-size:20px; line-height:1.25; color:#0F1437; }
.apCardT small{ font-size:13.5px; font-weight:700; color:#6B4A2A; }
.apCardBody{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.apCardBody > small{ font-size:12.5px; font-weight:700; color:#7D5A3A; }
.apDone{ display:flex; align-items:center; gap:6px; font-size:15px; font-weight:800; color:#176B3A; }
.apDone .apIco{ width:22px; height:22px; }
/* لغز اتحل: الكارت كله بيفتح النتيجة، وتحته عدّاد للجاي */
.apCard.done{ cursor:pointer; border-color:#176B3A; box-shadow:0 4px 0 #176B3A; }
.apCard.done:active{ transform:translateY(2px); box-shadow:0 2px 0 #176B3A; }
.apDaily.done{ background:linear-gradient(#F3FAEC, #E3F2D8); }
.apNext{ display:flex; align-items:center; gap:6px; font-size:14px; font-weight:800; color:#0F1437; background:rgba(15,20,55,0.07); border-radius:999px; padding:3px 12px 4px 10px; align-self:flex-start; }
.apNextIco{ width:17px; height:17px; color:#C8102E; }
.apNextT{ font-variant-numeric:tabular-nums; }
.dkNote.apNext{ align-self:center; font-size:15px; color:#0F1437; }
.apBtn.share{ background:#176B3A; box-shadow:0 4px 0 #0A3A1E; }
.apBtnIco{ width:18px; height:18px; }
/* الخرز (بدل النجوم): صور صغيرة، المنوّرة زرقا والمطفية رمادي بحرف غامق، فالعدد بيبان من أول نظرة على أي خلفية */
.apBeads{ display:inline-flex; align-items:center; gap:2px; flex:none; direction:rtl; }
.apBead{ display:block; width:15px; height:15px; flex:none; -webkit-user-drag:none; }

.apBtn{ min-height:44px; border:none; border-radius:12px; padding:9px 18px; font-size:18px; font-weight:800; line-height:1.35; color:#F6EBD0; background:#0F1437; box-shadow:0 4px 0 #070A1C; display:inline-flex; align-items:center; justify-content:center; gap:8px; }
.apBtn:active{ transform:translateY(3px); box-shadow:0 1px 0 #070A1C; }
.apBtn.primary{ background:#C8102E; box-shadow:inset 0 0 0 2px #C8102E, inset 0 0 0 4px #F6EBD0, 0 4px 0 #070A1C; min-width:96px; }
.apBtn.dark{ min-width:96px; }
.apBtn.big{ width:100%; font-size:21px; padding:12px; }
.apBtn.small{ font-size:15px; padding:7px 14px; }
.apBtn.warm{ background:#C8102E; }
.apBtn.light{ background:#FFF8E6; color:#0F1437; border:2px solid #0F1437; box-shadow:0 3px 0 #0F1437; font-size:16px; padding:8px 10px; }
.apBtn.light .apIco{ width:22px; height:22px; }
.apFoot{ margin:2px 0 0; text-align:center; font-size:13px; font-weight:700; color:#7D5A3A; line-height:1.5; }

/* المراحل */
.apHead{ display:grid; grid-template-columns:44px 1fr 44px; align-items:center; gap:8px; flex:none; }
.apHead h2{ margin:0; text-align:center; font-family:'Changa', sans-serif; font-weight:800; font-size:23px; line-height:1.4; color:#C8102E; }
.apScroll{ flex:1; min-height:0; overflow-y:auto; margin:0 -4px; padding:4px 4px 12px; }
.apGrid{ display:grid; grid-template-columns:repeat(5, 1fr); gap:8px; }
.apTile{ position:relative; aspect-ratio:1 / 1.08; border:2px solid #0F1437; border-radius:12px; background:#FFF8E6; box-shadow:0 3px 0 #0F1437; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0; padding:2px; }
.apTile b{ font-family:'Rakkas', 'Changa', sans-serif; font-weight:400; font-size:23px; line-height:1.15; color:#0F1437; }
.apTile .apBeads{ min-height:14px; gap:2px; margin-top:2px; }
.apTile .apBead{ width:14px; height:14px; }
.apTile.done{ background:#E6F3DF; }
.apTile.hard{ background:#FFE3D0; }
.apTile.hard.done{ background:#F5DCC0; }
.apTile.cur{ background:#C8102E; border-color:#0F1437; }
.apTile.cur b{ color:#FFF8E6; }
.apTile.locked{ opacity:0.45; box-shadow:none; }
.apLock{ width:15px; height:15px; color:#7D5A3A; }
.apTileFlame{ position:absolute; top:-7px; left:-6px; width:20px; height:20px; }

/* الأرشيف */
.apMonth{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.apMonth b{ font-size:21px; font-weight:800; color:#0F1437; }
.apNav{ width:44px; height:44px; }
.apCal{ display:grid; grid-template-columns:repeat(7, 1fr); gap:5px; column-gap:clamp(2px, calc((100% - 310px) / 6), 5px); }   /* الأيام ٤٤ على الأقل حتى على ٣٦٠ */
.apWd{ text-align:center; font-size:12.5px; font-weight:800; line-height:1.3; color:#7D5A3A; white-space:nowrap; min-width:0; }   /* «حد» «اتنين»… كلمة مش حرف (مراجعة تلاهي) */
.apDay{ aspect-ratio:1 / 1.12; border:2px solid #0F1437; border-radius:10px; background:#FFF8E6; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:0; gap:0; box-shadow:0 2px 0 #0F1437; }
.apDay b{ font-size:16px; font-weight:800; color:#0F1437; line-height:1.2; }
.apDay .apBeads{ gap:1px; margin-top:1px; }
.apDay .apBead{ width:11px; height:11px; }
.apDay.empty{ border:none; background:none; box-shadow:none; }
.apDay.off{ opacity:0.3; box-shadow:none; }
.apDay.done{ background:#DDF0D5; }
.apDay.today{ background:#C8102E; }
.apDay.today b{ color:#FFF8E6; }
.apDay.frozen{ background:#DDF1FB; }
.apDayIco{ width:13px; height:13px; color:#3F86B5; }

.apSheet{ z-index:20; }
.apToast{ position:absolute; bottom:calc(24px + env(safe-area-inset-bottom, 0px)); left:50%; transform:translate(-50%, 8px); background:#0F1437; color:#F6EBD0; font-size:15px; font-weight:800; line-height:1.35; border-radius:999px; padding:5px 16px; opacity:0; pointer-events:none; transition:opacity 0.18s, transform 0.18s; z-index:30; white-space:nowrap; text-align:center; }
.apToast.show{ opacity:1; transform:translate(-50%, 0); }
.apHiddenTa{ position:fixed; top:-200px; opacity:0; }

/* ---------- الصفحة نفسها ---------- */
html, body{ margin:0; padding:0; height:100%; background:#1A1440; overflow:hidden; overscroll-behavior:none; }
/* قبل ما اللعبة تقوم (السكريبتات لسه بتتحمّل): ورق بنفس لون الانترو وشاشة فتح التطبيق، مش كحلي، عشان مفيش نطّة لون على النت البطيء.
   index.html حاطط dkPre على html، وApp.boot بيشيلها أول ما الانترو أو الرئيسية يتحطوا */
html.dkPre, html.dkPre body{ background:#F1E3C2; }
body{ display:flex; justify-content:center; }
#app{ width:100%; max-width:520px; height:100%; height:100dvh; }
@media (min-width:600px){ #app{ box-shadow:0 0 0 4px #0F1437, 0 20px 60px rgba(0,0,0,0.5); } }

/* ============================================================
   الليدربورد (js/lb.js)
   ============================================================ */
.apMini.lbCard{ background:linear-gradient(#FFF8E0, #FFEDB3); }
/* حلول مستنية تتبعت: علامة صغيرة بعددها في ركن المربع */
.lbPend{ position:absolute; top:6px; left:6px; min-width:22px; height:22px; padding:0 5px; border-radius:11px; background:#C8102E; color:#fff; border:2px solid #F1E3C2; font-size:12.5px; font-weight:800; line-height:18px; text-align:center; }
.lbScroll{ display:flex; flex-direction:column; gap:12px; }
.lbInfo{ align-items:center; text-align:center; gap:8px; padding:16px 14px; }
.lbInfo b{ font-family:'Changa', sans-serif; font-weight:800; font-size:20px; line-height:1.3; color:#0F1437; }
.lbInfo p{ margin:0; font-size:14.5px; font-weight:700; color:#6B4A2A; line-height:1.55; }
.lbBig{ width:54px; height:54px; }
.lbMe{ gap:10px; background:linear-gradient(#FFF8E6, #FFF1D0); }
.lbMeTop{ display:flex; align-items:center; gap:10px; }
.lbMeName{ flex:1; display:flex; flex-direction:column; min-width:0; }
.lbMeName b{ font-family:'Changa', sans-serif; font-weight:800; font-size:20px; line-height:1.35; color:#0F1437; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lbMeName small{ font-size:12.5px; font-weight:700; color:#7D5A3A; }
.lbEdit{ width:44px; height:44px; flex:none; border:2px solid #0F1437; border-radius:12px; background:#FFF8E6; color:#0F1437; box-shadow:0 3px 0 #0F1437; display:flex; align-items:center; justify-content:center; padding:0; }
.lbEdit .apIco{ width:20px; height:20px; }
.lbEdit:active{ transform:translateY(2px); box-shadow:0 1px 0 #0F1437; }
.lbStats{ display:grid; grid-template-columns:repeat(3, 1fr); gap:6px; }
.lbStat{ display:flex; flex-direction:column; align-items:center; background:#FFF8E6; border:2px solid #0F1437; border-radius:10px; padding:4px 4px 3px; }
.lbStat b{ font-family:'Rakkas', 'Changa', sans-serif; font-weight:400; font-size:22px; line-height:1.3; color:#C8102E; font-variant-numeric:tabular-nums; }
.lbStat span{ font-size:12px; font-weight:800; color:#7D5A3A; }
.lbAva{ position:relative; width:34px; height:34px; flex:none; border-radius:50%; overflow:hidden; border:2px solid #0F1437; background:#9AD1D4; display:flex; align-items:center; justify-content:center; }
.lbAva.big{ width:52px; height:52px; border-width:3px; }
.lbAva img{ width:100%; height:100%; object-fit:cover; display:block; }
.lbAva b{ font-size:16px; font-weight:800; color:#0F1437; line-height:1; }
.lbAva.big b{ font-size:24px; }
.lbList{ display:flex; flex-direction:column; gap:6px; }
.lbHead{ font-size:13px; font-weight:800; color:#7D5A3A; padding:0 4px; }
.lbRow{ display:grid; grid-template-columns:34px 34px 1fr auto; align-items:center; gap:9px; background:#FFF8E6; border:2px solid #0F1437; border-radius:12px; padding:6px 10px; box-shadow:0 2px 0 #0F1437; }
.lbRank{ justify-self:center; min-width:30px; height:30px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:15px; font-weight:800; color:#0F1437; background:rgba(15,20,55,0.07); font-variant-numeric:tabular-nums; }
.lbRow.top1 .lbRank{ background:#FFD23F; box-shadow:inset 0 0 0 2px #7A4A00; }
.lbRow.top2 .lbRank{ background:#DCDCE4; box-shadow:inset 0 0 0 2px #5C5C70; }
.lbRow.top3 .lbRank{ background:#E9B48A; box-shadow:inset 0 0 0 2px #7A3E12; }
.lbName{ font-size:16px; font-weight:800; color:#2A1B10; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
.lbPts{ font-family:'Rakkas', 'Changa', sans-serif; font-size:19px; color:#C8102E; font-variant-numeric:tabular-nums; }
.lbRow.me{ background:#0F1437; border-color:#0F1437; box-shadow:0 3px 0 #070A1C; }
.lbRow.me .lbName{ color:#F6EBD0; }
.lbRow.me .lbPts{ color:#FFD23F; }
.lbRow.me .lbRank{ background:#FFD23F; color:#0F1437; box-shadow:none; }
.lbGap{ text-align:center; font-size:20px; font-weight:800; color:#7D5A3A; line-height:0.8; }
.lbWait{ display:flex; flex-direction:column; align-items:center; gap:8px; padding:18px 8px; font-size:14.5px; font-weight:700; color:#6B4A2A; text-align:center; }
.lbPendLine{ margin:0; text-align:center; font-size:13.5px; font-weight:800; color:#A10E26; }
.lbWhy{ margin:0; text-align:center; font-size:15.5px; font-weight:700; color:#2A1B10; line-height:1.55; }
.lbGBtn{ display:flex; justify-content:center; align-items:center; min-height:48px; font-size:14px; font-weight:700; color:#6B4A2A; text-align:center; }
.lbSmall{ display:block; text-align:center; font-size:12.5px; font-weight:700; color:#7D5A3A; line-height:1.5; }
.lbSmall.err{ color:#A10E26; }
.lbLegal{ margin:0; text-align:center; font-size:12.5px; font-weight:700; color:#7D5A3A; line-height:1.6; }
.lbLegal a{ display:inline-flex; align-items:center; min-height:44px; padding:0 6px; color:#7D5A3A; text-decoration:underline; text-underline-offset:3px; }
.lbInput{ width:100%; font-family:inherit; font-size:18px; font-weight:700; color:#0F1437; background:#FFF8E6; border:2px solid #0F1437; border-radius:12px; padding:9px 12px; outline:none; user-select:text; -webkit-user-select:text; }
.lbInput:focus{ box-shadow:0 0 0 3px #FFB730; }
.lbSet .apBtn{ flex:none; }
.lbWin{ margin:0; text-align:center; font-size:15px; font-weight:800; color:#1C4FA0; line-height:1.5; }
.lbWin.done{ color:#176B3A; }
button.lbWin.link{ background:none; border:none; padding:2px; min-height:44px; width:100%; text-decoration:underline; cursor:pointer; font-family:inherit; }
.lbSoon{ flex:none; font-size:13px; font-weight:800; color:#7D5A3A; background:rgba(15,20,55,0.07); border-radius:999px; padding:4px 10px; }

/* ---------- شاشة التسجيل أول فتحة (app.js: gate، والكارت من LB.gateCard): نفس ترتيب ومسافات «عجلة المفهومية» ---------- */
.apGate{ flex-direction:column; padding:calc(14px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y:auto; overscroll-behavior:contain; }
.apGateIn{ margin:auto 0; display:flex; flex-direction:column; align-items:stretch; gap:16px; }
.apGateBrand h1{ font-size:min(50px, 12vw); line-height:1.25; }
.apGateBrand p{ margin-top:-4px; font-size:16px; font-weight:800; }
.apGateArt{ align-self:center; margin:-6px 0 -8px; }
.lbGate{ align-items:stretch; gap:10px; padding:16px; border-radius:18px; box-shadow:0 5px 0 #0F1437; margin-top:6px; }
.lbGateT{ font-family:'Changa', sans-serif; font-weight:800; font-size:22px; line-height:1.4; color:#0F1437; text-align:center; }
.lbGate .lbWhy{ font-size:15px; color:#5A3D22; }
.lbGate .lbGBtn{ min-height:46px; flex-direction:column; }
.lbWaitIn{ display:inline-flex; align-items:center; gap:8px; font-weight:800; }
.lbGate .lbSmall.err{ font-size:14px; font-weight:800; }
.lbGate .lbRetry, .lbGate .lbSkip, .lbGate .lbBack{ width:100%; font-size:17px; padding:9px 12px; }
.lbGate .apBtn[hidden]{ display:none; }
/* «بعدين» وكل زراير الشاشة ولينكات الخصوصية: ٤٤ بكسل على الأقل في الاتجاهين (زكي ١٤/١١) */
.lbGate .apBtn, .lbGate .lbGNative{ min-height:44px; }
.lbGate .lbLater{ width:100%; font-size:17px; padding:9px 12px; }
.lbGate .lbLegal a, .lbNeedIab a{ display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; padding:0 6px; }
.lbNeed .lbNeedGo{ min-height:44px; }
.lbNeedIab{ display:flex; flex-direction:column; align-items:stretch; gap:8px; width:100%; }
/* جوه متصفح فيسبوك وأخواته: «احفظ تقدمك» و«افتح في كروم» (js/lb.js) */
.apBtn.lbIabBtn{ text-decoration:none; background:#1C4FA0; box-shadow:0 4px 0 #0E2A5C; color:#fff; }
.lbIab{ display:flex; align-items:center; justify-content:space-between; gap:10px; background:#E3ECFA; border:2px solid #1C4FA0; border-radius:12px; padding:7px 10px; font-size:13.5px; font-weight:800; color:#0E2A5C; line-height:1.45; flex:none; }
.lbIabGo{ flex:none; background:#1C4FA0; color:#fff; border-radius:999px; padding:5px 12px; font-size:13.5px; font-weight:800; text-decoration:none; white-space:nowrap; }
/* زرار جوجل في التطبيق (js/lb.js gBtn): نفس .tvGNative في «عجلة المفهومية» بالظبط */
.lbGNative{
  position:relative; align-self:center; display:flex; align-items:center; justify-content:center; width:100%; max-width:320px; min-height:44px;
  padding:4px 46px; border-radius:999px; background:#131314; color:#E3E3E3; border:1px solid #8E918F;
  font-size:15.5px; font-weight:500; line-height:1.3; white-space:nowrap; transition:transform .08s, background .2s, opacity .2s;
}
.lbGNative:active:not(:disabled){ transform:translateY(1px); background:#2A2A2D; }
.lbGNative:disabled{ opacity:.6; cursor:default; }
.lbGLogo{ position:absolute; inset-inline-start:3px; top:50%; transform:translateY(-50%); width:36px; height:36px; border-radius:50%; background:#fff; display:flex; align-items:center; justify-content:center; }
.lbGLogo svg{ width:19px; height:19px; display:block; }

/* ============================================================
   «حاجة مش عجباك؟ ابعت» و«رسايل اللاعيبة» (js/fb.js)
   ============================================================ */
.fbBtnIco{ width:25px; height:25px; color:#0F1437; }
/* «رسايل اللاعيبة» (الأدمن): عدد الجديد بالأحمر في ركن الأيقونة */
.fbBadge{ position:absolute; top:-8px; left:-8px; min-width:22px; height:22px; padding:0 5px; border-radius:11px; background:#C8102E; color:#fff; border:2px solid #F1E3C2; font-size:12.5px; font-weight:800; line-height:18px; text-align:center; font-variant-numeric:tabular-nums; }
.fbBadge:empty{ display:none; }
.dkCard.fbCard{ gap:10px; }
.fbLead{ font-size:14.5px; }
.fbKind{ display:flex; flex-direction:column; gap:5px; }
.fbKind > small{ font-size:12.5px; font-weight:800; color:#7D5A3A; }
.fbChips{ display:flex; gap:6px; flex-wrap:wrap; }
.fbChip{ flex:1; min-width:0; min-height:44px; border:2px solid #0F1437; border-radius:999px; background:#FFF8E6; color:#0F1437; font-size:14.5px; font-weight:800; padding:5px 8px; line-height:1.3; white-space:nowrap; }
.fbChip.on{ background:#0F1437; color:#FFD23F; }
.fbTa{ width:100%; min-height:118px; resize:vertical; font-family:inherit; font-size:16px; font-weight:600; line-height:1.55; color:#0F1437; background:#FFFBEF; border:2px solid #0F1437; border-radius:12px; padding:9px 11px; outline:none; user-select:text; -webkit-user-select:text; }
.fbTa:focus{ box-shadow:0 0 0 3px #FFB730; }
.fbTa::placeholder{ color:#9C8A6E; }
.fbUnder{ display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-top:-4px; }
.fbUnder .fbMsg{ flex:1; text-align:start; }
.fbCount{ flex:none; font-size:12px; font-weight:800; color:#7D5A3A; font-variant-numeric:tabular-nums; direction:rtl; }
.fbCount.over{ color:#A10E26; }
.apBtn.fbSend:disabled{ opacity:0.45; cursor:default; transform:none; }
.fbThanksIco{ align-self:center; width:64px; height:64px; }
/* الشاشة */
.fbTabs{ display:grid; grid-template-columns:repeat(3, 1fr); gap:4px; background:rgba(15,20,55,0.08); border-radius:12px; padding:4px; flex:none; }
.fbTab{ border:none; border-radius:9px; background:none; color:#0F1437; font-size:14px; font-weight:800; padding:6px 4px; line-height:1.3; }
.fbTab.on{ background:#0F1437; color:#F6EBD0; }
.fbScroll{ display:flex; flex-direction:column; }
.fbList{ display:flex; flex-direction:column; gap:10px; }
.fbList .fbAll{ align-self:flex-start; }
.fbItem{ gap:6px; padding:10px 12px; }
.fbItem.new{ border-color:#C8102E; box-shadow:0 4px 0 #C8102E; }
.fbItemTop{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
.fbCat{ font-size:12.5px; font-weight:800; border-radius:999px; padding:2px 10px; background:rgba(15,20,55,0.08); color:#0F1437; }
.fbCat.bug{ background:#FBD9D3; color:#7A1606; }
.fbCat.idea{ background:#FFF0B8; color:#6B4A00; }
.fbCat.other{ background:#DDE7F6; color:#1C3A6E; }
.fbWhen{ font-size:12.5px; font-weight:700; color:#7D5A3A; }
.fbText{ margin:0; font-size:15.5px; font-weight:600; line-height:1.6; color:#2A1B10; white-space:pre-wrap; overflow-wrap:anywhere; user-select:text; -webkit-user-select:text; }
.fbMeta{ font-size:12.5px; font-weight:700; color:#6B4A2A; line-height:1.5; }
.fbUa{ font-size:12px; font-weight:700; color:#7D5A3A; }
.fbUa summary{ cursor:pointer; }
.fbUa code{ display:block; direction:ltr; text-align:left; font-size:11px; line-height:1.45; overflow-wrap:anywhere; background:rgba(15,20,55,0.06); border-radius:8px; padding:5px 7px; margin-top:4px; user-select:text; -webkit-user-select:text; }
.fbActs{ display:flex; gap:6px; flex-wrap:wrap; }
.fbActs .apBtn{ flex:none; }
.apBtn.fbMore{ align-self:center; }
/* «افتح في كروم» (js/dl.js، جوه فيسبوك وأخواته) */
.apDl.apDlIab{ background:#E3ECF8; border-color:#1C4FA0; }
.apDl.apDlIab .apDlTxt span{ color:#2A3F66; }
.apBtn.apDlGo.apDlChrome{ background:#1C4FA0; box-shadow:0 3px 0 #0E2A5C; white-space:nowrap; }
.apDl.apDlIab .apDlLater{ color:#2A3F66; }
/* ---------- نقل التقدم من نسخة التجربة (js/move.js) ---------- */
/* كارت الرئيسية في الـArtifact: نفس مقاس كارت «نزّل»، أزرق وأصفر عشان يبان */
.mvHome{ display:flex; align-items:center; gap:10px; background:linear-gradient(#FFF6D6, #FFEDB3); border:2px solid #0F1437; border-radius:14px; padding:8px 10px 8px 12px; box-shadow:0 3px 0 #0F1437; flex:none; }
.mvIco{ width:36px; height:36px; flex:none; }
.mvTxt{ flex:1; display:flex; flex-direction:column; gap:1px; min-width:0; }
.mvTxt b{ font-size:16px; font-weight:800; color:#0F1437; line-height:1.35; }
.mvTxt span{ font-size:12.5px; font-weight:700; color:#6B4A2A; line-height:1.4; }
.apBtn.mvGo{ flex:none; min-width:68px; background:#C8102E; box-shadow:0 3px 0 #70091A; }
.apBtn.mvGo:active{ box-shadow:0 1px 0 #70091A; }
/* الورق */
.mvCard{ gap:10px; }
.mvCard h2{ font-size:26px; }
.mvLead{ margin:0; text-align:center; font-size:15px; font-weight:700; color:#2A1B10; line-height:1.55; }
.mvWait{ display:flex; align-items:center; justify-content:center; gap:8px; margin:6px 0; font-size:14.5px; font-weight:800; color:#6B4A2A; }
.mvSum{ list-style:none; margin:0; padding:8px 10px; display:flex; flex-direction:column; gap:4px; background:#FFF8E6; border:2px solid #0F1437; border-radius:12px; }
.mvSum li{ display:flex; align-items:center; gap:7px; font-size:15px; font-weight:800; color:#0F1437; line-height:1.4; }
.mvChk{ width:18px; height:18px; }
.apBtn.mvOpen{ text-decoration:none; font-size:20px; padding:11px 14px; }
.mvOr, .mvKeep, .mvLb{ margin:0; text-align:center; font-size:13px; font-weight:700; color:#6B4A2A; line-height:1.55; }
.mvLb{ color:#1C4FA0; }
.mvCode{ width:100%; resize:none; font-family:ui-monospace, Menlo, Consolas, monospace; font-size:12px; line-height:1.45; color:#0F1437; background:#FFFBEF; border:2px dashed rgba(15,20,55,0.4); border-radius:10px; padding:6px 8px; text-align:left; overflow-wrap:anywhere; word-break:break-all; user-select:text; -webkit-user-select:text; }
.mvCode.mvPaste{ border-style:solid; border-color:#0F1437; font-size:13px; }
.mvCode:focus{ outline:none; box-shadow:0 0 0 3px #FFB730; }
.mvSite{ margin:0; text-align:center; font-size:13px; font-weight:700; color:#6B4A2A; }
.mvSite a{ color:#1C4FA0; font-weight:800; unicode-bidi:isolate; }
.mvErr{ margin:0; text-align:center; font-size:16px; font-weight:800; color:#A10E26; line-height:1.5; }
.mvMsg{ margin-top:-4px; }
.mvCard .apBtn.light{ font-size:16px; }
.mvSet .apBtn{ flex:none; }
/* ورقة «نفكّرك بلغز اليوم؟» (js/notif.js، التطبيق بس) */
.ntWhy{ margin:0; font-size:15px; font-weight:700; color:#5A3D22; text-align:center; }
.ntList{ display:flex; flex-direction:column; gap:8px; }
.ntItem{ display:flex; align-items:center; gap:10px; background:#FFF8E6; border:2px solid #0F1437; border-radius:12px; padding:8px 10px; text-align:start; }
.ntItem .ntIco{ width:30px; height:30px; flex:none; }
.ntItem .ntIco svg{ width:100%; height:100%; display:block; }
.ntItem b{ display:block; font-size:16px; color:#0F1437; }
.ntItem small{ display:block; font-size:13px; color:#5A3D22; line-height:1.4; }
.ntNote{ display:block; font-size:13px; color:#6B4A2A; line-height:1.5; text-align:center; }
.apSheet .ntYes, .apSheet .ntNo{ width:100%; }
/* «امسح حسابي» (js/lb.js) */
.apBtn.danger{ background:#8E1022; box-shadow:0 4px 0 #3A0610; width:100%; }
.apBtn.danger:active{ box-shadow:0 1px 0 #3A0610; }
.apBtn.danger[disabled]{ opacity:.6; }
.lbDelSet .lbDel{ color:#8E1022; }
.lbDelList{ margin:0; padding:0 22px 0 0; font-size:14px; font-weight:700; color:#0F1437; line-height:1.6; text-align:start; }
.lbDelLocal{ display:flex; align-items:center; gap:10px; font-size:15px; font-weight:700; color:#0F1437; background:#FFF8E6; border:2px solid #0F1437; border-radius:12px; padding:10px 12px; cursor:pointer; text-align:start; }
.lbDelLocal input{ width:22px; height:22px; accent-color:#8E1022; flex:none; margin:0; }
/* «من استوديو تلاهي» بالشعار ورقم النسخة (app.js studio): آخر الرئيسية، وآخر الإعدادات. الشعار مربع مدوّر زي ما هو */
.apStudioRow{ display:flex; align-items:center; justify-content:center; gap:9px; flex:none; }
.apStudioLogo{ display:block; width:40px; height:40px; border-radius:10px; box-shadow:0 0 0 2px #0F1437, 0 2px 0 2px #0F1437; flex:none; -webkit-user-drag:none; }
.apStudioTxt{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.3; }
.apStudioTxt b{ font-size:14px; font-weight:800; color:#0F1437; }
.apStudioTxt small{ font-size:12.5px; font-weight:700; color:#7D5A3A; }
.apStudio{ margin:6px 0 2px; }
.apSetStudio{ margin-top:2px; }

/* ============================================================
   موبايل بالعرض (ملاحظة مراجعة تلاهي: على ٧٣٢×٣٣٠ الأدوات كانت بتخرج برّه الشاشة).
   شاشة قصيرة بالعرض ولمس بس (مش الكمبيوتر: css/desk.css للماوس، ومش التابلت: أطول من ٥٠٠): شاشة اللعب جنب بعض، الشبكة
   على قد الطول (--dkS) في ناحية، والشريط والمحاولات والقواعد والأدوات عمود في الناحية التانية. وباقي الشاشات بتسكرول زي ما هي.
   تطبيق أندرويد واقف بس (AndroidManifest)، فده للمتصفح. الاختبار land.* في page-test
   ============================================================ */
@media (orientation:landscape) and (max-height:500px) and (pointer:coarse){
  #app{ max-width:none; }
  /* الشاشات التانية: نفس عرض الموبايل في النص (اللعب بس اللي بياخد العرض كله)، وبتسكرول */
  .apHome, .apList, .apGate{ padding-inline:max(16px, calc((100% - 520px) / 2)); }
  .dk, .apScr.dk.on{
    --dkS:calc(100dvh - 16px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    display:grid; align-items:stretch;
    grid-template-columns:minmax(0, 1fr) var(--dkS);
    grid-template-rows:auto auto auto auto auto minmax(0, 1fr) auto auto;
    column-gap:16px; row-gap:6px;
    padding:calc(8px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  }
  .dk > *{ grid-column:1; min-width:0; }
  /* الطبقات اللي فوق كل حاجة (الاحتفال والكروت): من غير مكان في الجريد، فبتغطي الشاشة كلها */
  .dk > .dkModal, .dk > .dkFx{ grid-column:auto; grid-row:auto; }
  .dkTop{ grid-row:1; padding-top:0; }
  .dkStatus{ grid-row:2; margin-top:0; }
  .dkRules{ grid-row:3; }
  .dkTip{ grid-row:4; }
  .dkLegend{ grid-row:5; }
  .dkSp{ display:none; }
  .dkSp.last{ display:block; grid-row:6; }
  .dkCoach{ grid-row:7; }
  .dkTools, .dkHintBar{ grid-row:8; }
  .dk.measure .dkSp.last{ display:block; }
  .dk > .dkWrap{ grid-column:2; grid-row:1 / -1; flex:none !important; align-self:center; width:var(--dkS); height:var(--dkS); }
  /* القواعد من غير الرسمة، والشرح سطرين، عشان العمود كله يبان من غير سكرول */
  .dkRuleCv{ display:none; }
  .dkRule{ padding:4px 5px; justify-content:center; }
  .dkCoachTop p{ min-height:0; font-size:15px; }
  /* وقت الشرح (المرحلة ١ و٢) الكلام محتاج المكان: القواعد ودليل الألوان بيستخبوا، والشرح نفسه بيقول القاعدة */
  .dk:has(.dkCoach.show) .dkRules, .dk:has(.dkCoach.show) .dkLegend{ display:none; }
  .dkCoach{ padding:8px 10px 7px; gap:4px; }
  .dkTool{ height:52px; }
  .dkHintBar{ height:52px; }
  /* كارت التلميح والتوست في العمود اللي جنب الشبكة (فوق الشبكة مفيش مكان) */
  .dk .dkHint, .dk .dkToast, .dk.hinting .dkToast{ bottom:auto; top:6px; right:auto; left:calc(100% + 16px); width:calc(100vw - var(--dkS) - 60px); max-width:none; margin:0; transform:none; white-space:normal; text-align:center; }
  .dk .dkToast{ top:auto; bottom:64px; transform:translateY(8px); }
  .dk .dkToast.show, .dk.hinting .dkToast.show{ transform:none; }
  .dk.hinting .dkToast{ top:auto; bottom:64px; }
}
