/* ═══ هدهد ضدّ الكلّ (rpsboss.js) — v2 «مبارزة الزعيم» (٢٠٢٦/١٠/٢٨) ═══
   نظام الشكل:
   - الخلفيّة ليل نيلي، وبقعة ضوء دافية من فوق على الزعيم (هو بطل المشهد).
   - لون لكلّ اختيار، ثابت بكلّ مكان: حجر كهرماني · ورقة سماوي · مقص وردي.
   - النتيجة بثلاث ألوان بس: أخضر ينجون · ذهبي تعادل · أحمر طلعوا.
   - أيقونات SVG مرسومة (RpsBossGame.ICON) — بلا إيموجي. */
.rb{--rk:#f0a64e;--pp:#4fd0ff;--sc:#ff5fa8;--ok:#3ee08a;--bad:#ff4b5c;--gold:var(--star,#ffd24a);
  position:relative;overflow:hidden;font-weight:800;color:#fff;
  background:radial-gradient(60% 55% at 50% 12%,rgba(255,150,70,.22),transparent 70%),
             radial-gradient(ellipse at 50% 0%,#2a1f5c 0%,#140f33 50%,#07061a 100%)}
.rb::before{content:'';position:absolute;left:50%;top:-10%;width:60cqw;height:75cqh;transform:translateX(-50%);pointer-events:none;
  background:conic-gradient(from 160deg at 50% 0%,transparent 0deg,rgba(255,210,140,.12) 12deg,transparent 22deg,transparent 338deg,rgba(255,210,140,.12) 348deg,transparent 360deg);
  -webkit-mask-image:linear-gradient(180deg,#000 40%,transparent);mask-image:linear-gradient(180deg,#000 40%,transparent)}
.rb .xg-chip{background:linear-gradient(160deg,#2c2266,#16123a);border:2px solid rgba(160,140,255,.5)}
.rb .xg-title b{color:#fff;font-size:5.4cqh;text-shadow:0 .4cqh 0 #3a1f9a,0 0 3cqh rgba(140,110,255,.5)}
.rb .xg-title small{color:#d9d2ff;font-size:2.6cqh}
.rb .xg-title small .rb-k{font-style:normal;color:var(--gold);font-weight:900}
.rb.fin .xg-title b{color:var(--gold)}

/* الأيقونات */
.rb-ic{display:block;width:100%;height:100%;overflow:visible}
.rb-ic .f{fill:var(--c,#fff);stroke:rgba(0,0,0,.55);stroke-width:2.6;stroke-linejoin:round}
.rb-ic .l{fill:none;stroke:rgba(0,0,0,.42);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.rb-ic .l.b{stroke:var(--c,#fff);stroke-width:7.5;filter:drop-shadow(0 0 0 rgba(0,0,0,.6))}
.rb-ic .h{fill:#140f33}
.rb-ic .p{fill:#fff;stroke:rgba(0,0,0,.5);stroke-width:1.5}
.rb-rock{--c:var(--rk)}.rb-paper{--c:var(--pp)}.rb-sci{--c:var(--sc)}

/* ── الساحة: السجلّ · الزعيم · المفاجأة ── */
.rb-arena{position:relative;flex:0 0 auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:2cqw;padding:0 3cqw;margin:3.2cqh 0 1.6cqh}
.rb-boss{display:flex;align-items:center;gap:2.4cqw}
.rb-who{display:grid;justify-items:center;gap:0}
.rb-throne{position:relative;width:15cqh;height:15cqh;border-radius:50%;padding:.8cqh;
  background:conic-gradient(from 200deg,#ffd24a,#ff8a3c,#ff4f6b,#ffd24a);box-shadow:0 0 6cqh rgba(255,140,70,.45),0 1.2cqh 3cqh rgba(0,0,0,.5)}
.rb-throne img{width:100%;height:100%;border-radius:50%;object-fit:cover;background:#140f30;border:.6cqh solid #140f30;display:block}
.rb-crown{position:absolute;top:-4.4cqh;left:50%;width:7.6cqh;transform:translateX(-50%) rotate(-6deg);fill:var(--gold);stroke:#7a4c00;stroke-width:2.5;stroke-linejoin:round;filter:drop-shadow(0 .5cqh .8cqh rgba(0,0,0,.5))}
.rb-crown circle{fill:#fff3c4}
.rb-plate{margin-top:-1.6cqh;position:relative;display:flex;align-items:baseline;gap:.8cqh;padding:.5cqh 2.2cqh;border-radius:1.2cqh;
  background:linear-gradient(180deg,#e63a4a,#9c1527);box-shadow:0 .6cqh 0 #5e0b16,0 1cqh 2cqh rgba(0,0,0,.4)}
.rb-plate b{font-size:3.4cqh;font-weight:900}
.rb-plate small{font-size:2cqh;color:#ffd6d9;font-weight:800}
.rb-vs{font-size:4.6cqh;font-weight:900;color:var(--gold);text-shadow:0 .5cqh 0 #5a3a00,0 0 2cqh rgba(255,200,80,.5);transform:skewX(-8deg)}
.rb-hand{--c:#fff;position:relative;width:17cqh;height:17cqh;border-radius:2.6cqh;display:grid;grid-template-rows:1fr auto;place-items:center;padding:1.6cqh 1.4cqh 1.2cqh;
  background:linear-gradient(170deg,#25204f,#120e2c);border:.6cqh solid rgba(255,255,255,.22);box-shadow:inset 0 0 0 .3cqh rgba(0,0,0,.4),0 1.2cqh 3cqh rgba(0,0,0,.5)}
.rb-hand.rb-rock{--c:var(--rk)}.rb-hand.rb-paper{--c:var(--pp)}.rb-hand.rb-sci{--c:var(--sc)}
.rb-hand > .rb-ic{width:10cqh;height:10cqh;filter:drop-shadow(0 .6cqh 0 rgba(0,0,0,.4))}
.rb-hand b{font-size:3.2cqh;font-weight:900;color:#fff}
.rb-hand.rb-rock,.rb-hand.rb-paper,.rb-hand.rb-sci{border-color:var(--c);box-shadow:0 0 0 .4cqh rgba(0,0,0,.3),0 0 6cqh color-mix(in srgb,var(--c) 60%,transparent)}
.rb-hand.rb-rock b,.rb-hand.rb-paper b,.rb-hand.rb-sci b{color:var(--c)}
.rb-q{font-size:10cqh;line-height:1;font-weight:900;color:var(--gold)}
.rb-hand.rest .rb-q{color:#9fa6ff}
.rb-cycle{position:relative;display:block;width:11cqh;height:11cqh}
.rb-cycle .rb-ic{position:absolute;inset:0;opacity:0;animation:rbCycle .36s steps(1) infinite}
.rb-cycle .rb-ic:nth-child(1){--c:var(--rk)}
.rb-cycle .rb-ic:nth-child(2){--c:var(--pp);animation-delay:.12s}
.rb-cycle .rb-ic:nth-child(3){--c:var(--sc);animation-delay:.24s}
@keyframes rbCycle{0%{opacity:1}33%{opacity:0}}
.rb-boss.spin .rb-hand{animation:rbShake .12s linear infinite}
.rb-boss.spin .rb-hand b{color:var(--gold)}
@keyframes rbShake{50%{transform:translateY(-.8cqh) rotate(-3deg)}}
.rb-boss.show .rb-hand,.rb-boss.min .rb-hand{animation:rbSlam .5s cubic-bezier(.2,1.8,.4,1)}
@keyframes rbSlam{0%{transform:scale(.55) rotate(-14deg)}100%{transform:none}}
.rb-boss.show .rb-throne{animation:rbBump .5s ease-out}
@keyframes rbBump{40%{transform:scale(1.07)}}

/* سجلّ رميات هدهد */
.rb-hist{justify-self:start;display:grid;gap:.8cqh;padding:1.2cqh 1.6cqh;border-radius:1.8cqh;background:rgba(10,8,30,.55);box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.rb-hist small{font-size:2.1cqh;color:#c8c2f0;font-weight:800}
.rb-hist div{display:flex;gap:.8cqh;align-items:center;min-height:5cqh}
.rb-hist i{display:block;width:4.4cqh;height:4.4cqh;opacity:.55}
.rb-hist i.last{width:5.4cqh;height:5.4cqh;opacity:1}
.rb-hn{font-size:2.2cqh;color:#9a93c8}
.rb-side{justify-self:end;max-width:30cqw}
.rb-rule,.rb-tw{display:grid;gap:.3cqh;padding:1.2cqh 2cqh;border-radius:1.8cqh;background:rgba(10,8,30,.55);box-shadow:inset 0 0 0 1px rgba(255,255,255,.12)}
.rb-rule b{font-size:2.8cqh;color:var(--ok)}
.rb-rule small,.rb-tw small{font-size:2.1cqh;color:#d9d2ff;font-weight:700;line-height:1.4}
.rb-tw{grid-template-columns:auto 1fr;column-gap:1.4cqh;align-items:center;background:linear-gradient(160deg,#ffd24a,#ff9a3c);color:#2a1600;box-shadow:0 0 4cqh rgba(255,180,60,.45);animation:rbPulse 1.4s ease-in-out infinite}
.rb-tw span{grid-row:span 2;width:6cqh;height:6cqh;border-radius:1.4cqh;background:#2a1600;display:grid;place-items:center}
.rb-tw span svg{width:4cqh;height:4cqh;fill:none;stroke:var(--gold);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.rb-tw b{font-size:3.2cqh;font-weight:900}
.rb-tw small{color:#4a2a00}
@keyframes rbPulse{50%{transform:scale(1.04)}}

/* ── البوّابات الثلاث ── */
.rb-lanes{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1.6cqw;padding:0 3cqw}
.rb-lane{position:relative;display:grid;grid-template-rows:auto auto 1fr;gap:1cqh;padding:1.6cqh 1.6cqw 1.4cqh;border-radius:2.4cqh;min-height:0;overflow:hidden;
  background:linear-gradient(180deg,color-mix(in srgb,var(--c) 26%,#120e2c) 0%,#0f0b26 55%);border:.45cqh solid color-mix(in srgb,var(--c) 70%,transparent);
  box-shadow:inset 0 .6cqh 0 color-mix(in srgb,var(--c) 45%,transparent),0 1cqh 3cqh rgba(0,0,0,.35);transition:transform .35s,filter .35s,opacity .35s,box-shadow .35s}
.rb-wm{position:absolute;left:-4cqh;bottom:-5cqh;width:30cqh;height:30cqh;opacity:.08;pointer-events:none;transform:rotate(-12deg)}
.rb-lh{position:relative;display:flex;align-items:center;gap:1.2cqh}
.rb-li{width:7.4cqh;height:7.4cqh;flex:0 0 auto}
.rb-lh b{font-size:4.6cqh;font-weight:900;color:#fff;text-shadow:0 .4cqh 0 rgba(0,0,0,.35)}
.rb-lh kbd{font:900 2.6cqh/1 Oswald,Cairo,sans-serif;padding:.6cqh 1.2cqh;border-radius:1cqh;background:rgba(255,255,255,.14);color:#fff}
.rb-cnt{margin-inline-start:auto;font:700 7cqh/1 Oswald,Cairo,sans-serif;font-style:normal;color:var(--c);text-shadow:0 .5cqh 0 rgba(0,0,0,.4)}
.rb-bar{position:relative;height:1.1cqh;border-radius:99px;background:rgba(255,255,255,.1);overflow:hidden}
.rb-bar i{position:absolute;top:0;bottom:0;inset-inline-start:0;width:var(--fill,0%);background:var(--c);border-radius:inherit;transition:width .35s}

/* الوجوه — تصغر مع العدد */
.rb-faces{position:relative;display:flex;flex-wrap:wrap;align-content:flex-start;justify-content:center;gap:1.2cqh 1cqh;min-height:0;overflow:hidden;padding-top:.6cqh}
.rb-faces em{display:grid;justify-items:center;gap:.4cqh;font-style:normal;width:12cqh;animation:rbIn .35s cubic-bezier(.2,1.6,.4,1)}
.rb-faces em .av{width:9cqh !important;height:9cqh !important;font-size:4cqh !important;box-shadow:0 0 0 .4cqh color-mix(in srgb,var(--c) 70%,transparent)}
.rb-faces em .rb-nm{max-width:100%;font-size:2.2cqh;font-weight:800;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rb-faces[data-sz=m] em{width:9cqh}
.rb-faces[data-sz=m] em .av{width:6.6cqh !important;height:6.6cqh !important;font-size:3cqh !important}
.rb-faces[data-sz=m] em .rb-nm{font-size:1.8cqh}
.rb-faces[data-sz=s]{gap:.7cqh}
.rb-faces[data-sz=s] em{width:5.6cqh}
.rb-faces[data-sz=s] em .av{width:5.2cqh !important;height:5.2cqh !important;font-size:2.4cqh !important;box-shadow:0 0 0 .3cqh color-mix(in srgb,var(--c) 70%,transparent)}
.rb-faces[data-sz=s] em .rb-nm{display:none}
.rb-more{font-style:normal;align-self:center;font:700 3.2cqh Oswald,Cairo,sans-serif;color:#fff;opacity:.85}
@keyframes rbIn{from{transform:translateY(-4cqh) scale(.4);opacity:0}}

/* ── الكشف ── */
.rb-res{position:absolute;left:50%;top:auto;bottom:9cqh;transform:translate(-50%,0) scale(.4) rotate(-5deg);opacity:0;pointer-events:none;
  padding:1cqh 3.4cqh;border-radius:1.6cqh;font-size:4.6cqh;font-weight:900;white-space:nowrap;color:#fff;box-shadow:0 1cqh 3cqh rgba(0,0,0,.5);
  transition:transform .45s cubic-bezier(.2,1.7,.4,1) .35s,opacity .2s .35s}
.rb-res:empty{display:none}
.rb.done .rb-res{opacity:1;transform:translate(-50%,0) rotate(-5deg)}
.rb.done .rb-lane.win{transform:translateY(-1cqh);border-color:var(--ok);box-shadow:0 0 0 .4cqh var(--ok),0 0 6cqh rgba(62,224,138,.45)}
.rb.done .rb-lane.win .rb-res{background:linear-gradient(180deg,#43e892,#18a85c)}
.rb.done .rb-lane.tie{border-color:var(--gold);box-shadow:0 0 0 .4cqh var(--gold),0 0 5cqh rgba(255,210,74,.35)}
.rb.done .rb-lane.tie .rb-res{background:linear-gradient(180deg,#ffe07a,#e9a51e);color:#2a1600}
.rb.done .rb-lane.lose{border-color:rgba(255,75,92,.55);background:#120d22}
.rb.done .rb-lane.lose :is(.rb-lh,.rb-bar,.rb-faces,.rb-wm){filter:saturate(.25) brightness(.6)}
.rb.done .rb-lane.lose .rb-res{background:linear-gradient(180deg,#ff5c6b,#b5172a)}
.rb.done .rb-lane.empty{opacity:.32}
.rb-faces em.fall{animation:rbFall .9s cubic-bezier(.5,0,.9,.5) var(--d,0ms) forwards}
@keyframes rbFall{30%{transform:translateY(-1.5cqh) rotate(-10deg)}100%{transform:translateY(60cqh) rotate(70deg);opacity:0}}

.rb-foot{flex:0 0 auto;display:flex;justify-content:center;gap:4cqw;padding:1.2cqh 0 1.6cqh;font-size:3.4cqh;color:#e9e4ff}
.rb-foot b{color:var(--gold);font:700 4.4cqh Oswald,Cairo,sans-serif}
.rb-foot span:empty{display:none}
#rbIdle{color:#ffb4bc}

/* المفاجآت */
.rb.tw-rev{background:radial-gradient(60% 55% at 50% 12%,rgba(255,80,120,.25),transparent 70%),radial-gradient(ellipse at 50% 0%,#5a1f45 0%,#22102e 50%,#07061a 100%)}
.rb.tw-spy{background:radial-gradient(60% 55% at 50% 12%,rgba(80,220,255,.2),transparent 70%),radial-gradient(ellipse at 50% 0%,#14365c 0%,#0d1633 50%,#07061a 100%)}
.rb.tw-fast .xg-clock{animation:rbPulse .5s ease-in-out infinite}

html.perf-lite .rb::before{display:none}
html.perf-lite .rb-tw,html.perf-lite .rb.tw-fast .xg-clock{animation:none}
