/* ============================================================
   «تعرفني صدق؟» — تحدّي مودّة. Mobile-first، دافئ وراقٍ وممتع (لا Gaming طفوليّ).
   يعتمد متغيّرات العلامة (brand-tokens.css). RTL.
   ============================================================ */

.ch-wrap {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px 16px calc(28px + env(safe-area-inset-bottom));
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.ch-center { justify-content: center; text-align: center; }

/* ── نصوص ── */
.ch-eyebrow { font-size: .82rem; letter-spacing: .04em; color: var(--accent); font-weight: 700; }
.ch-title {
    font-size: clamp(1.7rem, 6.5vw, 2.4rem);
    line-height: 1.25; font-weight: 800; margin: 10px 0; color: var(--c-ink);
}
.ch-sub { font-size: 1.05rem; color: var(--bg-inverse, #475569); opacity: .85; line-height: 1.7; }
.ch-mega { font-size: clamp(2.6rem, 13vw, 4rem); font-weight: 800; line-height: 1; }

/* ── أزرار ── */
.ch-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 16px 20px; border: none; border-radius: 16px;
    font-size: 1.1rem; font-weight: 800; cursor: pointer; font-family: inherit;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; box-shadow: 0 8px 22px -8px var(--primary); transition: transform .12s ease, box-shadow .2s ease;
    -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.ch-btn:active { transform: translateY(2px) scale(.99); }
.ch-btn:disabled { opacity: .55; cursor: default; }
.ch-btn.secondary {
    background: var(--bg-surface); color: var(--primary);
    border: 1.5px solid var(--border-default); box-shadow: none;
}
.ch-btn.ghost { background: transparent; color: var(--primary); box-shadow: none; border: none; font-weight: 700; }
.ch-btn.sm { width: auto; padding: 10px 16px; font-size: .95rem; border-radius: 12px; }
.ch-btnrow { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* ── بطاقات ── */
.ch-card {
    background: var(--bg-surface); border: 1px solid var(--border-subtle);
    border-radius: 20px; padding: 18px; box-shadow: 0 2px 14px -8px rgba(0,0,0,.15);
}
.ch-card + .ch-card { margin-top: 12px; }

/* ── شارات ثقة ── */
.ch-badges { display: flex; flex-wrap: wrap; gap: 8px 14px; justify-content: center; margin-top: 14px; }
.ch-badge { font-size: .85rem; color: var(--bg-inverse, #475569); opacity: .8; display: inline-flex; align-items: center; gap: 5px; }

/* ── كيف يعمل ── */
.ch-steps { display: grid; gap: 12px; margin-top: 22px; }
.ch-step { display: flex; gap: 12px; align-items: flex-start; text-align: right; }
.ch-step .n {
    flex: 0 0 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-subtle, #fde68a); color: var(--accent); font-weight: 800;
}
.ch-step .t { font-weight: 700; }
.ch-step .d { font-size: .92rem; opacity: .8; }

/* ── اختيار الجمهور ── */
.ch-aud { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 16px 0; }
.ch-aud button {
    padding: 16px 10px; border-radius: 16px; border: 1.5px solid var(--border-default);
    background: var(--bg-surface); font-family: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--c-ink);
    transition: border-color .15s, background .15s, transform .1s;
}
.ch-aud button .emo { font-size: 1.5rem; }
.ch-aud button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-subtle, #eef2ff); }
.ch-aud button:active { transform: scale(.97); }

/* ── حقول ── */
.ch-input {
    width: 100%; padding: 15px 16px; border-radius: 14px; border: 1.5px solid var(--border-default);
    background: var(--bg-surface); font-family: inherit; font-size: 1.05rem; color: var(--c-ink);
}
.ch-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-subtle, #eef2ff); }
.ch-label { font-weight: 700; margin-bottom: 6px; display: block; }

/* ── مراجعة الأسئلة (المُنشئ) ── */
.ch-q { margin-bottom: 14px; }
.ch-q-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.ch-q-num { font-weight: 800; color: var(--primary); }
.ch-q-text { font-weight: 700; font-size: 1.08rem; line-height: 1.5; margin-bottom: 12px; }
.ch-opts { display: grid; gap: 8px; }
.ch-opt {
    display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 13px;
    border: 1.5px solid var(--border-default); background: var(--bg-canvas); cursor: pointer;
    font-size: 1rem; transition: border-color .15s, background .15s, transform .1s; text-align: right;
}
.ch-opt .dot {
    flex: 0 0 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong);
    display: grid; place-items: center; transition: all .15s;
}
.ch-opt.correct { border-color: var(--primary); background: var(--primary-subtle, #eef2ff); }
.ch-opt.correct .dot { border-color: var(--primary); background: var(--primary); }
.ch-opt.correct .dot::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.ch-opt:active { transform: scale(.99); }
.ch-hint { font-size: .84rem; opacity: .7; margin-top: 8px; }
.ch-regen { background: none; border: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: .9rem; display: inline-flex; gap: 5px; align-items: center; }

/* ── مبدّل الجائزة ── */
.ch-reward { display: grid; gap: 10px; margin: 14px 0; }
.ch-reward label {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px;
    border: 1.5px solid var(--border-default); cursor: pointer; background: var(--bg-surface);
}
.ch-reward input { margin-top: 3px; accent-color: var(--primary); }
.ch-reward label.on { border-color: var(--primary); background: var(--primary-subtle, #eef2ff); }

/* ── شريط التقدّم (اللاعب) ── */
.ch-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.ch-dots { display: flex; gap: 6px; }
.ch-dots .d { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); transition: all .25s; }
.ch-dots .d.on { background: var(--primary); transform: scale(1.25); }
.ch-count { font-size: .9rem; font-weight: 700; opacity: .75; white-space: nowrap; }

/* ── شاشة اللعب: انتقالات ── */
.ch-scene { animation: chIn .32s var(--ease-enter, cubic-bezier(.22,1,.36,1)); }
@keyframes chIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes chPop { 0%{transform:scale(.8);opacity:0} 60%{transform:scale(1.05)} 100%{transform:scale(1);opacity:1} }

.ch-play-q { font-size: clamp(1.3rem, 5.5vw, 1.7rem); font-weight: 800; line-height: 1.4; margin: 8px 0 20px; }
.ch-play-opts { display: grid; gap: 12px; }
.ch-play-opt {
    padding: 18px 16px; border-radius: 16px; border: 2px solid var(--border-default);
    background: var(--bg-surface); font-family: inherit; font-size: 1.1rem; font-weight: 700;
    cursor: pointer; text-align: center; color: var(--c-ink); transition: transform .1s, border-color .15s, background .15s;
}
.ch-play-opt:active { transform: scale(.97); }
.ch-play-opt.picked { border-color: var(--primary); background: var(--primary-subtle, #eef2ff); }

/* ── شاشة الحساب ── */
.ch-calc { text-align: center; padding: 40px 0; }
.ch-calc .spinner {
    width: 54px; height: 54px; border-radius: 50%; margin: 0 auto 18px;
    border: 4px solid var(--border-subtle); border-top-color: var(--primary); animation: chSpin 1s linear infinite;
}
@keyframes chSpin { to { transform: rotate(360deg); } }

/* ── النتيجة ── */
.ch-result { text-align: center; animation: chPop .5s ease; }
.ch-ring { position: relative; width: 168px; height: 168px; margin: 8px auto 14px; }
.ch-ring svg { transform: rotate(-90deg); }
.ch-ring .pct { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; }
.ch-result .emoji { font-size: 3rem; animation: chPop .6s ease; }
.ch-result .head { font-size: 1.5rem; font-weight: 800; margin: 6px 0; }
.ch-result .sub { font-size: 1.05rem; opacity: .85; line-height: 1.6; }

/* ── متصدّرون ── */
.ch-lb { display: grid; gap: 8px; margin-top: 6px; }
.ch-lb-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.ch-lb-row.you { border-color: var(--primary); background: var(--primary-subtle, #eef2ff); }
.ch-lb-rank { flex: 0 0 30px; text-align: center; font-weight: 800; }
.ch-lb-name { flex: 1; font-weight: 700; }
.ch-lb-score { font-weight: 800; color: var(--primary); }
.ch-lb-time { font-size: .82rem; opacity: .65; }

/* ── حلقة الانتشار CTA ── */
.ch-viral { margin-top: 24px; padding: 22px 18px; border-radius: 20px; text-align: center;
    background: linear-gradient(135deg, var(--primary-subtle, #eef2ff), var(--accent-subtle, #fef3c7)); }
.ch-viral h3 { font-size: 1.35rem; font-weight: 800; margin-bottom: 4px; }

/* ── مشاركة ── */
.ch-share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.ch-share-grid a, .ch-share-grid button {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 14px;
    border: 1px solid var(--border-subtle); background: var(--bg-surface); cursor: pointer; font-family: inherit;
    font-size: .78rem; color: var(--c-ink); text-decoration: none;
}
.ch-share-grid .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 1.15rem; }
.ic-wa { background: #25D366; } .ic-sc { background: #FFFC00; color: #111 !important; } .ic-tw { background: #111; } .ic-cp { background: var(--primary); }

.ch-linkbox { display: flex; gap: 8px; margin-top: 8px; }
.ch-linkbox input { flex: 1; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border-default); background: var(--bg-canvas); font-family: inherit; direction: ltr; text-align: left; font-size: .9rem; }

/* ── لوحة تحدّياتي ── */
.ch-mine-card { }
.ch-mine-card .stat { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0; }
.ch-mine-card .stat b { font-size: 1.15rem; }
.ch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.ch-pill.win { background: var(--accent-subtle, #fef3c7); color: var(--accent); }
.ch-pill.live { background: #dcfce7; color: #166534; }

/* ── هديّة / upsell ── */
.ch-prod { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1.5px solid var(--border-default); background: var(--bg-surface); }
.ch-prod img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--bg-subtle); }
.ch-prod .nm { font-weight: 700; }
.ch-prod .pr { color: var(--primary); font-weight: 800; }
.ch-upsell { display: grid; gap: 10px; margin: 12px 0; }
.ch-upsell label { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1.5px solid var(--border-default); background: var(--bg-surface); cursor: pointer; }
.ch-upsell label.on { border-color: var(--primary); background: var(--primary-subtle, #eef2ff); }
.ch-upsell input { accent-color: var(--primary); }
.ch-total { display: flex; justify-content: space-between; align-items: center; font-size: 1.15rem; font-weight: 800; margin: 14px 0; }

/* ── toast ── */
.ch-toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
    background: var(--bg-inverse, #111); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 700; z-index: 9999;
    opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.ch-toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

.ch-hide { display: none !important; }

/* ============ المسابقات (Campaign) — راقٍ لا سحوبات ============ */
.cm-hero { text-align: center; padding: 8px 0 4px; }
.cm-prize-img { width: 100%; max-width: 320px; margin: 14px auto; border-radius: 22px; display: block; box-shadow: 0 18px 50px -18px var(--primary); }
.cm-badge-prize { display: inline-flex; align-items: center; gap: 8px; background: var(--accent-subtle, #fef3c7); color: var(--accent); font-weight: 800; padding: 8px 16px; border-radius: 999px; font-size: .95rem; }
.cm-countdown { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.cm-cd-box { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 12px 6px; min-width: 66px; text-align: center; }
.cm-cd-box b { font-size: 1.6rem; font-weight: 800; display: block; line-height: 1; color: var(--primary); }
.cm-cd-box span { font-size: .72rem; opacity: .7; }
.cm-locked { text-align: center; font-weight: 800; font-size: 1.2rem; margin: 14px 0; }
.cm-section { margin-top: 22px; }
.cm-section h3 { font-weight: 800; font-size: 1.15rem; margin-bottom: 10px; }
.cm-checklist { display: grid; gap: 8px; }
.cm-check { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; background: var(--bg-surface); border: 1px solid var(--border-subtle); }
.cm-check .mk { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 24px; font-weight: 800; }
.cm-check.on .mk { background: #dcfce7; color: #166534; } .cm-check.off .mk { background: var(--bg-subtle); color: var(--border-strong); }
.cm-progressbar { height: 12px; border-radius: 999px; background: var(--bg-subtle); overflow: hidden; margin: 10px 0; }
.cm-progressbar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .5s ease; }
.cm-rankbox { text-align: center; padding: 18px; border-radius: 18px; background: linear-gradient(135deg, var(--primary-subtle, #eef2ff), var(--accent-subtle, #fef3c7)); }
.cm-rankbox .num { font-size: 2.4rem; font-weight: 800; }
.cm-winner { text-align: center; padding: 30px 0; }
.cm-winner .crown { font-size: 3.4rem; }
.cm-winner .name { font-size: 1.8rem; font-weight: 800; margin: 6px 0; }
/* شارة/بانر داخل صفحات التحدّي (غير مزعج) */
.cm-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 18px; margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary-subtle, #eef2ff), var(--accent-subtle, #fef3c7)); text-decoration: none; color: var(--c-ink); }
.cm-banner .emo { font-size: 1.8rem; }
.cm-banner .tx { flex: 1; }
.cm-banner .tx b { display: block; font-weight: 800; }
.cm-banner .tx span { font-size: .85rem; opacity: .8; }
.cm-banner .go { font-weight: 800; color: var(--primary); white-space: nowrap; }
.cm-terms { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: 16px; padding: 18px; line-height: 1.9; }

@media (prefers-reduced-motion: reduce) {
    .ch-scene, .ch-result, .ch-result .emoji { animation: none !important; }
    .ch-btn:active { transform: none; }
}
