/* ========================================
   المسابقة الكبرى - التصميم الاحترافي
   أحد مشاريع شؤون إسلامية
======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent
}

:root {
    --bg: #030816;
    --bg2: #05102a;
    --bg3: #0a183d;
    --gold: #d4a017;
    --gold-l: #fadd70;
    --gold-d: #b8860b;
    --green: #1b8a2e;
    --green-l: #4caf50;
    --blue: #1a5fb4;
    --blue-l: #42a5f5;
    --red: #e53935;
    --red-l: #ff5252;
    --purple: #7c3aed;
    --purple-l: #a78bfa;
    --teal: #0d9488;
    --text: #f5f0e8;
    --text2: #d1c8b4;
    --text3: #998d75;
    --card: rgba(10, 24, 61, 0.5);
    --card2: rgba(10, 24, 61, 0.8);
    --border: rgba(212, 160, 23, 0.2);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --radius: 16px;
    --radius-lg: 24px;
}

html,
body {
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    user-select: none;
    -webkit-user-select: none;
    font-feature-settings: 'tnum';
    -moz-font-feature-settings: 'tnum';
    -webkit-font-feature-settings: 'tnum';
}

/* ===== الشاشات ===== */
.screen {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1
}

.screen.active {
    display: flex
}

.screen.fade-in {
    animation: fadeIn .4s ease-out
}

.screen.slide-in {
    animation: slideIn .4s ease-out
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-30px);
        opacity: 0
    }

    to {
        transform: translateX(0);
        opacity: 1
    }
}

/* ===== الأزرار ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .75rem 2rem;
    border-radius: 50px;
    border: none;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, .2), transparent);
    opacity: 0;
    transition: opacity .25s;
}

.btn:active::after {
    opacity: 1
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-l), var(--gold-d));
    color: #030816;
    font-weight: 800;
    box-shadow: 0 4px 20px rgba(212, 160, 23, .3);
}

.btn-gold:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(212, 160, 23, .5)
}

.btn-gold:active {
    transform: scale(.97)
}

.btn-green {
    background: linear-gradient(135deg, var(--green), #0d5e1a);
    color: white;
    box-shadow: 0 4px 20px rgba(27, 138, 46, .4);
}

.btn-outline {
    background: transparent;
    color: var(--gold);
    border: 2px solid rgba(212, 160, 23, .4);
}

.btn-outline:hover {
    background: rgba(212, 160, 23, .1);
    border-color: var(--gold)
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.15rem
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--card2);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.btn-icon:hover {
    background: var(--card);
    transform: scale(1.1)
}

.btn-arrow {
    font-size: 1.3rem;
    transition: transform .2s
}

.btn:hover .btn-arrow {
    transform: translateX(-4px)
}

/* ===== شاشة البداية ===== */
#screen-start {
    background: linear-gradient(160deg, #030816 0%, #05102a 40%, #0a183d 70%, #030816 100%);
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
}

.stars-bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, .3), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(255, 255, 255, .2), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, .4), transparent),
        radial-gradient(1px 1px at 10% 80%, rgba(255, 255, 255, .2), transparent),
        radial-gradient(2px 2px at 70% 60%, rgba(255, 255, 255, .15), transparent),
        radial-gradient(1px 1px at 40% 20%, rgba(255, 255, 255, .3), transparent),
        radial-gradient(1px 1px at 90% 90%, rgba(255, 255, 255, .2), transparent),
        radial-gradient(2px 2px at 30% 70%, rgba(255, 255, 255, .1), transparent);
    animation: twinkle 4s ease-in-out infinite alternate;
}

.stars-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(30deg, rgba(212,160,23,0.03) 12%, transparent 12.5%, transparent 87%, rgba(212,160,23,0.03) 87.5%),
        linear-gradient(150deg, rgba(212,160,23,0.03) 12%, transparent 12.5%, transparent 87%, rgba(212,160,23,0.03) 87.5%),
        linear-gradient(30deg, rgba(212,160,23,0.03) 12%, transparent 12.5%, transparent 87%, rgba(212,160,23,0.03) 87.5%),
        linear-gradient(150deg, rgba(212,160,23,0.03) 12%, transparent 12.5%, transparent 87%, rgba(212,160,23,0.03) 87.5%),
        linear-gradient(60deg, rgba(212,160,23,0.02) 25%, transparent 25.5%, transparent 75%, rgba(212,160,23,0.02) 75%),
        linear-gradient(60deg, rgba(212,160,23,0.02) 25%, transparent 25.5%, transparent 75%, rgba(212,160,23,0.02) 75%);
    background-size: 80px 140px;
    background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0, 40px 70px;
    opacity: 0.5;
    pointer-events: none;
}

@keyframes twinkle {
    0% { opacity: .6 }
    100% { opacity: 1 }
}

.start-container {
    text-align: center;
    z-index: 2;
    padding: 1.8rem 1.5rem 2rem;
    max-width: 440px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: auto;
}

/* ===== الزخارف الإسلامية ===== */
.ornament-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: -4px;
}

.ornament-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.ornament-star {
    color: var(--gold);
    font-size: 1.2rem;
    opacity: 0.7;
    animation: float 3s ease-in-out infinite;
}

.ornament-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: -4px;
}

.ornament-line-short {
    width: 40px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,160,23,0.4), transparent);
}

.ornament-dots {
    color: var(--gold);
    font-size: 0.5rem;
    opacity: 0.5;
    letter-spacing: 4px;
}

@keyframes float {
    0%, 100% { transform: translateY(0) }
    50% { transform: translateY(-12px) }
}

@keyframes pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .5 }
    50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1 }
}

.title {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.9rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-l) 0%, var(--gold) 40%, var(--gold-l) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
    letter-spacing: 2px;
    filter: drop-shadow(0 2px 8px rgba(212,160,23,0.3));
}

.subtitle {
    font-size: 0.85rem;
    color: var(--text2);
    margin-bottom: 0;
    letter-spacing: 0.5px;
}

/* ===== بطاقة النموذج الزجاجية ===== */
/* بطاقة الترحيب بالعائدين */
.welcome-back-card {
    background: linear-gradient(135deg, rgba(212, 160, 23, 0.15), rgba(76, 175, 80, 0.1));
    border: 1px solid rgba(212, 160, 23, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.welcome-back-greeting {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    color: var(--text1);
    margin-bottom: 0.8rem;
}

.welcome-back-greeting i {
    color: var(--gold);
    font-size: 1.5rem;
}

.welcome-back-greeting strong {
    color: var(--gold);
}

.welcome-back-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--text2);
}

.welcome-back-stats span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== بطاقات أوضاع اللعب ===== */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    width: 100%;
    margin: 0.5rem 0;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
    width: 100%;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.mode-card:hover::before {
    opacity: 1;
}

.mode-card:active {
    transform: scale(0.97);
}

.mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 14px;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.mode-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.mode-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.mode-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
}

/* وضع الماراثون */
.mode-marathon {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.2), rgba(244, 67, 54, 0.15));
    border-color: rgba(255, 152, 0, 0.3);
}
.mode-marathon::before {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.3), rgba(244, 67, 54, 0.2));
}
.mode-marathon .mode-icon {
    background: linear-gradient(135deg, #FF9800, #F44336);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

/* المستويات */
.mode-levels {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.2), rgba(103, 58, 183, 0.15));
    border-color: rgba(33, 150, 243, 0.3);
}
.mode-levels::before {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.3), rgba(103, 58, 183, 0.2));
}
.mode-levels .mode-icon {
    background: linear-gradient(135deg, #2196F3, #673AB7);
    color: #fff;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

/* التحدي اليومي */
.mode-daily {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2), rgba(0, 188, 212, 0.15));
    border-color: rgba(76, 175, 80, 0.3);
}
.mode-daily::before {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3), rgba(0, 188, 212, 0.2));
}
.mode-daily .mode-icon {
    background: linear-gradient(135deg, #4CAF50, #00BCD4);
    color: #fff;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

/* أنيميشن ظهور البطاقات */
.mode-card:nth-child(1) { animation: fadeInUp 0.4s ease 0.1s both; }
.mode-card:nth-child(2) { animation: fadeInUp 0.4s ease 0.2s both; }
.mode-card:nth-child(3) { animation: fadeInUp 0.4s ease 0.3s both; }

/* ===== Overlay نموذج المستويات ===== */
.levels-form-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
}

.levels-form-card {
    background: rgba(10, 24, 61, 0.95);
    border: 1px solid rgba(212, 160, 23, 0.2);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    animation: fadeInUp 0.4s ease;
}

.levels-form-card .form-close-btn {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.levels-form-card .form-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text1);
}

.levels-form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.levels-form-header h3 {
    font-size: 1.3rem;
    color: var(--text1);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-close-form {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-close-form:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text1);
}

.levels-form-body {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.levels-form-body .input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* زر إعادة التعيين */
.btn-reset-player {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text2);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0.6rem;
    font-family: inherit;
}

.btn-reset-player:hover {
    border-color: rgba(244, 67, 54, 0.4);
    color: #F44336;
    background: rgba(244, 67, 54, 0.1);
}

/* ===== Light mode overrides ===== */
body.light-mode .mode-marathon {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.12), rgba(244, 67, 54, 0.08));
    border-color: rgba(255, 152, 0, 0.25);
}
body.light-mode .mode-levels {
    background: linear-gradient(135deg, rgba(33, 150, 243, 0.12), rgba(103, 58, 183, 0.08));
    border-color: rgba(33, 150, 243, 0.25);
}
body.light-mode .mode-daily {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.12), rgba(0, 188, 212, 0.08));
    border-color: rgba(76, 175, 80, 0.25);
}
body.light-mode .mode-title {
    color: var(--text1);
}
body.light-mode .mode-desc {
    color: var(--text2);
}
body.light-mode .levels-form-card {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(212, 160, 23, 0.15);
}
body.light-mode .levels-form-card .form-close-btn {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text2);
}
body.light-mode .btn-reset-player {
    border-color: rgba(0, 0, 0, 0.12);
}

.form-card {
    background: rgba(10, 24, 61, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(212, 160, 23, 0.15);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-l), transparent);
    opacity: 0.4;
}

.input-group {
    text-align: right;
    margin-bottom: 0;
}

.input-group label,
.age-group label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .85rem;
    color: var(--text2);
    margin-bottom: .4rem;
    font-weight: 500;
}

.input-group label i,
.age-group label i {
    color: var(--gold);
    font-size: 0.8rem;
    opacity: 0.7;
}

.input-group input {
    width: 100%;
    padding: .7rem 1rem;
    border-radius: 12px;
    border: 1.5px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1rem;
    text-align: center;
    transition: all .3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--gold);
    background: rgba(212, 160, 23, .04);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, .08), 0 0 20px rgba(212, 160, 23, .06);
}

.input-group input::placeholder {
    color: var(--text3)
}

/* ===== أزرار البدء ===== */
.start-buttons-row {
    display: flex;
    gap: .6rem;
    width: 100%;
}

.start-buttons-row .btn {
    flex: 1;
    padding: .85rem .5rem;
    font-size: 1rem;
}

.start-buttons-row .study-link {
    text-decoration: none;
    font-size: .9rem;
}

#btn-start {
    width: 100%;
    margin-top: 0;
    padding: .85rem 2rem;
    font-size: 1.05rem;
}

#btn-start:not(:disabled) {
    animation: btn-glow 2s ease-in-out infinite alternate;
}

@keyframes btn-glow {
    0% { box-shadow: 0 4px 20px rgba(212,160,23,0.3); }
    100% { box-shadow: 0 4px 30px rgba(212,160,23,0.5), 0 0 60px rgba(212,160,23,0.15); }
}

#btn-start:disabled {
    opacity: .35;
    cursor: not-allowed;
    transform: none !important;
    animation: none;
}

#btn-continue {
    width: 100%;
    margin-bottom: 0;
}

/* ===== بطاقات الميزات ===== */
.start-features {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.feature-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    background: rgba(212, 160, 23, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.12);
    border-radius: 10px;
    flex: 1;
    min-width: 80px;
    max-width: 140px;
    transition: all .3s;
    justify-content: center;
}

.feature-card:hover {
    background: rgba(212, 160, 23, 0.08);
    border-color: rgba(212, 160, 23, 0.25);
    transform: translateY(-1px);
}

.feature-icon {
    font-size: 0.95rem;
    color: var(--gold);
    filter: drop-shadow(0 0 4px rgba(212,160,23,0.3));
}

.feature-text {
    font-size: 0.68rem;
    color: var(--text2);
    font-weight: 600;
    white-space: nowrap;
}

/* ===== تلميح الفئة العمرية ===== */
.age-hint {
    display: block;
    font-size: .75rem;
    color: var(--gold-l);
    margin-top: .3rem;
    min-height: 1.2em;
    text-align: center;
}

/* ===== تصنيفات المحتوى ===== */
.start-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
}

.cat-tag {
    font-size: .65rem;
    padding: .2rem .65rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    color: var(--text3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all .3s;
}

.cat-tag i {
    color: var(--gold);
    opacity: 0.6;
    font-size: 0.6rem;
}

.cat-tag:hover {
    background: rgba(212,160,23,0.06);
    border-color: rgba(212,160,23,0.15);
    color: var(--text2);
}

/* ===== أزرار الفئة العمرية والجنس ===== */
.age-group {
    text-align: right;
    margin-bottom: 0;
}

.age-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: .5rem;
}

.gender-options {
    display: flex;
    gap: .6rem;
}

.age-btn,
.gender-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    padding: .45rem .3rem;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    cursor: pointer;
    transition: all .3s ease;
    position: relative;
    overflow: hidden;
}

.gender-btn {
    flex: 1;
    padding: .55rem .5rem;
}

.gender-btn .gender-label {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
}

.gender-btn[data-gender="M"] {
    background: rgba(33, 150, 243, 0.1);
    border-color: rgba(33, 150, 243, 0.2);
}

.gender-btn[data-gender="M"]:hover {
    background: rgba(33, 150, 243, 0.18);
    border-color: rgba(33, 150, 243, 0.35);
}

.gender-btn[data-gender="F"] {
    background: rgba(156, 39, 176, 0.1);
    border-color: rgba(156, 39, 176, 0.2);
}

.gender-btn[data-gender="F"]:hover {
    background: rgba(156, 39, 176, 0.18);
    border-color: rgba(156, 39, 176, 0.35);
}

.age-btn:hover,
.gender-btn:hover {
    border-color: rgba(212, 160, 23, .3);
    background: rgba(212, 160, 23, .05);
}

.age-btn:active,
.gender-btn:active {
    transform: scale(.96)
}

.age-btn.selected,
.gender-btn.selected {
    border-color: var(--gold);
    background: rgba(212, 160, 23, .1);
    box-shadow: 0 0 20px rgba(212, 160, 23, .15), inset 0 0 20px rgba(212, 160, 23, .05);
}

.age-btn.selected::before,
.gender-btn.selected::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(212, 160, 23, .08), transparent);
    pointer-events: none;
}

.age-emoji,
.gender-emoji {
    font-size: 1.05rem;
    line-height: 1;
    transition: transform .3s;
}

.age-btn.selected .age-emoji,
.gender-btn.selected .gender-emoji {
    transform: scale(1.1);
}

/* ألوان أيقونات الفئات العمرية */
.age-btn[data-age="7"] .age-emoji { color: #66bb6a; }
.age-btn[data-age="11"] .age-emoji { color: #42a5f5; }
.age-btn[data-age="15"] .age-emoji { color: #ab47bc; }
.age-btn[data-age="25"] .age-emoji { color: #ef5350; }

/* أزرار الجنس المحددة */
.gender-btn.selected[data-gender="M"] {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.5);
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.15), inset 0 0 20px rgba(33, 150, 243, 0.05);
}

.gender-btn.selected[data-gender="F"] {
    background: rgba(156, 39, 176, 0.2);
    border-color: rgba(156, 39, 176, 0.5);
    box-shadow: 0 0 20px rgba(156, 39, 176, 0.15), inset 0 0 20px rgba(156, 39, 176, 0.05);
}

.age-range {
    font-size: .78rem;
    font-weight: 700;
    color: var(--gold-l)
}

.age-level {
    display: none;
}

.gender-label {
    font-size: .65rem;
    color: var(--text3);
    font-weight: 600;
    transition: color .3s;
}

.age-btn.selected .age-level,
.gender-btn.selected .gender-label {
    color: var(--gold-l)
}

@media(max-width:400px) {
    .title {
        font-size: 1.7rem;
    }

    .start-buttons-row {
        flex-direction: column;
    }
}

@media(max-width:360px) {
    .age-options {
        grid-template-columns: repeat(2, 1fr);
        gap: .4rem
    }

    .age-btn {
        padding: .4rem .3rem
    }

    .age-emoji {
        font-size: .95rem
    }

    .age-range {
        font-size: .72rem
    }

    .form-card {
        padding: 1rem .8rem;
    }

    .feature-card {
        min-width: 70px;
        padding: .4rem .5rem;
    }

    .start-container {
        padding: 1.5rem 1rem 2rem;
    }
}

/* ===== شاشة المستويات ===== */
#screen-levels {
    background: linear-gradient(180deg, #050520, #0a0a3a, #0f1045)
}

.levels-top-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(212, 160, 23, .12), rgba(212, 160, 23, .04));
    border-bottom: 1px solid rgba(212, 160, 23, .2);
    cursor: pointer;
    transition: background .2s;
}

.levels-top-banner:hover {
    background: rgba(212, 160, 23, .18)
}

.banner-icon {
    font-size: 1.3rem
}

.banner-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: .5px;
}

.levels-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .8rem 1rem;
    background: rgba(0, 0, 0, .3);
    border-bottom: 1px solid var(--border);
    z-index: 10;
    flex-shrink: 0;
}

.player-info {
    display: flex;
    align-items: center;
    gap: .6rem
}

.player-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-d));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 0 15px rgba(212, 160, 23, .3);
}

.player-details {
    display: flex;
    flex-direction: column
}

.player-name-display {
    font-weight: 700;
    font-size: .95rem
}

.player-stars-count {
    font-size: .75rem;
    color: var(--gold-l)
}

.header-score {
    text-align: center
}

.score-label {
    display: block;
    font-size: .65rem;
    color: var(--text3);
    text-transform: uppercase
}

.score-value {
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--gold-l)
}

.levels-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.levels-scroll::-webkit-scrollbar {
    width: 4px
}

.levels-scroll::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 23, .2);
    border-radius: 2px
}

/* عوالم ومستويات */
.world-section {
    margin-bottom: 2rem;
    position: relative
}

.world-header {
    text-align: center;
    padding: .8rem;
    margin-bottom: 1rem;
    border-radius: var(--radius);
    position: relative;
}

.world-header h3 {
    font-size: 1.1rem;
    margin-bottom: .2rem
}

.world-header p {
    font-size: .75rem;
    opacity: .7
}

.world-levels {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    position: relative;
}

/* خط المسار */
.world-levels::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: rgba(255, 255, 255, .08);
    border-radius: 2px;
    transform: translateX(-50%);
}

.level-node {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    max-width: 320px;
    padding: .4rem;
    cursor: pointer;
    transition: all .3s;
}

.level-node:nth-child(odd) {
    flex-direction: row;
    padding-right: 2rem
}

.level-node:nth-child(even) {
    flex-direction: row-reverse;
    padding-left: 2rem
}

.level-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 900;
    position: relative;
    transition: all .3s;
}

.level-circle.locked {
    background: rgba(255, 255, 255, .05);
    color: var(--text3);
    border: 3px solid rgba(255, 255, 255, .1);
}

.level-circle.current {
    background: linear-gradient(135deg, var(--gold), var(--gold-d));
    color: #1a1000;
    border: 3px solid var(--gold-l);
    box-shadow: 0 0 25px rgba(212, 160, 23, .5);
    animation: pulseNode 2s ease-in-out infinite;
}

@keyframes pulseNode {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(212, 160, 23, .4)
    }

    50% {
        box-shadow: 0 0 30px rgba(212, 160, 23, .7)
    }
}

.level-circle.completed {
    background: linear-gradient(135deg, var(--green), #0d5e1a);
    color: white;
    border: 3px solid var(--green-l);
}

.level-circle .lock-icon {
    font-size: 1.1rem
}

.level-info {
    flex: 1
}

.level-info .level-name {
    font-weight: 700;
    font-size: .9rem;
    display: block
}

.level-info .level-stars {
    font-size: .75rem;
    letter-spacing: 2px;
    display: block;
    margin-top: .1rem
}

.level-info .level-stars .star-empty {
    opacity: .25
}

/* ===== شاشة اللعب ===== */
#screen-game {
    background: linear-gradient(180deg, #0a0a30, #0f0f40);
    padding-top: 60px;
}

.game-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 50;
}

.game-progress {
    text-align: center
}

#q-counter {
    font-size: .8rem;
    color: var(--text2);
    display: block
}

.progress-bar-mini {
    width: 120px;
    height: 5px;
    background: rgba(255, 255, 255, .1);
    border-radius: 3px;
    margin-top: .2rem;
    overflow: hidden;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, var(--gold), var(--gold-l));
    border-radius: 3px;
    transition: width .4s ease;
}

.game-score-live {
    text-align: center
}

#live-score {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--gold-l);
    display: block
}

.score-label-sm {
    font-size: .65rem;
    color: var(--text3)
}

/* المؤقت */
.timer-container {
    width: 80px;
    height: 80px;
    margin: 1rem auto .5rem;
    position: relative;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg)
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, .08);
    stroke-width: 6
}

.timer-ring {
    fill: none;
    stroke: var(--gold);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 276.46;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset .5s linear, stroke .3s;
}

.timer-ring.warning {
    stroke: var(--red)
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    font-weight: 900;
}

.timer-text.warning {
    color: var(--red);
    animation: blink .5s infinite
}

@keyframes blink {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .4
    }
}

/* الشارة */
.streak-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    margin-bottom: .5rem;
    animation: bounceIn .4s;
}

.streak-fire {
    font-size: 1.3rem
}

.streak-count {
    font-size: 1.1rem;
    font-weight: 900;
    color: #ff9800
}

@keyframes bounceIn {
    0% {
        transform: scale(0)
    }

    50% {
        transform: scale(1.3)
    }

    100% {
        transform: scale(1)
    }
}

/* فئة السؤال */
.question-category {
    text-align: center;
    font-size: .8rem;
    color: var(--text3);
    margin-bottom: .5rem;
}

/* بطاقة السؤال */
.question-card {
    margin: 0 1rem .8rem;
    padding: 1.2rem 1.5rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
    backdrop-filter: blur(5px);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.question-text {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.8
}

/* الخيارات */
.options-container {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: .6rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .9rem 1.2rem;
    border-radius: var(--radius);
    border: 2px solid rgba(255, 255, 255, .1);
    background: var(--card);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s;
    text-align: right;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    border-color: rgba(255, 255, 255, .25);
    background: var(--card2)
}

.option-btn:active {
    transform: scale(.98)
}

.option-btn .option-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: rgba(255, 255, 255, .08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    font-weight: 900;
}

.option-btn .option-text {
    flex: 1
}

.option-btn.correct {
    border-color: var(--green-l) !important;
    background: rgba(27, 138, 46, .2) !important;
    animation: correctPop .4s ease;
}

.option-btn.correct .option-letter {
    background: var(--green);
    color: white
}

.option-btn.wrong {
    border-color: var(--red) !important;
    background: rgba(229, 57, 53, .15) !important;
    animation: shake .4s ease;
}

.option-btn.wrong .option-letter {
    background: var(--red);
    color: white
}

.option-btn.disabled {
    pointer-events: none;
    opacity: .6
}

@keyframes correctPop {
    0% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.03)
    }

    100% {
        transform: scale(1)
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0)
    }

    25% {
        transform: translateX(-8px)
    }

    75% {
        transform: translateX(8px)
    }
}

/* صح أم خطأ */
.tf-container {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.tf-btn {
    flex: 1;
    padding: 1.2rem;
    border-radius: var(--radius-lg);
    border: 2px solid rgba(255, 255, 255, .1);
    background: var(--card);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s;
    text-align: center;
}

.tf-btn:hover {
    border-color: rgba(255, 255, 255, .25)
}

.tf-btn .tf-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: .3rem
}

.tf-btn.correct {
    border-color: var(--green-l) !important;
    background: rgba(27, 138, 46, .2) !important
}

.tf-btn.wrong {
    border-color: var(--red) !important;
    background: rgba(229, 57, 53, .15) !important
}

/* الترتيب */
.order-container {
    padding: 0 1rem;
    max-width: 500px;
    margin: 0 auto;
    width: 100%
}

.order-slots {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-bottom: .8rem
}

.order-slot {
    padding: .7rem 1rem;
    border-radius: var(--radius);
    border: 2px dashed rgba(255, 255, 255, .15);
    background: rgba(255, 255, 255, .02);
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    color: var(--text3);
    transition: all .2s;
}

.order-slot.filled {
    border-style: solid;
    border-color: var(--gold);
    background: rgba(212, 160, 23, .1);
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}

.order-items {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center
}

.order-item {
    padding: .6rem 1rem;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, .15);
    background: var(--card);
    color: var(--text);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

.order-item:hover {
    border-color: var(--gold);
    background: rgba(212, 160, 23, .1)
}

.order-item.used {
    opacity: .3;
    pointer-events: none
}

.order-check-btn {
    display: block;
    margin: .8rem auto 0;
    padding: .6rem 2rem;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, var(--gold), var(--gold-d));
    color: #1a1000;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all .2s;
}

.order-check-btn:disabled {
    opacity: .3;
    cursor: not-allowed
}

/* التوضيح */
.explanation-card {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: rgba(10, 10, 40, .97);
    border-top: 2px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    text-align: center;
    z-index: 60;
    animation: slideUp .3s ease-out;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

@keyframes slideUp {
    from {
        transform: translateY(100%)
    }

    to {
        transform: translateY(0)
    }
}

.explanation-icon {
    font-size: 2.5rem;
    margin-bottom: .5rem
}

.explanation-answer {
    display: inline-block;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 8px 18px;
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gold);
    line-height: 1.6;
    text-align: center;
}

.explanation-answer.timeout {
    background: rgba(244, 67, 54, 0.12);
    border-color: rgba(244, 67, 54, 0.35);
    color: #ff6b6b;
}

.explanation-answer .answer-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text3);
    margin-bottom: 2px;
}

.explanation-answer .answer-value {
    font-size: 1rem;
    font-weight: 700;
}

.explanation-text {
    font-size: .95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--text2)
}

/* صف أزرار بطاقة الشرح */
.explanation-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
}

.explanation-actions .btn-report-error {
    flex: 0 0 auto;
}

#btn-next-q {
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 220px;
    text-align: center;
}

.explanation-actions .btn-favorite {
    flex: 0 0 auto;
}

/* ===== شاشة النتائج ===== */
#screen-results {
    background: linear-gradient(180deg, #050520, #0a0a3a);
    align-items: center;
    justify-content: center;
}

.results-container {
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 420px;
    width: 100%;
    animation: fadeIn .5s ease-out;
}

.results-badge {
    font-size: 4rem;
    margin-bottom: .5rem
}

.results-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--gold-l)
}

.results-stars {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 8px
}

.results-stars .star-empty {
    opacity: .2
}

.results-stats {
    display: flex;
    gap: .8rem;
    justify-content: center;
    margin-bottom: 2rem
}

.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .8rem 1rem;
    min-width: 80px;
}

.stat-num {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold-l)
}

.stat-label {
    font-size: .7rem;
    color: var(--text3)
}

.results-buttons {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    align-items: center
}

.results-buttons .btn {
    min-width: 240px
}

/* ===== شاشة شهادة التقدير ===== */
#screen-prize {
    background: linear-gradient(180deg, #0a0520, #15082e, #0a0a30);
    align-items: center;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
}

.prize-container {
    text-align: center;
    padding: 2.5rem 1.5rem 3rem;
    max-width: 440px;
    width: 100%;
    position: relative;
    margin: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prize-trophy {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
    color: var(--gold);
    filter: drop-shadow(0 0 30px rgba(212, 160, 23, .5));
}

.prize-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-l) 0%, var(--gold) 40%, var(--gold-l) 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    filter: drop-shadow(0 2px 8px rgba(212,160,23,0.3));
}

.prize-subtitle {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}

.prize-desc {
    font-size: .9rem;
    color: var(--gold-l);
    margin-bottom: .5rem;
}

/* ===== بطاقة الشهادة ===== */
.cert-card {
    background: rgba(10, 24, 61, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px solid rgba(212, 160, 23, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.8rem 1.3rem;
    margin: .5rem 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-l), transparent);
    opacity: 0.5;
}

.cert-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-l), transparent);
    opacity: 0.5;
}

.cert-text {
    font-size: .95rem;
    color: var(--text2);
    line-height: 1.8;
    max-width: 320px;
}

/* دائرة النسبة المئوية */
.cert-percentage-wrap {
    display: flex;
    justify-content: center;
}

.cert-percentage {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(212,160,23,0.15), rgba(212,160,23,0.05));
    border: 3px solid var(--gold);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    box-shadow: 0 0 30px rgba(212,160,23,0.2), inset 0 0 20px rgba(212,160,23,0.05);
}

.cert-percent-num {
    font-family: 'Tajawal', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--gold-l);
    line-height: 1;
}

.cert-percent-label {
    font-size: .6rem;
    color: var(--text3);
    font-weight: 500;
}

/* نجوم الشهادة */
.cert-stars {
    display: flex;
    justify-content: center;
    gap: 3px;
    flex-wrap: wrap;
    max-width: 280px;
}

.cert-stars i {
    font-size: .85rem;
    color: var(--gold);
    filter: drop-shadow(0 0 3px rgba(212,160,23,0.4));
}

.cert-date {
    font-size: .75rem;
    color: var(--text3);
}

/* ===== الإحصائيات النهائية ===== */
.final-stats {
    display: flex;
    justify-content: center;
    gap: .6rem;
    margin: .5rem 0;
    flex-wrap: wrap;
}

.final-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: .7rem 1rem;
    background: rgba(212, 160, 23, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.12);
    border-radius: 12px;
    flex: 1;
    min-width: 85px;
    max-width: 110px;
}

.final-stat i {
    font-size: 1.2rem;
    color: var(--gold);
}

.final-stat-num {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-l);
}

.final-stat-label {
    font-size: .6rem;
    color: var(--text3);
}

#btn-share {
    width: 100%;
}

#btn-restart-quiz {
    width: 100%;
}

/* الكونفتي */
.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0);
        opacity: 1
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0
    }
}

/* ===== الصوت ===== */
.sound-btn {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .2s;
}

.sound-btn:hover {
    background: var(--card2)
}

.sound-btn.muted {
    opacity: .4
}

/* ===== المسار بين المستويات ===== */
.path-connector {
    width: 4px;
    height: 30px;
    background: rgba(255, 255, 255, .08);
    margin: 0 auto;
    border-radius: 2px;
}

.path-connector.completed {
    background: rgba(76, 175, 80, .3)
}

/* ===== تجاوب ===== */
@media(max-width:400px) {
    .title {
        font-size: 2.2rem
    }

    .logo-icon {
        font-size: 3.5rem
    }

    .question-text {
        font-size: 1rem
    }

    .option-btn {
        padding: .7rem 1rem;
        font-size: .9rem
    }

    .option-btn .option-letter {
        width: 28px;
        height: 28px;
        font-size: .75rem
    }

    .timer-container {
        width: 65px;
        height: 65px
    }

    .timer-text {
        font-size: 1.3rem
    }

    .results-stars {
        font-size: 2rem
    }

    .stat-box {
        min-width: 70px;
        padding: .6rem
    }

    .stat-num {
        font-size: 1.2rem
    }

    .level-circle {
        width: 48px;
        height: 48px;
        font-size: 1.1rem
    }

    .level-info .level-name {
        font-size: .8rem
    }

    .prize-title {
        font-size: 1.8rem
    }

    .prize-code {
        font-size: 1.4rem;
        letter-spacing: 4px
    }
}

@media(min-width:600px) {
    .options-container {
        max-width: 550px
    }

    .question-card {
        margin: 0 auto .8rem;
        max-width: 600px
    }
}

/* ===== تأثيرات إضافية ===== */
.points-popup {
    position: fixed;
    pointer-events: none;
    z-index: 100;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--gold-l);
    animation: pointsFloat 1s ease-out forwards;
}

@keyframes pointsFloat {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1
    }

    100% {
        transform: translateY(-80px) scale(1.5);
        opacity: 0
    }
}

/* حركة القلب للإجابة الصحيحة */
.heart-burst {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    pointer-events: none;
    z-index: 100;
    animation: heartBurst .6s ease-out forwards;
}

@keyframes heartBurst {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1
    }

    50% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: .8
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0
    }
}

/* ===== عنصر مشروع شؤون إسلامية ===== */
.project-tag {
    font-size: .75rem;
    color: var(--text3);
    margin-top: -2px;
    margin-bottom: 0;
    opacity: 0.7;
    letter-spacing: 0.3px;
}

.study-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-color: rgba(100, 181, 246, 0.3);
    color: var(--blue-l);
    background: rgba(26, 95, 180, 0.08);
}

.study-link:hover {
    background: rgba(26, 95, 180, 0.15);
    border-color: rgba(100, 181, 246, 0.5);
    color: #90caf9;
}

.start-nav-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(212, 160, 23, .1);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.start-nav-links a {
    color: var(--text3);
    text-decoration: none;
    font-size: .75rem;
    transition: color .2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.start-nav-links a:hover {
    color: var(--gold-l);
}

.start-nav-links a i {
    font-size: .65rem;
    opacity: 0.6;
}

.nav-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text3);
    opacity: 0.4;
}

/* ===== أزرار أسفل الخيارات ===== */
.game-actions {
    display: flex;
    justify-content: center;
    gap: .6rem;
    margin-top: 10px;
    padding: 0 1rem;
}

.game-action-btn {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 1rem;
    border-radius: 50px;
    border: 1.5px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: var(--text2);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
}

.game-action-btn:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .2)
}

.game-action-btn:active {
    transform: scale(.95)
}

.game-action-btn:disabled {
    opacity: .3;
    cursor: not-allowed;
    pointer-events: none
}

.action-icon {
    font-size: 1.1rem;
    line-height: 1
}

.action-text {
    white-space: nowrap
}

.action-swap {
    border-color: rgba(66, 165, 245, .3);
    color: var(--blue-l)
}

.action-swap:hover {
    background: rgba(66, 165, 245, .1);
    border-color: rgba(66, 165, 245, .5)
}

.action-reveal {
    border-color: rgba(240, 208, 96, .3);
    color: var(--gold-l)
}

.action-reveal:hover {
    background: rgba(240, 208, 96, .1);
    border-color: rgba(240, 208, 96, .5)
}

/* ===== نافذة التعليمات ===== */
.instr-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 5, 20, .92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn .3s ease-out;
}

.instr-card {
    background: linear-gradient(160deg, #12123a, #0a0a30);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 440px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    animation: slideUp .4s ease-out;
}

.instr-card::-webkit-scrollbar {
    width: 3px
}

.instr-card::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 23, .3);
    border-radius: 2px
}

.instr-header {
    text-align: center;
    margin-bottom: 1.2rem
}

.instr-icon {
    font-size: 2.8rem;
    display: block;
    margin-bottom: .4rem;
    filter: drop-shadow(0 0 15px rgba(212, 160, 23, .4))
}

.instr-header h2 {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-l);
}

.instr-body {
    display: flex;
    flex-direction: column;
    gap: .7rem;
    margin-bottom: 1.2rem
}

.instr-item {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .7rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: background .2s;
}

.instr-item:hover {
    background: rgba(255, 255, 255, .06)
}

.instr-item-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px
}

.instr-item strong {
    display: block;
    font-size: .9rem;
    color: var(--text);
    margin-bottom: 2px
}

.instr-item p {
    font-size: .78rem;
    color: var(--text2);
    line-height: 1.6;
    margin: 0
}

.instr-warning {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    padding: .8rem;
    border-radius: var(--radius);
    background: rgba(212, 160, 23, .08);
    border: 1.5px solid rgba(212, 160, 23, .25);
    margin-top: .3rem;
}

.instr-warn-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px
}

.instr-warning strong {
    display: block;
    font-size: .9rem;
    color: var(--gold-l);
    margin-bottom: 3px
}

.instr-warning p {
    font-size: .78rem;
    color: var(--text2);
    line-height: 1.7;
    margin: 0
}

.instr-warning p strong {
    display: inline;
    font-size: inherit;
    color: var(--gold)
}

.instr-accept {
    width: 100%;
    margin-top: .5rem
}

/* ===== زر الإعدادات ===== */
.settings-btn {
    position: fixed;
    bottom: 1rem;
    left: 3.5rem;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .2s;
}

.settings-btn:hover {
    background: var(--card2);
    transform: rotate(45deg)
}

.settings-btn:active {
    transform: scale(.9) rotate(45deg)
}

/* ===== نافذة إعدادات الصوت ===== */
.audio-settings-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(5, 5, 20, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn .25s ease-out;
}

.audio-settings-card {
    background: linear-gradient(160deg, #14143e, #0c0c32);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    max-width: 380px;
    width: 100%;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
    animation: slideUp .35s ease-out;
}

.audio-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.audio-settings-header h3 {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.1rem;
    color: var(--gold-l);
    font-weight: 700;
}

.btn-close-settings {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, .06);
    color: var(--text2);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.btn-close-settings:hover {
    background: rgba(255, 255, 255, .12);
    color: var(--text)
}

/* ===== مفاتيح كتم الصوت ===== */
.mute-toggles {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1rem;
}

.mute-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .6rem .8rem;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .06);
}

.mute-toggle-label {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.mute-toggle-label i {
    font-size: 1rem;
    color: var(--text2);
    width: 20px;
    text-align: center;
}

.mute-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    color: var(--text3);
    padding: 0;
    line-height: 1;
    transition: color .2s;
}

.mute-toggle-btn.active {
    color: var(--gold);
}

.mute-toggle-btn:hover {
    opacity: .8;
}

.settings-desc {
    font-size: .8rem;
    color: var(--text3);
    text-align: center;
    margin-bottom: .8rem;
}

.track-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: 1.2rem;
}

.track-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .9rem;
    border-radius: var(--radius);
    border: 1.5px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .03);
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
    width: 100%;
    text-align: right;
}

.track-item:hover {
    border-color: rgba(212, 160, 23, .3);
    background: rgba(212, 160, 23, .05)
}

.track-item.active {
    border-color: var(--gold);
    background: rgba(212, 160, 23, .12);
    box-shadow: 0 0 15px rgba(212, 160, 23, .15);
}

.track-item.active::after {
    content: '✓';
    margin-right: auto;
    margin-left: 0;
    color: var(--gold);
    font-weight: 900;
    font-size: 1.1rem;
}

.track-item.disabled {
    opacity: .4;
    cursor: not-allowed;
    pointer-events: none;
}

.track-icon {
    font-size: 1.3rem;
    flex-shrink: 0
}

.track-name {
    flex: 1
}

.track-soon {
    font-size: .65rem;
    color: var(--text3);
    background: rgba(255, 255, 255, .06);
    padding: .15rem .5rem;
    border-radius: 50px;
    margin-right: auto;
}

.volume-control {
    margin-top: .5rem
}

.vol-label {
    display: block;
    font-size: .8rem;
    color: var(--text2);
    margin-bottom: .5rem;
}

.vol-slider-wrap {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.vol-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, .12);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-d));
    border: 2px solid var(--gold-l);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(212, 160, 23, .4);
}

.vol-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-d));
    border: 2px solid var(--gold-l);
    cursor: pointer;
}

.vol-slider::-webkit-slider-runnable-track {
    height: 4px;
    border-radius: 2px;
}

.vol-value {
    font-size: .75rem;
    color: var(--gold-l);
    font-weight: 700;
    min-width: 30px;
    text-align: center;
}

/* ===== أنماط سؤال الترتيب ===== */
.ordering-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.order-hint,
.match-hint {
    color: var(--gold-l);
    font-size: 0.9rem;
    font-weight: 600;
    opacity: 0.8;
    text-align: center;
}

.order-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 400px;
}

.order-slot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 2px dashed rgba(212, 160, 23, 0.3);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    min-height: 48px;
    transition: all 0.3s ease;
}

.order-slot.filled {
    border-style: solid;
    border-color: rgba(212, 160, 23, 0.5);
    background: rgba(212, 160, 23, 0.08);
}

.order-slot.correct {
    border-color: var(--green-l) !important;
    background: rgba(76, 175, 80, 0.15) !important;
}

.order-slot.wrong {
    border-color: var(--red) !important;
    background: rgba(229, 57, 53, 0.15) !important;
}

.slot-num {
    background: rgba(212, 160, 23, 0.2);
    color: var(--gold-l);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.slot-text {
    font-weight: 600;
    color: var(--text);
}

.order-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.order-item {
    padding: 10px 18px;
    border-radius: 12px;
    background: rgba(122, 58, 237, 0.12);
    border: 1.5px solid rgba(167, 139, 250, 0.3);
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.25s ease;
}

.order-item:hover:not(.used) {
    background: rgba(122, 58, 237, 0.25);
    border-color: var(--purple-l);
    transform: translateY(-2px);
}

.order-item:active:not(.used) {
    transform: scale(0.96);
}

.order-item.used {
    opacity: 0.25;
    pointer-events: none;
    transform: scale(0.92);
}

.order-reset {
    padding: 8px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text3);
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.order-reset:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* ===== أنماط سؤال أكمل الفراغ ===== */
.fillblank-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===== أنماط سؤال التوصيل ===== */
.matching-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.match-grid {
    display: flex;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.match-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    max-width: 200px;
}

.match-item {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.12);
    color: var(--text);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    text-align: center;
    transition: all 0.25s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.match-item:hover:not(.matched) {
    border-color: rgba(212, 160, 23, 0.5);
    background: rgba(212, 160, 23, 0.08);
}

.match-item.active {
    border-color: var(--gold) !important;
    background: rgba(212, 160, 23, 0.15) !important;
    box-shadow: 0 0 12px rgba(212, 160, 23, 0.3);
}

.match-item.matched {
    opacity: 0.5;
    pointer-events: none;
    border-color: var(--blue-l);
    background: rgba(66, 165, 245, 0.1);
}

.match-item.correct {
    opacity: 1 !important;
    border-color: var(--green-l) !important;
    background: rgba(76, 175, 80, 0.15) !important;
}

.match-item.wrong {
    opacity: 1 !important;
    border-color: var(--red) !important;
    background: rgba(229, 57, 53, 0.15) !important;
}

.match-item-right {
    border-color: rgba(122, 58, 237, 0.3);
    background: rgba(122, 58, 237, 0.08);
}

.match-item-left {
    border-color: rgba(13, 148, 136, 0.3);
    background: rgba(13, 148, 136, 0.08);
}

/* تفاصيل المستوى */
.level-detail {
    font-size: 0.75rem;
    color: var(--text3);
    font-weight: 500;
}

@media (max-width: 500px) {
    .order-item {
        padding: 8px 14px;
        font-size: 0.88rem;
    }

    .match-grid {
        gap: 8px;
    }

    .match-item {
        padding: 8px 10px;
        font-size: 0.82rem;
        min-height: 38px;
    }

    .match-column {
        max-width: 160px;
    }
}

/* ===== زر إبلاغ عن خطأ في بطاقة الشرح ===== */
.btn-report-error {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid rgba(255, 152, 0, 0.3);
    color: #ff9800;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-report-error:hover {
    background: rgba(255, 152, 0, 0.1);
    border-color: rgba(255, 152, 0, 0.5);
}
.btn-report-error i {
    font-size: 0.72rem;
}

/* ===== نافذة الإبلاغ ===== */
.report-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.report-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    animation: reportIn 0.3s ease;
}
@keyframes reportIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.report-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
}
.report-header-icon {
    background: rgba(255,152,0,0.15);
    color: #ff9800;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.report-header h3 {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}
.btn-close-report {
    background: rgba(255,255,255,0.05);
    border: none;
    color: var(--text3);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-close-report:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text);
}
.report-body {
    padding: 16px 20px;
}
.report-question-preview {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--text2);
    margin-bottom: 14px;
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
}
.report-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 8px;
}
.report-reasons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}
.report-reason-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text2);
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: right;
}
.report-reason-btn:hover {
    background: rgba(255,152,0,0.08);
    border-color: rgba(255,152,0,0.2);
}
.report-reason-btn.selected {
    background: rgba(255,152,0,0.12);
    border-color: rgba(255,152,0,0.4);
    color: #ff9800;
}
.report-reason-btn i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}
.report-textarea {
    width: 100%;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 14px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    resize: none;
    outline: none;
    direction: rtl;
    transition: border-color 0.2s;
}
.report-textarea:focus {
    border-color: rgba(255,152,0,0.4);
}
.report-textarea::placeholder {
    color: var(--text3);
}
.report-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--border);
}
.report-footer .btn {
    flex: 1;
    justify-content: center;
}
.report-footer .btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
/* رسالة نجاح البلاغ */
.report-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 30px 20px;
    text-align: center;
}
.report-success-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(76,175,80,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #4caf50;
}
.report-success h4 {
    font-size: 1.05rem;
    color: var(--text);
}
.report-success p {
    font-size: 0.82rem;
    color: var(--text3);
}

/* ========================================
   Feature 1: مراجعة الأخطاء
======================================== */
#screen-review {
    background: linear-gradient(180deg, #050520, #0a0a3a);
}

.review-topbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    background: rgba(0, 0, 0, .3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.review-topbar-title {
    flex: 1;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-l);
}

.review-count {
    font-size: .8rem;
    color: var(--red-l);
    background: rgba(229, 57, 53, .15);
    padding: .25rem .7rem;
    border-radius: 50px;
    font-weight: 600;
}

.review-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.review-scroll::-webkit-scrollbar { width: 4px }
.review-scroll::-webkit-scrollbar-thumb { background: rgba(212,160,23,.2); border-radius: 2px }

.review-cards {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    max-width: 500px;
    margin: 0 auto;
}

.review-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    animation: fadeIn .4s ease-out;
}

.review-card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
}

.review-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(229, 57, 53, .2);
    color: var(--red-l);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.review-cat {
    font-size: .75rem;
    color: var(--text3);
}

.review-question {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: .7rem;
    color: var(--text);
}

.review-answers {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .6rem;
}

.review-answer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .5rem .8rem;
    border-radius: 10px;
    font-size: .85rem;
}

.review-answer-label {
    font-size: .7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.review-answer-text {
    font-weight: 600;
    font-size: .9rem;
}

.review-wrong {
    background: rgba(229, 57, 53, .1);
    border: 1px solid rgba(229, 57, 53, .25);
}

.review-wrong .review-answer-label { color: var(--red-l); }
.review-wrong .review-answer-text { color: var(--red-l); }

.review-correct {
    background: rgba(76, 175, 80, .1);
    border: 1px solid rgba(76, 175, 80, .25);
}

.review-correct .review-answer-label { color: var(--green-l); }
.review-correct .review-answer-text { color: var(--green-l); }

.review-explanation {
    font-size: .8rem;
    color: var(--text2);
    line-height: 1.6;
    padding: .5rem .7rem;
    background: rgba(212, 160, 23, .06);
    border-radius: 8px;
    border-right: 3px solid var(--gold);
}

.review-explanation i {
    color: var(--gold);
    margin-left: 4px;
}

/* ========================================
   Feature 2: التحدي اليومي
======================================== */
.btn-daily-challenge {
    display: flex;
    align-items: center;
    gap: .6rem;
    width: 100%;
    padding: .55rem 1rem;
    border-radius: 12px;
    border: 1.5px solid rgba(76, 175, 80, .3);
    background: linear-gradient(135deg, rgba(76, 175, 80, .08), rgba(212, 160, 23, .08));
    color: var(--text);
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    cursor: pointer;
    transition: all .3s;
    text-align: right;
}

.btn-daily-challenge:hover {
    border-color: rgba(76, 175, 80, .5);
    background: linear-gradient(135deg, rgba(76, 175, 80, .15), rgba(212, 160, 23, .12));
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(76, 175, 80, .2);
}

.btn-daily-challenge:active {
    transform: scale(.98);
}

.daily-icon {
    font-size: 1.2rem;
    color: var(--gold);
    flex-shrink: 0;
}

.daily-text {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.daily-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--gold-l);
}

.daily-streak {
    font-size: .75rem;
    color: var(--green-l);
    font-weight: 600;
}

.daily-streak i {
    color: #ff6b6b;
}

#screen-daily {
    background: linear-gradient(180deg, #050520, #0a0a3a);
}

.daily-topbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    background: rgba(0, 0, 0, .3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.daily-topbar-title {
    flex: 1;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-l);
}

.daily-date {
    font-size: .8rem;
    color: var(--text3);
    background: rgba(255, 255, 255, .05);
    padding: .25rem .7rem;
    border-radius: 50px;
}

.daily-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.daily-played-card,
.daily-result-card {
    text-align: center;
    max-width: 380px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
    animation: fadeIn .5s ease-out;
}

.daily-played-icon,
.daily-result-icon {
    font-size: 3.5rem;
    color: var(--green-l);
    filter: drop-shadow(0 0 20px rgba(76,175,80,.4));
}

.daily-played-title,
.daily-result-title {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold-l);
}

.daily-played-sub,
.daily-result-sub {
    font-size: .9rem;
    color: var(--text2);
}

.daily-result-score {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold-l);
    font-family: 'Tajawal', sans-serif;
}

.daily-stats-row {
    display: flex;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin: .5rem 0;
}

.daily-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    padding: .7rem 1rem;
    background: rgba(212, 160, 23, 0.05);
    border: 1px solid rgba(212, 160, 23, 0.12);
    border-radius: 12px;
    flex: 1;
    min-width: 85px;
}

.daily-stat-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gold-l);
}

.daily-stat-label {
    font-size: .65rem;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 4px;
}

.daily-stat-label i {
    font-size: .6rem;
}

/* ========================================
   Feature 3: وضع التدريب السريع
======================================== */
.practice-section {
    padding: 1rem 0;
    margin-top: .5rem;
    border-top: 1px solid rgba(212, 160, 23, .1);
}

.practice-btn {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .8rem 1.2rem;
    border-color: rgba(122, 58, 237, .3);
    color: var(--purple-l);
}

.practice-btn:hover {
    background: rgba(122, 58, 237, .1);
    border-color: rgba(122, 58, 237, .5);
}

.practice-btn i {
    font-size: 1.2rem;
}

.practice-desc {
    font-size: .7rem;
    color: var(--text3);
    font-weight: 400;
}

/* Practice mode - hide timer and score */
#screen-game.practice-mode .timer-container {
    display: none !important;
}

#screen-game.practice-mode .game-score-live {
    visibility: hidden;
}

#screen-game.practice-mode .streak-display {
    display: none !important;
}

/* ========================================
   Feature 4: إحصائياتي
======================================== */
#screen-stats {
    background: linear-gradient(180deg, #050520, #0a0a3a);
}

.stats-topbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    background: rgba(0, 0, 0, .3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.stats-topbar-title {
    flex: 1;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-l);
}

.stats-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.stats-scroll::-webkit-scrollbar { width: 4px }
.stats-scroll::-webkit-scrollbar-thumb { background: rgba(212,160,23,.2); border-radius: 2px }

.stats-content {
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Empty state */
.stats-empty {
    text-align: center;
    padding: 3rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
}

.stats-empty-icon {
    font-size: 3rem;
    color: var(--text3);
    opacity: .4;
}

.stats-empty h3 {
    font-size: 1.1rem;
    color: var(--text2);
}

.stats-empty p {
    font-size: .85rem;
    color: var(--text3);
}

/* Overview card */
.stats-overview-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.stats-circle-wrap {
    position: relative;
    width: 120px;
    height: 120px;
}

.stats-circle-svg {
    width: 100%;
    height: 100%;
}

.stats-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.stats-circle-num {
    font-family: 'Tajawal', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--gold-l);
    line-height: 1;
}

.stats-circle-label {
    font-size: .6rem;
    color: var(--text3);
    font-weight: 500;
}

.stats-summary-row {
    display: flex;
    gap: 1.5rem;
    text-align: center;
}

.stats-summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stats-summary-num {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.stats-summary-label {
    font-size: .7rem;
    color: var(--text3);
}

/* Highlights */
.stats-highlights {
    display: flex;
    gap: .6rem;
}

.stats-highlight-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    padding: .8rem .6rem;
    border-radius: var(--radius);
    text-align: center;
}

.stats-highlight-card i {
    font-size: 1.2rem;
}

.stats-highlight-label {
    font-size: .65rem;
    font-weight: 600;
    opacity: .7;
}

.stats-highlight-cat {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text);
}

.stats-highlight-pct {
    font-size: 1.1rem;
    font-weight: 900;
}

.stats-best {
    background: rgba(76, 175, 80, .1);
    border: 1px solid rgba(76, 175, 80, .25);
}

.stats-best i { color: var(--gold); }
.stats-best .stats-highlight-label { color: var(--green-l); }
.stats-best .stats-highlight-pct { color: var(--green-l); }

.stats-worst {
    background: rgba(229, 57, 53, .08);
    border: 1px solid rgba(229, 57, 53, .2);
}

.stats-worst i { color: var(--red-l); }
.stats-worst .stats-highlight-label { color: var(--red-l); }
.stats-worst .stats-highlight-pct { color: var(--red-l); }

/* Section title */
.stats-section-title {
    font-family: 'Tajawal', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .3rem;
}

.stats-section-title i {
    color: var(--gold);
    font-size: .85rem;
}

/* Category bars */
.stats-bars {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.stats-bar-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .7rem .9rem;
}

.stats-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: .4rem;
}

.stats-bar-cat {
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
}

.stats-bar-info {
    font-size: .72rem;
    color: var(--text3);
    font-weight: 600;
}

.stats-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, .06);
    border-radius: 4px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width .8s ease;
    min-width: 2px;
}

/* Levels header actions */
.levels-header-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.header-action-btn {
    background: rgba(212, 160, 23, .1) !important;
    border: 1px solid rgba(212, 160, 23, .25) !important;
    color: var(--gold) !important;
}

.header-action-btn:hover {
    background: rgba(212, 160, 23, .2) !important;
    border-color: var(--gold) !important;
}

/* ===== responsive for new features ===== */
@media(max-width:400px) {
    .daily-stat-item {
        min-width: 70px;
        padding: .5rem .6rem;
    }
    .daily-stat-num { font-size: 1.1rem; }
    .stats-highlights { flex-direction: column; }
    .stats-circle-num { font-size: 1.5rem; }
}

/* ========================================
   Feature 5: نظام المفضلة
======================================== */

/* زر المفضلة في بطاقة الشرح */
.btn-favorite {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(212, 160, 23, 0.3);
    color: var(--text3);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-favorite:hover {
    background: rgba(212, 160, 23, 0.1);
    border-color: rgba(212, 160, 23, 0.5);
    color: var(--gold);
}

.btn-favorite.is-fav {
    background: rgba(212, 160, 23, 0.15);
    border-color: var(--gold);
    color: var(--gold);
}

.btn-favorite.is-fav:hover {
    background: rgba(212, 160, 23, 0.25);
}

/* شاشة المفضلة */
#screen-favorites {
    background: linear-gradient(180deg, #050520, #0a0a3a);
}

.favorites-topbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    background: rgba(0, 0, 0, .3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.favorites-topbar-title {
    flex: 1;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-l);
}

.favorites-count {
    font-size: .8rem;
    color: var(--gold);
    background: rgba(212, 160, 23, .12);
    padding: .25rem .7rem;
    border-radius: 50px;
    font-weight: 600;
}

.favorites-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.favorites-scroll::-webkit-scrollbar { width: 4px }
.favorites-scroll::-webkit-scrollbar-thumb { background: rgba(212,160,23,.2); border-radius: 2px }

.favorites-cards {
    display: flex;
    flex-direction: column;
    gap: .8rem;
    max-width: 500px;
    margin: 0 auto;
}

.fav-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    animation: fadeIn .4s ease-out;
}

.fav-card-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
}

.fav-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(212, 160, 23, .15);
    color: var(--gold);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}

.fav-cat {
    font-size: .75rem;
    color: var(--text3);
    flex: 1;
}

.fav-remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(229, 57, 53, .1);
    color: var(--red-l);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .8rem;
    transition: all .2s;
}

.fav-remove-btn:hover {
    background: rgba(229, 57, 53, .25);
}

.fav-question {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: .7rem;
    color: var(--text);
}

.fav-answer {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: .5rem .8rem;
    border-radius: 10px;
    background: rgba(76, 175, 80, .1);
    border: 1px solid rgba(76, 175, 80, .25);
    margin-bottom: .6rem;
}

.fav-answer-label {
    font-size: .7rem;
    font-weight: 600;
    color: var(--green-l);
    display: flex;
    align-items: center;
    gap: 4px;
}

.fav-answer-text {
    font-weight: 600;
    font-size: .9rem;
    color: var(--green-l);
    line-height: 1.6;
}

.fav-explanation {
    font-size: .8rem;
    color: var(--text2);
    line-height: 1.6;
    padding: .5rem .7rem;
    background: rgba(212, 160, 23, .06);
    border-radius: 8px;
    border-right: 3px solid var(--gold);
}

.fav-explanation i {
    color: var(--gold);
    margin-left: 4px;
}

/* حالة فارغة */
.favorites-empty {
    text-align: center;
    padding: 3rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
}

.favorites-empty-icon {
    font-size: 3rem;
    color: var(--gold);
    opacity: .3;
}

.favorites-empty h3 {
    font-size: 1.1rem;
    color: var(--text2);
}

.favorites-empty p {
    font-size: .85rem;
    color: var(--text3);
}

/* ========================================
   Feature 6: لوحة الشرف
======================================== */
#screen-leaderboard {
    background: linear-gradient(180deg, #050520, #0a0a3a);
}

.lb-topbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .8rem 1rem;
    background: rgba(0, 0, 0, .3);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.lb-topbar-title {
    flex: 1;
    font-family: 'Tajawal', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-l);
}

.lb-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.lb-scroll::-webkit-scrollbar { width: 4px }
.lb-scroll::-webkit-scrollbar-thumb { background: rgba(212,160,23,.2); border-radius: 2px }

.lb-list {
    max-width: 440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.lb-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .8rem 1rem;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all .3s;
    animation: fadeIn .4s ease-out;
}

.lb-item.rank-gold {
    background: linear-gradient(135deg, rgba(212, 160, 23, .12), rgba(212, 160, 23, .04));
    border-color: rgba(212, 160, 23, .4);
    box-shadow: 0 0 20px rgba(212, 160, 23, .1);
}

.lb-item.rank-silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, .1), rgba(192, 192, 192, .03));
    border-color: rgba(192, 192, 192, .35);
}

.lb-item.rank-bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, .1), rgba(205, 127, 50, .03));
    border-color: rgba(205, 127, 50, .3);
}

.lb-rank {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    flex-shrink: 0;
    color: var(--text3);
    background: rgba(255, 255, 255, .05);
}

.rank-gold .lb-rank {
    background: linear-gradient(135deg, #FFD700, #B8860B);
    color: #1a1000;
    font-size: 1.2rem;
    box-shadow: 0 0 15px rgba(212, 160, 23, .4);
}

.rank-silver .lb-rank {
    background: linear-gradient(135deg, #E0E0E0, #9E9E9E);
    color: #333;
    font-size: 1.1rem;
}

.rank-bronze .lb-rank {
    background: linear-gradient(135deg, #CD7F32, #8B5A2B);
    color: #fff;
    font-size: 1rem;
}

.lb-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.lb-name {
    font-weight: 700;
    font-size: .95rem;
    color: var(--text);
}

.lb-details {
    font-size: .72rem;
    color: var(--text3);
    display: flex;
    align-items: center;
    gap: 6px;
}

.lb-score {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.lb-score-num {
    font-size: 1.2rem;
    font-weight: 900;
    color: var(--gold-l);
}

.lb-score-label {
    font-size: .6rem;
    color: var(--text3);
}

/* حالة فارغة */
.leaderboard-empty {
    text-align: center;
    padding: 3rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .8rem;
}

.leaderboard-empty-icon {
    font-size: 3rem;
    color: var(--gold);
    opacity: .3;
}

.leaderboard-empty h3 {
    font-size: 1.1rem;
    color: var(--text2);
}

.leaderboard-empty p {
    font-size: .85rem;
    color: var(--text3);
}

/* زر لوحة الشرف في الصفحة الرئيسية */
.btn-leaderboard-start {
    border-color: rgba(212, 160, 23, .3);
    color: var(--gold);
    font-size: .9rem;
}

.btn-leaderboard-start:hover {
    background: rgba(212, 160, 23, .1);
    border-color: var(--gold);
}

/* ========================================
   Feature 7: مشاركة النتيجة المحسّنة
======================================== */
#btn-share-level {
    border-color: rgba(76, 175, 80, .3);
    color: var(--green-l);
}

#btn-share-level:hover {
    background: rgba(76, 175, 80, .1);
    border-color: rgba(76, 175, 80, .5);
}

/* توست نسخ النتيجة */
.share-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(76, 175, 80, .95);
    color: white;
    padding: .6rem 1.5rem;
    border-radius: 50px;
    font-size: .9rem;
    font-weight: 600;
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: toastIn .3s ease-out, toastOut .3s ease-in 2s forwards;
    box-shadow: 0 4px 20px rgba(76, 175, 80, .4);
}

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toastOut {
    from { transform: translateX(-50%) translateY(0); opacity: 1; }
    to { transform: translateX(-50%) translateY(20px); opacity: 0; }
}

/* ========================================
   Feature 8: الوضع الفاتح
======================================== */

/* زر تبديل السمة */
.theme-toggle-btn {
    position: fixed;
    bottom: 1rem;
    left: 6rem;
    z-index: 999;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all .3s;
    color: var(--gold);
}

.theme-toggle-btn:hover {
    background: var(--card2);
    transform: scale(1.1);
}

.theme-toggle-btn:active {
    transform: scale(.9);
}

/* ===== الوضع الفاتح ===== */
body.light-mode {
    --bg: #f5f3ef;
    --bg2: #eae7e0;
    --bg3: #ddd9d0;
    --text: #1a1a2e;
    --text2: #3d3d5c;
    --text3: #6b6b8a;
    --card: rgba(255, 255, 255, 0.7);
    --card2: rgba(255, 255, 255, 0.85);
    --border: rgba(212, 160, 23, 0.2);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    /* ألوان ذهبية داكنة للقراءة على خلفية فاتحة */
    --gold-l: #8B6914;
    --gold: #7A5800;
    --gold-d: #5C4200;
    /* ألوان فرعية مناسبة للوضع الفاتح */
    --green-l: #1B7A2E;
    --blue-l: #1565C0;
    --red-l: #C62828;
    --purple-l: #6D28D9;
}

body.light-mode #screen-start {
    background: linear-gradient(160deg, #f5f3ef 0%, #eae7e0 40%, #f0ebe3 70%, #f5f3ef 100%);
}

body.light-mode .stars-bg {
    background-image:
        radial-gradient(2px 2px at 20% 30%, rgba(212,160,23,.15), transparent),
        radial-gradient(2px 2px at 80% 10%, rgba(212,160,23,.1), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(212,160,23,.2), transparent),
        radial-gradient(1px 1px at 10% 80%, rgba(212,160,23,.1), transparent),
        radial-gradient(2px 2px at 70% 60%, rgba(212,160,23,.08), transparent),
        radial-gradient(1px 1px at 40% 20%, rgba(212,160,23,.15), transparent),
        radial-gradient(1px 1px at 90% 90%, rgba(212,160,23,.1), transparent),
        radial-gradient(2px 2px at 30% 70%, rgba(212,160,23,.05), transparent);
}

body.light-mode .stars-bg::after {
    opacity: 0.15;
}

body.light-mode #screen-levels {
    background: linear-gradient(180deg, #eae7e0, #f0ebe3, #f5f3ef);
}

body.light-mode #screen-game {
    background: linear-gradient(180deg, #eee9e0, #f5f0e8);
}

body.light-mode #screen-results {
    background: linear-gradient(180deg, #eae7e0, #f0ebe3);
}

body.light-mode #screen-prize {
    background: linear-gradient(180deg, #f0ebe3, #eae7e0, #f0ebe3);
}

body.light-mode #screen-review,
body.light-mode #screen-daily,
body.light-mode #screen-stats,
body.light-mode #screen-favorites,
body.light-mode #screen-leaderboard {
    background: linear-gradient(180deg, #eae7e0, #f0ebe3);
}

/* تأثير الزجاج في الوضع الفاتح */
body.light-mode .form-card {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(212, 160, 23, 0.2);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

body.light-mode .input-group input {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, .1);
    color: #1a1a2e;
}

body.light-mode .input-group input::placeholder {
    color: #999;
}

body.light-mode .input-group input:focus {
    border-color: var(--gold);
    background: rgba(255, 255, 255, 0.95);
}

/* أزرار الفئة العمرية والجنس */
body.light-mode .age-btn,
body.light-mode .gender-btn {
    border-color: rgba(0, 0, 0, .08);
    background: rgba(255, 255, 255, .5);
}

body.light-mode .age-btn:hover,
body.light-mode .gender-btn:hover {
    background: rgba(212, 160, 23, .08);
}

body.light-mode .gender-btn[data-gender="M"] {
    background: rgba(33, 150, 243, 0.08);
    border-color: rgba(33, 150, 243, 0.2);
}

body.light-mode .gender-btn[data-gender="F"] {
    background: rgba(156, 39, 176, 0.08);
    border-color: rgba(156, 39, 176, 0.2);
}

/* شريط اللعب العلوي */
body.light-mode .game-topbar {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 160, 23, .15);
}

body.light-mode .levels-header {
    background: rgba(255, 255, 255, .6);
}

body.light-mode .levels-top-banner {
    background: linear-gradient(135deg, rgba(212, 160, 23, .08), rgba(212, 160, 23, .02));
    border-bottom-color: rgba(212, 160, 23, .15);
}

/* بطاقة السؤال */
body.light-mode .question-card {
    background: rgba(255, 255, 255, .7);
    border-color: rgba(212, 160, 23, .15);
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
}

/* الخيارات */
body.light-mode .option-btn {
    background: rgba(255, 255, 255, .7);
    border-color: rgba(0, 0, 0, .08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

body.light-mode .option-btn:hover {
    background: rgba(255, 255, 255, .9);
    border-color: rgba(0, 0, 0, .15);
}

body.light-mode .option-btn .option-letter {
    background: rgba(212, 160, 23, .1);
    color: var(--gold-d);
}

/* صح أم خطأ */
body.light-mode .tf-btn {
    background: rgba(255, 255, 255, .7);
    border-color: rgba(0, 0, 0, .08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

/* بطاقة الشرح */
body.light-mode .explanation-card {
    background: rgba(255, 255, 255, .97);
    border-top-color: rgba(212, 160, 23, .2);
}

/* أزرار أسفل الخيارات */
body.light-mode .game-action-btn {
    background: rgba(255, 255, 255, .5);
    border-color: rgba(0, 0, 0, .1);
}

/* النتائج */
body.light-mode .stat-box {
    background: rgba(255, 255, 255, .6);
    border-color: rgba(212, 160, 23, .15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
}

/* البطاقات العامة */
body.light-mode .review-card,
body.light-mode .fav-card,
body.light-mode .lb-item,
body.light-mode .stats-bar-item,
body.light-mode .stats-overview-card {
    background: rgba(255, 255, 255, .7);
    border-color: rgba(212, 160, 23, .15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .04);
}

/* شريط المستوى */
body.light-mode .level-circle.locked {
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .1);
}

body.light-mode .world-levels::before {
    background: rgba(0, 0, 0, .06);
}

body.light-mode .path-connector {
    background: rgba(0, 0, 0, .06);
}

/* النوافذ المنبثقة */
body.light-mode .instr-overlay,
body.light-mode .audio-settings-overlay {
    background: rgba(245, 243, 239, .92);
}

body.light-mode .instr-card {
    background: linear-gradient(160deg, #fff, #f8f6f2);
    border-color: rgba(212, 160, 23, .2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .1);
}

body.light-mode .audio-settings-card {
    background: linear-gradient(160deg, #fff, #f8f6f2);
    border-color: rgba(212, 160, 23, .2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .1);
}

body.light-mode .instr-item {
    background: rgba(0, 0, 0, .02);
    border-color: rgba(0, 0, 0, .06);
}

body.light-mode .instr-warning {
    background: rgba(212, 160, 23, .06);
    border-color: rgba(212, 160, 23, .2);
}

body.light-mode .report-overlay {
    background: rgba(245, 243, 239, .85);
}

body.light-mode .report-card {
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .1);
}

/* الأزرار الثابتة */
body.light-mode .sound-btn,
body.light-mode .settings-btn,
body.light-mode .theme-toggle-btn {
    background: rgba(255, 255, 255, .8);
    border-color: rgba(212, 160, 23, .2);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
    color: var(--gold-d);
}

body.light-mode .sound-btn:hover,
body.light-mode .settings-btn:hover,
body.light-mode .theme-toggle-btn:hover {
    background: rgba(255, 255, 255, .95);
}

/* رابط المذاكرة وأزرار outline */
body.light-mode .btn-outline {
    border-color: rgba(212, 160, 23, .35);
}

body.light-mode .btn-outline:hover {
    background: rgba(212, 160, 23, .08);
}

/* بطاقات الميزات */
body.light-mode .feature-card {
    background: rgba(255, 255, 255, .5);
    border-color: rgba(212, 160, 23, .15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .03);
}

/* شهادة التقدير */
body.light-mode .cert-card {
    background: rgba(255, 255, 255, .7);
    border-color: rgba(212, 160, 23, .25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

/* إحصائيات نهائية */
body.light-mode .final-stat {
    background: rgba(255, 255, 255, .5);
    border-color: rgba(212, 160, 23, .15);
}

/* التحدي اليومي */
body.light-mode .btn-daily-challenge {
    background: linear-gradient(135deg, rgba(76, 175, 80, .06), rgba(212, 160, 23, .06));
    border-color: rgba(76, 175, 80, .25);
}

body.light-mode .daily-stat-item {
    background: rgba(255, 255, 255, .5);
    border-color: rgba(212, 160, 23, .12);
}

/* التدريب */
body.light-mode .practice-btn {
    border-color: rgba(122, 58, 237, .2);
}

body.light-mode .practice-btn:hover {
    background: rgba(122, 58, 237, .06);
}

/* إعدادات الصوت */
body.light-mode .mute-toggle-row {
    background: rgba(0, 0, 0, .02);
    border-color: rgba(0, 0, 0, .06);
}

body.light-mode .track-item {
    background: rgba(255, 255, 255, .6);
    border-color: rgba(0, 0, 0, .08);
}

body.light-mode .track-item.active {
    background: rgba(212, 160, 23, .1);
    border-color: var(--gold);
}

/* الترتيب */
body.light-mode .order-slot {
    background: rgba(255, 255, 255, .5);
    border-color: rgba(139, 105, 20, .35);
}

body.light-mode .order-item {
    background: rgba(109, 40, 217, 0.1);
    border-color: rgba(109, 40, 217, 0.35);
    color: var(--text);
}

body.light-mode .order-slot.filled {
    border-color: rgba(139, 105, 20, .55);
    background: rgba(180, 130, 10, .08);
}

body.light-mode .slot-num {
    background: rgba(139, 105, 20, .15);
    color: #7A5800;
}

body.light-mode .order-hint,
body.light-mode .match-hint {
    color: #7A5800;
}

/* التوصيل */
body.light-mode .match-item {
    background: rgba(255, 255, 255, .6);
    border-color: rgba(0, 0, 0, .1);
}

body.light-mode .match-item-right {
    border-color: rgba(109, 40, 217, 0.3);
    background: rgba(109, 40, 217, 0.06);
}

body.light-mode .match-item-left {
    border-color: rgba(13, 148, 136, 0.3);
    background: rgba(13, 148, 136, 0.06);
}

/* شريط التقدم */
body.light-mode .progress-bar-mini {
    background: rgba(0, 0, 0, .06);
}

body.light-mode .stats-bar-track {
    background: rgba(0, 0, 0, .05);
}

/* لوحة الشرف في الوضع الفاتح */
body.light-mode .lb-item.rank-gold {
    background: linear-gradient(135deg, rgba(212, 160, 23, .08), rgba(255, 255, 255, .7));
    border-color: rgba(212, 160, 23, .35);
}

body.light-mode .lb-item.rank-silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, .08), rgba(255, 255, 255, .7));
    border-color: rgba(192, 192, 192, .3);
}

body.light-mode .lb-item.rank-bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, .08), rgba(255, 255, 255, .7));
    border-color: rgba(205, 127, 50, .25);
}

body.light-mode .lb-rank {
    background: rgba(0, 0, 0, .04);
}

/* نقاط متحركة */
body.light-mode .points-popup {
    color: var(--gold-d);
    text-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* شريط أعلى الشاشات الفرعية */
body.light-mode .review-topbar,
body.light-mode .daily-topbar,
body.light-mode .stats-topbar,
body.light-mode .favorites-topbar,
body.light-mode .lb-topbar {
    background: rgba(255, 255, 255, .6);
    border-bottom-color: rgba(212, 160, 23, .15);
}

/* btn-icon في الوضع الفاتح */
body.light-mode .btn-icon {
    background: rgba(255, 255, 255, .6);
    color: #1a1a2e;
}

body.light-mode .btn-icon:hover {
    background: rgba(255, 255, 255, .9);
}

/* header action btn */
body.light-mode .header-action-btn {
    background: rgba(212, 160, 23, .08) !important;
    border-color: rgba(212, 160, 23, .2) !important;
}

/* روابط الفوتر */
body.light-mode .start-nav-links {
    border-top-color: rgba(0, 0, 0, .06);
}

body.light-mode .start-nav-links a {
    color: #6b6b8a;
}

body.light-mode .start-nav-links a:hover {
    color: var(--gold-d);
}

/* تأثير المؤقت */
body.light-mode .timer-bg {
    stroke: rgba(0, 0, 0, .06);
}

/* vol slider */
body.light-mode .vol-slider {
    background: rgba(0, 0, 0, .08);
}

/* report elements */
body.light-mode .report-question-preview {
    background: rgba(0, 0, 0, .02);
    border-color: rgba(0, 0, 0, .06);
}

body.light-mode .report-reason-btn {
    background: rgba(0, 0, 0, .02);
    border-color: rgba(0, 0, 0, .06);
}

body.light-mode .report-textarea {
    background: rgba(0, 0, 0, .02);
    border-color: rgba(0, 0, 0, .08);
    color: #1a1a2e;
}

body.light-mode .report-textarea::placeholder {
    color: #999;
}

/* order reset */
body.light-mode .order-reset {
    background: rgba(0, 0, 0, .03);
    border-color: rgba(0, 0, 0, .08);
}

/* stats highlights */
body.light-mode .stats-best {
    background: rgba(76, 175, 80, .06);
    border-color: rgba(76, 175, 80, .2);
}

body.light-mode .stats-worst {
    background: rgba(229, 57, 53, .05);
    border-color: rgba(229, 57, 53, .15);
}

/* btn-gold في الوضع الفاتح: خلفية ذهبية ساطعة مع نص داكن */
body.light-mode .btn-gold {
    background: linear-gradient(135deg, #F0C840, #D4A017);
    color: #1a1000;
    box-shadow: 0 4px 20px rgba(180, 130, 10, .25);
}

/* عناصر تحتاج خلفيات ذهبية ساطعة في الوضع الفاتح */
body.light-mode .progress-fill-mini {
    background: linear-gradient(90deg, #D4A017, #E8B830);
}

body.light-mode .level-circle.current {
    background: linear-gradient(135deg, #D4A017, #B8860B);
    border-color: #C5920A;
    box-shadow: 0 0 20px rgba(180, 130, 10, .35);
}

body.light-mode .title,
body.light-mode .prize-title {
    filter: drop-shadow(0 1px 4px rgba(120, 80, 0, 0.15));
}

/* شريط التمرير في الوضع الفاتح */
body.light-mode .vol-slider::-webkit-slider-thumb {
    background: linear-gradient(135deg, #D4A017, #B8860B);
    border-color: #C5920A;
    box-shadow: 0 0 6px rgba(180, 130, 10, .3);
}

body.light-mode .vol-slider::-moz-range-thumb {
    background: linear-gradient(135deg, #D4A017, #B8860B);
    border-color: #C5920A;
}

/* خطوط زخرفية - ذهبي متوسط */
body.light-mode .form-card::before,
body.light-mode .cert-card::before,
body.light-mode .cert-card::after {
    background: linear-gradient(90deg, transparent, #C5920A, transparent);
}

/* بطاقة الشرح في الوضع الفاتح */
body.light-mode .explanation-answer {
    background: rgba(180, 130, 10, 0.1);
    border-color: rgba(180, 130, 10, 0.3);
}

/* أزرار الفعل (أظهر الإجابة) */
body.light-mode .action-reveal {
    color: #8B6914;
    border-color: rgba(139, 105, 20, .35);
}

body.light-mode .action-reveal:hover {
    background: rgba(139, 105, 20, .08);
    border-color: rgba(139, 105, 20, .5);
}

/* عناصر الترتيب - تحسين التباين */
body.light-mode .order-item:hover:not(.used) {
    background: rgba(109, 40, 217, 0.18);
    border-color: var(--purple-l);
}

/* confetti background */
body.light-mode .confetti {
    mix-blend-mode: multiply;
}