/* ====================================================================
   Qadiyah Challenge — Millionaire-style 15 cases
   ==================================================================== */

#qchall-app, #qchall-app * { box-sizing: border-box; }
#qchall-app [hidden] { display: none !important; }

#qchall-app {
    --gold-1: #ffe27a;
    --gold-2: #f5b342;
    --gold-3: #b8791b;
    --navy-1: #06091a;
    --navy-2: #0d1330;
    --navy-3: #131b46;
    --purple: #2a1e5c;
    --red:    #e63946;
    --green:  #16c784;
    --text:   #f5f6ff;
    --muted:  #b9bdd9;

    position: relative;
    min-height: 100vh;
    padding: 28px 16px 80px;
    overflow: hidden;
    color: var(--text);
    font-family: "Tajawal", "Cairo", "Segoe UI", system-ui, sans-serif;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(95, 58, 220, .55) 0%, rgba(13, 19, 48, 0) 55%),
        radial-gradient(ellipse at 50% 110%, rgba(245, 179, 66, .25) 0%, rgba(13, 19, 48, 0) 60%),
        linear-gradient(180deg, #06091a 0%, #0d1330 50%, #131b46 100%);
}

/* ----- Background decorations ----- */
.qchall-bg {
    position: absolute; inset: 0;
    pointer-events: none; overflow: hidden; z-index: 0;
}
.qchall-bg-rays {
    position: absolute; inset: -50% -10% auto -10%;
    height: 120%;
    background:
        conic-gradient(from 90deg at 50% 0%,
            transparent 0deg,
            rgba(255, 226, 122, .10) 8deg,
            transparent 16deg,
            rgba(255, 226, 122, .07) 30deg,
            transparent 50deg,
            rgba(255, 226, 122, .12) 70deg,
            transparent 90deg,
            rgba(255, 226, 122, .06) 110deg,
            transparent 140deg,
            rgba(255, 226, 122, .10) 160deg,
            transparent 180deg);
    filter: blur(2px);
    animation: qchall-rays 30s linear infinite;
    opacity: .65;
}
@keyframes qchall-rays { to { transform: rotate(360deg); } }
.qchall-bg-particles {
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, .35) 1px, transparent 2px),
        radial-gradient(circle at 80% 30%, rgba(255, 255, 255, .25) 1px, transparent 2px),
        radial-gradient(circle at 30% 70%, rgba(255, 255, 255, .25) 1px, transparent 2px),
        radial-gradient(circle at 65% 85%, rgba(255, 255, 255, .35) 1px, transparent 2px),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .15) 1px, transparent 2px);
    background-size: 600px 600px, 700px 700px, 500px 500px, 800px 800px, 900px 900px;
    opacity: .6;
}

/* ----- Screens ----- */
.qchall-screen { display: none; position: relative; z-index: 1; }
.qchall-screen.is-active { display: block; animation: qchall-fade .45s ease both; }
@keyframes qchall-fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* =================================================================
   START SCREEN
   ================================================================= */
.qchall-screen--start { max-width: 760px; margin: 0 auto; text-align: center; }

.qchall-logo { padding: 36px 0 22px; }
.qchall-logo__crown {
    font-size: 70px; line-height: 1;
    filter: drop-shadow(0 8px 28px rgba(255, 200, 80, .55));
    animation: qchall-bob 4s ease-in-out infinite;
}
@keyframes qchall-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.qchall-logo__title {
    margin: 14px 0 6px;
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 900;
    background: linear-gradient(180deg, #fff7d1 0%, var(--gold-1) 35%, var(--gold-2) 65%, var(--gold-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-shadow: 0 6px 24px rgba(245, 179, 66, .25);
}
.qchall-logo__subtitle { color: var(--muted); font-size: 18px; margin: 0; }

.qchall-start-card {
    margin-top: 28px;
    padding: 28px 24px 32px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
    border: 1px solid rgba(255, 226, 122, .25);
    box-shadow:
        0 30px 80px rgba(0, 0, 0, .45),
        inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
}
.qchall-start-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 12px; margin-bottom: 22px;
}
.qchall-start-stat {
    padding: 16px 10px; border-radius: 16px;
    background: rgba(13, 19, 48, .55);
    border: 1px solid rgba(255, 255, 255, .07);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.qchall-start-stat .num { font-size: 30px; font-weight: 900; color: #fff; }
.qchall-start-stat .lbl { font-size: 13px; color: var(--muted); }
.qchall-start-stat--gold {
    background: linear-gradient(160deg, rgba(245, 179, 66, .25), rgba(245, 179, 66, .05));
    border-color: rgba(255, 226, 122, .4);
}
.qchall-start-stat--gold .num { color: var(--gold-1); }

.qchall-rules {
    list-style: none; margin: 0 0 24px; padding: 0;
    text-align: right; color: #e6e8ff; line-height: 1.95; font-size: 15px;
}
.qchall-rules li b { color: var(--gold-1); }

/* ----- Big shiny button ----- */
.qchall-btn {
    position: relative; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 16px 38px; min-width: 220px;
    border: 0; border-radius: 999px;
    color: #2a1700; font-weight: 900; font-size: 18px;
    background: linear-gradient(180deg, #fff7d1 0%, var(--gold-1) 30%, var(--gold-2) 70%, var(--gold-3) 100%);
    box-shadow:
        0 14px 30px rgba(245, 179, 66, .45),
        inset 0 1px 0 rgba(255, 255, 255, .65),
        inset 0 -2px 0 rgba(120, 70, 0, .25);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease;
    font-family: inherit;
}
.qchall-btn:hover  { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(245, 179, 66, .55), inset 0 1px 0 rgba(255, 255, 255, .65); }
.qchall-btn:active { transform: translateY(0); }
.qchall-btn__shine {
    position: absolute; top: 0; bottom: 0; left: -40%;
    width: 30%;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, .55) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: qchall-shine 3.4s ease-in-out infinite;
}
@keyframes qchall-shine { 0% { left: -40%; } 60%, 100% { left: 130%; } }

.qchall-btn--next {
    background: linear-gradient(180deg, #6c8eff 0%, #4a6cf6 50%, #2a4dd1 100%);
    color: #fff;
    box-shadow: 0 12px 30px rgba(74, 108, 246, .45), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* =================================================================
   GAME SCREEN
   ================================================================= */
.qchall-topbar {
    max-width: 1100px; margin: 0 auto 18px;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px;
    border-radius: 16px;
    background: rgba(13, 19, 48, .55);
    border: 1px solid rgba(255, 255, 255, .08);
}
.qchall-icon-btn {
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(230, 57, 70, .15); color: #fff;
    border: 1px solid rgba(230, 57, 70, .35);
    cursor: pointer; font-size: 16px; line-height: 1;
}
.qchall-icon-btn:hover { background: rgba(230, 57, 70, .35); }
.qchall-progress { font-weight: 700; font-size: 16px; color: #fff; }
.qchall-progress__sep { color: var(--muted); margin: 0 4px; }
.qchall-progress__total { color: var(--gold-1); }
.qchall-score {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    background: linear-gradient(160deg, rgba(245, 179, 66, .2), rgba(245, 179, 66, .05));
    border: 1px solid rgba(255, 226, 122, .35);
    color: var(--gold-1); font-weight: 800;
}

.qchall-stage-grid {
    max-width: 1100px; margin: 0 auto;
    display: grid; grid-template-columns: 1fr 280px; gap: 24px;
}
@media (max-width: 860px) {
    .qchall-stage-grid { grid-template-columns: 1fr; }
    .qchall-ladder { order: -1; }
}

/* ----- Question card ----- */
.qchall-lifelines {
    display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 12px;
}
.qchall-lifeline {
    position: relative;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: linear-gradient(160deg, rgba(108, 142, 255, .2), rgba(108, 142, 255, .05));
    border: 1px solid rgba(108, 142, 255, .4);
    color: #cfd6ff; font-weight: 700; cursor: pointer;
    font-family: inherit; font-size: 14px;
    transition: all .2s ease;
}
.qchall-lifeline .ico { font-size: 18px; }
.qchall-lifeline:not(:disabled):hover {
    background: linear-gradient(160deg, rgba(108, 142, 255, .35), rgba(108, 142, 255, .1));
    transform: translateY(-1px);
}
.qchall-lifeline:disabled { opacity: .35; cursor: not-allowed; }
.qchall-lifeline__count {
    background: var(--gold-2); color: #2a1700;
    padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 900;
}

.qchall-card {
    position: relative;
    padding: 26px 24px 24px;
    border-radius: 22px;
    background:
        linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 30px 70px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .07);
    backdrop-filter: blur(6px);
    overflow: hidden;
}
.qchall-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 226, 122, .08) 50%, transparent 100%);
    pointer-events: none;
}
.qchall-card--big {
    border-color: rgba(255, 226, 122, .55);
    background: linear-gradient(160deg, rgba(245, 179, 66, .12), rgba(42, 30, 92, .35));
    box-shadow: 0 30px 80px rgba(245, 179, 66, .25), 0 0 0 1px rgba(255, 226, 122, .1) inset;
}
.qchall-card__badge {
    display: inline-block; padding: 5px 12px;
    border-radius: 999px;
    background: rgba(108, 142, 255, .2); color: #cfd6ff;
    font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.qchall-card--big .qchall-card__badge {
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
    color: #2a1700;
}
.qchall-card__emoji { font-size: 44px; line-height: 1; margin-bottom: 6px; }
.qchall-card__title { margin: 4px 0 10px; font-size: 20px; color: #fff; font-weight: 800; }
.qchall-card__text { margin: 0; font-size: 17px; line-height: 1.85; color: #eef0ff; white-space: pre-line; }
.qchall-card__meta {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}
.qchall-card__meta span {
    padding: 4px 10px; border-radius: 999px;
    background: rgba(255, 255, 255, .07);
    font-size: 12px; color: var(--muted);
}

/* ----- Options ----- */
.qchall-options {
    margin-top: 18px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.qchall-option {
    position: relative;
    padding: 14px 18px 14px 50px;
    text-align: right;
    border: 1px solid rgba(255, 226, 122, .35);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(13, 19, 48, .65), rgba(42, 30, 92, .55));
    color: #fff; font-weight: 700; font-size: 16px;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
    font-family: inherit;
}
.qchall-option:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(180deg, rgba(245, 179, 66, .25), rgba(42, 30, 92, .65));
    box-shadow: 0 10px 24px rgba(245, 179, 66, .25);
}
.qchall-option__letter {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
    color: #2a1700; font-weight: 900; font-size: 14px;
}
.qchall-option--correct {
    background: linear-gradient(180deg, rgba(22, 199, 132, .35), rgba(22, 199, 132, .15)) !important;
    border-color: var(--green) !important;
    box-shadow: 0 0 0 2px rgba(22, 199, 132, .35), 0 10px 24px rgba(22, 199, 132, .25);
    animation: qchall-pulse-green .8s ease;
}
.qchall-option--wrong {
    background: linear-gradient(180deg, rgba(230, 57, 70, .35), rgba(230, 57, 70, .15)) !important;
    border-color: var(--red) !important;
    box-shadow: 0 0 0 2px rgba(230, 57, 70, .35);
    animation: qchall-shake .45s ease;
}
.qchall-option:disabled { cursor: default; }
@keyframes qchall-pulse-green {
    0% { transform: scale(.98); } 50% { transform: scale(1.02); } 100% { transform: scale(1); }
}
@keyframes qchall-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* ----- Hint box ----- */
.qchall-hint {
    margin-top: 16px;
    padding: 14px 16px; border-radius: 14px;
    background: linear-gradient(160deg, rgba(108, 142, 255, .18), rgba(108, 142, 255, .04));
    border: 1px solid rgba(108, 142, 255, .35);
    display: flex; gap: 12px; align-items: flex-start;
    animation: qchall-fade .35s ease both;
}
.qchall-hint__ico { font-size: 22px; line-height: 1.2; }
.qchall-hint__body { color: #e8ecff; line-height: 1.7; font-size: 15px; }

/* ----- Feedback ----- */
.qchall-feedback {
    margin-top: 18px;
    padding: 18px 20px; border-radius: 16px;
    background: rgba(13, 19, 48, .7);
    border: 1px solid rgba(255, 255, 255, .1);
    animation: qchall-fade .35s ease both;
    text-align: center;
}
.qchall-feedback__head {
    font-size: 22px; font-weight: 900; margin-bottom: 6px;
}
.qchall-feedback--correct .qchall-feedback__head { color: var(--green); }
.qchall-feedback--wrong   .qchall-feedback__head { color: var(--red); }
.qchall-feedback__body { color: #d8dbf5; line-height: 1.85; margin: 0 0 12px; }

/* =================================================================
   LADDER (right side)
   ================================================================= */
.qchall-ladder {
    padding: 14px 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(13, 19, 48, .8), rgba(42, 30, 92, .55));
    border: 1px solid rgba(255, 255, 255, .08);
    display: flex; flex-direction: column-reverse; gap: 6px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}
.qchall-rung {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; border-radius: 10px;
    color: #c8cdf0; font-size: 14px; font-weight: 700;
    transition: all .2s ease;
}
.qchall-rung__num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: rgba(255, 255, 255, .08); color: #cfd6ff;
    font-weight: 900; font-size: 13px;
}
.qchall-rung--milestone {
    background: linear-gradient(90deg, rgba(245, 179, 66, .15), rgba(245, 179, 66, .05));
    color: var(--gold-1);
}
.qchall-rung--milestone .qchall-rung__num {
    background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
    color: #2a1700;
}
.qchall-rung--passed {
    color: var(--green);
}
.qchall-rung--passed .qchall-rung__num { background: var(--green); color: #00130a; }
.qchall-rung--current {
    background: linear-gradient(90deg, rgba(108, 142, 255, .35), rgba(108, 142, 255, .1));
    color: #fff;
    box-shadow: 0 0 0 1px rgba(108, 142, 255, .5), 0 8px 24px rgba(108, 142, 255, .35);
}
.qchall-rung--current .qchall-rung__num {
    background: #fff; color: #2a1700;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .15);
}

/* =================================================================
   END SCREEN
   ================================================================= */
.qchall-screen--end { max-width: 620px; margin: 60px auto 0; }
.qchall-end-card {
    text-align: center;
    padding: 36px 28px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
    border: 1px solid rgba(255, 226, 122, .35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}
.qchall-end-icon { font-size: 76px; filter: drop-shadow(0 6px 20px rgba(245, 179, 66, .55)); }
.qchall-end-card.is-loss .qchall-end-icon { filter: drop-shadow(0 6px 20px rgba(230, 57, 70, .5)); }
.qchall-end-title {
    margin: 8px 0 4px;
    font-size: 32px; font-weight: 900;
    background: linear-gradient(180deg, #fff7d1, var(--gold-2));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.qchall-end-msg { color: var(--muted); font-size: 16px; margin: 0 0 18px; }
.qchall-end-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 22px;
}
.qchall-end-stats > div {
    padding: 14px 8px; border-radius: 14px;
    background: rgba(13, 19, 48, .55);
    border: 1px solid rgba(255, 255, 255, .08);
    display: flex; flex-direction: column; gap: 2px;
}
.qchall-end-stats .num { font-size: 26px; font-weight: 900; color: #fff; }
.qchall-end-stats .lbl { font-size: 12px; color: var(--muted); }

/* ----- Loading ----- */
.qchall-loading {
    position: fixed; inset: 0;
    background: rgba(6, 9, 26, .82);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 16px; z-index: 9999; color: #fff;
}
.qchall-loading__ring {
    width: 56px; height: 56px; border-radius: 50%;
    border: 4px solid rgba(255, 226, 122, .2);
    border-top-color: var(--gold-1);
    animation: qchall-spin 1s linear infinite;
}
@keyframes qchall-spin { to { transform: rotate(360deg); } }

/* ----- Responsive tweaks ----- */
@media (max-width: 540px) {
    .qchall-options { grid-template-columns: 1fr; }
    .qchall-card__title { font-size: 18px; }
    .qchall-card__text { font-size: 16px; }
    .qchall-logo__title { font-size: 36px; }
    .qchall-start-row { gap: 8px; }
    .qchall-start-stat .num { font-size: 24px; }
}
