/* Quranic Hikma — Qaida puzzles & learning games */
.qh-hub {
    --qh-ink: #121a17;
    --qh-muted: #5d6b62;
    --qh-forest: #0e4b38;
    --qh-leaf: #1f6b4f;
    --qh-sand: #c6a15b;
    --qh-cream: #f7f4ee;
    --qh-panel: #fffdf8;
    --qh-line: rgba(14, 75, 56, 0.14);
    position: relative;
    padding: 56px 0 72px;
    background:
        radial-gradient(ellipse at 12% 0%, rgba(80, 188, 132, 0.1), transparent 42%),
        radial-gradient(ellipse at 88% 100%, rgba(198, 161, 91, 0.12), transparent 45%),
        linear-gradient(180deg, #f7f4ee 0%, #f1eee6 55%, #f7f4ee 100%);
    overflow: hidden;
}
.qh-hub::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("../images/background/pattern-2.png");
    background-size: 420px;
    opacity: 0.06;
    pointer-events: none;
}
.qh-hub .auto-container { position: relative; z-index: 1; }
.qh-hub-head {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 28px;
}
.qh-hub-badge {
    display: inline-block;
    margin-bottom: 14px;
    padding: 8px 22px 8px 16px;
    background: #d7e9de;
    color: #16352a;
    font-size: 14px;
    font-weight: 700;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 50%, calc(100% - 14px) 100%, 0 100%);
}
.qh-hub-title {
    margin: 0;
    color: var(--qh-ink);
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1.25;
    font-weight: 700;
}
.qh-hub-lead {
    margin: 12px auto 0;
    color: var(--qh-muted);
    font-size: 16px;
    line-height: 1.65;
}
.qh-hub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 0 22px;
}
.qh-hub-tab {
    border: 1px solid var(--qh-line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--qh-forest);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.qh-hub-tab:hover { transform: translateY(-1px); border-color: rgba(14, 75, 56, 0.35); }
.qh-hub-tab.is-on {
    background: var(--qh-forest);
    border-color: var(--qh-forest);
    color: #fff;
}
.qh-hub-panel {
    background: var(--qh-panel);
    border: 1px solid var(--qh-line);
    border-radius: 22px;
    padding: 22px 20px 26px;
    box-shadow: 0 18px 40px rgba(18, 40, 28, 0.06);
    max-width: 920px;
    margin: 0 auto;
}
.qh-hub-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}
.qh-hub-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--qh-forest);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.qh-hub-select {
    min-width: 220px;
    max-width: 100%;
    border: 1px solid var(--qh-line);
    background: #fff;
    color: var(--qh-ink);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}
.qh-hub-btn {
    border: 0;
    background: var(--qh-leaf);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
}
.qh-hub-btn:hover { background: var(--qh-forest); }
.qh-hub-btn--ghost {
    background: #e8f1eb;
    color: var(--qh-forest);
}
.qh-hub-btn--ghost:hover { background: #d7e9de; color: var(--qh-forest); }
.qh-hub-hint,
.qh-hub-status {
    margin: 0 0 12px;
    color: var(--qh-muted);
    font-size: 15px;
    line-height: 1.5;
}
.qh-hub-status.is-ok { color: #1b6b3a; font-weight: 600; }
.qh-hub-status.is-bad { color: #9a3412; font-weight: 600; }

.qh-puzzle-slots,
.qh-puzzle-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 10px 0 16px;
}
.qh-slot,
.qh-tile {
    width: 64px;
    min-height: 72px;
    border-radius: 14px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Amiri, "Times New Roman", serif;
    cursor: pointer;
    user-select: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.qh-slot {
    border: 2px dashed rgba(14, 75, 56, 0.28);
    background: linear-gradient(180deg, #f3e7d0, #e8d4a8);
    color: var(--qh-ink);
}
.qh-slot.is-filled {
    border-style: solid;
    border-color: rgba(14, 75, 56, 0.35);
    background: linear-gradient(180deg, #fff8ea, #f0dfb8);
}
.qh-slot.is-correct { border-color: #1b6b3a; box-shadow: 0 0 0 2px rgba(27, 107, 58, 0.18); }
.qh-slot.is-wrong { border-color: #c2410c; animation: qh-shake 0.35s ease; }
.qh-tile {
    border: 1px solid rgba(14, 75, 56, 0.18);
    background: #fff;
    box-shadow: 0 8px 18px rgba(18, 40, 28, 0.08);
}
.qh-tile:hover { transform: translateY(-2px); }
.qh-tile.is-selected {
    border-color: var(--qh-sand);
    box-shadow: 0 0 0 3px rgba(198, 161, 91, 0.35);
}
.qh-tile.is-used { opacity: 0.35; pointer-events: none; }
.qh-glyph {
    font-size: 1.85rem;
    line-height: 1;
    color: var(--qh-ink);
}
.qh-name {
    margin-top: 4px;
    font-family: Lexend, sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: var(--qh-muted);
    letter-spacing: 0.02em;
}

.qh-ginti-card { text-align: center; }
.qh-ginti-digit {
    font-family: Amiri, "Times New Roman", serif;
    font-size: clamp(3.5rem, 10vw, 5.5rem);
    line-height: 1;
    color: var(--qh-forest);
}
.qh-ginti-western {
    margin: 4px 0 16px;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--qh-sand);
}
.qh-ginti-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 520px;
    margin: 0 auto 12px;
}
.qh-ginti-options button {
    border: 1px solid var(--qh-line);
    background: #fff;
    border-radius: 14px;
    padding: 14px 12px;
    font-family: Amiri, "Times New Roman", serif;
    font-size: 1.35rem;
    cursor: pointer;
    color: var(--qh-ink);
}
.qh-ginti-options button:hover { border-color: var(--qh-leaf); }
.qh-ginti-options button.is-correct { background: #e8f6ec; border-color: #1b6b3a; }
.qh-ginti-options button.is-wrong { background: #fff1eb; border-color: #c2410c; }

.qh-game-prompt {
    text-align: center;
    font-size: 1.2rem;
    color: var(--qh-ink);
    margin: 8px 0 16px;
}
.qh-game-choices {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 12px;
}
.qh-game-choices .qh-tile { width: 78px; min-height: 86px; }
.qh-game-score {
    text-align: center;
    font-weight: 700;
    color: var(--qh-forest);
    margin: 8px 0 0;
}
.qh-memory-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    max-width: 420px;
    margin: 0 auto 12px;
}
.qh-memory-card {
    aspect-ratio: 1;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(160deg, #0e4b38, #1f6b4f);
    color: #fff;
    font-family: Amiri, "Times New Roman", serif;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(14, 75, 56, 0.18);
}
.qh-memory-card.is-face { background: #fffdf8; color: var(--qh-ink); border: 1px solid var(--qh-line); }
.qh-memory-card.is-matched { opacity: 0.45; pointer-events: none; }

.qh-tasbeeh {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
}
.qh-tasbeeh .qh-hub-select { width: 100%; margin: 8px 0 14px; }
.qh-tasbeeh-arabic {
    font-family: Amiri, "Times New Roman", serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: var(--qh-forest);
    margin-bottom: 18px;
    min-height: 2.4em;
}
.qh-tasbeeh-bead {
    width: min(220px, 70vw);
    height: min(220px, 70vw);
    border-radius: 50%;
    border: 6px solid rgba(198, 161, 91, 0.55);
    background:
        radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.35), transparent 40%),
        linear-gradient(160deg, #1f6b4f, #0a3a2b);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 22px 40px rgba(10, 50, 35, 0.28);
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: transform 0.12s ease;
}
.qh-tasbeeh-bead:active { transform: scale(0.96); }
.qh-tasbeeh-count {
    font-size: clamp(2.6rem, 8vw, 3.6rem);
    font-weight: 700;
    line-height: 1;
}
.qh-tasbeeh-cap {
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}
.qh-tasbeeh-meta {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin: 18px 0 14px;
    color: var(--qh-muted);
    font-size: 15px;
}
.qh-tasbeeh-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.qh-hub-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    margin: 36px auto 0;
    max-width: 980px;
    padding: 34px 40px;
    border-radius: 28px;
    background: #1d422e;
    box-shadow: 0 22px 48px rgba(18, 40, 28, 0.18);
}
.qh-hub-banner-copy {
    flex: 1 1 360px;
    min-width: 0;
}
.qh-hub-banner-title {
    margin: 0;
    color: #fff;
    font-size: clamp(1.35rem, 2.4vw, 1.85rem);
    line-height: 1.25;
    font-weight: 700;
}
.qh-hub-banner-text {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 15px;
    line-height: 1.6;
    max-width: 34em;
}
.qh-hub-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex: 0 0 auto;
    align-items: center;
}
.qh-hub-banner-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.qh-hub-banner-btn:hover { transform: translateY(-1px); }
.qh-hub-banner-btn--solid {
    background: #4e8b5b;
    color: #fff !important;
    border: 1px solid #4e8b5b;
}
.qh-hub-banner-btn--solid:hover { background: #3f754b; border-color: #3f754b; }
.qh-hub-banner-btn--ghost {
    background: transparent;
    color: #fff !important;
    border: 1.5px solid rgba(255, 255, 255, 0.92);
}
.qh-hub-banner-btn--ghost:hover { background: rgba(255, 255, 255, 0.08); }

@keyframes qh-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

@media (max-width: 900px) {
    .qh-hub-banner {
        flex-direction: column;
        align-items: flex-start;
        padding: 28px 24px;
        gap: 20px;
    }
    .qh-hub-banner-actions { width: 100%; }
    .qh-hub-banner-btn { flex: 1 1 auto; }
}
@media (max-width: 767px) {
    .qh-hub { padding: 40px 0 56px; }
    .qh-hub-panel { padding: 18px 14px 22px; border-radius: 18px; }
    .qh-slot, .qh-tile { width: 56px; min-height: 64px; }
    .qh-glyph { font-size: 1.55rem; }
    .qh-ginti-options { grid-template-columns: 1fr; }
    .qh-memory-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
    .qh-hub-banner { border-radius: 22px; padding: 24px 18px; }
    .qh-hub-banner-actions { flex-direction: column; align-items: stretch; }
    .qh-hub-banner-btn { width: 100%; white-space: normal; text-align: center; }
}
