/* =========================================================
   بنك أثر | أسئلة المسابقات الثقافية من أثَر للألعاب
   الهوية الافتراضية: «أرشيف أثر» (ورق سماوي فاتح، حبر كحلي، لمسات سماوية،
   ونقاط أثر تصعد في الواجهة)، والبديل: ثيمات أثَر الثلاثة من ../assets/athar.css
   ========================================================= */

/* ---------- هوية بنك أثر ---------- */
[data-theme="bank"]{
  --bg:#F3F8FF;
  --bg-paint:radial-gradient(1200px 600px at 100% -10%,#E3F1FF 0%,rgba(227,241,255,0) 60%),#F3F8FF;
  --text:#0A2463;
  --text-2:#1547A8;
  --accent:#1E6FE0;
  --accent-hover:#1547A8;
  --on-accent:#FFFFFF;
  --hl:#5CC2F5;
  --hl-2:#3B98EA;
  --surface:#FFFFFF;
  --surface-2:#E7F1FE;
  --solid:#FFFFFF;
  --line:rgba(10,36,99,.13);
  --cell:#E7F1FE;
  --cell-label:rgba(10,36,99,.42);
  --shadow:0 10px 30px rgba(10,36,99,.09);
  --scrim:rgba(6,20,60,.62);
}

/* ---------- متغيرات خاصة بهذا الموقع لكل ثيم ---------- */
:root{
  --font-head:"Thmanyah Sans","IBM Plex Sans Arabic",system-ui,sans-serif;
  --font-body:"Thmanyah Sans","IBM Plex Sans Arabic",system-ui,sans-serif;
  --ok:#1F8A4C; --ok-bg:#E6F4EA; --ok-line:#9FD3B2; --ok-text:#145A33;
  --bad:#C8463D; --bad-bg:#FBE9E7; --bad-line:#EFB0AA;
  --hero-bg:var(--surface); --hero-text:var(--text); --hero-gold:var(--accent); --hero-soft:var(--text-2);
  --hero-line:var(--line);
  --mark:var(--accent); --mark-cut:var(--bg);
  --lv0:#1F8A4C; --lv1:#B8893B; --lv2:#C8463D;
}
[data-theme="bank"]{
  --hero-bg:linear-gradient(150deg,#0A2463 0%,#1547A8 55%,#1E6FE0 100%); --hero-text:#FFFFFF; --hero-gold:#BFE3FC; --hero-soft:#DCEEFE;
  --hero-line:rgba(143,208,250,.5);
  --mark:#1E6FE0; --mark-cut:#F3F8FF;
  --lv0:#1F8A4C; --lv1:#C98A12; --lv2:#C8463D;
}
[data-theme="navy"]{
  --ok:#5FDC97; --ok-bg:rgba(95,220,151,.16); --ok-line:rgba(95,220,151,.5); --ok-text:#B9F4D3;
  --bad:#FF8A80; --bad-bg:rgba(255,138,128,.16); --bad-line:rgba(255,138,128,.5);
  --mark:#FFFFFF; --mark-cut:#0A2463;
  --lv0:#5FDC97; --lv1:#FFD27A; --lv2:#FF8A80;
}
[data-theme="blue"]{
  --ok:#B8FFD9; --ok-bg:rgba(10,90,60,.36); --ok-line:rgba(184,255,217,.6); --ok-text:#FFFFFF;
  --bad:#FFD3CF; --bad-bg:rgba(150,30,30,.34); --bad-line:rgba(255,211,207,.6);
  --mark:#FFFFFF; --mark-cut:#1E6FE0;
  --lv0:#B8FFD9; --lv1:#FFE6A8; --lv2:#FFD3CF;
}

/* ---------- أساسيات ---------- */
*{box-sizing:border-box; margin:0; padding:0;}
html{-webkit-text-size-adjust:100%;}
body{
  min-height:100vh; min-height:100dvh;
  background:var(--bg-paint); background-attachment:fixed;
  color:var(--text);
  font-family:var(--font-body);
  font-weight:500; font-size:16px; line-height:1.75;
  display:flex; flex-direction:column; overflow-x:hidden;
}
h1,h2,h3{font-family:var(--font-head); font-weight:700; line-height:1.4;}
strong,b{font-weight:700;}
button,input{font:inherit; color:inherit;}
button{cursor:pointer; -webkit-tap-highlight-color:transparent; background:none; border:none;}
ul{list-style:none;}
[hidden]{display:none !important;}
:focus-visible{outline:3px solid var(--hl); outline-offset:2px;}
.muted{color:var(--text-2); font-size:.85rem;}
main{flex:1;}
.wrap{width:min(1080px,100%); margin:0 auto; padding:18px clamp(14px,3vw,28px) 28px; display:grid; grid-template-columns:minmax(0,1fr); gap:16px;}
.wrap.narrow{width:min(760px,100%);}

/* ---------- الشعارات: ديوان أو أثَر حسب الثيم ---------- */
.logo-bank{display:none;}
[data-theme="bank"] .logo-bank{display:block;}
[data-theme="bank"] .logo-main,[data-theme="bank"] .logo-rev{display:none;}
.mk-fill{fill:currentColor;}
.mk-line{fill:none; stroke:currentColor;}
.mk-cut{fill:none; stroke:var(--cut,var(--mark-cut));}

/* ---------- الشريط العلوي ---------- */
.topbar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:10px clamp(14px,3vw,28px); border-bottom:1px solid var(--line);
  background:var(--solid);
}
[data-theme="navy"] .topbar,[data-theme="blue"] .topbar{background:transparent;}
.brand{display:flex; align-items:center; gap:10px; min-width:0; text-decoration:none; color:inherit;}
.brand .logo{height:48px; width:auto; flex:none;}
.brand svg.logo{width:70px; height:38px; color:var(--mark);}
.brand-text{display:flex; flex-direction:column; min-width:0; line-height:1.3;}
.brand-text strong{font-family:var(--font-head); font-size:1.35rem; color:var(--accent);}
.brand-text small{color:var(--text-2); font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.top-tools{display:flex; align-items:center; gap:8px; flex:none;}

.icon-btn{
  width:42px; height:42px; border-radius:50%;
  display:grid; place-items:center;
  background:var(--surface); border:1px solid var(--line);
  transition:transform .15s ease, background .2s ease;
}
.icon-btn:hover{background:var(--surface-2);}
.icon-btn:active{transform:scale(.92);}
.icon-btn svg{width:22px; height:22px; fill:var(--text);}
.icon-btn .wave{stroke:var(--text);}
.icon-btn .ico-off{display:none;}
.icon-btn[aria-pressed="false"] .ico-on{display:none;}
.icon-btn[aria-pressed="false"] .ico-off{display:block; opacity:.6;}

/* نقطة هوية ديوان في مبدّل الثيمات */
.theme-dot[data-set-theme="bank"]{background:linear-gradient(135deg,#0A2463 50%,#5CC2F5 50%);}

/* ---------- الأزرار ---------- */
.btn{
  min-height:48px; padding:10px 20px;
  border-radius:14px; border:1px solid var(--line);
  background:var(--surface); color:var(--text);
  font-weight:700; font-size:1rem;
  transition:transform .15s ease, background .2s ease, opacity .2s;
}
.btn:hover{background:var(--surface-2); transform:translateY(-2px);}
.btn:active{transform:translateY(0) scale(.97);}
.btn.primary{background:var(--accent); color:var(--on-accent); border-color:transparent;}
.btn.primary:hover{background:var(--accent-hover);}
.btn.small{min-height:40px; padding:6px 14px; font-size:.92rem; border-radius:12px;}
.btn:disabled{opacity:.45; cursor:not-allowed; transform:none;}
.link-btn{color:var(--accent); font-weight:700; font-size:.9rem; padding:6px 8px; border-radius:8px;}
.link-btn:hover{background:var(--surface-2);}

/* ---------- الشاشات ---------- */
.screen{display:none;}
.screen.active{display:block; animation:fade .3s ease;}
@keyframes fade{from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:none;}}

/* ---------- الواجهة التعريفية ---------- */
.hero{
  position:relative; overflow:hidden; text-align:center;
  background:var(--hero-bg); color:var(--hero-text);
  padding:34px 18px 30px; border-bottom:1px solid var(--line);
}
.hero-pattern{display:none;}
[data-theme="bank"] .hero-pattern{
  display:block; position:absolute; inset:0; opacity:.55; pointer-events:none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180' viewBox='0 0 180 180' fill='%23ffffff' fill-opacity='.10'%3E%3Ccircle cx='20' cy='150' r='5'/%3E%3Ccircle cx='42' cy='126' r='6'/%3E%3Ccircle cx='70' cy='108' r='4'/%3E%3Ccircle cx='96' cy='80' r='7'/%3E%3Ccircle cx='124' cy='62' r='4.5'/%3E%3Ccircle cx='150' cy='34' r='6'/%3E%3Cpath d='M118 128h34a8 8 0 0 1 8 8v18a8 8 0 0 1-8 8h-34a8 8 0 0 1-8-8v-18a8 8 0 0 1 8-8z' fill='none' stroke='%23ffffff' stroke-opacity='.14' stroke-width='2'/%3E%3C/svg%3E") center/180px;
}
[data-theme="bank"] .hero::after{
  content:""; position:absolute; inset:12px; border:1.5px solid var(--hero-line); border-radius:10px; pointer-events:none;
}
.hero > *{position:relative;}
.hero-mark{width:132px; height:70px; margin:0 auto 4px; color:var(--hero-gold); --cut:var(--hero-bg);}
.hero-athar{height:120px; width:auto; margin:0 auto 6px;}
.hero h1{font-size:clamp(3rem,10vw,4.4rem); line-height:1.25; color:var(--hero-gold);}
.hero-sub{font-size:1.02rem; color:var(--hero-text); opacity:.92;}
.hero-verse{
  display:inline-block; margin-top:12px; padding:7px 18px;
  border-block:1px solid var(--hero-line);
  color:var(--hero-soft); font-size:.98rem;
}
.hero-stats{
  display:flex; flex-wrap:wrap; justify-content:center; gap:8px 10px; margin-top:18px;
}
.hero-stats li{
  min-width:108px; padding:8px 12px; border-radius:14px;
  border:1px solid var(--hero-line); display:flex; flex-direction:column; line-height:1.4;
  background:rgba(255,255,255,.05);
}
.hero-stats b{font-weight:700; font-size:1.45rem; color:var(--hero-gold);}
.hero-stats span{font-size:.78rem; color:var(--hero-text); opacity:.9;}

/* ---------- البطاقات ---------- */
.card{
  background:var(--surface); border:1px solid var(--line); border-radius:18px;
  padding:16px clamp(14px,2.4vw,22px) 18px; box-shadow:var(--shadow);
}
.card-head{display:flex; align-items:center; justify-content:space-between; gap:8px 12px; flex-wrap:wrap; margin-bottom:12px;}
.card-head h2{font-size:1.14rem; display:flex; align-items:center; gap:9px;}
.step{
  width:30px; height:30px; flex:none; border-radius:50%;
  display:grid; place-items:center; font-size:.95rem;
  background:var(--accent); color:var(--on-accent); font-family:var(--font-body);
}
.head-actions{display:flex; gap:2px;}
.two-cols{display:grid; gap:16px; grid-template-columns:repeat(auto-fit,minmax(280px,1fr));}

/* شبكة الدواوين */
.diwan-grid{display:grid; gap:10px; grid-template-columns:repeat(auto-fill,minmax(210px,1fr));}
.diwan-btn{
  position:relative; text-align:start; padding:12px 14px 12px 40px; border-radius:14px;
  border:1.5px solid var(--line); background:var(--solid);
  display:flex; flex-direction:column; gap:2px; min-height:86px;
  transition:transform .15s ease, border-color .2s ease, background .2s ease;
}
.diwan-btn:hover{transform:translateY(-2px);}
.diwan-btn .d-num{font-size:.74rem; color:var(--hl-2); font-weight:700;}
.diwan-btn .d-title{font-family:var(--font-head); font-weight:700; font-size:1.08rem; line-height:1.45;}
.diwan-btn .d-count{font-size:.8rem; color:var(--text-2);}
.diwan-btn .tick{
  position:absolute; inset-inline-end:12px; top:12px; width:22px; height:22px; border-radius:50%;
  border:1.5px solid var(--line); display:grid; place-items:center;
}
.diwan-btn .tick svg{width:13px; height:13px; stroke:var(--on-accent); fill:none; stroke-width:3; opacity:0;}
.diwan-btn[aria-pressed="true"]{border-color:var(--accent); background:var(--surface-2);}
.diwan-btn[aria-pressed="true"] .tick{background:var(--accent); border-color:var(--accent);}
.diwan-btn[aria-pressed="true"] .tick svg{opacity:1;}

/* الأقسام */
.sections-box{display:grid; gap:12px;}
.sec-group{border-top:1px dashed var(--line); padding-top:10px;}
.sec-group:first-child{border-top:none; padding-top:0;}
.sec-group summary{
  display:flex; align-items:center; justify-content:space-between; gap:10px; cursor:pointer;
  list-style:none; min-height:40px; border-radius:10px;
}
.sec-group summary::-webkit-details-marker{display:none;}
.sec-group summary h3{font-size:1rem; color:var(--accent); display:flex; align-items:center; gap:8px;}
.sec-group summary h3::before{
  content:""; width:8px; height:8px; border-inline-start:2px solid var(--hl-2); border-bottom:2px solid var(--hl-2);
  transform:rotate(45deg); transition:transform .2s ease; flex:none;
}
.sec-group[open] summary h3::before{transform:rotate(-45deg);}
.sec-group .chips{margin-top:8px;}
.chips{display:flex; flex-wrap:wrap; gap:8px;}
.chip{
  min-height:40px; padding:6px 14px; border-radius:999px;
  border:1.5px solid var(--line); background:var(--solid);
  font-size:.9rem; font-weight:500; display:inline-flex; align-items:center; gap:7px;
  transition:background .2s ease, border-color .2s ease, transform .15s ease;
}
.chip:active{transform:scale(.96);}
.chip small{font-size:.74rem; opacity:.8; background:var(--surface-2); border-radius:999px; padding:0 7px;}
.chip[aria-pressed="true"]{background:var(--accent); border-color:var(--accent); color:var(--on-accent); font-weight:700;}
.chip[aria-pressed="true"] small{background:rgba(255,255,255,.2);}
[data-theme="navy"] .chip[aria-pressed="true"] small,[data-theme="blue"] .chip[aria-pressed="true"] small{background:rgba(10,36,99,.16);}
.sec-empty{color:var(--text-2); font-size:.92rem;}

/* المستوى */
.level-row{display:grid; grid-template-columns:repeat(3,1fr); gap:8px;}
.level-btn{
  padding:10px 6px; border-radius:14px; border:1.5px solid var(--line); background:var(--solid);
  display:flex; flex-direction:column; align-items:center; line-height:1.5; opacity:.62;
  transition:opacity .2s ease, border-color .2s ease, transform .15s ease;
}
.level-btn:active{transform:scale(.96);}
.level-btn b{font-size:1.02rem;}
.level-btn small{font-size:.76rem; color:var(--text-2);}
.level-btn[aria-pressed="true"]{opacity:1; border-color:var(--lv); box-shadow:inset 0 -4px 0 var(--lv);}
.lv-0{--lv:var(--lv0);} .lv-1{--lv:var(--lv1);} .lv-2{--lv:var(--lv2);}

/* مفتاح التبديل */
.switch-row{display:flex; align-items:center; gap:12px; cursor:pointer; min-height:48px;}
.switch-row input{position:absolute; opacity:0; width:1px; height:1px;}
.switch{
  width:50px; height:28px; flex:none; border-radius:999px; background:var(--surface-2);
  border:1.5px solid var(--line); position:relative; transition:background .2s ease;
}
.switch::after{
  content:""; position:absolute; top:2px; inset-inline-start:2px; width:21px; height:21px; border-radius:50%;
  background:var(--text-2); transition:transform .22s cubic-bezier(.3,1.5,.5,1), background .2s ease;
}
.switch-row input:checked + .switch{background:var(--accent); border-color:var(--accent);}
.switch-row input:checked + .switch::after{transform:translateX(-22px); background:var(--on-accent);}
.switch-row input:focus-visible + .switch{outline:3px solid var(--hl); outline-offset:2px;}
.switch-text{display:flex; flex-direction:column; line-height:1.45;}
.switch-text small{color:var(--text-2); font-size:.8rem;}
.count-row{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px;}
.count-row .chip{min-width:52px; justify-content:center;}

/* شريط البدء */
.start-bar{
  position:sticky; bottom:0; z-index:5; margin-top:6px;
  background:var(--solid); border-top:1px solid var(--line);
  box-shadow:0 -8px 24px rgba(0,0,0,.08);
  padding:10px clamp(14px,3vw,28px) calc(10px + env(safe-area-inset-bottom));
}
.start-inner{width:min(1080px,100%); margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap;}
.match{display:flex; align-items:baseline; gap:7px;}
.match b{font-weight:700; font-size:1.7rem; color:var(--accent); line-height:1.2;}
.match span{color:var(--text-2); font-size:.9rem;}
.start-actions{display:flex; gap:8px; flex:1; justify-content:flex-end;}

/* ---------- شريط العرض ---------- */
.view-bar{display:flex; align-items:center; justify-content:space-between; gap:12px;}
.view-title{display:flex; align-items:baseline; gap:8px; min-width:0; flex-wrap:wrap; justify-content:flex-end;}
.view-title b{font-weight:700; font-size:1.2rem; color:var(--accent);}
.view-title span{color:var(--text-2); font-size:.86rem;}
.bank-tools{display:flex; align-items:center; gap:10px 14px; flex-wrap:wrap;}
.search{
  flex:1 1 240px; display:flex; align-items:center; gap:8px; min-height:46px; padding:0 14px;
  border-radius:14px; border:1.5px solid var(--line); background:var(--solid);
}
.search:focus-within{border-color:var(--accent);}
.search svg{width:20px; height:20px; stroke:var(--text-2); flex:none;}
.search input{flex:1; min-width:0; border:none; outline:none; background:transparent; height:44px;}
.search input::placeholder{color:var(--text-2); opacity:.8;}
.switch-row.compact{min-height:44px;}

/* ---------- بطاقة السؤال (على نسق صفحات ديوان) ---------- */
.q-list{display:grid; grid-template-columns:minmax(0,1fr); gap:14px;}
.q-card{
  position:relative; background:var(--surface); border:1px solid var(--line);
  border-inline-start:5px solid var(--accent); border-radius:16px;
  padding:14px clamp(12px,2.2vw,20px) 14px; box-shadow:var(--shadow);
}
.q-meta{display:flex; align-items:center; gap:6px 10px; flex-wrap:wrap; margin-bottom:8px; font-size:.78rem; color:var(--hl-2);}
[data-theme="navy"] .q-meta,[data-theme="blue"] .q-meta{color:var(--text-2);}
.q-meta .lvl{
  margin-inline-start:auto; padding:1px 12px; border-radius:999px; font-weight:700; font-size:.78rem;
  color:var(--lv); border:1.5px solid var(--lv); background:var(--solid);
}
.q-head{display:flex; align-items:flex-start; gap:12px;}
.q-num{
  flex:none; min-width:38px; height:38px; padding:0 8px; border-radius:50%;
  display:grid; place-items:center; background:var(--accent); color:var(--on-accent);
  font-weight:700; font-size:.95rem;
}
.q-text{font-family:var(--font-body); font-size:1.08rem; font-weight:700; line-height:1.8; padding-top:2px;}
.opts{display:grid; gap:6px; margin-top:10px;}
.opt{
  width:100%; text-align:start; display:flex; align-items:center; gap:10px;
  padding:7px 10px; border-radius:12px; border:1.5px solid transparent;
  transition:background .2s ease, border-color .2s ease, transform .12s ease;
}
.opt .ltr{
  flex:none; width:30px; height:30px; border-radius:50%; display:grid; place-items:center;
  border:1.5px solid var(--line); color:var(--text-2); font-weight:700; font-size:.88rem; background:var(--solid);
}
.opt .o-text{flex:1; min-width:0; line-height:1.7;}
.opt .cite{
  flex:none; display:none; align-items:center; gap:6px; padding:1px 10px; border-radius:999px;
  background:var(--solid); border:1px solid var(--ok-line); color:var(--ok); font-size:.76rem; font-weight:700;
  white-space:nowrap;
}
.opt .cite svg{width:14px; height:14px; fill:var(--ok);}
.opt .cite svg path{stroke:var(--solid); fill:none; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round;}
/* الإجابة الصحيحة مظللة بالأخضر عند الإظهار */
.q-card.show .opt.correct{background:var(--ok-bg); border-color:var(--ok-line); color:var(--ok-text); font-weight:700;}
.q-card.show .opt.correct .ltr{background:var(--ok); border-color:var(--ok); color:#fff;}
[data-theme="blue"] .q-card.show .opt.correct .ltr{color:#0A5A3C;}
.q-card.show .opt.correct .cite{display:inline-flex;}
.q-card.show .opt.wrong{background:var(--bad-bg); border-color:var(--bad-line);}
.q-card.show .opt.wrong .ltr{background:var(--bad); border-color:var(--bad); color:#fff;}
.q-foot{display:flex; justify-content:flex-end; gap:4px; margin-top:8px;}
.q-foot:empty{display:none;}
/* إخفاء الخيارات: يبقى السؤال وحده، وتظهر الإجابة الصحيحة فقط عند إظهارها */
body.hide-opts .q-card:not(.opts-open) .opt{display:none;}
body.hide-opts .q-card:not(.opts-open).show .opt.correct{display:flex;}
body.hide-opts .q-card:not(.opts-open):not(.show) .opts{margin-top:0;}
body:not(.hide-opts) [data-showopts]{display:none;}
.answers-on [data-reveal]{display:none;}
body:not(.hide-opts) .answers-on .q-foot{display:none;}
.grade-row{
  display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap;
  padding:10px 12px; border-radius:14px; border:1px dashed var(--line); background:var(--surface);
  font-weight:700; font-size:.95rem;
}
.grade-row .btn.ok{border-color:var(--ok-line); color:var(--ok);}
.grade-row .btn.bad{border-color:var(--bad-line); color:var(--bad);}
.grade-row .btn[aria-pressed="true"].ok{background:var(--ok-bg);}
.grade-row .btn[aria-pressed="true"].bad{background:var(--bad-bg);}
.quiz-actions.three{grid-template-columns:1fr 1fr 1.3fr;}
.q-foot .link-btn{font-size:.86rem;}
.q-source{font-size:.76rem; color:var(--text-2); margin-top:8px; display:none;}
.q-card.show .q-source{display:block;}
mark{background:var(--hl); color:#1D2A24; border-radius:4px; padding:0 2px;}

.empty{text-align:center; color:var(--text-2); padding:26px 0;}
.more-row{display:flex; justify-content:center;}

/* ---------- الاختبار ---------- */
.progress{height:8px; border-radius:999px; background:var(--surface-2); overflow:hidden; border:1px solid var(--line);}
.progress i{display:block; height:100%; width:0; background:var(--hl); border-radius:999px; transition:width .35s ease;}
[data-theme="bank"] .progress i{background:linear-gradient(90deg,#1E6FE0,#5CC2F5);}
.q-card.big{padding:18px clamp(14px,3vw,26px) 18px; animation:pop .32s cubic-bezier(.3,1.3,.5,1);}
@keyframes pop{from{opacity:0; transform:translateY(10px) scale(.985);} to{opacity:1; transform:none;}}
.q-card.big .q-text{font-size:clamp(1.15rem,3.6vw,1.45rem);}
.q-card.big .opts{gap:10px; margin-top:16px;}
.q-card.big .opt{padding:12px 12px; border-color:var(--line); background:var(--solid); font-size:1.04rem; min-height:56px;}
.q-card.big:not(.show) .opt:hover{border-color:var(--accent); transform:translateY(-1px);}
.q-card.big:not(.show) .opt:active{transform:scale(.985);}
.q-card.big .opt .ltr{width:34px; height:34px;}
.q-card.big.show .opt{cursor:default;}
.q-card.big.show .opt:not(.correct):not(.wrong){opacity:.6;}
.q-card.big.show .opt.correct{animation:good .45s ease;}
.q-card.big.show .opt.wrong{animation:shake .4s ease;}
@keyframes good{40%{transform:scale(1.02);}}
@keyframes shake{20%{transform:translateX(6px);} 40%{transform:translateX(-6px);} 60%{transform:translateX(4px);} 80%{transform:translateX(-3px);}}
.quiz-actions{display:grid; grid-template-columns:1fr 1.4fr; gap:10px;}
.hint{text-align:center; color:var(--text-2); font-size:.8rem;}
@media (hover:none){.hint{display:none;}}

/* ---------- النتيجة ---------- */
.result{text-align:center; padding:26px 18px 22px;}
.result-mark{width:110px; height:58px; margin:0 auto 6px; color:var(--hl-2); --cut:var(--surface);}
.result h2{font-size:1.5rem;}
.result-score{display:flex; align-items:baseline; justify-content:center; gap:8px; margin:6px 0 4px;}
.result-score b{font-weight:700; font-size:3.4rem; line-height:1.2; color:var(--accent);}
.result-score span{color:var(--text-2); font-size:1.05rem;}
.result-stats{display:flex; justify-content:center; gap:8px; flex-wrap:wrap; margin:10px 0 18px;}
.result-stats li{min-width:96px; padding:8px 10px; border-radius:14px; border:1px solid var(--line); background:var(--solid); display:flex; flex-direction:column; line-height:1.45;}
.result-stats b{font-size:1.35rem;}
.result-stats span{font-size:.78rem; color:var(--text-2);}
.result-stats .ok b{color:var(--ok);} .result-stats .bad b{color:var(--bad);}
.result-actions{display:flex; gap:8px; justify-content:center; flex-wrap:wrap;}

/* ---------- نافذة التأكيد ---------- */
.modal{position:fixed; inset:0; z-index:20; background:var(--scrim); display:grid; place-items:center; padding:18px; animation:fade .2s ease;}
.modal-box{width:min(420px,100%); background:var(--solid); border:1px solid var(--line); border-radius:18px; padding:22px 18px 16px; text-align:center; box-shadow:var(--shadow);}
.modal-box p{font-weight:700; font-size:1.08rem; margin-bottom:14px;}
.modal-actions{display:flex; gap:8px; justify-content:center;}

/* ---------- التذييل ---------- */
.foot{text-align:center; padding:14px 16px 18px; color:var(--text-2); font-size:.84rem; border-top:1px solid var(--line);}
[data-theme="bank"] .foot{background:#0A2463; color:#BFE3FC; border-top:none;}
.foot-2{font-size:.76rem; opacity:.85;}

/* ---------- الجوال ---------- */
@media (max-width:560px){
  body{font-size:15.5px;}
  .brand-text small{display:none;}
  .brand svg.logo{width:58px; height:32px;}
  .brand .logo{height:42px;}
  .theme-switch{gap:4px; padding:4px;}
  .theme-dot{width:25px; height:25px;}
  .icon-btn{width:38px; height:38px;}
  .hero{padding:26px 14px 22px;}
  .hero-stats li{min-width:calc(50% - 6px); flex:1;}
  .diwan-grid{grid-template-columns:repeat(2,1fr); gap:8px;}
  .diwan-btn{padding:10px 10px 10px 34px; min-height:80px;}
  .diwan-btn .d-title{font-size:.98rem;}
  .diwan-btn .tick{inset-inline-end:8px; top:10px;}
  .start-inner{gap:6px;}
  .match{flex-basis:100%; justify-content:center;}
  .match b{font-size:1.4rem;}
  .start-actions .btn{flex:1; padding:10px 8px;}
  .opt{flex-wrap:wrap;}
  .opt .cite{margin-inline-start:40px;}
  .quiz-actions{grid-template-columns:1fr 1fr;}
  .quiz-actions.three{grid-template-columns:1fr 1fr;}
  .quiz-actions.three #nextBtn{grid-column:1 / -1;}
  .quiz-actions .btn{padding:10px 8px;}
  .view-title span{display:none;}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important; transition:none !important;}
}

/* ---------- زر الحساب في الشريط العلوي ---------- */
.top-tools #accountSlot{display:flex;}
.brand-text strong{white-space:nowrap;}
@media (max-width:560px){
  .top-tools .acc-n{display:none;}
  .top-tools .acc-btn{padding:4px;}
}
