:root {
  --bg: #0b0a14; --panel: #17142a; --panel2: #221d3d; --line: #3a3160;
  --gold: #ffc83a; --gold2: #ffe9a8; --text: #f2ecff; --muted: #a59cc4; --red: #ff5a6a;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: radial-gradient(ellipse at top, #2a1d4d 0%, #0b0a14 60%) fixed; color: var(--text); font-family: 'Cairo', system-ui, sans-serif; overflow-x: hidden; }
body { user-select: none; }
#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; padding-bottom: 76px; }
#app.shake { animation: shake .35s; }
#app.mono { filter: grayscale(1) contrast(1.3); transition: filter .15s; }
@keyframes shake { 20% { transform: translate(var(--sh), 0) } 40% { transform: translate(calc(var(--sh) * -1), 2px) } 60% { transform: translate(calc(var(--sh) * .6), -2px) } 80% { transform: translate(calc(var(--sh) * -.4), 0) } }
.screen { padding: 10px 12px; }
h1.scr-title { font-family: 'Reem Kufi', 'Cairo'; color: var(--gold); margin: 6px 0 10px; font-size: 24px; text-shadow: 0 0 12px #ffc83a55; }
h1 small, h2 small { color: var(--muted); font-size: 14px; font-weight: 400; }
h2, h3 { font-family: 'Reem Kufi', 'Cairo'; margin: 4px 0 8px; }
.muted { color: var(--muted); font-size: 13px; }
.warn { color: var(--red); font-size: 13px; }
.short { color: var(--red); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; margin-top: 10px; }
.stars { color: var(--gold); letter-spacing: -1px; text-shadow: 0 0 6px #000; }

/* ===== الأزرار ===== */
.btn { font-family: inherit; font-weight: 700; font-size: 15px; color: var(--text); background: linear-gradient(#2f2852, #211c3b); border: 1px solid var(--line); border-radius: 12px; padding: 9px 16px; cursor: pointer; transition: transform .1s, filter .2s; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.gold { background: linear-gradient(#ffd55e, #d99a12); color: #2a1a00; border-color: #ffe9a8; box-shadow: 0 0 14px #ffc83a55; }
.btn.sm { font-size: 13px; padding: 5px 10px; }
.btn.big { font-size: 20px; padding: 14px 26px; }
.btn.ghost { background: transparent; opacity: .6; margin-top: 14px; }
.btn.back { margin-bottom: 6px; }

/* ===== الشريط العلوي والسفلي ===== */
#topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-around; padding: 8px 6px; background: #0b0a14ee; border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); font-weight: 700; font-size: 14px; }
#topbar small { color: var(--muted); font-weight: 400; font-size: 11px; }
#nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: #120f22f2; border-top: 1px solid var(--line); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
#nav button { flex: 1; background: none; border: 0; color: var(--muted); font-family: inherit; font-size: 22px; padding: 8px 0 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; }
#nav button span { font-size: 12px; font-weight: 700; }
#nav button.on { color: var(--gold); text-shadow: 0 0 10px #ffc83a88; }

/* ===== النوافذ ===== */
#modal { position: fixed; inset: 0; background: #000b; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
#modal[hidden] { display: none; }
#modal-box { background: linear-gradient(#221d3d, #17142a); border: 1px solid var(--gold); border-radius: 18px; padding: 18px; max-width: 420px; width: 100%; text-align: center; box-shadow: 0 0 40px #ffc83a33; max-height: 90vh; overflow: auto; }
#toast { position: fixed; top: 60px; left: 50%; transform: translate(-50%, -20px); background: #221d3dee; border: 1px solid var(--gold); padding: 8px 16px; border-radius: 12px; z-index: 200; opacity: 0; pointer-events: none; transition: .25s; font-weight: 700; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.loot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 18px; font-weight: 700; }
.loot span { background: var(--panel2); padding: 6px 10px; border-radius: 10px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 10px 0; }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 150; }
.flash { position: fixed; inset: 0; pointer-events: none; z-index: 140; mix-blend-mode: screen; }
.floattext { position: fixed; transform: translate(-50%, -50%); font-weight: 900; pointer-events: none; z-index: 160; text-shadow: 0 2px 0 #000, 0 0 8px #000; animation: floatup 1.1s ease-out forwards; font-family: 'Cairo'; }
@keyframes floatup { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6) } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15) } 100% { opacity: 0; transform: translate(-50%, -180%) scale(1) } }

/* ===== صور الأبطال ===== */
.art { position: relative; width: 100%; height: 100%; overflow: hidden; }
.art img, .art .svgart { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.art img { z-index: 1; }

/* إطار الندرة */
.r1 { --rc: #9aa3ad; } .r2 { --rc: #4cd964; } .r3 { --rc: #3fa9ff; } .r4 { --rc: #b06cff; } .r5 { --rc: #ffc83a; }

/* ===== بطاقة البطل ===== */
.hgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.hgrid.small { grid-template-columns: repeat(5, 1fr); max-height: 260px; overflow: auto; padding: 2px; }
.hcard { position: relative; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; border: 2px solid var(--rc); background: #000; cursor: pointer; box-shadow: 0 0 8px color-mix(in srgb, var(--rc) 40%, transparent); }
.hcard.r5 { border-width: 3px; box-shadow: 0 0 14px #ffc83a88; }
.hcard.r5::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(115deg, transparent 30%, #fff6 48%, transparent 60%) -200% 0 / 250% 100% no-repeat; animation: shine 3.5s infinite; }
.hcard.r4::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: linear-gradient(115deg, transparent 35%, #e0b0ff44 50%, transparent 60%) -200% 0 / 250% 100% no-repeat; animation: shine 5s infinite; }
@keyframes shine { 0%, 60% { background-position: -200% 0 } 100% { background-position: 200% 0 } }
.hcard.chosen { outline: 3px solid #5dff8a; outline-offset: -3px; filter: brightness(1.15); }
.hcard.chosen::before { content: '✔'; position: absolute; z-index: 5; top: 30%; left: 50%; transform: translateX(-50%); font-size: 28px; color: #5dff8a; text-shadow: 0 0 8px #000; }
.hc-el { position: absolute; top: 3px; right: 3px; z-index: 4; font-size: 14px; background: #000a; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.hc-team { position: absolute; top: 3px; left: 3px; z-index: 4; font-size: 12px; }
.hc-foot { position: absolute; bottom: 0; left: 0; right: 0; z-index: 4; padding: 14px 3px 3px; background: linear-gradient(transparent, #000e 45%); text-align: center; line-height: 1.15; }
.hc-foot .stars { font-size: 10px; }
.hc-n { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-l { font-size: 10px; color: var(--gold2); }
.hcard.mini { width: 54px; flex: none; }
.hcard.mini .hc-n, .hcard.mini .stars { display: none; }
.hcard.empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; border-style: dashed; border-color: var(--line); background: transparent; box-shadow: none; }
.team-row { display: flex; gap: 6px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px; margin-bottom: 8px; overflow-x: auto; }
.team-row b { writing-mode: vertical-rl; color: var(--gold); font-size: 12px; }
.tpow { font-size: 12px; color: var(--gold2); margin-inline-start: auto; white-space: nowrap; }
.filters { display: flex; gap: 5px; margin-bottom: 8px; }
.filters button { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 6px 0; font-family: inherit; font-size: 15px; cursor: pointer; }
.filters button.on { border-color: var(--gold); background: var(--panel2); }

/* ===== تفاصيل البطل ===== */
.hd { display: flex; gap: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 25%, #17142a), #17142a 60%); border: 2px solid var(--rc); border-radius: 16px; padding: 10px; }
.hd.r5 { box-shadow: 0 0 24px #ffc83a55; }
.hd-art { width: 44%; flex: none; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; border: 2px solid var(--rc); position: relative; }
.hd.r5 .hd-art::after { content: ''; position: absolute; inset: 0; z-index: 3; background: linear-gradient(115deg, transparent 30%, #fff5 48%, transparent 60%) -200% 0 / 250% 100% no-repeat; animation: shine 3.5s infinite; }
.hd-info { flex: 1; min-width: 0; font-size: 13px; }
.hd-info h2 { font-size: 21px; margin: 2px 0; }
.rar { font-weight: 700; font-size: 12px; }
.lvl { margin-top: 6px; }
.bar { height: 7px; background: #0008; border-radius: 4px; overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; transition: width .3s; }
.bar.xp i { background: linear-gradient(90deg, #5dff8a, #2fbf5a); }
.asc { color: var(--gold); margin: 4px 0; letter-spacing: 2px; }
.stats { display: flex; gap: 8px; font-weight: 700; font-size: 14px; margin: 6px 0; flex-wrap: wrap; }
.skill { background: #0006; border-radius: 10px; padding: 6px 8px; border-inline-start: 3px solid var(--c); }
.skill p { margin: 3px 0 0; color: var(--muted); }

/* ===== القلعة ===== */
.prod { text-align: center; color: var(--gold2); font-size: 13px; margin-bottom: 8px; }
.grid-b { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bld { background: linear-gradient(#221d3d, #17142a); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px; text-align: center; cursor: pointer; transition: transform .1s; }
.bld:active { transform: scale(.96); }
.bld-ic { font-size: 34px; filter: drop-shadow(0 0 6px #ffc83a55); }
.bld-n { font-weight: 700; font-size: 13px; }
.bld-l { font-size: 11px; color: var(--muted); }
.bld.locked { opacity: .45; }
.bld.busy { border-color: var(--gold); animation: pulseb 1.2s infinite; }
@keyframes pulseb { 50% { box-shadow: 0 0 16px #ffc83a88 } }
.building-bar { background: var(--panel2); border: 1px solid var(--gold); border-radius: 12px; padding: 8px; margin-bottom: 8px; display: flex; gap: 6px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 13px; }
.materials { display: flex; justify-content: space-around; background: var(--panel); border-radius: 12px; padding: 8px; margin-top: 10px; font-weight: 700; }

/* ===== السحب ===== */
.portal { position: relative; background: radial-gradient(circle at 50% 30%, #4b2a8a, #17142a 70%); border: 2px solid var(--gold); border-radius: 18px; padding: 14px; text-align: center; overflow: hidden; margin-bottom: 12px; }
.portal.small { border-color: var(--line); background: var(--panel); }
.portal-ring { position: absolute; width: 260px; height: 260px; left: 50%; top: -60px; transform: translateX(-50%); border-radius: 50%; background: conic-gradient(#ffc83a00, #ffc83a66, #b06cff66, #3fa9ff66, #ffc83a00); animation: spin 8s linear infinite; filter: blur(18px); opacity: .7; }
@keyframes spin { to { transform: translateX(-50%) rotate(360deg) } }
.portal h2 { position: relative; color: var(--gold); text-shadow: 0 0 12px #ffc83a; }
.legend-strip { position: relative; display: flex; gap: 4px; overflow-x: auto; padding: 4px 0; }
.ls { flex: none; width: 46px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; border: 2px solid var(--gold); box-shadow: 0 0 8px var(--c); }
.rates { position: relative; font-size: 13px; color: var(--gold2); }
.reveal { position: fixed; inset: 0; z-index: 120; background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, #000) 0%, #000e 70%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.orb { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--c) 40%, transparent 70%); animation: orb 1.5s ease-in infinite; box-shadow: 0 0 60px var(--c); }
@keyframes orb { 0% { transform: scale(.5) rotate(0) } 100% { transform: scale(1.6) rotate(180deg) } }
.reveal-cards { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 460px; }
.rcard { position: relative; width: 82px; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; border: 2px solid var(--rc); animation: cardin .5s backwards; box-shadow: 0 0 16px var(--rc); }
.rcard:only-child { width: 230px; border-width: 3px; }
.rcard.r5 { box-shadow: 0 0 30px #ffc83a, 0 0 60px #ffc83a77; }
.rc-foot { position: absolute; bottom: 0; left: 0; right: 0; z-index: 4; text-align: center; padding: 18px 4px 6px; background: linear-gradient(transparent, #000e 50%); font-size: 12px; display: flex; flex-direction: column; }
.rcard:only-child .rc-foot { font-size: 20px; }
.rc-foot small { color: var(--gold2); font-size: 13px; }
@keyframes cardin { 0% { transform: rotateY(90deg) scale(.6); opacity: 0 } 100% { transform: none; opacity: 1 } }

/* ===== القصة ===== */
.chapter { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-bottom: 10px; }
.chapter.locked { opacity: .4; }
.stages { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.stage { position: relative; font-family: inherit; font-weight: 900; font-size: 16px; aspect-ratio: 1; border-radius: 50%; border: 2px solid var(--gold); background: radial-gradient(#4b2a8a, #221d3d); color: var(--text); cursor: pointer; }
.stage:disabled { border-color: var(--line); background: #17142a; color: #555; cursor: default; }
.stage.done { border-color: #5dff8a; }
.stage.boss:not(:disabled) { box-shadow: 0 0 12px #ff5a3c; border-color: #ff5a3c; }
.stage i { position: absolute; bottom: -4px; left: -2px; font-size: 11px; color: #5dff8a; font-style: normal; }

/* ===== الورشة والمعسكر ===== */
.item-row { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 6px; font-size: 13px; }
.item-row > div:nth-child(2) { flex: 1; }
.item-row.locked { opacity: .5; }
.ii { font-size: 30px; }
.camp-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; font-size: 13px; }

/* ===== المقدمة ===== */
#scr-intro { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 24px; cursor: pointer; background: radial-gradient(circle at 50% 40%, #4b2a8a88, transparent 60%); }
.intro-text { font-family: 'Reem Kufi', 'Cairo'; font-size: 22px; line-height: 1.8; max-width: 360px; animation: fadein 1s; text-shadow: 0 0 12px #b06cff; }
.hint { color: var(--muted); font-size: 13px; animation: blink 1.6s infinite; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px) } }
@keyframes blink { 50% { opacity: .3 } }

/* ===== المعركة ===== */
#scr-battle { padding: 6px 8px; background: radial-gradient(ellipse at 50% 15%, #3a1f5c, transparent 60%); min-height: 100vh; }
.b-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.b-head b { flex: 1; color: var(--gold); }
#b-wave { color: var(--muted); font-size: 12px; }
#enemies { display: flex; justify-content: center; gap: 8px; margin: 8px 0 4px; min-height: 128px; }
.enemy { position: relative; width: 31%; max-width: 130px; background: linear-gradient(color-mix(in srgb, var(--c) 30%, #17142a), #17142a); border: 2px solid color-mix(in srgb, var(--c) 60%, #000); border-radius: 14px; padding: 6px 4px; text-align: center; cursor: pointer; transition: transform .15s, opacity .4s; }
.enemy.boss { width: 38%; border-color: #ff5a3c; box-shadow: 0 0 18px #ff5a3c88; }
.enemy.targeted { border-color: #fff; box-shadow: 0 0 14px #fff8; }
.enemy .target-mark { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); display: none; font-size: 16px; }
.enemy.targeted .target-mark { display: block; animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translate(-50%, -4px) } }
.enemy.dead { opacity: .15; transform: scale(.85); pointer-events: none; }
.e-icon { font-size: 44px; line-height: 1.1; filter: drop-shadow(0 0 8px var(--c)); }
.enemy.boss .e-icon { font-size: 56px; }
.e-name { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.e-name small { color: var(--muted); }
.bar.hp { height: 12px; margin-top: 3px; }
.bar.hp i { background: linear-gradient(90deg, #ff4d5e, #c81e3a); }
.bar.hp b { position: absolute; inset: 0; font-size: 9px; line-height: 12px; text-shadow: 0 0 2px #000; }
.pips { display: flex; gap: 2px; justify-content: center; margin-top: 3px; font-size: 10px; align-items: center; }
.pips i { width: 9px; height: 5px; border-radius: 2px; background: #0008; border: 1px solid #ff5a6a66; }
.pips i.on { background: #ff5a6a; box-shadow: 0 0 4px #ff5a6a; }
.status { font-size: 11px; min-height: 13px; }
.hit { animation: hit .3s; }
@keyframes hit { 30% { transform: translateX(-5px); filter: brightness(2.5) } 60% { transform: translateX(4px) } }
.lunge { transform: translateY(14px) scale(1.06); }
#wave-banner { position: fixed; top: 35%; left: 0; right: 0; text-align: center; font-family: 'Reem Kufi'; font-size: 36px; color: var(--gold); text-shadow: 0 0 20px #ffc83a, 0 2px 0 #000; pointer-events: none; opacity: 0; z-index: 90; }
#wave-banner.show { animation: banner 1.2s; }
@keyframes banner { 0% { opacity: 0; transform: scale(2) } 20%, 70% { opacity: 1; transform: scale(1) } 100% { opacity: 0 } }

#heroes { display: flex; gap: 5px; justify-content: center; margin: 4px 0; }
.bhero { position: relative; width: 19%; aspect-ratio: 2/3.2; border-radius: 10px; overflow: hidden; border: 2px solid var(--rc); background: #000; cursor: pointer; transition: transform .15s, filter .3s; }
.bhero .art { height: calc(100% - 16px); }
.bhero .bar { position: absolute; left: 2px; right: 2px; height: 6px; z-index: 4; }
.bhero .bar.hp { bottom: 9px; margin: 0; height: 6px; }
.bhero .bar.mana { bottom: 2px; }
.bar.mana i { background: linear-gradient(90deg, var(--c), #fff); }
.b-el { position: absolute; top: 2px; right: 2px; z-index: 4; font-size: 12px; }
.bhero .status { position: absolute; top: 2px; left: 2px; z-index: 4; }
.bhero.dead { filter: grayscale(1) brightness(.35); pointer-events: none; }
.bhero.near { box-shadow: 0 0 10px var(--c); }
.ready-tag { display: none; position: absolute; top: 40%; left: 0; right: 0; z-index: 5; text-align: center; font-weight: 900; font-size: 12px; color: #fff; text-shadow: 0 0 6px var(--c), 0 0 2px #000; animation: blink .8s infinite; }
.bhero.ready { border-color: var(--c); animation: ready 1s infinite; transform: translateY(-4px); }
.bhero.ready .ready-tag { display: block; }
.bhero.ready::after { content: ''; position: absolute; inset: 0; z-index: 3; background: radial-gradient(circle at 50% 100%, color-mix(in srgb, var(--c) 60%, transparent), transparent 70%); animation: blink 1s infinite; pointer-events: none; }
@keyframes ready { 0%, 100% { box-shadow: 0 0 10px var(--c), 0 0 2px #fff } 50% { box-shadow: 0 0 26px var(--c), 0 0 46px var(--c) } }
.bhero.pick { outline: 3px dashed #5dff8a; outline-offset: -3px; }

#b-items { display: flex; gap: 5px; align-items: center; justify-content: center; margin: 4px 0; min-height: 36px; flex-wrap: wrap; }
.item { position: relative; font-size: 20px; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; width: 40px; height: 36px; cursor: pointer; }
.item small { position: absolute; bottom: -2px; left: 2px; font-size: 10px; color: var(--gold2); font-weight: 700; }
.item.on { border-color: #5dff8a; box-shadow: 0 0 10px #5dff8a; }
.iuse { font-size: 11px; color: var(--muted); }

#board { position: relative; width: 100%; max-width: 460px; margin: 4px auto 0; background: #0d0b1acc; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: none; direction: ltr; }
.gem { position: absolute; top: 0; left: 0; display: flex; align-items: center; justify-content: center; transition: transform .2s ease-in; cursor: pointer; padding: 3px; }
.gem span { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; border-radius: 30%; font-size: 24px; box-shadow: inset 0 -5px 8px #0006, inset 0 4px 6px #fff5, 0 2px 4px #0008; }
.gem-fire span { background: radial-gradient(circle at 35% 30%, #ffb08a, #ff5a3c 45%, #8a1f0b); }
.gem-water span { background: radial-gradient(circle at 35% 30%, #bfe6ff, #3fa9ff 45%, #0b4f8a); }
.gem-forest span { background: radial-gradient(circle at 35% 30%, #c8ffd2, #4cd964 45%, #16702a); }
.gem-earth span { background: radial-gradient(circle at 35% 30%, #ffe2b0, #d39a45 45%, #6b4512); }
.gem-light span { background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd84a 45%, #8a6d0b); }
.gem-dark span { background: radial-gradient(circle at 35% 30%, #e7c8ff, #b06cff 45%, #43166e); }
.gem.sel span { outline: 3px solid #fff; animation: blink .6s infinite; }
.gem.pop { transition: transform .25s, opacity .25s; opacity: 0; transform-origin: center; }
.gem.pop span { transform: scale(1.6); transition: transform .25s; }

/* ===== شاشة القدرة الخاصة ===== */
.splash { position: fixed; inset: 0; z-index: 130; pointer-events: none; display: flex; align-items: center; justify-content: center; }
.splash-bg { position: absolute; inset: 0; background: linear-gradient(100deg, #000c 0%, color-mix(in srgb, var(--c) 45%, #000) 50%, #000c 100%); animation: fadein .2s; }
.splash-bg::before { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(100deg, transparent 0 40px, #ffffff10 40px 44px); animation: streak .6s linear infinite; }
@keyframes streak { to { background-position: -88px 0 } }
.splash-art { position: absolute; right: -10%; bottom: 0; height: 92%; aspect-ratio: 2/3; animation: slidein .45s cubic-bezier(.2, .9, .3, 1.2); filter: drop-shadow(0 0 30px var(--c)); -webkit-mask-image: linear-gradient(to left, #000 60%, transparent); mask-image: linear-gradient(to left, #000 60%, transparent); }
.splash-art .art { border-radius: 0; }
@keyframes slidein { from { transform: translateX(60%); opacity: 0 } }
.splash-name { position: absolute; left: 6%; top: 58%; font-family: 'Reem Kufi', 'Cairo'; font-size: 38px; font-weight: 700; color: #fff; text-shadow: 0 0 18px var(--c), 0 0 4px var(--c), 0 3px 0 #000; animation: namein .5s .15s backwards; display: flex; flex-direction: column; max-width: 60%; }
.splash-name small { font-size: 16px; color: var(--gold2); }
@keyframes namein { from { transform: translateX(-80px) skewX(-20deg); opacity: 0 } }
.splash.out { opacity: 0; transition: opacity .25s; }

/* ================= المرحلة 2 ================= */
#nav button { position: relative; }
#nav button.badge::after { content: ''; position: absolute; top: 6px; right: 28%; width: 9px; height: 9px; border-radius: 50%; background: #ff4d5e; box-shadow: 0 0 6px #ff4d5e; animation: blink 1.2s infinite; }
.building-bar.tower { border-color: #5dff8a55; }
.building-bar.tower.full { border-color: #5dff8a; animation: pulseb 1.2s infinite; }
.materials + .materials { margin-top: 6px; }
.filters.mode button.on.hard { border-color: #ff5a3c; background: #3a1414; color: #ffb08a; }
.chapter.hard { border-color: #ff5a3c55; background: linear-gradient(#2a1414, #17142a); }
.chapter.hard .stage:not(:disabled) { border-color: #ff5a3c; background: radial-gradient(#7a1f1f, #2a1414); }
.chapter.hard .stage.done { border-color: #5dff8a; }

/* الشارات */
.nodes { display: flex; gap: 5px; justify-content: center; margin: 6px 0; }
.nodes i { width: 24px; height: 24px; border-radius: 6px; transform: rotate(45deg); background: #0006; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; color: var(--muted); }
.nodes i.on { background: linear-gradient(135deg, #ffd55e, #d99a12); border-color: #ffe9a8; box-shadow: 0 0 8px #ffc83a88; color: #2a1a00; }
.nodes i.star { width: 28px; height: 28px; }

/* المهام */
.login-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.lday { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 4px 2px; text-align: center; font-size: 10px; line-height: 1.3; min-height: 64px; }
.lday small { color: var(--muted); display: block; }
.lday.got { opacity: .45; border-color: #5dff8a; }
.lday.today { border-color: var(--gold); box-shadow: 0 0 10px #ffc83a88; animation: pulseb 1.2s infinite; }
.quest { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #ffffff10; }
.quest:last-child { border-bottom: 0; }
.quest.claimed { opacity: .5; }
.q-info { flex: 1; min-width: 0; font-size: 13px; }
.q-info small { display: block; color: var(--gold2); font-size: 11px; margin-bottom: 3px; }
.quest .btn { min-width: 64px; }
