/* شاشات اللعبة — بتكمّل ../assets/style.css (متغيرات الهوية والأزرار) */
[hidden] { display: none !important; }
body.play { background: var(--cream-2); min-height: 100vh; }
.play-bar { position: sticky; top: 0; z-index: 50; background: var(--cream); border-bottom: 3px solid var(--line); }
.grade-name { margin-inline-start: auto; font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; background: var(--sun); border: 3px solid var(--line); border-radius: 999px; padding: 0 .9em; }
.play-main { padding: 28px 0 60px; max-width: 920px; }
.loading { text-align: center; padding: 80px 0; font-size: 1.2rem; }
.pop { position: fixed; width: 14px; height: 14px; pointer-events: none; z-index: 90; color: var(--sun); animation: pop .8s ease-out forwards; }
@keyframes pop { to { transform: translate(var(--x), var(--y)) scale(.2) rotate(180deg); opacity: 0; } }

/* generic panel */
.panel { background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 32px 24px; box-shadow: var(--shadow); }
.center { text-align: center; }
.big { font-size: 4rem; }

/* ---------- lessons ---------- */
.hello { display: flex; align-items: center; gap: 20px; justify-content: space-between; background: var(--ink); color: var(--on-dark); border-radius: var(--radius); border: 3px solid var(--line); padding: 24px 28px; margin-bottom: 28px; overflow: hidden; box-shadow: var(--shadow); }
.hello h1 { color: var(--on-dark); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: .2em; }
.hello p { margin: 0; color: #cfe2e7; }
.hello-art { display: flex; align-items: center; flex-shrink: 0; }
.hello-art .avatar { height: 104px; width: 104px; }
.hello-art .char-b { margin-inline: -18px; height: 124px; width: 124px; z-index: 2; border-color: var(--sun); }
@keyframes bob { 50% { transform: translateY(-8px); } }
.lesson-grid { display: grid; gap: 16px; }
.lesson {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 16px; text-align: start; width: 100%;
  background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 16px 20px; box-shadow: 0 6px 0 var(--line);
  transition: transform .15s, box-shadow .15s;
}
.lesson-wrap { display: flex; flex-direction: column; gap: 8px; }
.mat-btn { align-self: flex-start; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; padding: .35em 1.1em; background: var(--white); color: var(--fg); border: 3px solid var(--line); border-radius: 999px; box-shadow: 0 4px 0 var(--line); }
.mat-btn:hover { background: var(--sun); }
.mat-title { font-family: var(--font-display); font-size: clamp(1.3rem, 3.5vw, 1.8rem); margin: 0; }
.mat-list { display: grid; gap: 16px; margin-bottom: 20px; }
.mat { background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 6px 0 var(--line); }
.mat-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.mat-head h3 { margin: 0; font-family: var(--font-display); font-size: 1.25rem; }
.mat-head p { margin: 2px 0 0; color: var(--muted); }
.mat-ico { font-size: 2rem; width: 52px; height: 52px; display: grid; place-items: center; background: var(--cream); border: 3px solid var(--line); border-radius: 16px; flex-shrink: 0; }
.mat-img, .mat-video { display: block; max-width: 100%; max-height: 360px; margin: 0 auto 10px; border-radius: 14px; border: 3px solid var(--line); }
.mat-audio { width: 100%; margin-bottom: 10px; }
.mat .q-embed { margin: 0 auto 10px; }
.mat-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lesson:hover { transform: translateY(-3px); box-shadow: 0 9px 0 var(--line); }
.lesson:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line); }
.lesson-ico { width: 60px; height: 60px; display: grid; place-items: center; font-size: 1.9rem; background: var(--c); border: 3px solid var(--line); border-radius: 18px; transform: rotate(-4deg); }
.lesson-body strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; line-height: 1.3; color: var(--fg); }
.lesson-body small, .lesson-meta small { color: var(--muted); }
.lesson-meta { display: flex; flex-direction: column; align-items: flex-end; }
.reviewed { display: inline-block; margin-inline-start: .6em; padding: 0 .55em; border-radius: 999px; background: var(--mint); color: var(--ink); font-size: .75rem; font-weight: 600; line-height: 1.6; }
.stars { color: #f2a900; font-size: 1.3rem; letter-spacing: 2px; line-height: 1.2; }
.go { background: var(--ruby); color: #fff; border: 3px solid var(--line); border-radius: 999px; padding: .1em 1em; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }

/* ---------- round ---------- */
.round-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); background: var(--white); font-size: 1.2rem; font-weight: 700; flex-shrink: 0; }
.progress { flex: 1; height: 18px; background: var(--white); border: 3px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--sun)); transition: width .4s; }
.qcount { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; min-width: 3.2em; text-align: center; }

.stage { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: start; }
.mate { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar { border-radius: 50%; border: 4px solid var(--white); background: var(--white); box-shadow: 0 6px 0 rgba(3, 27, 84, .25); object-fit: cover; }
.mate > .avatar { width: 120px; height: 120px; animation: bob 3s ease-in-out infinite; border-color: var(--sun); }
.bubble { background: var(--white); border: 3px solid var(--line); border-radius: 18px; padding: .5em .9em; font-weight: 600; font-size: .95rem; text-align: center; position: relative; order: -1; }
.bubble::after { content: ""; position: absolute; bottom: -11px; left: 50%; width: 16px; height: 16px; background: var(--white); border: 3px solid var(--line); border-top: 0; border-inline-start: 0; transform: translateX(-50%) rotate(45deg); }

.qcard { background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); padding: 26px 24px; box-shadow: var(--shadow); transition: background .3s; }
.qcard.is-right { background: var(--good-bg); }
.qcard.is-wrong { background: var(--bad-bg); }
.q-emoji { text-align: center; font-size: clamp(4rem, 12vw, 6rem); line-height: 1.1; margin-bottom: 8px; animation: pop-in .5s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop-in { from { transform: scale(.4); opacity: 0; } }
.q-text { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 20px; }
.q-text h2 { font-size: clamp(1.4rem, 3.6vw, 2rem); text-align: center; margin: 0; }
.q-media { display: block; margin: 0 auto 14px; max-width: 100%; max-height: min(42vh, 320px); border-radius: 18px; border: 3px solid var(--line); background: #fff; object-fit: contain; }
.q-embed { aspect-ratio: 16 / 9; width: min(100%, 560px); max-height: none; overflow: hidden; }
.q-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
.opt .opt-e { display: block; font-size: 2.4rem; line-height: 1.1; }
.opt .opt-img { display: block; margin: 0 auto 6px; max-width: 100%; max-height: 110px; border-radius: 12px; object-fit: contain; }
.opt .opt-t { display: block; }
.speak { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--line); background: var(--sun); font-size: 1.2rem; flex-shrink: 0; }

.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.opts.letters .opt { font-size: 3rem; padding: .2em; }
.opt {
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; line-height: 1.3; padding: .6em .8em; background: var(--cream);
  border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line); color: var(--fg);
  transition: transform .12s, box-shadow .12s, background .2s;
}
.opt:not(:disabled):hover { transform: translateY(-2px); background: var(--hover-bg); }
.opt:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 var(--line); }
.opt:disabled { cursor: default; }
.opt.right { background: #7be0b0; animation: nod .5s; }
.opt.wrong { background: #ff9aa6; animation: shake .4s; }
.opts.two .opt.yes:not(:disabled) { background: var(--good-bg); }
.opts.two .opt.no:not(:disabled) { background: var(--bad-bg); }
@keyframes nod { 40% { transform: scale(1.06); } }
@keyframes shake { 25% { transform: translateX(8px); } 75% { transform: translateX(-8px); } }

.feedback { min-height: 2.2em; margin-top: 16px; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.feedback.ok { color: var(--ok); }
.feedback.no { color: var(--ruby-d); }
.qwrap .next { display: flex; margin: 18px auto 0; }

.order { display: grid; gap: 14px; }
.slot, .pool { min-height: 74px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px; border-radius: 18px; }
.slot { border: 3px dashed var(--line); background: var(--cream); }
.slot.empty::before { content: "اضغط على الكلمات بالترتيب هنا"; color: var(--muted); }
.slot.right { border-style: solid; background: var(--good-bg); }
.slot.wrong { border-style: solid; background: var(--bad-bg); }
.pool { justify-content: center; }
.chip { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; padding: .35em .9em; background: var(--sun); border: 3px solid var(--line); border-radius: 14px; box-shadow: 0 4px 0 var(--line); }
.chip:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--line); }
.check { justify-self: center; }
.check:disabled { opacity: .45; cursor: not-allowed; box-shadow: 0 5px 0 var(--line); transform: none; }

/* ---------- أنواع الأسئلة الإضافية ---------- */
.opts.tiles { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.opts.tiles .opt { font-size: 1.5rem; padding: .9em .6em; }
.opt.multi.picked, .opt.match-item.picked { background: var(--sun); transform: translateY(-2px); }
.opt.multi.right { background: #7be0b0; }
.opt.multi.wrong { background: #ff9aa6; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.match .col { display: grid; gap: 12px; align-content: start; }
.opt.match-item { font-size: 1.35rem; padding: .55em .5em; }
.opt.match-item:disabled { opacity: .85; }
.buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.bucket { min-height: 110px; padding: 10px; border: 3px dashed var(--line); border-radius: 18px; background: var(--cream); cursor: pointer; transition: background .2s; }
.bucket:hover { background: var(--hover-bg); }
.bucket strong { display: block; text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin-bottom: 8px; color: var(--fg); }
.bucket-items { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bucket .chip { font-size: 1.1rem; }
.chip.picked { background: var(--mint); transform: translateY(-3px); }
.chip.ok { background: #7be0b0; }
.chip.bad { background: #ff9aa6; }

/* ---------- results ---------- */
.results h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.big-mate { flex-direction: row; justify-content: center; margin-bottom: 6px; }
.big-mate .avatar { width: 110px; height: 110px; }
.big-mate .avatar:nth-child(2) { width: 134px; height: 134px; margin-inline: -14px; z-index: 2; border-color: var(--sun); }
.big-stars { font-size: 3.4rem; color: #f2a900; letter-spacing: 6px; line-height: 1.1; text-shadow: 0 3px 0 rgba(0, 0, 0, .15); }
.score { font-size: 1.3rem; font-weight: 600; margin: .3em 0 1em; }
.gem-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 20px; }
.gem-row svg { width: 38px; height: 34px; color: var(--ruby); animation: pop-in .5s cubic-bezier(.2, 1.5, .4, 1) backwards; }
.gem-row svg.off { color: #c9d4d7; opacity: .6; }
.review { text-align: start; background: var(--cream); border: 3px dashed var(--line); border-radius: 18px; padding: 14px 20px; margin: 0 auto 20px; max-width: 520px; }
.review h3 { font-size: 1.2rem; }
.review ul { margin: 0; padding-inline-start: 1.2em; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }

@media (max-width: 720px) {
  .stage { grid-template-columns: 1fr; }
  .mate { flex-direction: row-reverse; justify-content: center; }
  .mate > .avatar { width: 84px; height: 84px; }
  .bubble { order: 0; }
  .bubble::after { bottom: auto; top: 50%; left: auto; right: -9px; transform: translateY(-50%) rotate(-45deg); border: 3px solid var(--line); border-top: 0; border-inline-end: 0; }
  .hello { flex-direction: column; text-align: center; padding-bottom: 0; }
  .hello-art { margin-block: 0; padding-bottom: 20px; }
  .lesson { grid-template-columns: auto 1fr; }
  .lesson-meta { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .go { display: none; }
  .grade-name { font-size: 1rem; }
  .brand-img { height: 38px; }
}

/* ---------- ملف اللاعب ---------- */
.profile-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 190px; font: inherit; font-family: var(--font-display); font-weight: 700; font-size: .95rem; color: var(--fg); background: var(--white); border: 3px solid var(--line); border-radius: 999px; padding: .25em .8em; cursor: pointer; box-shadow: 0 3px 0 var(--line); }
.profile-btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 var(--line); }
.profile-btn.on { background: var(--mint); }
.profile-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-back { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(3, 27, 84, .55); overflow-y: auto; }
.modal-panel { position: relative; width: min(440px, 100%); background: var(--white); border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 22px 22px; outline: none; }
.modal-panel h2 { margin: 0 0 .4em; padding-inline-end: 44px; }
.modal-close { position: absolute; inset-block-start: 10px; inset-inline-end: 10px; padding: .2em .6em; }
.modal-panel .muted { color: var(--muted2); }
.modal-form { display: grid; gap: 14px; }
.field { display: grid; gap: 4px; font-weight: 600; }
.field input, .field select { font: inherit; padding: .55em .8em; border: 3px solid var(--line); border-radius: 14px; background: var(--cream); color: var(--fg); width: 100%; }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.field small { font-weight: 400; color: var(--muted2); }
.preview { margin: 0; font-weight: 700; min-height: 1.4em; }
.form-err { margin: 0; padding: .5em .8em; border-radius: 12px; background: var(--bad-bg); border: 2px solid var(--ruby); color: var(--danger); font-weight: 600; }
.choose { display: grid; gap: 12px; margin-top: 14px; }
.modal-panel .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }
.code-box { font-family: var(--font-display); font-weight: 800; font-size: 2.1rem; letter-spacing: .12em; text-align: center; background: var(--cream); border: 3px dashed var(--line); border-radius: 16px; padding: .4em; margin: 8px 0 14px; user-select: all; }
.modal-panel .danger { color: var(--danger); }
.modal-panel .btn-primary.danger { color: #fff; background: var(--danger); }
.is-busy { opacity: .6; pointer-events: none; }
@media (max-width: 560px) { .profile-label { display: none; } .profile-btn { padding: .25em .6em; } .code-box { font-size: 1.7rem; } }

/* ---------- تحدّيات الأصحاب ---------- */
.challenge .lead { font-weight: 700; font-size: 1.15rem; margin: 0 0 .3em; }
.challenge .muted { color: var(--muted2); }
.challenge .small { font-size: .9rem; }
.challenge .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 14px; }
.challenge .modal-form { max-width: 360px; margin-inline: auto; text-align: start; }
.challenge-bar { display: flex; justify-content: center; margin: -8px 0 24px; }
.challenge-box { margin: 18px 0 6px; }
.challenge-box h3 { margin: 0 0 .5em; }
.board { list-style: none; margin: 14px auto; padding: 0; max-width: 420px; display: grid; gap: 8px; text-align: start; }
.board li { display: grid; grid-template-columns: 2.2em 1fr auto; align-items: center; gap: 8px; background: var(--cream); border: 3px solid var(--line); border-radius: 14px; padding: .35em .8em; font-weight: 600; }
.board li.me { background: var(--sun); }
.board .rank { font-family: var(--font-display); font-weight: 800; text-align: center; }
.board .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .pts { font-family: var(--font-display); font-weight: 800; }
.link-box { width: 100%; font: inherit; font-size: .85rem; padding: .5em .7em; border: 3px solid var(--line); border-radius: 12px; background: var(--cream); color: var(--fg); margin-bottom: 6px; }
.modal-panel .small { font-size: .9rem; }
.modal-panel a { color: var(--fg); font-weight: 700; }

/* ---------- سباق الأصحاب ---------- */
.race .count-num { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 28vw, 9rem); line-height: 1; margin: .2em 0; color: var(--ruby); animation: bump .5s; }
.race .lobby li { grid-template-columns: 1fr auto; }
.race .tag { font-weight: 600; color: var(--muted2); }
.race .race-subject { margin-bottom: 14px; }
.race .race-subject h3 { margin: 0 0 .4em; }
.race .race-lessons { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.challenge-bar { gap: 10px; flex-wrap: wrap; }
.race-bar { position: fixed; inset-inline: 8px; inset-block-end: 8px; z-index: 60; display: grid; gap: 4px; max-width: 520px; margin-inline: auto; padding: 8px 10px; background: var(--white); border: 3px solid var(--line); border-radius: 16px; box-shadow: 0 4px 0 var(--line); }
.race-row { display: grid; grid-template-columns: minmax(70px, 28%) 1fr auto; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; }
.race-row .rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-row .track { height: 12px; border: 2px solid var(--line); border-radius: 999px; background: var(--cream); overflow: hidden; }
.race-row .track i { display: block; height: 100%; background: var(--mint); transition: width .4s; }
.race-row.me .track i { background: var(--ruby); }
.race-row.me .rn { color: var(--ruby); }
.race-row.off { opacity: .55; }
.race-row .rs { min-width: 2.6em; text-align: end; font-family: var(--font-display); }
body.play:has(.race-bar) .play-main { padding-bottom: 150px; }
.lesson.soon { opacity: .6; cursor: not-allowed; box-shadow: 0 3px 0 var(--line); filter: grayscale(.4); }
.lesson.soon:hover { transform: none; box-shadow: 0 3px 0 var(--line); }

/* شرح بعد الإجابة + بلاغ عن غلط في السؤال */
.explain { margin: 14px auto 0; max-width: 34em; padding: 10px 14px; border-radius: 14px; background: var(--soft); border: 2px dashed var(--line); font-size: 1.05rem; line-height: 1.6; text-align: center; }
.report { margin-top: 12px; text-align: center; }
.report-link { background: none; border: 0; padding: 6px 10px; font: inherit; font-size: .9rem; color: inherit; opacity: .7; text-decoration: underline; cursor: pointer; }
.report-link:hover, .report-link:focus-visible { opacity: 1; }
.report-ask, .report-done { margin: 0 0 8px; font-size: .95rem; }
.report-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.report-opts .chip { font-size: .95rem; box-shadow: 0 3px 0 var(--line); border-width: 2px; }
.report-opts .chip:disabled { opacity: .5; }

/* إعدادات الراحة (play/a11y.js) */
.a11y-btn { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.2rem; background: var(--white); border: 3px solid var(--line); border-radius: 50%; box-shadow: 0 3px 0 var(--line); cursor: pointer; }
.a11y-btn:hover { transform: translateY(1px); box-shadow: 0 2px 0 var(--line); }
.a11y-list { display: grid; gap: 12px; margin-top: 8px; }
.a11y-switch, .a11y-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 10px 14px; font: inherit; text-align: start; color: var(--fg); background: var(--cream); border: 3px solid var(--line); border-radius: 16px; }
.a11y-switch { cursor: pointer; }
.a11y-label { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.a11y-label small { display: block; font-family: inherit; font-weight: 400; font-size: .8rem; opacity: .75; }
.a11y-knob { position: relative; flex-shrink: 0; width: 52px; height: 30px; background: var(--track); border: 3px solid var(--line); border-radius: 999px; transition: background .2s; }
.a11y-knob::after { content: ''; position: absolute; inset-block-start: 2px; inset-inline-start: 2px; width: 20px; height: 20px; background: var(--white); border: 2px solid var(--line); border-radius: 50%; transition: inset-inline-start .2s; }
.a11y-switch[aria-checked="true"] .a11y-knob { background: var(--mint); }
.a11y-switch[aria-checked="true"] .a11y-knob::after { inset-inline-start: 22px; }
.a11y-sizes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.a11y-size { font: inherit; font-weight: 600; font-size: .9rem; padding: .25em .8em; color: var(--fg); background: var(--white); border: 2px solid var(--line); border-radius: 999px; cursor: pointer; }
.a11y-size[aria-pressed="true"] { background: var(--sun); }
.a11y-note { margin: 12px 0 0; font-size: .85rem; text-align: center; }
.a11y-btn:focus-visible, .a11y-switch:focus-visible, .a11y-size:focus-visible { outline: 3px solid var(--ruby); outline-offset: 2px; }

html.a11y-font-1 { font-size: 112.5%; }
html.a11y-font-2 { font-size: 128%; }
html.a11y-no-sound .speak { display: none; }
html.a11y-reduce-motion *, html.a11y-reduce-motion *::before, html.a11y-reduce-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-reduce-motion .pop { display: none; }
@media (max-width: 520px) { .a11y-switch, .a11y-row { padding: 8px 10px; } .a11y-row { flex-wrap: wrap; } }

/* الأوسمة */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 14px; }
.badge-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; background: var(--white); border: 3px solid var(--line); border-radius: 18px; box-shadow: 0 4px 0 var(--line); text-align: center; }
.badge-card.on { background: var(--soft); }
.badge-card.off { opacity: .6; filter: grayscale(.6); box-shadow: none; }
.badge-card strong { font-family: var(--font-display); font-size: 1.05rem; }
.badge-card small { font-size: .8rem; opacity: .8; }
.badge-ico { font-size: 2.2rem; line-height: 1.2; }
.badge-prog { margin-top: 4px; padding: 0 .6em; font-size: .8rem; font-weight: 600; background: var(--cream); border: 2px solid var(--line); border-radius: 999px; }
.new-badges { margin: 14px auto 0; padding: 12px; max-width: 34em; background: var(--soft); border: 3px dashed var(--line); border-radius: 18px; }
.new-badges h3 { margin: 0 0 8px; }
.badge-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.badge-chip { display: flex; flex-direction: column; align-items: center; min-width: 110px; animation: pop-in .5s cubic-bezier(.2, 1.5, .4, 1); }
.badge-chip strong { font-family: var(--font-display); }
.badge-chip small { font-size: .8rem; opacity: .8; }

/* أهداف الدرس */
.goals { align-self: stretch; margin: 0; padding: 8px 14px; background: var(--white); border: 3px solid var(--line); border-radius: 16px; font-size: .95rem; }
.goals summary { cursor: pointer; font-family: var(--font-display); font-weight: 700; }
.goals ul { margin: 8px 0 2px; padding-inline-start: 1.3em; line-height: 1.7; }
.goals summary:focus-visible { outline: 3px solid var(--ruby); outline-offset: 2px; border-radius: 8px; }

.review-got { margin: 6px 0; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ok); }

/* الأترام */
.term-group + .term-group, .term-group + .term-group { margin-top: 18px; }
.term-title { display: inline-block; margin: 0 0 10px; padding: .15em .9em; font-family: var(--font-display); font-size: 1.1rem; background: var(--sun); border: 3px solid var(--line); border-radius: 999px; }

/* ركن الألعاب */
.arcade-hud { flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.hud-timer { padding: 0 .8em; background: var(--white); border: 3px solid var(--line); border-radius: 999px; min-width: 5em; text-align: center; }
.hud-timer.low { background: var(--ruby); color: #fff; animation: bob 0.6s ease-in-out infinite; }
.hud-lives { letter-spacing: 2px; }
.hud-score { padding: 0 .8em; background: var(--mint); border: 3px solid var(--line); border-radius: 999px; }
.arcade-pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin: 10px 0; font-family: var(--font-display); font-weight: 700; }
.arcade-select { max-width: 100%; font: inherit; font-weight: 500; padding: .35em .8em; color: var(--fg); background: var(--white); border: 3px solid var(--line); border-radius: 14px; }
.arcade-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 14px; }
.arcade-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; font: inherit; color: var(--fg); background: var(--soft); border: 3px solid var(--line); border-radius: 20px; box-shadow: 0 5px 0 var(--line); cursor: pointer; }
.arcade-card:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--line); }
.arcade-card strong { font-family: var(--font-display); font-size: 1.3rem; }
.arcade-card small { font-size: .9rem; opacity: .85; }
.arcade-card:focus-visible, .arcade-select:focus-visible { outline: 3px solid var(--ruby); outline-offset: 2px; }

/* ملخص الدرس */
.summary { text-align: start; line-height: 1.9; font-size: 1.1rem; }
.summary h3 { margin: 1em 0 .3em; font-family: var(--font-display); }
.summary p { margin: .4em 0; }
.summary ul { margin: .4em 0; padding-inline-start: 1.4em; }
.summary-goals { margin-bottom: 12px; padding: 10px 14px; background: var(--soft); border: 3px dashed var(--line); border-radius: 16px; }
.summary-goals ul { margin: 6px 0 0; }
.speak-all { margin-top: 12px; }

/* عدد الأسئلة */
.count-chip { display: inline-block; margin-inline-start: .6em; padding: 0 .7em; font-family: var(--font-body, inherit); font-size: .8rem; font-weight: 600; vertical-align: middle; background: var(--white); border: 2px solid var(--line); border-radius: 999px; }
.qn { opacity: .75; }

/* اختيار المادة */
.pick-title { margin: 8px 0 14px; font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2rem); text-align: center; }
.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin-bottom: 22px; }
.subject-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px 18px; font: inherit; color: var(--fg); text-align: center; cursor: pointer; background: var(--white); border: 4px solid var(--c); border-radius: 26px; box-shadow: 0 6px 0 var(--line); transition: transform .15s, box-shadow .15s; }
.subject-card:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 9px 0 var(--line); }
.subject-card:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 3px 0 var(--line); }
.subject-card:focus-visible { outline: 4px solid var(--ruby); outline-offset: 3px; }
.subject-card.soon { opacity: .6; cursor: not-allowed; }
.subject-ico { display: grid; place-items: center; width: 92px; height: 92px; font-size: 3.2rem; background: var(--c); border: 3px solid var(--line); border-radius: 26px; transform: rotate(-4deg); }
.subject-name { font-family: var(--font-display); font-size: 2rem; line-height: 1.2; }
.subject-meta { font-size: .95rem; opacity: .8; }
.subject-prog { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 80%; }
.subject-prog .bar { display: block; width: 100%; height: 10px; background: var(--track); border: 2px solid var(--line); border-radius: 999px; overflow: hidden; }
.subject-prog .bar i { display: block; height: 100%; background: var(--c); }
.subject-card .go { margin-top: 6px; background: var(--ruby); color: #fff; border: 3px solid var(--line); border-radius: 999px; padding: .1em 1em; font-family: var(--font-display); font-weight: 700; }
.subject-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.subject-head h2 { margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.1rem); }

/* عناوين المجموعات (الفصول) جوه المادة */
.section-group + .section-group { margin-top: 16px; }
.section-title { margin: 14px 0 8px; padding-inline-start: .6em; font-family: var(--font-display); font-size: 1.15rem; border-inline-start: 6px solid var(--sun); }

/* الألعاب الكاملة */
.arcade-sub { margin: 18px 0 4px; font-family: var(--font-display); }
.ask-back { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 14px; background: rgba(3, 27, 84, .7); overflow-y: auto; }
.ask-card { width: min(640px, 100%); margin: 0; }
.ask-title { margin: 0 0 8px; text-align: center; font-family: var(--font-display); font-weight: 700; }
.game-root { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-bottom: 24px; }
.game-hud { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.game-hud .pill { padding: 0 .8em; background: var(--white); border: 3px solid var(--line); border-radius: 999px; }
.game-msg { min-height: 1.6em; margin: 0; text-align: center; font-weight: 600; }
.game-canvas { max-width: 100%; height: auto; touch-action: none; background: #fff; border: 4px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line); }

/* شطرنج */
.chess-board { display: grid; grid-template-columns: repeat(8, 1fr); width: min(92vw, 520px); aspect-ratio: 1; border: 4px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: 0 5px 0 var(--line); direction: ltr; }
.chess-board .cell { display: grid; place-items: center; padding: 0; border: 0; font: inherit; cursor: pointer; position: relative; }
.chess-board .cell.light { background: #f0d9b5; }
.chess-board .cell.dark { background: #b58863; }
.chess-board .cell.last { box-shadow: inset 0 0 0 4px rgba(253, 200, 9, .75); }
.chess-board .cell.sel { background: #fdc809; }
.chess-board .cell.tgt::after { content: ''; position: absolute; width: 28%; height: 28%; background: rgba(23, 213, 240, .85); border: 2px solid var(--line); border-radius: 50%; }
.chess-board .cell.chk { background: #fc2f65; }
.chess-board .pc { font-size: clamp(1.6rem, 8vw, 3.2rem); line-height: 1; }
.chess-board .pc.w { color: #fff; text-shadow: -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111, 0 2px 0 #111; }
.chess-board .pc.b { color: #14193a; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.chess-board .cell:focus-visible { outline: 3px solid var(--ruby); outline-offset: -3px; }
.chk-pill { background: #fc2f65 !important; color: #fff; }

/* السيجة */
.seega-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; width: min(92vw, 420px); aspect-ratio: 1; padding: 8px; background: #8a5a2b; border: 4px solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 var(--line); direction: ltr; }
.seega-board .scell { display: grid; place-items: center; padding: 0; background: #e8c88a; border: 3px solid #5c3a14; border-radius: 10px; cursor: pointer; }
.seega-board .scell.mid { background: #fdc809; }
.seega-board .scell.can { box-shadow: 0 0 0 3px #17d5f0; }
.seega-board .scell.sel { background: var(--hover-bg); }
.seega-board .scell.tgt { background: #b9f3d6; }
.seega-board .sp { width: 68%; height: 68%; border: 3px solid var(--line); border-radius: 50%; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); }
.seega-board .sp.p1 { background: #fdc809; }
.seega-board .sp.p2 { background: #3b8eea; }
.seega-board .scell:focus-visible { outline: 3px solid var(--ruby); }

/* لودو */
.ludo-board { position: relative; width: min(94vw, 480px); aspect-ratio: 1; background: radial-gradient(circle, var(--soft) 0 62%, #e9f4ff 63%); border: 4px solid var(--line); border-radius: 50%; box-shadow: 0 5px 0 var(--line); direction: ltr; }
.ludo-board .lcell { position: absolute; width: 5.2%; height: 5.2%; transform: translate(-50%, -50%); display: grid; place-items: center; font-size: .6rem; background: var(--white); border: 2px solid var(--line); border-radius: 50%; }
.ludo-board .lcell.home { border-color: rgba(0, 0, 0, .45); opacity: .85; }
.ludo-board .lbase { position: absolute; width: 22%; height: 22%; transform: translate(-50%, -50%); background: rgba(255, 255, 255, .8); border: 4px dashed; border-radius: 18px; }
.ludo-board .lcenter { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2rem; }
.ludo-board .ltoken { position: absolute; width: 6.6%; height: 6.6%; transform: translate(-50%, -50%); padding: 0; border: 3px solid var(--line); border-radius: 50%; box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .3), 0 2px 0 var(--line); transition: left .25s, top .25s; }
.ludo-board .ltoken.can { animation: bob .6s ease-in-out infinite; cursor: pointer; z-index: 3; outline: 3px solid #fff; }
.ludo-board .ltoken:disabled { cursor: default; }
.ludo-die { font-size: 2.6rem; line-height: 1; padding: .1em .5em; background: var(--white); border: 4px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line); cursor: pointer; }
.ludo-die:disabled { opacity: .45; cursor: not-allowed; }
.ludo-die:not(:disabled) { animation: bob .8s ease-in-out infinite; }

/* ورشة الصائغ */
.jw-board { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; width: min(94vw, 460px); padding: 8px; background: #5b3a8e; border: 4px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line); direction: ltr; }
.jw-cell { aspect-ratio: 1; display: grid; place-items: center; padding: 0; font-size: clamp(1.3rem, 6.5vw, 2.3rem); line-height: 1; background: #f4e9ff; border: 3px solid #2b1a4a; border-radius: 12px; cursor: pointer; transition: transform .12s; }
.jw-cell.sel { background: #fdc809; transform: scale(1.08); }
.jw-cell.pop { animation: pop-in .3s ease-out reverse; background: #b9f3d6; }
.jw-cell:focus-visible { outline: 3px solid var(--ruby); }

/* برج الجواهر / المنجم / الرماية / البولينج */
.tw-canvas, .mn-canvas, .ar-canvas, .bw-canvas { display: block; width: min(94vw, 420px); max-width: 100%; height: auto; margin: 0 auto; border: 4px solid var(--line); border-radius: 18px; box-shadow: 0 5px 0 var(--line); background: #2b1a4a; touch-action: manipulation; }
.mn-pad { display: flex; justify-content: center; gap: .6rem; margin: .7rem 0; direction: ltr; }
.mn-btn { min-width: 4.2rem; min-height: 3.2rem; font-size: 1.2rem; touch-action: none; user-select: none; }
.bw-score { display: flex; direction: ltr; justify-content: center; gap: 2px; margin: .4rem auto; max-width: 94vw; }
.bw-frame { flex: 1; min-width: 0; border: 2px solid var(--line); border-radius: 6px; background: var(--white); text-align: center; font-size: clamp(.6rem, 2.4vw, .85rem); }
.bw-frame.cur { background: var(--hover-bg); }
.bw-rolls { display: flex; justify-content: flex-end; gap: 2px; padding: 0 2px; min-height: 1.3em; border-bottom: 1px solid #ccc; }
.bw-total { min-height: 1.4em; font-weight: 700; }
.big-code { font-size: 2rem; font-weight: 800; letter-spacing: .15em; }
