/* ==========================================================================
   مركز الفردوس — المكوّنات المشتركة (نظام "الكوفي المربّع")
   قطع صغيرة تُستخدم في أي صفحة: شريط التقدم الكوفي، زر الأطفال، مربع الإجابة،
   بطاقة المحطة، الشارات، لوح الآية، ومفتاح وضع العرض.
   كل القيم من tokens.css.
   ========================================================================== */

/* ---------- شريط التقدم الكوفي: مربعات تمتلئ بدل النسبة المئوية ---------- */
.fd-progress {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.fd-progress > * {
    width: var(--fd-cell, 18px);
    height: var(--fd-cell, 18px);
    border-radius: var(--r-cell);
    background: var(--c-line);
    transition: background .25s var(--ease), transform .25s var(--ease);
}

.fd-progress > .is-done { background: var(--c-orange); }
.fd-progress > .is-now {
    background: transparent;
    box-shadow: inset 0 0 0 3px var(--c-orange);
    animation: fdPulse 1.6s ease-in-out infinite;
}

.fd-progress.on-stage > * { background: var(--c-teal-800); }
.fd-progress.on-stage > .is-done { background: var(--c-orange); }
.fd-progress.on-stage > .is-now { background: transparent; }

@keyframes fdPulse { 50% { box-shadow: inset 0 0 0 3px var(--c-orange-soft); } }

/* ---------- زر الأطفال: كتلة كبيرة لها حافة تنضغط ---------- */
.fd-btn-kids {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    min-height: 64px;
    padding: 0 2rem;
    border: 0;
    border-radius: var(--r-tile);
    background: var(--c-orange);
    color: var(--c-teal-950);
    font-family: var(--font-ui);
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--c-orange-edge);
    transition: background .2s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}

.fd-btn-kids:hover { background: var(--c-orange-soft); }
.fd-btn-kids:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--c-orange-edge); }
.fd-btn-kids.is-teal { background: var(--c-teal-700); color: var(--c-white); box-shadow: 0 5px 0 var(--c-teal-950); }
.fd-btn-kids.is-teal:active { box-shadow: 0 1px 0 var(--c-teal-950); }

/* ---------- مربع الإجابة ---------- */
.fd-tile {
    display: grid;
    place-items: center;
    min-height: 84px;
    padding: 12px;
    border: 0;
    border-radius: var(--r-tile);
    background: var(--c-white);
    color: var(--c-ink);
    font-family: var(--font-quran);
    font-size: 1.7rem;
    cursor: pointer;
    box-shadow: inset 0 0 0 2px var(--c-line), 0 5px 0 var(--c-line);
    transition: transform .15s var(--ease), background .2s, box-shadow .15s;
}

.fd-tile:active { transform: translateY(4px); box-shadow: inset 0 0 0 2px var(--c-line), 0 1px 0 var(--c-line); }
.fd-tile.is-selected { box-shadow: inset 0 0 0 3px var(--c-teal-700), 0 5px 0 var(--c-teal-700); }
.fd-tile.is-correct { background: var(--c-correct); color: var(--c-white); box-shadow: 0 5px 0 var(--c-correct-deep); }
.fd-tile.is-wrong { background: var(--c-wrong); color: var(--c-white); box-shadow: 0 5px 0 var(--c-wrong-deep); animation: fdShake .35s; }

@keyframes fdShake {
    25% { transform: translateX(-6px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-3px); }
}

/* ---------- الشارات ---------- */
.fd-chip {
    display: inline-flex;
    align-items: center;
    gap: .35em;
    padding: .2rem .7rem;
    border-radius: var(--r-cell);
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.6;
    background: var(--c-teal-100);
    color: var(--c-teal-900);
}

.fd-chip.is-orange { background: var(--c-orange-50); color: var(--c-orange-ink); }
.fd-chip.is-correct { background: var(--c-correct-100); color: var(--c-correct-deep); }
.fd-chip.is-wrong { background: var(--c-wrong-100); color: var(--c-wrong-deep); }
.fd-chip.is-muted { background: var(--c-line-soft); color: var(--c-ink-soft); }

/* ---------- بطاقة المحطة ---------- */
.fd-station {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    align-items: start;
    padding: 18px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-tile);
    background: var(--c-white);
}

.fd-station-num {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--r-block);
    background: var(--c-orange);
    color: var(--c-teal-950);
    font-family: var(--font-kufi);
    font-weight: 700;
    font-size: 1.4rem;
}

.fd-station.is-done .fd-station-num { background: var(--c-teal-100); color: var(--c-teal-900); }
.fd-station.is-locked { opacity: .6; }
.fd-station.is-locked .fd-station-num { background: var(--c-line); color: var(--c-ink-muted); }

/* ---------- لوح الآية: هادئ دائمًا ---------- */
.fd-ayah {
    font-family: var(--font-quran);
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    line-height: 2.2;
    background: var(--c-paper-raised);
    color: var(--c-ink);
    border-radius: var(--r-tile);
    padding: .3em 1.1em;
    text-align: center;
}

/* ---------- مفتاح وضع العرض ---------- */
.fd-projector-btn svg { width: 20px; height: 20px; }
.fd-projector-btn[aria-pressed="true"] {
    background: var(--c-orange) !important;
    color: var(--c-teal-950) !important;
}

/* ---------- القوس تحت العنوان (من القوس تحت المصحف في الشعار) ---------- */
.fd-arc {
    display: block;
    width: 72px;
    height: 10px;
    margin-top: 10px;
    background: no-repeat center / 100% 100% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 10'%3E%3Cpath d='M2 2 Q36 12 70 2' fill='none' stroke='%23F0964E' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
}

.section-head.center .fd-arc { margin-inline: auto; }

@media (prefers-reduced-motion: reduce) {
    .fd-progress > .is-now, .fd-tile.is-wrong { animation: none; }
}

/* ==========================================================================
   قسم "عن اللعبة / لماذا هذا الدرس" أسفل صفحات الدروس والألعاب.
   كان يعتمد على كلاسات Bootstrap غير محمّلة في صفحات الموقع، فنعرّفه هنا بنظام الكوفي.
   ========================================================================== */
.game-info-section {
    background: var(--c-paper);
    padding: clamp(3.5rem, 7vw, 5.5rem) 0;
    border-top: 1px solid var(--c-line);
}

.game-info-section > .container {
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2.5rem);
}

.game-info-section .section-header {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 2.5rem;
    display: grid;
    justify-items: center;
    gap: .6rem;
}

.game-info-section .section-badge {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .3rem .8rem;
    font-size: .875rem;
    font-weight: 800;
}

.game-info-section .section-title {
    font-family: var(--font-kufi);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1.35;
    color: var(--c-ink);
    margin: 0;
}

.game-info-section .section-subtitle {
    color: var(--c-ink-soft);
    font-size: 1.05rem;
    line-height: 1.9;
    margin: 0;
}

.game-info-section .row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
}

.game-info-section .row > [class*="col-"] {
    width: auto;
    max-width: none;
    padding: 0;
}

.game-info-section .feature-card {
    height: 100%;
    background: var(--c-white);
    border: 1px solid var(--c-line);
    border-radius: var(--r-tile);
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
}

.game-info-section .feature-icon,
.game-info-section .feature-card .feature-icon {
    margin-bottom: 1rem;
    background: none !important;
    width: auto;
    height: auto;
    padding: 0;
}

.game-info-section .icon-circle {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: var(--r-block);
    background: var(--c-teal-900);
    color: var(--c-cream);
    font-size: 1.3rem;
}

.game-info-section .feature-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 .4rem;
    color: var(--c-ink);
}

.game-info-section .feature-card p {
    color: var(--c-ink-soft);
    font-size: .98rem;
    line-height: 1.8;
    margin: 0;
}

.game-info-section .game-info-cta {
    margin-top: 2.5rem;
    padding: 1.4rem 1.6rem;
    color: var(--c-cream);
    text-align: center;
    font-weight: 800;
    font-size: 1.1rem;
}

.game-info-section .game-info-cta :is(h3, p, strong) {
    color: var(--c-cream);
    margin: 0;
}

@media (max-width: 900px) {
    .game-info-section .row {
        grid-template-columns: 1fr;
    }
}

/* الزخارف الضبابية خلف الدروس والألعاب تتعارض مع قاعدة المسرح المسطّح */
.tj-sky-blob,
.tj-blob,
.game-sky-blob {
    display: none !important;
}

/* ---------- الإشعار العام (نجاح / خطأ) أسفل الشريط العلوي ---------- */
.fd-flash {
    position: fixed;
    top: calc(84px + 12px);
    inset-inline: 0;
    margin-inline: auto;
    z-index: 200;
    width: min(560px, calc(100% - 32px));
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 16px;
    background: var(--c-paper-raised);
    border: 1px solid var(--c-line);
    border-radius: var(--r-block);
    box-shadow: var(--shadow-float);
    color: var(--c-ink);
    font-weight: 700;
    animation: fdFlashIn .3s var(--ease) both;
}

.fd-flash p { margin: 0; line-height: 1.6; }

.fd-flash-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: var(--r-cell);
    background: var(--c-correct);
    color: var(--c-white);
}

.fd-flash.is-error .fd-flash-mark { background: var(--c-wrong); }
.fd-flash-mark svg,
.fd-flash-close svg { width: 18px; height: 18px; }

.fd-flash-close {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: var(--r-cell);
    background: transparent;
    color: var(--c-ink-soft);
    cursor: pointer;
}

.fd-flash-close:hover { background: var(--c-line-soft); color: var(--c-ink); }
.fd-flash.is-leaving { opacity: 0; transform: translateY(-8px); transition: opacity .25s, transform .25s; }

@keyframes fdFlashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .fd-flash { animation: none; }
}
