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

:root {
    --bg: #020b24;
    --bg2: #091a42;
    --bg3: #112d75;
    --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(17, 45, 117, 0.4);
    --card2: rgba(17, 45, 117, 0.7);
    --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), var(--gold-d));
    color: #1a1000;
    box-shadow: 0 4px 20px rgba(212, 160, 23, .4);
}

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

.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, #020b24 0%, #091a42 40%, #112d75 70%, #020b24 100%);
    align-items: center;
    justify-content: center;
}

.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;
}

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

    100% {
        opacity: 1
    }
}

.start-container {
    text-align: center;
    z-index: 2;
    padding: 1rem;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.logo-glow {
    position: relative;
    display: inline-block;
    padding: 10px;
}

.logo-icon {
    font-size: 5rem;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 30px rgba(212, 160, 23, .5));
    color: var(--gold-l);
}

.logo-rays {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 160, 23, .15) 0%, transparent 70%);
    animation: pulse 2s ease-in-out infinite;
}

@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: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold-l), var(--gold), var(--gold-l));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 0.9rem;
    color: var(--text2);
    margin-bottom: 0px;
}

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

.input-group label {
    display: block;
    font-size: .85rem;
    color: var(--text2);
    margin-bottom: .3rem
}

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

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

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

#btn-start {
    width: 100%;
    margin-bottom: .2rem;
    padding: 0.8rem 2.5rem;
}

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

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

.start-features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 5px;
    margin-bottom: 0px;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .8rem;
    color: var(--text3);
    background: rgba(255, 255, 255, .03);
    padding: 4px 10px;
    border-radius: 20px;
}

.feature span {
    font-size: 1.2rem
}

.age-hint {
    display: block;
    font-size: .75rem;
    color: var(--gold-l);
    margin-top: .3rem;
    min-height: 1.2em;
    text-align: center;
}

.age-badge {
    display: inline-block;
    padding: .3rem 1.2rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, .05);
    font-size: .8rem;
    color: var(--text3);
}

.start-categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .4rem;
    margin-top: .5rem;
}

.start-categories span {
    font-size: .7rem;
    padding: .2rem .6rem;
    border-radius: 50px;
    background: rgba(255, 255, 255, .05);
    color: var(--text3);
}

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

.age-group label {
    display: block;
    font-size: .85rem;
    color: var(--text2);
    margin-bottom: .3rem;
    text-align: center
}

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

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

.age-btn,
.gender-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .1rem;
    padding: .5rem .2rem;
    border-radius: var(--radius);
    border: 2px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .04);
    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: .8rem .2rem;
}

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

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

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

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

.age-emoji,
.gender-emoji {
    font-size: 1.5rem;
    line-height: 1
}

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

.age-level,
.gender-label {
    font-size: .65rem;
    color: var(--text3);
    font-weight: 500
}

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

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

    .age-btn {
        padding: .6rem .2rem
    }

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

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

/* ===== شاشة المستويات ===== */
#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-text {
    font-size: .95rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: var(--text2)
}

#btn-next-q {
    min-width: 180px
}

/* ===== شاشة النتائج ===== */
#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: center;
    overflow-y: auto;
}

.prize-container {
    text-align: center;
    padding: 2rem 1.5rem;
    max-width: 440px;
    width: 100%;
    position: relative
}

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

.prize-title {
    font-family: 'Amiri', serif;
    font-size: 2.2rem;
    background: linear-gradient(135deg, var(--gold-l), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: .5rem 0 .2rem;
}

.prize-subtitle {
    font-size: 1.1rem;
    color: var(--text2);
    margin-bottom: .5rem
}

.prize-desc {
    font-size: .9rem;
    color: var(--text3);
    margin-bottom: 1.5rem
}

.prize-card {
    background: linear-gradient(135deg, rgba(212, 160, 23, .1), rgba(212, 160, 23, .02));
    border: 2px solid var(--gold);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.prize-icon {
    font-size: 3rem;
    margin-bottom: .5rem
}

.prize-card h3 {
    color: var(--gold-l);
    margin-bottom: .5rem
}

.prize-card p {
    font-size: .9rem;
    color: var(--text2);
    margin-bottom: .8rem
}

.prize-code-box {
    background: rgba(0, 0, 0, .3);
    border-radius: var(--radius);
    padding: .8rem;
    margin: .8rem 0;
}

.code-label {
    display: block;
    font-size: .75rem;
    color: var(--text3);
    margin-bottom: .3rem
}

.prize-code {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 6px;
    color: var(--gold-l);
    font-family: monospace;
}

.prize-instructions {
    font-size: .8rem;
    color: var(--text3)
}

.final-stats {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap
}

.final-stat {
    padding: .5rem 1rem;
    border-radius: 50px;
    background: var(--card);
    font-size: .85rem;
}

#btn-share {
    width: 100%;
    margin-bottom: .7rem
}

/* الكونفتي */
.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: .8rem;
    color: var(--text3);
    margin-top: -4px;
    margin-bottom: 8px;
}

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

.start-nav-links a {
    color: var(--gold);
    text-decoration: none;
    font-size: .85rem;
    transition: color .2s;
}

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

.nav-sep {
    color: var(--text3);
    font-size: .7rem
}

/* ===== أزرار أسفل الخيارات ===== */
.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)
}

.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;
}