/**
 * Eduplayify Template: image_labeling (التوصيل على صورة)
 * تصميم تفاعلي فخم مستوحى من منصات التعليم العالمية
 * صورة مركزية كبيرة مضبوطة الأبعاد بدون أي إزاحة للنقاط، ونقاط هدف دقيقة بدون أرقام،
 * مع طبقات z-index صحيحة لظهور خطوط السحب والتوصيل بانسيابية تامة
 */

/* الحاوية الأساسية للعبة */
.il-player-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: clamp(6px, 1.5vw, 16px);
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    position: relative;
}

/* بطاقة العنوان والتعليمات - مرفوعة وبارزة دائماً في أعلى طبقة بصرية */
.il-header-card {
    position: relative !important;
    z-index: 50 !important;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    -webkit-border-radius: 14px;
    padding: clamp(8px, 1.4vh, 12px) clamp(14px, 2vw, 22px);
    margin-bottom: clamp(10px, 1.8vh, 18px);
    text-align: center;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    -webkit-box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    flex: 0 0 auto !important;
    width: 100%;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.il-title {
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 900;
    color: #1e1b4b;
    margin: 0 0 4px 0;
    line-height: 1.35;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.il-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.il-subtitle {
    font-size: clamp(0.82rem, 1.25vw, 0.95rem);
    color: #64748b;
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

/* مسرح اللعبة التفاعلي (3 أعمدة: عمود أيسر - صورة مركزية - عمود أيمن) */
.il-play-stage {
    position: relative;
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    flex-direction: row;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -webkit-flex-direction: row;
    -ms-flex-direction: row;
    direction: ltr !important;
    align-items: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    justify-content: space-between;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -ms-flex-pack: justify;
    gap: clamp(14px, 2.5vw, 30px);
    width: 100%;
    min-height: 400px;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

/* في البيئات العربية: الحفاظ على الترتيب الفيزيائي للأعمدة (يسار - صورة - يمين) */
[dir="rtl"] .il-play-stage,
html[dir="rtl"] .il-play-stage,
body[dir="rtl"] .il-play-stage {
    direction: ltr !important;
}

/* طبقة خطوط التوصيل SVG - تعلو إطار الصورة وتمر تحته البطاقات والنقاط بدون اعتراض أي أحداث */
.il-lines-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: 20 !important;
    overflow: visible;
}

.il-lines-svg,
.il-lines-svg * {
    pointer-events: none !important;
}

/* خطوط التوصيل */
.il-line-dragging {
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 8 5;
    animation: ilDashAnim 0.85s linear infinite;
}

@keyframes ilDashAnim {
    from {
        stroke-dashoffset: 26;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.il-drag-tip-halo {
    pointer-events: none;
    animation: ilHaloPulse 0.9s ease-in-out infinite alternate;
}

@keyframes ilHaloPulse {
    from {
        transform-origin: center;
        opacity: 0.25;
    }
    to {
        transform-origin: center;
        opacity: 0.55;
    }
}

.il-drag-tip-circle {
    pointer-events: none;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
}

body.il-is-dragging-active,
#gamePlayArea.il-is-dragging-active,
.gpa-fullscreen.il-is-dragging-active {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    cursor: grabbing !important;
}

body.il-is-dragging-active .il-card-item,
body.il-is-dragging-active .il-point,
#gamePlayArea.il-is-dragging-active .il-card-item,
#gamePlayArea.il-is-dragging-active .il-point {
    cursor: grabbing !important;
}

.il-line-pending {
    stroke-width: 3.5;
    stroke-linecap: round;
}

.il-line-correct {
    stroke: #10b981 !important;
    stroke-width: 4.5;
    stroke-linecap: round;
}

.il-line-incorrect {
    stroke: #f43f5e !important;
    stroke-width: 4;
    stroke-linecap: round;
}

/* خط خلفي أبيض للتباين الفائق فوق أي خلفية */
.il-line-bg {
    stroke: #ffffff;
    stroke-width: 7;
    stroke-linecap: round;
    opacity: 0.92;
}

/* إطار وحاوية الصورة المركزية - بلا إطار مرئي: الصورة تأخذ كامل المساحة */
.il-frame-card {
    position: relative;
    background: transparent;
    background: none;
    border: none;
    border-radius: 0;
    -webkit-border-radius: 0;
    padding: 0;
    box-shadow: none;
    -webkit-box-shadow: none;
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    align-items: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    justify-content: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    flex: 1 1 auto; /* يتمدد لالتهام المساحة التي وفّرتها الأعمدة الضيقة فتكبر الصورة */
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    text-align: center;
    margin: 0 auto;
}

/* غلاف الصورة مطابق بنسبة 100% لأبعاد الصورة بدون هوامش مضللة لنقاط التحديد */
.il-image-wrapper {
    position: relative;
    display: inline-block;
    width: auto;
    height: auto;
    max-width: 100%;
    line-height: 0;
    margin: 0 auto;
}

/* تكبير الصورة لتكون واضحة وبارزة في المنتصف */
.il-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100% !important;
    max-height: 420px;
    max-height: clamp(320px, 74vh, 760px);
    border-radius: 10px;
    -webkit-border-radius: 10px;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    -webkit-box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* ========================================================
   نقاط الصورة (Target Dots): صغيرة، دقيقة، وبدون أرقام
   ======================================================== */
.il-point {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    background: #ffffff;
    border: 2px solid #111827;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 2px 6px rgba(0, 0, 0, 0.35);
    -webkit-box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.95), 0 2px 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    margin: 0 !important;
    transform: translate(-50%, -50%) !important;
    -webkit-transform: translate(-50%, -50%) !important;
    -ms-transform: translate(-50%, -50%) !important;
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out, background 0.16s ease-out, border-color 0.16s ease-out;
    -webkit-transition: -webkit-transform 0.16s ease-out, -webkit-box-shadow 0.16s ease-out, background 0.16s ease-out, border-color 0.16s ease-out;
    z-index: 35 !important;
    touch-action: none;
    -ms-touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

/* نقطة مركزية صغيرة داخل الهدف */
.il-point::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    background: #111827;
    transform: translate(-50%, -50%);
    -webkit-transform: translate(-50%, -50%);
    transition: background 0.16s ease-out;
    -webkit-transition: background 0.16s ease-out;
}

/* مساحة لمس موسعة غير مرئية لتسهيل النقر والسحب */
.il-point::before {
    content: '';
    position: absolute;
    top: -14px;
    left: -14px;
    right: -14px;
    bottom: -14px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    background: transparent;
}

.il-point:hover:not(.is-locked) {
    transform: translate(-50%, -50%) scale(1.35);
    -webkit-transform: translate(-50%, -50%) scale(1.35);
    -ms-transform: translate(-50%, -50%) scale(1.35);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.4), 0 3px 10px rgba(0, 0, 0, 0.4);
    -webkit-box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.4), 0 3px 10px rgba(0, 0, 0, 0.4);
}

/* عند توصيل النقطة */
.il-point.connected {
    background: #4f46e5;
    border-color: #ffffff;
    box-shadow: 0 0 0 3px #4f46e5, 0 3px 8px rgba(0, 0, 0, 0.3);
    -webkit-box-shadow: 0 0 0 3px #4f46e5, 0 3px 8px rgba(0, 0, 0, 0.3);
}

.il-point.connected::after {
    background: #ffffff;
}

/* عند التوصيل الصحيح */
.il-point.correct {
    background: #10b981 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px #10b981, 0 3px 8px rgba(16, 185, 129, 0.5) !important;
    -webkit-box-shadow: 0 0 0 3px #10b981, 0 3px 8px rgba(16, 185, 129, 0.5) !important;
}

.il-point.correct::after {
    background: #ffffff !important;
}

/* عند التوصيل الخاطئ */
.il-point.incorrect {
    background: #f43f5e !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 3px #f43f5e, 0 3px 8px rgba(244, 63, 94, 0.5) !important;
    -webkit-box-shadow: 0 0 0 3px #f43f5e, 0 3px 8px rgba(244, 63, 94, 0.5) !important;
}

.il-point.incorrect::after {
    background: #ffffff !important;
}

/* حالة السحب فوق النقطة */
.il-point.drop-hover {
    transform: translate(-50%, -50%) scale(1.55) !important;
    -webkit-transform: translate(-50%, -50%) scale(1.55) !important;
    -ms-transform: translate(-50%, -50%) scale(1.55) !important;
    background: #10b981 !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.5), 0 4px 14px rgba(16, 185, 129, 0.6) !important;
    -webkit-box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.5), 0 4px 14px rgba(16, 185, 129, 0.6) !important;
    z-index: 35;
}

/* حالة التحديد للنقر المباشر */
.il-point.active-select {
    transform: translate(-50%, -50%) scale(1.45) !important;
    -webkit-transform: translate(-50%, -50%) scale(1.45) !important;
    -ms-transform: translate(-50%, -50%) scale(1.45) !important;
    background: #f59e0b !important;
    border-color: #ffffff !important;
    box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.5), 0 4px 14px rgba(245, 158, 11, 0.5) !important;
    -webkit-box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.5), 0 4px 14px rgba(245, 158, 11, 0.5) !important;
    z-index: 35;
}

/* ========================================================
   أعمدة وبطاقات البيانات الجانبية الملونة
   ======================================================== */
.il-cards-col {
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    flex-direction: column;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    gap: clamp(10px, 1.8vh, 18px);
    flex: 0 1 auto;
    width: auto; /* عرض المحتوى فقط: أطول كلمة تحدد عرض العمود */
    max-width: 250px;
    min-width: 0;
    z-index: 30 !important;
}

.il-cards-col-left {
    align-items: flex-end;
    -webkit-box-align: end;
    -webkit-align-items: flex-end;
    -ms-flex-align: end;
}

.il-cards-col-right {
    align-items: flex-start;
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    -ms-flex-align: start;
}

/* بطاقة البيان الفردية الملونة */
.il-card-item {
    position: relative;
    width: auto; /* ينكمش لعرض النص (أطول كلمة) بدل العرض الثابت العريض */
    padding: clamp(9px, 1.5vh, 14px) clamp(12px, 1.6vw, 20px);
    border-radius: 10px;
    -webkit-border-radius: 10px;
    color: #ffffff;
    font-size: clamp(0.92rem, 1.35vw, 1.12rem);
    font-weight: 800;
    text-align: center;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
    -webkit-box-shadow: 0 3px 10px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    transition: transform 0.16s ease-out, box-shadow 0.16s ease-out, filter 0.16s ease-out;
    -webkit-transition: -webkit-transform 0.16s ease-out, -webkit-box-shadow 0.16s ease-out, filter 0.16s ease-out;
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    align-items: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    justify-content: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    gap: 8px;
    touch-action: none;
    -ms-touch-action: none;
    -webkit-tap-highlight-color: transparent;
    line-height: 1.3;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
}

.il-card-item:hover:not(.correct):not(.is-locked) {
    transform: translateY(-2px) scale(1.02);
    -webkit-transform: translateY(-2px) scale(1.02);
    -ms-transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    -webkit-box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

/* منع عناصر النص الداخلية من بدء سحب متصفح افتراضي */
.il-card-label,
.il-card-peg,
.il-card-peg-stem {
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* وتد / مقبس التوصيل (Peg Socket) البارز على جانب البطاقة نحو الصورة */
.il-card-peg {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    background: inherit;
    border: 2.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    -webkit-box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    z-index: 2;
}

/* ساق قصيرة تصل الوتد بجسم البطاقة */
.il-card-peg-stem {
    position: absolute;
    top: 50%;
    height: 4px;
    background: inherit;
    transform: translateY(-50%);
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    z-index: 1;
}

/* أوتاد العمود الأيسر تتجه يميناً نحو الصورة دائماً */
.il-cards-col-left .il-card-peg {
    right: -13px !important;
    left: auto !important;
}
.il-cards-col-left .il-card-peg-stem {
    right: -6px !important;
    left: auto !important;
    width: 8px !important;
}

/* أوتاد العمود الأيمن تتجه يساراً نحو الصورة دائماً */
.il-cards-col-right .il-card-peg {
    left: -13px !important;
    right: auto !important;
}
.il-cards-col-right .il-card-peg-stem {
    left: -6px !important;
    right: auto !important;
    width: 8px !important;
}

/* دعم اتجاه النصوص العربية بسلاسة داخل البطاقات */
[dir="rtl"] .il-card-item,
html[dir="rtl"] .il-card-item,
body[dir="rtl"] .il-card-item {
    direction: rtl;
}

/* حالات البطاقة */
.il-card-item.connected {
    box-shadow: 0 0 0 3px #4f46e5, 0 6px 16px rgba(79, 70, 229, 0.35);
    -webkit-box-shadow: 0 0 0 3px #4f46e5, 0 6px 16px rgba(79, 70, 229, 0.35);
}

.il-card-item.correct {
    background: #059669 !important;
    box-shadow: 0 0 0 3px #10b981, 0 6px 16px rgba(16, 185, 129, 0.35) !important;
    -webkit-box-shadow: 0 0 0 3px #10b981, 0 6px 16px rgba(16, 185, 129, 0.35) !important;
    cursor: default;
}

.il-card-item.incorrect {
    background: #e11d48 !important;
    box-shadow: 0 0 0 3px #f43f5e, 0 6px 16px rgba(244, 63, 94, 0.35) !important;
    -webkit-box-shadow: 0 0 0 3px #f43f5e, 0 6px 16px rgba(244, 63, 94, 0.35) !important;
}

.il-card-item.active-select {
    box-shadow: 0 0 0 4px #f59e0b, 0 8px 20px rgba(245, 158, 11, 0.45) !important;
    -webkit-box-shadow: 0 0 0 4px #f59e0b, 0 8px 20px rgba(245, 158, 11, 0.45) !important;
    transform: scale(1.05) !important;
    -webkit-transform: scale(1.05) !important;
    -ms-transform: scale(1.05) !important;
}

.il-card-item.drop-hover {
    box-shadow: 0 0 0 4px #10b981, 0 8px 20px rgba(16, 185, 129, 0.45) !important;
    -webkit-box-shadow: 0 0 0 4px #10b981, 0 8px 20px rgba(16, 185, 129, 0.45) !important;
    transform: scale(1.05) !important;
    -webkit-transform: scale(1.05) !important;
    -ms-transform: scale(1.05) !important;
}

/* شريط الإجراءات والتحقق */
.il-actions-bar {
    display: flex;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    align-items: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    justify-content: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    gap: 14px;
    margin-top: clamp(14px, 2.2vh, 22px);
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    z-index: 20;
}

.il-check-btn {
    min-width: 190px;
    padding: clamp(11px, 1.7vh, 15px) clamp(28px, 3.2vw, 40px);
    font-size: clamp(1.05rem, 1.6vw, 1.25rem);
    font-weight: 800;
    border-radius: 9999px;
    -webkit-border-radius: 9999px;
    background: #4338ca;
    background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    background: -webkit-linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    -webkit-box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    cursor: pointer;
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
    -webkit-transition: -webkit-transform 0.18s ease-out, -webkit-box-shadow 0.18s ease-out;
}

.il-check-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(79, 70, 229, 0.48);
    -webkit-box-shadow: 0 6px 22px rgba(79, 70, 229, 0.48);
}

.il-check-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    -webkit-box-shadow: none;
}

.il-retry-btn {
    padding: clamp(10px, 1.6vh, 14px) clamp(22px, 2.6vw, 30px);
    font-size: clamp(0.96rem, 1.5vw, 1.15rem);
    font-weight: 800;
    border-radius: 9999px;
    -webkit-border-radius: 9999px;
    background: #f8fafc;
    color: #334155;
    border: 2px solid #cbd5e1;
    cursor: pointer;
    transition: background 0.16s ease-out, border-color 0.16s ease-out;
    -webkit-transition: background 0.16s ease-out, border-color 0.16s ease-out;
}

.il-retry-btn:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
}

/* شريط التغذية الراجعة */
.il-feedback-banner {
    margin-top: 14px;
    padding: 11px 20px;
    border-radius: 12px;
    -webkit-border-radius: 12px;
    text-align: center;
    font-weight: 800;
    font-size: clamp(0.95rem, 1.5vw, 1.15rem);
    z-index: 20;
}

.il-feedback-banner.is-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1.5px solid #a7f3d0;
}

.il-feedback-banner.is-partial {
    background: #fffbeb;
    color: #92400e;
    border: 1.5px solid #fde68a;
}

/* ========================================================
   تجاوب خاص للشاشات الصغيرة والهواتف (Mobile View)
   ======================================================== */
@media (max-width: 767px) {
    .il-play-stage {
        flex-direction: column;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        -ms-flex-direction: column;
        gap: 14px;
    }

    .il-cards-col {
        width: 100%;
        flex-direction: row;
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -webkit-flex-direction: row;
        -ms-flex-direction: row;
        flex-wrap: wrap;
        -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
        justify-content: center;
        -webkit-box-pack: center;
        -webkit-justify-content: center;
        -ms-flex-pack: center;
        align-items: center;
        -webkit-box-align: center;
        -webkit-align-items: center;
        -ms-flex-align: center;
        gap: 8px;
    }

    .il-cards-col-left {
        order: 2;
        -webkit-order: 2;
    }

    .il-frame-card {
        order: 1;
        -webkit-order: 1;
        width: 100%;
    }

    .il-cards-col-right {
        order: 3;
        -webkit-order: 3;
    }

    .il-card-item {
        width: auto;
        flex: 1 1 calc(50% - 10px);
        max-width: calc(50% - 6px);
        padding: 8px 12px;
        font-size: 0.88rem;
    }

    .il-card-peg,
    .il-card-peg-stem {
        display: none;
    }

    .il-image {
        max-height: clamp(260px, 45vh, 400px);
    }

    .il-point {
        width: 12px;
        height: 12px;
    }

    .il-check-btn {
        min-width: 160px;
        padding: 10px 22px;
        font-size: 1rem;
    }
}

/* ========================================================
   وضع ملء الشاشة والشاشات الكبيرة والسبورات الذكية (Fullscreen Mode)
   العنوان دائماً بالأعلى بارز وبأعلى طبقة بصرية z-index 50، والصورة متكيفة بدقة بدون أي تداخل
   ======================================================== */
#gamePlayArea:fullscreen .il-player-wrap,
.gpa-fullscreen .il-player-wrap {
    flex: 1 1 0 !important;
    display: flex !important;
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: -ms-flexbox !important;
    flex-direction: column !important;
    -webkit-box-orient: vertical !important;
    -webkit-box-direction: normal !important;
    -webkit-flex-direction: column !important;
    -ms-flex-direction: column !important;
    justify-content: space-between !important;
    -webkit-box-pack: justify !important;
    -webkit-justify-content: space-between !important;
    -ms-flex-pack: justify !important;
    min-height: 0 !important;
    height: 100% !important;
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 2px 6px !important;
    box-sizing: border-box !important;
    position: relative !important;
}

#gamePlayArea:fullscreen .il-header-card,
.gpa-fullscreen .il-header-card {
    position: relative !important;
    z-index: 50 !important;
    flex: 0 0 auto !important;
    padding: 6px 14px !important;
    margin-bottom: 8px !important;
    border-radius: 12px !important;
    background: #ffffff !important;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08) !important;
    border: 1.5px solid #e2e8f0 !important;
}

#gamePlayArea:fullscreen .il-title,
.gpa-fullscreen .il-title {
    font-size: clamp(1rem, 1.4vw, 1.25rem) !important;
    margin: 0 0 2px 0 !important;
    line-height: 1.25 !important;
}

#gamePlayArea:fullscreen .il-subtitle,
.gpa-fullscreen .il-subtitle {
    font-size: clamp(0.78rem, 1.05vw, 0.88rem) !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

#gamePlayArea:fullscreen .il-play-stage,
.gpa-fullscreen .il-play-stage {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    gap: clamp(12px, 2vw, 32px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
}

#gamePlayArea:fullscreen .il-cards-col,
.gpa-fullscreen .il-cards-col {
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: 250px !important;
    gap: clamp(8px, 1.4vh, 16px) !important;
    justify-content: center !important;
    z-index: 30 !important;
}

#gamePlayArea:fullscreen .il-card-item,
.gpa-fullscreen .il-card-item {
    font-size: clamp(0.92rem, 1.2vw, 1.12rem) !important;
    padding: clamp(8px, 1.2vh, 12px) clamp(12px, 1.5vw, 18px) !important;
    z-index: 30 !important;
}

#gamePlayArea:fullscreen .il-frame-card,
.gpa-fullscreen .il-frame-card {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    max-height: 100% !important;
    min-height: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 0 !important;
    position: relative !important;
    z-index: 10 !important;
}

#gamePlayArea:fullscreen .il-image-wrapper,
.gpa-fullscreen .il-image-wrapper {
    position: relative !important;
    display: inline-block !important;
    max-height: 100% !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    line-height: 0 !important;
    margin: 0 auto !important;
    z-index: 10 !important;
}

#gamePlayArea:fullscreen .il-image,
.gpa-fullscreen .il-image {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: clamp(160px, calc(100vh - 250px), 520px) !important;
    object-fit: contain !important;
}

#gamePlayArea:fullscreen .il-point,
.gpa-fullscreen .il-point {
    width: 12px !important;
    height: 12px !important;
    z-index: 35 !important;
}

#gamePlayArea:fullscreen .il-actions-bar,
.gpa-fullscreen .il-actions-bar {
    flex: 0 0 auto !important;
    margin-top: 6px !important;
    z-index: 40 !important;
}

#gamePlayArea:fullscreen .il-check-btn,
.gpa-fullscreen .il-check-btn {
    font-size: clamp(1rem, 1.3vw, 1.18rem) !important;
    padding: clamp(8px, 1.2vh, 12px) clamp(26px, 3vw, 42px) !important;
}

#gamePlayArea:fullscreen .il-retry-btn,
.gpa-fullscreen .il-retry-btn {
    font-size: clamp(0.92rem, 1.2vw, 1.05rem) !important;
    padding: clamp(7px, 1.1vh, 10px) clamp(18px, 2.5vw, 28px) !important;
}

#gamePlayArea:fullscreen .il-feedback-banner,
.gpa-fullscreen .il-feedback-banner {
    flex: 0 0 auto !important;
    margin-top: 4px !important;
    padding: 6px 14px !important;
    font-size: 0.95rem !important;
    z-index: 45 !important;
}

/* مصيدة غير بديهية: flex-gap غائب في Safari<14.1 — هوامش بديلة فقط عند الغياب */
@supports not (gap: 14px) {
    .il-cards-col > * { margin: 5px 0; }
    .il-actions-bar > * { margin: 0 7px; }
}