@font-face { font-family: 'Cairo'; font-weight: 400; src: url(fonts/cairo-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Cairo'; font-weight: 700; src: url(fonts/cairo-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Cairo'; font-weight: 900; src: url(fonts/cairo-arabic-900-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: 'Cairo'; font-weight: 400; src: url(fonts/cairo-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: 'Cairo'; font-weight: 700 900; src: url(fonts/cairo-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F; }

:root {
  --bg: #f4f1ff; --card: #ffffff; --ink: #1f1640; --muted: #6b6390; --line: #e4def8;
  --brand: #6c3cf0; --brand2: #9b6dff; --ok: #1fb36b; --okbg: #e3f8ec; --bad: #e5484d; --badbg: #fde8e8;
  --gold: #ffb300; --code: #1e1b2e; --codeink: #f1ecff;
  --mono: Consolas, 'Cascadia Mono', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif; background: var(--bg); color: var(--ink); direction: rtl; font-size: 17px; -webkit-user-select: none; user-select: none; overflow: hidden; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
input, textarea { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; overflow: auto; }
code, .ltr { direction: ltr; unicode-bidi: isolate; }
code { font-family: var(--mono); background: #efe9ff; color: #5326c9; padding: 1px 7px; border-radius: 6px; font-size: .92em; }
b { color: var(--brand); }

/* ---------- buttons ---------- */
.btn { background: var(--brand); color: #fff; font-weight: 700; padding: 12px 26px; border-radius: 14px; box-shadow: 0 4px 0 #4b22b8; transition: transform .08s; font-size: 18px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #4b22b8; }
.btn:disabled { background: #c9c2e3; box-shadow: 0 4px 0 #aaa2c9; cursor: not-allowed; }
.btn.ok { background: var(--ok); box-shadow: 0 4px 0 #128a50; }
.btn.bad { background: var(--bad); box-shadow: 0 4px 0 #b12a2e; }
.btn.ghost { background: #fff; color: var(--brand); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.btn.sm { padding: 7px 14px; font-size: 15px; border-radius: 10px; }
.iconbtn { background: transparent; font-size: 22px; padding: 6px 10px; border-radius: 10px; color: var(--muted); }
.iconbtn:hover { background: #ebe5ff; }

/* ---------- login ---------- */
#login { display: grid; place-items: center; background: radial-gradient(circle at 20% 10%, #d9ccff 0, transparent 40%), radial-gradient(circle at 90% 90%, #ffd9c7 0, transparent 40%), var(--bg); }
.login-box { width: min(880px, 94vw); text-align: center; padding: 30px 0; }
.logo { font-size: 64px; line-height: 1; }
.app-title { font-size: 44px; font-weight: 900; margin: 6px 0 0; color: var(--brand); }
.app-sub { color: var(--muted); margin: 0 0 4px; font-size: 18px; }
.school-name { color: var(--ink); font-weight: 700; margin-bottom: 22px; }
.students { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; margin: 18px 0; }
.stu { background: #fff; border-radius: 18px; padding: 16px 10px; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); cursor: pointer; transition: transform .1s; }
.stu:hover { transform: translateY(-3px); border-color: var(--brand2); }
.avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 6px; color: #fff; font-weight: 900; font-size: 24px; background: linear-gradient(135deg, var(--brand), #ff7a59); }
.stu .n { font-weight: 700; }
.stu .c { color: var(--muted); font-size: 14px; }
.new-stu { background: #fff; border-radius: 20px; padding: 22px; border: 2px dashed var(--brand2); max-width: 560px; margin: 10px auto; }
.new-stu h3 { margin: 0 0 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; }
.field { padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; outline: none; min-width: 0; }
.field:focus { border-color: var(--brand2); }
.teacher-link { position: fixed; top: 14px; left: 14px; z-index: 6; }

/* ---------- home ---------- */
.topbar { position: sticky; top: 0; z-index: 5; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; padding: 10px 22px; }
.topbar .avatar { width: 42px; height: 42px; font-size: 18px; margin: 0; }
.topbar .who { line-height: 1.2; }
.topbar .who .c { color: var(--muted); font-size: 13px; }
.spacer { flex: 1; }
.pill { background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 4px 14px; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.home-wrap { max-width: 900px; margin: 0 auto; padding: 24px 18px 80px; }
.stage { background: #fff; border-radius: 24px; margin-bottom: 26px; border: 2px solid var(--line); overflow: hidden; position: relative; }
.stage-head { padding: 18px 22px; color: #fff; display: flex; gap: 16px; align-items: center; }
.stage-head .ic { font-size: 44px; background: rgba(255,255,255,.22); border-radius: 18px; width: 70px; height: 70px; display: grid; place-items: center; }
.stage-head h2 { margin: 0; font-size: 24px; }
.stage-head .en { opacity: .9; font-size: 14px; direction: ltr; text-align: right; }
.stage-head p { margin: 4px 0 0; opacity: .95; font-size: 15px; }
.stage-prog { height: 8px; background: rgba(255,255,255,.3); border-radius: 9px; margin-top: 8px; overflow: hidden; }
.stage-prog i { display: block; height: 100%; background: #fff; border-radius: 9px; }
.path { padding: 26px 20px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.node { display: flex; flex-direction: column; align-items: center; width: 220px; cursor: pointer; }
.node .dot { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; background: #fff; border: 4px solid var(--line); box-shadow: 0 6px 0 var(--line); transition: transform .12s; position: relative; }
.node:hover .dot { transform: scale(1.06); }
.node .t { font-weight: 700; margin-top: 8px; text-align: center; line-height: 1.3; }
.node .e { font-size: 12px; color: var(--muted); direction: ltr; }
.node .xp { font-size: 12px; color: var(--gold); font-weight: 700; }
.node.done .dot { background: var(--ok); border-color: #128a50; box-shadow: 0 6px 0 #128a50; color: #fff; }
.node.current .dot { border-color: var(--brand); box-shadow: 0 6px 0 var(--brand), 0 0 0 8px rgba(108,60,240,.15); animation: pulse 1.6s infinite; }
.node.locked { cursor: not-allowed; opacity: .55; }
.node.locked .dot { filter: grayscale(1); }
.node .badge-done { position: absolute; bottom: -4px; left: -4px; background: var(--gold); color: #fff; border-radius: 50%; width: 26px; height: 26px; font-size: 14px; display: grid; place-items: center; border: 2px solid #fff; }
.node:nth-child(4n+2) { transform: translateX(-70px); } .node:nth-child(4n+4) { transform: translateX(70px); }
.stage.locked .path { filter: grayscale(.8); opacity: .6; }
.lock-note { text-align: center; color: var(--muted); padding: 0 0 18px; font-weight: 700; }
.cert-ready { margin: 0 20px 20px; background: #fff8e1; border: 2px solid #ffe082; border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; gap: 12px; }
@keyframes pulse { 50% { box-shadow: 0 6px 0 var(--brand), 0 0 0 16px rgba(108,60,240,.05); } }

/* ---------- player ---------- */
#player { display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.p-top { display: flex; align-items: center; gap: 16px; padding: 12px 22px; }
.p-prog { flex: 1; height: 16px; background: #eee9fb; border-radius: 99px; overflow: hidden; }
.p-prog i { display: block; height: 100%; background: linear-gradient(90deg, #8a5cff, var(--ok)); border-radius: 99px; transition: width .3s; }
.hearts { font-size: 22px; letter-spacing: 2px; }
.p-title { color: var(--muted); font-weight: 700; font-size: 15px; }
.p-body { flex: 1; overflow: auto; padding: 18px 20px 30px; }
.card { max-width: 760px; margin: 0 auto; animation: slidein .25s ease; }
@keyframes slidein { from { opacity: 0; transform: translateX(-24px); } }
.card .img { font-size: 84px; text-align: center; margin: 4px 0 10px; }
.card .txt { font-size: 21px; line-height: 1.9; }
.card .q { font-size: 22px; font-weight: 700; line-height: 1.8; margin-bottom: 16px; }
.note { background: #f3efff; border-inline-start: 5px solid var(--brand2); padding: 12px 16px; border-radius: 12px; margin-top: 16px; font-size: 18px; line-height: 1.8; }
.note::before { content: '💡 '; }
pre.code { background: var(--code); color: var(--codeink); direction: ltr; text-align: left; padding: 16px 18px; border-radius: 14px; font-family: var(--mono); font-size: 18px; line-height: 1.6; margin: 14px 0; position: relative; white-space: pre-wrap; -webkit-user-select: text; user-select: text; overflow: auto; }
pre.code .lang { position: absolute; top: 6px; right: 10px; font-size: 11px; color: #a993ff; font-family: 'Cairo'; letter-spacing: 1px; }
.tk-k { color: #ff8ad8; } .tk-s { color: #9ff07c; } .tk-n { color: #ffcb6b; } .tk-c { color: #8a83a8; font-style: italic; } .tk-t { color: #7ec8ff; } .tk-a { color: #ffcb6b; } .tk-f { color: #82e9ff; }
.run-out { margin-top: -6px; }
.out { background: #0f0d1a; color: #c8ffbf; direction: ltr; text-align: left; font-family: var(--mono); padding: 12px 16px; border-radius: 12px; white-space: pre-wrap; min-height: 44px; font-size: 17px; }
.out .err { color: #ff9a9a; }
.out .errar { color: #ffd27a; direction: rtl; text-align: right; font-family: 'Cairo'; display: block; margin-bottom: 4px; }
.out-label { font-size: 13px; color: var(--muted); margin: 8px 0 4px; }
iframe.preview { width: 100%; height: 230px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }

.opts { display: grid; gap: 12px; }
.opt { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px 18px; font-size: 19px; text-align: right; box-shadow: 0 4px 0 var(--line); color: var(--ink); }
.opt:hover { border-color: var(--brand2); }
.opt.sel { border-color: var(--brand); background: #f3efff; box-shadow: 0 4px 0 var(--brand2); }
.opt.right { border-color: var(--ok); background: var(--okbg); }
.opt.wrong { border-color: var(--bad); background: var(--badbg); }
.blank { display: inline-block; min-width: 70px; height: 32px; vertical-align: middle; border-bottom: 3px solid #a993ff; background: #2d2944; border-radius: 6px; margin: 0 2px; padding: 0 8px; cursor: pointer; text-align: center; color: #fff; line-height: 32px; }
.blank.filled { background: #4b3a8f; }
.blank input { width: 120px; background: transparent; border: 0; color: #fff; font-family: var(--mono); font-size: 18px; outline: none; text-align: center; }
.tokens { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 20px; direction: ltr; }
.tok { background: #fff; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); border-radius: 12px; padding: 8px 18px; font-family: var(--mono); font-size: 18px; color: var(--ink); }
.tok:hover { border-color: var(--brand2); }
.order-zone { min-height: 60px; border: 2px dashed var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.order-zone.answer { border-color: var(--brand2); background: #faf8ff; }
.oline { background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 9px 14px; font-size: 18px; box-shadow: 0 3px 0 var(--line); text-align: right; color: var(--ink); white-space: pre; }
.oline.code { direction: ltr; text-align: left; font-family: var(--mono); }
.oline .num { display: inline-block; width: 26px; color: var(--brand); font-weight: 900; }
.zone-label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }

/* robot */
.robot-wrap { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.grid { display: inline-grid; gap: 4px; background: #d9d1f5; padding: 6px; border-radius: 14px; direction: ltr; }
.cell { width: 62px; height: 62px; background: #fff; border-radius: 8px; display: grid; place-items: center; font-size: 34px; position: relative; }
.cell.wall { background: #8d6e63; }
.cell.trail { background: #ece5ff; }
.robot-side { min-width: 280px; flex: 1; max-width: 420px; }
.prog-bar { min-height: 64px; background: #1e1b2e; border-radius: 14px; padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; align-items: center; }
.prog-bar .empty { color: #8a83a8; font-size: 14px; direction: rtl; width: 100%; text-align: center; }
.blk { background: #6c3cf0; color: #fff; border-radius: 9px; padding: 4px 9px; font-size: 22px; }
.blk.rep { background: #ff8f00; font-size: 17px; font-weight: 900; }
.blk.active { outline: 3px solid #ffeb3b; }
.palette { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; direction: ltr; justify-content: center; }
.palette button { font-size: 28px; background: #fff; border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); border-radius: 12px; width: 62px; height: 56px; }
.palette button.rep { background: #fff3e0; border-color: #ffcc80; font-size: 22px; width: auto; padding: 0 12px; }
.rep-pick { display: flex; gap: 6px; justify-content: center; direction: ltr; margin-bottom: 8px; }
.rep-pick button { background: #ff8f00; color: #fff; border-radius: 10px; width: 44px; height: 40px; font-weight: 900; font-size: 18px; }
.limit { text-align: center; color: var(--muted); font-size: 15px; }

/* code editor */
.editor { width: 100%; min-height: 200px; background: var(--code); color: var(--codeink); font-family: var(--mono); font-size: 18px; line-height: 1.6; padding: 14px 16px; border-radius: 14px; border: 3px solid transparent; direction: ltr; text-align: left; resize: vertical; outline: none; tab-size: 4; white-space: pre; }
.editor:focus { border-color: var(--brand2); }
.ed-bar { display: flex; gap: 10px; align-items: center; margin: 8px 0; }

/* bottom bar & feedback */
.p-bottom { border-top: 2px solid var(--line); padding: 16px 22px; display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 86px; transition: background .2s; }
.p-bottom.ok { background: var(--okbg); border-color: #b6ebcd; }
.p-bottom.bad { background: var(--badbg); border-color: #f6c2c3; }
.fb { flex: 1; max-width: 640px; font-size: 19px; font-weight: 700; line-height: 1.6; }
.fb small { display: block; font-weight: 400; font-size: 16px; color: var(--ink); }
.p-bottom.ok .fb { color: #128a50; } .p-bottom.bad .fb { color: #b12a2e; }

/* ---------- done / modals ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(31,22,64,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: #fff; border-radius: 26px; padding: 28px; width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; text-align: center; animation: pop .25s ease; }
.modal.wide { width: min(1000px, 100%); text-align: right; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } }
.big-emoji { font-size: 80px; line-height: 1.1; }
.done-title { font-size: 30px; font-weight: 900; margin: 8px 0; }
.code-box { background: linear-gradient(135deg, #2b1a6b, #6c3cf0); color: #fff; border-radius: 18px; padding: 14px; margin: 14px 0; }
.code-box .lbl { font-size: 14px; opacity: .85; }
.code-box .cd { font-family: var(--mono); font-size: 30px; font-weight: 700; letter-spacing: 2px; direction: ltr; -webkit-user-select: text; user-select: text; }
.code-box.gold { background: linear-gradient(135deg, #b26a00, #ffb300); }
.code-box.badge { background: linear-gradient(135deg, #00796b, #26a69a); }
.stats { display: flex; gap: 12px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.confetti { position: fixed; top: -40px; font-size: 26px; z-index: 60; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* achievements */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 12px 0 22px; }
.bdg { border: 2px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; background: #fff; }
.bdg .i { font-size: 38px; }
.bdg .t { font-weight: 700; }
.bdg .d { font-size: 13px; color: var(--muted); }
.bdg.off { opacity: .4; filter: grayscale(1); }
.bdg .cd, .codes-table .cd { font-family: var(--mono); direction: ltr; font-weight: 700; color: var(--brand); font-size: 14px; -webkit-user-select: text; user-select: text; }
.codes-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.codes-table th, .codes-table td { border-bottom: 1px solid var(--line); padding: 8px; text-align: right; }
.codes-table th { background: #f6f3ff; position: sticky; top: 0; }
h3.sec { margin: 18px 0 6px; }

/* teacher */
.tabs { display: flex; gap: 6px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tab { background: transparent; padding: 10px 16px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab.on { color: var(--brand); border-color: var(--brand); }
.verify-res { margin-top: 16px; border-radius: 16px; padding: 16px; font-size: 18px; line-height: 1.9; }
.verify-res.ok { background: var(--okbg); border: 2px solid #b6ebcd; }
.verify-res.bad { background: var(--badbg); border: 2px solid #f6c2c3; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; font-size: 15px; }
.warn { color: var(--bad); font-weight: 700; }
.muted { color: var(--muted); }

/* ---------- certificate ---------- */
#certView .modal { width: min(1060px, 100%, calc((92vh - 110px) * 1.414 + 36px)); padding: 18px; }
.cert { container-type: inline-size; width: 100%; aspect-ratio: 297 / 210; background: #fff; position: relative; color: #1f1640; overflow: hidden; border-radius: 6px; }
.cert-frame { position: absolute; inset: 2.2%; border: 9px double var(--cc, #6c3cf0); border-radius: 10px; }
.cert-corner { position: absolute; width: 22%; aspect-ratio: 1; border-radius: 50%; background: var(--cc, #6c3cf0); opacity: .12; }
.cert-in { position: absolute; inset: 6% 8%; display: flex; flex-direction: column; align-items: center; text-align: center; justify-content: space-between; }
.cert .school { font-weight: 700; font-size: 1.15cqw; color: #5a527c; }
.cert .ttl { font-size: 3.6cqw; font-weight: 900; color: var(--cc, #6c3cf0); line-height: 1.2; }
.cert .ttl-en { font-size: 1.2cqw; letter-spacing: .4em; color: #8a83a8; direction: ltr; }
.cert .line { font-size: 1.45cqw; line-height: 1.9; }
.cert .stu-name { font-size: 3cqw; font-weight: 900; border-bottom: 3px solid var(--gold); padding: 0 30px; display: inline-block; line-height: 1.5; }
.cert .stage-name { font-weight: 900; color: var(--cc, #6c3cf0); }
.cert .sig-row { display: flex; width: 100%; justify-content: space-between; align-items: flex-end; font-size: 1.1cqw; }
.cert .sig { text-align: center; min-width: 22%; }
.cert .sig .s { border-top: 2px solid #c9c2e3; padding-top: 6px; margin-top: 2.6cqw; font-weight: 700; }
.cert .cert-code { text-align: center; }
.cert .cert-code .cd { font-family: var(--mono); font-size: 1.7cqw; font-weight: 700; direction: ltr; background: #f3efff; padding: 4px 14px; border-radius: 8px; letter-spacing: 1px; color: #2b1a6b; }
.cert .medal { font-size: 4.2cqw; line-height: 1; }
.cert-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }

@media print {
  @page { size: A4 landscape; margin: 0; }
  body { background: #fff; overflow: visible; }
  body > *:not(#certView) { display: none !important; }
  #certView { position: static; background: none; padding: 0; display: block; }
  #certView .modal { width: 297mm; height: 210mm; padding: 0; border-radius: 0; max-height: none; animation: none; overflow: hidden; }
  .cert { width: 297mm; height: 210mm; aspect-ratio: auto; border-radius: 0; }
  .cert .school { font-size: 13pt; } .cert .ttl { font-size: 40pt; } .cert .ttl-en { font-size: 13pt; }
  .cert .line { font-size: 16pt; } .cert .stu-name { font-size: 32pt; } .cert .sig-row { font-size: 12pt; }
  .cert .sig .s { margin-top: 28pt; } .cert .cert-code .cd { font-size: 18pt; } .cert .medal { font-size: 44pt; }
  .cert-actions { display: none !important; }
}

/* ---------- v2: أسلوب شرح قصير + تمرين ---------- */
.card.wide { max-width: 900px; }
.card .img.sm { font-size: 54px; margin: 0 0 6px; }
.lead { font-size: 19px; line-height: 1.8; color: #3b3260; margin-bottom: 10px; }
.c-title { text-align: center; font-size: 28px; margin: 4px 0 12px; color: var(--brand); }
.again { background: #fff3e0; color: #b26a00; border: 2px solid #ffcc80; border-radius: 12px; padding: 8px 14px; font-weight: 700; margin-bottom: 14px; text-align: center; }
ul.recap { list-style: none; padding: 0; font-size: 20px; line-height: 2.1; }
.opt.multi { display: flex; align-items: center; gap: 12px; }
.opt .box { width: 22px; height: 22px; border: 2px solid var(--brand2); border-radius: 6px; flex: none; }
.opt.multi.sel .box { background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.tok.used { visibility: hidden; }
.blank.b-ok { background: #128a50 !important; border-color: #9ff07c; }
.blank.b-bad { background: #b12a2e !important; border-color: #ffb4b4; }
.story { background: #f6f3ff; border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; display: flex; gap: 18px; align-items: center; }
.story-img { font-size: 70px; background: #1e1b2e; border-radius: 16px; width: 120px; height: 110px; display: grid; place-items: center; flex: none; }
.story .txt { font-size: 18px; }
.badge-pr { font-size: 12px; letter-spacing: 1px; color: var(--muted); font-weight: 700; display: none; }
.task-h { margin: 6px 0 4px; }
.pill.bug { background: #fde8e8; border-color: #f6c2c3; color: #b12a2e; }
.test { margin-top: 12px; border-radius: 14px; padding: 12px 14px; border: 2px solid; }
.test.ok { background: var(--okbg); border-color: #b6ebcd; }
.test.bad { background: var(--badbg); border-color: #f6c2c3; }
.test .t-h { font-weight: 900; margin-bottom: 6px; }
.t-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t-cols pre.out { margin: 0; }
.order-zone.revealed { border-color: var(--ok); background: var(--okbg); }
.iconbtn:disabled { opacity: .3; cursor: default; }
.mark { font-family: 'Cairo'; font-weight: 900; font-size: 26px; color: #fff; background: var(--brand2); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; }
.mark.mk-ok { background: var(--ok); }
.cell { position: relative; }
.mark-sm { position: absolute; bottom: 2px; right: 4px; font-size: 13px; font-weight: 900; color: var(--brand); font-family: 'Cairo'; }
.trace-opts { grid-template-columns: repeat(3, 1fr); }
.trace-opts .opt { text-align: center; font-size: 26px; font-weight: 900; }
.cert .cert-head { width: 100%; text-align: center; }
.cert .letterhead { width: 72%; display: block; margin: 0 auto; }
.cert .credit { font-size: 0.85cqw; color: #8a83a8; margin-top: 0.3cqw; }
.cert .ttl { font-size: 3.1cqw; } .cert .medal { font-size: 3cqw; }
.cert .line { font-size: 1.35cqw; line-height: 1.8; } .cert .stu-name { font-size: 2.6cqw; }
@media print {
  .cert .credit { font-size: 9pt; margin-top: 2pt; }
  .cert .ttl { font-size: 34pt; } .cert .medal { font-size: 32pt; }
  .cert .line { font-size: 15pt; } .cert .stu-name { font-size: 28pt; }
}

/* ===================== حُرّاس أبوصيبع — الإضافات ===================== */
body { background: radial-gradient(circle at 10% 0%, #e7defd 0, transparent 35%), radial-gradient(circle at 100% 100%, #d7f3ff 0, transparent 40%), var(--bg); }
.btn.big { font-size: 22px; padding: 14px 34px; border-radius: 18px; }
.art { width: 100%; height: 100%; display: block; overflow: visible; }
.face { width: 72px; height: 72px; flex: none; }
/* حركات الشخصيات */
@keyframes bob { 50% { transform: translateY(-6px); } }
@keyframes blinkA { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.art .eyes { transform-box: fill-box; transform-origin: center; animation: blinkA 4s infinite; }
.art .blink { animation: blinkA 1.4s infinite; transform-box: fill-box; transform-origin: center; }
.art .float { animation: bob 3s ease-in-out infinite; }
.art .tail { transform-box: fill-box; transform-origin: 0 100%; animation: wag 1.6s ease-in-out infinite; }
@keyframes wag { 50% { transform: rotate(-8deg); } }

/* شاشة الدخول */
.hero { position: relative; width: min(900px, 94vw); margin: 0 auto; aspect-ratio: 3 / 1; }
.app-cover { position: absolute; inset: 0; }
.app-cover > .art { position: absolute; inset: 0; border-radius: 28px; box-shadow: 0 18px 40px rgba(60, 30, 160, .25); }
.ac-guide { position: absolute; left: 4%; bottom: 6%; width: 24%; height: 72%; animation: bob 3s ease-in-out infinite; }
.ac-salman { position: absolute; left: 24%; bottom: 4%; width: 17%; height: 52%; }
.ac-cat { position: absolute; right: 4%; bottom: 4%; width: 16%; height: 48%; }
.hero-title { position: absolute; right: 6%; top: 18%; width: 52%; text-align: center; color: #fff; text-shadow: 0 3px 12px rgba(20, 0, 80, .45); }
.hero-title h1 { margin: 0; font-size: clamp(28px, 4.6vw, 50px); font-weight: 900; line-height: 1.25; }
.hero-title p { margin: 4px 0 0; font-size: clamp(14px, 1.8vw, 20px); opacity: .95; letter-spacing: 1px; }
.tagline { font-size: 20px; font-weight: 700; color: var(--brand); margin: 18px 0 6px; }
.credit-line { color: var(--muted); font-size: 14px; margin-top: 18px; }

/* أغلفة المراحل */
.stage-cover { position: relative; aspect-ratio: 760 / 260; overflow: hidden; }
.cover { position: absolute; inset: 0; }
.cover > .art { position: absolute; inset: 0; }
.cv-guide { position: absolute; right: 3%; bottom: 5%; width: 22%; height: 66%; animation: bob 3s ease-in-out infinite; }
.cv-villain { position: absolute; left: 3%; bottom: 5%; width: 24%; height: 70%; animation: bob 3.4s ease-in-out infinite reverse; }
.cv-villain.beaten { filter: grayscale(.2); animation: none; transform: rotate(-8deg); }
.cv-villain .stamp { position: absolute; top: 34%; left: 6%; transform: rotate(-14deg); border: 4px solid #1f9d55; color: #1f9d55; background: rgba(255, 255, 255, .92); font-weight: 900; font-size: clamp(14px, 2vw, 22px); padding: 2px 12px; border-radius: 10px; }
.sc-text { position: absolute; inset: auto 28% 6% 28%; text-align: center; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.sc-text h2 { margin: 0; font-size: clamp(18px, 2.4vw, 26px); }
.sc-text p { margin: 2px 0 6px; font-size: 14px; }
.sc-text .en { font-size: 13px; opacity: .9; direction: ltr; }
.sc-text .stage-prog { background: rgba(255, 255, 255, .35); }
.sc-lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; background: rgba(30, 20, 60, .45); }
.stage { border: 3px solid color-mix(in srgb, var(--sc) 35%, white); }
.final-banner { display: flex; align-items: center; gap: 16px; background: linear-gradient(135deg, #fff6d6, #ffe08a); border: 3px solid #ffc83d; border-radius: 22px; padding: 14px 20px; margin-bottom: 22px; font-size: 18px; }
.final-banner > div:nth-child(2) { flex: 1; }
.final-banner .face { width: 80px; height: 80px; }

/* عقد المسار */
.node.n-boss .dot { width: 96px; height: 96px; background: #fff; border-color: var(--sc); box-shadow: 0 6px 0 var(--sc); }
.boss-face { width: 78px; height: 78px; }
.node.n-boss.locked .dot { filter: grayscale(1) brightness(.6); }
.node .ko { position: absolute; top: -6px; right: -6px; background: var(--ok); color: #fff; border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-size: 16px; border: 3px solid #fff; }
.node.n-mission .dot { border-radius: 22px; }

/* شخصية تتكلم */
.speaker { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.speaker .face { width: 84px; height: 84px; }
.bubble { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; font-size: 19px; line-height: 1.8; box-shadow: 0 4px 0 var(--line); flex: 1; }
.bubble::before { content: ''; position: absolute; top: 22px; right: -11px; border: 10px solid transparent; border-left-color: var(--line); }
.bubble.big { font-size: 22px; max-width: 640px; margin: 10px auto; }
.s-name { font-size: 13px; color: var(--brand); font-weight: 900; }
.story { display: flex; flex-direction: column; gap: 12px; }
.s-row { display: flex; gap: 12px; align-items: flex-start; animation: rise .4s ease both; }
.s-row.rev { flex-direction: row-reverse; }
.s-row.rev .bubble { background: #fff8e6; border-color: #ffe0a3; box-shadow: 0 4px 0 #ffe0a3; }
.s-row .face { width: 76px; height: 76px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.intro-art { width: 140px; height: 140px; margin: 0 auto 6px; animation: bob 3s ease-in-out infinite; }
.intro-art .face { width: 140px; height: 140px; }
.joke-box { display: flex; gap: 12px; align-items: center; background: #fff8e6; border: 2px dashed #ffc83d; border-radius: 16px; padding: 10px 14px; margin-top: 14px; font-size: 18px; }
.joke-box .face { width: 58px; height: 58px; }
.fb small.joke { color: #8a5a00; }
.m-face { width: 120px; height: 120px; margin: 0 auto; }
.m-face .face { width: 120px; height: 120px; }
.sentence { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 18px; font-size: 21px; line-height: 2.4; margin-bottom: 8px; }
.sentence .blank { background: #efe9ff; color: var(--brand); border-bottom: 3px solid var(--brand2); min-width: 90px; }
.sentence .blank.filled { background: #e3dcff; }
.blank.typed input { color: var(--brand); font-family: 'Cairo'; font-weight: 700; }
.oline { font-family: 'Cairo'; white-space: normal; }
.oline .num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; margin-left: 8px; font-size: 15px; }
.opts.two { grid-template-columns: 1fr 1fr; }

/* مصطلح إنجليزي ينطق */
.term { display: inline-flex; align-items: center; gap: 4px; background: linear-gradient(135deg, #ffe7a3, #ffd060); color: #5a3a00; border: 2px solid #f0b400; border-radius: 999px; padding: 0 10px; font-weight: 700; font-size: .92em; vertical-align: baseline; box-shadow: 0 3px 0 #d79a00; cursor: pointer; line-height: 1.6; margin: 0 2px; }
.term:hover { filter: brightness(1.05); transform: translateY(-1px); }
.term.nudge { animation: nudge 1.6s ease-in-out infinite; }
.term.heard { background: linear-gradient(135deg, #e3f8ec, #bff0d4); border-color: #46a758; color: #155c2e; box-shadow: 0 3px 0 #2f8a46; }
@keyframes nudge { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(1.12) rotate(-3deg); } 90% { transform: scale(1.08) rotate(3deg); } }
.say-hint { display: flex; align-items: center; gap: 10px; background: #fff8e6; border: 2px solid #ffd060; border-radius: 16px; padding: 6px 12px; margin-bottom: 12px; font-size: 17px; animation: rise .4s ease both; }
.say-hint .sh-face { width: 52px; height: 52px; }
.dict { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.dterm { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }

/* الفرز */
.sort-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: center; margin: 10px 0; }
.bin { min-height: 170px; border-radius: 22px; font-size: 22px; font-weight: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; box-shadow: 0 6px 0 rgba(0, 0, 0, .15); transition: transform .1s; }
.bin span { font-size: 46px; }
.bin em { font-style: normal; font-size: 15px; background: rgba(255, 255, 255, .6); padding: 0 10px; border-radius: 99px; }
.bin.b0 { background: #e3f8ec; color: #155c2e; border: 3px solid #46a758; }
.bin.b1 { background: #fde8e8; color: #9b1c1c; border: 3px solid #e5484d; }
.bin:active { transform: scale(.96); }
.deck { min-height: 190px; display: grid; place-items: center; }
.scard { background: #fff; border: 3px solid var(--brand2); border-radius: 22px; padding: 22px 18px; font-size: 21px; font-weight: 700; text-align: center; width: 100%; box-shadow: 0 10px 24px rgba(80, 40, 200, .18); line-height: 1.7; }
.sc-ic { font-size: 48px; }
.deck-done { font-size: 80px; }
.pop-in { animation: popIn .25s ease both; }
@keyframes popIn { from { transform: scale(.8); opacity: 0; } }
.fly-l { animation: flyL .26s ease-in forwards; } .fly-r { animation: flyR .26s ease-in forwards; }
@keyframes flyL { to { transform: translateX(260px) rotate(14deg) scale(.6); opacity: 0; } }
@keyframes flyR { to { transform: translateX(-260px) rotate(-14deg) scale(.6); opacity: 0; } }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.sort-left { text-align: center; }
.timer { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; color: #b12a2e; margin-bottom: 6px; }
.t-bar { flex: 1; height: 14px; background: #fde8e8; border-radius: 99px; overflow: hidden; }
.t-bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #e5484d, #ffb300); transition: width 1s linear; }
.warn { color: #b12a2e; font-weight: 700; }

/* مقياس كلمة السر */
.meter-box { background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.m-warn { background: #fff3e0; border-radius: 12px; padding: 6px 12px; color: #8a4b00; }
.field.pw { font-size: 26px; text-align: center; font-family: Consolas, monospace; letter-spacing: 1px; }
.m-bar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.m-bar i { height: 16px; border-radius: 99px; background: #e9e4f7; transition: background .2s; }
.m-row { display: flex; justify-content: space-between; align-items: center; font-size: 20px; flex-wrap: wrap; gap: 8px; }
.fox-est { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.fox-est .face { width: 54px; height: 54px; }
.m-tips { margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 16px; line-height: 1.9; }

/* محاكي الرسائل والمنشورات */
.hs-wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.mock { background: #fff; border: 2px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: 0 8px 22px rgba(30, 20, 80, .1); font-size: 18px; line-height: 1.9; }
.mock .m-top { background: #2b2152; color: #fff; padding: 8px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.mock .m-top .face { width: 34px; height: 34px; background: #fff; border-radius: 50%; }
.mock .m-head { padding: 10px 14px; border-bottom: 1px solid var(--line); background: #faf8ff; }
.mock .m-body { padding: 14px; }
.mock.phone { max-width: 420px; margin: 0 auto; border-radius: 28px; border-width: 8px; border-color: #2b2152; }
.mock .m-from { padding: 8px 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.mock .sms { margin: 14px; background: #eef1f6; border-radius: 18px 18px 18px 4px; padding: 12px 14px; }
.mock .p-pic { font-size: 90px; text-align: center; background: linear-gradient(135deg, #d7f3ff, #fde8f3); padding: 10px; line-height: 1.2; }
.hs { cursor: pointer; border-radius: 6px; padding: 0 3px; border-bottom: 2px dashed #b5a8e6; transition: background .15s; }
.hs:hover { background: #f3efff; }
.hs.got { background: #fde8e8; border-bottom: 3px solid #e5484d; color: #9b1c1c; font-weight: 700; }
.hs.got::after { content: ' 🚩'; }
.hs.nope { animation: shake .35s; background: #eee; }
.hs-side { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px; }
.found { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.hs-list { list-style: none; padding: 0; margin: 0; font-size: 16px; line-height: 1.8; }
.hs-list li { background: #fff4f4; border-radius: 10px; padding: 4px 10px; margin-bottom: 6px; animation: rise .3s ease both; }
.chat { max-width: 620px; margin: 0 auto; }
.chat-log { height: 300px; overflow: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: #f6f3ff; }
.msg { max-width: 80%; padding: 8px 14px; border-radius: 16px; font-size: 18px; }
.msg.them { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 4px 16px; }
.msg.me { align-self: flex-start; background: var(--brand); color: #fff; border-radius: 16px 16px 16px 4px; }
.msg.me b { color: #fff; }
.msg.guide { align-self: center; background: #e3f8ec; color: #155c2e; font-size: 16px; max-width: 95%; }
.chat-opts { display: grid; gap: 8px; padding: 12px; }
.copt { font-size: 17px; padding: 10px 14px; }
.copt.wrong { opacity: .6; }

/* معركة الزعيم */
.boss-hud { display: flex; align-items: center; gap: 14px; padding: 6px 22px; background: linear-gradient(90deg, #2b2152, #4b2bd6); color: #fff; }
.bh-face { width: 70px; height: 70px; position: relative; }
.bh-face.hurt { animation: hurt .5s; }
.bh-face.laugh { animation: laughA .6s; }
@keyframes hurt { 20% { transform: translateX(-8px) rotate(-8deg); filter: brightness(2) saturate(0); } 50% { transform: translateX(8px) rotate(6deg); } }
@keyframes laughA { 30% { transform: translateY(-10px) scale(1.1); } 60% { transform: translateY(0) scale(1); } 80% { transform: translateY(-5px); } }
.boom { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 26px; font-weight: 900; color: #ffd34d; text-shadow: 0 2px 0 #b12a2e; animation: boomA .7s ease-out forwards; white-space: nowrap; }
@keyframes boomA { from { transform: translate(-50%, 0) scale(.5); opacity: 1; } to { transform: translate(-50%, -30px) scale(1.4); opacity: 0; } }
.bh-mid { flex: 1; }
.bh-name { font-weight: 900; font-size: 17px; }
.bh-bar { height: 16px; background: rgba(255, 255, 255, .25); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bh-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ff5d73, #ffb300); transition: width .5s; }
.boss-hud .hearts { font-size: 24px; }
.boss-intro { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--sc) 40%, white), var(--sc)); padding: 24px; text-align: center; }
.bi-villain { width: 230px; height: 230px; position: relative; animation: bob 2s ease-in-out infinite; }
.bi-villain.defeated { animation: defeatA 2s ease-in forwards; }
@keyframes defeatA { 0% { transform: rotate(0); } 30% { transform: rotate(-20deg) scale(1.05); } 100% { transform: rotate(720deg) scale(0); opacity: 0; } }
.poof { position: absolute; inset: 0; display: grid; place-items: center; font-size: 120px; opacity: 0; animation: poofA 2s forwards; }
@keyframes poofA { 70% { opacity: 0; } 80% { opacity: 1; transform: scale(1.4); } 100% { opacity: 0; transform: scale(2); } }
.bi-vs { font-size: 34px; font-weight: 900; color: #fff; text-shadow: 0 3px 10px rgba(0, 0, 0, .35); }
.bi-rules { color: #fff; font-size: 18px; font-weight: 700; }
.badge-toast { position: fixed; bottom: 110px; left: 24px; z-index: 80; display: flex; gap: 12px; align-items: center; background: #fff; border: 3px solid #ffc83d; border-radius: 18px; padding: 10px 18px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: rise .4s ease both; font-size: 17px; }
.badge-toast .bi { font-size: 40px; }
.bdg .vi { width: 70px; height: 70px; margin: 0 auto; }
.welcome { text-align: right; display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.welcome .w-row { display: flex; gap: 12px; align-items: center; }
.welcome .w-row.rev { flex-direction: row-reverse; }
.welcome .face { width: 96px; height: 96px; }
.welcome .btn { align-self: center; }
.cert-guide { position: absolute; left: 7%; top: 30%; width: 11%; opacity: .9; }
.again { margin-bottom: 14px; }
.boss-intro .bubble { flex: none; }
.mock .m-top b { color: #fff; }
#certView { z-index: 70; }

/* اسم المطوّر وحساب إنستغرام في الواجهة الرئيسية */
.dev-credit { margin-top: 22px; font-size: 15px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.dev-credit .ig { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 700; text-decoration: none; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--line); background: #fff; }
.dev-credit .ig:hover { border-color: #c4b5fd; }
.dev-credit .ig img { width: 22px; height: 22px; display: block; }
/* زر مشاركة Teams */
.btn.teams { background: #5b5fc7; box-shadow: 0 4px 0 #3d3f99; }
/* لوحة المعلم: الدروس والأسئلة */
.lh-prev { max-width: 100%; max-height: 120px; display: block; border: 2px solid var(--line); border-radius: 12px; padding: 6px; background: #fff; margin-bottom: 10px; }
.ls-list { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow: auto; padding: 2px; }
.ls-item { border: 2px solid var(--line); border-radius: 14px; padding: 10px 14px; background: #fff; }
.ls-item.open { border-color: #c4b5fd; }
.ls-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.ls-cards { margin: 10px 0 8px; padding: 0 22px 0 0; display: flex; flex-direction: column; gap: 6px; }
.ls-cards li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.ls-sum { flex: 1; min-width: 200px; }
.ls-act { display: flex; gap: 6px; }
.pill.sm { padding: 1px 10px; font-size: 13px; }
.pill.sm.ed { background: #efe9ff; border-color: #c4b5fd; color: #4b23c9; }
.editor-form { display: flex; flex-direction: column; gap: 10px; text-align: right; }
.editor-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.opt-row .field { flex: 1; }
.opt-row .chk { flex-direction: row !important; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }

/* الاسم بثلاث خانات + معاينة الشهادة قبل قفل الاسم */
.name-part { flex: 1 1 120px; min-width: 110px; }
.name-row { flex-wrap: wrap; }
.iconbtn.sm { font-size: 15px; padding: 2px 6px; vertical-align: middle; }
.cert-sample { position: relative; max-width: 480px; margin: 0 auto; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; pointer-events: none; }
.sample-mark { position: absolute; inset: 0; display: grid; place-items: center; font-size: 64px; font-weight: 900; color: rgba(108, 60, 240, .12); transform: rotate(-18deg); }
.warn-box { background: #fff3e0; border: 2px solid #ffcc80; border-radius: 12px; padding: 8px 12px; margin: 8px 0; font-weight: 700; }

/* ===== الهاتف والآيباد ===== */
@media (max-width: 700px) {
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .topbar::after { content: ''; flex-basis: 100%; order: 1; height: 0; }
  .topbar .who { flex: 1 1 0; min-width: 0; }
  .topbar .who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 34px); display: inline-block; vertical-align: middle; }
  .topbar .spacer { display: none; }
  .topbar .pill, .topbar .btn.sm { order: 2; font-size: 14px; padding: 4px 10px; }
  .topbar .iconbtn { padding: 4px 6px; font-size: 20px; }
  .name-part { flex: 1 1 0; min-width: 0; }
}
@media (max-width: 700px) {
  .p-body { padding: 12px 12px 24px; }
  .card .txt { font-size: 18px; }
  .card .q { font-size: 19px; }
  .card .txt, .card .q, .card .lead, .opt, .tokens, .bubble { overflow-wrap: anywhere; }
  .opt { font-size: 17px; padding: 12px 14px; }
}
@media (max-width: 700px) {
  .modal-bg { padding: 12px; }
  .modal { padding: 18px; border-radius: 20px; }
}
@media (max-width: 700px) {
  .sort-wrap { gap: 8px; }
  .bin { font-size: 16px; min-height: 140px; padding: 6px 4px; overflow-wrap: anywhere; text-align: center; }
  .bin span { font-size: 32px; }
}
@media (max-width: 700px) {
  .hs-wrap { grid-template-columns: minmax(0, 1fr); }
  .hs-side { order: -1; padding: 8px 12px; }
  .mock { font-size: 16px; }
  .scard { padding: 14px 8px; font-size: 16px; overflow-wrap: anywhere; min-width: 0; }
  .scard code { white-space: normal; word-break: break-all; font-size: .85em; }
  .deck { min-height: 150px; min-width: 0; }
}
