/* شاشة الجلسة المرئية — معهد تجسير
   الخط: Tajawal — نفس خط الموقع (resources/css/app.css: --font-tajawal) */
:root {
  --navy: #0b2b45;
  --navy-2: #133c5e;
  --gold: #c9a227;
  --line: rgba(255, 255, 255, .12);
  --ok: #16a34a;
  --danger: #dc2626;
  --muted: #94a3b8;
  --font: "Tajawal", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

/* ⚠️ إلزامي: أصناف مثل .gate{display:grid} تتغلّب على خاصية hidden فتبقى
   الطبقة تحجب النقر وهي «مخفية». هذه القاعدة تحسم الأمر لكل العناصر. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: radial-gradient(1200px 800px at 70% -10%, var(--navy-2), var(--navy) 55%, #071c2e);
  color: #e8eef6;
  font-family: var(--font);
  font-weight: 400;
  overflow: hidden;
}

/* كل عناصر الواجهة ترث خط الموقع (الافتراضي في المتصفحات خط النظام) */
button, input, textarea, select, a { font-family: inherit; }
button { cursor: pointer; }

/* ————— الأيقونات (SVG خطّي) ————— */
.ico, .ctl__ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.ctl__ico { width: 21px; height: 21px; }
.ico--sm { width: 15px; height: 15px; stroke-width: 2; }

/* ————— بوابة الدخول ————— */
.gate {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: radial-gradient(900px 600px at 50% 0%, var(--navy-2), #061a2b 70%);
}
.gate__box {
  width: min(92vw, 460px); text-align: center;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
  border-radius: 20px; padding: 32px 26px;
  backdrop-filter: blur(8px);
}
/* شعار المعهد: صورة من إعدادات الموقع، والنص بديل إن غابت أو فشل تحميلها.
 * ⚠️ شعار الموقع كحليّ على خلفية شفافة (مصمَّم لهيدر فاتح) فيذوب على الداكن،
 * لذا يُعرَض على لوحة بيضاء بدل إعادة تلوين علامة العميل. */
.gate__logo { font-size: 26px; font-weight: 800; color: var(--gold); letter-spacing: .5px; }
.gate__logoImg {
  box-sizing: border-box;
  max-width: 190px; max-height: 108px; width: auto; height: auto;
  object-fit: contain; display: block; margin: 0 auto 4px;
  background: #fff; border-radius: 16px; padding: 12px 18px;
  box-shadow: 0 10px 26px rgba(2, 12, 22, .38);
}
.gate__msg { margin: 14px 0 18px; color: #cfe0f0; line-height: 1.9; font-size: 15px; }
.gate__hint { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.gate__spin {
  width: 34px; height: 34px; margin: 0 auto;
  border: 3px solid rgba(255, 255, 255, .18); border-top-color: var(--gold);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gate__preview {
  width: 100%; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden;
  background: #04121e; border: 1px solid var(--line); margin-bottom: 14px;
}
.gate__preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.gate__name { font-weight: 700; margin-bottom: 14px; font-size: 15px; }

/* ————— الإطار العام —————
 * ⚠️ عدد الصفوف يجب أن يطابق أبناء .app بالترتيب:
 *   topbar (auto) · barrow شريط الأدوات (auto) · stage المسرح (1fr) · controls (auto)
 * كان الشريط يأخذ الـ1fr فيتضخّم ويُجبر المسرح على التمرير لرؤية الفيديو.
 */
.app { height: 100%; display: grid; grid-template-rows: auto auto 1fr auto; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--line);
  background: rgba(4, 18, 30, .6);
}
.topbar__info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar__info strong { font-weight: 700; font-size: 15px; }
.topbar__right { display: flex; align-items: center; gap: 8px; }
.topbar__timer { color: var(--muted); font-size: 13px; font-weight: 500; }
.topbar__count {
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 11px;
  font-size: 13px; font-weight: 700;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot--live { background: var(--danger); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: rgba(201, 162, 39, .16); color: var(--gold); border: 1px solid rgba(201, 162, 39, .35);
}
.badge--admin { background: rgba(59, 130, 246, .16); color: #93c5fd; border-color: rgba(59, 130, 246, .4); }
.badge--student { background: rgba(255, 255, 255, .08); color: #cbd5e1; border-color: var(--line); }

/* ————— المسرح ————— */
.stage { display: flex; min-height: 0; overflow: hidden; }

/*
 * شبكة الفيديو: تملأ المساحة المتاحة **بلا تمرير**.
 * الصفوف `1fr` والخلايا تتقلّص (min-height:0)، والفيديو داخلها يُحجَّم بـcontain
 * فيظهر كاملاً — عند مشارك واحد يشغل كل المساحة بلا سكرول.
 */
.grid {
  flex: 1 1 auto; min-width: 0; min-height: 0; padding: 12px;
  display: grid; gap: 10px;
  grid-template-columns: 1fr; grid-auto-rows: 1fr;
  align-content: stretch; justify-content: stretch;
  overflow: hidden;
}
/* أكثر من 12 بلاطة: نسمح بالتمرير مع إبقاء حجم معقول */
.grid[data-many="1"] { grid-auto-rows: minmax(150px, 1fr); overflow-y: auto; }

.tile {
  position: relative; border-radius: 16px; overflow: hidden;
  background: #04121e; border: 1px solid var(--line);
  min-width: 0; min-height: 0; display: grid; place-items: center;
}
.tile--screen { grid-column: 1 / -1; grid-row: span 2; }
.tile__media { position: relative; width: 100%; height: 100%; display: grid; place-items: center; min-height: 0; }

/*
 * الفيديو يتوسّع لملء البلاطة مع إظهاره كاملاً (contain: لا قصّ ولا تشويه).
 * ⚠️ يُوضَع absolute لا grid item: النسبة المئوية داخل خلية شبكة بحجم «auto»
 * تعود على حجم الفيديو الأصلي (مرجع دائري) فلا يتوسّع أبداً.
 */
.tile video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain; display: block;
}

/*
 * مشارك واحد: البلاطة نفسها تأخذ نسبة 16/9 وتتمركز داخل المساحة، فيظهر الفيديو
 * كبيراً في وسط الشاشة بلا هوامش سوداء عريضة وبلا أي تمرير.
 */
.grid[data-solo="1"] { place-content: center; }
.grid[data-solo="1"] .tile {
  /* الارتفاع محدَّد من صفّ الشبكة، والعرض يُشتقّ منه بالنسبة 16/9 ثم يُقصّ بحدّ العرض */
  height: 100%; width: auto; aspect-ratio: 16 / 9; max-width: 100%; margin: auto;
}
.tile--self video { transform: scaleX(-1); }
.tile--screen video { background: #000; }
.tile__avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--line); background: #0a2136;
}
.tile__initials {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(160deg, var(--navy-2), #0a2136);
  border: 2px solid rgba(201, 162, 39, .4); color: var(--gold);
  font-size: 32px; font-weight: 800;
}
.tile__label {
  position: absolute; inset-inline-start: 10px; inset-block-end: 10px;
  display: flex; align-items: center; gap: 7px;
  background: rgba(4, 18, 30, .72); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px; font-size: 12.5px; max-width: calc(100% - 20px);
}
.tile__label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile__mic { display: inline-flex; color: var(--danger); }
.tile__mic .ico { width: 14px; height: 14px; }
.tile__acts {
  position: absolute; inset-inline-end: 8px; inset-block-start: 8px;
  display: flex; gap: 6px; opacity: 0; transition: opacity .15s;
}
.tile:hover .tile__acts, .tile:focus-within .tile__acts { opacity: 1; }
.tile__act {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: rgba(4, 18, 30, .82);
  color: #e8eef6; border-radius: 9px; padding: 5px 9px; font-size: 11.5px; font-weight: 500;
}
/* الأحمر للإجراء الهدّام وحده (الطرد)؛ الباقي إبراز محايد */
.tile__act:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); }

/* ————— اللوحة الجانبية ————— */
.side {
  width: 340px; flex: 0 0 340px; display: flex; flex-direction: column;
  border-inline-start: 1px solid var(--line); background: rgba(4, 18, 30, .55);
}
.side__tabs { display: flex; border-bottom: 1px solid var(--line); }
.side__tab {
  flex: 1; padding: 13px 8px; background: none; border: 0; color: var(--muted);
  font-size: 13.5px; font-weight: 500; border-bottom: 2px solid transparent;
}
.side__tab.is-active { color: #fff; font-weight: 700; border-bottom-color: var(--gold); }
.side__panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
.side__panel.is-active { display: flex; }

.chat { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.msg { background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; }
.msg--me { background: rgba(201, 162, 39, .12); border-color: rgba(201, 162, 39, .3); }
.msg--system { background: transparent; border-style: dashed; color: var(--muted); font-size: 12.5px; text-align: center; }
.msg__head { display: flex; gap: 7px; align-items: center; font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.msg__body { font-size: 14.5px; line-height: 1.8; word-break: break-word; }
.chat__form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat__form input {
  flex: 1; min-width: 0; background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 13px; color: #fff; font-size: 14.5px;
}
.chat__form input::placeholder { color: var(--muted); font-family: inherit; }
.chat__form input:focus { outline: none; border-color: var(--gold); }
.btn--send { padding: 0 14px; display: grid; place-items: center; }
.btn--send .ico { width: 19px; height: 19px; }

.people, .files { list-style: none; margin: 0; padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
/* ⚠️ بطاقة المشارك سطران: ترويسة ثم أزرار تلتفّ.
   الصفّ الواحد كان يدفع الأزرار خارج اللوحة الجانبية (شريط تمرير أفقي وقصّ). */
.person {
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 11px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px;
}
.person__hd { display: flex; align-items: center; gap: 9px; min-width: 0; flex-wrap: wrap; }
.file {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px;
}
.person__name, .file__name { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__acts { display: flex; flex-wrap: wrap; gap: 6px; }
.person .tile__act { flex: 0 0 auto; white-space: nowrap; }

/* شارة حالة إذن البثّ للطالب */
.grantTag {
  font-size: 10.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
  background: rgba(255, 255, 255, .07); color: var(--muted); border: 1px solid var(--line);
}
.grantTag.is-on { background: rgba(34, 197, 94, .16); color: #6ee7a8; border-color: rgba(34, 197, 94, .35); }

/* زرّ منح الإذن يبرز، وزرّ الطرد يحمرّ عند المرور */
.tile__act--grant { border-color: rgba(201, 162, 39, .45); color: var(--gold); }
.tile__act--grant:hover { background: var(--gold); border-color: var(--gold); color: #10233a; }
.tile__act--danger:hover { background: var(--danger); border-color: var(--danger); }

/* قفل زرّي المايك/الكاميرا حتى يأذن المدرّب */
.ctl.is-locked, .btn.is-locked { opacity: .5; position: relative; }
.ctl.is-locked::after, .btn.is-locked::after {
  content: '🔒'; position: absolute; inset-block-start: -2px; inset-inline-end: -2px; font-size: 10px;
}
.files__upload { padding: 12px; border-bottom: 1px solid var(--line); text-align: center; }
.files__hint { font-size: 12px; color: var(--muted); margin-top: 7px; }
.file__size { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.file .ico { color: var(--muted); }

/* ————— أزرار التحكّم ————— */
.controls {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px; border-top: 1px solid var(--line); background: rgba(4, 18, 30, .7);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.ctl {
  display: grid; place-items: center; gap: 4px; min-width: 82px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line);
  color: #e8eef6; border-radius: 14px; padding: 10px 12px;
  transition: background .15s, border-color .15s, transform .1s;
}
.ctl:hover { background: rgba(255, 255, 255, .13); }
.ctl:active { transform: scale(.97); }
.ctl.is-on { background: rgba(22, 163, 74, .2); border-color: rgba(22, 163, 74, .5); }
.ctl.is-off { background: rgba(220, 38, 38, .16); border-color: rgba(220, 38, 38, .4); color: #fca5a5; }
.ctl--leave:hover { background: rgba(148, 163, 184, .22); border-color: var(--muted); }
.ctl--danger { color: #fca5a5; }
.ctl--danger:hover { background: rgba(220, 38, 38, .3); border-color: var(--danger); color: #fff; }
.ctl__lbl { font-size: 11.5px; font-weight: 500; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .07);
  color: #e8eef6; border-radius: 10px; padding: 9px 14px; font-size: 13.5px; font-weight: 500;
}
.btn:hover { background: rgba(255, 255, 255, .14); }
.btn--primary { background: var(--gold); border-color: var(--gold); color: #14202e; font-weight: 700; }
.btn--primary:hover { filter: brightness(1.08); background: var(--gold); }
.btn--icon { background: transparent; }
.btn--lg { width: 100%; padding: 12px; font-size: 15px; }
.chip {
  background: var(--danger); color: #fff; border-radius: 999px;
  padding: 0 7px; font-size: 11.5px; font-weight: 700; margin-inline-start: 4px;
}

.toast {
  position: fixed; inset-block-end: 96px; inset-inline: 0; margin: auto; width: fit-content;
  max-width: 90vw; z-index: 60;
  background: rgba(4, 18, 30, .96); border: 1px solid var(--gold);
  color: #fff; border-radius: 12px; padding: 11px 18px; font-size: 14px; font-weight: 500;
}

/* ————— شريط واحد: أدوات المعلّم + تفاعل المشاركين ————— */
.barrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 14px; border-bottom: 1px solid var(--line);
  background: rgba(4, 18, 30, .5);
}
.barrow__sp { flex: 1 1 auto; }
.toolbar, .reactbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* مجموعة أدوات معنونة */
.tgroup {
  display: flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 6px; border-radius: 12px;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .07);
}
.tgroup__lbl { font-size: 10.5px; color: #7d8da0; font-weight: 500; padding-inline-end: 3px; }
.tsep { width: 1px; height: 26px; background: var(--line); }

.tbtn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  color: #e8eef6; border-radius: 10px; padding: 7px 11px; font-size: 12.5px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s;
}
.tbtn:hover { background: rgba(255, 255, 255, .13); }
.tbtn:active { transform: scale(.96); }
.tbtn--icon { padding: 7px 9px; }
.tbtn.is-on { background: rgba(201, 162, 39, .22); border-color: rgba(201, 162, 39, .5); color: #f3dfa2; }

/* لون مميّز لكل أداة (الأيقونة ملوّنة والخلفية تتلوّن عند التمرير) */
.tbtn--present  .ico { color: #60a5fa; }
.tbtn--present:hover  { background: rgba(96, 165, 250, .16); border-color: rgba(96, 165, 250, .45); }
.tbtn--board    .ico { color: #34d399; }
.tbtn--board:hover    { background: rgba(52, 211, 153, .16); border-color: rgba(52, 211, 153, .45); }
.tbtn--video    .ico { color: #c084fc; }
.tbtn--video:hover    { background: rgba(192, 132, 252, .16); border-color: rgba(192, 132, 252, .45); }
.tbtn--materials .ico { color: #2dd4bf; }
.tbtn--materials:hover { background: rgba(45, 212, 191, .16); border-color: rgba(45, 212, 191, .45); }
.tbtn--poll     .ico { color: #fbbf24; }
.tbtn--poll:hover     { background: rgba(251, 191, 36, .16); border-color: rgba(251, 191, 36, .45); }
.tbtn--lecture  .ico { color: #a5b4fc; }
.tbtn--lecture:hover  { background: rgba(165, 180, 252, .16); border-color: rgba(165, 180, 252, .45); }
.tbtn--stop     .ico { color: #f87171; }
.tbtn--stop:hover     { background: rgba(248, 113, 113, .18); border-color: rgba(248, 113, 113, .5); }
.tbtn--hand     .ico { color: var(--gold); }
.tbtn--hand:hover     { background: rgba(201, 162, 39, .18); border-color: rgba(201, 162, 39, .5); }
.tbtn--like     .ico { color: #60a5fa; }
.tbtn--clap     .ico { color: #34d399; }
.tbtn--ask      .ico { color: #fbbf24; }
.tbtn--like:hover, .tbtn--clap:hover, .tbtn--ask:hover { background: rgba(255, 255, 255, .14); }

/* الأداة النشطة تُبرَز بلونها */
.tbtn--board.is-on   { background: rgba(52, 211, 153, .22); border-color: rgba(52, 211, 153, .55); color: #baf3dd; }
.tbtn--lecture.is-on { background: rgba(165, 180, 252, .22); border-color: rgba(165, 180, 252, .55); color: #dfe3ff; }
.tbtn--present.is-on { background: rgba(96, 165, 250, .22); border-color: rgba(96, 165, 250, .55); color: #d6e8ff; }

.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .25); padding: 0; }
.swatch.is-on { border-color: #fff; transform: scale(1.12); }

/* ⚠️ اللوحات تُفتح تحت أزرارها (جهة الأدوات) لا على الحافة المقابلة:
   `inset-inline-end` في RTL = اليسار، فكانت تفتح فوق اللوحة الجانبية وتبدو معطّلة.
   وz-index أعلى من `.side` (30) حتى لا تختفي خلفها. */
.toolsPanel, .quizForm {
  position: fixed; z-index: 60; inset-inline-start: 14px; inset-block-start: 118px;
  width: min(92vw, 340px); max-height: 62vh; overflow-y: auto;
  background: rgba(6, 24, 38, .98); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.toolsPanel__hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-weight: 700; font-size: 14px; margin-bottom: 10px; color: var(--gold);
}
.panelClose {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: #e8eef6;
  border-radius: 8px; width: 26px; height: 26px; line-height: 1; font-size: 15px; cursor: pointer;
}
.panelClose:hover { background: rgba(255, 255, 255, .14); }
.quizForm { display: flex; flex-direction: column; gap: 8px; }
.quizForm input, .quizForm select {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 9px; padding: 9px 11px; color: #fff; font-size: 13.5px;
}
.quizForm input::placeholder { color: var(--muted); }
#quizChoices { display: flex; flex-direction: column; gap: 6px; }

/* ————— مسرح الوسيلة ————— */
.toolStage {
  flex: 1 1 62%; min-width: 0; display: flex; flex-direction: column;
  border-inline-end: 1px solid var(--line); position: relative; min-height: 0;
}
.toolStage__hd {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.toolStage__sp { flex: 1 1 auto; }
.toolStage__body {
  position: relative; flex: 1; min-height: 0; margin: 10px 14px 0;
  background: #061826; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  display: grid; place-items: center;
}
#pageImage { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
#drawCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.videoBox { width: 100%; height: 100%; display: grid; place-items: center; background: #000; }
.videoBox video { width: 100%; height: 100%; object-fit: contain; }
#ytBox, #ytPlayer, #ytBox iframe { width: 100%; height: 100%; border: 0; }
.drawTools {
  display: flex; align-items: center; gap: 7px; padding: 9px 14px; flex-wrap: wrap;
}
.toolBusy {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; gap: 10px;
  background: rgba(4, 18, 30, .8); font-size: 14px;
}
.toolBusy .gate__spin { width: 28px; height: 28px; }

/* شبكة الفيديو تتقلّص جانباً عند وجود وسيلة معروضة */
.grid.is-side { flex: 0 0 300px; grid-template-columns: 1fr; grid-auto-rows: minmax(0, 170px); align-content: start; overflow-y: auto; }


/* ————— الاستطلاع ————— */
.quizBox {
  margin: 10px 14px 12px; padding: 12px; border-radius: 12px;
  background: rgba(201, 162, 39, .08); border: 1px solid rgba(201, 162, 39, .28);
  display: flex; flex-direction: column; gap: 9px;
}
.quiz__q { font-weight: 700; font-size: 14.5px; }
.quiz__opt { display: flex; align-items: center; gap: 9px; }
.quiz__btn { flex: 0 0 auto; min-width: 92px; }
.quiz__bar { flex: 1; height: 9px; border-radius: 999px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.quiz__fill { height: 100%; background: var(--gold); transition: width .35s; }
.quiz__fill.is-correct { background: var(--ok); }
.quiz__pct { font-size: 12px; color: var(--muted); min-width: 66px; }

.ico--flip { transform: scaleX(-1); }

/* شارة رفع اليد على البلاطة */
.tile__hand { display: inline-flex; color: var(--gold); }
.tile__hand .ico { width: 14px; height: 14px; }

@media (max-width: 1000px) {
  .toolStage { flex: 1 1 100%; border-inline-end: 0; }
  .grid.is-side { flex: 0 0 auto; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); max-height: 180px; }
}

@media (max-width: 860px) {
  .stage { flex-direction: column; }
  .side { width: auto; flex: 1 1 auto; border-inline-start: 0; border-top: 1px solid var(--line); }
  .grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); padding: 10px; }
  .ctl { min-width: 64px; padding: 9px 8px; }
  .ctl__lbl { font-size: 10.5px; }
  .topbar__right .btn--icon span { display: none; }
}

/* ————— التفاعلات الطائرة (نمط جوجل ميت) —————
 * طبقة فوق كل شيء، لا تلتقط النقر، والأيقونة تصعد وتتلاشى ثم تُزال من الـDOM.
 */
.reactLayer {
  position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden;
}
.reactFly {
  position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: reactRise 2.6s ease-out forwards;
}
.reactFly .ico { width: 34px; height: 34px; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .5)); }
.reactFly__who {
  font-size: 11px; font-weight: 700; color: #e8eef6; white-space: nowrap;
  background: rgba(6, 24, 38, .8); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}
@keyframes reactRise {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  12%  { transform: translateY(-14px) scale(1.12); opacity: 1; }
  70%  { transform: translateY(-160px) scale(1); opacity: 1; }
  100% { transform: translateY(-260px) scale(.9); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .reactFly { animation-duration: 1.2s; }
}

/* ألوان التفاعلات (كل تفاعل بلونه كما طلب المالك) */
.tbtn--clap  .ico { color: #fbbf24; }
.tbtn--heart .ico { color: #fb7185; }
.tbtn--laugh .ico { color: #facc15; }
.tbtn--like  .ico { color: #38bdf8; }
.tbtn--ask   .ico { color: #a78bfa; }
.tbtn--react .ico { color: #34d399; }
.react--clap  { color: #fbbf24; }
.react--heart { color: #fb7185; }
.react--laugh { color: #facc15; }
.react--like  { color: #38bdf8; }
.react--question { color: #a78bfa; }
.react--hand  { color: #f59e0b; }

/* التفاعلات معطّلة: الأزرار تبقى مرئية لكن مقفلة بسبب واضح */
.reactbar.is-off .tbtn--icon { opacity: .4; }
